Эх сурвалжийг харах

Merge branch 'V0.0.5' of http://10.87.21.221:8000/jzyd_yyds/soc into V0.0.5

jiawuxian 1 жил өмнө
parent
commit
5303a3c84b
28 өөрчлөгдсөн 384 нэмэгдсэн , 134 устгасан
  1. 9 1
      project_data/sql/0.0.5/soc/soc.sql
  2. 3 0
      soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SafeCheckTaskRegisterBookVo.java
  3. 1 1
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/Constants.java
  4. 3 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/mapper/TMonitoringRetrievalPlanMapper.java
  5. 21 4
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java
  6. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/controller/CoreDrillDictionaryController.java
  7. 6 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateTaskMapper.java
  8. 27 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluatePlanServiceImpl.java
  9. 1 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanListVO.java
  10. 4 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanVO.java
  11. 2 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/controller/CoreMessageCenterController.java
  12. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/mapper/CoreMessageCenterMapper.java
  13. 44 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/service/impl/CoreMessageCenterServiceImpl.java
  14. 9 7
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/message/mapper/CoreAnnouncementNotificationMapper.java
  15. 7 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/panel/service/impl/PanelServiceImpl.java
  16. 3 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/mapper/CoreMonitoringRetrievalTaskMapper.java
  17. 29 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/ICoreMonitoringRetrievalTaskBuilderService.java
  18. 10 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskBuilderServiceImpl.java
  19. 7 14
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java
  20. 6 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafeLevelServiceImpl.java
  21. 17 7
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleServiceImpl.java
  22. 15 0
      soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateTaskMapper.xml
  23. 1 1
      soc-modules/soc-modules-core/src/main/resources/mapper/information/CoreMessageCenterMapper.xml
  24. 38 1
      soc-modules/soc-modules-core/src/main/resources/mapper/message/CoreAnnouncementNotificationMapper.xml
  25. 26 0
      soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml
  26. 3 2
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java
  27. 80 69
      soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java
  28. 10 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java

+ 9 - 1
project_data/sql/0.0.5/soc/soc.sql

@@ -146,4 +146,12 @@ INSERT INTO `sys_dict_data` ( `dict_sort`, `dict_label`, `dict_value`, `dict_typ
 DELETE from sys_dict_data where dict_type='sign_level' and dict_label='其他' limit 1;
 INSERT INTO  `sys_dict_data`( `dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (0, '其他', '3', 'sign_level', NULL, 'default', 'N', '0', null, NOW(), null
                                                                                                                                                                                                                 , NOW(), NULL);
-
+-- 增加演练范本详情菜单权限
+set @id =  ( SELECT id FROM `sys_menu` where menu_name='演练范本详情' and perms='core:drillDictionary:query');
+DELETE from sys_role_menu where menu_id=@id;
+insert into sys_role_menu select DISTINCT id,@id from sys_role;
+-- 仅仅给超级管理员用,标记为删除状态,通过脚本维护了一条管理员与角色的关联数据,防止首页等依赖于登录用户角色信息的页面查询报错
+DELETE FROM `sys_role` WHERE `role_name`='超级管理员';
+INSERT INTO `sys_role` (`org_type`, `role_name`, `role_key`, `role_sort`, `data_scope`, `menu_check_strictly`, `dept_check_strictly`, `status`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('1', '超级管理员', 'default', 0, 1, 1, 1, '0', 2, '超级管理员', '2023-12-07 17:14:07', '', NULL, '仅仅给超级管理员用,标记为删除状态,通过脚本维护了一条管理员与角色的关联数据,防止首页等依赖于登录用户角色信息的页面查询报错');
+DELETE FROM `sys_user_role` WHERE `role_id` = (SELECT id FROM `sys_role` WHERE `role_name`='超级管理员')
+INSERT INTO `sys_user_role` (`user_id`, `role_id`, `create_by`, `create_time`, `update_by`, `update_time`) SELECT 1 as `user_id`, id as `role_id`, '超级管理员' as `create_by`, '2023-09-17 19:57:06' as `create_time`, NULL, NULL  FROM `sys_role` WHERE `role_name`='超级管理员';

+ 3 - 0
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SafeCheckTaskRegisterBookVo.java

@@ -33,6 +33,9 @@ public class SafeCheckTaskRegisterBookVo {
   @ApiModelProperty("受检机构名称")
   private String orgName;
 
+  @ApiModelProperty(value = "受检机构")
+  private String orgPath;
+
   @ApiModelProperty("受检日期 eg: 2000年1月2日")
   private String dateStr;
 

+ 1 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/constant/Constants.java

@@ -158,5 +158,5 @@ public class Constants {
 
     public static final String HMS_FORMAT = "yyyy-MM-dd HH:mm:ss";
 
-    public static final String HM_FORMAT = "yyyyMMddHHmm";
+    public static final String HM_FORMAT = "yyyyMMddHHmmss";
 }

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/mapper/TMonitoringRetrievalPlanMapper.java

@@ -88,6 +88,8 @@ public interface TMonitoringRetrievalPlanMapper extends BaseMapper<TMonitoringRe
      * @return 结果
      */
     int deleteTMonitoringRetrievalPlanByIds(Long[] ids);
-  List<AccessDataVo>   selectPointByTask(Long taskId);
+
+    List<AccessDataVo> selectPointByTask(Long taskId);
+
     AccessPdfVO selectTask(Long taskId);
 }

+ 21 - 4
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java

@@ -90,6 +90,8 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
     private RemoteFileService fileService;
     @Autowired
     private CoreMonitoringRetrievalTaskMapper coreMonitoringRetrievalTaskMapper;
+    @Autowired
+    private ICoreRegisterBookPdfService iCoreRegisterBookPdfService;
 
     @Override
     public TableDataInfo selectPage(TMonitoringRetrievalPlan tMonitoringRetrievalPlan) {
@@ -170,8 +172,8 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectAllTaskByPlanId(collect, status);
         if (CollectionUtils.isNotEmpty(coreMonitoringRetrievalTasks)) {
             isComplete = true;
-        }else {
-            isComplete=false;
+        } else {
+            isComplete = false;
         }
         if (plan.getPlanStatus() == 0) {
             isComplete = false;
@@ -858,13 +860,27 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
             }
             if ("1".equals(monitoringRetrievalPlan.getPlanCycle())) {
                 LocalDate currentDate = LocalDate.now();
+                //为了删除PDF查询要删除的任务id
+                List<Long> longs = coreMonitoringRetrievalTaskBuilderService.selectTaskByToday(id, currentDate.toString());
+                if (CollectionUtils.isNotEmpty(longs)){
+                    longs.forEach(l->{
+                        iCoreRegisterBookPdfService.deleteWithFile(l);
+                    });
+                }
+
                 coreMonitoringRetrievalTaskBuilderService.deleteTaskByToday(id, currentDate.toString());
             } else {
                 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
                 String format = simpleDateFormat.format(new Date());
+                //为了删除PDF查询要删除的任务id
+                List<Long> longs = coreMonitoringRetrievalTaskBuilderService.selectTaskByStartTime(id, format);
+                if (CollectionUtils.isNotEmpty(longs)){
+                    longs.forEach(l->{
+                        iCoreRegisterBookPdfService.deleteWithFile(l);
+                    });
+                }
                 coreMonitoringRetrievalTaskBuilderService.deleteTaskByStartTime(id, format);
             }
-
         }
         return i;
     }
@@ -912,6 +928,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         //  registerBookPdf.setId(appSafetyCheckTask.getId());
         registerBookPdf.setRegisterBookType(RegisterBookType.MONITOR_ACCESS.getNum());
         registerBookPdf.setDate(new Date());
+        registerBookPdf.setId(accessPdfVO.getTaskId());
         SysOrg org = remoteOrgService.selectSysOrgById(accessPdf.getOrgId(), SecurityConstants.INNER);
         registerBookPdf.setOrgId(org.getId());
         registerBookPdf.setOrgPath(org.getPath());
@@ -953,7 +970,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
             dataVos.add(v);
         }
         accessPdf.setDataVos(dataVos);
