Просмотр исходного кода

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

ouyang 1 год назад
Родитель
Сommit
b9ed9c00d8
25 измененных файлов с 103 добавлено и 82 удалено
  1. 12 1
      project_data/sql/0.0.3/soc/soc.sql
  2. 0 0
      project_data/sql/0.0.4/nacos/nacos.sql
  3. 0 0
      project_data/sql/0.0.4/quartz/quartz.sql
  4. 7 0
      project_data/sql/0.0.4/soc/soc.sql
  5. 2 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskDetailVo.java
  6. 2 1
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskPageVo.java
  7. 2 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/vo/CoreEduTrainingTaskDetailVo.java
  8. 2 2
      soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/vo/SysLearningMaterialsPageVo.java
  9. 11 5
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java
  10. 1 9
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java
  11. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ProtectionServiceImpl.java
  12. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/protection/ProtectionLogPageVo.java
  13. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/protection/ProtectionPageVo.java
  14. 1 1
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java
  15. 7 6
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyCheck/service/impl/SafetyCheckRegisterSericeImpl.java
  16. 12 12
      soc-modules/soc-modules-core/src/main/java/com/xunmei/core/safetyindex/service/impl/CoreSafeLevelServiceImpl.java
  17. 2 2
      soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookAqbwbndjhMapper.xml
  18. 2 2
      soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookHsggbsdjMapper.xml
  19. 2 2
      soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookMapper.xml
  20. 6 0
      soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml
  21. 3 2
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysUserMapper.java
  22. 6 12
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java
  23. 1 1
      soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/SecurityUserExport.java
  24. 7 4
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysNfcBindMapper.xml
  25. 12 13
      soc-modules/soc-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 12 - 1
project_data/sql/0.0.3/soc/soc.sql

