Browse Source

备货库位托盘上架接口

chenglong
汤建军 1 year ago
parent
commit
2a61269da7
  1. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  2. 42
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownStockupAreaApiController.java
  3. 9
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseUpdownStockupAreaService.java
  4. 84
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -160,7 +160,7 @@ date_format(from_unixtime(create_time),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d
<if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.handleStatus != 40 "> and lawo.work_order_status in ( #{param.workOrderStatus }) </if>
<!-- <if test="param.workOrderStatus != null and param.workOrderStatus != '' and param.customerServiceState == null "> and lawo.work_order_status in ( #{param.workOrderStatus }) and lap.types_of = '2' </if>-->
<if test="param.handleStatus != null and param.handleStatus == 40 "> and lawo.work_order_status in ('10') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('30') and lap.types_of = '2' and lap.processing_status in ('1') </if>
<if test="param.handleStatus != null and param.handleStatus == 50 "> and lawo.work_order_status in ('20') and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 10 ">and lap.types_of = '2' </if>
<if test="param.handleStatus!= null and param.handleStatus == 30">and lawo.work_order_status in (21,30) and lap.processing_status = '4' </if>
<if test="param.handleStatus!= null and param.handleStatus == 20 ">and lawo.work_order_status in (80,100) and lacr.warehouse_id=#{param.warehouseId} </if>

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

@ -351,4 +351,46 @@ public class WarehouseUpdownStockupAreaApiController {
}
}
@ResponseBody
@PostMapping("/upShelfTray")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "上架托盘维度", notes = "传入trayTypeDTO")
public R upShelfTray(@RequestBody UpdownTypeDTO updownTypeDTO ) {
String method = "###########upShelfTray: ";
log.info(method + "上架托盘维度 updownTypeDTO={}", updownTypeDTO);
String trayCode = updownTypeDTO.getTrayCode();//托盘码
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,"库位信息不能为空");
}
if(StringUtil.isBlank(trayCode)){
log.warn(method+"托盘码不能为空 trayCode={}",trayCode);
return R.fail(403,"托盘码不能为空");
}
//上架托盘维度
R r = warehouseUpdownStockupAreaService.upShelfTray(trayCode, allocationId, myCurrentWarehouse.getId());
/* if (r.getCode() == 200) {
warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString());
}*/
return r;
}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,"系统异常,联系管理员");
}
}
}

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

@ -119,4 +119,13 @@ public interface IWarehouseUpdownStockupAreaService extends BaseService<Warehous
* @return
*/
R upShelfZeroStockeArticle(List<UpShelfZeroOrderDTO> upShelfZeroOrderList, Long allocationId, Long id);
/**
* 上架托盘
* @param trayCode
* @param allocationId
* @param id
* @return
*/
R upShelfTray(String trayCode, Long allocationId, Long id);
}

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

