汪菘 1 year ago
parent
commit
c9c87b1ad6
  1. BIN
      acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls
  2. 12
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java
  3. 159
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java
  4. 6
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java
  5. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java
  6. 86
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java
  7. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java
  8. 4
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java
  9. 147
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java
  10. 1287
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java
  11. 6
      acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java
  12. 4
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java
  13. 16
      acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java
  14. 125
      acs/nladmin-system/src/main/java/org/nl/acs/opc/JsonUtl.java
  15. 4
      acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java
  16. 28
      acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java
  17. 80
      acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue
  18. 8
      acs/nladmin-ui/src/views/acs/instruction/index.vue
  19. 8
      acs/nladmin-ui/src/views/acs/task/index.vue

BIN
acs/nladmin-system/src/main/java/org/nl/acs/device/wql/task_inst.xls

Binary file not shown.

12
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/agv/ndcone/AgvNdcOneDeviceDriver.java

@ -217,7 +217,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
//标准版-机械手对接位 //标准版-机械手对接位
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver(); lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
lnshPalletizingManipulatorSiteDeviceDriver.writing(3); lnshPalletizingManipulatorSiteDeviceDriver.writing(2);
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() != 0 if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() != 0
&& lnshPalletizingManipulatorSiteDeviceDriver.getMove() != 0 && lnshPalletizingManipulatorSiteDeviceDriver.getMove() != 0
&& (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 1) && (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 1)
@ -364,7 +364,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver(); lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
lnshFoldDiscSiteDeviceDriver.writing(3); lnshFoldDiscSiteDeviceDriver.writing(3);
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0 if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() != 0) { && lnshFoldDiscSiteDeviceDriver.getContainer_qty() > 0) {
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 1) // && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 1)
// && (lnshFoldDiscSiteDeviceDriver.getAction() == 3 || lnshFoldDiscSiteDeviceDriver.getAction() == 1) // && (lnshFoldDiscSiteDeviceDriver.getAction() == 3 || lnshFoldDiscSiteDeviceDriver.getAction() == 1)
inst.setExecute_status("1"); inst.setExecute_status("1");
@ -453,7 +453,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
//标准版-机械手对接位 //标准版-机械手对接位
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver(); lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
lnshPalletizingManipulatorSiteDeviceDriver.writing(5); lnshPalletizingManipulatorSiteDeviceDriver.writing(3);
if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() != 0 if (lnshPalletizingManipulatorSiteDeviceDriver.getMode() != 0
&& lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 0 && lnshPalletizingManipulatorSiteDeviceDriver.getMove() == 0
&& (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 2) && (lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 3 || lnshPalletizingManipulatorSiteDeviceDriver.getIo_action() == 2)
@ -592,7 +592,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver(); lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
lnshFoldDiscSiteDeviceDriver.writing(5); lnshFoldDiscSiteDeviceDriver.writing(5);
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0 if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() != 0 && lnshFoldDiscSiteDeviceDriver.getContainer_qty() == 0
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 2) // && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 3 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 2)
) { ) {
inst.setExecute_status("5"); inst.setExecute_status("5");
@ -844,7 +844,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver(); lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
lnshFoldDiscSiteDeviceDriver.writing(4); lnshFoldDiscSiteDeviceDriver.writing(4);
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0 if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() == 0 // && lnshFoldDiscSiteDeviceDriver.getContainer_qty() == 0
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 1 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 3) // && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 1 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 3)
// && (lnshFoldDiscSiteDeviceDriver.getAction() == 2 || lnshFoldDiscSiteDeviceDriver.getAction() == 3) // && (lnshFoldDiscSiteDeviceDriver.getAction() == 2 || lnshFoldDiscSiteDeviceDriver.getAction() == 3)
) { ) {
@ -1086,7 +1086,7 @@ public class AgvNdcOneDeviceDriver extends AbstractDeviceDriver implements Devic
if (device.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) { if (device.getDeviceDriver() instanceof LnshFoldDiscSiteDeviceDriver) {
lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver(); lnshFoldDiscSiteDeviceDriver = (LnshFoldDiscSiteDeviceDriver) device.getDeviceDriver();
if (lnshFoldDiscSiteDeviceDriver.getMode() != 0 if (lnshFoldDiscSiteDeviceDriver.getMode() != 0
&& lnshFoldDiscSiteDeviceDriver.getMove() != 0 // && lnshFoldDiscSiteDeviceDriver.getMove() != 0
// && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 2 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 3) // && (lnshFoldDiscSiteDeviceDriver.getIo_action() == 2 || lnshFoldDiscSiteDeviceDriver.getIo_action() == 3)
) { ) {
inst.setExecute_status("6"); inst.setExecute_status("6");

159
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/AbstractOpcDeviceDriver.java

@ -1,18 +1,175 @@
package org.nl.acs.device_driver.driver; package org.nl.acs.device_driver.driver;
import org.nl.acs.opc.OpcConfig; import org.nl.acs.opc.*;
import org.nl.acs.udw.UnifiedDataAccessor; import org.nl.acs.udw.UnifiedDataAccessor;
import org.nl.acs.udw.UnifiedDataAccessorFactory; import org.nl.acs.udw.UnifiedDataAccessorFactory;
import org.nl.acs.udw.UnifiedDataAppService;
import org.nl.modules.wql.exception.WDKException;
import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Group;
import org.openscada.opc.lib.da.Item;
import org.openscada.opc.lib.da.ItemState;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.*;
public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver { public class AbstractOpcDeviceDriver extends AbstractDeviceDriver implements OpcDeviceDriver {
UnifiedDataAccessor opcUdw; UnifiedDataAccessor opcUdw;
@Autowired
private OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerService .class);
public AbstractOpcDeviceDriver() { public AbstractOpcDeviceDriver() {
this.opcUdw = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key); this.opcUdw = UnifiedDataAccessorFactory.getAccessor(OpcConfig.udw_opc_value_key);
} }
private Date sendTime;
private String last_items;
private int noLog_sendTimeOut;
private Date noLog_sendTime;
private String noLog_last_items;
@Override @Override
public UnifiedDataAccessor getOpcValueAccessor() { public UnifiedDataAccessor getOpcValueAccessor() {
return this.opcUdw; return this.opcUdw;
} }
public void checkcontrol(Map<String, Object> itemValues) throws Exception {
Group group = opcServerService.getServer(this.getOpcServer());
Map<String, Object> write = new HashMap();
Map<String, Item> readitems = new LinkedHashMap();
List<String> itemsString = new ArrayList();
itemsString = new ArrayList<> (itemValues.keySet());
Iterator is = itemsString.iterator();
while (is.hasNext()) {
String string = (String) is.next();
try {
readitems.put(string, group.addItem(string));
} catch (Exception e) {
e.printStackTrace();
}
}
int i = 0;
while(true) {
//下发信号
control( itemValues);
Map<String, Object> read = new HashMap();
Map<Item, ItemState> itemStatus = group.read(true, (Item[])readitems.values().toArray(new Item[0]));
Set<Item> items = itemStatus.keySet();
Iterator var15 = items.iterator();
while(var15.hasNext()) {
Item item = (Item)var15.next();
ItemState itemState = (ItemState)itemStatus.get(item);
Object value = OpcUtl.getValue(item, itemState);
read.put(item.getId(), value);
}
boolean check = true;
Iterator var24 = itemsString.iterator();
while(var24.hasNext()) {
String itemString = (String)var24.next();
if (!ObjectUtl.isEquals(itemValues.get(itemString), JsonUtl.parse(read.get(itemString)))) {
check = false;
}
}
if (check) {
return;
}
if (i > 0) {
ThreadUtl.sleep(300L);
}
if (i > 3) {
throw new WDKException("写入次数超过3次而失败");
}
++i;
}
}
public boolean control(Map<String, Object> itemValues) {
Iterator<Map.Entry<String, Object>> it = itemValues.entrySet().iterator();
ItemValue p2[];
p2 = new ItemValue[itemValues.size()];
int i=0;
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
System.out.println("即将写入值:"+entry.getKey() + ":" + entry.getValue());
p2[i] = new ItemValue();
p2[i].setItem_code(entry.getKey());
p2[i].setItem_value(entry.getValue());
i++;
}
return this.control(p2);
}
public boolean control(ItemValue[] itemValues) {
if (itemValues != null && itemValues.length != 0) {
String this_items = JsonUtl.parseWithoutException(itemValues);
boolean need_write = false;
StringBuilder sb = new StringBuilder();
ItemValue[] var5 = itemValues;
int var6 = itemValues.length;
for (int var7 = 0; var7 < var6; ++var7) {
ItemValue itemValue = var5[var7];
String code = itemValue.getItem_code();
Object udw_value = this.getUdwValue(code);
Object write_value = itemValue.getItem_value();
sb.append(code);
sb.append(":");
sb.append(JsonUtl.parseWithoutException(udw_value));
sb.append(";");
if (!need_write && !UnifiedDataAppService.isEquals(udw_value, write_value)) {
need_write = true;
} else {
//log.warn("下发信号点位{} 当前写入值:{} 与系统内存值:{} 相同,不再写入 ", code, write_value, udw_value );
}
}
// need_write = true;
if (need_write) {
Date date = new Date();
/*if (StringUtl.isEqual(this_items, this.last_items) && date.getTime() - this.sendTime.getTime() < (long) WcsConfig.opc_write_repeat_check) {
log.trace("发送时间因为小于{}毫秒,而被无视", WcsConfig.opc_write_repeat_check);
return false;
}*/
this.last_items = this_items;
this.sendTime = date;
/* this.execute_log.setResource(this.getDevice().getCode(), this.getDevice().getName());
this.execute_log.log("原始记录{}->变更为{}", new Object[]{sb, this_items});
OpcServerService opcServerService = OpcServerFactory.getOpcServerService();*/
OpcServerService opcServerService = SpringContextHolder.getBean(OpcServerServiceImpl.class);
opcServerService.writeInteger(this.getOpcServer(), itemValues);
UnifiedDataAccessor opcValueAccessor = this.getOpcValueAccessor();
ItemValue[] var17 = itemValues;
int var18 = itemValues.length;
for (int var19 = 0; var19 < var18; ++var19) {
ItemValue itemValue = var17[var19];
String code = itemValue.getItem_code();
Object value = itemValue.getItem_value();
opcValueAccessor.setValue(code, value);
}
}
return true;
} else {
throw new WDKException("下发 无内容");
}
}
} }

6
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/OpcDeviceDriver.java

@ -58,7 +58,8 @@ public interface OpcDeviceDriver extends DeviceDriver {
} }
default Integer getIntegeregerValue(String protocol) { default Integer getIntegeregerValue(String protocol) {
return (Integer) this.getValue(protocol); Object value = this.getValue(protocol)==null?"0":this.getValue(protocol);
return Integer.parseInt(value.toString());
} }
default int[] getIntegeregerArrayValue(String protocol) { default int[] getIntegeregerArrayValue(String protocol) {
@ -86,4 +87,7 @@ public interface OpcDeviceDriver extends DeviceDriver {
return this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDeviceCode() + "." + item; return this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDeviceCode() + "." + item;
} }
default Object getUdwValue(String protocol) {
return this.getOpcValueAccessor().getValue(protocol);
}
} }

