Browse Source

更新

master
汪菘 2 years ago
parent
commit
0524ce09b3
  1. 13
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_Laminating_machine/LnshLaminatingMachineDeviceDriver.java
  2. 40
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_fold_disc_site/LnshFoldDiscSiteDeviceDriver.java
  3. 7
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_mixing_mill/LnshMixingMillDeviceDriver.java
  4. 55
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_pallet_manipulator/LnshPackagePalletManipulatorDeviceDriver.java
  5. 199
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/LnshPackageSiteDeviceDriver.java
  6. 35
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java
  7. 427
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/LnshRGVDeviceDriver.java
  8. 2
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDefination.java
  9. 127
      acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java
  10. 6
      acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java
  11. 41
      acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java
  12. 5
      acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java
  13. 75
      acs/hd/nladmin-system/src/main/resources/config/application-prod.yml
  14. 37
      acs/hd/nladmin-system/src/main/resources/logback-spring.xml
  15. 101
      acs/qd/src/views/acs/device/driver/lnsh/lnsh_rgv.vue

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

@ -150,12 +150,7 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
return; return;
} }
if (!this.itemProtocol.getIsonline()) { if (mode == 0) {
this.setIsonline(false);
this.setIserror(true);
message = "信号量同步异常";
//未联机
} else if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
this.setIserror(true); this.setIserror(true);
message = "未联机"; message = "未联机";
@ -258,16 +253,14 @@ public class LnshLaminatingMachineDeviceDriver extends AbstractOpcDeviceDriver i
return false; return false;
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject jo = acsToWmsService.getVehicleCode(this.device_code); JSONObject jo = acsToWmsService.getVehicleCode(this.device_code);
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
String vehicle_code = jo.getString("vehicle_code"); String vehicle_code = jo.getString("vehicle_code");
this.writing(this.mode);
this.writing("to_barcode",vehicle_code); this.writing("to_barcode",vehicle_code);
this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }

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

@ -3,6 +3,7 @@ package org.nl.acs.device_driver.lnsh.lnsh_fold_disc_site;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -13,6 +14,7 @@ import org.nl.acs.device_driver.DeviceDriver;
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.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;
@ -49,7 +51,8 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
@Autowired @Autowired
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
String device_code; String device_code;
int mode = 0; int mode = 0;
int error = 0; int error = 0;
@ -70,6 +73,12 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
int branchProtocol = 0; int branchProtocol = 0;
private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date();
private int instruction_require_time_out;
private int instruction_finished_time_out;
String message; String message;
int status = 0; int status = 0;
int last_status = 0; int last_status = 0;
@ -181,7 +190,9 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
break; break;
case 3: case 3:
if (!requireSucess) {
palletizing();
}
break; break;
case 4: case 4:
break; break;
@ -198,6 +209,31 @@ public class LnshFoldDiscSiteDeviceDriver extends AbstractOpcDeviceDriver implem
last_container_qty = container_qty; last_container_qty = container_qty;
} }
/**
* 拆垛完成
*
* @param
*/
public synchronized boolean palletizing() {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.instruction_require_time = date;
JSONObject json = new JSONObject();
json.put("device_code",device_code);
json.put("type","3");
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
if (result.getStatus() == 200) {
this.writing(this.mode);
requireSucess = true;
}
return true;
}
}
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()

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

