rev 清理无用代码
This commit is contained in:
@@ -161,6 +161,7 @@ public interface AgvService {
|
|||||||
public JSONObject createOrederData(Instruction inst, String type);
|
public JSONObject createOrederData(Instruction inst, String type);
|
||||||
|
|
||||||
public JSONArray createBlocksData(Instruction inst);
|
public JSONArray createBlocksData(Instruction inst);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* magic 全部暂停车辆
|
* magic 全部暂停车辆
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
||||||
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("id",code);
|
jo.put("id", code);
|
||||||
agvurl = agvurl + ":" + agvport + "/markComplete";
|
agvurl = agvurl + ":" + agvport + "/markComplete";
|
||||||
log.info("关闭agv运单序列请求:{}", agvurl);
|
log.info("关闭agv运单序列请求:{}", agvurl);
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
if (charging.equals("true")) {
|
if (charging.equals("true")) {
|
||||||
state_name = "CHARGING";
|
state_name = "CHARGING";
|
||||||
} else {
|
} else {
|
||||||
if (procBusiness.equals("true")){
|
if (procBusiness.equals("true")) {
|
||||||
state_name = "EXECUTING";
|
state_name = "EXECUTING";
|
||||||
} else {
|
} else {
|
||||||
state_name = "IDLE";
|
state_name = "IDLE";
|
||||||
@@ -601,7 +601,7 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
String energyLevel = String.valueOf(rbk_report.getDouble("battery_level"));
|
String energyLevel = String.valueOf(rbk_report.getDouble("battery_level"));
|
||||||
String transportOrder = String.valueOf(current_order.get("id"));
|
String transportOrder = String.valueOf(current_order.get("id"));
|
||||||
Instruction inst = instructionService.findByCodeFromCache(transportOrder);
|
Instruction inst = instructionService.findByCodeFromCache(transportOrder);
|
||||||
if(!ObjectUtil.isEmpty(inst)){
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
transportOrder = inst.getTask_code();
|
transportOrder = inst.getTask_code();
|
||||||
} else {
|
} else {
|
||||||
transportOrder = "";
|
transportOrder = "";
|
||||||
@@ -659,7 +659,6 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResponse queryXZAgvInstStatus(String instCode) {
|
public HttpResponse queryXZAgvInstStatus(String instCode) {
|
||||||
|
|
||||||
@@ -750,8 +749,8 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
||||||
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
|
String agvport = acsConfigService.findConfigFromCache().get(AcsConfig.AGVPORT);
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("id",instCode);
|
jo.put("id", instCode);
|
||||||
jo.put("disableVehicle",false);
|
jo.put("disableVehicle", false);
|
||||||
agvurl = agvurl + ":" + agvport + "/terminate";
|
agvurl = agvurl + ":" + agvport + "/terminate";
|
||||||
log.info("删除agv指令请求agvurl:{}", agvurl);
|
log.info("删除agv指令请求agvurl:{}", agvurl);
|
||||||
HttpResponse result = HttpRequest.post(agvurl)
|
HttpResponse result = HttpRequest.post(agvurl)
|
||||||
@@ -1553,7 +1552,7 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
String priority = inst.getPriority();
|
String priority = inst.getPriority();
|
||||||
jo.put("priority", Integer.parseInt(priority));
|
jo.put("priority", Integer.parseInt(priority));
|
||||||
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString());
|
log.info("任务号:{},指令号{},下发agv订单序列参数:{}", inst.getTask_code(), inst.getInstruction_code(), jo.toString());
|
||||||
logServer.log(inst.getTask_code(),"sendOrderSequencesToXZ","",jo.toString(),"", "","",inst.getVehicle_code());
|
logServer.log(inst.getTask_code(), "sendOrderSequencesToXZ", "", jo.toString(), "", "", "", inst.getVehicle_code());
|
||||||
|
|
||||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.FORKAGV).toString(), "1")) {
|
||||||
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
String agvurl = acsConfigService.findConfigFromCache().get(AcsConfig.AGVURL);
|
||||||
@@ -1567,7 +1566,7 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
.execute();
|
.execute();
|
||||||
log.info(agvurl);
|
log.info(agvurl);
|
||||||
log.info("任务号:{},指令号{},状态{},下发agv订单序列反馈:{}", inst.getTask_code(), inst.getInstruction_code(), result.getStatus(), result.body());
|
log.info("任务号:{},指令号{},状态{},下发agv订单序列反馈:{}", inst.getTask_code(), inst.getInstruction_code(), result.getStatus(), result.body());
|
||||||
logServer.log(inst.getTask_code(),"sendOrderSequencesToXZ","info",jo.toString(),result.body(), String.valueOf(result.getStatus()),agvurl,inst.getVehicle_code());
|
logServer.log(inst.getTask_code(), "sendOrderSequencesToXZ", "info", jo.toString(), result.body(), String.valueOf(result.getStatus()), agvurl, inst.getVehicle_code());
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
@@ -1627,13 +1626,13 @@ public class AgvServiceImpl implements AgvService {
|
|||||||
JSONArray ja = new JSONArray();
|
JSONArray ja = new JSONArray();
|
||||||
JSONObject jo = new JSONObject();
|
JSONObject jo = new JSONObject();
|
||||||
jo.put("blockId", IdUtil.simpleUUID());
|
jo.put("blockId", IdUtil.simpleUUID());
|
||||||
jo.put("location",inst.getStart_point_code());
|
jo.put("location", inst.getStart_point_code());
|
||||||
jo.put("operation","JackLoad");
|
jo.put("operation", "JackLoad");
|
||||||
ja.add(jo);
|
ja.add(jo);
|
||||||
JSONObject jo1 = new JSONObject();
|
JSONObject jo1 = new JSONObject();
|
||||||
jo1.put("blockId",IdUtil.simpleUUID());
|
jo1.put("blockId", IdUtil.simpleUUID());
|
||||||
jo1.put("location",inst.getNext_point_code());
|
jo1.put("location", inst.getNext_point_code());
|
||||||
jo1.put("operation","JackUnload");
|
jo1.put("operation", "JackUnload");
|
||||||
ja.add(jo1);
|
ja.add(jo1);
|
||||||
return ja;
|
return ja;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ public interface AcsConfig {
|
|||||||
//WCS系统接口地址
|
//WCS系统接口地址
|
||||||
String WCSURL = "wcsurl";
|
String WCSURL = "wcsurl";
|
||||||
|
|
||||||
String APP_URL ="APP_URL";
|
String APP_URL = "APP_URL";
|
||||||
|
|
||||||
String VERSIONNAME ="versionName";
|
String VERSIONNAME = "versionName";
|
||||||
|
|
||||||
|
|
||||||
String HASOTHERSYSTEM = "hasOtherSystem";
|
String HASOTHERSYSTEM = "hasOtherSystem";
|
||||||
|
|||||||
@@ -174,10 +174,10 @@ public class DeviceAssignedServiceImpl implements DeviceAssignedService {
|
|||||||
List<DeviceAssignedDto> list = new ArrayList();
|
List<DeviceAssignedDto> list = new ArrayList();
|
||||||
for (int i = 0; i < arr.size(); i++) {
|
for (int i = 0; i < arr.size(); i++) {
|
||||||
JSONObject jo = arr.getJSONObject(i);
|
JSONObject jo = arr.getJSONObject(i);
|
||||||
if(jo.getString("task_nextdevice_code").indexOf(",") != -1){
|
if (jo.getString("task_nextdevice_code").indexOf(",") != -1) {
|
||||||
String task_nextdevice_code[] = jo.getString("task_nextdevice_code").split(",");
|
String task_nextdevice_code[] = jo.getString("task_nextdevice_code").split(",");
|
||||||
for(int j=0;j<task_nextdevice_code.length;j++){
|
for (int j = 0; j < task_nextdevice_code.length; j++) {
|
||||||
if(StrUtil.equals(old_task_nextdevice_code,task_nextdevice_code[j])){
|
if (StrUtil.equals(old_task_nextdevice_code, task_nextdevice_code[j])) {
|
||||||
DeviceAssignedDto dto = new DeviceAssignedDto();
|
DeviceAssignedDto dto = new DeviceAssignedDto();
|
||||||
dto.setAssigned_id(jo.getString("assigned_id"));
|
dto.setAssigned_id(jo.getString("assigned_id"));
|
||||||
dto.setDevice_code(jo.getString("device_code"));
|
dto.setDevice_code(jo.getString("device_code"));
|
||||||
@@ -189,7 +189,7 @@ public class DeviceAssignedServiceImpl implements DeviceAssignedService {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String task_nextdevice_code = jo.getString("task_nextdevice_code");
|
String task_nextdevice_code = jo.getString("task_nextdevice_code");
|
||||||
if(StrUtil.equals(old_task_nextdevice_code,task_nextdevice_code)){
|
if (StrUtil.equals(old_task_nextdevice_code, task_nextdevice_code)) {
|
||||||
DeviceAssignedDto dto = new DeviceAssignedDto();
|
DeviceAssignedDto dto = new DeviceAssignedDto();
|
||||||
dto.setAssigned_id(jo.getString("assigned_id"));
|
dto.setAssigned_id(jo.getString("assigned_id"));
|
||||||
dto.setDevice_code(jo.getString("device_code"));
|
dto.setDevice_code(jo.getString("device_code"));
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ public class DeviceDbitemServiceImpl implements DeviceDbitemService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
|
||||||
public DeviceDbitemDto findById(String item_id) {
|
public DeviceDbitemDto findById(String item_id) {
|
||||||
WQLObject wo = WQLObject.getWQLObject("acs_device_dbitem");
|
WQLObject wo = WQLObject.getWQLObject("acs_device_dbitem");
|
||||||
JSONObject json = wo.query("item_id ='" + item_id + "'").uniqueResult(0);
|
JSONObject json = wo.query("item_id ='" + item_id + "'").uniqueResult(0);
|
||||||
@@ -61,12 +60,9 @@ public class DeviceDbitemServiceImpl implements DeviceDbitemService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(DeviceDbitemDto dto) {
|
public void create(DeviceDbitemDto dto) {
|
||||||
//String currentUsername = SecurityUtils.getCurrentUsername();
|
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
|
||||||
dto.setDevice_id(IdUtil.simpleUUID());
|
dto.setDevice_id(IdUtil.simpleUUID());
|
||||||
//dto.setCreate_by(currentUsername);
|
|
||||||
//dto.setUpdate_by(currentUsername);
|
|
||||||
dto.setUpdate_time(now);
|
dto.setUpdate_time(now);
|
||||||
dto.setCreate_time(now);
|
dto.setCreate_time(now);
|
||||||
|
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
Iterator<Device> iterator = allDevice.iterator();
|
Iterator<Device> iterator = allDevice.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
Device device = iterator.next();
|
Device device = iterator.next();
|
||||||
if (StrUtil.equals(device.getDevice_code(),device_code)) {
|
if (StrUtil.equals(device.getDevice_code(), device_code)) {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -856,6 +856,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
String remark = form.optString("remark");
|
String remark = form.optString("remark");
|
||||||
String vehicle_code = form.optString("vehicle_code");
|
String vehicle_code = form.optString("vehicle_code");
|
||||||
String islock = form.optString("islock");
|
String islock = form.optString("islock");
|
||||||
|
String source_device = form.optString("source_device");
|
||||||
if (device_code.indexOf(".") != -1) {
|
if (device_code.indexOf(".") != -1) {
|
||||||
device_code = device_code.substring(0, device_code.indexOf("."));
|
device_code = device_code.substring(0, device_code.indexOf("."));
|
||||||
}
|
}
|
||||||
@@ -887,6 +888,10 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
standardOrdinarySiteDeviceDriver.setHasGoods(Integer.parseInt(hasGoodStatus));
|
standardOrdinarySiteDeviceDriver.setHasGoods(Integer.parseInt(hasGoodStatus));
|
||||||
device.setHas_goods(Integer.parseInt(hasGoodStatus));
|
device.setHas_goods(Integer.parseInt(hasGoodStatus));
|
||||||
}
|
}
|
||||||
|
//指令完成式判断是否需要记录物料来源
|
||||||
|
if (!StrUtil.isEmpty(source_device) && StrUtil.equals("true", String.valueOf(device.getExtraValue().get("source_device")))) {
|
||||||
|
standardOrdinarySiteDeviceDriver.setSource_device(source_device);
|
||||||
|
}
|
||||||
if (StrUtil.isNotEmpty(material_type)) {
|
if (StrUtil.isNotEmpty(material_type)) {
|
||||||
standardOrdinarySiteDeviceDriver.setMaterial(material_type);
|
standardOrdinarySiteDeviceDriver.setMaterial(material_type);
|
||||||
device.setMaterial_type(material_type);
|
device.setMaterial_type(material_type);
|
||||||
@@ -919,6 +924,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock));
|
standardOrdinarySiteDeviceDriver.setIslock(Boolean.valueOf(islock));
|
||||||
device.setIslock(islock);
|
device.setIslock(islock);
|
||||||
}
|
}
|
||||||
|
|
||||||
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
|
WQLObject runpointwo = WQLObject.getWQLObject("acs_device_runpoint");
|
||||||
JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0);
|
JSONObject json = runpointwo.query("device_code ='" + device_code + "'").uniqueResult(0);
|
||||||
if (!ObjectUtil.isEmpty(json)) {
|
if (!ObjectUtil.isEmpty(json)) {
|
||||||
@@ -1008,8 +1014,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
JSONObject updatejson = JSONObject.fromObject(obj);
|
JSONObject updatejson = JSONObject.fromObject(obj);
|
||||||
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
runpointwo.update(updatejson, "device_code = '" + device_code + "'");
|
||||||
}
|
}
|
||||||
}
|
} else if (device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
|
||||||
else if (device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) {
|
|
||||||
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) device.getDeviceDriver();
|
standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) device.getDeviceDriver();
|
||||||
standardEmptyPalletSiteDeviceDriver.setContainer(vehicle_code);
|
standardEmptyPalletSiteDeviceDriver.setContainer(vehicle_code);
|
||||||
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
} else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
@@ -1060,7 +1065,7 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial
|
|||||||
ElectricFenceDeviceDriver electricFenceDeviceDriver;
|
ElectricFenceDeviceDriver electricFenceDeviceDriver;
|
||||||
if (device.getDeviceDriver() instanceof ElectricFenceDeviceDriver) {
|
if (device.getDeviceDriver() instanceof ElectricFenceDeviceDriver) {
|
||||||
electricFenceDeviceDriver = (ElectricFenceDeviceDriver) device.getDeviceDriver();
|
electricFenceDeviceDriver = (ElectricFenceDeviceDriver) device.getDeviceDriver();
|
||||||
if (StrUtil.equals(suspended,"0")) {
|
if (StrUtil.equals(suspended, "0")) {
|
||||||
electricFenceDeviceDriver.setSuspended(true);
|
electricFenceDeviceDriver.setSuspended(true);
|
||||||
} else {
|
} else {
|
||||||
electricFenceDeviceDriver.setSuspended(false);
|
electricFenceDeviceDriver.setSuspended(false);
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ public class StorageCellServiceImpl implements StorageCellService {
|
|||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
|
|
||||||
HashMap map = new HashMap<>(16);
|
HashMap map = new HashMap<>(16);
|
||||||
map.put("flag","6");
|
map.put("flag", "6");
|
||||||
if (whereJson.get("blurry") != null) {
|
if (whereJson.get("blurry") != null) {
|
||||||
map.put("blurry", "%" + whereJson.get("blurry") + "%");
|
map.put("blurry", "%" + whereJson.get("blurry") + "%");
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject json = WQL.getWO("Qdevice_query_002").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page),"update_time desc");
|
JSONObject json = WQL.getWO("Qdevice_query_002").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "update_time desc");
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,22 +3,16 @@ package org.nl.acs.device_driver.electric_fence;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.json.JSONObject;
|
|
||||||
import org.nl.acs.agv.server.AgvService;
|
import org.nl.acs.agv.server.AgvService;
|
||||||
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_driver.DeviceDriver;
|
import org.nl.acs.device_driver.DeviceDriver;
|
||||||
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.instruction.service.InstructionService;
|
|
||||||
import org.nl.acs.opc.Device;
|
import org.nl.acs.opc.Device;
|
||||||
import org.nl.acs.route.service.RouteLineService;
|
|
||||||
import org.nl.acs.task.service.TaskService;
|
|
||||||
import org.nl.utils.SpringContextHolder;
|
import org.nl.utils.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 java.util.Date;
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -72,7 +66,7 @@ public class ElectricFenceDeviceDriver extends AbstractOpcDeviceDriver implement
|
|||||||
if (error != last_error) {
|
if (error != last_error) {
|
||||||
if (this.error == 1) {
|
if (this.error == 1) {
|
||||||
agvService.pause();
|
agvService.pause();
|
||||||
} else if (this.error == 0){
|
} else if (this.error == 0) {
|
||||||
agvService.resume();
|
agvService.resume();
|
||||||
}
|
}
|
||||||
//this.execute_log.setContainer("");
|
//this.execute_log.setContainer("");
|
||||||
|
|||||||
@@ -195,7 +195,7 @@ public class NdxySpecialDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (moveNumber == 4 && ObjectUtil.isNotEmpty(taskServer.findByNextCode(this.device_code))){
|
if (moveNumber == 4 && ObjectUtil.isNotEmpty(taskServer.findByNextCode(this.device_code))) {
|
||||||
this.checked = false;
|
this.checked = false;
|
||||||
this.choose = false;
|
this.choose = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
this.execute_log.setResource(device_code, device_code);
|
this.execute_log.setResource(device_code, device_code);
|
||||||
this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error);
|
this.execute_log.log("设备:" + device_code + ",last_error -> error:" + last_error + "->" + error);
|
||||||
}
|
}
|
||||||
if ( move != 0 && task > 0) {
|
if (move != 0 && task > 0) {
|
||||||
//inst_message
|
//inst_message
|
||||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||||
if (inst != null) {
|
if (inst != null) {
|
||||||
@@ -291,7 +291,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
if(ObjectUtil.isEmpty(barcode()) && mode ==2 && move==1 && operation_type==1 ){
|
if (ObjectUtil.isEmpty(barcode()) && mode == 2 && move == 1 && operation_type == 1) {
|
||||||
writing(7);
|
writing(7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -571,7 +571,7 @@ public class StandardCoveyorControlWithScannerDeviceDriver extends AbstractOpcDe
|
|||||||
//container_code
|
//container_code
|
||||||
TaskDto task = taskserver.findByContainer(container_code);
|
TaskDto task = taskserver.findByContainer(container_code);
|
||||||
if (!ObjectUtil.isEmpty(task)) {
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
if(!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))){
|
if (!ObjectUtils.isEmpty(instructionService.findByBarcodeFromCache(container_code))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
String taskid = task.getTask_id();
|
String taskid = task.getTask_id();
|
||||||
|
|||||||
@@ -183,17 +183,17 @@ public class StandardEmptyPalletSiteDeviceDriver extends AbstractOpcDeviceDriver
|
|||||||
log.debug("设备运转模式:等待工作");
|
log.debug("设备运转模式:等待工作");
|
||||||
return;
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
String apply_task ="";
|
String apply_task = "";
|
||||||
if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("apply_task"))) {
|
if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("apply_task"))) {
|
||||||
apply_task = this.getDevice().getExtraValue().get("apply_task").toString();
|
apply_task = this.getDevice().getExtraValue().get("apply_task").toString();
|
||||||
}
|
}
|
||||||
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS), "1")) {
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS), "1")) {
|
||||||
if (number == max_emptypalletnum && !requireSucess && move > 0 && StrUtil.equals(apply_task,"true")) {
|
if (number == max_emptypalletnum && !requireSucess && move > 0 && StrUtil.equals(apply_task, "true")) {
|
||||||
apply_InEmpty();
|
apply_InEmpty();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//当前数量等于最大数量,并且申请任务为true,则生成搬运任务
|
//当前数量等于最大数量,并且申请任务为true,则生成搬运任务
|
||||||
if (number == max_emptypalletnum && !requireSucess && move > 0 && StrUtil.equals(apply_task,"true")) {
|
if (number == max_emptypalletnum && !requireSucess && move > 0 && StrUtil.equals(apply_task, "true")) {
|
||||||
//判断逻辑
|
//判断逻辑
|
||||||
//需要检查关联的另一设备也满足数量后才能入库
|
//需要检查关联的另一设备也满足数量后才能入库
|
||||||
Object[] linkobj = (Object[]) this.getDevice().getExtraValue().get("link_device_code");
|
Object[] linkobj = (Object[]) this.getDevice().getExtraValue().get("link_device_code");
|
||||||
|
|||||||
@@ -7,32 +7,28 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.json.JSONObject;
|
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
|
||||||
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.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.device_driver.standard_emptypallet_site.StandardEmptyPalletSiteDeviceDriver;
|
|
||||||
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;
|
||||||
import org.nl.acs.opc.Device;
|
import org.nl.acs.opc.Device;
|
||||||
import org.nl.acs.opc.DeviceAppService;
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
import org.nl.acs.opc.WcsConfig;
|
|
||||||
import org.nl.acs.route.service.RouteLineService;
|
import org.nl.acs.route.service.RouteLineService;
|
||||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
import org.nl.modules.system.util.CodeUtil;
|
|
||||||
import org.nl.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.*;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* RGV驱动
|
* RGV驱动
|
||||||
@@ -173,7 +169,7 @@ public class StandardRGVDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
return;
|
return;
|
||||||
case 2:
|
case 2:
|
||||||
//申请任务
|
//申请任务
|
||||||
if (mode == 2 && walk_y == 1 && move == 0 && !applySucess ) {
|
if (mode == 2 && walk_y == 1 && move == 0 && !applySucess) {
|
||||||
instruction_apply();
|
instruction_apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,12 +294,12 @@ public class StandardRGVDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
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_command, 1);
|
itemMap.put(to_command, 1);
|
||||||
itemMap.put(to_onset,appService.findDeviceByCode(inst.getStart_device_code()).getAddress());
|
itemMap.put(to_onset, appService.findDeviceByCode(inst.getStart_device_code()).getAddress());
|
||||||
itemMap.put(to_target,appService.findDeviceByCode(inst.getNext_device_code()).getAddress());
|
itemMap.put(to_target, appService.findDeviceByCode(inst.getNext_device_code()).getAddress());
|
||||||
itemMap.put(to_task, inst.getInstruction_code());
|
itemMap.put(to_task, inst.getInstruction_code());
|
||||||
ReadUtil.write(itemMap, server);
|
ReadUtil.write(itemMap, server);
|
||||||
this.execute_log.setResource(this.device_code, device_code);
|
this.execute_log.setResource(this.device_code, device_code);
|
||||||
this.execute_log.log("设备:{},下发作业命令:{},起始站{},目标站:{},任务号:{}", device_code, to_command,to_onset ,to_target, to_task);
|
this.execute_log.log("设备:{},下发作业命令:{},起始站{},目标站:{},任务号:{}", device_code, to_command, to_onset, to_target, to_task);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -317,17 +313,17 @@ public class StandardRGVDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
} else {
|
} else {
|
||||||
this.instruction_require_time = date;
|
this.instruction_require_time = date;
|
||||||
|
|
||||||
Object[] value = (Object[])this.device.getExtraValue().get("get_device_code");
|
Object[] value = (Object[]) this.device.getExtraValue().get("get_device_code");
|
||||||
Object[] value2 = (Object[])this.device.getExtraValue().get("put_device_code");
|
Object[] value2 = (Object[]) this.device.getExtraValue().get("put_device_code");
|
||||||
|
|
||||||
for (int i = 0; i < value.length; i++) {
|
for (int i = 0; i < value.length; i++) {
|
||||||
String get_device_code = value[i].toString();
|
String get_device_code = value[i].toString();
|
||||||
//Device device = appService.findDeviceByCode(get_device_code);
|
//Device device = appService.findDeviceByCode(get_device_code);
|
||||||
TaskDto task = taskserver.findByStartCode(get_device_code);
|
TaskDto task = taskserver.findByStartCode(get_device_code);
|
||||||
if(!ObjectUtil.isEmpty(task)){
|
if (!ObjectUtil.isEmpty(task)) {
|
||||||
for(int j=0;j<value2.length;j++){
|
for (int j = 0; j < value2.length; j++) {
|
||||||
String putdevice_code = value2[j].toString();
|
String putdevice_code = value2[j].toString();
|
||||||
if(StrUtil.equals(task.getNext_device_code(),putdevice_code)){
|
if (StrUtil.equals(task.getNext_device_code(), putdevice_code)) {
|
||||||
String taskid = task.getTask_id();
|
String taskid = task.getTask_id();
|
||||||
String taskcode = task.getTask_code();
|
String taskcode = task.getTask_code();
|
||||||
String vehiclecode = task.getVehicle_code();
|
String vehiclecode = task.getVehicle_code();
|
||||||
@@ -365,7 +361,7 @@ public class StandardRGVDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(applySucess){
|
if (applySucess) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ public class StandardScannerDeviceDriver extends AbstractDeviceDriver implements
|
|||||||
throw new Exception("ip未配置");
|
throw new Exception("ip未配置");
|
||||||
} else {
|
} else {
|
||||||
String result = (String) this.accessor_value.getValue(this.getIp());
|
String result = (String) this.accessor_value.getValue(this.getIp());
|
||||||
if(!StrUtil.isEmpty(result)){
|
if (!StrUtil.isEmpty(result)) {
|
||||||
log.debug(DateUtil.now() +" ip:{} 条码:{}",ip,result);
|
log.debug(DateUtil.now() + " ip:{} 条码:{}", ip, result);
|
||||||
System.out.println( DateUtil.now() +" ip:"+ ip + " 条码:"+result);
|
System.out.println(DateUtil.now() + " ip:" + ip + " 条码:" + result);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,8 +54,6 @@ public class ItemProtocol {
|
|||||||
public static String item_to_erroe = "to_temperature2";
|
public static String item_to_erroe = "to_temperature2";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private SparyTowerDeviceDriver driver;
|
private SparyTowerDeviceDriver driver;
|
||||||
|
|
||||||
public ItemProtocol(SparyTowerDeviceDriver driver) {
|
public ItemProtocol(SparyTowerDeviceDriver driver) {
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ public class YkbkSpecialDeviceDriver extends AbstractOpcDeviceDriver implements
|
|||||||
if (move != last_move) {
|
if (move != last_move) {
|
||||||
this.execute_log.setResource(this.devicecode, this.device.getDevice_name());
|
this.execute_log.setResource(this.devicecode, this.device.getDevice_name());
|
||||||
this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move);
|
this.execute_log.log("设备:" + device_code + ",last_move -> move:" + last_mode + "->" + move);
|
||||||
if(move != 0 ){
|
if (move != 0) {
|
||||||
Device deviceByCode = deviceAppService.findDeviceByCode(device_code);
|
Device deviceByCode = deviceAppService.findDeviceByCode(device_code);
|
||||||
if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("default_material"))) {
|
if (ObjectUtil.isNotEmpty(this.getDevice().getExtraValue().get("default_material"))) {
|
||||||
this.setMaterial(this.getDevice().getExtraValue().get("default_material").toString());
|
this.setMaterial(this.getDevice().getExtraValue().get("default_material").toString());
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.JSONObject;
|
|
||||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||||
import org.nl.annotation.Log;
|
import org.nl.annotation.Log;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package org.nl.acs.ext.wms.service;
|
|||||||
|
|
||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.JSONObject;
|
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String type = "";
|
String type = "";
|
||||||
if(!ObjectUtil.isEmpty(result2)){
|
if (!ObjectUtil.isEmpty(result2)) {
|
||||||
if (result2.getStatus() == 200) {
|
if (result2.getStatus() == 200) {
|
||||||
type = "info";
|
type = "info";
|
||||||
} else {
|
} else {
|
||||||
@@ -155,7 +155,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
|
|
||||||
HttpResponse result2 = null;
|
HttpResponse result2 = null;
|
||||||
log.info("feedbackActionStatusToWms-----请求参数{}", data.toString());
|
log.info("feedbackActionStatusToWms-----请求参数{}", data.toString());
|
||||||
logServer.log(task_code, "feedbackActionStatusToWms", "", data.toString(), "","", wmsurl, vehicle_code);
|
logServer.log(task_code, "feedbackActionStatusToWms", "", data.toString(), "", "", wmsurl, vehicle_code);
|
||||||
|
|
||||||
AddressDto addressDto = addressService.findByCode("feedbackActionStatusToWms");
|
AddressDto addressDto = addressService.findByCode("feedbackActionStatusToWms");
|
||||||
String methods_url = addressDto.getMethods_url();
|
String methods_url = addressDto.getMethods_url();
|
||||||
@@ -173,7 +173,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String type = "";
|
String type = "";
|
||||||
if(!ObjectUtil.isEmpty(result2)){
|
if (!ObjectUtil.isEmpty(result2)) {
|
||||||
if (result2.getStatus() == 200) {
|
if (result2.getStatus() == 200) {
|
||||||
type = "info";
|
type = "info";
|
||||||
} else {
|
} else {
|
||||||
@@ -377,7 +377,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
String url = wmsUrl + methods_url;
|
String url = wmsUrl + methods_url;
|
||||||
HttpResponse result = null;
|
HttpResponse result = null;
|
||||||
log.info("feedbackAgvStatus----请求参数{}", json);
|
log.info("feedbackAgvStatus----请求参数{}", json);
|
||||||
logServer.log("","feedbackAgvStatus","",json.toString(),"","",url,"");
|
logServer.log("", "feedbackAgvStatus", "", json.toString(), "", "", url, "");
|
||||||
try {
|
try {
|
||||||
result = HttpRequest.post(url)
|
result = HttpRequest.post(url)
|
||||||
.body(String.valueOf(json))
|
.body(String.valueOf(json))
|
||||||
@@ -387,7 +387,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
|||||||
//网络不通
|
//网络不通
|
||||||
System.out.println(msg);
|
System.out.println(msg);
|
||||||
log.info("feedbackAgvStatus----异常返回参数{}", msg);
|
log.info("feedbackAgvStatus----异常返回参数{}", msg);
|
||||||
logServer.log("","feedbackAgvStatus","error",json.toString(),msg,String.valueOf(result.getStatus()),url,"");
|
logServer.log("", "feedbackAgvStatus", "error", json.toString(), msg, String.valueOf(result.getStatus()), url, "");
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,13 +40,11 @@ import org.nl.acs.route.service.RouteLineService;
|
|||||||
import org.nl.acs.route.service.dto.RouteLineDto;
|
import org.nl.acs.route.service.dto.RouteLineDto;
|
||||||
import org.nl.acs.task.service.TaskService;
|
import org.nl.acs.task.service.TaskService;
|
||||||
import org.nl.acs.task.service.dto.TaskDto;
|
import org.nl.acs.task.service.dto.TaskDto;
|
||||||
import org.nl.exception.WDKException;
|
|
||||||
import org.nl.utils.SpringContextHolder;
|
import org.nl.utils.SpringContextHolder;
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
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 org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -71,7 +69,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
JSONObject resultJson = new JSONObject();
|
JSONObject resultJson = new JSONObject();
|
||||||
log.info("createFromWms--------------:输入参数:" + tasks.toString());
|
log.info("createFromWms--------------:输入参数:" + tasks.toString());
|
||||||
logServer.log("", "createFromWms", "info", tasks.toString(), "", "", "", "");
|
logServer.log("", "createFromWms", "info", tasks.toString(), "", "", "", "");
|
||||||
try{
|
try {
|
||||||
JSONArray errArr = new JSONArray();
|
JSONArray errArr = new JSONArray();
|
||||||
for (int i = 0; i < tasks.size(); i++) {
|
for (int i = 0; i < tasks.size(); i++) {
|
||||||
JSONObject task = tasks.getJSONObject(i);
|
JSONObject task = tasks.getJSONObject(i);
|
||||||
@@ -155,7 +153,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TaskService.checkSameTaskByCode(task_code)){
|
if (TaskService.checkSameTaskByCode(task_code)) {
|
||||||
JSONObject json = new JSONObject();
|
JSONObject json = new JSONObject();
|
||||||
json.put("task_code", task_code);
|
json.put("task_code", task_code);
|
||||||
json.put("message", "不能存在相同的任务号!");
|
json.put("message", "不能存在相同的任务号!");
|
||||||
@@ -229,7 +227,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
resultJson.put("message", "操作成功");
|
resultJson.put("message", "操作成功");
|
||||||
resultJson.put("data", new JSONObject());
|
resultJson.put("data", new JSONObject());
|
||||||
log.info("createFromWms--------------:输出参数:" + resultJson.toString());
|
log.info("createFromWms--------------:输出参数:" + resultJson.toString());
|
||||||
logServer.log("", "createFromWms", "info",tasks.toString(), resultJson.toString(), "200", "", "");
|
logServer.log("", "createFromWms", "info", tasks.toString(), resultJson.toString(), "200", "", "");
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -238,7 +236,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
resultJson.put("message", e.getMessage());
|
resultJson.put("message", e.getMessage());
|
||||||
resultJson.put("data", new JSONObject());
|
resultJson.put("data", new JSONObject());
|
||||||
log.info("createFromWms--------------:输出参数:" + resultJson.toString());
|
log.info("createFromWms--------------:输出参数:" + resultJson.toString());
|
||||||
logServer.log("", "createFromWms", "error",tasks.toString(), resultJson.toString(), "400", "", "");
|
logServer.log("", "createFromWms", "error", tasks.toString(), resultJson.toString(), "400", "", "");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,9 +330,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
electricFenceDeviceDriver = (ElectricFenceDeviceDriver) device.getDeviceDriver();
|
electricFenceDeviceDriver = (ElectricFenceDeviceDriver) device.getDeviceDriver();
|
||||||
if (electricFenceDeviceDriver.getSuspended()) {
|
if (electricFenceDeviceDriver.getSuspended()) {
|
||||||
throw new RuntimeException("交通管制无法进入");
|
throw new RuntimeException("交通管制无法进入");
|
||||||
} else if (StrUtil.equals(type,"1")) {
|
} else if (StrUtil.equals(type, "1")) {
|
||||||
electricFenceDeviceDriver.setSuspended(true);
|
electricFenceDeviceDriver.setSuspended(true);
|
||||||
} else if (StrUtil.equals(type,"2")) {
|
} else if (StrUtil.equals(type, "2")) {
|
||||||
electricFenceDeviceDriver.setSuspended(false);
|
electricFenceDeviceDriver.setSuspended(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ public class LogServerImpl implements LogServer {
|
|||||||
for (int i = 0; i < content.size(); i++) {
|
for (int i = 0; i < content.size(); i++) {
|
||||||
JSONObject jsonObject = content.getJSONObject(i);
|
JSONObject jsonObject = content.getJSONObject(i);
|
||||||
String responseparam = jsonObject.getString("responseparam");
|
String responseparam = jsonObject.getString("responseparam");
|
||||||
if (StrUtil.isNotEmpty(responseparam) && responseparam.contains("null")){
|
if (StrUtil.isNotEmpty(responseparam) && responseparam.contains("null")) {
|
||||||
responseparam = responseparam.replace("null","\"\"");
|
responseparam = responseparam.replace("null", "\"\"");
|
||||||
}
|
}
|
||||||
jsonObject.put("responseparam",responseparam);
|
jsonObject.put("responseparam", responseparam);
|
||||||
newContent.add(jsonObject);
|
newContent.add(jsonObject);
|
||||||
}
|
}
|
||||||
json.put("content",newContent);
|
json.put("content", newContent);
|
||||||
Object parse = JSONObject.fromObject(json.toString());
|
Object parse = JSONObject.fromObject(json.toString());
|
||||||
return parse;
|
return parse;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,10 +39,10 @@ public class DeviceOpcSynchronizeAutoRun extends AbstractAutoRunnable {
|
|||||||
|
|
||||||
Map<String, OpcServerManageDto> servers = this.opcServerManageService.queryAllServerMap();
|
Map<String, OpcServerManageDto> servers = this.opcServerManageService.queryAllServerMap();
|
||||||
Map<String, List<List<OpcItemDto>>> pros;
|
Map<String, List<List<OpcItemDto>>> pros;
|
||||||
do{
|
do {
|
||||||
Thread.sleep(1000L);
|
Thread.sleep(1000L);
|
||||||
pros = this.deviceAppService.findAllFormatProtocolFromDriver();
|
pros = this.deviceAppService.findAllFormatProtocolFromDriver();
|
||||||
}while (ObjectUtil.isEmpty(pros));
|
} while (ObjectUtil.isEmpty(pros));
|
||||||
Set<String> keys = pros.keySet();
|
Set<String> keys = pros.keySet();
|
||||||
Iterator var4 = keys.iterator();
|
Iterator var4 = keys.iterator();
|
||||||
System.out.println("test:" + var4.hasNext());
|
System.out.println("test:" + var4.hasNext());
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ import org.nl.start.auto.initial.ApplicationAutoInitial;
|
|||||||
import org.nl.utils.FileUtil;
|
import org.nl.utils.FileUtil;
|
||||||
import org.nl.utils.SecurityUtils;
|
import org.nl.utils.SecurityUtils;
|
||||||
import org.nl.wql.WQL;
|
import org.nl.wql.WQL;
|
||||||
import org.nl.wql.core.bean.ResultBean;
|
|
||||||
import org.nl.wql.core.bean.WQLObject;
|
import org.nl.wql.core.bean.WQLObject;
|
||||||
import org.nl.wql.util.WqlUtil;
|
import org.nl.wql.util.WqlUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -65,18 +64,18 @@ public class RouteLineServiceImpl implements RouteLineService, ApplicationAutoIn
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||||
HashMap<String,String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
String device_code = (String) whereJson.get("device_code");
|
String device_code = (String) whereJson.get("device_code");
|
||||||
String next_device_code = (String) whereJson.get("next_device_code");
|
String next_device_code = (String) whereJson.get("next_device_code");
|
||||||
String route_plan_id = (String) whereJson.get("route_plan_id");
|
String route_plan_id = (String) whereJson.get("route_plan_id");
|
||||||
map.put("flag","1");
|
map.put("flag", "1");
|
||||||
if (StrUtil.isNotEmpty(device_code)){
|
if (StrUtil.isNotEmpty(device_code)) {
|
||||||
map.put("device_code","%" + device_code + "%");
|
map.put("device_code", "%" + device_code + "%");
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotEmpty(next_device_code)){
|
if (StrUtil.isNotEmpty(next_device_code)) {
|
||||||
map.put("next_device_code","%" + next_device_code + "%");
|
map.put("next_device_code", "%" + next_device_code + "%");
|
||||||
}
|
}
|
||||||
map.put("route_plan_id",route_plan_id);
|
map.put("route_plan_id", route_plan_id);
|
||||||
JSONObject json = WQL.getWO("QROUTE").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "line.create_time desc");
|
JSONObject json = WQL.getWO("QROUTE").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "line.create_time desc");
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
@@ -417,7 +416,7 @@ public class RouteLineServiceImpl implements RouteLineService, ApplicationAutoIn
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void reload(){
|
public void reload() {
|
||||||
Object[] param = new Object[0];
|
Object[] param = new Object[0];
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
List<RoutePlanDto> routePlans = this.routePlanService.queryAll(map);
|
List<RoutePlanDto> routePlans = this.routePlanService.queryAll(map);
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ import org.nl.acs.device_driver.standard_manipulator_inspect_site.StandardManipu
|
|||||||
import org.nl.acs.device_driver.standard_manipulator_stacking_site.StandardManipulatorStackingSiteDeviceDriver;
|
import org.nl.acs.device_driver.standard_manipulator_stacking_site.StandardManipulatorStackingSiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
import org.nl.acs.device_driver.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.standard_photoelectric_inspect_site.StandardPhotoelectricInspectSiteDeviceDriver;
|
import org.nl.acs.device_driver.standard_photoelectric_inspect_site.StandardPhotoelectricInspectSiteDeviceDriver;
|
||||||
|
import org.nl.acs.device_driver.standard_rgv.StandardRGVDeviceDriver;
|
||||||
import org.nl.acs.device_driver.standard_scanner.StandardScannerDeviceDriver;
|
import org.nl.acs.device_driver.standard_scanner.StandardScannerDeviceDriver;
|
||||||
import org.nl.acs.device_driver.weighing_site.WeighingSiteDeviceDriver;
|
import org.nl.acs.device_driver.weighing_site.WeighingSiteDeviceDriver;
|
||||||
import org.nl.acs.device_driver.ykbk_special.YkbkSpecialDeviceDriver;
|
import org.nl.acs.device_driver.ykbk_special.YkbkSpecialDeviceDriver;
|
||||||
import org.nl.acs.device_driver.standard_rgv.StandardRGVDeviceDriver;
|
|
||||||
import org.nl.acs.opc.Device;
|
import org.nl.acs.opc.Device;
|
||||||
import org.nl.acs.opc.DeviceAppService;
|
import org.nl.acs.opc.DeviceAppService;
|
||||||
import org.nl.acs.opc.DeviceAppServiceImpl;
|
import org.nl.acs.opc.DeviceAppServiceImpl;
|
||||||
@@ -455,7 +455,7 @@ public class StageActorServiceImpl implements StageActorService {
|
|||||||
jo.put("action", standardCoveyorControlWithScannerDeviceDriver.getAction());
|
jo.put("action", standardCoveyorControlWithScannerDeviceDriver.getAction());
|
||||||
jo.put("ioaction", standardCoveyorControlWithScannerDeviceDriver.getIoaction());
|
jo.put("ioaction", standardCoveyorControlWithScannerDeviceDriver.getIoaction());
|
||||||
jo.put("container", StrUtil.isEmpty(standardCoveyorControlWithScannerDeviceDriver.barcode()) ? "" : standardCoveyorControlWithScannerDeviceDriver.barcode());
|
jo.put("container", StrUtil.isEmpty(standardCoveyorControlWithScannerDeviceDriver.barcode()) ? "" : standardCoveyorControlWithScannerDeviceDriver.barcode());
|
||||||
jo.put("message", StrUtil.equals(standardCoveyorControlWithScannerDeviceDriver.getMessage(),"null") ? "":standardCoveyorControlWithScannerDeviceDriver.getMessage());
|
jo.put("message", StrUtil.equals(standardCoveyorControlWithScannerDeviceDriver.getMessage(), "null") ? "" : standardCoveyorControlWithScannerDeviceDriver.getMessage());
|
||||||
jo.put("requestSucess", standardCoveyorControlWithScannerDeviceDriver.getRequireSucess().toString());
|
jo.put("requestSucess", standardCoveyorControlWithScannerDeviceDriver.getRequireSucess().toString());
|
||||||
jo.put("applySucess", standardCoveyorControlWithScannerDeviceDriver.getApplySucess().toString());
|
jo.put("applySucess", standardCoveyorControlWithScannerDeviceDriver.getApplySucess().toString());
|
||||||
jo.put("instruction_message", standardCoveyorControlWithScannerDeviceDriver.getInst_message());
|
jo.put("instruction_message", standardCoveyorControlWithScannerDeviceDriver.getInst_message());
|
||||||
@@ -496,7 +496,7 @@ public class StageActorServiceImpl implements StageActorService {
|
|||||||
jo.put("action", standardCoveyorControlWithPlcScannerDeviceDriver.getAction());
|
jo.put("action", standardCoveyorControlWithPlcScannerDeviceDriver.getAction());
|
||||||
jo.put("ioaction", standardCoveyorControlWithPlcScannerDeviceDriver.getIoaction());
|
jo.put("ioaction", standardCoveyorControlWithPlcScannerDeviceDriver.getIoaction());
|
||||||
jo.put("container", StrUtil.isEmpty(standardCoveyorControlWithPlcScannerDeviceDriver.getBarcode()) ? "" : standardCoveyorControlWithPlcScannerDeviceDriver.getBarcode());
|
jo.put("container", StrUtil.isEmpty(standardCoveyorControlWithPlcScannerDeviceDriver.getBarcode()) ? "" : standardCoveyorControlWithPlcScannerDeviceDriver.getBarcode());
|
||||||
jo.put("message", StrUtil.isEmpty(standardCoveyorControlWithPlcScannerDeviceDriver.getMessage()) ? "":standardCoveyorControlWithPlcScannerDeviceDriver.getMessage());
|
jo.put("message", StrUtil.isEmpty(standardCoveyorControlWithPlcScannerDeviceDriver.getMessage()) ? "" : standardCoveyorControlWithPlcScannerDeviceDriver.getMessage());
|
||||||
jo.put("requestSucess", standardCoveyorControlWithPlcScannerDeviceDriver.getRequireSucess().toString());
|
jo.put("requestSucess", standardCoveyorControlWithPlcScannerDeviceDriver.getRequireSucess().toString());
|
||||||
jo.put("applySucess", standardCoveyorControlWithPlcScannerDeviceDriver.getApplySucess().toString());
|
jo.put("applySucess", standardCoveyorControlWithPlcScannerDeviceDriver.getApplySucess().toString());
|
||||||
jo.put("instruction_message", standardCoveyorControlWithPlcScannerDeviceDriver.getInst_message());
|
jo.put("instruction_message", standardCoveyorControlWithPlcScannerDeviceDriver.getInst_message());
|
||||||
@@ -964,8 +964,7 @@ public class StageActorServiceImpl implements StageActorService {
|
|||||||
jo.put("isError", ykbkSpecialDeviceDriver.getIserror());
|
jo.put("isError", ykbkSpecialDeviceDriver.getIserror());
|
||||||
jo.put("container", ykbkSpecialDeviceDriver.getContainer());
|
jo.put("container", ykbkSpecialDeviceDriver.getContainer());
|
||||||
jo.put("message", ykbkSpecialDeviceDriver.getMessage());
|
jo.put("message", ykbkSpecialDeviceDriver.getMessage());
|
||||||
}
|
} else if (device.getDeviceDriver() instanceof StandardPhotoelectricInspectSiteDeviceDriver) {
|
||||||
else if (device.getDeviceDriver() instanceof StandardPhotoelectricInspectSiteDeviceDriver) {
|
|
||||||
standardPhotoelectricInspectSiteDeviceDriver = (StandardPhotoelectricInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardPhotoelectricInspectSiteDeviceDriver = (StandardPhotoelectricInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (standardPhotoelectricInspectSiteDeviceDriver.getMode() == 0) {
|
if (standardPhotoelectricInspectSiteDeviceDriver.getMode() == 0) {
|
||||||
mode = "未联机";
|
mode = "未联机";
|
||||||
@@ -992,8 +991,7 @@ public class StageActorServiceImpl implements StageActorService {
|
|||||||
jo.put("isError", standardPhotoelectricInspectSiteDeviceDriver.getIserror());
|
jo.put("isError", standardPhotoelectricInspectSiteDeviceDriver.getIserror());
|
||||||
jo.put("container", standardPhotoelectricInspectSiteDeviceDriver.getContainer());
|
jo.put("container", standardPhotoelectricInspectSiteDeviceDriver.getContainer());
|
||||||
jo.put("message", standardPhotoelectricInspectSiteDeviceDriver.getMessage());
|
jo.put("message", standardPhotoelectricInspectSiteDeviceDriver.getMessage());
|
||||||
}
|
} else if (device.getDeviceDriver() instanceof ElectricFenceDeviceDriver) {
|
||||||
else if (device.getDeviceDriver() instanceof ElectricFenceDeviceDriver) {
|
|
||||||
electricFenceDeviceDriver = (ElectricFenceDeviceDriver) device.getDeviceDriver();
|
electricFenceDeviceDriver = (ElectricFenceDeviceDriver) device.getDeviceDriver();
|
||||||
obj.put("device_name", electricFenceDeviceDriver.getDevice().getDevice_name());
|
obj.put("device_name", electricFenceDeviceDriver.getDevice().getDevice_name());
|
||||||
jo.put("isOnline", true);
|
jo.put("isOnline", true);
|
||||||
@@ -1003,7 +1001,7 @@ public class StageActorServiceImpl implements StageActorService {
|
|||||||
jo.put("error", electricFenceDeviceDriver.getError());
|
jo.put("error", electricFenceDeviceDriver.getError());
|
||||||
jo.put("isError", electricFenceDeviceDriver.getIserror());
|
jo.put("isError", electricFenceDeviceDriver.getIserror());
|
||||||
}
|
}
|
||||||
jo.put("driver_code",device.getDeviceDriverDefination().getDriverCode());
|
jo.put("driver_code", device.getDeviceDriverDefination().getDriverCode());
|
||||||
obj.put("data", jo);
|
obj.put("data", jo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user