@@ -233,6 +233,16 @@ INSERT ignore INTO core_safety_index_calculate_rule_item (id, rule_id, indicator
 -- INSERT ignore INTO core_safety_index_calculate_rule_item (id, rule_id, indicator_note, calculate_type, indicator_days, item_type, item_value, order_num, create_time, create_by, update_time, update_by) VALUES (1717123345565184002, 1714172822255894529, '连续五次未登', 2, 5, null, 1, 0, now(), null, now(), null);
 -- INSERT ignore INTO core_safety_index_calculate_rule_item (id, rule_id, indicator_note, calculate_type, indicator_days, item_type, item_value, order_num, create_time, create_by, update_time, update_by) VALUES (1717123345569378306, 1714172822255894529, '连续十次未登', 2, 10, null, 1, 0, now(), null, now(), null);
 
+delete from sys_menu where id in (1728960667819544578);
+INSERT INTO sys_menu (id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, platform_type, icon, image_path, create_by, create_time, update_by, update_time, remark)
+VALUES (1728960667819544578, '安保部门从业人员导出', 100, 10, '', null, null, 1, 0, 'F', '0', '0', 'system:user:exportSecurity', '1', null, null, null, now(), '', null, '');
+delete from sys_role_menu where menu_id=1728960667819544578;
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (115, 1728960667819544578);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (116, 1728960667819544578);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (117, 1728960667819544578);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (118, 1728960667819544578);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (119, 1728960667819544578);
+INSERT INTO `sys_role_menu` (`role_id`, `menu_id`) VALUES (120, 1728960667819544578);
 -- 新增安保综合评价规则目录、菜单、页面及页面权限
 delete from sys_menu where id in (1714247486990786561,1712277074707779586,1712278645189414914,1714187591810588674,1714187748136493058,1714187851295399937,1714188002965626881,1714188131026116609);
 INSERT INTO sys_menu (id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, perms, platform_type, icon, image_path, create_by, create_time, update_by, update_time, remark) VALUES (1712277074707779586, '安全综合管理评价', 0, 13, '/safetyindex', null, null, 1, 0, 'M', '0', '0', '', '1', 'clipboard', null, null, now(), null, now(), '');
@@ -1555,4 +1565,5 @@ FROM
 	order by a.role_id	;
 -- 字段长度变更
 ALTER TABLE `core_drill_task`
-    MODIFY COLUMN `drill_site` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '演练地点' AFTER `drill_end_time`;
+    MODIFY COLUMN `drill_site` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '演练地点' AFTER `drill_end_time`;
+

+ 0 - 0
project_data/sql/0.0.4/nacos/nacos.sql


+ 0 - 0
project_data/sql/0.0.4/quartz/quartz.sql


+ 7 - 0
project_data/sql/0.0.4/soc/soc.sql

@@ -0,0 +1,7 @@
+UPDATE sys_dict_data set dict_label='停用' WHERE (dict_type='plan_status' and dict_value=1 ) or (dict_type='sys_user_is_lock' and dict_value=1 );
+
+DELETE FROM `sys_dict_type` WHERE dict_type='rule_status';
+DELETE FROM `sys_dict_data` WHERE dict_type='rule_status';
+INSERT INTO `sys_dict_type` (`dict_id`, `dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES (20231113157, '手册状态', 'rule_status', '0', 'jwx', '2023-11-27 14:55:51', '', NULL, NULL);
+INSERT INTO `sys_dict_data` (`dict_code`, `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 (20231114641, 0, '启用', '0', 'rule_status', NULL, 'default', 'N', '0', 'jwx', '2023-11-27 14:56:36', '', NULL, NULL);
+INSERT INTO `sys_dict_data` (`dict_code`, `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 (20231114643, 1, '停用', '1', 'rule_status', NULL, 'default', 'N', '0', 'jwx', '2023-11-27 14:56:44', '', NULL, NULL);

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskDetailVo.java

@@ -64,11 +64,11 @@ public class CoreDrillTaskDetailVo {
     @ApiModelProperty(value = "记录人名称")
     private String recorderName;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     @ApiModelProperty(value = "计划任务开始日期")
     private LocalDateTime startDate;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     @ApiModelProperty(value = "计划任务截止日期")
     private LocalDateTime endDate;
 

+ 2 - 1
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/drill/vo/CoreDrillTaskPageVo.java

@@ -31,6 +31,8 @@ public class CoreDrillTaskPageVo {
     @ApiModelProperty(value = "机构")
     private Long orgId;
 
+    private Integer orgType;
+
     @ApiModelProperty(value = "机构名称")
     private String orgName;
 
@@ -57,7 +59,6 @@ public class CoreDrillTaskPageVo {
     @ApiModelProperty(value = "演练地点")
     private String drillSite;
 
-
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     @ApiModelProperty(value = "任务计划开始日期")
     private Date startDate;

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/vo/CoreEduTrainingTaskDetailVo.java

@@ -57,11 +57,11 @@ public class CoreEduTrainingTaskDetailVo {
     @ApiModelProperty(value = "记录人名称")
     private String recorderName;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     @ApiModelProperty(value = "计划任务开始日期")
     private LocalDateTime startDate;
 
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
     @ApiModelProperty(value = "计划任务截止日期")
     private LocalDateTime endDate;
 

+ 2 - 2
soc-common/soc-common-core/src/main/java/com/xunmei/common/core/domain/edu/vo/SysLearningMaterialsPageVo.java

@@ -46,10 +46,10 @@ public class SysLearningMaterialsPageVo {
     private String createBy;
 
     @ApiModelProperty(value = "上传时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date createTime;
     @ApiModelProperty(value = "更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date updateTime;
 
     @ApiModelProperty(value = "附件")

+ 11 - 5
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillTaskServiceImpl.java

@@ -39,6 +39,7 @@ import com.xunmei.common.core.exception.SystemException;
 import com.xunmei.common.core.utils.DateUtils;
 import com.xunmei.common.core.web.domain.AjaxResult;
 import com.xunmei.common.core.web.page.TableDataInfo;
+import com.xunmei.common.redis.utils.RedisUtils;
 import com.xunmei.common.security.utils.DictUtils;
 import com.xunmei.common.security.utils.SecurityUtils;
 import com.xunmei.core.TaskCreatingServiceImplBase;
@@ -56,6 +57,7 @@ import com.xunmei.system.api.domain.SysDictData;
 import com.xunmei.system.api.domain.SysOrg;
 import com.xunmei.system.api.domain.SysUser;
 import com.xunmei.system.api.function.RemoteCallHandlerExecutor;
+import com.xunmei.system.api.vo.SysOrgVO;
 import io.netty.util.internal.StringUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -132,8 +134,9 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
                     .in(CoreDrillTaskToRole::getDrillTaskId, idList));
             Map<Long, List<CoreDrillTaskToRole>> listMap = roleList.stream().collect(Collectors.groupingBy(CoreDrillTaskToRole::getDrillTaskId));*/
             final List<CoreDrillTaskPageVo> records = pageData.getRecords();
+            final List<SysOrgVO> cacheList = RedisUtils.getCacheList(CacheConstants.ORG_CACHE_LIST_KEY);
             for (CoreDrillTaskPageVo record : records) {
-                dealData(record, records, null);
+                dealData(record, records, cacheList);
             }
             // records.sort(getComparator());
         }
@@ -164,11 +167,12 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
     }
 
 
-    private void dealData(CoreDrillTaskPageVo record, List<CoreDrillTaskPageVo> records, Map<Long, List<CoreDrillTaskToRole>> listMap) {
+    private void dealData(CoreDrillTaskPageVo record, List<CoreDrillTaskPageVo> records, List<SysOrgVO> cacheList) {
         record.setNo(records.indexOf(record) + 1);
         record.setTypeText(DrillType.getName(record.getType()));
         record.setStatusText(DrillDoStatus.getName(record.getStatus()));
         record.setCategoryText(DictUtils.getDictLabel(DictConstants.CORE_DRILL_CATEGORY, record.getCategory()));
+        cacheList.stream().filter(org -> ObjectUtil.equal(org.getId(), record.getOrgId())).findFirst().ifPresent(type -> record.setOrgType(type.getType()));
         /*List<CoreDrillTaskToRole> coreDrillTaskToRoles = listMap.get(record.getId());
         if (ObjectUtil.isNotEmpty(coreDrillTaskToRoles)) {
             record.setTaskRoleList(coreDrillTaskToRoles);
@@ -653,7 +657,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
             planIdList = coreDrillPlanMapper.selectIdByParentId(plan.getId());
             planId = null;
         }
-        if (ObjectUtil.isAllEmpty(planId,planIdList)){
+        if (ObjectUtil.isAllEmpty(planId, planIdList)) {
             return new ArrayList<>();
         }
         request.setStartTime(DateUtil.beginOfMonth(request.getStartTime()));
@@ -727,6 +731,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
 
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Integer sign(CoreDrillTaskSignDto request) {
         CoreDrillTask DrillTask = getById(request.getId());
         SysUser sysUser = SecurityUtils.getLoginUser().getSysUser();
@@ -746,8 +751,9 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
                 .eq(CoreDrillTaskToUser::getType, 1)
                 .eq(CoreDrillTaskToUser::getSign, 0));
         if (null == unSignNums || unSignNums == 0) {
-            DrillTask.setStatus(DrillDoStatus.WAIT_COMMENT.getCode());
+            DrillTask.setStatus(DrillDoStatus.DONE.getCode());
             coreDrillTaskMapper.updateById(DrillTask);
+            buildDrillTaskPdf(request.getId());
         }
        /* final List<CoreDrillTaskToUser> taskToUserList = taskToUserMapper.selectList(new LambdaUpdateWrapper<CoreDrillTaskToUser>()
                 .eq(CoreDrillTaskToUser::getDrillTaskId, request.getId()));
@@ -900,7 +906,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         //drillTask.setComment(request.getComment());
         drillTask.setRecStatus(0);
         int i = baseMapper.updateById(drillTask);
-        buildDrillTaskPdf(request.getTaskId());
+        //buildDrillTaskPdf(request.getTaskId());
 
         return i;
     }

+ 1 - 9
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/question/service/impl/QuestionServiceImpl.java

@@ -176,17 +176,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     public int insertQuestion(Question question) {
         question.setId(IDHelper.id());
 
-        if (ObjectUtil.equal(question.getSrcType(), QuestionSrcType.Resumption.getValue())) {
+        if (ObjectUtil.equal(question.getOrgId(),SecurityUtils.getLoginUser().getOrgId())) {
             question.setConfirmStatus(QuestionConfirmEnum.Confirmed.getValue());
             question.setReformStatus(QuestionReformEnum.Unreform.getValue());
-//            QuestionFlow flow = new QuestionFlow();
-//            flow.setQuestionId(question.getId());
-//            flow.setExecuteTime(new Date());
-//            flow.setExecutorId(SecurityUtils.getUserId());
-//            flow.setExecutorName(SecurityUtils.getLoginUser().getName());
-//            flow.setExecuteStatus(0);
-//            flow.setExecuteStep(QuestionStepEnum.confirm.getValue());
-//            questionFlowMapper.insert(flow);
         } else {
             question.setConfirmStatus(QuestionConfirmEnum.Unconfirm.getValue());
             question.setReformStatus(null);

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/ProtectionServiceImpl.java

@@ -160,7 +160,7 @@ public class ProtectionServiceImpl extends ServiceImpl<ProtectionMapper, Protect
         }
         //按规则分页
         page = this.protectionLogMapper.pageLog(page, request);
-        TableDataInfo<ProtectionPageVo> data = TableDataInfo.success(page);
+        TableDataInfo<ProtectionLogPageVo> data = TableDataInfo.success(page);
 //        int order=request.getPage()*request.getSize();
 //        for (Object row : data.getRows()) {
 //            ((ProtectionLogPageVo)row).setOrder(++order);

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/protection/ProtectionLogPageVo.java

@@ -39,7 +39,7 @@ public class ProtectionLogPageVo {
 //    private String orgName;
 
     @ApiModelProperty("更新时间")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     private Date updateTime;
 
     @ApiModelProperty("防区状态")

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/protection/ProtectionPageVo.java

@@ -72,7 +72,7 @@ public class ProtectionPageVo {
     /**
      * 布撤防时间
      */
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
     @ExcelProperty(value = "最近登记时间",index = 6)
     @ColumnWidth(20)
     private  Date statusUpdateTime;

+ 1 - 1
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/retrieval/service/impl/CoreMonitoringRetrievalTaskServiceImpl.java

@@ -315,7 +315,7 @@ public class CoreMonitoringRetrievalTaskServiceImpl extends ServiceImpl<CoreMoni
             safeScoreResumptionDataVo.setTaskName(task.getTaskName());
             safeScoreResumptionDataVo.setOrgName(task.getOrgName());
             safeScoreResumptionDataVo.setExecPostName(map.get(task.getRoleId()));
-            safeScoreResumptionDataVo.setPlanTimeStart(task.getPlanEndTime());
+            safeScoreResumptionDataVo.setPlanTimeStart(task.getPlanStartTime());
             safeScoreResumptionDataVo.setPlanTimeEnd(task.getPlanEndTime());
             list.add(safeScoreResumptionDataVo);
         }

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

@@ -673,17 +673,18 @@ public class SafetyCheckRegisterSericeImpl extends ServiceImpl<CoreSafetyTaskMap
             }
         }
 
-        if (ObjectUtil.isNull(task.getGrantUserId())) {
-            Long uncompletedCount = tasks.stream()
-                    .filter(t -> !ObjectUtil.equal(t.getStatus(), SafetyCheckTaskStatus.Completed.getValue()) && ObjectUtil.isNull(t.getGrantUserId()))
+//        if (ObjectUtil.isNull(task.getGrantUserId())) {
+            Long canGrantCount = tasks.stream()
+                    .filter(t -> !ObjectUtil.equal(t.getStatus(), SafetyCheckTaskStatus.Completed.getValue()) &&
+                            ObjectUtil.notEqual(t.getStatus(),SafetyCheckTaskStatus.OverDue.getValue()))
                     .count();
             Long selfCompletedCount = tasks.stream()
-                    .filter(t -> ObjectUtil.equal(t.getStatus(), SafetyCheckTaskStatus.Completed.getValue()) && ObjectUtil.equal(t.getSubmitorId(), loginUserId))
+                    .filter(t -> ObjectUtil.equal(t.getStatus(), SafetyCheckTaskStatus.Completed.getValue()) && ObjectUtil.isNull(t.getGrantUserId()))
                     .count();
-            if (uncompletedCount <= 1 && selfCompletedCount == 0) {
+            if (canGrantCount <= 1 && selfCompletedCount == 0) {
                 throw new ServiceException("网点负责人每月亲自检查不少于1次");
             }
-        }
+//        }
 
         LambdaUpdateWrapper<CoreSafetyTask> updateWrapper = new LambdaUpdateWrapper<>();
         updateWrapper.eq(CoreSafetyTask::getId, dto.getTaskId())

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

@@ -88,28 +88,28 @@ public class CoreSafeLevelServiceImpl extends ServiceImpl<CoreSafeLevelMapper, C
     @Override
     public int updateCoreSafeLevel(CoreSafeLevel coreSafeLevel) {
         final List<CoreSafeLevel> list = coreSafeLevelMapper.selectList(null);
-        list.removeIf(item-> ObjectUtil.equal(item.getId(),coreSafeLevel.getId()));
-        /*for (CoreSafeLevel level : list) {
-            if (level.getMinValue().intValue()<coreSafeLevel.getMinValue().intValue()&&coreSafeLevel.getMinValue().intValue()<level.getMaxValue().intValue()){
+        list.removeIf(item -> ObjectUtil.equal(item.getId(), coreSafeLevel.getId()));
+        for (CoreSafeLevel level : list) {
+            if (level.getMinValue().intValue() < coreSafeLevel.getMinValue().intValue() && coreSafeLevel.getMinValue().intValue() < level.getMaxValue().intValue()) {
                 throw new RuntimeException("最小值已存在其他等级区间,请重新设置!");
             }
-            if (level.getMinValue().intValue()<coreSafeLevel.getMaxValue().intValue()&&coreSafeLevel.getMaxValue().intValue()<level.getMaxValue().intValue()){
-                throw new RuntimeException("最值已存在其他等级区间,请重新设置!");
+            if (level.getMinValue().intValue() < coreSafeLevel.getMaxValue().intValue() && coreSafeLevel.getMaxValue().intValue() < level.getMaxValue().intValue()) {
+                throw new RuntimeException("最值已存在其他等级区间,请重新设置!");
             }
-        }*/
-        String desc= getDesc(coreSafeLevel);
+        }
+        String desc = getDesc(coreSafeLevel);
         coreSafeLevel.setDescription(desc);
         return coreSafeLevelMapper.updateById(coreSafeLevel);
     }
 
     private String getDesc(CoreSafeLevel coreSafeLevel) {
-        if (coreSafeLevel.getId() == 1){
-            return coreSafeLevel.getMinValue()+"分(不含)以上";
+        if (coreSafeLevel.getId() == 1) {
+            return coreSafeLevel.getMinValue() + "分(不含)以上";
         }
-        if (coreSafeLevel.getId() == 2||coreSafeLevel.getId() == 3){
-            return coreSafeLevel.getMinValue()+"分(不含)与"+coreSafeLevel.getMaxValue()+"分(含)之间 ";
+        if (coreSafeLevel.getId() == 2 || coreSafeLevel.getId() == 3) {
+            return coreSafeLevel.getMinValue() + "分(不含)与" + coreSafeLevel.getMaxValue() + "分(含)之间 ";
         }
-        return coreSafeLevel.getMaxValue()+"分及以下";
+        return coreSafeLevel.getMaxValue() + "分及以下";
     }
 
 

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookAqbwbndjhMapper.xml

@@ -73,7 +73,7 @@
         a.type,
         a.year,
         u2.name as userName,
-        o.name as orgName,
+        o.short_name as orgName,
         group_concat(u.name) as userNames
         from core_safety_book_aqbwbndjh a
         left join core_safety_book_aqbwbndjh_user au on au.aqbwbndjh_id=a.id
@@ -114,7 +114,7 @@
                a.org_id,
                a.type,
                a.year,
-               o.name as org_name,
+               o.short_name as org_name,
                group_concat(u.name) as userNames
         from core_safety_book_aqbwbndjh a
                  left join core_safety_book_aqbwbndjh_user au on au.aqbwbndjh_id = a.id

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookHsggbsdjMapper.xml

@@ -66,7 +66,7 @@
             h.update_by,
             h.images,
                h.join_names,
-               o.name as org_name,
+               o.short_name as org_name,
             group_concat( u.NAME ) AS userNames
         FROM
             core_safety_book_hsggbsdj h
@@ -106,7 +106,7 @@
         h.update_by,
         h.images,
                h.join_names,
-        o.name as org_name,
+        o.short_name as org_name,
                h.org_id,
         group_concat( u.NAME ) AS userNames
         FROM

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/safetybook/CoreSafetyBookMapper.xml

@@ -69,7 +69,7 @@
         b.update_time,
         b.deleted,
         b.type,
-        o.name as org_name,
+        o.short_name as org_name,
         u.name as user_name
         from core_safety_book b
         left join sys_org o on b.org_id=o.id
@@ -99,7 +99,7 @@
                b.update_time,
                b.deleted,
                b.type,
-               o.name as org_name,
+               o.short_name as org_name,
                u.name as user_name
         from core_safety_book b
                  left join sys_org o on b.org_id=o.id

+ 6 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafetyTaskMapper.xml

@@ -867,6 +867,12 @@ SELECT t.id,
         <if test="task.status != null  and task.status != ''">
             and t.status =#{task.status}
         </if>
+        <if test="task.checkOrgIds!=null and task.checkOrgIds.size>0">
+            and t.org_id in
+            <foreach collection="task.checkOrgIds" close=")" open="(" separator="," item="id">
+                #{id}
+            </foreach>
+        </if>
         <!--        <if test="task.roleId != null  and task.roleId != ''">-->
         <!--            and t.role_id =#{task.roleId}-->
         <!--        </if>-->

+ 3 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/mapper/SysUserMapper.java

@@ -159,7 +159,8 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
     List<SysUser> selectUserListByRoleAndOrg(@Param("sysRoleOrgDTO") SysPlanOrgDTO sysRoleOrgDTO);
 
     List<UserExport> select(@Param("info") SysUser user);
-    List<SecurityUserExport>selectSecurityUser();
 
-    List<String> selectCountByNames(@Param("names")List<String> names);
+    List<SecurityUserExport> selectSecurityUser(@Param("path") String path);
+
+    List<String> selectCountByNames(@Param("names") List<String> names);
 }

+ 6 - 12
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/SysUserServiceImpl.java

@@ -56,30 +56,22 @@ import java.util.stream.Collectors;
 @Service
 public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
     private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
-
+    @Autowired
+    protected Validator validator;
     @Autowired
     private SysUserMapper userMapper;
-
     @Autowired
     private SysRoleMapper roleMapper;
-
     @Autowired
     private SysPostMapper postMapper;
-
     @Autowired
     private SysUserRoleMapper userRoleMapper;
-
     @Autowired
     private SysUserPostMapper userPostMapper;
-
     @Autowired
     private ISysConfigService configService;
-
     @Autowired
     private ISysOrgService orgService;
-
-    @Autowired
-    protected Validator validator;
     @Autowired
     private SysOrgMapper sysOrgMapper;
     @Autowired
@@ -699,7 +691,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
 
     @Override
     public List<SecurityUserExport> downSecurityUser() {
-        List<SecurityUserExport> securityUserExports = userMapper.selectSecurityUser();
+        SysOrg sysOrg2 = orgService.selectSysOrgById(SecurityUtils.getLoginUser().getOrgId());
+        List<SecurityUserExport> securityUserExports = userMapper.selectSecurityUser(sysOrg2.getPath());
         securityUserExports.forEach(s -> {
             s.setCity("福建");
             SysOrg sysOrg = sysOrgMapper.selectById(s.getOrgId());
@@ -732,7 +725,8 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             //取得方式
             String sysEducationType = iSysDictDataService.selectDictLabel("sys_education_type", s.getEducationType());
             s.setEducationType(sysEducationType);
-            String sysDuties = iSysDictDataService.selectDictLabel("sys_duties", s.getResponsibilitiesLeaderDuties());s.setResponsibilitiesLeaderDuties(sysDuties);
+            String sysDuties = iSysDictDataService.selectDictLabel("sys_duties", s.getResponsibilitiesLeaderDuties());
+            s.setResponsibilitiesLeaderDuties(sysDuties);
         });
         return securityUserExports;
     }

+ 1 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/util/SecurityUserExport.java

@@ -50,7 +50,7 @@ public class SecurityUserExport {
     private Date entryTime;
     @ExcelProperty(value = "工作年限", index = 12)
     private String workDuration;
-    @ExcelProperty(value = "最高学历", index = 13)
+    @ExcelProperty(value="最高学历", index = 13)
     private String highestEducation;
     @ExcelProperty(value = "取得方式", index = 14)
     private String educationType;

+ 7 - 4
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysNfcBindMapper.xml

@@ -123,7 +123,10 @@
         order by a.org_id,a.area_id,code
     </select>
     <select id="selectSysNfcBindByCode" resultType="com.xunmei.system.domain.SysNfcBind">
-        SELECT * FROM sys_nfc_bind WHERE del_flag=0 AND code=#{code}
+        SELECT *
+        FROM sys_nfc_bind
+        WHERE del_flag = 0
+          AND code = #{code}
     </select>
 
     <insert id="insertSysNfcBind" parameterType="com.xunmei.system.domain.SysNfcBind">
@@ -256,8 +259,8 @@
         </foreach>
     </delete>
     <delete id="deleteSysNfcBindByCode">
-        delete
-        from sys_nfc_bind
-        where  code = #{code}
+        UPDATE sys_nfc_bind
+        set del_flag=2
+        where code = #{code}
     </delete>
 </mapper>

+ 12 - 13
soc-modules/soc-modules-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -220,24 +220,21 @@
         select id, username
         from sys_user
         where username = #{userName}
-          and deleted = '0'
-        limit 1
+          and deleted = '0' limit 1
     </select>
 
     <select id="checkPhoneUnique" parameterType="String" resultType="com.xunmei.system.api.domain.SysUser">
         select id, phone
         from sys_user
         where phone = #{phonenumber}
-          and deleted = '0'
-        limit 1
+          and deleted = '0' limit 1
     </select>
 
     <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
         select user_id, email
         from sys_user
         where email = #{email}
-          and deleted = '0'
-        limit 1
+          and deleted = '0' limit 1
     </select>
 
     <insert id="insertUser" parameterType="com.xunmei.system.api.domain.SysUser" useGeneratedKeys="true"
@@ -411,8 +408,8 @@
         (
         SELECT
         h.user_id AS is_manager,
-<!--        ur. role_names,-->
-<!--        ur. roleIds,-->
+        <!--        ur. role_names,-->
+        <!--        ur. roleIds,-->
         GROUP_CONCAT(sr.role_name) role_names,
         CONCAT(",",GROUP_CONCAT( sr.id ),",") as roleIds,
         u.id,
@@ -455,10 +452,10 @@
         sys_user u
         LEFT JOIN sys_org o ON u.original_org_id = o.id
         LEFT JOIN ( SELECT user_id FROM sys_user_role uo LEFT JOIN sys_role ro ON uo.role_id = ro.id WHERE ro.role_name
-<!--        LIKE '%安全保卫管理人员' group by user_id) h ON h.user_id = u.id-->
-<!--        LEFT JOIN (select sro.user_id, GROUP_CONCAT(sr.role_name) role_names,-->
-<!--        CONCAT(",",GROUP_CONCAT( sr.id ),",") as roleIds from sys_user_role sro-->
-<!--        LEFT JOIN sys_role sr on sro.role_id=sr.id) ur on ur.user_id = u.id-->
+        <!--        LIKE '%安全保卫管理人员' group by user_id) h ON h.user_id = u.id-->
+        <!--        LEFT JOIN (select sro.user_id, GROUP_CONCAT(sr.role_name) role_names,-->
+        <!--        CONCAT(",",GROUP_CONCAT( sr.id ),",") as roleIds from sys_user_role sro-->
+        <!--        LEFT JOIN sys_role sr on sro.role_id=sr.id) ur on ur.user_id = u.id-->
         LIKE '%安全保卫管理人员' ) h ON h.user_id = u.id
         LEFT JOIN sys_user_role sro on u.id=sro.user_id
         LEFT JOIN sys_role sr on sro.role_id=sr.id
@@ -511,7 +508,7 @@
         <!--        <if test="info.onlyManager ==false or info.onlyManager==null">-->
         <!--            AND (t.is_manage is NULL OR t.is_manage ='N')-->
         <!--        </if>-->
-        ORDER BY  t.org_id DESC, t.id DESC
+        ORDER BY t.org_id DESC, t.id DESC
     </select>
     <select id="selectrolesByOrgId" resultType="com.xunmei.system.api.domain.SysRole">
         SELECT r.*
@@ -736,5 +733,7 @@
                  LEFT JOIN sys_user b ON a.user_id = b.id
                  LEFT JOIN sys_org c ON c.id = b.org_id
         WHERE b.deleted = 0
+          and c.path like concat(#{path}, '%')
+
     </select>
 </mapper>