浏览代码

Merge branch 'V0.0.2' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.2

jiawuxian 2 年之前
父节点
当前提交
f5ab63d2bb

+ 22 - 2
project_data/sql/0.0.2/soc/soc.sql

@@ -783,6 +783,7 @@ CREATE TABLE `core_safety_task_data_nfc` (
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='安全检查nfc扫描表';
 
 -- 新增系统参数:演练任务行社推荐数量单季度最大值,演练任务地区推荐数量单季度最大值
+delete from sys_config where config_key in ('HS_REC_DRILL_TASK_MAX','AREA_REC_DRILL_TASK_MAX');
 INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('演练任务行社推荐数量单季度最大值', 'HS_REC_DRILL_TASK_MAX', '3', 'Y', '超级管理员', '2023-09-21 11:20:41', '', null, null);
 INSERT INTO sys_config (config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark) VALUES ('演练任务地区推荐数量单季度最大值', 'AREA_REC_DRILL_TASK_MAX', '3', 'Y', '超级管理员', '2023-09-21 11:35:30', '', null, null);
 
@@ -1054,8 +1055,27 @@ DELIMITER ;
 CALL add_column_if_not_exists();
 DROP PROCEDURE add_column_if_not_exists;
 
+//
+DELIMITER $$
+CREATE PROCEDURE add_column_if_not_exists()
+BEGIN
+  IF NOT EXISTS (
+      SELECT *
+      FROM INFORMATION_SCHEMA.COLUMNS
+      WHERE TABLE_NAME = 'sys_user'
+      AND COLUMN_NAME = 'is_manage'
+  )
+  THEN
+ALTER TABLE sys_user
+    ADD COLUMN `is_manage` VARCHAR(2) DEFAULT NULL COMMENT '是否管理人员:Y是,N否';
+END IF;
+END$$
+DELIMITER ;
 
 
+CALL add_column_if_not_exists();
+DROP PROCEDURE add_column_if_not_exists;
+
 /*
  Navicat Premium Data Transfer
 
@@ -1406,7 +1426,7 @@ INSERT INTO `sys_menu` (`id`, `menu_name`, `parent_id`, `order_num`, `path`, `co
 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 (00000000000000002318, '检查任务', 2326, 4, 'check/task/index', 'check/task/index', NULL, 1, 0, 'C', '0', '0', '', '1', 'documentation', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 DELETE FROM sys_menu WHERE id IN(2359,2360,2361,2362,2363,2364,2365)
 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 (2359, '信息发送管理', 2207, 3, 'send', 'information/send/index', NULL, 1, 1, 'C', '0', '0', 'core:send:list', '1', 'email', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (2359, '信息发送管理', 2207, 3, 'send', 'core/send/index', NULL, 1, 1, 'C', '0', '0', 'core:send:list', '1', 'email', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (2360, '新增', 2359, 1, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:add', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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`)
@@ -1416,7 +1436,7 @@ VALUES (2362, '修改', 2359, 3, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:se
 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 (2363, '详情', 2359, 4, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:send:query', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (2364, '履职临期提醒', 2207, 3, 'configuration', 'information/configuration/index', NULL, 1, 1, 'C', '0', '0', 'core:configuration:query', '1', 'dashboard', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
+VALUES (2364, '履职临期提醒', 2207, 3, 'configuration', 'core/configuration/index', NULL, 1, 1, 'C', '0', '0', 'core:configuration:query', '1', 'dashboard', NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 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 (2365, '提交', 2364, 1, NULL, NULL, NULL, 1, 0, 'F', '0', '0', 'core:configuration:add', '1', NULL, NULL, '超级管理员', '2023-09-21 10:37:52', '超级管理员', '2023-09-22 09:42:43', '');
 delete from sys_role_menu where menu_id in(2359,2360,2361,2362,2363,2364,2365) ;

+ 2 - 1
soc-api/soc-api-system/src/main/java/com/xunmei/system/api/domain/SysUser.java

@@ -54,7 +54,8 @@ public class SysUser extends BaseEntity {
      */
     @ApiModelProperty(value = "启用/禁用")
     private String isLock;
-
+    @ApiModelProperty(value = "是否管理员")
+    private String isManage;
     /**
      * 岗位
      */

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

@@ -81,11 +81,9 @@ public class CoreDrillTaskDetailVo {
     private String drillSite;
 
 
-    @TableField("comment_score")
     @ApiModelProperty(value = "评分")
-    private String commentScore;
+    private Integer commentScore;
 
-    @TableField("comment")
     @ApiModelProperty(value = "评语")
     private String comment;
 

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

@@ -85,7 +85,7 @@ public class CoreDrillTaskPageVo {
     private String signNums;
 
     @ApiModelProperty(value = "评分")
-    private String commentScore;
+    private Integer commentScore;
 
     @ApiModelProperty(value = "评语")
     private String comment;

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

@@ -643,7 +643,7 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
         dealRecListParam(request);
         IPage<CoreDrillTaskRecPageVo> page;
         if (request.getRecStatus() != null) {
-            page = coreDrillTaskMapper.selectRecPage(request.getPageRequest(), request, Arrays.asList(request.getRecStatus()));
+            page = coreDrillTaskMapper.selectRecPage(request.getPageRequest(), request, Collections.singletonList(request.getRecStatus()));
         } else {
             page = coreDrillTaskMapper.selectRecPage(request.getPageRequest(), request, getRecStatus());
         }
@@ -770,28 +770,43 @@ public class CoreDrillTaskServiceImpl extends ServiceImpl<CoreDrillTaskMapper, C
 
     private void checkRecNum(CoreDrillTask drillTask, Integer recStatus) {
 
+        List<Long> collect = Stream.of(drillTask.getOrgPath().split("-")).map(Long::valueOf).collect(Collectors.toList());
+        List<SysOrg> sysOrgList = RemoteCallHandlerExecutor.executeRemoteCall(()->
+                orgService.selectOrgByIdList(collect, SecurityConstants.INNER), ErrorMsgConstants.QUERY_ORG_DATA_ERROR);
+
         DrillRecStatus drillRecStatus = DrillRecStatus.getDrillRecStatus(recStatus);
         if (drillRecStatus == null) {
             throw new SystemException("推荐状态异常!");
         }
         SysConfig sysConfig;
         if (ObjectUtil.equal(drillRecStatus, DrillRecStatus.REC_REGION_EXCELLENT_CASE)) {
+
             sysConfig = RemoteCallHandlerExecutor.executeRemoteCall(() ->
-                    remoteConfigService.findSysConfigByCode(SystemParameterConstant.HS_REC_DRILL_TASK_MAX, SecurityConstants.INNER), ErrorMsgConstants.QUERY_CONFIG_ERROR);
+                    remoteConfigService.findSysConfigByCode(SystemParameterConstant.HS_REC_DRILL_TASK_MAX, SecurityConstants.INNER),
+                    ErrorMsgConstants.QUERY_CONFIG_ERROR);
+
+            SysOrg sysOrg = sysOrgList.stream().filter(org -> ObjectUtil.equal(org.getType(), OrgTypeEnum.HANG_SHE.getCode()))
+                    .findFirst().orElseThrow(() -> new SystemException(ErrorMsgConstants.QUERY_ORG_DATA_ERROR));
+
             Long count = coreDrillTaskMapper.selectCount(new LambdaQueryWrapper<CoreDrillTask>()
                     .eq(CoreDrillTask::getRecStatus, DrillRecStatus.REC_REGION_EXCELLENT_CASE.getCode())
-                    .likeRight(CoreDrillTask::getOrgPath, drillTask.getOrgPath()));
+                    .likeRight(CoreDrillTask::getOrgPath, sysOrg.getPath()));
             if (count != null && count >= Integer.parseInt(sysConfig.getConfigValue())) {
                 throw new SystemException("推荐地区优秀案例已达上限!");
             }
         }
         if (ObjectUtil.equal(drillRecStatus, DrillRecStatus.REC_PROVINCE_EXCELLENT_CASE)) {
+
             sysConfig = RemoteCallHandlerExecutor.executeRemoteCall(() ->
-                    remoteConfigService.findSysConfigByCode(SystemParameterConstant.AREA_REC_DRILL_TASK_MAX, SecurityConstants.INNER), ErrorMsgConstants.QUERY_CONFIG_ERROR);
+                    remoteConfigService.findSysConfigByCode(SystemParameterConstant.AREA_REC_DRILL_TASK_MAX, SecurityConstants.INNER),
+                    ErrorMsgConstants.QUERY_CONFIG_ERROR);
+
+            SysOrg sysOrg = sysOrgList.stream().filter(org -> ObjectUtil.equal(org.getType(), OrgTypeEnum.BAN_SHI_CHU.getCode()))
+                    .findFirst().orElseThrow(() -> new SystemException(ErrorMsgConstants.QUERY_ORG_DATA_ERROR));
 
             Long count = coreDrillTaskMapper.selectCount(new LambdaQueryWrapper<CoreDrillTask>()
                     .eq(CoreDrillTask::getRecStatus, DrillRecStatus.REC_PROVINCE_EXCELLENT_CASE.getCode())
-                    .likeRight(CoreDrillTask::getOrgPath, drillTask.getOrgPath()));
+                    .likeRight(CoreDrillTask::getOrgPath, sysOrg.getPath()));
             if (count != null && count >= Integer.parseInt(sysConfig.getConfigValue())) {
                 throw new SystemException("推荐省级优秀案例已达上限!");
             }

+ 2 - 2
soc-modules/soc-modules-core/src/main/resources/mapper/drill/CoreDrillTaskMapper.xml

@@ -64,7 +64,7 @@
     <select id="selectPageData" resultType="com.xunmei.common.core.domain.drill.vo.CoreDrillTaskPageVo"
             parameterType="com.xunmei.common.core.domain.edu.dto.CoreEduTrainingTaskPageDto">
         select t.id, plan_id, t.org_id, t.org_name, title, type as type, status,rec_status, host_id,u.name as hostName,
-        start_date, end_date, t.drill_time, t.pdf_url as pdfUrl
+        start_date, end_date, t.drill_time, t.pdf_url as pdfUrl,drill_site as drillSite,comment_score as commentScore,comment
         from core_drill_task t left join sys_user u on t.host_id=u.id
         <where>
             <choose>
@@ -238,7 +238,7 @@
             and t.org_path like concat(#{request.orgPath},'%')
         </if>
         <if test="request.recStatus!=null">
-            and t.rec_status=#{request.recStatus}
+            and t.rec_status in (#{request.recStatus},#{request.recStatus+1})
         </if>
     </sql>
 

+ 6 - 2
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/controller/SysUserController.java

@@ -88,7 +88,11 @@ public class SysUserController extends BaseController {
 
         ajax.put("data", sysUserTableDataInfo);
         boolean admin = false;
-        String s = roleService.selectRoleNameByUserId(SecurityUtils.getUserId());
+        SysUser sysUser = userService.selectUserById(SecurityUtils.getUserId());
+        if (null!=sysUser&&"Y".equals(sysUser.getIsManage())){
+            admin=true;
+        }
+ /*       String s = roleService.selectRoleNameByUserId(SecurityUtils.getUserId());
         if (StringUtils.isNotEmpty(s)) {
             int i = s.indexOf(",");
 
@@ -103,7 +107,7 @@ public class SysUserController extends BaseController {
             } else if (s.endsWith("管理人员") || s.equals("超级管理员")) {
                 admin = true;
             }
-        }
+        }*/
 
         ajax.put("check", admin);
         return ajax;