单据维护删除系统繁忙问题

dev
anthonywj 2 years ago
parent 5ca5575e96
commit 24739fb392

@ -301,13 +301,20 @@ public class IoOrderServiceImpl implements IoOrderService {
//更新扫码单据详情 //更新扫码单据详情
IoOrderDetailCodeEntity ioOrderDetailCodeEntity = ioOrderDetailCodeService.findByUnique(ioCodeEntity.getOrderId(), ioCodeEntity.getRelId(), ioCodeEntity.getBatchNo()); IoOrderDetailCodeEntity ioOrderDetailCodeEntity = ioOrderDetailCodeService.findByUnique(ioCodeEntity.getOrderId(), ioCodeEntity.getRelId(), ioCodeEntity.getBatchNo());
ioOrderDetailCodeEntity.setReCount(ioOrderDetailCodeEntity.getReCount() - reCount);
ioOrderDetailCodeService.update(ioOrderDetailCodeEntity); if (ioOrderDetailCodeEntity != null) {
ioOrderDetailCodeEntity.setReCount(ioOrderDetailCodeEntity.getReCount() - reCount);
ioOrderDetailCodeService.update(ioOrderDetailCodeEntity);
}
//更新结果详情 //更新结果详情
IoOrderDetailResultEntity ioOrderDetailResultEntity = ioOrderDetailResultService.findByUnique(ioCodeEntity.getOrderId(), ioCodeEntity.getRelId(), ioCodeEntity.getBatchNo()); IoOrderDetailResultEntity ioOrderDetailResultEntity = ioOrderDetailResultService.findByUnique(ioCodeEntity.getOrderId(), ioCodeEntity.getRelId(), ioCodeEntity.getBatchNo());
ioOrderDetailResultEntity.setReCount(ioOrderDetailResultEntity.getReCount() - reCount); if (ioOrderDetailResultEntity != null) {
ioOrderDetailResultService.update(ioOrderDetailResultEntity); ioOrderDetailResultEntity.setReCount(ioOrderDetailResultEntity.getReCount() - reCount);
ioOrderDetailResultService.update(ioOrderDetailResultEntity);
}
} else { } else {
//如果数量扣减之后为0直接删除此条码 //如果数量扣减之后为0直接删除此条码
codeService.deleteById(ioCodeEntity.getId()); codeService.deleteById(ioCodeEntity.getId());
@ -371,15 +378,17 @@ public class IoOrderServiceImpl implements IoOrderService {
invPreProductService.update(invProductEntity); invPreProductService.update(invProductEntity);
} else { //普通库存 } else { //普通库存
InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectByCode(billNo, code); InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectByCode(billNo, code);
int count = invProductDetailEntity.getCount() - 1; if (invProductDetailEntity != null) {
if (count == 0) { int count = invProductDetailEntity.getCount() - 1;
invProductDetailService.deleteById(invProductDetailEntity.getId()); if (count == 0) {
} else { invProductDetailService.deleteById(invProductDetailEntity.getId());
//更新详情表 } else {
invProductDetailEntity.setCount(count); //更新详情表
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode()); invProductDetailEntity.setCount(count);
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount); int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
invProductDetailService.update(invProductDetailEntity); invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
invProductDetailService.update(invProductDetailEntity);
}
} }
//更新产品表 //更新产品表
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode()); InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());

Loading…
Cancel
Save