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
ba9b09a9
Commit
ba9b09a9
authored
Sep 16, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委托管理 还差校核计算 和校核保存功能 其他功能接口完成
parent
b01afe4c
Show whitespace changes
Inline
Side-by-side
Showing
39 changed files
with
1571 additions
and
255 deletions
+1571
-255
EntrustController.java
...wise/sc/cement/business/controller/EntrustController.java
+145
-31
TeamController.java
...cn/wise/sc/cement/business/controller/TeamController.java
+13
-0
Sample.java
...c/main/java/cn/wise/sc/cement/business/entity/Sample.java
+4
-2
SampleCheckTeam.java
...va/cn/wise/sc/cement/business/entity/SampleCheckTeam.java
+14
-9
SampleDistribution.java
...cn/wise/sc/cement/business/entity/SampleDistribution.java
+15
-0
SampleHandleEnclosure.java
...wise/sc/cement/business/entity/SampleHandleEnclosure.java
+62
-0
TeamGroup.java
...ain/java/cn/wise/sc/cement/business/entity/TeamGroup.java
+3
-0
EntrustMapper.java
...java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
+6
-0
SampleDistributionMapper.java
...e/sc/cement/business/mapper/SampleDistributionMapper.java
+4
-1
SampleHandleEnclosureMapper.java
...c/cement/business/mapper/SampleHandleEnclosureMapper.java
+23
-0
SampleHandleMapper.java
...cn/wise/sc/cement/business/mapper/SampleHandleMapper.java
+2
-1
SampleMapper.java
.../java/cn/wise/sc/cement/business/mapper/SampleMapper.java
+20
-0
TeamMapper.java
...in/java/cn/wise/sc/cement/business/mapper/TeamMapper.java
+2
-0
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+145
-1
SampleDistributionMapper.xml
...c/cement/business/mapper/xml/SampleDistributionMapper.xml
+26
-26
SampleHandleEnclosureMapper.xml
...ement/business/mapper/xml/SampleHandleEnclosureMapper.xml
+27
-0
SampleHandleMapper.xml
...wise/sc/cement/business/mapper/xml/SampleHandleMapper.xml
+32
-6
TeamMapper.xml
...java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
+8
-5
DistributionQuery.java
...ise/sc/cement/business/model/query/DistributionQuery.java
+0
-11
HandleQuery.java
...a/cn/wise/sc/cement/business/model/query/HandleQuery.java
+1
-1
SampleCheckTeamQuery.java
.../sc/cement/business/model/query/SampleCheckTeamQuery.java
+15
-10
SampleDistributionEnclosureQuery.java
...usiness/model/query/SampleDistributionEnclosureQuery.java
+24
-0
SampleDistributionTeamQuery.java
...ent/business/model/query/SampleDistributionTeamQuery.java
+5
-16
SampleHandleEnclosureQuery.java
...ment/business/model/query/SampleHandleEnclosureQuery.java
+25
-0
SampleHandleQuery.java
...ise/sc/cement/business/model/query/SampleHandleQuery.java
+1
-1
EntrustVo.java
...n/java/cn/wise/sc/cement/business/model/vo/EntrustVo.java
+6
-3
SampleCheckGroupVo.java
.../wise/sc/cement/business/model/vo/SampleCheckGroupVo.java
+41
-0
SampleCheckVo.java
...va/cn/wise/sc/cement/business/model/vo/SampleCheckVo.java
+49
-0
SampleDistributionTeamVo.java
...sc/cement/business/model/vo/SampleDistributionTeamVo.java
+30
-4
SampleHandleEnclosureVo.java
.../sc/cement/business/model/vo/SampleHandleEnclosureVo.java
+62
-0
SampleHandleVo.java
...a/cn/wise/sc/cement/business/model/vo/SampleHandleVo.java
+10
-1
TeamListVo.java
.../java/cn/wise/sc/cement/business/model/vo/TeamListVo.java
+3
-0
IEntrustService.java
...a/cn/wise/sc/cement/business/service/IEntrustService.java
+38
-12
ISampleHandleEnclosureService.java
...ement/business/service/ISampleHandleEnclosureService.java
+16
-0
ITeamService.java
...java/cn/wise/sc/cement/business/service/ITeamService.java
+3
-0
EntrustServiceImpl.java
...e/sc/cement/business/service/impl/EntrustServiceImpl.java
+646
-113
SampleHandleEnclosureServiceImpl.java
...siness/service/impl/SampleHandleEnclosureServiceImpl.java
+20
-0
TeamServiceImpl.java
...wise/sc/cement/business/service/impl/TeamServiceImpl.java
+24
-0
application.yml
cement-business/src/main/resources/application.yml
+1
-1
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/EntrustController.java
View file @
ba9b09a9
...
...
@@ -39,14 +39,20 @@ public class EntrustController {
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态(0未审批,1已通过,2未通过,3样品处理,4派发)"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态(0未评审,1已通过,2未通过,"
+
"3样品处理中,4样品处理完成,"
+
"5样品检测中,6样品检测完成,"
+
"7校核中,8校核完成)"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"委托单位id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
)
{
public
BaseResponse
getPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
try
{
return
entrustService
.
getPage
(
pageQuery
,
startDate
,
endDate
,
status
,
clientId
,
projectName
);
return
entrustService
.
getPage
(
pageQuery
,
startDate
,
endDate
,
status
,
clientId
,
projectName
,
projectCode
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"委托分页列表{}"
,
e
);
}
...
...
@@ -119,37 +125,67 @@ public class EntrustController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"样品处理
分页列表
"
)
@ApiOperation
(
value
=
"样品处理
任务分页
"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态((0未接受,1接受,2完成))"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"委托单位id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getSampleHandlePage"
)
public
BaseResponse
getSampleHandlePage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
)
{
public
BaseResponse
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
)
{
try
{
return
entrustService
.
getSampleHandlePage
(
pageQuery
,
projectCode
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"样品处理任务分页{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"样品处理任务列表"
)
@GetMapping
(
"/getSampleHandleList"
)
public
BaseResponse
getSampleHandleList
(
Integer
id
)
{
try
{
return
entrustService
.
getSampleHandle
Page
(
pageQuery
,
startDate
,
endDate
,
status
,
clientId
,
projectName
);
return
entrustService
.
getSampleHandle
List
(
id
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"样品处理
分页
列表{}"
,
e
);
log
.
debug
(
"样品处理
任务
列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"接受样品处理任务"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"样品处理表id集合"
,
required
=
true
,
allowMultiple
=
true
,
dataType
=
"Integer"
,
paramType
=
"query"
)
@PostMapping
(
"/acceptHandle"
)
public
BaseResponse
acceptHandle
(
Integer
id
)
{
public
BaseResponse
acceptHandle
(
Integer
[]
ids
)
{
try
{
return
entrustService
.
acceptHandle
(
id
);
return
entrustService
.
acceptHandle
(
id
s
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"接受样品处理任务{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"数据上传列表"
)
@GetMapping
(
"/getSampleHandleEnclosureList"
)
public
BaseResponse
getSampleHandleEnclosureList
(
Integer
sampleHandleId
)
{
try
{
return
entrustService
.
getSampleHandleEnclosureList
(
sampleHandleId
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"数据上传列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"样品处理数据上传附件"
)
@PostMapping
(
"/uploadEnclosureCL"
)
public
BaseResponse
uploadEnclosureCL
(
SampleHandleEnclosureQuery
query
)
{
try
{
return
entrustService
.
uploadEnclosureCL
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"样品处理数据上传附件{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"样品处理详情"
)
@GetMapping
(
"getHandleDtail/{id}"
)
@GetMapping
(
"
/
getHandleDtail/{id}"
)
public
BaseResponse
getHandleDtail
(
@PathVariable
Integer
id
){
try
{
return
entrustService
.
getHandleDtail
(
id
);
...
...
@@ -160,10 +196,11 @@ public class EntrustController {
}
@ApiOperation
(
value
=
"完成样品处理任务"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"样品处理表id集合"
,
required
=
true
,
allowMultiple
=
true
,
dataType
=
"Integer"
,
paramType
=
"query"
)
@PostMapping
(
"/finishHandle"
)
public
BaseResponse
finishHandle
(
Integer
id
)
{
public
BaseResponse
finishHandle
(
Integer
[]
ids
)
{
try
{
return
entrustService
.
finishHandle
(
id
);
return
entrustService
.
finishHandle
(
id
s
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"完成样品处理任务{}"
,
e
);
}
...
...
@@ -181,47 +218,124 @@ public class EntrustController {
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"派发分页列表"
)
@ApiOperation
(
value
=
"派发
任务
分页列表"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态((0未接受,1接受,2完成))"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"委托单位id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getSampleDistributionPage"
)
public
BaseResponse
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
)
{
public
BaseResponse
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
String
projectCode
)
{
try
{
return
entrustService
.
getSampleDistributionPage
(
pageQuery
,
startDate
,
endDate
,
status
,
clientId
,
projectNam
e
);
return
entrustService
.
getSampleDistributionPage
(
pageQuery
,
projectName
,
projectCod
e
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"派发分页列表{}"
,
e
);
log
.
debug
(
"派发任务分页列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"检测通知单详情"
)
@GetMapping
(
"/getSampleDistributionList/{id}"
)
public
BaseResponse
getSampleDistributionList
(
@PathVariable
Integer
id
){
try
{
return
entrustService
.
getSampleDistributionList
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"检测通知单详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"接受检测项目任务"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"任务派发表id集合"
,
required
=
true
,
allowMultiple
=
true
,
dataType
=
"Integer"
,
paramType
=
"query"
)
@PostMapping
(
"/acceptDistribution"
)
public
BaseResponse
acceptDistribution
(
Integer
id
)
{
public
BaseResponse
acceptDistribution
(
Integer
[]
ids
)
{
try
{
return
entrustService
.
acceptDistribution
(
id
);
return
entrustService
.
acceptDistribution
(
id
s
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"接受检测项目任务{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"检测项目上传附件"
)
@PostMapping
(
"/uploadEnclosurePF"
)
public
BaseResponse
uploadEnclosurePF
(
SampleDistributionEnclosureQuery
query
)
{
try
{
return
entrustService
.
uploadEnclosurePF
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"检测项目上传附件{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"完成检测项目任务"
)
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"任务派发表id集合"
,
required
=
true
,
allowMultiple
=
true
,
dataType
=
"Integer"
,
paramType
=
"query"
)
@PostMapping
(
"/finishDistribution"
)
public
BaseResponse
finishDistribution
(
Integer
id
)
{
public
BaseResponse
finishDistribution
(
Integer
[]
ids
)
{
try
{
return
entrustService
.
finishDistribution
(
id
);
return
entrustService
.
finishDistribution
(
id
s
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"完成检测项目任务{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"数据校核分页"
)
@ApiImplicitParams
(
value
=
{
@ApiImplicitParam
(
name
=
"startDate"
,
value
=
"开始日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"endDate"
,
value
=
"结束日期"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"status"
,
value
=
"状态(6样品检测完成,7校核中,8校核完成)"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"clientId"
,
value
=
"委托单位id"
,
paramType
=
"query"
,
dataType
=
"Integer"
),
@ApiImplicitParam
(
name
=
"projectName"
,
value
=
"项目名称"
,
paramType
=
"query"
,
dataType
=
"String"
),
@ApiImplicitParam
(
name
=
"projectCode"
,
value
=
"项目编号"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
@GetMapping
(
"/getCheckPage"
)
public
BaseResponse
getCheckPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
)
{
try
{
return
entrustService
.
getCheckPage
(
pageQuery
,
startDate
,
endDate
,
status
,
clientId
,
projectName
,
projectCode
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"数据校核分页{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"数据校核详情列表"
)
@GetMapping
(
"/getCheckList/{id}"
)
public
BaseResponse
getCheckList
(
@PathVariable
Integer
id
){
try
{
return
entrustService
.
getCheckList
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"数据校核详情列表{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"样品检测项校核详情"
)
@GetMapping
(
"/getCheckDetail"
)
public
BaseResponse
getCheckDetail
(
String
cementCode
){
try
{
return
entrustService
.
getCheckDetail
(
cementCode
);
}
catch
(
Exception
e
){
log
.
debug
(
"样品检测项校核详情{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"查询任务检测附件信息"
)
@GetMapping
(
"/getEnclosureList"
)
public
BaseResponse
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
){
try
{
return
entrustService
.
getEnclosureList
(
sampleId
,
teamGroupId
,
userId
);
}
catch
(
Exception
e
){
log
.
debug
(
"查询任务检测附件信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"数据校核"
)
@PostMapping
(
"/check"
)
public
BaseResponse
check
(
CheckQuery
query
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/TeamController.java
View file @
ba9b09a9
...
...
@@ -121,6 +121,19 @@ public class TeamController {
}
}
@ApiOperation
(
value
=
"根据检测组id获取检测项信息"
)
@GetMapping
(
"/getByGroup"
)
public
BaseResponse
getByGroup
(
Integer
id
)
{
try
{
return
teamService
.
getByGroup
(
id
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"根据检测组id获取检测项信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/Sample.java
View file @
ba9b09a9
...
...
@@ -113,9 +113,11 @@ public class Sample implements Serializable {
@ApiModelProperty
(
"销毁时间"
)
private
LocalDateTime
destructionTime
;
@ApiModelProperty
(
"样品处理是否全部完成(0未处理完成,1处理完成"
)
private
Integer
isHandle
;
@ApiModelProperty
(
"样品是否检测完成(0未检测完成, 1检测完成,)"
)
private
Integer
isCheck
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleCheckTeam.java
View file @
ba9b09a9
...
...
@@ -34,19 +34,24 @@ public class SampleCheckTeam implements Serializable {
@ApiModelProperty
(
"样品检测表id"
)
private
Integer
checkId
;
@ApiModelProperty
(
"检测
项目id(检测项目表)
"
)
private
Integer
te
stItem
Id
;
@ApiModelProperty
(
"检测
组id
"
)
private
Integer
te
amGroup
Id
;
@ApiModelProperty
(
"检测
项目
"
)
private
String
te
stItem
;
@ApiModelProperty
(
"检测
组名称
"
)
private
String
te
amGroupName
;
/**
* 检测项目信息 json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
* json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
@ApiModelProperty
(
"检测项目信息json串"
)
private
String
testTeams
;
@ApiModelProperty
(
"主样检测结果 json串"
)
private
String
main_result
;
@ApiModelProperty
(
"次样检测结果json串"
)
private
String
secondary_result
;
@ApiModelProperty
(
"最终校核计算结果json串"
)
private
String
end_result
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleDistribution.java
View file @
ba9b09a9
...
...
@@ -34,6 +34,9 @@ public class SampleDistribution implements Serializable {
@ApiModelProperty
(
"样品表d"
)
private
Integer
sampleId
;
@ApiModelProperty
(
"检测组id"
)
private
Integer
teamGroupId
;
@ApiModelProperty
(
"检测项id"
)
private
Integer
teamId
;
...
...
@@ -55,5 +58,17 @@ public class SampleDistribution implements Serializable {
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"上传图片时间"
)
private
LocalDateTime
updateTime
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/SampleHandleEnclosure.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
java.time.LocalDateTime
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-09-14
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
public
class
SampleHandleEnclosure
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"样品处理表id"
)
private
Integer
sampleHandleId
;
@ApiModelProperty
(
"处理项表id"
)
private
Integer
handleId
;
@ApiModelProperty
(
"操作人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"上传图片时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
"状态(0未上传,1成功,2上传失败)"
)
private
Integer
status
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/TeamGroup.java
View file @
ba9b09a9
...
...
@@ -31,6 +31,9 @@ public class TeamGroup implements Serializable {
@ApiModelProperty
(
"检测组名称"
)
private
String
name
;
@ApiModelProperty
(
"校核元素 json串"
)
private
String
checkElement
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/EntrustMapper.java
View file @
ba9b09a9
...
...
@@ -28,4 +28,10 @@ public interface EntrustMapper extends BaseMapper<Entrust> {
@Select
(
"select count(*) from entrust where day(create_time) = day(now())"
)
Integer
counts
();
IPage
<
EntrustVo
>
getSampleHandlePage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
EntrustVo
>
getSampleDistributionPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
IPage
<
EntrustVo
>
getCheckPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleDistributionMapper.java
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.model.vo.SampleCheckGroupVo
;
import
cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo
;
import
cn.wise.sc.cement.business.model.vo.SampleDistributionVo
;
import
cn.wise.sc.cement.business.model.vo.SampleHandleVo
;
...
...
@@ -24,5 +25,7 @@ public interface SampleDistributionMapper extends BaseMapper<SampleDistribution>
IPage
<
SampleDistributionVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
SampleDistributionTeamVo
>
getDistributionTeamList
(
Integer
sampleId
);
List
<
SampleDistributionTeamVo
>
getDistributionTeamList
(
@Param
(
"sampleId"
)
Integer
sampleId
,
@Param
(
"userId"
)
Integer
userId
);
List
<
SampleCheckGroupVo
>
getSampleCheckGroupList
(
@Param
(
"sampleId"
)
Integer
sampleId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleHandleEnclosureMapper.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.SampleHandleEnclosure
;
import
cn.wise.sc.cement.business.model.vo.SampleHandleEnclosureVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author ztw
* @since 2020-09-14
*/
public
interface
SampleHandleEnclosureMapper
extends
BaseMapper
<
SampleHandleEnclosure
>
{
List
<
SampleHandleEnclosureVo
>
getList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleHandleMapper.java
View file @
ba9b09a9
...
...
@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -21,7 +22,7 @@ import java.util.Map;
public
interface
SampleHandleMapper
extends
BaseMapper
<
SampleHandle
>
{
IPage
<
SampleHandleVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
SampleHandleVo
>
getSampleHandleList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
SampleHandleVo
getDetail
(
Integer
id
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/SampleMapper.java
View file @
ba9b09a9
...
...
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -28,4 +29,23 @@ public interface SampleMapper extends BaseMapper<Sample> {
@Select
(
"select max(parallel_code) from sample"
)
String
getMaxCementCode
();
@Select
(
"select * from sample where cement_code = parallel_code and entrust_id = #{entrustId}"
+
" order by id asc "
)
List
<
Sample
>
getSampleList
(
Integer
entrustId
);
@Select
(
"select * from sample where cement_code = parallel_code and entrust_id = #{entrustId} "
+
" and is_handle != 1 order by id asc"
)
List
<
Sample
>
getNoHandleList
(
Integer
entrustId
);
@Select
(
"select * from sample where entrust_id = #{entrustId} and is_check != 1 order by id asc"
)
List
<
Sample
>
getNoDistributionList
(
Integer
entrustId
);
//校核详情样品列表(不展示平行样副样)
@Select
(
"select * from sample where cement_code = parallel_code and entrust_id = #{entrustId} "
+
"and is_handle = 1 and is_check = 1 order by id asc"
)
List
<
Sample
>
getCheckSampleList
(
Integer
entrustId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/TeamMapper.java
View file @
ba9b09a9
...
...
@@ -30,4 +30,6 @@ public interface TeamMapper extends BaseMapper<Team> {
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
String
>
getByGroup
(
Integer
groupId
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
View file @
ba9b09a9
...
...
@@ -20,6 +20,9 @@
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.userId != null"
>
and e.user_id = #{params.userId}
</if>
...
...
@@ -51,7 +54,22 @@
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*, p.name as projectName, c.name as clientName, su.name as userName,
select e.*,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as statusValue,
p.name as projectName, c.name as clientName, su.name as userName,
su.phone as userPhone, su.fax as userFax
from entrust e
left join project p on p.id = e.project_id
...
...
@@ -62,4 +80,130 @@
<select
id=
"getSampleHandlePage"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.id as id, e.sample_num as sampleNum,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as statusValue,
p.id as projectId, p.name as projectName, p.code as projectCode,
su.name as userName
from sample_handle t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
where 1=1
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
group by e.id
order by e.update_time desc
</select>
<select
id=
"getSampleDistributionPage"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.id as id, e.sample_num as sampleNum,e.entrust_date as entrustDate,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as statusValue,
p.id as projectId, p.name as projectName, p.code as projectCode,
su.name as userName
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
where 1=1
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
GROUP BY e.id
order by e.update_time desc
</select>
<!--数据校核分页列表-->
<select
id=
"getCheckPage"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*, p.name as projectName, c.name as clientName, su.name as userName,
(
CASE e.status
WHEN 0 THEN '未评审'
WHEN 1 THEN '已通过'
WHEN 2 THEN '未通过'
WHEN 3 THEN '样品处理中'
WHEN 4 THEN '样品处理完成'
WHEN 5 THEN '样品检测中'
WHEN 6 THEN '样品检测完成'
WHEN 7 THEN '校核中'
WHEN 8 THEN '校核完成'
ELSE ''
END
) as statusValue
from entrust e
left join project p on p.id = e.project_id
left join client c on c.id = e.client_id
left join sys_user su on su.id = e.user_id
<include
refid=
"checkWhere"
/>
order by e.update_time desc
</select>
<sql
id=
"checkWhere"
>
<where>
and e.is_delete = 1 and e.status >= 6
<if
test=
"params.startDate != null and params.startDate != ''"
>
and DATE(e.entrust_date)
>
= #{params.startDate}
</if>
<if
test=
"params.endDate != null and params.endDate != ''"
>
and DATE(e.entrust_date)
<
= #{params.endDate}
</if>
<if
test=
"params.status != null"
>
and e.status = #{params.status}
</if>
<if
test=
"params.clientId != null"
>
and e.client_id = #{params.clientId}
</if>
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.userId != null"
>
and e.user_id = #{params.userId}
</if>
</where>
</sql>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleDistributionMapper.xml
View file @
ba9b09a9
...
...
@@ -38,41 +38,41 @@
</select>
<select
id=
"getDistributionTeamList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleDistributionTeamVo"
>
select t.id as distributionId, su.id as userId, su.name as userName, s.id as teamId, s.name as teamName
select t.id as distributionId, su.id as userId, su.name as userName,
t.team_group_id as teamGroupId, tg.name as teamGroupName, s.id as teamId, s.name as teamName,
t.enclosure_url as enclosureUrl, t.alias as alias, t.ext_name as extName,
t.status as status,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '已接受'
WHEN 2 THEN '已完成'
ELSE ''
END
) as statusValue
from sample_distribution t
left join sys_user su on su.id = t.user_id
left join team s on s.id = t.team_id
left join team_group tg on tg.id = t.team_group_id
where t.sample_id = #{sampleId}
<if
test=
"userId != null"
>
and t.user_id = #{userId}
</if>
order by t.id asc
</select>
<select
id=
"getSampleCheckGroupList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleCheckGroupVo"
>
select sd.team_group_id as teamGroupId, tg.name as teamGroupName,
sd.user_id as userId, su.name as userName
from sample_distribution sd
left join team_group tg on tg.id = sd.team_group_id
left join sys_user su on su.id = sd.user_id
where sd.sample_id = #{sampleId}
group by sd.team_group_id,sd.user_id
order by sd.team_group_id
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleHandleEnclosureMapper.xml
0 → 100644
View file @
ba9b09a9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.SampleHandleEnclosureMapper"
>
<select
id=
"getList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleHandleEnclosureVo"
>
select t.*,
su.name as userName,
(
CASE t.status
WHEN 0 THEN '未上传'
WHEN 1 THEN '成功'
WHEN 2 THEN '上传失败'
ELSE ''
END
) as statusValue
from sample_handle_enclosure t
left join sys_user su on su.id = t.user_id
where t.sample_handle_id = #{params.sampleHandleId}
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
</if>
order by t.id ASC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/SampleHandleMapper.xml
View file @
ba9b09a9
...
...
@@ -20,28 +20,54 @@
<if
test=
"params.projectName != null and params.projectName != ''"
>
and p.name like concat('%', #{params.projectName}, '%')
</if>
<if
test=
"params.projectCode != null and params.projectCode != ''"
>
and p.code like concat('%', #{params.projectCode}, '%')
</if>
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleHandleVo"
>
select t.*, su.name as userName, s.name as sampleName, s.sample_code as sampleCode,
s.cement_code as cementCode, p.id as projectId, p.name as projectName, p.code as projectCode
<select
id=
"getSampleHandleList"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleHandleVo"
>
select t.*, p.id as projectId, p.name as projectName, p.code as projectCode,
e.sample_num as sampleNum,
s.name as sampleName, s.sample_code as sampleCode,s.cement_code as cementCode,
su.name as userName,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '已接受'
WHEN 2 THEN '已完成'
ELSE ''
END
) as statusValue
from sample_handle t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
left join entrust e on e.id = s.entrust_id
left join project p on p.id = e.project_id
<include
refid=
"where"
/>
order by t.create_time desc
where e.id = #{params.id} and s.cement_code = s.parallel_code
<if
test=
"params.userId != null"
>
and t.user_id = #{params.userId}
</if>
order by t.id ASC
</select>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.SampleHandleVo"
>
select t.*, su.name as userName, s.name as sampleName, s.sample_code as sampleCode,
s.cement_code as cementCode, p.id as projectId, p.name as projectName, p.code as projectCode
s.cement_code as cementCode, p.id as projectId, p.name as projectName, p.code as projectCode,
(
CASE t.status
WHEN 0 THEN '未接受'
WHEN 1 THEN '已接受'
WHEN 2 THEN '已完成'
ELSE ''
END
) as statusValue
from sample_handle t
left join sys_user su on su.id = t.user_id
left join sample s on s.id = t.sample_id
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/TeamMapper.xml
View file @
ba9b09a9
...
...
@@ -27,7 +27,7 @@
<select
id=
"getList"
resultType=
"cn.wise.sc.cement.business.model.vo.TeamListVo"
>
SELECT t.id as id, t.name as name, t.method_id as methodId,
SELECT t.id as id, t.name as name, t.
group_id as groupId, t.
method_id as methodId,
m.name as methodName, m.number as number
FROM team t
left join method m on m.id = t.method_id
...
...
@@ -41,7 +41,7 @@
FROM team t
left join team_group tg on tg.id = t.group_id
left join method m on m.id = t.method_id
where t.id =
$
{id}
where t.id =
#
{id}
</select>
...
...
@@ -62,9 +62,12 @@
<include
refid=
"where"
/>
</select>
<!--根据检测组id 获取所有检测项信息-->
<select
id=
"getByGroup"
resultType=
"java.lang.String"
>
SELECT t.name
FROM team t
WHERE t.group_id = #{groupId} and t.status = 1
</select>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/DistributionQuery.java
View file @
ba9b09a9
...
...
@@ -18,11 +18,6 @@ public class DistributionQuery {
@ApiModelProperty
(
"委托表id"
)
private
Integer
id
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"样品信息列表"
)
private
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
;
...
...
@@ -34,13 +29,7 @@ public class DistributionQuery {
this
.
id
=
id
;
}
public
String
getRemark
()
{
return
remark
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
public
List
<
SampleDistributionQuery
>
getSampleDistributionQueryList
()
{
return
sampleDistributionQueryList
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/HandleQuery.java
View file @
ba9b09a9
...
...
@@ -18,7 +18,7 @@ public class HandleQuery {
@ApiModelProperty
(
"委托表id"
)
private
Integer
id
;
@ApiModelProperty
(
"样品
及检测
项列表"
)
@ApiModelProperty
(
"样品
处理
项列表"
)
private
List
<
SampleHandleQuery
>
sampleHandleQueryList
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleCheckTeamQuery.java
View file @
ba9b09a9
...
...
@@ -28,19 +28,24 @@ public class SampleCheckTeamQuery {
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"检测
项目id(检测项目表)
"
)
private
Integer
te
stItem
Id
;
@ApiModelProperty
(
"检测
组id
"
)
private
Integer
te
amGroup
Id
;
@ApiModelProperty
(
"检测
项目
"
)
private
String
te
stItem
;
@ApiModelProperty
(
"检测
组名称
"
)
private
String
te
amGroupName
;
/**
* 检测项目信息 json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
* json串
{"样重m":"40","K值":1.0274,"Vsio2":3.89,................}
*/
@ApiModelProperty
(
"检测项目信息 json串"
)
private
String
testTeams
;
@ApiModelProperty
(
"主样检测结果 json串"
)
private
String
main_result
;
@ApiModelProperty
(
"次样检测结果json串"
)
private
String
secondary_result
;
@ApiModelProperty
(
"最终校核计算结果json串"
)
private
String
end_result
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleDistributionEnclosureQuery.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"委托-样品派发检测项上传附件请求"
)
public
class
SampleDistributionEnclosureQuery
{
@ApiModelProperty
(
"样品派发表id"
)
private
Integer
id
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"路径"
)
private
String
enclosureUrl
;
}
\ No newline at end of file
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleDistributionTeamQuery.java
View file @
ba9b09a9
...
...
@@ -9,29 +9,18 @@ import lombok.Data;
* @author: ztw
* @create: 2020-08-07 14:58
**/
//
@Data
@Data
@ApiModel
(
"委托-样品检测项派发请求"
)
public
class
SampleDistributionTeamQuery
{
@ApiModelProperty
(
"检测组id"
)
private
Integer
teamGroupId
;
@ApiModelProperty
(
"检测项id"
)
private
Integer
teamId
;
@ApiModelProperty
(
"检测人员id"
)
private
Integer
userId
;
public
Integer
getTeamId
()
{
return
teamId
;
}
public
void
setTeamId
(
Integer
teamId
)
{
this
.
teamId
=
teamId
;
}
public
Integer
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleHandleEnclosureQuery.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
@Data
@ApiModel
(
"委托-样品处理项数据上传附件请求"
)
public
class
SampleHandleEnclosureQuery
{
@ApiModelProperty
(
"样品处理附件表id"
)
private
Integer
id
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"路径"
)
private
String
enclosureUrl
;
}
\ No newline at end of file
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/SampleHandleQuery.java
View file @
ba9b09a9
...
...
@@ -14,7 +14,7 @@ import java.time.LocalDateTime;
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel
(
"委托-样品处理请求"
)
@ApiModel
(
"委托-样品处理
项
请求"
)
public
class
SampleHandleQuery
{
@ApiModelProperty
(
"样品表d"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/EntrustVo.java
View file @
ba9b09a9
...
...
@@ -93,18 +93,21 @@ public class EntrustVo {
/**
* 样品及检测项
*/
@ApiModelProperty
(
"样品临时列表"
)
@ApiModelProperty
(
"样品临时列表
新建的时候展示
"
)
private
List
<
SampleTmpVo
>
sampleTmpList
;
@ApiModelProperty
(
"样品列表(展示平行样的样品)"
)
@ApiModelProperty
(
"样品列表(展示平行样的样品)
派发的时候展示
"
)
private
List
<
SampleVo
>
sampleList
;
@ApiModelProperty
(
"样品处理列表(不展示平行样的样品)"
)
@ApiModelProperty
(
"样品处理列表(不展示平行样的样品)
样品处理的时候展示
"
)
private
List
<
SampleVo
>
sampleHandleList
;
@ApiModelProperty
(
"检测项 只显示第一个样品的"
)
private
String
checkTeam
;
@ApiModelProperty
(
"所有样品名称"
)
private
String
sampleNames
;
@ApiModelProperty
(
"检测依据编号 只显示第一个样品的"
)
private
String
checkMethodNumber
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleCheckGroupVo.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
com.alibaba.fastjson.JSONArray
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @description:
* @author: qh
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel
(
"校核-检测组Vo"
)
public
class
SampleCheckGroupVo
{
@ApiModelProperty
(
"检测组id"
)
private
Integer
teamGroupId
;
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
@ApiModelProperty
(
"检测人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"检测人姓名"
)
private
String
userName
;
@ApiModelProperty
(
"校核元素 json串"
)
private
String
checkElement
;
@ApiModelProperty
(
"校核元素 json数组"
)
private
JSONArray
checkElementList
;
@ApiModelProperty
(
"校核结果 json串"
)
private
List
<
String
>
checkResult
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleCheckVo.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.List
;
/**
* @description:
* @author: qh
* @create: 2020-08-07 14:58
**/
@Data
@ApiModel
(
"校核-样品Vo"
)
public
class
SampleCheckVo
{
@ApiModelProperty
(
"样品表id"
)
private
Integer
id
;
@ApiModelProperty
(
"样品名"
)
private
String
name
;
@ApiModelProperty
(
"来样编号"
)
private
String
sampleCode
;
@ApiModelProperty
(
"本所编号"
)
private
String
cementCode
;
@ApiModelProperty
(
"平行样编号"
)
private
String
parallelCode
;
@ApiModelProperty
(
"检测组列表"
)
public
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleDistributionTeamVo.java
View file @
ba9b09a9
...
...
@@ -16,20 +16,46 @@ public class SampleDistributionTeamVo {
@ApiModelProperty
(
"派发表id"
)
private
Integer
distributionId
;
/**
* 检测项id
*/
@ApiModelProperty
(
"检测组id"
)
private
Integer
teamGroupId
;
@ApiModelProperty
(
"检测组名称"
)
private
String
teamGroupName
;
@ApiModelProperty
(
"检测项id"
)
private
Integer
teamId
;
@ApiModelProperty
(
"检测项名称"
)
private
String
teamName
;
@ApiModelProperty
(
"检测人员id"
)
private
Integer
userId
;
@ApiModelProperty
(
"检测人员姓名"
)
private
String
userName
;
@ApiModelProperty
(
"(0未接受,1接受,2完成)"
)
private
Integer
status
;
@ApiModelProperty
(
" 状态值(0未接受,1已接受,2已完成)"
)
private
String
statusValue
;
@ApiModelProperty
(
"附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleHandleEnclosureVo.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
/**
* <p>
*
* </p>
*
* @author ztw
* @since 2020-09-14
*/
@Data
@ApiModel
(
"样品处理-数据上传Vo"
)
public
class
SampleHandleEnclosureVo
{
private
Integer
id
;
@ApiModelProperty
(
"样品处理表id"
)
private
Integer
sampleHandleId
;
@ApiModelProperty
(
"处理项表id"
)
private
Integer
handleId
;
@ApiModelProperty
(
"操作人id"
)
private
Integer
userId
;
@ApiModelProperty
(
"操作人姓名"
)
private
String
userName
;
@ApiModelProperty
(
"附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"创建时间"
)
private
LocalDateTime
createTime
;
@ApiModelProperty
(
"上传图片时间"
)
private
LocalDateTime
updateTime
;
@ApiModelProperty
(
"状态(0未上传,1成功,2上传失败)"
)
private
Integer
status
;
@ApiModelProperty
(
" 状态值(0未接受,1接受,2完成)"
)
private
String
statusValue
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/SampleHandleVo.java
View file @
ba9b09a9
...
...
@@ -30,6 +30,9 @@ public class SampleHandleVo {
@ApiModelProperty
(
"项目编号"
)
private
String
projectCode
;
@ApiModelProperty
(
"样品数量"
)
private
Integer
sampleNum
;
@ApiModelProperty
(
"样品表d"
)
private
Integer
sampleId
;
...
...
@@ -48,9 +51,12 @@ public class SampleHandleVo {
@ApiModelProperty
(
"处理人员姓名"
)
private
String
userName
;
@ApiModelProperty
(
"处理项"
)
@ApiModelProperty
(
"处理项
(1、2、3)
"
)
private
String
content
;
@ApiModelProperty
(
"处理项名称(打磨、棍磨)"
)
private
String
contentName
;
@ApiModelProperty
(
"要求完成日期(计划完成日期)"
)
private
LocalDate
planFinishDate
;
...
...
@@ -60,4 +66,7 @@ public class SampleHandleVo {
@ApiModelProperty
(
"(0未接受,1接受,2完成)"
)
private
Integer
status
;
@ApiModelProperty
(
" 状态值(0未接受,1接受,2完成)"
)
private
String
statusValue
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/TeamListVo.java
View file @
ba9b09a9
...
...
@@ -21,6 +21,9 @@ public class TeamListVo {
@ApiModelProperty
(
"检测项目"
)
private
String
name
;
@ApiModelProperty
(
"检测组表id"
)
private
Integer
groupId
;
@ApiModelProperty
(
"检测依据表id"
)
private
Integer
methodId
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/IEntrustService.java
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.Entrust
;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.entity.SampleHandleEnclosure
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.*
;
import
cn.wise.sc.cement.business.model.vo.EntrustVo
;
import
cn.wise.sc.cement.business.model.vo.SampleDistributionVo
;
import
cn.wise.sc.cement.business.model.vo.SampleHandleVo
;
import
cn.wise.sc.cement.business.model.vo.*
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 服务类
...
...
@@ -21,7 +24,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
public
interface
IEntrustService
extends
IService
<
Entrust
>
{
BaseResponse
<
IPage
<
EntrustVo
>>
getPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
);
Integer
clientId
,
String
projectName
,
String
projectCode
);
BaseResponse
<
String
>
setTopping
(
Integer
id
);
...
...
@@ -34,19 +37,42 @@ public interface IEntrustService extends IService<Entrust> {
BaseResponse
<
String
>
approval
(
ApprovalQuery
query
);
BaseResponse
<
String
>
handle
(
HandleQuery
query
);
BaseResponse
<
IPage
<
SampleHandleVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
);
BaseResponse
<
String
>
acceptHandle
(
Integer
id
);
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleHandleList
(
Integer
id
);
BaseResponse
<
String
>
acceptHandle
(
Integer
[]
ids
);
BaseResponse
<
List
<
SampleHandleEnclosureVo
>>
getSampleHandleEnclosureList
(
Integer
sampleHandleId
);
BaseResponse
<
SampleHandleEnclosure
>
uploadEnclosureCL
(
SampleHandleEnclosureQuery
query
);
BaseResponse
<
SampleHandleVo
>
getHandleDtail
(
Integer
id
);
BaseResponse
<
String
>
finishHandle
(
Integer
id
);
BaseResponse
<
String
>
finishHandle
(
Integer
[]
ids
);
BaseResponse
<
String
>
distribution
(
DistributionQuery
query
);
BaseResponse
<
IPage
<
SampleDistributionVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
);
BaseResponse
<
String
>
acceptDistribution
(
Integer
id
);
BaseResponse
<
String
>
finishDistribution
(
Integer
id
);
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
String
projectCode
);
BaseResponse
<
Map
<
String
,
Object
>>
getSampleDistributionList
(
Integer
id
);
BaseResponse
<
String
>
acceptDistribution
(
Integer
[]
ids
);
BaseResponse
<
SampleDistribution
>
uploadEnclosurePF
(
SampleDistributionEnclosureQuery
query
);
BaseResponse
<
String
>
finishDistribution
(
Integer
[]
ids
);
BaseResponse
<
IPage
<
EntrustVo
>>
getCheckPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
);
BaseResponse
<
Map
<
String
,
Object
>>
getCheckList
(
Integer
id
);
BaseResponse
<
List
<
SampleCheckVo
>>
getCheckDetail
(
String
cementCode
);
BaseResponse
<
List
<
SampleDistribution
>>
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
);
BaseResponse
<
String
>
check
(
CheckQuery
query
);
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/ISampleHandleEnclosureService.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.SampleHandleEnclosure
;
import
com.baomidou.mybatisplus.extension.service.IService
;
/**
* <p>
* 服务类
* </p>
*
* @author ztw
* @since 2020-09-14
*/
public
interface
ISampleHandleEnclosureService
extends
IService
<
SampleHandleEnclosure
>
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/ITeamService.java
View file @
ba9b09a9
...
...
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
...
...
@@ -36,5 +37,7 @@ public interface ITeamService extends IService<Team> {
void
export
(
Integer
status
,
Integer
gourpId
,
String
name
,
String
fileName
,
HttpServletResponse
response
);
BaseResponse
<
List
<
String
>>
getByGroup
(
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/EntrustServiceImpl.java
View file @
ba9b09a9
...
...
@@ -10,10 +10,12 @@ import cn.wise.sc.cement.business.model.vo.*;
import
cn.wise.sc.cement.business.service.*
;
import
cn.wise.sc.cement.business.util.RedisUtil
;
import
cn.wise.sc.cement.business.wrapper.page.Query
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.models.auth.In
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.tomcat.jni.Local
;
...
...
@@ -81,6 +83,14 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
private
SysApprovalMapper
sysApprovalMapper
;
@Resource
private
MethodMapper
methodMapper
;
@Resource
private
HandleMapper
handleMapper
;
@Autowired
private
ISampleHandleEnclosureService
sampleHandleEnclosureService
;
@Resource
private
SampleHandleEnclosureMapper
sampleHandleEnclosureMapper
;
@Resource
private
TeamGroupMapper
teamGroupMapper
;
/**
* 委托分页
...
...
@@ -94,7 +104,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
*/
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
){
Integer
clientId
,
String
projectName
,
String
projectCode
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
...
...
@@ -105,6 +115,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"委托评审"
);
if
(
approvalId
==
null
){
return
BaseResponse
.
errorMsg
(
"委托评审信息错误"
);
...
...
@@ -121,7 +132,14 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
//检测项目名称
String
sampleNames
=
""
;
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()>
0
){
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
){
sampleNames
=
sampleNames
.
equals
(
""
)?
sampleTmp
.
getName
():(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
checkTeam
=
""
;
...
...
@@ -162,10 +180,6 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
/**
* 新增委托
* @param query
...
...
@@ -208,13 +222,13 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
for
(
SampleTmpQuery
sampleTmpQuery
:
query
.
getSampleTmpList
()){
SampleTmp
sampleTmp
=
new
SampleTmp
();
BeanUtils
.
copyProperties
(
sampleTmpQuery
,
sampleTmp
);
String
teamIds
=
sampleTmpQuery
.
getTeamIds
();
String
teamIds
=
sampleTmpQuery
.
getTeamIds
();
//选择的检测项id集合
BigDecimal
charge
=
new
BigDecimal
(
"0.00"
);
System
.
out
.
println
(
"charge==========================="
+
charge
);
if
(
teamIds
!=
null
){
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
){
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
){
charge
=
charge
.
compareTo
(
BigDecimal
.
ZERO
)==
0
?
team
.
getCharge
():(
charge
.
add
(
team
.
getCharge
()));
}
...
...
@@ -242,7 +256,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
EntrustVo
entrustVo
=
entrustMapper
.
getDetail
(
id
);
if
(
entrustVo
.
getStatus
()
==
1
){
if
(
entrustVo
.
getStatus
()
!=
0
){
QueryWrapper
<
Sample
>
sampleWrapper
=
new
QueryWrapper
<>();
sampleWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
sampleWrapper
.
orderByAsc
(
"id"
);
...
...
@@ -259,19 +273,22 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
teamIds
!=
null
){
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
){
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
){
teamName
=
teamName
.
equals
(
""
)?
team
.
getName
():(
teamName
+
"、"
+
team
.
getName
());
Team
Vo
teamVo
=
teamMapper
.
getDetail
(
Integer
.
valueOf
(
teamId
));
if
(
team
Vo
!=
null
){
teamName
=
teamName
.
equals
(
""
)?
team
Vo
.
getName
():(
teamName
+
"、"
+
teamVo
.
getName
());
SampleDistributionTeamVo
distributionTeamVo
=
new
SampleDistributionTeamVo
();
distributionTeamVo
.
setTeamId
(
team
.
getId
());
distributionTeamVo
.
setTeamName
(
team
.
getName
());
distributionTeamVo
.
setTeamGroupId
(
teamVo
.
getGroupId
());
distributionTeamVo
.
setTeamGroupName
(
teamVo
.
getGroupName
());
distributionTeamVo
.
setTeamId
(
teamVo
.
getId
());
distributionTeamVo
.
setTeamName
(
teamVo
.
getName
());
sampleNoDistributionTeamVoList
.
add
(
distributionTeamVo
);
}
}
}
sampleVo
.
setTeamName
(
teamName
);
//评审人员可以查看所有的检测项内容
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
());
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
()
,
null
);
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()>
0
)
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
}
else
{
...
...
@@ -393,7 +410,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
sample
.
setId
(
null
)
.
setSampleId
(
sampleQuery
.
getId
())
.
setStatus
(
0
)
//样品状态为未领用状态
.
setCreateTime
(
LocalDateTime
.
now
());
.
setCreateTime
(
LocalDateTime
.
now
())
.
setIsHandle
(
0
)
//样品处理未完成状态
.
setIsCheck
(
0
);
//样品检测未完成状态
if
(
sampleQuery
.
getIsParallel
()
==
1
){
//平行样
//生成平行样编号 (如果是平行样,会生成两条记录,本所编号是相同的,
// 第一个平行样编号和本所编号相同,第二个平行样的平行样编号会在本所编号上+1)
...
...
@@ -461,6 +480,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
List
<
SampleHandleQuery
>
sampleHandleQueryList
=
query
.
getSampleHandleQueryList
();
List
<
SampleHandle
>
sampleHandleList
=
new
ArrayList
<>();
for
(
SampleHandleQuery
sampleHandleQuery
:
sampleHandleQueryList
){
//样品处理表
SampleHandle
sampleHandle
=
new
SampleHandle
();
if
(
sampleHandleQuery
.
getSampleId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
...
...
@@ -469,7 +489,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
errorMsg
(
"请选择处理人"
);
}
if
(
StringUtils
.
isEmpty
(
sampleHandleQuery
.
getContent
())){
return
BaseResponse
.
errorMsg
(
"请
填写
处理项"
);
return
BaseResponse
.
errorMsg
(
"请
选择
处理项"
);
}
if
(
sampleHandleQuery
.
getPlanFinishDate
()
==
null
){
return
BaseResponse
.
errorMsg
(
"请选择要求完成日期"
);
...
...
@@ -477,52 +497,138 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
BeanUtils
.
copyProperties
(
sampleHandleQuery
,
sampleHandle
);
sampleHandle
.
setStatus
(
0
).
setCreateTime
(
LocalDateTime
.
now
());
sampleHandleList
.
add
(
sampleHandle
);
//样品处理项附件表
if
(
sampleHandle
.
getContent
()
!=
null
){
String
[]
handIdS
=
sampleHandle
.
getContent
().
split
(
"、"
);
List
<
SampleHandleEnclosure
>
sampleHandleEnclosureList
=
new
ArrayList
<>();
for
(
String
handleId
:
handIdS
){
Handle
handle
=
handleMapper
.
selectById
(
Integer
.
valueOf
(
handleId
));
if
(
handle
==
null
){
return
BaseResponse
.
errorMsg
(
"选择的处理项信息有误"
);
}
SampleHandleEnclosure
sampleHandleEnclosure
=
new
SampleHandleEnclosure
();
sampleHandleEnclosure
.
setSampleHandleId
(
sampleHandle
.
getId
())
.
setHandleId
(
handle
.
getId
())
.
setUserId
(
sampleHandle
.
getUserId
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setStatus
(
0
)
.
setAlias
(
handle
.
getName
());
sampleHandleEnclosureList
.
add
(
sampleHandleEnclosure
);
}
sampleHandleEnclosureService
.
saveBatch
(
sampleHandleEnclosureList
);
}
}
sampleHandleService
.
saveBatch
(
sampleHandleList
);
}
entrust
.
setIsHandle
(
1
);
//该委托单下的样品改为已领用状态
/*QueryWrapper<Sample> sampleWrapper = new QueryWrapper<>();
sampleWrapper.eq("entrust_id", entrust.getId());
List<Sample> sampleList = sampleMapper.selectList(sampleWrapper);
if(sampleList != null && sampleList.size()>0){
for(Sample sample : sampleList){
sample.setStatus(1);//已领用状态
}
}
sampleService.updateBatchById(sampleList);*/
//委托表改成已发送样品处理,状态改为样品处理状态中
entrust
.
setIsHandle
(
1
)
.
setStatus
(
3
);
entrustMapper
.
updateById
(
entrust
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"发送样品处理任务"
,
null
);
return
BaseResponse
.
okMsg
(
"已发送样品处理任务"
);
}
/**
* 样品处理分页
* 样品处理
任务
分页
* @param pageQuery
* @param startDate
* @param endDate
* @param status
* @param clientId
* @param projectName
* @param projectCode
* @return
*/
@Override
public
BaseResponse
<
IPage
<
SampleHandleVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
){
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleHandlePage
(
PageQuery
pageQuery
,
String
projectCode
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"userId"
,
loginUser
.
getId
());
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
SampleHandleVo
>
pages
=
sampleHandleMapper
.
getPage
(
page
,
params
);
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleHandlePage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
){
for
(
EntrustVo
entrustVo
:
list
){
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustVo
.
getId
());
//检测项目名称
String
sampleNames
=
""
;
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
){
//样品名称 列表中的拼接
for
(
Sample
sample
:
sampleList
){
sampleNames
=
sampleNames
.
equals
(
""
)?
sample
.
getName
():(
sampleNames
+
"、"
+
sample
.
getName
());
}
//检测项 和检测依据 列表里只显示第一个样品的
Sample
sample
=
sampleList
.
get
(
0
);
String
teamIds
=
sample
.
getTeamIds
();
String
checkTeam
=
""
;
if
(
teamIds
!=
null
){
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
){
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
){
checkTeam
=
checkTeam
.
equals
(
""
)?
team
.
getName
():(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
entrustVo
.
setCheckTeam
(
checkTeam
);
entrustVo
.
setCheckMethodNumber
(
sample
.
getMethodNumbers
());
}
entrustVo
.
setSampleNames
(
sampleNames
);
}
}
pages
.
setRecords
(
list
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 样品处理任务列表
* @param id 委托表id
* @return
*/
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleHandleList
(
Integer
id
){
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
LoginUser
loginUser
=
userService
.
getLoginUser
();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
id
);
params
.
put
(
"userId"
,
loginUser
.
getId
());
List
<
SampleHandleVo
>
SampleHandleList
=
sampleHandleMapper
.
getSampleHandleList
(
params
);
map
.
put
(
"entrust"
,
entrust
);
map
.
put
(
"SampleHandleList"
,
SampleHandleList
);
return
BaseResponse
.
okData
(
map
);
}
/**
* 接受样品处理任务
* @param id
* @param id
s 委托单
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
acceptHandle
(
Integer
id
){
if
(
id
==
null
){
public
BaseResponse
<
String
>
acceptHandle
(
Integer
[]
ids
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
ids
==
null
||
ids
.
length
<=
0
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
List
<
SampleHandle
>
sampleHandleList
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
){
SampleHandle
sampleHandle
=
sampleHandleMapper
.
selectById
(
id
);
if
(
sampleHandle
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
...
...
@@ -530,10 +636,15 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sampleHandle
.
getStatus
()
!=
0
){
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
if
(
loginUser
.
getId
()
!=
sampleHandle
.
getUserId
()){
return
BaseResponse
.
errorMsg
(
"请登录样品处理人账号操作"
);
}
sampleHandle
.
setStatus
(
1
).
setAcceptTime
(
LocalDateTime
.
now
());
sampleHandleMapper
.
updateById
(
sampleHandle
);
Sample
sample
=
sampleService
.
getById
(
sampleHandle
.
getSampleId
());
sampleHandleList
.
add
(
sampleHandle
);
}
sampleHandleService
.
updateBatchById
(
sampleHandleList
);
//记录委托单日志
Sample
sample
=
sampleService
.
getById
(
sampleHandleList
.
get
(
0
).
getSampleId
());
if
(
sample
==
null
){
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
...
...
@@ -541,6 +652,53 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
okMsg
(
"已接受样品处理任务"
);
}
/**
* 数据上传列表
* @param sampleHandleId 样品处理表id
* @return
*/
public
BaseResponse
<
List
<
SampleHandleEnclosureVo
>>
getSampleHandleEnclosureList
(
Integer
sampleHandleId
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"sampleHandleId"
,
sampleHandleId
);
params
.
put
(
"userId"
,
loginUser
.
getId
());
List
<
SampleHandleEnclosureVo
>
list
=
sampleHandleEnclosureMapper
.
getList
(
params
);
return
BaseResponse
.
okData
(
list
);
}
/**
* 样品处理数据上传附件
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
SampleHandleEnclosure
>
uploadEnclosureCL
(
SampleHandleEnclosureQuery
query
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
query
==
null
||
query
.
getId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
SampleHandleEnclosure
sampleHandleEnclosure
=
sampleHandleEnclosureMapper
.
selectById
(
query
.
getId
());
if
(
sampleHandleEnclosure
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误"
);
}
sampleHandleEnclosure
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
.
setExtName
(
query
.
getExtName
())
.
setUpdateTime
(
LocalDateTime
.
now
())
.
setStatus
(
1
);
if
(
StringUtils
.
isEmpty
(
query
.
getEnclosureUrl
())){
sampleHandleEnclosure
.
setStatus
(
2
);
//上传失败
}
sampleHandleEnclosureMapper
.
updateById
(
sampleHandleEnclosure
);
return
BaseResponse
.
okData
(
sampleHandleEnclosure
);
}
/**
* 样品处理详情
* @param id
...
...
@@ -552,19 +710,23 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
okData
(
sampleHandleVo
);
}
/**
* 完成样品处理任务
* @param id
* @param id
s
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finishHandle
(
Integer
id
){
if
(
id
==
null
){
public
BaseResponse
<
String
>
finishHandle
(
Integer
[]
ids
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
ids
==
null
||
ids
.
length
<=
0
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
Entrust
entrust
=
null
;
for
(
Integer
id
:
ids
){
SampleHandle
sampleHandle
=
sampleHandleMapper
.
selectById
(
id
);
if
(
sampleHandle
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
...
...
@@ -572,18 +734,45 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
sampleHandle
.
getStatus
()
!=
1
){
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
if
(
loginUser
.
getId
()
!=
sampleHandle
.
getUserId
()){
return
BaseResponse
.
errorMsg
(
"请登录样品处理人账号操作"
);
}
sampleHandle
.
setStatus
(
2
).
setFinishTime
(
LocalDateTime
.
now
());
sampleHandleMapper
.
updateById
(
sampleHandle
);
Sample
sample
=
sampleService
.
getById
(
sampleHandle
.
getSampleId
());
//判断该委托单下的所有样品的处理 及 处理项是否全部完成
Sample
sample
=
sampleMapper
.
selectById
(
sampleHandle
.
getSampleId
());
if
(
sample
==
null
){
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
sample
.
getEntrustId
(),
"完成样品处理任务"
,
null
);
QueryWrapper
<
SampleHandle
>
sampleHandleWrapper
=
new
QueryWrapper
<>();
sampleHandleWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
sampleHandleWrapper
.
ne
(
"status"
,
2
);
List
<
SampleHandle
>
sampleHandleIngList
=
sampleHandleMapper
.
selectList
(
sampleHandleWrapper
);
if
(
sampleHandleIngList
==
null
||
sampleHandleIngList
.
size
()
==
0
){
sample
.
setIsHandle
(
1
);
//样品处理全部完成
}
sampleMapper
.
updateById
(
sample
);
entrust
=
entrustMapper
.
selectById
(
sample
.
getEntrustId
());
if
(
entrust
!=
null
){
if
(
entrust
.
getStatus
()
!=
3
){
return
BaseResponse
.
errorMsg
(
"委托单状态错误"
);
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getNoHandleList
(
sample
.
getEntrustId
());
if
(
sampleList
==
null
||
sampleList
.
size
()
==
0
){
entrust
.
setStatus
(
4
);
}
entrustMapper
.
updateById
(
entrust
);
}
}
if
(
entrust
==
null
){
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
}
//记录委托单日志
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"完成样品处理任务"
,
null
);
return
BaseResponse
.
okMsg
(
"已完成样品处理任务"
);
}
/**
* 派发检测项目任务
* @param query
...
...
@@ -592,6 +781,10 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
@Transactional
@Override
public
BaseResponse
<
String
>
distribution
(
DistributionQuery
query
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
query
.
getId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
...
...
@@ -599,10 +792,9 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
entrust
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
if
(
entrust
.
getStatus
()
!=
1
){
if
(
entrust
.
getStatus
()
!=
4
){
return
BaseResponse
.
errorMsg
(
"当前状态不允许派发"
);
}
entrust
.
setRemark
(
query
.
getRemark
());
if
(
query
.
getSampleDistributionQueryList
()
!=
null
&&
query
.
getSampleDistributionQueryList
().
size
()>
0
){
List
<
SampleDistributionQuery
>
sampleDistributionQueryList
=
query
.
getSampleDistributionQueryList
();
List
<
SampleDistribution
>
sampleDistributionList
=
new
ArrayList
<>();
...
...
@@ -614,7 +806,8 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
distributionQuery
.
getSampleDistributionTeamQueryList
()
!=
null
&&
distributionQuery
.
getSampleDistributionTeamQueryList
().
size
()>
0
){
List
<
SampleDistributionTeamQuery
>
sampleDistributionTeamQueryList
=
distributionQuery
.
getSampleDistributionTeamQueryList
();
for
(
SampleDistributionTeamQuery
distributionTeamQuery
:
sampleDistributionTeamQueryList
){
if
(
distributionTeamQuery
==
null
||
distributionTeamQuery
.
getTeamId
()==
null
){
if
(
distributionTeamQuery
==
null
||
distributionTeamQuery
.
getTeamId
()==
null
||
distributionTeamQuery
.
getTeamGroupId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"检测项信息错误"
);
}
if
(
distributionTeamQuery
.
getUserId
()
==
null
){
...
...
@@ -622,6 +815,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
SampleDistribution
sampleDistribution
=
new
SampleDistribution
();
sampleDistribution
.
setSampleId
(
distributionQuery
.
getSampleId
())
.
setTeamGroupId
(
distributionTeamQuery
.
getTeamGroupId
())
.
setTeamId
(
distributionTeamQuery
.
getTeamId
())
.
setUserId
(
distributionTeamQuery
.
getUserId
())
.
setStatus
(
0
)
...
...
@@ -639,7 +833,7 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
distributionService
.
saveBatch
(
sampleDistributionList
);
sampleService
.
updateBatchById
(
sampleList
);
}
entrust
.
setIsDistribution
(
1
);
entrust
.
set
Status
(
5
).
set
IsDistribution
(
1
);
entrustMapper
.
updateById
(
entrust
);
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"派发检测项目任务"
,
null
);
return
BaseResponse
.
okMsg
(
"已派发检测项目任务"
);
...
...
@@ -647,42 +841,139 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
/**
* 派发分页
* 派发
任务
分页
* @param pageQuery
* @param startDate
* @param endDate
* @param status
* @param clientId
* @param projectName
* @param projectCode
* @return
*/
@Override
public
BaseResponse
<
IPage
<
SampleDistributionVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
){
public
BaseResponse
<
IPage
<
EntrustVo
>>
getSampleDistributionPage
(
PageQuery
pageQuery
,
String
projectName
,
String
projectCode
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
params
.
put
(
"userId"
,
loginUser
.
getId
());
Page
<
SampleDistributionVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
SampleDistributionVo
>
pages
=
distributionMapper
.
getPage
(
page
,
params
);
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getSampleDistributionPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
){
for
(
EntrustVo
entrustVo
:
list
){
List
<
Sample
>
sampleList
=
sampleMapper
.
getSampleList
(
entrustVo
.
getId
());
//检测项目名称
String
sampleNames
=
""
;
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
){
//样品名称 列表中的拼接
for
(
Sample
sample
:
sampleList
){
sampleNames
=
sampleNames
.
equals
(
""
)?
sample
.
getName
():(
sampleNames
+
"、"
+
sample
.
getName
());
}
//检测项 和检测依据 列表里只显示第一个样品的
Sample
sample
=
sampleList
.
get
(
0
);
String
teamIds
=
sample
.
getTeamIds
();
String
checkTeam
=
""
;
if
(
teamIds
!=
null
){
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
){
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
){
checkTeam
=
checkTeam
.
equals
(
""
)?
team
.
getName
():(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
entrustVo
.
setCheckTeam
(
checkTeam
);
entrustVo
.
setCheckMethodNumber
(
sample
.
getMethodNumbers
());
}
entrustVo
.
setSampleNames
(
sampleNames
);
}
}
pages
.
setRecords
(
list
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 检测通知单详情
* @param id 委托表id
* @return
*/
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
getSampleDistributionList
(
Integer
id
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
QueryWrapper
<
Sample
>
sampleWrapper
=
new
QueryWrapper
<>();
sampleWrapper
.
eq
(
"entrust_id"
,
id
);
sampleWrapper
.
orderByAsc
(
"id"
);
List
<
Sample
>
sampleList
=
sampleService
.
list
(
sampleWrapper
);
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
){
for
(
Sample
sample
:
sampleList
){
SampleVo
sampleVo
=
new
SampleVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
String
teamIds
=
sample
.
getTeamIds
();
String
teamName
=
""
;
List
<
SampleDistributionTeamVo
>
sampleNoDistributionTeamVoList
=
new
ArrayList
<>();
if
(
teamIds
!=
null
){
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
){
TeamVo
teamVo
=
teamMapper
.
getDetail
(
Integer
.
valueOf
(
teamId
));
if
(
teamVo
!=
null
){
teamName
=
teamName
.
equals
(
""
)?
teamVo
.
getName
():(
teamName
+
"、"
+
teamVo
.
getName
());
SampleDistributionTeamVo
distributionTeamVo
=
new
SampleDistributionTeamVo
();
distributionTeamVo
.
setTeamGroupId
(
teamVo
.
getGroupId
());
distributionTeamVo
.
setTeamGroupName
(
teamVo
.
getGroupName
());
distributionTeamVo
.
setTeamId
(
teamVo
.
getId
());
distributionTeamVo
.
setTeamName
(
teamVo
.
getName
());
sampleNoDistributionTeamVoList
.
add
(
distributionTeamVo
);
}
}
}
sampleVo
.
setTeamName
(
teamName
);
//检测人员只能看到自己则的检测内容
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
loginUser
.
getId
());
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()>
0
)
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
}
else
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleNoDistributionTeamVoList
);
}
sampleVoList
.
add
(
sampleVo
);
}
}
map
.
put
(
"entrust"
,
entrust
);
map
.
put
(
"sampleVoList"
,
sampleVoList
);
return
BaseResponse
.
okData
(
map
);
}
/**
* 接受检测项目任务
* @param id
* @param id
s 样品派发表id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
acceptDistribution
(
Integer
id
){
if
(
id
==
null
){
public
BaseResponse
<
String
>
acceptDistribution
(
Integer
[]
ids
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
ids
==
null
||
ids
.
length
<=
0
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
List
<
SampleDistribution
>
sampleHandleList
=
new
ArrayList
<>();
for
(
Integer
id
:
ids
){
SampleDistribution
distribution
=
distributionMapper
.
selectById
(
id
);
if
(
distribution
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
...
...
@@ -691,8 +982,11 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
errorMsg
(
"状态错误"
);
}
distribution
.
setStatus
(
1
).
setAcceptTime
(
LocalDateTime
.
now
());
distributionMapper
.
updateById
(
distribution
);
Sample
sample
=
sampleService
.
getById
(
distribution
.
getSampleId
());
sampleHandleList
.
add
(
distribution
);
}
distributionService
.
updateBatchById
(
sampleHandleList
);
Sample
sample
=
sampleService
.
getById
(
sampleHandleList
.
get
(
0
).
getSampleId
());
if
(
sample
==
null
){
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
...
...
@@ -700,17 +994,51 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
return
BaseResponse
.
okMsg
(
"已接受检测项目任务"
);
}
/**
* 检测项目上传附件
* @param query
* @return
*/
@Transactional
@Override
public
BaseResponse
<
SampleDistribution
>
uploadEnclosurePF
(
SampleDistributionEnclosureQuery
query
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
query
==
null
||
query
.
getId
()
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
SampleDistribution
sampleDistribution
=
distributionMapper
.
selectById
(
query
.
getId
());
if
(
sampleDistribution
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误"
);
}
sampleDistribution
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
.
setExtName
(
query
.
getExtName
())
.
setAlias
(
query
.
getAlias
())
.
setUpdateTime
(
LocalDateTime
.
now
());
distributionMapper
.
updateById
(
sampleDistribution
);
return
BaseResponse
.
okData
(
sampleDistribution
);
}
/**
* 完成检测项目任务
* @param id
* @param id
s 样品派发表id
* @return
*/
@Transactional
@Override
public
BaseResponse
<
String
>
finishDistribution
(
Integer
id
){
if
(
id
==
null
){
public
BaseResponse
<
String
>
finishDistribution
(
Integer
[]
ids
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
ids
==
null
||
ids
.
length
<=
0
){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
Entrust
entrust
=
null
;
for
(
Integer
id
:
ids
){
SampleDistribution
distribution
=
distributionMapper
.
selectById
(
id
);
if
(
distribution
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
...
...
@@ -720,14 +1048,220 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
}
distribution
.
setStatus
(
2
).
setFinishTime
(
LocalDateTime
.
now
());
distributionMapper
.
updateById
(
distribution
);
Sample
sample
=
sampleService
.
getById
(
distribution
.
getSampleId
());
//判断该委托单下的所有样品的检测 及 检测项是否全部完成
Sample
sample
=
sampleMapper
.
selectById
(
distribution
.
getSampleId
());
if
(
sample
==
null
){
return
BaseResponse
.
errorMsg
(
"样品信息错误"
);
}
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
sample
.
getEntrustId
(),
"完成检测项目任务"
,
null
);
QueryWrapper
<
SampleDistribution
>
sampleDistributionWrapper
=
new
QueryWrapper
<>();
sampleDistributionWrapper
.
eq
(
"sample_id"
,
sample
.
getId
());
sampleDistributionWrapper
.
ne
(
"status"
,
2
);
List
<
SampleDistribution
>
sampleDistributionIngList
=
distributionMapper
.
selectList
(
sampleDistributionWrapper
);
if
(
sampleDistributionIngList
==
null
||
sampleDistributionIngList
.
size
()
==
0
){
sample
.
setIsCheck
(
1
);
//样品检测全部完成
}
sampleMapper
.
updateById
(
sample
);
entrust
=
entrustMapper
.
selectById
(
sample
.
getEntrustId
());
if
(
entrust
!=
null
){
if
(
entrust
.
getStatus
()
!=
5
){
return
BaseResponse
.
errorMsg
(
"委托单状态错误"
);
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getNoDistributionList
(
sample
.
getEntrustId
());
if
(
sampleList
==
null
||
sampleList
.
size
()
==
0
){
entrust
.
setStatus
(
6
);
}
entrustMapper
.
updateById
(
entrust
);
}
}
if
(
entrust
==
null
){
return
BaseResponse
.
errorMsg
(
"委托信息错误"
);
}
logsService
.
saveLog
(
SysLogs
.
ObjType
.
ENTRUST_LOG
,
entrust
.
getId
(),
"完成检测项目任务"
,
null
);
return
BaseResponse
.
okMsg
(
"已完成检测项目任务"
);
}
/**
* 数据校核分页
* @param pageQuery
* @param startDate
* @param endDate
* @param status
* @param clientId
* @param projectName
* @param projectCode
* @return
*/
@Override
public
BaseResponse
<
IPage
<
EntrustVo
>>
getCheckPage
(
PageQuery
pageQuery
,
String
startDate
,
String
endDate
,
Integer
status
,
Integer
clientId
,
String
projectName
,
String
projectCode
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"startDate"
,
startDate
);
params
.
put
(
"endDate"
,
endDate
);
params
.
put
(
"status"
,
status
);
params
.
put
(
"clientId"
,
clientId
);
params
.
put
(
"projectName"
,
projectName
);
params
.
put
(
"projectCode"
,
projectCode
);
Integer
approvalId
=
sysApprovalMapper
.
getApprovalId
(
"数据校核"
);
if
(
approvalId
==
null
){
return
BaseResponse
.
errorMsg
(
"数据校核信息错误"
);
}
if
(
loginUser
.
getId
()
!=
approvalId
){
return
BaseResponse
.
errorMsg
(
"当前登录账号没有数据校核权限"
);
}
Page
<
EntrustVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
EntrustVo
>
pages
=
entrustMapper
.
getCheckPage
(
page
,
params
);
List
<
EntrustVo
>
list
=
pages
.
getRecords
();
if
(
list
!=
null
&&
list
.
size
()>
0
){
for
(
EntrustVo
entrustVo
:
list
){
QueryWrapper
<
SampleTmp
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"entrust_id"
,
entrustVo
.
getId
());
List
<
SampleTmp
>
sampleTmpList
=
sampleTmpService
.
list
(
queryWrapper
);
//检测项目名称
String
sampleNames
=
""
;
if
(
sampleTmpList
!=
null
&&
sampleTmpList
.
size
()>
0
){
//样品名称 列表中的拼接
for
(
SampleTmp
sampleTmp
:
sampleTmpList
){
sampleNames
=
sampleNames
.
equals
(
""
)?
sampleTmp
.
getName
():(
sampleNames
+
"、"
+
sampleTmp
.
getName
());
}
entrustVo
.
setSampleNames
(
sampleNames
);
//检测项 和检测依据 列表里只显示第一个样品的
SampleTmp
sampleTmp
=
sampleTmpList
.
get
(
0
);
String
teamIds
=
sampleTmp
.
getTeamIds
();
String
checkTeam
=
""
;
if
(
teamIds
!=
null
){
String
[]
teamIdS
=
teamIds
.
split
(
"、"
);
for
(
String
teamId
:
teamIdS
){
Team
team
=
teamMapper
.
selectById
(
Integer
.
valueOf
(
teamId
));
if
(
team
!=
null
){
checkTeam
=
checkTeam
.
equals
(
""
)?
team
.
getName
():(
checkTeam
+
"、"
+
team
.
getName
());
}
}
}
entrustVo
.
setCheckTeam
(
checkTeam
);
entrustVo
.
setCheckMethodNumber
(
sampleTmp
.
getMethodNumbers
());
}
}
}
pages
.
setRecords
(
list
);
return
BaseResponse
.
okData
(
pages
);
}
/**
* 数据校核详情列表
* @param id 委托表id
* @return
*/
@Override
public
BaseResponse
<
Map
<
String
,
Object
>>
getCheckList
(
Integer
id
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Entrust
entrust
=
entrustMapper
.
selectById
(
id
);
if
(
entrust
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误"
);
}
List
<
Sample
>
sampleList
=
sampleMapper
.
getCheckSampleList
(
id
);
List
<
SampleVo
>
sampleVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
){
for
(
Sample
sample
:
sampleList
){
SampleVo
sampleVo
=
new
SampleVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleVo
);
List
<
SampleDistributionTeamVo
>
sampleDistributionTeamVoList
=
distributionMapper
.
getDistributionTeamList
(
sample
.
getId
(),
null
);
if
(
sampleDistributionTeamVoList
!=
null
&&
sampleDistributionTeamVoList
.
size
()>
0
)
{
sampleVo
.
setSampleDistributionTeamVoList
(
sampleDistributionTeamVoList
);
}
else
{
sampleVo
.
setSampleDistributionTeamVoList
(
null
);
}
sampleVoList
.
add
(
sampleVo
);
}
}
map
.
put
(
"entrust"
,
entrust
);
map
.
put
(
"sampleVoList"
,
sampleVoList
);
return
BaseResponse
.
okData
(
map
);
}
/**
* 样品检测项校核详情
* @param cementCode 本所编号
* @return
*/
public
BaseResponse
<
List
<
SampleCheckVo
>>
getCheckDetail
(
String
cementCode
){
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
){
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
StringUtils
.
isEmpty
(
cementCode
)){
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
QueryWrapper
<
Sample
>
sampleQW
=
new
QueryWrapper
<>();
sampleQW
.
eq
(
"cement_code"
,
cementCode
);
List
<
Sample
>
sampleList
=
sampleMapper
.
selectList
(
sampleQW
);
List
<
SampleCheckVo
>
sampleCheckVoList
=
new
ArrayList
<>();
if
(
sampleList
!=
null
&&
sampleList
.
size
()>
0
){
for
(
Sample
sample
:
sampleList
){
SampleCheckVo
sampleCheckVo
=
new
SampleCheckVo
();
BeanUtils
.
copyProperties
(
sample
,
sampleCheckVo
);
//根据样品id 获取检测组
List
<
SampleCheckGroupVo
>
sampleCheckGroupVoList
=
distributionMapper
.
getSampleCheckGroupList
(
sample
.
getId
());
if
(
sampleCheckGroupVoList
!=
null
&&
sampleCheckGroupVoList
.
size
()>
0
){
for
(
SampleCheckGroupVo
sampleCheckGroupVo
:
sampleCheckGroupVoList
){
TeamGroup
teamGroup
=
teamGroupMapper
.
selectById
(
sampleCheckGroupVo
.
getTeamGroupId
());
if
(
teamGroup
==
null
){
return
BaseResponse
.
errorMsg
(
"检测组信息错误"
);
}
//转成JSONArray
JSONArray
checkElementList
=
JSONArray
.
parseArray
(
teamGroup
.
getCheckElement
());
sampleCheckGroupVo
.
setCheckElement
(
teamGroup
.
getCheckElement
());
sampleCheckGroupVo
.
setCheckElementList
(
checkElementList
);
//根据检测组id返回检测组对应的所有检测项信息
List
<
String
>
checkResutlList
=
teamMapper
.
getByGroup
(
teamGroup
.
getId
());
sampleCheckGroupVo
.
setCheckResult
(
checkResutlList
);
sampleCheckVo
.
setSampleCheckGroupVoList
(
sampleCheckGroupVoList
);
}
}
sampleCheckVoList
.
add
(
sampleCheckVo
);
}
}
return
BaseResponse
.
okData
(
sampleCheckVoList
);
}
//
/**
* 根据样品id,检测组id,检测人id 查询任务检测附件信息
* @param sampleId
* @param teamGroupId
* @param userId
* @return
*/
public
BaseResponse
<
List
<
SampleDistribution
>>
getEnclosureList
(
Integer
sampleId
,
Integer
teamGroupId
,
Integer
userId
){
QueryWrapper
<
SampleDistribution
>
sdQueryWrapper
=
new
QueryWrapper
<>();
sdQueryWrapper
.
eq
(
"sample_id"
,
sampleId
);
sdQueryWrapper
.
eq
(
"team_group_id"
,
teamGroupId
);
sdQueryWrapper
.
eq
(
"user_id"
,
userId
);
List
<
SampleDistribution
>
sdList
=
distributionMapper
.
selectList
(
sdQueryWrapper
);
return
BaseResponse
.
okData
(
sdList
);
}
//校核计算
public
BaseResponse
<
String
>
checkCount
(
CheckQuery
query
){
return
null
;
}
//校核保存
/**
* 数据校核
...
...
@@ -783,24 +1317,23 @@ public class EntrustServiceImpl extends ServiceImpl<EntrustMapper, Entrust> impl
if
(
checkTeamQuery
==
null
){
return
BaseResponse
.
errorMsg
(
"检测样品信息错误"
);
}
if
(
checkTeamQuery
.
getTe
stItemId
()==
null
||
StringUtils
.
isEmpty
(
checkTeamQuery
.
getTestItem
())){
if
(
checkTeamQuery
.
getTe
amGroupId
()==
null
||
StringUtils
.
isEmpty
(
checkTeamQuery
.
getTeamGroupName
())){
return
BaseResponse
.
errorMsg
(
"检测项目信息错误"
);
}
if
(
StringUtils
.
isEmpty
(
checkTeamQuery
.
getTe
stTeams
())){
if
(
StringUtils
.
isEmpty
(
checkTeamQuery
.
getTe
amGroupName
())){
return
BaseResponse
.
errorMsg
(
"请录入校核结果"
);
}
SampleCheckTeam
sampleCheckTeam
=
new
SampleCheckTeam
();
sampleCheckTeam
.
setCheckId
(
check
.
getId
())
.
setTestItemId
(
checkTeamQuery
.
getTestItemId
())
.
setTestItem
(
checkTeamQuery
.
getTestItem
())
.
setTestTeams
(
checkTeamQuery
.
getTestTeams
())
.
setTeamGroupId
(
checkTeamQuery
.
getTeamGroupId
())
.
setTeamGroupName
(
checkTeamQuery
.
getTeamGroupName
())
.
setCreateTime
(
LocalDateTime
.
now
())
.
setRemark
(
checkTeamQuery
.
getRemark
());
sampleCheckTeamList
.
add
(
sampleCheckTeam
);
testItems
=
testItems
.
equals
(
""
)?
sampleCheckTeam
.
getTestItem
():
testItems
+
"、"
+
sampleCheckTeam
.
getTestItem
();
//
testItems = testItems.equals("")?sampleCheckTeam.getTestItem():testItems+"、"+sampleCheckTeam.getTestItem();
}
sampleCheckTeamService
.
saveBatch
(
sampleCheckTeamList
);
}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/SampleHandleEnclosureServiceImpl.java
0 → 100644
View file @
ba9b09a9
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.SampleHandleEnclosure
;
import
cn.wise.sc.cement.business.mapper.SampleHandleEnclosureMapper
;
import
cn.wise.sc.cement.business.service.ISampleHandleEnclosureService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
/**
* <p>
* 服务实现类
* </p>
*
* @author ztw
* @since 2020-09-14
*/
@Service
public
class
SampleHandleEnclosureServiceImpl
extends
ServiceImpl
<
SampleHandleEnclosureMapper
,
SampleHandleEnclosure
>
implements
ISampleHandleEnclosureService
{
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/TeamServiceImpl.java
View file @
ba9b09a9
...
...
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
io.swagger.models.auth.In
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -197,4 +198,27 @@ public class TeamServiceImpl extends ServiceImpl<TeamMapper, Team> implements IT
}
}
/**
* 根据检测组id获取检测项信息
* @param id
* @return
*/
@Override
public
BaseResponse
<
List
<
String
>>
getByGroup
(
Integer
id
){
List
<
String
>
map
=
teamMapper
.
getByGroup
(
id
);
return
BaseResponse
.
okData
(
map
);
}
}
cement-business/src/main/resources/application.yml
View file @
ba9b09a9
...
...
@@ -7,7 +7,7 @@ spring:
profiles
:
active
:
dev
datasource
:
#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
username
:
root
password
:
admin!@#123
...
...
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