Commit 42321050 by zhu.zewen

修复销毁审批详情原因

parent 24c71c79
......@@ -31,4 +31,7 @@ public class PhysicDestroyCheckDetail extends BaseVersionEntity {
private String batchNo;
@ApiModelProperty(value = "销毁数量")
private Integer destroyNum;
@ApiModelProperty(value = "原因")
private String reason;
}
......@@ -84,7 +84,10 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
this.save(check);
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());
}
......@@ -178,31 +181,31 @@ public class PhysicDestroyCheckServiceImpl extends BaseServiceImpl<PhysicDestroy
//创建销毁
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();
ampoule.setPhysicName(physicDestroyCheckDetail.getPhysicName());
ampoule.setPhysicSpec(physicDestroyCheckDetail.getPhysicSpec());
ampoule.setPhysicType(physicDestroyCheckDetail.getPhysicType());
ampoule.setUnit(physicDestroyCheckDetail.getUnit());
ampoule.setFactoryName(physicDestroyCheckDetail.getFactoryName());
ampoule.setExpireDate(physicDestroyCheckDetail.getExpireDate());
ampoule.setPhysicName(detail.getPhysicName());
ampoule.setPhysicSpec(detail.getPhysicSpec());
ampoule.setPhysicType(detail.getPhysicType());
ampoule.setUnit(detail.getUnit());
ampoule.setFactoryName(detail.getFactoryName());
ampoule.setExpireDate(detail.getExpireDate());
ampoule.setBatchNo(ampoule.getBatchNo());
ampoule.setPhysicNum(physicDestroyCheckDetail.getDestroyNum());
ampoule.setBatchNo(detail.getBatchNo());
ampoule.setPhysicNum(detail.getDestroyNum());
ampoule.setOrderNo(physicDestroyCheck.getOrderNo());
ampoule.setTransferDeptId(physicDestroyCheck.getApplyDeptId());
ampoule.setAcceptDeptId(sysUser.getDeptId());
ampoule.setExpendNum(physicDestroyCheckDetail.getDestroyNum());
ampoule.setExpendNum(detail.getDestroyNum());
ampoule.setRecycleReceiptNum(null);
ampoule.setType(2);
ampoule.setDestroyStatus(1);
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.getDestroyNum());
ampoule.setPhysicBalance(physicSum - physicDestroyCheckDetail.getDestroyNum());
Integer batchNoSum = physicStorageAmpouleMapper.selectCurrentSumByBatchNo(detail.getPhysicName(), detail.getPhysicSpec(), detail.getFactoryName(), detail.getBatchNo());
Integer physicSum = physicStorageAmpouleMapper.selectCurrentSumByName(detail.getPhysicName(), detail.getPhysicSpec(), detail.getFactoryName());
ampoule.setBatchBalance(batchNoSum - detail.getDestroyNum());
ampoule.setPhysicBalance(physicSum - detail.getDestroyNum());
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