This commit is contained in:
2023-01-04 13:54:55 +08:00
parent 6901090298
commit af3c5985ea
3 changed files with 22 additions and 1 deletions

View File

@@ -86,6 +86,8 @@ public interface InstructionService {
*/
Instruction findByTaskcode(String code);
Instruction findByCacheTaskcode(String code);
/**
* 根据任务id查询
*

View File

@@ -232,6 +232,17 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
return obj;
}
@Override
public Instruction findByCacheTaskcode(String task_code) {
for (int i = 0; i < this.instructions.size(); i++) {
Instruction inst = instructions.get(i);
if (StrUtil.equals(task_code, inst.getTask_code())) {
return inst;
}
}
return null;
}
@Override
public Instruction findByTaskid(String id, String wherecaluse) {
if (!StrUtil.isEmpty(wherecaluse)) {

View File

@@ -42,6 +42,14 @@ public class AutoCreateInst {
TaskDto acsTask = list.get(i);
String taskid = acsTask.getTask_id();
String taskcode = acsTask.getTask_code();
Instruction instruction = instructionService.findByCacheTaskcode(taskcode);
if (ObjectUtils.isNotEmpty(instruction)) {
acsTask.setRemark("该任务,已经生成指令!");
taskserver.updateByCodeFromCache(acsTask);
continue;
}
String vehiclecode = acsTask.getVehicle_code();
String priority = acsTask.getPriority();
String is_send = acsTask.getIs_send();
@@ -56,7 +64,7 @@ public class AutoCreateInst {
String next_point_code = acsTask.getNext_point_code();
if(StrUtil.equals(is_send,"0")){
if (StrUtil.equals(is_send, "0")) {
continue;
}
// if(StrUtil.equals(acsTask.getTask_type(),"1") || StrUtil.equals(acsTask.getTask_type(),"2")){