diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreContactController.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreContactController.java index 5cbee3f52..4bcc39117 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreContactController.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataStoreContactController.java @@ -102,11 +102,7 @@ public class BasicdataStoreContactController extends BladeController { List storeContactEntities = basicdataStoreContactService.list(Wrappers.query().lambda() .eq(BasicdataStoreContactEntity::getShopId, basicdataStoreContact.getShopId()) ); - if(storeContactEntities.size() > 0){ - basicdataStoreContact.setDefaultType(false); - }else{ - basicdataStoreContact.setDefaultType(true); - } + basicdataStoreContact.setDefaultType(storeContactEntities.size() <= 0); return R.status(basicdataStoreContactService.save(basicdataStoreContact)); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataOpenIncomingClient.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataOpenIncomingClient.java index 984a7324a..5cedadd9f 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataOpenIncomingClient.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataOpenIncomingClient.java @@ -18,10 +18,6 @@ public class BasicdataOpenIncomingClient implements IBasicdataOpenIncomingClient @Override public Boolean checkOpenIncoming(Long warehouseId, Long brandId) { BasicdataOpenIncomingSettingEntity settingEntity = basicdataOpenIncomingSettingService.findEntityByParam(warehouseId,brandId); - if(Objects.isNull(settingEntity)){ - return false; - }else{ - return true; - } + return !Objects.isNull(settingEntity); } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java index 28284bbac..d464a0d6a 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataClientServiceImpl.java @@ -383,14 +383,12 @@ public class BasicdataClientServiceImpl extends BaseServiceImpl>>>>> basicdataClient.getClientCode() {}", basicdataClient.getClientCode()); //查询客户编码和客户名称是否存在 boolean b = basicdataClients.stream().anyMatch(ii -> { - if (ii.getClientCode() != null && !ii.getClientCode().equals("")) { + if (ii.getClientCode() != null && !ii.getClientCode().isEmpty()) { log.info(">>>>>>>>>>>>> 1{}", ii.getClientCode()); log.info(">>>>>>>>>>>>> 2{}", ii.getClientName()); - if (ii.getClientCode().equals(basicdataClient.getClientCode()) - || ii.getClientName().equals(basicdataClient.getClientName().trim())) { - return true; - } + return ii.getClientCode().equals(basicdataClient.getClientCode()) + || ii.getClientName().equals(basicdataClient.getClientName().trim()); } return false; }); diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java index cce94388c..8b69f3e28 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java @@ -198,132 +198,131 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl data) { log.info("传入参数>>>>>>>>>>>>>>>>>>>>>>>{}", data); - outerLoop: - for (BasicdataDriverArteryImproterExcel datum : data) { + for (BasicdataDriverArteryImproterExcel datum : data) { - try { - List driverMiddleEntity = new ArrayList<>(); + try { + List driverMiddleEntity = new ArrayList<>(); - //检查数据是否为空 - if (ObjectUtils.isEmpty(datum.getPhone()) || ObjectUtils.isEmpty(datum.getName()) || ObjectUtils.isEmpty(datum.getWarehouseName()) || ObjectUtils.isEmpty(datum.getCarrierName())) { + //检查数据是否为空 + if (ObjectUtils.isEmpty(datum.getPhone()) || ObjectUtils.isEmpty(datum.getName()) || ObjectUtils.isEmpty(datum.getWarehouseName()) || ObjectUtils.isEmpty(datum.getCarrierName())) { // log.error("必填数据不能为空"); // continue; - throw new ServiceException("必填数据不能为空!"); - } - if (!ObjectUtils.isEmpty(datum.getPhone())) { - String phone = datum.getPhone(); - BasicdataDriverArteryEntity arteryEntity = baseMapper.findEntityByPhone(phone); - if(!Objects.isNull(arteryEntity)){ - throw new ServiceException(phone+"手机号码已存在!"); - } - - R userR = userClient.userInfoByPhone("627683", datum.getPhone()); - if (userR.getData() == null) { + throw new ServiceException("必填数据不能为空!"); + } + if (!ObjectUtils.isEmpty(datum.getPhone())) { + String phone = datum.getPhone(); + BasicdataDriverArteryEntity arteryEntity = baseMapper.findEntityByPhone(phone); + if (!Objects.isNull(arteryEntity)) { + throw new ServiceException(phone + "手机号码已存在!"); + } + + R userR = userClient.userInfoByPhone("627683", datum.getPhone()); + if (userR.getData() == null) { // log.error("未找到用户"); // continue; - throw new ServiceException("未找到用户!"); - } else { - datum.setUserId(userR.getData().getId()); - } - } - if (!ObjectUtils.isEmpty(datum.getBindVehicle())) { - String[] car = datum.getBindVehicle().split(","); - for (String s : car) { - List carListByName = basicdataVehicleService.findCarListByName(s); - - if (carListByName.isEmpty()) { + throw new ServiceException("未找到用户!"); + } else { + datum.setUserId(userR.getData().getId()); + } + } + if (!ObjectUtils.isEmpty(datum.getBindVehicle())) { + String[] car = datum.getBindVehicle().split(","); + for (String s : car) { + List carListByName = basicdataVehicleService.findCarListByName(s); + + if (carListByName.isEmpty()) { // log.error("未找到可绑定的车辆"); - throw new ServiceException("未找到可绑定的车辆!"); - } else { - BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); - basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId()); - driverMiddleEntity.add(basicdataDrivermiddleEntity); - } - } - } - if (!ObjectUtils.isEmpty(datum.getCarrierName())) { - //找到数据库内的承运商 - List basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName())); - - if (ObjectUtils.isEmpty(basicdataCarrierEntities)) { + throw new ServiceException("未找到可绑定的车辆!"); + } else { + BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); + basicdataDrivermiddleEntity.setBrandId(carListByName.get(0).getId()); + driverMiddleEntity.add(basicdataDrivermiddleEntity); + } + } + } + if (!ObjectUtils.isEmpty(datum.getCarrierName())) { + //找到数据库内的承运商 + List basicdataCarrierEntities = basicdataCarrierService.list(Wrappers.lambdaQuery().eq(BasicdataCarrierEntity::getCarrierName, datum.getCarrierName())); + + if (ObjectUtils.isEmpty(basicdataCarrierEntities)) { // log.error("未找到承运商"); // continue; - throw new ServiceException("未找到承运商!"); - } else { - datum.setCarrierId(basicdataCarrierEntities.get(0).getId()); - } - } - List warehouseList = new ArrayList<>(); - if (!ObjectUtils.isEmpty(datum.getWarehouseName())) { - String warehouseNames = datum.getWarehouseName(); - warehouseNames = warehouseNames.replaceAll(",",","); - List warehouseNameList = new ArrayList<>(); - if(warehouseNames.contains(",")){ - warehouseNameList = Arrays.asList(warehouseNames.split(",")); - }else{ - warehouseNameList.add(warehouseNames); - } - - for (String wn : warehouseNameList) { - //在数据库找到仓库名字对应 - BasicdataWarehouseEntity byName = warehouseClient.findByName(wn); - if (ObjectUtils.isEmpty(byName)) { - throw new ServiceException("未找到仓库!"); - } else { - JSONObject jsonObject = new JSONObject(); - jsonObject.put("warehouseId",byName.getId()); - jsonObject.put("warehouseName",wn); - warehouseList.add(jsonObject); - } - } - } - //根据手机号去重 如果有手机号相同 就删除老数据 - if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) { - List basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper().lambda() - .eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone())); - if (!basicdataVehicleEntities.isEmpty()) { - basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone()); - } - } - BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class); - //连接到前端后取消注释 - BladeUser user = AuthUtil.getUser(); - copy.setTenantId(user.getTenantId());// 租户号 - copy.setCreateUser(user.getUserId()); // 创建人 - copy.setUpdateUser(user.getUserId());// 更新人 - log.info("复制后>>>>>>>>>>>>{}", copy); - - this.save(copy); - - List driverWarehouseEntities = new ArrayList<>(); - for (JSONObject jsonObject : warehouseList) { - Long warehouseId = jsonObject.getLong("warehouseId"); - BasicdataDriverWarehouseEntity basicdataDriverWarehouseEntity = new BasicdataDriverWarehouseEntity(); - basicdataDriverWarehouseEntity.setTenantId(AuthUtil.getTenantId()); - basicdataDriverWarehouseEntity.setCreateUser(AuthUtil.getUserId()); - basicdataDriverWarehouseEntity.setUpdateUser(AuthUtil.getUserId()); - basicdataDriverWarehouseEntity.setCreateDept(Func.firstLong(AuthUtil.getDeptId())); - basicdataDriverWarehouseEntity.setDriverId(copy.getId()); - basicdataDriverWarehouseEntity.setWarehouseId(warehouseId); - driverWarehouseEntities.add(basicdataDriverWarehouseEntity); - } - basicdataDriverWarehouseService.saveBatch(driverWarehouseEntities); - - //车辆和司机绑定关系 - for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) { - basicdataDrivermiddleEntity.setDriverId(copy.getId()); - basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity); - } - } catch (DataAccessException e) { - throw new ServiceException("用户" + datum.getName() + "数据长度异常"); - } catch (ServiceException e) { - throw new ServiceException("用户" + datum.getName() + e.getMessage()); - } catch (Exception e) { - throw new RuntimeException("用户" + datum.getName() + "数据错误" + e.getMessage()); - } - - } + throw new ServiceException("未找到承运商!"); + } else { + datum.setCarrierId(basicdataCarrierEntities.get(0).getId()); + } + } + List warehouseList = new ArrayList<>(); + if (!ObjectUtils.isEmpty(datum.getWarehouseName())) { + String warehouseNames = datum.getWarehouseName(); + warehouseNames = warehouseNames.replaceAll(",", ","); + List warehouseNameList = new ArrayList<>(); + if (warehouseNames.contains(",")) { + warehouseNameList = Arrays.asList(warehouseNames.split(",")); + } else { + warehouseNameList.add(warehouseNames); + } + + for (String wn : warehouseNameList) { + //在数据库找到仓库名字对应 + BasicdataWarehouseEntity byName = warehouseClient.findByName(wn); + if (ObjectUtils.isEmpty(byName)) { + throw new ServiceException("未找到仓库!"); + } else { + JSONObject jsonObject = new JSONObject(); + jsonObject.put("warehouseId", byName.getId()); + jsonObject.put("warehouseName", wn); + warehouseList.add(jsonObject); + } + } + } + //根据手机号去重 如果有手机号相同 就删除老数据 + if (ObjectUtils.isNotNull(datum) && ObjectUtils.isNotNull(datum.getPhone())) { + List basicdataVehicleEntities = baseMapper.selectList(new QueryWrapper().lambda() + .eq(BasicdataDriverArteryEntity::getPhone, datum.getPhone())); + if (!basicdataVehicleEntities.isEmpty()) { + basicdataDriverArteryMapper.updateIsdeletedByPhone(datum.getPhone()); + } + } + BasicdataDriverArteryEntity copy = Func.copy(datum, BasicdataDriverArteryEntity.class); + //连接到前端后取消注释 + BladeUser user = AuthUtil.getUser(); + copy.setTenantId(user.getTenantId());// 租户号 + copy.setCreateUser(user.getUserId()); // 创建人 + copy.setUpdateUser(user.getUserId());// 更新人 + log.info("复制后>>>>>>>>>>>>{}", copy); + + this.save(copy); + + List driverWarehouseEntities = new ArrayList<>(); + for (JSONObject jsonObject : warehouseList) { + Long warehouseId = jsonObject.getLong("warehouseId"); + BasicdataDriverWarehouseEntity basicdataDriverWarehouseEntity = new BasicdataDriverWarehouseEntity(); + basicdataDriverWarehouseEntity.setTenantId(AuthUtil.getTenantId()); + basicdataDriverWarehouseEntity.setCreateUser(AuthUtil.getUserId()); + basicdataDriverWarehouseEntity.setUpdateUser(AuthUtil.getUserId()); + basicdataDriverWarehouseEntity.setCreateDept(Func.firstLong(AuthUtil.getDeptId())); + basicdataDriverWarehouseEntity.setDriverId(copy.getId()); + basicdataDriverWarehouseEntity.setWarehouseId(warehouseId); + driverWarehouseEntities.add(basicdataDriverWarehouseEntity); + } + basicdataDriverWarehouseService.saveBatch(driverWarehouseEntities); + + //车辆和司机绑定关系 + for (BasicdataDrivermiddleEntity basicdataDrivermiddleEntity : driverMiddleEntity) { + basicdataDrivermiddleEntity.setDriverId(copy.getId()); + basicdataDrivermiddleServiceImpl.save(basicdataDrivermiddleEntity); + } + } catch (DataAccessException e) { + throw new ServiceException("用户" + datum.getName() + "数据长度异常"); + } catch (ServiceException e) { + throw new ServiceException("用户" + datum.getName() + e.getMessage()); + } catch (Exception e) { + throw new RuntimeException("用户" + datum.getName() + "数据错误" + e.getMessage()); + } + + } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java index f7473ac95..8a4bd8c50 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java @@ -411,7 +411,7 @@ public class BasicdataFreightServiceImpl extends BaseServiceImpl"); message.append(firstMessage); - message.append(rowMessage.toString()); + message.append(rowMessage); message.append("

"); message.append("
"); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java index 517690306..ba913e862 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsAreaServiceImpl.java @@ -130,8 +130,7 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl>>>>>",var6); - return; - } + } //return warehouseGoodsAreaList; } @@ -387,8 +386,7 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl>>>>>",var6); - return; - } + } }else if (type ==2){ //sheetOne List basicdatavisualizationSheetKCOnes = baseMapper.exportWarehouseByCKStrip(warehouseId); @@ -440,8 +438,7 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl>>>>>",var6); - return; - } + } }else if (type ==3){ //sheetOne @@ -487,8 +484,7 @@ public class BasicdataGoodsAreaServiceImpl extends BaseServiceImpl>>>>>",var6); - return; - } + } } //return warehouseGoodsAreaList; } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java index 04fa58f0f..41a809d77 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java @@ -563,7 +563,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl longs = new ArrayList<>(); for (BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity : basicdataGoodsAllocationEntitiesDate) { Long id = basicdataGoodsAllocationEntity.getId(); - List longs1 = Arrays.asList(id); + List longs1 = Collections.singletonList(id); //查询有无绑定货物 Integer integer = warehouseUpdownGoodsClient.selectCountByAllo(id.toString()); if (integer > 0) { diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java index 0153e2ce0..be9c401dd 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataPriceServiceImpl.java @@ -2888,7 +2888,7 @@ public class BasicdataPriceServiceImpl extends BaseServiceImpl"); message.append(firstMessage); - message.append(rowMessage.toString()); + message.append(rowMessage); message.append("

