|
|
|
@ -3554,11 +3554,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
if (Func.isEmpty(myCurrentWarehouse)) { |
|
|
|
|
return R.fail(403, "未授权!!!"); |
|
|
|
|
} |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
Boolean driver = distributionDeliveryListService.judgeIsDriver(user); |
|
|
|
|
if (!driver){ |
|
|
|
|
return Resp.scanFail("当前操作由司机完成","当前操作由司机完成"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda() |
|
|
|
|
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId()) |
|
|
|
|
); |
|
|
|
|
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliveryListService.getDriver(distributionDeliveryListEntity, user, null, driver); |
|
|
|
|
if (Objects.isNull(deliverySelfEntity)){ |
|
|
|
|
return Resp.scanFail("当前司机无权操作","当前司机无权操作"); |
|
|
|
|
} |
|
|
|
|
if (Func.isEmpty(distributionDeliveryListEntity)) { |
|
|
|
|
return R.fail(403, "配送错误!!!"); |
|
|
|
|
} |
|
|
|
@ -3585,18 +3595,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
//查询这个包件是否满足该客户的要求
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationMapper.selectById(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); |
|
|
|
|
|
|
|
|
|
DistributionDeliverySelfEntity distributionDeliverySelfEntity = new DistributionDeliverySelfEntity(); |
|
|
|
|
if ("1".equals(distributionDeliveryListEntity.getKind())) { |
|
|
|
|
distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(new QueryWrapper<DistributionDeliverySelfEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
|
.eq(DistributionDeliverySelfEntity::getIsMaster, 2) |
|
|
|
|
); |
|
|
|
|
} else { |
|
|
|
|
DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(new QueryWrapper<DistributionDeliveryTripartiteEntity>().lambda() |
|
|
|
|
.eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId())); |
|
|
|
|
BeanUtils.copyProperties(distributionDeliveryTripartiteEntity, distributionDeliverySelfEntity); |
|
|
|
|
} |
|
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
//查询装车扫描表
|
|
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
@ -3639,23 +3637,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntity = loadscanEntity; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(deliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getVehicleNub())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleName(deliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(deliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) { |
|
|
|
|
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
if (Func.isNotEmpty(deliverySelfEntity.getId())) { |
|
|
|
|
distributionLoadscanEntity.setLoadingId(deliverySelfEntity.getId().toString()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
if (Func.isNotEmpty(deliverySelfEntity.getDriverName())) { |
|
|
|
|
distributionLoadscanEntity.setDriverName(deliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(deliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanEntity.setPackageId(parcelListEntity.getId()); |
|
|
|
@ -3739,23 +3737,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
distributionLoadscanEntity = loadscanEntity; |
|
|
|
|
//标识异常签收
|
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getDriverPhone())) { |
|
|
|
|
distributionLoadscanEntity.setDriverPhone(deliverySelfEntity.getDriverPhone()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleNub())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleName(distributionDeliverySelfEntity.getVehicleNub()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getVehicleNub())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleName(deliverySelfEntity.getVehicleNub()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getDriverId())) { |
|
|
|
|
distributionLoadscanEntity.setDriverId(deliverySelfEntity.getDriverId()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getId())) { |
|
|
|
|
distributionLoadscanEntity.setLoadingId(distributionDeliverySelfEntity.getId().toString()); |
|
|
|
|
if (Func.isNotEmpty(deliverySelfEntity.getId())) { |
|
|
|
|
distributionLoadscanEntity.setLoadingId(deliverySelfEntity.getId().toString()); |
|
|
|
|
} |
|
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDriverName())) { |
|
|
|
|
distributionLoadscanEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
if (Func.isNotEmpty(deliverySelfEntity.getDriverName())) { |
|
|
|
|
distributionLoadscanEntity.setDriverName(deliverySelfEntity.getDriverName()); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotBlank(distributionDeliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(distributionDeliverySelfEntity.getVehicleId()); |
|
|
|
|
if (StringUtils.isNotBlank(deliverySelfEntity.getVehicleId())) { |
|
|
|
|
distributionLoadscanEntity.setVehicleId(deliverySelfEntity.getVehicleId()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanEntity.setScanTime(simpleDateFormat.format(new Date())); |
|
|
|
|
distributionLoadscanEntity.setPackageId(parcelListEntity.getId()); |
|
|
|
@ -3824,24 +3822,31 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
|
|
|
|
|
.eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) |
|
|
|
|
); |
|
|
|
|
if (Func.isEmpty(list)) { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
DistributionLoadscanAbnormalEntity distributionLoadscanAbnormalEntity = new DistributionLoadscanAbnormalEntity(); |
|
|
|
|
distributionLoadscanAbnormalEntity.setAuditingStatus(LoadingAbnormalAuditingStatusConstant.daishenhe.getValue()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setStockArticleId(parcelListEntity.getStockArticleId()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverName(distributionDeliverySelfEntity.getDriverName()); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); |
|
|
|
|
distributionLoadscanAbnormalEntity.setDriverPhone(distributionDeliverySelfEntity.getDriverPhone()); |
|
|
|
|
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.getUserName());
|
|
|
|
|
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); |
|
|
|
|
} |
|
|
|
|
//修改对应的签收为可审核
|
|
|
|
|