Jelajahi Sumber

Merge branch 'V0.1.0' into V0.1.1

jingyuanchao 1 tahun lalu
induk
melakukan
f6d50d4d6e

+ 6 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/drill/service/impl/CoreDrillPlanServiceImpl.java

@@ -426,8 +426,12 @@ public class CoreDrillPlanServiceImpl extends ServiceImpl<CoreDrillPlanMapper, C
 
         List<Long> longs = baseMapper.selectAllIdByParentId(plan.getId());
         if (!longs.isEmpty()) {
-            physicalDeleteMapper.deletedDrillPlanByIds(longs);
-            coreDrillPlanToExecOrgService.deleteByPlanIds(longs);
+            longs.remove(plan.getId());
+            if(!longs.isEmpty()){
+                baseMapper.delByIds(longs);
+            }
+//            physicalDeleteMapper.deletedDrillPlanByIds(longs);
+//            coreDrillPlanToExecOrgService.deleteByPlanIds(longs);
         }
 
 

+ 6 - 2
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/edu/service/impl/CoreEduTrainingPlanServiceImpl.java

@@ -393,8 +393,12 @@ public class CoreEduTrainingPlanServiceImpl extends ServiceImpl<CoreEduTrainingP
 
         List<Long> longs = baseMapper.selectAllIdByParentId(plan.getId());
         if (!longs.isEmpty()) {
-            physicalDeleteMapper.deletedEduPlanByIds(longs);
-            coreEduTrainingPlanToExecOrgService.deleteByPlanIds(longs);
+            longs.remove(plan.getId());
+            if(!longs.isEmpty()){
+                baseMapper.delByIds(longs);
+            }
+//            physicalDeleteMapper.deletedEduPlanByIds(longs);
+//            coreEduTrainingPlanToExecOrgService.deleteByPlanIds(longs);
         }
 
 

+ 2 - 1
soc-modules/soc-modules-core/src/main/resources/mapper/safetycheck/CoreSafecheckPlanMapper.xml

@@ -301,6 +301,7 @@
     </select>
     <select id="selectByCycle" resultType="com.xunmei.core.safetyCheck.domain.CoreSafecheckPlan">
         SELECT
+        DISTINCT
         p.*
         FROM
         core_safecheck_plan p
@@ -314,7 +315,7 @@
         <if test="cycle != null and cycle!=''">
             and p.plan_cycle=#{cycle}
         </if>
-        and ( o1.type = 3
+        and ( o1.type = 3 OR p.exec_org_type IN (1,2)
         OR o2.type IN (
         1,
         2

+ 3 - 2
soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/CoreDrillTask.java

@@ -1,5 +1,6 @@
 package com.xunmei.job.task;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.UUID;
 import com.alibaba.fastjson2.JSON;
 import com.xunmei.common.core.web.domain.AjaxResult;
@@ -24,10 +25,10 @@ public class CoreDrillTask {
         log.info("执行预案演练定时任务结束....,当前任务 id:{},当前时间:{},结果:{}", id, new Date(), JSON.toJSONString(result));
     }
 
-    public void buildDrillTask(Integer cycle, Date date) {
+    public void buildDrillTask(String cycle, String date) {
         String id = UUID.fastUUID().toString();
         log.info("开始执行预案演练定时任务,当前任务 id:{},周期:{},时间:{}", id, cycle, date);
-        AjaxResult result = remoteDrillService.buildDrillTask(cycle, date);
+        AjaxResult result = remoteDrillService.buildDrillTask(Integer.parseInt(cycle), DateUtil.parse(date));
         log.info("执行预案演练定时任务结束,当前任务 id:{},周期:{},时间:{},结果:{}", id, cycle, date, JSON.toJSONString(result));
     }
 

+ 3 - 2
soc-modules/soc-modules-job/src/main/java/com/xunmei/job/task/CoreEduTrainingTask.java

@@ -1,5 +1,6 @@
 package com.xunmei.job.task;
 
+import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.UUID;
 import com.alibaba.fastjson2.JSON;
 import com.xunmei.common.core.web.domain.AjaxResult;
@@ -24,10 +25,10 @@ public class CoreEduTrainingTask {
         log.info("执行教育培训定时任务结束....,当前任务 id:{},当前时间:{},结果:{}", id, new Date(), JSON.toJSONString(result));
     }
 
-    public void buildEduTask(Integer cycle, Date date) {
+    public void buildEduTask(String cycle, String date) {
         String id = UUID.fastUUID().toString();
         log.info("开始执行教育培训定时任务,当前任务 id:{},周期:{},时间:{}", id, cycle, date);
-        AjaxResult result = remoteEduTrainingService.buildEduTask(cycle, date);
+        AjaxResult result = remoteEduTrainingService.buildEduTask(Integer.parseInt(cycle), DateUtil.parse(date));
         log.info("执行教育培训定时任务结束,当前任务 id:{},周期:{},时间:{},结果:{}", id, cycle, date, JSON.toJSONString(result));
     }
 

+ 6 - 1
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/service/impl/ExportSqlServiceImpl.java

@@ -73,7 +73,12 @@ public class ExportSqlServiceImpl implements ExportSqlService {
     public Object executeSql(String sql) throws Exception {
         sql = Sm4Util.decryptEcb("51d95b1dc43a9faaad0570f81c755fcf",sql);
         sql = sql.toLowerCase();
-        if(sql.contains("select")){
+        // 脚本加密后 < > 符号被转义了
+        sql=sql.replace("&gt;",">");
+        sql=sql.replace("&lt;","<");
+
+        // 修改语句中也可能存在查询语句
+        if(sql.startsWith(("select"))){
             List<LinkedHashMap<String, Object>> maps = objectMapper.selectPublicItemList(sql);
             return maps;
         }