4
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java

@ -155,12 +155,14 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
request.setVehicle_type(String.valueOf(container_type)); request.setVehicle_type(String.valueOf(container_type));
ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class); ApplySignalStatusResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)), ApplySignalStatusResponse.class);
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS..."; message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request))); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "请求参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();; message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求成功" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
} else { } else {
message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();; message = RequestMethodEnum.getName("real_time_set_point") + "real_time_set_point 接口请求失败" + resp.getMessage();;
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "返回参数:" + JSON.toJSONString(request)));
} }
} }
} }

86
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java

@ -2,6 +2,7 @@ package org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
@ -10,9 +11,12 @@ import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
import org.nl.acs.device_driver.RequestMethodEnum;
import org.nl.acs.device_driver.RouteableDeviceDriver; import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver; import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver; import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskRequest;
import org.nl.acs.ext.wms.data.AcsToWmsData.applyTask.ApplyTaskResponse;
import org.nl.acs.ext.wms.service.AcsToWmsService; import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.InstructionService;
import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.instruction.service.dto.Instruction;
@ -21,11 +25,14 @@ import org.nl.acs.monitor.DeviceStageMonitor;
import org.nl.acs.opc.Device; import org.nl.acs.opc.Device;
import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.modules.lucene.service.LuceneExecuteLogService;
import org.nl.modules.lucene.service.dto.LuceneLogDto;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server; import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import java.lang.reflect.Method;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -41,6 +48,8 @@ import java.util.Map;
public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor { public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor {
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
LuceneExecuteLogService lucene = SpringContextHolder.getBean("luceneExecuteLogServiceImpl");
InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl"); InstructionService instructionService = SpringContextHolder.getBean("instructionServiceImpl");
DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl"); DeviceService deviceservice = SpringContextHolder.getBean("deviceServiceImpl");
@ -190,17 +199,21 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
message = ""; message = "";
Instruction instruction = null; Instruction instruction = null;
List toInstructions; List toInstructions;
switch (mode) {
case 1: if (mode > 2 && !requireSucess) {
log.debug("设备运转模式:等待工作"); if (ObjectUtil.isNotEmpty(this.device.getExtraValue().get(String.valueOf(mode)))) {
break; String modethod = this.device.getExtraValue().get(String.valueOf(mode)).toString();
case 2: try {
// int max_emptypalletnum = Integer.parseInt(this.getDevice().getExtraValue().get("max_emptypalletnum").toString()); applyRequest(modethod);
// //当前数量等于最大数量,则生成搬运任务 } catch (Exception e) {
// if (!requireSucess && container_qty >= max_emptypalletnum) { message = "错误:" + e.getMessage();
// putStorage(); this.setIserror(true);
// } }
break; } else {
message = "无效模式请求,驱动未配置此请求方法";
}
} else {
message = "无请求";
} }
} }
@ -216,34 +229,57 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
/** /**
* 拆垛完成 * 请求
* *
* @param * @param
*/ */
public synchronized boolean palletizing() { public synchronized boolean applyRequest(String modethod) throws Exception {
Object obj1 = this;
Date date = new Date(); Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false; return false;
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); Object obj = this.getClass().getDeclaredConstructor().newInstance();
json.put("device_code", device_code); Method method1 = this.getClass().getMethod(modethod, null);
json.put("type", "3"); method1.invoke(this, null);
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); return true;
if (ObjectUtil.isNotEmpty(result)) { }
if (result.getStatus() == HttpStatus.OK.value()) { }
JSONObject jsonObject = JSONObject.parseObject(result.body());
if (ObjectUtil.isNotEmpty(jsonObject) && "200".equals(jsonObject.getString("status"))) {
this.writing(200); /**
requireSucess = true; * 申请取走空料盅托盘
} *
} * @param
*/
public synchronized boolean apply_take_empty_vehicle() {
if(move == 1) {
ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
request.setRequest_medthod_name(RequestMethodEnum.getName(Thread.currentThread().getStackTrace()[1].getMethodName()));
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message + "参数:" + JSON.toJSONString(request)));
if (resp.getCode() == 200) {
this.writing(200);
this.setRequireSucess(true);
} else {
this.writing(400);
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 接口请求失败" + resp.getMessage();;
} }
return true; return true;
} else {
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备无货未请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
return false;
} }
} }
public void writing(String param, String value) { public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code() String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()

4
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java

@ -400,7 +400,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(101);
this.setRequireSucess(true); this.setRequireSucess(true);
} else { } else {
this.writing(400); this.writing(400);
@ -423,7 +423,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(102);
this.setRequireSucess(true); this.setRequireSucess(true);
} else { } else {
this.writing(400); this.writing(400);

4
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java

@ -429,7 +429,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(101);
this.setRequireSucess(true); this.setRequireSucess(true);
} else { } else {
this.writing(400); this.writing(400);
@ -452,7 +452,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class); ApplyTaskResponse resp = JSON.toJavaObject(JSONObject.parseObject(acsToWmsService.applyTask(request)),ApplyTaskResponse.class);
if (resp.getCode() == 200) { if (resp.getCode() == 200) {
this.writing(200); this.writing(102);
this.setRequireSucess(true); this.setRequireSucess(true);
} else { } else {
this.writing(400); this.writing(400);

147
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_palletizing_manipulator_site/LnshPalletizingManipulatorSiteDeviceDriver.java

@ -256,80 +256,83 @@ public class LnshPalletizingManipulatorSiteDeviceDriver extends AbstractOpcDevic
String message = null; String message = null;
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
mode = this.itemProtocol.getMode(); mode = this.itemProtocol.getMode();
error = this.itemProtocol.getError(); error = this.itemProtocol.getError();
move = this.itemProtocol.getMove(); move = this.itemProtocol.getMove();
task = this.itemProtocol.getTask(); task = this.itemProtocol.getTask();
hasGoods = this.itemProtocol.getMove(); hasGoods = this.itemProtocol.getMove();
io_action = this.itemProtocol.getIoAction(); io_action = this.itemProtocol.getIoAction();
action = this.itemProtocol.getAction(); action = this.itemProtocol.getAction();
weight = this.itemProtocol.getWeight(); weight = this.itemProtocol.getWeight();
material = this.itemProtocol.getMaterial(); material = this.itemProtocol.getMaterial();
barcode = this.itemProtocol.getBarcode(); barcode = this.itemProtocol.getBarcode();
AlongSide = this.itemProtocol.getAlongSide(); AlongSide = this.itemProtocol.getAlongSide();
BshortSide = this.itemProtocol.getBshortSide(); BshortSide = this.itemProtocol.getBshortSide();
Htrapezoidal = this.itemProtocol.getHtrapezoidal(); Htrapezoidal = this.itemProtocol.getHtrapezoidal();
Wthickness = this.itemProtocol.getWthickness(); Wthickness = this.itemProtocol.getWthickness();
encoder_qty = this.itemProtocol.getEncoder_qty(); encoder_qty = this.itemProtocol.getEncoder_qty();
unqualified_qty = this.itemProtocol.getUnqualified_qty(); unqualified_qty = this.itemProtocol.getUnqualified_qty();
product_code = this.itemProtocol.getProduct_code(); product_code = this.itemProtocol.getProduct_code();
AlongSide = this.itemProtocol.getAlongSide(); AlongSide = this.itemProtocol.getAlongSide();
BshortSide = this.itemProtocol.getBshortSide(); BshortSide = this.itemProtocol.getBshortSide();
Htrapezoidal = this.itemProtocol.getHtrapezoidal(); Htrapezoidal = this.itemProtocol.getHtrapezoidal();
Wthickness = this.itemProtocol.getWthickness(); Wthickness = this.itemProtocol.getWthickness();
tray_qty = this.itemProtocol.getTray_qty(); tray_qty = this.itemProtocol.getTray_qty();
tray_high = this.itemProtocol.getTray_high(); tray_high = this.itemProtocol.getTray_high();
crib_category = this.itemProtocol.getCrib_category(); crib_category = this.itemProtocol.getCrib_category();
palletX1_line = this.itemProtocol.getPalletX1_line(); palletX1_line = this.itemProtocol.getPalletX1_line();
palletY1_row = this.itemProtocol.getPalletY1_row(); palletY1_row = this.itemProtocol.getPalletY1_row();
palletA1_angle = this.itemProtocol.getPalletA1_angle(); palletA1_angle = this.itemProtocol.getPalletA1_angle();
palletX2_line = this.itemProtocol.getPalletX2_line(); palletX2_line = this.itemProtocol.getPalletX2_line();
palletY2_row = this.itemProtocol.getPalletY2_row(); palletY2_row = this.itemProtocol.getPalletY2_row();
palletA2_angle = this.itemProtocol.getPalletA2_angle(); palletA2_angle = this.itemProtocol.getPalletA2_angle();
palletX3_line = this.itemProtocol.getPalletX3_line(); palletX3_line = this.itemProtocol.getPalletX3_line();
palletY3_row = this.itemProtocol.getPalletY3_row(); palletY3_row = this.itemProtocol.getPalletY3_row();
palletA3_angle = this.itemProtocol.getPalletA3_angle(); palletA3_angle = this.itemProtocol.getPalletA3_angle();
pressCribX1_line = this.itemProtocol.getPressCribX1_line(); pressCribX1_line = this.itemProtocol.getPressCribX1_line();
pressCribY1_row = this.itemProtocol.getPressCribY1_row(); pressCribY1_row = this.itemProtocol.getPressCribY1_row();
pressCribA1_angle = this.itemProtocol.getPressCribA1_angle(); pressCribA1_angle = this.itemProtocol.getPressCribA1_angle();
pressCribX2_line = this.itemProtocol.getPressCribX2_line(); pressCribX2_line = this.itemProtocol.getPressCribX2_line();
pressCribY2_row = this.itemProtocol.getPressCribY2_row(); pressCribY2_row = this.itemProtocol.getPressCribY2_row();
pressCribA2_angle = this.itemProtocol.getPressCribA2_angle(); pressCribA2_angle = this.itemProtocol.getPressCribA2_angle();
pressCribX3_line = this.itemProtocol.getPressCribX3_line(); pressCribX3_line = this.itemProtocol.getPressCribX3_line();
pressCribY3_row = this.itemProtocol.getPressCribY3_row(); pressCribY3_row = this.itemProtocol.getPressCribY3_row();
pressCribA3_angle = this.itemProtocol.getPressCribA3_angle(); pressCribA3_angle = this.itemProtocol.getPressCribA3_angle();
Zoffset = this.itemProtocol.getZoffset(); Zoffset = this.itemProtocol.getZoffset();
pallet_layerQty = this.itemProtocol.getPallet_layerQty(); pallet_layerQty = this.itemProtocol.getPallet_layerQty();
pressCrib_layerQty = this.itemProtocol.getPressCrib_layerQty(); pressCrib_layerQty = this.itemProtocol.getPressCrib_layerQty();
codeLayerX1_interval = this.itemProtocol.getCodeLayerX1_interval(); codeLayerX1_interval = this.itemProtocol.getCodeLayerX1_interval();
codeLayerY1_interval = this.itemProtocol.getCodeLayerY1_interval(); codeLayerY1_interval = this.itemProtocol.getCodeLayerY1_interval();
codeLayerX2_interval = this.itemProtocol.getCodeLayerX2_interval(); codeLayerX2_interval = this.itemProtocol.getCodeLayerX2_interval();
codeLayerY2_interval = this.itemProtocol.getCodeLayerY2_interval(); codeLayerY2_interval = this.itemProtocol.getCodeLayerY2_interval();
codeLayerX3_interval = this.itemProtocol.getCodeLayerX3_interval(); codeLayerX3_interval = this.itemProtocol.getCodeLayerX3_interval();
codeLayerY3_interval = this.itemProtocol.getcodeLayerY3_interval(); codeLayerY3_interval = this.itemProtocol.getcodeLayerY3_interval();
codeLayerX1_offset = this.itemProtocol.getCodeLayerX1_offset(); codeLayerX1_offset = this.itemProtocol.getCodeLayerX1_offset();
codeLayerY1_offset = this.itemProtocol.getCodeLayerY1_offset(); codeLayerY1_offset = this.itemProtocol.getCodeLayerY1_offset();
codeLayerX2_offset = this.itemProtocol.getCodeLayerX2_offset(); codeLayerX2_offset = this.itemProtocol.getCodeLayerX2_offset();
codeLayerY2_offset = this.itemProtocol.getCodeLayerY2_offset(); codeLayerY2_offset = this.itemProtocol.getCodeLayerY2_offset();
codeLayerX3_offset = this.itemProtocol.getCodeLayerX3_offset(); codeLayerX3_offset = this.itemProtocol.getCodeLayerX3_offset();
codeLayerY3_offset = this.itemProtocol.getCodeLayerY3_offset(); codeLayerY3_offset = this.itemProtocol.getCodeLayerY3_offset();
pressLayerX1_interval = this.itemProtocol.getPressLayerX1_interval(); pressLayerX1_interval = this.itemProtocol.getPressLayerX1_interval();
pressLayerY1_interval = this.itemProtocol.getPressLayerY1_interval(); pressLayerY1_interval = this.itemProtocol.getPressLayerY1_interval();
pressLayerX2_interval = this.itemProtocol.getPressLayerX2_interval(); pressLayerX2_interval = this.itemProtocol.getPressLayerX2_interval();
pressLayerY2_interval = this.itemProtocol.getPressLayerY2_interval(); pressLayerY2_interval = this.itemProtocol.getPressLayerY2_interval();
pressLayerX3_interval = this.itemProtocol.getPressLayerX3_interval(); pressLayerX3_interval = this.itemProtocol.getPressLayerX3_interval();
pressLayerY3_interval = this.itemProtocol.getPressLayerY3_interval(); pressLayerY3_interval = this.itemProtocol.getPressLayerY3_interval();
pressLayerX1_offset = this.itemProtocol.getPressLayerX1_offset(); pressLayerX1_offset = this.itemProtocol.getPressLayerX1_offset();
pressLayerY1_offset = this.itemProtocol.getPressLayerY1_offset(); pressLayerY1_offset = this.itemProtocol.getPressLayerY1_offset();
pressLayerX2_offset = this.itemProtocol.getPressLayerX2_offset(); pressLayerX2_offset = this.itemProtocol.getPressLayerX2_offset();
pressLayerY2_offset = this.itemProtocol.getPressLayerY2_offset(); pressLayerY2_offset = this.itemProtocol.getPressLayerY2_offset();
pressLayerX3_offset = this.itemProtocol.getPressLayerX3_offset(); pressLayerX3_offset = this.itemProtocol.getPressLayerX3_offset();
pressLayerY3_offset = this.itemProtocol.getPressLayerY3_offset(); pressLayerY3_offset = this.itemProtocol.getPressLayerY3_offset();
tool_coordinate = this.itemProtocol.getTool_coordinate(); tool_coordinate = this.itemProtocol.getTool_coordinate();
tool_coordinate = this.itemProtocol.getTool_coordinate(); tool_coordinate = this.itemProtocol.getTool_coordinate();
if (mode != last_mode) { if (mode != last_mode) {
this.setRequireSucess(false); this.setRequireSucess(false);
if(mode==2){
writing(0);
}
logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode)); logServer.deviceItemValue(this.device_code, "mode", String.valueOf(mode));
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + " -> " + mode);
} }

