Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
竹天卫
tianjin-cement
Commits
a4a2de3f
Commit
a4a2de3f
authored
Sep 30, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产值总统计
parent
8dfe5395
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
216 additions
and
66 deletions
+216
-66
NonStandardValueController.java
...ement/business/controller/NonStandardValueController.java
+50
-51
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+16
-0
ProductionVo.java
...ava/cn/wise/sc/cement/business/model/vo/ProductionVo.java
+39
-0
INormProductionService.java
...se/sc/cement/business/service/INormProductionService.java
+3
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+16
-0
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+86
-11
PageUtil.java
...c/main/java/cn/wise/sc/cement/business/util/PageUtil.java
+6
-4
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NonStandardValueController.java
View file @
a4a2de3f
...
@@ -25,68 +25,67 @@ import java.util.List;
...
@@ -25,68 +25,67 @@ import java.util.List;
/**
/**
* <p>
* <p>
*
前端控制器
* 前端控制器
* </p>
* </p>
*
*
* @author wlb
* @author wlb
* @since 2020-09-23
* @since 2020-09-23
*/
*/
@Api
(
tags
=
"非标产值-非标产值"
)
@Api
(
tags
=
"非标产值-非标产值"
)
@RestController
@RestController
@RequestMapping
(
"/tcdri/nonestandard_value"
)
@RequestMapping
(
"/tcdri/nonestandard_value"
)
public
class
NonStandardValueController
{
public
class
NonStandardValueController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"NoneStandardValueController"
);
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"NoneStandardValueController"
);
@Autowired
@Autowired
private
INonStandardValueService
inonStandardValueService
;
private
INonStandardValueService
inonStandardValueService
;
@ApiOperation
(
value
=
"非标产值分页"
)
@ApiOperation
(
value
=
"非标产值分页"
)
@GetMapping
(
"/getPage"
)
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
Integer
userId
,
String
name
)
{
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
Integer
userId
,
String
name
)
{
try
{
try
{
return
inonStandardValueService
.
getPage
(
pageQuery
,
userId
,
name
);
return
inonStandardValueService
.
getPage
(
pageQuery
,
userId
,
name
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"非标产值分页列表{}"
,
e
);
log
.
debug
(
"非标产值分页列表{}"
,
e
);
}
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@GetMapping
(
"/user_id"
)
@GetMapping
(
"/user_id"
)
@ApiOperation
(
"非标产值统计"
)
@ApiOperation
(
"非标产值统计"
)
public
BaseResponse
nonValue
(
PageQuery
pageQuery
,
String
start
,
String
end
)
{
public
BaseResponse
nonValue
(
PageQuery
pageQuery
,
String
start
,
String
end
)
{
Date
startParse
=
DateUtil
.
parse
(
start
);
Date
startParse
=
DateUtil
.
parse
(
start
);
Date
endParse
=
DateUtil
.
parse
(
end
);
Date
endParse
=
DateUtil
.
parse
(
end
);
//将list拆分成分页
//将list拆分成分页
BaseResponse
<
List
<
NonStandardValue
>>
baseResponse
=
inonStandardValueService
.
nonValue
(
startParse
,
endParse
);
BaseResponse
<
List
<
NonStandardValue
>>
baseResponse
=
inonStandardValueService
.
nonValue
(
startParse
,
endParse
);
List
<
NonStandardValue
>
data
=
baseResponse
.
getData
();
List
<
NonStandardValue
>
data
=
baseResponse
.
getData
();
if
(
data
.
size
()
!=
0
)
{
if
(
data
.
size
()
!=
0
)
{
Page
<
NonStandardValue
>
rts
=
PageUtil
.
listConvertToPage
(
data
,
pageQuery
);
Page
<
NonStandardValue
>
rts
=
PageUtil
.
listConvertToPage
(
data
,
pageQuery
);
return
BaseResponse
.
okData
(
rts
);
return
BaseResponse
.
okData
(
rts
);
}
}
return
baseResponse
;
return
baseResponse
;
}
}
@ApiOperation
(
value
=
"获取所有已通过的非标产值"
)
@ApiOperation
(
value
=
"获取所有已通过的非标产值"
)
@GetMapping
(
"/getList"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
(
String
start
,
String
end
)
{
public
BaseResponse
getList
(
String
start
,
String
end
)
{
try
{
try
{
Date
startParse
=
DateUtil
.
parse
(
start
);
Date
startParse
=
DateUtil
.
parse
(
start
);
Date
endParse
=
DateUtil
.
parse
(
end
);
Date
endParse
=
DateUtil
.
parse
(
end
);
return
inonStandardValueService
.
getList
(
startParse
,
endParse
);
return
inonStandardValueService
.
getList
(
startParse
,
endParse
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取所有已通过的非标产值{}"
,
e
);
log
.
debug
(
"获取所有已通过的非标产值{}"
,
e
);
}
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@ApiOperation
(
"非标产值信息导出列表"
)
@ApiOperation
(
"非标产值信息导出列表"
)
@PostMapping
(
"/exportList"
)
@PostMapping
(
"/exportList"
)
public
void
exportList
(
Integer
status
,
String
filename
,
Integer
userId
,
String
name
,
HttpServletResponse
response
)
{
public
void
exportList
(
Integer
status
,
String
filename
,
Integer
userId
,
String
name
,
HttpServletResponse
response
)
{
try
{
try
{
inonStandardValueService
.
exportList
(
status
,
filename
,
userId
,
name
,
response
);
inonStandardValueService
.
exportList
(
status
,
filename
,
userId
,
name
,
response
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
debug
(
"非标产值信息导出列表{}"
,
e
);
log
.
debug
(
"非标产值信息导出列表{}"
,
e
);
}
}
}
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
a4a2de3f
...
@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.entity.NormProductionStatistics;
...
@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.entity.NormProductionStatistics;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
cn.wise.sc.cement.business.util.PageUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -25,6 +26,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -131,6 +133,20 @@ public class NormProductionController {
...
@@ -131,6 +133,20 @@ public class NormProductionController {
return
BaseResponse
.
okData
(
data
);
return
BaseResponse
.
okData
(
data
);
}
}
@GetMapping
(
"/total/production"
)
public
BaseResponse
production
(
PageQuery
pageQuery
,
String
name
,
String
start
,
String
end
)
{
Long
startTime
=
null
;
Long
endTime
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
)
&&
StrUtil
.
isNotBlank
(
end
))
{
startTime
=
DateUtil
.
parseDate
(
start
).
getTime
();
endTime
=
DateUtil
.
parseDate
(
end
).
getTime
();
}
List
<
ProductionVo
>
rts
=
iNormProductionService
.
production
(
name
,
startTime
,
endTime
);
return
BaseResponse
.
okData
(
PageUtil
.
listConvertToPage
(
rts
,
pageQuery
));
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/ProductionVo.java
0 → 100644
View file @
a4a2de3f
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description:
* @author: qh
* @create: 2020-09-30 14:16
**/
@Data
@ApiModel
(
"总产值统计"
)
public
class
ProductionVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
42L
;
/**
* 主键
*/
@ApiModelProperty
(
"用户id"
)
private
String
userId
;
@ApiModelProperty
(
"用户名"
)
private
String
userName
;
@ApiModelProperty
(
"账号"
)
private
String
account
;
@ApiModelProperty
(
"职位id"
)
private
Integer
positionId
;
@ApiModelProperty
(
"职位"
)
private
String
position
;
@ApiModelProperty
(
"统计时间"
)
private
String
time
;
@ApiModelProperty
(
"标准产值"
)
private
Integer
productionValue
=
0
;
@ApiModelProperty
(
"非标准产值"
)
private
Double
nonProductionValue
=
0
D
;
@ApiModelProperty
(
"总产值"
)
private
Double
productionTotalValue
=
0
D
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/INormProductionService.java
View file @
a4a2de3f
...
@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.entity.NormProductionStatistics;
...
@@ -5,6 +5,7 @@ import cn.wise.sc.cement.business.entity.NormProductionStatistics;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
...
@@ -71,4 +72,6 @@ public interface INormProductionService extends IService<NormProduction> {
...
@@ -71,4 +72,6 @@ public interface INormProductionService extends IService<NormProduction> {
*/
*/
List
<
NormProduction
.
NormProductionDetail
>
normProductionDetails
(
Integer
userId
,
List
<
NormProduction
.
NormProductionDetail
>
normProductionDetails
(
Integer
userId
,
Long
start
,
Long
end
);
Long
start
,
Long
end
);
List
<
ProductionVo
>
production
(
String
name
,
Long
start
,
Long
end
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
a4a2de3f
...
@@ -1799,6 +1799,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1799,6 +1799,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
qualityDetails
.
size
()
==
0
)
{
if
(
qualityDetails
.
size
()
==
0
)
{
return
null
;
return
null
;
}
}
//处理inputValue
qualityDetails
.
forEach
(
arg
->
arg
.
setInputResult
(
mapStringToMap
(
arg
.
getInputResult
())));
QualityDetail
firstQualityDetail
=
qualityDetails
.
get
(
0
);
QualityDetail
firstQualityDetail
=
qualityDetails
.
get
(
0
);
QualityDetailVo
qualityDetailVo
=
new
QualityDetailVo
();
QualityDetailVo
qualityDetailVo
=
new
QualityDetailVo
();
BeanUtil
.
copyProperties
(
firstQualityDetail
,
qualityDetailVo
);
BeanUtil
.
copyProperties
(
firstQualityDetail
,
qualityDetailVo
);
...
@@ -1864,4 +1867,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1864,4 +1867,17 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
qualityDetailVo
;
return
qualityDetailVo
;
}
}
private
String
mapStringToMap
(
String
str
)
{
str
=
str
.
substring
(
1
,
str
.
length
()
-
1
);
String
[]
strs
=
str
.
split
(
","
);
Map
<
String
,
String
>
map
=
new
HashMap
<>(
strs
.
length
);
for
(
String
string
:
strs
)
{
String
key
=
string
.
split
(
"="
)[
0
];
String
value
=
string
.
split
(
"="
)[
1
];
map
.
put
(
key
,
value
);
}
return
JSON
.
toJSONString
(
map
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
a4a2de3f
...
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
...
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.entity.EntrustSample
;
import
cn.wise.sc.cement.business.entity.EntrustSample
;
import
cn.wise.sc.cement.business.entity.Handle
;
import
cn.wise.sc.cement.business.entity.Handle
;
import
cn.wise.sc.cement.business.entity.NonStandardValue
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProduction
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.entity.NormProductionStatistics
;
import
cn.wise.sc.cement.business.entity.SampleCheckTeam
;
import
cn.wise.sc.cement.business.entity.SampleCheckTeam
;
...
@@ -18,7 +19,9 @@ import cn.wise.sc.cement.business.mapper.NormProductionMapper;
...
@@ -18,7 +19,9 @@ import cn.wise.sc.cement.business.mapper.NormProductionMapper;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.NormProductionVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
cn.wise.sc.cement.business.service.IHandleService
;
import
cn.wise.sc.cement.business.service.IHandleService
;
import
cn.wise.sc.cement.business.service.INonStandardValueService
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.service.INormProductionService
;
import
cn.wise.sc.cement.business.service.ISampleCheckTeamService
;
import
cn.wise.sc.cement.business.service.ISampleCheckTeamService
;
import
cn.wise.sc.cement.business.service.ISampleDistributionService
;
import
cn.wise.sc.cement.business.service.ISampleDistributionService
;
...
@@ -30,13 +33,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...
@@ -30,13 +33,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.math.RoundingMode
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
@@ -69,13 +73,15 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -69,13 +73,15 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
IHandleService
iHandleService
;
IHandleService
iHandleService
;
final
final
ISysPostService
iSysPostService
;
ISysPostService
iSysPostService
;
final
INonStandardValueService
iNonStandardValueService
;
public
NormProductionServiceImpl
(
ISampleDistributionService
iSampleDistributionService
,
public
NormProductionServiceImpl
(
ISampleDistributionService
iSampleDistributionService
,
ISampleHandleService
iSampleHandleService
,
ISampleHandleService
iSampleHandleService
,
ISysUserService
iSysUserService
,
ISysUserService
iSysUserService
,
ISampleCheckTeamService
iSampleCheckTeamService
,
ISampleCheckTeamService
iSampleCheckTeamService
,
ITeamGroupService
iTeamGroupService
,
IHandleService
iHandleService
,
ITeamGroupService
iTeamGroupService
,
IHandleService
iHandleService
,
ISysPostService
iSysPostService
)
{
ISysPostService
iSysPostService
,
INonStandardValueService
iNonStandardValueService
)
{
this
.
iSampleDistributionService
=
iSampleDistributionService
;
this
.
iSampleDistributionService
=
iSampleDistributionService
;
this
.
iSampleHandleService
=
iSampleHandleService
;
this
.
iSampleHandleService
=
iSampleHandleService
;
this
.
iSysUserService
=
iSysUserService
;
this
.
iSysUserService
=
iSysUserService
;
...
@@ -83,6 +89,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -83,6 +89,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
this
.
iTeamGroupService
=
iTeamGroupService
;
this
.
iTeamGroupService
=
iTeamGroupService
;
this
.
iHandleService
=
iHandleService
;
this
.
iHandleService
=
iHandleService
;
this
.
iSysPostService
=
iSysPostService
;
this
.
iSysPostService
=
iSysPostService
;
this
.
iNonStandardValueService
=
iNonStandardValueService
;
}
}
@Override
@Override
...
@@ -234,7 +241,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -234,7 +241,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
List
<
NormProduction
.
NormProductionDetail
>
normProductionDetails
=
List
<
NormProduction
.
NormProductionDetail
>
normProductionDetails
=
normProductionDetails
(
null
,
start
,
end
);
normProductionDetails
(
null
,
start
,
end
);
if
(
normProductionDetails
.
size
()
==
0
){
if
(
normProductionDetails
.
size
()
==
0
)
{
return
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
return
BaseResponse
.
errorMsg
(
"没找到相关数据!"
);
}
}
...
@@ -289,13 +296,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -289,13 +296,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
//过滤名字
//过滤名字
if
(
StrUtil
.
isNotBlank
(
name
))
{
if
(
StrUtil
.
isNotBlank
(
name
))
{
List
<
NormProductionStatistics
>
collect
=
rts
.
stream
().
filter
(
arg
->
{
List
<
NormProductionStatistics
>
collect
=
rts
.
stream
().
filter
(
arg
->
arg
.
getUserName
().
contains
(
name
)).
collect
(
Collectors
.
toList
());
if
(
arg
.
getUserName
().
contains
(
name
))
{
return
true
;
}
else
{
return
false
;
}
}).
collect
(
Collectors
.
toList
());
return
BaseResponse
.
okData
(
collect
);
return
BaseResponse
.
okData
(
collect
);
}
}
return
BaseResponse
.
okData
(
rts
);
return
BaseResponse
.
okData
(
rts
);
...
@@ -350,7 +351,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -350,7 +351,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
List
<
Integer
>
userIds
=
rts
.
stream
()
List
<
Integer
>
userIds
=
rts
.
stream
()
.
map
(
NormProduction
.
NormProductionDetail
::
getUserId
)
.
map
(
NormProduction
.
NormProductionDetail
::
getUserId
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
userIds
.
size
()
==
0
){
if
(
userIds
.
size
()
==
0
)
{
return
new
ArrayList
<>();
return
new
ArrayList
<>();
}
}
List
<
SysUser
>
users
=
iSysUserService
.
listByIds
(
userIds
);
List
<
SysUser
>
users
=
iSysUserService
.
listByIds
(
userIds
);
...
@@ -362,6 +363,80 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -362,6 +363,80 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
return
rts
;
return
rts
;
}
}
@Override
public
List
<
ProductionVo
>
production
(
String
name
,
Long
start
,
Long
end
)
{
Date
startDate
=
null
;
Date
endDate
=
new
Date
();
if
(
start
!=
null
&&
start
!=
0
)
{
startDate
=
DateUtil
.
date
(
start
);
}
if
(
end
!=
null
&&
end
!=
0
)
{
endDate
=
DateUtil
.
date
(
end
);
}
//非标准产值
List
<
NonStandardValue
>
nonStandardValues
=
iNonStandardValueService
.
nonValue
(
startDate
,
endDate
).
getData
();
//标准产值
List
<
NormProductionStatistics
>
productionStatistics
=
this
.
normProductionStatistics
(
start
,
end
,
name
).
getData
();
//以userId找关系
Set
<
String
>
userIds
=
new
HashSet
<>();
nonStandardValues
.
forEach
(
arg
->
userIds
.
add
(
arg
.
getUserId
()
+
""
));
productionStatistics
.
forEach
(
arg
->
userIds
.
add
(
arg
.
getUserId
()));
List
<
ProductionVo
>
rts
=
new
ArrayList
<>(
userIds
.
size
());
userIds
.
forEach
(
arg
->
{
ProductionVo
productionVo
=
new
ProductionVo
();
productionVo
.
setUserId
(
arg
);
//找到标准准产值里面的数据
productionStatistics
.
forEach
(
opt
->
{
if
(
opt
.
getUserId
().
equals
(
arg
))
{
productionVo
.
setProductionValue
(
opt
.
getCoefficient
());
productionVo
.
setUserName
(
opt
.
getUserName
());
productionVo
.
setPosition
(
opt
.
getPosition
());
productionVo
.
setAccount
(
opt
.
getAccount
());
}
});
//找到标准产值里面的数据
nonStandardValues
.
forEach
(
opt
->
{
if
(
arg
.
equals
(
opt
.
getUserId
()
+
""
))
{
productionVo
.
setNonProductionValue
(
opt
.
getFinalValue
());
}
});
rts
.
add
(
productionVo
);
});
//处理非标准产值没有用名职位信息
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
in
(
"id"
,
userIds
);
List
<
SysUser
>
users
=
iSysUserService
.
list
(
qw
);
List
<
SysPost
>
sysPosts
=
iSysPostService
.
list
();
Date
finalStartDate
=
startDate
;
rts
.
forEach
(
arg
->
{
arg
.
setTime
(
finalStartDate
==
null
?
""
:
finalStartDate
.
toString
()
+
" — "
+
end
.
toString
());
if
(
StrUtil
.
isBlank
(
arg
.
getUserName
()))
{
//关联用户信息
users
.
stream
().
filter
(
opt
->
arg
.
getUserId
().
equals
(
opt
.
getId
()
+
""
)).
findFirst
()
.
ifPresent
(
opt
->
{
arg
.
setUserName
(
opt
.
getName
());
arg
.
setAccount
(
opt
.
getUsername
());
arg
.
setPositionId
(
opt
.
getPostId
());
});
//关联职务
sysPosts
.
stream
().
filter
(
opt
->
arg
.
getPositionId
().
intValue
()
==
opt
.
getId
())
.
findFirst
()
.
ifPresent
(
opt
->
arg
.
setPosition
(
opt
.
getName
()));
}
arg
.
setProductionTotalValue
(
arg
.
getNonProductionValue
()
+
arg
.
getProductionValue
());
});
//过滤名字
if
(
StrUtil
.
isNotBlank
(
name
))
{
return
rts
.
stream
().
filter
(
arg
->
arg
.
getUserName
().
contains
(
name
))
.
collect
(
Collectors
.
toList
());
}
return
rts
;
}
/**
/**
* 计算校核单每条数据的标准产值
* 计算校核单每条数据的标准产值
*
*
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/PageUtil.java
View file @
a4a2de3f
...
@@ -2,7 +2,6 @@ package cn.wise.sc.cement.business.util;
...
@@ -2,7 +2,6 @@ package cn.wise.sc.cement.business.util;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.poi.ss.formula.functions.T
;
import
java.util.List
;
import
java.util.List
;
...
@@ -13,11 +12,14 @@ import java.util.List;
...
@@ -13,11 +12,14 @@ import java.util.List;
**/
**/
public
class
PageUtil
{
public
class
PageUtil
{
public
static
<
T
>
Page
<
T
>
listConvertToPage
(
List
<
T
>
list
,
PageQuery
pageQuery
)
{
public
static
<
T
>
Page
<
T
>
listConvertToPage
(
List
<
T
>
list
,
PageQuery
pageQuery
)
{
int
start
=
pageQuery
.
getPageNo
();
int
start
=
pageQuery
.
getPageNo
();
int
end
=
Math
.
min
((
start
+
pageQuery
.
getPageSize
()),
list
.
size
());
int
end
=
Math
.
min
((
start
+
pageQuery
.
getPageSize
()),
list
.
size
());
Page
<
T
>
page
=
new
Page
<>(
start
,
end
,
list
.
size
());
Page
<
T
>
page
=
new
Page
<>(
start
,
pageQuery
.
getPageSize
(),
list
.
size
());
page
.
setRecords
(
list
.
subList
(
start
,
end
));
if
(
start
*
page
.
getSize
()
>
list
.
size
())
{
return
page
;
}
page
.
setRecords
(
list
.
subList
((
int
)(
start
*
page
.
getSize
()),
end
));
return
page
;
return
page
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment