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

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

Loading…
Cancel
Save