fix: 西门子输送线横移修复
This commit is contained in:
@@ -309,7 +309,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
logServer.deviceItemValue(this.device_code, "task", String.valueOf(task));
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||||
if ("true".equals(this.device.getExtraValue().get("task_update"))) {
|
if ("true".equals(this.device.getExtraValue().get("task_update"))) {
|
||||||
|
|
||||||
taskDeviceUpdate(task);
|
taskDeviceUpdate(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -461,20 +460,18 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void taskDeviceUpdate(int task) {
|
private void taskDeviceUpdate(int task) {
|
||||||
Instruction inst = instructionService.findByTaskcode(String.valueOf(task));
|
Instruction inst = instructionService.findByInsructionCode(String.valueOf(task));
|
||||||
|
|
||||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||||
|
|
||||||
applyManipulatorActionRequest.setDevice_code(device_code);
|
applyManipulatorActionRequest.setDevice_code(device_code);
|
||||||
applyManipulatorActionRequest.setAction("3");
|
applyManipulatorActionRequest.setAction("3");
|
||||||
if (ObjectUtil.isNotEmpty(inst) && StrUtil.isNotEmpty(inst.getTask_code())) {
|
if (ObjectUtil.isEmpty(inst)) {
|
||||||
applyManipulatorActionRequest.setTask_code1(inst.getTask_code());
|
logServer.deviceExecuteLog(this.device_code, "", "", "任务号不存在:" + inst);
|
||||||
}else {
|
return;
|
||||||
message = "task变化未找到指令";
|
|
||||||
}
|
}
|
||||||
|
applyManipulatorActionRequest.setTask_code1(inst.getTask_code());
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest);
|
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest);
|
||||||
try {
|
try {
|
||||||
ApplyManipulatorActionResponse response = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
|
ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||||
if (response == null || response.getstatus() == 200) {
|
if (response == null || response.getstatus() == 200) {
|
||||||
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage());
|
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,13 @@ public interface InstructionService {
|
|||||||
*/
|
*/
|
||||||
Instruction findByTaskcode(String code);
|
Instruction findByTaskcode(String code);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据指令号查询
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
Instruction findByInsructionCode(String code);
|
||||||
|
|
||||||
Instruction findByTaskcodeAndStatus(String code);
|
Instruction findByTaskcodeAndStatus(String code);
|
||||||
|
|
||||||
Instruction findByTaskcodeAndStatus(String code,String status);
|
Instruction findByTaskcodeAndStatus(String code,String status);
|
||||||
|
|||||||
@@ -258,6 +258,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Instruction findByInsructionCode(String code) {
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||||
|
JSONObject json = wo.query("instruction_code ='" + code + "'","create_time desc").uniqueResult(0);
|
||||||
|
final Instruction obj = json.toJavaObject(Instruction.class);
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Instruction findByTaskcodeAndStatus(String code) {
|
public Instruction findByTaskcodeAndStatus(String code) {
|
||||||
Iterator var3 = instructions.iterator();
|
Iterator var3 = instructions.iterator();
|
||||||
|
|||||||
Reference in New Issue
Block a user