Browse Source

入库单上架打托

master
汤建军 8 months ago
parent
commit
a6ff241187
  1. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java
  2. 31
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWarehousingDetailEntity.java
  3. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java
  4. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java
  5. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java
  6. 14
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehousingEntryDetailExcel.java
  7. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java
  8. 65
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

8
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataTrayClient.java

@ -71,4 +71,12 @@ public interface IBasicdataTrayClient {
@GetMapping(API_PREFIX+"/getTrayByTrayNo")
BasicdataTrayEntity getTrayByTrayNo(@RequestParam String trayNo);
/**
* 查询托盘
* @param positions
* @return
*/
@GetMapping(API_PREFIX+"/findByTrayName")
BasicdataTrayEntity findByTrayName(@RequestParam String positions);
}

31
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/WarehouseWarehousingDetailEntity.java

@ -127,4 +127,35 @@ public class WarehouseWarehousingDetailEntity extends TenantEntity {
@ApiModelProperty(value = "品牌ID")
private Long brandId;
/**
* 库位Id
*/
@ApiModelProperty(value = "库位Id")
private Long allocationId;
/**
* 库位名称
*/
@ApiModelProperty(value = "库位名称")
private String allocationName;
/**
* 托盘ID
*/
@ApiModelProperty(value = "托盘ID")
private Long trayId;
/**
* 托盘名称
*/
@ApiModelProperty(value = "托盘名称")
private String trayName;
/**
* 装载类型
*/
@ApiModelProperty(value = "装载类型")
private Integer loadingType;
}

2
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseGoodsAllocationClient.java

@ -62,4 +62,6 @@ public interface IWarehouseGoodsAllocationClient {
List<WarehouseGoodsAllocationEntity> getAllocationInforByIds(@RequestParam("ids") String [] ids);
@GetMapping(TOP+ "/findByAllocationQrCode")
WarehouseGoodsAllocationEntity findByAllocationQrCode(@RequestParam String positions);
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataTrayClient.java

@ -109,4 +109,11 @@ public class BasicdataTrayClient implements IBasicdataTrayClient {
return basicdataTrayService.getOne(queryWrapper);
}
@Override
public BasicdataTrayEntity findByTrayName(String positions) {
return basicdataTrayService.list(Wrappers.<BasicdataTrayEntity>query().lambda()
.eq(BasicdataTrayEntity::getPalletName,positions)
).get(0);
}
}

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java

@ -218,6 +218,7 @@ public class WarehouseWarehousingEntryController extends BladeController {
warehousingEntryDetailExcel.setPackagingSpecifications("1");
warehousingEntryDetailExcel.setCreateInventory(100);
warehousingEntryDetailExcel.setPositions("存放位置 选填");
warehousingEntryDetailExcel.setLoadingType("存放类型 1-库位 2-托盘 ");
warehousingEntryDetailExcel.setRemark("备注 选填");
list.add(warehousingEntryDetailExcel);
ExcelUtil.export(response, "仓库入库单数据" + DateUtil.time(), "仓库入库单数据表", list, WarehousingEntryDetailExcel.class);

14
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/WarehousingEntryDetailExcel.java

@ -5,6 +5,7 @@ import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
@ -164,12 +165,22 @@ public class WarehousingEntryDetailExcel implements Serializable {
@ColumnWidth(20)
@ExcelProperty("入库数量")
private Integer createInventory;
/**
* 存放位置
*/
@ColumnWidth(20)
@ExcelProperty("存放位置")
private String positions;
/**
* 装载类型 1- 库位 2- 托盘
*/
@ExcelProperty("存放类型")
@ApiModelProperty(value = "装载类型 1- 库位 2- 托盘")
private String loadingType;
/**
* 备注
*/
@ -178,4 +189,7 @@ public class WarehousingEntryDetailExcel implements Serializable {
private String remark;
}

8
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseGoodsAllocationClient.java

@ -17,6 +17,7 @@
package com.logpm.warehouse.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.service.IWarehouseGoodsAllocationService;
import lombok.AllArgsConstructor;
@ -70,4 +71,11 @@ public class WarehouseGoodsAllocationClient implements IWarehouseGoodsAllocation
return warehouseGoodsAllocationService.selectAllocationInfo(lss);
}
@Override
public WarehouseGoodsAllocationEntity findByAllocationQrCode(String positions) {
return warehouseGoodsAllocationService.list(Wrappers.<WarehouseGoodsAllocationEntity>query().lambda()
.eq(WarehouseGoodsAllocationEntity::getQrCode,positions)
).get(0);
}
}

65
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -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;
}
}

Loading…
Cancel
Save