|
|
|
@ -905,6 +905,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.error(method + "barCode参数缺失"); |
|
|
|
|
return R.fail("请联系备货人员进行备货"); |
|
|
|
|
} |
|
|
|
|
Integer isStrictLoading = 0; |
|
|
|
|
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId()); |
|
|
|
|
if (!Objects.isNull(warehouseConfig.getIsStrictLoading())){ |
|
|
|
|
isStrictLoading = warehouseConfig.getIsStrictLoading(); |
|
|
|
|
} |
|
|
|
|
String[] split = distrilbutionloadingscanDTO.getBarcodes().split(","); |
|
|
|
|
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
List<JSONObject> jsonObjects = new ArrayList<>(); |
|
|
|
@ -938,6 +943,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//更新签收人
|
|
|
|
|
Integer i = distributionSignforMapper.updateSignUser(loadscaninvnEntity.getDeliveryId(), loadscaninvnEntity.getReservationId(), user); |
|
|
|
|
} else { |
|
|
|
|
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){ |
|
|
|
|
return R.fail("操作失败,存在未装车包件"); |
|
|
|
|
} |
|
|
|
|
//不存在装车数据,需要进行装车数据的补录
|
|
|
|
|
//库存品未进行装车
|
|
|
|
|
//这里装车的数据需要进行补录
|
|
|
|
@ -952,6 +960,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); |
|
|
|
|
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); |
|
|
|
|
distributionDeliverySelfEntity.setVehicleNub(distributionDeliveryTripartiteEntity.getVehicleNum()); |
|
|
|
|
} |
|
|
|
|
DistributionLoadscaninvnEntity distributionLoadscaninvnEntity = new DistributionLoadscaninvnEntity(); |
|
|
|
|
|
|
|
|
@ -979,7 +988,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscaninvnEntity.setScanUser(user.getNickName()); |
|
|
|
|
distributionLoadscaninvnEntity.setScanTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscaninvnEntity.setPackageNub(inventoryPackage.get(0).getNum()); |
|
|
|
|
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.yijianzhuangche.getValue()); |
|
|
|
|
distributionLoadscaninvnEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); |
|
|
|
|
distributionLoadscaninvnEntity.setIsInsert(LoadingIsInsertConstant.bulu.getValue()); |
|
|
|
|
distributionLoadscaninvnEntity.setScanType("1"); |
|
|
|
|
distributionLoadscaninvnEntity.setType(2); |
|
|
|
@ -1395,6 +1404,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
log.error(method + "参数异常,ReservationId为空"); |
|
|
|
|
return R.fail("请联系管理员"); |
|
|
|
|
} |
|
|
|
|
Integer isStrictLoading = 0; |
|
|
|
|
WarehouseConfigEntity warehouseConfig = warehouseConfigClient.getWarehouseConfig(myCurrentWarehouse.getId()); |
|
|
|
|
if (!Objects.isNull(warehouseConfig.getIsStrictLoading())) { |
|
|
|
|
isStrictLoading = warehouseConfig.getIsStrictLoading(); |
|
|
|
|
} |
|
|
|
|
//查询订单
|
|
|
|
|
String zeroPackageIds = distrilbutionloadingscanDTO.getZeroPackageIds(); |
|
|
|
|
Long reservationId = distrilbutionloadingscanDTO.getReservationId(); |
|
|
|
@ -1438,12 +1452,18 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
.eq(DistributionLoadscanEntity::getPackageId, zeroPackageIds) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
String driverName = ""; |
|
|
|
|
String driverPhone = ""; |
|
|
|
|
String vehicleNub = ""; |
|
|
|
|
Long loadingId = null; |
|
|
|
|
//查询该车次负责司机
|
|
|
|
|
List<DistributionDeliverySelfVO> deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId()); |
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity(); |
|
|
|
|
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); |
|
|
|
|
distributionDeliverySelfEntity.setVehicleNub(distributionDeliveryTripartiteEntity.getVehicleNum()); |
|
|
|
|
} |
|
|
|
|
//在库数
|
|
|
|
|
int a = 0; |
|
|
|
|
//签收数
|
|
|
|
@ -1454,19 +1474,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
int d = 0; |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.sss"); |
|
|
|
|
if (Func.isEmpty(loadscanEntity)) { |
|
|
|
|
|
|
|
|
|
if ("1".equals(deliveryListEntity.getKind())) { |
|
|
|
|
//自主配送
|
|
|
|
|
driverPhone = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverPhone).collect(Collectors.joining(",")); |
|
|
|
|
driverName = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getDriverName).collect(Collectors.joining(",")); |
|
|
|
|
vehicleNub = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getVehicleNub).collect(Collectors.joining(",")); |
|
|
|
|
List<Long> collect = deliverySelfInfo.stream().filter(f -> 2 == f.getIsMaster()).map(DistributionDeliverySelfVO::getId).collect(Collectors.toList()); |
|
|
|
|
loadingId = collect.get(0); |
|
|
|
|
} else if ("2".equals(deliveryListEntity.getKind())) { |
|
|
|
|
//外协
|
|
|
|
|
} else { |
|
|
|
|
log.error(method + "配送司机异常:{}", distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
return R.fail("请联系管理员"); |
|
|
|
|
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){ |
|
|
|
|
return R.fail("操作失败,存在未装车包件"); |
|
|
|
|
} |
|
|
|
|
a = distributionParcelNumberDTO.getHandQuantity() - reservationZeroPackageEntities.getQuantity(); |
|
|
|
|
b = distributionParcelNumberDTO.getSigninQuantity() + reservationZeroPackageEntities.getQuantity(); |
|
|
|
@ -1474,9 +1483,24 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
d = distributionParcelNumberDTO.getDeliveryQuantity() - reservationZeroPackageEntities.getQuantity(); |
|
|
|
|
//未进行装车操作
|
|
|
|
|
DistributionLoadscanEntity unLoadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
unLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
unLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
unLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
unLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
unLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
unLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); |
|
|
|
|
unLoadscanEntity.setIsInsert(2); |
|
|
|
|
unLoadscanEntity.setLoadingId(loadingId.toString()); |
|
|
|
|
unLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId()+""); |
|
|
|
|
unLoadscanEntity.setOrderId(reservationZeroPackageEntities.getStockArticleId()); |
|
|
|
|
unLoadscanEntity.setPackageId(reservationZeroPackageEntities.getParcelListId()); |
|
|
|
|
unLoadscanEntity.setReservationId(reservationId); |
|
|
|
@ -1490,11 +1514,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
unLoadscanEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
unLoadscanEntity.setTrainNumber(deliveryListEntity.getTrainNumber()); |
|
|
|
|
unLoadscanEntity.setVehicleId(deliveryListEntity.getVehicleId()); |
|
|
|
|
unLoadscanEntity.setVehicleName(vehicleNub); |
|
|
|
|
unLoadscanEntity.setDriverId(deliveryListEntity.getDriverId()); |
|
|
|
|
unLoadscanEntity.setDriverName(driverName); |
|
|
|
|
unLoadscanEntity.setDriverPhone(driverPhone); |
|
|
|
|
unLoadscanEntity.setLoadingId(driverPhone); |
|
|
|
|
unLoadscanEntity.setScanType(LoadingStatusConstant.buluzhuangche.getValue()); |
|
|
|
|
unLoadscanEntity.setScanTime(simpleDateFormat.format(new Date())); |
|
|
|
|
unLoadscanEntity.setSigningTime(simpleDateFormat.format(new Date(System.currentTimeMillis() + (6 * 1000)))); |
|
|
|
@ -1503,7 +1523,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
unLoadscanEntity.setSigningUser(user.getNickName()); |
|
|
|
|
unLoadscanEntity.setIsSignfor(2); |
|
|
|
|
unLoadscanEntity.setSignforState(2); |
|
|
|
|
// loadscanEntity.setSigningTime(new Date().toString());
|
|
|
|
|
unLoadscanEntity.setReceivedQuantity(reservationZeroPackageEntities.getQuantity()); |
|
|
|
|
unLoadscanEntity.setLoadedNub(reservationZeroPackageEntities.getQuantity()); |
|
|
|
|
unLoadscanEntity.setPackageNub(reservationZeroPackageEntities.getQuantity()); |
|
|
|
@ -1529,6 +1548,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
jsonObject.put("remark", "文员签收"); |
|
|
|
|
jsonObjects.add(jsonObject); |
|
|
|
|
} else { |
|
|
|
|
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){ |
|
|
|
|
if (loadscanEntity.getPackageNub() < reservationZeroPackageEntities.getQuantity()){ |
|
|
|
|
return R.fail("装车未完成,无法完成签收"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
a = distributionParcelNumberEntity.getHandQuantity() + loadscanEntity.getLoadedNub() - reservationZeroPackageEntities.getQuantity(); |
|
|
|
|
b = distributionParcelNumberEntity.getSigninQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntities.getQuantity(); |
|
|
|
|
c = distributionParcelNumberEntity.getOutboundQuantity() - loadscanEntity.getReceivedQuantity() + reservationZeroPackageEntities.getQuantity(); |
|
|
|
@ -3170,6 +3195,12 @@ 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 +3240,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 +3268,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,6 +3299,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
} |
|
|
|
|
aaa.add(trunklinePackageTrackLog); |
|
|
|
|
} else { |
|
|
|
|
if (isStrictLoading == Integer.parseInt(IsOrNoConstant.yes.getValue())){ |
|
|
|
|
return R.fail("操作失败,存在未装车包件"); |
|
|
|
|
} |
|
|
|
|
//这里装车的数据需要进行补录
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfDTO(); |
|
|
|
|
if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) { |
|
|
|
@ -3286,6 +3313,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); |
|
|
|
|
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); |
|
|
|
|
distributionDeliverySelfEntity.setVehicleNub(distributionDeliveryTripartiteEntity.getVehicleNum()); |
|
|
|
|
} |
|
|
|
|
DistributionDeliveryListEntity listEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
if (Func.isEmpty(listEntity)) { |
|
|
|
@ -3346,13 +3374,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 +3391,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); |
|
|
|
@ -3397,7 +3405,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
|
|
|
|
|
//添加缓存
|
|
|
|
|
if (!packageLockIds.isEmpty()) { |
|
|
|
|
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:"); |
|
|
|
|
List<Long> a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryListEntity.getTrainNumber() + ":orderPackageCode:"); |
|
|
|
|
if (Func.isNotEmpty(a)) { |
|
|
|
|
assert a != null; |
|
|
|
|
boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any)); |
|
|
|
@ -3406,10 +3414,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
throw new CustomerException("该包件正在被操作,请稍后再试!!!"); |
|
|
|
|
} else { |
|
|
|
|
packageLockIds.addAll(a); |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryListEntity.getTrainNumber() + ":orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryListEntity.getTrainNumber() + ":orderPackageCode:", packageLockIds, 60L); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//维护客户
|
|
|
|
@ -3806,40 +3814,32 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//构建异常签收
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
//查询一次是否进行了异常装车,如果没有进行异常装车数据进行审核
|
|
|
|
|
List<DistributionLoadscanAbnormalEntity> list = distributionLoadscanAbnormalService.list(Wrappers.<DistributionLoadscanAbnormalEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanAbnormalEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) |
|
|
|
|
.eq(DistributionLoadscanAbnormalEntity::getDeliveryListId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
|
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(list)) { |
|
|
|
|
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity(); |
|
|
|
|
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverName(deliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverId(Long.parseLong(deliverySelfEntity.getDriverId())); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverPhone(deliverySelfEntity.getDriverPhone()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDeliveryListId(distributionDeliveryListEntity.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDeliveryType(distributionDeliveryListEntity.getType()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setScanUser(user.getNickName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setScanTime(new Date()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingQuantity(parcelListEntity.getQuantity()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setPackageCode(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingId(loadingId); |
|
|
|
|
distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.qianshouyichang.getValue()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setGoodsType(1); |
|
|
|
|
distributionLoadscanAbnormalEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setGoodsType(1); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingId(loadingId); |
|
|
|
|
distributionLoadscanAbnormalEntity.setVehicleId(Long.parseLong(deliverySelfEntity.getVehicleId())); |
|
|
|
|
distributionLoadscanAbnormalEntity.setVehicleName(deliverySelfEntity.getVehicleNub()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingId(loadingId); |
|
|
|
|
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity); |
|
|
|
|
} |
|
|
|
|
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity(); |
|
|
|
|
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverName(deliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverId(Long.parseLong(deliverySelfEntity.getDriverId())); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverPhone(deliverySelfEntity.getDriverPhone()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDeliveryListId(distributionDeliveryListEntity.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setReservationId(reservationEntity.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDeliveryType(distributionDeliveryListEntity.getType()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setScanUser(user.getNickName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setScanTime(new Date()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingQuantity(parcelListEntity.getQuantity()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setPackageCode(parcelListEntity.getOrderPackageCode()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setPackageId(parcelListEntity.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingId(loadingId); |
|
|
|
|
distributionLoadscanAbnormalEntity.setAbnormalType(LoadingAbnormalTypeConstant.qianshouyichang.getValue()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setGoodsType(1); |
|
|
|
|
distributionLoadscanAbnormalEntity.setWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setWarehouseName(myCurrentWarehouse.getName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setGoodsType(1); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingId(loadingId); |
|
|
|
|
distributionLoadscanAbnormalEntity.setVehicleId(Long.parseLong(deliverySelfEntity.getVehicleId())); |
|
|
|
|
distributionLoadscanAbnormalEntity.setVehicleName(deliverySelfEntity.getVehicleNub()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setLoadingId(loadingId); |
|
|
|
|
distributionLoadscanAbnormalService.save(distributionLoadscanAbnormalEntity); |
|
|
|
|
//修改对应的签收为可审核
|
|
|
|
|
DistributionSignforEntity signforEntity = distributionSignforMapper.getByReservationId(reservationEntity.getId()); |
|
|
|
|
signforEntity.setIsHaveAbnormalPackage(2); |
|
|
|
@ -3912,7 +3912,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
int reservationNum = reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum(); |
|
|
|
|
|
|
|
|
|
AtomicInteger signingTotal = new AtomicInteger(); |
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda().eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
|
.eq(DistributionLoadscanEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()) |
|
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) |
|
|
|
|
); |
|
|
|
|
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda().eq(DistributionLoadscaninvnEntity::getReservationId, distrilbutionloadingscanDTO.getReservationId()).ne(DistributionLoadscaninvnEntity::getScanState, LoadingStatusConstant.quxiao.getValue())); |
|
|
|
|
if (Func.isNotEmpty(loadscanEntityList)) { |
|
|
|
|
int packSignTotal = loadscanEntityList.stream().filter(l -> Func.equals(l.getSignforState(), LoadScanSigningStatusConstant.yiqianshou.getValue())).mapToInt(DistributionLoadscanEntity::getReceivedQuantity).sum(); |
|
|
|
@ -5405,7 +5408,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(); |
|
|
|
@ -7718,9 +7721,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
List<DistributionLoadscanEntity> pushList = new ArrayList<>(); |
|
|
|
|
List<DistributionLoadscaninvnEntity> pushInventoryList = new ArrayList<>(); |
|
|
|
|
//配置项
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = this.getDriver(deliveryListEntity,user,distributionDeliveryListService.judgeIsDriver(user)); |
|
|
|
|
if (Objects.isNull(distributionDeliverySelfEntity)){ |
|
|
|
|
return Resp.scanFail("当前操作人无此包件签收权限!!!","当前操作人无此包件签收权限!!!"); |
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = this.getDriver(deliveryListEntity, user, distributionDeliveryListService.judgeIsDriver(user)); |
|
|
|
|
if (Objects.isNull(distributionDeliverySelfEntity)) { |
|
|
|
|
return Resp.scanFail("当前操作人无此包件签收权限!!!", "当前操作人无此包件签收权限!!!"); |
|
|
|
|
} |
|
|
|
|
switch (type) { |
|
|
|
|
case 1: |
|
|
|
@ -7776,10 +7779,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (Integer.parseInt(IsOrNoConstant.yes.getValue()) == isStrictLoading) { |
|
|
|
|
//校验司机是否一致
|
|
|
|
|
if (!loadscanEntity.getDriverName().equals(distributionDeliverySelfEntity.getDriverName()) || |
|
|
|
|
!loadscanEntity.getDriverId().equals(distributionDeliverySelfEntity.getDriverId()) || |
|
|
|
|
!loadscanEntity.getVehicleName().equals(distributionDeliverySelfEntity.getVehicleNub()) |
|
|
|
|
) { |
|
|
|
|
return Resp.scanFail("当前操作人无此包件签收权限!!!","当前操作人无此包件签收权限"); |
|
|
|
|
return Resp.scanFail("当前操作人无此包件签收权限!!!", "当前操作人无此包件签收权限"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity = updateSignDistributionLoadscanEntity(loadscanEntity, user, parcelListEntity); |
|
|
|
@ -7844,9 +7846,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (OrderPackageReservationStatusConstant.yiyueyue.getValue().equals(parcelListEntity.getOrderPackageReservationStatus())) { |
|
|
|
|
return Resp.scanFail("当前包件存在配送计划", "当前包件存在配送计划"); |
|
|
|
|
} |
|
|
|
|
if (deliveryListEntity.getKind().equals("2")){ |
|
|
|
|
return Resp.scanFail("外协无法异常签收", "外协无法异常签收"); |
|
|
|
|
} |
|
|
|
|
return R.fail(3006, null); |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
return Resp.scanFail("不属于当前签收客户", "不属于当前签收客户"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -8223,9 +8227,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
String collect = orderCodes.stream().distinct().collect(Collectors.joining(",")); |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(collect, myCurrentWarehouse.getId()); |
|
|
|
|
} |
|
|
|
|
distributionSignforMapper.autoDpdateSignfor(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
|
|
|
|
|
String str = checkSignNum(distrilbutionloadingscanDTO); |
|
|
|
|
return Resp.scanSuccess("签收成功", str); |
|
|
|
|
// String str = checkSignNum(distrilbutionloadingscanDTO);
|
|
|
|
|
Integer integer = distributionSignforMapper.signforNum(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
return Resp.scanSuccess(integer+"件", integer+"件"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -8831,8 +8837,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//查询当前操作司机
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
Boolean driver = distributionDeliveryListService.judgeIsDriver(user); |
|
|
|
|
log.info("username>>>>>>>>>>>>>user:{}",user.getNickName()); |
|
|
|
|
log.info("driver>>>>>>>>>>>>>user:{}",driver); |
|
|
|
|
log.info("username>>>>>>>>>>>>>user:{}", user.getNickName()); |
|
|
|
|
log.info("driver>>>>>>>>>>>>>user:{}", driver); |
|
|
|
|
|
|
|
|
|
if (deliveryListEntity.getKind().equals("1")) { |
|
|
|
|
|
|
|
|
@ -8840,7 +8846,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
return Resp.scanFail("当前操作需由司机完成", "当前操作需由司机完成"); |
|
|
|
|
} |
|
|
|
|
DistributionDeliverySelfEntity deliverySelfEntity = this.getDriver(deliveryListEntity, user, driver); |
|
|
|
|
log.info("driverName>>>>>>>>>>>>>:{}",deliverySelfEntity.getDriverName()); |
|
|
|
|
log.info("driverName>>>>>>>>>>>>>:{}", deliverySelfEntity.getDriverName()); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(deliverySelfEntity)) { |
|
|
|
|
|
|
|
|
@ -8910,7 +8916,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
signforEntity.setSjsigningTime(sdf.format(new Date())); |
|
|
|
|
signforEntity.setDriverSigning(SignforDriverSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
signforEntity.setSigneeName(user.getNickName()); |
|
|
|
|
log.info("driverName>>>>>>>>>>>>>:{}",user.getNickName()); |
|
|
|
|
log.info("driverName>>>>>>>>>>>>>:{}", user.getNickName()); |
|
|
|
|
signforEntity.setSigneeId(user.getUserId()); |
|
|
|
|
return R.data(this.updateById(signforEntity)); |
|
|
|
|
} |
|
|
|
@ -9028,7 +9034,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()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -9094,7 +9100,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntity.setScanStatus(LoadingStatusConstant.buluzhuangche.getValue()); |
|
|
|
|
distributionLoadscanEntity.setSignforType(LoadScanSigningTypeStatusConstant.sijiqianshou.getValue()); |
|
|
|
|
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.weiqianshou.getValue()); |
|
|
|
|
if (!distributionLoadscanEntity.getLoadedNub().equals(distributionLoadscanEntity.getReceivedQuantity())) { |
|
|
|
|
if (distributionLoadscanEntity.getLoadedNub().equals(distributionLoadscanEntity.getReceivedQuantity())) { |
|
|
|
|
distributionLoadscanEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue()); |
|
|
|
|
} |
|
|
|
|
return distributionLoadscanEntity; |
|
|
|
|