diff --git a/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/dto/DeliveryEditDto.java b/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/dto/DeliveryEditDto.java index bbbbca1..e233906 100644 --- a/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/dto/DeliveryEditDto.java +++ b/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/dto/DeliveryEditDto.java @@ -58,4 +58,43 @@ public class DeliveryEditDto { */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date estimatedArrivalTime; + + /** 空车过磅重量 */ + private String emptyWeight; + /** 装车过磅重量 */ + private String entruckWeight; + /** 落地过磅重量 */ + private String landingEntruckWeight; + + /** 检疫票照片 */ + private String quarantineTickeyUrl; + /** 传纸质磅单(双章) */ + private String poundListImg; + /** 车辆空磅上磅车头照片 */ + private String emptyVehicleFrontPhoto; + /** 车辆过重磅车头照片 */ + private String loadedVehicleFrontPhoto; + /** 车辆重磅照片 */ + private String loadedVehicleWeightPhoto; + /** 驾驶员手持身份证站车头照片 */ + private String driverIdCardPhoto; + /** 到地纸质磅单(双章) */ + private String destinationPoundListImg; + /** 到地车辆过重磅车头照片 */ + private String destinationVehicleFrontPhoto; + + /** 装车过磅视频 */ + private String entruckWeightVideo; + /** 空车过磅视频 */ + private String emptyWeightVideo; + /** 装牛视频 */ + private String cattleLoadingVideo; + /** 控槽视频 */ + private String controlSlotVideo; + /** 装完牛绕车一圈视频 */ + private String cattleLoadingCircleVideo; + /** 卸牛视频 */ + private String unloadCattleVideo; + /** 到地过磅视频 */ + private String destinationWeightVideo; } diff --git a/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/service/impl/DeliveryServiceImpl.java b/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/service/impl/DeliveryServiceImpl.java index e43e90d..2f65c91 100644 --- a/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/service/impl/DeliveryServiceImpl.java +++ b/tradeCattle/aiotagro-cattle-trade/src/main/java/com/aiotagro/cattletrade/business/service/impl/DeliveryServiceImpl.java @@ -689,7 +689,9 @@ public class DeliveryServiceImpl extends ServiceImpl i Integer userId = SecurityUtil.getCurrentUserId(); // 入参日志 - logger.info("更新运送清单: deliveryId={}, ratedQuantity={}", dto.getDeliveryId(), dto.getRatedQuantity()); + logger.info("更新运送清单: deliveryId={}, ratedQuantity={}, quarantineTickeyUrl={}, poundListImg={}, cattleLoadingVideo={}", + dto.getDeliveryId(), dto.getRatedQuantity(), dto.getQuarantineTickeyUrl(), + dto.getPoundListImg(), dto.getCattleLoadingVideo()); // 查询运送清单是否存在 Delivery delivery = this.getById(dto.getDeliveryId()); @@ -765,6 +767,71 @@ public class DeliveryServiceImpl extends ServiceImpl i delivery.setFirmPrice(dto.getFirmPrice()); } + // 更新重量字段:将空字符串转换为null,避免数据库DECIMAL字段类型错误 + // 注意:前端可能传递空字符串"",需要处理这种情况 + if (dto.getEmptyWeight() != null) { + delivery.setEmptyWeight(StringUtils.isNotEmpty(dto.getEmptyWeight()) ? dto.getEmptyWeight() : null); + } + if (dto.getEntruckWeight() != null) { + delivery.setEntruckWeight(StringUtils.isNotEmpty(dto.getEntruckWeight()) ? dto.getEntruckWeight() : null); + } + if (dto.getLandingEntruckWeight() != null) { + delivery.setLandingEntruckWeight(StringUtils.isNotEmpty(dto.getLandingEntruckWeight()) ? dto.getLandingEntruckWeight() : null); + } + + // 更新照片字段:将空字符串转换为null,避免前端显示问题 + // 注意:前端总是传递字段(即使是空字符串),只有在传递了有效URL时才更新 + if (dto.getQuarantineTickeyUrl() != null) { + delivery.setQuarantineTickeyUrl(StringUtils.isNotEmpty(dto.getQuarantineTickeyUrl()) ? dto.getQuarantineTickeyUrl() : null); + } + if (dto.getPoundListImg() != null) { + delivery.setPoundListImg(StringUtils.isNotEmpty(dto.getPoundListImg()) ? dto.getPoundListImg() : null); + } + if (dto.getEmptyVehicleFrontPhoto() != null) { + delivery.setEmptyVehicleFrontPhoto(StringUtils.isNotEmpty(dto.getEmptyVehicleFrontPhoto()) ? dto.getEmptyVehicleFrontPhoto() : null); + } + if (dto.getLoadedVehicleFrontPhoto() != null) { + delivery.setLoadedVehicleFrontPhoto(StringUtils.isNotEmpty(dto.getLoadedVehicleFrontPhoto()) ? dto.getLoadedVehicleFrontPhoto() : null); + } + if (dto.getLoadedVehicleWeightPhoto() != null) { + delivery.setLoadedVehicleWeightPhoto(StringUtils.isNotEmpty(dto.getLoadedVehicleWeightPhoto()) ? dto.getLoadedVehicleWeightPhoto() : null); + } + if (dto.getDriverIdCardPhoto() != null) { + delivery.setDriverIdCardPhoto(StringUtils.isNotEmpty(dto.getDriverIdCardPhoto()) ? dto.getDriverIdCardPhoto() : null); + } + if (dto.getDestinationPoundListImg() != null) { + delivery.setDestinationPoundListImg(StringUtils.isNotEmpty(dto.getDestinationPoundListImg()) ? dto.getDestinationPoundListImg() : null); + } + if (dto.getDestinationVehicleFrontPhoto() != null) { + delivery.setDestinationVehicleFrontPhoto(StringUtils.isNotEmpty(dto.getDestinationVehicleFrontPhoto()) ? dto.getDestinationVehicleFrontPhoto() : null); + } + + // 更新视频字段:将空字符串转换为null,避免前端显示问题 + if (dto.getEntruckWeightVideo() != null) { + delivery.setEntruckWeightVideo(StringUtils.isNotEmpty(dto.getEntruckWeightVideo()) ? dto.getEntruckWeightVideo() : null); + } + if (dto.getEmptyWeightVideo() != null) { + delivery.setEmptyWeightVideo(StringUtils.isNotEmpty(dto.getEmptyWeightVideo()) ? dto.getEmptyWeightVideo() : null); + } + if (dto.getCattleLoadingVideo() != null) { + delivery.setEntruckVideo(StringUtils.isNotEmpty(dto.getCattleLoadingVideo()) ? dto.getCattleLoadingVideo() : null); + } + if (dto.getControlSlotVideo() != null) { + delivery.setControlSlotVideo(StringUtils.isNotEmpty(dto.getControlSlotVideo()) ? dto.getControlSlotVideo() : null); + } + if (dto.getCattleLoadingCircleVideo() != null) { + delivery.setCattleLoadingCircleVideo(StringUtils.isNotEmpty(dto.getCattleLoadingCircleVideo()) ? dto.getCattleLoadingCircleVideo() : null); + } + if (dto.getUnloadCattleVideo() != null) { + delivery.setUnloadCattleVideo(StringUtils.isNotEmpty(dto.getUnloadCattleVideo()) ? dto.getUnloadCattleVideo() : null); + } + if (dto.getDestinationWeightVideo() != null) { + delivery.setDestinationWeightVideo(StringUtils.isNotEmpty(dto.getDestinationWeightVideo()) ? dto.getDestinationWeightVideo() : null); + } + + logger.info("更新文件字段: quarantineTickeyUrl={}, poundListImg={}, cattleLoadingVideo={}", + delivery.getQuarantineTickeyUrl(), delivery.getPoundListImg(), delivery.getEntruckVideo()); + // 根据车牌号从车辆表重新获取车辆照片(编辑时同步更新照片) // 这样即使车辆表中的照片有更新,也能同步到运送清单 if (delivery.getLicensePlate() != null && StringUtils.isNotEmpty(delivery.getLicensePlate())) {