|
|
@ -983,7 +983,7 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
if (ioOrderEntity != null && invWarehouseEntity != null) {
|
|
|
|
if (ioOrderEntity != null && invWarehouseEntity != null) {
|
|
|
|
//判断是哪个类型的库存
|
|
|
|
//判断是哪个类型的库存
|
|
|
|
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) {
|
|
|
|
if (invWarehouseEntity.getAdvanceType() == ConstantStatus.ACTION_TYPE_NORMAL) {
|
|
|
|
setInvProductEntityList(ioOrderDetailResultEntityList, ioOrderEntity.getMainAction(), status);
|
|
|
|
setInvProductEntityList(ioOrderDetailResultEntityList, ioOrderEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1091,11 +1091,12 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
return orderDao.getfilterOrderList(filterOrderRequest);
|
|
|
|
return orderDao.getfilterOrderList(filterOrderRequest);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean setInvProductEntityList(List<IoOrderDetailResultEntity> ioOrderDetailResultEntityList, String mainAction, Integer status) {
|
|
|
|
public Boolean setInvProductEntityList(List<IoOrderDetailResultEntity> ioOrderDetailResultEntityList,IoOrderEntity ioOrderEntity) {
|
|
|
|
|
|
|
|
|
|
|
|
for (IoOrderDetailResultEntity ioOrderDetailResultEntity : ioOrderDetailResultEntityList) {
|
|
|
|
for (IoOrderDetailResultEntity ioOrderDetailResultEntity : ioOrderDetailResultEntityList) {
|
|
|
|
//查询该产品是不是存在
|
|
|
|
//查询该产品是不是存在
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(ioOrderDetailResultEntity.getBindRlFk(), ioOrderDetailResultEntity.getBatchNo(), ioOrderDetailResultEntity.getSupId());
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(ioOrderDetailResultEntity.getBindRlFk(), ioOrderDetailResultEntity.getBatchNo(),
|
|
|
|
|
|
|
|
ioOrderDetailResultEntity.getSupId(),ioOrderEntity.getDeptCode(),ioOrderEntity.getInvCode());
|
|
|
|
if (invProductEntity == null) {
|
|
|
|
if (invProductEntity == null) {
|
|
|
|
//没有该产品就填充数据
|
|
|
|
//没有该产品就填充数据
|
|
|
|
invProductEntity = new InvProductEntity();
|
|
|
|
invProductEntity = new InvProductEntity();
|
|
|
@ -1107,7 +1108,8 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
invProductEntity.setInCount(0);
|
|
|
|
invProductEntity.setInCount(0);
|
|
|
|
invProductEntity.setOutCount(0);
|
|
|
|
invProductEntity.setOutCount(0);
|
|
|
|
invProductEntity.setSupId(ioOrderDetailResultEntity.getSupId());
|
|
|
|
invProductEntity.setSupId(ioOrderDetailResultEntity.getSupId());
|
|
|
|
invProductEntity.setDeptCode(ioOrderDetailResultEntity.getDeptCode());
|
|
|
|
invProductEntity.setDeptCode(ioOrderEntity.getDeptCode());
|
|
|
|
|
|
|
|
invProductEntity.setInvCode(ioOrderEntity.getInvCode());
|
|
|
|
invProductEntity.setCreateTime(new Date());
|
|
|
|
invProductEntity.setCreateTime(new Date());
|
|
|
|
invProductEntity.setUpdateTime(new Date());
|
|
|
|
invProductEntity.setUpdateTime(new Date());
|
|
|
|
invProductEntity.setNowStock(0); //现存量
|
|
|
|
invProductEntity.setNowStock(0); //现存量
|
|
|
@ -1117,20 +1119,20 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
invProductEntity.setOnWayCount(0);//在途库存
|
|
|
|
invProductEntity.setOnWayCount(0);//在途库存
|
|
|
|
invProductEntity.setAvailableStock(0);//可用库存
|
|
|
|
invProductEntity.setAvailableStock(0);//可用库存
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (mainAction.equals(ConstantType.TYPE_PUT)) {
|
|
|
|
if (ioOrderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
|
|
|
|
//出库
|
|
|
|
//出库
|
|
|
|
if (status == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
invProductEntity.setPlanOutCount((invProductEntity.getPlanOutCount() != null ? invProductEntity.getPlanOutCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setPlanOutCount((invProductEntity.getPlanOutCount() != null ? invProductEntity.getPlanOutCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setFrozenCount((invProductEntity.getFrozenCount() != null ? invProductEntity.getFrozenCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setFrozenCount((invProductEntity.getFrozenCount() != null ? invProductEntity.getFrozenCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
} else if (status == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
} else if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
invProductEntity.setPlanOutCount((invProductEntity.getPlanOutCount() != null ? invProductEntity.getPlanOutCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setPlanOutCount((invProductEntity.getPlanOutCount() != null ? invProductEntity.getPlanOutCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setFrozenCount((invProductEntity.getFrozenCount() != null ? invProductEntity.getFrozenCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setFrozenCount((invProductEntity.getFrozenCount() != null ? invProductEntity.getFrozenCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (mainAction.equals(ConstantType.TYPE_OUT)) {
|
|
|
|
} else if (ioOrderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
//入库
|
|
|
|
//入库
|
|
|
|
if (status == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
invProductEntity.setPlanInCount((invProductEntity.getInCount() != null ? invProductEntity.getInCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setPlanInCount((invProductEntity.getInCount() != null ? invProductEntity.getInCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
} else if (status == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
} else if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
invProductEntity.setPlanInCount((invProductEntity.getInCount() != null ? invProductEntity.getInCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setPlanInCount((invProductEntity.getInCount() != null ? invProductEntity.getInCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|