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
8dbe3e15
authored
Jan 16, 2026
by
zhu.zewen
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
修复药品数据统计
parent
2b37ca2a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
18 deletions
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicAmpoule.java
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicDestroyCheckDetail.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/resources/mapper/PhysicAmpouleMapper.xml
jmai-physic/src/main/resources/mapper/PhysicStorageAmpouleMapper.xml
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicAmpoule.java
View file @
8dbe3e15
...
...
@@ -32,7 +32,7 @@ public class PhysicAmpoule extends BaseVersionEntity {
@ApiModelProperty
(
value
=
"药品数量"
)
private
Integer
physicNum
;
@ApiModelProperty
(
value
=
"类型"
)
@ApiModelProperty
(
value
=
"类型
:1-接收、2-退回
"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"订单号"
)
private
String
orderNo
;
...
...
jmai-physic/src/main/java/com/jmai/physic/entity/PhysicDestroyCheckDetail.java
View file @
8dbe3e15
...
...
@@ -29,6 +29,6 @@ public class PhysicDestroyCheckDetail extends BaseVersionEntity {
@ApiModelProperty
(
value
=
"批号"
)
private
String
batchNo
;
@ApiModelProperty
(
value
=
"
药品
数量"
)
private
Integer
physic
Num
;
@ApiModelProperty
(
value
=
"
销毁
数量"
)
private
Integer
destroy
Num
;
}
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicAmpouleServiceImpl.java
View file @
8dbe3e15
...
...
@@ -17,7 +17,6 @@ import com.jmai.physic.service.PhysicAmpouleService;
import
com.jmai.physic.service.PhysicBillService
;
import
com.jmai.physic.vo.PhysicAmpouleUseVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicAmpouleVO
;
import
com.jmai.physic.vo.PhysicVO
;
import
com.jmai.sys.AbstractService
;
import
com.jmai.sys.consts.enums.RoleTypeEum
;
...
...
jmai-physic/src/main/java/com/jmai/physic/service/impl/PhysicDestroyCheckServiceImpl.java
View file @
8dbe3e15
...
...
@@ -70,7 +70,7 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
@Override
public
void
create
(
PhysicDestroyCheckCreateReq
req
)
{
String
orderNo
=
sysManager
.
newOrderNo
(
PhysicDestroyCheck
.
class
);
int
destroyNum
=
req
.
getCheckDetailList
().
stream
().
mapToInt
(
PhysicDestroyCheckDetail:
:
get
Physic
Num
).
sum
();
int
destroyNum
=
req
.
getCheckDetailList
().
stream
().
mapToInt
(
PhysicDestroyCheckDetail:
:
get
Destroy
Num
).
sum
();
PhysicDestroyCheck
check
=
new
PhysicDestroyCheck
();
BeanUtil
.
copyProperties
(
req
,
check
);
...
...
@@ -188,12 +188,12 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
ampoule
.
setExpireDate
(
physicDestroyCheckDetail
.
getExpireDate
());
ampoule
.
setBatchNo
(
ampoule
.
getBatchNo
());
ampoule
.
setPhysicNum
(
physicDestroyCheckDetail
.
get
Physic
Num
());
ampoule
.
setPhysicNum
(
physicDestroyCheckDetail
.
get
Destroy
Num
());
ampoule
.
setOrderNo
(
physicDestroyCheck
.
getOrderNo
());
ampoule
.
setTransferDeptId
(
physicDestroyCheck
.
getApplyDeptId
());
ampoule
.
setAcceptDeptId
(
sysUser
.
getDeptId
());
ampoule
.
setExpendNum
(
physicDestroyCheckDetail
.
get
Physic
Num
());
ampoule
.
setExpendNum
(
physicDestroyCheckDetail
.
get
Destroy
Num
());
ampoule
.
setRecycleReceiptNum
(
null
);
ampoule
.
setType
(
2
);
...
...
@@ -201,8 +201,8 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
Integer
batchNoSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByBatchNo
(
physicDestroyCheckDetail
.
getPhysicName
(),
physicDestroyCheckDetail
.
getPhysicSpec
(),
physicDestroyCheckDetail
.
getFactoryName
(),
physicDestroyCheckDetail
.
getBatchNo
());
Integer
physicSum
=
physicStorageAmpouleMapper
.
selectCurrentSumByName
(
physicDestroyCheckDetail
.
getPhysicName
(),
physicDestroyCheckDetail
.
getPhysicSpec
(),
physicDestroyCheckDetail
.
getFactoryName
());
ampoule
.
setBatchBalance
(
batchNoSum
-
physicDestroyCheckDetail
.
get
Physic
Num
());
ampoule
.
setPhysicBalance
(
physicSum
-
physicDestroyCheckDetail
.
get
Physic
Num
());
ampoule
.
setBatchBalance
(
batchNoSum
-
physicDestroyCheckDetail
.
get
Destroy
Num
());
ampoule
.
setPhysicBalance
(
physicSum
-
physicDestroyCheckDetail
.
get
Destroy
Num
());
physicStorageAmpouleMapper
.
insert
(
ampoule
);
}
}
...
...
jmai-physic/src/main/resources/mapper/PhysicAmpouleMapper.xml
View file @
8dbe3e15
...
...
@@ -33,12 +33,23 @@
</select>
<select
id=
"selectCurrentSumByBatchNo"
resultType=
"java.lang.Integer"
>
select IFNULL(sum(physic_num),0) from physic_ampoule where
physic_name=#{name} and physic_spec=#{spec} and batch_no=#{batchNo} and factory_name =#{factoryName}
SELECT
IFNULL(SUM(CASE WHEN type = 1 THEN physic_num WHEN type = 2 THEN -physic_num ELSE 0 END), 0)
FROM physic_ampoule
WHERE status=100
AND physic_name=#{name}
AND physic_spec=#{spec}
AND factory_name =#{factoryName}
AND batch_no=#{batchNo}
</select>
<select
id=
"selectCurrentSumByName"
resultType=
"java.lang.Integer"
>
select IFNULL(sum(physic_num),0) from physic_ampoule where
physic_name=#{name} and physic_spec=#{spec} and factory_name =#{factoryName}
SELECT
IFNULL(SUM(CASE WHEN type = 1 THEN physic_num WHEN type = 2 THEN -physic_num ELSE 0 END), 0)
FROM physic_ampoule
WHERE status=100
AND physic_name=#{name}
AND physic_spec=#{spec}
AND factory_name =#{factoryName}
</select>
</mapper>
jmai-physic/src/main/resources/mapper/PhysicStorageAmpouleMapper.xml
View file @
8dbe3e15
...
...
@@ -23,13 +23,23 @@
</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}
SELECT
IFNULL(SUM(CASE WHEN type = 1 THEN physic_num WHEN type = 2 THEN -physic_num ELSE 0 END), 0)
FROM physic_storage_ampoule
WHERE status=100
AND physic_name=#{name}
AND physic_spec=#{spec}
AND factory_name =#{factoryName}
AND batch_no=#{batchNo}
</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}
SELECT
IFNULL(SUM(CASE WHEN type = 1 THEN physic_num WHEN type = 2 THEN -physic_num ELSE 0 END), 0)
FROM physic_storage_ampoule
WHERE status=100
AND physic_name=#{name}
AND physic_spec=#{spec}
AND factory_name =#{factoryName}
</select>
<select
id=
"selectDestroy"
resultType=
"com.jmai.physic.vo.PhysicDestroyNumVO"
>
...
...
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