更新
This commit is contained in:
@@ -180,6 +180,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
if (move_1 != last_move_1) {
|
||||
if (move_1 == 0) {
|
||||
this.setRequireSucess1(false);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "前工位有货变无货,复位前工位请求标记requireSucess1:"+requireSucess1);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "move_1", String.valueOf(move_1));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move_1:" + last_move_1 + "->" + move_1);
|
||||
@@ -187,6 +188,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
if (move_2 != last_move_2) {
|
||||
if (move_2 == 0) {
|
||||
this.setRequireSucess2(false);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "前工位有货变无货,复位前工位请求标记requireSucess1:"+requireSucess1);
|
||||
}
|
||||
logServer.deviceItemValue(this.device_code, "move_2", String.valueOf(move_2));
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号move_2:" + last_move_2 + "->" + move_2);
|
||||
@@ -356,11 +358,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
}
|
||||
//前工位申请任务
|
||||
else if (mode == 2 && move_2 == 0 && action_2 == 0 && move_1 == 0 && task2 == 0 && !requireSucess1) {
|
||||
// System.out.println("move_2:" + move_2 + ",action_2:" + action_2 + ",move_1:" + move_1 + ",task2:" + task2 + ",requireSucess1:" + requireSucess1);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "move_2:" + move_2 + ",action_2:" + action_2 + ",move_1:" + move_1 + ",task2:" + task2 + ",requireSucess1:" + requireSucess1);
|
||||
instruction_require();
|
||||
} else {
|
||||
System.out.println("111");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -480,10 +478,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
writing("to_onset1", start_addr);
|
||||
writing("to_target1", next_addr);
|
||||
writing("to_task1", instdto.getInstruction_code());
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请前工位满料任务成功,requireSucess1"+requireSucess1+",指令号:"+instdto.getInstruction_code());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -564,11 +559,11 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
writing("to_target2", next_addr);
|
||||
writing("to_task2", instdto.getInstruction_code());
|
||||
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请后工位空盘任务成功,requireSucess2"+requireSucess2+",指令号:"+instdto.getInstruction_code());
|
||||
|
||||
} else {
|
||||
if (mode == 2 && move_2 == 0 && action_2 == 0 && move_1 == 0 && task2 == 0 && !requireSucess1) {
|
||||
// System.out.println("move_2:" + move_2 + ",action_2:" + action_2 + ",move_1:" + move_1 + ",task2:" + task2 + ",requireSucess1:" + requireSucess1);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "move_2:" + move_2 + ",action_2:" + action_2 + ",move_1:" + move_1 + ",task2:" + task2 + ",requireSucess1:" + requireSucess1);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "申请后工位空盘任务未找到,开始申请前工位任务,requireSucess1"+requireSucess1);
|
||||
instruction_require();
|
||||
}
|
||||
}
|
||||
@@ -593,6 +588,7 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_param, value);
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "下发电气信号:"+to_param +",值:"+value);
|
||||
|
||||
ReadUtil.write(itemMap, server);
|
||||
}
|
||||
|
||||
@@ -281,25 +281,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
break;
|
||||
}
|
||||
|
||||
switch (flag) {
|
||||
//请求取货
|
||||
// case 1:
|
||||
// writing(5);
|
||||
// return;
|
||||
// //取货完成
|
||||
// case 2:
|
||||
// writing(2);
|
||||
// return;
|
||||
// //请求放货
|
||||
// case 3:
|
||||
// writing(6);
|
||||
// return;
|
||||
// //放货完成
|
||||
// case 4:
|
||||
// writing(3);
|
||||
// this.writing(3,Integer.parseInt(inst.getInstruction_code()));
|
||||
// return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
last_mode = mode;
|
||||
@@ -331,7 +313,11 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("type","4");
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请空盘,请求接口lnshApplyTaskToWms:"+json);
|
||||
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请空盘,反馈接口lnshApplyTaskToWms:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.get("status").toString(),"200")) {
|
||||
@@ -361,7 +347,11 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
json.put("pcsn",batch);
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
json.put("is_full","0");
|
||||
logServer.deviceExecuteLog(this.device_code,"","","叫料,请求接口lnshApplyTaskToWms:"+json);
|
||||
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","叫料,反馈接口applyIntoKiln:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.get("status").toString(),"200")) {
|
||||
@@ -391,121 +381,14 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
json.put("task_code",inst.getTask_code());
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请入窑输送任务,请求接口applyIntoKiln:"+json);
|
||||
|
||||
HttpResponse result = acsToWmsService.applyIntoKiln(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请入窑输送任务,反馈接口applyIntoKiln:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.get("status").toString(),"200")) {
|
||||
// JSONObject joo = JSONObject.parseObject(jsonObject.get("data").toString());
|
||||
// String ext_task_uuid = joo.getString("ext_task_uuid");
|
||||
// String task_code = joo.getString("task_code");
|
||||
// String start_point_code = joo.getString("start_device_code");
|
||||
// String next_point_code = joo.getString("next_device_code");
|
||||
// String start_device_code = "";
|
||||
// String next_device_code = "";
|
||||
// if (StrUtil.isEmpty(task_code)) {
|
||||
// throw new WDKException("任务号不能为空");
|
||||
// }
|
||||
// if (StrUtil.isEmpty(start_point_code)) {
|
||||
// throw new WDKException("起点不能为空");
|
||||
// }
|
||||
// if (StrUtil.isEmpty(next_point_code)) {
|
||||
// throw new WDKException("终点不能为空");
|
||||
// }
|
||||
//
|
||||
// JSONObject start_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + start_point_code + "'").uniqueResult(0);
|
||||
// if (!ObjectUtil.isEmpty(start_device_json)) {
|
||||
// start_point_code = (String) start_device_json.get("parent_storage_code") == null ? start_point_code : (String) start_device_json.get("storage_code");
|
||||
// }
|
||||
// JSONObject next_device_json = WQLObject.getWQLObject("acs_storage_cell").query("parent_storage_code ='" + next_point_code + "'").uniqueResult(0);
|
||||
// if (!ObjectUtil.isEmpty(next_device_json)) {
|
||||
// next_point_code = (String) next_device_json.get("parent_storage_code") == null ? next_point_code : (String) next_device_json.get("storage_code");
|
||||
// }
|
||||
// String priority = joo.getString("priority");
|
||||
// String vehicle_code = joo.getString("vehicle_code");
|
||||
// String vehicle_type = joo.getString("vehicle_type");
|
||||
// String route_plan_code = joo.getString("route_plan_code");
|
||||
// String task_type = joo.getString("task_type");
|
||||
// String remark = joo.getString("remark");
|
||||
// String params = joo.getString("params");
|
||||
//
|
||||
// if (start_point_code.indexOf("-") > 0) {
|
||||
// String str[] = start_point_code.split("-");
|
||||
// start_device_code = str[0];
|
||||
// } else {
|
||||
// start_device_code = start_point_code;
|
||||
// }
|
||||
//
|
||||
// if (next_point_code.indexOf("-") > 0) {
|
||||
// String str[] = next_point_code.split("-");
|
||||
// next_device_code = str[0];
|
||||
// } else {
|
||||
// next_device_code = next_point_code;
|
||||
// }
|
||||
//
|
||||
// if (StrUtil.isEmpty(route_plan_code)) {
|
||||
// route_plan_code = "normal";
|
||||
// }
|
||||
//
|
||||
// JSONObject jo = new JSONObject();
|
||||
// jo.put("task_code", task_code);
|
||||
// jo.put("ext_task_uuid", ext_task_uuid);
|
||||
// jo.put("start_point_code", start_point_code);
|
||||
// jo.put("next_point_code", next_point_code);
|
||||
// jo.put("start_parent_code", start_point_code);
|
||||
// jo.put("next_parent_code", next_point_code);
|
||||
// jo.put("start_device_code", start_device_code);
|
||||
// jo.put("next_device_code", next_device_code);
|
||||
// jo.put("priority", priority);
|
||||
// jo.put("vehicle_code", vehicle_code);
|
||||
// jo.put("vehicle_type", vehicle_type);
|
||||
// jo.put("remark", remark);
|
||||
// jo.put("params", params);
|
||||
// jo.put("task_type", StrUtil.isEmpty(task_type) ? 1 : Integer.parseInt(task_type));
|
||||
//
|
||||
// TaskDto task_dto = jo.toJavaObject(TaskDto.class);
|
||||
// try {
|
||||
// taskserver.create(task_dto);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// Instruction instdto = new Instruction();
|
||||
// instdto.setInstruction_id(IdUtil.simpleUUID());
|
||||
// instdto.setRoute_plan_code(route_plan_code);
|
||||
// instdto.setRemark(task_dto.getRemark());
|
||||
// instdto.setMaterial(task_dto.getMaterial());
|
||||
// instdto.setQuantity(task_dto.getQuantity());
|
||||
// instdto.setTask_id(task_dto.getTask_id());
|
||||
// instdto.setTask_code(task_dto.getTask_code());
|
||||
// instdto.setVehicle_code(task_dto.getVehicle_code());
|
||||
// String now = DateUtil.now();
|
||||
// instdto.setCreate_time(now);
|
||||
// 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();
|
||||
//
|
||||
// }
|
||||
//
|
||||
// //创建指令后修改任务状态
|
||||
// WQLObject taskwo = WQLObject.getWQLObject("acs_task");
|
||||
//
|
||||
// task_dto.setTask_status("1");
|
||||
// //创建指令后修改任务状态
|
||||
// task_dto.setTask_status("1");
|
||||
// taskserver.update(task_dto);
|
||||
|
||||
this.writing(1);
|
||||
this.setRequireSucess(true);
|
||||
}
|
||||
@@ -532,7 +415,11 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("type","5");
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请入窑,请求接口inKiln:"+json);
|
||||
|
||||
HttpResponse result = acsToWmsService.inKiln(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请入窑,反馈接口inKiln:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.get("status").toString(),"200")) {
|
||||
@@ -561,8 +448,11 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
json.put("device_code",device_code);
|
||||
json.put("type","2");
|
||||
json.put("is_full","1");
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请物料出库,请求接口lnshApplyTaskToWms:"+json);
|
||||
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请物料出库,反馈接口lnshApplyTaskToWms:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||
@@ -575,7 +465,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请入库
|
||||
* 申请出窑
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
@@ -589,7 +479,11 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请出窑,请求接口outKiln:"+json);
|
||||
|
||||
HttpResponse result = acsToWmsService.outKiln(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","申请出窑,反馈接口outKiln:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.get("status").toString(),"200")) {
|
||||
@@ -622,7 +516,10 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
// json.put("material",material);
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
json.put("is_full","1");
|
||||
logServer.deviceExecuteLog(this.device_code,"","","putStorage请求接口lnshApplyTaskToWms:"+json);
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","putStorage反馈接口lnshApplyTaskToWms:"+result.body());
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||
@@ -711,6 +608,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
Server server = ReadUtil.getServer(opcservcerid);
|
||||
Map<String, Object> itemMap = new HashMap<String, Object>();
|
||||
itemMap.put(to_command, command);
|
||||
logServer.deviceExecuteLog(this.device_code,"","","下发电气信号:"+to_command+",value"+command);
|
||||
ReadUtil.write(itemMap, server);
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
private Date instruction_require_time = new Date();
|
||||
private Date instruction_finished_time = new Date();
|
||||
|
||||
private int instruction_require_time_out;
|
||||
private int instruction_require_time_out =3000;
|
||||
boolean requireSucess = false;
|
||||
|
||||
boolean resultSucess = false;
|
||||
@@ -943,9 +943,11 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_require_time = date;
|
||||
logServer.deviceExecuteLog(this.device_code,"","","请求接口enterOrder:"+json);
|
||||
HttpResponse result = acsToWmsService.enterOrder(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
logServer.deviceExecuteLog(this.device_code,"","","反馈接口enterOrder:"+jsonObject);
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||
ProduceshiftorderDto dto = produceshiftorderService.findByCode(order_No);
|
||||
if (this.mode == 4) {
|
||||
|
||||
@@ -1,29 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<included>
|
||||
<springProperty scope="context" name="logPath" source="logging.file.path" defaultValue="logs"/>
|
||||
<property name="log.pattern"
|
||||
value="%black(%contextName-) %red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}) - %gray(%msg%n)"/>
|
||||
<springProperty scope="context" name="lokiUrl" source="loki.url"/>
|
||||
<property name="LOKI_URL" value="${lokiUrl}"/>
|
||||
<!--添加loki-->
|
||||
<appender name="lokiAppender" class="com.github.loki4j.logback.Loki4jAppender">
|
||||
<batchTimeoutMs>1000</batchTimeoutMs>
|
||||
<http class="com.github.loki4j.logback.ApacheHttpSender">
|
||||
<url>${LOKI_URL}</url>
|
||||
</http>
|
||||
<format>
|
||||
<label>
|
||||
<pattern>logType=acs_to_wms</pattern>
|
||||
</label>
|
||||
<message>
|
||||
<pattern>${log.pattern}</pattern>
|
||||
</message>
|
||||
<sortByTime>true</sortByTime>
|
||||
</format>
|
||||
<property name="LOG_HOME" value="${logPath}"/>
|
||||
<!-- 按照每天生成日志文件 -->
|
||||
<appender name="FILE12" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
||||
<!--日志文件输出的文件名-->
|
||||
<FileNamePattern>${LOG_HOME}/ACS请求WMS/%d{yyyy-MM-dd}.%i.log</FileNamePattern>
|
||||
<!--日志文件保留天数-->
|
||||
<maxHistory>15</maxHistory>
|
||||
<!--单个日志最大容量 至少10MB才能看得出来-->
|
||||
<maxFileSize>200MB</maxFileSize>
|
||||
<!--所有日志最多占多大容量-->
|
||||
<totalSizeCap>2GB</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
||||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
|
||||
<charset>${log.charset}</charset>
|
||||
</encoder>
|
||||
|
||||
</appender>
|
||||
|
||||
<!-- <logger name="org.nl.start.Init" level="info" additivity="false">
|
||||
<appender-ref ref="FILE3"/>
|
||||
</logger>-->
|
||||
|
||||
<!-- 打印sql -->
|
||||
<logger name="org.nl.acs.ext.wms.service.impl.AcsToWmsServiceImpl" level="info" additivity="false">
|
||||
<appender-ref ref="lokiAppender" />
|
||||
<appender-ref ref="FILE12"/>
|
||||
</logger>
|
||||
</included>
|
||||
|
||||
Reference in New Issue
Block a user