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
93706d81
Commit
93706d81
authored
Jul 23, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加部分流程检测单位限制;
parent
bbf88bca
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
294 additions
and
316 deletions
+294
-316
EntrustFlowUtils.java
...atzn/cloud/service/lims/hmhj/common/EntrustFlowUtils.java
+8
-0
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+9
-4
EntrustSampleBackupController.java
...e/lims/hmhj/controller/EntrustSampleBackupController.java
+10
-0
EntrustSampleController.java
...service/lims/hmhj/controller/EntrustSampleController.java
+3
-0
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+2
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+2
-0
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+15
-14
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+48
-41
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+30
-105
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+106
-114
EntrustSampleBackupMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleBackupMapper.xml
+13
-1
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+9
-2
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+19
-16
StatisticsMapper.xml
src/main/resources/mapper/hmhj/StatisticsMapper.xml
+20
-19
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/common/EntrustFlowUtils.java
View file @
93706d81
...
@@ -108,4 +108,12 @@ public class EntrustFlowUtils {
...
@@ -108,4 +108,12 @@ public class EntrustFlowUtils {
}
}
return
statusEnum
;
return
statusEnum
;
}
}
public
static
boolean
isContains
(
String
statusPath
,
String
flowStatus
)
{
if
(
StringUtils
.
isBlank
(
statusPath
)
||
StringUtils
.
isBlank
(
flowStatus
))
{
return
false
;
}
List
<
String
>
flowList
=
Arrays
.
asList
(
statusPath
.
split
(
"->"
));
return
flowList
.
stream
().
anyMatch
(
t
->
t
.
equals
(
flowStatus
));
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
93706d81
...
@@ -208,9 +208,10 @@ public class EntrustController extends ServiceController {
...
@@ -208,9 +208,10 @@ public class EntrustController extends ServiceController {
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
})
@PostMapping
(
"/page_make"
)
@PostMapping
(
"/page_make"
)
public
RestResult
<
Page
<
Entrust
>>
getPageMake
(
Entrust
entrust
)
{
public
RestResult
<
Page
<
Entrust
VO
>>
getPageMake
(
EntrustVO
entrust
)
{
entrust
.
setStatus
(
EntrustStatusEnum
.
MAKE
);
entrust
.
setStatus
(
EntrustStatusEnum
.
MAKE
);
return
success
(
entrustService
.
page
(
getPage
(),
entrust
));
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustService
.
pageEntrustSampleMake
(
getPage
(),
entrust
));
}
}
...
@@ -224,6 +225,7 @@ public class EntrustController extends ServiceController {
...
@@ -224,6 +225,7 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_make_his"
)
@PostMapping
(
"/page_make_his"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageMakeHis
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageMakeHis
(
EntrustVO
entrust
)
{
entrust
.
setNotSampleStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrust
.
setNotSampleStatus
(
EntrustSampleStatusEnum
.
DRAFT
);
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustService
.
pageEntrustByNotSample
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustByNotSample
(
getPage
(),
entrust
));
}
}
...
@@ -400,7 +402,6 @@ public class EntrustController extends ServiceController {
...
@@ -400,7 +402,6 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_sample_receive"
)
@PostMapping
(
"/page_entrust_sample_receive"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageEntrustSampleReceive
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageEntrustSampleReceive
(
EntrustVO
entrust
)
{
entrust
.
setPrepareStatus
(
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
entrust
.
setPrepareStatus
(
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
// 设置用户编组
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustService
.
pageEntrustSampleReceive
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustSampleReceive
(
getPage
(),
entrust
));
}
}
...
@@ -416,7 +417,6 @@ public class EntrustController extends ServiceController {
...
@@ -416,7 +417,6 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_sample_receive_his"
)
@PostMapping
(
"/page_entrust_sample_receive_his"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageEntrustSampleReceiveHis
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageEntrustSampleReceiveHis
(
EntrustVO
entrust
)
{
entrust
.
setPrepareNotStatus
(
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
entrust
.
setPrepareNotStatus
(
EntrustSamplePrepareStatusEnum
.
RECEIVE
);
// 设置用户编组
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustService
.
pageEntrustSampleReceiveHis
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustSampleReceiveHis
(
getPage
(),
entrust
));
}
}
...
@@ -605,6 +605,8 @@ public class EntrustController extends ServiceController {
...
@@ -605,6 +605,8 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_report_make"
)
@PostMapping
(
"/page_entrust_report_make"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportMake
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportMake
(
EntrustVO
entrust
)
{
entrust
.
setSampleStatus
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
entrust
.
setSampleStatus
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
REPORT_MAKE
.
getName
());
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustService
.
pageEntrustBySample
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustBySample
(
getPage
(),
entrust
));
}
}
...
@@ -633,6 +635,7 @@ public class EntrustController extends ServiceController {
...
@@ -633,6 +635,7 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_report_check"
)
@PostMapping
(
"/page_entrust_report_check"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportCheck
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportCheck
(
EntrustVO
entrust
)
{
entrust
.
setReportStatus
(
EntrustReportStatusEnum
.
CHECK
);
entrust
.
setReportStatus
(
EntrustReportStatusEnum
.
CHECK
);
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
REPORT_CHECK
.
getName
());
return
success
(
entrustService
.
pageEntrustByReport
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustByReport
(
getPage
(),
entrust
));
}
}
...
@@ -667,6 +670,7 @@ public class EntrustController extends ServiceController {
...
@@ -667,6 +670,7 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_report_approve"
)
@PostMapping
(
"/page_entrust_report_approve"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportApprove
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportApprove
(
EntrustVO
entrust
)
{
entrust
.
setReportStatus
(
EntrustReportStatusEnum
.
ALLOW
);
entrust
.
setReportStatus
(
EntrustReportStatusEnum
.
ALLOW
);
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
REPORT_ALLOW
.
getName
());
return
success
(
entrustService
.
pageEntrustByReport
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustByReport
(
getPage
(),
entrust
));
}
}
...
@@ -732,6 +736,7 @@ public class EntrustController extends ServiceController {
...
@@ -732,6 +736,7 @@ public class EntrustController extends ServiceController {
@PostMapping
(
"/page_entrust_report_issue"
)
@PostMapping
(
"/page_entrust_report_issue"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportIssue
(
EntrustVO
entrust
)
{
public
RestResult
<
Page
<
EntrustVO
>>
getPageReportIssue
(
EntrustVO
entrust
)
{
entrust
.
setReportStatus
(
EntrustReportStatusEnum
.
ISSUE
);
entrust
.
setReportStatus
(
EntrustReportStatusEnum
.
ISSUE
);
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
REPORT_ISSUE
.
getName
());
return
success
(
entrustService
.
pageEntrustByReport
(
getPage
(),
entrust
));
return
success
(
entrustService
.
pageEntrustByReport
(
getPage
(),
entrust
));
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleBackupController.java
View file @
93706d81
...
@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.hmhj.controller;
...
@@ -3,6 +3,7 @@ package com.patzn.cloud.service.lims.hmhj.controller;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleBackup
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleBackup
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleBackupStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.EntrustSampleBackupStatusEnum
;
import
com.patzn.cloud.service.hmhj.vo.EntrustSampleBackupVO
;
import
com.patzn.cloud.service.hmhj.vo.EntrustSampleBackupVO
;
import
com.patzn.cloud.service.lims.hmhj.service.impl.UserInfoServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
@@ -40,6 +41,9 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -40,6 +41,9 @@ public class EntrustSampleBackupController extends ServiceController {
@Autowired
@Autowired
private
IEntrustSampleBackupService
entrustSampleBackupService
;
private
IEntrustSampleBackupService
entrustSampleBackupService
;
@Autowired
private
UserInfoServiceImpl
userInfoService
;
@ApiOperation
(
"样品备样分页列表"
)
@ApiOperation
(
"样品备样分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
@@ -51,6 +55,7 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -51,6 +55,7 @@ public class EntrustSampleBackupController extends ServiceController {
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPage
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPage
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
BACKUP_ING
);
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
BACKUP_ING
);
entrustSampleBackup
.
setType
(
"BY"
);
entrustSampleBackup
.
setType
(
"BY"
);
entrustSampleBackup
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
}
}
...
@@ -66,6 +71,7 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -66,6 +71,7 @@ public class EntrustSampleBackupController extends ServiceController {
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageBackupHis
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageBackupHis
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
entrustSampleBackup
.
setNotStatus
(
EntrustSampleBackupStatusEnum
.
BACKUP_ING
);
entrustSampleBackup
.
setNotStatus
(
EntrustSampleBackupStatusEnum
.
BACKUP_ING
);
entrustSampleBackup
.
setType
(
"BY"
);
entrustSampleBackup
.
setType
(
"BY"
);
entrustSampleBackup
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
}
}
...
@@ -81,6 +87,7 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -81,6 +87,7 @@ public class EntrustSampleBackupController extends ServiceController {
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageManage
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageManage
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
MANAGE_ING
);
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
MANAGE_ING
);
entrustSampleBackup
.
setType
(
"YP"
);
entrustSampleBackup
.
setType
(
"YP"
);
entrustSampleBackup
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustSampleBackupService
.
pageManage
(
getPage
(),
entrustSampleBackup
));
return
success
(
entrustSampleBackupService
.
pageManage
(
getPage
(),
entrustSampleBackup
));
}
}
...
@@ -95,6 +102,7 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -95,6 +102,7 @@ public class EntrustSampleBackupController extends ServiceController {
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageManageHis
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageManageHis
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
entrustSampleBackup
.
setNotStatus
(
EntrustSampleBackupStatusEnum
.
MANAGE_ING
);
entrustSampleBackup
.
setNotStatus
(
EntrustSampleBackupStatusEnum
.
MANAGE_ING
);
entrustSampleBackup
.
setType
(
"YP"
);
entrustSampleBackup
.
setType
(
"YP"
);
entrustSampleBackup
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
}
}
// =========================================
// =========================================
...
@@ -111,6 +119,7 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -111,6 +119,7 @@ public class EntrustSampleBackupController extends ServiceController {
@PostMapping
(
"/page_handle"
)
@PostMapping
(
"/page_handle"
)
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageHandle
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageHandle
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
HANDLE
);
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
HANDLE
);
entrustSampleBackup
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
}
}
...
@@ -125,6 +134,7 @@ public class EntrustSampleBackupController extends ServiceController {
...
@@ -125,6 +134,7 @@ public class EntrustSampleBackupController extends ServiceController {
@PostMapping
(
"/page_handle_his"
)
@PostMapping
(
"/page_handle_his"
)
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageHandleHis
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
public
RestResult
<
Page
<
EntrustSampleBackupVO
>>
getPageHandleHis
(
EntrustSampleBackupVO
entrustSampleBackup
)
{
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
HANDLE_OK
);
entrustSampleBackup
.
setStatus
(
EntrustSampleBackupStatusEnum
.
HANDLE_OK
);
entrustSampleBackup
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
return
success
(
entrustSampleBackupService
.
pageVO
(
getPage
(),
entrustSampleBackup
));
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleController.java
View file @
93706d81
...
@@ -94,6 +94,8 @@ public class EntrustSampleController extends ServiceController {
...
@@ -94,6 +94,8 @@ public class EntrustSampleController extends ServiceController {
@PostMapping
(
"/page_report_make"
)
@PostMapping
(
"/page_report_make"
)
public
RestResult
<
Page
<
EntrustSampleVO
>>
getPageReportMake
(
EntrustSampleVO
entrustSample
)
{
public
RestResult
<
Page
<
EntrustSampleVO
>>
getPageReportMake
(
EntrustSampleVO
entrustSample
)
{
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
entrustSample
.
setStatus
(
EntrustSampleStatusEnum
.
REPORT_MAKE
);
// 只显示试样
entrustSample
.
setType
(
0
);
return
success
(
entrustSampleService
.
pageVOForMake
(
getPage
(),
entrustSample
));
return
success
(
entrustSampleService
.
pageVOForMake
(
getPage
(),
entrustSample
));
}
}
...
@@ -113,6 +115,7 @@ public class EntrustSampleController extends ServiceController {
...
@@ -113,6 +115,7 @@ public class EntrustSampleController extends ServiceController {
EntrustSampleStatusEnum
.
REPORT_SEND
,
EntrustSampleStatusEnum
.
REPORT_SEND
,
EntrustSampleStatusEnum
.
END
EntrustSampleStatusEnum
.
END
));
));
entrustSample
.
setType
(
0
);
return
success
(
entrustSampleService
.
pageVOForMakeHis
(
getPage
(),
entrustSample
));
return
success
(
entrustSampleService
.
pageVOForMakeHis
(
getPage
(),
entrustSample
));
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
93706d81
...
@@ -16,6 +16,7 @@ import com.patzn.cloud.service.hmhj.vo.TesterWorkloadStatsVO;
...
@@ -16,6 +16,7 @@ import com.patzn.cloud.service.hmhj.vo.TesterWorkloadStatsVO;
import
com.patzn.cloud.service.lims.base.entity.LmsUserRelGroup
;
import
com.patzn.cloud.service.lims.base.entity.LmsUserRelGroup
;
import
com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO
;
import
com.patzn.cloud.service.lims.base.vo.LmsUserRelGroupVO
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleItemService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustSampleItemService
;
import
com.patzn.cloud.service.lims.hmhj.service.impl.UserInfoServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
...
@@ -41,6 +42,7 @@ public class EntrustSampleItemController extends ServiceController {
...
@@ -41,6 +42,7 @@ public class EntrustSampleItemController extends ServiceController {
@Autowired
@Autowired
private
IEntrustSampleItemService
entrustSampleItemService
;
private
IEntrustSampleItemService
entrustSampleItemService
;
@ApiOperation
(
"分页列表"
)
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
93706d81
...
@@ -102,4 +102,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
...
@@ -102,4 +102,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
boolean
isCanIntoNextNode
(
Entrust
entrust
);
boolean
isCanIntoNextNode
(
Entrust
entrust
);
boolean
isCanIntoPrevNode
(
Entrust
entrust
);
boolean
isCanIntoPrevNode
(
Entrust
entrust
);
Page
<
EntrustVO
>
pageEntrustSampleMake
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
93706d81
...
@@ -234,11 +234,12 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -234,11 +234,12 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
if
(!
entrustSampleService
.
isRequireJudgeGrading
(
entrust
.
getId
()))
{
if
(!
entrustSampleService
.
isRequireJudgeGrading
(
entrust
.
getId
()))
{
entrustSampleService
.
updateJudgeStatus
(
entrust
.
getId
(),
2
);
entrustSampleService
.
updateJudgeStatus
(
entrust
.
getId
(),
2
);
}
}
entrustService
.
updateById
(
entrust
);
// 更改样品编码显示形式,由三级变为一级
// 更改样品编码显示形式,由三级变为一级
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrust
.
getId
(),
1
);
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrust
.
getId
(),
1
);
}
}
// 流程状态
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrustService
.
updateById
(
entrust
);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
fromFlowStatus
.
getDisplay
(),
toFlowStatus
.
getDisplay
(),
0
,
account
,
remark
);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
fromFlowStatus
.
getDisplay
(),
toFlowStatus
.
getDisplay
(),
0
,
account
,
remark
);
}
}
}
}
...
@@ -275,14 +276,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -275,14 +276,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
private
void
judgeStatusPath
(
Entrust
entrust
,
EntrustFlowEnum
nextStatus
)
{
private
void
judgeStatusPath
(
Entrust
entrust
,
EntrustFlowEnum
nextStatus
)
{
RestAssert
.
fail
(
null
==
entrust
,
"委托信息为空"
);
RestAssert
.
fail
(
null
==
entrust
,
"委托信息为空"
);
String
statusPath
=
entrust
.
getStatusPath
();
String
statusPath
=
entrust
.
getStatusPath
()
,
flowStatus
=
entrust
.
getFlowStatus
()
;
// 为空,或者路径中不包含当前流程状态
// 为空,或者路径中不包含当前流程状态
if
(
StringUtils
.
isBlank
(
statusPath
)
||
!
entrust
.
getStatusPath
().
contains
(
entrust
.
getFlowStatus
()
))
{
if
(
!
EntrustFlowUtils
.
isContains
(
statusPath
,
flowStatus
))
{
return
;
return
;
}
}
EntrustFlowEnum
nextFlowStatus
=
EntrustFlowUtils
.
getNextFlowStatus
(
entrust
.
getFlowStatus
()
,
statusPath
);
EntrustFlowEnum
nextFlowStatus
=
EntrustFlowUtils
.
getNextFlowStatus
(
flowStatus
,
statusPath
);
// RestAssert.fail(null == nextFlowStatus,"状态路径配置的下一流程节点为空,无法进行下一步");
// RestAssert.fail(null == nextFlowStatus,"状态路径配置的下一流程节点为空,无法进行下一步");
RestAssert
.
fail
(
null
!=
nextFlowStatus
&&
nextFlowStatus
!=
nextStatus
,
String
.
format
(
"状态路径配置的下一节点为【%s】,无法进行下一步"
,
nextFlowStatus
.
getDisplay
()));
RestAssert
.
fail
(
null
!=
nextFlowStatus
&&
nextFlowStatus
!=
nextStatus
,
String
.
format
(
"状态路径配置的下一节点为【%s】,无法进行下一步"
,
nextFlowStatus
.
getDisplay
()));
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -461,14 +462,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -461,14 +462,14 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
sampleStatusEnum
=
EntrustSampleStatusEnum
.
REPORT_SEND
;
sampleStatusEnum
=
EntrustSampleStatusEnum
.
REPORT_SEND
;
}
}
if
(
null
!=
sampleStatusEnum
)
{
entrust
.
setFlowStatus
(
sampleStatusEnum
.
getName
());
entrustSample
.
setStatus
(
sampleStatusEnum
);
entrustService
.
updateById
(
entrust
);
entrustSample
.
setProgres
s
(
sampleStatusEnum
);
entrustSample
.
setStatu
s
(
sampleStatusEnum
);
entrustSampleService
.
update
(
entrustSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
())
);
entrustSample
.
setProgress
(
sampleStatusEnum
);
if
(
null
!=
entrustReport
)
{
entrustSampleService
.
update
(
entrustSample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()));
reason
=
String
.
format
(
"因【%s】,退回至%s"
,
reason
,
sampleStatusEnum
.
getDisplay
());
if
(
null
!=
entrustReport
)
{
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
entrustReport
.
getStatus
().
getDisplay
(),
sampleStatusEnum
.
getDisplay
(),
2
,
account
,
reason
);
reason
=
String
.
format
(
"因【%s】,退回至%s"
,
reason
,
sampleStatusEnum
.
getDisplay
()
);
}
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
entrustReport
.
getStatus
().
getDisplay
(),
sampleStatusEnum
.
getDisplay
(),
2
,
account
,
reason
);
}
}
}
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
93706d81
...
@@ -117,6 +117,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -117,6 +117,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Autowired
@Autowired
private
Executor
executor1
;
private
Executor
executor1
;
@Autowired
private
UserInfoServiceImpl
userInfoService
;
@Value
(
"${libreOffice.url}"
)
@Value
(
"${libreOffice.url}"
)
private
String
libreOfficeUrl
;
private
String
libreOfficeUrl
;
@Autowired
@Autowired
...
@@ -216,6 +219,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -216,6 +219,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
if
(
entrustService
.
isCanIntoNextNode
(
entrust
))
{
entrustService
.
submitToNextNode
(
entrust
,
account
);
entrustService
.
submitToNextNode
(
entrust
,
account
);
}
else
{
}
else
{
entrust
.
setFlowStatus
(
EntrustFlowEnum
.
TEST
.
getName
());
entrustService
.
updateById
(
entrust
);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"任务分配"
,
"数据录入"
,
0
,
account
,
"提交至数据录入"
);
entrustRecordService
.
record
(
new
Long
[]{
entrust
.
getId
()},
"任务分配"
,
"数据录入"
,
0
,
account
,
"提交至数据录入"
);
}
}
}
}
...
@@ -299,7 +304,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -299,7 +304,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// RestAssert.fail(itemList.stream().filter(t -> (null == t.getEndIndex() || 0 == t.getEndIndex().intValue())).count() > 0, "存在没有完成检测的检测项目");
// RestAssert.fail(itemList.stream().filter(t -> (null == t.getEndIndex() || 0 == t.getEndIndex().intValue())).count() > 0, "存在没有完成检测的检测项目");
// 若存在检测项目没有完成的,不可提交
// 若存在检测项目没有完成的,不可提交
for
(
EntrustSampleItemVO
item
:
itemList
)
{
for
(
EntrustSampleItemVO
item
:
itemList
)
{
RestAssert
.
fail
(
null
==
item
.
getEndIndex
()
||
0
==
item
.
getEndIndex
(),
"检测项目名称:"
+
item
.
getName
()
+
"未填写检测值,请确认!"
);
long
testerId
=
null
==
item
.
getTesterId
()
?
0
l
:
item
.
getTesterId
().
longValue
();
boolean
noSubmit
=
null
==
item
.
getEndIndex
()
||
0
==
item
.
getEndIndex
();
if
(
noSubmit
)
{
String
message
=
String
.
format
(
"检测项目【%s】未填写检测值!"
,
item
.
getName
());
if
(
testerId
!=
account
.
getUserId
().
longValue
())
{
message
=
"其他用户的"
+
message
;
}
RestAssert
.
fail
(
message
);
}
}
}
EntrustSampleItem
item
=
new
EntrustSampleItem
();
EntrustSampleItem
item
=
new
EntrustSampleItem
();
...
@@ -319,8 +332,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -319,8 +332,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
entrustService
.
submitToNextNode
(
entrust
,
account
);
entrustService
.
submitToNextNode
(
entrust
,
account
);
return
true
;
return
true
;
}
}
// 样品操作日志
// 暂时不提供
// 修改委托信息
// 修改委托信息
entrust
.
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
()).
setFlowStatus
(
EntrustFlowEnum
.
REPORT_MAKE
.
getName
()).
setProgress
(
EntrustStatusEnum
.
TEST
).
setStatus
(
EntrustStatusEnum
.
TEST
);
entrust
.
setLid
(
account
.
getUserId
()).
setLtime
(
new
Date
()).
setFlowStatus
(
EntrustFlowEnum
.
REPORT_MAKE
.
getName
()).
setProgress
(
EntrustStatusEnum
.
TEST
).
setStatus
(
EntrustStatusEnum
.
TEST
);
entrustService
.
updateById
(
entrust
);
entrustService
.
updateById
(
entrust
);
...
@@ -770,6 +781,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -770,6 +781,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
@Override
@Override
public
Page
<
EntrustSampleItemVO
>
pageItemDeviateCheck
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
entrustSampleItem
)
{
public
Page
<
EntrustSampleItemVO
>
pageItemDeviateCheck
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
entrustSampleItem
)
{
entrustSampleItem
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
page
.
setRecords
(
baseMapper
.
selectByItemDeviate
(
page
,
entrustSampleItem
));
return
page
.
setRecords
(
baseMapper
.
selectByItemDeviate
(
page
,
entrustSampleItem
));
}
}
...
@@ -843,11 +855,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -843,11 +855,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
page
;
return
page
;
}
}
List
<
Long
>
ids
=
list
.
stream
().
map
(
s
->
{
List
<
Long
>
ids
=
list
.
stream
().
map
(
ItemDeviate:
:
getItemId
).
collect
(
Collectors
.
toList
());
return
s
.
getItemId
();
}).
collect
(
Collectors
.
toList
());
entrustSampleItem
.
setIds
(
ids
);
entrustSampleItem
.
setIds
(
ids
);
entrustSampleItem
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
return
page
.
setRecords
(
baseMapper
.
selectByItemDeviate
(
page
,
entrustSampleItem
));
return
page
.
setRecords
(
baseMapper
.
selectByItemDeviate
(
page
,
entrustSampleItem
));
}
}
...
@@ -911,7 +921,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -911,7 +921,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleItemList
),
"样品检测项目及内容不能为空"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
sampleItemList
),
"样品检测项目及内容不能为空"
);
// 计算合计值
// 获得产品标准信息 -- 实时最新不是根据样品中的是否组合判定进行判定
// 可能需要根据样品中的字段进行判断是否需要组合判定composeJudge
GradingStandard
standard
=
gradingStandardService
.
getById
(
sampleVO
.
getProductStandardId
());
RestAssert
.
fail
(
null
==
standard
,
"产品标准不能为空"
);
// 是否组合判定
boolean
isComposeJudgment
=
null
!=
standard
.
getComposeJudge
()
&&
1
==
standard
.
getComposeJudge
().
intValue
();
// 计算合计-组合判定合计值
double
totalValue
=
sampleItemList
.
stream
().
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getTestValue
())).
map
(
t
->
{
double
totalValue
=
sampleItemList
.
stream
().
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getTestValue
())).
map
(
t
->
{
// 符合此条件,需要判断是否此标准且为稀有元素且值小于0.01即可忽略为0
// 符合此条件,需要判断是否此标准且为稀有元素且值小于0.01即可忽略为0
String
testValue
=
t
.
getTestValue
().
trim
();
String
testValue
=
t
.
getTestValue
().
trim
();
...
@@ -924,12 +941,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -924,12 +941,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 获取检测项目值对象
// 获取检测项目值对象
Map
<
String
,
Double
>
itemDataMap
=
sampleItemList
.
stream
().
collect
(
Collectors
.
toMap
(
EntrustSampleItemVO:
:
getName
,
t
->
Double
.
parseDouble
(
t
.
getTestValue
())));
Map
<
String
,
Double
>
itemDataMap
=
sampleItemList
.
stream
().
collect
(
Collectors
.
toMap
(
EntrustSampleItemVO:
:
getName
,
t
->
Double
.
parseDouble
(
t
.
getTestValue
())));
// 获得产品标准信息 -- 实时最新不是根据样品中的是否组合判定进行判定
// 可能需要根据样品中的字段进行判断是否需要组合判定composeJudge
GradingStandard
standard
=
gradingStandardService
.
getById
(
sampleVO
.
getProductStandardId
());
RestAssert
.
fail
(
null
==
standard
,
"产品标准不能为空"
);
// 是否组合判定
boolean
isComposeJudgment
=
null
!=
standard
.
getComposeJudge
()
&&
1
==
standard
.
getComposeJudge
().
intValue
();
// 获得产品等级信息
// 获得产品等级信息
List
<
GradingProduct
>
gradingProductList
=
gradingProductService
.
list
(
Condition
.
create
()
List
<
GradingProduct
>
gradingProductList
=
gradingProductService
.
list
(
Condition
.
create
()
.
eq
(
"grading_standard_id"
,
standard
.
getId
()).
eq
(
"deleted"
,
0
)
.
eq
(
"grading_standard_id"
,
standard
.
getId
()).
eq
(
"deleted"
,
0
)
...
@@ -940,29 +952,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -940,29 +952,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 循环产品标准依次判定级别
// 循环产品标准依次判定级别
for
(
int
i
=
0
;
i
<
gradingProductList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
gradingProductList
.
size
();
i
++)
{
// 最后一个判定级别
boolean
isLastGrading
=
i
==
gradingProductList
.
size
()
-
1
;
// ==
GradingProduct
product
=
gradingProductList
.
get
(
i
);
GradingProduct
product
=
gradingProductList
.
get
(
i
);
RestAssert
.
fail
(
null
==
product
.
getSumValue
(),
"产品标准合计值不能为空"
);
RestAssert
.
fail
(
null
==
product
.
getSumValue
(),
"产品标准合计值不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
product
.
getSumCompare
()),
"产品标准比较符不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
product
.
getSumCompare
()),
"产品标准比较符不能为空"
);
// 根据比较符类型比较大小
// 比较单个大小是否都符合
if
(!
CompareUtils
.
Comparator
.
get
(
product
.
getSumCompare
()).
calc
(
totalValue
,
product
.
getSumValue
().
doubleValue
()))
{
if
(
i
<
gradingProductList
.
size
()
-
1
)
{
continue
;
}
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
break
;
}
// 符合合计,若不为组合判定,则直接判定合格
if
(!
isComposeJudgment
)
{
// continue;
// 样品判定合格
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
.
setSampleGrading
(
product
.
getProductGrade
()));
break
;
}
// 若为组合判定,比较单个大小是否都符合
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
.
eq
(
"grading_product_id"
,
product
.
getId
()).
eq
(
"compose_judge"
,
1
)
.
eq
(
"grading_product_id"
,
product
.
getId
()).
eq
(
"compose_judge"
,
1
)
.
eq
(
"deleted"
,
0
));
.
eq
(
"deleted"
,
0
));
...
@@ -984,8 +981,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -984,8 +981,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingItems
),
"样品下设定组合判定的检测项目不存在"
);
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
gradingItems
),
"样品下设定组合判定的检测项目不存在"
);
//
获取失败数量
//
若失败,则进入下一判级
long
failCount
=
gradingItems
.
stream
().
filter
(
t
->
{
if
(
gradingItems
.
stream
().
anyMatch
(
t
->
{
// 获取填写检测值
// 获取填写检测值
double
testValue
=
itemDataMap
.
get
(
t
.
getName
());
double
testValue
=
itemDataMap
.
get
(
t
.
getName
());
// 若不包含正常的比较符,那么则为区间比较符
// 若不包含正常的比较符,那么则为区间比较符
...
@@ -1005,18 +1002,28 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1005,18 +1002,28 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
!
CompareUtils
.
Comparator
.
get
(
t
.
getDecisionSymbol
()).
calc
(
testValue
,
Double
.
parseDouble
(
t
.
getLimitValue
()));
return
!
CompareUtils
.
Comparator
.
get
(
t
.
getDecisionSymbol
()).
calc
(
testValue
,
Double
.
parseDouble
(
t
.
getLimitValue
()));
}
}
}
}
).
count
();
))
{
// 若为最后一个级别,那么判定结果
// 若存在不符合判定要求,则进入下一标准判定
if
(
isLastGrading
)
{
if
(
failCount
>
0
)
{
// 存在下一个标准等级判定,继续判定
if
(
i
>=
gradingProductList
.
size
()
-
1
)
{
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
break
;
break
;
}
}
// 否则,继续下一判定级别
continue
;
continue
;
}
}
// 继续判定是否为组合判定,若为组合判定,那么需要判定组合结果是否符合限定值
if
(
isComposeJudgment
)
{
// 根据比较符类型比较大小
if
(!
CompareUtils
.
Comparator
.
get
(
product
.
getSumCompare
()).
calc
(
totalValue
,
product
.
getSumValue
().
doubleValue
()))
{
if
(!
isLastGrading
)
{
continue
;
}
updateJudgeNoPass
(
sample
,
account
,
updateSampleList
);
break
;
}
}
// 样品判定合格
// 样品判定合格
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
updateSampleList
.
add
(
sample
.
setOkJudge
(
"合格"
).
setJudger
(
account
.
getUserName
()).
setJudgerId
(
account
.
getUserId
())
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
.
setJudgeCheckTime
(
new
Date
()).
setJudgeStatus
(
0
).
setJudgeProgress
(
0
)
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
93706d81
...
@@ -86,6 +86,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -86,6 +86,9 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Autowired
@Autowired
private
SysOrgClient
sysOrgClient
;
private
SysOrgClient
sysOrgClient
;
@Autowired
private
UserInfoServiceImpl
userInfoService
;
@Autowired
@Autowired
private
Executor
executor1
;
private
Executor
executor1
;
...
@@ -335,7 +338,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -335,7 +338,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
boolean
hasSendMessage
=
false
;
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
if
(
StringUtils
.
isNotBlank
(
e
.
getStatusPath
()
))
{
if
(
isCanIntoNextNode
(
e
))
{
rejectToPrevNode
(
e
,
reason
,
account
);
rejectToPrevNode
(
e
,
reason
,
account
);
hasSendMessage
=
true
;
hasSendMessage
=
true
;
}
else
{
}
else
{
...
@@ -362,7 +365,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -362,7 +365,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
boolean
hasSendMessage
=
false
;
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
// 若存在路径,根据状态路径处理数据
// 若存在路径,根据状态路径处理数据
if
(
StringUtils
.
isNotBlank
(
e
.
getStatusPath
())
&&
e
.
getStatusPath
().
contains
(
e
.
getFlowStatus
()
))
{
if
(
isCanIntoNextNode
(
e
))
{
submitToNextNode
(
e
,
account
);
submitToNextNode
(
e
,
account
);
hasSendMessage
=
true
;
hasSendMessage
=
true
;
}
else
{
}
else
{
...
@@ -389,7 +392,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -389,7 +392,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
boolean
hasSendMessage
=
false
;
boolean
hasSendMessage
=
false
;
for
(
Entrust
e
:
entrustList
)
{
for
(
Entrust
e
:
entrustList
)
{
// 若存在路径,根据状态路径处理数据
// 若存在路径,根据状态路径处理数据
if
(
StringUtils
.
isNotBlank
(
e
.
getStatusPath
()
))
{
if
(
isCanIntoNextNode
(
e
))
{
submitToNextNode
(
e
,
account
);
submitToNextNode
(
e
,
account
);
hasSendMessage
=
true
;
hasSendMessage
=
true
;
}
else
{
}
else
{
...
@@ -567,63 +570,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -567,63 +570,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustSampleReceive
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustSampleReceive
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
List
<
EntrustSamplePrepare
>
prepareList
=
entrustSamplePrepareService
.
list
(
Condition
.
create
().
setSqlSelect
(
"entrust_sample_id"
)
.
eq
(
"status"
,
EntrustSamplePrepareStatusEnum
.
RECEIVE
).
isNotNull
(
"entrust_sample_id"
));
if
(
CollectionUtils
.
isEmpty
(
prepareList
))
{
return
page
;
}
List
<
Long
>
sampleIds
=
prepareList
.
stream
().
map
(
p
->
{
return
p
.
getEntrustSampleId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
sampleIds
))
{
return
page
;
}
List
<
EntrustSample
>
entrustSamples
=
entrustSampleService
.
getBatchIds
(
sampleIds
);
if
(
CollectionUtils
.
isEmpty
(
entrustSamples
))
{
return
page
;
}
List
<
Long
>
ids
=
entrustSamples
.
stream
().
map
(
e
->
{
return
e
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
}
entrust
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectEntrustSampleReceive
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectEntrustSampleReceive
(
page
,
entrust
));
}
}
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustSampleReceiveHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustSampleReceiveHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
List
<
EntrustSamplePrepare
>
prepareList
=
entrustSamplePrepareService
.
list
(
Condition
.
create
().
setSqlSelect
(
"entrust_sample_id"
).
ne
(
"status"
,
EntrustSamplePrepareStatusEnum
.
RECEIVE
));
if
(
CollectionUtils
.
isEmpty
(
prepareList
))
{
return
page
;
}
List
<
Long
>
sampleIds
=
prepareList
.
stream
().
map
(
p
->
{
return
p
.
getEntrustSampleId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
sampleIds
))
{
return
page
;
}
List
<
EntrustSample
>
entrustSamples
=
entrustSampleService
.
getBatchIds
(
sampleIds
);
if
(
CollectionUtils
.
isEmpty
(
entrustSamples
))
{
return
page
;
}
List
<
Long
>
ids
=
entrustSamples
.
stream
().
map
(
e
->
{
return
e
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
}
entrust
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectEntrustSampleReceive
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectEntrustSampleReceive
(
page
,
entrust
));
}
}
...
@@ -664,64 +616,32 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -664,64 +616,32 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustBySample
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustBySample
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
RestAssert
.
fail
(
null
==
entrust
.
getSampleStatus
(),
"样品状态不能为空"
);
List
<
EntrustSample
>
sampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"status"
,
entrust
.
getSampleStatus
()));
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
if
(
null
==
entrust
.
getSampleStatus
())
{
return
page
;
}
List
<
Long
>
ids
=
sampleList
.
stream
().
map
(
s
->
{
return
s
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
return
page
;
}
}
entrust
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
}
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustByNotSample
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustByNotSample
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
RestAssert
.
fail
(
null
==
entrust
.
getNotSampleStatus
(),
"样品状态不能为空"
);
if
(
null
==
entrust
.
getNotSampleStatus
())
{
List
<
EntrustSample
>
sampleList
=
entrustSampleService
.
list
(
Condition
.
create
().
ne
(
"status"
,
entrust
.
getNotSampleStatus
()));
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
return
page
;
return
page
;
}
}
List
<
Long
>
ids
=
sampleList
.
stream
().
map
(
s
->
{
return
s
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
}
entrust
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
}
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustByReport
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustByReport
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
RestAssert
.
fail
(
null
==
entrust
.
getReportStatus
(),
"报告状态不能为空"
);
if
(
null
==
entrust
.
getReportStatus
())
{
List
<
EntrustReport
>
reportList
=
entrustReportService
.
list
(
Condition
.
create
().
eq
(
"status"
,
entrust
.
getReportStatus
()));
if
(
CollectionUtils
.
isEmpty
(
reportList
))
{
return
page
;
}
List
<
Long
>
ids
=
reportList
.
stream
().
map
(
s
->
{
return
s
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
return
page
;
}
}
// 此方法过滤检测单位
entrust
.
set
IdsList
(
ids
);
entrust
.
set
GroupNameList
(
userInfoService
.
getCurGroupNameList
()
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
}
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustByReportNotHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustByReportNotHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
RestAssert
.
fail
(
null
==
entrust
.
getReportNotStatus
(),
"报告状态不能为空"
);
RestAssert
.
fail
(
null
==
entrust
.
getReportNotStatus
(),
"报告状态不能为空"
);
...
@@ -744,20 +664,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -744,20 +664,12 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustByReportHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustByReportHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
entrust
.
getReportStatusList
()),
"报告状态不能为空"
);
//
List
<
EntrustReport
>
reportList
=
entrustReportService
.
list
(
Condition
.
create
().
in
(
"status"
,
entrust
.
getReportStatusList
()));
if
(
CollectionUtils
.
isEmpty
(
entrust
.
getReportStatusList
()))
{
if
(
CollectionUtils
.
isEmpty
(
reportList
))
{
return
page
;
}
List
<
Long
>
ids
=
reportList
.
stream
().
map
(
s
->
{
return
s
.
getEntrustId
();
}).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
ids
))
{
return
page
;
return
page
;
}
}
// 历史同样过滤检测单位
entrust
.
set
IdsList
(
ids
);
entrust
.
set
GroupNameList
(
userInfoService
.
getCurGroupNameList
()
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
}
...
@@ -1372,14 +1284,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1372,14 +1284,27 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
public
boolean
isCanIntoNextNode
(
Entrust
entrust
)
{
public
boolean
isCanIntoNextNode
(
Entrust
entrust
)
{
// 路径不为空且当前流程状态不为空且存在下一步流程节点
// 路径不为空且当前流程状态不为空且存在下一步流程节点
String
statusPath
=
entrust
.
getStatusPath
(),
flowStatus
=
entrust
.
getFlowStatus
();
String
statusPath
=
entrust
.
getStatusPath
(),
flowStatus
=
entrust
.
getFlowStatus
();
return
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
statusPath
)
&&
statusPath
.
contains
(
flowStatus
)
&&
null
!=
EntrustFlowUtils
.
getNextFlowStatus
(
flowStatus
,
statusPath
);
if
(
StringUtils
.
isNotBlank
(
statusPath
))
{
List
<
String
>
flowList
=
Arrays
.
asList
(
statusPath
.
split
(
"->"
));
return
flowList
.
stream
().
anyMatch
(
t
->
t
.
equals
(
flowStatus
))
&&
null
!=
EntrustFlowUtils
.
getNextFlowStatus
(
flowStatus
,
statusPath
);
}
return
false
;
}
}
@Override
@Override
public
boolean
isCanIntoPrevNode
(
Entrust
entrust
)
{
public
boolean
isCanIntoPrevNode
(
Entrust
entrust
)
{
// 路径不为空且当前流程状态不为空且存在上一步流程节点
// 路径不为空且当前流程状态不为空且存在上一步流程节点
String
statusPath
=
entrust
.
getStatusPath
(),
flowStatus
=
entrust
.
getFlowStatus
();
String
statusPath
=
entrust
.
getStatusPath
(),
flowStatus
=
entrust
.
getFlowStatus
();
return
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
statusPath
)
&&
statusPath
.
contains
(
flowStatus
)
&&
null
!=
EntrustFlowUtils
.
getPrevFlowStatus
(
flowStatus
,
statusPath
);
if
(
StringUtils
.
isNotBlank
(
statusPath
))
{
List
<
String
>
flowList
=
Arrays
.
asList
(
statusPath
.
split
(
"->"
));
return
flowList
.
stream
().
anyMatch
(
t
->
t
.
equals
(
flowStatus
))
&&
null
!=
EntrustFlowUtils
.
getPrevFlowStatus
(
flowStatus
,
statusPath
);
}
return
false
;
}
@Override
public
Page
<
EntrustVO
>
pageEntrustSampleMake
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
}
}
}
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
93706d81
...
@@ -2,45 +2,28 @@
...
@@ -2,45 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!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.EntrustMapper"
>
<mapper
namespace=
"com.patzn.cloud.service.lims.hmhj.mapper.EntrustMapper"
>
<select
id=
"listByContractId"
resultType=
"com.patzn.cloud.service.hmhj.dto.EntrustSampleDTO"
>
<sql
id=
"basicCondition"
>
SELECT * FROM entrust_sample WHERE deleted = 0 AND entrust_id =#{entrustId} ORDER BY code DESC
</select>
<select
id=
"selectEntrustSampleReceive"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT * FROM entrust WHERE deleted = 0
<if
test=
"null!=vo.idsList"
>
AND id IN
<foreach
collection=
"vo.idsList"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"null!=vo.groupNameList"
>
AND test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
order by entrust_time desc
</select>
<select
id=
"selectVOList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT e.* FROM entrust e WHERE e.deleted = 0
<if
test=
"null!=vo.idsList"
>
AND e.id IN
<foreach
collection=
"vo.idsList"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"null!=vo.client"
>
<if
test=
"null!=vo.client"
>
AND e.client
LIKE CONCAT('%',#{vo.client},'%')
AND e.client LIKE CONCAT('%',#{vo.client},'%')
</if>
</if>
<if
test=
"null!=vo.code"
>
<if
test=
"null!=vo.code"
>
AND e.code
LIKE CONCAT('%',#{vo.code},'%')
AND e.code LIKE CONCAT('%',#{vo.code},'%')
</if>
</if>
<if
test=
"null!=vo.testSide"
>
<if
test=
"null!=vo.testSide"
>
AND e.test_side LIKE CONCAT('%',#{vo.testSide},'%')
AND e.test_side LIKE CONCAT('%',#{vo.testSide},'%')
</if>
<if
test=
"null!=vo.status"
>
AND e.status = #{vo.status}
</if>
<if
test=
"null!=vo.flowStatus"
>
AND e.flow_status = #{vo.flowStatus}
</if>
<if
test=
"null != vo.groupNameList"
>
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
</if>
<if
test=
"null!=vo.statusList"
>
<if
test=
"null!=vo.statusList"
>
AND e.status IN
AND e.status IN
...
@@ -48,18 +31,88 @@
...
@@ -48,18 +31,88 @@
#{status}
#{status}
</foreach>
</foreach>
</if>
</if>
<if
test=
"null != vo.idsList"
>
AND e.id IN
<foreach
collection=
"vo.idsList"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
</sql>
<select
id=
"listByContractId"
resultType=
"com.patzn.cloud.service.hmhj.dto.EntrustSampleDTO"
>
SELECT *
FROM entrust_sample
WHERE deleted = 0
AND entrust_id = #{entrustId}
ORDER BY code DESC
</select>
<select
id=
"selectEntrustSampleReceive"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT e.* FROM entrust e WHERE e.deleted = 0
<include
refid=
"basicCondition"
/>
<if
test=
"null != vo.prepareStatus"
>
and exists (
select 1 from entrust_sample s
join entrust_sample_prepare p on p.entrust_sample_id = s.id
where s.deleted = 0 and p.deleted = 0 and p.entrust_sample_id is not null
and s.entrust_id = e.id and p.status = #{vo.prepareStatus}
)
</if>
<if
test=
"null != vo.prepareNotStatus"
>
and exists (
select 1 from entrust_sample s
join entrust_sample_prepare p on p.entrust_sample_id = s.id
where s.deleted = 0 and p.deleted = 0 and p.entrust_sample_id is not null
and s.entrust_id = e.id and p.status != #{vo.prepareNotStatus}
)
</if>
order by e.entrust_time desc
</select>
<select
id=
"selectVOList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT e.* FROM entrust e WHERE e.deleted = 0
<include
refid=
"basicCondition"
/>
<if
test=
"null != vo.sampleStatus"
>
AND exists (
select 1 from entrust_sample s where s.deleted = 0
and s.entrust_id = e.id and s.status = #{vo.sampleStatus}
)
</if>
<if
test=
"null != vo.notSampleStatus"
>
AND exists (
select 1 from entrust_sample s where s.deleted = 0
and s.entrust_id = e.id and s.status != #{vo.notSampleStatus}
)
</if>
<if
test=
"null != vo.itemStatus"
>
<if
test=
"null != vo.itemStatus"
>
AND exists (
AND exists (
select 1 from entrust_sample_item i join entrust_sample s on i.entrust_sample_id = s.id
select 1 from entrust_sample_item i join entrust_sample s on i.entrust_sample_id = s.id
where s.deleted = 0 and i.deleted = 0 and s.entrust_id = e.id and i.status = #{vo.itemStatus}
where s.deleted = 0 and i.deleted = 0 and s.entrust_id = e.id and i.status = #{vo.itemStatus}
)
)
</if>
</if>
<if
test=
"null!=vo.groupNameList"
>
<if
test=
"null != vo.reportStatus"
>
AND e.test_side IN
AND exists (
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
#{groupName}
and r.status = #{vo.reportStatus}
)
</if>
<if
test=
"null != vo.reportStatusList"
>
AND exists (
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
and r.status IN
<foreach
collection=
"vo.reportStatusList"
index=
"index"
item=
"reportStatus"
open=
"("
separator=
","
close=
")"
>
#{reportStatus}
</foreach>
</foreach>
)
</if>
</if>
<if
test=
"null != vo.uid"
>
<if
test=
"null != vo.uid"
>
AND e.uid = #{vo.uid}
AND e.uid = #{vo.uid}
</if>
</if>
...
@@ -69,39 +122,18 @@
...
@@ -69,39 +122,18 @@
<!--查询委托历史数据-->
<!--查询委托历史数据-->
<select
id=
"selectEntrustVOHisList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
<select
id=
"selectEntrustVOHisList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT * FROM entrust e WHERE e.deleted = 0
SELECT * FROM entrust e WHERE e.deleted = 0
<include
refid=
"basicCondition"
/>
<if
test=
"null != vo.itemStatusEnumList"
>
<if
test=
"null != vo.itemStatusEnumList"
>
AND exists (
AND exists (
select 1 from entrust_sample s,entrust_sample_item i where s.deleted = 0 and i.deleted = 0
select 1 from entrust_sample s,entrust_sample_item i where s.deleted = 0 and i.deleted = 0
and s.id = i.entrust_sample_id and e.id = s.entrust_id
and s.id = i.entrust_sample_id and e.id = s.entrust_id
and i.status IN
and i.status IN
<foreach
collection=
"vo.itemStatusEnumList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"vo.itemStatusEnumList"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
#{item}
</foreach>
)
</if>
<if
test=
"null!=vo.client"
>
AND e.client LIKE CONCAT('%',#{vo.client},'%')
</if>
<if
test=
"null!=vo.code"
>
AND e.code LIKE CONCAT('%',#{vo.code},'%')
</if>
<if
test=
"null!=vo.testSide"
>
AND e.test_side LIKE CONCAT('%',#{vo.testSide},'%')
</if>
<if
test=
"null!=vo.statusList"
>
AND e.status IN
<foreach
collection=
"vo.statusList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
</if>
<if
test=
"null!=vo.groupNameList"
>
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</foreach>
)
</if>
</if>
order by entrust_time desc
order by e
.e
ntrust_time desc
</select>
</select>
<select
id=
"selectVOListByItem"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
<select
id=
"selectVOListByItem"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
...
@@ -109,6 +141,8 @@
...
@@ -109,6 +141,8 @@
entrust e,entrust_sample s,entrust_sample_item i
entrust e,entrust_sample s,entrust_sample_item i
WHERE e.deleted = 0 and s.deleted = 0 and i.deleted = 0
WHERE e.deleted = 0 and s.deleted = 0 and i.deleted = 0
and s.entrust_id = e.id and i.entrust_sample_id = s.id
and s.entrust_id = e.id and i.entrust_sample_id = s.id
<include
refid=
"basicCondition"
/>
<if
test=
"null!=vo.itemStatus"
>
<if
test=
"null!=vo.itemStatus"
>
and i.status = #{vo.itemStatus}
and i.status = #{vo.itemStatus}
</if>
</if>
...
@@ -118,21 +152,6 @@
...
@@ -118,21 +152,6 @@
#{status}
#{status}
</foreach>
</foreach>
</if>
</if>
<if
test=
"null!=vo.groupNameList"
>
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
<if
test=
"null!=vo.client"
>
AND e.client LIKE CONCAT('%',#{vo.client},'%')
</if>
<if
test=
"null!=vo.code"
>
AND e.code LIKE CONCAT('%',#{vo.code},'%')
</if>
<if
test=
"null!=vo.testSide"
>
AND e.test_side LIKE CONCAT('%',#{vo.testSide},'%')
</if>
<if
test=
"null!=vo.testerId"
>
<if
test=
"null!=vo.testerId"
>
AND i.tester_id = #{vo.testerId}
AND i.tester_id = #{vo.testerId}
</if>
</if>
...
@@ -145,45 +164,18 @@
...
@@ -145,45 +164,18 @@
s.name "sample_name",s."sample_num"
s.name "sample_name",s."sample_num"
FROM entrust e
FROM entrust e
left join (select s.entrust_id,s.name,count(1) "sample_num" from entrust_sample s
left join (select s.entrust_id,s.name,count(1) "sample_num" from entrust_sample s
where s.deleted = 0 group by s.entrust_id, s.name
where s.deleted = 0 group by s.entrust_id, s.name
) s on s.entrust_id = e.id
) s on s.entrust_id = e.id
WHERE deleted = 0
WHERE deleted = 0
<if
test=
"null!=vo.idsList"
>
AND id IN
<include
refid=
"basicCondition"
/>
<foreach
collection=
"vo.idsList"
index=
"index"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"null!=vo.client"
>
AND client LIKE CONCAT('%',#{vo.client},'%')
</if>
<if
test=
"null!=vo.code"
>
AND code LIKE CONCAT('%',#{vo.code},'%')
</if>
<if
test=
"null!=vo.testSide"
>
AND test_side LIKE CONCAT('%',#{vo.testSide},'%')
</if>
<if
test=
"null != vo.entrustTimeS and null != vo.entrustTimeE"
>
<if
test=
"null != vo.entrustTimeS and null != vo.entrustTimeE"
>
AND to_char(entrust_time, 'YYYY-MM-dd HH24:MI:SS') BETWEEN #{vo.entrustTimeS} AND #{vo.entrustTimeE}
AND to_char(entrust_time, 'YYYY-MM-dd HH24:MI:SS') BETWEEN #{vo.entrustTimeS} AND #{vo.entrustTimeE}
</if>
</if>
<if
test=
"null!=vo.statusList"
>
order by e.entrust_time desc
AND status IN
<foreach
collection=
"vo.statusList"
index=
"index"
item=
"status"
open=
"("
separator=
","
close=
")"
>
#{status}
</foreach>
</if>
<if
test=
"null!=vo.groupNameList"
>
AND test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
order by entrust_time desc
</select>
</select>
</mapper>
</mapper>
src/main/resources/mapper/hmhj/EntrustSampleBackupMapper.xml
View file @
93706d81
...
@@ -45,6 +45,12 @@
...
@@ -45,6 +45,12 @@
<if
test=
"null!=vo.entrustCode"
>
<if
test=
"null!=vo.entrustCode"
>
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
</if>
</if>
<if
test=
"null != vo.groupNameList"
>
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
</where>
</where>
order by date_part('day', CAST(b.storage_period AS TIMESTAMP) - CAST( now() AS TIMESTAMP)) asc,b.ctime desc
order by date_part('day', CAST(b.storage_period AS TIMESTAMP) - CAST( now() AS TIMESTAMP)) asc,b.ctime desc
</select>
</select>
...
@@ -63,7 +69,7 @@
...
@@ -63,7 +69,7 @@
s.code AS "sampleCode" ,
s.code AS "sampleCode" ,
e.client ,
e.client ,
e.code AS "entrustCode",
e.code AS "entrustCode",
(case when e.sample_handle_advise = '检测完毕退还' and s.status
>
20 then 1 else 0 end) "weights"
(case when e.sample_handle_advise = '检测完毕退还' and s.status
>
20 then 1 else 0 end) "weights"
FROM
FROM
entrust_sample_backup b
entrust_sample_backup b
JOIN entrust_sample s ON b.sample_id = s.ID
JOIN entrust_sample s ON b.sample_id = s.ID
...
@@ -92,6 +98,12 @@
...
@@ -92,6 +98,12 @@
<if
test=
"null!=vo.entrustCode"
>
<if
test=
"null!=vo.entrustCode"
>
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
AND e.code LIKE CONCAT('%',#{vo.entrustCode},'%')
</if>
</if>
<if
test=
"null != vo.groupNameList"
>
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
</where>
</where>
order by (case when e.sample_handle_advise = '检测完毕退还' and s.status
>
20 then 1 else 0 end) desc, b.ctime desc
order by (case when e.sample_handle_advise = '检测完毕退还' and s.status
>
20 then 1 else 0 end) desc, b.ctime desc
</select>
</select>
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
93706d81
...
@@ -241,6 +241,12 @@
...
@@ -241,6 +241,12 @@
#{id}
#{id}
</foreach>
</foreach>
</if>
</if>
<if
test=
"null != vo.groupNameList"
>
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
#{groupName}
</foreach>
</if>
ORDER BY s.code , i.name
ORDER BY s.code , i.name
</select>
</select>
...
@@ -340,6 +346,7 @@
...
@@ -340,6 +346,7 @@
<select
id=
"selectByEntrustId"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"
>
<select
id=
"selectByEntrustId"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustSampleItemVO"
>
SELECT i.id,i.name,i.entrust_sample_id,s.entrust_id,i.agreed_value,i.test_value,i.standard,s.code AS "sampleCode"
SELECT i.id,i.name,i.entrust_sample_id,s.entrust_id,i.agreed_value,i.test_value,i.standard,s.code AS "sampleCode"
,s.name AS "sampleName", s.sample_shape ,s.sample_quantity, s.standard, s.sample_from,s.product_code,s.name_code,
,s.name AS "sampleName", s.sample_shape ,s.sample_quantity, s.standard, s.sample_from,s.product_code,s.name_code,
i.tester_id,i.tester,
(case when COALESCE(ii."END_INDEX",0) = 0 then 0 else 1 end) "endIndex"
(case when COALESCE(ii."END_INDEX",0) = 0 then 0 else 1 end) "endIndex"
FROM
FROM
entrust_sample_item i
entrust_sample_item i
...
@@ -453,7 +460,7 @@
...
@@ -453,7 +460,7 @@
join entrust_sample_item_index ii on ii.entrust_sample_item_id = i.id
join entrust_sample_item_index ii on ii.entrust_sample_item_id = i.id
join entrust_sample s on s.id = i.entrust_sample_id
join entrust_sample s on s.id = i.entrust_sample_id
join gspi g on g.grading_standard_id = s.product_standard_id and strpos(i.name,g.name) >= 0
join gspi g on g.grading_standard_id = s.product_standard_id and strpos(i.name,g.name) >= 0
where i.deleted = 0 and ii.deleted = 0
where i.deleted = 0 and ii.deleted = 0
AND s.type = 0
<if
test=
"null != vo.entrustId"
>
<if
test=
"null != vo.entrustId"
>
and s.entrust_id = #{vo.entrustId}
and s.entrust_id = #{vo.entrustId}
</if>
</if>
...
@@ -535,7 +542,7 @@
...
@@ -535,7 +542,7 @@
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id
JOIN entrust_sample_item i ON i.ID = ii.entrust_sample_item_id
JOIN entrust_sample s ON s.ID = i.entrust_sample_id
JOIN entrust_sample s ON s.ID = i.entrust_sample_id
JOIN entrust e on e.id = s.entrust_id
JOIN entrust e on e.id = s.entrust_id
where ii.deleted = 0 and i.deleted = 0 and s.deleted = 0 and e.deleted = 0
where ii.deleted = 0 and i.deleted = 0 and s.deleted = 0 and e.deleted = 0
AND s.type = 0
<if
test=
"null != vo.client"
>
<if
test=
"null != vo.client"
>
and e.client LIKE CONCAT('%',#{vo.client},'%')
and e.client LIKE CONCAT('%',#{vo.client},'%')
</if>
</if>
...
...
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
93706d81
...
@@ -45,6 +45,10 @@
...
@@ -45,6 +45,10 @@
AND s.code LIKE CONCAT('%',#{vo.code},'%')
AND s.code LIKE CONCAT('%',#{vo.code},'%')
</if>
</if>
<if
test=
"null != vo.type"
>
AND s.type = #{vo.type}
</if>
<if
test=
"null != vo.notStatus"
>
<if
test=
"null != vo.notStatus"
>
AND s.status != #{vo.notStatus}
AND s.status != #{vo.notStatus}
</if>
</if>
...
@@ -138,18 +142,17 @@
...
@@ -138,18 +142,17 @@
group by cr.sample_id
group by cr.sample_id
) cr on cr.sample_id = s.id
) cr on cr.sample_id = s.id
WHERE
WHERE
s.deleted = 0
s.deleted = 0 AND s.type = 0 AND e.deleted = 0
AND e.deleted = 0
<if
test=
"vo.name!=null"
>
<if
test=
"vo.name!=null"
>
AND s.name LIKE CONCAT('%',#{vo.name},'%')
AND s.name LIKE CONCAT('%',#{vo.name},'%')
</if>
</if>
<if
test=
"vo.entrustTimeStart!=null"
>
<if
test=
"vo.entrustTimeStart!=null"
>
AND e.entrust_time >= #{vo.entrustTimeStart}
AND e.entrust_time >= #{vo.entrustTimeStart}
</if>
</if>
<if
test=
"vo.entrustTimeEnd!=null"
>
<if
test=
"vo.entrustTimeEnd!=null"
>
AND e.entrust_time
<![CDATA[<=]]>
#{vo.entrustTimeEnd}
AND e.entrust_time
<![CDATA[<=]]>
#{vo.entrustTimeEnd}
</if>
</if>
<if
test=
"null!=vo.code"
>
<if
test=
"null!=vo.code"
>
AND s.code LIKE CONCAT('%',#{vo.code},'%')
AND s.code LIKE CONCAT('%',#{vo.code},'%')
...
@@ -203,7 +206,7 @@
...
@@ -203,7 +206,7 @@
JOIN electrolyzer e ON s.electrolyzer_id = e.ID
JOIN electrolyzer e ON s.electrolyzer_id = e.ID
LEFT JOIN ix ix ON ix.entrust_sample_id = s.id
LEFT JOIN ix ix ON ix.entrust_sample_id = s.id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0 and s.name = '原铝'
s.deleted = 0 and e.deleted = 0 and s.name = '原铝'
AND s.type = 0
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
AND EXISTS (
AND EXISTS (
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
...
@@ -255,7 +258,7 @@
...
@@ -255,7 +258,7 @@
entrust_sample_item_index ii
entrust_sample_item_index ii
WHERE
WHERE
i.ID = ii.entrust_sample_item_id
i.ID = ii.entrust_sample_item_id
and ii.name like '%电解质-%'
and ii.name like '%电解质-%'
AND i.deleted = 0
AND i.deleted = 0
AND ii.deleted = 0
AND ii.deleted = 0
and ii.test_value is not null and is_numeric(ii.test_value)
and ii.test_value is not null and is_numeric(ii.test_value)
...
@@ -290,7 +293,7 @@
...
@@ -290,7 +293,7 @@
LEFT JOIN ix ix ON ix.entrust_sample_id = s.id
LEFT JOIN ix ix ON ix.entrust_sample_id = s.id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0
s.deleted = 0 and e.deleted = 0
and s.name = '电解质'
and s.name = '电解质'
AND s.type = 0
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
AND EXISTS (
AND EXISTS (
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
select 1 from entrust_sample_item si where si.deleted = 0 and si.entrust_sample_id = s.id
...
@@ -339,7 +342,7 @@
...
@@ -339,7 +342,7 @@
WHERE
WHERE
i.ID = ii.entrust_sample_item_id
i.ID = ii.entrust_sample_item_id
AND I.TESTER_ID = u.USER_ID
AND I.TESTER_ID = u.USER_ID
--
and ii.name like '%磷生铁-%'
and ii.name like '%磷生铁-%'
AND i.deleted = 0
AND i.deleted = 0
AND ii.deleted = 0
AND ii.deleted = 0
AND ii.test_value is not null and is_numeric(ii.test_value)
AND ii.test_value is not null and is_numeric(ii.test_value)
...
@@ -382,7 +385,7 @@
...
@@ -382,7 +385,7 @@
from entrust_sample s
from entrust_sample s
join pi pi on pi.entrust_sample_id = s.id
join pi pi on pi.entrust_sample_id = s.id
where s.deleted = 0
where s.deleted = 0
AND s.type = 0
group by pi.period
group by pi.period
</select>
</select>
...
...
src/main/resources/mapper/hmhj/StatisticsMapper.xml
View file @
93706d81
...
@@ -11,11 +11,12 @@
...
@@ -11,11 +11,12 @@
FROM
FROM
entrust_sample s,
entrust_sample s,
(
(
SELECT COUNT (1) "total" FROM entrust_sample s WHERE s.deleted = 0 AND s.sample_grading IS NOT NULL
SELECT COUNT (1) "total" FROM entrust_sample s WHERE s.deleted = 0
AND s.type = 0 AND s.sample_grading IS NOT NULL
AND to_char(s.judge_time, 'yyyy-MM-dd') = to_char( now(), 'yyyy-MM-dd')
AND to_char(s.judge_time, 'yyyy-MM-dd') = to_char( now(), 'yyyy-MM-dd')
) A
) A
WHERE
WHERE
s.deleted = 0
s.deleted = 0
AND s.type = 0
AND s.sample_grading IS NOT NULL AND to_char( s.judge_time, 'yyyy-MM-dd' ) = to_char(now(), 'yyyy-MM-dd')
AND s.sample_grading IS NOT NULL AND to_char( s.judge_time, 'yyyy-MM-dd' ) = to_char(now(), 'yyyy-MM-dd')
GROUP BY
GROUP BY
A.total,
A.total,
...
@@ -27,13 +28,13 @@
...
@@ -27,13 +28,13 @@
<!--外委完成量统计-->
<!--外委完成量统计-->
<select
id=
"selectOutTestFinishQuantity"
resultType=
"com.patzn.cloud.service.hmhj.entity.Statistics"
>
<select
id=
"selectOutTestFinishQuantity"
resultType=
"com.patzn.cloud.service.hmhj.entity.Statistics"
>
SELECT
SELECT
count(
1
) "total",
count(
distinct c.id
) "total",
sum(case when s.status = 70 and s.judge_status = 2 then 1 else 0 end) "done_num"
sum(case when s.status = 70 and s.judge_status = 2 then 1 else 0 end) "done_num"
FROM
FROM
contract_sample c, entrust_sample s
contract_sample c, entrust_sample s
WHERE
WHERE
c.deleted = 0 and s.deleted = 0 and c.id = s.contract_sample_id
c.deleted = 0 and s.deleted = 0 and c.id = s.contract_sample_id
and c.type = 1
and c.type = 1
AND s.type = 0
</select>
</select>
<!--本周自产炭块质量统计-->
<!--本周自产炭块质量统计-->
...
@@ -50,14 +51,14 @@
...
@@ -50,14 +51,14 @@
FROM
FROM
entrust_sample s
entrust_sample s
WHERE
WHERE
s.deleted = 0
s.deleted = 0
AND s.type = 0
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND s.NAME = '自产阳极炭块'
AND s.NAME = '自产阳极炭块'
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
AND EXTRACT ( WEEK FROM s.judge_time ) = EXTRACT ( WEEK FROM NOW() )
AND EXTRACT ( WEEK FROM s.judge_time ) = EXTRACT ( WEEK FROM NOW() )
) A
) A
WHERE
WHERE
s.deleted = 0
s.deleted = 0
AND s.type = 0
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND s.NAME = '自产阳极炭块'
AND s.NAME = '自产阳极炭块'
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
...
@@ -78,7 +79,7 @@
...
@@ -78,7 +79,7 @@
FROM
FROM
entrust_sample s
entrust_sample s
WHERE
WHERE
s.deleted = 0
s.deleted = 0
AND s.type = 0
AND s.sample_grading IS NOT NULL
AND s.sample_grading IS NOT NULL
AND s.status = 70 AND s.judge_status = 2
AND s.status = 70 AND s.judge_status = 2
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
AND EXTRACT ( YEAR FROM s.judge_time ) = EXTRACT ( YEAR FROM NOW() )
...
@@ -107,7 +108,7 @@
...
@@ -107,7 +108,7 @@
join entrust_report r on r.entrust_id = e.id
join entrust_report r on r.entrust_id = e.id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0 and r.deleted = 0
s.deleted = 0 and e.deleted = 0 and r.deleted = 0
AND s.status = 70 AND s.judge_status = 2
AND s.status = 70 AND s.judge_status = 2
AND s.type = 0
AND s.judge_time between #{vo.timeS} and #{vo.timeE}
AND s.judge_time between #{vo.timeS} and #{vo.timeE}
) a , (SELECT
) a , (SELECT
count(r.id) "total"
count(r.id) "total"
...
@@ -117,7 +118,7 @@
...
@@ -117,7 +118,7 @@
join entrust_report r on r.entrust_id = e.id
join entrust_report r on r.entrust_id = e.id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0 and r.deleted = 0
s.deleted = 0 and e.deleted = 0 and r.deleted = 0
AND s.status = 70 AND s.judge_status = 2
AND s.status = 70 AND s.judge_status = 2
AND s.type = 0
AND s.judge_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE}
AND s.judge_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE}
) b,
) b,
(SELECT
(SELECT
...
@@ -128,7 +129,7 @@
...
@@ -128,7 +129,7 @@
join entrust_report r on r.entrust_id = e.id
join entrust_report r on r.entrust_id = e.id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0 and r.deleted = 0
s.deleted = 0 and e.deleted = 0 and r.deleted = 0
AND s.status = 70 AND s.judge_status = 2
AND s.status = 70 AND s.judge_status = 2
AND s.type = 0
AND s.judge_time between #{vo.prevTimeS} and #{vo.prevTimeE}
AND s.judge_time between #{vo.prevTimeS} and #{vo.prevTimeE}
) c
) c
...
@@ -144,7 +145,8 @@
...
@@ -144,7 +145,8 @@
join entrust_sample s on s.id = i.entrust_sample_id
join entrust_sample s on s.id = i.entrust_sample_id
join contract_sample c on c.id = s.contract_sample_id
join contract_sample c on c.id = s.contract_sample_id
WHERE
WHERE
i.deleted = 0 and s.deleted = 0 and c.deleted = 0 and c.type = 1
i.deleted = 0 and s.deleted = 0 and c.deleted = 0
and c.type = 1 AND s.type = 0
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
AND i.ctime between #{vo.timeS} and #{vo.timeE}
AND i.ctime between #{vo.timeS} and #{vo.timeE}
</if>
</if>
...
@@ -166,7 +168,7 @@
...
@@ -166,7 +168,7 @@
entrust_sample s
entrust_sample s
join entrust e on e.id = s.entrust_id
join entrust e on e.id = s.entrust_id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0
s.deleted = 0 and e.deleted = 0
AND s.type = 0
AND e.entrust_time between #{vo.timeS} and #{vo.timeE}
AND e.entrust_time between #{vo.timeS} and #{vo.timeE}
) a ,
) a ,
(SELECT
(SELECT
...
@@ -174,8 +176,8 @@
...
@@ -174,8 +176,8 @@
FROM
FROM
entrust_sample s
entrust_sample s
join entrust e on e.id = s.entrust_id
join entrust e on e.id = s.entrust_id
WHERE s.deleted = 0 and e.deleted = 0
WHERE s.deleted = 0 and e.deleted = 0
AND s.type = 0
AND s.entrust_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE}
AND s.entrust_time between #{vo.lastYearTimeS} and #{vo.lastYearTimeE}
) b,
) b,
(SELECT
(SELECT
count(s.id) "total"
count(s.id) "total"
...
@@ -183,7 +185,7 @@
...
@@ -183,7 +185,7 @@
entrust_sample s
entrust_sample s
join entrust e on e.id = s.entrust_id
join entrust e on e.id = s.entrust_id
WHERE
WHERE
s.deleted = 0 and e.deleted = 0
s.deleted = 0 and e.deleted = 0
AND s.type = 0
AND s.entrust_time between #{vo.prevTimeS} and #{vo.prevTimeE}
AND s.entrust_time between #{vo.prevTimeS} and #{vo.prevTimeE}
) c
) c
</select>
</select>
...
@@ -197,7 +199,7 @@
...
@@ -197,7 +199,7 @@
entrust_sample_item i
entrust_sample_item i
join entrust_sample s on s.id = i.entrust_sample_id
join entrust_sample s on s.id = i.entrust_sample_id
WHERE
WHERE
i.deleted = 0 and s.deleted = 0
i.deleted = 0 and s.deleted = 0
AND s.type = 0
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
AND i.ctime between #{vo.timeS} and #{vo.timeE}
AND i.ctime between #{vo.timeS} and #{vo.timeE}
</if>
</if>
...
@@ -216,7 +218,7 @@
...
@@ -216,7 +218,7 @@
entrust e
entrust e
join entrust_report r on r.entrust_id = e.id
join entrust_report r on r.entrust_id = e.id
WHERE
WHERE
e.deleted = 0 and r.deleted = 0 and r.status = 50
e.deleted = 0 and r.deleted = 0
AND s.type = 0
and r.status = 50
<if
test=
"null != vo.timeS and null != vo.timeE"
>
<if
test=
"null != vo.timeS and null != vo.timeE"
>
AND r.report_check_time between #{vo.timeS} and #{vo.timeE}
AND r.report_check_time between #{vo.timeS} and #{vo.timeE}
</if>
</if>
...
@@ -270,8 +272,7 @@
...
@@ -270,8 +272,7 @@
ENTRUST E
ENTRUST E
JOIN ENTRUST_SAMPLE S ON S.entrust_id = E.ID
JOIN ENTRUST_SAMPLE S ON S.entrust_id = E.ID
WHERE
WHERE
E.deleted = 0
E.deleted = 0 AND S.deleted = 0 AND s.type = 0
AND S.deleted = 0
AND S.NAME IN ( '电解质', '硅铁', '磷铁', '锰铁', '水', '纯铝', '铝合金', '石灰石' )
AND S.NAME IN ( '电解质', '硅铁', '磷铁', '锰铁', '水', '纯铝', '铝合金', '石灰石' )
GROUP BY
GROUP BY
s.NAME ORDER BY S.NAME
s.NAME ORDER BY S.NAME
...
...
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