|
|
|
@ -334,80 +334,89 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
|
if (basicBussinessTypeEntity.getActionType() == ConstantStatus.ACTION_TYPE_PREIN) {
|
|
|
|
|
|
|
|
|
|
InvPreInProductDetailEntity invProductDetailEntity = invPreinProductDetailService.selectByCode(billNo, code);
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
invPreinProductDetailService.deleteById(invProductDetailEntity.getId() + "");
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|
invProductDetailEntity.setCount(count);
|
|
|
|
|
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
|
|
|
|
|
invPreinProductDetailService.update(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
//更新产品表
|
|
|
|
|
InvPreinProductEntity invProductEntity = invPreinProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int inCount = invProductEntity.getInCount() - reCount;
|
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int outCount = invProductEntity.getOutCount() - reCount;
|
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
|
if (invProductDetailEntity != null) {
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
invPreinProductDetailService.deleteById(invProductDetailEntity.getId() + "");
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|
invProductDetailEntity.setCount(count);
|
|
|
|
|
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
|
|
|
|
|
invPreinProductDetailService.update(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
//更新产品表
|
|
|
|
|
InvPreinProductEntity invProductEntity = invPreinProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int inCount = invProductEntity.getInCount() - reCount;
|
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int outCount = invProductEntity.getOutCount() - reCount;
|
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
|
}
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
}
|
|
|
|
|
invPreinProductService.update(invProductEntity);
|
|
|
|
|
}
|
|
|
|
|
invPreinProductService.update(invProductEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else if (basicBussinessTypeEntity.getActionType() == ConstantStatus.ACTION_TYPE_ADVANCE) { //寄售库存
|
|
|
|
|
InvPreProductDetailEntity invProductDetailEntity = invPreProductDetailService.selectByCode(billNo, code);
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
invPreProductService.deleteById(invProductDetailEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|
invProductDetailEntity.setCount(count);
|
|
|
|
|
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
|
|
|
|
|
invPreProductDetailService.update(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
//更新产品表
|
|
|
|
|
InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int inCount = invProductEntity.getInCount() - reCount;
|
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int outCount = invProductEntity.getOutCount() - reCount;
|
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
|
if (invProductDetailEntity != null) {
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
invPreProductService.deleteById(invProductDetailEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|
invProductDetailEntity.setCount(count);
|
|
|
|
|
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
|
|
|
|
|
invPreProductDetailService.update(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
//更新产品表
|
|
|
|
|
InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int inCount = invProductEntity.getInCount() - reCount;
|
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int outCount = invProductEntity.getOutCount() - reCount;
|
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
|
}
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
}
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
invPreProductService.update(invProductEntity);
|
|
|
|
|
}
|
|
|
|
|
invPreProductService.update(invProductEntity);
|
|
|
|
|
|
|
|
|
|
} else { //普通库存
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = invProductDetailService.selectByCode(billNo, code);
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
invProductDetailService.deleteById(invProductDetailEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|
invProductDetailEntity.setCount(count);
|
|
|
|
|
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
|
|
|
|
|
invProductDetailService.update(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
//更新产品表
|
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int inCount = invProductEntity.getInCount() - reCount;
|
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int outCount = invProductEntity.getOutCount() - reCount;
|
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
|
|
|
|
|
|
if (invProductDetailEntity != null) {
|
|
|
|
|
int count = invProductDetailEntity.getCount() - 1;
|
|
|
|
|
int reCount = udiCalCountUtil.getActCount(invProductDetailEntity.getNameCode());
|
|
|
|
|
if (count == 0) {
|
|
|
|
|
invProductDetailService.deleteById(invProductDetailEntity.getId());
|
|
|
|
|
} else {
|
|
|
|
|
//更新详情表
|
|
|
|
|
invProductDetailEntity.setCount(count);
|
|
|
|
|
invProductDetailEntity.setReCount(invProductDetailEntity.getReCount() - reCount);
|
|
|
|
|
invProductDetailService.update(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
//更新产品表
|
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int inCount = invProductEntity.getInCount() - reCount;
|
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
|
int outCount = invProductEntity.getOutCount() - reCount;
|
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
|
}
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
}
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
|
}
|
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|