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
a624ab5b
Commit
a624ab5b
authored
Aug 07, 2021
by
lijingjing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委托部分需求添加;
parent
9626aef1
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
178 additions
and
1 deletions
+178
-1
EntrustController.java
...cloud/service/lims/hmhj/controller/EntrustController.java
+30
-0
EntrustSampleItemController.java
...ice/lims/hmhj/controller/EntrustSampleItemController.java
+12
-0
EntrustSampleItemMapper.java
...oud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
+3
-0
IEntrustSampleItemService.java
.../service/lims/hmhj/service/IEntrustSampleItemService.java
+4
-0
IEntrustService.java
...atzn/cloud/service/lims/hmhj/service/IEntrustService.java
+8
-0
EntrustSampleItemServiceImpl.java
.../lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
+17
-0
EntrustSampleServiceImpl.java
...vice/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
+1
-0
EntrustServiceImpl.java
...ud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
+84
-1
EntrustMapper.xml
src/main/resources/mapper/hmhj/EntrustMapper.xml
+3
-0
EntrustSampleItemMapper.xml
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
+10
-0
20200807新增委托字段.sql
src/test/java/resources/db_sql/hmhj/v150/20200807新增委托字段.sql
+6
-0
No files found.
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustController.java
View file @
a624ab5b
...
...
@@ -288,6 +288,12 @@ public class EntrustController extends ServiceController {
return
success
(
entrustService
.
editEntrust
(
entrustDTO
,
getAccount
()));
}
@ApiOperation
(
"保存并提交委托"
)
@PostMapping
(
"/save_or_update_to_submit"
)
public
RestResult
<
Boolean
>
saveOrUpdateToSubmit
(
@RequestBody
EntrustDTO
entrustDTO
)
{
return
success
(
entrustService
.
saveOrUpdateToSubmit
(
entrustDTO
,
getAccount
()));
}
@ApiOperation
(
value
=
"根据ID查询VO查询 id 信息"
,
notes
=
"根据ID查询VO查询 id 的数据内容"
)
@ApiImplicitParams
({
...
...
@@ -319,6 +325,12 @@ public class EntrustController extends ServiceController {
return
success
(
entrustService
.
submitToCheck
(
ids
,
getAccount
()));
}
@ApiOperation
(
"提交至下一流程"
)
@PostMapping
(
"/submit_to_next_flow"
)
public
RestResult
<
Boolean
>
submitToNextFlow
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
return
success
(
entrustService
.
submitToNextFlow
(
ids
,
getAccount
()));
}
@ApiOperation
(
"提交至下一节点"
)
@PostMapping
(
"/submit_to_next_node"
)
public
RestResult
<
Boolean
>
submitToNextNode
(
@RequestParam
(
"ids"
)
Long
[]
ids
)
{
...
...
@@ -873,4 +885,22 @@ public class EntrustController extends ServiceController {
public
RestResult
<
Boolean
>
updatePrintStatus
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
(
"userId"
)
Long
userId
)
{
return
success
(
entrustService
.
updatePrintStatus
(
ids
,
userId
));
}
@ApiOperation
(
"设置历史数据为委托模板"
)
@PostMapping
(
"/set_entrust_tpl"
)
public
RestResult
<
Boolean
>
updateSetEntrustTpl
(
@RequestParam
(
"ids"
)
List
<
Long
>
ids
,
@RequestParam
(
"status"
)
Integer
status
)
{
return
success
(
entrustService
.
updateSetEntrustTpl
(
ids
,
status
));
}
@ApiOperation
(
"获取委托模板数据"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_PAGE
,
value
=
"请求数据的页码"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_ROWS
,
value
=
"每页条数"
,
required
=
true
,
paramType
=
"query"
,
dataTypeClass
=
Integer
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SIDX
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
@ApiImplicitParam
(
name
=
RestConstants
.
PAGE_SORD
,
value
=
"排序方式"
,
paramType
=
"query"
,
dataTypeClass
=
String
.
class
),
})
@PostMapping
(
"/page_entrust_tpl"
)
public
RestResult
<
Page
<
EntrustVO
>>
getPageEntrustTpl
(
EntrustVO
entrust
)
{
return
success
(
entrustService
.
getPageEntrustTpl
(
getPage
(),
entrust
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/controller/EntrustSampleItemController.java
View file @
a624ab5b
...
...
@@ -643,4 +643,16 @@ public class EntrustSampleItemController extends ServiceController {
public
RestResult
<
Map
>
getSampleItemStatsQuery
(
SampleItemDTO
sampleItemDTO
)
{
return
success
(
entrustSampleItemService
.
getSampleItemStatsQuery
(
sampleItemDTO
));
}
@ApiOperation
(
"批量删除样品下检测项目"
)
@PostMapping
(
"/delete_sample_item"
)
public
RestResult
<
Boolean
>
removeSamplesItem
(
@RequestParam
(
"sampleIds"
)
Long
[]
sampleIds
,
@RequestParam
(
"itemName"
)
String
itemName
)
{
return
success
(
entrustSampleItemService
.
removeSamplesItem
(
sampleIds
,
itemName
));
}
@ApiOperation
(
"恢复删除的检测项目"
)
@PostMapping
(
"/revoke_deleted_item"
)
public
RestResult
<
Boolean
>
revokeDeletedItem
(
@RequestParam
(
"sampleIds"
)
Long
[]
sampleIds
)
{
return
success
(
entrustSampleItemService
.
revokeDeletedItems
(
sampleIds
));
}
}
src/main/java/com/patzn/cloud/service/lims/hmhj/mapper/EntrustSampleItemMapper.java
View file @
a624ab5b
...
...
@@ -70,4 +70,7 @@ public interface EntrustSampleItemMapper extends BatchMapper<EntrustSampleItem>
List
<
EntrustSampleItemVO
>
selectUnfinishItemList
(
@Param
(
"vo"
)
QueryDTO
dto
);
boolean
updateBatchByData
(
@Param
(
"itemList"
)
List
<
EntrustSampleItem
>
sampleItems
);
@SqlParser
(
filter
=
true
)
boolean
updateForRevokeDeletedItems
(
@Param
(
"sampleIds"
)
Long
[]
sampleIds
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustSampleItemService.java
View file @
a624ab5b
...
...
@@ -101,4 +101,8 @@ public interface IEntrustSampleItemService extends IBaseService<EntrustSampleIte
boolean
autoAllotItemFromFlowStatus
(
Long
entrustId
,
EntrustFlowEnum
flowEnum
,
Account
account
);
boolean
updateBatchByData
(
List
<
EntrustSampleItem
>
sampleItems
);
boolean
removeSamplesItem
(
Long
[]
sampleIds
,
String
itemName
);
boolean
revokeDeletedItems
(
Long
[]
sampleIds
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/IEntrustService.java
View file @
a624ab5b
...
...
@@ -108,4 +108,12 @@ public interface IEntrustService extends IBaseService<Entrust> {
boolean
updateEntrustById
(
Entrust
entrust
);
boolean
backFromReportMake
(
Long
[]
ids
,
Account
account
,
String
reason
);
boolean
updateSetEntrustTpl
(
List
<
Long
>
ids
,
Integer
status
);
Page
<
EntrustVO
>
getPageEntrustTpl
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
);
boolean
submitToNextFlow
(
Long
[]
ids
,
Account
account
);
boolean
saveOrUpdateToSubmit
(
EntrustDTO
entrustDTO
,
Account
account
);
}
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleItemServiceImpl.java
View file @
a624ab5b
...
...
@@ -10,6 +10,7 @@ import com.google.common.collect.Lists;
import
com.patzn.cloud.commons.api.RestAssert
;
import
com.patzn.cloud.commons.controller.Account
;
import
com.patzn.cloud.commons.controller.LoginHelper
;
import
com.patzn.cloud.commons.exception.PatznException
;
import
com.patzn.cloud.commons.service.impl.BaseServiceImpl
;
import
com.patzn.cloud.commons.toolkit.DateUtils
;
import
com.patzn.cloud.commons.toolkit.FileUtils
;
...
...
@@ -1276,6 +1277,22 @@ public class EntrustSampleItemServiceImpl extends BaseServiceImpl<EntrustSampleI
return
baseMapper
.
updateBatchByData
(
sampleItems
);
}
@Override
public
boolean
removeSamplesItem
(
Long
[]
sampleIds
,
String
itemName
)
{
if
(
null
==
sampleIds
||
StringUtils
.
isBlank
(
itemName
))
{
throw
new
PatznException
(
"样品编号或检测项目为空"
);
}
return
baseMapper
.
update
(
new
EntrustSampleItem
().
setDeleted
(
1
),
Condition
.
create
().
eq
(
"name"
,
itemName
).
in
(
"entrust_sample_id"
,
sampleIds
))
>
0
;
}
@Override
public
boolean
revokeDeletedItems
(
Long
[]
sampleIds
)
{
if
(
null
==
sampleIds
)
{
throw
new
PatznException
(
"样品编号为空"
);
}
return
baseMapper
.
updateForRevokeDeletedItems
(
sampleIds
);
}
/**
* 处理 原铝等标准为
*/
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustSampleServiceImpl.java
View file @
a624ab5b
...
...
@@ -634,6 +634,7 @@ public class EntrustSampleServiceImpl extends BaseServiceImpl<EntrustSampleMappe
@Override
public
boolean
removeByIds
(
List
<
Long
>
ids
)
{
entrustSampleItemService
.
remove
(
Condition
.
create
().
in
(
"entrust_sample_id"
,
ids
));
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
}
...
...
src/main/java/com/patzn/cloud/service/lims/hmhj/service/impl/EntrustServiceImpl.java
View file @
a624ab5b
...
...
@@ -295,8 +295,11 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
BigDecimal
totalFee
=
BigDecimal
.
ZERO
;
entrust
.
setId
(
IdWorker
.
getId
());
// 保存并提交委托时使用
dto
.
setId
(
entrust
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
sampleDTOList
))
{
RestAssert
.
fail
(
sampleDTOList
.
stream
().
map
(
EntrustSampleDTO:
:
getName
).
distinct
().
count
()
>
1
,
"一个委托只能下同一种样品!"
);
List
<
EntrustSample
>
saveSampleList
=
new
ArrayList
<>();
List
<
EntrustSampleItem
>
saveEntrustSampleItemList
=
new
ArrayList
<>();
...
...
@@ -476,6 +479,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
return
false
;
}
List
<
EntrustSampleDTO
>
sampleList
=
entrustDTO
.
getSampleDTOList
();
RestAssert
.
fail
(
sampleList
.
stream
().
map
(
EntrustSampleDTO:
:
getName
).
distinct
().
count
()
>
1
,
"一个委托只能下同一种样品!"
);
if
(
CollectionUtils
.
isEmpty
(
sampleList
))
{
// PtAssert.fail("样品不能为空");
}
...
...
@@ -993,7 +997,7 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
entrust
.
setId
(
null
);
entrust
.
setCode
(
null
).
setStatus
(
EntrustStatusEnum
.
DRAFT
).
setProgress
(
EntrustStatusEnum
.
DRAFT
)
.
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
)
.
setOrgId
(
null
)
;
// 保存委托信息
saveEntrust
(
entrust
);
entrustIdList
.
add
(
entrust
.
getId
());
...
...
@@ -1405,4 +1409,83 @@ public class EntrustServiceImpl extends BaseServiceImpl<EntrustMapper, Entrust>
report
.
setDeleted
(
1
);
return
entrustReportService
.
update
(
report
,
Condition
.
create
().
in
(
"entrust_id"
,
ids
));
}
@Override
public
boolean
updateSetEntrustTpl
(
List
<
Long
>
ids
,
Integer
statusInt
)
{
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
ids
),
"历史委托编号为空"
);
// 默认设置
int
status
=
null
==
statusInt
?
0
:
statusInt
.
intValue
();
// 组织ID
Long
orgId
=
-
1
l
;
if
(
1
==
status
)
{
List
<
SysOrg
>
orgList
=
sysOrgClient
.
getListByUserId
(
LoginHelper
.
getAccount
().
getUserId
()).
getData
();
RestAssert
.
fail
(
CollectionUtils
.
isEmpty
(
orgList
),
"用户组织为空"
);
orgId
=
orgList
.
get
(
0
).
getId
();
}
return
update
(
new
Entrust
().
setOrgId
(
orgId
),
Condition
.
create
().
in
(
"id"
,
ids
));
}
@Override
public
Page
<
EntrustVO
>
getPageEntrustTpl
(
Page
<
EntrustVO
>
page
,
EntrustVO
entrust
)
{
List
<
SysOrg
>
orgList
=
sysOrgClient
.
getListByUserId
(
LoginHelper
.
getAccount
().
getUserId
()).
getData
();
Long
orgId
=
-
2
l
;
if
(
CollectionUtils
.
isNotEmpty
(
orgList
))
{
entrust
.
setOrgId
(
orgList
.
get
(
0
).
getId
());
}
return
page
.
setRecords
(
baseMapper
.
selectVOList
(
page
,
entrust
));
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
submitToNextFlow
(
Long
[]
ids
,
Account
account
)
{
RestAssert
.
fail
(
null
==
ids
||
0
==
ids
.
length
,
"请选择要提交的委托!"
);
List
<
Entrust
>
entrustList
=
getBatchIds
(
Arrays
.
asList
(
ids
));
List
<
Long
>
specialIds
=
new
ArrayList
<>(),
normalIds
=
new
ArrayList
<>();
for
(
Entrust
entrust
:
entrustList
)
{
if
(
"是"
.
equals
(
entrust
.
getSpecialAsk
()))
{
specialIds
.
add
(
entrust
.
getId
());
}
else
{
// 若状态路径不为空且可以进入下一步流程,那么
if
(
null
!=
EntrustFlowUtils
.
getNextFlowStatus
(
EntrustFlowEnum
.
DRAFT
.
getName
(),
entrust
.
getStatusPath
()))
{
submitToNextNode
(
entrust
,
account
);
}
else
{
normalIds
.
add
(
entrust
.
getId
());
}
}
}
Entrust
updateModel
=
new
Entrust
();
if
(
CollectionUtils
.
isNotEmpty
(
specialIds
))
{
updateModel
.
setStatus
(
EntrustStatusEnum
.
CHECK
);
updateModel
.
setProgress
(
EntrustStatusEnum
.
CHECK
);
updateModel
.
setFlowStatus
(
EntrustFlowEnum
.
CHECK
.
getName
());
update
(
updateModel
,
Condition
.
create
().
in
(
"id"
,
specialIds
));
entrustRecordService
.
record
(
specialIds
,
EntrustStatusEnum
.
DRAFT
.
getDisplay
(),
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
0
,
account
,
"提交至委托审核"
);
lmsMsgService
.
sendMsg
(
"/hmhj/entrust_manage/entrust_review"
,
"有委托从委托登记提交过来,请及时审核"
,
"新的委托审核任务!"
,
account
,
null
);
}
if
(
CollectionUtils
.
isNotEmpty
(
normalIds
))
{
updateModel
.
setStatus
(
EntrustStatusEnum
.
MAKE
);
updateModel
.
setProgress
(
EntrustStatusEnum
.
MAKE
);
updateModel
.
setFlowStatus
(
EntrustFlowEnum
.
MAKE
.
getName
());
updateById
(
updateModel
);
// 更改样品编号级别
normalIds
.
forEach
(
entrustId
->
{
entrustSampleService
.
updateSampleCodeByEntrustId
(
entrustId
,
2
);
});
entrustRecordService
.
record
(
normalIds
,
EntrustStatusEnum
.
CHECK
.
getDisplay
(),
EntrustStatusEnum
.
MAKE
.
getDisplay
(),
0
,
account
,
"提交至样品待制备"
);
lmsMsgService
.
sendMsg
(
"/hmhj/sample_manage/sample_prepare"
,
"有委托审核通过,请及时进行样品的制备"
,
"新的样品制备任务!"
,
account
,
null
);
}
return
true
;
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveOrUpdateToSubmit
(
EntrustDTO
entrustDTO
,
Account
account
)
{
if
(
null
==
entrustDTO
.
getId
())
{
saveEntrustDTO
(
entrustDTO
,
account
);
}
else
{
editEntrust
(
entrustDTO
,
account
);
}
return
submitToNextFlow
(
new
Long
[]{
entrustDTO
.
getId
()},
account
);
}
}
src/main/resources/mapper/hmhj/EntrustMapper.xml
View file @
a624ab5b
...
...
@@ -16,6 +16,9 @@
<if
test=
"null!=vo.status"
>
AND e.status = #{vo.status}
</if>
<if
test=
"null!=vo.orgId"
>
AND e.org_id = #{vo.orgId}
</if>
<if
test=
"null!=vo.flowStatus"
>
AND e.flow_status = #{vo.flowStatus}
</if>
...
...
src/main/resources/mapper/hmhj/EntrustSampleItemMapper.xml
View file @
a624ab5b
...
...
@@ -706,4 +706,14 @@
where id = #{item.id}
</foreach>
</update>
<update
id=
"updateForRevokeDeletedItems"
>
update entrust_sample_item
set
deleted = 0
where entrust_sample_id in
<foreach
collection=
"sampleIds"
index=
"index"
item=
"sampleId"
open=
"("
separator=
","
close=
")"
>
#{sampleId}
</foreach>
</update>
</mapper>
src/test/java/resources/db_sql/hmhj/v150/20200807新增委托字段.sql
0 → 100644
View file @
a624ab5b
ALTER
TABLE
"public"
.
"entrust"
ALTER
TABLE
"public"
.
"entrust"
ADD
COLUMN
"org_id"
int8
;
COMMENT
ON
COLUMN
"public"
.
"entrust"
.
"org_id"
IS
'组织ID,用于委托模板'
;
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment