更新
This commit is contained in:
@@ -652,17 +652,17 @@ public class MagicAgvServiceImpl implements MagicAgvService {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() != 0) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
lnshLaminatingMachineDeviceDriver.writing(1);
|
||||
}
|
||||
//如果组盘绑定条码成功,就允许agv离开
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() == 6 && lnshLaminatingMachineDeviceDriver.getResult()) {
|
||||
is_feedback = true;
|
||||
}
|
||||
} else if ("NOP".equals(action)) {
|
||||
if (lnshLaminatingMachineDeviceDriver.getMode() != 0 && lnshLaminatingMachineDeviceDriver.getMode() != 6) {
|
||||
inst.setExecute_device_code(address);
|
||||
inst.setExecute_status("4");
|
||||
lnshLaminatingMachineDeviceDriver.writing(3,Integer.parseInt(inst.getInstruction_code()));
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
lnshLaminatingMachineDeviceDriver.writing(1);
|
||||
}
|
||||
//如果组盘绑定条码成功,就允许agv离开
|
||||
|
||||
@@ -908,7 +908,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD
|
||||
String demoArray[] = demosub.split(",");
|
||||
List<String> demoList = Arrays.asList(demoArray);
|
||||
json.put("device_code",demoList.get(put_station-1).replace("\"",""));
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
// json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
HttpResponse result = acsToWmsService.queryCribbingInfo(json);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
|
||||
@@ -188,19 +188,19 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
logServer.deviceExecuteLog(this.device_code,"","","信号specifications:" + last_specifications + "->" + specifications);
|
||||
}
|
||||
|
||||
if (mode == 2 && move != 0 && task > 0) {
|
||||
//inst_message
|
||||
inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
if (inst != null) {
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
finish_instruction();
|
||||
}
|
||||
if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||
inst.setInstruction_status("1");
|
||||
instructionService.update(inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
// if (mode == 2 && move != 0 && task > 0) {
|
||||
// //inst_message
|
||||
// inst = instructionService.findByCodeFromCache(String.valueOf(task));
|
||||
// if (inst != null) {
|
||||
// if (StrUtil.equals(inst.getInstruction_status(), "1") && StrUtil.equals(this.getDeviceCode(), inst.getNext_device_code())) {
|
||||
// finish_instruction();
|
||||
// }
|
||||
// if (StrUtil.equals(inst.getInstruction_status(), "0") && StrUtil.equals(this.getDeviceCode(), inst.getStart_device_code())) {
|
||||
// inst.setInstruction_status("1");
|
||||
// instructionService.update(inst);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
} catch (Exception var17) {
|
||||
return;
|
||||
@@ -567,7 +567,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
json.put("type","2");
|
||||
json.put("is_full","1");
|
||||
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(result.body());
|
||||
if (result.getStatus() == 200 && StrUtil.equals(jsonObject.getString("status"),"200")) {
|
||||
@@ -625,7 +625,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("type",type);
|
||||
// json.put("material",material);
|
||||
// json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
json.put("vehicle_code",this.autoGenericCode(String.valueOf(barcode)));
|
||||
// json.put("is_full","1");
|
||||
HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json);
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
|
||||
@@ -11,10 +11,12 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.agv.server.MagicAgvService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.slf4j.MDC;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* 查询AGV任务状态
|
||||
@@ -28,9 +30,13 @@ public class QueryMagicAgvTaskStatus {
|
||||
@Autowired
|
||||
MagicAgvService magicAgvService;
|
||||
|
||||
private String log_file_type = "log_file_type";
|
||||
private String log_type = "agv接口日志";
|
||||
|
||||
public void run() throws Exception {
|
||||
|
||||
List<Instruction> instList = instructionService.findAllInstFromCache();
|
||||
MDC.put(log_file_type, log_type);
|
||||
if (instList.size() > 0) {
|
||||
for (int i = 0; i < instList.size(); i++) {
|
||||
Instruction inst = instList.get(i);
|
||||
@@ -67,6 +73,7 @@ public class QueryMagicAgvTaskStatus {
|
||||
instructionService.update(inst);
|
||||
}
|
||||
} else if ("FINISHED".equals(state)) {
|
||||
log.info("agv指令状态:{}",state);
|
||||
if (inst != null) {
|
||||
inst.setInstruction_status("2");
|
||||
instructionService.finish(inst);
|
||||
|
||||
Reference in New Issue
Block a user