TRX 1 rok pred
rodič
commit
13d0dc14b6

+ 6 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/domain/schedule/ScheduleTaskConfig.java

@@ -1,5 +1,6 @@
 package com.zhongshu.card.server.core.domain.schedule;
 
+import cn.hutool.json.JSONObject;
 import com.zhongshu.card.client.type.DataState;
 import com.zhongshu.card.client.type.ScheduleType;
 import com.zhongshu.card.server.core.domain.base.SuperMain;
@@ -9,6 +10,8 @@ import lombok.Data;
 import lombok.NoArgsConstructor;
 import org.springframework.data.mongodb.core.mapping.Document;
 
+import java.util.HashMap;
+
 /**
  * 定时任务记录
  *
@@ -24,6 +27,9 @@ public class ScheduleTaskConfig extends SuperMain {
     @Schema(description = "关联的数据ID")
     private String aboutDataId;
 
+    @Schema(description = "关联的数据")
+    private HashMap<String, Object> data = new HashMap<>();
+
     @Schema(description = "定时任务类型")
     private ScheduleType scheduleType;
 

+ 9 - 0
FullCardServer/src/main/java/com/zhongshu/card/server/core/service/schedule/ScheduleTaskConfigService.java

@@ -1,5 +1,6 @@
 package com.zhongshu.card.server.core.service.schedule;
 
+import cn.hutool.json.JSONObject;
 import com.github.microservice.net.ResultContent;
 import com.zhongshu.card.client.type.DataState;
 import com.zhongshu.card.client.type.ScheduleType;
@@ -15,6 +16,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -59,12 +61,19 @@ public class ScheduleTaskConfigService {
             try {
                 String lockKey = projectMainPaySettingDao.acquire(entity.getId(), 5000L);
                 if (StringUtils.isNotEmpty(lockKey)) {
+//                    项目结算任务
                     String aboutDataId = entity.getProjectOid() + "_" + entity.getChannelType().name();
                     ScheduleTaskConfig taskConfig = scheduleTaskConfigDao.findTopByAboutDataId(aboutDataId);
                     if (ObjectUtils.isEmpty(taskConfig)) {
                         taskConfig = new ScheduleTaskConfig();
                     }
                     taskConfig.setAboutDataId(aboutDataId);
+                    HashMap<String, Object> data = new HashMap<>();
+                    data.put("projectOid", entity.getProjectOid());
+                    data.put("id", entity.getId());
+                    data.put("channelType", entity.getChannelType());
+
+                    taskConfig.setData(data);
                     taskConfig.setDataState(DataState.Enable);
                     taskConfig.setScheduleType(ScheduleType.SettlementTask);
                     String expression = "";