1287
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java

File diff suppressed because it is too large

6
acs/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java

@ -258,8 +258,6 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
} else { } else {
message = "无请求"; message = "无请求";
} }
Object ignore_pickup_check = this.getExtraValue().get("ignore_pickup_check");
} }
last_mode = mode; last_mode = mode;
@ -599,7 +597,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
* @param * @param
*/ */
public synchronized boolean apply_take_empty_vehicle() { public synchronized boolean apply_take_empty_vehicle() {
if(move == 0) { if(move == 1) {
ApplyTaskRequest request = new ApplyTaskRequest(); ApplyTaskRequest request = new ApplyTaskRequest();
request.setDevice_code(this.getDevice_code()); request.setDevice_code(this.getDevice_code());
request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName()); request.setRequest_medthod_code(Thread.currentThread().getStackTrace()[1].getMethodName());
@ -619,7 +617,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
} }
return true; return true;
} else { } else {
message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备货未请求LMS..."; message = RequestMethodEnum.getName("apply_take_empty_vehicle") + "apply_take_empty_vehicle 设备货未请求LMS...";
lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message)); lucene.deviceExecuteLog(new LuceneLogDto(this.device_code, message));
return false; return false;
} }

4
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/data/AcsToWmsData/applyTask/ApplyTaskResponse.java

