Browse Source

1.根据托盘码查询所有货物

training
zhenghaoyu 2 years ago
parent
commit
423866e3d8
  1. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java
  2. 3
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TrayTypeDataVO.java
  3. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java
  4. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java
  5. 79
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

4
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseTrayTypeClient.java

@ -18,6 +18,7 @@ package com.logpm.warehouse.feign;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -44,4 +45,7 @@ public interface IWarehouseTrayTypeClient {
@PostMapping(TOP+"/delEntityByMasterId")
Boolean removeByMasterId(@RequestParam Long id);
@PostMapping(API_PREFIX+"/selectListByTrayCode")
R selectListByTrayCode(@RequestParam String trayCode);
}

3
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TrayTypeDataVO.java

@ -1,5 +1,6 @@
package com.logpm.warehouse.vo;
import com.logpm.warehouse.entity.WarehouseTrayGoodsEntity;
import lombok.Data;
import java.io.Serializable;
@ -34,4 +35,6 @@ public class TrayTypeDataVO implements Serializable {
private List<TrayTypeDataListVO> list = new ArrayList<>();
private List<WarehouseTrayGoodsEntity> goodsLsit = new ArrayList<>();
}

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseTrayTypeClient.java

@ -2,6 +2,7 @@ package com.logpm.warehouse.feign;
import com.logpm.warehouse.service.IWarehouseTrayTypeService;
import lombok.AllArgsConstructor;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
@ -18,4 +19,9 @@ public class WarehouseTrayTypeClient implements IWarehouseTrayTypeClient {
public Boolean removeByMasterId(Long id) {
return warehouseTrayTypeService.deleteByMasterId(id);
}
@Override
public R selectListByTrayCode(String trayCode) {
return warehouseTrayTypeService.selectListByTrayCode(trayCode);
}
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseTrayTypeService.java

@ -85,4 +85,6 @@ public interface IWarehouseTrayTypeService extends BaseService<WarehouseTrayType
R selectStockByMaterialNameAndMarketId(Long marketId, String materialName, Long warehouseId);
R selectListByTrayCode(String trayCode);
}

79
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayTypeServiceImpl.java

@ -1988,6 +1988,85 @@ public class WarehouseTrayTypeServiceImpl extends BaseServiceImpl<WarehouseTrayT
return R.data(ls);
}
@Override
public R selectListByTrayCode(String trayCode) {
BasicdataTrayEntity basicdataTrayEntity = basicdataTrayClient.getTrayByTrayCode(trayCode);
if(Objects.isNull(basicdataTrayEntity)){
log.warn("###############getEntityByTrayCode: 托盘不存在 trayCode={}",trayCode);
throw new CustomerException(403,"托盘不存在");
}
Integer disableType = basicdataTrayEntity.getDisableType();
if(disableType == 2){
log.warn("###############getEntityByTrayCode: 该托盘已被禁用 trayCode={}",trayCode);
throw new CustomerException(403,"该托盘已被禁用");
}
Long trayId = basicdataTrayEntity.getId();
Long allocationId = warehouseTaryAllocationService.getAllocationIdByTrayId(trayId);
if(!Objects.isNull(allocationId)){
log.warn("###############getEntityByTrayCode: 托盘已上架 allocationId={}",allocationId);
throw new CustomerException(403,"托盘已上架");
}
//根据托盘编码查询是否有托盘编码存在打托数据
QueryWrapper<WarehouseTrayTypeEntity> queryTrayTypeWrapper = new QueryWrapper<>();
queryTrayTypeWrapper.eq("is_deleted",0)
.eq("tray_code",trayCode);
WarehouseTrayTypeEntity trayTypeEntity = baseMapper.selectOne(queryTrayTypeWrapper);
if(Objects.isNull(trayTypeEntity)){
//没有查询到托盘打托信息
return null;
}
String type = trayTypeEntity.getType();//类型 1扫码分拣(订制品) 2人工分拣(零担) 3库存品
Long trayTypeId = trayTypeEntity.getId();//打托方式id
String trayType = trayTypeEntity.getTrayType();
Long wId = trayTypeEntity.getWarehouseId();//托盘打托仓库
TrayTypeDataVO trayTypeDataVO = new TrayTypeDataVO();
trayTypeDataVO.setTrayTypeId(trayTypeId);
trayTypeDataVO.setType(type);
trayTypeDataVO.setTrayCode(trayTypeEntity.getTrayCode());
trayTypeDataVO.setTrayNum(trayTypeEntity.getTotalNum());
trayTypeDataVO.setName(trayTypeEntity.getFilterValue());
trayTypeDataVO.setOrderTotalNum(trayTypeEntity.getOrderTotalNum());
trayTypeDataVO.setTrayType(trayType);
trayTypeDataVO.setMarketId(trayTypeEntity.getMarketId());
trayTypeDataVO.setMarketName(trayTypeEntity.getMarketName());
trayTypeDataVO.setReamrk(trayTypeEntity.getRemark());
trayTypeDataVO.setWarehosueId(wId);
QueryWrapper<WarehouseTrayGoodsEntity> queryWrapper =new QueryWrapper<>();
queryWrapper.eq("tray_type_id",trayTypeId);
List<WarehouseTrayGoodsEntity> goodsList = warehouseTrayGoodsService.list(queryWrapper);
trayTypeDataVO.setGoodsLsit(goodsList);
// if(PalletProductTypeConstant.CUSTOMIZED.equals(type)){//订制品打托
// String trayTypeName = DictBizCache.getValue(DictBizConstant.PALLET_ORDER_TYPE, trayTypeEntity.getTrayType());
// trayTypeDataVO.setTrayTypeName(trayTypeName);
// List<TrayTypeDataListVO> list = warehouseTrayGoodsService.getListByTrayTypeId(trayTypeId);
// trayTypeDataVO.setList(list);
// }else if(PalletProductTypeConstant.ARTIFICIAL.equals(type)){
// String trayTypeName = DictBizCache.getValue(DictBizConstant.PALLET_ZERO_TYPE, trayTypeEntity.getTrayType());
// trayTypeDataVO.setTrayTypeName(trayTypeName);
// List<TrayTypeDataListVO> list = warehouseTrayGoodsService.getZeroListByTrayTypeId(trayTypeId);
// trayTypeDataVO.setList(list);
// }else if(PalletProductTypeConstant.STOCKDATA.equals(type)){
// String trayTypeName = DictBizCache.getValue(DictBizConstant.PALLET_STOCK_TYPE, trayTypeEntity.getTrayType());
// trayTypeDataVO.setTrayTypeName(trayTypeName);
// List<TrayTypeDataListVO> list = warehouseTrayGoodsService.getStockListByTrayTypeId(trayTypeId);
// trayTypeDataVO.setList(list);
// }else if(PalletProductTypeConstant.STOCKNODATA.equals(type)){
// String trayTypeName = DictBizCache.getValue(DictBizConstant.PALLET_STOCKNODATA_TYPE, trayTypeEntity.getTrayType());
// trayTypeDataVO.setTrayTypeName(trayTypeName);
// List<TrayTypeDataListVO> list = warehouseTrayGoodsService.getStockListByTrayTypeId(trayTypeId);
// trayTypeDataVO.setList(list);
// }else {
// log.warn("##################getEntityByTrayCode: 未知的打托类型");
// }
// return trayTypeDataVO;
return R.data(trayTypeDataVO);
}
private R moveTrayOrderPackageCode(WarehouseTrayTypeEntity trayTypeEntity, String orderPackageCode) {
DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCode(orderPackageCode);

Loading…
Cancel
Save