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
f8ab0465
Commit
f8ab0465
authored
Jul 19, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
同步修改合同检测值
parent
8d281c6a
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
262 additions
and
131 deletions
+262
-131
EntrustReportController.java
...service/lims/hmhj/controller/EntrustReportController.java
+44
-50
EntrustSampleController.java
...service/lims/hmhj/controller/EntrustSampleController.java
+29
-7
EntrustReportMapper.java
...n/cloud/service/lims/hmhj/mapper/EntrustReportMapper.java
+8
-0
EntrustSampleItemMapper.java
...oud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
+10
-8
IContractSampleService.java
...oud/service/lims/hmhj/service/IContractSampleService.java
+2
-0
IEntrustReportService.java
...loud/service/lims/hmhj/service/IEntrustReportService.java
+4
-0
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+4
-0
ContractSampleServiceImpl.java
...ice/lims/hmhj/service/impl/ContractSampleServiceImpl.java
+14
-5
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+24
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+63
-61
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+25
-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
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustReportController.java
View file @
f8ab0465
...
...
@@ -47,10 +47,10 @@ public class EntrustReportController extends ServiceController {
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
})
@PostMapping
(
"/page"
)
public
RestResult
<
Page
<
EntrustReport
>>
getPage
(
EntrustReport
entrustReport
)
{
public
RestResult
<
Page
<
EntrustReport
>>
getPage
(
EntrustReport
entrustReport
)
{
entrustReport
.
setStatus
(
EntrustReportStatusEnum
.
MAKING
);
return
success
(
entrustReportService
.
page
(
getPage
(),
entrustReport
));
}
}
@ApiOperation
(
"报告台账编制历史分页列表"
)
...
...
@@ -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,7 +174,7 @@ 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
()));
}
...
...
@@ -195,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
),
...
...
@@ -212,8 +216,6 @@ public class EntrustReportController extends ServiceController {
}
@ApiOperation
(
"查询 id 信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
...
...
@@ -228,108 +230,100 @@ public class EntrustReportController extends ServiceController {
@ApiImplicitParam
(
name
=
"id"
,
value
=
"主键"
,
required
=
true
,
paramType
=
"path"
,
dataTypeClass
=
Long
.
class
),
})
@PutMapping
(
"/{id}"
)
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
EntrustReport
entrustReport
)
{
public
RestResult
<
Boolean
>
edit
(
@PathVariable
(
"id"
)
Long
id
,
EntrustReport
entrustReport
)
{
entrustReport
.
setId
(
id
);
return
success
(
entrustReportService
.
updateById
(
entrustReport
));
}
}
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
EntrustReport
entrustReport
)
{
public
RestResult
<
Boolean
>
add
(
EntrustReport
entrustReport
)
{
return
success
(
entrustReportService
.
save
(
entrustReport
));
}
}
@ApiOperation
(
"根据 ids 删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"ids"
,
value
=
"主键列表"
,
required
=
true
,
paramType
=
"query"
,
allowMultiple
=
true
,
dataTypeClass
=
Long
.
class
),
})
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
@DeleteMapping
(
"/"
)
public
RestResult
<
Boolean
>
delete
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
)
{
return
success
(
entrustReportService
.
removeByIds
(
ids
));
}
}
@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 @
f8ab0465
...
...
@@ -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/mapper/EntrustReportMapper.java
View file @
f8ab0465
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 @
f8ab0465
...
...
@@ -19,7 +19,7 @@ import java.util.List;
/**
* <p>
*
Mapper 接口
* Mapper 接口
* </p>
*
* @author wwd
...
...
@@ -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 @
f8ab0465
...
...
@@ -69,4 +69,6 @@ public interface IContractSampleService extends IBaseService<ContractSample> {
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 @
f8ab0465
...
...
@@ -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/IEntrustSampleService.java
View file @
f8ab0465
...
...
@@ -101,4 +101,8 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
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/impl/ContractSampleServiceImpl.java
View file @
f8ab0465
...
...
@@ -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
;
}
...
...
@@ -416,5 +416,14 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
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 @
f8ab0465
...
...
@@ -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
;
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
f8ab0465
...
...
@@ -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
;
...
...
@@ -95,6 +95,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Autowired
private
IItemDeviateService
itemDeviateService
;
@Autowired
private
IContractSampleService
contractSampleService
;
@Autowired
private
IItemRelOriginalRecordService
itemRelOriginalRecordService
;
...
...
@@ -115,10 +117,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
private
Executor
executor1
;
@Autowired
private
LmsUserRelGroupClient
lmsUserRelGroupClient
;
@Value
(
"${libreOffice.url}"
)
private
String
libreOfficeUrl
;
@Autowired
...
...
@@ -133,7 +131,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
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
);
}
...
...
@@ -153,7 +151,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
try
{
List
<
EntrustSampleItem
>
entrustSampleItemList
=
JSONArray
.
parseArray
(
itemJson
,
EntrustSampleItem
.
class
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrustSampleItemList
),
"检测项目数据为空"
);
RestAssert
.
fail
(
entrustSampleItemList
.
stream
().
filter
(
t
->
null
==
t
.
getId
()).
count
()
>
0
,
"要修改检测值的编号为空"
);
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
()));
...
...
@@ -251,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
));
...
...
@@ -273,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
);
...
...
@@ -306,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
();
...
...
@@ -342,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
;
}
...
...
@@ -357,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
))
...
...
@@ -438,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
<>();
...
...
@@ -548,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
()))
...
...
@@ -679,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
<>();
...
...
@@ -896,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
{
// 获取检测项目及指标数据
sampleItemList
=
baseMapper
.
listIndexReplaceItemBySampleId
(
sampleVO
.
getId
());
}
// 获取检测项目及指标数据
List
<
EntrustSampleItemIndexVO
>
sampleItemIndexList
=
entrustSampleItemIndexService
.
listVOBySampleIds
(
Arrays
.
asList
(
sampleVO
.
getId
()));
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleItemIndexList
),
"样品检测项目及内容不能为空"
);
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
));
...
...
@@ -913,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
());
...
...
@@ -933,19 +924,18 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingProductList
),
"产品标准不能为空"
);
// 循环产品标准依次判定级别
sample:
for
(
int
i
=
0
;
i
<
gradingProductList
.
size
();
i
++)
{
GradingProduct
product
=
gradingProductList
.
get
(
i
);
RestAssert
.
fail
(
null
==
product
.
getSumValue
(),
"产品标准合计值不能为空"
);
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
);
break
sample
;
break
;
}
// 符合合计,若不为组合判定,则直接判定合格
...
...
@@ -955,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
()));
break
sample
;
break
;
}
// 若为组合判定,比较单个大小是否都符合
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
...
...
@@ -963,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
;
}
}
...
...
@@ -980,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
();
// 若存在不符合判定要求,则进入下一标准判定
...
...
@@ -989,7 +997,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 存在下一个标准等级判定,继续判定
if
(
i
>=
gradingProductList
.
size
()
-
1
)
{
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
break
sample
;
break
;
}
continue
;
}
...
...
@@ -998,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
sample
;
break
;
}
}
if
(
updateSampleList
.
size
()
>
0
)
{
...
...
@@ -1014,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
())
...
...
@@ -1031,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
...
...
@@ -1079,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
);
...
...
@@ -1120,8 +1124,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
/**
* 处理 原铝等标准为
*
* @param entrustId
*/
private
void
updateComposeJudgeByTestValue
(
Long
entrustId
)
{
// GB/T 1196 2017
...
...
@@ -1141,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 @
f8ab0465
...
...
@@ -1775,4 +1775,28 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
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 @
f8ab0465
...
...
@@ -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 @
f8ab0465
...
...
@@ -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 @
f8ab0465
...
...
@@ -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
...
...
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