@ -22,4 +22,8 @@ public class ApplyTaskResponse extends BaseResponse {
private String mix_num; private String mix_num;
private String weight; private String weight;
//private String is_order_finish;
} }

16
acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java

@ -855,10 +855,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_code", device.getDevice_code()); jo.put("device_code", device.getDevice_code());
jo.put("mode", lnshRGVDeviceDriver.getMode()); jo.put("mode", lnshRGVDeviceDriver.getMode());
jo.put("status", lnshRGVDeviceDriver.getStatus()); jo.put("status", lnshRGVDeviceDriver.getStatus());
jo.put("move1", lnshRGVDeviceDriver.getMove1()); jo.put("move1", lnshRGVDeviceDriver.getMove_1());
jo.put("move2", lnshRGVDeviceDriver.getMove2()); jo.put("move2", lnshRGVDeviceDriver.getMove_2());
jo.put("action1", lnshRGVDeviceDriver.getAction1()); jo.put("action1", lnshRGVDeviceDriver.getAction_1());
jo.put("action2", lnshRGVDeviceDriver.getAction2()); jo.put("action2", lnshRGVDeviceDriver.getAction_2());
jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y()); jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y());
jo.put("error", lnshRGVDeviceDriver.getError()); jo.put("error", lnshRGVDeviceDriver.getError());
jo.put("task1", lnshRGVDeviceDriver.getTask1()); jo.put("task1", lnshRGVDeviceDriver.getTask1());
@ -1064,10 +1064,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
jo.put("device_code", device.getDevice_code()); jo.put("device_code", device.getDevice_code());
jo.put("mode", lnshRGVDeviceDriver.getMode()); jo.put("mode", lnshRGVDeviceDriver.getMode());
jo.put("status", lnshRGVDeviceDriver.getStatus()); jo.put("status", lnshRGVDeviceDriver.getStatus());
jo.put("move_1", lnshRGVDeviceDriver.getMove1()); jo.put("move_1", lnshRGVDeviceDriver.getMove_1());
jo.put("move_2", lnshRGVDeviceDriver.getMove2()); jo.put("move_2", lnshRGVDeviceDriver.getMove_2());
jo.put("action_1", lnshRGVDeviceDriver.getAction1()); jo.put("action_1", lnshRGVDeviceDriver.getAction_1());
jo.put("action_2", lnshRGVDeviceDriver.getAction2()); jo.put("action_2", lnshRGVDeviceDriver.getAction_2());
jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y()); jo.put("walk_y", lnshRGVDeviceDriver.getWalk_y());
jo.put("error", lnshRGVDeviceDriver.getError()); jo.put("error", lnshRGVDeviceDriver.getError());
jo.put("task1", lnshRGVDeviceDriver.getTask1()); jo.put("task1", lnshRGVDeviceDriver.getTask1());