@ -186,12 +186,7 @@ public class LnshMixingMillDeviceDriver extends AbstractOpcDeviceDriver implemen
return; return;
} }
if (!this.itemProtocol.getIsonline()) { if (mode == 0) {
this.setIsonline(false);
this.setIserror(true);
message = "信号量同步异常";
//未联机
} else if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
this.setIserror(true); this.setIserror(true);
message = "未联机"; message = "未联机";

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

@ -34,10 +34,7 @@ import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 晟华-包装码垛机械手 * 晟华-包装码垛机械手
@ -603,12 +600,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
return; return;
} }
if (!this.itemProtocol.getIsonline()) { if (mode == 0) {
this.setIsonline(false);
this.setIserror(true);
message = "信号量同步异常";
//未联机
} else if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
this.setIserror(true); this.setIserror(true);
message = "未联机"; message = "未联机";
@ -651,6 +643,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
case 6: case 6:
//码垛完成 //码垛完成
if (!requireSucess) { if (!requireSucess) {
applyEmpty();
palletizing(); palletizing();
} }
break; break;
@ -665,6 +658,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
if (!requireSucess) { if (!requireSucess) {
applyEmpty(); applyEmpty();
} }
break;
case 9: case 9:
//工单完成 //工单完成
if (!requireSucess && !order_No.equals("0")) { if (!requireSucess && !order_No.equals("0")) {
@ -791,13 +785,13 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
this.writing(this.mode); this.writing(this.mode);
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No); ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
if (this.mode == 4) { if (this.mode == 4) {
dto.setOrder_status("0"); dto.setOrder_status("1");
} else if (this.mode == 9){ } else if (this.mode == 9){
dto.setOrder_status("2"); dto.setOrder_status("2");
} }
produceshiftorderService.update(dto); produceshiftorderService.update(dto);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }
@ -815,7 +809,11 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(put_station-1).replace("\"",""));
json.put("vehicle_code",barcode); json.put("vehicle_code",barcode);
JSONObject jo = acsToWmsService.getVehicle(json); JSONObject jo = acsToWmsService.getVehicle(json);
@ -883,7 +881,6 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
String two_qty = content.getString("two_qty"); String two_qty = content.getString("two_qty");
String tool_coordinate = content.getString("tool_coordinate"); String tool_coordinate = content.getString("tool_coordinate");
this.writing(this.mode);
this.writing("to_material_qty",qty); this.writing("to_material_qty",qty);
this.writing("to_material_code",material_code); this.writing("to_material_code",material_code);
this.writing("to_product_code",product_code); this.writing("to_product_code",product_code);
@ -944,9 +941,10 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
this.writing("to_one_qty",one_qty); this.writing("to_one_qty",one_qty);
this.writing("to_two_qty",two_qty); this.writing("to_two_qty",two_qty);
this.writing("to_tool_coordinate",tool_coordinate); this.writing("to_tool_coordinate",tool_coordinate);
this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }
@ -964,7 +962,11 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(put_station-1).replace("\"",""));
json.put("qty",qty); json.put("qty",qty);
json.put("vehicle_code",barcode); json.put("vehicle_code",barcode);
json.put("is_full","1"); json.put("is_full","1");
@ -1030,8 +1032,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
if (result.getStatus() == 200) { if (result.getStatus() == 200) {
this.writing(this.mode); this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }
@ -1049,7 +1051,11 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(put_station-1).replace("\"",""));
json.put("qty",qty); json.put("qty",qty);
json.put("vehicle_code",barcode); json.put("vehicle_code",barcode);
json.put("is_full","0"); json.put("is_full","0");
@ -1115,8 +1121,8 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json);
if (result.getStatus() == 200) { if (result.getStatus() == 200) {
this.writing(this.mode); this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }
@ -1134,16 +1140,17 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(put_station-1).replace("\"",""));
json.put("type","4"); json.put("type","4");
json.put("qty",qty);
json.put("vehicle_code",barcode);
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
if (result.getStatus() == 200) { if (result.getStatus() == 200) {
this.writing(this.mode); this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }

199
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_package_site/LnshPackageSiteDeviceDriver.java

@ -3,6 +3,7 @@ package org.nl.acs.device_driver.lnsh.lnsh_package_site;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpResponse;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
@ -16,6 +17,7 @@ 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.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver; import org.nl.acs.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver;
import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver; import org.nl.acs.device_driver.standard_inspect_site.StandardInspectSiteDeviceDriver;
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;
@ -54,7 +56,8 @@ public class LnshPackageSiteDeviceDriver extends AbstractOpcDeviceDriver impleme
TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl");
@Autowired @Autowired
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired
AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl");
//放货准备锁 //放货准备锁
String putReadyLock = null; String putReadyLock = null;
//有货标记 //有货标记
@ -178,16 +181,7 @@ public class LnshPackageSiteDeviceDriver extends AbstractOpcDeviceDriver impleme
return; return;
} }
//急停 if (mode == 0) {
if (this.isStop()) {
//未在线无心跳
} else if (!this.itemProtocol.getIsonline()) {
this.setIsonline(false);
this.setIserror(true);
message = "信号量同步异常";
//未联机
} else if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
this.setIserror(true); this.setIserror(true);
message = "未联机"; message = "未联机";
@ -210,15 +204,12 @@ public class LnshPackageSiteDeviceDriver extends AbstractOpcDeviceDriver impleme
case 2: case 2:
break; break;
case 3: case 3:
//申请空盘
if (!requireSucess && this.move == 0) {
applyEmpty();
}
break; break;
case 4: case 4:
//申请搬运任务 //申请贴标
if (!requireSucess && this.move != 0) { if (!requireSucess && this.move != 0 && !StrUtil.equals("0",barcode)) {
autoCreateTask(); applyBarcode();
} }
break; break;
case 5: case 5:
@ -238,130 +229,32 @@ public class LnshPackageSiteDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
/** /**
* 生成搬运任务 * 申请贴标
* *
* @return * @return
*/ */
public synchronized boolean autoCreateTask() { public synchronized boolean applyBarcode() {
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;
TaskDto dto = new TaskDto(); JSONObject json = new JSONObject();
String now = DateUtil.now(); json.put("device_code",this.device_code);
dto.setTask_id(IdUtil.simpleUUID()); json.put("vehicle_code",barcode);
dto.setCreate_by(this.getDevice().getDevice_code()); HttpResponse result = acsToWmsService.applyBarcode(json);
dto.setUpdate_by(this.getDevice().getDevice_code()); if (result.getStatus() == 200) {
dto.setStart_point_code(this.getDevice().getDevice_code()); this.writing(this.mode);
dto.setStart_device_code(this.getDevice().getDevice_code()); requireSucess = true;
dto.setTask_status("0");
dto.setPriority("101");
String next_device_code = "";
String plan_uuid = WQLObject.getWQLObject("acs_route_plan").query("plan_code= '" + dto.getRoute_plan_code() + "'").uniqueResult(0).getString("plan_uuid");
JSONArray ja = routelineserver.queryNextLine(this.getDevice().getDevice_code(), plan_uuid);
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = (JSONObject) ja.get(i);
next_device_code = jo.get("next_device_code").toString();
Device nextdevice = appService.findDeviceByCode(next_device_code);
StandardInspectSiteDeviceDriver standardInspectSiteDeviceDriver;
if (nextdevice.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) nextdevice.getDeviceDriver();
String maxTaskNum = WQLObject.getWQLObject("sys_param").query("code= 'onePointMaxTask' and is_active='1' ").uniqueResult(0).getString("value");
if (taskserver.checkAllowCreate(next_device_code) >= Integer.parseInt(maxTaskNum)) {
next_device_code = "";
continue;
}
if (standardInspectSiteDeviceDriver.getMode() == 2 && standardInspectSiteDeviceDriver.getMove() == 0) {
break;
}
}
} }
if (StrUtil.isEmpty(next_device_code)) {
throw new RuntimeException("该设备未找到对应路由");
}
dto.setNext_point_code(next_device_code);
dto.setNext_device_code(next_device_code);
dto.setUpdate_time(now);
dto.setCreate_time(now);
String taskcode = CodeUtil.getNewCode("TASK_NO");
dto.setTask_code("-" + taskcode);
try {
taskserver.create(dto);
} catch (Exception e) {
e.printStackTrace();
}
this.setRequireSucess(true);
return true; return true;
} }
} }
public synchronized boolean applyEmpty() {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.instruction_require_time = date;
TaskDto dto = new TaskDto();
String now = DateUtil.now();
dto.setTask_id(IdUtil.simpleUUID());
dto.setCreate_by(this.getDevice().getDevice_code());
dto.setUpdate_by(this.getDevice().getDevice_code());
dto.setTask_status("0");
dto.setPriority("101");
String start_device_code = "";
String plan_uuid = WQLObject.getWQLObject("acs_route_plan").query("plan_code= '" + dto.getRoute_plan_code() + "'").uniqueResult(0).getString("plan_uuid");
JSONArray ja = routelineserver.querySuperiorLine(this.getDevice().getDevice_code(), plan_uuid);
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
for (int i = 0; i < ja.size(); i++) {
JSONObject jo = (JSONObject) ja.get(i);
start_device_code = jo.get("device_code").toString();
Device start_device = appService.findDeviceByCode(start_device_code);
StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver;
if (start_device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) start_device.getDeviceDriver();
//根据路由 寻找取空盘的设备
// if(standardEmptyPalletSiteDeviceDriver.getNumber() < Integer.parseInt(standardEmptyPalletSiteDeviceDriver.getDevice().getExtraValue().get("max_emptypalletnum").toString()) ) {
// break;
// }
if (standardEmptyPalletSiteDeviceDriver.getMode() == 2 && standardEmptyPalletSiteDeviceDriver.getNumber() > 0) {
break;
}
}
}
dto.setTask_type("1");
dto.setEmptypallet_num("1");
dto.setNext_device_code(this.getDevice().getDevice_code());
dto.setNext_point_code(this.getDevice().getDevice_code());
dto.setStart_point_code(start_device_code);
dto.setStart_device_code(start_device_code);
if (StrUtil.isEmpty(start_device_code)) {
throw new RuntimeException("该设备未找到对应路由");
}
dto.setUpdate_time(now);
dto.setCreate_time(now);
String taskcode = CodeUtil.getNewCode("TASK_NO");
dto.setTask_code("-" + taskcode);
try {
taskserver.create(dto);
} catch (Exception e) {
e.printStackTrace();
}
this.setRequireSucess(true);
this.setBranchProtocol(0);
return true;
}
}
public void finish_instruction(Instruction instruction) throws Exception { public void finish_instruction(Instruction instruction) throws Exception {
instruction_finished(instruction); instruction_finished(instruction);
} }
@ -446,52 +339,14 @@ public class LnshPackageSiteDeviceDriver extends AbstractOpcDeviceDriver impleme
} }
public boolean instruction_require(String container_code) { public void writing(int command) {
return instruction_require(container_code, WcsConfig.task_container_type_default_desc); String to_command = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
} + "." + org.nl.acs.device_driver.lnsh.lnsh_station.ItemProtocol.item_to_command;
String opcservcerid = this.getDevice().getOpc_server_id();
/** Server server = ReadUtil.getServer(opcservcerid);
* 请求指令 Map<String, Object> itemMap = new HashMap<String, Object>();
* itemMap.put(to_command, command);
* @param container_code ReadUtil.write(itemMap, server);
* @param container_type
*/
public synchronized boolean instruction_require(String container_code, String container_type) {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.instruction_require_time = date;
TaskDto dto = new TaskDto();
String now = DateUtil.now();
dto.setTask_id(IdUtil.simpleUUID());
dto.setCreate_by(this.getDevice().getDevice_code());
dto.setUpdate_by(this.getDevice().getDevice_code());
dto.setStart_point_code(this.getDevice().getDevice_code());
dto.setVehicle_code(container_code);
dto.setVehicle_type(container_type);
String taskcode = CodeUtil.getNewCode("TASK_NO");
dto.setTask_code("-" + taskcode);
dto.setTask_status("0");
dto.setPriority("101");
RouteLineDto jo = routelineserver.findByCode(this.getDevice().getDevice_code());
String next_device_codecode = jo.getNext_device_code();
if (StrUtil.isEmpty(next_device_codecode)) {
throw new RuntimeException("该设备未找到对应路由");
}
dto.setNext_point_code(next_device_codecode);
dto.setUpdate_time(now);
dto.setCreate_time(now);
WQLObject wo = WQLObject.getWQLObject("acs_task");
JSONObject json = (JSONObject) JSONObject.toJSON(dto);
wo.insert(json);
requireSucess = false;
return true;
}
} }
public void writing(int type, int command) { public void writing(int type, int command) {

35
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_rgv/ItemProtocol.java

@ -26,14 +26,17 @@ public class ItemProtocol {
public static String item_standby_time = "standby_time"; public static String item_standby_time = "standby_time";
public static String item_production_time = "production_time"; public static String item_production_time = "production_time";
public static String item_error_time = "error_time"; public static String item_error_time = "error_time";
public static String item_to_command = "to_command";
public static String item_to_command1 = "to_command1";
public static String item_to_onset1 = "to_onset1"; public static String item_to_onset1 = "to_onset1";
public static String item_to_target1 = "to_target1"; public static String item_to_target1 = "to_target1";
public static String item_to_task = "to_task"; public static String item_to_task1 = "to_task1";
public static String item_to_command2 = "to_command2";
public static String item_to_task2 = "to_task2"; public static String item_to_task2 = "to_task2";
public static String item_to_onset2 = "to_onset2"; public static String item_to_onset2 = "to_onset2";
public static String item_to_target2 = "to_target2"; public static String item_to_target2 = "to_target2";
private LnshRGVDeviceDriver driver; private LnshRGVDeviceDriver driver;
public ItemProtocol(LnshRGVDeviceDriver driver) { public ItemProtocol(LnshRGVDeviceDriver driver) {
@ -100,8 +103,8 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_task2); return this.getOpcIntegerValue(item_task2);
} }
public int getTo_command() { public int getTo_command1() {
return this.getOpcIntegerValue(item_to_command); return this.getOpcIntegerValue(item_to_command1);
} }
public int getTo_onset1() { public int getTo_onset1() {
@ -120,14 +123,19 @@ public class ItemProtocol {
return this.getOpcIntegerValue(item_to_target2); return this.getOpcIntegerValue(item_to_target2);
} }
public int getTo_task() { public int getTo_command2() {
return this.getOpcIntegerValue(item_to_task); return this.getOpcIntegerValue(item_to_command2);
}
public int getTo_task1() {
return this.getOpcIntegerValue(item_to_task1);
} }
public int getTo_task2() { public int getTo_task2() {
return this.getOpcIntegerValue(item_to_task2); return this.getOpcIntegerValue(item_to_task2);
} }
//是否有货 //是否有货
public int hasGoods(int move) { public int hasGoods(int move) {
return move; return move;
@ -170,13 +178,14 @@ public class ItemProtocol {
public static List<ItemDto> getWriteableItemDtos() { public static List<ItemDto> getWriteableItemDtos() {
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
list.add(new ItemDto(item_to_command, "下发命令", "DB2.W0")); list.add(new ItemDto(item_to_command1, "前工位下发命令", "DB51.W0"));
list.add(new ItemDto(item_to_onset1, "下发起始站", "DB2.W2")); list.add(new ItemDto(item_to_onset1, "下发起始站", "DB51.W2"));
list.add(new ItemDto(item_to_target1, "下发目标站", "DB2.W4")); list.add(new ItemDto(item_to_target1, "下发目标站", "DB51.W4"));
list.add(new ItemDto(item_to_task, "下发任务号", "DB2.D8")); list.add(new ItemDto(item_to_task1, "下发任务号", "DB51.D6"));
list.add(new ItemDto(item_to_onset2, "下发起始站", "DB2.W12")); list.add(new ItemDto(item_to_command2, "后工位下发命令", "DB51.W10"));
list.add(new ItemDto(item_to_target2, "下发目标站", "DB2.W14")); list.add(new ItemDto(item_to_onset2, "下发起始站2", "DB51.W12"));
list.add(new ItemDto(item_to_task2, "下发任务号2", "DB2.D20")); list.add(new ItemDto(item_to_target2, "下发目标站2", "DB51.W14"));
list.add(new ItemDto(item_to_task2, "下发任务号2", "DB51.D16"));
return list; return list;
} }

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

@ -24,13 +24,11 @@ import org.nl.acs.route.service.RouteLineService;
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.utils.SpringContextHolder; import org.nl.utils.SpringContextHolder;
import org.nl.wql.core.bean.WQLObject;
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 java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 晟华RGV * 晟华RGV
@ -52,6 +50,13 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl");
@Autowired @Autowired
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class); DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
@Autowired
DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
//当前指令1
Instruction inst1 = null;
//当前指令2
Instruction inst2 = null;
int mode = 0; int mode = 0;
int error = 0; int error = 0;
@ -73,6 +78,9 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
//暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域
int flag; int flag;
Boolean requireSucess1 = false;
Boolean requireSucess2 = false;
String device_code; String device_code;
int status = 0; int status = 0;
int last_status = 0; int last_status = 0;
@ -110,7 +118,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
@Override @Override
public void execute() throws Exception{ public void execute() throws Exception {
String message = null; String message = null;
try { try {
device_code = this.getDeviceCode(); device_code = this.getDeviceCode();
@ -131,72 +139,118 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
if (mode != last_mode) { if (mode != last_mode) {
this.setRequireSucess(false); this.setRequireSucess(false);
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);
} }
if (error != last_error) { if (error != last_error) {
logServer.deviceItemValue(this.device_code,"error" ,String.valueOf(error)); logServer.deviceItemValue(this.device_code, "error", String.valueOf(error));
logServer.deviceExecuteLog(this.device_code,"","","信号error:" + last_error + "->" + error); logServer.deviceExecuteLog(this.device_code, "", "", "信号error:" + last_error + "->" + error);
} }
if (status != last_status) { if (status != last_status) {
logServer.deviceItemValue(this.device_code,"status" ,String.valueOf(status)); logServer.deviceItemValue(this.device_code, "status", String.valueOf(status));
logServer.deviceExecuteLog(this.device_code,"","","信号status:" + last_status + "->" + status); logServer.deviceExecuteLog(this.device_code, "", "", "信号status:" + last_status + "->" + status);
} }
if (move_1 != last_move_1) { if (move_1 != last_move_1) {
logServer.deviceItemValue(this.device_code,"move_1" ,String.valueOf(move_1)); logServer.deviceItemValue(this.device_code, "move_1", String.valueOf(move_1));
logServer.deviceExecuteLog(this.device_code,"","","信号move_1:" + last_move_1 + "->" + move_1); logServer.deviceExecuteLog(this.device_code, "", "", "信号move_1:" + last_move_1 + "->" + move_1);
} }
if (move_2 != last_move_2) { if (move_2 != last_move_2) {
logServer.deviceItemValue(this.device_code,"move_2" ,String.valueOf(move_2)); logServer.deviceItemValue(this.device_code, "move_2", String.valueOf(move_2));
logServer.deviceExecuteLog(this.device_code,"","","信号move_2:" + last_move_2 + "->" + move_2); logServer.deviceExecuteLog(this.device_code, "", "", "信号move_2:" + last_move_2 + "->" + move_2);
} }
if (action_1 != last_action_1) { if (action_1 != last_action_1) {
logServer.deviceItemValue(this.device_code,"action_1" ,String.valueOf(action_1)); logServer.deviceItemValue(this.device_code, "action_1", String.valueOf(action_1));
logServer.deviceExecuteLog(this.device_code,"","","信号action_1:" + last_action_1 + "->" + action_1); logServer.deviceExecuteLog(this.device_code, "", "", "信号action_1:" + last_action_1 + "->" + action_1);
} }
if (action_2 != last_action_2) { if (action_2 != last_action_2) {
logServer.deviceItemValue(this.device_code,"action_2" ,String.valueOf(action_2)); logServer.deviceItemValue(this.device_code, "action_2", String.valueOf(action_2));
logServer.deviceExecuteLog(this.device_code,"","","信号action_2:" + last_action_2 + "->" + action_2); logServer.deviceExecuteLog(this.device_code, "", "", "信号action_2:" + last_action_2 + "->" + action_2);
} }
if (walk_y != last_walk_y) { if (walk_y != last_walk_y) {
logServer.deviceItemValue(this.device_code,"walk_y" ,String.valueOf(walk_y)); logServer.deviceItemValue(this.device_code, "walk_y", String.valueOf(walk_y));
logServer.deviceExecuteLog(this.device_code,"","","信号walk_y:" + last_walk_y + "->" + walk_y); logServer.deviceExecuteLog(this.device_code, "", "", "信号walk_y:" + last_walk_y + "->" + walk_y);
} }
if (task1 != last_task1) { if (task1 != last_task1) {
logServer.deviceItemValue(this.device_code,"task1" ,String.valueOf(task1)); logServer.deviceItemValue(this.device_code, "task1", String.valueOf(task1));
logServer.deviceExecuteLog(this.device_code,"","","信号task1:" + last_task1 + "->" + task1); logServer.deviceExecuteLog(this.device_code, "", "", "信号task1:" + last_task1 + "->" + task1);
} }
if (task2 != last_task2) { if (task2 != last_task2) {
logServer.deviceItemValue(this.device_code,"task2" ,String.valueOf(task2)); logServer.deviceItemValue(this.device_code, "task2", String.valueOf(task2));
logServer.deviceExecuteLog(this.device_code,"","","信号task2:" + last_task2 + "->" + task2); logServer.deviceExecuteLog(this.device_code, "", "", "信号task2:" + last_task2 + "->" + task2);
} }
if (open_time != last_open_time) { if (open_time != last_open_time) {
logServer.deviceItemValue(this.device_code,"open_time" ,String.valueOf(open_time)); logServer.deviceItemValue(this.device_code, "open_time", String.valueOf(open_time));
logServer.deviceExecuteLog(this.device_code,"","","信号open_time:" + last_open_time + "->" + open_time); logServer.deviceExecuteLog(this.device_code, "", "", "信号open_time:" + last_open_time + "->" + open_time);
} }
if (standby_time != last_standby_time) { if (standby_time != last_standby_time) {
logServer.deviceItemValue(this.device_code,"standby_time" ,String.valueOf(standby_time)); logServer.deviceItemValue(this.device_code, "standby_time", String.valueOf(standby_time));
logServer.deviceExecuteLog(this.device_code,"","","信号standby_time:" + last_standby_time + "->" + standby_time); logServer.deviceExecuteLog(this.device_code, "", "", "信号standby_time:" + last_standby_time + "->" + standby_time);
} }
if (production_time != last_production_time) { if (production_time != last_production_time) {
logServer.deviceItemValue(this.device_code,"production_time" ,String.valueOf(production_time)); logServer.deviceItemValue(this.device_code, "production_time", String.valueOf(production_time));
logServer.deviceExecuteLog(this.device_code,"","","信号production_time:" + last_production_time + "->" + production_time); logServer.deviceExecuteLog(this.device_code, "", "", "信号production_time:" + last_production_time + "->" + production_time);
} }
if (error_time != last_error_time) { if (error_time != last_error_time) {
logServer.deviceItemValue(this.device_code,"error_time" ,String.valueOf(error_time)); logServer.deviceItemValue(this.device_code, "error_time", String.valueOf(error_time));
logServer.deviceExecuteLog(this.device_code,"","","信号error_time:" + last_error_time + "->" + error_time); logServer.deviceExecuteLog(this.device_code, "", "", "信号error_time:" + last_error_time + "->" + error_time);
} }
} catch (Exception var17) { } catch (Exception var17) {
return; return;
} }
if (!this.itemProtocol.getIsonline()) { if (task1 > 0) {
this.setIsonline(false); //inst_message
this.setIserror(true); inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
message = "信号量同步异常"; if (inst1 != null) {
//未联机 if (StrUtil.equals(inst1.getInstruction_status(), "0")) {
} else if (mode == 0) { inst1.setInstruction_status("1");
instructionService.update(inst1);
}
}
}
if (action_1 == 4 && move_1 == 0 && task1 > 0) {
//inst_message
inst1 = instructionService.findByCodeFromCache(String.valueOf(task1));
if (inst1 != null) {
if (StrUtil.equals(inst1.getInstruction_status(), "1")) {
finish_instruction(inst1);
}
}
}
if (task2 > 0) {
//inst_message
inst2 = instructionService.findByCodeFromCache(String.valueOf(task2));
if (inst2 != null) {
if (StrUtil.equals(inst2.getInstruction_status(), "0")) {
inst2.setInstruction_status("1");
instructionService.update(inst2);
}
}
}
if (action_2 == 4 && move_2 == 0 && task2 > 0) {
//inst_message
inst2 = instructionService.findByCodeFromCache(String.valueOf(task2));
if (inst2 != null) {
if (StrUtil.equals(inst2.getInstruction_status(), "1")) {
finish_instruction(inst2);
}
}
}
//给后工位下发空盘放货信号
if (mode == 3 && action_1 == 2 && action_2 == 2 && move_1 == 1 && move_2 == 1 && task1 > 0 && task2 > 0) {
writing("to_command2", "2");
}
//给前工位下发放货信号
if (mode == 3 && action_2 == 4 && move_1 == 1 && move_2 == 0 && task1 > 0) {
writing("to_command1", "2");
}
if (mode == 0) {
this.setIsonline(false); this.setIsonline(false);
this.setIserror(true); this.setIserror(true);
message = "未联机"; message = "未联机";
@ -217,25 +271,29 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
log.debug("设备运转模式:等待工作"); log.debug("设备运转模式:等待工作");
return; return;
case 2: case 2:
//申请任务 //后工位申请任务
if (walk_y == 1 && move_1 == 0 && !requireSucess ) { if (mode == 2 && move_2 == 0 && action_2 == 0 && !requireSucess2) {
instruction_apply(); instruction_require2();
} }
break; break;
case 3:
//前工位申请任务
if (mode == 3 && move_2 == 1 && action_2 == 1 && move_1 == 0 && !requireSucess1) {
instruction_require();
}
} }
switch (flag) { switch (flag) {
//取货完成 //取货完成
case 1: case 1:
writing(2); writing1(2);
return; return;
//放货完成 //放货完成
case 2: case 2:
writing(3); writing1(3);
return; return;
} }
} }
last_mode = mode; last_mode = mode;
last_error = error; last_error = error;
@ -263,126 +321,187 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
} }
} }
/**
* 请求指令 public void writing1(int command) {
*/ String to_command1 = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
public synchronized boolean instruction_apply() throws Exception { + "." + ItemProtocol.item_to_command1;
String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_command1, command);
ReadUtil.write(itemMap, server);
}
public synchronized boolean finish_instruction(Instruction inst) throws Exception {
instructionService.finish(inst);
return true;
}
//申请前工位任务
public synchronized boolean instruction_require() throws Exception {
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_apply_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_apply_time = date;
String linkobj = (String)this.getDevice().getExtraValue().get("get_device_code1");
Object[] value = (Object[]) this.device.getExtraValue().get("get_device_code"); String demosub = linkobj.substring(1,linkobj.length()-1);
Object[] value2 = (Object[]) this.device.getExtraValue().get("load_device_code"); String demoArray[] = demosub.split(",");
Object[] value3 = (Object[]) this.device.getExtraValue().get("put_device_code"); List<String> device_code_list = Arrays.asList(demoArray);
TaskDto task = null;
for (int i = 0; i < value.length; i++) { for(int i=0;i<device_code_list.size();i++){
String get_device_code = value[i].toString(); task = taskserver.queryTaskByDeviceCode(device_code_list.get(i).replace("\"","")).get(0);
//Device device = appService.findDeviceByCode(get_device_code); if(ObjectUtil.isNotEmpty(task)) break;
TaskDto task = taskserver.findByStartCode(get_device_code); }
if (!ObjectUtil.isEmpty(task)) { if (!ObjectUtil.isEmpty(task)) {
for (int j = 0; j < value2.length; j++) { String taskid = task.getTask_id();
String putdevice_code = value2[j].toString(); String taskcode = task.getTask_code();
if (StrUtil.equals(task.getNext_device_code(), putdevice_code)) { String vehiclecode = task.getVehicle_code();
String taskid = task.getTask_id(); String priority = task.getPriority();
String taskcode = task.getTask_code(); String start_point_code = task.getStart_point_code();
String vehiclecode = task.getVehicle_code(); String start_device_code = task.getStart_device_code();
String priority = task.getPriority(); String route_plan_code = task.getRoute_plan_code();
String start_point_code = task.getStart_point_code(); String next_point_code = task.getNext_point_code();
String start_device_code = task.getStart_device_code(); String next_device_code = task.getNext_device_code();
String route_plan_code = task.getRoute_plan_code(); Device startdevice = deviceAppservice.findDeviceByCode(start_device_code);
Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
Instruction instdto = new Instruction();
instdto.setInstruction_id(IdUtil.simpleUUID()); Instruction instdto = new Instruction();
instdto.setRoute_plan_code(route_plan_code); instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setRemark(task.getRemark()); instdto.setRoute_plan_code(route_plan_code);
instdto.setMaterial(task.getMaterial()); instdto.setRemark(task.getRemark());
instdto.setQuantity(task.getQuantity()); instdto.setMaterial(task.getMaterial());
instdto.setTask_id(taskid); instdto.setQuantity(task.getQuantity());
instdto.setTask_code(taskcode); instdto.setTask_id(taskid);
instdto.setVehicle_code(vehiclecode); instdto.setTask_code(taskcode);
String now = DateUtil.now(); instdto.setVehicle_code(vehiclecode);
instdto.setCreate_time(now); String now = DateUtil.now();
instdto.setCreate_by("auto"); instdto.setCreate_time(now);
instdto.setStart_device_code(start_device_code); instdto.setCreate_by("auto");
instdto.setNext_device_code(putdevice_code); instdto.setStart_device_code(start_device_code);
instdto.setStart_point_code(start_point_code); instdto.setNext_device_code(next_device_code);
instdto.setNext_point_code(putdevice_code); instdto.setStart_point_code(start_point_code);
instdto.setPriority(priority); instdto.setNext_point_code(next_point_code);
instdto.setInstruction_status("0"); instdto.setPriority(priority);
instdto.setExecute_device_code(start_point_code); instdto.setInstruction_status("0");
instructionService.create(instdto); instdto.setExecute_device_code(start_point_code);
//创建指令后修改任务状态
task.setTask_status("1"); try {
taskserver.update(task); instructionService.create(instdto);
requireSucess = true; } catch (Exception e) {
writing(instdto); e.printStackTrace();
break;
}
}
} }
if (requireSucess) { //创建指令后修改任务状态
break; WQLObject taskwo = WQLObject.getWQLObject("acs_task");
} task.setTask_status("1");
//创建指令后修改任务状态
task.setTask_status("1");
taskserver.update(task);
requireSucess1 = true;
String start_addr = startdevice.getAddress();
String next_addr = nextdevice.getAddress();
writing("to_command1","1");
writing("to_onset1",start_addr);
writing("to_target1",next_addr);
writing("to_task1",instdto.getInstruction_code());
} else {
} }
}
return true;
}
for (int i = 0; i < value2.length; i++) { //申请后工位任务
String load_device_code = value2[i].toString(); public synchronized boolean instruction_require2() throws Exception {
//Device device = appService.findDeviceByCode(get_device_code); Date date = new Date();
TaskDto task = taskserver.findByStartCode(load_device_code); if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
if (!ObjectUtil.isEmpty(task)) { log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
for (int j = 0; j < value3.length; j++) { return false;
String putdevice_code = value3[j].toString(); } else {
if (StrUtil.equals(task.getNext_device_code(), putdevice_code)) { this.instruction_apply_time = date;
String taskid = task.getTask_id(); String linkobj = (String)this.getDevice().getExtraValue().get("get_device_code2");
String taskcode = task.getTask_code(); String demosub = linkobj.substring(1,linkobj.length()-1);
String vehiclecode = task.getVehicle_code(); String demoArray[] = demosub.split(",");
String priority = task.getPriority(); List<String> device_code_list = Arrays.asList(demoArray);
String start_point_code = task.getStart_point_code(); TaskDto task = null;
String start_device_code = task.getStart_device_code(); for(int i=0;i<device_code_list.size();i++){
String route_plan_code = task.getRoute_plan_code(); task = taskserver.queryTaskByDeviceCode(device_code_list.get(i).replace("\"","")).get(0);
if(ObjectUtil.isNotEmpty(task)) break;
Instruction instdto = new Instruction(); }
instdto.setInstruction_id(IdUtil.simpleUUID()); if (!ObjectUtil.isEmpty(task)) {
instdto.setRoute_plan_code(route_plan_code); String taskid = task.getTask_id();
instdto.setRemark(task.getRemark()); String taskcode = task.getTask_code();
instdto.setMaterial(task.getMaterial()); String vehiclecode = task.getVehicle_code();
instdto.setQuantity(task.getQuantity()); String priority = task.getPriority();
instdto.setTask_id(taskid); String start_point_code = task.getStart_point_code();
instdto.setTask_code(taskcode); String start_device_code = task.getStart_device_code();
instdto.setVehicle_code(vehiclecode); String route_plan_code = task.getRoute_plan_code();
String now = DateUtil.now(); String next_point_code = task.getNext_point_code();
instdto.setCreate_time(now); String next_device_code = task.getNext_device_code();
instdto.setCreate_by("auto"); Device startdevice = deviceAppservice.findDeviceByCode(start_device_code);
instdto.setStart_device_code(start_device_code); Device nextdevice = deviceAppservice.findDeviceByCode(next_device_code);
instdto.setNext_device_code(putdevice_code);
instdto.setStart_point_code(start_point_code); Instruction instdto = new Instruction();
instdto.setNext_point_code(putdevice_code); instdto.setInstruction_id(IdUtil.simpleUUID());
instdto.setPriority(priority); instdto.setRoute_plan_code(route_plan_code);
instdto.setInstruction_status("0"); instdto.setRemark(task.getRemark());
instdto.setExecute_device_code(start_point_code); instdto.setMaterial(task.getMaterial());
instructionService.create(instdto); instdto.setQuantity(task.getQuantity());
//创建指令后修改任务状态 instdto.setTask_id(taskid);
task.setTask_status("1"); instdto.setTask_code(taskcode);
taskserver.update(task); instdto.setVehicle_code(vehiclecode);
requireSucess = true; String now = DateUtil.now();
writing(instdto); instdto.setCreate_time(now);
break; instdto.setCreate_by("auto");
} instdto.setStart_device_code(start_device_code);
} instdto.setNext_device_code(next_device_code);
instdto.setStart_point_code(start_point_code);
instdto.setNext_point_code(next_point_code);
instdto.setPriority(priority);
instdto.setInstruction_status("0");
instdto.setExecute_device_code(start_point_code);
try {
instructionService.create(instdto);
} catch (Exception e) {
e.printStackTrace();
} }
if (requireSucess) { //创建指令后修改任务状态
break; WQLObject taskwo = WQLObject.getWQLObject("acs_task");
} task.setTask_status("1");
//创建指令后修改任务状态
task.setTask_status("1");
taskserver.update(task);
requireSucess2 = true;
String start_addr = startdevice.getAddress();
String next_addr = nextdevice.getAddress();
writing("to_command2","1");
writing("to_onset2",start_addr);
writing("to_target2",next_addr);
writing("to_task2",instdto.getInstruction_code());
} else {
} }
} }
return true; return true;
} }
public boolean exe_business() { public boolean exe_business() {
return true; return true;
} }
@ -433,10 +552,16 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
log.info("设备:{},下发作业命令:{},起始站{},目标站:{},任务号:{}", device_code, to_command,to_onset ,to_target, to_task); log.info("设备:{},下发作业命令:{},起始站{},目标站:{},任务号:{}", device_code, to_command,to_onset ,to_target, to_task);
} }
public void writing(int type, int command) {
public void writing(String param, String value) {
String to_param = this.getDevice().getOpc_server_code() + "." + this.getDevice().getOpc_plc_code() + "." + this.getDevice().getDevice_code()
+ "." + param;
String opcservcerid = this.getDevice().getOpc_server_id(); String opcservcerid = this.getDevice().getOpc_server_id();
Server server = ReadUtil.getServer(opcservcerid); Server server = ReadUtil.getServer(opcservcerid);
Map<String, Object> itemMap = new HashMap<String, Object>(); Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_param, value);
ReadUtil.write(itemMap, server); ReadUtil.write(itemMap, server);
} }
} }

