|
|
|
@ -284,75 +284,76 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
} else { |
|
|
|
|
//查询库存品信息
|
|
|
|
|
DistributionStockListEntity stockListEntity = new DistributionStockListEntity(); |
|
|
|
|
stockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); |
|
|
|
|
stockListEntity.setMarketId(warehousingEntryDTO.getClientId()); |
|
|
|
|
stockListEntity.setMaterialId(warehousingDetail.getMaterialId()); |
|
|
|
|
stockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); |
|
|
|
|
// stockListEntity.setStoreId(warehousingEntryDTO.getStoreId());
|
|
|
|
|
// stockListEntity.setMarketId(warehousingEntryDTO.getClientId());
|
|
|
|
|
// stockListEntity.setMaterialId(warehousingDetail.getMaterialId());
|
|
|
|
|
// stockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch());
|
|
|
|
|
DistributionStockListVO queryData = distributionStockListClient.getQueryData(stockListEntity); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加
|
|
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
|
distributionStockListEntity.setUnpack(false); |
|
|
|
|
//导入
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(queryData)) { |
|
|
|
|
// distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
|
|
|
|
|
// distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
|
|
|
|
|
//修改
|
|
|
|
|
DistributionStockListEntity distributionStockList = new DistributionStockListEntity(); |
|
|
|
|
distributionStockList.setQuantityStock(queryData.getQuantityStock() + num); |
|
|
|
|
distributionStockList.setOutboundQuantity(queryData.getOutboundQuantity()); |
|
|
|
|
distributionStockList.setId(queryData.getId()); |
|
|
|
|
distributionStockListClient.getUpdateStockList(distributionStockList); |
|
|
|
|
} else { |
|
|
|
|
//添加
|
|
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
|
distributionStockListEntity.setUnpack(false); |
|
|
|
|
// distributionStockListEntity.setStockArticleId(distributionParcelList.getStockArticleId()); //订单ID
|
|
|
|
|
distributionStockListEntity.setOrderCode(Optional.ofNullable(warehousingEntryDTO.getOrderNumber()).orElse(null)); //订单自编号
|
|
|
|
|
distributionStockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); //入库批次号
|
|
|
|
|
distributionStockListEntity.setOrderCode(Optional.ofNullable(warehousingEntryDTO.getOrderNumber()).orElse(null)); //订单自编号
|
|
|
|
|
distributionStockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); //入库批次号
|
|
|
|
|
// distributionStockListEntity.setServiceNumber("服务号"); //服务号
|
|
|
|
|
distributionStockListEntity.setDescriptionGoods(warehousingDetail.getProductName()); //货物名称
|
|
|
|
|
distributionStockListEntity.setCargoNumber(warehousingDetail.getProductCode()); //货物编号
|
|
|
|
|
distributionStockListEntity.setWarehouseId(warehousingEntryDTO.getWarehouseId()); //仓库ID
|
|
|
|
|
distributionStockListEntity.setMarketId(warehousingEntryDTO.getClientId()); //商场及客户
|
|
|
|
|
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
|
|
|
|
|
distributionStockListEntity.setWarehousingTime(warehousingEntryDTO.getReceiptDate()); //入库时间
|
|
|
|
|
distributionStockListEntity.setLicensePlate(Optional.ofNullable(warehousingEntryDTO.getLicensePlate()).orElse(null)); //车牌
|
|
|
|
|
if (Func.isNotEmpty(warehousingEntryDTO.getStoreId())) { |
|
|
|
|
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
|
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())) { |
|
|
|
|
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
|
|
|
|
|
} |
|
|
|
|
distributionStockListEntity.setServiceType(warehousingEntryDTO.getServiceType()); |
|
|
|
|
distributionStockListEntity.setDescriptionGoods(warehousingDetail.getProductName()); //货物名称
|
|
|
|
|
distributionStockListEntity.setCargoNumber(warehousingDetail.getProductCode()); //货物编号
|
|
|
|
|
distributionStockListEntity.setWarehouseId(warehousingEntryDTO.getWarehouseId()); //仓库ID
|
|
|
|
|
distributionStockListEntity.setMarketId(warehousingEntryDTO.getClientId()); //商场及客户
|
|
|
|
|
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
|
|
|
|
|
distributionStockListEntity.setWarehousingTime(warehousingEntryDTO.getReceiptDate()); //入库时间
|
|
|
|
|
distributionStockListEntity.setLicensePlate(Optional.ofNullable(warehousingEntryDTO.getLicensePlate()).orElse(null)); //车牌
|
|
|
|
|
if (Func.isNotEmpty(warehousingEntryDTO.getStoreId())) { |
|
|
|
|
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
|
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())) { |
|
|
|
|
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
|
|
|
|
|
} |
|
|
|
|
distributionStockListEntity.setServiceType(warehousingEntryDTO.getServiceType()); |
|
|
|
|
// distributionStockListEntity.setStorageLocation("库位信息"); //库位信息
|
|
|
|
|
// distributionStockListEntity.setMallName(warehousingEntryDTO.getCustomerName()); //商场名称
|
|
|
|
|
// distributionStockListEntity.setUnit("单位");//单位
|
|
|
|
|
distributionStockListEntity.setWarehouseName(warehousingEntryDTO.getWarehouse());//仓库名称
|
|
|
|
|
distributionStockListEntity.setWarehouseName(warehousingEntryDTO.getWarehouse());//仓库名称
|
|
|
|
|
// distributionStockListEntity.setStoreId(Long.parseLong("12312"));//门店ID
|
|
|
|
|
// distributionStockListEntity.setShoppingMall(warehousingEntryDTO.getClientId());//所属商场
|
|
|
|
|
|
|
|
|
|
// distributionStockListEntity.setMarketCode(warehousingEntryDTO.get);//商场编码
|
|
|
|
|
distributionStockListEntity.setMarketName(warehousingEntryDTO.getCustomerName());//商场名称
|
|
|
|
|
distributionStockListEntity.setMarketName(warehousingEntryDTO.getCustomerName());//商场名称
|
|
|
|
|
// distributionStockListEntity.setStoreCode(warehousingEntryDTO.getStore);//门店编码
|
|
|
|
|
distributionStockListEntity.setStoreName(warehousingEntryDTO.getStoreName());//门店名称
|
|
|
|
|
distributionStockListEntity.setBrandName(warehousingDetail.getBrandName());//品牌]名称
|
|
|
|
|
distributionStockListEntity.setBrandId(warehousingDetail.getBrandId());//品牌ID
|
|
|
|
|
distributionStockListEntity.setStoreName(warehousingEntryDTO.getStoreName());//门店名称
|
|
|
|
|
distributionStockListEntity.setBrandName(warehousingDetail.getBrandName());//品牌]名称
|
|
|
|
|
distributionStockListEntity.setBrandId(warehousingDetail.getBrandId());//品牌ID
|
|
|
|
|
// distributionStockListEntity.setFactory("工厂车次");//工厂车次
|
|
|
|
|
// distributionStockListEntity.setCategory("品分类");//品分类
|
|
|
|
|
distributionStockListEntity.setMaterialId(warehousingDetail.getMaterialId());//货物ID
|
|
|
|
|
distributionStockListEntity.setMaterialId(warehousingDetail.getMaterialId());//货物ID
|
|
|
|
|
// distributionStockListEntity.setStoreName("门店名称");//门店名称
|
|
|
|
|
// distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
|
|
|
|
|
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
distributionStockListEntity.setQuantityStock(num); //库存数量
|
|
|
|
|
distributionStockListEntity.setOutboundQuantity(0); //出库数量
|
|
|
|
|
distributionStockListEntity.setUnpackingQuantity(0); //库存拆包数量
|
|
|
|
|
distributionStockListEntity.setSku(warehousingDetail.getSku()); |
|
|
|
|
distributionStockListEntity.setSourceType("2");//导入
|
|
|
|
|
|
|
|
|
|
if (Func.isNotEmpty(queryData)) { |
|
|
|
|
// distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
|
|
|
|
|
// distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
|
|
|
|
|
//修改
|
|
|
|
|
DistributionStockListEntity distributionStockList = new DistributionStockListEntity(); |
|
|
|
|
distributionStockList.setQuantityStock(queryData.getQuantityStock() + num); |
|
|
|
|
distributionStockList.setOutboundQuantity(queryData.getOutboundQuantity()); |
|
|
|
|
distributionStockList.setId(queryData.getId()); |
|
|
|
|
distributionStockListClient.getUpdateStockList(distributionStockList); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
distributionStockListEntity.setQuantityStock(num); //库存数量
|
|
|
|
|
distributionStockListEntity.setOutboundQuantity(0); //出库数量
|
|
|
|
|
distributionStockListEntity.setUnpackingQuantity(0); //库存拆包数量
|
|
|
|
|
distributionStockListEntity.setSku(warehousingDetail.getSku()); |
|
|
|
|
distributionStockListEntity.setSourceType("2"); |
|
|
|
|
distributionStockListClient.getAddStockList(distributionStockListEntity); |
|
|
|
|
stockListEntity = distributionStockListEntity; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity(); |
|
|
|
|
BeanUtil.copyProperties(distributionStockListEntity, distributionStockListInfo); |
|
|
|
|
BeanUtil.copyProperties(stockListEntity, distributionStockListInfo); |
|
|
|
|
distributionStockListInfo.setSourceType("2");//导入
|
|
|
|
|
return distributionStockListInfoClient.addStockListInfoEntity(distributionStockListInfo); |
|
|
|
|
} |
|
|
|
|