|
|
|
@ -48,6 +48,7 @@ import org.springblade.common.constant.stockup.StockupStatusConstant;
|
|
|
|
|
import org.springblade.common.constant.stockup.StockupTypeStatusConstant; |
|
|
|
|
import org.springblade.common.utils.CommonUtil; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.redis.cache.BladeRedis; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
@ -705,17 +706,41 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
//判断是否可以继续备货
|
|
|
|
|
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId); |
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); |
|
|
|
|
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationType("4"); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); |
|
|
|
|
List<WarehouseUpdownGoodsEntity> locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if(locationInformation.isEmpty()){ |
|
|
|
|
return Resp.scanFail("当前货位的库存品已为零,请更换货位继续!!", "当前货位的库存品已为零,请更换货位继续!!"); |
|
|
|
|
List<WarehouseUpdownGoodsEntity> locationInformation ; |
|
|
|
|
if(byId.getSourceType().equals("2")){ |
|
|
|
|
//导入
|
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); |
|
|
|
|
warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationType("4"); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); |
|
|
|
|
locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if(locationInformation.isEmpty()){ |
|
|
|
|
return Resp.scanFail("当前货位的库存品已为零,请更换货位继续!!", "当前货位的库存品已为零,请更换货位继续!!"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
//查询包件信息
|
|
|
|
|
List<DistributionParcelListEntity> list = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode) |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderCode, byId.getIncomingBatch()) |
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, byId.getWarehouseId()) |
|
|
|
|
); |
|
|
|
|
if(ObjectUtils.isNotNull(list) && list.size() > 1){ |
|
|
|
|
throw new ServiceException("查询到重复包条信息!!"); |
|
|
|
|
} |
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationId(list.get(0).getId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationType("4"); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); |
|
|
|
|
locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
if(locationInformation.isEmpty()){ |
|
|
|
|
return Resp.scanFail("当前货位没有该包件信息!!", "当前货位没有该包件信息!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Integer i = distributionStockupService.selectPackagePrint(stockupDTO); |
|
|
|
|
switch (i) { |
|
|
|
|
case 1: |
|
|
|
@ -750,20 +775,32 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// warehouseUpdownGoodsEntity.setAssociationType("4");
|
|
|
|
|
// WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
|
|
|
|
|
if(!locationInformation.isEmpty()){ |
|
|
|
|
entity.setAllocationTitle(locationInformation.get(0).getPositionCode()); |
|
|
|
|
entity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
//todo 待下架操作
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("marketId",byId.getMarketId()); |
|
|
|
|
jsonObject.put("materialCode",byId.getMarketCode()); |
|
|
|
|
jsonObject.put("warehouseId",byId.getWarehouseId()); |
|
|
|
|
jsonObject.put("incomingBatch",byId.getIncomingBatch()); |
|
|
|
|
jsonObject.put("enterNum",1); |
|
|
|
|
jsonObject.put("allocationId",stockupDTO.getAllocationId()); |
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
list.add(jsonObject); |
|
|
|
|
R r = warehouseUpdownTypeClient.downStock(list); |
|
|
|
|
log.debug("下架状态:{}",r.getMsg()); |
|
|
|
|
if(byId.getServiceType().equals("2")){ |
|
|
|
|
//导入下架
|
|
|
|
|
entity.setAllocationTitle(locationInformation.get(0).getPositionCode()); |
|
|
|
|
entity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
//todo 待下架操作
|
|
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
|
jsonObject.put("marketId",byId.getMarketId()); |
|
|
|
|
jsonObject.put("materialCode",byId.getMarketCode()); |
|
|
|
|
jsonObject.put("warehouseId",byId.getWarehouseId()); |
|
|
|
|
jsonObject.put("incomingBatch",byId.getIncomingBatch()); |
|
|
|
|
jsonObject.put("enterNum",1); |
|
|
|
|
jsonObject.put("allocationId",stockupDTO.getAllocationId()); |
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
list.add(jsonObject); |
|
|
|
|
R r = warehouseUpdownTypeClient.downStock(list); |
|
|
|
|
if(r.getCode() != 200){ |
|
|
|
|
log.debug("##########"+r.getMsg()); |
|
|
|
|
return Resp.scanFail("下架失败,请联系管理员!!","下架失败,请联系管理员!!"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
R r = warehouseUpdownTypeClient.downPackage(packetBarCode, byId.getWarehouseId()); |
|
|
|
|
if(r.getCode() != 200){ |
|
|
|
|
log.debug("##########"+r.getMsg()); |
|
|
|
|
return Resp.scanFail("下架失败,请联系管理员!!","下架失败,请联系管理员!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
return Resp.scanFail("本货位的物料已为0,请更换货位继续!!","本货位的物料已为0,请更换货位继续!!"); |
|
|
|
|
} |
|
|
|
|