"); message.append("
"); } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java index bf20b4b95..0ee8808a0 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java @@ -252,8 +252,8 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl>>:{}",driverArteryEntity.getPhone()); //绑定用户 basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity(); - basicdataDrivermiddleEntity.setDriverId(driverArteryEntity.getId());; - } + basicdataDrivermiddleEntity.setDriverId(driverArteryEntity.getId()); + } } } diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/util/EasyExcelUtil.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/util/EasyExcelUtil.java index 0af874ddb..a92255ba5 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/util/EasyExcelUtil.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/util/EasyExcelUtil.java @@ -47,7 +47,7 @@ public class EasyExcelUtil { if (builder == null) { return null; } else { - ((ExcelReaderSheetBuilder) builder.sheet(sheetNo).headRowNumber(headRowNumber)).doRead(); + builder.sheet(sheetNo).headRowNumber(headRowNumber).doRead(); return dataListener.getDataList(); } } @@ -57,7 +57,7 @@ public class EasyExcelUtil { if (builder == null) { return null; } else { - ((ExcelReaderSheetBuilder) builder.sheet(sheetNo).headRowNumber(headRowNumber)).registerConverter(new TrimConverter()).doRead(); + builder.sheet(sheetNo).headRowNumber(headRowNumber).registerConverter(new TrimConverter()).doRead(); return dataListener.getDataList(); } }