-        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.MONITOR_ACCESS,accessPdfVO.getOrgName());
+        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.MONITOR_ACCESS, accessPdfVO.getOrgName());
         accessPdf.setDest(fileName);
         return accessPdf;
     }

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/controller/CoreDrillDictionaryController.java

@@ -47,7 +47,7 @@ public class CoreDrillDictionaryController extends BaseController {
      * 获取预案演练库详细信息
      */
     @ApiOperation(value = "获取CoreDrillDictionary详细信息")
-    @RequiresPermissions("core:drillDictionary:edit")
+    @RequiresPermissions("core:drillDictionary:query")
     @GetMapping(value = "/{id}")
     public AjaxResult getInfo(@PathVariable("id") Long id) {
         return success(coreDrillDictionaryService.selectCoreDrillDictionaryById(id));

+ 6 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/mapper/CoreEvaluateTaskMapper.java

@@ -34,6 +34,12 @@ public interface CoreEvaluateTaskMapper extends BaseMapper<CoreEvaluateTask> {
     CoreEvaluateTask selectCoreEvaluateTaskById(Long id);
 
     /**
+     * 根据计划id查询对应任务
+     * @param
+     * @return
+     */
+    List<CoreEvaluateTask>selectTaskByPlanIdAndStatus(@Param("planId") Long planId,@Param("statusList") String[]statusList);
+    /**
      * 查询外包评价任务列表
      *
      * @param coreEvaluateTask 外包评价任务
@@ -81,7 +87,6 @@ public interface CoreEvaluateTaskMapper extends BaseMapper<CoreEvaluateTask> {
 
     Page<Map> statistics(@Param("page") Page<Map> page, @Param("request") EvaluateTaskStatisticsDTO request);
 
-    //List<LinkedHashMap> statisticsAll(@Param("request") EvaluateTaskStatisticsDTO request);
     LinkedHashMap statisticsAll(@Param("request") EvaluateTaskStatisticsDTO request);
 
     List<Map> getContentByTaskId(@Param("id") Long id, @Param("startTime") Date startTime, @Param("endTime") Date endTime);

+ 27 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/service/impl/CoreEvaluatePlanServiceImpl.java

@@ -16,10 +16,7 @@ import com.xunmei.core.evaluate.domain.*;
 import com.xunmei.core.evaluate.dto.CoreEvaluatePlanDTO;
 import com.xunmei.core.evaluate.dto.EvaluateQueryDTO;
 import com.xunmei.core.evaluate.dto.EvaluateTaskStatisticsDTO;
-import com.xunmei.core.evaluate.mapper.CoreEvaluateContentMapper;
-import com.xunmei.core.evaluate.mapper.CoreEvaluatePlanContentMapper;
-import com.xunmei.core.evaluate.mapper.CoreEvaluatePlanMapper;
-import com.xunmei.core.evaluate.mapper.CoreEvaluateRoleMapper;
+import com.xunmei.core.evaluate.mapper.*;
 import com.xunmei.core.evaluate.service.ICoreEvaluatePlanService;
 import com.xunmei.core.evaluate.service.ICoreEvaluateTaskService;
 import com.xunmei.core.evaluate.vo.CoreEvaluatePlanListVO;
@@ -67,6 +64,8 @@ public class CoreEvaluatePlanServiceImpl extends ServiceImpl<CoreEvaluatePlanMap
     private ICoreEvaluateTaskService coreEvaluateTaskService;
     @Resource
     private RemoteRoleService remoteRoleService;
+    @Autowired
+    private CoreEvaluateTaskMapper coreEvaluateTaskMapper;
 
     /**
      * 查询外包评价计划
@@ -83,6 +82,20 @@ public class CoreEvaluatePlanServiceImpl extends ServiceImpl<CoreEvaluatePlanMap
         coreEvaluatePlanVO.setRoleIds(roleList);
         List<CoreEvaluateContent> byEvaluateId = coreEvaluateContentMapper.getByEvaluateId(id);
         coreEvaluatePlanVO.setCoreEvaluateContentList(byEvaluateId);
+        //是否有已完成的任务
+        String[] status = {"2"};
+        List<CoreEvaluateTask> coreEvaluateTasks = coreEvaluateTaskMapper.selectTaskByPlanIdAndStatus(id, status);
+        coreEvaluatePlanVO.setIsComplete(false);
+        if (CollectionUtils.isNotEmpty(coreEvaluateTasks)) {
+            coreEvaluatePlanVO.setIsComplete(true);
+        }
+        //是否有任务
+        String[] status1 = {"0","1","2"};
+        List<CoreEvaluateTask> coreEvaluateTasks1 = coreEvaluateTaskMapper.selectTaskByPlanIdAndStatus(id, status1);
+        coreEvaluatePlanVO.setIsHaveTask(false);
+        if (CollectionUtils.isNotEmpty(coreEvaluateTasks1)){
+            coreEvaluatePlanVO.setIsHaveTask(true);
+        }
         return coreEvaluatePlanVO;
     }
 
@@ -240,11 +253,12 @@ public class CoreEvaluatePlanServiceImpl extends ServiceImpl<CoreEvaluatePlanMap
             coreEvaluatePlanContent.setEvaluateId(coreEvaluatePlanDTO.getId());
             coreEvaluatePlanContentMapper.insert(coreEvaluatePlanContent);
         });
+        //
         return i;
     }
 
     @Override
-    public int distribute(Long id,Boolean immediateEffect) {
+    public int distribute(Long id, Boolean immediateEffect) {
         CoreEvaluatePlanVO coreEvaluatePlanVO = this.selectCoreEvaluatePlanById(id);
         CoreEvaluatePlan coreEvaluatePlan = baseMapper.selectById(id);
         coreEvaluatePlan.setBuildTaskNow(immediateEffect);
@@ -398,6 +412,14 @@ public class CoreEvaluatePlanServiceImpl extends ServiceImpl<CoreEvaluatePlanMap
             evaluateQueryDTO.setOrgId(null);
         }
         page = coreEvaluatePlanMapper.selectPageList(page, evaluateQueryDTO);
+        page.getRecords().forEach(p -> {
+            String[] status = {"2"};
+            List<CoreEvaluateTask> coreEvaluateTasks = coreEvaluateTaskMapper.selectTaskByPlanIdAndStatus(p.getId(), status);
+            p.setIsComplete(false);
+            if (CollectionUtils.isNotEmpty(coreEvaluateTasks)) {
+                p.setIsComplete(true);
+            }
+        });
         //抓换为TableDataInfo适配前端
         return TableDataInfo.build(page);
     }

+ 1 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanListVO.java

@@ -56,4 +56,5 @@ public class CoreEvaluatePlanListVO {
 
     @ApiModelProperty(value = "状态")
     private String status;
+    private Boolean isComplete;
 }

+ 4 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/evaluate/vo/CoreEvaluatePlanVO.java

@@ -14,6 +14,7 @@ import java.util.List;
 public class CoreEvaluatePlanVO {
     private Long id;
     private Boolean buildTaskNow;
+    private String status;
     /**
      * 外包评价名称
      */
@@ -42,5 +43,7 @@ public class CoreEvaluatePlanVO {
     private String evaluateCycle;
     @ApiModelProperty(value = "内容")
     private List<CoreEvaluateContent> coreEvaluateContentList;
-
+    private Boolean isComplete;
+    private Boolean isHaveTask;
+    private String isDistribute;
 }

+ 2 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/controller/CoreMessageCenterController.java

@@ -44,8 +44,8 @@ public class CoreMessageCenterController extends BaseController {
     }
 
     @ApiOperation(value = "查询消息列表是否有未读")
-    @GetMapping("/isRead")
-    public AjaxResult isRead() {
+    @GetMapping("/haveRead")
+    public AjaxResult haveRead() {
         return success(coreMessageCenterService.isRead());
     }
 

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/mapper/CoreMessageCenterMapper.java

@@ -23,7 +23,7 @@ import java.util.List;
 public interface CoreMessageCenterMapper extends BaseMapper<CoreMessageCenter> {
 
     Page<CoreMessageCenterVO> selectByPage(Page<CoreMessageCenter> page, @Param("request") CoreMessageCenterDTO request);
-    Integer selectNoRead();
+    Integer selectNoRead(Long userId);
     /**
      * 查询消息中心
      *

+ 44 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/service/impl/CoreMessageCenterServiceImpl.java

@@ -1,23 +1,36 @@
 package com.xunmei.core.information.service.impl;
 
 
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.nacos.common.utils.CollectionUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.xunmei.common.core.constant.SecurityConstants;
+import com.xunmei.common.core.domain.message.vo.MessageAppPageVo;
 import com.xunmei.common.core.domain.retrieval.domain.CoreMonitoringRetrievalTask;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.information.domain.CoreMessageCenter;
 import com.xunmei.core.information.dto.CoreMessageCenterDTO;
 import com.xunmei.core.information.mapper.CoreMessageCenterMapper;
 import com.xunmei.core.information.service.ICoreMessageCenterService;
 import com.xunmei.core.information.vo.CoreMessageCenterVO;
 import com.xunmei.core.message.mapper.CoreAnnouncementNotificationMapper;
+import com.xunmei.system.api.RemoteOrgService;
+import com.xunmei.system.api.RemoteRoleService;
+import com.xunmei.system.api.RemoteUserService;
+import com.xunmei.system.api.domain.SysOrg;
+import com.xunmei.system.api.domain.SysRole;
+import com.xunmei.system.api.model.LoginUser;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 消息中心Service业务层处理
@@ -29,8 +42,15 @@ import java.util.List;
 public class CoreMessageCenterServiceImpl extends ServiceImpl<CoreMessageCenterMapper, CoreMessageCenter> implements ICoreMessageCenterService {
     @Autowired
     private CoreMessageCenterMapper coreMessageCenterMapper;
-@Autowired
-private CoreAnnouncementNotificationMapper coreAnnouncementNotificationMapper;
+    @Autowired
+    private CoreAnnouncementNotificationMapper coreAnnouncementNotificationMapper;
+    @Resource
+    private RemoteOrgService remoteOrgService;
+    @Autowired
+    private RemoteUserService remoteUserService;
+    @Autowired
+    private RemoteRoleService remoteRoleService;
+
     /**
      * 查询消息中心
      *
@@ -73,9 +93,28 @@ private CoreAnnouncementNotificationMapper coreAnnouncementNotificationMapper;
 
     @Override
     public Boolean isRead() {
-        Integer integer1 = baseMapper.selectNoRead();
-        Integer integer = coreAnnouncementNotificationMapper.selectNoRead();
-        if (integer+integer1==0){
+        Long userId = SecurityUtils.getUserId();
+        Integer integer1 = baseMapper.selectNoRead(userId);
+        //通知
+        LoginUser loginUser = SecurityUtils.getLoginUser();
+        SysOrg sysOrg = remoteOrgService.selectSysOrgById(loginUser.getOrgId(), SecurityConstants.INNER);
+        List<SysRole> roleByUserId = remoteRoleService.getRoleByUserId(loginUser.getUserid(), SecurityConstants.INNER);
+        List<Long> collect = roleByUserId.stream().map(SysRole::getId).collect(Collectors.toList());
+        Long[] roles;
+        if (CollectionUtils.isNotEmpty(collect)) {
+            roles = collect.toArray(new Long[collect.size()]);
+        } else {
+            roles = null;
+        }
+        //通知
+        List<MessageAppPageVo> messageAppPageVos = coreAnnouncementNotificationMapper.selectAll(loginUser.getOrgId(), roles);
+        List<Long> longs = coreAnnouncementNotificationMapper.selectReadByUser(loginUser.getUserid());
+        List<Long> collect1 = messageAppPageVos.stream().map(MessageAppPageVo::getId).collect(Collectors.toList());
+        Integer i = 0;
+        if (CollectionUtils.isNotEmpty(collect1) && CollectionUtils.isNotEmpty(longs) && longs.size() != collect1.size()) {
+            i = 1;
+        }
+        if (i + integer1 == 0) {
             return false;
         }
         return true;

+ 9 - 7
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/message/mapper/CoreAnnouncementNotificationMapper.java

@@ -74,24 +74,26 @@ public interface CoreAnnouncementNotificationMapper extends BaseMapper<CoreAnnou
 
     void insertBatchToRole(@Param("list") List<CoreAnnouncementNotificationToRole> list);
 
-    Page<CoreAnnouncementNotificationPageVo> selectPageList( @Param("page") Page<CoreAnnouncementNotificationPageVo> page,  @Param("request")CoreAnnouncementNotificationPageDto request);
+    Page<CoreAnnouncementNotificationPageVo> selectPageList(@Param("page") Page<CoreAnnouncementNotificationPageVo> page, @Param("request") CoreAnnouncementNotificationPageDto request);
 
     List<CoreAnnouncementNotificationToOrg> selectOrgIds(@Param("records") List<CoreAnnouncementNotificationPageVo> records);
 
     List<CoreAnnouncementNotificationToRole> selectRoleIds(@Param("records") List<CoreAnnouncementNotificationPageVo> records);
 
     void deleteRole(@Param("notificationId") Long notificationId);
-    void deleteOrg(@Param("notificationId") Long id);
-
-    void deleteNotificationToUsers(@Param("notificationId")  Long notificationId);
 
-    Page<MessageAppPageVo> selectAppPage(@Param("page")Page<MessageAppPageVo> page, @Param("request")CoreAnnouncementNotificationAppPageDto request);
+    void deleteOrg(@Param("notificationId") Long id);
 
-    List<CoreAnnouncementNotificationToUser> selectNotificationToUsers(@Param("request")CoreAnnouncementNotificationAppPageDto request, @Param("records")List<MessageAppPageVo> records);
+    void deleteNotificationToUsers(@Param("notificationId") Long notificationId);
+List<MessageAppPageVo> selectAll(@Param("orgId") Long orgId,@Param("roles") Long[]roles);
+    Page<MessageAppPageVo> selectAppPage(@Param("page") Page<MessageAppPageVo> page, @Param("request") CoreAnnouncementNotificationAppPageDto request);
+List<Long> selectReadByUser(Long userId);
+    List<CoreAnnouncementNotificationToUser> selectNotificationToUsers(@Param("request") CoreAnnouncementNotificationAppPageDto request, @Param("records") List<MessageAppPageVo> records);
 
     CoreAnnouncementNotificationToUser checkIsRead(@Param("request") CoreAnnouncementNotificationAppPageDto request);
 
     void insertNotificationUser(@Param("notificationUser") CoreAnnouncementNotificationToUser notificationUser);
-Integer selectNoRead();
 
+    Integer selectNoRead(Long userId);
+List<Long> selectAllTongZhi(@Param("orgId") Long orgId,@Param("orgType") Integer orgType,@Param("roles") Long[]roles);
 }

+ 7 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/panel/service/impl/PanelServiceImpl.java

@@ -99,14 +99,16 @@ public class PanelServiceImpl implements PanelService {
 
     @Override
     public List<PanelResultVo> selectPage() throws ExecutionException, InterruptedException, TimeoutException {
-        Long userId=SecurityUtils.getUserId();
+        Long userId = SecurityUtils.getUserId();
         List<Long> roles = RemoteCallHandlerExecutor.executeRemoteCall(
                 () -> roleService.getUserRoleId(userId, SecurityConstants.FROM_SOURCE),
                 ErrorMsgConstants.QUERY_USER_ROLE_ERROR);
 
         PanelListDto panelListDto = PanelAdapter.getMapperSelectParam(SecurityUtils.getLoginUser().getOrgId(),
                 roles, userId);
-
+        if (ObjectUtil.isEmpty(panelListDto.getRoleIdList())) {
+            return new ArrayList<>();
+        }
 
         //履职任务
         CompletableFuture<List<PanelListVo>> resumptionTaskFuture = CompletableFuture.supplyAsync(() ->
@@ -203,6 +205,9 @@ public class PanelServiceImpl implements PanelService {
         PanelListDto req = PanelAdapter.getMapperSelectParam(SecurityUtils.getLoginUser().getOrgId(),
                 roles, SecurityUtils.getUserId());
         req.setPermList(permList);
+        if (ObjectUtil.isEmpty(req.getRoleIdList()) || ObjectUtil.isEmpty(permList)) {
+            return new ArrayList<>();
+        }
         List<CompletableFuture<WebPanelResult>> list = new ArrayList<>();
         //教育培训
         CompletableFuture<WebPanelResult> eduTrainingTaskFuture = CompletableFuture.supplyAsync(() ->

+ 3 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/mapper/CoreMonitoringRetrievalTaskMapper.java

@@ -110,7 +110,7 @@ public interface CoreMonitoringRetrievalTaskMapper extends BaseMapper<CoreMonito
     void deleteAllTaskByPlanId(@Param("planId") Long planId);
 
     void deleteTaskByStartTime(@Param("planId") Long planId, @Param("endTime") String endTime);
-
+ List<Long>   selectTaskByStartTime(@Param("planId") Long planId, @Param("endTime") String endTime);
     void deleteAllTaskByPlanIds(@Param("planIds") Long[] planIds);
 
     void deleteDayTaskByTime(@Param("planId") Long planId, @Param("cycle") String cycle, @Param("startTime") Date startTime, @Param("endTime") Date endTime);
@@ -119,6 +119,8 @@ public interface CoreMonitoringRetrievalTaskMapper extends BaseMapper<CoreMonito
 
     void deleteTaskByToday(@Param("planId") Long planId, @Param("day") String day);
 
+    List<Long> selectTaskByToday(@Param("planId") Long planId, @Param("day") String day);
+
     /**
      * 删除周任务
      *

+ 29 - 6
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/ICoreMonitoringRetrievalTaskBuilderService.java

@@ -116,12 +116,35 @@ public interface ICoreMonitoringRetrievalTaskBuilderService extends IService<Cor
      * @param planId
      */
     void deleteAllTaskByPlanId(Long planId);
-    //删除今天之后的任务
-void  deleteTaskByStartTime(Long planId,String startTime);
-void  deleteTaskByToday(Long planId,String day);
+
+    //删除结束时间今天之后的任务
+    void deleteTaskByStartTime(Long planId, String startTime);
+
+    /**
+     * 查询结束时间是当前之后的任务
+     * @param planId
+     * @param startTime
+     * @return
+     */
+    List<Long>selectTaskByStartTime(Long planId, String startTime);
+
+    /**
+     * 删除今天的任务
+     * @param planId
+     * @param day
+     */
+    void deleteTaskByToday(Long planId, String day);
+
+    /**
+     * 查询今天的任务
+     * @param planId
+     * @param day
+     * @return
+     */
+    List<Long>selectTaskByToday(Long planId, String day);
+
     void deleteAllTaskByPlanIds(List<Long> planId);
 
-//    List<CoreMonitoringRetrievalTask> selectAllTaskByPlanId(List<Long> planId,List<String>status);
 
     /**
      * 删除日任务
@@ -140,6 +163,6 @@ void  deleteTaskByToday(Long planId,String day);
 
     void updateDeleteTaskByPlanId(Long planId, Integer isDeleted);
 
-//    void selectMonitorExceptionData(List<Long> orgIds,DateTime time);
 
-    void taskChangeForTimeWorkChange(WorkTimeChangeEvent event);}
+    void taskChangeForTimeWorkChange(WorkTimeChangeEvent event);
+}

+ 10 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskBuilderServiceImpl.java

@@ -267,11 +267,21 @@ public class CoreMonitoringRetrievalTaskBuilderServiceImpl extends ServiceImpl<C
     }
 
     @Override
+    public List<Long> selectTaskByStartTime(Long planId, String startTime) {
+        return coreMonitoringRetrievalTaskMapper.selectTaskByStartTime(planId,startTime);
+    }
+
+    @Override
     public void deleteTaskByToday(Long planId, String day) {
         coreMonitoringRetrievalTaskMapper.deleteTaskByToday(planId,day);
     }
 
     @Override
+    public List<Long> selectTaskByToday(Long planId, String day) {
+        return coreMonitoringRetrievalTaskMapper.selectTaskByToday(planId,day);
+    }
+
+    @Override
     public void deleteAllTaskByPlanIds(List<Long> planId) {
         Long[] longs = planId.toArray(new Long[planId.size()]);
         //   coreMonitoringRetrievalTaskMapper.deleteAllTaskByPlanIds(longs);

+ 7 - 14
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/CoreSafecheckPlanServiceImpl.java

@@ -934,12 +934,9 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         registerBookPdf.setId(appSafetyCheckTask.getId());
         registerBookPdf.setRegisterBookType(RegisterBookType.SAFE_CHECK_REPORT.getNum());
         registerBookPdf.setDate(new Date());
-        SysOrg org = orgService.selectSysOrgById(registerBookVo.getOrgId(), SecurityConstants.INNER);
-        registerBookPdf.setOrgId(org.getId());
-        registerBookPdf.setOrgPath(org.getPath());
+        registerBookPdf.setOrgId(registerBookVo.getOrgId());
+        registerBookPdf.setOrgPath(registerBookVo.getOrgPath());
         registerBookPdf.setFileUrl(url);
-        //registerBookPdf.setFileName(StringUtils.substringAfterLast(url, "\\"));
-        //registerBookPdf.setFileName(StringUtils.substringAfterLast(url, File.separator));
         registerBookPdf.setFileName(registerBookVo.getDest());
         registerBookPdf.setOrgName(registerBookVo.getOrgName());
         if (StringUtils.isEmpty(url) || StringUtils.isEmpty(registerBookPdf.getFileName())) {
@@ -1005,7 +1002,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
 
     public SafeCheckTaskRegisterBookVo buildSafetyCheckRegisterBookData(CoreSafetyTask appSafetyCheckTask) {
         SafeCheckTaskRegisterBookVo registerBookVo = new SafeCheckTaskRegisterBookVo();
-        registerBookVo.setTaskTitle(appSafetyCheckTask.getTitle() + getRegisterBookCycleText(Math.toIntExact(appSafetyCheckTask.getCheckCycle()), appSafetyCheckTask.getSubmitTime()));
+        registerBookVo.setTaskTitle(appSafetyCheckTask.getTitle() /*+ getRegisterBookCycleText(Math.toIntExact(appSafetyCheckTask.getCheckCycle()), appSafetyCheckTask.getSubmitTime())*/);
         final SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
         String dateStr = format.format(appSafetyCheckTask.getSubmitTime());
         registerBookVo.setDateStr(dateStr);
@@ -1013,17 +1010,13 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
         registerBookVo.setCheckOrgName(appSafetyCheckTask.getCheckOrgName());
         registerBookVo.setOrgId(appSafetyCheckTask.getOrgId());
         registerBookVo.setOrgName(appSafetyCheckTask.getOrgName());
+        registerBookVo.setOrgPath(appSafetyCheckTask.getOrgPath());
         String checkUserInfo = appSafetyCheckTask.getSubmitBy();
         registerBookVo.setCheckUserInfo(checkUserInfo);
         registerBookVo.setCheckTeam(appSafetyCheckTask.getCheckTeam());
-        if (ObjectUtil.isNull(appSafetyCheckTask.getCheckType())) {
-            registerBookVo.setCheckTypeText(StringUtil.EMPTY_STRING);
-        } else {
-            registerBookVo.setCheckTypeText(DictUtils.getDictLabel(DictConstants.CHECK_TYPE, appSafetyCheckTask.getCheckType().intValue()));
-
-        }
+        final CoreSafecheckPlan plan = coreSafecheckPlanMapper.get(appSafetyCheckTask.getPlanId());
+        registerBookVo.setCheckTypeText(DictUtils.getDictLabel(DictConstants.CHECK_TYPE, plan.getCheckType().intValue()));
         List<CheckDataVo> pointCheckDataList = new ArrayList<>();
-
         List<AppTaskRegisterPointVo> appTaskRegisterPointVos = coreSafetyTaskMapper.selectPointByTask(appSafetyCheckTask.getId());
         for (AppTaskRegisterPointVo vo :
                 appTaskRegisterPointVos) {
@@ -1037,7 +1030,7 @@ public class CoreSafecheckPlanServiceImpl extends ServiceImpl<CoreSafecheckPlanM
 
         registerBookVo.setCheckDatas(pointCheckDataList);
 
-        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.SAFE_CHECK_REPORT,registerBookVo.getOrgName());
+        String fileName = registerBookPdfService.getPdfFileName(RegisterBookType.SAFE_CHECK_REPORT, registerBookVo.getOrgName());
         registerBookVo.setDest(fileName);
         return registerBookVo;
     }

+ 6 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafeLevelServiceImpl.java

@@ -87,6 +87,12 @@ public class CoreSafeLevelServiceImpl extends ServiceImpl<CoreSafeLevelMapper, C
      */
     @Override
     public int updateCoreSafeLevel(CoreSafeLevel coreSafeLevel) {
+        if (coreSafeLevel.getMaxValue().intValue() < 0 || coreSafeLevel.getMinValue().intValue() < 0) {
+            throw new RuntimeException("区间最大值或最小值不能小于0!");
+        }
+        if (ObjectUtil.equals(coreSafeLevel.getMaxValue(), coreSafeLevel.getMinValue())) {
+            throw new RuntimeException("区间最大值或最小值不能小于相等!");
+        }
         final List<CoreSafeLevel> list = coreSafeLevelMapper.selectList(null);
         list.removeIf(item -> ObjectUtil.equal(item.getId(), coreSafeLevel.getId()));
         for (CoreSafeLevel level : list) {

+ 17 - 7
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafetyIndexCalculateRuleServiceImpl.java

@@ -52,6 +52,7 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
     private ICoreSafetyIndexCalculateRuleItemService ruleItemService;
     @Autowired
     private CoreSafetyIndexCalculateRuleItemMapper ruleItemMapper;
+
     @Override
     public TableDataInfo<CoreSafetyIndexCalculateRulePageVo> selectPage(CoreSafetyIndexCalculateRulePageDto request) {
 
@@ -61,7 +62,7 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
         if (ObjectUtil.isEmpty(records)) {
             return TableDataInfo.build(page);
         }
-        Map<String, String> map =getCoreSafetyDictMap();
+        Map<String, String> map = getCoreSafetyDictMap();
         for (CoreSafetyIndexCalculateRulePageVo record : page.getRecords()) {
             //设置组织名称
             record.setOrgTypeText(OrgTypeEnum.getName(record.getOrgType()));
@@ -74,7 +75,7 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
         return TableDataInfo.build(page);
     }
 
-    private Map<String, String>  getCoreSafetyDictMap(){
+    private Map<String, String> getCoreSafetyDictMap() {
         List<CoreSafetyDict> dictList = safetyDictService.selectCoreSafetyDictList(null);
         return dictList.stream().collect(Collectors.toMap(CoreSafetyDict::getCode, CoreSafetyDict::getName));
     }
@@ -88,7 +89,7 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
     @Override
     public CoreSafetyIndexCalculateRuleDetailVo selectCoreSafetyIndexCalculateRuleById(Long id) {
         CoreSafetyIndexCalculateRule calculateRule = coreSafetyIndexCalculateRuleMapper.selectById(id);
-        if (calculateRule==null){
+        if (calculateRule == null) {
             throw new SystemException("安全指标配置不存在");
         }
         CoreSafetyIndexCalculateRuleDetailVo record = new CoreSafetyIndexCalculateRuleDetailVo();
@@ -101,7 +102,7 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
         List<CoreSafetyIndexCalculateRuleItem> list = ruleItemService.list(new LambdaQueryWrapper<CoreSafetyIndexCalculateRuleItem>()
                 .eq(CoreSafetyIndexCalculateRuleItem::getRuleId, id));
         List<CoreSafetyIndexCalculateRuleItemVo> properties = BeanHelper.copyProperties(list, CoreSafetyIndexCalculateRuleItemVo.class);
-        properties.forEach(r->{
+        properties.forEach(r -> {
             r.setCalculateTypeText(CalculateTypeEnums.getName(r.getCalculateType()));
         });
         record.setItemList(properties);
@@ -137,7 +138,7 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
         calculateRule.setId(IdWorker.getId());
         List<CoreSafetyIndexCalculateRuleItemInsertDto> itemList = coreSafetyIndexCalculateRule.getItemList();
         List<CoreSafetyIndexCalculateRuleItem> properties = BeanHelper.copyProperties(itemList, CoreSafetyIndexCalculateRuleItem.class);
-        properties.forEach(r->{
+        properties.forEach(r -> {
             r.setRuleId(calculateRule.getId());
             r.setCreateBy(SecurityUtils.getUserId().toString());
             r.setUpdateBy(SecurityUtils.getUserId().toString());
@@ -157,6 +158,9 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int updateCoreSafetyIndexCalculateRule(CoreSafetyIndexCalculateRuleUpdateDto request) {
+        if (request.getScore() < 0) {
+            throw new RuntimeException("分值不能小于0!");
+        }
         CoreSafetyIndexCalculateRule coreSafetyIndexCalculateRule = new CoreSafetyIndexCalculateRule();
         BeanUtils.copyProperties(request, coreSafetyIndexCalculateRule);
         coreSafetyIndexCalculateRule.setUpdateBy(SecurityUtils.getUserId().toString());
@@ -164,10 +168,16 @@ public class CoreSafetyIndexCalculateRuleServiceImpl extends ServiceImpl<CoreSaf
         ruleItemMapper.delete(new LambdaQueryWrapper<CoreSafetyIndexCalculateRuleItem>().eq(CoreSafetyIndexCalculateRuleItem::getRuleId, request.getId()));
         List<CoreSafetyIndexCalculateRuleItemUpdateDto> itemList = request.getItemList();
         List<CoreSafetyIndexCalculateRuleItem> properties = BeanHelper.copyProperties(itemList, CoreSafetyIndexCalculateRuleItem.class);
-        properties.forEach(r->{
+        properties.forEach(r -> {
+            if (ObjectUtil.isNull(r.getIndicatorDays()) || r.getIndicatorDays() < 0) {
+                throw new RuntimeException("连续数不能小于0!");
+            }
+            if (ObjectUtil.isNull(r.getItemValue()) || r.getItemValue() < 0) {
+                throw new RuntimeException("系数不能小于0!");
+            }
             r.setUpdateBy(SecurityUtils.getUserId().toString());
             r.setUpdateTime(new Date());
-            if (r.getId()==null){
+            if (r.getId() == null) {
                 r.setCreateBy(SecurityUtils.getUserId().toString());
                 r.setCreateTime(new Date());
             }

+ 15 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/evaluate/CoreEvaluateTaskMapper.xml

@@ -255,6 +255,21 @@
         GROUP BY
         a.id
     </select>
+    <select id="selectTaskByPlanIdAndStatus" resultType="com.xunmei.core.evaluate.domain.CoreEvaluateTask">
+        SELECT
+            *
+        FROM
+            core_evaluate_task
+        WHERE
+            plan_id = #{planId}
+        <if test="statusList != null">
+            AND `status` IN
+            <foreach collection="statusList" item="status" open="(" separator="," close=")">
+                #{status}
+            </foreach>
+        </if>
+
+    </select>
 
 
     <insert id="insertCoreEvaluateTask" parameterType="com.xunmei.core.evaluate.domain.CoreEvaluateTask">

+ 1 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/information/CoreMessageCenterMapper.xml

@@ -80,7 +80,7 @@
         FROM
             core_message_center
         WHERE
-            is_read = 0
+            is_read = 0 AND user_id=#{userId}
     </select>
 
     <insert id="insertCoreMessageCenter" parameterType="com.xunmei.core.information.domain.CoreMessageCenter">

+ 38 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/message/CoreAnnouncementNotificationMapper.xml

@@ -111,6 +111,42 @@
         WHERE
                 id NOT IN ( SELECT announcement_notification_id FROM core_announcement_notification_to_user )
     </select>
+    <select id="selectAllTongZhi" resultType="java.lang.Long">
+        SELECT
+            a.id
+        FROM
+            core_announcement_notification a
+                LEFT JOIN core_announcement_notification_to_org b ON a.id = b.announcement_notification_id
+                LEFT JOIN core_announcement_notification_to_role c ON a.id = c.announcement_notification_id
+        WHERE
+            a.tag_org_type = #{orgType}
+          AND b.org_id = #{orgId}
+          <if test="roles !=null">
+              AND c.role_id
+              in
+              <foreach collection="roles" item="item" open="(" close=")" separator=",">
+                  #{item}
+              </foreach>
+          </if>
+    </select>
+    <select id="selectAll" resultType="com.xunmei.common.core.domain.message.vo.MessageAppPageVo">
+        select T.*,T.file_list as strFileList from (select a.* from core_announcement_notification a
+        left join core_announcement_notification_to_role b on a.id = b.announcement_notification_id
+        left join core_announcement_notification_to_org c on a.id = c.announcement_notification_id
+        where a.messag_status = 1 and c.org_id = #{orgId} and (a.messag_type = 0 or (b.role_id in
+        <foreach collection="roles" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach> and a.messag_type=1))
+        GROUP BY a.id) T
+    </select>
+    <select id="selectReadByUser" resultType="java.lang.Long">
+        SELECT
+            announcement_notification_id
+        FROM
+            core_announcement_notification_to_user
+        WHERE
+            user_id=#{userId}
+    </select>
 
     <insert id="insertCoreAnnouncementNotification" parameterType="com.xunmei.common.core.domain.message.domain.CoreAnnouncementNotification">
         insert into core_announcement_notification
@@ -184,7 +220,8 @@
         </foreach>
     </insert>
     <insert id="insertNotificationUser">
-        insert into core_announcement_notification_to_user(id,announcement_notification_id,org_id,user_id)values(#{notificationUser.id},#{notificationUser.announcementNotificationId},#{notificationUser.orgId},#{notificationUser.userId})
+        insert into core_announcement_notification_to_user(id,announcement_notification_id,org_id,user_id)
+        values(#{notificationUser.id},#{notificationUser.announcementNotificationId},#{notificationUser.orgId},#{notificationUser.userId})
     </insert>
 
     <update id="updateCoreAnnouncementNotification" parameterType="com.xunmei.common.core.domain.message.domain.CoreAnnouncementNotification">

+ 26 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/retrieval/CoreMonitoringRetrievalTaskMapper.xml

@@ -836,4 +836,30 @@
 
                            OR parent_id = #{planId}) b)
     </select>
+    <select id="selectTaskByToday" resultType="java.lang.Long">
+        SELECT
+            id
+        FROM
+            core_monitoring_retrieval_task
+        WHERE
+            ymd_date LIKE #{day}
+          AND plan_id IN (
+            SELECT
+                id
+            FROM
+                ( SELECT id FROM core_monitoring_retrieval_plan WHERE id = #{planId} OR parent_id = #{planId} ) b)
+    </select>
+    <select id="selectTaskByStartTime" resultType="java.lang.Long">
+        SELECT
+            id
+        FROM
+            core_monitoring_retrieval_task
+        WHERE
+            plan_end_time > #{endTime}
+          AND plan_id IN (
+            SELECT
+                id
+            FROM
+                ( SELECT id FROM core_monitoring_retrieval_plan WHERE id = #{planId} OR parent_id = #{planId} ) b)
+    </select>
 </mapper>

+ 3 - 2
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/service/LocalSysFileServiceImpl.java

@@ -362,9 +362,9 @@ public class LocalSysFileServiceImpl implements ISysFileService {
     @Override
     public String generateOutInPdf(Map<String, Object> data) throws Exception {
         PdfFilePathVo pathVo = getLocalFilePath("visit", data.get("fileName").toString());
-        String afterStr = StringEscapeUtils.escapeEcmaScript(pathVo.getAbsolutePath());
+        String afterStr = StringEscapeUtils.escapeEcmaScript(pathVo.getTempFileName());
         log.info("开始生成来访管理登记簿,当前绝对地址为:{}", afterStr);
-        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getAbsolutePath(), 6, 10);
+        final ItextPdfTableVo pdfTableVo = PdfUtil.createTable(pathVo.getTempFileName(), 6, 10);
         final Document document = pdfTableVo.getDocument();
         final PdfWriter writer = pdfTableVo.getWriter();
 
@@ -376,6 +376,7 @@ public class LocalSysFileServiceImpl implements ISysFileService {
         document.close();
         writer.close();
         log.info("来访管理登记簿生成结束,当前绝对地址为:{}", afterStr);
+        PdfUtil.addPageNum(pathVo.getTempFileName(), pathVo.getAbsolutePath(), fs, tableFont);
         //此处返回  /statics/edu/xxx.pdf
         return this.prefix + pathVo.getRelativePath();
     }

+ 80 - 69
soc-modules/soc-modules-file/src/main/java/com/xunmei/file/utils/PdfUtil.java

@@ -81,14 +81,17 @@ public class PdfUtil {
         if (rowspan != null && rowspan > 0) {
             cell.setRowspan(rowspan);
         }
-        cell.setPaddingTop(8f);
+       // cell.setPaddingTop(8f);
         cell.setPaddingLeft(8f);
         cell.setPaddingRight(8f);
         cell.setPaddingBottom(8f);
+        cell.setLeading(1F,1.5F);
         if (PdfPCell.ALIGN_MIDDLE != align) {
             cell.setHorizontalAlignment(align);
         } else {
-            cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);//设置单元格的垂直对齐方式
+            //设置单元格的垂直方向对齐方式
+            cell.setVerticalAlignment(PdfPCell.ALIGN_MIDDLE);
+            //设置单元格的水平方向对齐方式
             cell.setHorizontalAlignment(Element.ALIGN_CENTER);
         }
         return cell;
@@ -102,6 +105,7 @@ public class PdfUtil {
         if (rowspan != null && rowspan > 0) {
             cell.setRowspan(rowspan);
         }
+        cell.setNoWrap(false);
         cell.setLeading(lineSpacing, 0);
         if (PdfPCell.ALIGN_MIDDLE != align) {
             cell.setHorizontalAlignment(align);
@@ -175,11 +179,11 @@ public class PdfUtil {
         createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
 
         //内容
-        createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 140);
-        createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_LEFT, 5, 140);
-        createPDFCell(tableFont, table, "总结", Element.ALIGN_MIDDLE, 1, 140);
-        createPDFCell(tableFont, table, data.get("note").toString(), Element.ALIGN_LEFT, 5, 140);
-        createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 140);
+        createPDFCell(tableFont, table, "内容", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("content").toString(), Element.ALIGN_LEFT, 5, 1);
+        createPDFCell(tableFont, table, "总结", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("note").toString(), Element.ALIGN_LEFT, 5, 1);
+        createPDFCell(tableFont, table, "参会人员签字", Element.ALIGN_MIDDLE, 1, 1);
         dealEduImageCell((List<String>) data.get("signImage"), table, 5, 30, 30);
         document.add(table);
 
@@ -189,7 +193,6 @@ public class PdfUtil {
         for (List<String> stringList : listList) {
             PdfPTable innerTable = new PdfPTable(6);
             createPDFCell(tableFont, innerTable, "图片附件", Element.ALIGN_MIDDLE, 1, 1);
-            innerTable.setSpacingBefore(10f);
             //一行展示一张图片
             dealEduImageCell(new ArrayList<>(stringList), innerTable, 2, 150, 200);
             document.newPage();
@@ -290,64 +293,69 @@ public class PdfUtil {
         //证件图片
         createPDFCell(tableFont, table, "证件图片", Element.ALIGN_MIDDLE, 1, 1);
         //证件图片 图片填充
-        final PdfPTable imageTable1 = getImage((List<String>) data.get("imageFile"), 2, 148, 108, 2);
+        final PdfPTable imageTable1 = getImage((List<String>) data.get("imageFile"), 2, 190, 130, 2);
         final PdfPCell cell1 = new PdfPCell();
         cell1.setNoWrap(false);
-        cell1.setPaddingLeft(8f);
-        cell1.setPaddingRight(8f);
-        cell1.setPaddingBottom(8f);
-        cell1.setPaddingTop(8f);
+        cell1.setPaddingLeft(4f);
+        cell1.setPaddingRight(4f);
+        cell1.setPaddingBottom(4f);
+        cell1.setPaddingTop(4f);
         cell1.setColspan(5);
         cell1.setRowspan(1);
         //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
         cell1.addElement(imageTable1);
         table.addCell(cell1);
-        createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
-        final PdfPTable imageTable2 = getImage((List<String>) data.get("file"), 2, 148, 148, 2);
-        final PdfPCell cell2 = new PdfPCell();
-        cell2.setNoWrap(false);
-        cell2.setPaddingLeft(8f);
-        cell2.setPaddingRight(8f);
-        cell2.setPaddingBottom(8f);
-        cell2.setPaddingTop(8f);
-        cell2.setColspan(5);
-        cell2.setRowspan(1);
-        //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
-        cell2.addElement(imageTable2);
-        table.addCell(cell2);
+
         createPDFCell(tableFont, table, "身份核验材料", Element.ALIGN_MIDDLE, 1, 1);
-        final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 148, 148, 2);
+        final PdfPTable imageTable3 = getImage((List<String>) data.get("checkImage"), 2, 190, 190, 2);
         final PdfPCell cell3 = new PdfPCell();
         cell3.setNoWrap(false);
-        cell3.setPaddingLeft(8f);
-        cell3.setPaddingRight(8f);
-        cell3.setPaddingBottom(8f);
-        cell3.setPaddingTop(8f);
+        cell3.setPaddingLeft(4f);
+        cell3.setPaddingRight(4f);
+        cell3.setPaddingBottom(4f);
+        cell3.setPaddingTop(4f);
         cell3.setColspan(5);
         cell3.setRowspan(1);
         //cell1.setBorder(Rectangle.LEFT | Rectangle.RIGHT | Rectangle.BOTTOM);
         cell3.addElement(imageTable3);
         table.addCell(cell3);
 
-
         document.add(table);
+
+        PdfPTable innerTable = new PdfPTable(6);
+        createPDFCell(tableFont, innerTable, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
+
+//        createPDFCell(tableFont, table, "介绍信附件", Element.ALIGN_MIDDLE, 1, 1);
+        final PdfPTable imageTable2 = getImage((List<String>) data.get("file"), 2, 380, 320, 1);
+        final PdfPCell cell2 = new PdfPCell();
+        cell2.setNoWrap(false);
+        cell2.setPaddingLeft(4f);
+        cell2.setPaddingRight(4f);
+        cell2.setPaddingBottom(4f);
+        cell2.setPaddingTop(4f);
+        cell2.setColspan(5);
+        cell2.setRowspan(1);
+        cell2.addElement(imageTable2);
+        innerTable.addCell(cell2);
+        document.newPage();
+        document.add(innerTable);
     }
 
     public static void dealDrillBody(Document document, PdfPTable table, Font tableFont, Map<String, Object> data) throws Exception {
         //第一行
-        createPDFCell(tableFont, table, "演练单位", Element.ALIGN_CENTER, 1, 1);
-        createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_CENTER, 2, 1);
-        createPDFCell(tableFont, table, "地点", Element.ALIGN_CENTER, 1, 1);
-        createPDFCell(tableFont, table, data.get("drillSite").toString(), Element.ALIGN_CENTER, 2, 1);
+        createPDFCell(tableFont, table, "演练单位", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("orgName").toString(), Element.ALIGN_MIDDLE, 2, 1);
+        createPDFCell(tableFont, table, "地点", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("drillSite").toString(), Element.ALIGN_MIDDLE, 2, 1);
         //第二行
-        createPDFCell(tableFont, table, "指挥人", Element.ALIGN_CENTER, 1, 1);
-        createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_CENTER, 2, 1);
-        createPDFCell(tableFont, table, "记录人", Element.ALIGN_CENTER, 1, 1);
-        createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_CENTER, 2, 1);
+        createPDFCell(tableFont, table, "指挥人", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("hostName").toString(), Element.ALIGN_MIDDLE, 2, 1);
+        createPDFCell(tableFont, table, "记录人", Element.ALIGN_MIDDLE, 1, 1);
+        createPDFCell(tableFont, table, data.get("recorderName").toString(), Element.ALIGN_MIDDLE, 2, 1);
         //第三行
-        createPDFCell(tableFont, table, "演练时间", Element.ALIGN_CENTER, 1, 1);
+        createPDFCell(tableFont, table, "演练时间", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("drillTime").toString(), Element.ALIGN_LEFT, 5, 1);
-        createPDFCell(tableFont, table, "演练项目", Element.ALIGN_CENTER, 1, 1);
+        createPDFCell(tableFont, table, "演练项目", Element.ALIGN_MIDDLE, 1, 1);
         createPDFCell(tableFont, table, data.get("typeText").toString(), Element.ALIGN_LEFT, 5, 1);
         //预设案由
         createPDFCell(tableFont, table, "预设案由", Element.ALIGN_MIDDLE, 1, 1);
@@ -419,6 +427,7 @@ public class PdfUtil {
         PdfPTable imageInnerTable = new PdfPTable(imageNumsOfRow);
         imageInnerTable.setSplitRows(true);
         imageInnerTable.setSplitLate(false);
+        imageInnerTable.setWidthPercentage(100F);
         for (String image : imageList) {
             Image imageData = convertFileToByteArray(new File(image));
             if (imageData != null) {
@@ -426,10 +435,11 @@ public class PdfUtil {
             }
             PdfPCell innerCell = new PdfPCell(imageData);
             innerCell.setNoWrap(false);
-            innerCell.setPaddingTop(8f);
+          /*  innerCell.setPaddingTop(8f);
             innerCell.setPaddingLeft(8f);
             innerCell.setPaddingRight(8f);
-            innerCell.setPaddingBottom(8f);
+            innerCell.setPaddingBottom(8f);*/
+
             innerCell.setBorder(Rectangle.NO_BORDER);
             innerCell.setHorizontalAlignment(Element.ALIGN_CENTER);
             innerCell.setVerticalAlignment(Element.ALIGN_MIDDLE);
@@ -439,12 +449,12 @@ public class PdfUtil {
         table.addCell(outCell);
     }
 
-
     private static PdfPTable getImage(List<String> images, int totalImages, float imageWidth, float imageHeight, Integer ImageNumsOfRow) throws Exception {
         if (images == null) {
             images = new ArrayList<>();
         }
         PdfPTable innerTable = new PdfPTable(ImageNumsOfRow);
+        innerTable.setWidthPercentage(100f);
         innerTable.setSplitRows(true);
         innerTable.setSplitLate(false);
         //这里根据实际图片数量来判断是否需要补充白色图片,保证每行显示3张图片,用以填充空白
@@ -481,6 +491,7 @@ public class PdfUtil {
         outerTable.setSplitRows(true);
         outerTable.setSplitLate(false);
         outerTable.addCell(innerCell);
+        outerTable.setWidthPercentage(100f);
         return outerTable;
     }
 
@@ -513,45 +524,45 @@ public class PdfUtil {
 
     public static void dealAccessPBody(Document document, PdfPTable table, Font tableFont, Font tableTitleFont, List<AccessDataVo> data) throws DocumentException {
 
-        PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 3, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "硬盘录像机", Element.ALIGN_MIDDLE, 16, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "序号", Element.ALIGN_MIDDLE, 5, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "硬盘录像机", Element.ALIGN_MIDDLE, 15, 0);
         PdfUtil.createPDFCell(tableTitleFont, table, "通道名称", Element.ALIGN_MIDDLE, 9, 0);
-        PdfUtil.createPDFCell(tableTitleFont, table, "检查项目", Element.ALIGN_MIDDLE, 9, 0);
+        PdfUtil.createPDFCell(tableTitleFont, table, "检查项目", Element.ALIGN_MIDDLE, 8, 0);
         PdfUtil.createPDFCell(tableTitleFont, table, "存在问题", Element.ALIGN_MIDDLE, 9, 0);
         for (int i = 1; i <= data.size(); i++) {
-            PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 3, 0);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 16, 0);
+            PdfUtil.createPDFCell(tableFont, table, String.valueOf(i), Element.ALIGN_MIDDLE, 5, 0);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getHostName(), Element.ALIGN_MIDDLE, 15, 0);
             PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getVideoChannelName(), Element.ALIGN_MIDDLE, 9, 0);
-            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 9, 0);
+            PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getProject(), Element.ALIGN_MIDDLE, 8, 0);
             PdfUtil.createPDFCell(tableFont, table, data.get(i - 1).getAbnormalIllustrate(), Element.ALIGN_MIDDLE, 9, 0);
         }
         document.add(table);
     }
 
     public static void dealSafeCheckPBody(Document document, PdfPTable table, Font tableFont, SafeCheckTaskRegisterBookVo data) throws DocumentException {
-        PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_CENTER, 4, 1);
-        PdfUtil.createPDFCell(tableFont, table, "被查日期", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getDateStr(), Element.ALIGN_CENTER, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "被查单位", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getOrgName(), Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查日期", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getDateStr(), Element.ALIGN_MIDDLE, 4, 1);
 
-        PdfUtil.createPDFCell(tableFont, table, "检查类型", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_CENTER, 4, 1);
-        PdfUtil.createPDFCell(tableFont, table, "检查名称", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getTaskTitle(), Element.ALIGN_CENTER, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查类型", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getCheckTypeText(), Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查名称", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getTaskTitle(), Element.ALIGN_MIDDLE, 4, 1);
 
-        PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_CENTER, 4, 1);
-        PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_CENTER, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查单位", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getCheckOrgName(), Element.ALIGN_MIDDLE, 4, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查人", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getCheckUserInfo(), Element.ALIGN_MIDDLE, 4, 1);
 
-        PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_CENTER, 3, 1);
-        PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_CENTER, 11, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查组成员", Element.ALIGN_MIDDLE, 3, 1);
+        PdfUtil.createPDFCell(tableFont, table, data.getCheckTeam(), Element.ALIGN_MIDDLE, 11, 1);
 
-        PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_CENTER, 14, 1);
+        PdfUtil.createPDFCell(tableFont, table, "发现问题情况", Element.ALIGN_MIDDLE, 14, 1);
 
-        PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_CENTER, 2, 1);
-        PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_CENTER, 6, 1);
-        PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_CENTER, 6, 1);
+        PdfUtil.createPDFCell(tableFont, table, "序号", Element.ALIGN_MIDDLE, 2, 1);
+        PdfUtil.createPDFCell(tableFont, table, "检查项目", Element.ALIGN_MIDDLE, 6, 1);
+        PdfUtil.createPDFCell(tableFont, table, "存在问题", Element.ALIGN_MIDDLE, 6, 1);
         final Optional<CheckDataVo> optional = data.getCheckDatas().stream().filter(res -> ObjectUtil.isNotEmpty(res.getResRemark())).findAny();
         if (!optional.isPresent()) {
             PdfUtil.createPDFCell(tableFont, table, "1", Element.ALIGN_MIDDLE, 2, 1);

+ 10 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java

@@ -36,6 +36,7 @@ import com.xunmei.system.service.ISysOrgService;
 import com.xunmei.system.service.ISysUserService;
 import com.xunmei.system.util.SecurityUserExport;
 import com.xunmei.system.util.UserExport;
+import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -46,6 +47,7 @@ import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.RequestParam;
 
 import javax.validation.Validator;
+import java.security.Security;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -761,8 +763,15 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     public List<Long> selectUserRoleMenu(Long userId) {
         final List<SysUserRole> roleList = userRoleMapper.selectList(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId));
         final List<Long> collect = roleList.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
+        boolean isAdmin = SecurityUtils.isAdmin(userId);
+        // 不是管理员 且没有角色时 返回空,管理员返回所有菜单
+        if(!isAdmin && ObjectUtil.isEmpty(collect))
+        {
+            return new ArrayList<>();
+        }
+
         return roleMenuMapper.selectList(new LambdaQueryWrapper<SysRoleMenu>()
-                        .in(ObjectUtil.isNotEmpty(collect), SysRoleMenu::getRoleId, collect))
+                        .in(!isAdmin, SysRoleMenu::getRoleId, collect))
                 .stream()
                 .map(SysRoleMenu::getMenuId)
                 .distinct()