|
|
|
@ -242,6 +242,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
@Autowired |
|
|
|
|
private ITrunklinePackageTrackLogClient trunklinePackageTrackLogClient; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IDistributionNodeWorkService iDistributionNodeWorkService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<DistributionSignforVO> selectDistributionSignforPage(IPage<DistributionSignforVO> page, DistributionSignforVO distributionSignfor) { |
|
|
|
@ -2490,6 +2493,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
@Override |
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public R signfor(DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String nickName = null; |
|
|
|
|
Long userId = null; |
|
|
|
|
//思路: 在于一个客户下不会出现重复的包条码
|
|
|
|
@ -2498,10 +2503,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return R.fail(403, "仓库信息不能为空"); |
|
|
|
|
} |
|
|
|
|
DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
if (Objects.isNull(myCurrentWarehouse)) { |
|
|
|
|
return R.fail(403, "配送任务错误"); |
|
|
|
|
} |
|
|
|
|
//查询是否完成复核
|
|
|
|
|
//查询是否完成复核
|
|
|
|
|
DistributionSignforEntity signforEntity = this.getOne(Wrappers.<DistributionSignforEntity>query().lambda() |
|
|
|
|
.eq(DistributionSignforEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) |
|
|
|
|
); |
|
|
|
@ -2523,13 +2525,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS"); |
|
|
|
|
// ---------------------------------2023-09-09 包件签收调整---------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
String singleTime = simpleDateFormat.format(new Date()); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity parcelListEntity = distributionParcelListService.selectByOrderPackageCode(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId()); |
|
|
|
|
if (Func.isEmpty(parcelListEntity)) { |
|
|
|
|
return Resp.scanFail("系统无编码", "系统无编码"); |
|
|
|
|
} |
|
|
|
|
if (parcelListEntity.equals(OrderPackageStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
if (parcelListEntity.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { |
|
|
|
|
return Resp.scanFail("包件已签收", "包件已签收"); |
|
|
|
|
} |
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
@ -2591,7 +2593,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
//存在装车记录,进行修改即可
|
|
|
|
|
//进行签收记录数据的维护
|
|
|
|
|
loadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
loadscanEntity.setSigningTime(singleTime); |
|
|
|
|
loadscanEntity.setSignforState(2); |
|
|
|
|
loadscanEntity.setOneClick(1); |
|
|
|
|
loadscanEntity.setOneQclick(1); |
|
|
|
@ -2704,8 +2706,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionParcelListService.updateById(updatePackage); |
|
|
|
|
//维护签收包件状态
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(collect.get(0).getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
//推送信息至工厂
|
|
|
|
|
distributionAsyncService.sendFactory(collect.get(0), simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName); |
|
|
|
|
|
|
|
|
|
orderPackageCodes.add(updatePackage.getOrderPackageCode()); |
|
|
|
|
//进行备货库位下架
|
|
|
|
|
List<JSONObject> jsonObjects = new ArrayList<>(); |
|
|
|
@ -2722,12 +2723,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} else if (Func.isEmpty(collect)) { |
|
|
|
|
//这里就需要对该包件信息是否属于该配送计划进行判定。如果属于该配送计划则是串货。不是那么则需要提示是否异常签收或者返回的操作
|
|
|
|
|
//查询配送计划中是否存在该包件
|
|
|
|
|
DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
); |
|
|
|
|
if (Func.isNotEmpty(one) && one.getConditions() == 2) { |
|
|
|
|
log.warn("#####################此包件不是定制品 {}", one.getConditions()); |
|
|
|
|
if (Func.isNotEmpty(parcelListEntity) && parcelListEntity.getConditions() == 2) { |
|
|
|
|
log.warn("#####################此包件不是定制品 {}", parcelListEntity.getConditions()); |
|
|
|
|
return Resp.scanFail("此包件不是定制品", "此包件不是定制品"); |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
@ -2796,15 +2793,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(aaa); |
|
|
|
|
|
|
|
|
|
// 推送
|
|
|
|
|
try { |
|
|
|
|
sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(), |
|
|
|
|
deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(), |
|
|
|
|
AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// throw new RuntimeException(e);
|
|
|
|
|
log.error(">>>> 签收推送报错", e); |
|
|
|
|
} |
|
|
|
|
// 节点作业推送
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, singleTime, myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Resp.scanSuccessWithData("签收成功", str, orderPackageCodes); |
|
|
|
@ -2814,6 +2804,20 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void sendNodeWorkDataBroadcast(DistributionParcelListEntity parcelListEntity, DistributionReservationEntity distributionReservationEntity, String singleTime, BasicdataWarehouseEntity myCurrentWarehouse) { |
|
|
|
|
try { |
|
|
|
|
//推送信息至工厂
|
|
|
|
|
// distributionAsyncService.sendFactory(parcelListEntity, singleTime, distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
|
|
|
|
|
// sendMessage(distrilbutionloadingscanDTO.getBarcode(), distributionReservationEntity.getReservationCode(),
|
|
|
|
|
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
|
|
|
|
|
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
|
|
|
|
|
iDistributionNodeWorkService.signFor(parcelListEntity, distributionReservationEntity.getId(), singleTime, myCurrentWarehouse.getName()); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
// throw new RuntimeException(e);
|
|
|
|
|
log.error(">>>> 签收作业节点广播报错", e); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @param orderPackageCode |
|
|
|
|
* @param reservationCode |
|
|
|
@ -3074,7 +3078,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//维护签收包件状态
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
//推送信息至工厂
|
|
|
|
|
distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName); |
|
|
|
|
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
//收集包件
|
|
|
|
|
orderpackages.add(updatePackage.getOrderPackageCode()); |
|
|
|
|
|
|
|
|
@ -4843,9 +4849,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionAsyncService.checkSignStatus(loadscanEntities.getPackageId(), loadscanEntities.getReservationId(), loadscanEntities.getDeliveryId()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName()); |
|
|
|
|
packageIds.add(parcelListEntity.getId()); |
|
|
|
|
orderCodes.add(parcelListEntity.getOrderCode()); |
|
|
|
|
|
|
|
|
|
//distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, signingTime, myCurrentWarehouse); |
|
|
|
|
} |
|
|
|
|
//批量维护订单信息
|
|
|
|
|
if (Func.isNotEmpty(orderCodes)) { |
|
|
|
@ -4980,7 +4988,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//处理库存品
|
|
|
|
|
//查询出该客户下的库存品信息
|
|
|
|
|
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionSignforEntity.getReservationId()); |
|
|
|
|
if (detailEntities.size() > 0 && Func.isNotEmpty(detailEntities)) { |
|
|
|
|
if (!detailEntities.isEmpty() && Func.isNotEmpty(detailEntities)) { |
|
|
|
|
loadingInventoryNum += detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum(); |
|
|
|
|
signingInventoryNum += detailEntities.stream().mapToInt(DisStockListDetailEntity::getNum).sum(); |
|
|
|
|
boolean flag = detailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode())); |
|
|
|
@ -5310,7 +5318,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
jsonObjects.add(jsonObject); |
|
|
|
|
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntity.getSigningUser() + "司机司机批量签收,装车方式:扫描装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd()); |
|
|
|
|
distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName()); |
|
|
|
|
//distributionAsyncService.sendFactory(parcelListEntity, loadscanEntity.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntity.getSigningTime(), myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
loadscanEntities.setMsg("司机一键签收数据补录"); |
|
|
|
@ -5329,8 +5338,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
packageLockIds.add(loadscanEntities.getPackageId()); |
|
|
|
|
content = "包件在" + myCurrentWarehouse.getName() + "由" + loadscanEntities.getSigningUser() + "司机批量签收,装车方式:补录装车,配送车次号:" + distributionDeliveryListEntity.getTrainNumber() + "预约任务号:" + reservationEntity.getReservationCode(); |
|
|
|
|
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), parcelListEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_ABNORMAL_SIGN_FOR.getCode(), distributionDeliveryListEntity.getTrainNumber(), parcelListEntity.getWarehouseEntryTimeEnd()); |
|
|
|
|
//推送扫描记录
|
|
|
|
|
distributionAsyncService.sendFactory(parcelListEntity, loadscanEntities.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName()); |
|
|
|
|
// distributionAsyncService.sendFactory(parcelListEntity, loadscanEntities.getSigningTime(), reservationEntity.getId(), reservationEntity.getReservationCode(), myCurrentWarehouse.getName(), user.getNickName());
|
|
|
|
|
// 节点作业推送
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, reservationEntity, loadscanEntities.getSigningTime(), myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|