2
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDefination.java

@ -66,7 +66,7 @@ public class LnshSplitManipulatorDefination implements OpcDeviceDriverDefination
list.add(new ItemDto(ItemProtocol.item_standby_time, "待机时间", "DB7.D520")); list.add(new ItemDto(ItemProtocol.item_standby_time, "待机时间", "DB7.D520"));
list.add(new ItemDto(ItemProtocol.item_production_time, "生产时间", "DB7.D524")); list.add(new ItemDto(ItemProtocol.item_production_time, "生产时间", "DB7.D524"));
list.add(new ItemDto(ItemProtocol.item_error_time, "故障时间", "DB7.D528")); list.add(new ItemDto(ItemProtocol.item_error_time, "故障时间", "DB7.D528"));
list.add(new ItemDto(ItemProtocol.item_material, "物料", "DB7.D532")); list.add(new ItemDto(ItemProtocol.item_material, "物料", "DB7.S532"));
list.add(new ItemDto(ItemProtocol.item_total_split, "累计拆垛数量", "DB7.D536")); list.add(new ItemDto(ItemProtocol.item_total_split, "累计拆垛数量", "DB7.D536"));
list.add(new ItemDto(ItemProtocol.item_product_code, "产品编号", "DB7.D544")); list.add(new ItemDto(ItemProtocol.item_product_code, "产品编号", "DB7.D544"));

