diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java index 515494bbe..50f2500ad 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java @@ -79,9 +79,6 @@ public interface IBasicdataWarehouseClient { BasicdataWarehouseEntity getWarehouseEntityByWarehouseCode(@RequestParam String warehouseCode); - @GetMapping(WAREHOUSEBYDEPARTMENT) - BasicdataWarehouseEntity getWarehouseByDepartment(@RequestParam String deptId); - /** * 查询当前登录人仓库信息 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataCategoryImporter.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataCategoryImporter.java index 04356ed71..97e460ef3 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataCategoryImporter.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataCategoryImporter.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.logpm.basicdata.entity.BasicdataCategoryEntity; import com.logpm.basicdata.service.IBasicdataCategoryService; import lombok.AllArgsConstructor; +import org.springblade.common.exception.CustomerException; import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.excel.support.ExcelImporter; import org.springblade.core.log.exception.ServiceException; @@ -22,7 +23,7 @@ public class BasicdataCategoryImporter implements ExcelImporter data) { // 验证data 是否存在name相同的数据 @@ -32,7 +33,7 @@ public class BasicdataCategoryImporter implements ExcelImporter data) { @@ -53,14 +54,14 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter entity.getName().equals(datum.getCategory())); if (!isBrandFound) { // 或者执行其他逻辑,如记录到日志、抛出异常等 - throw new ServiceException(datum.getCategory() + "结算品类在系统中不存在!"); + throw new CustomerException(datum.getCategory() + "结算品类在系统中不存在!"); } // 需要判断目前增加的三方物料在系统中是否已经存在 diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java index 5322a9431..9ea560d99 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java @@ -94,8 +94,8 @@ public class BasicdataClientUserServiceImpl extends BaseServiceImpl 0 ){ - throw new RuntimeException("客户已绑定此门店!"); + if(!basicdataShopEntities.isEmpty()){ + throw new CustomerException("客户已绑定此门店!"); } basicdataShop.setTypeService(null); basicdataShop.setBusinessType(null); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java index 20def4979..dc909577d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java @@ -32,6 +32,7 @@ import com.logpm.basicdata.service.IBasicdataShopService; import com.logpm.basicdata.service.IBasicdataStoreBrandService; import com.logpm.basicdata.vo.BasicdataStoreBrandVO; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -88,20 +89,20 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.query().lambda() .eq(BasicdataStoreBrandEntity::getBrandId, basicdataStoreBrand.getBrandId()) .eq(BasicdataStoreBrandEntity::getClientId,basicdataStoreBrand.getShopId()) ); - if(basicdataStoreBrandEntities.size() > 0){ - throw new RuntimeException("当前已拥有该品牌!"); + if(!basicdataStoreBrandEntities.isEmpty()){ + throw new CustomerException("当前已拥有该品牌!"); } basicdataStoreBrand.setClientId(Long.parseLong(basicdataStoreBrand.getShopId())); //进行日志客户的日志记录 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java index 57d19afea..10cf28b2a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java @@ -124,8 +124,12 @@ public class DistributionSignforController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "详情", notes = "传入distributionSignfor") public R loadingAbnormalPackageListAuditing(@RequestParam("ids") String ids) { - R r = distributionSignforService.loadingAbnormalPackageListAuditing(ids); - return r; + try { + R r = distributionSignforService.loadingAbnormalPackageListAuditing(ids); + return r; + } catch (Exception e) { + return R.fail(e.getMessage()); + } } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java index e86651894..4fe4689ca 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java @@ -274,16 +274,6 @@ public class DistributionStockListController extends BladeController { return R.success("操作成功"); } - /** - * 获取批量在库订单信息 - */ - @GetMapping("/packageList") - @ApiOperationSupport(order = 7) - @ApiOperation(value = "获取批量在库订单信息", notes = "传入ids") - public R getPackageList(@RequestParam String id) { - R> result = distributionStockListService.getPackageList(id); - return result; - } /** * 获取批量在库订单信息 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index 73796eff3..eb0a8395f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java @@ -369,7 +369,11 @@ public class DistrilbutionBillLadingController extends BladeController { @ApiOperationSupport(order = 7) @ApiOperation(value = "批量签收定制品", notes = "传入ids") public R batchSign( @RequestBody DistrilbutionBillLadingDTO distrilbutionBillLading) { - return distrilbutionBillLadingService.batchSign(distrilbutionBillLading); + try { + return distrilbutionBillLadingService.batchSign(distrilbutionBillLading); + } catch (Exception e) { + return R.fail(e.getMessage()); + } } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java index b5e08aa2c..29b33d037 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java @@ -62,12 +62,6 @@ public interface IDistributionStockListService extends BaseService exportDistributionStockList(Map distributionStockList); - /** - * 查询订单下的包件信息 - * @param id - * @return - */ - R> getPackageList(String id); /** * 导入用户数据 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java index c4779df02..7741bb49f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java @@ -40,6 +40,7 @@ import com.logpm.distribution.vo.app.DistributionAppAddvalueVO; import lombok.extern.slf4j.Slf4j; import org.apache.logging.log4j.util.Strings; import org.springblade.common.constant.loading.LoadingStatusConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -425,7 +426,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(p.getPackageId()); if (!packageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; case 2: @@ -443,7 +444,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(p.getPackageId()); if (!inventoryPackageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; case 3: @@ -461,7 +462,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(p.getPackageId()); if (!zeroPackageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; } @@ -641,7 +642,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(s.getPackageId()); if (!packageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; case 2: @@ -659,7 +660,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(s.getPackageId()); if (!inventoryPackageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; case 3: @@ -677,7 +678,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(s.getPackageId()); if (!zeroPackageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; } @@ -1043,7 +1044,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean packageFlag = parcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(dto.getPackageId()); if (!packageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; case 2: @@ -1060,7 +1061,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl detailEntities = distributionReservationMapper.selectInventoryListByReservation(distributionAppAddvalueDTO.getReservationId()); boolean inventoryPackageFlag = detailEntities.stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()).contains(dto.getPackageId()); if (!inventoryPackageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; case 3: @@ -1078,7 +1079,7 @@ public class DistributionAddvalueServiceImpl extends BaseServiceImpl !Func.equals(pack.getId(), p.getPackageId())); boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().map(DistributionParcelNumberDTO::getId).collect(Collectors.toList()).contains(dto.getPackageId()); if (!zeroPackageFlag) { - throw new RuntimeException("不属于该客户包件"); + throw new CustomerException("不属于该客户包件"); } break; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 875a1a233..211c7bad5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -1073,7 +1073,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); @@ -2114,7 +2114,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); @@ -5657,7 +5657,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); @@ -6032,7 +6032,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (aaa) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java index 1e8e2cbf5..aaa01d2cf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java @@ -646,7 +646,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl { if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { @@ -824,7 +824,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl keyongshuliang) { - throw new RuntimeException("库存品库内数量不足!!!"); + throw new CustomerException("库存品库内数量不足!!!"); } if (Func.isNotBlank(i.getServiceNumber())) { serviceNumber.add(i.getServiceNumber()); @@ -1667,7 +1667,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl zero.getReservationNum() <= 0); if (flag) { - throw new RuntimeException(distributionStockArticleDTO.getOrderCode() + "数量录入错误!!!"); + throw new CustomerException(distributionStockArticleDTO.getOrderCode() + "数量录入错误!!!"); } //进行录入数量的操作 @@ -1696,7 +1696,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl list = distributionStockArticleService.getZeroOrderDetail(distributionStockArticleDTO.getId()); if (!list.isEmpty()) { if (list.stream().mapToInt(DistributionParcelNumberVO::getHandQuantity).sum() > 0) { - throw new RuntimeException(distributionStockArticleDTO.getOrderCode() + "在库数不足,请核对!!!"); + throw new CustomerException(distributionStockArticleDTO.getOrderCode() + "在库数不足,请核对!!!"); } list.forEach(l -> { DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); @@ -1903,7 +1903,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl keyongshuliang) { - throw new RuntimeException("库存品库内数量不足!!!"); + throw new CustomerException("库存品库内数量不足!!!"); } //新增库存品 reservationStocklistEntity.setStocklistId(distributionStockListDTO.getId()); @@ -2317,7 +2317,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl { if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { @@ -2410,7 +2410,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl packageLockIds.contains(f)); if (flag) { log.info("###################商配存在同时操作订单,订单号:" + s.getOrderCode() + "###################"); - throw new RuntimeException(s.getOrderCode() + "正在操作,请刷新后尝试"); + throw new CustomerException(s.getOrderCode() + "正在操作,请刷新后尝试"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + s.getOrderCode(), packageLockIds, 60L); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 09fd5a86a..16f8a2d70 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -786,7 +786,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl deliverySelfInfo = null; if (deliveryListEntity.getKind().equals(ServiceConstant.DELIVERLIST_KIND_SELF)) { - deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId()); + deliverySelfInfo = distributionDeliverySelfMapper.getDeliverySelfInfo(deliveryListEntity.getId()); } else { DistributionDeliveryTripartiteVO deliveryTripartiteInfo = distributionDeliveryTripartiteMapper.getDeliveryTripartiteInfo(deliveryListEntity.getId()); BeanUtils.copyProperties(deliveryTripartiteInfo, deliveryTripartiteInfo); @@ -1799,7 +1799,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:" + packageLockIds, packageLockIds, 60L); @@ -3010,7 +3010,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl jsonObjects = new ArrayList<>(); JSONObject jsonObject = new JSONObject(); jsonObject.put("code", distributionLoadscanEntity.getOrderPackageCode()); @@ -3518,12 +3517,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 10L); @@ -3972,7 +3970,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + deliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); @@ -5011,8 +5009,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds = new ArrayList<>(); @@ -5480,7 +5478,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "trainNumber:" + distributionDeliveryListEntity.getTrainNumber() + "orderPackageCode:", packageLockIds, 60L); @@ -5498,7 +5496,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl longs = Func.toLongList(ids); List distributionLoadscanAbnormalEntities = distributionLoadscanAbnormalService.listByIds(longs); + if (Func.isEmpty(distributionLoadscanAbnormalEntities)) { log.error("#############异常包件信息异常:{}", distributionLoadscanAbnormalEntities); return R.fail(3000, "审核失败"); } + + distributionLoadscanAbnormalEntities.forEach(p -> { + if (LoadingAbnormalAuditingStatusConstant.yishenhe.getValue().equals(p.getAuditingStatus())) { + throw new CustomerException("选择的数据已审核"); + } + } + ); + + List packageIds = distributionLoadscanAbnormalEntities.stream().filter(f -> LoadingAbnormalAuditingStatusConstant.daishenhe.getValue().equals(f.getAuditingStatus())).map(DistributionLoadscanAbnormalEntity::getPackageId).distinct().collect(Collectors.toList()); + //查询审核的是否存在计划 List packageEntityList = distributionReservationPackageService.list(Wrappers.query().lambda() .in(DistributionReservationPackageEntity::getParceListId, packageIds) @@ -6298,10 +6307,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl mapList = baseMapper.getWaybillSignforData(reservationId,AuthUtil.getUser().getUserId(),AuthUtil.getUser().getNickName()); + List mapList = baseMapper.getWaybillSignforData(reservationId, AuthUtil.getUser().getUserId(), AuthUtil.getUser().getNickName()); if (!mapList.isEmpty()) { for (WaybillLogDTO waybillLogDTO : mapList) { trunklineWaybillTrackClient.addSignWaybillLog(waybillLogDTO); @@ -6323,7 +6329,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId()); - if (customer.size()>1){ + if (customer.size() > 1) { resultMap.put("result", false); - resultMap.put("msg", "存在多个signfor信息 >>>ReservationId():"+distributionSignforEntity.getReservationId()); + resultMap.put("msg", "存在多个signfor信息 >>>ReservationId():" + distributionSignforEntity.getReservationId()); } if (Func.isNotEmpty(customer)) { //查询客户订单 @@ -6670,14 +6675,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl signforUser = userClient.userInfoById(signUserId); - if (Objects.equals(signforUser.getCode() , 200)){ + if (Objects.equals(signforUser.getCode(), 200)) { delivery.setOutPhone(signforUser.getData().getPhone()); - }else { + } else { resultMap.put("result", false); - resultMap.put("msg", "外协查询签收人电话失败:"+customer.get(0).getSignUserId()); + resultMap.put("msg", "外协查询签收人电话失败:" + customer.get(0).getSignUserId()); } } } @@ -6689,7 +6694,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl>>>> 推送老系统签收信息报错", e); } @@ -6698,17 +6703,17 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl handleSignPushDataUnitDTOList(List pushOldPackageLoading) { - pushOldPackageLoading.stream().forEach(k->{ - if (k.getGoods_type() == 3){ + pushOldPackageLoading.stream().forEach(k -> { + if (k.getGoods_type() == 3) { String unitNo = k.getUnitNo(); int indexOfUnitNo = unitNo.lastIndexOf("-"); - if (indexOfUnitNo>0){ + if (indexOfUnitNo > 0) { unitNo.substring(indexOfUnitNo); k.setUnitNo(unitNo); } String orderSelfNum = k.getOrderSelfNum(); int indexOfOrderSelfNum = orderSelfNum.lastIndexOf("-"); - if (indexOfUnitNo>0){ + if (indexOfUnitNo > 0) { orderSelfNum.substring(indexOfUnitNo); k.setOrderSelfNum(orderSelfNum); } @@ -6886,7 +6891,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl clerkInventoryCheckPushData(String orderPackageCode) { - Map resultMap = new HashMap<>(); + Map resultMap = new HashMap<>(); try { //查询此包件 List loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.query().lambda() @@ -6896,14 +6901,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl1) { + if (loadscaninvnEntityList.size() > 1) { //存在多个记录 resultMap.put("result", false); - resultMap.put("msg", orderPackageCode+"存在多个装车扫描记录"); + resultMap.put("msg", orderPackageCode + "存在多个装车扫描记录"); return resultMap; } DistributionLoadscaninvnEntity loadscaninvnEntity = loadscaninvnEntityList.get(0); @@ -6914,7 +6919,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl 0) { //查询包件扫描签收 //查询包件扫描签收 - List pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldSingleInventoryPackageLoading(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode); - List pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldSingleInventoryPackageSigning(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode); + List pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldSingleInventoryPackageLoading(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(), orderPackageCode); + List pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldSingleInventoryPackageSigning(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(), orderPackageCode); if (Func.isNotEmpty(pushOldInventoryPackageLoading)) { buildNameAndPhone(pushOldInventoryPackageLoading); signPushDataUnitDTOS.addAll(pushOldInventoryPackageLoading); @@ -7025,9 +7030,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl>>> clerkCheckPushData SignPushDataDTO :{}", delivery); resultMap = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); return resultMap; - }catch (Exception e) { + } catch (Exception e) { resultMap.put("result", false); - resultMap.put("msg", "数据准备错误"+e.getMessage()); + resultMap.put("msg", "数据准备错误" + e.getMessage()); log.error(">>>>> 推送老系统签收信息报错", e); } resultMap.put("result", false); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 103a028b3..988a38b99 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -865,7 +865,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class); queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); @@ -210,7 +210,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class); queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); @@ -258,11 +258,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl> getPackageList(String id) { - return null; - } @Override public void importUser(List data, Boolean isCovered) { @@ -922,7 +918,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl p.getSite().contains("blob")); if (blobFlag) { - throw new RuntimeException("图片上传失败!!!"); + throw new CustomerException("图片上传失败!!!"); } if (distrilbutionBillLading.getMark()) { //要删除 @@ -454,7 +455,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(",")); log.info("自提修改库存品未填写数量>>>未填写库存品批次号:{}", collect); - throw new RuntimeException("请填写正确的库存品数量"); + throw new CustomerException("请填写正确的库存品数量"); } //全部库存品数据 List listDetails = distributionDeliveryDetailsService.list(Wrappers.query().lambda() @@ -496,7 +497,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0) { //存在备货 - throw new RuntimeException("该库存品已备货无法减少"); + throw new CustomerException("该库存品已备货无法减少"); } else { //对于包件进行随机删除 @@ -864,7 +865,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(",")); log.info("自提添加库存品未填写数量>>>未填写库存品批次号:{}", collect); - throw new RuntimeException("请填写正确的库存品数量"); + throw new CustomerException("请填写正确的库存品数量"); } //没有 List detailsEntities = new ArrayList<>(); @@ -1483,7 +1484,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); redis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:", packageLockIds, 60L); @@ -1936,7 +1937,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl handleOrder(DistrilbutionBillLadingDTO distrilbutionBillLading, String pickupBatch) { BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); if (Func.isEmpty(myCurrentWarehouse)) { - throw new RuntimeException("未授权!!!"); + throw new CustomerException("未授权!!!"); } List aaa = new ArrayList<>(); List stockArticleList = distrilbutionBillLading.getStockArticleList(); @@ -2046,7 +2047,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroPackageEntities = new ArrayList<>(); @@ -3465,7 +3466,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageLockIds.contains(any)); if (flag) { //正在操作,请稍后重试 - throw new RuntimeException("该包件正在被操作,请稍后再试!!!"); + throw new CustomerException("该包件正在被操作,请稍后再试!!!"); } else { packageLockIds.addAll(a); redis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "pickupBatch:" + billLadingEntity.getPickupBatch() + "orderPackageCode:", packageLockIds, 60L); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java index b128104d9..494220f06 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java @@ -37,6 +37,7 @@ import com.logpm.distribution.vo.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.secure.utils.AuthUtil; @@ -325,7 +326,7 @@ public class DistrilbutionBillStockServiceImpl extends BaseServiceImpl printPreviewVOS = warehouseWarehousingEntryService.printBatch(ids, type); return R.data(printPreviewVOS); } catch (Exception e) { - throw new RuntimeException(e); + return R.fail(e.getMessage()); } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java index aa54d9b3c..abe428d1c 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java @@ -48,6 +48,7 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.common.IsOrNoConstant; import org.springblade.common.constant.retention.RetentionTypeConstant; +import org.springblade.common.exception.CustomerException; import org.springblade.core.log.exception.ServiceException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.secure.BladeUser; @@ -230,7 +231,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl !item.getAssociationType().equals("3")); if (flag) { log.warn(method + "多条上架记录AssociationValue:{},warehouseId:{}", code, warehouseId); - throw new RuntimeException("多条上架记录"); + throw new CustomerException("多条上架记录"); } else { log.warn(method + "零担备货库位存在多条上架记录AssociationValue:{},warehouseId:{}", code, warehouseId); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java index f189b793e..23808ad9a 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java @@ -221,7 +221,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl i.getCreateInventory()) {