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
0a78cc40
Commit
0a78cc40
authored
Jul 30, 2021
by
ghxdhr
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.patzn.com:wangweidong/patzn-cloud-service-hmhj
parents
92ef9a59
3c0833f2
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
210 additions
and
33 deletions
+210
-33
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+14
-12
EntrustSampleItemMapper.java
...oud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
+1
-0
EntrustSampleMapper.java
...n/cloud/service/lims/hmhj/mapper/EntrustSampleMapper.java
+2
-0
IEntrustReportService.java
...loud/service/lims/hmhj/service/IEntrustReportService.java
+1
-0
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+2
-1
IEntrustSampleService.java
...loud/service/lims/hmhj/service/IEntrustSampleService.java
+2
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+2
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+14
-4
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+9
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+42
-14
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+32
-2
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+33
-0
EntrustSampleMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
+56
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
0a78cc40
...
@@ -2,29 +2,24 @@ package com.patzn.cloud.service.lims.hmhj.controller;
...
@@ -2,29 +2,24 @@ package com.patzn.cloud.service.lims.hmhj.controller;
import
com.baomidou.kisso.annotation.Action
;
import
com.baomidou.kisso.annotation.Action
;
import
com.baomidou.kisso.annotation.Login
;
import
com.baomidou.kisso.annotation.Login
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.hmhj.dto.EntrustDTO
;
import
com.patzn.cloud.service.hmhj.dto.EntrustDTO
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.enums.*
;
import
com.patzn.cloud.service.hmhj.enums.*
;
import
com.patzn.cloud.service.hmhj.vo.EntrustVO
;
import
com.patzn.cloud.service.hmhj.vo.EntrustVO
;
import
com.patzn.cloud.service.lims.hmhj.service.impl.UserInfoServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.plugins.Page
;
import
com.patzn.cloud.commons.api.RestConstants
;
import
com.patzn.cloud.commons.api.RestResult
;
import
com.patzn.cloud.commons.controller.ServiceController
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
import
com.patzn.cloud.service.lims.hmhj.service.IEntrustService
;
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
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -336,6 +331,11 @@ public class EntrustController extends ServiceController {
...
@@ -336,6 +331,11 @@ public class EntrustController extends ServiceController {
return
success
(
entrustService
.
rejectToPrevNode
(
id
,
reason
,
getAccount
()));
return
success
(
entrustService
.
rejectToPrevNode
(
id
,
reason
,
getAccount
()));
}
}
@ApiOperation
(
"报告编制退回"
)
@PostMapping
(
"/back_from_report_make"
)
public
RestResult
<
Boolean
>
backFromReportMake
(
@RequestParam
(
"ids"
)
Long
[]
ids
,
@RequestParam
(
"reason"
)
String
reason
)
{
return
success
(
entrustService
.
backFromReportMake
(
ids
,
getAccount
(),
reason
));
}
@ApiOperation
(
"委托评审退回"
)
@ApiOperation
(
"委托评审退回"
)
@PostMapping
(
"/back_from_check"
)
@PostMapping
(
"/back_from_check"
)
...
@@ -491,6 +491,8 @@ public class EntrustController extends ServiceController {
...
@@ -491,6 +491,8 @@ public class EntrustController extends ServiceController {
// 过滤当前人为检测人的委托数据 - 节点数据不为空,且为检测时,只查询当前人信息
// 过滤当前人为检测人的委托数据 - 节点数据不为空,且为检测时,只查询当前人信息
if
(
EntrustFlowEnum
.
TEST
.
getName
().
equalsIgnoreCase
(
entrust
.
getSource
()))
{
if
(
EntrustFlowEnum
.
TEST
.
getName
().
equalsIgnoreCase
(
entrust
.
getSource
()))
{
entrust
.
setTesterId
(
getAccount
().
getUserId
());
entrust
.
setTesterId
(
getAccount
().
getUserId
());
// 只看当前人没有处理完成的委托
entrust
.
setItemStatus
(
EntrustSampleItemStatusEnum
.
TEST
);
}
}
// 获取当前用户分组
// 获取当前用户分组
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
entrust
.
setGroupNameList
(
userInfoService
.
getCurGroupNameList
());
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
View file @
0a78cc40
...
@@ -69,4 +69,5 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
...
@@ -69,4 +69,5 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
List
<
EntrustSampleItemVO
>
selectUnfinishItemList
(
@Param
(
"vo"
)
QueryDTO
dto
);
List
<
EntrustSampleItemVO
>
selectUnfinishItemList
(
@Param
(
"vo"
)
QueryDTO
dto
);
boolean
updateBatchByData
(
@Param
(
"itemList"
)
List
<
EntrustSampleItem
>
sampleItems
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleMapper.java
View file @
0a78cc40
...
@@ -42,4 +42,6 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> {
...
@@ -42,4 +42,6 @@ public interface EntrustSampleMapper extends BatchMapper<EntrustSample> {
Map
<
String
,
Object
>
selectAlBrandsRateStatus
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
Map
<
String
,
Object
>
selectAlBrandsRateStatus
(
@Param
(
"vo"
)
QueryDTO
queryDTO
);
List
<
EntrustSample
>
selectByReportIds
(
@Param
(
"reportIds"
)
Long
[]
reportIds
);
List
<
EntrustSample
>
selectByReportIds
(
@Param
(
"reportIds"
)
Long
[]
reportIds
);
boolean
updateBatchByData
(
@Param
(
"sampleList"
)
List
<
EntrustSample
>
sampleList
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustReportService.java
View file @
0a78cc40
...
@@ -59,4 +59,5 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
...
@@ -59,4 +59,5 @@ public interface IEntrustReportService extends IBaseService<EntrustReport> {
List
<
EntrustReport
>
getReportUnderEntrust
(
Long
entrustId
);
List
<
EntrustReport
>
getReportUnderEntrust
(
Long
entrustId
);
void
downloadExcel
(
Long
id
,
HttpServletResponse
response
);
void
downloadExcel
(
Long
id
,
HttpServletResponse
response
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
0a78cc40
...
@@ -5,7 +5,6 @@ import com.patzn.cloud.commons.controller.Account;
...
@@ -5,7 +5,6 @@ import com.patzn.cloud.commons.controller.Account;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.commons.service.IBaseService
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.QueryDTO
;
import
com.patzn.cloud.service.hmhj.dto.SampleItemDTO
;
import
com.patzn.cloud.service.hmhj.dto.SampleItemDTO
;
import
com.patzn.cloud.service.hmhj.entity.Entrust
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleItem
;
import
com.patzn.cloud.service.hmhj.entity.EntrustSampleItem
;
import
com.patzn.cloud.service.hmhj.entity.ItemDeviate
;
import
com.patzn.cloud.service.hmhj.entity.ItemDeviate
;
import
com.patzn.cloud.service.hmhj.entity.OriginalRecord
;
import
com.patzn.cloud.service.hmhj.entity.OriginalRecord
;
...
@@ -100,4 +99,6 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
...
@@ -100,4 +99,6 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean
autoAllotItem
(
Long
[]
ids
,
Account
account
);
boolean
autoAllotItem
(
Long
[]
ids
,
Account
account
);
boolean
autoAllotItemFromFlowStatus
(
Long
entrustId
,
EntrustFlowEnum
flowEnum
,
Account
account
);
boolean
autoAllotItemFromFlowStatus
(
Long
entrustId
,
EntrustFlowEnum
flowEnum
,
Account
account
);
boolean
updateBatchByData
(
List
<
EntrustSampleItem
>
sampleItems
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleService.java
View file @
0a78cc40
...
@@ -113,4 +113,6 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
...
@@ -113,4 +113,6 @@ public interface IEntrustSampleService extends IBaseService<EntrustSample> {
boolean
updateSampleInfo
(
EntrustSample
entrustSample
);
boolean
updateSampleInfo
(
EntrustSample
entrustSample
);
List
<
EntrustSample
>
getByReportIds
(
Long
[]
reportIds
);
List
<
EntrustSample
>
getByReportIds
(
Long
[]
reportIds
);
boolean
updateBatchByData
(
List
<
EntrustSample
>
sampleList
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
0a78cc40
...
@@ -106,4 +106,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
...
@@ -106,4 +106,6 @@ public interface IEntrustService extends IBaseService<Entrust> {
Page
<
EntrustVO
>
pageEntrustSampleMake
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
);
Page
<
EntrustVO
>
pageEntrustSampleMake
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
);
boolean
updateEntrustById
(
Entrust
entrust
);
boolean
updateEntrustById
(
Entrust
entrust
);
boolean
backFromReportMake
(
Long
[]
ids
,
Account
account
,
String
reason
);
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
0a78cc40
...
@@ -962,7 +962,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -962,7 +962,7 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 是否组合判定
// 是否组合判定
boolean
isComposeJudgment
=
null
!=
standard
.
getComposeJudge
()
&&
1
==
standard
.
getComposeJudge
().
intValue
();
boolean
isComposeJudgment
=
null
!=
standard
.
getComposeJudge
()
&&
1
==
standard
.
getComposeJudge
().
intValue
();
// 计算合计-组合判定合计值
// 计算合计-组合判定合计值
double
totalValue
=
sampleItemList
.
stream
().
filter
(
t
->
StringUtils
.
isNotBlank
(
t
.
getTestValue
())).
map
(
t
->
{
BigDecimal
totalDecimal
=
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
();
RestAssert
.
fail
(!
isNumber
(
testValue
),
String
.
format
(
"样品编号【%s】存在错误检测值【%s】"
,
sample
.
getCode
(),
testValue
));
RestAssert
.
fail
(!
isNumber
(
testValue
),
String
.
format
(
"样品编号【%s】存在错误检测值【%s】"
,
sample
.
getCode
(),
testValue
));
...
@@ -970,8 +970,10 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -970,8 +970,10 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
BigDecimal
.
ZERO
;
return
BigDecimal
.
ZERO
;
}
}
return
new
BigDecimal
(
testValue
);
return
new
BigDecimal
(
testValue
);
}).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
)
.
doubleValue
()
;
}).
reduce
(
BigDecimal
.
ZERO
,
BigDecimal:
:
add
);
// 杂质合计值修约
double
totalValue
=
totalDecimal
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_EVEN
).
doubleValue
();
// 获取检测项目值对象
// 获取检测项目值对象
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
())));
...
@@ -989,8 +991,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -989,8 +991,6 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
boolean
isLastGrading
=
i
==
gradingProductList
.
size
()
-
1
;
boolean
isLastGrading
=
i
==
gradingProductList
.
size
()
-
1
;
// ==
// ==
GradingProduct
product
=
gradingProductList
.
get
(
i
);
GradingProduct
product
=
gradingProductList
.
get
(
i
);
RestAssert
.
fail
(
null
==
product
.
getSumValue
(),
"产品标准合计值不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
product
.
getSumCompare
()),
"产品标准比较符不能为空"
);
// 比较单个大小是否都符合
// 比较单个大小是否都符合
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
List
<
GradingItem
>
gradingItemList
=
gradingItemService
.
list
(
Condition
.
create
()
...
@@ -1047,6 +1047,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1047,6 +1047,8 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
// 继续判定是否为组合判定,若为组合判定,那么需要判定组合结果是否符合限定值
// 继续判定是否为组合判定,若为组合判定,那么需要判定组合结果是否符合限定值
if
(
isComposeJudgment
)
{
if
(
isComposeJudgment
)
{
RestAssert
.
fail
(
null
==
product
.
getSumValue
(),
"产品标准合计值不能为空"
);
RestAssert
.
fail
(
StringUtils
.
isBlank
(
product
.
getSumCompare
()),
"产品标准比较符不能为空"
);
// 根据比较符类型比较大小
// 根据比较符类型比较大小
if
(!
CompareUtils
.
Comparator
.
get
(
product
.
getSumCompare
()).
calc
(
totalValue
,
product
.
getSumValue
().
doubleValue
()))
{
if
(!
CompareUtils
.
Comparator
.
get
(
product
.
getSumCompare
()).
calc
(
totalValue
,
product
.
getSumValue
().
doubleValue
()))
{
if
(!
isLastGrading
)
{
if
(!
isLastGrading
)
{
...
@@ -1266,6 +1268,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
...
@@ -1266,6 +1268,14 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
true
;
return
true
;
}
}
@Override
public
boolean
updateBatchByData
(
List
<
EntrustSampleItem
>
sampleItems
)
{
if
(
null
==
sampleItems
||
sampleItems
.
isEmpty
())
{
return
false
;
}
return
baseMapper
.
updateBatchByData
(
sampleItems
);
}
/**
/**
* 处理 原铝等标准为
* 处理 原铝等标准为
*/
*/
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
0a78cc40
...
@@ -1860,4 +1860,12 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
...
@@ -1860,4 +1860,12 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
public
List
<
EntrustSample
>
getByReportIds
(
Long
[]
reportIds
)
{
public
List
<
EntrustSample
>
getByReportIds
(
Long
[]
reportIds
)
{
return
baseMapper
.
selectByReportIds
(
reportIds
);
return
baseMapper
.
selectByReportIds
(
reportIds
);
}
}
@Override
public
boolean
updateBatchByData
(
List
<
EntrustSample
>
sampleList
)
{
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
return
false
;
}
return
baseMapper
.
updateBatchByData
(
sampleList
);
}
}
}
\ No newline at end of file
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
0a78cc40
...
@@ -40,7 +40,6 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -40,7 +40,6 @@ import org.springframework.transaction.annotation.Transactional;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalTime
;
import
java.time.LocalTime
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.Executor
;
import
java.util.concurrent.Executor
;
...
@@ -119,7 +118,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -119,7 +118,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
if
(
StringUtils
.
isNotBlank
(
client
))
{
if
(
StringUtils
.
isNotBlank
(
client
))
{
wrapper
.
like
(
"client"
,
client
);
wrapper
.
like
(
"client"
,
client
);
}
}
wrapper
.
orderBy
(
"c
od
e"
,
false
);
wrapper
.
orderBy
(
"c
tim
e"
,
false
);
return
this
.
page
(
page
,
wrapper
);
return
this
.
page
(
page
,
wrapper
);
}
}
...
@@ -745,19 +744,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -745,19 +744,10 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
@Override
@Override
public
Page
<
EntrustVO
>
pageEntrustJudgeHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
public
Page
<
EntrustVO
>
pageEntrustJudgeHis
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
List
<
EntrustSample
>
reportList
=
entrustSampleService
.
list
(
Condition
.
create
().
eq
(
"status"
,
entrust
.
getSampleStatus
()).
in
(
"judge_status"
,
entrust
.
getJudgeStatusList
()));
// ==
if
(
null
==
entrust
.
getSampleStatus
()
||
CollectionUtils
.
isEmpty
(
entrust
.
getJudgeStatusList
()))
{
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
.
setIdsList
(
ids
);
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
}
...
@@ -1002,7 +992,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1002,7 +992,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
}
}
entrust
.
setId
(
null
);
entrust
.
setId
(
null
);
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
)
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
)
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
())
.
setFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
())
.
setEntrustTime
(
new
Date
()).
setExpectSendTime
(
new
Date
())
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
);
.
setUid
(
account
.
getUserId
()).
setCtime
(
new
Date
()).
setLid
(
null
).
setLtime
(
null
);
// 保存委托信息
// 保存委托信息
saveEntrust
(
entrust
);
saveEntrust
(
entrust
);
...
@@ -1377,4 +1367,42 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
...
@@ -1377,4 +1367,42 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return
baseMapper
.
updateEntrustById
(
entrust
)
>
0
;
return
baseMapper
.
updateEntrustById
(
entrust
)
>
0
;
}
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
backFromReportMake
(
Long
[]
ids
,
Account
account
,
String
reason
)
{
RestAssert
.
fail
(
null
==
ids
||
ids
.
length
==
0
,
"请选择要退回的委托"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
for
(
Entrust
entrust
:
entrustList
)
{
EntrustFlowEnum
prevFlow
=
EntrustFlowEnum
.
TEST
;
// 是否可以直接退回上一步流程
if
(
isCanIntoPrevNode
(
entrust
))
{
prevFlow
=
EntrustFlowUtils
.
getPrevFlowStatus
(
entrust
.
getFlowStatus
(),
entrust
.
getStatusPath
());
}
// 1.获取委托,样品,检测项目状态
EntrustStatusEnum
prevStatus
=
EntrustFlowUtils
.
getStatus
(
prevFlow
);
EntrustSampleStatusEnum
prevSampleStatus
=
EntrustFlowUtils
.
getSampleStatus
(
prevFlow
);
EntrustSampleItemStatusEnum
prevItemStatus
=
EntrustFlowUtils
.
getItemStatus
(
prevFlow
);
// 2.重置委托,样品,检测项目各个数据
entrust
.
setProgress
(
prevStatus
).
setStatus
(
prevStatus
).
setFlowStatus
(
prevFlow
.
getName
());
updateById
(
entrust
);
//
List
<
EntrustSample
>
samples
=
entrustSampleService
.
getByEntrustId
(
entrust
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
samples
))
{
continue
;
}
EntrustSample
sample
=
new
EntrustSample
();
sample
.
setStatus
(
prevSampleStatus
).
setProgress
(
prevSampleStatus
);
entrustSampleService
.
update
(
sample
,
Condition
.
create
().
eq
(
"entrust_id"
,
entrust
.
getId
()));
List
<
Long
>
sampleIds
=
samples
.
stream
().
map
(
EntrustSample:
:
getId
).
collect
(
Collectors
.
toList
());
EntrustSampleItem
item
=
new
EntrustSampleItem
();
item
.
setStatus
(
prevItemStatus
).
setProgress
(
prevItemStatus
);
entrustSampleItemService
.
update
(
item
,
Condition
.
create
().
in
(
"entrust_sample_id"
,
sampleIds
));
// 3.日志
entrustRecordService
.
record
(
ids
,
EntrustFlowEnum
.
REPORT_MAKE
.
getDisplay
(),
prevFlow
.
getDisplay
(),
1
,
account
,
reason
);
}
// 4.删除报告
EntrustReport
report
=
new
EntrustReport
();
report
.
setDeleted
(
1
);
return
entrustReportService
.
update
(
report
,
Condition
.
create
().
in
(
"entrust_id"
,
ids
));
}
}
}
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
0a78cc40
...
@@ -22,6 +22,28 @@
...
@@ -22,6 +22,28 @@
<if
test=
"null != vo.uid"
>
<if
test=
"null != vo.uid"
>
AND e.uid = #{vo.uid}
AND e.uid = #{vo.uid}
</if>
</if>
<if
test=
"null != vo.entrustTimeS"
>
AND e.entrust_time
>
= #{vo.entrustTimeS}
</if>
<if
test=
"null != vo.entrustTimeE"
>
AND e.entrust_time
<
= #{vo.entrustTimeE}
</if>
<if
test=
"null != vo.receiveTimeS"
>
AND e.receive_time
>
= #{vo.receiveTimeS}
</if>
<if
test=
"null != vo.receiveTimeE"
>
AND e.receive_time
<
= #{vo.receiveTimeE}
</if>
<if
test=
"null != vo.expectSendTimeS"
>
AND e.expect_send_time
>
= #{vo.expectSendTimeS}
</if>
<if
test=
"null != vo.expectSendTimeE"
>
AND e.expect_send_time
<
= #{vo.expectSendTimeE}
</if>
<if
test=
"null != vo.groupNameList"
>
<if
test=
"null != vo.groupNameList"
>
AND e.test_side IN
AND e.test_side IN
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"vo.groupNameList"
index=
"index"
item=
"groupName"
open=
"("
separator=
","
close=
")"
>
...
@@ -92,6 +114,12 @@
...
@@ -92,6 +114,12 @@
AND exists (
AND exists (
select 1 from entrust_sample s where s.deleted = 0
select 1 from entrust_sample s where s.deleted = 0
and s.entrust_id = e.id and s.type = 0 and s.status = #{vo.sampleStatus}
and s.entrust_id = e.id and s.type = 0 and s.status = #{vo.sampleStatus}
<if
test=
"null != vo.judgeStatusList"
>
and s.judge_status IN
<foreach
collection=
"vo.judgeStatusList"
index=
"index"
item=
"judgeStatus"
open=
"("
separator=
","
close=
")"
>
#{judgeStatus}
</foreach>
</if>
)
)
</if>
</if>
...
@@ -133,7 +161,6 @@
...
@@ -133,7 +161,6 @@
)
)
</if>
</if>
<if
test=
"null != vo.reportStatusList"
>
<if
test=
"null != vo.reportStatusList"
>
AND exists (
AND exists (
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
select 1 from entrust_report r where r.deleted = 0 and r.entrust_id = e.id
...
@@ -144,7 +171,6 @@
...
@@ -144,7 +171,6 @@
</foreach>
</foreach>
)
)
</if>
</if>
order by e.ctime DESC
order by e.ctime DESC
</select>
</select>
...
@@ -203,6 +229,10 @@
...
@@ -203,6 +229,10 @@
join entrust_sample_item esi on esi.entrust_sample_id = es.id
join entrust_sample_item esi on esi.entrust_sample_id = es.id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
where es.deleted = 0 and esi.deleted = 0 and es.entrust_id = e.id
and esi.tester_id = #{vo.testerId}
and esi.tester_id = #{vo.testerId}
-- 数据录入节点,处理完成的数据不再显示
<if
test=
"null != vo.itemStatus"
>
and esi.status = #{vo.itemStatus}
</if>
)
)
</if>
</if>
order by e.entrust_time desc,e.code desc
order by e.entrust_time desc,e.code desc
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
0a78cc40
...
@@ -673,4 +673,37 @@
...
@@ -673,4 +673,37 @@
AND s.deleted = 0
AND s.deleted = 0
AND s.id = #{sampleId}
AND s.id = #{sampleId}
</select>
</select>
<update
id=
"updateBatchByData"
parameterType=
"java.util.List"
>
<foreach
collection=
"itemList"
item=
"item"
index=
"index"
open=
""
close=
""
separator=
";"
>
update entrust_sample_item
<set>
name = #{item.name}
,standard = #{item.standard}
,decide = #{item.decide}
,agreed_value = #{item.agreedValue}
,test_value = #{item.testValue}
,ltime = #{item.ltime}
,lid = #{item.lid}
,entrust_sample_id = #{item.entrustSampleId}
,status = #{item.status}
,progress = #{item.progress}
,group_id = #{item.groupId}
,group_name = #{item.groupName}
,tester = #{item.tester}
,tester_id = #{item.testerId}
,test_time = #{item.testTime}
,checker = #{item.checker}
,checker_id = #{item.checkerId}
,check_time = #{item.checkTime}
,auditor = #{item.auditor}
,auditor_id = #{item.auditorId}
,audit_time = #{item.auditTime}
,compose_judge = #{item.composeJudge}
,price = #{item.price}
,in_report = #{item.inReport}
</set>
where id = #{item.id}
</foreach>
</update>
</mapper>
</mapper>
src/main/resources/mapper/hmhj/EntrustSampleMapper.xml
View file @
0a78cc40
...
@@ -416,4 +416,60 @@
...
@@ -416,4 +416,60 @@
</foreach>
</foreach>
</select>
</select>
<update
id=
"updateBatchByData"
parameterType=
"java.util.List"
>
<foreach
collection=
"sampleList"
item=
"item"
index=
"index"
open=
""
close=
""
separator=
";"
>
update entrust_sample
<set>
name = #{item.name}
,ltime = #{item.ltime}
,lid = #{item.lid}
,code = #{item.code}
,sample_shape = #{item.sampleShape}
,sample_quantity = #{item.sampleQuantity}
,standard = #{item.standard}
,status = #{item.status}
,progress = #{item.progress}
,receiver = #{item.receiver}
,receiver_id = #{item.receiverId}
,receive_time = #{item.receiveTime}
,sample_grading = #{item.sampleGrading}
,quality_registration = #{item.qualityRegistration}
,ok_judge = #{item.okJudge}
,judger_id = #{item.judgerId}
,judge_time = #{item.judgeTime}
,judger = #{item.judger}
,judge_status = #{item.judgeStatus}
,judge_progress = #{item.judgeProgress}
,judge_checker = #{item.judgeChecker}
,judge_checker_id = #{item.judgeCheckerId}
,judge_check_time = #{item.judgeCheckTime}
,appearance_result = #{item.appearanceResult}
,contract_code = #{item.contractCode}
,contract_sample_id = #{item.contractSampleId}
,sample_from = #{item.sampleFrom}
,product_code = #{item.productCode}
,product_basis_name = #{item.productBasisName}
,compose_judge = #{item.composeJudge}
,product_standard_id = #{item.productStandardId}
,name_code = #{item.nameCode}
,surplus_sample_limit = #{item.surplusSampleLimit}
,supplier = #{item.supplier}
,slot_no = #{item.slotNo}
,code_type = #{item.codeType}
,first_code = #{item.firstCode}
,second_code = #{item.secondCode}
,third_code = #{item.thirdCode}
,manufacturer = #{item.manufacturer}
,category = #{item.category}
,electrolyzer_id = #{item.electrolyzerId}
,type = #{item.type}
,order_by = #{item.orderBy}
,compliance_test = #{item.complianceTest}
,fee = #{item.fee}
,modified = #{item.modified}
</set>
where id = #{item.id}
</foreach>
</update>
</mapper>
</mapper>
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