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.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task);
|
||||
if ("true".equals(this.device.getExtraValue().get("task_update"))) {
|
||||
|
||||
taskDeviceUpdate(task);
|
||||
}
|
||||
}
|
||||
@@ -461,20 +460,18 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
|
||||
}
|
||||
|
||||
private void taskDeviceUpdate(int task) {
|
||||
Instruction inst = instructionService.findByTaskcode(String.valueOf(task));
|
||||
|
||||
Instruction inst = instructionService.findByInsructionCode(String.valueOf(task));
|
||||
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
|
||||
|
||||
applyManipulatorActionRequest.setDevice_code(device_code);
|
||||
applyManipulatorActionRequest.setAction("3");
|
||||
if (ObjectUtil.isNotEmpty(inst) && StrUtil.isNotEmpty(inst.getTask_code())) {
|
||||
applyManipulatorActionRequest.setTask_code1(inst.getTask_code());
|
||||
}else {
|
||||
message = "task变化未找到指令";
|
||||
if (ObjectUtil.isEmpty(inst)) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "任务号不存在:" + inst);
|
||||
return;
|
||||
}
|
||||
applyManipulatorActionRequest.setTask_code1(inst.getTask_code());
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest);
|
||||
try {
|
||||
ApplyManipulatorActionResponse response = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
|
||||
ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
|
||||
if (response == null || response.getstatus() == 200) {
|
||||
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage());
|
||||
}
|
||||
|
||||
@@ -86,6 +86,13 @@ public interface InstructionService {
|
||||
*/
|
||||
Instruction findByTaskcode(String code);
|
||||
|
||||
/**
|
||||
* 根据指令号查询
|
||||
* @param code
|
||||
* @return
|
||||
*/
|
||||
Instruction findByInsructionCode(String code);
|
||||
|
||||
Instruction findByTaskcodeAndStatus(String code);
|
||||
|
||||
Instruction findByTaskcodeAndStatus(String code,String status);
|
||||
|
||||
@@ -258,6 +258,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
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
|
||||
public Instruction findByTaskcodeAndStatus(String code) {
|
||||
Iterator var3 = instructions.iterator();
|
||||
|
||||
Reference in New Issue
Block a user