代码更新
This commit is contained in:
@@ -81,7 +81,7 @@ public class AutoCreateTask {
|
||||
|
||||
String status = result.getString("status");
|
||||
String message = result.getString("message");
|
||||
//发送失败的任务JSON集合:task_uuid,message
|
||||
//发送失败的任务JSON集合:task_id,message
|
||||
JSONArray errArr = result.getJSONArray("errArr");
|
||||
|
||||
//任务下发以后,更新任务状态
|
||||
@@ -89,7 +89,7 @@ public class AutoCreateTask {
|
||||
if ("200".equals(status)) {
|
||||
taskList.forEach(item -> {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_uuid", item.getTask_id());
|
||||
taskObj.put("task_id", item.getTask_id());
|
||||
taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
taskObj.put("remark", "下发成功");
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
@@ -98,7 +98,7 @@ public class AutoCreateTask {
|
||||
} else {//下发失败
|
||||
taskList.forEach(item -> {
|
||||
JSONObject taskObj = new JSONObject();
|
||||
taskObj.put("task_uuid", item.getTask_id());
|
||||
taskObj.put("task_id", item.getTask_id());
|
||||
taskObj.put("task_status", TaskStatusEnum.ISSUE.getCode());
|
||||
taskObj.put("remark", "下发失败:" + message);
|
||||
taskObj.put("update_time", DateUtil.now());
|
||||
|
||||
@@ -12,7 +12,6 @@ import org.nl.modules.system.service.GenCodeService;
|
||||
import org.nl.modules.wql.core.bean.ResultBean;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -23,7 +22,6 @@ import java.util.Set;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@CacheConfig(cacheNames = "genCode")
|
||||
public class GenCodeServiceImpl implements GenCodeService {
|
||||
@Override
|
||||
public JSONObject queryAll(Map form, Pageable pageable) {
|
||||
@@ -98,7 +96,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String codeDemo(Map form) {
|
||||
public synchronized String codeDemo(Map form) {
|
||||
String code = (String) form.get("code");
|
||||
String id = this.queryIdByCode(code);
|
||||
//如果flag=1就执行更新数据库的操作
|
||||
@@ -166,7 +164,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
||||
}
|
||||
demo += value;
|
||||
if (flag.equals("1")) {
|
||||
wo.update(jo);
|
||||
wo.update(jo,"id = '"+jo.getString("id")+"'");
|
||||
}
|
||||
}
|
||||
return demo;
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
package org.nl.modules.system.util;
|
||||
|
||||
import org.nl.modules.system.service.GenCodeService;
|
||||
import org.nl.modules.system.service.impl.GenCodeServiceImpl;
|
||||
import org.nl.modules.wql.util.SpringContextHolder;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
public class CodeUtil {
|
||||
|
||||
public static synchronized String getNewCode(String ruleCode){
|
||||
GenCodeService service=new GenCodeServiceImpl();
|
||||
public static String getNewCode(String ruleCode){
|
||||
String flag = "1";
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("flag",flag);
|
||||
map.put("code",ruleCode);
|
||||
return service.codeDemo(map);
|
||||
return SpringContextHolder.getBean(GenCodeService.class).codeDemo(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user