|
|
|
@ -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,6 +706,9 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
//判断是否可以继续备货
|
|
|
|
|
DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId); |
|
|
|
|
List<WarehouseUpdownGoodsEntity> locationInformation ; |
|
|
|
|
if(byId.getSourceType().equals("2")){ |
|
|
|
|
//导入
|
|
|
|
|
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); |
|
|
|
|
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); |
|
|
|
@ -712,10 +716,31 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId()); |
|
|
|
|
warehouseUpdownGoodsEntity.setAssociationType("4"); |
|
|
|
|
warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); |
|
|
|
|
List<WarehouseUpdownGoodsEntity> locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); |
|
|
|
|
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,6 +775,8 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
// warehouseUpdownGoodsEntity.setAssociationType("4");
|
|
|
|
|
// WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity);
|
|
|
|
|
if(!locationInformation.isEmpty()){ |
|
|
|
|
if(byId.getServiceType().equals("2")){ |
|
|
|
|
//导入下架
|
|
|
|
|
entity.setAllocationTitle(locationInformation.get(0).getPositionCode()); |
|
|
|
|
entity.setAllocationId(stockupDTO.getAllocationId()); |
|
|
|
|
//todo 待下架操作
|
|
|
|
@ -763,7 +790,17 @@ public class DistributionStockupAppController extends BladeController {
|
|
|
|
|
List<JSONObject> list = new ArrayList<>(); |
|
|
|
|
list.add(jsonObject); |
|
|
|
|
R r = warehouseUpdownTypeClient.downStock(list); |
|
|
|
|
log.debug("下架状态:{}",r.getMsg()); |
|
|
|
|
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,请更换货位继续!!"); |
|
|
|
|
} |
|
|
|
|