Browse Source

备货库位扫描库位接口

chenglong
汤建军 1 year ago
parent
commit
fd41f35af7
  1. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DisStockListDetailMapper.xml
  3. 34
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownStockupAreaApiController.java
  4. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java
  5. 58
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/UpDownStockupAreaVO.java

@ -25,6 +25,10 @@ public class UpDownStockupAreaVO {
private String goodsType;
private String orderCode;
private Long orderId;
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DisStockListDetailMapper.xml

@ -58,6 +58,8 @@
ldsl.description_goods AS materielName,
ldsl.market_id AS marketId,
ldsl.market_name AS marketName,
ldsl.id AS orderId,
ldsl.order_code AS orderCode,
ldsl.incoming_batch AS incomingBatch,
#{warehouseId} AS warehouseId,
FROM

34
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownStockupAreaApiController.java

@ -38,6 +38,39 @@ public class WarehouseUpdownStockupAreaApiController {
private final IWarehouseUpdownStockupAreaService warehouseUpdownStockupAreaService;
@ResponseBody
@PostMapping("/upShelfScanAllocation")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "上架扫描备货库位", notes = "传入trayTypeDTO")
public R upShelfScanAllocation(@RequestBody UpdownTypeDTO updownTypeDTO ) {
String method = "###########upShelfScanAllocation: ";
log.info(method + "上架扫描库位 updownTypeDTO={}", updownTypeDTO);
Long allocationId = updownTypeDTO.getAllocationId();//库位ID
try{
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
log.warn(method+"仓库信息不能为空");
return R.fail(403,"仓库信息不能为空");
}
if(Objects.isNull(allocationId)){
log.warn(method+"库位id不能为空 allocationId={}",allocationId);
return R.fail(403,"库位id不能为空");
}
//查询该库位的货物信息
UpShelfAllocationVO upShelfAllocationVO = warehouseUpdownStockupAreaService.upShelfScanAllocation(allocationId,myCurrentWarehouse.getId());
return R.data(upShelfAllocationVO);
}catch (CustomerException e){
log.warn(e.message);
return Resp.scanFail(e.code,e.message,e.message);
}catch (Exception e){
log.error(method+"系统异常,联系管理员",e);
return R.fail(500,"系统异常,联系管理员");
}
}
@ResponseBody
@PostMapping("/upShelfPackage")
@ -109,7 +142,6 @@ public class WarehouseUpdownStockupAreaApiController {
return R.data(upDownStockupAreaVO);
}else {
return Resp.scanFail("该包件不存在","该包件不存在");
}
}catch (CustomerException e){
log.warn(e.message);

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

@ -57,4 +57,12 @@ public interface IWarehouseUpdownStockupAreaService extends BaseService<Warehous
* @return
*/
R upStockupAreaPackage(List<UpStockupAreaPackageDTO> upStockupAreaPackageDTOS, Long allocationId, Long id);
/**
* 备货库位扫描
* @param allocationId
* @param id
* @return
*/
UpShelfAllocationVO upShelfScanAllocation(Long allocationId, Long warehouseId);
}

58
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

@ -107,6 +107,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
stockupAreaVo.setMarketName(parcelListEntity.getMallName());
}
stockupAreaVo.setGoodsType("1");
stockupAreaVo.setOrderId(parcelListEntity.getStockArticleId());
stockupAreaVo.setAssociationId(parcelListEntity.getId());
stockupAreaVo.setAssociationValue(parcelListEntity.getOrderPackageCode());
if (1==parcelListEntity.getConditions()){
@ -224,4 +225,61 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
warehouseUpdownStockupAreaLogService.saveBatch(waitSaveWarehouseUpdownStockupAreaLogEntity);
return R.status(this.saveBatch(waitSaveWarehouseUpdownStockupAreaEntity));
}
/**
* @param allocationId
* @param warehouseId
* @return
*/
@Override
public UpShelfAllocationVO upShelfScanAllocation(Long allocationId, Long warehouseId) {
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("#############upShelfScanAllocation: 库位信息不存在 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("#################upShelfScanAllocation: 货架信息不存在 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("#################upShelfScanAllocation: 货区信息不存在 goodsAreaId={}",goodsAreaId);
throw new CustomerException(403,"货区信息不存在");
}
String areaType = basicdataGoodsAreaEntity.getAreaType();
if(!"1".equals(areaType)){
log.warn("#################upShelfScanAllocation: 备货区不能上下架 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("#################upShelfScanAllocation: 仓库信息不存在 wid={}",wid);
throw new CustomerException(403,"仓库信息不存在");
}
if(!wid.equals(warehouseId)){
log.warn("#################upShelfScanAllocation: 库位不在当前仓");
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);
return upShelfAllocationVO;
}
}

Loading…
Cancel
Save