Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
huang.tao
/
jmai-platform
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
90b819ae
authored
Dec 04, 2025
by
huangtao
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
销毁审批
parent
3735cd08
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
311 additions
and
24 deletions
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicDestroyCheckController.java
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicDestroyController.java
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicStorageAmpouleController.java
jmai-physic/src/main/java/com/jmai/physic/dto/PhysicDestroyCheckSignReq.java
jmai-physic/src/main/java/com/jmai/physic/dto/PhysicStorageAmpouleCreateReq.java
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicAmpoule.java
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicDestroyCheck.java
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicDestroyCheckDetail.java
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicStorageAmpoule.java
jmai-physic/src/main/java/com/jmai/physic/mapper/PhysicStorageAmpouleMapper.java
jmai-physic/src/main/java/com/jmai/physic/service/PhysicDestroyCheckService.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicAmpouleServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicDestroyCheckServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicStorageAmpouleServiceImpl.java
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicDestroyCheckVO.java
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicDestroyNumVO.java
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicStorageAmpouleVO.java
jmai-physic/src/main/resources/mapper/PhysicStorageAmpouleMapper.xml
jmai-sys/src/main/java/com/jmai/sys/service/impl/UserServiceImpl.java
logs/jmai/error.log
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicDestroyCheckController.java
View file @
90b819ae
...
...
@@ -4,9 +4,14 @@ package com.jmai.physic.controller;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicCheckQueryReq
;
import
com.jmai.physic.dto.PhysicDestroyCheckCreateReq
;
import
com.jmai.physic.dto.PhysicDestroyCheckSignReq
;
import
com.jmai.physic.dto.PhysicDestroySignReq
;
import
com.jmai.physic.entity.PhysicDestroy
;
import
com.jmai.physic.entity.PhysicDestroyCheck
;
import
com.jmai.physic.service.PhysicDestroyCheckService
;
import
com.jmai.physic.vo.PhysicDestroyCheckVO
;
import
com.jmai.physic.vo.PhysicDestroyNumVO
;
import
com.jmai.physic.vo.PhysicDestroyVO
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.dto.ResponseData
;
import
io.swagger.annotations.Api
;
...
...
@@ -21,6 +26,7 @@ import org.springframework.web.bind.annotation.RestController;
import
javax.annotation.Resource
;
import
javax.validation.Valid
;
import
java.util.List
;
@Slf4j
@Auth
...
...
@@ -45,4 +51,18 @@ public class PhysicDestroyCheckController {
return
physicDestroyCheckService
.
listPage
(
req
);
}
@PostMapping
(
"/sign"
)
@ApiOperation
(
value
=
"签名"
)
public
ResponseData
<
PhysicDestroyCheck
>
sign
(
@RequestBody
PhysicDestroyCheckSignReq
physicDestroyCheckSignReq
)
{
PhysicDestroyCheck
check
=
physicDestroyCheckService
.
sign
(
physicDestroyCheckSignReq
);
return
ResponseData
.
ok
(
check
);
}
@PostMapping
(
"/listDestroy"
)
@ApiOperation
(
value
=
"销毁数量列表"
)
public
ResponseData
<
List
<
PhysicDestroyNumVO
>>
listDestroy
()
{
List
<
PhysicDestroyNumVO
>
physicDestroyNumVOS
=
physicDestroyCheckService
.
listDestroy
();
return
ResponseData
.
ok
(
physicDestroyNumVOS
);
}
}
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicDestroyController.java
View file @
90b819ae
...
...
@@ -52,6 +52,4 @@ public class PhysicDestroyController {
PhysicDestroy
physicDestroy
=
physicDestroyService
.
sign
(
physicDestroySignReq
);
return
ResponseData
.
ok
(
physicDestroy
);
}
}
jmai-physic/src/main/java/com/jmai/physic/controller/PhysicStorageAmpouleController.java
View file @
90b819ae
...
...
@@ -7,7 +7,9 @@ import com.jmai.physic.entity.PhysicRecord;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.service.PhysicStorageAmpouleService
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.aop.Auth
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.dto.ResponseData
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -28,7 +30,7 @@ import javax.validation.Valid;
@RequestMapping
(
"/physicStorageAmpoule"
)
@Api
(
tags
=
"药品空安瓿登记-药库"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
paramType
=
"header"
,
name
=
"Access-Token"
,
value
=
"凭证"
,
required
=
true
,
dataType
=
"string"
)})
public
class
PhysicStorageAmpouleController
{
public
class
PhysicStorageAmpouleController
extends
AbstractService
{
@Resource
private
PhysicStorageAmpouleService
physicStorageAmpouleService
;
...
...
@@ -37,7 +39,8 @@ public class PhysicStorageAmpouleController {
@PostMapping
(
"/create"
)
@ApiOperation
(
value
=
"创建"
)
public
ResponseData
create
(
@RequestBody
@Valid
PhysicStorageAmpouleCreateReq
req
)
{
physicStorageAmpouleService
.
create
(
req
);
Long
userId
=
SpringContextUtils
.
getUserId
();
execWithLock
(
"physicStorageAmpoule:"
+
userId
,
()
->
physicStorageAmpouleService
.
create
(
req
));
return
ResponseData
.
ok
();
}
...
...
jmai-physic/src/main/java/com/jmai/physic/dto/PhysicDestroyCheckSignReq.java
0 → 100644
View file @
90b819ae
package
com
.
jmai
.
physic
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
PhysicDestroyCheckSignReq
{
@ApiModelProperty
(
value
=
"签名token"
)
private
String
encryptedToken
;
@ApiModelProperty
(
value
=
"签名账号"
)
private
String
relBizNo
;
@ApiModelProperty
(
value
=
"签名base64图片"
)
private
String
base64SourceData
;
@ApiModelProperty
(
value
=
"药品销毁id"
)
private
Long
physicDestroyCheckId
;
}
jmai-physic/src/main/java/com/jmai/physic/dto/PhysicStorageAmpouleCreateReq.java
View file @
90b819ae
...
...
@@ -10,10 +10,11 @@ import java.util.List;
public
class
PhysicStorageAmpouleCreateReq
{
@ApiModelProperty
(
value
=
"1-回收 2-移至销毁"
)
private
Integer
type
;
private
Integer
deptId
;
@ApiModelProperty
(
value
=
"移交部门"
)
private
Integer
transferDeptId
;
private
String
remark
;
...
...
@@ -38,6 +39,9 @@ public class PhysicStorageAmpouleCreateReq {
@ApiModelProperty
(
value
=
"批号"
)
private
String
batchNo
;
@ApiModelProperty
(
value
=
"厂家"
)
private
String
factoryName
;
}
}
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicAmpoule.java
View file @
90b819ae
...
...
@@ -20,7 +20,7 @@ public class PhysicAmpoule extends BaseVersionEntity {
private
Integer
physicNum
;
@ApiModelProperty
(
value
=
"规格"
)
private
String
physiSpec
;
private
String
physi
c
Spec
;
@ApiModelProperty
(
value
=
"批号"
)
private
String
batchNo
;
...
...
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicDestroyCheck.java
View file @
90b819ae
...
...
@@ -12,11 +12,17 @@ import lombok.Data;
@TableName
(
"physic_destroy_check"
)
public
class
PhysicDestroyCheck
extends
BaseVersionEntity
{
private
String
applyName
;
private
Stri
ng
applyDeptId
;
private
Lo
ng
applyDeptId
;
private
String
applyTitle
;
private
String
applyReason
;
private
String
images
;
private
Integer
destroyNum
;
@ApiModelProperty
(
value
=
"状态 0-审批中 1-已销毁 "
)
private
Integer
status
;
private
String
xhUser
;
private
String
jdUser
;
private
String
yxbzrUser
;
private
String
ywkkzUser
;
private
String
bwkkzUser
;
private
String
zgyzUser
;
}
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicDestroyCheckDetail.java
View file @
90b819ae
...
...
@@ -19,7 +19,7 @@ public class PhysicDestroyCheckDetail extends BaseVersionEntity {
private
Integer
physicNum
;
@ApiModelProperty
(
value
=
"规格"
)
private
String
physiSpec
;
private
String
physi
c
Spec
;
@ApiModelProperty
(
value
=
"批号"
)
private
String
batchNo
;
...
...
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicStorageAmpoule.java
View file @
90b819ae
...
...
@@ -31,13 +31,23 @@ public class PhysicStorageAmpoule extends BaseVersionEntity {
private
String
physicType
;
@ApiModelProperty
(
value
=
"1-接收 2-销毁"
)
@ApiModelProperty
(
value
=
"收入"
)
private
Integer
acquireNum
;
@ApiModelProperty
(
value
=
"发出"
)
private
Integer
expendNum
;
@ApiModelProperty
(
value
=
"1-接收 2-移至销毁"
)
private
Integer
type
;
private
String
orderNo
;
@ApiModelProperty
(
value
=
"1-待销毁 2-已销毁"
)
private
Integer
destroyStatus
;
private
Long
deptId
;
private
String
orderNo
;
@ApiModelProperty
(
value
=
"移交部门"
)
private
Long
transferDeptId
;
@ApiModelProperty
(
value
=
"接收部门"
)
private
Long
acceptDeptId
;
private
Integer
recycleReceiptNum
;
...
...
jmai-physic/src/main/java/com/jmai/physic/mapper/PhysicStorageAmpouleMapper.java
View file @
90b819ae
...
...
@@ -5,11 +5,21 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicAmpouleQueryReq
;
import
com.jmai.physic.entity.PhysicStorageAmpoule
;
import
com.jmai.physic.vo.PhysicDestroyNumVO
;
import
com.jmai.physic.vo.PhysicStorageAmpouleVO
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
PhysicStorageAmpouleMapper
extends
BaseMapper
<
PhysicStorageAmpoule
>
{
Page
<
PhysicStorageAmpouleVO
>
selectAmpoulePage
(
Page
<
PhysicStorageAmpouleVO
>
page
,
@Param
(
"req"
)
PhysicAmpouleQueryReq
req
);
Integer
selectCurrentSumByBatchNo
(
@Param
(
"name"
)
String
name
,
@Param
(
"spec"
)
String
spec
,
@Param
(
"factoryName"
)
String
factoryName
,
@Param
(
"batchNo"
)
String
batchNo
,
@Param
(
"deptId"
)
Long
deptId
);
Integer
selectCurrentSumByName
(
@Param
(
"name"
)
String
name
,
@Param
(
"spec"
)
String
spec
,
@Param
(
"factoryName"
)
String
factoryName
,
@Param
(
"deptId"
)
Long
deptId
);
List
<
PhysicDestroyNumVO
>
selectDestroy
();
}
jmai-physic/src/main/java/com/jmai/physic/service/PhysicDestroyCheckService.java
View file @
90b819ae
...
...
@@ -3,14 +3,26 @@ package com.jmai.physic.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicCheckQueryReq
;
import
com.jmai.physic.dto.PhysicDestroyCheckCreateReq
;
import
com.jmai.physic.dto.PhysicDestroyCheckSignReq
;
import
com.jmai.physic.entity.PhysicDestroy
;
import
com.jmai.physic.entity.PhysicDestroyCheck
;
import
com.jmai.physic.vo.PhysicDestroyCheckVO
;
import
com.jmai.physic.vo.PhysicDestroyNumVO
;
import
com.jmai.sys.dto.ResponseData
;
import
com.jmai.sys.service.BaseService
;
import
java.util.List
;
public
interface
PhysicDestroyCheckService
extends
BaseService
<
PhysicDestroyCheck
>
{
void
create
(
PhysicDestroyCheckCreateReq
req
);
Page
<
PhysicDestroyCheckVO
>
listPage
(
PhysicCheckQueryReq
req
);
PhysicDestroyCheck
sign
(
PhysicDestroyCheckSignReq
physicDestroyCheckSignReq
);
PhysicDestroyCheck
getInfo
(
Long
id
);
List
<
PhysicDestroyNumVO
>
listDestroy
();
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicAmpouleServiceImpl.java
View file @
90b819ae
...
...
@@ -54,7 +54,7 @@ public class PhysicAmpouleServiceImpl extends AbstractService implements PhysicA
ampoule
.
setPhysicName
(
physic
.
getPhysicName
());
ampoule
.
setBatchNo
(
physic
.
getBatchNo
());
ampoule
.
setPhysicNum
(
physic
.
getPhysicNum
());
ampoule
.
setPhysiSpec
(
physic
.
getPhysicSpec
());
ampoule
.
setPhysi
c
Spec
(
physic
.
getPhysicSpec
());
ampoule
.
setPhysicType
(
physic
.
getPhysicType
());
physicAmpouleMapper
.
insert
(
ampoule
);
}
...
...
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicDestroyCheckServiceImpl.java
View file @
90b819ae
package
com
.
jmai
.
physic
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jmai.physic.dto.PhysicCheckQueryReq
;
import
com.jmai.physic.dto.PhysicDestroyCheckCreateReq
;
import
com.jmai.physic.entity.PhysicDestroy
;
import
com.jmai.physic.entity.PhysicDestroyCheck
;
import
com.jmai.physic.entity.PhysicDestroyCheckDetail
;
import
com.jmai.api.exception.ServiceException
;
import
com.jmai.physic.cloudsign.CloudsignService
;
import
com.jmai.physic.dto.*
;
import
com.jmai.physic.entity.*
;
import
com.jmai.physic.mapper.PhysicDestroyCheckMapper
;
import
com.jmai.physic.mapper.PhysicStorageAmpouleMapper
;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.service.PhysicDestroyCheckDetailService
;
import
com.jmai.physic.service.PhysicDestroyCheckService
;
import
com.jmai.physic.vo.PhysicDestroyCheckVO
;
import
com.jmai.physic.vo.PhysicDestroyNumVO
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.entity.SysUser
;
import
com.jmai.sys.mapper.SysUserMapper
;
import
com.jmai.sys.service.impl.BaseServiceImpl
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
static
com
.
jmai
.
sys
.
AbstractService
.
buildEmptyPage
;
...
...
@@ -29,6 +40,19 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
@Resource
private
PhysicDestroyCheckMapper
physicDestroyCheckMapper
;
@Resource
private
CloudsignService
cloudsignService
;
@Resource
private
PhysicBillService
physicBillService
;
@Resource
private
SysUserMapper
sysUserMapper
;
@Resource
private
PhysicStorageAmpouleMapper
physicStorageAmpouleMapper
;
@Transactional
@Override
public
void
create
(
PhysicDestroyCheckCreateReq
req
)
{
...
...
@@ -46,6 +70,107 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
Page
<
PhysicDestroyCheckVO
>
page
=
buildEmptyPage
(
req
);
Page
<
PhysicDestroyCheckVO
>
checkPage
=
physicDestroyCheckMapper
.
selectCheckPage
(
page
,
req
);
for
(
PhysicDestroyCheckVO
checkVO
:
checkPage
.
getRecords
())
{
List
<
PhysicDestroyCheckDetail
>
list
=
physicDestroyCheckDetailService
.
list
(
new
LambdaQueryWrapper
<
PhysicDestroyCheckDetail
>().
eq
(
PhysicDestroyCheckDetail:
:
getCheckId
,
checkVO
.
getId
()));
checkVO
.
setDestroyCheckDetailList
(
list
);
}
return
checkPage
;
}
@Override
public
PhysicDestroyCheck
sign
(
PhysicDestroyCheckSignReq
physicDestroyCheckSignReq
)
{
Boolean
f
=
false
;
Long
userId
=
SpringContextUtils
.
getUserId
();
String
getstamp
=
cloudsignService
.
sign
(
physicDestroyCheckSignReq
.
getEncryptedToken
(),
physicDestroyCheckSignReq
.
getRelBizNo
(),
physicDestroyCheckSignReq
.
getBase64SourceData
());
PhysicDestroyCheck
physicDestroyCheck
=
physicDestroyCheckMapper
.
selectById
(
physicDestroyCheckSignReq
.
getPhysicDestroyCheckId
());
SysUser
sysUser
=
sysUserMapper
.
selectById
(
userId
);
if
(
physicDestroyCheck
.
getStatus
().
equals
(
0
)){
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
XH
)){
throw
new
ServiceException
(
"需要销毁人权限才可进行签名"
);
}
physicDestroyCheck
.
setStatus
(
1
);
SignInfoDTO
signInfoDTO
=
new
SignInfoDTO
(
getstamp
,
LocalDateTime
.
now
(),
userId
);
physicDestroyCheck
.
setXhUser
(
JSONUtil
.
toJsonStr
(
signInfoDTO
));
}
else
if
(
physicDestroyCheck
.
getStatus
().
equals
(
1
)){
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
JD
)){
throw
new
ServiceException
(
"需要监督人权限才可进行签名"
);
}
physicDestroyCheck
.
setStatus
(
2
);
SignInfoDTO
signInfoDTO
=
new
SignInfoDTO
(
getstamp
,
LocalDateTime
.
now
(),
userId
);
physicDestroyCheck
.
setJdUser
(
JSONUtil
.
toJsonStr
(
signInfoDTO
));
}
else
if
(
physicDestroyCheck
.
getStatus
().
equals
(
2
))
{
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
YXBZR
))
{
throw
new
ServiceException
(
"需要药学部主任权限才可进行签名"
);
}
physicDestroyCheck
.
setStatus
(
3
);
SignInfoDTO
signInfoDTO
=
new
SignInfoDTO
(
getstamp
,
LocalDateTime
.
now
(),
userId
);
physicDestroyCheck
.
setYxbzrUser
(
JSONUtil
.
toJsonStr
(
signInfoDTO
));
}
else
if
(
physicDestroyCheck
.
getStatus
().
equals
(
3
)){
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
YWKKZ
)){
throw
new
ServiceException
(
"需要医务科科长权限才可进行签名"
);
}
physicDestroyCheck
.
setStatus
(
4
);
SignInfoDTO
signInfoDTO
=
new
SignInfoDTO
(
getstamp
,
LocalDateTime
.
now
(),
userId
);
physicDestroyCheck
.
setYwkkzUser
(
JSONUtil
.
toJsonStr
(
signInfoDTO
));
}
else
if
(
physicDestroyCheck
.
getStatus
().
equals
(
4
)){
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
BWKKZ
)){
throw
new
ServiceException
(
"需要保卫科科长权限才可进行签名"
);
}
physicDestroyCheck
.
setStatus
(
5
);
SignInfoDTO
signInfoDTO
=
new
SignInfoDTO
(
getstamp
,
LocalDateTime
.
now
(),
userId
);
physicDestroyCheck
.
setBwkkzUser
(
JSONUtil
.
toJsonStr
(
signInfoDTO
));
}
else
if
(
physicDestroyCheck
.
getStatus
().
equals
(
5
))
{
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
ZGYZ
))
{
throw
new
ServiceException
(
"需要主管院长权限才可进行签名"
);
}
physicDestroyCheck
.
setStatus
(
6
);
SignInfoDTO
signInfoDTO
=
new
SignInfoDTO
(
getstamp
,
LocalDateTime
.
now
(),
userId
);
physicDestroyCheck
.
setZgyzUser
(
JSONUtil
.
toJsonStr
(
signInfoDTO
));
f
=
true
;
}
if
(
f
){
BillDTO
billDTO
=
new
BillDTO
();
BeanUtil
.
copyProperties
(
physicDestroyCheck
,
billDTO
);
billDTO
.
setType
(
7
);
billDTO
.
setDeptId
(
physicDestroyCheck
.
getApplyDeptId
());
billDTO
.
setRefId
(
physicDestroyCheck
.
getId
());
physicBillService
.
createBill
(
billDTO
);
//创建销毁
List
<
PhysicDestroyCheckDetail
>
list
=
physicDestroyCheckDetailService
.
list
(
new
LambdaQueryWrapper
<
PhysicDestroyCheckDetail
>().
eq
(
PhysicDestroyCheckDetail:
:
getCheckId
,
physicDestroyCheck
.
getId
()));
for
(
PhysicDestroyCheckDetail
physicDestroyCheckDetail
:
list
)
{
PhysicStorageAmpoule
ampoule
=
new
PhysicStorageAmpoule
();
ampoule
.
setPhysicName
(
physicDestroyCheckDetail
.
getPhysicName
());
ampoule
.
setBatchNo
(
ampoule
.
getBatchNo
());
ampoule
.
setAcceptDeptId
(
sysUser
.
getDeptId
());
ampoule
.
setPhysicNum
(
physicDestroyCheckDetail
.
getPhysicNum
());
ampoule
.
setPhysicSpec
(
physicDestroyCheckDetail
.
getPhysicSpec
());
ampoule
.
setExpendNum
(
physicDestroyCheckDetail
.
getPhysicNum
());
ampoule
.
setType
(
2
);
ampoule
.
setDestroyStatus
(
1
);
Integer
batchNoSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByBatchNo
(
physicDestroyCheckDetail
.
getPhysicName
(),
physicDestroyCheckDetail
.
getPhysicSpec
(),
physicDestroyCheckDetail
.
getFactoryName
(),
physicDestroyCheckDetail
.
getBatchNo
(),
sysUser
.
getDeptId
());
Integer
physicSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByName
(
physicDestroyCheckDetail
.
getPhysicName
(),
physicDestroyCheckDetail
.
getPhysicSpec
(),
physicDestroyCheckDetail
.
getFactoryName
(),
sysUser
.
getDeptId
());
ampoule
.
setBatchBalance
(
batchNoSum
-
physicDestroyCheckDetail
.
getPhysicNum
());
ampoule
.
setPhysicNum
(
physicSum
-
physicDestroyCheckDetail
.
getPhysicNum
());
physicStorageAmpouleMapper
.
insert
(
ampoule
);
}
}
physicDestroyCheckMapper
.
updateById
(
physicDestroyCheck
);
return
getInfo
(
physicDestroyCheck
.
getId
());
}
@Override
public
PhysicDestroyCheck
getInfo
(
Long
id
)
{
PhysicDestroyCheck
check
=
physicDestroyCheckMapper
.
selectById
(
id
);
return
check
;
}
@Override
public
List
<
PhysicDestroyNumVO
>
listDestroy
()
{
List
<
PhysicDestroyNumVO
>
list
=
physicStorageAmpouleMapper
.
selectDestroy
();
return
list
;
}
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicStorageAmpouleServiceImpl.java
View file @
90b819ae
...
...
@@ -43,17 +43,45 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
@Transactional
@Override
public
void
create
(
PhysicStorageAmpouleCreateReq
req
)
{
for
(
PhysicStorageAmpouleCreateReq
.
Physic
physic
:
req
.
getPhysicList
())
{
Long
userId
=
SpringContextUtils
.
getUserId
();
SysUser
sysUser
=
sysUserMapper
.
selectById
(
userId
);
if
(
req
.
getType
()==
1
)
{
for
(
PhysicStorageAmpouleCreateReq
.
Physic
physic
:
req
.
getPhysicList
())
{
PhysicStorageAmpoule
ampoule
=
new
PhysicStorageAmpoule
();
BeanUtil
.
copyProperties
(
req
,
ampoule
);
BeanUtil
.
copyProperties
(
req
,
ampoule
);
ampoule
.
setPhysicName
(
physic
.
getPhysicName
());
ampoule
.
setBatchNo
(
physic
.
getBatchNo
());
ampoule
.
setAcceptDeptId
(
sysUser
.
getDeptId
());
ampoule
.
setPhysicNum
(
physic
.
getPhysicNum
());
ampoule
.
setPhysicSpec
(
physic
.
getPhysicSpec
());
ampoule
.
setPhysicType
(
physic
.
getPhysicType
());
ampoule
.
setAcquireNum
(
physic
.
getPhysicNum
());
Integer
batchNoSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByBatchNo
(
physic
.
getPhysicName
(),
physic
.
getPhysicSpec
(),
physic
.
getFactoryName
(),
physic
.
getBatchNo
(),
sysUser
.
getDeptId
());
Integer
physicSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByName
(
physic
.
getPhysicName
(),
physic
.
getPhysicSpec
(),
physic
.
getFactoryName
(),
sysUser
.
getDeptId
());
ampoule
.
setBatchBalance
(
batchNoSum
+
physic
.
getPhysicNum
());
ampoule
.
setPhysicNum
(
physicSum
+
physic
.
getPhysicNum
());
physicStorageAmpouleMapper
.
insert
(
ampoule
);
}
}
if
(
req
.
getType
()==
2
)
{
for
(
PhysicStorageAmpouleCreateReq
.
Physic
physic
:
req
.
getPhysicList
())
{
PhysicStorageAmpoule
ampoule
=
new
PhysicStorageAmpoule
();
BeanUtil
.
copyProperties
(
req
,
ampoule
);
ampoule
.
setPhysicName
(
physic
.
getPhysicName
());
ampoule
.
setBatchNo
(
physic
.
getBatchNo
());
ampoule
.
setTransferDeptId
(
sysUser
.
getDeptId
());
ampoule
.
setAcceptDeptId
(
sysUser
.
getDeptId
());
ampoule
.
setPhysicNum
(
physic
.
getPhysicNum
());
ampoule
.
setPhysicSpec
(
physic
.
getPhysicSpec
());
ampoule
.
setPhysicType
(
physic
.
getPhysicType
());
ampoule
.
setAcquireNum
(
physic
.
getPhysicNum
());
Integer
batchNoSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByBatchNo
(
physic
.
getPhysicName
(),
physic
.
getPhysicSpec
(),
physic
.
getFactoryName
(),
physic
.
getBatchNo
(),
sysUser
.
getDeptId
());
Integer
physicSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByName
(
physic
.
getPhysicName
(),
physic
.
getPhysicSpec
(),
physic
.
getFactoryName
(),
sysUser
.
getDeptId
());
ampoule
.
setBatchBalance
(
batchNoSum
-
physic
.
getPhysicNum
());
ampoule
.
setPhysicNum
(
physicSum
-
physic
.
getPhysicNum
());
physicStorageAmpouleMapper
.
insert
(
ampoule
);
}
}
}
...
...
@@ -71,6 +99,9 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
Long
userId
=
SpringContextUtils
.
getUserId
();
String
getstamp
=
cloudsignService
.
sign
(
physicStorageAmpouleSignReq
.
getEncryptedToken
(),
physicStorageAmpouleSignReq
.
getRelBizNo
(),
physicStorageAmpouleSignReq
.
getBase64SourceData
());
PhysicStorageAmpoule
ampoule
=
getInfo
(
physicStorageAmpouleSignReq
.
getPhysicStorageAmpouleId
());
if
(
ampoule
.
getType
()==
2
&&
ampoule
.
getDestroyStatus
()==
1
){
throw
new
ServiceException
(
"已销毁记录不需要签名"
);
}
SysUser
sysUser
=
sysUserMapper
.
selectById
(
userId
);
if
(
ampoule
.
getStatus
().
equals
(
0
)){
if
(!
RoleTypeEum
.
isPass
(
sysUser
.
getRoleAsList
(),
RoleTypeEum
.
JS
)){
...
...
@@ -92,7 +123,7 @@ public class PhysicStorageAmpouleServiceImpl extends AbstractService implements
BillDTO
billDTO
=
new
BillDTO
();
BeanUtil
.
copyProperties
(
ampoule
,
billDTO
);
billDTO
.
setType
(
ampoule
.
getType
().
equals
(
"1"
)?
5
:
7
);
billDTO
.
setDeptId
(
ampoule
.
getDeptId
());
billDTO
.
setDeptId
(
ampoule
.
get
Accept
DeptId
());
billDTO
.
setRefId
(
ampoule
.
getId
());
physicBillService
.
createBill
(
billDTO
);
}
...
...
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicDestroyCheckVO.java
View file @
90b819ae
package
com
.
jmai
.
physic
.
vo
;
import
com.jmai.physic.entity.PhysicDestroyCheck
;
import
com.jmai.physic.entity.PhysicDestroyCheckDetail
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
PhysicDestroyCheckVO
extends
PhysicDestroyCheck
{
private
String
createName
;
private
List
<
PhysicDestroyCheckDetail
>
destroyCheckDetailList
;
}
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicDestroyNumVO.java
0 → 100644
View file @
90b819ae
package
com
.
jmai
.
physic
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
PhysicDestroyNumVO
{
@ApiModelProperty
(
value
=
"药品名称"
)
private
String
physicName
;
@ApiModelProperty
(
value
=
"规格"
)
private
String
physicSpec
;
@ApiModelProperty
(
value
=
"批号"
)
private
String
batchNo
;
private
String
factoryName
;
private
String
unit
;
private
String
remark
;
@ApiModelProperty
(
value
=
"销毁数量"
)
private
Integer
destroyNum
;
}
jmai-physic/src/main/java/com/jmai/physic/vo/PhysicStorageAmpouleVO.java
View file @
90b819ae
...
...
@@ -6,4 +6,5 @@ import lombok.Data;
@Data
public
class
PhysicStorageAmpouleVO
extends
PhysicStorageAmpoule
{
private
String
createName
;
private
String
deptName
;
}
jmai-physic/src/main/resources/mapper/PhysicStorageAmpouleMapper.xml
View file @
90b819ae
...
...
@@ -4,7 +4,10 @@
<select
id=
"selectAmpoulePage"
resultType=
"com.jmai.physic.vo.PhysicStorageAmpouleVO"
>
select a.*,b.name as createName from physic_storage_ampoule a left join sys_user b on a.create_by =b.id
select a.*,b.name as createName,(select dept_name from sys_dept d where d.id = a.transfer_dept_id) as deptName
from
physic_storage_ampoule
a left join sys_user b on a.create_by =b.id
where
a.del_flag = 0
<if
test=
"req.dateTime != null "
>
...
...
@@ -14,8 +17,25 @@
and a.physic_name LIKE CONCAT('%', #{req.physicName}, '%')
</if>
<if
test=
"req.deptId!=null"
>
and a.dept_id = #{req.deptId}
and a.
transfer_
dept_id = #{req.deptId}
</if>
order by a.create_time desc
</select>
<select
id=
"selectCurrentSumByBatchNo"
resultType=
"java.lang.Integer"
>
select (IFNULL(sum(acquire_num),0) - IFNULL(sum(expend_num),0)) from physic_storage_ampoule where
physic_name=#{name} and physic_spec=#{spec} and batch_no=#{batchNo} and factory_name =#{factoryName} and accept_dept_id =#{deptId}
</select>
<select
id=
"selectCurrentSumByName"
resultType=
"java.lang.Integer"
>
select (IFNULL(sum(acquire_num),0) - IFNULL(sum(expend_num),0)) from physic_storage_ampoule where
physic_name=#{name} and physic_spec=#{spec} and factory_name =#{factoryName} and accept_dept_id =#{deptId}
</select>
<select
id=
"selectDestroy"
resultType=
"com.jmai.physic.vo.PhysicDestroyNumVO"
>
select physic_name,physic_spec,batch_no,factory_name,unit,remark from physic_storage_ampoule
where type =2 and destroy_status =0
gropu by physic_name,physic_spec,batch_no,factory_name,accept_dept_id
</select>
</mapper>
jmai-sys/src/main/java/com/jmai/sys/service/impl/UserServiceImpl.java
View file @
90b819ae
...
...
@@ -283,7 +283,7 @@ public class UserServiceImpl extends AbstractService implements UserService {
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getKeyword
()),
SysUser:
:
getMobile
,
req
.
getKeyword
())
// 过滤非系统管理员
.
ne
(!
SpringContextUtils
.
isPlatformAdmin
(),
SysUser:
:
getType
,
PLATFORM_ADMIN
.
getCode
())
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getStatus
()),
SysUser:
:
getStatus
,
req
.
getStatus
());
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getStatus
()),
SysUser:
:
getStatus
,
req
.
getStatus
())
.
orderByDesc
(
SysUser:
:
getCreateTime
)
;
}
@Override
...
...
logs/jmai/error.log
View file @
90b819ae
This diff is collapsed.
Click to expand it.
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