Bladeren bron

Merge remote-tracking branch 'origin/V0.0.2' into V0.0.2

ouyang 2 jaren geleden
bovenliggende
commit
00fc196572
15 gewijzigde bestanden met toevoegingen van 133 en 328 verwijderingen
  1. 51 1
      project_data/sql/0.0.2/soc/soc.sql
  2. 5 2
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/access/service/impl/TMonitoringRetrievalPlanServiceImpl.java
  3. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/controller/CoreMessageCenterController.java
  4. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/mapper/CoreMessageCenterMapper.java
  5. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/service/impl/CoreMessageCenterServiceImpl.java
  6. 15 0
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/vo/CoreMessageCenterVO.java
  7. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/job/SafetyCheckJobBusiness.java
  8. 2 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRegisterSericeImpl.java
  9. 7 2
      soc-modules/soc-modules-core/src/main/resources/mapper/information/CoreMessageCenterMapper.xml
  10. 1 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysMenu.java
  11. 6 3
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java
  12. 7 0
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysMenuServiceImpl.java
  13. 0 116
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/IDHelper.java
  14. 32 32
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ResumptionType.java
  15. 0 167
      soc-modules/soc-modules-system/src/main/java/com/xunmei/util/SnowflaskGenerator.java

+ 51 - 1
project_data/sql/0.0.2/soc/soc.sql

@@ -121,9 +121,59 @@ BEGIN
             add rec_status int null comment '推荐状态:0:正常案例、1:行社优秀案例、2:已推荐地区优秀案例、3:地区优秀案例、4:已推荐省级优秀案例、5:省级优秀案例' after status;
     END IF;
 
+    IF NOT EXISTS(SELECT *
+                  FROM information_schema.columns
+                  WHERE table_schema = DATABASE()
+                    AND table_name = 'sync_fjnx_org_business_relation'
+                    AND column_name = 'tree_show_parent_code') THEN
+        ALTER TABLE `sync_fjnx_org_business_relation`
+            ADD COLUMN `tree_show_parent_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机构树上显示的父级编码' AFTER `business_parent_code`;
+    END IF;
+
+    IF NOT EXISTS(SELECT *
+                  FROM information_schema.columns
+                  WHERE table_schema = DATABASE()
+                    AND table_name = 'sync_fjnx_org_business_relation'
+                    AND column_name = 'org_type') THEN
+        ALTER TABLE `sync_fjnx_org_business_relation`
+            ADD COLUMN `org_type` int NULL DEFAULT NULL COMMENT '同步配置表自定义机构类型 1:省联社 2:办事处 3: 地区行社' AFTER `tree_show_parent_code`;
+    END IF;
+
+    IF NOT EXISTS(SELECT *
+                  FROM information_schema.columns
+                  WHERE table_schema = DATABASE()
+                    AND table_name = 'sync_fjnx_org_business_relation'
+                    AND column_name = 'dqhs_org_code') THEN
+        ALTER TABLE `sync_fjnx_org_business_relation`
+            ADD COLUMN `dqhs_org_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci  NULL DEFAULT NULL COMMENT '办事处对应的地区行社,机构编码是办事处时需要配置' AFTER `org_type`;
+    END IF;
+
 END??
 DELIMITER ;
 CALL schema_change();
