更新
This commit is contained in:
@@ -126,6 +126,11 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
private Date instruction_require_time = new Date();
|
||||
private Date instruction_finished_time = new Date();
|
||||
private Date instruction_apply_time = new Date();
|
||||
|
||||
private Date instruction_require_time2 = new Date();
|
||||
private Date instruction_finished_time2 = new Date();
|
||||
private Date instruction_apply_time2 = new Date();
|
||||
|
||||
private int instruction_require_time_out = 3000;
|
||||
|
||||
@Override
|
||||
@@ -349,9 +354,12 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
instruction_require2();
|
||||
}
|
||||
//前工位申请任务
|
||||
if (mode == 2 && move_2 == 0 && action_2 == 0 && move_1 == 0 && task2 == 0 && !requireSucess1) {
|
||||
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:
|
||||
@@ -400,11 +408,11 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
|
||||
//申请前工位任务
|
||||
public synchronized boolean instruction_require() throws Exception {
|
||||
Date date = new Date();
|
||||
if (date.getTime() - this.instruction_apply_time.getTime() < (long) this.instruction_require_time_out) {
|
||||
if (date.getTime() - this.instruction_apply_time2.getTime() < (long) this.instruction_require_time_out) {
|
||||
log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
|
||||
return false;
|
||||
} else {
|
||||
this.instruction_apply_time = date;
|
||||
this.instruction_apply_time2 = date;
|
||||
String linkobj = (String) this.getDevice().getExtraValue().get("get_device_code1");
|
||||
String demosub = linkobj.substring(1, linkobj.length() - 1);
|
||||
String demoArray[] = demosub.split(",");
|
||||
@@ -557,7 +565,11 @@ 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -699,7 +699,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("material_code",material);
|
||||
json.put("qty",qty);
|
||||
json.put("type","3");
|
||||
json.put("type","2");
|
||||
enterProduction(json);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -758,7 +758,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
|
||||
json.put("device_code",this.device_code);
|
||||
json.put("material_code",material);
|
||||
json.put("qty",qty);
|
||||
json.put("type","3");
|
||||
json.put("type","2");
|
||||
enterProduction(json);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -177,7 +177,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
switch (type) {
|
||||
case 0:
|
||||
if (phase == 0x01) {
|
||||
data = AgvService.sendAgvOneModeInst(phase, index);
|
||||
// data = AgvService.sendAgvOneModeInst(phase, index);
|
||||
if (!ObjectUtil.isEmpty(inst)) {
|
||||
inst.setInstruction_status("1");
|
||||
inst.setAgv_jobno(String.valueOf(index));
|
||||
@@ -219,14 +219,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
//嘉耐缓存货架
|
||||
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (lnshLaminatingMachineDeviceDriver.getMove() != 0) {
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
} else {
|
||||
logServer.deviceExecuteLog("ndc","","", "AGV请求取货设备{}无货,无法反馈");
|
||||
}
|
||||
// if (lnshLaminatingMachineDeviceDriver.getMove() != 0) {
|
||||
// inst.setExecute_status("1");
|
||||
// instructionService.update(inst);
|
||||
// data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// flag = true;
|
||||
// } else {
|
||||
// logServer.deviceExecuteLog("ndc","","", "AGV请求取货设备{}无货,无法反馈");
|
||||
// }
|
||||
inst.setExecute_status("1");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
}
|
||||
//嘉耐工位模板
|
||||
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
|
||||
@@ -314,14 +318,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
//嘉耐缓存货架
|
||||
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("5");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
} else {
|
||||
logServer.deviceExecuteLog("ndc","","","AGV取货完成请求离开设备{}有货,无法反馈");
|
||||
}
|
||||
// if (lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
// inst.setExecute_status("5");
|
||||
// instructionService.update(inst);
|
||||
// data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// flag = true;
|
||||
// } else {
|
||||
// logServer.deviceExecuteLog("ndc","","","AGV取货完成请求离开设备{}有货,无法反馈");
|
||||
// }
|
||||
inst.setExecute_status("5");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
}
|
||||
//嘉耐工位模板
|
||||
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
|
||||
@@ -432,14 +440,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
//嘉耐缓存货架
|
||||
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
inst.setExecute_status("3");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
} else {
|
||||
logServer.deviceExecuteLog("ndc","","","AGV请求放货设备{}有货,无法反馈");
|
||||
}
|
||||
// if (lnshLaminatingMachineDeviceDriver.getMove() == 0) {
|
||||
// inst.setExecute_status("3");
|
||||
// instructionService.update(inst);
|
||||
// data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// flag = true;
|
||||
// } else {
|
||||
// logServer.deviceExecuteLog("ndc","","","AGV请求放货设备{}有货,无法反馈");
|
||||
// }
|
||||
inst.setExecute_status("3");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
}
|
||||
//嘉耐工位模板
|
||||
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
|
||||
@@ -509,14 +521,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
||||
//嘉耐缓存货架
|
||||
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
|
||||
if (lnshLaminatingMachineDeviceDriver.getMove() != 0) {
|
||||
inst.setExecute_status("6");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
} else {
|
||||
logServer.deviceExecuteLog("ndc","","","AGV放货完成请求离开设备{}无货,无法反馈");
|
||||
}
|
||||
// if (lnshLaminatingMachineDeviceDriver.getMove() != 0) {
|
||||
// inst.setExecute_status("6");
|
||||
// instructionService.update(inst);
|
||||
// data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
// flag = true;
|
||||
// } else {
|
||||
// logServer.deviceExecuteLog("ndc","","","AGV放货完成请求离开设备{}无货,无法反馈");
|
||||
// }
|
||||
inst.setExecute_status("6");
|
||||
instructionService.update(inst);
|
||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||
flag = true;
|
||||
}
|
||||
//嘉耐工位模板
|
||||
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
|
||||
|
||||
@@ -75,6 +75,9 @@ public class WmsToJnServiceImpl implements WmsToJnService {
|
||||
String ITEMCODE = dayScheduleObj.getString("ITEMCODE");
|
||||
//压机编号
|
||||
String SBDM = dayScheduleObj.getString("SBDM");
|
||||
if (StrUtil.isEmpty(SBDM)) {
|
||||
throw new BadRequestException("压机编号为空!");
|
||||
}
|
||||
JSONObject materialObj = material_table.query("material_code ='" + ITEMCODE + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(materialObj)) {
|
||||
this.synchroMaterial(new JSONObject());
|
||||
|
||||
@@ -340,11 +340,11 @@ public class CallMaterialTask extends AbstractAcsTask {
|
||||
if (StrUtil.equals(point_status01, "00") && StrUtil.equals(point_status02, "00") && ObjectUtil.isEmpty(task1) && ObjectUtil.isEmpty(task2)) {
|
||||
JSONObject jo = new JSONObject();
|
||||
JSONArray arr = new JSONArray();
|
||||
jo.put("device_code", "FJJXS1");
|
||||
jo.put("code", "to_feedback");
|
||||
jo.put("value", "10");
|
||||
arr.add(jo);
|
||||
wmsToAcsService.action(arr);
|
||||
// jo.put("device_code", "FJJXS1");
|
||||
// jo.put("code", "to_feedback");
|
||||
// jo.put("value", "10");
|
||||
// arr.add(jo);
|
||||
// wmsToAcsService.action(arr);
|
||||
}
|
||||
}
|
||||
if (StrUtil.equals(next_point_code, "FJJXSSLW301") || StrUtil.equals(next_point_code, "FJJXSSLW301")) {
|
||||
@@ -353,11 +353,11 @@ public class CallMaterialTask extends AbstractAcsTask {
|
||||
if (StrUtil.equals(point_status01, "00") && StrUtil.equals(point_status02, "00")) {
|
||||
JSONObject jo = new JSONObject();
|
||||
JSONArray arr = new JSONArray();
|
||||
jo.put("device_code", "FJJXS3");
|
||||
jo.put("code", "to_feedback");
|
||||
jo.put("value", "10");
|
||||
arr.add(jo);
|
||||
wmsToAcsService.action(arr);
|
||||
// jo.put("device_code", "FJJXS3");
|
||||
// jo.put("code", "to_feedback");
|
||||
// jo.put("value", "10");
|
||||
// arr.add(jo);
|
||||
// wmsToAcsService.action(arr);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user