zhb.dong преди 1 година
родител
ревизия
4cda3bc591

+ 36 - 2
zd-gateway/src/main/java/com/zd/gateway/filter/RequestBodyFilter.java

@@ -5,20 +5,45 @@ import org.slf4j.MDC;
 import org.springframework.cloud.gateway.filter.GatewayFilterChain;
 import org.springframework.cloud.gateway.filter.GlobalFilter;
 import org.springframework.core.Ordered;
+import org.springframework.core.io.buffer.DataBuffer;
+import org.springframework.core.io.buffer.DataBufferUtils;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.http.codec.HttpMessageReader;
 import org.springframework.stereotype.Component;
+import org.springframework.util.StreamUtils;
 import org.springframework.web.server.ServerWebExchange;
+import reactor.core.publisher.Flux;
 import reactor.core.publisher.Mono;
 
+import java.nio.charset.StandardCharsets;
+
+
 @Component
 @Slf4j(topic = "【gateway-http-body---】")
 public class RequestBodyFilter implements GlobalFilter, Ordered {
+
+    private final HttpMessageReader<String> messageReader;
+
+    public RequestBodyFilter(HttpMessageReader<String> messageReader) {
+        this.messageReader = messageReader;
+    }
+
     @Override
     public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
         log.info("============================ Request Begin =============================");
         log.info("traceId:{}", MDC.get("traceId"));
         log.info("Request path: {}", exchange.getRequest().getPath());
-        log.info("Request query params: {}", exchange.getRequest().getQueryParams());
-        log.info("Request headers: {}", exchange.getRequest().getHeaders());
+
+        HttpHeaders headers = exchange.getRequest().getHeaders();
+        MediaType contentType = headers.getContentType();
+        if (contentType != null && contentType.isCompatibleWith(MediaType.APPLICATION_JSON)) {
+            Flux<DataBuffer> body = exchange.getRequest().getBody();
+
+        }else{
+            log.info("Request query params: {}", exchange.getRequest().getQueryParams());
+        }
+        log.info("Request headers: {}", headers);
 
         return chain.filter(exchange).then(Mono.fromRunnable(() -> {
             log.info("Response status code: {}", exchange.getResponse().getStatusCode());
@@ -27,6 +52,15 @@ public class RequestBodyFilter implements GlobalFilter, Ordered {
         }));
     }
 
+    private Mono<String> readJsonBody(Flux<DataBuffer> body) {
+        return this.messageReader.readMono(
+                Mono.just(ServerHttpRequestDecorator.empty().body(BodyInserters.fromDataBuffers(body))),
+                String.class,
+                MediaType.APPLICATION_JSON,
+                Map.of()
+        );
+    }
+
     @Override
     public int getOrder() {
         return -10;

+ 152 - 150
zd-modules/zd-security/src/main/java/com/zd/security/service/impl/CheckManageServiceImpl.java

@@ -107,8 +107,8 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
     private CheckDeviceService checkDeviceService;
 
     @Override
-    public Page<CheckManageVo> selecCheckManageList(Page page,CheckManageBo bo) {
-        return checkManageMapper.selecCheckManageList(page,bo);
+    public Page<CheckManageVo> selecCheckManageList(Page page, CheckManageBo bo) {
+        return checkManageMapper.selecCheckManageList(page, bo);
     }
 
     /**
@@ -118,8 +118,8 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
      * @return
      */
     @Override
-    public Page<CheckManageVo> selecCheckManageTobeReviewedList(Page page,CheckManageBo bo) {
-        return checkManageMapper.selecCheckManageTobeReviewedList(page,bo);
+    public Page<CheckManageVo> selecCheckManageTobeReviewedList(Page page, CheckManageBo bo) {
+        return checkManageMapper.selecCheckManageTobeReviewedList(page, bo);
     }
 
     /***
@@ -138,8 +138,8 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
      */
     @Override
     @Synchronized
-    public Page<CheckManageVo> selecSubCheckManageList( Page page, CheckManageBo bo) {
-        return checkManageMapper.selecSubCheckManageList(page,bo);
+    public Page<CheckManageVo> selecSubCheckManageList(Page page, CheckManageBo bo) {
+        return checkManageMapper.selecSubCheckManageList(page, bo);
     }
 
     /**
@@ -152,10 +152,10 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         Long deptId = null;
         //获取当前登录用户
         LoginModel sysUser = tokenService.getLoginUser();
-        log.error("sysuser:{}",sysUser.toString());
+        log.error("sysuser:{}", sysUser.toString());
         AjaxResult dept = remoteDeptService.getInfoByDeptId(sysUser.getDeptId());
-        log.error("dept:{}",dept.toString());
-        if (HttpStatus.SUCCESS==Integer.valueOf(dept.get("code").toString())) {
+        log.error("dept:{}", dept.toString());
+        if (HttpStatus.SUCCESS == Integer.valueOf(dept.get("code").toString())) {
             LinkedHashMap<String, Object> linkedHashMap = (LinkedHashMap<String, Object>) dept.get("data");
             String deptNaces = linkedHashMap.get("ancestors").toString();
             //查询登录用户所属的院校
@@ -171,26 +171,26 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
 
     @Override
     public void checkPlanStatus(Long checkManageId) {
-        Predicate<List<CheckManage>> magPre1 = p -> p.stream().filter(b->b.getManageStatus().intValue()!=2).count()==0;
+        Predicate<List<CheckManage>> magPre1 = p -> p.stream().filter(b -> b.getManageStatus().intValue() != 2).count() == 0;
         CheckManage checkManage = getById(checkManageId);
         if (checkManage.getCheckPlanId() != null) {
             List<CheckManage> checkManagers = list(new LambdaQueryWrapper<CheckManage>()
                     .eq(CheckManage::getCheckPlanId, checkManage.getCheckPlanId()));
             if (magPre1.test(checkManagers)) {
-                Function<List<CheckManage>,List<Long>> functionManageId = a->Optional.ofNullable(a).orElseGet(Collections::emptyList)
+                Function<List<CheckManage>, List<Long>> functionManageId = a -> Optional.ofNullable(a).orElseGet(Collections::emptyList)
                         .stream()
-                        .map(b->b.getId())
+                        .map(b -> b.getId())
                         .collect(Collectors.toList());
 
                 //2是待整改,3是待复核   如果没有这两个类型的数据,就说明所有的流程全部执行完毕
                 List<CheckHazard> checkHazards = checkHazardService.list(new LambdaQueryWrapper<CheckHazard>().in(CheckHazard::getCheckManageId, functionManageId.apply(checkManagers))
-                        .and(i->i.eq(CheckHazard::getRectifyStatus, 2).or().eq(CheckHazard::getRectifyStatus,3)));
-                if(checkHazards==null || checkHazards.isEmpty()){
+                        .and(i -> i.eq(CheckHazard::getRectifyStatus, 2).or().eq(CheckHazard::getRectifyStatus, 3)));
+                if (checkHazards == null || checkHazards.isEmpty()) {
                     //没有未完成,修改计划状态已结束
                     checkPlanService.update(new LambdaUpdateWrapper<CheckPlan>().eq(CheckPlan::getId, checkManage.getCheckPlanId())
-                            .set(CheckPlan::getCheckStatus,3));
+                            .set(CheckPlan::getCheckStatus, 3));
                     //这里只需要如果是院校巡查的时候,才会在任务完成后,看需不需要取消临时人的身份
-                    if(checkManage.getCheckType() == 1){
+                    if (checkManage.getCheckType() == 1) {
                         remAuth(checkManage);
                     }
                 }
@@ -199,57 +199,57 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
     }
 
 
-    public void remAuth(CheckManage checkManage){
+    public void remAuth(CheckManage checkManage) {
         //这里只需要如果是院校巡查的时候,才会在任务完成后,看需不需要取消临时人的身份
-        if(checkManage.getCheckType().intValue()==1){
-            List<CheckMember> oldCheckMemberList = checkMemberService.list(new LambdaQueryWrapper <CheckMember>().eq(CheckMember::getCheckPlanId,checkManage.getCheckPlanId()));
+        if (checkManage.getCheckType().intValue() == 1) {
+            List<CheckMember> oldCheckMemberList = checkMemberService.list(new LambdaQueryWrapper<CheckMember>().eq(CheckMember::getCheckPlanId, checkManage.getCheckPlanId()));
             //这里添加一个身份校验,当流程结束的时候,需要查询当前用户是否在其他流程中
-            List<CheckPlan> checkPlanList = checkPlanService.list(new LambdaQueryWrapper <CheckPlan>().ne(CheckPlan::getCheckStatus,3));
-            Function<List<CheckPlan>,List<Long>> function = a->Optional.ofNullable(a).orElseGet(Collections::emptyList)
+            List<CheckPlan> checkPlanList = checkPlanService.list(new LambdaQueryWrapper<CheckPlan>().ne(CheckPlan::getCheckStatus, 3));
+            Function<List<CheckPlan>, List<Long>> function = a -> Optional.ofNullable(a).orElseGet(Collections::emptyList)
                     .stream()
                     .distinct()
-                    .map(b->b.getId())
+                    .map(b -> b.getId())
                     .collect(Collectors.toList());
-            List<CheckMember> newCheckMemberList = checkMemberService.list(new LambdaQueryWrapper <CheckMember>()
-                    .in(CheckMember::getCheckPlanId,function.apply(checkPlanList)));
+            List<CheckMember> newCheckMemberList = checkMemberService.list(new LambdaQueryWrapper<CheckMember>()
+                    .in(CheckMember::getCheckPlanId, function.apply(checkPlanList)));
 
-            Predicate<CheckMember> predicate = a-> Optional.ofNullable(newCheckMemberList).orElseGet(Collections::emptyList)
+            Predicate<CheckMember> predicate = a -> Optional.ofNullable(newCheckMemberList).orElseGet(Collections::emptyList)
                     .stream()
-                    .filter(b->a.getUserId().longValue() == b.getUserId().longValue())
-                    .count()==0;
+                    .filter(b -> a.getUserId().longValue() == b.getUserId().longValue())
+                    .count() == 0;
 
             //过滤出当前计划组的人,没有在其他计划组的人员列表
             List<Long> userIds = Optional.ofNullable(oldCheckMemberList).orElseGet(Collections::emptyList)
                     .stream()
-                    .filter(a->predicate.test(a))
-                    .map(b->b.getUserId())
+                    .filter(a -> predicate.test(a))
+                    .map(b -> b.getUserId())
                     .collect(Collectors.toList());
             //这里需要根据过滤出的人员查询检查人员
-            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
-                    .eq(CheckStaffUser::getStaffType,1));
-            Predicate<Long> predicate2 = a-> Optional.ofNullable(checkStaffUserList).orElseGet(Collections::emptyList)
+            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper<CheckStaffUser>()
+                    .eq(CheckStaffUser::getStaffType, 1));
+            Predicate<Long> predicate2 = a -> Optional.ofNullable(checkStaffUserList).orElseGet(Collections::emptyList)
                     .stream()
-                    .filter(b->a.longValue() == b.getUserId().longValue())
-                    .count()==0;
+                    .filter(b -> a.longValue() == b.getUserId().longValue())
+                    .count() == 0;
             //这里需要移除没有在检查人员的人员列表数据权限
             Long[] longList = Optional.ofNullable(userIds).orElseGet(Collections::emptyList)
                     .stream()
-                    .filter(a->predicate2.test(a))
+                    .filter(a -> predicate2.test(a))
                     .toArray(Long[]::new);
-            if(longList.length>0){
+            if (longList.length > 0) {
                 AjaxResult delsafecheck = remoteUserService.delsafecheck(longList);
                 //这里需要根据过滤出的人员查询整改人员
-                List<CheckStaffUser> zgStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
-                        .eq(CheckStaffUser::getStaffType,2));
+                List<CheckStaffUser> zgStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper<CheckStaffUser>()
+                        .eq(CheckStaffUser::getStaffType, 2));
 
-                Predicate<Long> predicate3 = a-> Optional.ofNullable(zgStaffUserList).orElseGet(Collections::emptyList)
+                Predicate<Long> predicate3 = a -> Optional.ofNullable(zgStaffUserList).orElseGet(Collections::emptyList)
                         .stream()
-                        .filter(b->a.longValue() == b.getUserId().longValue())
-                        .count()>0;
+                        .filter(b -> a.longValue() == b.getUserId().longValue())
+                        .count() > 0;
                 Long[] staffUserArray = Arrays.asList(longList).stream()
-                        .filter(a->predicate3.test(a))
+                        .filter(a -> predicate3.test(a))
                         .toArray(Long[]::new);
-                if(staffUserArray.length>0){
+                if (staffUserArray.length > 0) {
                     //还原被同时移除的整改权限,把对应的整改人权限补回来
                     remoteUserService.rectifycheck(staffUserArray);
                 }
@@ -261,14 +261,15 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
 
     /**
      * 获取过滤list的用户userid
+     *
      * @return
      */
-    public Long[] makeUserId(List<CheckStaffUser> checkStaffUserList){
+    public Long[] makeUserId(List<CheckStaffUser> checkStaffUserList) {
         Long[] ids = new Long[checkStaffUserList.size()];
         LongAdder adder = new LongAdder();
         Optional.ofNullable(checkStaffUserList).orElseGet(Collections::emptyList)
                 .stream()
-                .forEach(a->{
+                .forEach(a -> {
                     ids[adder.intValue()] = a.getUserId();
                     adder.increment();
                 });
@@ -279,17 +280,17 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
     @Override
     public CheckManageExcelVo getRectifyAdviceNoteView(Long checkMangeId) {
         CheckManageVo checkManage = checkManageService.findCheckManage2Notification(checkMangeId);
-        if(checkManage == null){
+        if (checkManage == null) {
             throw new ServiceException("生成失败,ID无效!");
         }
         //这里查询隐患项列表
         //查询条件
-        QueryWrapper <CheckHazard> wrapper = new QueryWrapper <>();
+        QueryWrapper<CheckHazard> wrapper = new QueryWrapper<>();
         //过滤物理删除数据及正序叙
         wrapper.lambda().eq(CheckHazard::getIsDeleted, Boolean.FALSE)
-                .eq(CheckHazard::getCheckFlag,0)
-                .eq(CheckHazard::getCheckManageId,checkManage.getId()).orderByAsc(CheckHazard::getId);
-        List <CheckHazard> checkHazardList = checkHazardService.list(wrapper);
+                .eq(CheckHazard::getCheckFlag, 0)
+                .eq(CheckHazard::getCheckManageId, checkManage.getId()).orderByAsc(CheckHazard::getId);
+        List<CheckHazard> checkHazardList = checkHazardService.list(wrapper);
 
         CheckManageExcelVo checkManageExcelVo = new CheckManageExcelVo();
         checkManageExcelVo.setCheckYear(String.valueOf(checkManage.getCheckTime().get(ChronoField.YEAR)));
@@ -299,7 +300,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         checkManageExcelVo.setRectifyMonth(String.valueOf(checkManage.getRectifyDeadline().get(ChronoField.MONTH_OF_YEAR)));
         checkManageExcelVo.setRectifyDay(String.valueOf(checkManage.getRectifyDeadline().get(ChronoField.DAY_OF_MONTH)));
         // 学院名称
-        checkManageExcelVo.setDeptName(checkManage.getCollegeName()+""+checkManage.getBuildName());
+        checkManageExcelVo.setDeptName(checkManage.getCollegeName() + "" + checkManage.getBuildName());
         // 实验室名称
         checkManageExcelVo.setSubName(checkManage.getSubjectName());
 
@@ -310,36 +311,36 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         checkManageExcelVo.setCount(checkManage.getDangerNum());
 
         //电子签章
-        ResultData <String> remote = remoteDeptService.getDeptBySign(checkManage.getDeptId());
-        String deptSign = remote.getData()==null?"":remote.getData()+"";
+        ResultData<String> remote = remoteDeptService.getDeptBySign(checkManage.getDeptId());
+        String deptSign = remote.getData() == null ? "" : remote.getData() + "";
         checkManageExcelVo.setCheckDeptSign(deptSign);
 
         //这里整改结果的列表
         for (int i = 0; i < checkHazardList.size(); i++) {
-            if(checkHazardList.get(i).getRectifyStatus().intValue()==1 || checkHazardList.get(i).getRectifyStatus().intValue()==4){
+            if (checkHazardList.get(i).getRectifyStatus().intValue() == 1 || checkHazardList.get(i).getRectifyStatus().intValue() == 4) {
                 CheckManageDetail2Vo detail2 = new CheckManageDetail2Vo();
                 detail2.setHazardName(checkHazardList.get(i).getHazardCheckName());
                 detail2.setRectifyStatus(zgResult(checkHazardList.get(i)));
 
                 //查询整改审批通过的那条数据
                 //查询条件
-                QueryWrapper <CheckRectify> wrapperRectify = new QueryWrapper <>();
+                QueryWrapper<CheckRectify> wrapperRectify = new QueryWrapper<>();
                 //过滤物理删除数据及正序叙
                 wrapperRectify.lambda().eq(CheckRectify::getIsDeleted, Boolean.FALSE)
-                        .eq(CheckRectify::getCheckHazardId,checkHazardList.get(i).getId())
+                        .eq(CheckRectify::getCheckHazardId, checkHazardList.get(i).getId())
                         .orderByDesc(CheckRectify::getId);
                 List<CheckRectify> checkRectifyList = checkRectifyService.list(wrapperRectify);
-                if(checkRectifyList!=null && !checkRectifyList.isEmpty()){
+                if (checkRectifyList != null && !checkRectifyList.isEmpty()) {
                     detail2.setRectifyMeasure(checkRectifyList.get(0).getRectifyMeasure());
-                    if(checkHazardList.get(i).getRectifyStatus().intValue()!=4){
+                    if (checkHazardList.get(i).getRectifyStatus().intValue() != 4) {
                         detail2.setRechecker("复查人员(签字):");
                         ResultData<String> resultData = remoteLaboratoryService.signatureByUserId(checkRectifyList.get(0).getReviewedBy());
                         detail2.setCheckNickName(resultData.getData());
                         detail2.setRectifyYear(checkRectifyList.get(0).getReviewedTime().get(ChronoField.YEAR));
                         detail2.setRectifyMonth(checkRectifyList.get(0).getReviewedTime().get(ChronoField.MONTH_OF_YEAR));
                         detail2.setRectifyDay(checkRectifyList.get(0).getReviewedTime().get(ChronoField.DAY_OF_MONTH));
-                    }else{
-                        if(checkRectifyList.get(0).getCreateTime()!=null){
+                    } else {
+                        if (checkRectifyList.get(0).getCreateTime() != null) {
                             detail2.setRectifyYear(checkRectifyList.get(0).getCreateTime().get(ChronoField.YEAR));
                             detail2.setRectifyMonth(checkRectifyList.get(0).getCreateTime().get(ChronoField.MONTH_OF_YEAR));
                             detail2.setRectifyDay(checkRectifyList.get(0).getCreateTime().get(ChronoField.DAY_OF_MONTH));
@@ -349,26 +350,26 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
 
                     //图片稍后处理
                     //查询条件
-                    QueryWrapper <Upload> updateWrapper = new QueryWrapper <>();
+                    QueryWrapper<Upload> updateWrapper = new QueryWrapper<>();
                     //过滤物理删除数据及正序叙
                     updateWrapper.lambda().eq(Upload::getIsDeleted, Boolean.FALSE)
-                            .eq(Upload::getKeyId,checkRectifyList.get(0).getId())
-                            .eq(Upload::getSource,3).orderByAsc(Upload::getId);
-                    List <Upload> updateList = uploadService.list(updateWrapper);
-                    for(int con=0;con<updateList.size();con++){
-                        if(con == 0){
+                            .eq(Upload::getKeyId, checkRectifyList.get(0).getId())
+                            .eq(Upload::getSource, 3).orderByAsc(Upload::getId);
+                    List<Upload> updateList = uploadService.list(updateWrapper);
+                    for (int con = 0; con < updateList.size(); con++) {
+                        if (con == 0) {
                             detail2.setRectifyImg1(updateList.get(con).getFileUrl());
                         }
-                        if(con == 1){
+                        if (con == 1) {
                             detail2.setRectifyImg2(updateList.get(con).getFileUrl());
                         }
-                        if(con == 2){
+                        if (con == 2) {
                             detail2.setRectifyImg3(updateList.get(con).getFileUrl());
                         }
-                        if(con == 3){
+                        if (con == 3) {
                             detail2.setRectifyImg4(updateList.get(con).getFileUrl());
                         }
-                        if(con == 4){
+                        if (con == 4) {
                             detail2.setRectifyImg5(updateList.get(con).getFileUrl());
                         }
                     }
@@ -380,29 +381,29 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
 
         }
 
-        checkManageExcelVo.setCheckRoom(checkManage.getSubjectName()+checkManage.getRoomNumber());
-        checkManageExcelVo.setCheckDate(checkManage.getCheckTime().get(ChronoField.YEAR)+"-"+checkManage.getCheckTime().get(ChronoField.MONTH_OF_YEAR)
-                +"-"+checkManage.getCheckTime().get(ChronoField.DAY_OF_MONTH));
+        checkManageExcelVo.setCheckRoom(checkManage.getSubjectName() + checkManage.getRoomNumber());
+        checkManageExcelVo.setCheckDate(checkManage.getCheckTime().get(ChronoField.YEAR) + "-" + checkManage.getCheckTime().get(ChronoField.MONTH_OF_YEAR)
+                + "-" + checkManage.getCheckTime().get(ChronoField.DAY_OF_MONTH));
 
         // 做一个检查人的字符串;
         StringBuilder stringBuffer = new StringBuilder();
 
         //这里需要查询检查者,返回多个检查者
-        if(checkManage.getCheckType()==1){
-            List<CheckMember> checkMemberList = checkMemberService.list(new LambdaQueryWrapper <CheckMember>().eq(CheckMember::getCheckPlanId,checkManage.getCheckPlanId()));
-            for(CheckMember checkMember:checkMemberList){
+        if (checkManage.getCheckType() == 1) {
+            List<CheckMember> checkMemberList = checkMemberService.list(new LambdaQueryWrapper<CheckMember>().eq(CheckMember::getCheckPlanId, checkManage.getCheckPlanId()));
+            for (CheckMember checkMember : checkMemberList) {
                 stringBuffer.append(",").append(checkMember.getName());
             }
-            if(stringBuffer.length()>0){
+            if (stringBuffer.length() > 0) {
                 checkManageExcelVo.setCheckUser(stringBuffer.substring(1));
             }
-        }else{
-            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
-                    .eq(CheckStaffUser::getSubId,checkManage.getSubId()).eq(CheckStaffUser::getStaffType,1));
-            for(CheckStaffUser checkStaffUser:checkStaffUserList){
+        } else {
+            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper<CheckStaffUser>()
+                    .eq(CheckStaffUser::getSubId, checkManage.getSubId()).eq(CheckStaffUser::getStaffType, 1));
+            for (CheckStaffUser checkStaffUser : checkStaffUserList) {
                 stringBuffer.append(",").append(checkStaffUser.getNickName());
             }
-            if(stringBuffer.length()>0){
+            if (stringBuffer.length() > 0) {
                 checkManageExcelVo.setCheckUser(stringBuffer.substring(1));
             }
         }
@@ -416,12 +417,12 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             detail.setCheckDesc(checkHazardList.get(i).getHazardDescribe());
             //图片稍后处理
             //查询条件
-            QueryWrapper <Upload> updateWrapper = new QueryWrapper <>();
+            QueryWrapper<Upload> updateWrapper = new QueryWrapper<>();
             //过滤物理删除数据及正序叙
             updateWrapper.lambda().eq(Upload::getIsDeleted, Boolean.FALSE)
                     .eq(Upload::getKeyId, checkHazardList.get(i).getId())
                     .eq(Upload::getSource, 2).orderByAsc(Upload::getId);
-            List <Upload> updateList = uploadService.list(updateWrapper);
+            List<Upload> updateList = uploadService.list(updateWrapper);
             for (int con = 0; con < updateList.size(); con++) {
                 if (con == 0) {
                     detail.setCheckImg1(updateList.get(con).getFileUrl());
@@ -446,7 +447,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
     }
 
     @Override
-    @DataPermission(roleKey="checkGentle")
+    @DataPermission(roleKey = "checkGentle")
     public Page<CheckManage> getlist(QueryCheckManageListParam queryCheckManageListParam, LambdaQueryWrapper<CheckManage> queryWrapper) {
         return checkManageService.page(new Page<CheckManage>(queryCheckManageListParam.getPageNum(), queryCheckManageListParam.getPageSize()), queryWrapper);
     }
@@ -464,7 +465,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             for (CheckHazardInfoVo hazardInfoVo : checkHazardInfoVoList) {
                 List<CheckHazardDto> list = new ArrayList<>();
                 List<CheckOptionVo> checkOptionVos = map.get(hazardInfoVo.getHazardId());
-                if(StringUtils.isNotNull(checkOptionVos)){
+                if (StringUtils.isNotNull(checkOptionVos)) {
                     for (CheckOptionVo checkOptionVo : checkOptionVos) {
                         CheckHazardDto checkHazardDto1 = new CheckHazardDto();
                         checkHazardDto1.setCode(checkOptionVo.getCode());
@@ -474,7 +475,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
                         checkHazardDto1.setCheckFlag(0);
                         list.add(checkHazardDto1);
                     }
-                }else{
+                } else {
                     CheckHazardDto checkHazardDto1 = new CheckHazardDto();
                     checkHazardDto1.setCheckCategory(2);
                     checkHazardDto1.setCheckFlag(0);
@@ -501,7 +502,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             for (CheckHazardInfoVo hazardInfoVo : checkHazardInfoVoList) {
                 List<CheckHazardDto> list = new ArrayList<>();
                 List<CheckOptionVo> checkOptionVos = map.get(hazardInfoVo.getHazardId());
-                if(StringUtils.isNotNull(checkOptionVos)){
+                if (StringUtils.isNotNull(checkOptionVos)) {
                     for (CheckOptionVo checkOptionVo : checkOptionVos) {
                         CheckHazardDto checkHazardDto1 = new CheckHazardDto();
                         checkHazardDto1.setCode(checkOptionVo.getCode());
@@ -512,7 +513,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
                         checkHazardDto1.setCheckFlag(0);
                         list.add(checkHazardDto1);
                     }
-                }else{
+                } else {
                     CheckHazardDto checkHazardDto1 = new CheckHazardDto();
                     checkHazardDto1.setCheckCategory(2);
                     checkHazardDto1.setCheckFlag(0);
@@ -541,16 +542,16 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         checkManageNotifyExcelVo.setRectifyDay(String.valueOf(checkManage.getRectifyDeadline().get(ChronoField.DAY_OF_MONTH)));
 
         checkManageNotifyExcelVo.setCheckDeptName(checkManage.getCollegeName());
-        if(checkManage.getBuildName()!=null){
-            checkManageNotifyExcelVo.setDeptName(checkManage.getCollegeName()+""+checkManage.getBuildName());
-        }else{
+        if (checkManage.getBuildName() != null) {
+            checkManageNotifyExcelVo.setDeptName(checkManage.getCollegeName() + "" + checkManage.getBuildName());
+        } else {
             checkManageNotifyExcelVo.setDeptName(checkManage.getCollegeName());
         }
 
 
         //电子签章
-        ResultData <String> remote = remoteDeptService.getDeptBySign(checkManage.getDeptId());
-        String deptSign = remote.getData()==null?"":remote.getData()+"";
+        ResultData<String> remote = remoteDeptService.getDeptBySign(checkManage.getDeptId());
+        String deptSign = remote.getData() == null ? "" : remote.getData() + "";
         checkManageNotifyExcelVo.setCheckDeptSign(deptSign);
 
 
@@ -566,37 +567,37 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         checkManageNotifyExcelVo.setNowMonth(month + "");
         checkManageNotifyExcelVo.setNowDay(day + "");
 
-        if(checkHazardDtoList!=null){
+        if (checkHazardDtoList != null) {
             for (int i = 0; i < checkHazardDtoList.size(); i++) {
                 //增加安全隐患判断为不符合的条件数据
-                if(checkHazardDtoList.get(i).getCheckFlag().intValue()==0){
+                if (checkHazardDtoList.get(i).getCheckFlag().intValue() == 0) {
                     CheckManageNotifyDetailVo detail = new CheckManageNotifyDetailVo();
                     detail.setIndex((1 + i) + "");
                     // 实验室名称
                     detail.setSubName(checkManage.getSubjectName());
                     // 隐患描述
-                    detail.setCheckDesc("("+(i+1)+")"+checkHazardDtoList.get(i).getHazardDescribe());
+                    detail.setCheckDesc("(" + (i + 1) + ")" + checkHazardDtoList.get(i).getHazardDescribe());
 
-                    for(int con=0;con<checkHazardDtoList.get(i).getUploadDtoList().size();con++){
-                        if(con == 0){
+                    for (int con = 0; con < checkHazardDtoList.get(i).getUploadDtoList().size(); con++) {
+                        if (con == 0) {
                             detail.setCheckImg1(checkHazardDtoList.get(i).getUploadDtoList().get(con).getFileUrl());
                         }
-                        if(con == 1){
+                        if (con == 1) {
                             detail.setCheckImg2(checkHazardDtoList.get(i).getUploadDtoList().get(con).getFileUrl());
                         }
-                        if(con == 2){
+                        if (con == 2) {
                             detail.setCheckImg3(checkHazardDtoList.get(i).getUploadDtoList().get(con).getFileUrl());
                         }
-                        if(con == 3){
+                        if (con == 3) {
                             detail.setCheckImg4(checkHazardDtoList.get(i).getUploadDtoList().get(con).getFileUrl());
                         }
-                        if(con == 4){
+                        if (con == 4) {
                             detail.setCheckImg5(checkHazardDtoList.get(i).getUploadDtoList().get(con).getFileUrl());
                         }
                     }
 
                     // 检查项名称,需要注意多级展示
-                    detail.setCheckOptionName("("+(i+1)+")"+checkHazardDtoList.get(i).getHazardCheckName());
+                    detail.setCheckOptionName("(" + (i + 1) + ")" + checkHazardDtoList.get(i).getHazardCheckName());
                     checkManageNotifyExcelVo.getCheckManageNotifyDetailList().add(detail);
                 }
             }
@@ -606,14 +607,14 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
     }
 
 
-    public String zgResult(CheckHazard checkHazard){
-        if(checkHazard.getRectifyStatus()==1){
+    public String zgResult(CheckHazard checkHazard) {
+        if (checkHazard.getRectifyStatus() == 1) {
             return "已整改";
-        }else if(checkHazard.getRectifyStatus()==2){
+        } else if (checkHazard.getRectifyStatus() == 2) {
             return "待整改";
-        }else if(checkHazard.getRectifyStatus()==3){
+        } else if (checkHazard.getRectifyStatus() == 3) {
             return "待复核";
-        }else{
+        } else {
             return "暂无法整改";
         }
     }
@@ -633,23 +634,23 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
 
         StringBuffer phones = new StringBuffer();
         StringBuffer userIds = new StringBuffer();
-        if(checkManageBo.getCheckType() == 1){
+        if (checkManageBo.getCheckType() == 1) {
             //校院巡查
             List<CheckMember> checkMembers = checkMemberService.list(new LambdaQueryWrapper<CheckMember>().eq(CheckMember::getCheckPlanId, checkManageBo.getCheckPlanId()));
-            Optional.ofNullable(checkMembers).orElseGet(Collections::emptyList).forEach(checkMember->{
+            Optional.ofNullable(checkMembers).orElseGet(Collections::emptyList).forEach(checkMember -> {
                 userIds.append(checkMember.getUserId()).append(",");
             });
-        }else {
+        } else {
             //实验室自查
-            Function<String,List<Long>> func = a->Arrays.asList(a.split(",")).stream().map(b->Long.parseLong(b)).collect(Collectors.toList());
+            Function<String, List<Long>> func = a -> Arrays.asList(a.split(",")).stream().map(b -> Long.parseLong(b)).collect(Collectors.toList());
             //这里根据实验室id查询对应的整改人员列表
-            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
-                    .eq(CheckStaffUser::getStaffType,1).in(CheckStaffUser::getSubId,func.apply(subIds)));
+            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper<CheckStaffUser>()
+                    .eq(CheckStaffUser::getStaffType, 1).in(CheckStaffUser::getSubId, func.apply(subIds)));
             StringBuilder stringBuffer = new StringBuilder();
-            for(CheckStaffUser checkStaffUser:checkStaffUserList){
+            for (CheckStaffUser checkStaffUser : checkStaffUserList) {
                 stringBuffer.append(",").append(checkStaffUser.getUserId());
             }
-            if(stringBuffer.length()>0){
+            if (stringBuffer.length() > 0) {
                 userIds.append(stringBuffer.substring(1));
             }
         }
@@ -662,25 +663,25 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             checkManage.setCheckUser(checkManageBo.getLoginUserName());
             checkManage.setCheckTime(LocalDateTime.now());
             BeanUtils.copyProperties(a, checkManage);
-            if(checkManage.getCheckCategory() == 2){
+            if (checkManage.getCheckCategory() == 2) {
                 // 2专项检查
-                if(StringUtils.isNotBlank(checkManage.getJoinHazardIds())){
+                if (StringUtils.isNotBlank(checkManage.getJoinHazardIds())) {
                     //通过关联id查询危险源信息
                     ResultData<List<CheckHazardInfo>> ret = remoteLaboratoryService.getHazardSubjectRelationListByIds(checkManage.getJoinHazardIds());
-                    if(HttpStatus.SUCCESS == ret.getCode() && ret.getData().size() > 0){
+                    if (HttpStatus.SUCCESS == ret.getCode() && ret.getData().size() > 0) {
                         List<CheckHazardInfoVo> checkHazardInfoVoList = JSON.parseArray(JSON.toJSONString(ret.getData()), CheckHazardInfoVo.class);
-                        if(checkHazardInfoVoList == null || checkHazardInfoVoList.isEmpty()){
+                        if (checkHazardInfoVoList == null || checkHazardInfoVoList.isEmpty()) {
                             return;
                         }
                         checkManage.setCheckHazardInfo(JSON.toJSONString(ret.getData()));
                     }
-                }else {
+                } else {
                     //实验室下绑定危险源列表
-                    ResultData result = remoteLaboratoryService.getHazardSubjectRelationList(a.getSubId(),checkManage.getHazardIds());
-                    if(HttpStatus.SUCCESS == result.getCode()){
+                    ResultData result = remoteLaboratoryService.getHazardSubjectRelationList(a.getSubId(), checkManage.getHazardIds());
+                    if (HttpStatus.SUCCESS == result.getCode()) {
                         result.getData();
                         List<CheckHazardInfoVo> checkHazardInfoVoList = JSON.parseArray(JSON.toJSONString(result.getData()), CheckHazardInfoVo.class);
-                        if(checkHazardInfoVoList == null || checkHazardInfoVoList.isEmpty()){
+                        if (checkHazardInfoVoList == null || checkHazardInfoVoList.isEmpty()) {
                             return;
                         }
                         checkManage.setCheckHazardInfo(JSON.toJSONString(result.getData()));
@@ -695,10 +696,10 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             //if(StringUtils.isNotBlank(a.getSafeUserId())){
             //    userIds.append(a.getSafeUserId()).append(",");
             //}
-            if(StringUtils.isNotBlank(a.getSafeUserPhone())){
+            if (StringUtils.isNotBlank(a.getSafeUserPhone())) {
                 phones.append(a.getSafeUserPhone()).append(",");
             }
-            if(StringUtils.isNotBlank(a.getAdminPhone())){
+            if (StringUtils.isNotBlank(a.getAdminPhone())) {
                 phones.append(a.getAdminPhone()).append(",");
             }
         });
@@ -706,20 +707,20 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         NoticeSendDto noticeSendDto = new NoticeSendDto();
         noticeSendDto.setNoticeType(1);
         noticeSendDto.setCheckType(checkManageBo.getCheckType());
-        if(StringUtils.isNotBlank(subIds)){
-            if(StringUtils.isNotEmpty(userIds)){
+        if (StringUtils.isNotBlank(subIds)) {
+            if (StringUtils.isNotEmpty(userIds)) {
                 String userIdStr = userIds.substring(0, userIds.length() - 1);
                 noticeSendDto.setUserIds(userIdStr);
             }
         }
-        if(StringUtils.isNotBlank(phones)){
+        if (StringUtils.isNotBlank(phones)) {
             String phoneStr = phones.substring(0, phones.length() - 1);
             noticeSendDto.setPhoneStr(phoneStr);
         }
         noticeConfigService.sendMsg(noticeSendDto);
         //发送通知
         if (saveBatch(checkManageList)) {
-            checkManageList.forEach(checkManage->{
+            checkManageList.forEach(checkManage -> {
                 if (checkManageBo.getCheckHazardDtoList() != null && checkManageBo.getCheckHazardDtoList().size() > 0) {
                     CheckHazardBo checkHazardBo = new CheckHazardBo();
                     checkHazardBo.setCheckManageId(checkManage.getId());
@@ -762,13 +763,13 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             noticeSendDto.setNoticeType(2);
             noticeSendDto.setCheckType(checkManageBo.getCheckType());
             //这里根据实验室id查询对应的整改人员列表
-            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper <CheckStaffUser>()
-                    .eq(CheckStaffUser::getStaffType,2).eq(CheckStaffUser::getSubId,checkManage.getSubId()));
+            List<CheckStaffUser> checkStaffUserList = checkStaffUserService.list(new LambdaQueryWrapper<CheckStaffUser>()
+                    .eq(CheckStaffUser::getStaffType, 2).eq(CheckStaffUser::getSubId, checkManage.getSubId()));
             StringBuilder stringBuffer = new StringBuilder();
-            for(CheckStaffUser checkStaffUser:checkStaffUserList){
+            for (CheckStaffUser checkStaffUser : checkStaffUserList) {
                 stringBuffer.append(",").append(checkStaffUser.getUserId());
             }
-            if(stringBuffer.length()>0){
+            if (stringBuffer.length() > 0) {
                 noticeSendDto.setRectifyNum(checkManageBo.getCheckHazardDtoList().size());
                 noticeSendDto.setUserIds(stringBuffer.substring(1));
                 noticeConfigService.sendMsg(noticeSendDto);
@@ -782,10 +783,10 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         //默认计划进行中
         Integer checkStatus = 2;
         //最后一个已检查 && 符合
-        if (checkManage.getManageStatus() == 2 && checkManage.getCheckResult() == 1){
+        if (checkManage.getManageStatus() == 2 && checkManage.getCheckResult() == 1) {
             List<CheckManage> list = list(new LambdaQueryWrapper<CheckManage>().eq(CheckManage::getCheckPlanId, checkManage.getCheckPlanId()));
             List<CheckManage> collect = list.stream().filter(i -> i.getManageStatus() != 2).collect(Collectors.toList());
-            if (collect.size() == 0){
+            if (collect.size() == 0) {
                 List<Long> manageIdList = list.stream().map(CheckManage::getId).collect(Collectors.toList());
                 long count = checkHazardService.count(new LambdaQueryWrapper<CheckHazard>().in(CheckHazard::getCheckManageId, manageIdList)
                         .and(i -> i.eq(CheckHazard::getRectifyStatus, 2).or().eq(CheckHazard::getRectifyStatus, 3)));
@@ -799,14 +800,14 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
         //院校巡查 实验室自查 修改巡查计划 检查进度
         long toBeCheckCount = count(new LambdaQueryWrapper<CheckManage>().eq(CheckManage::getCheckPlanId, checkManage.getCheckPlanId())
                 .eq(CheckManage::getManageStatus, 0));
-        if (toBeCheckCount>0) {
+        if (toBeCheckCount > 0) {
             checkSchedule.append("待检查").append(toBeCheckCount);
         }
         long checkingCount = count(new LambdaQueryWrapper<CheckManage>().eq(CheckManage::getCheckPlanId, checkManage.getCheckPlanId())
                 .eq(CheckManage::getManageStatus, 1));
         if (checkSchedule.length() > 0 && checkingCount > 0) {
             checkSchedule.append("/检查中").append(checkingCount);
-        } else if (checkSchedule.length() == 0 && checkingCount > 0){
+        } else if (checkSchedule.length() == 0 && checkingCount > 0) {
             checkSchedule.append("检查中").append(checkingCount);
         }
         long alreadyCheckCount = count(new LambdaQueryWrapper<CheckManage>().eq(CheckManage::getCheckPlanId, checkManage.getCheckPlanId())
@@ -817,38 +818,38 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
             checkSchedule.append("已检查").append(alreadyCheckCount);
         }
         checkPlanService.update(new LambdaUpdateWrapper<CheckPlan>().eq(CheckPlan::getId, checkManage.getCheckPlanId())
-                .set(CheckPlan::getCheckSchedule,checkSchedule.toString()).set(CheckPlan::getCheckStatus,checkStatus));
+                .set(CheckPlan::getCheckSchedule, checkSchedule.toString()).set(CheckPlan::getCheckStatus, checkStatus));
     }
 
     @Override
     public CheckManageVo findCheckManage(Long id) {
         CheckManageVo checkManageVo = new CheckManageVo();
         CheckManage checkManage = baseMapper.selectById(id);
-        BeanUtils.copyProperties(checkManage,checkManageVo);
+        BeanUtils.copyProperties(checkManage, checkManageVo);
         CheckHazardBo checkHazardBo = new CheckHazardBo();
         checkHazardBo.setCheckManageId(checkManage.getId());
         checkHazardBo.setSubId(checkManage.getSubId());
-        if(checkManage.getCheckCategory() == 1){
+        if (checkManage.getCheckCategory() == 1) {
             List<CheckHazardDto> checkHazardVos = checkHazardService.checkHazardListNoPage(checkHazardBo);
             checkManageVo.setCheckHazardDtoList(checkHazardVos);
-        }else {
+        } else {
             String checkHazardInfo = checkManage.getCheckHazardInfo();
             List<CheckHazardInfoVo> checkHazardInfoVoList = JSON.parseArray(checkHazardInfo, CheckHazardInfoVo.class);
-            LinkedHashMap<Long,List <CheckHazardDto>> linkedHashMaps = checkHazardService.checkHazardSpecialNoPage(checkHazardBo);
+            LinkedHashMap<Long, List<CheckHazardDto>> linkedHashMaps = checkHazardService.checkHazardSpecialNoPage(checkHazardBo);
 
-            if(linkedHashMaps.size() > 0){
+            if (linkedHashMaps.size() > 0) {
                 for (CheckHazardInfoVo hazardInfoVo : checkHazardInfoVoList) {
                     hazardInfoVo.setCheckHazardDtoList(linkedHashMaps.get(hazardInfoVo.getJoinHazardId()));
                 }
-            }else {
+            } else {
                 String hazardIds = checkManage.getHazardIds();
                 CheckDeviceBo checkDeviceBo = new CheckDeviceBo();
-                checkDeviceBo.setHazardIds(Convert.toList(Long.class,hazardIds.split(",")));
+                checkDeviceBo.setHazardIds(Convert.toList(Long.class, hazardIds.split(",")));
                 LinkedHashMap<Long, List<CheckOptionVo>> map = checkDeviceService.findByList(checkDeviceBo);
                 for (CheckHazardInfoVo hazardInfoVo : checkHazardInfoVoList) {
                     List<CheckHazardDto> list = new ArrayList<>();
                     List<CheckOptionVo> checkOptionVos = map.get(hazardInfoVo.getHazardId());
-                    if(StringUtils.isNotNull(checkOptionVos)){
+                    if (StringUtils.isNotNull(checkOptionVos)) {
                         for (CheckOptionVo checkOptionVo : checkOptionVos) {
                             CheckHazardDto checkHazardDto1 = new CheckHazardDto();
                             checkHazardDto1.setCode(checkOptionVo.getCode());
@@ -860,7 +861,7 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
                             checkHazardDto1.setHazardCheckCount(0);
                             list.add(checkHazardDto1);
                         }
-                    }else{
+                    } else {
                         CheckHazardDto checkHazardDto1 = new CheckHazardDto();
                         checkHazardDto1.setCheckCategory(checkManage.getCheckCategory());
                         checkHazardDto1.setHazardCheckCount(0);
@@ -887,11 +888,12 @@ public class CheckManageServiceImpl extends ServiceImpl<CheckManageMapper, Check
 
     /**
      * 逾期定时任务
+     *
      * @Return void
      **/
     @Scheduled(cron = "0 0 0 * * ?")
     public void overdueTimedTaskByManage() {
-        update(new LambdaUpdateWrapper<CheckManage>().ne(CheckManage::getManageStatus,2).lt(CheckManage::getCycleEndTime,LocalDate.now()).set(CheckManage::getIsOverdue,1));
+        update(new LambdaUpdateWrapper<CheckManage>().ne(CheckManage::getManageStatus, 2).lt(CheckManage::getCycleEndTime, LocalDate.now()).set(CheckManage::getIsOverdue, 1));
     }
 
 }