|
|
|
@ -4643,7 +4643,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//配送零担备货
|
|
|
|
|
return handleDeliveryZeroStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity); |
|
|
|
|
case 4: |
|
|
|
|
//配送零担备货
|
|
|
|
|
//配送托盘备货
|
|
|
|
|
return handleDeliveryTrayStockUp(stockupDTO, myCurrentWarehouse, reservationId, stockupEntity); |
|
|
|
|
default: |
|
|
|
|
log.error(method + "未知scanType"); |
|
|
|
@ -4687,26 +4687,42 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.info(method+"查询预约包件计划信息错误>>>>>>>>>>>>>>>>>>>>>>reservationId:{}",reservationId); |
|
|
|
|
return R.fail("查询计划信息错误"); |
|
|
|
|
} |
|
|
|
|
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList()); |
|
|
|
|
boolean isAllStockUp = distributionParcelListEntities.stream().anyMatch(a -> OrderPackageStockupStatusConstant.daibeihuo.getValue().equals(a.getOrderPackageStockupStatus())); |
|
|
|
|
if (isAllStockUp) { |
|
|
|
|
List<DistributionParcelListEntity> unStockUpPackageData = distributionParcelListEntities.stream().filter(f1 -> OrderPackageStockupStatusConstant.daibeihuo.getValue().equals(f1.getOrderPackageStockupStatus())).collect(Collectors.toList()); |
|
|
|
|
if (unStockUpPackageData.isEmpty()) { |
|
|
|
|
return Resp.scanFail("扫描已完成","扫描已完成"); |
|
|
|
|
} |
|
|
|
|
List<Long> trayPackageIds = trayIdList.stream().map(WarehouseTrayGoodsEntity::getAssociationId).collect(Collectors.toList()); |
|
|
|
|
List<DistributionParcelListEntity> packageData = unStockUpPackageData.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList()); |
|
|
|
|
if (packageData.isEmpty()) { |
|
|
|
|
return R.fail("当前托盘无此客户的货物"); |
|
|
|
|
} |
|
|
|
|
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId()); |
|
|
|
|
//生成扫描数据
|
|
|
|
|
List<DistributionStockEntity> stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId(),stockupEntity); |
|
|
|
|
if (!stockEntityList.isEmpty()) { |
|
|
|
|
// 备货作业节点
|
|
|
|
|
distributionStockService.saveBatch(stockEntityList); |
|
|
|
|
List<Long> updatePackageIds = stockEntityList.stream().map(DistributionStockEntity::getParcelListId).collect(Collectors.toList()); |
|
|
|
|
distributionParcelListService.update(Wrappers.<DistributionParcelListEntity>update().lambda() |
|
|
|
|
.in(DistributionParcelListEntity::getId,updatePackageIds) |
|
|
|
|
.set(DistributionParcelListEntity::getOrderPackageStockupStatus,OrderPackageStockupStatusConstant.yibeihu.getValue()) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> packageData = distributionParcelListEntities.stream().filter(f -> trayPackageIds.contains(f.getId())).collect(Collectors.toList()); |
|
|
|
|
if (packageData.isEmpty()) { |
|
|
|
|
return R.fail("当前托盘无此客户的货物"); |
|
|
|
|
} |
|
|
|
|
warehouseUpdownTypeClient.downTray(trayByTrayCode.getPalletCode(),myCurrentWarehouse.getId()); |
|
|
|
|
//生成扫描数据
|
|
|
|
|
List<DistributionStockEntity> stockEntityList = generateDeliveryTrayPackageStockEntity(reservationEntity,packageData,myCurrentWarehouse,user,stockupDTO.getStockupId()); |
|
|
|
|
if (!stockEntityList.isEmpty()) { |
|
|
|
|
distributionStockService.saveBatch(stockEntityList); |
|
|
|
|
return Resp.scanSuccess("操作成功",""); |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("订制品备货已完成",""); |
|
|
|
|
} |
|
|
|
|
return Resp.scanSuccess("操作成功"," "); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<DistributionStockEntity> generateDeliveryTrayPackageStockEntity(DistributionReservationEntity reservationEntity, |
|
|
|
|
List<DistributionParcelListEntity> packageData, |
|
|
|
|
BasicdataWarehouseEntity warehouse, |
|
|
|
|
BladeUser user, |
|
|
|
|
Long stockUpId) { |
|
|
|
|
Long stockUpId, |
|
|
|
|
DistributionStockupEntity stockupEntity) { |
|
|
|
|
List<DistributionStockEntity> list= new ArrayList<>(); |
|
|
|
|
for (DistributionParcelListEntity parcelListEntity : packageData) { |
|
|
|
|
DistributionStockEntity distributionStockEntity = new DistributionStockEntity(); |
|
|
|
@ -4728,6 +4744,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionStockEntity.setScanUser(user.getNickName()); |
|
|
|
|
distributionStockEntity.setIsTray(Integer.parseInt(IsOrNoConstant.yes.getValue())); |
|
|
|
|
list.add(distributionStockEntity); |
|
|
|
|
NodeFanoutMsg<StockUpVO> nodeFanoutMsg = buildStockUpNodeData(stockupEntity, distributionStockEntity, parcelListEntity); |
|
|
|
|
if (ObjectUtils.isNotNull(nodeFanoutMsg)) { |
|
|
|
|
distributionNodeWorkService.planStock(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return list; |
|
|
|
|
} |
|
|
|
@ -5071,7 +5091,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (parcelListEntity.getConditions() != 2) { |
|
|
|
|
return Resp.scanFail("当前包件不是库存品", "当前包件不是库存品"); |
|
|
|
|
} |
|
|
|
|
if (OrderPackageGroundingStatusConstant.yishangjia.getValue().equals(parcelListEntity.getOrderPackageFreezeStatus())) { |
|
|
|
|
if (OrderPackageGroundingStatusConstant.yishangjia.getValue().equals(parcelListEntity.getOrderPackageGroundingStatus())) { |
|
|
|
|
return Resp.scanFail("当前库存品未上架", "当前库存品未上架"); |
|
|
|
|
} |
|
|
|
|
//查询计划是否正常
|
|
|
|
@ -5660,12 +5680,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R handleDeliveryPackageDetailList(Long reservationId, Long orderId) { |
|
|
|
|
public R handleDeliveryPackageDetailList(Long reservationId) { |
|
|
|
|
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId); |
|
|
|
|
if (Objects.isNull(stockUpClientVO)){ |
|
|
|
|
return R.fail("查询备货客户信息错误"); |
|
|
|
|
} |
|
|
|
|
List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList = baseMapper.selectDeliveryPackageDetailList(reservationId,orderId); |
|
|
|
|
List<DistributionAppStockUpPackageDetailVO> deliveryPackageDetailList = baseMapper.selectDeliveryPackageDetailList(reservationId); |
|
|
|
|
if (!deliveryPackageDetailList.isEmpty()) { |
|
|
|
|
stockUpClientVO.setDeliveryPackageDetailList(deliveryPackageDetailList); |
|
|
|
|
} |
|
|
|
@ -5674,12 +5694,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R handleBillPackageDetailList(Long reservationId, Long orderId) { |
|
|
|
|
public R handleBillPackageDetailList(Long reservationId) { |
|
|
|
|
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId); |
|
|
|
|
if (Objects.isNull(stockUpClientVO)){ |
|
|
|
|
return R.fail("查询备货客户信息错误"); |
|
|
|
|
} |
|
|
|
|
List<DistributionAppStockUpPackageDetailVO> billPackageDetailList = baseMapper.selectBillPackageDetailList(reservationId,orderId); |
|
|
|
|
List<DistributionAppStockUpPackageDetailVO> billPackageDetailList = baseMapper.selectBillPackageDetailList(reservationId); |
|
|
|
|
if (!billPackageDetailList.isEmpty()) { |
|
|
|
|
stockUpClientVO.setDeliveryPackageDetailList(billPackageDetailList); |
|
|
|
|
} |
|
|
|
@ -5827,14 +5847,15 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
//查询已扫备货的详情
|
|
|
|
|
List<DistributionAppStockUpScanDetailVO> stockUpScanDetailVO = distributionStockService.selectScanDetail(reservationId,stockupId); |
|
|
|
|
return R.data(stockUpScanDetailVO); |
|
|
|
|
if (!stockUpScanDetailVO.isEmpty()) { |
|
|
|
|
stockUpClientVO.setStockUpScanDetailVO(stockUpScanDetailVO); |
|
|
|
|
return R.data(stockUpClientVO); |
|
|
|
|
} |
|
|
|
|
return R.fail("无备货记录"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R newStockupArea(StockupDTO stockupDTO) { |
|
|
|
|
if (Objects.isNull(stockupDTO.getStockupId())){ |
|
|
|
|
return R.fail("StockupId()参数缺失"); |
|
|
|
|
} |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
return Resp.scanFail("请选择备货作业仓库","请选择备货作业仓库"); |
|
|
|
@ -5843,6 +5864,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanFail("当前仓库无部门信息","当前仓库无部门信息"); |
|
|
|
|
} |
|
|
|
|
Long stockupId = stockupDTO.getStockupId(); |
|
|
|
|
String allocationCode = stockupDTO.getAllocationCode(); |
|
|
|
|
DistributionStockupEntity stockupEntity = this.getById(stockupId); |
|
|
|
|
if (Objects.isNull(stockupEntity)) { |
|
|
|
|
return R.fail("查询备货计划错误"); |
|
|
|
@ -5862,7 +5884,16 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long deptId = myCurrentWarehouse.getDepartment(); |
|
|
|
|
return R.data(basicdataGoodsAreaClient.getDepartmentId(deptId)); |
|
|
|
|
List<BasicdataGoodsAreaVO> goodsAreaVOList = basicdataGoodsAreaClient.getDepartmentId(deptId); |
|
|
|
|
BasicdataGoodsAllocationEntity entityByQrCode = basicdataGoodsAllocationClient.findEntityByQrCode(myCurrentWarehouse.getId(), allocationCode); |
|
|
|
|
if (Objects.isNull(entityByQrCode)){ |
|
|
|
|
return Resp.scanFail("请扫描库位码","请扫描库位码"); |
|
|
|
|
} |
|
|
|
|
List<BasicdataGoodsAreaVO> areaVOList = goodsAreaVOList.stream().filter(f -> "1".equals(f.getAreaType()) && entityByQrCode.getGoodsAreaId().equals(f.getId())).collect(Collectors.toList()); |
|
|
|
|
if (!areaVOList.isEmpty()) { |
|
|
|
|
return Resp.scanFail("当前库位不是备货库位","当前库位不是备货库位"); |
|
|
|
|
} |
|
|
|
|
return R.data(entityByQrCode); |
|
|
|
|
}else { |
|
|
|
|
return Resp.scanFail("当前操作人无此操作权限","当前操作人无此操作权限"); |
|
|
|
|
} |
|
|
|
@ -6058,13 +6089,28 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R handleDeliveryTrayDetailList(Long reservationId) { |
|
|
|
|
|
|
|
|
|
return R.data(distributionReservationMapper.deliveryTrayDetailList(reservationId)); |
|
|
|
|
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId); |
|
|
|
|
if (Objects.isNull(stockUpClientVO)){ |
|
|
|
|
return R.fail("查询备货客户信息错误"); |
|
|
|
|
} |
|
|
|
|
List<DistributionAppStockUpTrayDetailVO> distributionAppStockUpTrayDetailVOS = distributionReservationMapper.deliveryTrayDetailList(reservationId); |
|
|
|
|
if (!distributionAppStockUpTrayDetailVOS.isEmpty()) { |
|
|
|
|
stockUpClientVO.setDeliveryTrayList(distributionAppStockUpTrayDetailVOS); |
|
|
|
|
} |
|
|
|
|
return R.data(stockUpClientVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R handleBillTrayDetailList(Long reservationId) { |
|
|
|
|
return R.data(distrilbutionBillLadingMapper.billTrayDetailList(reservationId)); |
|
|
|
|
DistributionAppStockUpClientVO stockUpClientVO = baseMapper.selectPlanClientDetailById(reservationId); |
|
|
|
|
if (Objects.isNull(stockUpClientVO)){ |
|
|
|
|
return R.fail("查询备货客户信息错误"); |
|
|
|
|
} |
|
|
|
|
List<DistributionAppStockUpTrayDetailVO> distributionAppStockUpTrayDetailVOS = distrilbutionBillLadingMapper.billTrayDetailList(reservationId); |
|
|
|
|
if (!distributionAppStockUpTrayDetailVOS.isEmpty()) { |
|
|
|
|
stockUpClientVO.setDeliveryTrayList(distributionAppStockUpTrayDetailVOS); |
|
|
|
|
} |
|
|
|
|
return R.data(stockUpClientVO); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|