|
|
|
@ -1,7 +1,6 @@
|
|
|
|
|
package com.glxp.udi.admin.thread;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
import com.glxp.udi.admin.constant.ConstantStatus;
|
|
|
|
|
import com.glxp.udi.admin.constant.TypeConstant;
|
|
|
|
|
import com.glxp.udi.admin.entity.inout.*;
|
|
|
|
@ -97,32 +96,26 @@ public class InvProductsTrService {
|
|
|
|
|
//查询码详情数据,用于生成库存
|
|
|
|
|
WarehouseQueryRequest warehouseQueryRequest = new WarehouseQueryRequest();
|
|
|
|
|
warehouseQueryRequest.setOrderId(orderId);
|
|
|
|
|
warehouseQueryRequest.setUdi(invProductEntity.getNameCode());
|
|
|
|
|
if (StrUtil.isNotBlank(invProductEntity.getBatchNo())) {
|
|
|
|
|
warehouseQueryRequest.setBatchNo(invProductEntity.getBatchNo());
|
|
|
|
|
}
|
|
|
|
|
List<WarehouseEntity> warehouseEntities = codesService.filterWarehouse(warehouseQueryRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(warehouseEntities)) {
|
|
|
|
|
for (WarehouseEntity warehouseEntity : warehouseEntities) {
|
|
|
|
|
UdiInfoEntity tempUdi = udiInfoService.findByNameCode(warehouseEntity.getNameCode(), customerId);
|
|
|
|
|
if (tempUdi.getUuid().equals(orderDetailEntity.getUuidFk())) {
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
|
|
|
|
|
invProductDetailEntity.setProductIdFk(invProductEntity.getRelIdFk() + "");
|
|
|
|
|
invProductDetailEntity.setInvProductIdFk(String.valueOf(invProductEntity.getId()));
|
|
|
|
|
invProductDetailEntity.setCode(warehouseEntity.getCode());
|
|
|
|
|
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
|
|
|
|
|
int actCount = inoutUtils.getActCount(tempUdi);
|
|
|
|
|
invProductDetailEntity.setCount(actCount * warehouseEntity.getCount());
|
|
|
|
|
invProductDetailEntity.setAction(warehouseEntity.getAction());
|
|
|
|
|
invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo());
|
|
|
|
|
invProductDetailEntity.setMainAction(warehouseEntity.getMainAction());
|
|
|
|
|
invProductDetailEntity.setProductDate(warehouseEntity.getProduceDate());
|
|
|
|
|
invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate());
|
|
|
|
|
invProductDetailEntity.setUpdateTime(new Date());
|
|
|
|
|
invProductDetailEntity.setCustomerId(orderEntity.getCustomerId() + "");
|
|
|
|
|
invProductDetailEntity.setLocStorageCode(warehouseEntity.getLocStorageCode());
|
|
|
|
|
invProductDetailService.insertInvProduct(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
|
|
|
|
|
invProductDetailEntity.setProductIdFk(invProductEntity.getRelIdFk() + "");
|
|
|
|
|
invProductDetailEntity.setInvProductIdFk(String.valueOf(invProductEntity.getId()));
|
|
|
|
|
invProductDetailEntity.setCode(warehouseEntity.getCode());
|
|
|
|
|
invProductDetailEntity.setOrderIdFk(warehouseEntity.getOrderId());
|
|
|
|
|
int actCount = inoutUtils.getActCount(tempUdi);
|
|
|
|
|
invProductDetailEntity.setCount(actCount * warehouseEntity.getCount());
|
|
|
|
|
invProductDetailEntity.setAction(warehouseEntity.getAction());
|
|
|
|
|
invProductDetailEntity.setBatchNo(warehouseEntity.getBatchNo());
|
|
|
|
|
invProductDetailEntity.setMainAction(warehouseEntity.getMainAction());
|
|
|
|
|
invProductDetailEntity.setProductDate(warehouseEntity.getProduceDate());
|
|
|
|
|
invProductDetailEntity.setExpireDate(warehouseEntity.getExpireDate());
|
|
|
|
|
invProductDetailEntity.setUpdateTime(new Date());
|
|
|
|
|
invProductDetailEntity.setCustomerId(orderEntity.getCustomerId() + "");
|
|
|
|
|
invProductDetailEntity.setLocStorageCode(warehouseEntity.getLocStorageCode());
|
|
|
|
|
invProductDetailService.insertInvProduct(invProductDetailEntity);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|