|
|
@ -190,43 +190,52 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
} else if (basicBussinessTypeEntity.isAdvanceType()) {
|
|
|
|
} else if (basicBussinessTypeEntity.isAdvanceType()) {
|
|
|
|
//是否寄售,删除寄售库存
|
|
|
|
//是否寄售,删除寄售库存
|
|
|
|
List<InvPreProductDetailEntity> invProductDetailEntities = invPreProductDetailService.selectByOrderIdFk(billNo);
|
|
|
|
List<InvPreProductDetailEntity> invProductDetailEntities = invPreProductDetailService.selectByOrderIdFk(billNo);
|
|
|
|
for (InvPreProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
|
|
|
|
//更新库存
|
|
|
|
for (InvPreProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
//更新库存
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
InvPreProductEntity invProductEntity = invPreProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
int count = invProductEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setInCount(count);
|
|
|
|
int count = invProductEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setInCount(count);
|
|
|
|
int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setOutCount(count);
|
|
|
|
int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
|
|
|
|
invProductEntity.setOutCount(count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//计算实际数量
|
|
|
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
|
|
|
invPreProductService.update(invProductEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
invPreProductService.update(invProductEntity);
|
|
|
|
//删除库存详情
|
|
|
|
|
|
|
|
invPreProductDetailService.deleteByOrderId(billNo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//删除库存详情
|
|
|
|
|
|
|
|
invPreProductDetailService.deleteByOrderId(billNo);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
//删除普通库存
|
|
|
|
//删除普通库存
|
|
|
|
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.selectByOrderIdFk(billNo);
|
|
|
|
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailService.selectByOrderIdFk(billNo);
|
|
|
|
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
|
|
|
|
//更新库存
|
|
|
|
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
//更新库存
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelId(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode());
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
int count = invProductEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setInCount(count);
|
|
|
|
int count = invProductEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setInCount(count);
|
|
|
|
int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setOutCount(count);
|
|
|
|
int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
|
|
|
|
invProductEntity.setOutCount(count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//计算实际数量
|
|
|
|
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
//删除库存详情
|
|
|
|
|
|
|
|
invProductDetailService.deleteByOrderId(billNo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//删除库存详情
|
|
|
|
|
|
|
|
invProductDetailService.deleteByOrderId(billNo);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -498,7 +507,7 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
filterOrderRequest.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);
|
|
|
|
filterOrderRequest.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Constant.ORDER_STATUS_NEW_ORDER:
|
|
|
|
case Constant.ORDER_STATUS_NEW_ORDER:
|
|
|
|
filterOrderRequest.setStatuses(Arrays.asList(1, 2, 4));
|
|
|
|
filterOrderRequest.setStatuses(Arrays.asList(1, 2, 4));
|
|
|
|
filterOrderRequest.setDealStatuses(Arrays.asList(1, 2));
|
|
|
|
filterOrderRequest.setDealStatuses(Arrays.asList(1, 2));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case Constant.ORDER_STATUS_UN_CHECK:
|
|
|
|
case Constant.ORDER_STATUS_UN_CHECK:
|
|
|
@ -680,11 +689,12 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<IoOrderEntity> orders = new ArrayList<>();
|
|
|
|
ArrayList<IoOrderEntity> orders = new ArrayList<>();
|
|
|
|
if (CollUtil.isNotEmpty(orders)) {
|
|
|
|
if (CollUtil.isNotEmpty(billNos)) {
|
|
|
|
List<IoOrderEntity> list = orderDao.selectList(new QueryWrapper<IoOrderEntity>().in("billNo", billNos).orderByDesc("id"));
|
|
|
|
List<IoOrderEntity> list = orderDao.selectList(new QueryWrapper<IoOrderEntity>().in("billNo", billNos).orderByDesc("id"));
|
|
|
|
orders.addAll(list);
|
|
|
|
orders.addAll(list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
orders.add(order);
|
|
|
|
//将查询入口单据放在第一位的顺序
|
|
|
|
|
|
|
|
orders.add(0, order);
|
|
|
|
return orders;
|
|
|
|
return orders;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|