|
|
|
@ -28,22 +28,30 @@ import com.logpm.basic.entity.BasicMaterialEntity;
|
|
|
|
|
import com.logpm.basic.feign.IBasicMaterialClient; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataClientEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataStoreBrandEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataTrayEntity; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataClientClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataStoreBrandClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataTrayClient; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListEntity; |
|
|
|
|
import com.logpm.distribution.entity.DistributionStockListInfoEntity; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockListClient; |
|
|
|
|
import com.logpm.distribution.feign.IDistributionStockListInfoClient; |
|
|
|
|
import com.logpm.distribution.vo.DistributionStockListVO; |
|
|
|
|
import com.logpm.warehouse.dto.UpShelfPackageDTO; |
|
|
|
|
import com.logpm.warehouse.dto.UpShelfStockDTO; |
|
|
|
|
import com.logpm.warehouse.dto.WarehouseWarehousingEntryDTO; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehouseEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehousingDetailEntity; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseWarehousingEntryEntity; |
|
|
|
|
import com.logpm.warehouse.excel.WarehouseWarehousingEntryExcel; |
|
|
|
|
import com.logpm.warehouse.excel.WarehousingEntryDetailExcel; |
|
|
|
|
import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient; |
|
|
|
|
import com.logpm.warehouse.mapper.WarehouseWarehousingEntryMapper; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseTrayTypeService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseUpdownTypeService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseWarehousingDetailService; |
|
|
|
|
import com.logpm.warehouse.service.IWarehouseWarehousingEntryService; |
|
|
|
|
import com.logpm.warehouse.vo.WarehouseWarehousingEntryVO; |
|
|
|
@ -86,6 +94,10 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
private final IBasicdataStoreBrandClient basicdataStoreBrandClient; |
|
|
|
|
|
|
|
|
|
private final IBasicdataWarehouseClient warehouseClient; |
|
|
|
|
private final IWarehouseGoodsAllocationClient warehouseGoodsAllocationClient; |
|
|
|
|
private final IBasicdataTrayClient basicdataTrayClient; |
|
|
|
|
private final IWarehouseUpdownTypeService warehouseUpdownTypeService; |
|
|
|
|
private final IWarehouseTrayTypeService warehouseTrayTypeService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -352,6 +364,29 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
distributionStockListClient.getAddStockList(entity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer loadingType = warehousingDetail.getLoadingType(); |
|
|
|
|
if (Func.isNotEmpty(loadingType)){ |
|
|
|
|
if (loadingType.equals(1)){ |
|
|
|
|
//上架至库位
|
|
|
|
|
List<UpShelfStockDTO> list = new ArrayList<>(); |
|
|
|
|
UpShelfStockDTO upShelfStockDTO = new UpShelfStockDTO(); |
|
|
|
|
upShelfStockDTO.setMaterialCode(entity.getCargoNumber()); |
|
|
|
|
upShelfStockDTO.setMarketId(entity.getMarketId()); |
|
|
|
|
upShelfStockDTO.setAllocationId(warehousingDetail.getAllocationId()); |
|
|
|
|
upShelfStockDTO.setIncomingBatch(entity.getIncomingBatch()); |
|
|
|
|
upShelfStockDTO.setMaterialName(entity.getDescriptionGoods()); |
|
|
|
|
upShelfStockDTO.setNum(num); |
|
|
|
|
upShelfStockDTO.setWarehouseId(entity.getWarehouseId()); |
|
|
|
|
list.add(upShelfStockDTO); |
|
|
|
|
warehouseUpdownTypeService.upShelfStockList(list,warehousingDetail.getAllocationId(),entity.getWarehouseId(),"入库单录入数量上架至"+warehousingDetail.getAllocationName()+num+"件"); |
|
|
|
|
}else { |
|
|
|
|
//进行打托操作
|
|
|
|
|
warehouseTrayTypeService.enterStockNoDataMaterialCode(warehousingDetail.getTrayId().toString(),"100",entity.getCargoNumber(),entity.getMarketId(),num,entity.getIncomingBatch(),entity.getWarehouseId(),"入库单录入数量,打托至"+warehousingDetail.getTrayName()+num+"件"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DistributionStockListInfoEntity distributionStockListInfo = new DistributionStockListInfoEntity(); |
|
|
|
|
|
|
|
|
|
BeanUtil.copyProperties(entity, distributionStockListInfo); |
|
|
|
@ -396,9 +431,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public void importUser(List<WarehousingEntryDetailExcel> data, Boolean isCovered) { |
|
|
|
|
//分组
|
|
|
|
|
Map<String, List<WarehousingEntryDetailExcel>> collect = data.stream().map(x -> { |
|
|
|
|
return x; |
|
|
|
|
}).collect(Collectors.groupingBy(o -> { |
|
|
|
|
Map<String, List<WarehousingEntryDetailExcel>> collect = data.stream().collect(Collectors.groupingBy(o -> { |
|
|
|
|
System.out.println("====<<<<<<<<" + o); |
|
|
|
|
if (ObjectUtils.isEmpty(o) || ObjectUtils.isNull(o.getCustomerName()) || ObjectUtils.isNull(o.getCustomerCode())) { |
|
|
|
|
return ""; |
|
|
|
@ -490,6 +523,28 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
detail.setCreateInventory(i.getCreateInventory()); |
|
|
|
|
detail.setWarehousingEntryId(entryEntity.getId()); |
|
|
|
|
detail.setActualReceipt(0); |
|
|
|
|
if (!ObjectUtils.isNull(i.getPositions()) && Func.isNotEmpty(i.getLoadingType())){ |
|
|
|
|
String positions = i.getPositions(); |
|
|
|
|
positions =positions.trim().replaceAll("\n","").replaceAll("\r",""); |
|
|
|
|
//查询库位
|
|
|
|
|
if (i.getLoadingType().equals("1")){ |
|
|
|
|
//库位
|
|
|
|
|
WarehouseGoodsAllocationEntity warehouseGoodsAllocationEntity = warehouseGoodsAllocationClient.findByAllocationQrCode(positions); |
|
|
|
|
if (Func.isNotEmpty(warehouseGoodsAllocationEntity)){ |
|
|
|
|
detail.setLoadingType(1); |
|
|
|
|
detail.setAllocationId(warehouseGoodsAllocationEntity.getId()); |
|
|
|
|
detail.setAllocationName(warehouseGoodsAllocationEntity.getQrCode()); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
//托盘
|
|
|
|
|
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.findByTrayName(positions); |
|
|
|
|
if (Func.isNotEmpty(basicdataTrayEntity)){ |
|
|
|
|
detail.setLoadingType(2); |
|
|
|
|
detail.setTrayId(basicdataTrayEntity.getId()); |
|
|
|
|
detail.setTrayName(basicdataTrayEntity.getPalletName()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//品牌
|
|
|
|
|
BasicdataStoreBrandEntity brandList = basicdataStoreBrandClient.getBrandList(entryEntity.getClientId(), i.getBrandName()); |
|
|
|
|
if (Func.isNotEmpty(brandList)) { |
|
|
|
@ -559,4 +614,8 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
|
|
|
|
|
return listExcel; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|