|
|
|
@ -3170,6 +3170,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
// if (Func.isEmpty(parcelListEntity)) {
|
|
|
|
|
// return Resp.scanFail("包件信息不存在", "包件信息不存在");
|
|
|
|
|
// }
|
|
|
|
|
Integer isStrictLoading = 0; |
|
|
|
|
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId()); |
|
|
|
|
if (!Objects.isNull(warehouseConfig.getIsStrictLoading())){ |
|
|
|
|
isStrictLoading = warehouseConfig.getIsStrictLoading(); |
|
|
|
|
} |
|
|
|
|
DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
if (Func.isEmpty(distributionReservationEntity)) { |
|
|
|
|
log.error("########无效的预约单,reservationId:{}", distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
@ -3209,7 +3214,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.info("包件已在其他车次存在异常 >>>>当前车次:{},异常车次:{}", deliveryListEntity.getTrainNumber(), abnormalEntities.stream().map(DistributionLoadscanAbnormalEntity::getTrainNumber).collect(Collectors.joining(","))); |
|
|
|
|
return R.fail(code + "已在其他车次执行异常!!"); |
|
|
|
|
} |
|
|
|
|
//判断具体的装车信息
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
@ -3238,31 +3242,25 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscanEntity::getOrderPackageCode, parcelListEntity.getOrderPackageCode())); |
|
|
|
|
if (Func.isNotEmpty(distributionLoadscanEntity)) { |
|
|
|
|
|
|
|
|
|
if (distributionLoadscanEntity.getSignforState().equals(2)) { |
|
|
|
|
return Resp.scanFail("重复扫描", "重复扫描"); |
|
|
|
|
} |
|
|
|
|
//存在装车记录,进行修改即可
|
|
|
|
|
|
|
|
|
|
//进行签收记录数据的维护
|
|
|
|
|
distributionLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanEntity.setSignforState(2); |
|
|
|
|
distributionLoadscanEntity.setReceivedQuantity(distributionLoadscanEntity.getLoadedNub()); |
|
|
|
|
distributionLoadscanEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
distributionLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
distributionLoadscanEntity.setSigningUser(nickName); |
|
|
|
|
distributionLoadscanEntity.setSigningUserId(userId); |
|
|
|
|
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.wenyuanpiliangqianshou.getValue()); |
|
|
|
|
|
|
|
|
|
distributionLoadscanService.updateById(distributionLoadscanEntity); |
|
|
|
|
packageLockIds.add(distributionLoadscanEntity.getPackageId()); |
|
|
|
|
pushDatas.add(distributionLoadscanEntity); |
|
|
|
|
//缺少一个异步维护包件签收的方法
|
|
|
|
|
// distributionAsyncService.changeOrderSignforStatus(collect.get(0));
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser()); |
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(distributionLoadscanEntity.getOrderPackageCode())) { |
|
|
|
|
//下架解托
|
|
|
|
|
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托"); |
|
|
|
@ -3275,18 +3273,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
aaa.add(trunklinePackageTrackLog); |
|
|
|
|
} else { |
|
|
|
|
//这里装车的数据需要进行补录
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO(); |
|
|
|
|
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) { |
|
|
|
|
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, ServiceConstant.IS_MASTER_YES) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); |
|
|
|
|
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); |
|
|
|
|
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isStrictLoading){ |
|
|
|
|
return R.fail("当前操作需由司机完成"); |
|
|
|
|
} |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
Boolean driver = distributionDeliveryListService.judgeIsDriver(user); |
|
|
|
|
//这里装车的数据需要进行补录
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = this.getDriver(deliveryListEntity,user,driver); |
|
|
|
|
DistributionDeliveryListEntity listEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
if (Func.isEmpty(listEntity)) { |
|
|
|
|
log.error("##########配送计划异常:{}", listEntity); |
|
|
|
@ -3346,13 +3339,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
jsonObject.put("num", 1); |
|
|
|
|
jsonObject.put("remark", "文员签收下架"); |
|
|
|
|
jsonObjects.add(jsonObject); |
|
|
|
|
//进行签收数量的修改
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新装车包件数和签收包件数
|
|
|
|
|
Integer j = distributionSignforMapper.updateSignforByReservationId(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), distributionLoadscanEntity.getPackageNub()); |
|
|
|
|
//更新签收人
|
|
|
|
|
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser()); |
|
|
|
|
// 包件解托下架
|
|
|
|
|
//包件解托下架
|
|
|
|
|
content = "包件在" + myCurrentWarehouse.getName() + "由" + AuthUtil.getNickName() + "后台签收,装车方式:补录装车,配送车次号:" + deliveryListEntity.getTrainNumber() + "预约任务号:" + distributionReservationEntity.getReservationCode(); |
|
|
|
|
try { |
|
|
|
|
trunklinePackageTrackLog = handleLogJSONObject(myCurrentWarehouse, AuthUtil.getUser(), distributionLoadscanEntity.getOrderPackageCode(), content, WorkNodeEnums.DISTRIBUTION_SIGN_FOR.getCode(), deliveryListEntity.getId().toString(), parcelListEntity.getWarehouseEntryTimeEnd()); |
|
|
|
@ -3368,25 +3356,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionParcelListService.updateById(updatePackage); |
|
|
|
|
//维护签收包件状态
|
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(parcelListEntity.getOrderCode(), myCurrentWarehouse.getId()); |
|
|
|
|
//推送信息至工厂
|
|
|
|
|
// distributionAsyncService.sendFactory(parcelListEntity, simpleDateFormat.format(new Date()), distributionReservationEntity.getId(), distributionReservationEntity.getReservationCode(), myCurrentWarehouse.getName(), nickName);
|
|
|
|
|
sendNodeWorkDataBroadcast(parcelListEntity, distributionReservationEntity, distributionLoadscanEntity.getSigningTime(), myCurrentWarehouse); |
|
|
|
|
|
|
|
|
|
//收集包件
|
|
|
|
|
orderpackages.add(updatePackage.getOrderPackageCode()); |
|
|
|
|
|
|
|
|
|
// 推送商家端
|
|
|
|
|
|
|
|
|
|
// 推送
|
|
|
|
|
// try {
|
|
|
|
|
// sendMessage(orderPackageCode, distributionReservationEntity.getReservationCode(),
|
|
|
|
|
// deliveryListEntity.getTrainNumber(), deliveryListEntity.getVehicleName(), deliveryListEntity.getDriverName(),
|
|
|
|
|
// AuthUtil.getUserName(), myCurrentWarehouse.getId(), AuthUtil.getTenantId());
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
//// throw new RuntimeException(e);
|
|
|
|
|
// log.error(">>>> 签收推送报错", e);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
distributionSignforMapper.autoDpdateSignfor(distributionReservationEntity.getId()); |
|
|
|
|
} else { |
|
|
|
|
//一个客户下出现重复包条码
|
|
|
|
|
log.error("############出现重复包条码:{}", collect); |
|
|
|
@ -5400,7 +5373,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
.ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
if (packageLoadingData.isEmpty() && inventoryLoadingData.isEmpty()) { |
|
|
|
|
return Resp.scanFail("当前客户未进行装车操作", "当前客户未进行装车操作"); |
|
|
|
|
return Resp.scanFail("无可签收数据", "无可签收数据"); |
|
|
|
|
} |
|
|
|
|
if (!packageLoadingData.isEmpty()) { |
|
|
|
|
receivedQuantity += packageLoadingData.stream().mapToInt(DistributionLoadscanEntity::getPackageNub).sum(); |
|
|
|
@ -9025,7 +8998,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
loadscanEntity.setSigningUserId(user.getUserId()); |
|
|
|
|
loadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue()); |
|
|
|
|
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.weiqianshou.getValue()); |
|
|
|
|
if (!loadscanEntity.getLoadedNub().equals(loadscanEntity.getReceivedQuantity())) { |
|
|
|
|
if (loadscanEntity.getLoadedNub().equals(loadscanEntity.getReceivedQuantity())) { |
|
|
|
|
loadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|