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