This commit is contained in:
2023-02-06 16:16:34 +08:00
parent f977ceed49
commit 77ac88d8d4
2 changed files with 1377 additions and 1361 deletions

View File

@@ -10,6 +10,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.AcsConfig;
import org.nl.acs.agv.server.XianGongAgvService;
@@ -88,7 +89,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
}
public synchronized void reload() {
this.tasks = this.queryAll("task_status <2 and is_delete =0 order by create_time");
List list = this.queryAll("task_status <2 and is_delete =0 order by create_time");
tasks = new CopyOnWriteArrayList<>(list);
}
@Override
@@ -533,7 +536,9 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
tasks.add(dto);
synchronized(TaskServiceImpl.class){
tasks.add(dto);
}
}
/**
@@ -804,6 +809,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
TaskFeedbackDto feefbackdto = taskFeedbackService.findByCode(entity.getTask_code());
System.out.println(feefbackdto == null);
JSONObject feed_jo = new JSONObject();
feed_jo.put("task_id", entity.getTask_id());
feed_jo.put("task_code", entity.getTask_code());