Commit 42321050 by zhu.zewen

修复销毁审批详情原因

parent 24c71c79
...@@ -31,4 +31,7 @@ public class PhysicDestroyCheckDetail extends BaseVersionEntity { ...@@ -31,4 +31,7 @@ public class PhysicDestroyCheckDetail extends BaseVersionEntity {
private String batchNo; private String batchNo;
@ApiModelProperty(value = "销毁数量") @ApiModelProperty(value = "销毁数量")
private Integer destroyNum; private Integer destroyNum;
@ApiModelProperty(value = "原因")
private String reason;
} }
...@@ -84,7 +84,10 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy ...@@ -84,7 +84,10 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
this.save(check); this.save(check);
if (CollectionUtils.isNotEmpty(req.getCheckDetailList())) { if (CollectionUtils.isNotEmpty(req.getCheckDetailList())) {
req.getCheckDetailList().forEach(detail -> detail.setCheckId(check.getId())); req.getCheckDetailList().forEach(detail -> {
detail.setCheckId(check.getId());
detail.setReason(check.getApplyReason());
});
physicDestroyCheckDetailService.saveBatch(req.getCheckDetailList()); physicDestroyCheckDetailService.saveBatch(req.getCheckDetailList());
} }
...@@ -178,31 +181,31 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy ...@@ -178,31 +181,31 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
//创建销毁 //创建销毁
List<PhysicDestroyCheckDetail> list = physicDestroyCheckDetailService.list(new LambdaQueryWrapper<PhysicDestroyCheckDetail>().eq(PhysicDestroyCheckDetail::getCheckId, physicDestroyCheck.getId())); List<PhysicDestroyCheckDetail> list = physicDestroyCheckDetailService.list(new LambdaQueryWrapper<PhysicDestroyCheckDetail>().eq(PhysicDestroyCheckDetail::getCheckId, physicDestroyCheck.getId()));
for (PhysicDestroyCheckDetail physicDestroyCheckDetail : list) { for (PhysicDestroyCheckDetail detail : list) {
PhysicStorageAmpoule ampoule = new PhysicStorageAmpoule(); PhysicStorageAmpoule ampoule = new PhysicStorageAmpoule();
ampoule.setPhysicName(physicDestroyCheckDetail.getPhysicName()); ampoule.setPhysicName(detail.getPhysicName());
ampoule.setPhysicSpec(physicDestroyCheckDetail.getPhysicSpec()); ampoule.setPhysicSpec(detail.getPhysicSpec());
ampoule.setPhysicType(physicDestroyCheckDetail.getPhysicType()); ampoule.setPhysicType(detail.getPhysicType());
ampoule.setUnit(physicDestroyCheckDetail.getUnit()); ampoule.setUnit(detail.getUnit());
ampoule.setFactoryName(physicDestroyCheckDetail.getFactoryName()); ampoule.setFactoryName(detail.getFactoryName());
ampoule.setExpireDate(physicDestroyCheckDetail.getExpireDate()); ampoule.setExpireDate(detail.getExpireDate());
ampoule.setBatchNo(ampoule.getBatchNo()); ampoule.setBatchNo(detail.getBatchNo());
ampoule.setPhysicNum(physicDestroyCheckDetail.getDestroyNum()); ampoule.setPhysicNum(detail.getDestroyNum());
ampoule.setOrderNo(physicDestroyCheck.getOrderNo()); ampoule.setOrderNo(physicDestroyCheck.getOrderNo());
ampoule.setTransferDeptId(physicDestroyCheck.getApplyDeptId()); ampoule.setTransferDeptId(physicDestroyCheck.getApplyDeptId());
ampoule.setAcceptDeptId(sysUser.getDeptId()); ampoule.setAcceptDeptId(sysUser.getDeptId());
ampoule.setExpendNum(physicDestroyCheckDetail.getDestroyNum()); ampoule.setExpendNum(detail.getDestroyNum());
ampoule.setRecycleReceiptNum(null); ampoule.setRecycleReceiptNum(null);
ampoule.setType(2); ampoule.setType(2);
ampoule.setDestroyStatus(1); ampoule.setDestroyStatus(1);
Integer batchNoSum = physicStorageAmpouleMapper.selectCurrentSumByBatchNo(physicDestroyCheckDetail.getPhysicName(), physicDestroyCheckDetail.getPhysicSpec(), physicDestroyCheckDetail.getFactoryName(), physicDestroyCheckDetail.getBatchNo()); Integer batchNoSum = physicStorageAmpouleMapper.selectCurrentSumByBatchNo(detail.getPhysicName(), detail.getPhysicSpec(), detail.getFactoryName(), detail.getBatchNo());
Integer physicSum = physicStorageAmpouleMapper.selectCurrentSumByName(physicDestroyCheckDetail.getPhysicName(), physicDestroyCheckDetail.getPhysicSpec(), physicDestroyCheckDetail.getFactoryName()); Integer physicSum = physicStorageAmpouleMapper.selectCurrentSumByName(detail.getPhysicName(), detail.getPhysicSpec(), detail.getFactoryName());
ampoule.setBatchBalance(batchNoSum - physicDestroyCheckDetail.getDestroyNum()); ampoule.setBatchBalance(batchNoSum - detail.getDestroyNum());
ampoule.setPhysicBalance(physicSum - physicDestroyCheckDetail.getDestroyNum()); ampoule.setPhysicBalance(physicSum - detail.getDestroyNum());
physicStorageAmpouleMapper.insert(ampoule); physicStorageAmpouleMapper.insert(ampoule);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment