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
0cff4e7d
Commit
0cff4e7d
authored
Oct 27, 2020
by
qinhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.报告统计--多平行样适配
2.质量检测详情修改
parent
d03b29ca
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
232 additions
and
184 deletions
+232
-184
ReportController.java
.../wise/sc/cement/business/controller/ReportController.java
+19
-11
EntrustReport.java
...java/cn/wise/sc/cement/business/entity/EntrustReport.java
+6
-1
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+2
-2
SampleCheckMapper.xml
.../wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
+5
-6
SixElementReport.java
...va/cn/wise/sc/cement/business/model/SixElementReport.java
+6
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+192
-162
application.yml
cement-business/src/main/resources/application.yml
+2
-2
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/ReportController.java
View file @
0cff4e7d
...
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.PathVariable;
...
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
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
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -90,7 +91,7 @@ public class ReportController {
...
@@ -90,7 +91,7 @@ public class ReportController {
//首页及封面导出
//首页及封面导出
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
ReportDetailVo
rts
=
iEntrustService
.
getReportDetail
(
entrustId
);
if
(
rts
==
null
){
if
(
rts
==
null
)
{
return
;
return
;
}
}
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
Map
<
String
,
Object
>
beanParams
=
new
HashMap
<>(
10
);
...
@@ -121,7 +122,7 @@ public class ReportController {
...
@@ -121,7 +122,7 @@ public class ReportController {
//化学工业导出
//化学工业导出
List
<
IndustrialReport
>
list1
=
iEntrustService
.
getSampleIndustrialCheck
(
entrustId
);
List
<
IndustrialReport
>
list1
=
iEntrustService
.
getSampleIndustrialCheck
(
entrustId
);
list1
.
forEach
(
this
::
initMapStr2AlongPro
);
list1
.
forEach
(
this
::
initMapStr2AlongPro
);
beanParams
.
put
(
"list3"
,
list1
);
beanParams
.
put
(
"list3"
,
list1
);
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告)"
,
"report.ftl"
,
WordUtil
.
writeWordReport
(
rts
.
getProjectName
()
+
"(报告)"
,
"report.ftl"
,
beanParams
,
response
,
FileExt
.
EXCL
);
beanParams
,
response
,
FileExt
.
EXCL
);
...
@@ -137,7 +138,10 @@ public class ReportController {
...
@@ -137,7 +138,10 @@ public class ReportController {
private
void
initMapStr2AlongPro
(
SixElementReport
sixElement
)
{
private
void
initMapStr2AlongPro
(
SixElementReport
sixElement
)
{
String
countResult
=
sixElement
.
getCountResults
();
String
countResult
=
sixElement
.
getCountResults
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
countResult
,
SixElementReport
.
Element
.
class
);
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
list
.
forEach
(
arg
->
countResultMap
.
put
(
arg
.
getName
(),
arg
.
getValue
()));
sixElement
.
setAl2o3
(
"-"
);
sixElement
.
setAl2o3
(
"-"
);
sixElement
.
setTio2
(
"-"
);
sixElement
.
setTio2
(
"-"
);
...
@@ -159,16 +163,19 @@ public class ReportController {
...
@@ -159,16 +163,19 @@ public class ReportController {
sixElement
.
setSo3
(
countResultMap
.
getOrDefault
(
SixElementKey
.
SO3
.
getKey
(),
"0"
));
sixElement
.
setSo3
(
countResultMap
.
getOrDefault
(
SixElementKey
.
SO3
.
getKey
(),
"0"
));
}
}
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
){
private
void
initMapStr2AlongPro
(
IndustrialReport
industrialReport
)
{
String
countResult
=
industrialReport
.
getCountResults
();
String
countResult
=
industrialReport
.
getCountResults
();
HashMap
<
String
,
String
>
countResultMap
=
JSON
.
parseObject
(
countResult
,
HashMap
.
class
);
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
countResult
,
SixElementReport
.
Element
.
class
);
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
list
.
forEach
(
arg
->
countResultMap
.
put
(
arg
.
getName
(),
arg
.
getValue
()));
industrialReport
.
setMad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Mad
.
getKey
(),
"0"
));
industrialReport
.
setMjkg
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
QnetAdMJkg
.
getKey
(),
"0"
));
industrialReport
.
setAad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Aad
.
getKey
(),
"0"
));
industrialReport
.
setStad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
StAd
.
getKey
(),
"0"
));
industrialReport
.
setJz
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
JZ
.
getKey
(),
"0"
));
industrialReport
.
setVad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Vad
.
getKey
(),
"0"
));
industrialReport
.
setMad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Mad
.
getKey
(),
"0"
));
industrialReport
.
setMjkg
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
QnetAdMJkg
.
getKey
(),
"0"
));
industrialReport
.
setStad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
StAd
.
getKey
(),
"0"
));
industrialReport
.
setVad
(
countResultMap
.
getOrDefault
(
IndustrialElementKey
.
Vad
.
getKey
(),
"0"
));
}
}
...
@@ -194,4 +201,5 @@ public class ReportController {
...
@@ -194,4 +201,5 @@ public class ReportController {
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
return
strBuilder
.
replace
(
0
,
5
,
""
).
toString
();
}
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/EntrustReport.java
View file @
0cff4e7d
...
@@ -72,7 +72,7 @@ public class EntrustReport {
...
@@ -72,7 +72,7 @@ public class EntrustReport {
/**
/**
* 机械仪器名字
* 机械仪器名字
*/
*/
private
String
equipmentName
;
private
String
equipmentName
;
/**
/**
* 用户id
* 用户id
...
@@ -93,4 +93,9 @@ public class EntrustReport {
...
@@ -93,4 +93,9 @@ public class EntrustReport {
* 样品创建时间
* 样品创建时间
*/
*/
private
Date
sendTime
;
private
Date
sendTime
;
/**
* 器械id
*/
private
Integer
equipmentId
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
0cff4e7d
...
@@ -229,9 +229,9 @@
...
@@ -229,9 +229,9 @@
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
RIGHT JOIN
RIGHT JOIN
(SELECT id,entrust_id,team_ids,method_numbers,name,scct.check_id,
(SELECT id,entrust_id,team_ids,method_numbers,name,scct.check_id,
scct.equipment_name,scct.user_id,create_time as send_time FROM sample s
scct.equipment_name,scct.user_id,create_time as send_time
,scct.equipment_id
FROM sample s
RIGHT JOIN
RIGHT JOIN
(SELECT check_id,equipment_name,sample_id,user_id FROM sample_check_team sct
(SELECT check_id,equipment_name,sample_id,user_id
,equipment_id
FROM sample_check_team sct
RIGHT JOIN
RIGHT JOIN
(SELECT entrust_id,id FROM sample_check WHERE entrust_id = #{entrustId}) sc
(SELECT entrust_id,id FROM sample_check WHERE entrust_id = #{entrustId}) sc
ON sct.check_id = sc.id ) scct
ON sct.check_id = sc.id ) scct
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleCheckMapper.xml
View file @
0cff4e7d
...
@@ -4,17 +4,16 @@
...
@@ -4,17 +4,16 @@
<select
id=
"getSampleSixElementCheck"
resultType=
"cn.wise.sc.cement.business.model.SixElementReport"
>
<select
id=
"getSampleSixElementCheck"
resultType=
"cn.wise.sc.cement.business.model.SixElementReport"
>
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id FROM sample_check sc
SELECT * FROM (SELECT count_results,entrust_id,team_group_name,sct.sample_id
,sc.id
FROM sample_check sc
LEFT JOIN
LEFT JOIN
(SELECT check_id,sample_id FROM sample_check_team) sct
(SELECT check_id,sample_id FROM sample_check_team) sct
ON sct.check_id = sc.id
ON sct.check_id = sc.id
AND sc. is_parallel = 0
WHERE sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
WHERE sct.sample_id IS NOT NULL AND sc.team_group_name = '六元素' ) sscct
RIGHT JOIN
RIGHT JOIN
(SELECT cement_code,sample_code,sample_form,`name` as sample_nam
e,weight,id
(SELECT cement_code,sample_code,sample_form,`name` as sample_name,parallel_cod
e,weight,id
FROM sample) s
FROM sample) s
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
ON s.id = sscct.sample_id AND entrust_id = #{entrustId}
WHERE count_results IS NOT NULL;
WHERE count_results IS NOT NULL
AND s.parallel_code = cement_code
;
</select>
</select>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.IndustrialReport"
>
<select
id=
"getSampleIndustrialCheck"
resultType=
"cn.wise.sc.cement.business.model.IndustrialReport"
>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/SixElementReport.java
View file @
0cff4e7d
...
@@ -62,4 +62,10 @@ public class SixElementReport implements Serializable {
...
@@ -62,4 +62,10 @@ public class SixElementReport implements Serializable {
private
String
al2o3
=
""
;
private
String
al2o3
=
""
;
private
String
tio2
=
""
;
private
String
tio2
=
""
;
@Data
public
static
class
Element
implements
Serializable
{
private
String
name
;
private
String
value
;
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
0cff4e7d
...
@@ -111,6 +111,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -111,6 +111,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
private
ClientMapper
clientMapper
;
private
ClientMapper
clientMapper
;
@Autowired
@Autowired
private
ISysUserMessageService
userMessageService
;
private
ISysUserMessageService
userMessageService
;
@Resource
private
EquipmentMapper
equipmentMapper
;
/**
/**
* 委托分页
* 委托分页
...
@@ -266,13 +268,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -266,13 +268,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
}
//选择Mg必须选择Ca;选择Al必须选择Fe
//选择Mg必须选择Ca;选择Al必须选择Fe
if
(
teamNameList
.
contains
(
"MgO"
))
{
if
(
teamNameList
.
contains
(
"MgO"
))
{
if
(!
teamNameList
.
contains
(
"CaO"
))
{
if
(!
teamNameList
.
contains
(
"CaO"
))
{
return
BaseResponse
.
errorMsg
(
"选择MgO必须要选择CaO"
);
return
BaseResponse
.
errorMsg
(
"选择MgO必须要选择CaO"
);
}
}
}
}
if
(
teamNameList
.
contains
(
"Al2O3"
))
{
if
(
teamNameList
.
contains
(
"Al2O3"
))
{
if
(!
teamNameList
.
contains
(
"Fe2O3"
))
{
if
(!
teamNameList
.
contains
(
"Fe2O3"
))
{
return
BaseResponse
.
errorMsg
(
"选择Al2O3必须要选择Fe2O3"
);
return
BaseResponse
.
errorMsg
(
"选择Al2O3必须要选择Fe2O3"
);
}
}
}
}
...
@@ -290,8 +292,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -290,8 +292,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
approvalId
==
null
)
{
if
(
approvalId
==
null
)
{
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
}
}
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
approvalId
,
"您有一条新的委托单申请等待评审"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
approvalId
,
"您有一条新的委托单申请等待评审"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
if
(
wrapper
.
getCode
()
!=
200
)
{
if
(
wrapper
.
getCode
()
!=
200
)
{
return
wrapper
;
return
wrapper
;
}
}
return
BaseResponse
.
okData
(
entrust
);
return
BaseResponse
.
okData
(
entrust
);
...
@@ -495,6 +497,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -495,6 +497,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
userMessageService
.
checkMessage
(
loginUser
.
getId
(),
id
,
SysUserMessage
.
MessageType
.
ENTRUST
);
userMessageService
.
checkMessage
(
loginUser
.
getId
(),
id
,
SysUserMessage
.
MessageType
.
ENTRUST
);
return
BaseResponse
.
okData
(
entrustVo
);
return
BaseResponse
.
okData
(
entrustVo
);
}
}
/**
/**
* 详情-基本信息
* 详情-基本信息
*
*
...
@@ -791,7 +794,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -791,7 +794,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
cementCodeInteger
<=
integerMaxCode
)
{
if
(
cementCodeInteger
<=
integerMaxCode
)
{
return
BaseResponse
.
errorMsg
(
"本所编号必须大于最大值"
);
return
BaseResponse
.
errorMsg
(
"本所编号必须大于最大值"
);
}
}
if
(
sampleQuery
.
getIsParallel
()
==
null
)
{
if
(
sampleQuery
.
getIsParallel
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请选择是否需要平行样"
);
return
BaseResponse
.
errorMsg
(
"请选择是否需要平行样"
);
}
}
if
(
sampleQuery
.
getIsParallel
()
==
0
)
{
//非平行样
if
(
sampleQuery
.
getIsParallel
()
==
0
)
{
//非平行样
...
@@ -807,15 +810,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -807,15 +810,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setIsCheck
(
0
)
//样品校核未完成状态
.
setIsCheck
(
0
)
//样品校核未完成状态
.
setParallelCode
(
sampleQuery
.
getCementCode
());
.
setParallelCode
(
sampleQuery
.
getCementCode
());
sampleList
.
add
(
sample
);
sampleList
.
add
(
sample
);
}
else
{
//是平行样
}
else
{
//是平行样
if
(
sampleQuery
.
getIsParallel
()
<
2
)
{
if
(
sampleQuery
.
getIsParallel
()
<
2
)
{
return
BaseResponse
.
errorMsg
(
"平行样数量至少2条"
);
return
BaseResponse
.
errorMsg
(
"平行样数量至少2条"
);
}
}
if
(
sampleQuery
.
getIsParallel
()
>
4
)
{
if
(
sampleQuery
.
getIsParallel
()
>
4
)
{
return
BaseResponse
.
errorMsg
(
"平行样数量最多4条"
);
return
BaseResponse
.
errorMsg
(
"平行样数量最多4条"
);
}
}
for
(
int
i
=
0
;
i
<
sampleQuery
.
getIsParallel
();
i
++)
{
for
(
int
i
=
0
;
i
<
sampleQuery
.
getIsParallel
();
i
++)
{
integerMaxCode
=
cementCodeInteger
>
integerMaxCode
?
cementCodeInteger
:
integerMaxCode
+
1
;
integerMaxCode
=
cementCodeInteger
>
integerMaxCode
?
cementCodeInteger
:
integerMaxCode
+
1
;
String
yearStr
=
commonService
.
getIntegerYear
(
sampleQuery
.
getCementCode
());
String
yearStr
=
commonService
.
getIntegerYear
(
sampleQuery
.
getCementCode
());
maxCementCode
=
yearStr
+
"-"
+
commonService
.
getCementCode
(
integerMaxCode
);
maxCementCode
=
yearStr
+
"-"
+
commonService
.
getCementCode
(
integerMaxCode
);
Sample
sample
=
new
Sample
();
Sample
sample
=
new
Sample
();
...
@@ -839,7 +842,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -839,7 +842,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
entrust
.
setStatus
(
1
).
setProjectType
(
query
.
getProjectType
());
entrust
.
setStatus
(
1
).
setProjectType
(
query
.
getProjectType
());
//审批后生成委托编号
//审批后生成委托编号
String
entrustCode
=
entrust
.
getProjectCode
()
+
"_"
+
query
.
getSampleList
().
get
(
0
).
getCementCode
();
String
entrustCode
=
entrust
.
getProjectCode
()
+
"_"
+
query
.
getSampleList
().
get
(
0
).
getCementCode
();
entrust
.
setEntrustCode
(
entrustCode
);
entrust
.
setEntrustCode
(
entrustCode
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改评审状态为“通过”"
,
null
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"修改评审状态为“通过”"
,
null
);
}
else
if
(
query
.
getIsAgree
()
==
2
)
{
//驳回
}
else
if
(
query
.
getIsAgree
()
==
2
)
{
//驳回
...
@@ -923,8 +926,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -923,8 +926,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleHandleEnclosureService
.
saveBatch
(
sampleHandleEnclosureList
);
sampleHandleEnclosureService
.
saveBatch
(
sampleHandleEnclosureList
);
}
}
//消息推送
//消息推送
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
sampleHandle
.
getUserId
(),
"您有一条样品处理信息等待处理"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
sampleHandle
.
getUserId
(),
"您有一条样品处理信息等待处理"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
if
(
wrapper
.
getCode
()
!=
200
)
{
if
(
wrapper
.
getCode
()
!=
200
)
{
return
wrapper
;
return
wrapper
;
}
}
}
}
...
@@ -1197,9 +1200,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1197,9 +1200,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sample
.
getIsParallel
()
==
0
)
{
if
(
sample
.
getIsParallel
()
==
0
)
{
sample
.
setIsHandle
(
1
);
//样品处理全部完成
sample
.
setIsHandle
(
1
);
//样品处理全部完成
sampleMapper
.
updateById
(
sample
);
sampleMapper
.
updateById
(
sample
);
}
else
{
}
else
{
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
if
(
sampleList1
.
size
()
<
2
)
{
if
(
sampleList1
.
size
()
<
2
)
{
return
BaseResponse
.
errorMsg
(
"平行样样品数量信息错误"
);
return
BaseResponse
.
errorMsg
(
"平行样样品数量信息错误"
);
}
}
// 如果是平行样,平行样的状态也改成已处理完成
// 如果是平行样,平行样的状态也改成已处理完成
...
@@ -1278,8 +1281,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1278,8 +1281,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setCreateTime
(
LocalDateTime
.
now
());
.
setCreateTime
(
LocalDateTime
.
now
());
sampleDistributionList
.
add
(
sampleDistribution
);
sampleDistributionList
.
add
(
sampleDistribution
);
//消息推送
//消息推送
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
distributionTeamQuery
.
getUserId
(),
"您有一条样品检测信息等待接受"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
BaseResponse
wrapper
=
userMessageService
.
sendMessage
(
distributionTeamQuery
.
getUserId
(),
"您有一条样品检测信息等待接受"
,
entrust
.
getId
(),
SysUserMessage
.
MessageType
.
ENTRUST
);
if
(
wrapper
.
getCode
()
!=
200
)
{
if
(
wrapper
.
getCode
()
!=
200
)
{
return
wrapper
;
return
wrapper
;
}
}
}
}
...
@@ -1632,12 +1635,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1632,12 +1635,12 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
List
<
Sample
>
sampleList1
=
sampleMapper
.
getByCementCode
(
entrust
.
getId
(),
sample
.
getCementCode
());
//检测人员只能看到自己则的检测内容
//检测人员只能看到自己则的检测内容
if
(
sampleList1
.
size
()
>
1
)
{
if
(
sampleList1
.
size
()
>
1
)
{
for
(
Sample
sample1
:
sampleList1
)
{
for
(
Sample
sample1
:
sampleList1
)
{
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList2
=
distributionMapper
.
getDistributionTeamList
(
sample1
.
getId
(),
null
);
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList2
=
distributionMapper
.
getDistributionTeamList
(
sample1
.
getId
(),
null
);
if
(
sampleDistributionTeamVoList2
.
size
()
==
sampleDistributionTeamVoList
.
size
())
{
if
(
sampleDistributionTeamVoList2
.
size
()
==
sampleDistributionTeamVoList
.
size
())
{
for
(
int
i
=
0
;
i
<
sampleDistributionTeamVoList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
sampleDistributionTeamVoList
.
size
();
i
++)
{
SampleDistributionTeamVo
sdtvo
=
sampleDistributionTeamVoList
.
get
(
i
);
SampleDistributionTeamVo
sdtvo
=
sampleDistributionTeamVoList
.
get
(
i
);
if
(!
sdtvo
.
getUserName
().
contains
(
sampleDistributionTeamVoList2
.
get
(
i
).
getUserName
()))
{
if
(!
sdtvo
.
getUserName
().
contains
(
sampleDistributionTeamVoList2
.
get
(
i
).
getUserName
()))
{
sdtvo
.
setUserName
(
sdtvo
.
getUserName
()
+
"、"
+
sampleDistributionTeamVoList2
.
get
(
i
).
getUserName
());
sdtvo
.
setUserName
(
sdtvo
.
getUserName
()
+
"、"
+
sampleDistributionTeamVoList2
.
get
(
i
).
getUserName
());
}
}
}
}
...
@@ -1736,7 +1739,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1736,7 +1739,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
sampleCheckVo
.
setSampleCheckGroupVoList
(
sctVoList
);
sampleCheckVo
.
setSampleCheckGroupVoList
(
sctVoList
);
sampleCheckVoList
.
add
(
sampleCheckVo
);
sampleCheckVoList
.
add
(
sampleCheckVo
);
}
else
{
//未参与校核计算的
}
else
{
//未参与校核计算的
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
...
@@ -1749,9 +1752,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1749,9 +1752,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
//根据检测组id返回检测组对应的所有检测项信息
//根据检测组id返回检测组对应的所有检测项信息
// List<String> checkResutlList = teamMapper.getByGroup(teamGroup.getId());
// List<String> checkResutlList = teamMapper.getByGroup(teamGroup.getId());
List
<
Map
<
String
,
String
>>
checkResutlList2
=
teamMapper
.
getListByGroup
(
teamGroup
.
getId
());
List
<
Map
<
String
,
String
>>
checkResutlList2
=
teamMapper
.
getListByGroup
(
teamGroup
.
getId
());
JSONArray
jsonArray
=
new
JSONArray
();
JSONArray
jsonArray
=
new
JSONArray
();
for
(
Map
<
String
,
String
>
cr
:
checkResutlList2
)
{
for
(
Map
<
String
,
String
>
cr
:
checkResutlList2
)
{
jsonArray
.
add
(
cr
);
jsonArray
.
add
(
cr
);
}
}
String
checkResut_String
=
JSON
.
toJSON
(
jsonArray
).
toString
();
String
checkResut_String
=
JSON
.
toJSON
(
jsonArray
).
toString
();
...
@@ -1759,7 +1762,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1759,7 +1762,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckVo
.
setCountResults
(
checkResut_String
);
sampleCheckVo
.
setCountResults
(
checkResut_String
);
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
for
(
Sample
sample
:
sampleList
)
{
for
(
Sample
sample
:
sampleList
)
{
...
@@ -1840,7 +1842,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1840,7 +1842,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
SampleCheck
check
=
null
;
SampleCheck
check
=
null
;
//保存校核表信息
//保存校核表信息
if
(
query
.
getId
()
==
null
)
{
if
(
query
.
getId
()
==
null
)
{
check
=
new
SampleCheck
();
check
=
new
SampleCheck
();
check
.
setEntrustId
(
entrust
.
getId
())
check
.
setEntrustId
(
entrust
.
getId
())
.
setCementCode
(
query
.
getCementCode
())
.
setCementCode
(
query
.
getCementCode
())
...
@@ -1851,7 +1853,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1851,7 +1853,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setIsParallel
(
query
.
getIsParallel
())
.
setIsParallel
(
query
.
getIsParallel
())
.
setCreateTime
(
LocalDateTime
.
now
());
.
setCreateTime
(
LocalDateTime
.
now
());
sampleCheckMapper
.
insert
(
check
);
sampleCheckMapper
.
insert
(
check
);
}
else
{
}
else
{
check
=
sampleCheckMapper
.
selectById
(
query
.
getId
());
check
=
sampleCheckMapper
.
selectById
(
query
.
getId
());
}
}
//返回信息:样品的计算结果集合
//返回信息:样品的计算结果集合
...
@@ -1862,19 +1864,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1862,19 +1864,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
//该检测项的每个样品的检测计算结果集合
//该检测项的每个样品的检测计算结果集合
List
<
Map
<
String
,
String
>>
resultMapList
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
resultMapList
=
new
ArrayList
<>();
for
(
CheckCountSampleQuery
sampleQuery
:
query
.
getSampleList
())
{
for
(
CheckCountSampleQuery
sampleQuery
:
query
.
getSampleList
())
{
if
(
sampleQuery
.
getSmapleId
()
==
null
)
{
if
(
sampleQuery
.
getSmapleId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
}
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getParallelCode
()))
{
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getParallelCode
()))
{
return
BaseResponse
.
errorMsg
(
"请传入平行样编号"
);
return
BaseResponse
.
errorMsg
(
"请传入平行样编号"
);
}
}
if
(
sampleQuery
.
getUserId
()
==
null
)
{
if
(
sampleQuery
.
getUserId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请传入检测人id"
);
return
BaseResponse
.
errorMsg
(
"请传入检测人id"
);
}
}
if
(
sampleQuery
.
getEquipmentId
()
==
null
||
StringUtils
.
isEmpty
(
sampleQuery
.
getEquipmentName
()))
{
if
(
sampleQuery
.
getEquipmentId
()
==
null
||
StringUtils
.
isEmpty
(
sampleQuery
.
getEquipmentName
()))
{
return
BaseResponse
.
errorMsg
(
"请传选择检测设备"
);
return
BaseResponse
.
errorMsg
(
"请传选择检测设备"
);
}
}
if
(
sampleQuery
.
getIntputResult
()
==
null
)
{
if
(
sampleQuery
.
getIntputResult
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请输入检测数据"
);
return
BaseResponse
.
errorMsg
(
"请输入检测数据"
);
}
}
JSONArray
inputResult_jsonArray
=
commonService
.
mapToJSONArray
(
sampleQuery
.
getIntputResult
());
JSONArray
inputResult_jsonArray
=
commonService
.
mapToJSONArray
(
sampleQuery
.
getIntputResult
());
...
@@ -1888,7 +1890,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1888,7 +1890,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
System
.
out
.
println
(
resultMap_String
);
System
.
out
.
println
(
resultMap_String
);
//保存校核检测组检测项信息
//保存校核检测组检测项信息
SampleCheckTeam
sampleCheckTeam
=
null
;
SampleCheckTeam
sampleCheckTeam
=
null
;
if
(
sampleQuery
.
getId
()
==
null
)
{
if
(
sampleQuery
.
getId
()
==
null
)
{
sampleCheckTeam
=
new
SampleCheckTeam
();
sampleCheckTeam
=
new
SampleCheckTeam
();
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
.
setSampleId
(
sampleQuery
.
getSmapleId
())
.
setSampleId
(
sampleQuery
.
getSmapleId
())
...
@@ -1914,7 +1916,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1914,7 +1916,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
.
setCreateTime
(
LocalDateTime
.
now
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
"委托派发-数据校核"
);
.
setRemark
(
"委托派发-数据校核"
);
equipmentUseMapper
.
insert
(
equipmentUse2
);
equipmentUseMapper
.
insert
(
equipmentUse2
);
}
else
{
}
else
{
sampleCheckTeam
=
sampleCheckTeamMapper
.
selectById
(
sampleQuery
.
getId
());
sampleCheckTeam
=
sampleCheckTeamMapper
.
selectById
(
sampleQuery
.
getId
());
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
.
setInputResult
(
inputResult_String
)
.
setInputResult
(
inputResult_String
)
...
@@ -1924,104 +1926,104 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1924,104 +1926,104 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
countResultMap
.
put
(
"resultMapList"
,
resultMapList
);
countResultMap
.
put
(
"resultMapList"
,
resultMapList
);
//计算最终计算结果 和 结果误差值
//计算最终计算结果 和 结果误差值
Map
<
String
,
String
>
groupMap
=
new
HashMap
<>();
//"L.O.I":"1,2,3,4..."
Map
<
String
,
String
>
groupMap
=
new
HashMap
<>();
//"L.O.I":"1,2,3,4..."
if
(
resultMapList
!=
null
&&
resultMapList
.
size
()>
0
)
{
if
(
resultMapList
!=
null
&&
resultMapList
.
size
()
>
0
)
{
for
(
String
name
:
checkResutlList
)
{
for
(
String
name
:
checkResutlList
)
{
if
(
name
.
equals
(
"L.O.I"
))
{
if
(
name
.
equals
(
"L.O.I"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"SiO2"
))
{
}
else
if
(
name
.
equals
(
"SiO2"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"Al2O3+TiO2"
))
{
}
else
if
(
name
.
equals
(
"Al2O3+TiO2"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"Al2O3"
))
{
}
else
if
(
name
.
equals
(
"Al2O3"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"Fe2O3"
))
{
}
else
if
(
name
.
equals
(
"Fe2O3"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"CaO"
))
{
}
else
if
(
name
.
equals
(
"CaO"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"MgO"
))
{
}
else
if
(
name
.
equals
(
"MgO"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"TiO2"
))
{
}
else
if
(
name
.
equals
(
"TiO2"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"K2O"
))
{
}
else
if
(
name
.
equals
(
"K2O"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"Na2O"
))
{
}
else
if
(
name
.
equals
(
"Na2O"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"SO3"
))
{
}
else
if
(
name
.
equals
(
"SO3"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"Cl"
))
{
}
else
if
(
name
.
equals
(
"Cl"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"合量"
))
{
}
else
if
(
name
.
equals
(
"合量"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"KH"
))
{
}
else
if
(
name
.
equals
(
"KH"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"SM"
))
{
}
else
if
(
name
.
equals
(
"SM"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
if
(
name
.
equals
(
"AM"
))
{
}
else
if
(
name
.
equals
(
"AM"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
)
{
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()
==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
?
map
.
get
(
name
)
:
groupMap
.
get
(
name
)
+
","
+
map
.
get
(
name
));
}
}
}
else
{
}
else
{
groupMap
.
put
(
name
,
"0"
);
groupMap
.
put
(
name
,
"0"
);
...
@@ -2029,13 +2031,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2029,13 +2031,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
}
//计算平行样的平均值 最大误差值
//计算平行样的平均值 最大误差值
Map
<
String
,
Map
<
String
,
String
>>
mapResult
=
CheckCountUtil
.
countParallelAvgError
(
groupMap
);
Map
<
String
,
Map
<
String
,
String
>>
mapResult
=
CheckCountUtil
.
countParallelAvgError
(
groupMap
);
if
(
mapResult
!=
null
)
{
if
(
mapResult
!=
null
)
{
Map
<
String
,
String
>
countResults
=
mapResult
.
get
(
"countResults"
);
Map
<
String
,
String
>
countResults
=
mapResult
.
get
(
"countResults"
);
JSONArray
countResults_jsonArray
=
commonService
.
mapToJSONArray
(
countResults
);
JSONArray
countResults_jsonArray
=
commonService
.
mapToJSONArray
(
countResults
);
String
countResults_String
=
JSON
.
toJSON
(
countResults_jsonArray
).
toString
();
String
countResults_String
=
JSON
.
toJSON
(
countResults_jsonArray
).
toString
();
System
.
out
.
println
(
countResults_String
);
System
.
out
.
println
(
countResults_String
);
Map
<
String
,
String
>
countError
=
mapResult
.
get
(
"countError"
);
Map
<
String
,
String
>
countError
=
mapResult
.
get
(
"countError"
);
JSONArray
countError_jsonArray
=
commonService
.
mapToJSONArray
(
countError
);
JSONArray
countError_jsonArray
=
commonService
.
mapToJSONArray
(
countError
);
String
countError_String
=
JSON
.
toJSON
(
countError_jsonArray
).
toString
();
String
countError_String
=
JSON
.
toJSON
(
countError_jsonArray
).
toString
();
System
.
out
.
println
(
countError_String
);
System
.
out
.
println
(
countError_String
);
...
@@ -2047,19 +2049,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2047,19 +2049,19 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
}
}
Boolean
ret
=
true
;
//全部校核计算完成
Boolean
ret
=
true
;
//全部校核计算完成
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
query
.
getSampleList
().
get
(
0
).
getSmapleId
());
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
query
.
getSampleList
().
get
(
0
).
getSmapleId
());
for
(
SampleCheckGroupVo
groupVo
:
sampleCheckGroupVoList
)
{
for
(
SampleCheckGroupVo
groupVo
:
sampleCheckGroupVoList
)
{
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
sampleCheckQW
.
eq
(
"entrust_id"
,
entrust
.
getId
());
sampleCheckQW
.
eq
(
"entrust_id"
,
entrust
.
getId
());
sampleCheckQW
.
eq
(
"cement_code"
,
query
.
getCementCode
());
sampleCheckQW
.
eq
(
"cement_code"
,
query
.
getCementCode
());
sampleCheckQW
.
eq
(
"team_group_id"
,
groupVo
.
getTeamGroupId
());
sampleCheckQW
.
eq
(
"team_group_id"
,
groupVo
.
getTeamGroupId
());
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
if
(
sampleCheckList
==
null
||
sampleCheckList
.
size
()==
0
)
{
if
(
sampleCheckList
==
null
||
sampleCheckList
.
size
()
==
0
)
{
ret
=
false
;
//有一个检测组没有校核,证明校核没有完成
ret
=
false
;
//有一个检测组没有校核,证明校核没有完成
}
}
}
}
//如果检测组的校核全部完成
//如果检测组的校核全部完成
if
(
ret
)
{
if
(
ret
)
{
//更新样品表状态为已经校核状态 is_check 0未处理 1处理完成
//更新样品表状态为已经校核状态 is_check 0未处理 1处理完成
QueryWrapper
<
Sample
>
sampleQW
=
new
QueryWrapper
<>();
QueryWrapper
<
Sample
>
sampleQW
=
new
QueryWrapper
<>();
sampleQW
.
eq
(
"cement_code"
,
query
.
getCementCode
());
sampleQW
.
eq
(
"cement_code"
,
query
.
getCementCode
());
...
@@ -2205,7 +2207,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2205,7 +2207,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
logsService.saveLog(SysLogs.ObjType.ENTRUST_LOG, entrust.getId(), "数据校核", null);
logsService.saveLog(SysLogs.ObjType.ENTRUST_LOG, entrust.getId(), "数据校核", null);
return BaseResponse.okMsg("数据校核完成");
return BaseResponse.okMsg("数据校核完成");
}*/
}*/
@Override
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
public
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
...
@@ -2267,7 +2268,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2267,7 +2268,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
String
teamKey
=
"CACHE:TEAM"
;
String
teamKey
=
"CACHE:TEAM"
;
String
methodKey
=
"CACHE:METHOD"
;
String
methodKey
=
"CACHE:METHOD"
;
//缓存 60s
//缓存 60s
if
(!
redisUtil
.
existsKey
(
teamKey
))
{
if
(!
redisUtil
.
existsKey
(
teamKey
))
{
List
<
Team
>
teams
=
teamMapper
.
selectList
(
new
QueryWrapper
<>());
List
<
Team
>
teams
=
teamMapper
.
selectList
(
new
QueryWrapper
<>());
...
@@ -2279,6 +2279,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2279,6 +2279,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
String
value
=
JSON
.
toJSONString
(
methods
);
String
value
=
JSON
.
toJSONString
(
methods
);
redisUtil
.
setString
(
methodKey
,
value
,
60
);
redisUtil
.
setString
(
methodKey
,
value
,
60
);
}
}
List
<
Team
>
teams
=
JSON
.
parseArray
(
redisUtil
.
getString
(
teamKey
)
+
""
,
Team
.
class
);
List
<
Team
>
teams
=
JSON
.
parseArray
(
redisUtil
.
getString
(
teamKey
)
+
""
,
Team
.
class
);
List
<
Method
>
methods
=
JSON
.
parseArray
(
redisUtil
.
getString
(
methodKey
)
+
""
,
Method
.
class
);
List
<
Method
>
methods
=
JSON
.
parseArray
(
redisUtil
.
getString
(
methodKey
)
+
""
,
Method
.
class
);
list
.
forEach
(
arg
->
{
list
.
forEach
(
arg
->
{
...
@@ -2310,6 +2311,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2310,6 +2311,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
});
});
}
}
});
});
if
(
list
.
size
()
!=
0
)
{
if
(
list
.
size
()
!=
0
)
{
...
@@ -2401,7 +2404,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2401,7 +2404,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
null
;
return
null
;
}
}
//处理inputValue
//处理inputValue
qualityDetails
.
forEach
(
arg
->
arg
.
setInputResult
(
mapStringToMap
(
arg
.
getInputResult
())));
qualityDetails
.
forEach
(
arg
->
{
String
inputResult
=
arg
.
getInputResult
();
List
<
SixElementReport
.
Element
>
list
=
JSON
.
parseArray
(
inputResult
,
SixElementReport
.
Element
.
class
);
HashMap
<
String
,
String
>
countResultMap
=
new
HashMap
<>(
list
.
size
());
list
.
forEach
(
opt
->
countResultMap
.
put
(
opt
.
getName
(),
opt
.
getValue
()));
arg
.
setInputResult
(
JSON
.
toJSONString
(
countResultMap
));
});
QualityDetail
firstQualityDetail
=
qualityDetails
.
get
(
0
);
QualityDetail
firstQualityDetail
=
qualityDetails
.
get
(
0
);
QualityDetailVo
qualityDetailVo
=
new
QualityDetailVo
();
QualityDetailVo
qualityDetailVo
=
new
QualityDetailVo
();
...
@@ -2512,6 +2523,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2512,6 +2523,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
rts
.
setSampleNames
(
new
HashSet
<>(
source
.
size
()));
rts
.
setSampleNames
(
new
HashSet
<>(
source
.
size
()));
rts
.
setMethodNames
(
new
HashSet
<>(
source
.
size
()));
rts
.
setMethodNames
(
new
HashSet
<>(
source
.
size
()));
rts
.
setTeamNames
(
new
HashSet
<>(
source
.
size
()));
rts
.
setTeamNames
(
new
HashSet
<>(
source
.
size
()));
//关联检测仪器
String
equipmentKey
=
"CACHE:EQUIPMENT"
;
if
(!
redisUtil
.
existsKey
(
equipmentKey
))
{
List
<
Equipment
>
equipments
=
equipmentMapper
.
selectList
(
new
QueryWrapper
<>());
String
value
=
JSON
.
toJSONString
(
equipments
);
redisUtil
.
setString
(
equipmentKey
,
value
,
60
);
}
List
<
Equipment
>
equipments
=
JSON
.
parseArray
(
redisUtil
.
getString
(
equipmentKey
)
+
""
,
Equipment
.
class
);
source
.
forEach
(
arg
->
{
source
.
forEach
(
arg
->
{
//关联检测项目
//关联检测项目
if
(
StrUtil
.
isNotBlank
(
arg
.
getTeamName
()))
{
if
(
StrUtil
.
isNotBlank
(
arg
.
getTeamName
()))
{
...
@@ -2531,14 +2551,24 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2531,14 +2551,24 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
StrUtil
.
isNotBlank
(
arg
.
getName
()))
{
if
(
StrUtil
.
isNotBlank
(
arg
.
getName
()))
{
rts
.
getSampleNames
().
add
(
arg
.
getName
());
rts
.
getSampleNames
().
add
(
arg
.
getName
());
}
}
//关联检测仪器
if
(
StrUtil
.
isNotBlank
(
arg
.
getEntrustId
()
+
""
))
{
equipments
.
forEach
(
opt
->
{
if
(
opt
.
getId
().
intValue
()
==
arg
.
getEquipmentId
())
{
rts
.
getEquipmentNames
().
add
(
opt
.
getName
()
+
"("
+
opt
.
getCode
()
+
")"
);
}
});
}
});
});
rts
.
setSampleNum
(
rts
.
getSampleNames
().
size
());
rts
.
setSampleNum
(
rts
.
getSampleNames
().
size
());
//关联仪器名字 去重
//关联仪器名字 去重
List
<
String
>
equipmentNames
=
equipmentUseMapper
.
getEquipmentNamesByProjectId
(
firstReportDetail
.
getEntrustId
());
List
<
String
>
equipmentNames
=
equipmentUseMapper
.
getEquipmentNamesByProjectId
(
firstReportDetail
.
getEntrustId
());
equipmentNames
.
forEach
(
arg
->
rts
.
getEquipmentNames
().
add
(
arg
));
equipmentNames
.
forEach
(
arg
->
rts
.
getEquipmentNames
().
add
(
arg
));
//关联送样单位名字
//关联送样单位名字
String
clientKey
=
"CACHE:CLIENT"
;
String
clientKey
=
"CACHE:CLIENT"
;
if
(!
redisUtil
.
existsKey
(
clientKey
))
{
if
(!
redisUtil
.
existsKey
(
clientKey
))
{
...
...
cement-business/src/main/resources/application.yml
View file @
0cff4e7d
...
@@ -7,8 +7,8 @@ spring:
...
@@ -7,8 +7,8 @@ spring:
active
:
dev
active
:
dev
datasource
:
datasource
:
# 192.168.110.85 admin!@#123
# 192.168.110.85 admin!@#123
url
:
jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://192.168.110.85:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
#
url: jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
url
:
jdbc:mysql://81.68.92.175:3306/sinoma_tcdri?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=UTF-8&useSSL=false
username
:
root
username
:
root
password
:
admin!@#123
password
:
admin!@#123
driverClassName
:
com.mysql.cj.jdbc.Driver
driverClassName
:
com.mysql.cj.jdbc.Driver
...
...
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