更新
This commit is contained in:
@@ -306,7 +306,10 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
RljnPackagePalletSplitManipulatorDeviceDriver rljnPackagePalletSplitManipulatorDeviceDriver;
|
RljnPackagePalletSplitManipulatorDeviceDriver rljnPackagePalletSplitManipulatorDeviceDriver;
|
||||||
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) {
|
||||||
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
|
lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (lnshPalletizingManipulatorSiteDeviceDriver.getIserror()) {
|
if (lnshPalletizingManipulatorSiteDeviceDriver.getIserror()
|
||||||
|
&& !device_code.equals("MDJXS601")
|
||||||
|
&& !device_code.equals("MDJXS201")
|
||||||
|
&& !device_code.equals("MDJXS301")) {
|
||||||
throw new BadRequestException("设备状态异常,下发失败!");
|
throw new BadRequestException("设备状态异常,下发失败!");
|
||||||
}
|
}
|
||||||
if (StrUtil.isEmpty(qty)) {
|
if (StrUtil.isEmpty(qty)) {
|
||||||
@@ -418,6 +421,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService {
|
|||||||
return resultJson;
|
return resultJson;
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
log.info("createOrder--------------:设备信号异常,下发失败!");
|
||||||
MDC.remove(log_file_type);
|
MDC.remove(log_file_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -171,6 +171,13 @@ public interface InstructionService {
|
|||||||
*/
|
*/
|
||||||
void cancel(String id) throws Exception;
|
void cancel(String id) throws Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 嘉耐取消指令
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
void jnCancel(String id) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 取消指令不下发agv
|
* 取消指令不下发agv
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -824,6 +824,94 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void jnCancel(String id) throws Exception {
|
||||||
|
//flag= true时取消指令
|
||||||
|
boolean flag = false;
|
||||||
|
Instruction entity = this.findById(id);
|
||||||
|
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
TaskDto task = taskService.findByCodeFromCache(entity.getTask_code());
|
||||||
|
if (StrUtil.isEmpty(entity.getRoute_plan_code())) {
|
||||||
|
entity.setRoute_plan_code(task.getRoute_plan_code());
|
||||||
|
}
|
||||||
|
|
||||||
|
List<RouteLineDto> shortPathsList = routeLineService.getShortPathLines(entity.getStart_device_code(), entity.getNext_device_code(), entity.getRoute_plan_code());
|
||||||
|
String type = shortPathsList.get(0).getType();
|
||||||
|
// != 0 为agv任务 1=magic 2=NDC 3=XZ
|
||||||
|
if (!StrUtil.equals(type, "0")) {
|
||||||
|
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "1")
|
||||||
|
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||||
|
MagicAgvServiceImpl magicAgvService = SpringContextHolder.getBean(MagicAgvServiceImpl.class);
|
||||||
|
magicAgvService.deleteAgvInst(entity.getInstruction_code());
|
||||||
|
flag = true;
|
||||||
|
|
||||||
|
} else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "2")) {
|
||||||
|
//NDC agv指令不当场取消指令,需要等agv上报
|
||||||
|
if (!StrUtil.isEmpty(entity.getAgv_jobno())) {
|
||||||
|
NDCAgvServiceImpl ndcAgv = SpringContextHolder.getBean(NDCAgvServiceImpl.class);
|
||||||
|
ndcAgv.deleteAgvInstToNDC(entity);
|
||||||
|
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
} else if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.AGVTYPE).toString(), "3")
|
||||||
|
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||||
|
XianGongAgvServiceImpl xianGongAgvService = SpringContextHolder.getBean(XianGongAgvServiceImpl.class);
|
||||||
|
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
||||||
|
flag = true;
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||||
|
String now = DateUtil.now();
|
||||||
|
entity.setUpdate_time(now);
|
||||||
|
entity.setUpdate_by(currentUsername);
|
||||||
|
entity.setInstruction_status("3");
|
||||||
|
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||||
|
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||||
|
wo.update(json);
|
||||||
|
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||||
|
DeviceService deviceService = SpringContextHolder.getBean(DeviceServiceImpl.class);
|
||||||
|
|
||||||
|
// 如果是无光电的设备 指令完成变更起点、终点状态
|
||||||
|
JSONObject jo = new JSONObject();
|
||||||
|
jo.put("device_code", entity.getStart_device_code());
|
||||||
|
if (StrUtil.equals(entity.getMaterial(), "1")) {
|
||||||
|
jo.put("hasGoodStatus", "1");
|
||||||
|
} else if (!StrUtil.equals(entity.getMaterial(), "1") && !StrUtil.isEmpty(entity.getMaterial())) {
|
||||||
|
jo.put("hasGoodStatus", "2");
|
||||||
|
} else {
|
||||||
|
jo.put("hasGoodStatus", "0");
|
||||||
|
}
|
||||||
|
jo.put("material_type", entity.getMaterial());
|
||||||
|
jo.put("batch", entity.getBatch());
|
||||||
|
jo.put("islock", "false");
|
||||||
|
deviceService.changeDeviceStatus(jo);
|
||||||
|
|
||||||
|
JSONObject jo1 = new JSONObject();
|
||||||
|
jo1.put("device_code", entity.getNext_device_code());
|
||||||
|
jo.put("hasGoodStatus", "0");
|
||||||
|
jo.put("material_type", "");
|
||||||
|
jo.put("batch", "");
|
||||||
|
jo1.put("islock", "false");
|
||||||
|
deviceService.changeDeviceStatus(jo1);
|
||||||
|
|
||||||
|
String instnextdevice = entity.getNext_device_code();
|
||||||
|
Device device = appService.findDeviceByCode(instnextdevice);
|
||||||
|
if (device == null) {
|
||||||
|
log.debug("地址对应设备未找到");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
removeByCodeFromCache(entity.getInstruction_code());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancelNOSendAgv(String id) throws Exception {
|
public void cancelNOSendAgv(String id) throws Exception {
|
||||||
//flag= true时取消指令
|
//flag= true时取消指令
|
||||||
|
|||||||
@@ -563,7 +563,7 @@ public class JnHandServiceImpl implements JnHandService {
|
|||||||
if (StrUtil.isEmpty(instdto.getAgv_jobno())) {
|
if (StrUtil.isEmpty(instdto.getAgv_jobno())) {
|
||||||
instructionService.cancelNOSendAgv(inst_uuid);
|
instructionService.cancelNOSendAgv(inst_uuid);
|
||||||
} else {
|
} else {
|
||||||
agvService.deleteAgvInst(instdto.getInstruction_code());
|
instructionService.cancel(instdto.getInstruction_id());
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -198,6 +198,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device_code.equals("MDJXS201") || device_code.equals("MDJXS301") || device_code.equals("MDJXS601")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
//检测站点
|
//检测站点
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -290,6 +294,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device_code.equals("MDJXS201") || device_code.equals("MDJXS301") || device_code.equals("MDJXS601")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (standardInspectSiteDeviceDriver.getMove() == 0) {
|
if (standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||||
@@ -375,7 +383,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
logServer.deviceExecuteLog("ndc","","","phase==0x06," + "指令号:" + ikey + ",address:" + device_code);
|
logServer.deviceExecuteLog("ndc","","","phase==0x06," + "指令号:" + ikey + ",address:" + device.getDevice_code());
|
||||||
//检测站点
|
//检测站点
|
||||||
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
if (device.getDeviceDriver() instanceof LnshLaminatingMachineDeviceDriver) {
|
||||||
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
|
lnshLaminatingMachineDeviceDriver = (LnshLaminatingMachineDeviceDriver) device.getDeviceDriver();
|
||||||
@@ -393,6 +401,7 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
//如果组盘绑定条码成功,就允许agv离开
|
//如果组盘绑定条码成功,就允许agv离开
|
||||||
if (lnshLaminatingMachineDeviceDriver.getMode() == 6 && lnshLaminatingMachineDeviceDriver.getResult()) {
|
if (lnshLaminatingMachineDeviceDriver.getMode() == 6 && lnshLaminatingMachineDeviceDriver.getResult()) {
|
||||||
lnshLaminatingMachineDeviceDriver.writing(6);
|
lnshLaminatingMachineDeviceDriver.writing(6);
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
flag = true;
|
flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -403,6 +412,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device_code.equals("MDJXS201") || device_code.equals("MDJXS301") || device_code.equals("MDJXS601")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (standardInspectSiteDeviceDriver.getMove() == 0) {
|
if (standardInspectSiteDeviceDriver.getMove() == 0) {
|
||||||
@@ -476,6 +489,10 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
logServer.deviceExecuteLog("ndc", "","","未找到指令号对应的指令:" + ikey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (device_code.equals("MDJXS201") || device_code.equals("MDJXS301") || device_code.equals("MDJXS601")) {
|
||||||
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) {
|
||||||
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver();
|
||||||
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
if (standardInspectSiteDeviceDriver.getMove() != 0) {
|
||||||
@@ -571,19 +588,21 @@ public class NDCSocketConnectionAutoRun extends AbstractAutoRunnable {
|
|||||||
//请求删除任务
|
//请求删除任务
|
||||||
else if (phase == 0x30) {
|
else if (phase == 0x30) {
|
||||||
flag = true;
|
flag = true;
|
||||||
if (!ObjectUtil.isEmpty(inst)) {
|
// if (!ObjectUtil.isEmpty(inst)) {
|
||||||
data = AgvService.sendAgvOneModeInst(0x8F, index, 0);
|
// data = AgvService.sendAgvOneModeInst(0x8F, index, 0);
|
||||||
} else {
|
// } else {
|
||||||
log.info("未找到对应的指令无法删除");
|
// log.info("未找到对应的指令无法删除");
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
|
data = AgvService.sendAgvOneModeInst(0x8F, index, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
//任务删除确认
|
//任务删除确认
|
||||||
//(需要WCS反馈)
|
//(需要WCS反馈)
|
||||||
else if (phase == 0xFF) {
|
else if (phase == 0xFF) {
|
||||||
flag = true;
|
flag = true;
|
||||||
if (!ObjectUtil.isEmpty(inst)) {
|
if (!ObjectUtil.isEmpty(inst)) {
|
||||||
instructionService.cancel(inst.getInstruction_id());
|
instructionService.jnCancel(inst.getInstruction_id());
|
||||||
}
|
}
|
||||||
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
data = AgvService.sendAgvOneModeInst(phase, index, 0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,7 +321,11 @@ public class ProducetaskServiceImpl implements ProducetaskService {
|
|||||||
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
WmsToAcsService wmsToAcsService = SpringContextHolder.getBean(WmsToAcsService.class);
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
arr.add(taskObj);
|
arr.add(taskObj);
|
||||||
wmsToAcsService.sendProduceTask(arr);
|
Map<String, Object> result = wmsToAcsService.sendProduceTask(arr);
|
||||||
|
if (result.get("status").toString().equals("400")) {
|
||||||
|
String message = result.get("message").toString();
|
||||||
|
throw new BadRequestException(message);
|
||||||
|
}
|
||||||
JSONObject map = new JSONObject();
|
JSONObject map = new JSONObject();
|
||||||
String producetask_status = "02";
|
String producetask_status = "02";
|
||||||
if (StrUtil.equals(device_id, "1560189462410039296")) {
|
if (StrUtil.equals(device_id, "1560189462410039296")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user