From 9b3622cf449c54e420d7f4e97cc690cf6bd55713 Mon Sep 17 00:00:00 2001 From: gengby <858962040@qq.com> Date: Fri, 19 May 2023 13:15:46 +0800 Subject: [PATCH] =?UTF-8?q?rev=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DeviceServiceImpl.java | 224 +++++++++--------- ...CoveyorControlWithScannerDeviceDriver.java | 10 +- .../modules/quartz/task/AutoCreateInst.java | 2 + .../nl/modules/quartz/utils/ExecutionJob.java | 2 + .../service/impl/GenCodeServiceImpl.java | 13 +- .../org/nl/modules/system/util/CodeUtil.java | 16 +- acs/nladmin-ui/src/App.vue | 2 +- .../src/views/system/monitor/device/index.vue | 20 +- 8 files changed, 154 insertions(+), 135 deletions(-) diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index e836fd3..4ec9089 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -140,7 +140,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial public DeviceDto findByCode(String code) { WQLObject wo = WQLObject.getWQLObject("acs_device"); JSONObject json = wo.query("device_code ='" + code + "'").uniqueResult(0); - final DeviceDto obj = JSON.parseObject(String.valueOf(json), DeviceDto.class); + final DeviceDto obj = JSON.parseObject(String.valueOf(json), DeviceDto.class); return obj; } @@ -189,7 +189,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial dto.setUpdate_by(currentUsername); WQLObject wo = WQLObject.getWQLObject("acs_device"); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); wo.update(json); } @@ -234,7 +234,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial Iterator iterator = allDevice.iterator(); while (iterator.hasNext()) { Device device = iterator.next(); - if (StrUtil.equals(device.getDevice_code(),device_code)) { + if (StrUtil.equals(device.getDevice_code(), device_code)) { iterator.remove(); } } @@ -915,13 +915,15 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj); runpointwo.update(updatejson, "device_code = '" + device_code + "'"); } - } - else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { + } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.setMaterial(material_type); standardInspectSiteDeviceDriver.setBatch(batch); device.setMaterial_type(material_type); device.setBatch(batch); + } else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { + StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver(); + standardCoveyorControlWithScannerDeviceDriver.setDeviceStatus(form); } } @@ -1131,7 +1133,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial result.put("form", extraObj); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); String opc_id = dto.getOpc_server_id(); @@ -1162,14 +1164,14 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial JSONArray rs = WQLObject.getWQLObject("acs_device_extra").query("filed_type='02' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0); JSONArray r_arry = new JSONArray(); //先获取模板 - if(ObjectUtil.isNotEmpty(opcDeviceDriverDefination)){ + if (ObjectUtil.isNotEmpty(opcDeviceDriverDefination)) { List readableItemDtos = opcDeviceDriverDefination.getReadableItemDtos(); List readableItemJsons = new ArrayList<>(); for (int i = 0; i < readableItemDtos.size(); i++) { ItemDto itemDto = readableItemDtos.get(i); JSONObject readableItemJson = new JSONObject(); - readableItemJson.put("code",itemDto.getCode()); - readableItemJson.put("name",itemDto.getName()); + readableItemJson.put("code", itemDto.getCode()); + readableItemJson.put("name", itemDto.getName()); // readableItemJson.put("db",itemDto.getDb()); readableItemJsons.add(readableItemJson); } @@ -1180,7 +1182,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial String code = split[split.length - 1]; robj.put("code", code); robj.put("name", rs.getJSONObject(i).getString("remark")); - if (readableItemJsons.contains(robj)){ + if (readableItemJsons.contains(robj)) { robj.put("code", rs.getJSONObject(i).getString("extra_code")); robj.put("db", rs.getJSONObject(i).getString("extra_name")); r_arry.add(robj); @@ -1194,16 +1196,16 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial code = split[split.length - 1]; JSONObject jsonObject = new JSONObject(); jsonObject.put("code", code); - jsonObject.put("name",rJson.getString("name")); + jsonObject.put("name", rJson.getString("name")); rarry.add(jsonObject); } for (int i = 0; i < readableItemDtos.size(); i++) { ItemDto itemDto = readableItemDtos.get(i); JSONObject readableItemJson = new JSONObject(); - readableItemJson.put("code",itemDto.getCode()); - readableItemJson.put("name",itemDto.getName()); - if (!rarry.contains(readableItemJson)){ - readableItemJson.put("db",itemDto.getDb()); + readableItemJson.put("code", itemDto.getCode()); + readableItemJson.put("name", itemDto.getName()); + if (!rarry.contains(readableItemJson)) { + readableItemJson.put("db", itemDto.getDb()); r_arry.add(readableItemJson); } } @@ -1214,8 +1216,8 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial for (int i = 0; i < writeableItemDtos.size(); i++) { ItemDto itemDto = writeableItemDtos.get(i); JSONObject writeableItemJson = new JSONObject(); - writeableItemJson.put("code",itemDto.getCode()); - writeableItemJson.put("name",itemDto.getName()); + writeableItemJson.put("code", itemDto.getCode()); + writeableItemJson.put("name", itemDto.getName()); //writeableItemJson.put("db",itemDto.getDb()); writeableItemJsons.add(writeableItemJson); } @@ -1226,7 +1228,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial JSONObject robj = new JSONObject(); robj.put("code", code); robj.put("name", ws.getJSONObject(i).getString("remark")); - if (writeableItemJsons.contains(robj)){ + if (writeableItemJsons.contains(robj)) { robj.put("code", ws.getJSONObject(i).getString("extra_code")); robj.put("db", ws.getJSONObject(i).getString("extra_name")); w_arry.add(robj); @@ -1239,17 +1241,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial String[] split = code.split("\\."); code = split[split.length - 1]; JSONObject jsonObject = new JSONObject(); - jsonObject.put("code",code); - jsonObject.put("name",wJson.getString("name")); + jsonObject.put("code", code); + jsonObject.put("name", wJson.getString("name")); warry.add(jsonObject); } for (int i = 0; i < writeableItemDtos.size(); i++) { ItemDto itemDto = writeableItemDtos.get(i); JSONObject writeableItemJson = new JSONObject(); - writeableItemJson.put("code",itemDto.getCode()); - writeableItemJson.put("name",itemDto.getName()); - if (!warry.contains(writeableItemJson)){ - writeableItemJson.put("db",itemDto.getDb()); + writeableItemJson.put("code", itemDto.getCode()); + writeableItemJson.put("name", itemDto.getName()); + if (!warry.contains(writeableItemJson)) { + writeableItemJson.put("db", itemDto.getDb()); w_arry.add(writeableItemJson); } } @@ -1570,34 +1572,34 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial JSONArray rss = param.getJSONArray("rs"); JSONArray wss = param.getJSONArray("ws"); int numberSize = Integer.parseInt(form.getString("device_number")); - List> list = new LinkedList<>(); + List> list = new LinkedList<>(); - if (type.equals("db")){ + if (type.equals("db")) { for (int i = 0; i < numberSize; i++) { int dbInterval = db_interval * i; Integer deviceCode = device_code + i; for (int j = 0; j <= rss.size(); j++) { - Map map = new ListOrderedMap<>(); - if (j == rss.size()){ - map.put("设备编码",""); - map.put("读取地址",""); - map.put("读取意义",""); - map.put("",""); - map.put("写入地址",""); - map.put("写入意义",""); + Map map = new ListOrderedMap<>(); + if (j == rss.size()) { + map.put("设备编码", ""); + map.put("读取地址", ""); + map.put("读取意义", ""); + map.put("", ""); + map.put("写入地址", ""); + map.put("写入意义", ""); list.add(map); continue; } - if (i == 0 && j ==0){ - map.put("设备编码",""); - }else { - map.put("设备编码",deviceCode); + if (i == 0 && j == 0) { + map.put("设备编码", ""); + } else { + map.put("设备编码", deviceCode); } JSONObject rs = rss.getJSONObject(j); String db = rs.getString("db"); String name = rs.getString("name"); - if (i > 0){ - if (name.equals("心跳")){ + if (i > 0) { + if (name.equals("心跳")) { continue; } } @@ -1605,55 +1607,55 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial String startDB = dbs[0]; String endDB = dbs[1]; String endDBFirst = endDB.substring(0, 1); - Integer endDBEnd =Integer.parseInt(endDB.substring(1, endDB.length())) ; + Integer endDBEnd = Integer.parseInt(endDB.substring(1, endDB.length())); endDBEnd = endDBEnd + dbInterval; db = startDB + "." + endDBFirst + endDBEnd; - map.put("读取地址",db); - map.put("读取意义",name); - Map value = getValue(wss, j, dbInterval,i); + map.put("读取地址", db); + map.put("读取意义", name); + Map value = getValue(wss, j, dbInterval, i); map.putAll(value); list.add(map); System.out.println(map); } } - }else if (type.equals("v")){ + } else if (type.equals("v")) { for (int i = 0; i < numberSize; i++) { int dbInterval = db_interval * i; Integer deviceCode = device_code + i; for (int j = 0; j <= rss.size(); j++) { - Map map = new ListOrderedMap<>(); - if (j == rss.size()){ - map.put("设备编码",""); - map.put("读取地址",""); - map.put("读取意义",""); - map.put("",""); - map.put("写入地址",""); - map.put("写入意义",""); + Map map = new ListOrderedMap<>(); + if (j == rss.size()) { + map.put("设备编码", ""); + map.put("读取地址", ""); + map.put("读取意义", ""); + map.put("", ""); + map.put("写入地址", ""); + map.put("写入意义", ""); list.add(map); continue; } - if (i == 0 && j ==0){ - map.put("设备编码",""); - }else { - map.put("设备编码",deviceCode); + if (i == 0 && j == 0) { + map.put("设备编码", ""); + } else { + map.put("设备编码", deviceCode); } JSONObject rs = rss.getJSONObject(j); String db = rs.getString("db"); String name = rs.getString("name"); - if (i > 0){ - if (name.equals("心跳")){ + if (i > 0) { + if (name.equals("心跳")) { continue; } } //String[] dbs = db.split("\\."); - String startDB = db.substring(0,2); - String endDB = db.substring(2,db.length()); - Integer endDBEnd =Integer.parseInt(endDB) ; + String startDB = db.substring(0, 2); + String endDB = db.substring(2, db.length()); + Integer endDBEnd = Integer.parseInt(endDB); endDBEnd = endDBEnd + dbInterval; db = startDB + endDBEnd + ""; - map.put("读取地址",db); - map.put("读取意义",name); - Map value = getValue1(wss, j, dbInterval,i); + map.put("读取地址", db); + map.put("读取意义", name); + Map value = getValue1(wss, j, dbInterval, i); map.putAll(value); list.add(map); System.out.println(map); @@ -1665,17 +1667,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial FileUtil.downloadExcel(list, response); } - public Map getValue(JSONArray wss, int j, Integer dbInterval, int i){ + public Map getValue(JSONArray wss, int j, Integer dbInterval, int i) { int size = wss.size(); - Map map = new ListOrderedMap<>(); - if (i == 0 && j == 0){ - map.put("",""); - map.put("写入地址",""); - map.put("写入意义",""); + Map map = new ListOrderedMap<>(); + if (i == 0 && j == 0) { + map.put("", ""); + map.put("写入地址", ""); + map.put("写入意义", ""); return map; } - if (i == 0 && j > 0){ - if (j - 1 < size){ + if (i == 0 && j > 0) { + if (j - 1 < size) { JSONObject ws = wss.getJSONObject(j - 1); String db = ws.getString("db"); String name = ws.getString("name"); @@ -1683,19 +1685,19 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial String startDB = dbs[0]; String endDB = dbs[1]; String endDBFirst = endDB.substring(0, 1); - Integer endDBEnd =Integer.parseInt(endDB.substring(1, endDB.length())) ; + Integer endDBEnd = Integer.parseInt(endDB.substring(1, endDB.length())); endDBEnd = endDBEnd + dbInterval; db = startDB + "." + endDBFirst + endDBEnd; - map.put("",""); - map.put("写入地址",db); - map.put("写入意义",name); + map.put("", ""); + map.put("写入地址", db); + map.put("写入意义", name); return map; } } - if ( i > 0){ - j = j -1; + if (i > 0) { + j = j - 1; } - if (j < size){ + if (j < size) { JSONObject ws = wss.getJSONObject(j); String db = ws.getString("db"); String name = ws.getString("name"); @@ -1703,17 +1705,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial String startDB = dbs[0]; String endDB = dbs[1]; String endDBFirst = endDB.substring(0, 1); - Integer endDBEnd =Integer.parseInt(endDB.substring(1, endDB.length())) ; + Integer endDBEnd = Integer.parseInt(endDB.substring(1, endDB.length())); endDBEnd = endDBEnd + dbInterval; db = startDB + "." + endDBFirst + endDBEnd; - map.put("",""); - map.put("写入地址",db); - map.put("写入意义",name); + map.put("", ""); + map.put("写入地址", db); + map.put("写入意义", name); return map; } else { - map.put("",""); - map.put("写入地址",""); - map.put("写入意义",""); + map.put("", ""); + map.put("写入地址", ""); + map.put("写入意义", ""); return map; } } @@ -1806,52 +1808,52 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial ExportCSVUtil.responseSetProperties(fileName, bytes, response); } - public Map getValue1(JSONArray wss, int j, Integer dbInterval, int i){ + public Map getValue1(JSONArray wss, int j, Integer dbInterval, int i) { int size = wss.size(); - Map map = new ListOrderedMap<>(); - if (i == 0 && j == 0){ - map.put("",""); - map.put("写入地址",""); - map.put("写入意义",""); + Map map = new ListOrderedMap<>(); + if (i == 0 && j == 0) { + map.put("", ""); + map.put("写入地址", ""); + map.put("写入意义", ""); return map; } - if (i == 0 && j > 0){ - if (j - 1 < size){ + if (i == 0 && j > 0) { + if (j - 1 < size) { JSONObject ws = wss.getJSONObject(j - 1); String db = ws.getString("db"); String name = ws.getString("name"); //String[] dbs = db.split("\\."); String startDB = db.substring(0, 2); - String endDB = db.substring(2,db.length()); - Integer endDBEnd =Integer.parseInt(endDB) ; + String endDB = db.substring(2, db.length()); + Integer endDBEnd = Integer.parseInt(endDB); endDBEnd = endDBEnd + dbInterval; db = startDB + endDBEnd + ""; - map.put("",""); - map.put("写入地址",db); - map.put("写入意义",name); + map.put("", ""); + map.put("写入地址", db); + map.put("写入意义", name); return map; } } - if ( i > 0){ - j = j -1; + if (i > 0) { + j = j - 1; } - if (j < size){ + if (j < size) { JSONObject ws = wss.getJSONObject(j); String db = ws.getString("db"); String name = ws.getString("name"); String startDB = db.substring(0, 2); - String endDB = db.substring(2,db.length()); - Integer endDBEnd =Integer.parseInt(endDB) ; + String endDB = db.substring(2, db.length()); + Integer endDBEnd = Integer.parseInt(endDB); endDBEnd = endDBEnd + dbInterval; db = startDB + endDBEnd + ""; - map.put("",""); - map.put("写入地址",db); - map.put("写入意义",name); + map.put("", ""); + map.put("写入地址", db); + map.put("写入意义", name); return map; } else { - map.put("",""); - map.put("写入地址",""); - map.put("写入意义",""); + map.put("", ""); + map.put("写入地址", ""); + map.put("写入意义", ""); return map; } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java index f602829..390a7ce 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/standard_conveyor_control_with_scanner/StandardCoveyorControlWithScannerDeviceDriver.java @@ -645,12 +645,20 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe jo.put("isError", this.getIserror()); jo.put("message", this.getMessage()); jo.put("task", this.getTask()); + jo.put("requireSucess", requireSucess == true ? "1" : "0"); jo.put("barcode", this.getBarcode()); + jo.put("is_click", true); + jo.put("driver_type", "standard_conveyor_control_with_scanner"); return jo; } @Override public void setDeviceStatus(JSONObject data) { - + String requireSucess = data.getString("requireSucess"); + if (requireSucess.equals("1")){ + this.requireSucess = true; + } else if (requireSucess.equals("0")){ + this.requireSucess = false; + } } } diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java index 6f07460..bea0f8c 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java @@ -14,6 +14,7 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; +import org.nl.modules.system.util.CodeUtil; import org.nl.modules.wql.util.SpringContextHolder; import org.springframework.stereotype.Component; @@ -151,6 +152,7 @@ public class AutoCreateInst { } Instruction instdto = new Instruction(); + //instdto.setInstruction_code(CodeUtil.getNewCode("INSTRUCT_NO")); instdto.setInstruction_type(acsTask.getTask_type()); instdto.setInstruction_id(IdUtil.simpleUUID()); instdto.setRoute_plan_code(route_plan_code); diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java index 2843083..0ac78a9 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/quartz/utils/ExecutionJob.java @@ -27,6 +27,7 @@ import org.nl.modules.quartz.service.QuartzJobService; import org.nl.modules.wql.util.SpringContextHolder; import org.quartz.DisallowConcurrentExecution; import org.quartz.JobExecutionContext; +import org.quartz.PersistJobDataAfterExecution; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.quartz.QuartzJobBean; @@ -43,6 +44,7 @@ import java.util.concurrent.ThreadPoolExecutor; @SuppressWarnings({"unchecked", "all"}) @Slf4j @DisallowConcurrentExecution +@PersistJobDataAfterExecution public class ExecutionJob extends QuartzJobBean { /** diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java index 32ff1df..3b34d47 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/system/service/impl/GenCodeServiceImpl.java @@ -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; @@ -58,8 +60,8 @@ public class GenCodeServiceImpl implements GenCodeService { String now = DateUtil.now(); String code = (String) form.get("code"); JSONObject jo = wql.query("code = '" + code + "'").uniqueResult(0); - if (jo != null){ - throw new BadRequestException("该编码code已存在,请校验!"); + if (jo != null) { + throw new BadRequestException("该编码code已存在,请校验!"); } json.put("id", id); json.put("code", form.get("code")); @@ -86,8 +88,8 @@ public class GenCodeServiceImpl implements GenCodeService { WQLObject wql = WQLObject.getWQLObject("sys_code_rule"); String code = json.getString("code"); String id = json.getString("id"); - JSONObject jo = wql.query("id<>'"+id+"code = '" + code + "'").uniqueResult(0); - if (jo != null){ + JSONObject jo = wql.query("id<>'" + id + "code = '" + code + "'").uniqueResult(0); + if (jo != null) { throw new BadRequestException("该编码code已存在,请校验!"); } String now = DateUtil.now(); @@ -98,6 +100,7 @@ public class GenCodeServiceImpl implements GenCodeService { } @Override + @Transactional(propagation = Propagation.REQUIRES_NEW) public String codeDemo(Map form) { String code = (String) form.get("code"); String id = this.queryIdByCode(code); @@ -158,7 +161,7 @@ public class GenCodeServiceImpl implements GenCodeService { if (num_curr >= max_value) { num_curr = jo.getInteger("init_value"); jo.put("current_value", num_curr + ""); - }else{ + } else { jo.put("current_value", (num_curr + step) + ""); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/modules/system/util/CodeUtil.java b/acs/nladmin-system/src/main/java/org/nl/modules/system/util/CodeUtil.java index 982cd1b..9d76302 100644 --- a/acs/nladmin-system/src/main/java/org/nl/modules/system/util/CodeUtil.java +++ b/acs/nladmin-system/src/main/java/org/nl/modules/system/util/CodeUtil.java @@ -2,18 +2,20 @@ 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(); - String flag = "1"; - HashMap map = new HashMap<>(); - map.put("flag",flag); - map.put("code",ruleCode); - return service.codeDemo(map); + public static String getNewCode(String ruleCode){ + synchronized (ruleCode.intern()){ + String flag = "1"; + HashMap map = new HashMap<>(); + map.put("flag",flag); + map.put("code",ruleCode); + return SpringContextHolder.getBean(GenCodeService.class).codeDemo(map); + } } } diff --git a/acs/nladmin-ui/src/App.vue b/acs/nladmin-ui/src/App.vue index 2f82bcc..f5cb155 100644 --- a/acs/nladmin-ui/src/App.vue +++ b/acs/nladmin-ui/src/App.vue @@ -24,7 +24,7 @@ export default { this.timmer = setTimeout(() => { sessionStorage.clear() this.logout() - }, 1000 * 60 * 15) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456 + }, 100000 * 60 * 15) // 15分钟 https://blog.csdn.net/qq_42345108/article/details/103496456 }, logout() { this.$store.dispatch('LogOut').then(() => { diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index 8db7e17..febfebf 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -79,18 +79,18 @@ - + - - - - - - + + + + + +