125
acs/nladmin-system/src/main/java/org/nl/acs/opc/JsonUtl.java

@ -0,0 +1,125 @@
package org.nl.acs.opc;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.type.TypeFactory;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public class JsonUtl {
private static ObjectMapper objectMapper = null;
private static ObjectMapper objectMapperLog = null;
private JsonUtl() {
}
private static ObjectMapper init() {
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
// simpleModule.addSerializer(Enum.class, new EnumSerializer());
// simpleModule.addSerializer(Date.class, new DateSerializer());
// simpleModule.addDeserializer(Enum.class, new EnumDeserializer());
// simpleModule.addDeserializer(Date.class, new DateDeserializers.DateDeserializer());
objectMapper.registerModule(simpleModule);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return objectMapper;
}
public static ObjectMapper getInstance() {
if (objectMapper == null) {
Class var0 = JsonUtl.class;
synchronized(JsonUtl.class) {
if (objectMapper == null) {
objectMapper = init();
}
}
}
return objectMapper;
}
public static ObjectMapper getInstanceLog() {
if (objectMapperLog == null) {
Class var0 = JsonUtl.class;
synchronized(JsonUtl.class) {
if (objectMapperLog == null) {
objectMapperLog = init();
objectMapperLog.setSerializationInclusion(Include.NON_NULL);
}
}
}
return objectMapperLog;
}
public static ObjectMapper getObjectMapper() {
return getInstance();
}
public static String parse(Object object) throws RuntimeException {
try {
return getObjectMapper().writeValueAsString(object);
} catch (JsonProcessingException var2) {
throw new RuntimeException(var2);
}
}
public static String parseWithoutException(Object object) {
try {
return parse(object);
} catch (Exception var2) {
return null;
}
}
public static String parseLog(Object object) {
try {
return getInstanceLog().writeValueAsString(object);
} catch (Exception var2) {
return null;
}
}
public static <T> T format(String json, Class<T> clazz) throws RuntimeException {
try {
return getObjectMapper().readValue(json, clazz);
} catch (IOException var3) {
throw new RuntimeException(var3);
}
}
public static <T> List<T> formatList(String json, Class<T> clazz) throws RuntimeException {
try {
JavaType type = getObjectMapper().getTypeFactory().constructParametricType(List.class, new Class[]{clazz});
return (List)getObjectMapper().readValue(json, type);
} catch (IOException var3) {
throw new RuntimeException(var3);
}
}
public static <T, U> Map<T, U> formatMap(String json, Class<T> clazzKey, Class<U> clazzValue) throws RuntimeException {
try {
JavaType type = getObjectMapper().getTypeFactory().constructParametricType(Map.class, new Class[]{clazzKey, clazzValue});
return (Map)getObjectMapper().readValue(json, type);
} catch (IOException var4) {
throw new RuntimeException(var4);
}
}
public static <T> List<List<T>> formatListTwo(String json, Class<T> clazz) throws RuntimeException {
try {
TypeFactory typeFactory = getObjectMapper().getTypeFactory();
JavaType type = typeFactory.constructParametrizedType(List.class, List.class, new Class[]{clazz});
type = typeFactory.constructParametrizedType(List.class, List.class, new JavaType[]{type});
return (List)getObjectMapper().readValue(json, type);
} catch (IOException var4) {
throw new RuntimeException(var4);
}
}
}

