Browse Source

1.整库移库扫描目标库位

training
zhenghaoyu 1 year ago
parent
commit
8cb62fd636
  1. 35
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java
  2. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownTypeService.java
  3. 61
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

35
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java

@ -874,4 +874,39 @@ public class WarehouseUpdownTypeApiController {
}
}
@ResponseBody
@PostMapping("/moveAllocationScanAllocation")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "移库扫描库位", notes = "传入trayTypeDTO")
public R moveAllocationScanAllocation(@RequestBody UpdownTypeDTO updownTypeDTO) {
String method = "###########moveAllocationScanAllocation: ";
log.info(method + "移库扫描目标库位 updownTypeDTO={}", updownTypeDTO);
Long allocationId = updownTypeDTO.getAllocationId();//目标库位码
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(Objects.isNull(allocationId)){
log.warn(method+"库位码不能为空 allocationId={}",allocationId);
return R.fail(403,"库位码不能为空");
}
//查询该库位的货物信息
UpShelfAllocationVO upShelfAllocationVO = warehouseUpdownTypeService.moveAllocationScanAllocation(allocationId,myCurrentWarehouse.getId());
return R.data(upShelfAllocationVO);
}catch (CustomerException e){
log.warn(e.message);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
}

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

@ -61,4 +61,5 @@ public interface IWarehouseUpdownTypeService extends BaseService<WarehouseUpdown
OrderUpshelfDetailVO orderUpshelfDetail(String orderCode);
UpShelfAllocationVO moveAllocationScanAllocation(Long allocationId, Long warehouseId);
}

61
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownTypeServiceImpl.java

@ -1588,6 +1588,67 @@ public class WarehouseUpdownTypeServiceImpl extends BaseServiceImpl<WarehouseUpd
return null;
}
@Override
public UpShelfAllocationVO moveAllocationScanAllocation(Long allocationId, Long warehouseId) {
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("#############moveAllocationScanAllocation: 库位信息不存在 allocationId={}",allocationId);
throw new CustomerException(403,"库位信息不存在");
}
String goodsAllocationName = goodsAllocationEntity.getGoodsAllocationName();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
BasicdataGoodsShelfEntity basicdataGoodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId);
if(Objects.isNull(basicdataGoodsShelfEntity)){
log.warn("#################moveAllocationScanAllocation: 货架信息不存在 goodsShelfId={}",goodsShelfId);
throw new CustomerException(403,"货架信息不存在");
}
String goodsShelfName = basicdataGoodsShelfEntity.getGoodsShelfName();
Long goodsAreaId = basicdataGoodsShelfEntity.getGoodsAreaId();//货区id
BasicdataGoodsAreaEntity basicdataGoodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if(Objects.isNull(basicdataGoodsAreaEntity)){
log.warn("#################moveAllocationScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"货区信息不存在");
}
Long wid = basicdataGoodsAreaEntity.getWarehouseId();
String goodsAreaName = basicdataGoodsAreaEntity.getHeadline();//货区名称
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid);
if(Objects.isNull(basicdataWarehouseEntity)){
log.warn("#################moveAllocationScanAllocation: 仓库信息不存在 wid={}",wid);
throw new CustomerException(403,"仓库信息不存在");
}
if(!wid.equals(warehouseId)){
log.warn("#################moveAllocationScanAllocation: 库位不在当前仓");
throw new CustomerException(403,"库位不在当前仓");
}
String warehouseName = basicdataWarehouseEntity.getName();//仓库名称
UpShelfAllocationVO upShelfAllocationVO = new UpShelfAllocationVO();
upShelfAllocationVO.setWarehouseId(warehouseId);
upShelfAllocationVO.setWarehouseName(warehouseName);
upShelfAllocationVO.setAreaId(goodsAreaId);
upShelfAllocationVO.setAreaTitle(goodsAreaName);
upShelfAllocationVO.setShelfId(goodsShelfId);
upShelfAllocationVO.setShelfTitle(goodsShelfName);
upShelfAllocationVO.setAllocationId(allocationId);
upShelfAllocationVO.setAllocationTitle(goodsAllocationName);
//就去查对应的库位绑定数据
QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>();
updownTypeEntityQueryWrapper.eq("area_id",goodsAreaId)
.eq("shelf_id",goodsShelfId)
.eq("allocation_id",allocationId)
.eq("is_deleted",0);
WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper);
if(Objects.isNull(updownTypeEntity)){
log.warn("#############moveAllocationScanAllocation: 库位暂无数据 allocationId={}",allocationId);
return upShelfAllocationVO;
}else{
log.warn("#############moveAllocationScanAllocation: 库位已有绑定货物 allocationId={}",allocationId);
throw new CustomerException(403,"库位已有绑定货物");
}
}
private void saveUpdownGoodsLogPart(List<WarehouseUpdownGoodsEntity> updownGoodsList, int residue, String bindingType, Integer isAlltrays, String remark,Long warehouseId) {
List<WarehouseUpdownGoodsLogEntity> updownGoodsLogList = new ArrayList<>();

Loading…
Cancel
Save