|
|
@ -46,6 +46,7 @@ import com.glxp.api.service.inv.InvPreProductDetailService;
|
|
|
|
import com.glxp.api.service.inv.InvPreProductService;
|
|
|
|
import com.glxp.api.service.inv.InvPreProductService;
|
|
|
|
import com.glxp.api.service.inv.InvPreinProductDetailService;
|
|
|
|
import com.glxp.api.service.inv.InvPreinProductDetailService;
|
|
|
|
import com.glxp.api.service.inv.InvPreinProductService;
|
|
|
|
import com.glxp.api.service.inv.InvPreinProductService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.inv.impl.InvProductBatchService;
|
|
|
|
import com.glxp.api.service.inv.impl.InvProductService;
|
|
|
|
import com.glxp.api.service.inv.impl.InvProductService;
|
|
|
|
import com.glxp.api.service.inv.impl.InvProductServiceNew;
|
|
|
|
import com.glxp.api.service.inv.impl.InvProductServiceNew;
|
|
|
|
import com.glxp.api.service.system.SyncUploadDataBustypeService;
|
|
|
|
import com.glxp.api.service.system.SyncUploadDataBustypeService;
|
|
|
@ -59,6 +60,7 @@ import com.glxp.api.vo.basic.InvProductNewVo;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
import org.springframework.context.annotation.Lazy;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
@ -112,6 +114,8 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
private HttpOkClient httpOkClient;
|
|
|
|
private HttpOkClient httpOkClient;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private BasicCorpDao basicCorpDao;
|
|
|
|
private BasicCorpDao basicCorpDao;
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
|
|
|
private InvProductBatchService invProductBatchService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<IoOrderEntity> selectAll() {
|
|
|
|
public List<IoOrderEntity> selectAll() {
|
|
|
@ -289,23 +293,25 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
//删除普通库存
|
|
|
|
//删除普通库存
|
|
|
|
List<InvProductNewVo> invProductDetailEntities = invProductServiceNew.selectByOrderIdFk(billNo);
|
|
|
|
List<InvProductNewVo> invProductDetailEntities = invProductServiceNew.selectByOrderIdFk(billNo);
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
|
|
|
|
|
|
|
|
List<InvProductBatchEntity> batchEntities = new ArrayList<>();
|
|
|
|
for (InvProductNewVo invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
for (InvProductNewVo invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
//更新库存
|
|
|
|
//更新库存
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelIdFk(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(), invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode(), invProductDetailEntity.getPrice());
|
|
|
|
InvProductBatchEntity invProductBatchEntity = invProductBatchService.selectByUnique(invProductDetailEntity.getRelIdFk(),
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
invProductDetailEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getPrice());
|
|
|
|
|
|
|
|
if (invProductBatchEntity != null) {
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
int count = invProductEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
int count = invProductBatchEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
invProductEntity.setInCount(count);
|
|
|
|
invProductBatchEntity.setInCount(count);
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
int count = invProductBatchEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
invProductEntity.setOutCount(count);
|
|
|
|
invProductBatchEntity.setOutCount(count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//计算实际数量
|
|
|
|
//计算实际数量
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
invProductBatchEntity.setReCount(invProductBatchEntity.getInCount() - invProductBatchEntity.getOutCount());
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
batchEntities.add(invProductBatchEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
invProductBatchService.saveBatchEvent(batchEntities,basicBussinessTypeEntity.getMainAction());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -449,21 +455,28 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
InvProductNewVo invProductDetailEntity = invProductServiceNew.selectByCode(codeEntity.getOrderId(), codeEntity.getCode(), codeEntity.getPrice());
|
|
|
|
InvProductNewVo invProductDetailEntity = invProductServiceNew.selectByCode(codeEntity.getOrderId(), codeEntity.getCode(), codeEntity.getPrice());
|
|
|
|
|
|
|
|
|
|
|
|
if (invProductDetailEntity != null) {
|
|
|
|
if (invProductDetailEntity != null) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<InvProductBatchEntity> batchEntities = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
//更新产品表
|
|
|
|
//更新产品表
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelIdFk(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(),
|
|
|
|
InvProductBatchEntity invProductBatchEntity = invProductBatchService.selectByUnique(invProductDetailEntity.getRelIdFk(),
|
|
|
|
invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode(), invProductDetailEntity.getPrice());
|
|
|
|
invProductDetailEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getPrice());
|
|
|
|
if (invProductEntity != null) {
|
|
|
|
if (invProductBatchEntity != null) {
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
int inCount = invProductEntity.getInCount() - remainScanCount;
|
|
|
|
int count = invProductBatchEntity.getInCount() - remainScanCount;
|
|
|
|
invProductEntity.setInCount(inCount);
|
|
|
|
invProductBatchEntity.setInCount(count);
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
int outCount = invProductEntity.getOutCount() - remainScanCount;
|
|
|
|
int count = invProductBatchEntity.getOutCount() - remainScanCount;
|
|
|
|
invProductEntity.setOutCount(outCount);
|
|
|
|
invProductBatchEntity.setOutCount(count);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
//计算实际数量
|
|
|
|
|
|
|
|
invProductBatchEntity.setReCount(invProductBatchEntity.getInCount() - invProductBatchEntity.getOutCount());
|
|
|
|
|
|
|
|
batchEntities.add(invProductBatchEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
|
|
|
|
|
|
|
|
invProductBatchService.saveBatchEvent(batchEntities,basicBussinessTypeEntity.getMainAction());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -556,20 +569,25 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
List<InvProductNewVo> invProductDetailEntities = invProductServiceNew.selectByOrderIdFk(billNo);
|
|
|
|
List<InvProductNewVo> invProductDetailEntities = invProductServiceNew.selectByOrderIdFk(billNo);
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
|
|
|
|
if (CollUtil.isNotEmpty(invProductDetailEntities)) {
|
|
|
|
|
|
|
|
List<InvProductBatchEntity> batchEntities = new ArrayList<>();
|
|
|
|
for (InvProductNewVo invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
for (InvProductNewVo invProductDetailEntity : invProductDetailEntities) {
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(invProductDetailEntity.getRelIdFk(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getSupId(),
|
|
|
|
//更新库存
|
|
|
|
invProductDetailEntity.getDeptCode(), invProductDetailEntity.getInvCode(), invProductDetailEntity.getPrice());
|
|
|
|
InvProductBatchEntity invProductBatchEntity = invProductBatchService.selectByUnique(invProductDetailEntity.getRelIdFk(),
|
|
|
|
|
|
|
|
invProductDetailEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), invProductDetailEntity.getBatchNo(), invProductDetailEntity.getPrice());
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
if (invProductBatchEntity != null) {
|
|
|
|
int count = invProductEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
if (ConstantType.TYPE_PUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setInCount(count);
|
|
|
|
int count = invProductBatchEntity.getInCount() - invProductDetailEntity.getReCount();
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductBatchEntity.setInCount(count);
|
|
|
|
int count = invProductEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(invProductDetailEntity.getMainAction())) {
|
|
|
|
invProductEntity.setOutCount(count);
|
|
|
|
int count = invProductBatchEntity.getOutCount() - invProductDetailEntity.getReCount();
|
|
|
|
|
|
|
|
invProductBatchEntity.setOutCount(count);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//计算实际数量
|
|
|
|
|
|
|
|
invProductBatchEntity.setReCount(invProductBatchEntity.getInCount() - invProductBatchEntity.getOutCount());
|
|
|
|
|
|
|
|
batchEntities.add(invProductBatchEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
invProductEntity.setReCount(invProductEntity.getInCount() - invProductEntity.getOutCount());
|
|
|
|
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
invProductBatchService.saveBatchEvent(batchEntities,bussinessTypeEntity.getMainAction());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1040,7 +1058,7 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public IoOrderResponse findByWorkPlaceCode(String workPlaceCode,String getWorkPlaceQueueCode,Long userId,String action,Integer fifoSplitTag) {
|
|
|
|
public IoOrderResponse findByWorkPlaceCode(String workPlaceCode, String getWorkPlaceQueueCode, Long userId, String action, Integer fifoSplitTag) {
|
|
|
|
//根据用户和状态查找处理中的订单查询单据表
|
|
|
|
//根据用户和状态查找处理中的订单查询单据表
|
|
|
|
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
|
|
|
|
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
|
|
|
|
filterOrderRequest.setWorkPlaceCode(workPlaceCode);
|
|
|
|
filterOrderRequest.setWorkPlaceCode(workPlaceCode);
|
|
|
@ -1050,11 +1068,11 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
filterOrderRequest.setFifoSplitTag(fifoSplitTag);
|
|
|
|
filterOrderRequest.setFifoSplitTag(fifoSplitTag);
|
|
|
|
|
|
|
|
|
|
|
|
List<IoOrderResponse> ioOrderResponses = orderDao.filterList(filterOrderRequest);
|
|
|
|
List<IoOrderResponse> ioOrderResponses = orderDao.filterList(filterOrderRequest);
|
|
|
|
if (ioOrderResponses.size() > 0){
|
|
|
|
if (ioOrderResponses.size() > 0) {
|
|
|
|
IoOrderResponse ioOrderResponse = ioOrderResponses.get(0);
|
|
|
|
IoOrderResponse ioOrderResponse = ioOrderResponses.get(0);
|
|
|
|
return ioOrderResponse;
|
|
|
|
return ioOrderResponse;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -1119,59 +1137,65 @@ public class IoOrderServiceImpl implements IoOrderService {
|
|
|
|
return orderDao.getfilterOrderList(filterOrderRequest);
|
|
|
|
return orderDao.getfilterOrderList(filterOrderRequest);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Boolean setInvProductEntityList(List<IoOrderDetailResultEntity> ioOrderDetailResultEntityList, IoOrderEntity ioOrderEntity) {
|
|
|
|
public Boolean setInvProductEntityList(List<IoOrderDetailResultEntity> ioOrderDetailResultEntityList, IoOrderEntity orderEntity) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (IoOrderDetailResultEntity ioOrderDetailResultEntity : ioOrderDetailResultEntityList) {
|
|
|
|
for (IoOrderDetailResultEntity orderDetailResultEntity : ioOrderDetailResultEntityList) {
|
|
|
|
//查询该产品是不是存在
|
|
|
|
//查询该产品是不是存在
|
|
|
|
InvProductEntity invProductEntity = invProductService.selectByUnique(ioOrderDetailResultEntity.getBindRlFk(), ioOrderDetailResultEntity.getBatchNo(),
|
|
|
|
InvProductBatchEntity invProductBatchEntity = invProductBatchService.selectByUnique(orderDetailResultEntity.getBindRlFk(),
|
|
|
|
ioOrderDetailResultEntity.getSupId(), ioOrderEntity.getDeptCode(), ioOrderEntity.getInvCode(), ioOrderDetailResultEntity.getPrice());
|
|
|
|
orderDetailResultEntity.getSupId(), orderEntity.getDeptCode(), orderEntity.getInvCode(), orderDetailResultEntity.getBatchNo(), orderDetailResultEntity.getPrice());
|
|
|
|
if (invProductEntity == null) {
|
|
|
|
if (invProductBatchEntity == null) {
|
|
|
|
//没有该产品就填充数据
|
|
|
|
invProductBatchEntity = new InvProductBatchEntity();
|
|
|
|
invProductEntity = new InvProductEntity();
|
|
|
|
invProductBatchEntity.setRelIdFk(String.valueOf(orderDetailResultEntity.getBindRlFk()));
|
|
|
|
invProductEntity.setRelIdFk(ioOrderDetailResultEntity.getBindRlFk());
|
|
|
|
invProductBatchEntity.setNameCode(orderDetailResultEntity.getNameCode());
|
|
|
|
invProductEntity.setNameCode(ioOrderDetailResultEntity.getNameCode());
|
|
|
|
invProductBatchEntity.setBatchNo(orderDetailResultEntity.getBatchNo());
|
|
|
|
invProductEntity.setBatchNo(ioOrderDetailResultEntity.getBatchNo());
|
|
|
|
invProductBatchEntity.setProductionDate(orderDetailResultEntity.getProductDate());
|
|
|
|
invProductEntity.setProductionDate(ioOrderDetailResultEntity.getProductDate());
|
|
|
|
invProductBatchEntity.setExpireDate(orderDetailResultEntity.getExpireDate());
|
|
|
|
invProductEntity.setExpireDate(ioOrderDetailResultEntity.getExpireDate());
|
|
|
|
invProductBatchEntity.setOutCount(0);
|
|
|
|
invProductEntity.setInCount(0);
|
|
|
|
invProductBatchEntity.setInCount(0);
|
|
|
|
invProductEntity.setOutCount(0);
|
|
|
|
invProductBatchEntity.setReCount(0);
|
|
|
|
invProductEntity.setSupId(ioOrderDetailResultEntity.getSupId());
|
|
|
|
invProductBatchEntity.setCustomerId(orderDetailResultEntity.getSupId());
|
|
|
|
invProductEntity.setDeptCode(ioOrderEntity.getDeptCode());
|
|
|
|
invProductBatchEntity.setDeptCode(orderEntity.getDeptCode());
|
|
|
|
invProductEntity.setInvCode(ioOrderEntity.getInvCode());
|
|
|
|
invProductBatchEntity.setInvCode(orderEntity.getInvCode());
|
|
|
|
invProductEntity.setPrice(ioOrderDetailResultEntity.getPrice());
|
|
|
|
invProductBatchEntity.setCreateTime(new Date());
|
|
|
|
invProductEntity.setCreateTime(new Date());
|
|
|
|
invProductBatchEntity.setUpdateTime(new Date());
|
|
|
|
invProductEntity.setUpdateTime(new Date());
|
|
|
|
invProductBatchEntity.setNowStock(0); //现存量
|
|
|
|
invProductEntity.setNowStock(0); //现存量
|
|
|
|
invProductBatchEntity.setFrozenCount(0); //冻结量
|
|
|
|
invProductEntity.setFrozenCount(0); //冻结量
|
|
|
|
invProductBatchEntity.setPlanInCount(0);//预计入库量
|
|
|
|
invProductEntity.setPlanInCount(0);//预计入库量
|
|
|
|
invProductBatchEntity.setPlanOutCount(0);//预计出库量
|
|
|
|
invProductEntity.setPlanOutCount(0);//预计出库量
|
|
|
|
invProductBatchEntity.setOnWayCount(0);//在途库存
|
|
|
|
invProductEntity.setOnWayCount(0);//在途库存
|
|
|
|
invProductBatchEntity.setAvailableStock(0);//可用库存
|
|
|
|
invProductEntity.setAvailableStock(0);//可用库存
|
|
|
|
invProductBatchEntity.setPrice(orderDetailResultEntity.getPrice());
|
|
|
|
|
|
|
|
//添加产品表入院批次号
|
|
|
|
|
|
|
|
invProductBatchEntity.setInBatchNo(orderEntity.getBillNo().substring(orderEntity.getBillNo().length() - 12));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (ioOrderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
|
|
|
|
|
|
|
|
//出库
|
|
|
|
|
|
|
|
if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
if (orderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
invProductEntity.setPlanOutCount((invProductEntity.getPlanOutCount() != null ? invProductEntity.getPlanOutCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
invProductEntity.setFrozenCount((invProductEntity.getFrozenCount() != null ? invProductEntity.getFrozenCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductBatchEntity.setPlanOutCount((invProductBatchEntity.getPlanOutCount() != null ? invProductBatchEntity.getPlanOutCount() : 0) + orderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
} else if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
invProductBatchEntity.setFrozenCount((invProductBatchEntity.getFrozenCount() != null ? invProductBatchEntity.getFrozenCount() : 0) + orderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductEntity.setPlanOutCount((invProductEntity.getPlanOutCount() != null ? invProductEntity.getPlanOutCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
} else if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
invProductEntity.setFrozenCount((invProductEntity.getFrozenCount() != null ? invProductEntity.getFrozenCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductBatchEntity.setPlanOutCount((invProductBatchEntity.getPlanOutCount() != null ? invProductBatchEntity.getPlanOutCount() : 0) - orderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
|
|
|
|
invProductBatchEntity.setFrozenCount((invProductBatchEntity.getFrozenCount() != null ? invProductBatchEntity.getFrozenCount() : 0) - orderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (ioOrderEntity.getMainAction().equals(ConstantType.TYPE_OUT)) {
|
|
|
|
|
|
|
|
|
|
|
|
} else if (orderEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
|
|
|
|
//入库
|
|
|
|
//入库
|
|
|
|
if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_CHECK_SUCCESS) {
|
|
|
|
invProductEntity.setPlanInCount((invProductEntity.getInCount() != null ? invProductEntity.getInCount() : 0) + ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductBatchEntity.setPlanInCount((invProductBatchEntity.getInCount() != null ? invProductBatchEntity.getInCount() : 0) + orderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
} else if (ioOrderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
} else if (orderEntity.getStatus() == ConstantStatus.ORDER_STATUS_AUDITED) {
|
|
|
|
invProductEntity.setPlanInCount((invProductEntity.getInCount() != null ? invProductEntity.getInCount() : 0) - ioOrderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
invProductBatchEntity.setPlanInCount((invProductBatchEntity.getInCount() != null ? invProductBatchEntity.getInCount() : 0) - orderDetailResultEntity.getReCount());//预计出库量
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断有没有id走插入或者更新方法
|
|
|
|
//判断有没有id走插入或者更新方法
|
|
|
|
if (invProductEntity.getId() == null) {
|
|
|
|
if (invProductBatchEntity.getId() == null) {
|
|
|
|
invProductService.insert(invProductEntity);
|
|
|
|
invProductBatchService.save(invProductBatchEntity);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
invProductService.update(invProductEntity);
|
|
|
|
invProductBatchService.updateById(invProductBatchEntity);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|