4
acs/nladmin-system/src/main/java/org/nl/acs/task/service/dto/TaskDto.java

@ -248,4 +248,8 @@ public class TaskDto implements Serializable {
*/ */
private String direction; private String direction;
/**
* 放货设备编号(覆膜机)
*/
private String put_device_code;
} }

28
acs/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java

@ -740,39 +740,39 @@ public class StageServiceImpl implements StageService {
status = "故障"; status = "故障";
} }
if (lnshRGVDeviceDriver.getMove1() == 0) { if (lnshRGVDeviceDriver.getMove_1() == 0) {
move_1 = "无货"; move_1 = "无货";
} else if (lnshRGVDeviceDriver.getMove1() == 1) { } else if (lnshRGVDeviceDriver.getMove_1() == 1) {
move_1 = "有货"; move_1 = "有货";
} else if (lnshRGVDeviceDriver.getMove1() == 2) { } else if (lnshRGVDeviceDriver.getMove_1() == 2) {
move_1 = "有托盘有货"; move_1 = "有托盘有货";
} }
if (lnshRGVDeviceDriver.getMove2() == 0) { if (lnshRGVDeviceDriver.getMove_2() == 0) {
move_2 = "无货"; move_2 = "无货";
} else if (lnshRGVDeviceDriver.getMove2() == 1) { } else if (lnshRGVDeviceDriver.getMove_2() == 1) {
move_2 = "有货"; move_2 = "有货";
} else if (lnshRGVDeviceDriver.getMove2() == 2) { } else if (lnshRGVDeviceDriver.getMove_2() == 2) {
move_2 = "有托盘有货"; move_2 = "有托盘有货";
} }
if (lnshRGVDeviceDriver.getAction1() == 1) { if (lnshRGVDeviceDriver.getAction_1() == 1) {
action_1 = "取货中"; action_1 = "取货中";
} else if (lnshRGVDeviceDriver.getAction1() == 2) { } else if (lnshRGVDeviceDriver.getAction_1() == 2) {
action_1 = "取货完成"; action_1 = "取货完成";
} else if (lnshRGVDeviceDriver.getAction1() == 3) { } else if (lnshRGVDeviceDriver.getAction_1() == 3) {
action_1 = "放货中"; action_1 = "放货中";
} else if (lnshRGVDeviceDriver.getAction1() == 4) { } else if (lnshRGVDeviceDriver.getAction_1() == 4) {
action_1 = "放货完成"; action_1 = "放货完成";
} }
if (lnshRGVDeviceDriver.getAction2() == 1) { if (lnshRGVDeviceDriver.getAction_2() == 1) {
action_2 = "取货中"; action_2 = "取货中";
} else if (lnshRGVDeviceDriver.getAction2() == 2) { } else if (lnshRGVDeviceDriver.getAction_2() == 2) {
action_2 = "取货完成"; action_2 = "取货完成";
} else if (lnshRGVDeviceDriver.getAction2() == 3) { } else if (lnshRGVDeviceDriver.getAction_2() == 3) {
action_2 = "放货中"; action_2 = "放货中";
} else if (lnshRGVDeviceDriver.getAction2() == 4) { } else if (lnshRGVDeviceDriver.getAction_2() == 4) {
action_2 = "放货完成"; action_2 = "放货完成";
} }

