This commit is contained in:
loujf
2022-12-29 15:38:54 +08:00
parent e9abf08ab4
commit 789a2878de
6 changed files with 80 additions and 49 deletions

View File

@@ -126,6 +126,11 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
private Date instruction_require_time = new Date(); private Date instruction_require_time = new Date();
private Date instruction_finished_time = new Date(); private Date instruction_finished_time = new Date();
private Date instruction_apply_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; private int instruction_require_time_out = 3000;
@Override @Override
@@ -349,9 +354,12 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
instruction_require2(); 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); // 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(); instruction_require();
} else {
System.out.println("111");
} }
break; break;
case 3: case 3:
@@ -400,11 +408,11 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
//申请前工位任务 //申请前工位任务
public synchronized boolean instruction_require() throws Exception { public synchronized boolean instruction_require() throws Exception {
Date date = new Date(); 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); log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out);
return false; return false;
} else { } else {
this.instruction_apply_time = date; this.instruction_apply_time2 = date;
String linkobj = (String) this.getDevice().getExtraValue().get("get_device_code1"); String linkobj = (String) this.getDevice().getExtraValue().get("get_device_code1");
String demosub = linkobj.substring(1, linkobj.length() - 1); String demosub = linkobj.substring(1, linkobj.length() - 1);
String demoArray[] = demosub.split(","); String demoArray[] = demosub.split(",");
@@ -557,7 +565,11 @@ public class LnshRGVDeviceDriver extends AbstractOpcDeviceDriver implements Devi
} else { } 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; return true;

View File

@@ -699,7 +699,7 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im
json.put("device_code",this.device_code); json.put("device_code",this.device_code);
json.put("material_code",material); json.put("material_code",material);
json.put("qty",qty); json.put("qty",qty);
json.put("type","3"); json.put("type","2");
enterProduction(json); enterProduction(json);
} }
break; break;

View File

@@ -758,7 +758,7 @@ public class RljnPackagePalletSplitManipulatorDeviceDriver extends AbstractOpcDe
json.put("device_code",this.device_code); json.put("device_code",this.device_code);
json.put("material_code",material); json.put("material_code",material);
json.put("qty",qty); json.put("qty",qty);
json.put("type","3"); json.put("type","2");
enterProduction(json); enterProduction(json);
} }
break; break;

View File

