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
1a759b9e
Commit
1a759b9e
authored
Aug 13, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加接口保存合同用户所属期数;
添加接口合同相关暂停功能; 添加功能质量判定自动计算牌号(仅限原铝); 添加自动合并提交报告(报告签收、报告发放)自动汇入电子档案,不再手动质量判定; 添加合同相关字段;
parent
aaee09c6
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
170 additions
and
34 deletions
+170
-34
ContractSampleController.java
...ervice/lims/hmhj/controller/ContractSampleController.java
+12
-0
EntrustSampleItemMapper.java
...oud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
+3
-0
IContractSampleService.java
...oud/service/lims/hmhj/service/IContractSampleService.java
+2
-0
IEntrustReportService.java
...loud/service/lims/hmhj/service/IEntrustReportService.java
+2
-0
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+4
-0
ContractSampleServiceImpl.java
...ice/lims/hmhj/service/impl/ContractSampleServiceImpl.java
+24
-2
EntrustReportServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustReportServiceImpl.java
+16
-10
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+28
-0
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+3
-3
UserInfoServiceImpl.java
...d/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
+1
-1
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+16
-14
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+39
-0
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+4
-4
20210813新增字段.sql
src/test/java/resources/db_sql/hmhj/v152/20210813新增字段.sql
+16
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/ContractSampleController.java
View file @
1a759b9e
...
@@ -11,6 +11,7 @@ import com.patzn.cloud.service.hmhj.entity.ContractSample;
...
@@ -11,6 +11,7 @@ import com.patzn.cloud.service.hmhj.entity.ContractSample;
import
com.patzn.cloud.service.hmhj.enums.ContractSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.enums.ContractSampleStatusEnum
;
import
com.patzn.cloud.service.hmhj.vo.ContractSampleVO
;
import
com.patzn.cloud.service.hmhj.vo.ContractSampleVO
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleService
;
import
com.patzn.cloud.service.lims.hmhj.service.IContractSampleService
;
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
;
...
@@ -36,6 +37,9 @@ public class ContractSampleController extends ServiceController {
...
@@ -36,6 +37,9 @@ public class ContractSampleController extends ServiceController {
@Autowired
@Autowired
private
IContractSampleService
contractSampleService
;
private
IContractSampleService
contractSampleService
;
@Autowired
private
UserInfoServiceImpl
userInfoService
;
@ApiOperation
(
"分页列表"
)
@ApiOperation
(
"分页列表"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
@@ -377,6 +381,7 @@ public class ContractSampleController extends ServiceController {
...
@@ -377,6 +381,7 @@ public class ContractSampleController extends ServiceController {
@ApiOperation
(
"添加"
)
@ApiOperation
(
"添加"
)
@PostMapping
(
"/"
)
@PostMapping
(
"/"
)
public
RestResult
<
Boolean
>
add
(
ContractSample
contractSample
)
{
public
RestResult
<
Boolean
>
add
(
ContractSample
contractSample
)
{
contractSample
.
setPeriod
(
userInfoService
.
getUserPeriod
(
getAccount
()));
return
success
(
contractSampleService
.
save
(
contractSample
));
return
success
(
contractSampleService
.
save
(
contractSample
));
}
}
...
@@ -384,6 +389,7 @@ public class ContractSampleController extends ServiceController {
...
@@ -384,6 +389,7 @@ public class ContractSampleController extends ServiceController {
@ApiOperation
(
"添加"
)
@ApiOperation
(
"添加"
)
@PostMapping
(
"/add_contract_sample"
)
@PostMapping
(
"/add_contract_sample"
)
public
RestResult
<
Boolean
>
addDTO
(
@RequestBody
ContractSampleDTO
dto
)
{
public
RestResult
<
Boolean
>
addDTO
(
@RequestBody
ContractSampleDTO
dto
)
{
dto
.
setPeriod
(
userInfoService
.
getUserPeriod
(
getAccount
()));
return
success
(
contractSampleService
.
addDTO
(
dto
));
return
success
(
contractSampleService
.
addDTO
(
dto
));
}
}
...
@@ -577,4 +583,10 @@ public class ContractSampleController extends ServiceController {
...
@@ -577,4 +583,10 @@ public class ContractSampleController extends ServiceController {
return
success
(
contractSampleService
.
updateContractBatch
(
ids
,
contractSample
,
getAccount
()));
return
success
(
contractSampleService
.
updateContractBatch
(
ids
,
contractSample
,
getAccount
()));
}
}
@ApiOperation
(
"暂停、启动服务"
)
@PostMapping
(
"/suspendOrContinue"
)
public
RestResult
<
Boolean
>
suspendOrContinue
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"suspend"
)
Integer
suspend
)
{
return
success
(
contractSampleService
.
updateSuspendOrContinue
(
ids
,
suspend
,
getAccount
()));
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
View file @
1a759b9e
...
@@ -78,4 +78,7 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
...
@@ -78,4 +78,7 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
boolean
updateForRevokeRemovedItems
(
@Param
(
"ids"
)
Long
[]
ids
);
boolean
updateForRevokeRemovedItems
(
@Param
(
"ids"
)
Long
[]
ids
);
List
<
EntrustSampleItemVO
>
selectItemFillProgress
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleItemVO
itemVO
);
List
<
EntrustSampleItemVO
>
selectItemFillProgress
(
RowBounds
rowBounds
,
@Param
(
"vo"
)
EntrustSampleItemVO
itemVO
);
@SqlParser
(
filter
=
true
)
boolean
updateSampleRetakeInfoByEntrustId
(
@Param
(
"entrustId"
)
Long
entrustId
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IContractSampleService.java
View file @
1a759b9e
...
@@ -76,4 +76,6 @@ public interface IContractSampleService extends IBaseService<ContractSample> {
...
@@ -76,4 +76,6 @@ public interface IContractSampleService extends IBaseService<ContractSample> {
boolean
batchImport
(
MultipartFile
file
,
Account
account
);
boolean
batchImport
(
MultipartFile
file
,
Account
account
);
boolean
updateContractBatch
(
Long
[]
ids
,
ContractSample
contractSample
,
Account
account
);
boolean
updateContractBatch
(
Long
[]
ids
,
ContractSample
contractSample
,
Account
account
);
boolean
updateSuspendOrContinue
(
Long
[]
ids
,
Integer
suspend
,
Account
account
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustReportService.java
View file @
1a759b9e
...
@@ -61,4 +61,6 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
...
@@ -61,4 +61,6 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
void
downloadExcel
(
Long
id
,
HttpServletResponse
response
);
void
downloadExcel
(
Long
id
,
HttpServletResponse
response
);
void
changeExcelReportToPdf
(
Long
[]
ids
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
1a759b9e
...
@@ -113,4 +113,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
...
@@ -113,4 +113,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean
revokeRemovedItem
(
Long
[]
ids
);
boolean
revokeRemovedItem
(
Long
[]
ids
);
Page
<
EntrustSampleItemVO
>
getItemFillProgressQuery
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
itemVO
);
Page
<
EntrustSampleItemVO
>
getItemFillProgressQuery
(
Page
<
EntrustSampleItemVO
>
page
,
EntrustSampleItemVO
itemVO
);
boolean
updateQualityJudgeFlow
(
Long
[]
ids
,
Account
account
);
boolean
updateSampleRetakeByEntrustId
(
Long
entrustId
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/ContractSampleServiceImpl.java
View file @
1a759b9e
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
package
com
.
patzn
.
cloud
.
service
.
lims
.
hmhj
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.mapper.Condition
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.EntityWrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
import
com.baomidou.mybatisplus.mapper.Wrapper
;
...
@@ -8,7 +7,6 @@ import com.baomidou.mybatisplus.plugins.Page;
...
@@ -8,7 +7,6 @@ import com.baomidou.mybatisplus.plugins.Page;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.toolkit.CollectionUtils
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.exception.PatznException
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.service.hmhj.dto.ContractSampleDTO
;
import
com.patzn.cloud.service.hmhj.dto.ContractSampleDTO
;
import
com.patzn.cloud.service.hmhj.dto.ContractSampleVODTO
;
import
com.patzn.cloud.service.hmhj.dto.ContractSampleVODTO
;
...
@@ -43,6 +41,7 @@ import java.util.ArrayList;
...
@@ -43,6 +41,7 @@ import java.util.ArrayList;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -99,10 +98,23 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
...
@@ -99,10 +98,23 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
}
private
void
judgePauseStatus
(
Long
[]
ids
)
{
List
<
ContractSample
>
contractSamples
=
getBatchIds
(
Arrays
.
asList
(
ids
));
AtomicReference
<
String
>
contractCodeAtomic
=
new
AtomicReference
<>();
RestAssert
.
fail
(
contractSamples
.
stream
().
anyMatch
(
t
->
{
if
(
1
==
t
.
getSuspend
())
{
contractCodeAtomic
.
set
(
t
.
getCode
());
return
true
;
}
return
false
;
}),
String
.
format
(
"编号为【%s】的记录处于暂停状态,无法继续操作。"
,
contractCodeAtomic
.
get
()));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
public
boolean
submitToStoreTransport
(
Long
[]
ids
,
Account
account
)
{
public
boolean
submitToStoreTransport
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
judgePauseStatus
(
ids
);
ContractSample
contractSample
=
new
ContractSample
();
ContractSample
contractSample
=
new
ContractSample
();
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
STORE_TRANSPORT
);
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
STORE_TRANSPORT
);
contractSample
.
setProgress
(
ContractSampleStatusEnum
.
STORE_TRANSPORT
);
contractSample
.
setProgress
(
ContractSampleStatusEnum
.
STORE_TRANSPORT
);
...
@@ -116,6 +128,7 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
...
@@ -116,6 +128,7 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
@Override
@Override
public
boolean
submitToProTechCheck
(
Long
[]
ids
,
Account
account
)
{
public
boolean
submitToProTechCheck
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
judgePauseStatus
(
ids
);
List
<
ContractSample
>
contractSamples
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
ContractSample
>
contractSamples
=
getBatchIds
(
Arrays
.
asList
(
ids
));
RestAssert
.
fail
(
contractSamples
.
stream
().
anyMatch
(
t
->
null
==
t
.
getType
()),
"检测类型为空"
);
RestAssert
.
fail
(
contractSamples
.
stream
().
anyMatch
(
t
->
null
==
t
.
getType
()),
"检测类型为空"
);
ContractSample
contractSample
=
new
ContractSample
();
ContractSample
contractSample
=
new
ContractSample
();
...
@@ -131,6 +144,7 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
...
@@ -131,6 +144,7 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
@Override
@Override
public
boolean
proTechCheckPass
(
Long
[]
ids
,
Account
account
)
{
public
boolean
proTechCheckPass
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
RestAssert
.
fail
(
ArrayUtils
.
isEmpty
(
ids
),
"请选择要提交的合同!"
);
judgePauseStatus
(
ids
);
ContractSample
contractSample
=
new
ContractSample
();
ContractSample
contractSample
=
new
ContractSample
();
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_REG
);
contractSample
.
setStatus
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_REG
);
contractSample
.
setProgress
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_REG
);
contractSample
.
setProgress
(
ContractSampleStatusEnum
.
CHECK_ACCEPT_REG
);
...
@@ -546,4 +560,12 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
...
@@ -546,4 +560,12 @@ public class ContractSampleServiceImpl extends BaseServiceImpl<ContractSampleMap
return
baseMapper
.
update
(
contractSample
,
Condition
.
create
().
in
(
"id"
,
ids
))
>
0
;
return
baseMapper
.
update
(
contractSample
,
Condition
.
create
().
in
(
"id"
,
ids
))
>
0
;
}
}
@Override
public
boolean
updateSuspendOrContinue
(
Long
[]
ids
,
Integer
suspendInt
,
Account
account
)
{
int
suspend
=
null
==
suspendInt
?
0
:
suspendInt
;
String
suspendStr
=
1
==
suspend
?
"暂停"
:
"启动"
;
RestAssert
.
fail
(
null
==
ids
||
ids
.
length
==
0
,
String
.
format
(
"请选择要%s的记录"
,
suspendStr
));
return
update
(
new
ContractSample
().
setSuspend
(
suspend
),
Condition
.
create
().
in
(
"id"
,
ids
));
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustReportServiceImpl.java
View file @
1a759b9e
...
@@ -171,7 +171,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -171,7 +171,8 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
return
doExecuteSubmit
(
ids
,
EntrustFlowEnum
.
REPORT_MAKE
,
EntrustFlowEnum
.
REPORT_CHECK
,
account
);
return
doExecuteSubmit
(
ids
,
EntrustFlowEnum
.
REPORT_MAKE
,
EntrustFlowEnum
.
REPORT_CHECK
,
account
);
}
}
private
void
changeExcelReportToPdf
(
Long
[]
ids
)
{
@Override
public
void
changeExcelReportToPdf
(
Long
[]
ids
)
{
List
<
EntrustReport
>
reportList
=
list
(
Condition
.
create
().
in
(
"id"
,
ids
).
isNotNull
(
"object_key"
));
List
<
EntrustReport
>
reportList
=
list
(
Condition
.
create
().
in
(
"id"
,
ids
).
isNotNull
(
"object_key"
));
if
(
CollectionUtils
.
isEmpty
(
reportList
))
{
if
(
CollectionUtils
.
isEmpty
(
reportList
))
{
return
;
return
;
...
@@ -243,7 +244,6 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -243,7 +244,6 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
}
}
}
// 此处只转换报告相关的状态
// 此处只转换报告相关的状态
EntrustSampleStatusEnum
sampleStatusEnum
=
EntrustFlowUtils
.
getSampleStatus
(
toFlowStatus
);
EntrustSampleStatusEnum
sampleStatusEnum
=
EntrustFlowUtils
.
getSampleStatus
(
toFlowStatus
);
EntrustReportStatusEnum
reportStatusEnum
=
EntrustFlowUtils
.
getReportStatus
(
toFlowStatus
);
EntrustReportStatusEnum
reportStatusEnum
=
EntrustFlowUtils
.
getReportStatus
(
toFlowStatus
);
...
@@ -252,6 +252,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -252,6 +252,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
entrustReport
.
setStatus
(
reportStatusEnum
);
entrustReport
.
setStatus
(
reportStatusEnum
);
entrustReport
.
setProgress
(
reportStatusEnum
);
entrustReport
.
setProgress
(
reportStatusEnum
);
// 质量判定标志
boolean
executeJudgeFlag
=
false
;
if
(
toFlowStatus
==
EntrustFlowEnum
.
REPORT_ALLOW
)
{
if
(
toFlowStatus
==
EntrustFlowEnum
.
REPORT_ALLOW
)
{
entrustReport
.
setReportChecker
(
account
.
getUserName
()).
setReportCheckerId
(
account
.
getUserId
()).
setReportCheckTime
(
new
Date
());
entrustReport
.
setReportChecker
(
account
.
getUserName
()).
setReportCheckerId
(
account
.
getUserId
()).
setReportCheckTime
(
new
Date
());
}
else
if
(
toFlowStatus
==
EntrustFlowEnum
.
REPORT_ISSUE
||
toFlowStatus
==
EntrustFlowEnum
.
REPORT_SEND
)
{
}
else
if
(
toFlowStatus
==
EntrustFlowEnum
.
REPORT_ISSUE
||
toFlowStatus
==
EntrustFlowEnum
.
REPORT_SEND
)
{
...
@@ -278,6 +281,9 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -278,6 +281,9 @@ 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
);
toFlowStatus
=
EntrustFlowEnum
.
ARCHIVES
;
toFlowStatus
=
EntrustFlowEnum
.
ARCHIVES
;
}
else
{
// 需要质量判定,直接走质量判定
executeJudgeFlag
=
true
;
}
}
}
else
{
}
else
{
// == 若为归档,可以直接设置已归档
// == 若为归档,可以直接设置已归档
...
@@ -305,7 +311,11 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -305,7 +311,11 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
}
}
// 更新报告状态
// 更新报告状态
return
super
.
update
(
entrustReport
,
Condition
.
create
().
in
(
"id"
,
ids
));
boolean
result
=
super
.
update
(
entrustReport
,
Condition
.
create
().
in
(
"id"
,
ids
));
if
(!
executeJudgeFlag
)
{
return
result
;
}
return
entrustSampleItemService
.
updateQualityJudgeFlow
(
sampleIds
.
toArray
(
new
Long
[
sampleIds
.
size
()]),
account
);
}
}
private
List
<
Long
>
getSampleIds
(
Long
[]
reportIds
)
{
private
List
<
Long
>
getSampleIds
(
Long
[]
reportIds
)
{
...
@@ -324,7 +334,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -324,7 +334,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
if
(
null
!=
flowStatus
)
{
if
(
null
!=
flowStatus
)
{
toFlowStatus
=
flowStatus
;
toFlowStatus
=
flowStatus
;
// 若驳回的状态不在报告状态范围内
// 若驳回的状态不在报告状态范围内
if
(
flowStatus
.
getValue
()
.
intValue
()
<
8
)
{
if
(
flowStatus
.
getValue
()
<
8
)
{
// 对应样品状态
// 对应样品状态
EntrustSampleStatusEnum
sampleStatusEnum
=
EntrustFlowUtils
.
getSampleStatus
(
toFlowStatus
);
EntrustSampleStatusEnum
sampleStatusEnum
=
EntrustFlowUtils
.
getSampleStatus
(
toFlowStatus
);
...
@@ -342,9 +352,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -342,9 +352,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
!
sampleIds
.
contains
(
t
.
getId
())
!
sampleIds
.
contains
(
t
.
getId
())
).
collect
(
Collectors
.
toList
());
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
filterList
)
||
filterList
.
stream
().
noneMatch
(
t
->
{
if
(
CollectionUtils
.
isEmpty
(
filterList
)
||
filterList
.
stream
().
noneMatch
(
t
->
(
int
)
t
.
getStatus
().
getValue
()
>
(
int
)
sampleStatusEnum
.
getValue
()))
{
return
(
int
)
t
.
getStatus
().
getValue
()
>
(
int
)
sampleStatusEnum
.
getValue
();
}))
{
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrustService
.
updateById
(
entrust
);
entrustService
.
updateById
(
entrust
);
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
...
@@ -405,9 +413,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
...
@@ -405,9 +413,7 @@ public class EntrustReportServiceImpl extends BaseServiceImpl<EntrustReportMappe
!
sampleIds
.
contains
(
t
.
getId
())
!
sampleIds
.
contains
(
t
.
getId
())
).
collect
(
Collectors
.
toList
());
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
filterList
)
||
filterList
.
stream
().
noneMatch
(
t
->
{
if
(
CollectionUtils
.
isEmpty
(
filterList
)
||
filterList
.
stream
().
noneMatch
(
t
->
(
int
)
t
.
getStatus
().
getValue
()
>
(
int
)
finalSampleStatusEnum
.
getValue
()))
{
return
(
int
)
t
.
getStatus
().
getValue
()
>
(
int
)
finalSampleStatusEnum
.
getValue
();
}))
{
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrustService
.
updateById
(
entrust
);
entrustService
.
updateById
(
entrust
);
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
entrust
.
setFlowStatus
(
toFlowStatus
.
getName
());
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
1a759b9e
...
@@ -383,6 +383,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -383,6 +383,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 提交后执行组合判定
// 提交后执行组合判定
executor1
.
execute
(()
->
updateComposeJudgeByTestValue
(
entrustId
));
executor1
.
execute
(()
->
updateComposeJudgeByTestValue
(
entrustId
));
// 处理原铝是否重取
executor1
.
execute
(()
->
updateSampleRetakeByEntrustId
(
entrustId
));
return
true
;
return
true
;
}
}
...
@@ -1121,6 +1124,11 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1121,6 +1124,11 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
StringUtils
.
isBlank
(
value
)
?
""
:
value
.
trim
();
return
StringUtils
.
isBlank
(
value
)
?
""
:
value
.
trim
();
}
}
/**
* 牌号处理
*
* @param ids
*/
private
void
handleSampleBrand
(
Long
[]
ids
)
{
private
void
handleSampleBrand
(
Long
[]
ids
)
{
if
(
null
==
ids
||
0
==
ids
.
length
)
{
if
(
null
==
ids
||
0
==
ids
.
length
)
{
return
;
return
;
...
@@ -1219,6 +1227,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1219,6 +1227,9 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
}
}
if
(
CollectionUtils
.
isNotEmpty
(
reportList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
reportList
))
{
entrustReportService
.
updateBatchById
(
reportList
);
entrustReportService
.
updateBatchById
(
reportList
);
Long
[]
reportIds
=
reportList
.
stream
().
map
(
EntrustReport:
:
getId
).
collect
(
Collectors
.
toList
()).
toArray
(
new
Long
[
reportList
.
size
()]);
// 重新生成pdf文件
entrustReportService
.
changeExcelReportToPdf
(
reportIds
);
}
}
}
}
...
@@ -1469,6 +1480,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1469,6 +1480,15 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
page
.
setRecords
(
baseMapper
.
selectItemFillProgress
(
page
,
itemVO
));
return
page
.
setRecords
(
baseMapper
.
selectItemFillProgress
(
page
,
itemVO
));
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
updateQualityJudgeFlow
(
Long
[]
ids
,
Account
account
)
{
// 质量判定
updateQualityJudge
(
ids
,
account
);
// 提交至电子档案(包含验收结果数据录入)
return
entrustSampleService
.
submitToAcceptanceResultInput
(
ids
,
account
);
}
/**
/**
* 处理 原铝等标准为
* 处理 原铝等标准为
*/
*/
...
@@ -1509,4 +1529,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1509,4 +1529,12 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
updateBatchById
(
updateItems
);
updateBatchById
(
updateItems
);
}
}
}
}
@Override
public
boolean
updateSampleRetakeByEntrustId
(
Long
entrustId
)
{
if
(
null
==
entrustId
)
{
return
false
;
}
return
baseMapper
.
updateSampleRetakeInfoByEntrustId
(
entrustId
);
}
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
1a759b9e
...
@@ -287,8 +287,8 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -287,8 +287,8 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
AlTasteStatsVO
curr
=
list
.
get
(
i
);
AlTasteStatsVO
curr
=
list
.
get
(
i
);
// 以【分厂
+厂房
】作为获取上一条记录的KEY
// 以【分厂】作为获取上一条记录的KEY
String
key
=
curr
.
getBranch
()
+
curr
.
getPlant
()
;
String
key
=
curr
.
getBranch
();
// 是否存在同KEY数据
// 是否存在同KEY数据
if
(
dataMap
.
containsKey
(
key
))
{
if
(
dataMap
.
containsKey
(
key
))
{
List
<
AlTasteStatsVO
>
voList
=
dataMap
.
get
(
key
);
List
<
AlTasteStatsVO
>
voList
=
dataMap
.
get
(
key
);
...
@@ -306,7 +306,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -306,7 +306,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
// 是否需要取出数据处理
// 是否需要取出数据处理
if
(
i
>
0
)
{
if
(
i
>
0
)
{
AlTasteStatsVO
prev
=
list
.
get
(
i
-
1
);
AlTasteStatsVO
prev
=
list
.
get
(
i
-
1
);
List
<
AlTasteStatsVO
>
voList
=
dataMap
.
get
(
prev
.
getBranch
()
+
prev
.
getPlant
()
);
List
<
AlTasteStatsVO
>
voList
=
dataMap
.
get
(
prev
.
getBranch
());
// 将列表数据加入集合中
// 将列表数据加入集合中
resultList
.
addAll
(
voList
);
resultList
.
addAll
(
voList
);
// 将统计数据加入集合中
// 将统计数据加入集合中
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/UserInfoServiceImpl.java
View file @
1a759b9e
...
@@ -140,7 +140,7 @@ public class UserInfoServiceImpl {
...
@@ -140,7 +140,7 @@ public class UserInfoServiceImpl {
public
List
<
SysUser
>
getUsersByOrg
(
Long
orgId
)
{
public
List
<
SysUser
>
getUsersByOrg
(
Long
orgId
)
{
RestAssert
.
fail
(
null
==
orgId
,
"组织ID为空"
);
RestAssert
.
fail
(
null
==
orgId
,
"组织ID为空"
);
return
sysUserClient
.
getListByOrgId
(
orgId
,
null
).
service
Data
();
return
sysUserClient
.
getListByOrgId
(
orgId
,
""
).
get
Data
();
}
}
...
...
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
1a759b9e
...
@@ -117,15 +117,12 @@
...
@@ -117,15 +117,12 @@
<select
id=
"selectVOList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
<select
id=
"selectVOList"
resultType=
"com.patzn.cloud.service.hmhj.vo.EntrustVO"
>
SELECT e.*
with sample as (
FROM entrust e
select s.* from (
WHERE e.deleted = 0
select s.*,row_number() over(partition by s.entrust_id order by s.id asc) "rn" from entrust_sample s where s.deleted = 0 and s.type = 0
<include
refid=
"basicCondition"
/>
<if
test=
"null != vo.sampleStatus"
>
<if
test=
"null != vo.sampleStatus"
>
AND exists (
and s.status = #{vo.sampleStatus}
select 1 from entrust_sample s where s.deleted = 0
</if>
and s.entrust_id = e.id and s.type = 0 and s.status = #{vo.sampleStatus}
<if
test=
"null != vo.judgeStatus"
>
<if
test=
"null != vo.judgeStatus"
>
and s.judge_status = #{vo.judgeStatus}
and s.judge_status = #{vo.judgeStatus}
</if>
</if>
...
@@ -135,14 +132,19 @@
...
@@ -135,14 +132,19 @@
#{judgeStatus}
#{judgeStatus}
</foreach>
</foreach>
</if>
</if>
)
</if>
<if
test=
"null != vo.notSampleStatus"
>
<if
test=
"null != vo.notSampleStatus"
>
AND exists (
and s.status != #{vo.notSampleStatus}
select 1 from entrust_sample s where s.deleted = 0
</if>
and s.entrust_id = e.id and s.status != #{vo.notSampleStatus}
) s where s.rn = 1
)
)
SELECT e.*,s.sample_from
FROM entrust e
JOIN sample s on s.entrust_id = e.id
WHERE e.deleted = 0
<include
refid=
"basicCondition"
/>
<if
test=
"null != vo.sampleName"
>
AND e.sample_name like concat('%',#{vo.sampleName},'%')
</if>
</if>
<if
test=
"null != vo.itemStatus"
>
<if
test=
"null != vo.itemStatus"
>
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
1a759b9e
...
@@ -757,4 +757,43 @@
...
@@ -757,4 +757,43 @@
#{itemId}
#{itemId}
</foreach>
</foreach>
</update>
</update>
<!--根据委托ID更新样品的重取状态-->
<update
id=
"updateSampleRetakeInfoByEntrustId"
>
update entrust_sample s
set retake = c.retake
from (
with curr as (
select
s.code,s.slot_no || i.name "slot_name",x.name,i.test_time,x.test_value
from entrust_sample s
join entrust_sample_item i on i.entrust_sample_id = s.id
join entrust_sample_item_index x on x.entrust_sample_item_id = i.id
where s.deleted = 0 and i.deleted = 0 and x.deleted = 0
and s.entrust_id = #{entrustId} and s.name = '原铝' and
(x.name = '原铝Fe' or x.name = '原铝Si')
)
select
curr.code "sample_code",
max(case when curr.name = '原铝Fe' and abs(to_number(curr.test_value,'9.9999') - to_number(prev.test_value,'9.9999')) >= 0.04 then 1
when curr.name = '原铝Si' and abs(to_number(curr.test_value,'9.9999') - to_number(prev.test_value,'9.9999')) >= 0.02 then 1
else 0 end
) "retake"
from (
select
s.code,s.slot_no || i.name "slot_name",i.test_time,ix.test_value,
row_number() over(partition by s.slot_no,ix.name order by i.test_time desc) "rn"
from entrust_sample s
join entrust_sample_item i on i.entrust_sample_id = s.id
join entrust_sample_item_index ix on ix.entrust_sample_item_id = i.id
where s.deleted = 0 and i.deleted = 0 and ix.deleted = 0
and s.name = '原铝' and s.slot_no is not null and i.test_time is not null
and (ix.name = '原铝Fe' or ix.name = '原铝Si')
and s.entrust_id != #{entrustId}
) prev join curr on curr.slot_name = prev.slot_name
where prev.rn = 1
group by curr.code
order by curr.code asc
) c where c.sample_code = s.code and s.entrust_id = #{entrustId} and s.name = '原铝'
</update>
</mapper>
</mapper>
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
1a759b9e
...
@@ -202,18 +202,18 @@
...
@@ -202,18 +202,18 @@
COUNT ( 1 ) "total",
COUNT ( 1 ) "total",
( CASE WHEN COUNT ( 1 ) / ${vo.days} > 1 THEN ( COUNT ( 1 ) / (${vo.days} / 2) ) ELSE 1 END ) "slots_num",
( CASE WHEN COUNT ( 1 ) / ${vo.days} > 1 THEN ( COUNT ( 1 ) / (${vo.days} / 2) ) ELSE 1 END ) "slots_num",
sum(ix.al_85_num) "al_85_num",
sum(ix.al_85_num) "al_85_num",
round(coalesce(sum(ix.al_85_num),0)
/ COUNT ( 1 ),4
) "al_85_per",
round(coalesce(sum(ix.al_85_num),0)
* 1.0 / COUNT ( 1 ),2
) "al_85_per",
round(coalesce(sum(ix.al_85_num),0) / (${vo.days} / 2)) "al_85_slots_num",
round(coalesce(sum(ix.al_85_num),0) / (${vo.days} / 2)) "al_85_slots_num",
sum(ix.al_70_num) "al_70_num",
sum(ix.al_70_num) "al_70_num",
round(coalesce(sum(ix.al_70_num),0)
/ COUNT ( 1 ),4
) "al_70_per",
round(coalesce(sum(ix.al_70_num),0)
* 1.0 / COUNT ( 1 ),2
) "al_70_per",
round(coalesce(sum(ix.al_70_num),0) / (${vo.days} / 2)) "al_70_slots_num",
round(coalesce(sum(ix.al_70_num),0) / (${vo.days} / 2)) "al_70_slots_num",
sum(ix.fe_10_num) "fe_10_num",
sum(ix.fe_10_num) "fe_10_num",
round(coalesce(sum(ix.fe_10_num),0)
/ COUNT ( 1 ),4
) "fe_10_per",
round(coalesce(sum(ix.fe_10_num),0)
* 1.0 / COUNT ( 1 ),2
) "fe_10_per",
round(coalesce(sum(ix.fe_10_num),0) / (${vo.days} / 2)) "fe_10_slots_num",
round(coalesce(sum(ix.fe_10_num),0) / (${vo.days} / 2)) "fe_10_slots_num",
sum(ix.fe_08_num) "fe_08_num",
sum(ix.fe_08_num) "fe_08_num",
round(coalesce(sum(ix.fe_08_num),0)
/ COUNT ( 1 ),4
) "fe_08_per",
round(coalesce(sum(ix.fe_08_num),0)
* 1.0 / COUNT ( 1 ),2
) "fe_08_per",
round(coalesce(sum(ix.fe_08_num),0) / (${vo.days} / 2)) "fe_08_slots_num"
round(coalesce(sum(ix.fe_08_num),0) / (${vo.days} / 2)) "fe_08_slots_num"
FROM
FROM
entrust_sample s
entrust_sample s
...
...
src/test/java/resources/db_sql/hmhj/v152/20210813新增字段.sql
0 → 100644
View file @
1a759b9e
/** created by meazty on 2021/8/13 17:34 **/
/** created by meazty on 2021/8/13 17:34 **/
ALTER
TABLE
"public"
.
"entrust_sample"
ADD
COLUMN
"retake"
varchar
(
32
)
COLLATE
"pg_catalog"
.
"default"
;
COMMENT
ON
COLUMN
"public"
.
"entrust_sample"
.
"retake"
IS
'原铝是否重取'
;
ALTER
TABLE
"public"
.
"contract_sample"
ADD
COLUMN
"suspend"
int2
,
ADD
COLUMN
"period"
varchar
(
32
)
COLLATE
"pg_catalog"
.
"default"
;
COMMENT
ON
COLUMN
"public"
.
"contract_sample"
.
"suspend"
IS
'是否暂停'
;
COMMENT
ON
COLUMN
"public"
.
"contract_sample"
.
"period"
IS
'期数'
;
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