Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
patzn-cloud-service-hmhj
Overview
Overview
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
wangweidong
patzn-cloud-service-hmhj
Commits
ad723cb8
Commit
ad723cb8
authored
Jul 19, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.patzn.com:wangweidong/patzn-cloud-service-hmhj
parents
17c34644
f8ab0465
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
393 additions
and
138 deletions
+393
-138
EntrustFlowUtils.java
...atzn/cloud/service/lims/hmhj/common/EntrustFlowUtils.java
+1
-0
ContractSampleController.java
...ervice/lims/hmhj/controller/ContractSampleController.java
+1
-1
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+4
-4
EntrustReportController.java
...service/lims/hmhj/controller/EntrustReportController.java
+35
-46
EntrustSampleController.java
...service/lims/hmhj/controller/EntrustSampleController.java
+29
-7
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+9
-2
EntrustReportMapper.java
...n/cloud/service/lims/hmhj/mapper/EntrustReportMapper.java
+8
-0
EntrustSampleItemMapper.java
...oud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
+9
-7
IContractSampleService.java
...oud/service/lims/hmhj/service/IContractSampleService.java
+4
-0
IEntrustReportService.java
...loud/service/lims/hmhj/service/IEntrustReportService.java
+4
-0
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+3
-0
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+8
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+1
-0
ContractSampleServiceImpl.java
...ice/lims/hmhj/service/impl/ContractSampleServiceImpl.java
+32
-5
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+28
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+112
-66
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+63
-0
EntrustReportMapper.xml
src/main/resources/mapper/hmhj/EntrustReportMapper.xml
+14
-0
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+14
-0
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+7
-0
20210718新增台账字段.sql
src/test/java/resources/db_sql/hmhj/v147/20210718新增台账字段.sql
+7
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/common/EntrustFlowUtils.java
View file @
ad723cb8
...
...
@@ -102,6 +102,7 @@ public class EntrustFlowUtils {
statusEnum
=
EntrustStatusEnum
.
OUT_INPUT
;
break
;
case
14
:
case
15
:
statusEnum
=
EntrustStatusEnum
.
QUALITY_CHECK
;
break
;
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/ContractSampleController.java
View file @
ad723cb8
...
...
@@ -137,7 +137,7 @@ public class ContractSampleController extends ServiceController {
@PostMapping
(
"/page_out_reg"
)
public
RestResult
<
Page
<
ContractSample
>>
getPageOutReg
(
ContractSample
contractSample
)
{
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
OUT_DRIFT
);
return
success
(
contractSampleService
.
page
(
getPage
(),
contractSample
));
return
success
(
contractSampleService
.
page
OutReg
(
getPage
(),
contractSample
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
ad723cb8
...
...
@@ -486,7 +486,7 @@ public class EntrustController extends ServiceController {
public
RestResult
<
Page
<
EntrustVO
>>
getPageTaskTestData
(
EntrustVO
entrust
)
{
entrust
.
setItemStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
// 过滤当前人为检测人的委托数据 - 节点数据不为空,且为检测时,只查询当前人信息
if
(
StringUtils
.
isNotBlank
(
entrust
.
getSource
())
&&
EntrustFlowEnum
.
TEST
.
getName
().
equalsIgnoreCase
(
entrust
.
getSource
()))
{
if
(
StringUtils
.
isNotBlank
(
entrust
.
getSource
())
&&
EntrustFlowEnum
.
TEST
.
getName
().
equalsIgnoreCase
(
entrust
.
getSource
()))
{
entrust
.
setTesterId
(
getAccount
().
getUserId
());
}
// 获取当前用户分组
...
...
@@ -851,14 +851,14 @@ public class EntrustController extends ServiceController {
@ApiOperation
(
"导出检测委托书"
)
@GetMapping
(
"/export"
)
public
RestResult
<
Boolean
>
exportEntrust
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
entrustService
.
exportEntrust
(
ids
,
response
));
return
success
(
entrustService
.
exportEntrust
(
ids
,
response
));
}
/* 打印检测委托书完成后的ajax调用,先使用未登录方式 */
@ApiOperation
(
"修改检测委托书打印状态"
)
@Login
(
action
=
Action
.
Skip
)
@PostMapping
(
"/update_print_status"
)
public
RestResult
<
Boolean
>
updatePrintStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
(
"userId"
)
Long
userId
)
{
return
success
(
entrustService
.
updatePrintStatus
(
ids
,
userId
));
public
RestResult
<
Boolean
>
updatePrintStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
(
"userId"
)
Long
userId
)
{
return
success
(
entrustService
.
updatePrintStatus
(
ids
,
userId
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustReportController.java
View file @
ad723cb8
...
...
@@ -61,13 +61,26 @@ public class EntrustReportController extends ServiceController {
@PostMapping
(
"/page_report_make_his"
)
public
RestResult
<
Page
<
EntrustReport
>>
getPageReportMakeHis
(
EntrustReport
entrustReport
)
{
List
<
EntrustReportStatusEnum
>
reportStatusList
=
new
ArrayList
<>();
reportStatusList
.
add
(
EntrustReportStatusEnum
.
MAKING
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
CHECK
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
ISSUE
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
ALLOW
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
SEND
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
REPORT_PRINT
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
END
);
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
}
@ApiOperation
(
"报告台账历史版本分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page_report_his"
)
public
RestResult
<
Page
<
EntrustReport
>>
getPageReportHis
(
EntrustReport
entrustReport
)
{
entrustReport
.
setDeleted
(
1
);
return
success
(
entrustReportService
.
pageHis
(
getPage
(),
entrustReport
));
}
...
...
@@ -96,14 +109,10 @@ public class EntrustReportController extends ServiceController {
reportStatusList
.
add
(
EntrustReportStatusEnum
.
SEND
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
REPORT_PRINT
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
END
);
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
}
@ApiOperation
(
"报告批准分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -128,14 +137,10 @@ public class EntrustReportController extends ServiceController {
reportStatusList
.
add
(
EntrustReportStatusEnum
.
SEND
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
REPORT_PRINT
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
END
);
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
}
@ApiOperation
(
"报告发放分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -158,7 +163,7 @@ public class EntrustReportController extends ServiceController {
List
<
EntrustReportStatusEnum
>
reportStatusList
=
new
ArrayList
<>();
reportStatusList
.
add
(
EntrustReportStatusEnum
.
REPORT_PRINT
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
END
);
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
}
...
...
@@ -169,15 +174,10 @@ public class EntrustReportController extends ServiceController {
})
@PostMapping
(
"/page_report_branch"
)
public
RestResult
<
Page
<
EntrustReport
>>
getPageReportBranch
(
EntrustReportVO
entrustReportVO
)
{
return
success
(
entrustReportService
.
pageBranchReport
(
getPage
(),
entrustReportVO
,
getAccount
()));
return
success
(
entrustReportService
.
pageBranchReport
(
getPage
(),
entrustReportVO
,
getAccount
()));
}
@ApiOperation
(
"报告台账待签发分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -200,11 +200,10 @@ public class EntrustReportController extends ServiceController {
List
<
EntrustReportStatusEnum
>
reportStatusList
=
new
ArrayList
<>();
reportStatusList
.
add
(
EntrustReportStatusEnum
.
REPORT_PRINT
);
reportStatusList
.
add
(
EntrustReportStatusEnum
.
END
);
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
return
success
(
entrustReportService
.
pageStatus
(
getPage
(),
reportStatusList
,
entrustReport
));
}
@ApiOperation
(
"报告电子档案分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -217,8 +216,6 @@ public class EntrustReportController extends ServiceController {
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
...
...
@@ -254,87 +251,79 @@ public class EntrustReportController extends ServiceController {
}
@ApiOperation
(
"报告编制提交"
)
@PostMapping
(
"/submit_report_make"
)
public
RestResult
<
Boolean
>
submitReportMake
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustReportService
.
submitReportMake
(
ids
,
getAccount
()));
return
success
(
entrustReportService
.
submitReportMake
(
ids
,
getAccount
()));
}
@ApiOperation
(
"报告审核提交至报告批准"
)
@PostMapping
(
"/submit_report_check"
)
public
RestResult
<
Boolean
>
submitReportCheck
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustReportService
.
submitReportCheck
(
ids
,
getAccount
()));
return
success
(
entrustReportService
.
submitReportCheck
(
ids
,
getAccount
()));
}
@ApiOperation
(
"报告批准提交至报告发放"
)
@PostMapping
(
"/submit_from_allow_to_send"
)
public
RestResult
<
Boolean
>
submitFromAllowToSend
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustReportService
.
submitFromAllowToSend
(
ids
,
getAccount
()));
return
success
(
entrustReportService
.
submitFromAllowToSend
(
ids
,
getAccount
()));
}
@ApiOperation
(
"报告批准提交至报告签发"
)
@PostMapping
(
"/submit_from_allow_to_issue"
)
public
RestResult
<
Boolean
>
submitFromAllowToIssue
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustReportService
.
submitFromAllowToIssue
(
ids
,
getAccount
()));
return
success
(
entrustReportService
.
submitFromAllowToIssue
(
ids
,
getAccount
()));
}
@ApiOperation
(
"报告发放提交至质量判定"
)
@PostMapping
(
"/submit_from_send_to_judge"
)
public
RestResult
<
Boolean
>
submitFromSendToJudge
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustReportService
.
submitFromSendToJudge
(
ids
,
getAccount
()));
return
success
(
entrustReportService
.
submitFromSendToJudge
(
ids
,
getAccount
()));
}
@ApiOperation
(
"报告签发提交"
)
@PostMapping
(
"/submit_report_issue"
)
public
RestResult
<
Boolean
>
submitReportIssue
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustReportService
.
submitReportIssue
(
ids
,
getAccount
()));
return
success
(
entrustReportService
.
submitReportIssue
(
ids
,
getAccount
()));
}
@ApiOperation
(
"报告审核退回"
)
@PostMapping
(
"/back_report_check"
)
public
RestResult
<
Boolean
>
backReportCheck
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backReportCheck
(
ids
,
reason
,
getAccount
()));
public
RestResult
<
Boolean
>
backReportCheck
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backReportCheck
(
ids
,
reason
,
getAccount
()));
}
@ApiOperation
(
"报告签发退回"
)
@PostMapping
(
"/back_report_issue"
)
public
RestResult
<
Boolean
>
backReportIssue
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backReportIssue
(
ids
,
reason
,
getAccount
()));
public
RestResult
<
Boolean
>
backReportIssue
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backReportIssue
(
ids
,
reason
,
getAccount
()));
}
@ApiOperation
(
"报告发放退回至报告批准"
)
@PostMapping
(
"/back_from_report_send_to_allow"
)
public
RestResult
<
Boolean
>
backFromReportSendToAllow
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backFromReportSendToAllow
(
ids
,
reason
,
getAccount
()));
public
RestResult
<
Boolean
>
backFromReportSendToAllow
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backFromReportSendToAllow
(
ids
,
reason
,
getAccount
()));
}
@ApiOperation
(
"报告批准退回至报告审核"
)
@PostMapping
(
"/back_from_report_allow_to_check"
)
public
RestResult
<
Boolean
>
backFromReportAllowToCheck
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backFromReportAllowToCheck
(
ids
,
reason
,
getAccount
()));
public
RestResult
<
Boolean
>
backFromReportAllowToCheck
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backFromReportAllowToCheck
(
ids
,
reason
,
getAccount
()));
}
@ApiOperation
(
"报告签发退回至报告批准"
)
@PostMapping
(
"/back_from_report_issue_to_allow"
)
public
RestResult
<
Boolean
>
backFromReportIssueToAllow
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backFromReportIssueToAllow
(
ids
,
reason
,
getAccount
()));
public
RestResult
<
Boolean
>
backFromReportIssueToAllow
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustReportService
.
backFromReportIssueToAllow
(
ids
,
reason
,
getAccount
()));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleController.java
View file @
ad723cb8
...
...
@@ -5,14 +5,12 @@ import com.baomidou.mybatisplus.mapper.Wrapper;
import
com.google.common.collect.Lists
;
import
com.patzn.cloud.service.hmhj.dto.*
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSample
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleItemStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSamplePrepareStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.*
;
import
com.patzn.cloud.service.hmhj.vo.AlTasteStatsVO
;
import
com.patzn.cloud.service.hmhj.vo.ElectrolyteRatioStatsVO
;
import
com.patzn.cloud.service.hmhj.vo.EntrustSampleVO
;
import
com.patzn.cloud.service.hmhj.vo.PMakeFeStatsVO
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -27,6 +25,7 @@ import io.swagger.annotations.ApiImplicitParam;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -98,6 +97,25 @@ public class EntrustSampleController extends ServiceController {
return
success
(
entrustSampleService
.
pageVOForMake
(
getPage
(),
entrustSample
));
}
@ApiOperation
(
"报告编制样品历史分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_report_make_his"
)
public
RestResult
<
Page
<
EntrustSampleVO
>>
getPageReportMakeHis
(
EntrustSampleVO
entrustSample
)
{
entrustSample
.
setStatusList
(
Lists
.
newArrayList
(
EntrustSampleStatusEnum
.
REPORT_CHECK
,
EntrustSampleStatusEnum
.
REPORT_ALLOW
,
EntrustSampleStatusEnum
.
REPORT_ISSUE
,
EntrustSampleStatusEnum
.
REPORT_SEND
,
EntrustSampleStatusEnum
.
END
));
return
success
(
entrustSampleService
.
pageVOForMakeHis
(
getPage
(),
entrustSample
));
}
@ApiOperation
(
"报告审核样品分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
@@ -288,16 +306,20 @@ public class EntrustSampleController extends ServiceController {
return
success
(
entrustSampleService
.
makeReport
(
dto
,
getAccount
()));
}
@ApiOperation
(
"样品生成报告"
)
@PostMapping
(
"/make_report_from_his"
)
public
RestResult
<
Boolean
>
makeReportFromHis
(
@RequestBody
ReportDTO
dto
)
{
return
success
(
entrustSampleService
.
makeReportFromHis
(
dto
,
getAccount
()));
}
@ApiOperation
(
"选择检测项目生成样品报告"
)
@PostMapping
(
"/make_single_report"
)
public
RestResult
<
Boolean
>
makeReport
(
@RequestParam
(
"sampleId"
)
Long
sampleId
,
@RequestParam
(
"itemIds"
)
Long
[]
itemIds
,
@RequestParam
(
"templateId"
)
Long
templateId
)
{
return
success
(
entrustSampleService
.
makeSingleReport
(
sampleId
,
itemIds
,
templateId
,
getAccount
()));
public
RestResult
<
Boolean
>
makeReport
(
@RequestParam
(
"sampleId"
)
Long
sampleId
,
@RequestParam
(
"itemIds"
)
Long
[]
itemIds
,
@RequestParam
(
"templateId"
)
Long
templateId
)
{
return
success
(
entrustSampleService
.
makeSingleReport
(
sampleId
,
itemIds
,
templateId
,
getAccount
()));
}
@ApiOperation
(
"质量判定样品分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
ad723cb8
...
...
@@ -23,6 +23,7 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.xml.transform.Result
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -71,6 +72,12 @@ public class EntrustSampleItemController extends ServiceController {
return
success
(
entrustSampleItemService
.
updateById
(
entrustSampleItem
));
}
@ApiOperation
(
"批量更新检测项目检测值"
)
@PostMapping
(
"/item_batch_update"
)
public
RestResult
<
Boolean
>
updateItemList
(
@RequestBody
String
itemJson
)
{
return
success
(
entrustSampleItemService
.
updateItemBatch
(
itemJson
));
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustSampleItem
entrustSampleItem
)
{
...
...
@@ -574,8 +581,8 @@ public class EntrustSampleItemController extends ServiceController {
@ApiOperation
(
value
=
"填写原始记录"
,
notes
=
"填写原始记录"
)
@PostMapping
(
"/save_excel_original_record"
)
public
RestResult
<
OriginalRecord
>
saveExcelOriginalRecord
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"templateId"
)
Long
templateId
,
@RequestParam
(
"entrustCode"
)
String
entrustCode
)
{
return
success
(
entrustSampleItemService
.
saveExcelOriginalRecord
(
ids
,
templateId
,
getAccount
(),
entrustCode
));
public
RestResult
<
OriginalRecord
>
saveExcelOriginalRecord
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"templateId"
)
Long
templateId
,
@RequestParam
(
"entrustCode"
)
String
entrustCode
)
{
return
success
(
entrustSampleItemService
.
saveExcelOriginalRecord
(
ids
,
templateId
,
getAccount
(),
entrustCode
));
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustReportMapper.java
View file @
ad723cb8
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
mapper
;
import
com.baomidou.mybatisplus.annotations.SqlParser
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.mapper.BatchMapper
;
import
com.patzn.cloud.service.hmhj.entity.EntrustReport
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* <p>
...
...
@@ -13,4 +18,7 @@ import com.patzn.cloud.service.hmhj.entity.EntrustReport;
*/
public
interface
EntrustReportMapper
extends
BatchMapper
<
EntrustReport
>
{
@SqlParser
(
filter
=
true
)
List
<
EntrustReport
>
selectPageList
(
Page
<
EntrustReport
>
page
,
@Param
(
"vo"
)
EntrustReport
report
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
View file @
ad723cb8
...
...
@@ -34,21 +34,21 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
List
<
EntrustSampleItemVO
>
selectVOList
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleItemVO
entrustSampleItem
);
List
<
EntrustSampleItemVO
>
selectVOListBySampleIds
(
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectVOListBySampleIds
(
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectVOListBySampleIdsAndIds
(
@Param
(
"sampleIds"
)
Long
[]
sampleIds
,
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectVOListBySampleIdsAndIds
(
@Param
(
"sampleIds"
)
Long
[]
sampleIds
,
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectVOListByIds
(
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectVOListByIds
(
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectByEntrustSampleId
(
@Param
(
"sampleId"
)
Long
sampleId
);
List
<
EntrustSampleItemVO
>
selectByEntrustSampleId
(
@Param
(
"sampleId"
)
Long
sampleId
);
List
<
EntrustSampleItemVO
>
selectByItemDeviate
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleItemVO
entrustSampleItem
);
List
<
EntrustSampleItemVO
>
selectByItemDeviate
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleItemVO
entrustSampleItem
);
List
<
EntrustSampleItemVO
>
selectListVOByIds
(
@Param
(
"ids"
)
List
<
Long
>
expIdsList
);
List
<
EntrustSampleItemVO
>
selectListVOByIds
(
@Param
(
"ids"
)
List
<
Long
>
expIdsList
);
List
<
EntrustSampleItemVO
>
selectByOriginalRecordId
(
@Param
(
"originalRecordId"
)
Long
originalRecordId
);
List
<
EntrustSampleItemVO
>
selectMinStatusBySampleIds
(
@Param
(
"sampleIds"
)
List
<
Long
>
sampleIds
);
List
<
EntrustSampleItemVO
>
selectMinStatusBySampleIds
(
@Param
(
"sampleIds"
)
List
<
Long
>
sampleIds
);
List
<
EntrustSampleItemVO
>
selectByEntrustId
(
@Param
(
"entrustId"
)
Long
entrustId
);
...
...
@@ -64,4 +64,6 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
boolean
updateItemJudgeByEntrustId
(
@Param
(
"entrustId"
)
Long
entrustId
);
List
<
SampleItemStatsVO
>
selectSampleItemStats
(
@Param
(
"vo"
)
SampleItemDTO
sampleItemDTO
);
List
<
EntrustSampleItemVO
>
listIndexReplaceItemBySampleId
(
@Param
(
"sampleId"
)
Long
sampleId
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IContractSampleService.java
View file @
ad723cb8
...
...
@@ -67,4 +67,8 @@ public interface IContractSampleService extends IBaseService<ContractSample> {
boolean
passToSecondJudgeCheck
(
ContractSampleVODTO
dto
,
Account
account
);
boolean
addJudgementType
(
Long
[]
ids
,
String
judgement
,
Account
account
);
Page
<
ContractSample
>
pageOutReg
(
Page
<
ContractSample
>
page
,
ContractSample
contractSample
);
boolean
isOutEntrustData
(
Long
contractSampleId
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustReportService.java
View file @
ad723cb8
...
...
@@ -21,6 +21,8 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
Page
<
EntrustReport
>
page
(
Page
<
EntrustReport
>
page
,
EntrustReport
entrustReport
);
Page
<
EntrustReport
>
pageHis
(
Page
<
EntrustReport
>
page
,
EntrustReport
entrustReport
);
boolean
removeByIds
(
List
<
Long
>
ids
);
void
uploadReportGenerateDocx
(
Entrust
entrust
,
Long
[]
ids
,
Account
account
,
String
name
,
String
remark
,
File
file
);
...
...
@@ -50,4 +52,6 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
Page
<
EntrustReport
>
pageStatus
(
Page
<
EntrustReport
>
page
,
List
<
EntrustReportStatusEnum
>
reportStatusList
,
EntrustReport
entrustReport
);
Page
<
EntrustReport
>
pageBranchReport
(
Page
<
EntrustReport
>
page
,
EntrustReportVO
entrustReportVO
,
Account
account
);
boolean
updateLastFlowCheckByEntrustId
(
Long
entrustId
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
ad723cb8
...
...
@@ -5,6 +5,7 @@ import com.patzn.cloud.commons.controller.Account;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.SampleItemDTO
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleItem
;
import
com.patzn.cloud.service.hmhj.entity.ItemDeviate
;
import
com.patzn.cloud.service.hmhj.entity.OriginalRecord
;
...
...
@@ -29,6 +30,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean
removeByIds
(
List
<
Long
>
ids
);
boolean
updateItemBatch
(
String
itemJson
);
Page
<
EntrustSampleItemVO
>
pageAllotBySampleRight
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
entrustSampleItem
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
ad723cb8
...
...
@@ -97,4 +97,12 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
boolean
updateSampleCodeByIds
(
List
<
Long
>
sampleIdsList
,
int
level
);
List
<
EntrustSampleVO
>
selectVOLists
(
EntrustSampleVO
entrustSampleVO
);
boolean
isRequireJudgeGrading
(
Long
entrustId
);
boolean
updateJudgeStatus
(
Long
entrustId
,
Integer
judgeStatus
);
Page
<
EntrustSampleVO
>
pageVOForMakeHis
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
);
boolean
makeReportFromHis
(
ReportDTO
dto
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
ad723cb8
...
...
@@ -98,4 +98,5 @@ public interface IEntrustService extends IBaseService<Entrust> {
Boolean
updatePrintStatus
(
List
<
Long
>
ids
,
Long
userId
);
Boolean
saveOutEntrust
(
EntrustDTO
dto
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSampleServiceImpl.java
View file @
ad723cb8
...
...
@@ -360,22 +360,22 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
voList
),
"请选择通过的数据!"
);
for
(
ContractSampleVO
sampleVO
:
voList
)
{
RestAssert
.
fail
(
null
==
sampleVO
.
getId
(),
"
数据有误
!"
);
RestAssert
.
fail
(
null
==
sampleVO
.
getEntrust
Id
(),
"数据有误
!"
);
RestAssert
.
fail
(
null
==
sampleVO
.
getId
(),
"
合同数据为空
!"
);
RestAssert
.
fail
(
null
==
sampleVO
.
getEntrust
SampleId
(),
"样品数据为空
!"
);
}
List
<
Long
>
idsList
=
new
ArrayList
<>();
List
<
Long
>
entrustIdsList
=
new
ArrayList
<>();
List
<
Long
>
entrust
Sample
IdsList
=
new
ArrayList
<>();
for
(
ContractSampleVO
sampleVO
:
voList
)
{
idsList
.
add
(
sampleVO
.
getId
());
entrustIdsList
.
add
(
sampleVO
.
getEntrustSampleId
());
entrust
Sample
IdsList
.
add
(
sampleVO
.
getEntrustSampleId
());
}
EntrustSample
sample
=
new
EntrustSample
();
sample
.
setStatus
(
EntrustSampleStatusEnum
.
END
);
sample
.
setProgress
(
EntrustSampleStatusEnum
.
END
);
sample
.
setJudgeStatus
(
0
);
entrustSampleService
.
update
(
sample
,
Condition
.
create
().
in
(
"id"
,
entrustIdsList
));
entrustSampleService
.
update
(
sample
,
Condition
.
create
().
in
(
"id"
,
entrust
Sample
IdsList
));
return
true
;
}
...
...
@@ -398,5 +398,32 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
return
false
;
}
@Override
public
Page
<
ContractSample
>
pageOutReg
(
Page
<
ContractSample
>
page
,
ContractSample
contractSample
)
{
String
code
=
contractSample
.
getCode
();
String
materialName
=
contractSample
.
getMaterialName
();
contractSample
.
setCode
(
null
).
setMaterialName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
contractSample
);
if
(
StringUtils
.
isNotBlank
(
code
))
{
wrapper
.
like
(
"code"
,
code
);
}
if
(
StringUtils
.
isNotBlank
(
materialName
))
{
wrapper
.
like
(
"material_name"
,
materialName
);
}
wrapper
.
orderBy
(
"ctime"
,
false
);
wrapper
.
notExists
(
"select 1 from entrust_sample s where s.deleted = 0 and s.contract_sample_id = contract_sample.id"
);
return
this
.
page
(
page
,
wrapper
);
}
@Override
public
boolean
isOutEntrustData
(
Long
contractSampleId
)
{
if
(
null
==
contractSampleId
)
{
return
false
;
}
ContractSample
contractSample
=
getById
(
contractSampleId
);
return
null
!=
contractSample
&&
null
!=
contractSample
.
getType
()
&&
1
==
contractSample
.
getType
().
intValue
()
?
true
:
false
;
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
ad723cb8
...
...
@@ -64,6 +64,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
@Autowired
private
SysUserClient
sysUserClient
;
@Autowired
private
IEntrustReportRecordService
entrustReportRecordService
;
@Value
(
"${libreOffice.url}"
)
private
String
libreOfficeUrl
;
...
...
@@ -75,6 +78,11 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
@Override
public
Page
<
EntrustReport
>
pageHis
(
Page
<
EntrustReport
>
page
,
EntrustReport
entrustReport
)
{
return
page
.
setRecords
(
baseMapper
.
selectPageList
(
page
,
entrustReport
));
}
@Override
public
Page
<
EntrustReport
>
pageStatus
(
Page
<
EntrustReport
>
page
,
List
<
EntrustReportStatusEnum
>
reportStatusList
,
EntrustReport
entrustReport
)
{
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustReport
);
if
(
CollectionUtils
.
isNotEmpty
(
reportStatusList
))
{
...
...
@@ -97,6 +105,22 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
@Override
public
boolean
updateLastFlowCheckByEntrustId
(
Long
entrustId
,
Account
account
)
{
if
(
null
==
entrustId
)
{
return
false
;
}
// 根据委托编号获取生成的委托报告
List
<
EntrustReport
>
list
=
list
(
Condition
.
create
().
eq
(
"entrust_id"
,
entrustId
).
orderBy
(
"id"
,
false
));
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
false
;
}
EntrustReport
report
=
list
.
get
(
0
);
report
.
setStatus
(
EntrustReportStatusEnum
.
CHECK
).
setProgress
(
EntrustReportStatusEnum
.
CHECK
);
entrustRecordService
.
record
(
Collections
.
singletonList
(
report
.
getEntrustId
()),
"历史提交"
,
EntrustReportStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"从历史中重新生成报告提交至报告审核"
);
return
updateById
(
report
);
}
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
entrustReportRelSampleService
.
remove
(
Condition
.
create
().
in
(
"report_id"
,
ids
));
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
...
...
@@ -226,6 +250,10 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
// 若提交至 -> 质量判定,那么需要更改委托状态
if
(
toFlowStatus
==
EntrustFlowEnum
.
QUALITY_JUDGE
)
{
entrust
.
setStatus
(
EntrustStatusEnum
.
QUALITY_CHECK
);
// 若不需要质量判定,直接进入电子档案流程
if
(!
entrustSampleService
.
isRequireJudgeGrading
(
entrust
.
getId
()))
{
entrustSampleService
.
updateJudgeStatus
(
entrust
.
getId
(),
2
);
}
entrustService
.
updateById
(
entrust
);
// 更改样品编码显示形式,由三级变为一级
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrust
.
getId
(),
1
);
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
ad723cb8
...
...
@@ -15,9 +15,9 @@ import com.patzn.cloud.commons.toolkit.DateUtils;
import
com.patzn.cloud.commons.toolkit.FileUtils
;
import
com.patzn.cloud.commons.toolkit.JsonUtils
;
import
com.patzn.cloud.commons.toolkit.MapMergeUtils
;
import
com.patzn.cloud.feign.lims.base.client.LmsUserRelGroupClient
;
import
com.patzn.cloud.oss.starter.OssClient
;
import
com.patzn.cloud.oss.starter.OssFileResult
;
import
com.patzn.cloud.service.BaseEntity
;
import
com.patzn.cloud.service.hmhj.bean.KV
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.SampleItemDTO
;
...
...
@@ -72,8 +72,10 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
private
IEntrustRecordService
entrustRecordService
;
@Autowired
private
IEntrustSampleItem
IndexService
entrustSampleItemIndex
Service
;
private
IEntrustSampleItem
Service
entrustSampleItem
Service
;
@Autowired
private
IEntrustSampleItemIndexService
entrustSampleItemIndexService
;
@Autowired
private
IEntrustSampleItemRecordService
entrustSampleItemRecordService
;
...
...
@@ -93,6 +95,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Autowired
private
IItemDeviateService
itemDeviateService
;
@Autowired
private
IContractSampleService
contractSampleService
;
@Autowired
private
IItemRelOriginalRecordService
itemRelOriginalRecordService
;
...
...
@@ -113,10 +117,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
private
Executor
executor1
;
@Autowired
private
LmsUserRelGroupClient
lmsUserRelGroupClient
;
@Value
(
"${libreOffice.url}"
)
private
String
libreOfficeUrl
;
@Autowired
...
...
@@ -124,14 +124,18 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Autowired
private
IQualificationService
qualificationService
;
@Autowired
private
IContractSampleItemService
contractSampleItemService
;
@Override
public
Page
<
EntrustSampleItem
>
page
(
Page
<
EntrustSampleItem
>
page
,
EntrustSampleItem
entrustSampleItem
)
{
String
name
=
entrustSampleItem
.
getName
();
entrustSampleItem
.
setName
(
null
);
Wrapper
wrapper
=
new
EntityWrapper
<>(
entrustSampleItem
);
Wrapper
<
EntrustSampleItem
>
wrapper
=
new
EntityWrapper
<>(
entrustSampleItem
);
if
(
StringUtils
.
isNotBlank
(
name
))
{
wrapper
.
like
(
"name"
,
name
);
}
wrapper
.
orderBy
(
"id"
,
true
);
return
this
.
page
(
page
,
wrapper
);
}
...
...
@@ -142,6 +146,40 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
public
boolean
updateItemBatch
(
String
itemJson
)
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
itemJson
),
"检测项目数据为空"
);
try
{
List
<
EntrustSampleItem
>
entrustSampleItemList
=
JSONArray
.
parseArray
(
itemJson
,
EntrustSampleItem
.
class
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrustSampleItemList
),
"检测项目数据为空"
);
RestAssert
.
fail
(
entrustSampleItemList
.
stream
().
anyMatch
(
t
->
null
==
t
.
getId
()),
"要修改检测值的编号为空"
);
updateBatchById
(
entrustSampleItemList
);
EntrustSampleItem
sampleItem
=
entrustSampleItemList
.
get
(
0
);
entrustSampleItemList
=
entrustSampleItemService
.
list
(
Condition
.
create
().
eq
(
"entrust_sample_id"
,
sampleItem
.
getEntrustSampleId
()));
//
EntrustSample
entrustSample
=
entrustSampleService
.
getById
(
sampleItem
.
getEntrustSampleId
());
if
(
null
!=
entrustSample
&&
null
!=
entrustSample
.
getContractSampleId
())
{
List
<
ContractSampleItem
>
sampleItems
=
contractSampleItemService
.
list
(
Condition
.
create
().
eq
(
"contract_sample_id"
,
entrustSample
.
getContractSampleId
()));
if
(
CollectionUtils
.
isNotEmpty
(
sampleItems
))
{
for
(
ContractSampleItem
item
:
sampleItems
)
{
Optional
<
EntrustSampleItem
>
itemOptional
=
entrustSampleItemList
.
stream
().
filter
(
t
->
t
.
getName
().
equals
(
item
.
getName
())).
findFirst
();
if
(
itemOptional
.
isPresent
())
{
EntrustSampleItem
data
=
itemOptional
.
get
();
item
.
setTestValue
(
data
.
getTestValue
()).
setAgreedValue
(
data
.
getAgreedValue
()).
setDecide
(
data
.
getDecide
());
}
}
contractSampleItemService
.
updateBatchById
(
sampleItems
);
}
}
return
true
;
}
catch
(
Exception
e
)
{
//e.printStackTrace();
logger
.
error
(
e
.
getMessage
(),
e
.
getCause
());
RestAssert
.
fail
(
"检测数据转换失败"
);
}
return
false
;
}
@Override
public
Page
<
EntrustSampleItemVO
>
pageAllotBySampleRight
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
entrustSampleItem
)
{
if
(
ArrayUtils
.
isEmpty
(
entrustSampleItem
.
getSampleIdsArray
()))
{
RestAssert
.
fail
(
"请选择样品ID"
);
...
...
@@ -211,9 +249,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
page
;
}
List
<
Long
>
sampleIds
=
sampleList
.
stream
().
map
(
s
->
{
return
s
.
getId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
sampleList
.
stream
().
map
(
BaseEntity:
:
getId
).
collect
(
Collectors
.
toList
());
itemVO
.
setSampleIds
(
sampleIds
);
return
page
.
setRecords
(
baseMapper
.
selectByItemLeftList
(
page
,
itemVO
));
...
...
@@ -233,9 +269,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
page
;
}
List
<
Long
>
sampleIds
=
sampleList
.
stream
().
map
(
s
->
{
return
s
.
getId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
sampleList
.
stream
().
map
(
BaseEntity:
:
getId
).
collect
(
Collectors
.
toList
());
itemVO
.
setSampleIds
(
sampleIds
);
...
...
@@ -266,7 +300,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// RestAssert.fail(itemList.stream().filter(t -> (null == t.getEndIndex() || 0 == t.getEndIndex().intValue())).count() > 0, "存在没有完成检测的检测项目");
// 若存在检测项目没有完成的,不可提交
for
(
EntrustSampleItemVO
item
:
itemList
)
{
RestAssert
.
fail
(
null
==
item
.
getEndIndex
()
||
0
==
item
.
getEndIndex
()
.
intValue
()
,
"检测项目名称:"
+
item
.
getName
()
+
"未填写检测值,请确认!"
);
RestAssert
.
fail
(
null
==
item
.
getEndIndex
()
||
0
==
item
.
getEndIndex
(),
"检测项目名称:"
+
item
.
getName
()
+
"未填写检测值,请确认!"
);
}
EntrustSampleItem
item
=
new
EntrustSampleItem
();
...
...
@@ -302,12 +336,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
});
// 提交后执行组合判定
executor1
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
updateComposeJudgeByTestValue
(
entrustId
);
}
});
executor1
.
execute
(()
->
updateComposeJudgeByTestValue
(
entrustId
));
return
true
;
}
...
...
@@ -317,9 +346,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
List
<
ItemRelOriginalRecord
>
recordList
=
itemRelOriginalRecordService
.
list
(
Condition
.
create
().
setSqlSelect
(
"record_id"
).
in
(
"item_id"
,
ids
).
isNotNull
(
"record_id"
).
groupBy
(
"record_id"
));
if
(
CollectionUtils
.
isEmpty
(
recordList
))
return
;
List
<
Long
>
recordsList
=
recordList
.
stream
().
map
(
r
->
{
return
r
.
getRecordId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
recordsList
=
recordList
.
stream
().
map
(
ItemRelOriginalRecord:
:
getRecordId
).
collect
(
Collectors
.
toList
());
List
<
OriginalRecord
>
originalRecordList
=
originalRecordService
.
list
(
Condition
.
create
().
in
(
"id"
,
recordsList
).
isNull
(
"pdf_object_key"
));
if
(
CollectionUtils
.
isEmpty
(
originalRecordList
))
...
...
@@ -398,15 +425,11 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
entrustSampleItemRecordService
.
record
(
ids
,
EntrustSampleItemStatusEnum
.
AUDIT
.
getDisplay
(),
EntrustSampleItemStatusEnum
.
END
.
getDisplay
(),
0
,
"数据审核提交"
,
account
);
List
<
Long
>
sampleIds
=
list
.
stream
().
map
(
i
->
{
return
i
.
getEntrustSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleIds
=
list
.
stream
().
map
(
EntrustSampleItem:
:
getEntrustSampleId
).
collect
(
Collectors
.
toList
());
List
<
EntrustSampleItem
>
listCheckOk
=
super
.
list
(
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
).
ne
(
"status"
,
EntrustSampleItemStatusEnum
.
END
));
List
<
Long
>
sampleNotOkList
=
listCheckOk
.
stream
().
map
(
i
->
{
return
i
.
getEntrustSampleId
();
}).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleNotOkList
=
listCheckOk
.
stream
().
map
(
EntrustSampleItem:
:
getEntrustSampleId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
sampleOkIdsList
=
new
ArrayList
<>();
...
...
@@ -508,7 +531,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
mapReplace
.
put
(
"#{sampleNum}"
,
entrustSampleService
.
countByEntrustId
(
entrust
.
getId
())
+
""
);
// itemVoList中的所有项目名 --> 通过检测项目名拿到对应的采集仪器项目名
Set
<
String
>
itemNames
=
voList
.
stream
().
map
(
vo
->
vo
.
getName
()
).
distinct
().
collect
(
Collectors
.
toSet
());
Set
<
String
>
itemNames
=
voList
.
stream
().
map
(
EntrustSampleItem:
:
getName
).
distinct
().
collect
(
Collectors
.
toSet
());
List
<
Qualification
>
qualifications
=
qualificationService
.
list
(
Condition
.
create
().
in
(
"name"
,
itemNames
));
Map
<
String
,
String
>
itemNameMap
=
qualifications
.
stream
()
.
filter
(
q
->
StringUtils
.
isNotEmpty
(
q
.
getInstrumentItemName
()))
...
...
@@ -533,7 +556,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
/* 获取采集数据,并保存到SampleVO中 */
getCollectionData
(
null
,
sampleVOList
,
entrustCode
,
itemNameMap
,
template
);
getCollectionData
(
null
,
sampleVOList
,
entrustCode
,
itemNameMap
,
template
);
if
(
null
==
template
.
getSampleBeginRow
()
||
null
==
template
.
getSampleMergerNum
()
||
null
==
template
.
getTemplateSampleNum
())
{
...
...
@@ -554,7 +577,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
else
{
/* 获取采集到的数据 */
getCollectionData
(
voList
,
null
,
entrustCode
,
itemNameMap
,
template
);
getCollectionData
(
voList
,
null
,
entrustCode
,
itemNameMap
,
template
);
if
(
CollectionUtils
.
isNotEmpty
(
voList
))
{
mapReplace
.
put
(
"#{sampleFrom}"
,
voList
.
get
(
0
).
getSampleFrom
());
...
...
@@ -639,7 +662,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
AtomicBoolean
filledBlank
=
new
AtomicBoolean
(
false
);
/* 设置采集数据的Map -- itemVo */
if
(
itemVOList
!=
null
)
{
itemVOList
.
stream
().
forEach
(
vo
->
{
itemVOList
.
forEach
(
vo
->
{
List
<
String
>
datas
=
mapByNumItemName
.
get
(
vo
.
getSampleCode
()
+
itemNameMap
.
get
(
vo
.
getName
()));
if
(
CollectionUtils
.
isNotEmpty
(
datas
))
{
ArrayList
<
Map
<
String
,
String
>>
collectionDataList
=
new
ArrayList
<>();
...
...
@@ -647,21 +670,23 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
for
(
String
data
:
datas
)
{
Map
<
String
,
String
>
stringStringMap
=
toStringStringMap
(
data
);
/* 找到曲线数据和空白数据 */
List
<
Map
<
String
,
String
>>
curveDatas
=
new
ArrayList
<
Map
<
String
,
String
>>();
List
<
Map
<
String
,
String
>>
curveDatas
=
new
ArrayList
<
Map
<
String
,
String
>>();
if
(
stringStringMap
.
containsKey
(
curve
)
&&
!
filledCur
.
get
())
{
filledCur
.
set
(
true
);
curveDatas
=
(
List
<
Map
<
String
,
String
>>)
(
JSONArray
.
parse
(
stringStringMap
.
get
(
curve
)));
vo
.
setCurveDataList
(
curveDatas
);
}
List
<
String
>
blankKeys
=
new
ArrayList
<>();
blankKeys
.
add
(
"content"
);
blankKeys
.
add
(
"correctedContent"
);
blankKeys
.
add
(
"abs"
);
blankKeys
.
add
(
"content"
);
blankKeys
.
add
(
"correctedContent"
);
blankKeys
.
add
(
"abs"
);
if
(!
filledBlank
.
get
())
{
filledBlank
.
set
(
true
);
HashMap
<
String
,
String
>
blankMap
=
new
HashMap
<>();
for
(
String
blankKey
:
blankKeys
)
{
String
value
=
stringStringMap
.
get
(
"blank"
+
StringUtils
.
capitalize
(
blankKey
));
if
(
StringUtils
.
isNotEmpty
(
value
))
{
blankMap
.
put
(
blankKey
,
value
);
blankMap
.
put
(
blankKey
,
value
);
}
}
vo
.
setBlankDataMap
(
blankMap
);
...
...
@@ -694,7 +719,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
if
(
entry
.
getValue
()
instanceof
String
)
{
stringStringHashMap
.
put
(
entry
.
getKey
(),
(
String
)
entry
.
getValue
());
}
else
{
stringStringHashMap
.
put
(
entry
.
getKey
(),((
JSONArray
)
entry
.
getValue
()).
toJSONString
());
stringStringHashMap
.
put
(
entry
.
getKey
(),
((
JSONArray
)
entry
.
getValue
()).
toJSONString
());
}
}
return
stringStringHashMap
;
...
...
@@ -854,16 +879,25 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
List
<
EntrustSample
>
updateSampleList
=
new
ArrayList
<>();
boolean
isOutEntrustData
=
contractSampleService
.
isOutEntrustData
(
sampleList
.
get
(
0
).
getContractSampleId
());
for
(
EntrustSampleVO
sampleVO
:
sampleList
)
{
EntrustSample
sample
=
sampleVO
.
convert
(
EntrustSample
.
class
);
// 若为此标准,需要判断是否需要过滤掉稀有元素的判断
boolean
isSpecStandard
=
"GB/T 1196 2017"
.
equalsIgnoreCase
(
sampleVO
.
getProductCode
());
// 检测值【内部检测值实际为指标表中数据,外委检测值为检测项目数据】
List
<
EntrustSampleItemVO
>
sampleItemList
=
null
;
// 若为外部检测
if
(
isOutEntrustData
)
{
sampleItemList
=
entrustSampleItemService
.
getListBySampleId
(
sampleVO
.
getId
());
}
else
{
// 获取检测项目及指标数据
List
<
EntrustSampleItemIndexVO
>
sampleItemIndexList
=
entrustSampleItemIndexService
.
listVOBySampleIds
(
Arrays
.
asList
(
sampleVO
.
getId
()));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleItemIndexList
),
"样品检测项目及内容不能为空"
);
sampleItemList
=
baseMapper
.
listIndexReplaceItemBySampleId
(
sampleVO
.
getId
());
}
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleItemList
),
"样品检测项目及内容不能为空"
);
// 计算合计值
BigDecimal
totalValue
=
sampleItemIndex
List
.
stream
().
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getTestValue
())).
map
(
t
->
{
double
totalValue
=
sampleItem
List
.
stream
().
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getTestValue
())).
map
(
t
->
{
// 符合此条件,需要判断是否此标准且为稀有元素且值小于0.01即可忽略为0
String
testValue
=
t
.
getTestValue
().
trim
();
RestAssert
.
fail
(!
isNumber
(
testValue
),
String
.
format
(
"样品编号【%s】存在错误检测值【%s】"
,
sample
.
getCode
(),
testValue
));
...
...
@@ -871,11 +905,10 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
BigDecimal
.
ZERO
;
}
return
new
BigDecimal
(
testValue
);
}).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
double
total
=
totalValue
.
doubleValue
();
}).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
).
doubleValue
();
// 获取检测项目值对象
Map
<
String
,
Double
>
itemDataMap
=
sampleItem
IndexList
.
stream
().
collect
(
Collectors
.
toMap
(
EntrustSampleItemIndex
VO:
:
getName
,
t
->
Double
.
parseDouble
(
t
.
getTestValue
())));
Map
<
String
,
Double
>
itemDataMap
=
sampleItem
List
.
stream
().
collect
(
Collectors
.
toMap
(
EntrustSampleItem
VO:
:
getName
,
t
->
Double
.
parseDouble
(
t
.
getTestValue
())));
// 获得产品标准信息 -- 实时最新不是根据样品中的是否组合判定进行判定
// 可能需要根据样品中的字段进行判断是否需要组合判定composeJudge
GradingStandard
standard
=
gradingStandardService
.
getById
(
sampleVO
.
getProductStandardId
());
...
...
@@ -886,7 +919,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
List
<
GradingProduct
>
gradingProductList
=
gradingProductService
.
list
(
Condition
.
create
()
.
eq
(
"grading_standard_id"
,
standard
.
getId
()).
eq
(
"deleted"
,
0
)
// 依旧优先级来处理判定顺序
.
orderBy
(
"judge_priority"
,
fals
e
));
.
orderBy
(
"judge_priority"
,
tru
e
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingProductList
),
"产品标准不能为空"
);
...
...
@@ -897,12 +930,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
RestAssert
.
fail
(
StringUtils
.
isBlank
(
product
.
getSumCompare
()),
"产品标准比较符不能为空"
);
// 根据比较符类型比较大小
if
(!
CompareUtils
.
Comparator
.
get
(
product
.
getSumCompare
()).
calc
(
total
,
product
.
getSumValue
().
doubleValue
()))
{
if
(!
CompareUtils
.
Comparator
.
get
(
product
.
getSumCompare
()).
calc
(
total
Value
,
product
.
getSumValue
().
doubleValue
()))
{
if
(
i
<
gradingProductList
.
size
()
-
1
)
{
continue
;
}
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
continue
;
break
;
}
// 符合合计,若不为组合判定,则直接判定合格
...
...
@@ -912,7 +945,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
.
setSampleGrading
(
product
.
getProductGrade
()));
continue
;
break
;
}
// 若为组合判定,比较单个大小是否都符合
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
...
...
@@ -920,15 +953,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
.
eq
(
"deleted"
,
0
));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingItemList
),
"产品等级【"
+
product
.
getProductGrade
()
+
"】下为组合判定的检测项目为空"
);
// 若存在
gradingItemList
.
stream
().
forEach
(
t
->
{
gradingItemList
.
forEach
(
t
->
{
RestAssert
.
fail
(
StringUtils
.
isBlank
(
t
.
getDecisionSymbol
()),
"产品等级下产品检测项目比较符为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
t
.
getLimitValue
()),
"产品等级下产品检测项目限制值为空"
);
});
// 过滤 只要名称包含
List
<
GradingItem
>
gradingItems
=
gradingItemList
.
stream
().
filter
(
t
->
{
//
for
(
Map
.
Entry
entry
:
itemDataMap
.
entrySet
())
{
if
(
entry
.
getKey
().
toString
().
contains
(
t
.
getName
())
&&
StringUtils
.
isNotBlank
(
t
.
getLimitValue
()))
{
for
(
Map
.
Entry
<
String
,
Double
>
entry
:
itemDataMap
.
entrySet
())
{
if
(
entry
.
getKey
().
contains
(
t
.
getName
())
&&
StringUtils
.
isNotBlank
(
t
.
getLimitValue
()))
{
return
true
;
}
}
...
...
@@ -937,8 +970,26 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingItems
),
"样品下设定组合判定的检测项目不存在"
);
// 获取失败数量
long
failCount
=
gradingItems
.
stream
().
filter
(
t
->
!
CompareUtils
.
Comparator
.
get
(
t
.
getDecisionSymbol
()).
calc
(
itemDataMap
.
get
(
t
.
getName
()),
Double
.
parseDouble
(
t
.
getLimitValue
()))
long
failCount
=
gradingItems
.
stream
().
filter
(
t
->
{
// 获取填写检测值
double
testValue
=
itemDataMap
.
get
(
t
.
getName
());
// 若不包含正常的比较符,那么则为区间比较符
if
(!
CompareUtils
.
Comparator
.
containsKey
(
t
.
getDecisionSymbol
()))
{
String
[]
dataArr
=
t
.
getLimitValue
().
split
(
","
);
RestAssert
.
fail
(
dataArr
.
length
!=
2
,
String
.
format
(
"样品编号【%s】缺失检测范围值"
,
sample
.
getCode
()));
try
{
double
minV
=
Double
.
parseDouble
(
dataArr
[
0
].
trim
()),
maxV
=
Double
.
parseDouble
(
dataArr
[
1
].
trim
());
// 小于最小值 or 大于最大值
return
testValue
<
minV
||
testValue
>
maxV
;
}
catch
(
NumberFormatException
e
)
{
logger
.
error
(
e
.
getMessage
(),
e
.
getCause
());
RestAssert
.
fail
(
String
.
format
(
"样品编号【%s】检测范围值数据类型转换失败"
,
sample
.
getCode
()));
}
return
false
;
}
else
{
return
!
CompareUtils
.
Comparator
.
get
(
t
.
getDecisionSymbol
()).
calc
(
testValue
,
Double
.
parseDouble
(
t
.
getLimitValue
()));
}
}
).
count
();
// 若存在不符合判定要求,则进入下一标准判定
...
...
@@ -946,6 +997,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 存在下一个标准等级判定,继续判定
if
(
i
>=
gradingProductList
.
size
()
-
1
)
{
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
break
;
}
continue
;
}
...
...
@@ -954,7 +1006,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
.
setSampleGrading
(
product
.
getProductGrade
()));
break
;
}
}
if
(
updateSampleList
.
size
()
>
0
)
{
...
...
@@ -970,9 +1022,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
/**
* 不合格判定
*
* @param sample
* @return
*/
private
void
updateJudgeNoPass
(
EntrustSample
sample
,
Account
account
,
List
<
EntrustSample
>
sampleList
)
{
sampleList
.
add
(
sample
.
setOkJudge
(
"不合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
...
...
@@ -987,14 +1036,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
public
boolean
isAllocatedByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
||
0
l
==
entrustId
.
longValue
()
)
{
if
(
null
==
entrustId
)
{
return
false
;
}
return
baseMapper
.
selectUnallocatedCountByEntrustId
(
entrustId
)
==
0
;
}
private
boolean
isConfigureStatusPath
(
Entrust
entrust
)
{
return
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
())
?
true
:
false
;
return
StringUtils
.
isNotBlank
(
entrust
.
getStatusPath
())
&&
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
());
}
@Override
...
...
@@ -1035,13 +1084,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
/* 项目是否未检测 */
public
Boolean
isNotTesting
(
EntrustSampleItem
item
)
{
return
entrustSampleItemIndexService
.
list
(
Condition
.
create
()
.
eq
(
"entrust_sample_item_id"
,
item
.
getId
())).
size
()
==
0
;
return
entrustSampleItemIndexService
.
list
(
Condition
.
create
().
eq
(
"entrust_sample_item_id"
,
item
.
getId
())).
size
()
==
0
;
}
@Override
public
boolean
updateItemComposeJudgeByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
||
0
==
entrustId
.
longValue
()
)
{
if
(
null
==
entrustId
)
{
return
false
;
}
return
baseMapper
.
updateItemJudgeByEntrustId
(
entrustId
);
...
...
@@ -1076,8 +1124,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
/**
* 处理 原铝等标准为
*
* @param entrustId
*/
private
void
updateComposeJudgeByTestValue
(
Long
entrustId
)
{
// GB/T 1196 2017
...
...
@@ -1097,10 +1143,10 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 获取此标准的数据
for
(
EntrustSampleVO
vo
:
entrustSamples
)
{
// 获取检测值
List
<
EntrustSampleItemIndexVO
>
itemIndexVOList
=
entrustSampleItemIndexService
.
listVOBySampleIds
(
Arrays
.
as
List
(
vo
.
getId
()));
List
<
EntrustSampleItemIndexVO
>
itemIndexVOList
=
entrustSampleItemIndexService
.
listVOBySampleIds
(
Collections
.
singleton
List
(
vo
.
getId
()));
for
(
EntrustSampleItemIndexVO
indexVO
:
itemIndexVOList
)
{
if
(
StringUtils
.
isBlank
(
indexVO
.
getTestValue
())
||
!
otherYsList
.
contains
(
indexVO
))
{
if
(
StringUtils
.
isBlank
(
indexVO
.
getTestValue
())
||
!
otherYsList
.
contains
(
indexVO
.
getName
()
))
{
continue
;
}
if
(
Double
.
parseDouble
(
indexVO
.
getTestValue
())
>=
0.01d
)
{
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
ad723cb8
...
...
@@ -171,6 +171,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交到验收结果录入的数据"
);
if
(
submitJudgeCheck
(
ids
,
account
))
{
List
<
EntrustSample
>
sampleList
=
list
(
Condition
.
create
().
in
(
"id"
,
ids
));
List
<
Long
>
contractSampleIdList
=
new
ArrayList
<>();
for
(
EntrustSample
sample
:
sampleList
)
{
if
(
null
!=
sample
.
getContractSampleId
())
{
...
...
@@ -408,6 +409,10 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
QUALITY_JUDGE
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
END
;
itemStatus
=
EntrustSampleItemStatusEnum
.
END
;
}
else
if
(
nextFlowStatus
==
EntrustFlowEnum
.
ARCHIVES
)
{
sampleStatus
=
EntrustSampleStatusEnum
.
END
;
itemStatus
=
EntrustSampleItemStatusEnum
.
END
;
}
// 哪一级别
...
...
@@ -425,6 +430,9 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
if
(
null
!=
sampleStatus
)
{
updateSample
.
setStatus
(
sampleStatus
);
// 判定是否为质量判定
// 若为质量判定,判断需要判级
boolean
isRequireJudgeGrading
=
isRequireJudgeGrading
(
entrust
.
getId
());
for
(
EntrustSample
sample
:
sampleList
)
{
String
firstCode
=
sample
.
getFirstCode
(),
secondCode
=
sample
.
getSecondCode
(),
...
...
@@ -437,6 +445,10 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
}
sample
.
setCode
(
sampleCode
);
sample
.
setStatus
(
sampleStatus
).
setProgress
(
sampleStatus
);
// 不需要判级,直接跳入电子档案或者下一节点为质量判定
if
((!
isRequireJudgeGrading
&&
nextFlowStatus
==
EntrustFlowEnum
.
QUALITY_JUDGE
)
||
nextFlowStatus
==
EntrustFlowEnum
.
ARCHIVES
)
{
sample
.
setJudgeProgress
(
2
).
setJudgeStatus
(
2
);
}
}
// update(updateSample, Condition.create().eq("entrust_id", entrust.getId()));
// 批量更新样品编号和状态
...
...
@@ -1445,6 +1457,14 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return
super
.
update
(
sample
,
Condition
.
create
().
in
(
"id"
,
ids
));
}
private
ContractSample
getContractSampleBySampleId
(
Long
sampleId
)
{
EntrustSample
entrustSample
=
baseMapper
.
selectById
(
sampleId
);
if
(
null
==
entrustSample
||
null
==
entrustSample
.
getContractSampleId
())
{
return
null
;
}
return
contractSampleService
.
getById
(
entrustSample
.
getContractSampleId
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
backJudgeCheck
(
Long
[]
ids
,
String
remark
,
Account
account
)
{
...
...
@@ -1737,4 +1757,46 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
return
baseMapper
.
selectVOList
(
RowBounds
.
DEFAULT
,
entrustSampleVO
);
}
@Override
public
boolean
isRequireJudgeGrading
(
Long
entrustId
)
{
RestAssert
.
fail
(
null
==
entrustId
,
"判断是否需要判级时,委托编号不能为空"
);
List
<
EntrustSample
>
sampleList
=
getByEntrustId
(
entrustId
);
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
return
false
;
}
return
sampleList
.
stream
().
filter
(
t
->
null
!=
t
.
getProductStandardId
()).
count
()
>
0
;
}
@Override
public
boolean
updateJudgeStatus
(
Long
entrustId
,
Integer
judgeStatus
)
{
RestAssert
.
fail
(
null
==
entrustId
,
"更新判定结果时委托ID为空"
);
RestAssert
.
fail
(
null
==
judgeStatus
,
"更新判定结果时判定结果为空"
);
EntrustSample
entrustSample
=
new
EntrustSample
();
entrustSample
.
setJudgeStatus
(
judgeStatus
).
setJudgeProgress
(
judgeStatus
);
return
update
(
entrustSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrustId
));
}
@Override
public
Page
<
EntrustSampleVO
>
pageVOForMakeHis
(
Page
<
EntrustSampleVO
>
page
,
EntrustSampleVO
entrustSample
)
{
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrustSample
));
}
@Override
public
boolean
makeReportFromHis
(
ReportDTO
dto
,
Account
account
)
{
Long
[]
sampleIds
=
dto
.
getSampleIds
();
RestAssert
.
fail
(
null
==
sampleIds
,
"样品ID数据为空"
);
RestAssert
.
fail
(
null
==
dto
.
getEntrustId
(),
"委托ID数据为空"
);
// 从历史中生成报告,会自动删除之前的报告
entrustReportService
.
update
(
new
EntrustReport
().
setDeleted
(
1
),
Condition
.
create
().
eq
(
"entrust_id"
,
dto
.
getEntrustId
()));
// 删除样品与报告关联
entrustReportRelSampleService
.
remove
(
Condition
.
create
().
in
(
"sample_id"
,
sampleIds
));
EntrustSample
entrustSample
=
new
EntrustSample
();
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
entrustSample
.
setProgress
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
entrustSample
.
setJudgeStatus
(
null
).
setJudgeProgress
(
null
);
update
(
entrustSample
,
Condition
.
create
().
in
(
"id"
,
dto
.
getSampleIds
()));
makeReport
(
dto
,
account
);
return
entrustReportService
.
updateLastFlowCheckByEntrustId
(
dto
.
getEntrustId
(),
account
);
}
}
\ No newline at end of file
src/main/resources/mapper/hmhj/EntrustReportMapper.xml
View file @
ad723cb8
...
...
@@ -2,4 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.EntrustReportMapper"
>
<select
id=
"selectPageList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustReportVO"
>
select * from entrust_report r
<where>
<if
test=
"null == vo.deleted"
>
AND r.deleted = 0
</if>
<if
test=
"null != vo.deleted"
>
AND r.deleted = #{vo.deleted}
</if>
<if
test=
"null != vo.entrustId"
>
AND r.entrust_id = #{vo.entrustId}
</if>
</where>
</select>
</mapper>
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
ad723cb8
...
...
@@ -555,4 +555,18 @@
GROUP BY S.CODE
order by S.CODE asc
</select>
<!--旨在质量判定时统一结构使用,其他位置勿用-->
<select
id=
"listIndexReplaceItemBySampleId"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"
>
select
ii.*,
i.compose_judge,
s.code "sample_code",
s.entrust_id
FROM entrust_sample_item_index ii
JOIN entrust_sample_item i on ii.entrust_sample_item_id = i.id
JOIN entrust_sample s ON i.entrust_sample_id = s.id
WHERE ii.deleted =0 AND i.deleted = 0 AND s.deleted = 0
AND s.id = #{sampleId}
</select>
</mapper>
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
ad723cb8
...
...
@@ -57,6 +57,13 @@
)
</if>
<if
test=
"null != vo.statusList"
>
and s.status IN
<foreach
collection=
"vo.statusList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
</if>
<if
test=
"null != vo.itemStatusList"
>
AND exists (
select 1 from entrust_sample_item i where i.deleted = 0
...
...
src/test/java/resources/db_sql/hmhj/v147/20210718新增台账字段.sql
0 → 100644
View file @
ad723cb8
--添加炭块外观检测台账字段:生块装炉数--
--添加炭块外观检测台账字段:生块装炉数--
ALTER
TABLE
"public"
.
"carbon_appearance_check_ledger"
ADD
COLUMN
"raw_block_charge_num"
int4
;
COMMENT
ON
COLUMN
"public"
.
"carbon_appearance_check_ledger"
.
"raw_block_charge_num"
IS
'生块装炉数'
;
\ No newline at end of file
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