127
acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java

@ -31,10 +31,7 @@ import org.nl.wql.core.bean.WQLObject;
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 java.util.Date; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/** /**
* 晟华拆垛机械手 * 晟华拆垛机械手
@ -628,6 +625,12 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
} }
break; break;
case 7: case 7:
//申请出库
if (!requireSucess) {
callMaterial();
}
break;
case 8:
//申请空盘 //申请空盘
if (!requireSucess) { if (!requireSucess) {
applyEmpty(); applyEmpty();
@ -742,12 +745,16 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(getStation-1).replace("\"",""));
json.put("vehicle_code",barcode); json.put("vehicle_code",barcode);
JSONObject jo = acsToWmsService.getVehicle(json); JSONObject jo = acsToWmsService.getVehicle(json);
if (jo.getInteger("status") == 200) { if (jo.getInteger("status") == 200) {
JSONObject content = jo.getJSONObject("content"); JSONObject content = jo.getJSONObject("data");
String qty = content.getString("qty"); String qty = content.getString("qty");
String material_code = content.getString("material_code"); String material_code = content.getString("material_code");
String material_name = content.getString("material_name"); String material_name = content.getString("material_name");
@ -810,7 +817,6 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
String two_qty = content.getString("two_qty"); String two_qty = content.getString("two_qty");
String tool_coordinate = content.getString("tool_coordinate"); String tool_coordinate = content.getString("tool_coordinate");
this.writing(this.mode);
this.writing("to_material",material_code); this.writing("to_material",material_code);
this.writing("to_AlongSide",AlongSide); this.writing("to_AlongSide",AlongSide);
this.writing("to_BshortSide",BshortSide); this.writing("to_BshortSide",BshortSide);
@ -869,9 +875,9 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
this.writing("to_one_qty",one_qty); this.writing("to_one_qty",one_qty);
this.writing("to_two_qty",two_qty); this.writing("to_two_qty",two_qty);
this.writing("to_tool_coordinate",tool_coordinate); this.writing("to_tool_coordinate",tool_coordinate);
this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }
@ -889,74 +895,47 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(getStation-1).replace("\"",""));
json.put("type","3");
json.put("qty",total_split); json.put("qty",total_split);
json.put("vehicle_code",barcode); json.put("vehicle_code",barcode);
json.put("is_full","1"); HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
json.put("product_code",product_code); if (result.getStatus() == 200) {
json.put("AlongSide",AlongSide); this.writing(this.mode);
json.put("BshortSide",BshortSide); requireSucess = true;
json.put("Htrapezoidal",Htrapezoidal); }
json.put("Wthickness",Wthickness); return true;
json.put("tray_qty",tray_qty); }
json.put("tray_high",tray_high); }
json.put("crib_category",crib_category);
json.put("palletX1_line",palletX1_line);
json.put("palletY1_row",palletY1_row);
json.put("palletA1_angle",palletA1_angle);
json.put("palletX2_line",palletX2_line);
json.put("palletY2_row",palletY2_row);
json.put("palletA2_angle",palletA2_angle);
json.put("palletX3_line",palletX3_line);
json.put("palletY3_row",palletY3_row);
json.put("palletA3_angle",palletA3_angle);
json.put("pressCribX1_line",pressCribX1_line);
json.put("pressCribY1_row",pressCribY1_row);
json.put("pressCribA1_angle",pressCribA1_angle);
json.put("pressCribX2_line",pressCribX2_line);
json.put("pressCribY2_row",pressCribY2_row);
json.put("pressCribA2_angle",pressCribA2_angle);
json.put("pressCribX3_line",pressCribX3_line);
json.put("pressCribY3_row",pressCribY3_row);
json.put("pressCribA3_angle",pressCribA3_angle);
json.put("Zoffset",Zoffset);
json.put("pallet_layerQty",pallet_layerQty);
json.put("pressCrib_layerQty",pressCrib_layerQty);
json.put("codeLayerX1_interval",codeLayerX1_interval);
json.put("codeLayerY1_interval",codeLayerY1_interval);
json.put("codeLayerX2_interval",codeLayerX2_interval);
json.put("codeLayerY2_interval",codeLayerY2_interval);
json.put("codeLayerX3_interval",codeLayerX3_interval);
json.put("codeLayerY3_interval",codeLayerY3_interval);
json.put("codeLayerX1_offset",codeLayerX1_offset);
json.put("codeLayerY1_offset",codeLayerY1_offset);
json.put("codeLayerX2_offset",codeLayerX2_offset);
json.put("codeLayerY2_offset",codeLayerY2_offset);
json.put("codeLayerX3_offset",codeLayerX3_offset);
json.put("codeLayerY3_offset",codeLayerY3_offset);
json.put("pressLayerX1_interval",pressLayerX1_interval);
json.put("pressLayerY1_interval",pressLayerY1_interval);
json.put("pressLayerX2_interval",pressLayerX2_interval);
json.put("pressLayerY2_interval",pressLayerY2_interval);
json.put("pressLayerX3_interval",pressLayerX3_interval);
json.put("pressLayerY3_interval",pressLayerY3_interval);
json.put("pressLayerX1_offset",pressLayerX1_offset);
json.put("pressLayerY1_offset",pressLayerY1_offset);
json.put("pressLayerX2_offset",pressLayerX2_offset);
json.put("pressLayerY2_offset",pressLayerY2_offset);
json.put("pressLayerX3_offset",pressLayerX3_offset);
json.put("pressLayerY3_offset",pressLayerY3_offset);
json.put("one_cribTotal",one_cribTotal);
json.put("two_cribTotal",two_cribTotal);
json.put("one_qty",one_qty);
json.put("two_qty",two_qty);
json.put("tool_coordinate",tool_coordinate);
HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); /**
* 叫料
*
* @param
*/
public synchronized boolean callMaterial() {
Date date = new Date();
if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) {
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false;
} else {
this.instruction_require_time = date;
JSONObject json = new JSONObject();
String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(getStation-1).replace("\"","")); json.put("type","2");
json.put("is_full","1");
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
if (result.getStatus() == 200) { if (result.getStatus() == 200) {
this.writing(this.mode); this.writing(this.mode);
requireSucess = true;
} }
requireSucess = true;
return true; return true;
} }
} }
@ -974,7 +953,11 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
} else { } else {
this.instruction_require_time = date; this.instruction_require_time = date;
JSONObject json = new JSONObject(); JSONObject json = new JSONObject();
json.put("device_code",this.device_code); String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code");
String demosub = linkobj.substring(1,linkobj.length()-1);
String demoArray[] = demosub.split(",");
List<String> demoList = Arrays.asList(demoArray);
json.put("device_code",demoList.get(getStation-1).replace("\"",""));
json.put("type","4"); json.put("type","4");
json.put("qty",total_split); json.put("qty",total_split);
json.put("vehicle_code",barcode); json.put("vehicle_code",barcode);

6
acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/AcsToWmsService.java

@ -18,6 +18,12 @@ public interface AcsToWmsService {
*/ */
HttpResponse lnshApplyTaskToWms(JSONObject json); HttpResponse lnshApplyTaskToWms(JSONObject json);
/**
* ACS向WMS申请贴标
*/
HttpResponse applyBarcode(JSONObject json);
/** /**
* 申请入窑 * 申请入窑
* @param json * @param json

41
acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java

@ -226,6 +226,47 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public HttpResponse applyBarcode(JSONObject json) {
try {
MDC.put(log_file_type, log_type);
String wmsurl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
AddressDto addressDto = addressService.findByCode("getVehicleInfoBycode");
String url = wmsurl + addressDto.getMethods_url();
String device_code = json.getString("device_code");
String parent_device_code = "";
JSONObject jo = new JSONObject();
JSONObject device_json = WQLObject.getWQLObject("acs_storage_cell").query("storage_code ='" + device_code + "'").uniqueResult(0);
if (!device_json.isEmpty()) {
parent_device_code = (String) device_json.get("parent_storage_cell") == null ? device_code : (String) device_json.get("parent_storage_cell");
}
jo.put("device_code", parent_device_code);
jo.putAll(json);
log.info("lnshApplyTaskToWms-----请求参数{}", jo.toString());
HttpResponse result2 = null;
try {
//{"status":400,"timestamp":"2021-10-22 16:32:22","message":"业务类型不正确!"}
result2 = HttpRequest.post(url)
.header("Authorization", token)
.body(String.valueOf(jo))
.execute();
System.out.println(result2);
} catch (Exception e) {
String msg = e.getMessage();
//网络不通
System.out.println(msg);
}
log.info("lnshApplyTaskToWms-----输出参数{}", result2.body());
return result2;
} finally {
MDC.remove(log_file_type);
}
}
@Override @Override
public HttpResponse lnshApplyTaskToWms(JSONObject json) { public HttpResponse lnshApplyTaskToWms(JSONObject json) {
try { try {

5
acs/hd/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java

@ -219,8 +219,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
public Instruction findByTaskcodeToWms(String code) { public Instruction findByTaskcodeToWms(String code) {
WQLObject wo = WQLObject.getWQLObject("acs_instruction"); WQLObject wo = WQLObject.getWQLObject("acs_instruction");
JSONObject json = wo.query("task_code ='" + code + "'","create_time desc").uniqueResult(0); JSONObject json = wo.query("task_code ='" + code + "'","create_time desc").uniqueResult(0);
final Instruction obj = json.toJavaObject(Instruction.class); if (ObjectUtil.isNotEmpty(json))
return obj; return json.toJavaObject(Instruction.class);
return null;
} }
@Override @Override

75
acs/hd/nladmin-system/src/main/resources/config/application-prod.yml

@ -8,17 +8,24 @@ spring:
druid: druid:
db-type: com.alibaba.druid.pool.DruidDataSource db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:ch_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:lnsh_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:rljn_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
username: ${DB_USER:root} username: ${DB_USER:root}
password: ${DB_PWD:123456} # password: ${DB_PWD:P@ssw0rd}
password: ${DB_PWD:Root.123456}
# password: ${DB_PWD:123456}
# 初始连接数 # 初始连接数
initial-size: 5 initial-size: 5
# 最小连接数 # 最小连接数
min-idle: 15 min-idle: 15
# 最大连接数 # 最大连接数
max-active: 30 max-active: 30
# 是否自动回收超时连接
remove-abandoned: true
# 超时时间(以秒数为单位)
remove-abandoned-timeout: 180
# 获取连接超时时间 # 获取连接超时时间
max-wait: 5000 max-wait: 3000
# 连接有效性检测时间 # 连接有效性检测时间
time-between-eviction-runs-millis: 60000 time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间 # 连接在池中最小生存的时间
@ -38,11 +45,8 @@ spring:
enabled: true enabled: true
stat-view-servlet: stat-view-servlet:
enabled: true enabled: true
# 控制台管理用户名和密码
url-pattern: /druid/* url-pattern: /druid/*
reset-enable: false reset-enable: false
login-username: admin
login-password: 123456
filter: filter:
stat: stat:
enabled: true enabled: true
@ -52,10 +56,11 @@ spring:
merge-sql: true merge-sql: true
wall: wall:
config: config:
multi-statement-allow: true multi-statement-alagvslow: true
redis: redis:
#数据库索引 #数据库索引
database: ${REDIS_DB:0} database: ${REDIS_DB:2}
host: ${REDIS_HOST:127.0.0.1} host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379} port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:} password: ${REDIS_PWD:}
@ -79,7 +84,7 @@ login:
heigth: 36 heigth: 36
# 内容长度 # 内容长度
length: 2 length: 2
# 字体名称,为空则使用默认字体,如遇到线上乱码,设置其他字体即可 # 字体名称,为空则使用默认字体
font-name: font-name:
# 字体大小 # 字体大小
font-size: 25 font-size: 25
@ -91,36 +96,29 @@ jwt:
token-start-with: Bearer token-start-with: Bearer
# 必须使用最少88位的Base64对该令牌进行编码 # 必须使用最少88位的Base64对该令牌进行编码
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI= base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
# 令牌过期时间 此处单位/毫秒 ,默认2小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html # 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
token-validity-in-seconds: 7200000 token-validity-in-seconds: 14400000
# 在线用户key # 在线用户key
online-key: online-token- online-key: online-token-
# 验证码 # 验证码
code-key: code-key- code-key: code-key-
# token 续期检查时间范围(默认30分钟,单位默认毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期 # token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
detect: 1800000 detect: 1800000
# 续期时间范围,默认 1小时,这里单位毫秒 # 续期时间范围,默认1小时,单位毫秒
renew: 3600000 renew: 3600000
# IP 本地解析
ip:
local-parsing: true
#是否允许生成代码,生产环境设置为false #是否允许生成代码,生产环境设置为false
generator: generator:
enabled: false enabled: true
#如果生产环境要开启swagger,需要配置请求地址
#springfox:
# documentation:
# swagger:
# v2:
# host: # 接口域名或外网ip
#是否开启 swagger-ui #是否开启 swagger-ui
swagger: swagger:
enabled: true enabled: true
# IP 本地解析
ip:
local-parsing: true
# 文件存储路径 # 文件存储路径
file: file:
mac: mac:
@ -135,6 +133,33 @@ file:
# 文件大小 /M # 文件大小 /M
maxSize: 100 maxSize: 100
avatarMaxSize: 5 avatarMaxSize: 5
jetcache:
defaultCacheType: LOCAL
statIntervalMinutes: 15
areaInCacheName: false
hiddenPackages: com.yb
local:
default:
type: caffeine
limit: 100
keyConvertor: fastjson
expireAfterWriteInMillis: 60000
remote:
default:
type: redis.lettuce
keyConvertor: fastjson
valueEncoder: kryo
valueDecoder: kryo
poolConfig:
minIdle: 5
maxIdle: 200
maxTotal: 1000
uri:
- redis://127.0.0.1:6379
loki: loki:
url: http://localhost:3100/loki/api/v1 url: http://localhost:3100/loki/api/v1
systemName: acs systemName: acs

37
acs/hd/nladmin-system/src/main/resources/logback-spring.xml

@ -136,9 +136,42 @@ https://juejin.cn/post/6844903775631572999
<!--生产环境:打印控制台和输出到文件--> <!--生产环境:打印控制台和输出到文件-->
<springProfile name="prod"> <springProfile name="prod">
<root level="off"> <root level="info">
<appender-ref ref="asyncFileAppender"/> <appender-ref ref="CONSOLE"/>
<appender-ref ref="lokiAppender" /> <appender-ref ref="lokiAppender" />
</root> </root>
<!--logmanage -->
<logger name="org.nl.acs.log.service.impl.DeviceExecuteLogServiceImpl" level="info" additivity="false">
<appender-ref ref="lokiAppender" />
</logger>
<logger name="jdbc.resultsettable" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="lokiAppender" />
</logger>
<logger name="org.openscada.opc.lib.da.Server" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="lokiAppender" />
</logger>
<!--logmanage -->
<logger name="jdbc.audit" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="jdbc.resultset" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="springfox.documentation" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="jdbc.sqlonly" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="jdbc.sqltiming" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
<logger name="org.jinterop" level="ERROR" additivity="false">
<appender-ref ref="CONSOLE"/>
</logger>
</springProfile> </springProfile>
</configuration> </configuration>

101
acs/qd/src/views/acs/device/driver/lnsh/lnsh_rgv.vue

@ -1,5 +1,5 @@
<template> <template>
<!--晟华RGV--> <!--嘉耐双工位RGV-->
<div> <div>
<el-card class="box-card" shadow="never"> <el-card class="box-card" shadow="never">
<div slot="header" class="clearfix"> <div slot="header" class="clearfix">
@ -56,26 +56,42 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-col>
<el-col :span="8"> <el-form-item label="前工位取货点" prop="device_code" label-width="200">
<el-form-item label="取货点" prop="device_code">
<el-select
v-model="form.get_device_code"
multiple
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
</el-col>
<el-form-item label="装货点" prop="device_code">
<el-select <el-select
v-model="form.load_device_code" v-model="form.get_device_code1"
multiple
filterable filterable
reserveKeyword
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="装货点" prop="device_code">-->
<!-- <el-select-->
<!-- v-model="form.load_device_code"-->
<!-- filterable-->
<!-- multiple-->
<!-- placeholder="请选择"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in deviceList"-->
<!-- :key="item.device_code"-->
<!-- :label="item.device_name"-->
<!-- :value="item.device_code"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="前工位放货点" prop="device_code" label-width="200">
<el-select
v-model="form.put_device_code1"
filterable
reserveKeyword
multiple multiple
placeholder="请选择" placeholder="请选择"
> >
@ -87,10 +103,43 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="放货点" prop="device_code"> </el-col>
<el-col>
<el-form-item label="后工位取货点" prop="device_code" label-width="200">
<el-select <el-select
v-model="form.put_device_code" v-model="form.get_device_code2"
filterable filterable
reserveKeyword
multiple
placeholder="请选择"
>
<el-option
v-for="item in deviceList"
:label="item.device_name"
:value="item.device_code"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="装货点" prop="device_code">-->
<!-- <el-select-->
<!-- v-model="form.load_device_code"-->
<!-- filterable-->
<!-- multiple-->
<!-- placeholder="请选择"-->
<!-- >-->
<!-- <el-option-->
<!-- v-for="item in deviceList"-->
<!-- :key="item.device_code"-->
<!-- :label="item.device_name"-->
<!-- :value="item.device_code"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="后工位放货点" prop="device_code" label-width="200">
<el-select
v-model="form.put_device_code2"
filterable
reserveKeyword
multiple multiple
placeholder="请选择" placeholder="请选择"
> >
@ -102,7 +151,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-col>
</el-form> </el-form>
</el-card> </el-card>
@ -329,10 +378,12 @@ export default {
plc_code: '', plc_code: '',
opc_id: '', opc_id: '',
opc_code: '', opc_code: '',
configLoading: false, get_device_code1: '',
get_device_code: '', get_device_code2: '',
load_device_code: '', load_device_code: '',
put_device_code: '', put_device_code1: '',
put_device_code2: '',
configLoading: false,
dataOpcservers: [], dataOpcservers: [],
dataOpcPlcs: [], dataOpcPlcs: [],
deviceList: [], deviceList: [],

Loading…
Cancel
Save