|
|
|
@ -326,8 +326,18 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
|
ioOrderDetailResultEntity.setReCount(ioOrderDetailResultEntity.getReCount() - reCount);
|
|
|
|
|
ioOrderDetailResultService.update(ioOrderDetailResultEntity);
|
|
|
|
|
} else {
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(ioCodeEntity.getNameCode());
|
|
|
|
|
//如果数量扣减之后为0,直接删除此条码
|
|
|
|
|
codeService.deleteById(ioCodeEntity.getId());
|
|
|
|
|
//更新扫码单据详情
|
|
|
|
|
IoOrderDetailCodeEntity ioOrderDetailCodeEntity = ioOrderDetailCodeService.findByUnique(ioCodeEntity.getOrderId(), ioCodeEntity.getRelId(), ioCodeEntity.getBatchNo());
|
|
|
|
|
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 (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
@ -399,6 +409,7 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
|
|
|
|
|
invProductDetailService.deleteById(invProductDetailEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|