@ -98,6 +98,8 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
private final WarehouseGoodsAllocationClient warehouseGoodsAllocationClient;
private final IWarehouseTaryAllocationService warehouseTaryAllocationService;
@ -649,6 +651,88 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
return R.status(this.saveBatch(warehouseUpdownStockupAreaEntities));
}
/**
* @param trayCode
* @param allocationId
* @param warehouseId
* @return
*/
@Override
public R upShelfTray(String trayCode, Long allocationId, Long warehouseId) {
int num = 0;
//判断货位是否有托盘
BasicdataTrayEntity trayEntity = warehouseTaryAllocationService.getTrayByAllocationId(allocationId);
if(!Objects.isNull(trayEntity)){
log.warn("##############upShelfTray: 库位上已有托盘 allocationId={}",allocationId);
log.warn("##############upShelfTray: 库位上已有托盘 allocationId={}",allocationId);
// return R.fail(403,"库位上已有托盘");
}
// QueryWrapper<WarehouseUpdownTypeEntity> updownTypeEntityQueryWrapper = new QueryWrapper<>();
// updownTypeEntityQueryWrapper.eq("allocation_id",allocationId)
// .eq("is_deleted",0);
// WarehouseUpdownTypeEntity updownTypeEntity = baseMapper.selectOne(updownTypeEntityQueryWrapper);
// if(!Objects.isNull(updownTypeEntity)){
// log.warn("##############upShelfTray: 库位上已存在货物 allocationId={}",allocationId);
// return R.fail(403,"库位上已存在货物");
// }
BasicdataGoodsAllocationEntity goodsAllocationEntity = basicdataGoodsAllocationClient.getEntityByAllocationId(allocationId);
if(Objects.isNull(goodsAllocationEntity)){
log.warn("##############upShelfTray: 库位不存在 allocationId={}",allocationId);
return R.fail(403,"库位不存在");
}
String enableStatus = goodsAllocationEntity.getEnableStatus();
Long goodsShelfId = goodsAllocationEntity.getGoodsShelfId();
if("2".equals(enableStatus)){
log.warn("##############upShelfTray: 库位已被禁用 allocationId={}",allocationId);
return R.fail(403,"库位已被禁用");
}
BasicdataGoodsShelfEntity goodsShelfEntity = basicdataGoodsShelfClient.getEntityByGoodsShelfId(goodsShelfId);
if(Objects.isNull(goodsShelfEntity)){
log.warn("##############upShelfTray: 货架不存在 goodsShelfId={}",goodsShelfId);
return R.fail(403,"货架不存在");
}
Long goodsAreaId = goodsShelfEntity.getGoodsAreaId();
BasicdataGoodsAreaEntity goodsAreaEntity = basicdataGoodsAreaClient.getEntityByGoodsAreaId(goodsAreaId);
if(Objects.isNull(goodsAreaEntity)){
log.warn("##############upShelfTray: 货区不存在 goodsAreaId={}",goodsAreaId);
return R.fail(403,"货区不存在");
}
// String areaType = goodsAreaEntity.getAreaType();
// if("1".equals(areaType)){
// log.warn("#################upShelfTray: 备货区不能上下架 goodsAreaId={}",goodsAreaId);
// throw new CustomerException(403,"备货区不能上下架");
// }
Long wid = goodsAreaEntity.getWarehouseId();
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(wid);
if(Objects.isNull(warehouseEntity)){
log.warn("##############upShelfTray: 仓库不存在 warehouseId={}",wid);
return R.fail(403,"仓库不存在");
}
if(!wid.equals(warehouseId)){
log.warn("##############upShelfTray: 库位不在本仓库中 warehouseId={}",warehouseId);
return R.fail(403,"库位不在本仓库中");
}
//查询托盘上有哪些货物,存入相同的绑定关系和记录
QueryWrapper<WarehouseTrayTypeEntity> trayTypeEntityQueryWrapper = new QueryWrapper<>();
trayTypeEntityQueryWrapper.eq("tray_code",trayCode)
.eq("is_deleted",0);
WarehouseTrayTypeEntity trayTypeEntity = warehouseTrayTypeService.getOne(trayTypeEntityQueryWrapper);
if(Objects.isNull(trayTypeEntity)){
log.warn("##############upShelfTray: 托盘上没有货物信息 trayCode={}",trayCode);
return R.fail(403,"托盘上没有货物信息");
}
//处理托盘上的货物到库位上
return saveTrayGoodsToAllocation(trayTypeEntity,goodsAllocationEntity,goodsShelfEntity,goodsAreaEntity,warehouseId);
// return null;
}
private R saveTrayGoodsToAllocation(WarehouseTrayTypeEntity trayTypeEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAreaEntity goodsAreaEntity, Long warehouseId) {
return null;
}
private WarehouseUpdownStockupAreaEntity createdNewUpShelfInventory(Long allocationId, Long warehouseId, UpShelfStockDTO upShelfStockDTO, WarehouseUpdownStockupAreaEntity updownTypeEntity, Long goodsAreaId, BasicdataGoodsAreaEntity goodsAreaEntity, Long goodsShelfId, BasicdataGoodsShelfEntity goodsShelfEntity, BasicdataGoodsAllocationEntity goodsAllocationEntity) {
WarehouseUpdownStockupAreaEntity updownStockupAreaEntity = new WarehouseUpdownStockupAreaEntity();
updownStockupAreaEntity.setWarehouseId(warehouseId);

Loading…
Cancel
Save