80
acs/nladmin-ui/src/views/acs/device/driver/lnsh/lnsh_fold_disc_site.vue

@ -166,6 +166,68 @@
</el-form> </el-form>
</el-card> </el-card>
<el-card class="box-card" shadow="never">
<div slot="header" class="clearfix">
<span class="role-span">交互相关</span>
</div>
<div class="crud-opts2" style="margin-bottom: 5px;">
<span class="crud-opts-right2">
<!--左侧插槽-->
<slot name="left" />
<el-button
slot="left"
class="filter-item"
type="primary"
icon="el-icon-plus"
size="mini"
@click="insertdtl()"
>
新增一行
</el-button>
</span>
</div>
<div class="app-container">
<el-table :data="modeform.tableData" border fit highlight-current-row style="width: 100%;" class="tb-edit">
<el-table-column label="mode" prop="模式" width="180">
<template scope="scope">
<el-input-number value="3" :min="3" v-model="scope.row.mode" size="mini" />
<span v-show="scope.row.edit">{{ scope.row.mode }}</span>
</template>
</el-table-column>
<el-table-column label="request" prop="请求方法" width="500">
<template scope="scope">
<el-select
v-model="scope.row.request"
filterable
clearable
placeholder="请选择"
style="width: 450px"
>
<el-option
v-for="item in requestMethodList"
:key="item.code"
:label="item.name"
:value="item.code"
/>
</el-select>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="170" >
<template scope="scope">
<el-button
type="danger"
class="filter-item"
size="mini"
icon="el-icon-delete"
@click.native.prevent="deleteRow(scope.$index, modeform.tableData)"
/>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
<span class="role-span">PLC读取字段</span> <span class="role-span">PLC读取字段</span>
@ -301,11 +363,20 @@ export default {
opc_id: '', opc_id: '',
opc_code: '', opc_code: '',
configLoading: false, configLoading: false,
requestMethodList: [],
dataOpcservers: [], dataOpcservers: [],
dataOpcPlcs: [], dataOpcPlcs: [],
deviceList: [], deviceList: [],
data1: [], data1: [],
data2: [], data2: [],
modeform: {
tableData: [
{
mode: '8',
request: 'apply_force_take_full_vehicle'
}
]
},
form: { form: {
inspect_in_stocck: true, inspect_in_stocck: true,
ignore_pickup_check: true, ignore_pickup_check: true,
@ -360,9 +431,16 @@ export default {
deviceCrud.selectDeviceList().then(data => { deviceCrud.selectDeviceList().then(data => {
this.deviceList = data this.deviceList = data
}) })
deviceCrud.selectRequestMethodList().then(data => {
this.requestMethodList = data
})
}) })
}, },
methods: { methods: {
deleteRow(index, rows) {
debugger
rows.splice(index, 1)
},
finishReadEdit(data) { finishReadEdit(data) {
// code,mode // code,mode
if (data.code.indexOf('mode') !== -1) { if (data.code.indexOf('mode') !== -1) {
@ -493,7 +571,7 @@ export default {
parentForm.is_route = true parentForm.is_route = true
parentForm.plc_id = this.plc_id parentForm.plc_id = this.plc_id
parentForm.opc_id = this.opc_id parentForm.opc_id = this.opc_id
updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => { updateConfig(parentForm, this.form, this.modeform, this.data1, this.data2).then(res => {
this.notify('保存成功', 'success') this.notify('保存成功', 'success')
this.configLoading = false this.configLoading = false
}).catch(err => { }).catch(err => {

8
acs/nladmin-ui/src/views/acs/instruction/index.vue

@ -127,9 +127,13 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip /> <el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip /> <!-- <el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip /> <el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip /> <!-- <el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="start_point_code2" label="起点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_point_code2" label="终点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_device_code" label="放货位" min-width="100" show-overflow-tooltip />
<el-table-column prop="carno" label="车号" /> <el-table-column prop="carno" label="车号" />
<el-table-column prop="compound_inst" label="复合指令"> <el-table-column prop="compound_inst" label="复合指令">
<template slot-scope="scope"> <template slot-scope="scope">

8
acs/nladmin-ui/src/views/acs/task/index.vue

@ -261,9 +261,13 @@
</el-table-column> </el-table-column>
<el-table-column prop="priority" label="任务优先级" min-width="100" show-overflow-tooltip /> <el-table-column prop="priority" label="任务优先级" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip /> <el-table-column prop="start_point_code" label="起点" min-width="100" show-overflow-tooltip />
<el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip /> <!-- <el-table-column prop="start_parent_code" label="父起点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip /> <el-table-column prop="next_point_code" label="终点" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip /> <!-- <el-table-column prop="next_parent_code" label="父终点点位" min-width="100" show-overflow-tooltip />-->
<el-table-column prop="start_point_code2" label="起点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_point_code2" label="终点2" min-width="100" show-overflow-tooltip />
<el-table-column prop="next_device_code" label="放货位" min-width="100" show-overflow-tooltip />
<el-table-column prop="compound_task" label="复合任务"> <el-table-column prop="compound_task" label="复合任务">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.compound_task==='0' "></span> <span v-if="scope.row.compound_task==='0' "></span>

Loading…
Cancel
Save