rev:更新
This commit is contained in:
@@ -276,4 +276,6 @@ public interface InstructionService {
|
||||
|
||||
|
||||
void init(String id);
|
||||
|
||||
List<Instruction> findByTaskCodeFromCache(String task_code);
|
||||
}
|
||||
|
||||
@@ -1435,4 +1435,13 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
((SiemensConveyorDeviceDriver) startDeviceDriver).writing(list);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Instruction> findByTaskCodeFromCache(String task_code) {
|
||||
return Optional.ofNullable(instructions)
|
||||
.orElse(new ArrayList<>())
|
||||
.stream()
|
||||
.filter(instruction -> instruction.getTask_code().equals(task_code))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.modules.quartz.task;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@@ -39,7 +40,11 @@ public class AutoCreateInst {
|
||||
List<TaskDto> list = taskserver.queryAll("task_status = '0'");
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TaskDto acsTask = list.get(i);
|
||||
if(StrUtil.equals(acsTask.getTask_type(),"7") && !StrUtil.startWith(acsTask.getTask_code(), "-") ){
|
||||
List<Instruction> instructionList = instructionService.findByTaskCodeFromCache(acsTask.getTask_code());
|
||||
if (ObjectUtil.isNotEmpty(instructionList)) {
|
||||
continue;
|
||||
}
|
||||
if (StrUtil.equals(acsTask.getTask_type(), "7") && !StrUtil.startWith(acsTask.getTask_code(), "-")) {
|
||||
continue;
|
||||
}
|
||||
String taskid = acsTask.getTask_id();
|
||||
|
||||
@@ -15,6 +15,8 @@ import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -98,13 +100,14 @@ public class GenCodeServiceImpl implements GenCodeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
|
||||
public String codeDemo(Map form) {
|
||||
String code = (String) form.get("code");
|
||||
String id = this.queryIdByCode(code);
|
||||
//如果flag=1就执行更新数据库的操作
|
||||
String flag = (String) form.get("flag");
|
||||
WQLObject wo = WQLObject.getWQLObject("sys_code_rule_detail");
|
||||
JSONArray ja = wo.query("code_rule_id = '" + id + "'", " sort_num,type FOR UPDATE").getResultJSONArray(0);
|
||||
JSONArray ja = wo.query("code_rule_id = '" + id + "'", " sort_num,type").getResultJSONArray(0);
|
||||
String demo = "";
|
||||
boolean is_same = true;
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user