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
b0deefc5
Commit
b0deefc5
authored
Apr 01, 2021
by
shulidong
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0e4af394
84b4285e
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
306 additions
and
206 deletions
+306
-206
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+0
-1
NonStandardValueController.java
...ement/business/controller/NonStandardValueController.java
+10
-2
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+4
-4
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+15
-10
WeiXinController.java
.../wise/sc/cement/business/controller/WeiXinController.java
+20
-8
Sample.java
...c/main/java/cn/wise/sc/cement/business/entity/Sample.java
+1
-1
SampleDistributionMapper.java
...e/sc/cement/business/mapper/SampleDistributionMapper.java
+3
-0
DataStatisticsMapper.xml
...se/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
+3
-0
SampleDistributionMapper.xml
...c/cement/business/mapper/xml/SampleDistributionMapper.xml
+28
-1
SampleTmpQuery.java
...n/wise/sc/cement/business/model/query/SampleTmpQuery.java
+2
-0
INonStandardValueService.java
.../sc/cement/business/service/INonStandardValueService.java
+2
-1
DataStatisticsServiceImpl.java
...ment/business/service/impl/DataStatisticsServiceImpl.java
+1
-1
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+111
-56
NonStandardApplyServiceImpl.java
...nt/business/service/impl/NonStandardApplyServiceImpl.java
+2
-0
NonStandardApprovalServiceImpl.java
...business/service/impl/NonStandardApprovalServiceImpl.java
+2
-2
NonStandardValueServiceImpl.java
...nt/business/service/impl/NonStandardValueServiceImpl.java
+19
-21
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+7
-6
PrecipriceServiceImpl.java
...c/cement/business/service/impl/PrecipriceServiceImpl.java
+15
-13
ExcelUtil.java
.../main/java/cn/wise/sc/cement/business/util/ExcelUtil.java
+6
-46
application-dev.yml
cement-business/src/main/resources/application-dev.yml
+1
-1
report_new.ftl
cement-business/src/main/resources/templates/report_new.ftl
+54
-32
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
b0deefc5
...
...
@@ -283,7 +283,6 @@ public class EntrustController {
//*******************样品检测*****************************************
@ApiOperation
(
value
=
"派发样品检测-委托详情"
)
@GetMapping
(
"/getPFDtail/{id}"
)
public
BaseResponse
getPFDtail
(
@PathVariable
Integer
id
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NonStandardValueController.java
View file @
b0deefc5
...
...
@@ -97,9 +97,17 @@ public class NonStandardValueController {
@ApiOperation
(
"导出-产值统计-非标产值信息列表"
)
@PostMapping
(
"/exportList"
)
public
void
exportList
(
String
filename
,
Integer
userId
,
String
name
,
HttpServletResponse
response
)
{
public
void
exportList
(
String
start
,
String
end
,
Integer
groups
,
String
name
,
String
filename
,
HttpServletResponse
response
)
{
try
{
inonStandardValueService
.
exportList
(
filename
,
userId
,
name
,
response
);
Date
startParse
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
))
{
startParse
=
DateUtil
.
parse
(
start
);
}
Date
endParse
=
null
;
if
(
StrUtil
.
isNotBlank
(
end
))
{
endParse
=
DateUtil
.
parse
(
end
);
}
inonStandardValueService
.
exportList
(
startParse
,
endParse
,
groups
,
name
,
filename
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"导出-产值统计-非标产值信息列表{}"
,
e
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
b0deefc5
...
...
@@ -122,15 +122,15 @@ public class NormProductionController {
@ApiOperation
(
"产值统计-标准产值-分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"start
Date
"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"end
Date
"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"start"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"end"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"userName"
,
value
=
"姓名"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/statistics"
)
public
BaseResponse
statistics
(
PageQuery
pageQuery
,
String
start
Date
,
String
endDate
,
String
userName
)
{
public
BaseResponse
statistics
(
PageQuery
pageQuery
,
String
start
,
String
end
,
String
userName
)
{
try
{
return
iPrecipriceService
.
normProductionStatistics
(
pageQuery
,
start
Date
,
endDate
,
userName
);
return
iPrecipriceService
.
normProductionStatistics
(
pageQuery
,
start
,
end
,
userName
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"产值统计-标准产值-分页列表{}"
,
e
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
b0deefc5
...
...
@@ -129,14 +129,18 @@ public class ReportController {
private
String
getFirstSet
(
Set
<
String
>
set
)
{
if
(
set
!=
null
&&
set
.
size
()>
0
){
Iterator
<
String
>
iterator
=
set
.
iterator
();
if
(
iterator
.
hasNext
())
{
return
iterator
.
next
();
}
}
return
""
;
}
private
static
Set
<
String
>
moveFirst
(
Set
<
String
>
set
)
{
if
(
set
!=
null
&&
set
.
size
()>
0
){
Set
<
String
>
newSet
=
new
HashSet
<>(
set
.
size
());
Iterator
<
String
>
iterator
=
set
.
iterator
();
if
(
iterator
.
hasNext
())
{
...
...
@@ -145,6 +149,7 @@ public class ReportController {
newSet
.
remove
(
next
);
return
newSet
;
}
}
return
null
;
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/WeiXinController.java
View file @
b0deefc5
...
...
@@ -31,6 +31,10 @@ public class WeiXinController {
@Autowired
private
WeiXinService
weiXinService
;
@Value
(
"${spring.profiles.active}"
)
private
String
active
;
@ApiOperation
(
value
=
"获取登录token-小程序端"
)
@GetMapping
(
"/getToken"
)
public
BaseResponse
getToken
(
String
code
)
{
...
...
@@ -39,10 +43,14 @@ public class WeiXinController {
log
.
debug
(
"code: {}"
,
code
);
log
.
debug
(
"============================================="
);
try
{
if
(
active
.
equals
(
"prod"
)){
//正式服务器
return
weiXinService
.
getToken
(
code
,
"APP"
);
}
else
{
//测试服务器
return
weiXinService
.
getTestToken
(
code
);
//正式服务器
// return weiXinService.getToken(code, "APP");
}
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取登录token{}"
,
e
);
}
...
...
@@ -53,10 +61,14 @@ public class WeiXinController {
@GetMapping
(
"/getPCToken"
)
public
BaseResponse
getPCToken
(
String
code
)
{
try
{
if
(
active
.
equals
(
"prod"
)){
//正式服务器
return
weiXinService
.
getToken
(
code
,
"PC"
);
}
else
{
//测试服务器
return
weiXinService
.
getTestToken
(
code
);
//正式服务器
// return weiXinService.getToken(code, "PC");
}
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取登录token{}"
,
e
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/Sample.java
View file @
b0deefc5
...
...
@@ -134,7 +134,7 @@ public class Sample implements Serializable {
*/
public
static
String
weight2Kg
(
String
weight
,
Integer
weightType
){
String
result
=
""
;
if
(
StringUtils
.
isNotBlank
(
weight
)){
if
(
StringUtils
.
isNotBlank
(
weight
)
&&
weightType
!=
null
){
if
(
weightType
==
1
){
result
=
new
BigDecimal
(
weight
).
divide
(
new
BigDecimal
(
1000000000
)).
toString
();
}
else
if
(
weightType
==
2
){
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleDistributionMapper.java
View file @
b0deefc5
...
...
@@ -28,6 +28,9 @@ public interface SampleDistributionMapper extends BaseMapper<SampleDistribution>
List
<
SampleDistributionTeamVo
>
getDistributionTeamList
(
@Param
(
"sampleId"
)
Integer
sampleId
,
@Param
(
"userId"
)
Integer
userId
);
List
<
SampleDistributionTeamVo
>
getDistributionTeamList2
(
@Param
(
"sampleId"
)
Integer
sampleId
,
@Param
(
"userId"
)
Integer
userId
);
List
<
SampleDistributionTeamVo
>
getDistributionTeamResultList
(
@Param
(
"sampleId"
)
Integer
sampleId
,
@Param
(
"userId"
)
Integer
userId
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/DataStatisticsMapper.xml
View file @
b0deefc5
...
...
@@ -459,6 +459,7 @@
LEFT JOIN team t ON t.id = sd.team_id
WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null
and sd.distribution_result is not null and sd.distribution_result
<![CDATA[ <> ]]>
''
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
...
...
@@ -484,6 +485,7 @@
LEFT JOIN team t ON t.id = sd.team_id
WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null
and sd.distribution_result is not null and sd.distribution_result
<![CDATA[ <> ]]>
''
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
...
...
@@ -515,6 +517,7 @@
,(select @i:=0)t
WHERE s.is_check = 1 and s.cement_code = s.parallel_code
and sd.status = 4 and sd.check_id is not null
and sd.distribution_result is not null and sd.distribution_result
<![CDATA[ <> ]]>
''
<if
test=
"start != null and end != null"
>
AND (sd.finish_time between #{start} and #{end})
</if>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleDistributionMapper.xml
View file @
b0deefc5
...
...
@@ -77,6 +77,33 @@
order by t.id asc
</select>
<select
id=
"getDistributionTeamList2"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo"
>
select t.id as distributionId, su.id as userId, su.name as userName,
t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName,
t.status as status,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '接受'
WHEN 2 THEN '待校核'
WHEN 3 THEN '退回'
WHEN 4 THEN '校核通过'
WHEN 5 THEN '校核退回'
ELSE ''
END
) as statusValue
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join team s on s.id = t.team_id
left join team_group tg on tg.id = t.team_group_id
where t.sample_id = #{sampleId}
<if
test=
"userId != null"
>
and t.user_id = #{userId}
</if>
order by t.id asc
</select>
<select
id=
"getDistributionTeamResultList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo"
>
select t.id as distributionId, su.id as userId, su.name as userName,
t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName,
...
...
@@ -111,7 +138,7 @@
t.team_id as teamId
from sample_distribution t
left join sys_user su on su.id = t.user_id
where t.sample_id = #{sampleId}
where t.sample_id = #{sampleId}
and t.status = 2
<if
test=
"userId != null"
>
and t.user_id = #{userId}
</if>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleTmpQuery.java
View file @
b0deefc5
...
...
@@ -6,6 +6,7 @@ import io.swagger.models.auth.In;
import
lombok.Data
;
import
sun.java2d.loops.GeneralRenderer
;
import
javax.validation.constraints.Size
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
...
...
@@ -37,6 +38,7 @@ public class SampleTmpQuery {
private
String
samplePhoto
;
@ApiModelProperty
(
"样品重量"
)
@Size
(
max
=
10
,
min
=
1
)
private
BigDecimal
weight
;
@ApiModelProperty
(
"样品重量计量单位(1微克,2毫克,3克,4千克,5吨)"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/INonStandardValueService.java
View file @
b0deefc5
...
...
@@ -40,7 +40,8 @@ public interface INonStandardValueService extends IService<NonStandardValue> {
BaseResponse
<
List
<
NonStandardValueVo
>>
getList
(
Date
start
,
Date
end
,
Integer
groups
,
String
name
);
void
exportList
(
String
filename
,
Integer
userId
,
String
name
,
HttpServletResponse
response
);
void
exportList
(
Date
start
,
Date
end
,
Integer
groups
,
String
name
,
String
filename
,
HttpServletResponse
response
);
void
exportDetailList
(
Date
start
,
Date
end
,
Integer
userId
,
String
name
,
String
filename
,
HttpServletResponse
response
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/DataStatisticsServiceImpl.java
View file @
b0deefc5
...
...
@@ -480,7 +480,7 @@ public class DataStatisticsServiceImpl implements IDataStatisticsService {
}
}
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托
列表
"
:
fileName
,
wb
,
response
);
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托
单进展统计
"
:
fileName
,
wb
,
response
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
b0deefc5
...
...
@@ -46,6 +46,7 @@ import java.time.LocalDate;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.regex.Pattern
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -318,6 +319,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sampleTmpQuery
.
getWeight
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请填写样品重量"
);
}
if
(
sampleTmpQuery
.
getWeight
().
toString
().
length
()>
10
)
{
return
BaseResponse
.
errorMsg
(
"样品重量输入过长"
);
}
if
(
sampleTmpQuery
.
getWeightType
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择重量单位"
);
}
...
...
@@ -512,8 +518,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setProjectName
(
project
.
getName
());
}
String
entrustCode
=
entrust
.
getProjectCode
()
+
"-"
+
query
.
getSampleList
().
get
(
0
).
getCementCode
();
entrust
.
setEntrustCode
(
entrustCode
);
//消息推送 和 判断是否符合修改权限 会用到
List
<
Integer
>
approvalIdList
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
...
...
@@ -523,13 +528,18 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(!
approvalIdList
.
contains
(
loginUser
.
getId
())
&&
entrust
.
getUserId
()
!=
loginUser
.
getId
())
{
return
BaseResponse
.
errorMsg
(
"没有修改权限"
);
}
//如果时评审人员修改 存入委托编号
if
(
approvalIdList
.
contains
(
loginUser
.
getId
()))
{
String
entrustCode
=
entrust
.
getProjectCode
()
+
"-"
+
query
.
getSampleList
().
get
(
0
).
getCementCode
();
entrust
.
setEntrustCode
(
entrustCode
);
}
BeanUtils
.
copyProperties
(
query
,
entrust
);
//生成委托编号
// String entrustCode = commonService.createNo("WT", entrustMapper.counts());
if
(
entrust
.
getUserId
()
==
loginUser
.
getId
())
{
if
(
entrust
.
getUserId
()
==
loginUser
.
getId
()
&&
entrust
.
getStatus
()
==
2
)
{
entrust
.
setStatus
(
0
);
//未评审
}
else
if
(
approvalIdList
.
contains
(
loginUser
.
getId
()))
{
}
else
if
(
approvalIdList
.
contains
(
loginUser
.
getId
())
&&
entrust
.
getStatus
()
==
0
)
{
if
(
StringUtils
.
isEmpty
(
query
.
getProjectType
()))
{
return
BaseResponse
.
errorMsg
(
"请选择项目类型"
);
}
...
...
@@ -571,6 +581,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sampleQuery
.
getWeight
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请填写样品重量"
);
}
if
(
sampleQuery
.
getWeight
().
toString
().
length
()>
10
)
{
return
BaseResponse
.
errorMsg
(
"样品重量输入过长"
);
}
if
(
sampleQuery
.
getWeightType
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择重量单位"
);
}
...
...
@@ -632,10 +646,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setCharge
(
charge
)
.
setCreateTime
(
LocalDateTime
.
now
());
sampleTmpList
.
add
(
sampleTmp
);
sampleTmpService
.
save
(
sampleTmp
);
sampleQuery
.
setId
(
sampleTmp
.
getId
());
}
sampleTmpService
.
saveBatch
(
sampleTmpList
);
if
(
entrust
.
getUserId
()
!=
loginUser
.
getId
()
&&
approvalIdList
.
contains
(
loginUser
.
getId
())
)
{
if
(
approvalIdList
.
contains
(
loginUser
.
getId
())
&&
entrust
.
getStatus
()
==
9
)
{
//当前平行样编号最大值
String
redisMaxCementCode
=
getMaxCementCode
().
getData
();
//保存样品信息
...
...
@@ -653,7 +669,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改委托单"
,
null
);
//如果是委托人修改的
if
(
entrust
.
getUserId
()
==
loginUser
.
getId
())
{
if
(
entrust
.
getUserId
()
==
loginUser
.
getId
()
&&
entrust
.
getStatus
()
==
0
)
{
//委托人员修改委托,提示评审人员查看
String
userIds
=
""
;
for
(
Integer
approvalId
:
approvalIdList
)
{
...
...
@@ -676,7 +692,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
System
.
out
.
println
(
"**************************content**********************"
);
System
.
out
.
println
(
content
);
weiXinService
.
sendTextMessage
(
userIds
,
content
);
}
else
if
(
approvalIdList
.
contains
(
loginUser
.
getId
()))
{
}
else
if
(
approvalIdList
.
contains
(
loginUser
.
getId
())
&&
entrust
.
getStatus
()
==
9
)
{
//如果是评审人员修改
//评审人员修改委托,提示委托人查看
SysUser
createUser
=
userService
.
getById
(
entrust
.
getUserId
());
...
...
@@ -789,10 +805,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
TeamVo
teamVo
=
teamMapper
.
getDetail
(
Integer
.
valueOf
(
teamId
));
//如果本所编号不相等 则为副样,副样需要判断检测项是否需要平行样,如果不需要不用进行派发检测
if
(!
sample
.
getCementCode
().
equals
(
sample
.
getParallelCode
())
&&
teamVo
.
getIsParallel
()
==
0
)
{
break
;
continue
;
}
if
(
teamVo
!=
null
&&
teamVo
.
getIsPf
()
!=
0
)
{
if
(!
teamGroupIdList
.
contains
(
teamVo
.
getGroupId
()))
{
teamGroupIdList
.
add
(
teamVo
.
getGroupId
());
SampleTeamGroupVo
sampleTeamGroupVo
=
new
SampleTeamGroupVo
();
...
...
@@ -822,9 +837,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleDistributionTeamVoList
.
add
(
distributionTeamVo
);
sampleTeamGroupVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
}
teamName
=
teamName
.
equals
(
""
)
?
teamVo
.
getName
()
:
(
teamName
+
"、"
+
teamVo
.
getName
());
}
teamName
=
teamName
.
equals
(
""
)
?
teamVo
.
getName
()
:
(
teamName
+
"、"
+
teamVo
.
getName
());
}
}
sampleVo
.
setTeamName
(
teamName
);
...
...
@@ -1379,6 +1393,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setProjectCode
(
project
.
getCode
())
.
setProjectName
(
project
.
getName
());
}
//获取产值信息
QueryWrapper
<
NormProduction
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
0
);
queryWrapper
.
eq
(
"status"
,
1
);
List
<
NormProduction
>
normProduction
=
iNormProductionService
.
list
(
queryWrapper
);
if
(
normProduction
==
null
||
normProduction
.
size
()
!=
1
)
{
//还原本所编号最大值
return
BaseResponse
.
errorMsg
(
"请配置处理项的产值信息!"
);
}
/* //如果项目id或者项目编号为空,根据项目名称获取项目信息
if (StringUtils.isEmpty(entrust.getProjectCode())) {
ProjectVo projectVo = projectMapper.getByName(entrust.getProjectName());
...
...
@@ -1455,18 +1478,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.setStatus(0)
.setAlias(handle.getName());
sampleHandleEnclosureMapper.insert(sampleHandleEnclosure);*/
//获取产值信息
QueryWrapper
<
NormProduction
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"type"
,
0
);
queryWrapper
.
eq
(
"status"
,
1
);
List
<
NormProduction
>
normProduction
=
iNormProductionService
.
list
(
queryWrapper
);
if
(
normProduction
==
null
||
normProduction
.
size
()
!=
1
)
{
//评审未通过,删除评审后的样品
sampleMapper
.
deleteBatchIds
(
sampleList
);
//还原本所编号最大值
redisUtil
.
setString
(
"maxCementCode"
,
redisMaxCementCode
);
return
BaseResponse
.
errorMsg
(
"请配置处理项的产值信息!"
);
}
}
//消息推送
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
sampleHandle
.
getUserId
(),
"您有一条样品处理信息等待处理"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
...
...
@@ -1670,6 +1682,35 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
*/
private
BaseResponse
<
String
>
saveSampleList
(
List
<
SampleQuery
>
sampleQueryList
,
String
redisMaxCementCode
)
{
if
(
sampleQueryList
!=
null
&&
sampleQueryList
.
size
()
>
0
)
{
//对样品信息进行判断
for
(
SampleQuery
sampleQuery
:
sampleQueryList
)
{
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getName
()))
{
return
BaseResponse
.
errorMsg
(
"请填写样品名"
);
}
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getSampleCode
()))
{
return
BaseResponse
.
errorMsg
(
"请填写来样编号"
);
}
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getSampleForm
()))
{
return
BaseResponse
.
errorMsg
(
"请选择样品状态"
);
}
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getTeamIds
()))
{
return
BaseResponse
.
errorMsg
(
"请选择检测项目"
);
}
if
(
sampleQuery
.
getWeight
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请填写样品重量"
);
}
if
(
sampleQuery
.
getWeight
().
toString
().
length
()>
10
)
{
return
BaseResponse
.
errorMsg
(
"样品重量输入过长"
);
}
if
(
sampleQuery
.
getWeightType
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择重量单位"
);
}
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getOrigin
()))
{
return
BaseResponse
.
errorMsg
(
"请选择样品产地"
);
}
}
List
<
Sample
>
sampleList
=
new
ArrayList
<>();
String
maxCementCode
=
""
;
//最大本所编号对应的平行样编号
Integer
integerMaxCode
=
commonService
.
getIntegerCode
(
redisMaxCementCode
);
...
...
@@ -1681,6 +1722,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
integerLastCode
<=
integerMaxCode
)
{
return
BaseResponse
.
errorMsg
(
"本所编号必须大于最大值"
);
}
//当前本所编号 截取的年份
String
yearStr
=
commonService
.
getIntegerYear
(
lastCementCode
);
//平行样的集合(乱序)
...
...
@@ -1694,8 +1736,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
for
(
SampleQuery
sampleQuery
:
sampleQueryList
)
{
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getCementCode
()))
{
return
BaseResponse
.
errorMsg
(
"本所编号不能为空"
);
}
...
...
@@ -2660,7 +2704,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
SampleVo
sampleVo
=
new
SampleVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
loginUser
.
getId
());
distributionMapper
.
getDistributionTeamList
2
(
sample
.
getId
(),
loginUser
.
getId
());
Map
<
String
,
String
>
checkTeamMap
=
new
HashMap
<>();
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()
>
0
)
{
//已经派发过的列表
...
...
@@ -4963,6 +5007,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List
<
Method
>
methods
=
JSON
.
parseArray
(
redisUtil
.
getString
(
methodKey
)
+
""
,
Method
.
class
);
list
.
forEach
(
arg
->
{
String
teamIds
=
arg
.
getTeamIds
();
if
(
StringUtils
.
isNoneBlank
(
teamIds
)){
String
[]
teamSplit
=
teamIds
.
split
(
"、"
);
for
(
String
idStr
:
teamSplit
)
{
int
id
=
Integer
.
parseInt
(
idStr
);
...
...
@@ -4977,12 +5022,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
});
}
}
String
methodNumbers
=
arg
.
getMethodNumbers
();
if
(
StringUtils
.
isNoneBlank
(
methodNumbers
)){
String
[]
methodSplit
=
methodNumbers
.
split
(
"、"
);
for
(
String
idStr
:
methodSplit
)
{
String
id
=
Integer
.
parseInt
(
idStr
)
+
""
;
//
String id = Integer.parseInt(idStr) + "";
methods
.
forEach
(
opt
->
{
if
(
id
.
equals
(
opt
.
getNumber
()))
{
if
(
idStr
.
equals
(
opt
.
getNumber
()))
{
if
(
StrUtil
.
isBlank
(
arg
.
getMethodName
()))
{
arg
.
setMethodName
(
opt
.
getName
()
+
" "
+
opt
.
getStandard
());
}
else
{
...
...
@@ -4991,6 +5039,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
});
}
}
});
if
(
list
.
size
()
!=
0
)
{
...
...
@@ -5038,6 +5087,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//将样品重量换算成kg
if
(
newList
!=
null
){
newList
.
stream
().
forEach
(
arg
->{
arg
.
setWeight
(
Sample
.
weight2Kg
(
arg
.
getWeight
(),
arg
.
getWeightType
()));
});
}
...
...
@@ -5657,7 +5707,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts
.
setTeamNames
(
new
HashSet
<>(
source
.
size
()));
Set
<
Integer
>
equipmentIds
=
new
HashSet
<>(
source
.
size
());
source
.
forEach
(
arg
->
{
if
(
arg
.
getEquipmentId
()
!=
null
){
equipmentIds
.
add
(
arg
.
getEquipmentId
());
}
//获取使用的设备id view
//关联检测项目
if
(
StrUtil
.
isNotBlank
(
arg
.
getTeamName
()))
{
...
...
@@ -5682,8 +5734,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts
.
setSampleNum
(
rts
.
getSampleNames
().
size
());
//关联仪器名字 去重
if
(
equipmentIds
!=
null
&&
equipmentIds
.
size
()>
0
){
List
<
String
>
equipmentNames
=
equipmentUseMapper
.
getEquipmentNamesByEquipmentIds
(
equipmentIds
);
equipmentNames
.
forEach
(
arg
->
rts
.
getEquipmentNames
().
add
(
arg
));
}
//关联送样单位名字
String
clientKey
=
"CACHE:CLIENT"
;
...
...
@@ -5723,7 +5778,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()
+
1
];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"委托
编
号"
;
headers
[
1
]
=
"委托
单
号"
;
headers
[
2
]
=
"是否加急"
;
headers
[
3
]
=
"项目名称"
;
headers
[
4
]
=
"项目编号"
;
...
...
@@ -5934,7 +5989,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托
列表
"
:
fileName
,
wb
,
response
);
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托
单进展
"
:
fileName
,
wb
,
response
);
}
...
...
@@ -6130,7 +6185,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
coloum
=
coloum
+
1
;
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"
委托列表
"
:
fileName
,
wb
,
response
);
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"
样品标签
"
:
fileName
,
wb
,
response
);
}
...
...
@@ -6254,7 +6309,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托
列表
"
:
fileName
,
wb
,
response
);
ExcelUtil
.
excelExportNew
(
fileName
==
null
||
fileName
.
trim
().
length
()
<=
0
?
"委托
单校核
"
:
fileName
,
wb
,
response
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NonStandardApplyServiceImpl.java
View file @
b0deefc5
...
...
@@ -175,6 +175,8 @@ public class NonStandardApplyServiceImpl extends ServiceImpl<NonStandardApplyMap
ExcelUtil
.
excelExport
(
filename
==
null
||
filename
.
trim
().
length
()
<=
0
?
"非标产值申请"
:
filename
,
headers
,
datas
,
response
);
}
else
{
Assert
.
notNull
(
loginUser
,
"不存在数据!"
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NonStandardApprovalServiceImpl.java
View file @
b0deefc5
...
...
@@ -163,8 +163,8 @@ public class NonStandardApprovalServiceImpl extends ServiceImpl<NonStandardAppro
headers
[
3
]
=
"统计日期"
;
headers
[
4
]
=
"上报工日"
;
headers
[
5
]
=
"审批工日"
;
headers
[
6
]
=
"
状态
"
;
headers
[
7
]
=
"
最终产值
"
;
headers
[
6
]
=
"
最终产值
"
;
headers
[
7
]
=
"
状态
"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NonStandardValueServiceImpl.java
View file @
b0deefc5
...
...
@@ -7,6 +7,7 @@ import cn.wise.sc.cement.business.model.BaseResponse;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.NonStandardApplyVo
;
import
cn.wise.sc.cement.business.model.vo.NonStandardValueVo
;
import
cn.wise.sc.cement.business.model.vo.ProductionVo
;
import
cn.wise.sc.cement.business.service.INonStandardValueService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
...
...
@@ -149,21 +150,19 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
/**
* 导出-产值统计-非标产值-信息列表
* @param filename 文件名
* @param userId 用户id
* @param name 姓名
* @param start
* @param end
* @param groups
* @param name
* @param filename
* @param response
*/
@Override
public
void
exportList
(
String
filename
,
Integer
userId
,
String
name
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"userId"
,
userId
);
params
.
put
(
"name"
,
name
);
List
<
Map
<
String
,
Object
>>
list
=
nonStandardValueMapper
.
exportList
(
params
);
public
void
exportList
(
Date
start
,
Date
end
,
Integer
groups
,
String
name
,
String
filename
,
HttpServletResponse
response
)
{
List
<
NonStandardValue
>
list
=
nonValue
(
start
,
end
,
groups
,
name
).
getData
();
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
//
Map<String, Object> map = list.get(0);
String
[]
headers
=
new
String
[
6
];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"姓名"
;
...
...
@@ -172,17 +171,16 @@ public class NonStandardValueServiceImpl extends ServiceImpl<NonStandardValueMap
headers
[
4
]
=
"审批工日"
;
headers
[
5
]
=
"最终产值"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
])
==
null
?
""
:
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
&&
obj
!=
null
)
{
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
int
i
=
0
;
for
(
NonStandardValue
target
:
list
)
{
Object
[]
objs
=
new
Object
[
6
];
objs
[
0
]
=
i
++;
objs
[
1
]
=
target
.
getName
();
objs
[
2
]
=
target
.
getAccount
();
objs
[
3
]
=
target
.
getReportedHours
();
objs
[
4
]
=
target
.
getApprovalHours
();
objs
[
5
]
=
target
.
getFinalValue
();
datas
.
add
(
objs
);
}
ExcelUtil
.
excelExport
(
filename
==
null
||
filename
.
trim
().
length
()
<=
0
?
"非标产值"
:
filename
,
headers
,
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
b0deefc5
...
...
@@ -123,9 +123,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
if
(
normProduction
.
getType
()
==
null
){
return
BaseResponse
.
errorMsg
(
"类型不允许为空!"
);
}
if
(
normProduction
.
getAssessId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"对象id不允许为空!"
);
}
//如果是处理项 只能添加一次
if
(
normProduction
.
getType
()
==
0
){
normProduction
.
setAssessId
(
null
);
...
...
@@ -137,6 +135,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
return
BaseResponse
.
errorMsg
(
"当前处理项标准产值已存在!"
);
}
}
else
{
if
(
normProduction
.
getAssessId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"对象id不允许为空!"
);
}
//判断配置项目是否已存在
QueryWrapper
<
NormProduction
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"type"
,
normProduction
.
getType
());
...
...
@@ -216,9 +217,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
if
(
normProduction
.
getType
()
==
null
){
return
BaseResponse
.
errorMsg
(
"类型不允许为空!"
);
}
if
(
normProduction
.
getAssessId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"对象id不允许为空!"
);
}
NormProduction
normProductionOld
=
this
.
getById
(
normProduction
.
getId
());
if
(
normProductionOld
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
...
...
@@ -236,6 +234,9 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
return
BaseResponse
.
errorMsg
(
"当前处理项标准产值已存在!"
);
}
}
else
{
if
(
normProduction
.
getAssessId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"对象id不允许为空!"
);
}
//判断配置项目是否已存在
QueryWrapper
<
NormProduction
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"assess_id"
,
normProduction
.
getAssessId
());
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PrecipriceServiceImpl.java
View file @
b0deefc5
...
...
@@ -131,7 +131,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
throw
new
IllegalArgumentException
(
"联系管理员.配置产值信息!"
);
}
preciprice
.
setAnalyseRate
(
BigDecimal
.
valueOf
(
normProduction
.
getAnalyseRate
()));
preciprice
.
setAssessRate
(
BigDecimal
.
valueOf
(
normProduction
.
getAssess
Id
()));
preciprice
.
setAssessRate
(
BigDecimal
.
valueOf
(
normProduction
.
getAssess
Rate
()));
preciprice
.
setAssessValue
(
BigDecimal
.
valueOf
(
normProduction
.
getAssessValue
()));
preciprice
.
setReportedAnalyseResult
(
BigDecimal
.
valueOf
(
normProduction
.
getReportedAnalyseResult
()));
preciprice
.
setReportedResultRate
(
BigDecimal
.
valueOf
(
normProduction
.
getReportedResultRate
()));
...
...
@@ -323,7 +323,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
if
(!
BeanUtil
.
isEmpty
(
userId
))
{
qw
.
eq
(
"user_id"
,
userId
);
}
qw
.
eq
(
"status"
,
1
);
//
qw.eq("status", 1);
qw
.
orderByDesc
(
"create_time"
);
List
<
Preciprice
>
list
=
this
.
list
(
qw
);
List
<
NormProduction
.
NormProductionUserDetail
>
rts
=
new
ArrayList
<>(
list
.
size
());
...
...
@@ -364,7 +364,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
List
<
Preciprice
>
teamlist
=
list
.
stream
().
filter
(
arg
->(
arg
.
getType
()==
2
)).
collect
(
Collectors
.
toList
());
if
(
teamlist
!=
null
&&
teamlist
.
size
()>
0
){
Map
<
Integer
,
List
<
Preciprice
>>
mapByTeamId
=
team
Group
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
Preciprice:
:
getTargetId
,
Collectors
.
toList
()));
Map
<
Integer
,
List
<
Preciprice
>>
mapByTeamId
=
teamlist
.
stream
().
collect
(
Collectors
.
groupingBy
(
Preciprice:
:
getTargetId
,
Collectors
.
toList
()));
for
(
Map
.
Entry
<
Integer
,
List
<
Preciprice
>>
entry
:
mapByTeamId
.
entrySet
()){
NormProduction
.
NormProductionUserDetail
UserDetailRts
=
new
NormProduction
.
NormProductionUserDetail
();
UserDetailRts
.
setType
(
2
);
...
...
@@ -408,7 +408,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
if
(!
BeanUtil
.
isEmpty
(
userId
))
{
qw
.
eq
(
"user_id"
,
userId
);
}
qw
.
eq
(
"status"
,
1
);
//
qw.eq("status", 1);
qw
.
orderByDesc
(
"create_time"
);
List
<
Preciprice
>
list
=
this
.
list
(
qw
);
List
<
NormProduction
.
NormProductionUserDetail
>
rts
=
new
ArrayList
<>(
list
.
size
());
...
...
@@ -472,7 +472,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
headers
[
3
]
=
"数量"
;
headers
[
4
]
=
"合计"
;
headers
[
5
]
=
"产值设置:"
;
headers
[
5
]
=
"产值设置
参数
:"
;
headers
[
6
]
=
"额定工日"
;
headers
[
7
]
=
"报出对应分析结果"
;
...
...
@@ -497,13 +497,15 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
NormProductionVo
vo
=
null
;
if
(
target
.
getType
()
==
0
){
vo
=
normProductions
.
stream
()
.
filter
(
arg
->
(
arg
.
getType
().
equals
(
"处理项"
)
&&
arg
.
getAssessId
()==
null
)).
findFirst
().
get
(
);
.
filter
(
arg
->
(
arg
.
getType
().
equals
(
"处理项"
)
&&
arg
.
getAssessId
()==
null
)).
findFirst
().
orElse
(
null
);
}
else
if
(
target
.
getType
()
==
1
){
vo
=
normProductions
.
stream
()
.
filter
(
arg
->
(
arg
.
getType
().
equals
(
"检测组"
)
&&
arg
.
getAssessId
().
equals
(
target
.
getObjId
()))).
findFirst
().
get
();
vo
=
normProductions
.
stream
()
.
filter
(
arg
->
(
arg
.
getType
().
equals
(
"检测组"
)
&&
arg
.
getAssessId
().
equals
(
target
.
getObjId
())))
.
findFirst
().
orElse
(
null
);
}
else
if
(
target
.
getType
()
==
2
){
vo
=
normProductions
.
stream
()
.
filter
(
arg
->
(
arg
.
getType
().
equals
(
"检测项"
)
&&
arg
.
getAssessId
().
equals
(
target
.
getObjId
()))).
findFirst
().
get
(
);
.
filter
(
arg
->
(
arg
.
getType
().
equals
(
"检测项"
)
&&
arg
.
getAssessId
().
equals
(
target
.
getObjId
()))).
findFirst
().
orElse
(
null
);
}
if
(
vo
!=
null
){
...
...
@@ -568,7 +570,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
}
else
{
qw
.
eq
(
"target_id"
,
objId
);
}
qw
.
eq
(
"status"
,
1
);
//
qw.eq("status", 1);
qw
.
orderByDesc
(
"create_time"
);
List
<
Preciprice
>
list
=
this
.
list
(
qw
);
List
<
NormProduction
.
NormProductionDetail
>
rts
=
new
ArrayList
<>(
list
.
size
());
...
...
@@ -643,7 +645,7 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
});
//找到非标产值里面的数据
nonStandardValues
.
forEach
(
opt
->
{
if
(
arg
.
equals
(
opt
.
getUserId
()))
{
if
(
arg
.
equals
(
opt
.
getUserId
()
.
toString
()
))
{
productionVo
.
setNonProductionValue
(
opt
.
getFinalValue
());
}
});
...
...
@@ -737,8 +739,8 @@ public class PrecipriceServiceImpl extends ServiceImpl<PrecipriceMapper, Precipr
BigDecimal
analyseRateBig
=
BigDecimal
.
valueOf
(
rate
);
//分析占比
return
quotaDayBig
.
multiply
(
coefficientBig
)
.
divide
(
reportedAnalyseRtsBig
,
2
,
RoundingMode
.
HALF_DOWN
)
.
divide
(
reportedAnalyseRtsBig
,
10
,
BigDecimal
.
ROUND_HALF_UP
)
.
multiply
(
assessValueBig
).
multiply
(
analyseRateBig
)
.
setScale
(
2
,
RoundingMode
.
HALF_DOWN
);
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/util/ExcelUtil.java
View file @
b0deefc5
...
...
@@ -34,51 +34,6 @@ import java.util.List;
* @author zhutianwei
*/
public
class
ExcelUtil
{
public
static
void
excelLocal
(
String
path
,
String
fileName
,
String
[]
headers
,
List
<
Object
[]>
datas
)
{
Workbook
workbook
=
getWorkbook
(
headers
,
datas
);
if
(
workbook
!=
null
)
{
ByteArrayOutputStream
byteArrayOutputStream
=
null
;
FileOutputStream
fileOutputStream
=
null
;
try
{
byteArrayOutputStream
=
new
ByteArrayOutputStream
();
workbook
.
write
(
byteArrayOutputStream
);
String
suffix
=
".xls"
;
File
file
=
new
File
(
path
+
File
.
separator
+
fileName
+
suffix
);
if
(!
file
.
getParentFile
().
exists
())
{
file
.
getParentFile
().
mkdirs
();
}
fileOutputStream
=
new
FileOutputStream
(
file
);
fileOutputStream
.
write
(
byteArrayOutputStream
.
toByteArray
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
finally
{
try
{
if
(
fileOutputStream
!=
null
)
{
fileOutputStream
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
if
(
byteArrayOutputStream
!=
null
)
{
byteArrayOutputStream
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
try
{
workbook
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
/**
* 导出excel
*
...
...
@@ -217,11 +172,11 @@ public class ExcelUtil {
font
.
setBold
(
true
);
font
.
setFontHeightInPoints
((
short
)
13
);
style
.
setFont
(
font
);
style
.
setWrapText
(
true
);
maxColumn
=
headers
.
length
;
for
(
int
i
=
0
;
i
<
maxColumn
;
i
++)
{
cell
=
row
.
createCell
(
i
);
sheet
.
setColumnWidth
(
i
,
Math
.
min
(
255
*
256
,
sheet
.
getColumnWidth
(
i
)
*
12
/
10
));
XSSFFont
xxsfFont
=
workbook
.
createFont
();
//表头处理上下标
...
...
@@ -252,6 +207,7 @@ public class ExcelUtil {
if
(
datas
!=
null
&&
datas
.
size
()
>
0
)
{
// 渲染数据
CellStyle
style
=
workbook
.
createCellStyle
();
style
.
setWrapText
(
true
);
XSSFFont
xxsfFont
=
workbook
.
createFont
();
for
(
int
index
=
0
,
size
=
datas
.
size
();
index
<
size
;
index
++)
{
...
...
@@ -305,6 +261,8 @@ public class ExcelUtil {
for
(
int
i
=
0
;
i
<
maxColumn
;
i
++)
{
sheet
.
autoSizeColumn
(
i
);
//单元格自适应宽度
sheet
.
setColumnWidth
(
i
,
Math
.
max
(
15
*
256
,
Math
.
min
(
255
*
256
,
sheet
.
getColumnWidth
(
i
)
*
12
/
10
)));
}
return
workbook
;
...
...
@@ -411,6 +369,8 @@ public class ExcelUtil {
for
(
int
i
=
0
;
i
<
maxColumn
;
i
++)
{
sheet
.
autoSizeColumn
(
i
);
//单元格自适应宽度
sheet
.
setColumnWidth
(
i
,
Math
.
max
(
15
*
256
,
Math
.
min
(
255
*
256
,
sheet
.
getColumnWidth
(
i
)
*
12
/
10
)));
}
return
workbook
;
...
...
cement-business/src/main/resources/application-dev.yml
View file @
b0deefc5
...
...
@@ -7,7 +7,7 @@ spring:
profiles
:
active
:
dev
datasource
:
# 192.168.110.85 admin!@#123 sinoma_zhengshiData sinoma_tmp
# 192.168.110.85 admin!@#123
sinoma_tcdri
sinoma_zhengshiData sinoma_tmp
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_zhengshiData?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username
:
root
password
:
admin!@#123
...
...
cement-business/src/main/resources/templates/report_new.ftl
View file @
b0deefc5
...
...
@@ -1807,15 +1807,14 @@
<Borders>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
<Font
ss:FontName=
"
楷体"
x:CharSet=
"134"
x:Family=
"Modern"
ss:Size=
"14
"
/>
<Font
ss:FontName=
"
Times New Roman"
x:CharSet=
"134"
x:Family=
"Modern"
ss:Size=
"12"
ss:Color=
"#FF0000
"
/>
</Style>
<Style
ss:ID=
"s179"
>
<Alignment
ss:Vertical=
"Bottom"
/>
<Borders>
<Border
ss:Position=
"Left"
ss:LineStyle=
"Continuous"
ss:Weight=
"1"
/>
</Borders>
<Font
ss:FontName=
"Times New Roman"
x:Family=
"Roman"
ss:Size=
"12"
ss:Color=
"#FF0000"
/>
<Font
ss:FontName=
"Times New Roman"
x:CharSet=
"134"
x:Family=
"Modern"
ss:Size=
"12"
ss:Color=
"#FF0000"
/>
</Style>
<Style
ss:ID=
"s180"
>
<Alignment
ss:Vertical=
"Bottom"
/>
...
...
@@ -3963,10 +3962,11 @@
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"20"
>
<Cell
ss:MergeDown=
"14"
ss:StyleID=
"s166"
><Data
ss:Type=
"String"
>
检测依据
</Data><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s167"
><ss:Data
ss:Type=
"String"
xmlns=
"http://www.w3.org/TR/REC-html40"
>
<Font
html:Face=
"楷体"
x:Family=
"Modern"
>
${firstMethodName}
</Font><Font>
</Font></ss:Data><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s167"
>
<ss:Data
ss:Type=
"String"
xmlns=
"http://www.w3.org/TR/REC-html40"
>
<Font
html:Face=
"楷体"
x:Family=
"Modern"
>
${firstMethodName}
</Font>
<Font>
</Font>
</ss:Data><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"4"
ss:StyleID=
"s168"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"9"
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
...
...
@@ -4052,9 +4052,16 @@
</Row>
<
/#if>
<
/#if>
<
#--如果检测依据信息
不
为空-->
<
#--如果检测依据信息为空-->
<
#if ! methodNames??>
<
#list 1..(2-12) as i>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"20"
>
<Cell
ss:Index=
"2"
ss:MergeAcross=
"2"
ss:StyleID=
"m2194692801716"
><Data
ss:Type=
"String"
>
以下空白
</Data><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"9"
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
</Row>
<
#list 1..(2-14) as i>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"17.25"
>
<Cell
ss:Index=
"2"
ss:StyleID=
"s167"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s173"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
...
...
@@ -4078,19 +4085,16 @@
<
/#if>
<
#-- 仪器设备 9 -->
<
#--插入第一个设备-->
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"18"
ss:StyleID=
"s173"
>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"18"
>
<Cell
ss:MergeDown=
"8"
ss:StyleID=
"s187"
><Data
ss:Type=
"String"
>
主要仪器设备(编号)
</Data><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s178"
>
<ss:Data
ss:Type=
"String"
xmlns=
"http://www.w3.org/TR/REC-html40"
>
<Font
html:Size=
"12"
>
${firstEquipment}
</Font><Font
html:Face=
"Times New Roman"
x:Family=
"Roman"
html:Size=
"12"
>
</Font></ss:Data>
<NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"4"
ss:StyleID=
"s562"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"6"
ss:StyleID=
"s185"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"8"
ss:StyleID=
"s122"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s167"
>
<ss:Data
ss:Type=
"String"
xmlns=
"http://www.w3.org/TR/REC-html40"
>
<Font
html:Face=
"楷体"
x:Family=
"Modern"
>
${firstEquipment}
</Font>
<Font
>
</Font>
</ss:Data>
<NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"4"
ss:StyleID=
"s168"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"9"
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
</Row>
...
...
@@ -4098,8 +4102,8 @@
<
#--如果设备信息不为空-->
<
#if equipmentNames??>
<
#list equipmentNames as item>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"18"
>
<Cell
ss:Index=
"2"
ss:StyleID=
"s1
79
"
>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"18"
ss:StyleID=
"s173"
>
<Cell
ss:Index=
"2"
ss:StyleID=
"s1
67
"
>
<ss:Data
ss:Type=
"String"
xmlns=
"http://www.w3.org/TR/REC-html40"
>
<Font
html:Size=
"12"
>
${item}
</Font>
<Font
html:Face=
"Times New Roman"
x:Family=
"Roman"
html:Size=
"12"
>
</Font>
...
...
@@ -4142,11 +4146,29 @@
<
/#if>
<
#--如果设备为空-->
<
#if ! equipmentNames??>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"20"
>
<Cell
ss:Index=
"2"
ss:MergeAcross=
"2"
ss:StyleID=
"m2194692801716"
><Data
ss:Type=
"String"
>
以下空白
</Data><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"9"
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
</Row>
<
#list 1..(2-8) as i>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"18"
>
<Cell
ss:Index=
"2"
ss:StyleID=
"s179"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"4"
ss:StyleID=
"s563"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"8"
ss:StyleID=
"s122"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Row
ss:AutoFitHeight=
"0"
ss:Height=
"17.25"
>
<Cell
ss:Index=
"2"
ss:StyleID=
"s167"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s173"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s174"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s122"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s122"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s122"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:StyleID=
"s122"
><NamedCell
ss:Name=
"_FilterDatabase"
/></Cell>
<Cell
ss:Index=
"11"
ss:StyleID=
"Default"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
<Cell
ss:StyleID=
"s122"
/>
...
...
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