Переглянути джерело

处理事件json序列化异常

jiawuxian 2 роки тому
батько
коміт
f64bc37d10

+ 4 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/task/ResumptionTaskBusiness.java

@@ -397,6 +397,10 @@ public class ResumptionTaskBusiness extends TaskCreatingServiceImplBase<Resumpti
     }
 
     private List<Resumption> buildResumptions(AppPlan appPlan, SysOrg execOrg, Date planStartTime, Date planEndTime, List<Short> executedOrders, List<SysWorkTime> workTimes) {
+        if(ObjectUtil.equal(execOrg.getIsLock(),1)){
+            return  new ArrayList<>();
+        }
+
         List<Resumption> resumptionList = new ArrayList<>();
         Short count = 1;
         if (NumberUtil.isNumber(appPlan.getCount())) {

+ 4 - 3
soc-modules/soc-modules-system/src/main/java/com/xunmei/system/listener/WorkTimeChangeEventListener.java

@@ -1,6 +1,7 @@
 package com.xunmei.system.listener;
 
 import com.alibaba.fastjson2.JSON;
+import com.alibaba.nacos.shaded.com.google.gson.Gson;
 import com.xunmei.common.core.constant.SecurityConstants;
 import com.xunmei.common.core.event.WorkTimeChangeEvent;
 import com.xunmei.system.api.RemoteEduTrainingService;
@@ -38,9 +39,9 @@ public class WorkTimeChangeEventListener implements ApplicationListener<WorkTime
     public void onApplicationEvent(WorkTimeChangeEvent event) {
         CompletableFuture.supplyAsync(() ->
                 {
-                    remoteResumptionTaskService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
-                    eduTrainingService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
-                    remoteRetrievalTaskService.rebuild(JSON.toJSONString(event), SecurityConstants.INNER);
+                    remoteResumptionTaskService.rebuild(new Gson().toJson(event), SecurityConstants.INNER);
+                    eduTrainingService.rebuild(new Gson().toJson(event), SecurityConstants.INNER);
+                    remoteRetrievalTaskService.rebuild(new Gson().toJson(event), SecurityConstants.INNER);
                     return null;
                 }
         );