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
8570c775
Commit
8570c775
authored
Oct 22, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委托管理 校核接口优化完成
parent
1d3887b3
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
470 additions
and
184 deletions
+470
-184
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+2
-2
WeiXinController.java
.../wise/sc/cement/business/controller/WeiXinController.java
+23
-0
SampleCheck.java
...n/java/cn/wise/sc/cement/business/entity/SampleCheck.java
+4
-11
SampleCheckTeam.java
...va/cn/wise/sc/cement/business/entity/SampleCheckTeam.java
+4
-1
CheckCountQuery.java
.../wise/sc/cement/business/model/query/CheckCountQuery.java
+13
-5
CheckCountSampleQuery.java
...sc/cement/business/model/query/CheckCountSampleQuery.java
+42
-0
SampleCheckTeamVo.java
...n/wise/sc/cement/business/model/vo/SampleCheckTeamVo.java
+8
-0
SampleCheckVo.java
...va/cn/wise/sc/cement/business/model/vo/SampleCheckVo.java
+8
-8
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+2
-2
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+305
-135
WeiXinService.java
...n/wise/sc/cement/business/service/impl/WeiXinService.java
+18
-18
CheckCountUtil.java
.../java/cn/wise/sc/cement/business/util/CheckCountUtil.java
+41
-2
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
8570c775
...
@@ -445,7 +445,7 @@ public class EntrustController {
...
@@ -445,7 +445,7 @@ public class EntrustController {
}
}
@ApiOperation
(
value
=
"数据校核"
)
/*
@ApiOperation(value = "数据校核")
@PostMapping("/check")
@PostMapping("/check")
public BaseResponse check(@RequestBody CheckQuery query) {
public BaseResponse check(@RequestBody CheckQuery query) {
try {
try {
...
@@ -454,7 +454,7 @@ public class EntrustController {
...
@@ -454,7 +454,7 @@ public class EntrustController {
log.debug("数据校核{}", e);
log.debug("数据校核{}", e);
}
}
return BaseResponse.errorMsg("失败!");
return BaseResponse.errorMsg("失败!");
}
}
*/
private
String
getTeamName
(
List
<
SampleDistributionTeamVo
>
teamVos
)
{
private
String
getTeamName
(
List
<
SampleDistributionTeamVo
>
teamVos
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/WeiXinController.java
View file @
8570c775
...
@@ -47,6 +47,29 @@ public class WeiXinController {
...
@@ -47,6 +47,29 @@ public class WeiXinController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@ApiOperation
(
value
=
"获取accessToken信息-小程序端"
)
@GetMapping
(
"/getAccessToken"
)
public
BaseResponse
getAccessToken
(){
try
{
String
accessToken
=
weiXinService
.
getAccessToken
();
return
BaseResponse
.
okData
(
accessToken
);
}
catch
(
Exception
e
){
log
.
debug
(
"获取accessToken信息-小程序端{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取accessToken信息-管理端"
)
@GetMapping
(
"/getPCAccessToken"
)
public
BaseResponse
getPCAccessToken
(){
try
{
String
accessToken
=
weiXinService
.
getPCAccessToken
();
return
BaseResponse
.
okData
(
accessToken
);
}
catch
(
Exception
e
){
log
.
debug
(
"获取accessToken信息-管理端{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"当前登录用户"
)
@ApiOperation
(
value
=
"当前登录用户"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleCheck.java
View file @
8570c775
...
@@ -43,14 +43,11 @@ public class SampleCheck implements Serializable {
...
@@ -43,14 +43,11 @@ public class SampleCheck implements Serializable {
@ApiModelProperty
(
"检测组名称"
)
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
private
String
teamGroupName
;
@ApiModelProperty
(
"主样校核计算结果json串"
)
private
String
mainMap
;
@ApiModelProperty
(
"次样校核计算结果json串"
)
private
String
secondaryMap
;
@ApiModelProperty
(
"最终校核计算结果json串"
)
@ApiModelProperty
(
"最终校核计算结果json串"
)
private
String
countResult
;
private
String
countResults
;
@ApiModelProperty
(
"误差值 计算结果json串"
)
private
String
countError
;
@ApiModelProperty
(
"是否平行样(1是,0否)"
)
@ApiModelProperty
(
"是否平行样(1是,0否)"
)
private
Integer
isParallel
;
private
Integer
isParallel
;
...
@@ -62,8 +59,4 @@ public class SampleCheck implements Serializable {
...
@@ -62,8 +59,4 @@ public class SampleCheck implements Serializable {
private
String
remark
;
private
String
remark
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleCheckTeam.java
View file @
8570c775
...
@@ -52,9 +52,12 @@ public class SampleCheckTeam implements Serializable {
...
@@ -52,9 +52,12 @@ public class SampleCheckTeam implements Serializable {
* json串
* json串
* {"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
* {"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
*/
@ApiModelProperty
(
"
校核人员
输入检测结果 json串"
)
@ApiModelProperty
(
"输入检测结果 json串"
)
private
String
inputResult
;
private
String
inputResult
;
@ApiModelProperty
(
"计算结果 json串"
)
private
String
countResult
;
@ApiModelProperty
(
"创建时间"
)
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
private
LocalDateTime
createTime
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/CheckCountQuery.java
View file @
8570c775
...
@@ -14,20 +14,28 @@ import java.util.Map;
...
@@ -14,20 +14,28 @@ import java.util.Map;
* @create: 2020-08-07 14:58
* @create: 2020-08-07 14:58
**/
**/
@Data
@Data
@ApiModel
(
"数据校核-校核计算接口请求"
)
@ApiModel
(
"数据校核-校核计算接口请求
(检测组)
"
)
public
class
CheckCountQuery
{
public
class
CheckCountQuery
{
@ApiModelProperty
(
"校核sample_check表id,不传id为新增,传id为修改"
)
private
Integer
id
;
@ApiModelProperty
(
"检测组表id"
)
@ApiModelProperty
(
"检测组表id"
)
private
Integer
teamGroupId
;
private
Integer
teamGroupId
;
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
@ApiModelProperty
(
"是否平行样(1是,0否)"
)
@ApiModelProperty
(
"是否平行样(1是,0否)"
)
private
Integer
isParallel
;
private
Integer
isParallel
;
@ApiModelProperty
(
"
主样输入信息
"
)
@ApiModelProperty
(
"
委托表id
"
)
private
Map
<
String
,
Object
>
mainResult
=
new
HashMap
<>()
;
private
Integer
entrustId
;
@ApiModelProperty
(
"
次样输入信息
"
)
@ApiModelProperty
(
"
本所编号
"
)
private
Map
<
String
,
Object
>
secondaryResult
=
new
HashMap
<>()
;
private
String
cementCode
;
@ApiModelProperty
(
"样品信息集合"
)
private
List
<
CheckCountSampleQuery
>
sampleList
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/CheckCountSampleQuery.java
0 → 100644
View file @
8570c775
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* @description:
* @author: ztw
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel
(
"数据校核-校核计算接口请求(样品)"
)
public
class
CheckCountSampleQuery
{
@ApiModelProperty
(
"校核sample_check_team表id,不传id为新增,传id为修改"
)
private
Integer
id
;
@ApiModelProperty
(
"样品表id"
)
private
Integer
smapleId
;
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode
;
@ApiModelProperty
(
"检测人员id"
)
private
Integer
userId
;
@ApiModelProperty
(
"检测设备表id"
)
private
Integer
equipmentId
;
@ApiModelProperty
(
"检测设备名称"
)
private
String
equipmentName
;
@ApiModelProperty
(
"输入信息集合"
)
private
Map
<
String
,
Object
>
intputResult
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleCheckTeamVo.java
View file @
8570c775
...
@@ -13,6 +13,9 @@ import lombok.Data;
...
@@ -13,6 +13,9 @@ import lombok.Data;
@ApiModel
(
"校核-检测组列表Vo"
)
@ApiModel
(
"校核-检测组列表Vo"
)
public
class
SampleCheckTeamVo
{
public
class
SampleCheckTeamVo
{
@ApiModelProperty
(
"校核sample_check_team表id,不传id为新增,传id为修改"
)
private
Integer
id
;
@ApiModelProperty
(
"校核表id"
)
@ApiModelProperty
(
"校核表id"
)
private
Integer
checkId
;
private
Integer
checkId
;
...
@@ -41,5 +44,10 @@ public class SampleCheckTeamVo {
...
@@ -41,5 +44,10 @@ public class SampleCheckTeamVo {
@ApiModelProperty
(
"校核人员输入检测结果 json串"
)
@ApiModelProperty
(
"校核人员输入检测结果 json串"
)
private
String
inputResult
;
private
String
inputResult
;
@ApiModelProperty
(
"计算结果 json串"
)
private
String
countResult
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleCheckVo.java
View file @
8570c775
...
@@ -18,6 +18,9 @@ import java.util.List;
...
@@ -18,6 +18,9 @@ import java.util.List;
@ApiModel
(
"校核-样品Vo"
)
@ApiModel
(
"校核-样品Vo"
)
public
class
SampleCheckVo
{
public
class
SampleCheckVo
{
@ApiModelProperty
(
"校核sample_check表id,不传id为新增,传id为修改"
)
private
Integer
id
;
@ApiModelProperty
(
"委托表id"
)
@ApiModelProperty
(
"委托表id"
)
private
Integer
entrustId
;
private
Integer
entrustId
;
...
@@ -33,16 +36,13 @@ public class SampleCheckVo {
...
@@ -33,16 +36,13 @@ public class SampleCheckVo {
@ApiModelProperty
(
"检测组名称"
)
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
private
String
teamGroupName
;
@ApiModelProperty
(
"主样校核计算结果json串"
)
private
String
mainMap
;
@ApiModelProperty
(
"次样校核计算结果json串"
)
private
String
secondaryMap
;
@ApiModelProperty
(
"最终校核计算结果json串"
)
@ApiModelProperty
(
"最终校核计算结果json串"
)
private
String
countResult
;
private
String
countResults
;
@ApiModelProperty
(
"误差值 计算结果json串"
)
private
String
countError
;
@ApiModelProperty
(
"是否平行样(
1
是,0否)"
)
@ApiModelProperty
(
"是否平行样(
2-3
是,0否)"
)
private
Integer
isParallel
;
private
Integer
isParallel
;
@ApiModelProperty
(
"检测组列表"
)
@ApiModelProperty
(
"检测组列表"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
8570c775
...
@@ -80,9 +80,9 @@ public interface IEntrustService extends IService<Entrust> {
...
@@ -80,9 +80,9 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
List
<
SampleDistribution
>>
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
);
BaseResponse
<
List
<
SampleDistribution
>>
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
);
BaseResponse
<
Map
<
String
,
Map
<
String
,
String
>
>>
checkCount
(
CheckCountQuery
query
);
BaseResponse
<
Map
<
String
,
Object
>>
checkCount
(
CheckCountQuery
query
);
BaseResponse
<
String
>
check
(
CheckQuery
query
);
/*BaseResponse<String> check(CheckQuery query);*/
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
BaseResponse
<
IPage
<
EntrustVo
>>
getReportPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
clientId
,
String
endDate
,
Integer
clientId
,
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
8570c775
...
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.sun.org.apache.xpath.internal.operations.Bool
;
import
net.bytebuddy.description.field.FieldDescription
;
import
net.bytebuddy.description.field.FieldDescription
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -1676,7 +1677,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1676,7 +1677,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleQW
.
eq
(
"cement_code"
,
cementCode
);
sampleQW
.
eq
(
"cement_code"
,
cementCode
);
List
<
Sample
>
sampleList
=
sampleMapper
.
selectList
(
sampleQW
);
List
<
Sample
>
sampleList
=
sampleMapper
.
selectList
(
sampleQW
);
List
<
SampleCheckVo
>
sampleCheckVoList
=
new
ArrayList
<>();
List
<
SampleCheckVo
>
sampleCheckVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
Sample
sampleOne
=
sampleList
.
get
(
0
);
Sample
sampleOne
=
sampleList
.
get
(
0
);
...
@@ -1688,10 +1688,53 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1688,10 +1688,53 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
errorMsg
(
"委托单信息错误"
);
return
BaseResponse
.
errorMsg
(
"委托单信息错误"
);
}
}
//根据样品 和派发任务表 找到都有哪些检测组
//根据样品 和派发任务表 找到都有哪些检测组
if
(
sampleOne
.
getIsCheck
()
==
0
)
{
//未校核时显示
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
sampleOne
.
getId
());
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
sampleOne
.
getId
());
if
(
sampleCheckGroupVoList
!=
null
&&
sampleCheckGroupVoList
.
size
()
>
0
)
{
if
(
sampleCheckGroupVoList
!=
null
&&
sampleCheckGroupVoList
.
size
()
>
0
)
{
for
(
SampleCheckGroupVo
sampleCheckGroupVo
:
sampleCheckGroupVoList
)
{
for
(
SampleCheckGroupVo
sampleCheckGroupVo
:
sampleCheckGroupVoList
)
{
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
sampleCheckQW
.
eq
(
"entrust_id"
,
entrust
.
getId
());
sampleCheckQW
.
eq
(
"cement_code"
,
cementCode
);
sampleCheckQW
.
eq
(
"team_group_id"
,
sampleCheckGroupVo
.
getTeamGroupId
());
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
if
(
sampleCheckList
!=
null
&&
sampleCheckList
.
size
()
>
0
)
{
//参与校核计算的
SampleCheck
sampleCheck
=
sampleCheckList
.
get
(
0
);
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
sampleCheckVo
.
setId
(
sampleCheck
.
getId
());
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
sampleCheckVo
.
setCementCode
(
cementCode
);
sampleCheckVo
.
setTeamGroupId
(
sampleCheck
.
getTeamGroupId
());
sampleCheckVo
.
setTeamGroupName
(
sampleCheck
.
getTeamGroupName
());
sampleCheckVo
.
setCountResults
(
sampleCheck
.
getCountResults
());
sampleCheckVo
.
setCountError
(
sampleCheck
.
getCountError
());
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
QueryWrapper
<
SampleCheckTeam
>
sampleCheckTeamQW
=
new
QueryWrapper
<>();
sampleCheckTeamQW
.
eq
(
"check_id"
,
sampleCheck
.
getId
());
List
<
SampleCheckTeam
>
sampleCheckTeamList
=
sampleCheckTeamMapper
.
selectList
(
sampleCheckTeamQW
);
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
if
(
sampleCheckTeamList
!=
null
&&
sampleCheckTeamList
.
size
()
>
0
)
{
for
(
SampleCheckTeam
sampleCheckTeam
:
sampleCheckTeamList
)
{
SampleCheckTeamVo
sampleCheckTeamVo
=
new
SampleCheckTeamVo
();
sampleCheckTeamVo
.
setId
(
sampleCheckTeam
.
getId
());
sampleCheckTeamVo
.
setCheckId
(
sampleCheck
.
getId
());
sampleCheckTeamVo
.
setSampleId
(
sampleCheckTeam
.
getSampleId
());
sampleCheckTeamVo
.
setSampleId
(
sampleCheckTeam
.
getSampleId
());
//本所编号 展示的是平行样编号
sampleCheckTeamVo
.
setParallelCode
(
sampleCheckTeam
.
getParallelCode
());
sampleCheckTeamVo
.
setUserId
(
sampleCheckTeam
.
getUserId
());
SysUser
sysUser
=
userService
.
getById
(
sampleCheckTeam
.
getUserId
());
sampleCheckTeamVo
.
setUserName
(
sysUser
.
getName
());
sampleCheckTeamVo
.
setEquipmentId
(
sampleCheckTeam
.
getEquipmentId
());
sampleCheckTeamVo
.
setEquipmentName
(
sampleCheckTeam
.
getEquipmentName
());
sampleCheckTeamVo
.
setInputResult
(
sampleCheckTeam
.
getInputResult
());
sampleCheckTeamVo
.
setCountResult
(
sampleCheckTeam
.
getCountResult
());
sctVoList
.
add
(
sampleCheckTeamVo
);
}
}
sampleCheckVo
.
setSampleCheckGroupVoList
(
sctVoList
);
sampleCheckVoList
.
add
(
sampleCheckVo
);
}
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
());
...
@@ -1704,7 +1747,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1704,7 +1747,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
}
//根据检测组id返回检测组对应的所有检测项信息
//根据检测组id返回检测组对应的所有检测项信息
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
teamGroup
.
getId
());
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
teamGroup
.
getId
());
sampleCheckVo
.
setCountResult
(
checkResutlList
.
toString
());
sampleCheckVo
.
setCountResult
s
(
checkResutlList
.
toString
());
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
)
{
...
@@ -1728,47 +1771,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1728,47 +1771,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sampleCheckVoList
.
add
(
sampleCheckVo
);
sampleCheckVoList
.
add
(
sampleCheckVo
);
}
}
}
}
}
else
{
//校核之后显示
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
sampleCheckQW
.
eq
(
"cement_code"
,
cementCode
);
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
if
(
sampleCheckList
!=
null
&&
sampleCheckList
.
size
()
>
0
)
{
for
(
SampleCheck
sampleCheck
:
sampleCheckList
)
{
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
sampleCheckVo
.
setEntrustId
(
entrust
.
getId
());
sampleCheckVo
.
setSampleName
(
sampleOne
.
getName
());
sampleCheckVo
.
setCementCode
(
cementCode
);
sampleCheckVo
.
setTeamGroupId
(
sampleCheck
.
getTeamGroupId
());
sampleCheckVo
.
setTeamGroupName
(
sampleCheck
.
getTeamGroupName
());
sampleCheckVo
.
setMainMap
(
sampleCheck
.
getMainMap
());
sampleCheckVo
.
setSecondaryMap
(
sampleCheck
.
getSecondaryMap
());
sampleCheckVo
.
setCountResult
(
sampleCheck
.
getCountResult
());
sampleCheckVo
.
setIsParallel
(
sampleOne
.
getIsParallel
());
QueryWrapper
<
SampleCheckTeam
>
sampleCheckTeamQW
=
new
QueryWrapper
<>();
sampleCheckTeamQW
.
eq
(
"check_id"
,
sampleCheck
.
getId
());
List
<
SampleCheckTeam
>
sampleCheckTeamList
=
sampleCheckTeamMapper
.
selectList
(
sampleCheckTeamQW
);
List
<
SampleCheckTeamVo
>
sctVoList
=
new
ArrayList
<>();
if
(
sampleCheckTeamList
!=
null
&&
sampleCheckTeamList
.
size
()
>
0
)
{
for
(
SampleCheckTeam
sampleCheckTeam
:
sampleCheckTeamList
)
{
SampleCheckTeamVo
sampleCheckTeamVo
=
new
SampleCheckTeamVo
();
sampleCheckTeamVo
.
setCheckId
(
sampleCheck
.
getId
());
sampleCheckTeamVo
.
setSampleId
(
sampleCheckTeam
.
getSampleId
());
sampleCheckTeamVo
.
setSampleId
(
sampleCheckTeam
.
getSampleId
());
//本所编号 展示的是平行样编号
sampleCheckTeamVo
.
setParallelCode
(
sampleCheckTeam
.
getParallelCode
());
sampleCheckTeamVo
.
setUserId
(
sampleCheckTeam
.
getUserId
());
SysUser
sysUser
=
userService
.
getById
(
sampleCheckTeam
.
getUserId
());
sampleCheckTeamVo
.
setUserName
(
sysUser
.
getName
());
sampleCheckTeamVo
.
setEquipmentId
(
sampleCheckTeam
.
getEquipmentId
());
sampleCheckTeamVo
.
setEquipmentName
(
sampleCheckTeam
.
getEquipmentName
());
sampleCheckTeamVo
.
setInputResult
(
sampleCheckTeam
.
getInputResult
());
sctVoList
.
add
(
sampleCheckTeamVo
);
}
}
sampleCheckVo
.
setSampleCheckGroupVoList
(
sctVoList
);
sampleCheckVoList
.
add
(
sampleCheckVo
);
}
}
}
}
}
}
return
BaseResponse
.
okData
(
sampleCheckVoList
);
return
BaseResponse
.
okData
(
sampleCheckVoList
);
...
@@ -1800,107 +1802,275 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -1800,107 +1802,275 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
* @return
* @return
*/
*/
@Override
@Override
public
BaseResponse
<
Map
<
String
,
Map
<
String
,
String
>>>
checkCount
(
CheckCountQuery
query
)
{
@Transactional
public
BaseResponse
<
Map
<
String
,
Object
>>
checkCount
(
CheckCountQuery
query
)
{
if
(
query
==
null
)
{
if
(
query
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
}
Map
<
String
,
Map
<
String
,
String
>>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
query
.
getEntrustId
());
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
query
.
getTeamGroupId
());
if
(
entrust
==
null
)
{
return
BaseResponse
.
errorMsg
(
"信息错误"
);
Map
<
String
,
String
>
countMap
=
new
HashMap
<>();
}
if
(
query
.
getIsParallel
()
==
0
)
{
if
(
entrust
.
getStatus
()
<
6
)
{
Map
<
String
,
String
>
mainMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getMainResult
());
return
BaseResponse
.
errorMsg
(
"当前状态不允许校核"
);
map
.
put
(
"mainMap"
,
mainMap
);
}
map
.
put
(
"secondaryMap"
,
null
);
entrust
.
setStatus
(
7
);
//校核中状态
map
.
put
(
"countMap"
,
mainMap
);
LoginUser
loginUser
=
userService
.
getLoginUser
();
countMap
=
mainMap
;
if
(
loginUser
==
null
)
{
}
else
if
(
query
.
getIsParallel
()
==
1
)
{
return
BaseResponse
.
errorMsg
(
"请登录用户"
);
Map
<
String
,
String
>
mainMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getMainResult
());
}
Map
<
String
,
String
>
secondaryMap
=
commonService
.
checkCount
(
checkResutlList
,
query
.
getSecondaryResult
());
for
(
String
name
:
checkResutlList
)
{
if
(
query
.
getCementCode
()
==
null
)
{
if
(
name
.
equals
(
"L.O.I"
))
{
return
BaseResponse
.
errorMsg
(
"本所编号不能为空"
);
String
parallelResult
=
}
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
if
(
query
.
getTeamGroupId
()
==
null
||
StringUtils
.
isEmpty
(
query
.
getTeamGroupName
()))
{
countMap
.
put
(
name
,
parallelResult
);
return
BaseResponse
.
errorMsg
(
"请选择检测组"
);
}
else
if
(
name
.
equals
(
"SiO2"
))
{
}
String
parallelResult
=
SampleCheck
check
=
null
;
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
//保存校核表信息
countMap
.
put
(
name
,
parallelResult
);
if
(
query
.
getId
()
==
null
){
}
else
if
(
name
.
equals
(
"Al2O3+TiO2"
))
{
check
=
new
SampleCheck
();
String
parallelResult
=
check
.
setEntrustId
(
entrust
.
getId
())
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
.
setCementCode
(
query
.
getCementCode
())
countMap
.
put
(
name
,
parallelResult
);
.
setTeamGroupId
(
query
.
getTeamGroupId
())
}
else
if
(
name
.
equals
(
"Al2O3"
))
{
.
setTeamGroupName
(
query
.
getTeamGroupName
())
String
parallelResult
=
.
setCountResults
(
null
)
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
.
setCountError
(
null
)
countMap
.
put
(
name
,
parallelResult
);
.
setIsParallel
(
query
.
getIsParallel
())
}
else
if
(
name
.
equals
(
"Fe2O3"
))
{
.
setCreateTime
(
LocalDateTime
.
now
());
String
parallelResult
=
sampleCheckMapper
.
insert
(
check
);
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
}
else
{
countMap
.
put
(
name
,
parallelResult
);
check
=
sampleCheckMapper
.
selectById
(
query
.
getId
());
}
else
if
(
name
.
equals
(
"CaO"
))
{
}
String
parallelResult
=
//返回信息:样品的计算结果集合
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
Map
<
String
,
Object
>
countResultMap
=
new
HashMap
<>();
countMap
.
put
(
name
,
parallelResult
);
if
(
query
.
getSampleList
()
!=
null
&&
query
.
getSampleList
().
size
()
>
0
)
{
}
else
if
(
name
.
equals
(
"MgO"
))
{
//通过检测组获取检测项信息
String
parallelResult
=
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
check
.
getTeamGroupId
());
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
//该检测项的每个样品的检测计算结果集合
countMap
.
put
(
name
,
parallelResult
);
List
<
Map
<
String
,
String
>>
resultMapList
=
new
ArrayList
<>();
}
else
if
(
name
.
equals
(
"TiO2"
))
{
for
(
CheckCountSampleQuery
sampleQuery
:
query
.
getSampleList
())
{
String
parallelResult
=
if
(
sampleQuery
.
getSmapleId
()
==
null
){
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
countMap
.
put
(
name
,
parallelResult
);
}
}
else
if
(
name
.
equals
(
"K2O"
))
{
if
(
StringUtils
.
isEmpty
(
sampleQuery
.
getParallelCode
())){
String
parallelResult
=
return
BaseResponse
.
errorMsg
(
"请传入平行样编号"
);
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
}
countMap
.
put
(
name
,
parallelResult
);
if
(
sampleQuery
.
getUserId
()
==
null
){
}
else
if
(
name
.
equals
(
"Na2O"
))
{
return
BaseResponse
.
errorMsg
(
"请传入检测人id"
);
String
parallelResult
=
}
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
if
(
sampleQuery
.
getEquipmentId
()
==
null
||
StringUtils
.
isEmpty
(
sampleQuery
.
getEquipmentName
())){
countMap
.
put
(
name
,
parallelResult
);
return
BaseResponse
.
errorMsg
(
"请传选择检测设备"
);
}
else
if
(
name
.
equals
(
"SO3"
))
{
}
String
parallelResult
=
if
(
sampleQuery
.
getIntputResult
()
==
null
){
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
return
BaseResponse
.
errorMsg
(
"请输入检测数据"
);
countMap
.
put
(
name
,
parallelResult
);
}
}
else
if
(
name
.
equals
(
"Cl"
))
{
//计算检测结果
String
parallelResult
=
Map
<
String
,
String
>
resultMap
=
commonService
.
checkCount
(
checkResutlList
,
sampleQuery
.
getIntputResult
());
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
resultMapList
.
add
(
resultMap
);
countMap
.
put
(
name
,
parallelResult
);
//保存校核检测组检测项信息
}
else
if
(
name
.
equals
(
"合量"
))
{
SampleCheckTeam
sampleCheckTeam
=
null
;
String
parallelResult
=
if
(
sampleQuery
.
getId
()
==
null
){
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
sampleCheckTeam
=
new
SampleCheckTeam
();
countMap
.
put
(
name
,
parallelResult
);
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
}
else
if
(
name
.
equals
(
"KH"
))
{
.
setSampleId
(
sampleQuery
.
getSmapleId
())
String
parallelResult
=
.
setParallelCode
(
sampleQuery
.
getParallelCode
())
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
.
setUserId
(
sampleQuery
.
getUserId
())
countMap
.
put
(
name
,
parallelResult
);
.
setEquipmentId
(
sampleQuery
.
getEquipmentId
())
}
else
if
(
name
.
equals
(
"SM"
))
{
.
setEquipmentName
(
sampleQuery
.
getEquipmentName
())
String
parallelResult
=
.
setInputResult
(
JSON
.
toJSONString
(
sampleQuery
.
getIntputResult
()))
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
.
setCountResult
(
JSON
.
toJSONString
(
resultMap
))
countMap
.
put
(
name
,
parallelResult
);
.
setCreateTime
(
LocalDateTime
.
now
());
}
else
if
(
name
.
equals
(
"AM"
))
{
sampleCheckTeamMapper
.
insert
(
sampleCheckTeam
);
String
parallelResult
=
//添加设备使用记录 设备使用记录表 equipment_use
CheckCountUtil
.
countParallel
(
mainMap
.
get
(
name
),
secondaryMap
.
get
(
name
));
EquipmentUse
equipmentUse2
=
new
EquipmentUse
();
countMap
.
put
(
name
,
parallelResult
);
SysUser
sysUser
=
userService
.
getById
(
sampleCheckTeam
.
getUserId
());
}
else
{
equipmentUse2
.
setEquipmentId
(
sampleCheckTeam
.
getEquipmentId
())
countMap
.
put
(
name
,
mainMap
.
get
(
name
));
.
setUserId
(
sampleCheckTeam
.
getUserId
())
.
setUserName
(
sysUser
.
getName
())
.
setUseDate
(
LocalDate
.
now
())
.
setProjectId
(
entrust
.
getProjectId
())
.
setProjectName
(
entrust
.
getProjectName
())
.
setProjectCode
(
entrust
.
getProjectCode
())
.
setTestItem
(
check
.
getTeamGroupName
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
"委托派发-数据校核"
);
equipmentUseMapper
.
insert
(
equipmentUse2
);
}
else
{
sampleCheckTeam
=
sampleCheckTeamMapper
.
selectById
(
sampleQuery
.
getId
());
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
.
setInputResult
(
JSON
.
toJSONString
(
sampleQuery
.
getIntputResult
()))
.
setCountResult
(
JSON
.
toJSONString
(
resultMap
));
sampleCheckTeamMapper
.
updateById
(
sampleCheckTeam
);
}
}
countResultMap
.
put
(
"resultMapList"
,
resultMapList
);
//计算最终计算结果 和 结果误差值
Map
<
String
,
String
>
groupMap
=
new
HashMap
<>();
//"L.O.I":"1,2,3,4..."
if
(
resultMapList
!=
null
&&
resultMapList
.
size
()>
0
){
for
(
String
name
:
checkResutlList
)
{
if
(
name
.
equals
(
"L.O.I"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"SiO2"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,
(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"Al2O3+TiO2"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"Al2O3"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"Fe2O3"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"CaO"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"MgO"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"TiO2"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"K2O"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"Na2O"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"SO3"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"Cl"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"合量"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"KH"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"SM"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
if
(
name
.
equals
(
"AM"
))
{
for
(
Map
<
String
,
String
>
map
:
resultMapList
){
groupMap
.
put
(
name
,(
groupMap
==
null
||
groupMap
.
size
()==
0
||
groupMap
.
get
(
name
)
==
null
||
groupMap
.
get
(
name
).
equals
(
""
))
?
map
.
get
(
name
):
groupMap
.
get
(
name
)+
","
+
map
.
get
(
name
));
}
}
else
{
groupMap
.
put
(
name
,
"0"
);
}
}
}
}
}
map
.
put
(
"mainMap"
,
mainMap
);
//计算平行样的平均值 最大误差值
map
.
put
(
"secondaryMap"
,
secondaryMap
);
Map
<
String
,
Map
<
String
,
String
>>
mapResult
=
CheckCountUtil
.
countParallelAvgError
(
groupMap
);
map
.
put
(
"countMap"
,
countMap
);
if
(
mapResult
!=
null
){
Map
<
String
,
String
>
countResults
=
mapResult
.
get
(
"countResults"
);
Map
<
String
,
String
>
countError
=
mapResult
.
get
(
"countError"
);
check
.
setCountResults
(
JSON
.
toJSONString
(
countResults
));
check
.
setCountError
(
JSON
.
toJSONString
(
countError
));
sampleCheckMapper
.
updateById
(
check
);
countResultMap
.
put
(
"countResults"
,
countResults
);
countResultMap
.
put
(
"countError"
,
countError
);
}
}
}
return
BaseResponse
.
okData
(
map
);
Boolean
ret
=
true
;
//全部校核计算完成
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
query
.
getSampleList
().
get
(
0
).
getSmapleId
());
for
(
SampleCheckGroupVo
groupVo
:
sampleCheckGroupVoList
){
QueryWrapper
<
SampleCheck
>
sampleCheckQW
=
new
QueryWrapper
<>();
sampleCheckQW
.
eq
(
"entrust_id"
,
entrust
.
getId
());
sampleCheckQW
.
eq
(
"cement_code"
,
query
.
getCementCode
());
sampleCheckQW
.
eq
(
"team_group_id"
,
groupVo
.
getTeamGroupId
());
List
<
SampleCheck
>
sampleCheckList
=
sampleCheckMapper
.
selectList
(
sampleCheckQW
);
if
(
sampleCheckList
==
null
||
sampleCheckList
.
size
()==
0
){
ret
=
false
;
//有一个检测组没有校核,证明校核没有完成
}
}
//如果检测组的校核全部完成
if
(
ret
){
//更新样品表状态为已经校核状态 is_check 0未处理 1处理完成
QueryWrapper
<
Sample
>
sampleQW
=
new
QueryWrapper
<>();
sampleQW
.
eq
(
"cement_code"
,
query
.
getCementCode
());
List
<
Sample
>
sampleList
=
sampleMapper
.
selectList
(
sampleQW
);
if
(
sampleList
!=
null
&&
sampleList
.
size
()
>
0
)
{
for
(
Sample
sample
:
sampleList
)
{
sample
.
setIsCheck
(
1
);
sampleMapper
.
updateById
(
sample
);
}
}
}
//如果是保存并完成按钮,检测委托单中其他样品是否都是保存冰完成状态,如果是,委托单为检测完成状态
List
<
Sample
>
sampleNoCheckList
=
sampleMapper
.
getNoCheckList
(
entrust
.
getId
());
if
(
sampleNoCheckList
==
null
||
sampleNoCheckList
.
size
()
==
0
)
{
entrust
.
setStatus
(
8
);
}
entrustMapper
.
updateById
(
entrust
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"数据校核"
,
null
);
return
BaseResponse
.
okData
(
countResultMap
);
}
}
/**
/**
* 数据校核
* 数据校核
*
*
* @param
query
* @param
* @return
* @return
*/
*/
@Transactional
/*
@Transactional
@Override
@Override
public BaseResponse<String> check(CheckQuery query) {
public BaseResponse<String> check(CheckQuery query) {
if (query.getId() == null) {
if (query.getId() == null) {
...
@@ -2015,7 +2185,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
...
@@ -2015,7 +2185,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
entrustMapper.updateById(entrust);
entrustMapper.updateById(entrust);
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
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/WeiXinService.java
View file @
8570c775
...
@@ -49,24 +49,24 @@ public class WeiXinService {
...
@@ -49,24 +49,24 @@ public class WeiXinService {
System
.
out
.
println
(
"==================code==================="
);
System
.
out
.
println
(
"==================code==================="
);
System
.
out
.
println
(
code
);
System
.
out
.
println
(
code
);
try
{
try
{
//
String accessToken = null;
/*
String accessToken = null;
//
if(type.equals("PC")){
if(type.equals("PC")){
//
accessToken = getAccessToken();
accessToken = getAccessToken();
//
}else if(type.equals("APP")){
}else if(type.equals("APP")){
//
accessToken = getPCAccessToken();
accessToken = getPCAccessToken();
//
}else{
}else{
//
return BaseResponse.errorMsg("参数错误");
return BaseResponse.errorMsg("参数错误");
//
}
}
//
String param = "access_token=%s&code=%s";
String param = "access_token=%s&code=%s";
//
param = String.format(param, accessToken, code);
param = String.format(param, accessToken, code);
//
JSONObject jsonObject = WeixinInterfaceUtil.doGet(Global.USERINFOURL, param);
JSONObject jsonObject = WeixinInterfaceUtil.doGet(Global.USERINFOURL, param);
//
if(jsonObject.get("errcode").toString().equals("40029")){
if(jsonObject.get("errcode").toString().equals("40029")){
//
return BaseResponse.errorMsg("code失效!");
return BaseResponse.errorMsg("code失效!");
//
}
}
//
String UserId = jsonObject.getString("UserId");
String UserId = jsonObject.getString("UserId");
//
System.out.println("==================UserId===================");
System.out.println("==================UserId===================");
//
System.out.println(UserId);
System.out.println(UserId);
// JSONObject userJson = getUser(accessToken, UserId);
JSONObject userJson = getUser(accessToken, UserId);*/
QueryWrapper
<
SysUser
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
SysUser
>
wrapper
=
new
QueryWrapper
<>();
// wrapper.eq("phone", userJson.get("mobile"));
// wrapper.eq("phone", userJson.get("mobile"));
wrapper
.
eq
(
"phone"
,
code
);
//暂时用手机号代替code
wrapper
.
eq
(
"phone"
,
code
);
//暂时用手机号代替code
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/util/CheckCountUtil.java
View file @
8570c775
...
@@ -10,6 +10,7 @@ import java.io.*;
...
@@ -10,6 +10,7 @@ import java.io.*;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.math.BigInteger
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -795,15 +796,53 @@ public class CheckCountUtil {
...
@@ -795,15 +796,53 @@ public class CheckCountUtil {
int
resultInt1
=
result1
.
setScale
(
0
,
BigDecimal
.
ROUND_DOWN
).
intValue
();
int
resultInt1
=
result1
.
setScale
(
0
,
BigDecimal
.
ROUND_DOWN
).
intValue
();
BigDecimal
endResult
=
null
;
BigDecimal
endResult
=
null
;
if
((
resultInt1
&
1
)
==
1
){
//如果结果为奇数
if
((
resultInt1
&
1
)
==
1
){
//如果结果为奇数
endResult
=
aveCount
.
multiply
(
param100
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
endResult
=
aveCount
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
else
{
}
else
{
endResult
=
aveCount
.
multiply
(
param100
).
subtract
(
new
BigDecimal
(
0.0000000001
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
endResult
=
aveCount
.
subtract
(
new
BigDecimal
(
0.0000000001
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
}
return
endResult
.
toString
();
return
endResult
.
toString
();
}
}
/**
* 计算平行样的平均值 最大误差值
* @return
*/
public
static
Map
<
String
,
Map
<
String
,
String
>>
countParallelAvgError
(
Map
<
String
,
String
>
groupMap
)
{
Map
<
String
,
Map
<
String
,
String
>>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
countResults
=
new
HashMap
<>();
Map
<
String
,
String
>
countError
=
new
HashMap
<>();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
groupMap
.
entrySet
()){
String
[]
values
=
entry
.
getValue
().
split
(
","
);
BigDecimal
resultSum
=
null
;
//求总和
BigDecimal
maxNum
=
null
;
//求最大值
BigDecimal
minNum
=
null
;
//求最小值
for
(
String
val
:
values
){
BigDecimal
valBD
=
getBigDecimal
(
val
);
resultSum
=
resultSum
==
null
?
valBD:
resultSum
.
add
(
valBD
);
maxNum
=
maxNum
==
null
?
valBD:
(
valBD
.
compareTo
(
maxNum
)
==
1
?
valBD:
maxNum
);
minNum
=
minNum
==
null
?
valBD:
(
valBD
.
compareTo
(
minNum
)
==
-
1
?
valBD:
minNum
);
}
//平均值
BigDecimal
aveCount
=
resultSum
.
divide
(
new
BigDecimal
(
values
.
length
),
2
);
BigDecimal
result1
=
aveCount
.
multiply
(
param100
);
int
resultInt1
=
result1
.
setScale
(
0
,
BigDecimal
.
ROUND_DOWN
).
intValue
();
BigDecimal
ResultsValue
=
null
;
if
((
resultInt1
&
1
)
==
1
){
//如果结果为奇数
ResultsValue
=
aveCount
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
else
{
ResultsValue
=
aveCount
.
subtract
(
new
BigDecimal
(
0.0000000001
)).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);
}
//最大误差值
BigDecimal
errorValue
=
maxNum
.
subtract
(
minNum
).
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
);;
countResults
.
put
(
entry
.
getKey
(),
ResultsValue
.
toString
());
countError
.
put
(
entry
.
getKey
(),
errorValue
.
toString
());
}
map
.
put
(
"countResults"
,
countResults
);
map
.
put
(
"countError"
,
countError
);
return
map
;
}
...
...
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