rev 修改
This commit is contained in:
@@ -234,7 +234,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
Iterator<Device> iterator = allDevice.iterator();
|
Iterator<Device> iterator = allDevice.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Device device = iterator.next();
|
Device device = iterator.next();
|
||||||
if (StrUtil.equals(device.getDevice_code(),device_code)) {
|
if (StrUtil.equals(device.getDevice_code(), device_code)) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -915,13 +915,15 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj);
|
JSONObject updatejson = (JSONObject) JSONObject.toJSON(obj);
|
||||||
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
||||||
}
|
}
|
||||||
}
|
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
standardInspectSiteDeviceDriver.setMaterial(material_type);
|
standardInspectSiteDeviceDriver.setMaterial(material_type);
|
||||||
standardInspectSiteDeviceDriver.setBatch(batch);
|
standardInspectSiteDeviceDriver.setBatch(batch);
|
||||||
device.setMaterial_type(material_type);
|
device.setMaterial_type(material_type);
|
||||||
device.setBatch(batch);
|
device.setBatch(batch);
|
||||||
|
} else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) {
|
||||||
|
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver();
|
||||||
|
standardCoveyorControlWithScannerDeviceDriver.setDeviceStatus(form);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -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 rs = WQLObject.getWQLObject("acs_device_extra").query("filed_type='02' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0);
|
||||||
JSONArray r_arry = new JSONArray();
|
JSONArray r_arry = new JSONArray();
|
||||||
//先获取模板
|
//先获取模板
|
||||||
if(ObjectUtil.isNotEmpty(opcDeviceDriverDefination)){
|
if (ObjectUtil.isNotEmpty(opcDeviceDriverDefination)) {
|
||||||
List<ItemDto> readableItemDtos = opcDeviceDriverDefination.getReadableItemDtos();
|
List<ItemDto> readableItemDtos = opcDeviceDriverDefination.getReadableItemDtos();
|
||||||
List<JSONObject> readableItemJsons = new ArrayList<>();
|
List<JSONObject> readableItemJsons = new ArrayList<>();
|
||||||
for (int i = 0; i < readableItemDtos.size(); i++) {
|
for (int i = 0; i < readableItemDtos.size(); i++) {
|
||||||
ItemDto itemDto = readableItemDtos.get(i);
|
ItemDto itemDto = readableItemDtos.get(i);
|
||||||
JSONObject readableItemJson = new JSONObject();
|
JSONObject readableItemJson = new JSONObject();
|
||||||
readableItemJson.put("code",itemDto.getCode());
|
readableItemJson.put("code", itemDto.getCode());
|
||||||
readableItemJson.put("name",itemDto.getName());
|
readableItemJson.put("name", itemDto.getName());
|
||||||
// readableItemJson.put("db",itemDto.getDb());
|
// readableItemJson.put("db",itemDto.getDb());
|
||||||
readableItemJsons.add(readableItemJson);
|
readableItemJsons.add(readableItemJson);
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1182,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
String code = split[split.length - 1];
|
String code = split[split.length - 1];
|
||||||
robj.put("code", code);
|
robj.put("code", code);
|
||||||
robj.put("name", rs.getJSONObject(i).getString("remark"));
|
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("code", rs.getJSONObject(i).getString("extra_code"));
|
||||||
robj.put("db", rs.getJSONObject(i).getString("extra_name"));
|
robj.put("db", rs.getJSONObject(i).getString("extra_name"));
|
||||||
r_arry.add(robj);
|
r_arry.add(robj);
|
||||||
@@ -1194,16 +1196,16 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
code = split[split.length - 1];
|
code = split[split.length - 1];
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("code", code);
|
jsonObject.put("code", code);
|
||||||
jsonObject.put("name",rJson.getString("name"));
|
jsonObject.put("name", rJson.getString("name"));
|
||||||
rarry.add(jsonObject);
|
rarry.add(jsonObject);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < readableItemDtos.size(); i++) {
|
for (int i = 0; i < readableItemDtos.size(); i++) {
|
||||||
ItemDto itemDto = readableItemDtos.get(i);
|
ItemDto itemDto = readableItemDtos.get(i);
|
||||||
JSONObject readableItemJson = new JSONObject();
|
JSONObject readableItemJson = new JSONObject();
|
||||||
readableItemJson.put("code",itemDto.getCode());
|
readableItemJson.put("code", itemDto.getCode());
|
||||||
readableItemJson.put("name",itemDto.getName());
|
readableItemJson.put("name", itemDto.getName());
|
||||||
if (!rarry.contains(readableItemJson)){
|
if (!rarry.contains(readableItemJson)) {
|
||||||
readableItemJson.put("db",itemDto.getDb());
|
readableItemJson.put("db", itemDto.getDb());
|
||||||
r_arry.add(readableItemJson);
|
r_arry.add(readableItemJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1214,8 +1216,8 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
for (int i = 0; i < writeableItemDtos.size(); i++) {
|
for (int i = 0; i < writeableItemDtos.size(); i++) {
|
||||||
ItemDto itemDto = writeableItemDtos.get(i);
|
ItemDto itemDto = writeableItemDtos.get(i);
|
||||||
JSONObject writeableItemJson = new JSONObject();
|
JSONObject writeableItemJson = new JSONObject();
|
||||||
writeableItemJson.put("code",itemDto.getCode());
|
writeableItemJson.put("code", itemDto.getCode());
|
||||||
writeableItemJson.put("name",itemDto.getName());
|
writeableItemJson.put("name", itemDto.getName());
|
||||||
//writeableItemJson.put("db",itemDto.getDb());
|
//writeableItemJson.put("db",itemDto.getDb());
|
||||||
writeableItemJsons.add(writeableItemJson);
|
writeableItemJsons.add(writeableItemJson);
|
||||||
}
|
}
|
||||||
@@ -1226,7 +1228,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
JSONObject robj = new JSONObject();
|
JSONObject robj = new JSONObject();
|
||||||
robj.put("code", code);
|
robj.put("code", code);
|
||||||
robj.put("name", ws.getJSONObject(i).getString("remark"));
|
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("code", ws.getJSONObject(i).getString("extra_code"));
|
||||||
robj.put("db", ws.getJSONObject(i).getString("extra_name"));
|
robj.put("db", ws.getJSONObject(i).getString("extra_name"));
|
||||||
w_arry.add(robj);
|
w_arry.add(robj);
|
||||||
@@ -1239,17 +1241,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
String[] split = code.split("\\.");
|
String[] split = code.split("\\.");
|
||||||
code = split[split.length - 1];
|
code = split[split.length - 1];
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("code",code);
|
jsonObject.put("code", code);
|
||||||
jsonObject.put("name",wJson.getString("name"));
|
jsonObject.put("name", wJson.getString("name"));
|
||||||
warry.add(jsonObject);
|
warry.add(jsonObject);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < writeableItemDtos.size(); i++) {
|
for (int i = 0; i < writeableItemDtos.size(); i++) {
|
||||||
ItemDto itemDto = writeableItemDtos.get(i);
|
ItemDto itemDto = writeableItemDtos.get(i);
|
||||||
JSONObject writeableItemJson = new JSONObject();
|
JSONObject writeableItemJson = new JSONObject();
|
||||||
writeableItemJson.put("code",itemDto.getCode());
|
writeableItemJson.put("code", itemDto.getCode());
|
||||||
writeableItemJson.put("name",itemDto.getName());
|
writeableItemJson.put("name", itemDto.getName());
|
||||||
if (!warry.contains(writeableItemJson)){
|
if (!warry.contains(writeableItemJson)) {
|
||||||
writeableItemJson.put("db",itemDto.getDb());
|
writeableItemJson.put("db", itemDto.getDb());
|
||||||
w_arry.add(writeableItemJson);
|
w_arry.add(writeableItemJson);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1570,34 +1572,34 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
JSONArray rss = param.getJSONArray("rs");
|
JSONArray rss = param.getJSONArray("rs");
|
||||||
JSONArray wss = param.getJSONArray("ws");
|
JSONArray wss = param.getJSONArray("ws");
|
||||||
int numberSize = Integer.parseInt(form.getString("device_number"));
|
int numberSize = Integer.parseInt(form.getString("device_number"));
|
||||||
List<Map<String,Object>> list = new LinkedList<>();
|
List<Map<String, Object>> list = new LinkedList<>();
|
||||||
|
|
||||||
if (type.equals("db")){
|
if (type.equals("db")) {
|
||||||
for (int i = 0; i < numberSize; i++) {
|
for (int i = 0; i < numberSize; i++) {
|
||||||
int dbInterval = db_interval * i;
|
int dbInterval = db_interval * i;
|
||||||
Integer deviceCode = device_code + i;
|
Integer deviceCode = device_code + i;
|
||||||
for (int j = 0; j <= rss.size(); j++) {
|
for (int j = 0; j <= rss.size(); j++) {
|
||||||
Map<String,Object> map = new ListOrderedMap<>();
|
Map<String, Object> map = new ListOrderedMap<>();
|
||||||
if (j == rss.size()){
|
if (j == rss.size()) {
|
||||||
map.put("设备编码","");
|
map.put("设备编码", "");
|
||||||
map.put("读取地址","");
|
map.put("读取地址", "");
|
||||||
map.put("读取意义","");
|
map.put("读取意义", "");
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址","");
|
map.put("写入地址", "");
|
||||||
map.put("写入意义","");
|
map.put("写入意义", "");
|
||||||
list.add(map);
|
list.add(map);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i == 0 && j ==0){
|
if (i == 0 && j == 0) {
|
||||||
map.put("设备编码","");
|
map.put("设备编码", "");
|
||||||
}else {
|
} else {
|
||||||
map.put("设备编码",deviceCode);
|
map.put("设备编码", deviceCode);
|
||||||
}
|
}
|
||||||
JSONObject rs = rss.getJSONObject(j);
|
JSONObject rs = rss.getJSONObject(j);
|
||||||
String db = rs.getString("db");
|
String db = rs.getString("db");
|
||||||
String name = rs.getString("name");
|
String name = rs.getString("name");
|
||||||
if (i > 0){
|
if (i > 0) {
|
||||||
if (name.equals("心跳")){
|
if (name.equals("心跳")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1605,55 +1607,55 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
String startDB = dbs[0];
|
String startDB = dbs[0];
|
||||||
String endDB = dbs[1];
|
String endDB = dbs[1];
|
||||||
String endDBFirst = endDB.substring(0, 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;
|
endDBEnd = endDBEnd + dbInterval;
|
||||||
db = startDB + "." + endDBFirst + endDBEnd;
|
db = startDB + "." + endDBFirst + endDBEnd;
|
||||||
map.put("读取地址",db);
|
map.put("读取地址", db);
|
||||||
map.put("读取意义",name);
|
map.put("读取意义", name);
|
||||||
Map<String, Object> value = getValue(wss, j, dbInterval,i);
|
Map<String, Object> value = getValue(wss, j, dbInterval, i);
|
||||||
map.putAll(value);
|
map.putAll(value);
|
||||||
list.add(map);
|
list.add(map);
|
||||||
System.out.println(map);
|
System.out.println(map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else if (type.equals("v")){
|
} else if (type.equals("v")) {
|
||||||
for (int i = 0; i < numberSize; i++) {
|
for (int i = 0; i < numberSize; i++) {
|
||||||
int dbInterval = db_interval * i;
|
int dbInterval = db_interval * i;
|
||||||
Integer deviceCode = device_code + i;
|
Integer deviceCode = device_code + i;
|
||||||
for (int j = 0; j <= rss.size(); j++) {
|
for (int j = 0; j <= rss.size(); j++) {
|
||||||
Map<String,Object> map = new ListOrderedMap<>();
|
Map<String, Object> map = new ListOrderedMap<>();
|
||||||
if (j == rss.size()){
|
if (j == rss.size()) {
|
||||||
map.put("设备编码","");
|
map.put("设备编码", "");
|
||||||
map.put("读取地址","");
|
map.put("读取地址", "");
|
||||||
map.put("读取意义","");
|
map.put("读取意义", "");
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址","");
|
map.put("写入地址", "");
|
||||||
map.put("写入意义","");
|
map.put("写入意义", "");
|
||||||
list.add(map);
|
list.add(map);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (i == 0 && j ==0){
|
if (i == 0 && j == 0) {
|
||||||
map.put("设备编码","");
|
map.put("设备编码", "");
|
||||||
}else {
|
} else {
|
||||||
map.put("设备编码",deviceCode);
|
map.put("设备编码", deviceCode);
|
||||||
}
|
}
|
||||||
JSONObject rs = rss.getJSONObject(j);
|
JSONObject rs = rss.getJSONObject(j);
|
||||||
String db = rs.getString("db");
|
String db = rs.getString("db");
|
||||||
String name = rs.getString("name");
|
String name = rs.getString("name");
|
||||||
if (i > 0){
|
if (i > 0) {
|
||||||
if (name.equals("心跳")){
|
if (name.equals("心跳")) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//String[] dbs = db.split("\\.");
|
//String[] dbs = db.split("\\.");
|
||||||
String startDB = db.substring(0,2);
|
String startDB = db.substring(0, 2);
|
||||||
String endDB = db.substring(2,db.length());
|
String endDB = db.substring(2, db.length());
|
||||||
Integer endDBEnd =Integer.parseInt(endDB) ;
|
Integer endDBEnd = Integer.parseInt(endDB);
|
||||||
endDBEnd = endDBEnd + dbInterval;
|
endDBEnd = endDBEnd + dbInterval;
|
||||||
db = startDB + endDBEnd + "";
|
db = startDB + endDBEnd + "";
|
||||||
map.put("读取地址",db);
|
map.put("读取地址", db);
|
||||||
map.put("读取意义",name);
|
map.put("读取意义", name);
|
||||||
Map<String, Object> value = getValue1(wss, j, dbInterval,i);
|
Map<String, Object> value = getValue1(wss, j, dbInterval, i);
|
||||||
map.putAll(value);
|
map.putAll(value);
|
||||||
list.add(map);
|
list.add(map);
|
||||||
System.out.println(map);
|
System.out.println(map);
|
||||||
@@ -1665,17 +1667,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
FileUtil.downloadExcel(list, response);
|
FileUtil.downloadExcel(list, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String,Object> getValue(JSONArray wss, int j, Integer dbInterval, int i){
|
public Map<String, Object> getValue(JSONArray wss, int j, Integer dbInterval, int i) {
|
||||||
int size = wss.size();
|
int size = wss.size();
|
||||||
Map<String,Object> map = new ListOrderedMap<>();
|
Map<String, Object> map = new ListOrderedMap<>();
|
||||||
if (i == 0 && j == 0){
|
if (i == 0 && j == 0) {
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址","");
|
map.put("写入地址", "");
|
||||||
map.put("写入意义","");
|
map.put("写入意义", "");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
if (i == 0 && j > 0){
|
if (i == 0 && j > 0) {
|
||||||
if (j - 1 < size){
|
if (j - 1 < size) {
|
||||||
JSONObject ws = wss.getJSONObject(j - 1);
|
JSONObject ws = wss.getJSONObject(j - 1);
|
||||||
String db = ws.getString("db");
|
String db = ws.getString("db");
|
||||||
String name = ws.getString("name");
|
String name = ws.getString("name");
|
||||||
@@ -1683,19 +1685,19 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
String startDB = dbs[0];
|
String startDB = dbs[0];
|
||||||
String endDB = dbs[1];
|
String endDB = dbs[1];
|
||||||
String endDBFirst = endDB.substring(0, 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;
|
endDBEnd = endDBEnd + dbInterval;
|
||||||
db = startDB + "." + endDBFirst + endDBEnd;
|
db = startDB + "." + endDBFirst + endDBEnd;
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址",db);
|
map.put("写入地址", db);
|
||||||
map.put("写入意义",name);
|
map.put("写入意义", name);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( i > 0){
|
if (i > 0) {
|
||||||
j = j -1;
|
j = j - 1;
|
||||||
}
|
}
|
||||||
if (j < size){
|
if (j < size) {
|
||||||
JSONObject ws = wss.getJSONObject(j);
|
JSONObject ws = wss.getJSONObject(j);
|
||||||
String db = ws.getString("db");
|
String db = ws.getString("db");
|
||||||
String name = ws.getString("name");
|
String name = ws.getString("name");
|
||||||
@@ -1703,17 +1705,17 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
String startDB = dbs[0];
|
String startDB = dbs[0];
|
||||||
String endDB = dbs[1];
|
String endDB = dbs[1];
|
||||||
String endDBFirst = endDB.substring(0, 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;
|
endDBEnd = endDBEnd + dbInterval;
|
||||||
db = startDB + "." + endDBFirst + endDBEnd;
|
db = startDB + "." + endDBFirst + endDBEnd;
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址",db);
|
map.put("写入地址", db);
|
||||||
map.put("写入意义",name);
|
map.put("写入意义", name);
|
||||||
return map;
|
return map;
|
||||||
} else {
|
} else {
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址","");
|
map.put("写入地址", "");
|
||||||
map.put("写入意义","");
|
map.put("写入意义", "");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1806,52 +1808,52 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
ExportCSVUtil.responseSetProperties(fileName, bytes, response);
|
ExportCSVUtil.responseSetProperties(fileName, bytes, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String,Object> getValue1(JSONArray wss, int j, Integer dbInterval, int i){
|
public Map<String, Object> getValue1(JSONArray wss, int j, Integer dbInterval, int i) {
|
||||||
int size = wss.size();
|
int size = wss.size();
|
||||||
Map<String,Object> map = new ListOrderedMap<>();
|
Map<String, Object> map = new ListOrderedMap<>();
|
||||||
if (i == 0 && j == 0){
|
if (i == 0 && j == 0) {
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址","");
|
map.put("写入地址", "");
|
||||||
map.put("写入意义","");
|
map.put("写入意义", "");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
if (i == 0 && j > 0){
|
if (i == 0 && j > 0) {
|
||||||
if (j - 1 < size){
|
if (j - 1 < size) {
|
||||||
JSONObject ws = wss.getJSONObject(j - 1);
|
JSONObject ws = wss.getJSONObject(j - 1);
|
||||||
String db = ws.getString("db");
|
String db = ws.getString("db");
|
||||||
String name = ws.getString("name");
|
String name = ws.getString("name");
|
||||||
//String[] dbs = db.split("\\.");
|
//String[] dbs = db.split("\\.");
|
||||||
String startDB = db.substring(0, 2);
|
String startDB = db.substring(0, 2);
|
||||||
String endDB = db.substring(2,db.length());
|
String endDB = db.substring(2, db.length());
|
||||||
Integer endDBEnd =Integer.parseInt(endDB) ;
|
Integer endDBEnd = Integer.parseInt(endDB);
|
||||||
endDBEnd = endDBEnd + dbInterval;
|
endDBEnd = endDBEnd + dbInterval;
|
||||||
db = startDB + endDBEnd + "";
|
db = startDB + endDBEnd + "";
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址",db);
|
map.put("写入地址", db);
|
||||||
map.put("写入意义",name);
|
map.put("写入意义", name);
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( i > 0){
|
if (i > 0) {
|
||||||
j = j -1;
|
j = j - 1;
|
||||||
}
|
}
|
||||||
if (j < size){
|
if (j < size) {
|
||||||
JSONObject ws = wss.getJSONObject(j);
|
JSONObject ws = wss.getJSONObject(j);
|
||||||
String db = ws.getString("db");
|
String db = ws.getString("db");
|
||||||
String name = ws.getString("name");
|
String name = ws.getString("name");
|
||||||
String startDB = db.substring(0, 2);
|
String startDB = db.substring(0, 2);
|
||||||
String endDB = db.substring(2,db.length());
|
String endDB = db.substring(2, db.length());
|
||||||
Integer endDBEnd =Integer.parseInt(endDB) ;
|
Integer endDBEnd = Integer.parseInt(endDB);
|
||||||
endDBEnd = endDBEnd + dbInterval;
|
endDBEnd = endDBEnd + dbInterval;
|
||||||
db = startDB + endDBEnd + "";
|
db = startDB + endDBEnd + "";
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址",db);
|
map.put("写入地址", db);
|
||||||
map.put("写入意义",name);
|
map.put("写入意义", name);
|
||||||
return map;
|
return map;
|
||||||
} else {
|
} else {
|
||||||
map.put("","");
|
map.put("", "");
|
||||||
map.put("写入地址","");
|
map.put("写入地址", "");
|
||||||
map.put("写入意义","");
|
map.put("写入意义", "");
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -645,12 +645,20 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
jo.put("isError", this.getIserror());
|
jo.put("isError", this.getIserror());
|
||||||
jo.put("message", this.getMessage());
|
jo.put("message", this.getMessage());
|
||||||
jo.put("task", this.getTask());
|
jo.put("task", this.getTask());
|
||||||
|
jo.put("requireSucess", requireSucess == true ? "1" : "0");
|
||||||
jo.put("barcode", this.getBarcode());
|
jo.put("barcode", this.getBarcode());
|
||||||
|
jo.put("is_click", true);
|
||||||
|
jo.put("driver_type", "standard_conveyor_control_with_scanner");
|
||||||
return jo;
|
return jo;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setDeviceStatus(JSONObject data) {
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import org.nl.acs.route.service.RouteLineService;
|
|||||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
|
import org.nl.modules.system.util.CodeUtil;
|
||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -151,6 +152,7 @@ public class AutoCreateInst {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Instruction instdto = new Instruction();
|
Instruction instdto = new Instruction();
|
||||||
|
//instdto.setInstruction_code(CodeUtil.getNewCode("INSTRUCT_NO"));
|
||||||
instdto.setInstruction_type(acsTask.getTask_type());
|
instdto.setInstruction_type(acsTask.getTask_type());
|
||||||
instdto.setInstruction_id(IdUtil.simpleUUID());
|
instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||||
instdto.setRoute_plan_code(route_plan_code);
|
instdto.setRoute_plan_code(route_plan_code);
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import org.nl.modules.quartz.service.QuartzJobService;
|
|||||||
import org.nl.modules.wql.util.SpringContextHolder;
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
import org.quartz.DisallowConcurrentExecution;
|
import org.quartz.DisallowConcurrentExecution;
|
||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
|
import org.quartz.PersistJobDataAfterExecution;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||||
|
|
||||||
@@ -43,6 +44,7 @@ import java.util.concurrent.ThreadPoolExecutor;
|
|||||||
@SuppressWarnings({"unchecked", "all"})
|
@SuppressWarnings({"unchecked", "all"})
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@DisallowConcurrentExecution
|
@DisallowConcurrentExecution
|
||||||
|
@PersistJobDataAfterExecution
|
||||||
public class ExecutionJob extends QuartzJobBean {
|
public class ExecutionJob extends QuartzJobBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ import org.nl.modules.wql.util.WqlUtil;
|
|||||||
import org.springframework.cache.annotation.CacheConfig;
|
import org.springframework.cache.annotation.CacheConfig;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Propagation;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -58,7 +60,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
String code = (String) form.get("code");
|
String code = (String) form.get("code");
|
||||||
JSONObject jo = wql.query("code = '" + code + "'").uniqueResult(0);
|
JSONObject jo = wql.query("code = '" + code + "'").uniqueResult(0);
|
||||||
if (jo != null){
|
if (jo != null) {
|
||||||
throw new BadRequestException("该编码code已存在,请校验!");
|
throw new BadRequestException("该编码code已存在,请校验!");
|
||||||
}
|
}
|
||||||
json.put("id", id);
|
json.put("id", id);
|
||||||
@@ -86,8 +88,8 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
WQLObject wql = WQLObject.getWQLObject("sys_code_rule");
|
WQLObject wql = WQLObject.getWQLObject("sys_code_rule");
|
||||||
String code = json.getString("code");
|
String code = json.getString("code");
|
||||||
String id = json.getString("id");
|
String id = json.getString("id");
|
||||||
JSONObject jo = wql.query("id<>'"+id+"code = '" + code + "'").uniqueResult(0);
|
JSONObject jo = wql.query("id<>'" + id + "code = '" + code + "'").uniqueResult(0);
|
||||||
if (jo != null){
|
if (jo != null) {
|
||||||
throw new BadRequestException("该编码code已存在,请校验!");
|
throw new BadRequestException("该编码code已存在,请校验!");
|
||||||
}
|
}
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
@@ -98,6 +100,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||||
public String codeDemo(Map form) {
|
public String codeDemo(Map form) {
|
||||||
String code = (String) form.get("code");
|
String code = (String) form.get("code");
|
||||||
String id = this.queryIdByCode(code);
|
String id = this.queryIdByCode(code);
|
||||||
@@ -158,7 +161,7 @@ public class GenCodeServiceImpl implements GenCodeService {
|
|||||||
if (num_curr >= max_value) {
|
if (num_curr >= max_value) {
|
||||||
num_curr = jo.getInteger("init_value");
|
num_curr = jo.getInteger("init_value");
|
||||||
jo.put("current_value", num_curr + "");
|
jo.put("current_value", num_curr + "");
|
||||||
}else{
|
} else {
|
||||||
jo.put("current_value", (num_curr + step) + "");
|
jo.put("current_value", (num_curr + step) + "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,20 @@ package org.nl.modules.system.util;
|
|||||||
|
|
||||||
import org.nl.modules.system.service.GenCodeService;
|
import org.nl.modules.system.service.GenCodeService;
|
||||||
import org.nl.modules.system.service.impl.GenCodeServiceImpl;
|
import org.nl.modules.system.service.impl.GenCodeServiceImpl;
|
||||||
|
import org.nl.modules.wql.util.SpringContextHolder;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
public class CodeUtil {
|
public class CodeUtil {
|
||||||
|
|
||||||
public static synchronized String getNewCode(String ruleCode){
|
public static String getNewCode(String ruleCode){
|
||||||
GenCodeService service=new GenCodeServiceImpl();
|
synchronized (ruleCode.intern()){
|
||||||
String flag = "1";
|
String flag = "1";
|
||||||
HashMap<String,String> map = new HashMap<>();
|
HashMap<String,String> map = new HashMap<>();
|
||||||
map.put("flag",flag);
|
map.put("flag",flag);
|
||||||
map.put("code",ruleCode);
|
map.put("code",ruleCode);
|
||||||
return service.codeDemo(map);
|
return SpringContextHolder.getBean(GenCodeService.class).codeDemo(map);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export default {
|
|||||||
this.timmer = setTimeout(() => {
|
this.timmer = setTimeout(() => {
|
||||||
sessionStorage.clear()
|
sessionStorage.clear()
|
||||||
this.logout()
|
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() {
|
logout() {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
|
|||||||
@@ -79,18 +79,18 @@
|
|||||||
<el-form-item label="设备编号" prop="device_code" label-width="120px">
|
<el-form-item label="设备编号" prop="device_code" label-width="120px">
|
||||||
<el-input v-model="form.device_code" :disabled="true" />
|
<el-input v-model="form.device_code" :disabled="true" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="缺料请求成功" prop="requireSucess" label-width="120px">
|
<el-form-item label="请求标记" prop="requireSucess" label-width="120px">
|
||||||
<el-radio-group v-model="form.requireSucess">
|
<el-radio-group v-model="form.requireSucess">
|
||||||
<el-radio-button :label="0">否</el-radio-button>
|
<el-radio-button :label="0">否</el-radio-button>
|
||||||
<el-radio-button :label="1">是</el-radio-button>
|
<el-radio-button :label="1">是</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="空想请求成功" prop="fullrequireSucess" label-width="120px">
|
<!-- <el-form-item label="空箱请求成功" prop="fullrequireSucess" label-width="120px">-->
|
||||||
<el-radio-group v-model="form.fullrequireSucess">
|
<!-- <el-radio-group v-model="form.fullrequireSucess">-->
|
||||||
<el-radio-button :label="0">否</el-radio-button>
|
<!-- <el-radio-button :label="0">否</el-radio-button>-->
|
||||||
<el-radio-button :label="1">是</el-radio-button>
|
<!-- <el-radio-button :label="1">是</el-radio-button>-->
|
||||||
</el-radio-group>
|
<!-- </el-radio-group>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogFormVisible4 = false">取 消</el-button>
|
<el-button @click="dialogFormVisible4 = false">取 消</el-button>
|
||||||
@@ -210,7 +210,7 @@ export default {
|
|||||||
nodeMenu: false
|
nodeMenu: false
|
||||||
})
|
})
|
||||||
lf.on('node:click', (data, e) => { // 鼠标点击节点
|
lf.on('node:click', (data, e) => { // 鼠标点击节点
|
||||||
console.log("data: ", data)
|
console.log('data: ', data)
|
||||||
// 展开显示设备信息
|
// 展开显示设备信息
|
||||||
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
|
if (data.data.type !== 'pro-rect' && data.data.type !== 'pro-circle' && data.data.type !== 'triangle' && data.data.type !== 'rect-radius') {
|
||||||
if (data.data.properties.device) {
|
if (data.data.properties.device) {
|
||||||
@@ -276,7 +276,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
if (clickObj.data.driver_type === 'standard_ordinary_site') {
|
if (clickObj.data.driver_type === 'standard_ordinary_site') {
|
||||||
this.dialogFormVisible3 = true
|
this.dialogFormVisible3 = true
|
||||||
} else if (clickObj.data.driver_type === 'hailiang_packer_station') {
|
} else if (clickObj.data.driver_type === 'standard_conveyor_control_with_scanner') {
|
||||||
this.dialogFormVisible4 = true
|
this.dialogFormVisible4 = true
|
||||||
} else if (clickObj.data.driver_type === 'hailiang_xj_plc_test') {
|
} else if (clickObj.data.driver_type === 'hailiang_xj_plc_test') {
|
||||||
this.$refs.child1.setForm(clickObj)
|
this.$refs.child1.setForm(clickObj)
|
||||||
|
|||||||
Reference in New Issue
Block a user