+
+-- 新增fjnx机构同步 机构关系配置表数据
+delete from sync_fjnx_org_business_relation ;
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (1, 'M39000000', 'M31000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (2, 'M42000000', 'M33000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (3, 'M43000000', 'M34000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (4, 'M39000000', 'M35000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (5, 'M45000000', 'M36000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (6, 'M46000000', 'M37000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (7, 'M47000000', 'M38000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (8, '900000000', 'C900000000', 'C900000000', 1, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (9, 'M40000000', 'C900000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (10, 'M44000000', 'C900000000', 'C900000000', 3, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (11, 'M31000000', NULL, NULL, 2, 'M39000000', NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (12, 'M32000000', NULL, NULL, 2, NULL, NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (13, 'M33000000', NULL, NULL, 2, 'M42000000', NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (14, 'M34000000', NULL, NULL, 2, 'M43000000', NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (15, 'M35000000', NULL, NULL, 2, 'M39000000', NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (16, 'M36000000', NULL, NULL, 2, 'M45000000', NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (17, 'M37000000', NULL, NULL, 2, 'M46000000', NULL, NULL, NULL, NULL);
+INSERT INTO `sync_fjnx_org_business_relation` (`id`, `org_code`, `business_parent_code`, `tree_show_parent_code`, `org_type`, `dqhs_org_code`, `create_time`, `modified_name`, `update_time`, `modified_id`) VALUES (18, 'M38000000', NULL, NULL, 2, 'M47000000', NULL, NULL, NULL, NULL);
+
+
 -- 新增演练任务推荐状态字典
 delete from sys_dict_type where dict_type='drill_task_rec_status';
 delete from sys_dict_data where dict_type='drill_task_rec_status';
@@ -1192,7 +1242,7 @@ CREATE TABLE `core_safetycheck_rule_point`  (
 
 SET FOREIGN_KEY_CHECKS = 1;
 
-DELETE from `sys_dict_type` WHERE id='question_confirm_status' or id='question_reform_status';
+DELETE from `sys_dict_type` WHERE dict_type='question_confirm_status' or dict_type='question_reform_status';
 INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( '问题确认状态', 'question_confirm_status', '0', '超级管理员', '2023-09-13 18:14:59', '', NULL, NULL);
 INSERT INTO `sys_dict_type` (`dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( '问题整改状态', 'question_reform_status', '0', '超级管理员', '2023-09-13 18:15:18', '', NULL, NULL);
 

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

@@ -157,6 +157,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
         SysOrg org = new SysOrg();
         org.setType(3);
         org.setPath(topOrg.getPath());
+        //查询符合的机构,需求是先把行社加入
         List<SysOrg> list = remoteOrgService.listByParentIdAndType(org, SecurityConstants.INNER);
         Integer i = ZERO;
         List<TMonitoringRetrievalPlan> tMonitoringRetrievalPlans = new ArrayList<>();
@@ -183,6 +184,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
             monitoringRetrievalPlan.setParentId(tMonitoringRetrievalPlan.getId());
             monitoringRetrievalPlan.setIsDistribute("1");
             i = tMonitoringRetrievalPlanMapper.insert(monitoringRetrievalPlan);
+            //如果是行社直接新增,如果不是就要查询下面的机构
             if (tMonitoringRetrievalPlan.getOrgType().equals("3")) {
                 tMonitoringRetrievalPlans.add(monitoringRetrievalPlan);
             } else {
@@ -210,7 +212,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
                     plan.setDescription(tMonitoringRetrievalPlan.getDescription());
                     plan.setCreateType(1);
                     plan.setId(IdWorker.getId());
-                    plan.setParentId(monitoringRetrievalPlan.getId());
+                    plan.setParentId(tMonitoringRetrievalPlan.getId());
                     plan.setIsDistribute("1");
                     i = tMonitoringRetrievalPlanMapper.insert(plan);
                     tMonitoringRetrievalPlans.add(plan);
@@ -361,6 +363,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
                         CoreMonitoringRetrievalTask coreMonitoringRetrievalTask = new CoreMonitoringRetrievalTask();
                         coreMonitoringRetrievalTask.setPlanId(p.getId());
                         coreMonitoringRetrievalTask.setStatus("0");
+                        //根据计划查询未完成的任务
                         List<CoreMonitoringRetrievalTask> coreMonitoringRetrievalTasks = iCoreMonitoringRetrievalTaskService.selectCoreMonitoringRetrievalTaskList(coreMonitoringRetrievalTask);
                         List<Long> collect = coreMonitoringRetrievalTasks.stream().map(CoreMonitoringRetrievalTask::getId).distinct().collect(Collectors.toList());
                         if (CollectionUtils.isNotEmpty(collect)) {
@@ -369,7 +372,7 @@ public class TMonitoringRetrievalPlanServiceImpl extends ServiceImpl<TMonitoring
                             iCoreMonitoringRetrievalTaskService.deleteCoreMonitoringRetrievalTaskByIds(arr);
                         }
                         //删除带调阅任务
-                        iCoreMonitoringRetrievalTaskService.deleteWaitTaskByPlanId(p.getId());
+                       // iCoreMonitoringRetrievalTaskService.deleteWaitTaskByPlanId(p.getId());
                         p.setIsDeleted(2L);
                         i = tMonitoringRetrievalPlanMapper.updateTMonitoringRetrievalPlan(p);
                         if (i < 1) {

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

@@ -10,6 +10,7 @@ import com.xunmei.common.security.annotation.RequiresPermissions;
 import com.xunmei.core.information.domain.CoreMessageCenter;
 import com.xunmei.core.information.dto.CoreMessageCenterDTO;
 import com.xunmei.core.information.service.ICoreMessageCenterService;
+import com.xunmei.core.information.vo.CoreMessageCenterVO;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -35,7 +36,7 @@ public class CoreMessageCenterController extends BaseController {
 @ApiOperation(value = "查询消息列表")
 @RequiresPermissions("system:center:list")
 @GetMapping("/messageList")
-public TableDataInfo<CoreMessageCenter> list(CoreMessageCenterDTO coreMessageCenter) {
+public TableDataInfo<CoreMessageCenterVO> list(CoreMessageCenterDTO coreMessageCenter) {
     if (null==coreMessageCenter.getType()){
         coreMessageCenter.setType("3");
     }

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

@@ -7,6 +7,7 @@ import com.xunmei.common.core.domain.retrieval.domain.CoreMonitoringRetrievalTas
 import com.xunmei.core.access.dto.CoreMonitoringTaskRegistrationDTO;
 import com.xunmei.core.information.domain.CoreMessageCenter;
 import com.xunmei.core.information.dto.CoreMessageCenterDTO;
+import com.xunmei.core.information.vo.CoreMessageCenterVO;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 
@@ -21,7 +22,7 @@ import java.util.List;
 @Mapper
 public interface CoreMessageCenterMapper extends BaseMapper<CoreMessageCenter> {
 
-    Page<CoreMessageCenter> selectByPage(Page<CoreMessageCenter> page, @Param("request") CoreMessageCenterDTO request);
+    Page<CoreMessageCenterVO> selectByPage(Page<CoreMessageCenter> page, @Param("request") CoreMessageCenterDTO request);
     /**
      * 查询消息中心
      *

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

@@ -11,6 +11,7 @@ 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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -52,7 +53,7 @@ public class CoreMessageCenterServiceImpl extends ServiceImpl<CoreMessageCenterM
 
     @Override
     public TableDataInfo selectByPage(CoreMessageCenterDTO coreMessageCenterDTO) {
-        Page<CoreMessageCenter> coreMessageCenterPage = coreMessageCenterMapper.selectByPage(coreMessageCenterDTO.getPageRequest(), coreMessageCenterDTO);
+        Page<CoreMessageCenterVO> coreMessageCenterPage = coreMessageCenterMapper.selectByPage(coreMessageCenterDTO.getPageRequest(), coreMessageCenterDTO);
         TableDataInfo<CoreMessageCenter> tableDataInfo = new TableDataInfo();
         tableDataInfo.setMsg("操作成功");
         tableDataInfo.setCode(200);

+ 15 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/information/vo/CoreMessageCenterVO.java

@@ -0,0 +1,15 @@
+package com.xunmei.core.information.vo;
+
+import com.xunmei.common.core.domain.message.vo.MessageAppPageVo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * @author :LuoWei
+ * @date : 2023/9/25
+ */
+@Data
+public class CoreMessageCenterVO extends MessageAppPageVo {
+    @ApiModelProperty(value = "1公告通知2业务提醒3消息")
+    private String type;
+}

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/job/SafetyCheckJobBusiness.java

@@ -343,7 +343,7 @@ public class SafetyCheckJobBusiness {
             checkTask.setCheckOrgId(taskPlan.getCheckOrg().getId());
             checkTask.setCheckOrgName(taskPlan.getCheckOrg().getName());
             checkTask.setStatus(1);
-            checkTask.setDoneStatus(0);
+            checkTask.setDoneStatus(1);
             checkTask.setCheckType(0L);
             checkTask.setCheckCycle(Long.valueOf(taskPlan.getPlanCycle()));
             checkTask.setYmdDate(datetime);

+ 2 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRegisterSericeImpl.java

@@ -211,7 +211,7 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
         // 找出检查内容
         List<AppTaskRegisterPointVo> points = baseMapper.selectPoint(plan.getId(), id);
         Map<Long, List<CoreSafetyTaskDataRemarkimg>> taskImgs = new HashMap<>();
-        if (ObjectUtil.equal(task.getStatus(), SafetyCheckTaskStatus.UnderWay.getValue())) {
+        if (ObjectUtil.equal(task.getDoneStatus(), SafetyCheckTaskStatus.UnderWay.getValue())) {
             //已保存未提交的才可能有问题图片
             LambdaQueryWrapper<CoreSafetyTaskDataRemarkimg> wrapper = new LambdaQueryWrapper<>();
             wrapper.eq(CoreSafetyTaskDataRemarkimg::getTaskId, id);
@@ -429,6 +429,7 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
         LambdaUpdateWrapper<CoreSafetyTask> taskUpdateWraper = new LambdaUpdateWrapper();
         taskUpdateWraper.eq(CoreSafetyTask::getId, data.getId())
                 .set(CoreSafetyTask::getDoneStatus, ObjectUtil.equal(data.getIsSubmit(), 0) ? SafetyCheckTaskStatus.UnderWay.getValue() : SafetyCheckTaskStatus.Completed.getValue())
+                .set(CoreSafetyTask::getStatus,ObjectUtil.equal(data.getIsSubmit(), 0) ? SafetyCheckTaskStatus.UnderWay.getValue() : SafetyCheckTaskStatus.Completed.getValue())
                 .set(CoreSafetyTask::getSubmitTime, new Date())
                 .set(CoreSafetyTask::getSubmitorId, SecurityUtils.getUserId())
                 .set(CoreSafetyTask::getSubmitBy, SecurityUtils.getLoginUser().getName())

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

@@ -55,9 +55,14 @@
         <include refid="selectCoreMessageCenterVo"/>
         where id = #{id}
     </select>
-    <select id="selectByPage" resultType="com.xunmei.core.information.domain.CoreMessageCenter">
+    <select id="selectByPage" resultType="com.xunmei.core.information.vo.CoreMessageCenterVO">
         SELECT
-        *
+        id AS id,
+        type AS type,
+        title AS title,
+        is_read AS isRead,
+        content AS content,
+        create_time AS publishTime
         FROM
         core_message_center
         WHERE

+ 1 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/domain/SysMenu.java

@@ -34,6 +34,7 @@ public class SysMenu extends BaseEntity {
     /**
      * 菜单ID
      */
+
     private Long id;
 
     /**

+ 6 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysDeptServiceImpl.java

@@ -324,15 +324,18 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
 
     private List<SysOrgVO> generateTree(List<SysOrgVO> orgs, SysOrg sysOrg) {
         Long parentId = Constants.TOP_ORG_PARENT_ID;
-        if (ObjectUtil.isNotEmpty(sysOrg) && ObjectUtil.notEqual(Constants.TOP_ORG_PARENT_ID, sysOrg.getParentId())) {
-            parentId = sysOrg.getParentId();
+        if (ObjectUtil.isNotEmpty(sysOrg) && ObjectUtil.notEqual(Constants.TOP_ORG_PARENT_ID, sysOrg.getTreeShowParentId())) {
+            parentId = sysOrg.getTreeShowParentId();
         }
 
         // 顶级机构存在多个的情况
-        final List<Long> parentIds = orgs.stream().filter(x -> !orgs.stream().anyMatch(y -> x.getTreeShowParentId().equals(y.getId()))).map(SysOrgVO::getTreeShowParentId).collect(Collectors.toList());
+        List<Long> parentIds = orgs.stream().filter(x -> !orgs.stream().anyMatch(y -> x.getTreeShowParentId().equals(y.getId()))).map(SysOrgVO::getTreeShowParentId).collect(Collectors.toList());
         if (parentIds.size() == 0) {
             parentIds.add(parentId);
         }
+        else {
+            parentIds=parentIds.stream().distinct().collect(Collectors.toList());
+        }
         final Map<Long, List<SysOrgVO>> collect = orgs.stream().collect(Collectors.groupingBy(SysOrgVO::getTreeShowParentId));
         List<SysOrgVO> result = new ArrayList<>();
         parentIds.forEach(pId -> {

+ 7 - 0
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysMenuServiceImpl.java

@@ -1,9 +1,11 @@
 package com.xunmei.system.service.impl;
 
+import cn.hutool.core.util.ObjectUtil;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.xunmei.common.core.constant.Constants;
 import com.xunmei.common.core.constant.UserConstants;
+import com.xunmei.common.core.utils.IDHelper;
 import com.xunmei.common.core.utils.StringUtils;
 import com.xunmei.system.api.domain.SysRole;
 import com.xunmei.system.api.domain.SysUser;
@@ -15,6 +17,7 @@ import com.xunmei.system.mapper.SysMenuMapper;
 import com.xunmei.system.mapper.SysRoleMapper;
 import com.xunmei.system.mapper.SysRoleMenuMapper;
 import com.xunmei.system.service.ISysMenuService;
+
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -266,6 +269,10 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
      */
     @Override
     public int insertMenu(SysMenu menu) {
+        if(ObjectUtil.isNull(menu.getId())){
+            menu.setId(IDHelper.id());
+        }
+
         return menuMapper.insertMenu(menu);
     }
 

+ 0 - 116
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/IDHelper.java

@@ -1,116 +0,0 @@
-package com.xunmei.system.util;
-
-import cn.hutool.core.date.DateUtil;
-import com.xunmei.common.core.utils.snowId.DateHelper;
-import org.apache.commons.codec.digest.DigestUtils;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Component;
-import com.xunmei.system.util.SnowflaskGenerator;
-import javax.annotation.PostConstruct;
-import java.io.Serializable;
-import java.util.Date;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static cn.hutool.core.date.DatePattern.PURE_DATETIME_PATTERN;
-
-@Component
-public class IDHelper {
-
-
-    //    @Value("${snowflake.workerId}")
-//    private  long workerId;
-//    @Value("${snowflake.datacenterId}")
-//    private long datacenterId=0L;
-//    private  static  long _workerId=0L;
-//    private  static  long _datacenterId=0L;
-    @Autowired
-    private Environment environment;
-
-    @PostConstruct
-    public void setStatic() {
-        long _workerId = 0L;
-        long _datacenterId = 0L;
-        if (environment.containsProperty("snowflake.workerId")) {
-            _workerId = environment.getProperty("snowflake.workerId", long.class);
-        }
-        if (environment.containsProperty("snowflake.datacenterId")) {
-            _datacenterId = environment.getProperty("snowflake.datacenterId", long.class);
-        }
-
-//        snowflaskGenerator = new SnowflaskGenerator(_workerId, _datacenterId);
-        snowflaskGenerator = new SnowflaskGenerator(0L, 0L);
-    }
-
-    private static  SnowflaskGenerator snowflaskGenerator = null;
-
-    public static Long id() {
-        return snowflaskGenerator.nextId();
-    }
-
-    public static String dateTime(final Date date) {
-        return DateUtil.format(date, PURE_DATETIME_PATTERN);
-    }
-
-    public static String dateTime(final Date date, final Serializable other) {
-        return DateUtil.format(date, PURE_DATETIME_PATTERN) + "|" + other.toString();
-    }
-
-    public static String date(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "D" + dateHelper.getMonth() + "" + dateHelper.getDate() + "|" + other.toString();
-    }
-
-    public static String month(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "M" + dateHelper.getMonth() + "|" + other.toString();
-    }
-
-    public static String week(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "W" + dateHelper.getWeek() + "|" + other.toString();
-    }
-
-    public static String quarter(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "Q" + dateHelper.getQuarter() + "|" + other.toString();
-    }
-
-    public static String halfyear(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "H" + dateHelper.getHalfyear() + "|" + other.toString();
-    }
-
-    public static String year(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "Y" + dateHelper.getYear() + "|" + other.toString();
-    }
-
-    public static String hour(final Date date, final Serializable other) {
-        final DateHelper dateHelper = new DateHelper(date);
-        return dateHelper.getYear() + "R" + dateHelper.getMonth() + "" + dateHelper.getDate() + "" + dateHelper.getHour() + "|" + other.toString();
-    }
-
-    public static Long pad(final Serializable code, final Serializable id, final int i) {
-        return Long.parseLong(code + StringUtils.leftPad(id.toString(), i, "0"));
-    }
-
-    public static Long and(final Object... pp) {
-        return Long.parseLong(Stream.of(pp)
-                .filter(Objects::nonNull)
-                .map(Object::toString)
-                .collect(Collectors.joining()));
-    }
-
-    public static String md5(final Serializable... os) {
-        final StringBuilder stringBuilder = new StringBuilder(os.length * 10);
-        for (final Serializable o : os) {
-            stringBuilder.append(o.toString());
-        }
-        stringBuilder.trimToSize();
-        return DigestUtils.md5Hex(stringBuilder.toString());
-    }
-}

+ 32 - 32
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/ResumptionType.java

@@ -187,39 +187,39 @@ public enum ResumptionType {
         return null;
     }
 
-    /**
-     * @param formType
-     * @param date
-     * @param orgId
-     * @return
-     */
-    public String toId(final FormType formType, final Date date, final Long orgId) {
-        return this.toId(date, orgId) + "|" + formType.ordinal();
-    }
+//    /**
+//     * @param formType
+//     * @param date
+//     * @param orgId
+//     * @return
+//     */
+//    public String toId(final FormType formType, final Date date, final Long orgId) {
+//        return this.toId(date, orgId) + "|" + formType.ordinal();
+//    }
 
-    /**
-     * @param date
-     * @param orgId
-     * @return
-     */
-    public String toId(final Date date, final Long orgId) {
-        switch (this) {
-            case DAY:
-                return IDHelper.date(date, orgId);
-            case WEEK:
-                return IDHelper.week(date, orgId);
-            case MONTH:
-                return IDHelper.month(date, orgId);
-            case QUARTER:
-                return IDHelper.quarter(date, orgId);
-            case HALFYEAR:
-                return IDHelper.halfyear(date, orgId);
-            case HOUR:
-                return IDHelper.hour(date, orgId);
-            default:
-                return IDHelper.year(date, orgId);
-        }
-    }
+//    /**
+//     * @param date
+//     * @param orgId
+//     * @return
+//     */
+//    public String toId(final Date date, final Long orgId) {
+//        switch (this) {
+//            case DAY:
+//                return IDHelper.date(date, orgId);
+//            case WEEK:
+//                return IDHelper.week(date, orgId);
+//            case MONTH:
+//                return IDHelper.month(date, orgId);
+//            case QUARTER:
+//                return IDHelper.quarter(date, orgId);
+//            case HALFYEAR:
+//                return IDHelper.halfyear(date, orgId);
+//            case HOUR:
+//                return IDHelper.hour(date, orgId);
+//            default:
+//                return IDHelper.year(date, orgId);
+//        }
+//    }
 
     /**
      * @param date

+ 0 - 167
soc-modules/soc-modules-system/src/main/java/com/xunmei/util/SnowflaskGenerator.java

@@ -1,167 +0,0 @@
-package com.xunmei.system.util;
-
-import lombok.extern.slf4j.Slf4j;
-
-/**
- * Long类型ID生成器,固定为19位长度
- * 生成ID,采用snowflake算法,64bit整数,1秒可以生成800万个ID
- * 0-41bit毫秒时间戳-10bit机器ID-12bit序列化
- * 42bit的毫秒时间戳,2000年算起可以支持该算法使用到2068年,10bit的工作机器id可以支持1024台机器,12序列号支持1毫秒产生4096个自增序列id
- */
-@Slf4j
-
-public class SnowflaskGenerator {
-
-    /**
-     * 开始时间截 (2015-01-01)
-     */
-    private final long twepoch = 1420041600000L;
-
-    /**
-     * 机器id所占的位数
-     */
-    private final long workerIdBits = 1L;
-
-    /**
-     * 数据标识id所占的位数
-     */
-    private final long datacenterIdBits = 1L;
-
-    /**
-     * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数)
-     */
-    private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
-
-    /**
-     * 支持的最大数据标识id,结果是31
-     */
-    private final long maxDatacenterId = -1L ^ (-1L << datacenterIdBits);
-
-    /**
-     * 序列在id中占的位数
-     */
-    private final long sequenceBits = 12L;
-
-    /**
-     * 机器ID向左移12位
-     */
-    private final long workerIdShift = sequenceBits;
-
-    /**
-     * 数据标识id向左移17位(12+5)
-     */
-    private final long datacenterIdShift = sequenceBits + workerIdBits;
-
-    /**
-     * 时间截向左移22位(3+3+12)
-     */
-    private final long timestampLeftShift = sequenceBits + workerIdBits + datacenterIdBits;
-
-    /**
-     * 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095)
-     */
-    private final long sequenceMask = -1L ^ (-1L << sequenceBits);
-
-    /**
-     * 工作机器ID(0~31)
-     */
-    private long workerId;
-
-    /**
-     * 数据中心ID(0~31)
-     */
-    private long datacenterId;
-
-    /**
-     * 毫秒内序列(0~4095)
-     */
-    private long sequence = 0L;
-
-    /**
-     * 上次生成ID的时间截
-     */
-    private long lastTimestamp = -1L;
-
-
-    //==============================Constructors=====================================
-
-    /**
-     * 构造函数
-     *
-     * @param workerId     工作ID (0~31)
-     * @param datacenterId 数据中心ID (0~31)
-     */
-    public SnowflaskGenerator(long workerId, long datacenterId) {
-        if (workerId > maxWorkerId || workerId < 0) {
-            throw new IllegalArgumentException(String.format("worker Id can't be greater than %d or less than 0", maxWorkerId));
-        }
-        if (datacenterId > maxDatacenterId || datacenterId < 0) {
-            throw new IllegalArgumentException(String.format("datacenter Id can't be greater than %d or less than 0", maxDatacenterId));
-        }
-        this.workerId = workerId;
-        this.datacenterId = datacenterId;
-    }
-
-    // ==============================Methods==========================================
-
-    /**
-     * 获得下一个ID (该方法是线程安全的)
-     *
-     * @return SnowflakeId
-     */
-    public synchronized long nextId() {
-        long timestamp = timeGen();
-
-        //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常
-        if (timestamp < lastTimestamp) {
-            throw new RuntimeException(
-                    String.format("Clock moved backwards.  Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
-        }
-
-        //如果是同一时间生成的,则进行毫秒内序列
-        if (lastTimestamp == timestamp) {
-            sequence = (sequence + 1) & sequenceMask;
-            //毫秒内序列溢出
-            if (sequence == 0) {
-                //阻塞到下一个毫秒,获得新的时间戳
-                timestamp = tilNextMillis(lastTimestamp);
-            }
-        }
-        //时间戳改变,毫秒内序列重置
-        else {
-            sequence = 0L;
-        }
-
-        //上次生成ID的时间截
-        lastTimestamp = timestamp;
-
-        //移位并通过或运算拼到一起组成64位的ID
-        return ((timestamp - twepoch) << timestampLeftShift) //
-                | (datacenterId << datacenterIdShift) //
-                | (workerId << workerIdShift) //
-                | sequence;
-    }
-
-    /**
-     * 阻塞到下一个毫秒,直到获得新的时间戳
-     *
-     * @param lastTimestamp 上次生成ID的时间截
-     * @return 当前时间戳
-     */
-    protected long tilNextMillis(long lastTimestamp) {
-        long timestamp = timeGen();
-        while (timestamp <= lastTimestamp) {
-            timestamp = timeGen();
-        }
-        return timestamp;
-    }
-
-    /**
-     * 返回以毫秒为单位的当前时间
-     *
-     * @return 当前时间(毫秒)
-     */
-    protected long timeGen() {
-        return System.currentTimeMillis();
-    }
-}