diff --git a/pom.xml b/pom.xml index 58269087a..ba3db2716 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ - + 192.168.1.13 127.0.0.1 @@ -49,7 +49,8 @@ ${middle.server.url}:18848 - + + fd74182b-1fce-4dba-afa7-2623b0376205 ${middle.server.url}:8080 @@ -63,14 +64,14 @@ njcn common-microservice - + site 1.8 8 8 2.3.12.RELEASE - + Hoxton.SR12 2.2.7.RELEASE 5.7.9 @@ -90,6 +91,7 @@ 2.3 0.9.1 11.2 + 4.9.0 1.6.4 2.3.2 1.68 @@ -105,9 +107,6 @@ 2.3.0 1.2.7 4.4.0 - 0.5.3 - 4.8.1 - 8.2.1 1.7.0-Hoxton @@ -335,35 +334,62 @@ easypoi-spring-boot-starter ${easypoi.version} - - - me.tongfei - progressbar - ${progressbar.version} - - - com.squareup.okhttp3 - okhttp - ${okhttp.version} - - - io.minio - minio - ${minio.version} - - - com.squareup.okhttp3 - okhttp - - - com.baomidou dynamic-datasource-spring-boot-starter ${dynamic-datasource.version} - + + com.squareup.okhttp3 + logging-interceptor + ${okhttp3.version} + + + com.squareup.okhttp3 + mockwebserver + ${okhttp3.version} + + + com.squareup.okhttp3 + okcurl + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-dnsoverhttps + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-sse + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-testing-support + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-tls + ${okhttp3.version} + + + com.squareup.okhttp3 + okhttp-urlconnection + ${okhttp3.version} + + + org.influxdb + influxdb-java + 2.22 + diff --git a/pqs-common/common-core/pom.xml b/pqs-common/common-core/pom.xml index 850547f92..cfca7d7ac 100644 --- a/pqs-common/common-core/pom.xml +++ b/pqs-common/common-core/pom.xml @@ -107,6 +107,13 @@ - + + com.squareup.okhttp3 + okhttp + + + com.squareup.okhttp3 + logging-interceptor + \ No newline at end of file diff --git a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/ServerInfo.java b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/ServerInfo.java index a7028fb38..869964497 100644 --- a/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/ServerInfo.java +++ b/pqs-common/common-core/src/main/java/com/njcn/common/pojo/constant/ServerInfo.java @@ -38,8 +38,13 @@ public interface ServerInfo { String CS_HARMONIC_BOOT = "cs-harmonic-boot"; String CS_REPORT_BOOT = "cs-report-boot"; + + String ACCESS_BOOT = "access-boot"; + String CS_STAT_BOOT = "stat-boot"; + String CS_RT_BOOT = "rt-boot"; + String CS_ZL_EVENT_BOOT = "zl-event-boot"; diff --git a/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java b/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java index 6895b104f..d63ec7633 100644 --- a/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java +++ b/pqs-common/common-mq/src/main/java/com/njcn/mq/constant/BusinessTopic.java @@ -28,6 +28,9 @@ public interface BusinessTopic { */ String NJCN_APP_FILE_TOPIC = "njcnAppFileTopic"; + String NJCN_APP_FILE_STREAM_TOPIC = "njcnAppFileStreamTopic"; + + /********************************数据中心*********************************/ diff --git a/pqs-common/common-mq/src/main/java/com/njcn/mq/message/AppFileMessage.java b/pqs-common/common-mq/src/main/java/com/njcn/mq/message/AppFileMessage.java index 8b2337e50..c05bac26d 100644 --- a/pqs-common/common-mq/src/main/java/com/njcn/mq/message/AppFileMessage.java +++ b/pqs-common/common-mq/src/main/java/com/njcn/mq/message/AppFileMessage.java @@ -11,7 +11,7 @@ import lombok.Data; * @version 1.0.0 * @createTime 2023/9/5 16:38 */ - +@Data public class AppFileMessage extends BaseMessage { @ApiModelProperty("网络设备码") @@ -38,11 +38,15 @@ public class AppFileMessage extends BaseMessage { private AppFileMessage.FileInfo fileInfo; private String data; + + private String name; } @Data public static class FileInfo{ + private String name; + private Long fileTime; private Integer fileSize; diff --git a/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileMessageTemplate.java b/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileMessageTemplate.java index d92042fc3..23e8b864b 100644 --- a/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileMessageTemplate.java +++ b/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileMessageTemplate.java @@ -22,8 +22,9 @@ public class AppFileMessageTemplate extends RocketMQEnhanceTemplate { super(template); } - public SendResult sendMember(AppFileMessage appFileMessage, String tag) { + public SendResult sendMember(AppFileMessage appFileMessage) { appFileMessage.setSource(BusinessResource.APP_RESOURCE); - return send(BusinessTopic.NJCN_APP_FILE_TOPIC, tag, appFileMessage); + return send(BusinessTopic.NJCN_APP_FILE_TOPIC, BusinessTopic.FileTag.INFO_TAG, appFileMessage); } + } diff --git a/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileStreamMessageTemplate.java b/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileStreamMessageTemplate.java new file mode 100644 index 000000000..d03461380 --- /dev/null +++ b/pqs-common/common-mq/src/main/java/com/njcn/mq/template/AppFileStreamMessageTemplate.java @@ -0,0 +1,30 @@ +package com.njcn.mq.template; + +import com.njcn.middle.rocket.template.RocketMQEnhanceTemplate; +import com.njcn.mq.constant.BusinessResource; +import com.njcn.mq.constant.BusinessTopic; +import com.njcn.mq.message.AppFileMessage; +import org.apache.rocketmq.client.producer.SendResult; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.springframework.stereotype.Component; + +/** + * 类的介绍: + * + * @author xuyang + * @version 1.0.0 + * @createTime 2023/8/11 15:28 + */ +@Component +public class AppFileStreamMessageTemplate extends RocketMQEnhanceTemplate { + + public AppFileStreamMessageTemplate(RocketMQTemplate template) { + super(template); + } + + public SendResult sendMember(AppFileMessage appFileMessage) { + appFileMessage.setSource(BusinessResource.APP_RESOURCE); + return send(BusinessTopic.NJCN_APP_FILE_STREAM_TOPIC, BusinessTopic.FileTag.STREAM_TAG, appFileMessage); + } + +} diff --git a/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java b/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java index a2b02a079..ae8673b49 100644 --- a/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java +++ b/pqs-common/common-oss/src/main/java/com/njcn/oss/utils/FileStorageUtil.java @@ -10,6 +10,8 @@ import com.njcn.minioss.config.MinIossProperties; import com.njcn.minioss.util.MinIoUtils; import com.njcn.oss.constant.GeneralConstant; import com.njcn.oss.enums.OssResponseEnum; +import io.minio.MinioClient; +import io.minio.PutObjectArgs; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.tomcat.util.http.fileupload.IOUtils; @@ -17,8 +19,10 @@ import org.springframework.http.MediaType; import org.springframework.stereotype.Component; import org.springframework.web.multipart.MultipartFile; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.io.*; +import java.util.Optional; import java.util.UUID; /** @@ -31,6 +35,9 @@ import java.util.UUID; @RequiredArgsConstructor public class FileStorageUtil { + @Resource + private MinioClient instance; + private final GeneralInfo generalInfo; /*** @@ -99,6 +106,31 @@ public class FileStorageUtil { return filePath; } + /** + * 上传InputStream流,并指定文件的名称 + * @author xuyang + * @param inputStream + * @param dir + * @param fileName + * @return + */ + public String uploadStreamSpecifyName(InputStream inputStream, String dir, String fileName) { + String filePath; + if (generalInfo.getBusinessFileStorage() == GeneralConstant.HUAWEI_OBS) { + filePath = dir + minIoUtils.minFileName(fileName); + obsUtil.uploadStream(inputStream, filePath); + } else { + try { + //把名称存入数据 + MinIoUploadResDTO minIoUploadResDTO = uploadStreamSpecifyName(inputStream, minIossProperties.getBucket(), dir, fileName); + filePath = minIoUploadResDTO.getMinFileName(); + } catch (Exception e) { + throw new BusinessException(OssResponseEnum.UPLOAD_FILE_ERROR); + } + } + return filePath; + } + /*** * 根据文件路径获取文件短期的一个url @@ -221,6 +253,15 @@ public class FileStorageUtil { } } - + public MinIoUploadResDTO uploadStreamSpecifyName(InputStream inputStream, String bucketName, String directory, String fileName) throws Exception { + if (!minIoUtils.bucketExists(bucketName)) { + minIoUtils.makeBucket(bucketName); + } + directory = (String) Optional.ofNullable(directory).orElse(""); + String minFileName = directory + fileName; + this.instance.putObject((PutObjectArgs)((io.minio.PutObjectArgs.Builder)((io.minio.PutObjectArgs.Builder)PutObjectArgs.builder().bucket(bucketName)).object(minFileName)).stream(inputStream, (long)inputStream.available(), -1L).build()); + inputStream.close(); + return new MinIoUploadResDTO(minFileName, minIoUtils.getObjectUrl(bucketName, minFileName, 60)); + } } diff --git a/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java b/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java index b61bd9486..6303fd5e8 100644 --- a/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java +++ b/pqs-common/common-redis/src/main/java/com/njcn/redis/pojo/enums/AppRedisKey.java @@ -46,4 +46,11 @@ public interface AppRedisKey { */ String RMQ_CONSUME_KEY="rocketMQConsumeKey:"; + /** + * rocketMQ消费文件key + */ + String RMQ_FILE_CONSUME_KEY="rocketMQFileConsumeKey:"; + + String TIME="time-:"; + } diff --git a/pqs-common/common-web/pom.xml b/pqs-common/common-web/pom.xml index 429062075..0a011962b 100644 --- a/pqs-common/common-web/pom.xml +++ b/pqs-common/common-web/pom.xml @@ -69,11 +69,6 @@ com.nimbusds nimbus-jose-jwt - - org.influxdb - influxdb-java - - \ No newline at end of file diff --git a/pqs-device/common-device-biz/pom.xml b/pqs-device/common-device-biz/pom.xml index c06a3a41d..9bdb5fe96 100644 --- a/pqs-device/common-device-biz/pom.xml +++ b/pqs-device/common-device-biz/pom.xml @@ -59,13 +59,6 @@ com.njcn pqs-influx 0.0.1-SNAPSHOT - - - - com.squareup.okhttp3 - * - - diff --git a/pqs-device/device-boot/pom.xml b/pqs-device/device-boot/pom.xml index 55971cfc5..d881e47d5 100644 --- a/pqs-device/device-boot/pom.xml +++ b/pqs-device/device-boot/pom.xml @@ -21,16 +21,16 @@ - - + + com.njcn diff --git a/pqs-device/pms-device/pms-device-boot/pom.xml b/pqs-device/pms-device/pms-device-boot/pom.xml index b904c242d..3687863d9 100644 --- a/pqs-device/pms-device/pms-device-boot/pom.xml +++ b/pqs-device/pms-device/pms-device-boot/pom.xml @@ -44,24 +44,6 @@ com.njcn common-oss ${project.version} - - - com.squareup.okhttp3 - okhttp - - - - - - com.squareup.okhttp3 - okhttp - 4.8.1 - - - - com.squareup.okhttp3 - logging-interceptor - 4.8.1 diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/OverLimitLineDTO.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/OverLimitLineDTO.java index e4448ebde..c27417a1f 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/OverLimitLineDTO.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/dto/OverLimitLineDTO.java @@ -18,6 +18,8 @@ public class OverLimitLineDTO { private String lineScale; + private String manufacturer; + private String loadType; private String lineObjectName; diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml index c8abae46d..b85f379c9 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/mapper/mapping/LineMapper.xml @@ -667,7 +667,8 @@ A4.`Name` subName, C3.`Name` subScale, A5.`Name` cityCompany, - F.`Name` provinceCompany + F.`Name` provinceCompany, + dev.Manufacturer FROM pq_line A1, pq_line A2, @@ -676,6 +677,7 @@ pq_line A5, pq_line A6, pq_voltage B, + pq_device dev, sys_dict_data C1, sys_dict_data C2, sys_dict_data C3, @@ -689,7 +691,7 @@ AND A1.Pid = A2.Id AND A2.Id = B.Id AND B.Scale = C1.Id AND A1.Id = D.Id AND D.Load_Type = C2.Id AND A2.Pid = A3.Id AND A3.Pid = A4.Id AND A4.Pid = A5.Id AND A4.Id = E.Id AND E.Scale = C3.Id - AND A5.Pid = A6.Id AND A6.`Name` = F.Area_Code + AND A5.Pid = A6.Id AND A6.`Name` = F.Area_Code and A3.id = dev.id select work_plan_name, - sp.* + spm.* from supv_problem spm INNER JOIN supv_plan sp on sp.plan_Id=spm.plan_id diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmBackServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmBackServiceImpl.java index 25914a0ce..e2415e2a9 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmBackServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmBackServiceImpl.java @@ -60,7 +60,7 @@ public class SupvAlarmBackServiceImpl extends ServiceImpl ids) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.ne(SupvAlarmBack::getIsUploadHead, 0).eq(SupvAlarmBack::getWorkAlarmId, ids); + lambdaQueryWrapper.ne(SupvAlarmBack::getIsUploadHead, 0).in(SupvAlarmBack::getWorkAlarmId, ids); int count = this.count(lambdaQueryWrapper); if (count > 0) { throw new BusinessException("请选择未上送国网的删除"); diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmServiceImpl.java index ac8cd3585..01fd065f6 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvAlarmServiceImpl.java @@ -59,7 +59,7 @@ public class SupvAlarmServiceImpl extends ServiceImpl planIds) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.ne(SupvAlarm::getIsUploadHead, 0).eq(SupvAlarm::getAlarmId, planIds); + lambdaQueryWrapper.ne(SupvAlarm::getIsUploadHead, 0).in(SupvAlarm::getAlarmId, planIds); int count = this.count(lambdaQueryWrapper); if (count > 0) { throw new BusinessException("请选择未上送国网的删除"); diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanHisServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanHisServiceImpl.java index 042a76ff1..acd2593bc 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanHisServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanHisServiceImpl.java @@ -59,7 +59,7 @@ public class SupvPlanHisServiceImpl extends ServiceImpl planIds) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(SupvPlanHis::getIsUploadHead, 1).eq(SupvPlanHis::getId, planIds); + lambdaQueryWrapper.ne(SupvPlanHis::getIsUploadHead, 0).in(SupvPlanHis::getId, planIds); int count = this.count(lambdaQueryWrapper); if (count > 0) { throw new BusinessException("请选择未上送国网的删除"); diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java index da6f99308..2c0f3702a 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPlanServiceImpl.java @@ -211,7 +211,7 @@ public class SupvPlanServiceImpl extends ServiceImpl i @Transactional(rollbackFor = Exception.class) public boolean delPlan(List planIds) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.ne(SupvPlan::getIsUploadHead, 0).eq(SupvPlan::getPlanId, planIds); + lambdaQueryWrapper.ne(SupvPlan::getIsUploadHead, 0).in(SupvPlan::getPlanId, planIds); int count = this.count(lambdaQueryWrapper); if (count > 0) { throw new BusinessException("请选择未上送国网的删除"); diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java index f6f41f80e..6c83674c0 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvProblemServiceImpl.java @@ -20,7 +20,10 @@ import com.njcn.process.pojo.po.SupvProblem; import com.njcn.process.pojo.vo.SupvProblemVO; import com.njcn.process.service.ISupvProblemService; import com.njcn.system.api.DicDataFeignClient; +import com.njcn.system.enums.DicDataTypeEnum; +import com.njcn.system.pojo.po.DictData; import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.po.Dept; import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.web.factory.PageFactory; import lombok.RequiredArgsConstructor; @@ -87,7 +90,7 @@ public class SupvProblemServiceImpl extends ServiceImpl problemIds) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.ne(SupvProblem::getIsUploadHead, 0).eq(SupvProblem::getProblemId, problemIds); + lambdaQueryWrapper.ne(SupvProblem::getIsUploadHead, 0).in(SupvProblem::getProblemId, problemIds); int count = this.count(lambdaQueryWrapper); if (count > 0) { throw new BusinessException("请选择未上送国网的删除"); @@ -136,8 +139,26 @@ public class SupvProblemServiceImpl extends ServiceImpl supvProblemVOS = this.baseMapper.listDerive(supvProblemParam); -// List weightExcels = this.baseMapper.selectWeights(terminalMainQueryParam); -// ExcelUtil.exportExcel("监测点权重信息.xlsx",PqsLineWeightVo.WeightExcel.class,weightExcels); + //监测点状态 + List monitorTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.MONITOR_TYPE.getCode()).getData(); + Map mapMonitorType = monitorTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); + //问题类型 + List problemTypeList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SUPV_PROBLEM_TYPE.getCode()).getData(); + Map mapProblemType = problemTypeList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); + + for (SupvProblemVO supvProblem : supvProblemVOS) { + Dept dept = deptFeignClient.getDeptByCode(supvProblem.getDutyOrgId()).getData(); + supvProblem.setDutyOrgName(dept.getName()); + + if (mapMonitorType.containsKey(supvProblem.getMonitorType())) { + supvProblem.setMonitorType(mapMonitorType.get(supvProblem.getMonitorType()).getName()); + } + if (mapProblemType.containsKey(supvProblem.getProblemType())) { + supvProblem.setProblemType(mapProblemType.get(supvProblem.getProblemType()).getName()); + } + } + + ExcelUtil.exportExcel("实施问题信息.xlsx",SupvProblemVO.class,supvProblemVOS); } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/enums/SystemResponseEnum.java b/pqs-system/system-api/src/main/java/com/njcn/system/enums/SystemResponseEnum.java index 49a4d6ca9..48b09d410 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/enums/SystemResponseEnum.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/enums/SystemResponseEnum.java @@ -24,6 +24,7 @@ public enum SystemResponseEnum { INTERFERENCE_EMPTY("A00356","查询字典干扰源类型数据为空"), BUSINESS_EMPTY("A00356","查询字典行业类型数据为空"), + SYSTEM_TYPE_EMPTY("A00356","查询字典系统类型数据为空"), DEV_TYPE_EMPTY("A00357","查询字典设备类型数据为空"), MANUFACTURER("A00358","查询字典终端厂家数据为空"), DEV_VARIETY("A00359","查询字典终端类型数据为空"), diff --git a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java index 917823ccf..55aa5fcab 100644 --- a/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java +++ b/pqs-user/user-boot/src/main/java/com/njcn/user/service/impl/ComponentServiceImpl.java @@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.system.api.DicDataFeignClient; +import com.njcn.system.enums.SystemResponseEnum; import com.njcn.system.pojo.po.DictData; import com.njcn.user.enums.UserResponseEnum; import com.njcn.user.mapper.ComponentMapper; @@ -103,6 +104,9 @@ public class ComponentServiceImpl extends ServiceImpl> map = list.stream().filter(m->!Objects.isNull(m.getSystemType())).collect(Collectors.groupingBy(ComponentVO::getSystemType)); map.forEach((k,v)->{ DictData dictData = dicDataFeignClient.getDicDataById(k).getData(); + if (Objects.isNull(dictData)){ + throw new BusinessException(SystemResponseEnum.SYSTEM_TYPE_EMPTY); + } ComponentVO componentVO = new ComponentVO(); componentVO.setId(dictData.getId()); componentVO.setName(dictData.getName()); @@ -145,6 +149,9 @@ public class ComponentServiceImpl extends ServiceImpl> map = componentVOList.stream().collect(Collectors.groupingBy(ComponentVO::getSystemType)); map.forEach((k, v)->{ DictData dictData = dicDataFeignClient.getDicDataById(k).getData(); + if (Objects.isNull(dictData)){ + throw new BusinessException(SystemResponseEnum.SYSTEM_TYPE_EMPTY); + } ComponentVO componentVO = new ComponentVO(); componentVO.setName(dictData.getName()); componentVO.setChildren(