@@ -177,7 +177,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
switch (type) { switch (type) {
case 0: case 0:
if (phase == 0x01) { if (phase == 0x01) {
data = AgvService.sendAgvOneModeInst(phase, index); // data = AgvService.sendAgvOneModeInst(phase, index);
if (!ObjectUtil.isEmpty(inst)) { if (!ObjectUtil.isEmpty(inst)) {
inst.setInstruction_status("1"); inst.setInstruction_status("1");
inst.setAgv_jobno(String.valueOf(index)); inst.setAgv_jobno(String.valueOf(index));
@@ -219,14 +219,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//嘉耐缓存货架 //嘉耐缓存货架
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) { if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver(); lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
if (lnshLaminatingMachineDeviceDriver.getMove() != 0) { // if (lnshLaminatingMachineDeviceDriver.getMove() != 0) {
inst.setExecute_status("1"); // inst.setExecute_status("1");
instructionService.update(inst); // instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0); // data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true; // flag = true;
} else { // } else {
logServer.deviceExecuteLog("ndc","","", "AGV请求取货设备{}无货,无法反馈"); // logServer.deviceExecuteLog("ndc","","", "AGV请求取货设备{}无货,无法反馈");
} // }
inst.setExecute_status("1");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
} }
//嘉耐工位模板 //嘉耐工位模板
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) { if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
@@ -314,14 +318,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//嘉耐缓存货架 //嘉耐缓存货架
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) { if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver(); lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
if (lnshLaminatingMachineDeviceDriver.getMove() == 0) { // if (lnshLaminatingMachineDeviceDriver.getMove() == 0) {
inst.setExecute_status("5"); // inst.setExecute_status("5");
instructionService.update(inst); // instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0); // data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true; // flag = true;
} else { // } else {
logServer.deviceExecuteLog("ndc","","","AGV取货完成请求离开设备{}有货,无法反馈"); // logServer.deviceExecuteLog("ndc","","","AGV取货完成请求离开设备{}有货,无法反馈");
} // }
inst.setExecute_status("5");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
} }
//嘉耐工位模板 //嘉耐工位模板
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) { if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
@@ -432,14 +440,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//嘉耐缓存货架 //嘉耐缓存货架
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) { if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver(); lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
if (lnshLaminatingMachineDeviceDriver.getMove() == 0) { // if (lnshLaminatingMachineDeviceDriver.getMove() == 0) {
inst.setExecute_status("3"); // inst.setExecute_status("3");
instructionService.update(inst); // instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0); // data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true; // flag = true;
} else { // } else {
logServer.deviceExecuteLog("ndc","","","AGV请求放货设备{}有货,无法反馈"); // logServer.deviceExecuteLog("ndc","","","AGV请求放货设备{}有货,无法反馈");
} // }
inst.setExecute_status("3");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
} }
//嘉耐工位模板 //嘉耐工位模板
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) { if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {
@@ -509,14 +521,18 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
//嘉耐缓存货架 //嘉耐缓存货架
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) { if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver(); lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
if (lnshLaminatingMachineDeviceDriver.getMove() != 0) { // if (lnshLaminatingMachineDeviceDriver.getMove() != 0) {
inst.setExecute_status("6"); // inst.setExecute_status("6");
instructionService.update(inst); // instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0); // data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true; // flag = true;
} else { // } else {
logServer.deviceExecuteLog("ndc","","","AGV放货完成请求离开设备{}无货,无法反馈"); // logServer.deviceExecuteLog("ndc","","","AGV放货完成请求离开设备{}无货,无法反馈");
} // }
inst.setExecute_status("6");
instructionService.update(inst);
data = AgvService.sendAgvOneModeInst(phase, index, 0);
flag = true;
} }
//嘉耐工位模板 //嘉耐工位模板
if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) { if (device.getDeviceDriver() instanceof LnshStationDeviceDriver) {

View File

@@ -75,6 +75,9 @@ public class WmsToJnServiceImpl implements WmsToJnService {
String ITEMCODE = dayScheduleObj.getString("ITEMCODE"); String ITEMCODE = dayScheduleObj.getString("ITEMCODE");
//压机编号 //压机编号
String SBDM = dayScheduleObj.getString("SBDM"); String SBDM = dayScheduleObj.getString("SBDM");
if (StrUtil.isEmpty(SBDM)) {
throw new BadRequestException("压机编号为空!");
}
JSONObject materialObj = material_table.query("material_code ='" + ITEMCODE + "'").uniqueResult(0); JSONObject materialObj = material_table.query("material_code ='" + ITEMCODE + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(materialObj)) { if (ObjectUtil.isEmpty(materialObj)) {
this.synchroMaterial(new JSONObject()); this.synchroMaterial(new JSONObject());

View File

@@ -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)) { if (StrUtil.equals(point_status01, "00") && StrUtil.equals(point_status02, "00") && ObjectUtil.isEmpty(task1) && ObjectUtil.isEmpty(task2)) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
jo.put("device_code", "FJJXS1"); // jo.put("device_code", "FJJXS1");
jo.put("code", "to_feedback"); // jo.put("code", "to_feedback");
jo.put("value", "10"); // jo.put("value", "10");
arr.add(jo); // arr.add(jo);
wmsToAcsService.action(arr); // wmsToAcsService.action(arr);
} }
} }
if (StrUtil.equals(next_point_code, "FJJXSSLW301") || StrUtil.equals(next_point_code, "FJJXSSLW301")) { 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")) { if (StrUtil.equals(point_status01, "00") && StrUtil.equals(point_status02, "00")) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
jo.put("device_code", "FJJXS3"); // jo.put("device_code", "FJJXS3");
jo.put("code", "to_feedback"); // jo.put("code", "to_feedback");
jo.put("value", "10"); // jo.put("value", "10");
arr.add(jo); // arr.add(jo);
wmsToAcsService.action(arr); // wmsToAcsService.action(arr);
} }
} }