|
|
|
@ -1109,6 +1109,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
log.error(method + "参数缺少PackageIds:{}", distrilbutionBillLading); |
|
|
|
|
return R.fail("请联系管理员处理"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//查询选择包件是否存在有效数据
|
|
|
|
|
List<Long> list = Func.toLongList(distrilbutionBillLading.getPackageIds()); |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(list); |
|
|
|
@ -1354,7 +1355,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
public List<DistributionBillLadingScanEntity> handleSignPackage(Map<Integer, List<DistributionParcelListEntity>> packageMap, Long id, BasicdataWarehouseEntity myCurrentWarehouse) { |
|
|
|
|
String method = "###################DistributionBillLadingServiceImpl.handleSignPackage"; |
|
|
|
|
List<DistributionBillLadingScanEntity> ladingScanEntities = new ArrayList<>(); |
|
|
|
|
//查询自提信息
|
|
|
|
|
DistrilbutionBillLadingEntity billLadingEntity = this.getById(id); |
|
|
|
|
|
|
|
|
|
List<String> orderCodes = new ArrayList<>(); |
|
|
|
|
List<Long> packageLockIds = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
packageMap.forEach((k, v) -> { |
|
|
|
|
switch (k) { |
|
|
|
|
case 1: |
|
|
|
@ -1390,6 +1396,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
String singleTime = simpleDateFormat.format(new Date()); |
|
|
|
|
// 推送自提作业节点数据
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity,id,singleTime,myCurrentWarehouse); |
|
|
|
|
packageLockIds.add(parcelListEntity.getId()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
@ -1462,6 +1469,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
//添加缓存
|
|
|
|
|
if (!packageLockIds.isEmpty()) { |
|
|
|
|
List<Long> a = redis.get("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:"); |
|
|
|
|
if (Func.isNotEmpty(a)) { |
|
|
|
|
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any)); |
|
|
|
|
if (flag) { |
|
|
|
|
//正在操作,请稍后重试
|
|
|
|
|
throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); |
|
|
|
|
} else { |
|
|
|
|
packageLockIds.addAll(a); |
|
|
|
|
redis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
redis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!orderCodes.isEmpty()) { |
|
|
|
|
String collect = orderCodes.stream().distinct().collect(Collectors.joining(",")); |
|
|
|
|
log.info(method + "维护订单,orderCodes:{}", collect); |
|
|
|
@ -3130,6 +3153,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
if (ObjectUtils.isNull(myCurrentWarehouse)) { |
|
|
|
|
return Resp.scanFail("请选择仓库!", "请选择仓库!"); |
|
|
|
|
} |
|
|
|
|
DistrilbutionBillLadingEntity billLadingEntity = this.getById(billLadingId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询订单是否已签收
|
|
|
|
|
List<DistributionParcelListEntity> list4 = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query() |
|
|
|
|
.lambda() |
|
|
|
@ -3172,7 +3199,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
if (list.isEmpty()) { |
|
|
|
|
return Resp.scanFail("当前提货任务,订单不存在!", "当前提货任务,订单不存在!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Long> packageLockIds = new ArrayList<>(); |
|
|
|
|
AtomicBoolean n = new AtomicBoolean(false); |
|
|
|
|
// 获取订单的ID
|
|
|
|
|
List<Long> ls = list.stream() // 转换为Stream
|
|
|
|
@ -3266,7 +3293,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
distributionBillLadingScan.setStockArticleId(one.getId()); |
|
|
|
|
distributionBillLadingScan.setQuantity(1); |
|
|
|
|
distributionBillLadingScan.setBillLadingId( billLadingId); |
|
|
|
|
|
|
|
|
|
packageLockIds.add(distributionParcelListEntity.getId()); |
|
|
|
|
String signTime=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:SSS").format(new Date()); |
|
|
|
|
|
|
|
|
|
sendNodeWorkDataBroadcast(distributionParcelListEntity,billLadingId,signTime, myCurrentWarehouse); |
|
|
|
@ -3305,9 +3332,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
.setHeader("x-delay", 3000); |
|
|
|
|
return message; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加缓存
|
|
|
|
|
if (!packageLockIds.isEmpty()) { |
|
|
|
|
List<Long> a = redis.get("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:"); |
|
|
|
|
if (Func.isNotEmpty(a)) { |
|
|
|
|
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any)); |
|
|
|
|
if (flag) { |
|
|
|
|
//正在操作,请稍后重试
|
|
|
|
|
throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); |
|
|
|
|
} else { |
|
|
|
|
packageLockIds.addAll(a); |
|
|
|
|
redis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
redis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return Resp.scanSuccess("签收成功", "签收成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|