|
|
|
@ -19,6 +19,9 @@ package com.logpm.warehouse.service.impl;
|
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.google.common.eventbus.AllowConcurrentEvents; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListEntity; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockListClient; |
|
|
|
|
import com.logpm.distribution.vo.DistributionStockListVO; |
|
|
|
|
import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity; |
|
|
|
@ -52,6 +55,7 @@ import java.util.List;
|
|
|
|
|
@Service |
|
|
|
|
public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<WarehouseWarehousingEntryMapper, WarehouseWarehousingEntryEntity> implements IWarehouseWarehousingEntryService { |
|
|
|
|
private final IWarehouseWarehousingDetailService warehouseWarehousingDetailService; |
|
|
|
|
private final IDistributionStockListClient distributionStockListClient; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -138,21 +142,80 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加库存品 |
|
|
|
|
* @param num |
|
|
|
|
* @param warehousingEntryDTO |
|
|
|
|
* @param warehousingDetail |
|
|
|
|
* @param num 添加数量 |
|
|
|
|
* @param warehousingEntryDTO 客户信息 |
|
|
|
|
* @param warehousingDetail 物品信息 |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public Boolean addInventory(Integer num,WarehouseWarehousingEntryDTO warehousingEntryDTO,WarehouseWarehousingDetailEntity warehousingDetail){ |
|
|
|
|
// DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
|
|
|
|
|
// distributionStockList.setStoreId(warehousingEntryDTO.getStoreId()); //门店
|
|
|
|
|
// distributionStockList.setMarketId(warehousingEntryDTO.getClientId()); //客户id
|
|
|
|
|
// distributionStockList.setMaterialId(warehousingDetail.getMaterialId()); //物料id
|
|
|
|
|
if(num < 1){ |
|
|
|
|
return true; |
|
|
|
|
}else{ |
|
|
|
|
DistributionStockListVO queryData = distributionStockListClient.getQueryData(warehousingEntryDTO.getStoreId(),warehousingEntryDTO.getClientId(),warehousingDetail.getMaterialId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加
|
|
|
|
|
DistributionStockListEntity distributionStockListEntity = new DistributionStockListEntity(); |
|
|
|
|
|
|
|
|
|
if(Func.isNotEmpty(queryData)){ |
|
|
|
|
distributionStockListEntity.setQuantityStock( queryData.getQuantityStock()+num ); //库存数量
|
|
|
|
|
distributionStockListEntity.setOutboundQuantity(queryData.getOutboundQuantity()); //出库数量
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else{ |
|
|
|
|
distributionStockListEntity.setQuantityStock(num); //库存数量
|
|
|
|
|
distributionStockListEntity.setOutboundQuantity(0); //出库数量
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
distributionStockListEntity.setUnpack(false); |
|
|
|
|
// distributionStockListEntity.setStockArticleId(distributionParcelList.getStockArticleId()); //订单ID
|
|
|
|
|
// distributionStockListEntity.setOrderSelfNumbering(distributionStockArticleEntity.getOrderSelfNumbering()); //订单自编号
|
|
|
|
|
distributionStockListEntity.setIncomingBatch(warehousingEntryDTO.getReceiptBatch()); //入库批次号
|
|
|
|
|
// distributionStockListEntity.setServiceNumber("服务号"); //服务号
|
|
|
|
|
distributionStockListEntity.setDescriptionGoods(warehousingDetail.getProductName()); //货物名称
|
|
|
|
|
distributionStockListEntity.setCargoNumber(warehousingDetail.getPackagingNumber()); //货物编号
|
|
|
|
|
distributionStockListEntity.setWarehouse(warehousingEntryDTO.getWarehouseId()); //仓库
|
|
|
|
|
distributionStockListEntity.setMarketId(warehousingEntryDTO.getClientId()); //商场及客户
|
|
|
|
|
distributionStockListEntity.setCargoUnit(warehousingDetail.getProductUnit()); //货物单位
|
|
|
|
|
if(Func.isNotEmpty(warehousingEntryDTO.getStoreId())){ |
|
|
|
|
distributionStockListEntity.setStoreId(warehousingEntryDTO.getStoreId()); //门店
|
|
|
|
|
} |
|
|
|
|
if(Func.isNotEmpty(warehousingEntryDTO.getLicensePlate())){ |
|
|
|
|
distributionStockListEntity.setDespatch(warehousingEntryDTO.getTrainNumber());//车次号运单
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// distributionStockListEntity.setStorageLocation("库位信息"); //库位信息
|
|
|
|
|
// distributionStockListEntity.setMallName(warehousingEntryDTO.getCustomerName()); //商场名称
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// distributionStockListEntity.setUnit("单位");//单位
|
|
|
|
|
distributionStockListEntity.setWarehouseName(warehousingEntryDTO.getWarehouse());//仓库名称
|
|
|
|
|
// distributionStockListEntity.setStoreId(Long.parseLong("12312"));//门店ID
|
|
|
|
|
distributionStockListEntity.setShoppingMall(warehousingEntryDTO.getClientId());//所属商场
|
|
|
|
|
|
|
|
|
|
// distributionStockListEntity.setMarketCode(warehousingEntryDTO.get);//商场编码
|
|
|
|
|
distributionStockListEntity.setMarketName(warehousingEntryDTO.getCustomerName());//商场名称
|
|
|
|
|
// distributionStockListEntity.setStoreCode("门店编码");//门店编码
|
|
|
|
|
distributionStockListEntity.setStoreName(warehousingEntryDTO.getStoreName());//门店名称
|
|
|
|
|
// distributionStockListEntity.setFactory("工厂车次");//工厂车次
|
|
|
|
|
distributionStockListEntity.setCategory("品分类");//品分类
|
|
|
|
|
distributionStockListEntity.setMaterialId( warehousingDetail.getMaterialId());//货物ID
|
|
|
|
|
// distributionStockListEntity.setStoreName("门店名称");//门店名称
|
|
|
|
|
// distributionStockListEntity.setParcelListId(distributionParcelList.getId());//包件id
|
|
|
|
|
distributionStockListEntity.setQuantityOccupied(0);//冻结数量
|
|
|
|
|
|
|
|
|
|
return distributionStockListClient.getAddStockList(distributionStockListEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|