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
e2dfda9c
authored
Jan 23, 2026
by
zhu.zewen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
药品专用登记区分科室和药房,以及对应专账也区分
parent
d4ed9eaa
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
14 deletions
jmai-physic/src/main/java/com/jmai/physic/dto/BillDTO.java
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicRecord.java
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicRecordServiceImpl.java
jmai-sys/src/main/java/com/jmai/sys/consts/enums/DeptEnum.java
jmai-physic/src/main/java/com/jmai/physic/dto/BillDTO.java
View file @
e2dfda9c
...
@@ -29,7 +29,8 @@ public class BillDTO {
...
@@ -29,7 +29,8 @@ public class BillDTO {
@ApiModelProperty
(
value
=
"药品数量"
)
@ApiModelProperty
(
value
=
"药品数量"
)
private
Integer
physicNum
;
private
Integer
physicNum
;
@ApiModelProperty
(
value
=
"类型:1-采购入库、2-申领入库、3-申领出库、4-使用出库、5-回收空安瓿、6-退回空安瓿、7-销毁空安瓿"
)
@ApiModelProperty
(
value
=
"类型:1-采购入库、2-申领入库、3-申领出库、4-药品专用登记(科室)"
+
"、5-回收空安瓿、6-退回空安瓿、7-销毁空安瓿、8-药品专用登记(药房)"
)
private
Integer
type
;
private
Integer
type
;
@ApiModelProperty
(
value
=
"相关申请、入库等表id"
)
@ApiModelProperty
(
value
=
"相关申请、入库等表id"
)
...
...
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicRecord.java
View file @
e2dfda9c
...
@@ -10,7 +10,7 @@ import lombok.Data;
...
@@ -10,7 +10,7 @@ import lombok.Data;
@ApiModel
(
description
=
"药品专用登记"
)
@ApiModel
(
description
=
"药品专用登记"
)
@TableName
(
"physic_record"
)
@TableName
(
"physic_record"
)
public
class
PhysicRecord
extends
BaseVersionEntity
{
public
class
PhysicRecord
extends
BaseVersionEntity
{
@ApiModelProperty
(
value
=
"
部门ID
"
)
@ApiModelProperty
(
value
=
"
所属部门ID(科室、药房)
"
)
private
Long
deptId
;
private
Long
deptId
;
@ApiModelProperty
(
value
=
"药品名称"
)
@ApiModelProperty
(
value
=
"药品名称"
)
...
@@ -51,6 +51,9 @@ public class PhysicRecord extends BaseVersionEntity {
...
@@ -51,6 +51,9 @@ public class PhysicRecord extends BaseVersionEntity {
@ApiModelProperty
(
value
=
"处方医生"
)
@ApiModelProperty
(
value
=
"处方医生"
)
private
String
prescriptionDoctor
;
private
String
prescriptionDoctor
;
@ApiModelProperty
(
value
=
"关联科室专用登记(药房时不为空)"
)
private
Long
relatedRecordId
;
@ApiModelProperty
(
value
=
"状态:0-待调配、1-待发药、2- 待验收、3- 待复核、100-已完成"
)
@ApiModelProperty
(
value
=
"状态:0-待调配、1-待发药、2- 待验收、3- 待复核、100-已完成"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
value
=
"调配人"
)
@ApiModelProperty
(
value
=
"调配人"
)
...
...
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicRecordServiceImpl.java
View file @
e2dfda9c
...
@@ -19,6 +19,7 @@ import com.jmai.physic.vo.PhysicRecordVO;
...
@@ -19,6 +19,7 @@ import com.jmai.physic.vo.PhysicRecordVO;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.consts.BizFileTypes
;
import
com.jmai.sys.consts.BizFileTypes
;
import
com.jmai.sys.consts.enums.DeptEnum
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.ctx.SpringContextUtils
;
import
com.jmai.sys.dto.BizFileDto
;
import
com.jmai.sys.dto.BizFileDto
;
...
@@ -52,13 +53,13 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
...
@@ -52,13 +53,13 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
public
List
<
PhysicRecord
>
physicRecordCreate
(
PhysicRecordCreateReq
req
)
{
public
List
<
PhysicRecord
>
physicRecordCreate
(
PhysicRecordCreateReq
req
)
{
List
<
PhysicRecord
>
records
=
new
ArrayList
<>();
List
<
PhysicRecord
>
records
=
new
ArrayList
<>();
for
(
PhysicRecordCreateReq
.
Physic
physic
:
req
.
getPhysicList
())
{
for
(
PhysicRecordCreateReq
.
Physic
physic
:
req
.
getPhysicList
())
{
// 1)科室专账
// 1)科室专账
(deptId=科室)
// 专账类型:2-药房,3-科室(参考组织部门)
// 专账类型:2-药房,3-科室(参考组织部门)
PhysicRecord
r
ecord
=
newRecord
(
req
,
physic
,
3
);
PhysicRecord
ksR
ecord
=
newRecord
(
req
,
physic
,
3
);
physicRecordMapper
.
insert
(
r
ecord
);
physicRecordMapper
.
insert
(
ksR
ecord
);
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
bizFileService
.
addBizFilesIfAbsent
(
BizFileTypes
.
PHYSIC_RECORD_IMAGE
,
r
ecord
.
getId
().
toString
(),
req
.
getPrescriptionImages
());
bizFileService
.
addBizFilesIfAbsent
(
BizFileTypes
.
PHYSIC_RECORD_IMAGE
,
ksR
ecord
.
getId
().
toString
(),
req
.
getPrescriptionImages
());
}
}
}
}
...
@@ -66,18 +67,20 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
...
@@ -66,18 +67,20 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getSign
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getSign
()))
{
PhysicRecordSignReq
signReq
=
new
PhysicRecordSignReq
();
PhysicRecordSignReq
signReq
=
new
PhysicRecordSignReq
();
copyTo
(
req
.
getSign
(),
signReq
);
copyTo
(
req
.
getSign
(),
signReq
);
signReq
.
setPhysicRecordId
(
r
ecord
.
getId
());
signReq
.
setPhysicRecordId
(
ksR
ecord
.
getId
());
sign
(
signReq
);
sign
(
signReq
);
}
}
records
.
add
(
r
ecord
);
records
.
add
(
ksR
ecord
);
// 2)药房专账
// 2)药房专账(deptId=药房)
PhysicRecord
dupRecord
=
newRecord
(
req
,
physic
,
2
);
PhysicRecord
yfRecord
=
newRecord
(
req
,
physic
,
2
);
physicRecordMapper
.
insert
(
dupRecord
);
// 关联科室专账
yfRecord
.
setRelatedRecordId
(
ksRecord
.
getId
());
physicRecordMapper
.
insert
(
yfRecord
);
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
if
(
ObjectUtil
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
if
(
CollectionUtils
.
isNotEmpty
(
req
.
getPrescriptionImages
()))
{
bizFileService
.
addBizFilesIfAbsent
(
BizFileTypes
.
PHYSIC_RECORD_IMAGE
,
dup
Record
.
getId
().
toString
(),
req
.
getPrescriptionImages
());
bizFileService
.
addBizFilesIfAbsent
(
BizFileTypes
.
PHYSIC_RECORD_IMAGE
,
yf
Record
.
getId
().
toString
(),
req
.
getPrescriptionImages
());
}
}
}
}
}
}
...
@@ -87,7 +90,15 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
...
@@ -87,7 +90,15 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
private
PhysicRecord
newRecord
(
PhysicRecordCreateReq
req
,
PhysicRecordCreateReq
.
Physic
physic
,
Integer
type
)
{
private
PhysicRecord
newRecord
(
PhysicRecordCreateReq
req
,
PhysicRecordCreateReq
.
Physic
physic
,
Integer
type
)
{
PhysicRecord
record
=
new
PhysicRecord
();
PhysicRecord
record
=
new
PhysicRecord
();
BeanUtil
.
copyProperties
(
req
,
record
);
BeanUtil
.
copyProperties
(
req
,
record
);
record
.
setDeptId
(
SpringContextUtils
.
getDeptId
());
if
(
ObjectUtil
.
equals
(
type
,
2
))
{
// 药房
Long
yfDeptId
=
DeptEnum
.
YF
.
getCode
();
record
.
setDeptId
(
yfDeptId
);
}
else
{
// 用户所属科室
Long
ksDeptId
=
SpringContextUtils
.
getDeptId
();
record
.
setDeptId
(
ksDeptId
);
}
record
.
setPhysicName
(
physic
.
getPhysicName
());
record
.
setPhysicName
(
physic
.
getPhysicName
());
record
.
setPhysicSpec
(
physic
.
getPhysicSpec
());
record
.
setPhysicSpec
(
physic
.
getPhysicSpec
());
record
.
setPhysicType
(
physic
.
getPhysicType
());
record
.
setPhysicType
(
physic
.
getPhysicType
());
...
@@ -182,7 +193,7 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
...
@@ -182,7 +193,7 @@ public class PhysicRecordServiceImpl extends AbstractService implements PhysicRe
// 5)完成 => 生成专账
// 5)完成 => 生成专账
BillDTO
billDTO
=
new
BillDTO
();
BillDTO
billDTO
=
new
BillDTO
();
BeanUtil
.
copyProperties
(
physicRecord
,
billDTO
);
BeanUtil
.
copyProperties
(
physicRecord
,
billDTO
);
billDTO
.
setType
(
4
);
billDTO
.
setType
(
ObjectUtil
.
equals
(
physicRecord
.
getType
(),
2
)
?
8
:
4
);
billDTO
.
setDeptId
(
physicRecord
.
getDeptId
());
billDTO
.
setDeptId
(
physicRecord
.
getDeptId
());
billDTO
.
setRefId
(
physicRecord
.
getId
());
billDTO
.
setRefId
(
physicRecord
.
getId
());
physicBillService
.
createBill
(
billDTO
);
physicBillService
.
createBill
(
billDTO
);
...
...
jmai-sys/src/main/java/com/jmai/sys/consts/enums/DeptEnum.java
0 → 100644
View file @
e2dfda9c
package
com
.
jmai
.
sys
.
consts
.
enums
;
import
lombok.Getter
;
/**
* 部门枚举
* @author Qoder
*/
@Getter
public
enum
DeptEnum
{
YK
(
1
,
"药库"
),
YF
(
2
,
"药房"
),
KS
(
3
,
"科室"
);
private
long
code
;
private
String
msg
;
DeptEnum
(
long
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
/**
* 根据编码获取枚举值
* @param code 编码
* @return 枚举值
*/
public
static
DeptEnum
getEnum
(
long
code
)
{
for
(
DeptEnum
enums
:
DeptEnum
.
values
())
{
if
(
enums
.
getCode
()
==
code
)
{
return
enums
;
}
}
return
null
;
}
}
\ 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