Browse Source

fix:修改原来系统的exception

dist.1.3.0
pref_mail@163.com 8 months ago
parent
commit
b053aa7977
  1. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataWarehouseClient.java
  2. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataCategoryImporter.java
  3. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java
  4. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java
  5. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java
  6. 5
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataShopServiceImpl.java
  7. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  8. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionSignforController.java
  9. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockListController.java
  10. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java
  11. 6
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java
  12. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAddvalueServiceImpl.java
  13. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  14. 18
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  15. 99
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  16. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  17. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  18. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  19. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionUnpackingDetailsServiceImpl.java
  20. 23
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java
  21. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillStockServiceImpl.java
  22. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java
  23. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseRetentionRecordServiceImpl.java
  24. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java
  25. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

3
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);
/**
* 查询当前登录人仓库信息

5
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<BasicdataCategor
private final IBasicdataCategoryService basicdataCategoryService;
@Override
@Transactional(rollbackFor = RuntimeException.class)
@Transactional(rollbackFor = CustomerException.class)
public void save(List<BasicdataCategoryExcel> data) {
// 验证data 是否存在name相同的数据
@ -32,7 +33,7 @@ public class BasicdataCategoryImporter implements ExcelImporter<BasicdataCategor
.distinct()
.count() != data.size();
if(hasDuplicates){
throw new ServiceException("存在相同的数据");
throw new CustomerException("存在相同的数据");
}
// 得到目前系统存在品类

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java

@ -8,6 +8,7 @@ import com.logpm.basicdata.service.IBasicdataBrandService;
import com.logpm.basicdata.service.IBasicdataCategoryService;
import com.logpm.basicdata.service.IBasicdataFactoryCategoryService;
import lombok.AllArgsConstructor;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.excel.support.ExcelImporter;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.utils.BeanUtil;
@ -24,7 +25,7 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
private final IBasicdataBrandService basicdataBrandService;
private final IBasicdataCategoryService basicdataCategoryService;
@Transactional(rollbackFor = RuntimeException.class)
@Transactional(rollbackFor = CustomerException.class)
@Override
public void save(List<BasicdataFactoryCategoryExcel> data) {
@ -53,14 +54,14 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter<Basicdata
// 根据 isBrandFound 的值进行相应的处理
if (!isBrandFound) {
// 或者执行其他逻辑,如记录到日志、抛出异常等
throw new ServiceException(datum.getBrand() + "品牌在系统中不存在!");
throw new CustomerException(datum.getBrand() + "品牌在系统中不存在!");
}
isBrandFound = basicdataCategoryEntities.stream().anyMatch(entity -> entity.getName().equals(datum.getCategory()));
if (!isBrandFound) {
// 或者执行其他逻辑,如记录到日志、抛出异常等
throw new ServiceException(datum.getCategory() + "结算品类在系统中不存在!");
throw new CustomerException(datum.getCategory() + "结算品类在系统中不存在!");
}
// 需要判断目前增加的三方物料在系统中是否已经存在

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientUserServiceImpl.java

@ -94,8 +94,8 @@ public class BasicdataClientUserServiceImpl extends BaseServiceImpl<BasicdataCli
try {
return saveCustomerAndAddAcount(basicdataClientAccountVO.getPhone(), basicdataClientAccountVO.getName(), basicdataClientAccountVO.getClientId());
} catch (NoSuchAlgorithmException e) {
log.error("新增客户账户异常");
throw new RuntimeException(e);
log.error("新增客户账户异常",e);
throw new CustomerException("新增客户账户异常");
}
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java

@ -41,6 +41,7 @@ import com.logpm.basicdata.vo.BasicdataGoodsShelfVO;
import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.FileUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
@ -136,7 +137,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
}
if (Objects.isNull(basicdataGoodsShelfDTO.getWarehouseId()) & Objects.isNull(basicdataGoodsShelfDTO.getGoodsAreaId())) {
log.error("仓库货区信息不合法");
throw new RuntimeException("请完善货区信息!!!");
throw new CustomerException("请完善货区信息!!!");
}
Long warehouseId = basicdataGoodsShelfDTO.getWarehouseId();

5
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataShopServiceImpl.java

@ -27,6 +27,7 @@ import com.logpm.basicdata.service.IBasicdataShopService;
import com.logpm.basicdata.vo.BasicdataShopVO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -81,8 +82,8 @@ public class BasicdataShopServiceImpl extends BaseServiceImpl<BasicdataShopMappe
.eq(BasicdataShopEntity::getStoreCode, basicdataShop.getStoreCode())
.eq(BasicdataShopEntity::getStoreName, basicdataShop.getStoreName())
);
if(basicdataShopEntities.size() > 0 ){
throw new RuntimeException("客户已绑定此门店!");
if(!basicdataShopEntities.isEmpty()){
throw new CustomerException("客户已绑定此门店!");
}
basicdataShop.setTypeService(null);
basicdataShop.setBusinessType(null);

9
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<BasicdataSto
// );
String method = "##############BasicdataStoreBrandServiceImpl.submitSave";
if(Objects.isNull(basicdataStoreBrand.getShopId())){
throw new RuntimeException("当前客户ID缺失");
throw new CustomerException("当前客户ID缺失");
}
BasicdataClientEntity clientEntity = basicdataClientService.getById(basicdataStoreBrand.getShopId());
if(Objects.isNull(clientEntity)){
log.error(method+"查询客户信息错误:{}",basicdataStoreBrand.getShopId());
throw new RuntimeException("查询客户信息错误!");
throw new CustomerException("查询客户信息错误!");
}
List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>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()));
//进行日志客户的日志记录

8
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());
}
}
/**

10
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<List<DistributionStockArticleVO>> result = distributionStockListService.getPackageList(id);
return result;
}
/**
* 获取批量在库订单信息

6
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());
}
}
/**

6
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockListService.java

@ -62,12 +62,6 @@ public interface IDistributionStockListService extends BaseService<DistributionS
*/
List<DistributionStockListExcel> exportDistributionStockList(Map<String, Object> distributionStockList);
/**
* 查询订单下的包件信息
* @param id
* @return
*/
R<List<DistributionStockArticleVO>> getPackageList(String id);
/**
* 导入用户数据

19
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<Distributio
// boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !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<Distributio
// boolean inventoryPackageFlag = detailEntities.stream().allMatch(pack -> !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<Distributio
// boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !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<Distributio
// boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !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<Distributio
// boolean inventoryPackageFlag = detailEntities.stream().allMatch(pack -> !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<Distributio
// boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !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<Distributio
// boolean packageFlag = parcelListEntities.stream().allMatch(pack -> !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<Distributio
List<DisStockListDetailEntity> 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<Distributio
// boolean zeroPackageFlag = distributionParcelNumberDTOS.stream().allMatch(pack -> !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;
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -1073,7 +1073,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
boolean flag = a.stream().anyMatch(any -> 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<Distrib
boolean flag = a.stream().anyMatch(any -> 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<Distrib
boolean flag = a.stream().anyMatch(any -> 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<Distrib
boolean aaa = a.stream().anyMatch(any -> 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);

18
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -646,7 +646,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()}));
if (Func.isEmpty(distributionParcelListEntities)) {
log.error("#########################无可用包件,订单ID为‘;:{}", s.getId());
throw new RuntimeException(s.getOrderCode() + "无可用包件!!!");
throw new CustomerException(s.getOrderCode() + "无可用包件!!!");
}
distributionParcelListEntities.forEach(dp -> {
if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
@ -824,7 +824,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionStockListEntity stockListEntity = distributionStockListService.getById(i.getId());
int keyongshuliang = stockListEntity.getQuantityStock() - stockListEntity.getQuantityOccupied();
if (i.getReservationNum() > 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<Distribu
if (Func.isNotEmpty(parcelNumberVOS)) {
boolean flag = parcelNumberVOS.stream().allMatch(zero -> zero.getReservationNum() <= 0);
if (flag) {
throw new RuntimeException(distributionStockArticleDTO.getOrderCode() + "数量录入错误!!!");
throw new CustomerException(distributionStockArticleDTO.getOrderCode() + "数量录入错误!!!");
}
//进行录入数量的操作
@ -1696,7 +1696,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionParcelNumberVO> 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<Distribu
if (flag) {
log.error("###############预约新增订单同时操作");
//当前操作包件存在于缓存中,此次操作无效
throw new RuntimeException(v.get(0).getOrderCode() + "正在操作,请刷新后尝试");
throw new CustomerException(v.get(0).getOrderCode() + "正在操作,请刷新后尝试");
} else {
packageLockIds.addAll(a);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "orderCode:" + v.get(0).getOrderCode(), packageLockIds, 60L);
@ -1986,7 +1986,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
DistributionStockListEntity stockListEntity = distributionStockListService.getById(distributionStockListDTO.getId());
int keyongshuliang = stockListEntity.getQuantityStock() - stockListEntity.getQuantityOccupied();
if (distributionStockListDTO.getReservationNum() > keyongshuliang) {
throw new RuntimeException("库存品库内数量不足!!!");
throw new CustomerException("库存品库内数量不足!!!");
}
//新增库存品
reservationStocklistEntity.setStocklistId(distributionStockListDTO.getId());
@ -2317,7 +2317,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
.ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()));
if (Func.isEmpty(distributionParcelListEntities)) {
log.error("#########################此订单下包件列表查询为空:{}", s.getOrderCode());
throw new RuntimeException(s.getOrderCode() + "无可用包件信息...");
throw new CustomerException(s.getOrderCode() + "无可用包件信息...");
}
distributionParcelListEntities.forEach(dp -> {
if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) {
@ -2410,7 +2410,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
});
} else {
log.error("########################此零担订单无可用数量:{}", s.getOrderCode());
throw new RuntimeException(s.getOrderCode() + "无可用包件数量");
throw new CustomerException(s.getOrderCode() + "无可用包件数量");
}
} else {
log.error("###########################零担订单查询品类错误,订单ID:{}", s.getId());
@ -2436,7 +2436,7 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
boolean flag = a.stream().anyMatch(f -> 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);

99
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -786,7 +786,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Func.isNotEmpty(loadscaninvnEntity)) {
if (loadscaninvnEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) {
log.info(method + "库存品:" + s + "已经签收,无需重复签收");
throw new RuntimeException("库存品:" + s + "已经签收,无需重复签收");
throw new CustomerException("库存品:" + s + "已经签收,无需重复签收");
}
//存在装车数据,进行状态变更即可
loadscaninvnEntity.setSigningUserId(user.getUserId());
@ -883,7 +883,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} else {
//出现不属于当前客户的库存品包件信息
log.error(method + "库存品包件信息异常,请检查!!!:{}", s);
throw new RuntimeException("数据异常,请联系管理员!!!");
throw new CustomerException("数据异常,请联系管理员!!!");
}
}
@ -1099,7 +1099,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
List<DistributionDeliverySelfVO> 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<Distribution
nodeVos.add(middleStockUpNodeVo);
}
} catch (Exception e) {
throw new RuntimeException(e);
throw new CustomerException(e.getMessage());
}
@ -1863,7 +1863,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
}
} catch (Exception e) {
throw new RuntimeException(e);
throw new CustomerException(e.getMessage());
}
return nodeVos;
@ -1987,7 +1987,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
} catch (Exception e) {
log.error(" handleReservationNode", e);
throw new RuntimeException(e);
throw new CustomerException(e.getMessage());
}
return nodeVos;
@ -2037,7 +2037,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
//查询是否进行发车按钮
} catch (ParseException e) {
throw new RuntimeException(e);
throw new CustomerException(e.getMessage());
}
return nodeVos;
}
@ -2639,7 +2639,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), AuthUtil.getUser());
//下架解托
if(StringUtils.isNotBlank(loadscanEntity.getOrderPackageCode())){
if (StringUtils.isNotBlank(loadscanEntity.getOrderPackageCode())) {
warehouseUpdownTypeClient.downPackageOrDelTray(loadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
//维护订单状态
@ -2720,7 +2720,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
if(StringUtils.isNotBlank(collect.get(0).getOrderPackageCode())){
if (StringUtils.isNotBlank(collect.get(0).getOrderPackageCode())) {
//包件解托下架
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
@ -2807,7 +2807,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
boolean flag = a.stream().anyMatch(any -> 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<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(), AuthUtil.getUser());
if(StringUtils.isNotBlank(distributionLoadscanEntity.getOrderPackageCode())){
if (StringUtils.isNotBlank(distributionLoadscanEntity.getOrderPackageCode())) {
//下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(distributionLoadscanEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
@ -3426,14 +3426,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//修改签收数量
if(StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())){
if (StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())) {
//包件下架解托
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
List<JSONObject> jsonObjects = new ArrayList<>();
JSONObject jsonObject = new JSONObject();
jsonObject.put("code", distributionLoadscanEntity.getOrderPackageCode());
@ -3518,12 +3517,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
distributionLoadscanEntity.setAbnormalNote("异常签收");
if(StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())){
if (StringUtils.isNotBlank(parcelListEntity.getOrderPackageCode())) {
warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(), myCurrentWarehouse.getId(), "签收下架解托");
}
if (Func.isEmpty(loadscanEntity)) {
loadingId = distributionLoadscanEntity.getId();
distributionLoadscanService.save(distributionLoadscanEntity);
@ -3605,7 +3603,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
boolean flag = a.stream().anyMatch(any -> 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<Distribution
boolean flag = a.stream().anyMatch(any -> 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<Distribution
log.error(method + "reservationEntity参数错误:{}", reservationEntity);
return R.fail("服务器正忙~~");
}
Long batchLock = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "reservationId:" );
if (!Objects.isNull(batchLock)){
Long batchLock = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + "reservationId:");
if (!Objects.isNull(batchLock)) {
return R.fail("请不要重复操作");
}
List<Long> packageLockIds = new ArrayList<>();
@ -5480,7 +5478,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
boolean flag = a.stream().anyMatch(any -> 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<Distribution
distributionSignforEntity.setDriverRemarks(distributionSignfor.getDriverRemarks());
}
this.updateById(distributionSignforEntity);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "reservationId:", distributionSignfor.getReservationId(),60L);
bladeRedis.setEx("warehouseId:" + myCurrentWarehouse.getId() + "reservationId:", distributionSignfor.getReservationId(), 60L);
return R.status(true);
}
@ -5764,12 +5762,23 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//
List<Long> longs = Func.toLongList(ids);
List<DistributionLoadscanAbnormalEntity> 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<Long> packageIds = distributionLoadscanAbnormalEntities.stream().filter(f -> LoadingAbnormalAuditingStatusConstant.daishenhe.getValue().equals(f.getAuditingStatus())).map(DistributionLoadscanAbnormalEntity::getPackageId).distinct().collect(Collectors.toList());
//查询审核的是否存在计划
List<DistributionReservationPackageEntity> packageEntityList = distributionReservationPackageService.list(Wrappers.<DistributionReservationPackageEntity>query().lambda()
.in(DistributionReservationPackageEntity::getParceListId, packageIds)
@ -6298,10 +6307,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
handletrunklineWaybillSignLog(distributionSignfor.getReservationId());
this.updateById(distributionSignfor);
// 创建异步队列推送老系统的的签收信息 构建请求参数
return R.status(true);
@ -6312,10 +6317,11 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
/**
* 推送干线运单信息
*
* @param reservationId
*/
private void handletrunklineWaybillSignLog(Long reservationId) {
List<WaybillLogDTO> mapList = baseMapper.getWaybillSignforData(reservationId,AuthUtil.getUser().getUserId(),AuthUtil.getUser().getNickName());
List<WaybillLogDTO> 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<Distribution
}
}
/**
@ -6615,9 +6620,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//查询客户信息
List<SignPushDataContactDTO> 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<Distribution
buildReservationNameAndPhone(customer);
//完成客户信息添加
delivery.setSignPushDataContactDTOs(customer);
if (Objects.isNull(delivery.getOutPhone())){
if (Objects.isNull(delivery.getOutPhone())) {
Long signUserId = customer.get(0).getSignUserId();
R<User> 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<Distribution
return resultMap;
} catch (Exception e) {
resultMap.put("result", false);
resultMap.put("msg", "数据准备错误"+e.getMessage());
resultMap.put("msg", "数据准备错误" + e.getMessage());
log.error(">>>>> 推送老系统签收信息报错", e);
}
@ -6698,17 +6703,17 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
}
private List<SignPushDataUnitDTO> handleSignPushDataUnitDTOList(List<SignPushDataUnitDTO> 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<Distribution
@Override
public Map<String, Object> clerkInventoryCheckPushData(String orderPackageCode) {
Map<String,Object> resultMap = new HashMap<>();
Map<String, Object> resultMap = new HashMap<>();
try {
//查询此包件
List<DistributionLoadscaninvnEntity> loadscaninvnEntityList = distributionLoadscaninvnService.list(Wrappers.<DistributionLoadscaninvnEntity>query().lambda()
@ -6896,14 +6901,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (!loadscaninvnEntityList.isEmpty()) {
//未进行装车
resultMap.put("result", false);
resultMap.put("msg", orderPackageCode+"没有装车扫描记录");
resultMap.put("msg", orderPackageCode + "没有装车扫描记录");
return resultMap;
}
if (loadscaninvnEntityList.size()>1) {
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<Distribution
if (Func.isEmpty(signforEntity)) {
//存在多个记录
resultMap.put("result", false);
resultMap.put("msg", orderPackageCode+"查询signfor数据错误,id:"+loadscaninvnEntity.getReservationId());
resultMap.put("msg", orderPackageCode + "查询signfor数据错误,id:" + loadscaninvnEntity.getReservationId());
return resultMap;
}
// 得到配送计划
@ -6991,8 +6996,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (distributionReservationEntity.getReservationStockListNum() > 0) {
//查询包件扫描签收
//查询包件扫描签收
List<SignPushDataUnitDTO> pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldSingleInventoryPackageLoading(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode);
List<SignPushDataUnitDTO> pushOldInventoryPackageSigning = distributionSignforMapper.selectPushOldSingleInventoryPackageSigning(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(),orderPackageCode);
List<SignPushDataUnitDTO> pushOldInventoryPackageLoading = distributionSignforMapper.selectPushOldSingleInventoryPackageLoading(loadscaninvnEntity.getReservationId(), loadscaninvnEntity.getDeliveryId(), orderPackageCode);
List<SignPushDataUnitDTO> 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<Distribution
log.info(">>>> 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);

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -865,7 +865,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
String popHtml = TemplateUtil.popTemplate("包件码", map, html);
moldList.add(popHtml);
} catch (Exception e) {
throw new RuntimeException(e);
throw new CustomerException(e.getMessage());
}
});
orderPackgeCodeDataVO.setMoldList(moldList);
@ -1940,7 +1940,7 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
DistributionStockArticleEntity t = new DistributionStockArticleEntity();
if (Func.isEmpty(stockArticleEntity)) {
log.error(method + "订单不存在orderCode:{}", s);
throw new RuntimeException("订单不存在");
throw new CustomerException("订单不存在");
}
if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) {
//查询包件列表

10
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -157,7 +157,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
distributionStockList.put("warehouseId",myCurrentWarehouse.getId());
}else{
throw new ServiceException("请选择仓库,在进行导出数据!!!");
throw new CustomerException("请选择仓库,在进行导出数据!!!");
}
QueryWrapper<DistributionStockListEntity> queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class);
queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
@ -210,7 +210,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
distributionStockList.put("warehouseId",myCurrentWarehouse.getId());
}else{
throw new ServiceException("请选择仓库,在进行导出数据!!!");
throw new CustomerException("请选择仓库,在进行导出数据!!!");
}
QueryWrapper<DistributionStockListEntity> queryWrapper = Condition.getQueryWrapper(distributionStockList, DistributionStockListEntity.class);
queryWrapper.lambda().eq(DistributionStockListEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
@ -258,11 +258,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return excelList;
}
@Override
public R<List<DistributionStockArticleVO>> getPackageList(String id) {
return null;
}
@Override
public void importUser(List<DistributionStockListExcel> data, Boolean isCovered) {
@ -922,7 +918,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
return orderPackgeCodeDataVO;
} catch (Exception e) {
throw new RuntimeException(e);
throw new CustomerException(e.getMessage());
}
}

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -2672,12 +2672,12 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
} else {
//查询托盘存在多条记录
log.error(method + "查询库托盘信息失败orderCode:{},id:{},type:{}", stockArticleEntity.getOrderCode(), stockArticleEntity.getId(), "1");
throw new RuntimeException("查询托盘信息失败");
throw new CustomerException("查询托盘信息失败");
}
} else {
log.error(method + "查询库托盘信息失败orderCode:{},id:{},type:{}", stockArticleEntity.getOrderCode(), stockArticleEntity.getId(), "1");
//查询托盘信息错误
throw new RuntimeException("查询托盘信息失败");
throw new CustomerException("查询托盘信息失败");
}
} else {
log.info(method + "无库位无托盘备货");

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionUnpackingDetailsServiceImpl.java

@ -31,6 +31,7 @@ import com.logpm.distribution.mapper.DistributionUnpackingDetailsMapper;
import com.logpm.distribution.service.IDistributionStockListService;
import com.logpm.distribution.service.IDistributionUnpackingDetailsService;
import com.logpm.distribution.vo.DistributionUnpackingDetailsVO;
import org.springblade.common.exception.CustomerException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
@ -150,7 +151,7 @@ public class DistributionUnpackingDetailsServiceImpl extends BaseServiceImpl<Dis
distributionStockListEntity.setQuantityStock(distributionStockListEntity.getQuantityStock() - (detailsEntity.getUnpackingQuantity() * basicMaterialEntity.getPackageNum()));
if (distributionStockListEntity.getQuantityStock() - distributionStockListEntity.getOutboundQuantity() < 0){
//收集无法进行拆包的库存品
throw new RuntimeException("在库数量不足取消拆包操作");
throw new CustomerException("在库数量不足取消拆包操作");
}else {
distributionStockListEntities.add(distributionStockListEntity);
}
@ -178,12 +179,12 @@ public class DistributionUnpackingDetailsServiceImpl extends BaseServiceImpl<Dis
distributionStockListService.updateById(stockListEntity);
}else {
log.error(method+"取消拆包失败,存在多个父级库存品ID");
throw new RuntimeException("操作失败");
throw new CustomerException("操作失败");
}
}else {
//查询不到日志信息
log.error(method+"取消拆包失败,查询记录失败");
throw new RuntimeException("操作失败");
throw new CustomerException("操作失败");
}

23
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java

@ -131,6 +131,7 @@ import org.springblade.common.constant.reservation.ReservationPackageStatusConst
import org.springblade.common.constant.stockup.StockAssignStatusConstant;
import org.springblade.common.constant.stockup.StockupStatusConstant;
import org.springblade.common.constant.stockup.StockupTypeConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
@ -416,7 +417,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (!printEntityList.isEmpty()) {
boolean blobFlag = printEntityList.stream().anyMatch(p -> p.getSite().contains("blob"));
if (blobFlag) {
throw new RuntimeException("图片上传失败!!!");
throw new CustomerException("图片上传失败!!!");
}
if (distrilbutionBillLading.getMark()) {
//要删除
@ -454,7 +455,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (flag) {
String collect = stockDTOList.stream().filter(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(","));
log.info("自提修改库存品未填写数量>>>未填写库存品批次号:{}", collect);
throw new RuntimeException("请填写正确的库存品数量");
throw new CustomerException("请填写正确的库存品数量");
}
//全部库存品数据
List<DistributionDeliveryDetailsEntity> listDetails = distributionDeliveryDetailsService.list(Wrappers.<DistributionDeliveryDetailsEntity>query().lambda()
@ -496,7 +497,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
// 优先取消未备货
if (sum > 0) {
//存在备货
throw new RuntimeException("该库存品已备货无法减少");
throw new CustomerException("该库存品已备货无法减少");
} else {
//对于包件进行随机删除
@ -864,7 +865,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
if (flag) {
String collect = distrilbutionBillLading.getStockDTOList().stream().filter(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(","));
log.info("自提添加库存品未填写数量>>>未填写库存品批次号:{}", collect);
throw new RuntimeException("请填写正确的库存品数量");
throw new CustomerException("请填写正确的库存品数量");
}
//没有
List<DistributionDeliveryDetailsEntity> detailsEntities = new ArrayList<>();
@ -1483,7 +1484,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
//零担在库数不足进行签收
if (distributionParcelNumberEntity.getHandQuantity() < packageEntity.getQuantity()) {
log.info(method + "零担签收数量不足,计划数量:{},在库数量:{}", packageEntity.getQuantity(), distributionParcelNumberEntity.getHandQuantity());
throw new RuntimeException("零担在库数不足此次签收!!");
throw new CustomerException("零担在库数不足此次签收!!");
}
DistributionBillLadingScanEntity distributionBillLadingScanEntity = new DistributionBillLadingScanEntity();
distributionBillLadingScanEntity.setPacketBarCode(parcelListEntity.getOrderPackageCode());
@ -1542,7 +1543,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
boolean flag = a.stream().anyMatch(any -> 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<Distrilb
private List<JSONObject> handleOrder(DistrilbutionBillLadingDTO distrilbutionBillLading, String pickupBatch) {
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) {
throw new RuntimeException("未授权!!!");
throw new CustomerException("未授权!!!");
}
List<JSONObject> aaa = new ArrayList<>();
List<DistributionStockArticleEntity> stockArticleList = distrilbutionBillLading.getStockArticleList();
@ -2046,7 +2047,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
for (Long orderId : orderIds) {
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId);
if (Func.isEmpty(stockArticleEntity)) {
throw new RuntimeException("查询订单信息失败");
throw new CustomerException("查询订单信息失败");
}
if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) {
//定制品
@ -2072,7 +2073,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
}
} else {
log.info("####################3订单缺失IsZero字段:{}", stockArticleEntity.getId());
throw new RuntimeException(stockArticleEntity.getOrderCode() + "订单数据异常");
throw new CustomerException(stockArticleEntity.getOrderCode() + "订单数据异常");
}
DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO();
distrilbutionBillStock.setBillLadingId(distrilbutionBillLading.getId());
@ -2118,7 +2119,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
);
} else {
log.error("#########################无可用包件orderIds:{}", addOrderIds);
throw new RuntimeException(addOrderIds + "无可用包件");
throw new CustomerException(addOrderIds + "无可用包件");
}
}
List<DistributionReservationZeroPackageEntity> zeroPackageEntities = new ArrayList<>();
@ -3465,7 +3466,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
boolean flag = a.stream().anyMatch(any -> 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);

3
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<Distrilbu
if (!distributionStockArticleEntities.isEmpty()) {
String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).collect(Collectors.joining(","));
log.error("these orderCodes is operated on by now:{}",orderCodes);
throw new RuntimeException(orderCodes+"订单正在进行操作,请稍后再试!!!");
throw new CustomerException(orderCodes+"订单正在进行操作,请稍后再试!!!");
}
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseWarehousingEntryController.java

@ -248,7 +248,7 @@ public class WarehouseWarehousingEntryController extends BladeController {
List<PrintPreviewVO> printPreviewVOS = warehouseWarehousingEntryService.printBatch(ids, type);
return R.data(printPreviewVOS);
} catch (Exception e) {
throw new RuntimeException(e);
return R.fail(e.getMessage());
}
}

5
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<Warehou
if (saveFlah.get()) {
return Resp.scanSuccess("操作成功", retentionTotal.get() + "件");
} else {
throw new RuntimeException("服务器正忙...");
throw new CustomerException("服务器正忙...");
}
}
@ -303,7 +304,7 @@ public class WarehouseRetentionRecordServiceImpl extends BaseServiceImpl<Warehou
if (saveFlah.get()) {
return Resp.scanSuccess("操作成功", "共计滞留" + retentionTotal + "件");
} else {
throw new RuntimeException("服务器正忙...");
throw new CustomerException("服务器正忙...");
}
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownStockupAreaServiceImpl.java

@ -270,7 +270,7 @@ public class WarehouseUpdownStockupAreaServiceImpl extends BaseServiceImpl<Wareh
boolean flag = warehouseUpdownStockupAreaEntityList.stream().anyMatch(item -> !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);
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -221,7 +221,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
//入库单预计数量无法进行减少
log.info("入库单进行预计数量修改,原计划录入:{},目标修改:{}", i.getCreateInventory(), next.getCreateInventory());
log.info("入库单进行预计数量修改,已入库数量:{}", i.getActualReceipt());
throw new RuntimeException("入库单预计数量不能小于已入库数量");
throw new CustomerException("入库单预计数量不能小于已入库数量");
}
detailEntity.setCreateInventory(next.getCreateInventory());
if (next.getActualReceipt().equals(i.getCreateInventory()) || next.getActualReceipt() > i.getCreateInventory()) {

Loading…
Cancel
Save