diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 4008e9b..38d45d2 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.config.server.AcsConfigService; +import org.nl.acs.device.device_driver.standard_inspect.ItemDto; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.*; import org.nl.acs.device.service.dto.*; @@ -1171,8 +1172,9 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial //根据设备驱动定义获取OPC读写数据 DeviceDriverDefination deviceDriverDefination = deviceDriverDefinationAppService.getDeviceDriverDefination(driver_code); + OpcDeviceDriverDefination opcDeviceDriverDefination = null; if (deviceDriverDefination instanceof OpcDeviceDriverDefination) { - OpcDeviceDriverDefination opcDeviceDriverDefination = (OpcDeviceDriverDefination) deviceDriverDefination; + opcDeviceDriverDefination = (OpcDeviceDriverDefination) deviceDriverDefination; //处理DB读和写属性 result.put("rs", opcDeviceDriverDefination.getReadableItemDtos()); result.put("ws", opcDeviceDriverDefination.getWriteableItemDtos()); @@ -1190,24 +1192,12 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial extraObj.put(json.getString("extra_code"), json.get("extra_value")); } } - extraObj.put("address", dto.getAddress()); - JSONArray get_device_code = extraObj.getJSONArray("get_device_code"); - JSONArray load_device_code = extraObj.getJSONArray("load_device_code"); - JSONArray put_device_code = extraObj.getJSONArray("put_device_code"); - if (ObjectUtil.isNotEmpty(get_device_code)) { - extraObj.put("get_device_code",get_device_code); - } - if (ObjectUtil.isNotEmpty(load_device_code)) { - extraObj.put("load_device_code",load_device_code); - } - if (ObjectUtil.isNotEmpty(put_device_code)) { - extraObj.put("put_device_code",put_device_code); - } + extraObj.put("address", dto.getAddress()); result.put("form", extraObj); - JSONObject json = (JSONObject) JSONObject.toJSON(dto); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); String opc_id = dto.getOpc_server_id(); @@ -1237,35 +1227,111 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial //设备扩展表【acs_device_extra】 JSONArray rs = WQLObject.getWQLObject("acs_device_extra").query("filed_type='02' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0); JSONArray r_arry = new JSONArray(); - for (int i = 0; i < rs.size(); i++) { - JSONObject robj = new JSONObject(); - robj.put("code", rs.getJSONObject(i).getString("extra_code")); - robj.put("name", rs.getJSONObject(i).getString("remark")); - robj.put("db", rs.getJSONObject(i).getString("extra_name")); - r_arry.add(robj); + //先获取模板 + if(ObjectUtil.isNotEmpty(opcDeviceDriverDefination)){ + List readableItemDtos = opcDeviceDriverDefination.getReadableItemDtos(); + List readableItemJsons = new ArrayList<>(); + for (int i = 0; i < readableItemDtos.size(); i++) { + ItemDto itemDto = readableItemDtos.get(i); + JSONObject readableItemJson = new JSONObject(); + readableItemJson.put("code",itemDto.getCode()); + readableItemJson.put("name",itemDto.getName()); + // readableItemJson.put("db",itemDto.getDb()); + readableItemJsons.add(readableItemJson); + } + for (int i = 0; i < rs.size(); i++) { + JSONObject robj = new JSONObject(); + String extra_code = rs.getJSONObject(i).getString("extra_code"); + final String[] split = extra_code.split("\\."); + String code = split[split.length - 1]; + robj.put("code", code); + robj.put("name", rs.getJSONObject(i).getString("remark")); + if (readableItemJsons.contains(robj)){ + robj.put("code", rs.getJSONObject(i).getString("extra_code")); + robj.put("db", rs.getJSONObject(i).getString("extra_name")); + r_arry.add(robj); + } + } + List rarry = new ArrayList<>(); + for (int i = 0; i < r_arry.size(); i++) { + JSONObject rJson = r_arry.getJSONObject(i); + String code = rJson.getString("code"); + String[] split = code.split("\\."); + code = split[split.length - 1]; + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code", code); + jsonObject.put("name",rJson.getString("name")); + rarry.add(jsonObject); + } + for (int i = 0; i < readableItemDtos.size(); i++) { + ItemDto itemDto = readableItemDtos.get(i); + JSONObject readableItemJson = new JSONObject(); + readableItemJson.put("code",itemDto.getCode()); + readableItemJson.put("name",itemDto.getName()); + if (!rarry.contains(readableItemJson)){ + readableItemJson.put("db",itemDto.getDb()); + r_arry.add(readableItemJson); + } + } + JSONArray ws = WQLObject.getWQLObject("acs_device_extra").query("filed_type='03' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0); + JSONArray w_arry = new JSONArray(); + List writeableItemDtos = opcDeviceDriverDefination.getWriteableItemDtos(); + List writeableItemJsons = new ArrayList<>(); + for (int i = 0; i < writeableItemDtos.size(); i++) { + ItemDto itemDto = writeableItemDtos.get(i); + JSONObject writeableItemJson = new JSONObject(); + writeableItemJson.put("code",itemDto.getCode()); + writeableItemJson.put("name",itemDto.getName()); + //writeableItemJson.put("db",itemDto.getDb()); + writeableItemJsons.add(writeableItemJson); + } + for (int i = 0; i < ws.size(); i++) { + String extra_code = ws.getJSONObject(i).getString("extra_code"); + final String[] split = extra_code.split("\\."); + String code = split[split.length - 1]; + JSONObject robj = new JSONObject(); + robj.put("code", code); + robj.put("name", ws.getJSONObject(i).getString("remark")); + if (writeableItemJsons.contains(robj)){ + robj.put("code", ws.getJSONObject(i).getString("extra_code")); + robj.put("db", ws.getJSONObject(i).getString("extra_name")); + w_arry.add(robj); + } + } + List warry = new ArrayList<>(); + for (int i = 0; i < w_arry.size(); i++) { + JSONObject wJson = w_arry.getJSONObject(i); + String code = wJson.getString("code"); + String[] split = code.split("\\."); + code = split[split.length - 1]; + JSONObject jsonObject = new JSONObject(); + jsonObject.put("code",code); + jsonObject.put("name",wJson.getString("name")); + warry.add(jsonObject); + } + for (int i = 0; i < writeableItemDtos.size(); i++) { + ItemDto itemDto = writeableItemDtos.get(i); + JSONObject writeableItemJson = new JSONObject(); + writeableItemJson.put("code",itemDto.getCode()); + writeableItemJson.put("name",itemDto.getName()); + if (!warry.contains(writeableItemJson)){ + writeableItemJson.put("db",itemDto.getDb()); + w_arry.add(writeableItemJson); + } + } + if (!r_arry.isEmpty()) { + result.put("rs", r_arry); + } + if (!w_arry.isEmpty()) { + result.put("ws", w_arry); + } } - JSONArray ws = WQLObject.getWQLObject("acs_device_extra").query("filed_type='03' and device_id = '" + device_id + "'", "order_seq").getResultJSONArray(0); - JSONArray w_arry = new JSONArray(); - for (int i = 0; i < ws.size(); i++) { - JSONObject robj = new JSONObject(); - robj.put("code", ws.getJSONObject(i).getString("extra_code")); - robj.put("name", ws.getJSONObject(i).getString("remark")); - robj.put("db", ws.getJSONObject(i).getString("extra_name")); - w_arry.add(robj); - } - - if (!r_arry.isEmpty()) { - result.put("rs", r_arry); - } - if (!w_arry.isEmpty()) { - result.put("ws", w_arry); - } } else { //处理DB读和写属性 - /* result.put("rs", ReadUtil.getReadableItemDtos()); - result.put("ws", ReadUtil.getWriteableItemDtos());*/ +// result.put("rs", ReadUtil.getReadableItemDtos()); +// result.put("ws", ReadUtil.getWriteableItemDtos()); } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java index f98d7a5..1b28567 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_one_rgv/LnshOneRGVDeviceDriver.java @@ -1,9 +1,13 @@ package org.nl.acs.device_driver.lnsh.lnsh_one_rgv; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; @@ -14,15 +18,18 @@ import org.nl.acs.instruction.service.InstructionService; import org.nl.acs.instruction.service.dto.Instruction; import org.nl.acs.log.service.LogServer; import org.nl.acs.opc.Device; +import org.nl.acs.opc.DeviceAppService; +import org.nl.acs.opc.DeviceAppServiceImpl; import org.nl.acs.route.service.RouteLineService; +import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; +import org.nl.acs.task.service.dto.TaskDto; import org.nl.utils.SpringContextHolder; +import org.nl.wql.core.bean.WQLObject; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 嘉耐单工位RGV @@ -42,6 +49,8 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D TaskService taskserver = SpringContextHolder.getBean("taskServiceImpl"); @Autowired LogServer logServer = SpringContextHolder.getBean("logServerImpl"); + @Autowired + DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class); int mode = 0; int error = 0; @@ -82,6 +91,11 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D int qty = 0; int last_qty = 0; + private Date instruction_require_time = new Date(); + private Date instruction_finished_time = new Date(); + private Date instruction_apply_time = new Date(); + private int instruction_require_time_out = 3000; + String specifications = ""; String last_specifications = ""; @@ -92,7 +106,7 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D @Override - public void execute() { + public void execute() throws Exception { String message = null; try { device_code = this.getDeviceCode(); @@ -189,7 +203,9 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D log.debug("设备运转模式:等待工作"); return; case 2: - + if (mode == 2 && move_1 == 0 && action_1 == 0 && !requireSucess) { + instruction_require(); + } break; } @@ -269,4 +285,78 @@ public class LnshOneRGVDeviceDriver extends AbstractOpcDeviceDriver implements D Map itemMap = new HashMap(); ReadUtil.write(itemMap, server); } + + 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) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return false; + } else { + this.instruction_apply_time = date; + String linkobj = (String)this.getDevice().getExtraValue().get("get_device_code"); + String demosub = linkobj.substring(1,linkobj.length()-1); + String demoArray[] = demosub.split(","); + List device_code_list = Arrays.asList(demoArray); + TaskDto task = null; + for(int i=0;i demoList = Arrays.asList(demoArray); + json.put("device_code",demoList.get(put_station-1).replace("\"","")); json.put("qty",qty); json.put("vehicle_code",barcode); json.put("is_full","1"); @@ -1065,6 +1066,7 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD json.put("one_qty",one_qty); json.put("two_qty",two_qty); json.put("tool_coordinate",tool_coordinate); + json.put("material_code",material); HttpResponse result = acsToWmsService.applyTaskManipulatorToWms(json); if (ObjectUtil.isNotEmpty(result)) { @@ -1179,10 +1181,12 @@ public class LnshPackagePalletManipulatorDeviceDriver extends AbstractOpcDeviceD } else { this.instruction_require_time = date; JSONObject json = new JSONObject(); - json.put("device_code",this.device_code); + String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code"); + String demosub = linkobj.substring(1,linkobj.length()-1); + String demoArray[] = demosub.split(","); + List demoList = Arrays.asList(demoArray); + json.put("device_code",demoList.get(put_station-1).replace("\"","")); json.put("type","4"); - json.put("qty",qty); - json.put("vehicle_code",barcode); HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); if (ObjectUtil.isNotEmpty(result)) { JSONObject jsonObject = JSONObject.parseObject(result.body()); diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java index b0978fb..99bf445 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_split_manipulator/LnshSplitManipulatorDeviceDriver.java @@ -31,10 +31,7 @@ import org.nl.wql.core.bean.WQLObject; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 嘉耐拆垛机械手 @@ -236,23 +233,52 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im return; case 2: break; + case 4: + //排产单确认 +// if (!requireSucess && !order_No.equals("0")) { +// JSONObject json = new JSONObject(); +// json.put("producetask_code",order_No); +// json.put("device_code",this.device_code); +// json.put("material_code",material); +// json.put("qty",qty); +// json.put("type","1"); +// enterProduction(json); +// } + break; case 5: - //获取托盘信息 + //叫料出库 if (!requireSucess) { - getVehicle(); + applyMaterialOut(); } break; case 6: - //拆垛完成 + //申请空盘入库 if (!requireSucess) { - palletizing(); + applyEmptyIn(); } break; - case 7: - //申请空盘 - if (!requireSucess) { - applyEmpty(); - } +// case 7: +// //码垛强制完成 +// if (!requireSucess) { +// +// } +// break; +// case 8: +// //申请空盘 +// if (!requireSucess) { +// applyEmpty(); +// } + case 9: + //工单完成 +// if (!requireSucess && !order_No.equals("0")) { +// JSONObject json = new JSONObject(); +// json.put("producetask_code",order_No); +// json.put("device_code",this.device_code); +// json.put("material_code",material); +// json.put("qty",qty); +// json.put("type","3"); +// enterProduction(json); +// } break; } @@ -294,6 +320,73 @@ public class LnshSplitManipulatorDeviceDriver extends AbstractOpcDeviceDriver im } } + + + /** + * 申请物料出库 + * + * @param + */ + public synchronized boolean applyMaterialOut() { + Date date = new Date(); + if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return false; + } else { + this.instruction_require_time = date; + JSONObject json = new JSONObject(); + String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code"); + String demosub = linkobj.substring(1,linkobj.length()-1); + String demoArray[] = demosub.split(","); + List demoList = Arrays.asList(demoArray); + json.put("device_code",demoList.get(getStation-1).replace("\"","")); + json.put("type","2"); + json.put("is_full","1"); + + HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); + if (ObjectUtil.isNotEmpty(result)) { + JSONObject jsonObject = JSONObject.parseObject(result.body()); + if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) { + this.writing(this.mode); + this.setRequireSucess(true); + } + } + return true; + } + } + + /** + * 申请空盘入库 + * + * @param + */ + public synchronized boolean applyEmptyIn() { + Date date = new Date(); + if (date.getTime() - this.instruction_require_time.getTime() < (long) this.instruction_require_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_require_time_out); + return false; + } else { + this.instruction_require_time = date; + JSONObject json = new JSONObject(); + String linkobj = (String)this.getDevice().getExtraValue().get("link_device_code"); + String demosub = linkobj.substring(1,linkobj.length()-1); + String demoArray[] = demosub.split(","); + List demoList = Arrays.asList(demoArray); + json.put("device_code",demoList.get(getStation-1).replace("\"","")); + json.put("type","3"); + + HttpResponse result = acsToWmsService.lnshApplyTaskToWms(json); + if (ObjectUtil.isNotEmpty(result)) { + JSONObject jsonObject = JSONObject.parseObject(result.body()); + if (result.getStatus() == 200 && jsonObject.get("status").equals("200")) { + this.writing(this.mode); + this.setRequireSucess(true); + } + } + return true; + } + } + /** * 获取托盘信息 * diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java index 555cf29..05bdd99 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/device_driver/lnsh/lnsh_station/LnshStationDeviceDriver.java @@ -115,6 +115,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements String last_barcode; String specifications = ""; String last_specifications = ""; + int container_type =0; int batch = 0; int last_batch = 0; @@ -142,7 +143,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements barcode = this.itemProtocol.getBarcode(); batch = this.itemProtocol.getBatch(); specifications = this.itemProtocol.getSpecifications(); - + container_type = itemProtocol.getContainer_type(); if (mode != last_mode) { this.setRequireSucess(false); logServer.deviceLog(this.device_code,"mode" ,String.valueOf(mode)); @@ -536,7 +537,7 @@ public class LnshStationDeviceDriver extends AbstractOpcDeviceDriver implements JSONObject jsonObject = JSONObject.parseObject(result.body()); if (result.getStatus() == 200 && StrUtil.equals(jsonObject.get("status").toString(),"200")) { String code = jsonObject.getString("code"); - this.writing(this.mode); + this.writing(1); this.writing(2,Integer.parseInt(code)); this.setRequireSucess(true); } diff --git a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java index 44cb508..e89b5e5 100644 --- a/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java +++ b/acs/hd/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/WmsToAcsServiceImpl.java @@ -462,24 +462,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { //无光电普通站点 StandardOrdinarySiteDeviceDriver standardOrdinarySiteDeviceDriver; - //无光电特殊站点 - SpecialOrdinarySiteDeviceDriver specialOrdinarySiteDeviceDriver; - //空盘站点 - StandardEmptyPalletSiteDeviceDriver standardEmptyPalletSiteDeviceDriver; - //检测站点 - StandardInspectSiteDeviceDriver standardInspectSiteDevicedriver; - //检测站点-无PLC - NonLineInspectSiteDeviceDriver nonLineInspectSiteDeviceDriver; - //区域管制站点(机械手) - StandardManipulatorInspectSiteDeviceDriver standardManipulatorInspectSiteDeviceDriver; - //区域管制站点-无PLC - NonLineManipulatorInspectSiteDeviceDriver nonLineManipulatorInspectSiteDeviceDriver; - //控制点 - StandardCoveyorControlDeviceDriver standardCoveyorControlDeviceDriver; - //控制点-带扫码 - StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver; - //控制点-PLC扫码 - StandardCoveyorControlWithPlcScannerDeviceDriver standardCoveyorControlWithPlcScannerDeviceDriver; //监控点 StandardCoveyorMonitorDeviceDriver standardCoveyorMonitorDeviceDriver; //扫码器 @@ -488,8 +470,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { MachinesSiteDeviceDriver machinesSiteDeviceDriver; //自动门 StandardAutodoorDeviceDriver standardAutodoorDeviceDriver; - //称重设备 - WeighingSiteDeviceDriver weighingSiteDeviceDriver; //机械手码垛驱动(区分托盘类型) StandardManipulatorStackingSiteDeviceDriver standardManipulatorStackingSiteDeviceDriver; //光电检测站点(优先入库) @@ -559,6 +539,8 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("barcode", lnshStationDeviceDriver.getBarcode()); jo.put("specifications", lnshStationDeviceDriver.getSpecifications()); jo.put("batch", lnshStationDeviceDriver.getBatch()); + jo.put("pallet_type", lnshStationDeviceDriver.getContainer_type()); + } else if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); @@ -880,19 +862,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { throw new Exception("未找到对应设备:" + device_code); } - if (device.getDeviceDriver() instanceof StandardCoveyorControlDeviceDriver) { - standardCoveyorControlDeviceDriver = (StandardCoveyorControlDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardCoveyorControlDeviceDriver.getMode()); - jo.put("move", standardCoveyorControlDeviceDriver.getMove()); - jo.put("hasGoods", standardCoveyorControlDeviceDriver.getHasGoods()); - jo.put("isOnline", standardCoveyorControlDeviceDriver.getIsonline()); - jo.put("error", standardCoveyorControlDeviceDriver.getError()); - jo.put("isError", standardCoveyorControlDeviceDriver.getIserror()); - jo.put("requestSucess", standardCoveyorControlDeviceDriver.getRequireSucess()); - jo.put("applySucess", standardCoveyorControlDeviceDriver.getApplySucess()); - jo.put("message", standardCoveyorControlDeviceDriver.getMessage()); - } else if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { + if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); jo.put("mode", standardAutodoorDeviceDriver.getMode()); @@ -901,126 +871,17 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("error", standardAutodoorDeviceDriver.getError()); jo.put("isError", standardAutodoorDeviceDriver.getIserror()); } else if (device.getDeviceDriver() instanceof StandardCoveyorMonitorDeviceDriver) { - standardCoveyorMonitorDeviceDriver = (StandardCoveyorMonitorDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardCoveyorMonitorDeviceDriver.getMode()); - jo.put("move", standardCoveyorMonitorDeviceDriver.getMove()); - jo.put("hasGoods", standardCoveyorMonitorDeviceDriver.getHasGoods()); - jo.put("isOnline", standardCoveyorMonitorDeviceDriver.getIsonline()); - jo.put("error", standardCoveyorMonitorDeviceDriver.getError()); - jo.put("isError", standardCoveyorMonitorDeviceDriver.getIserror()); - jo.put("message", standardCoveyorMonitorDeviceDriver.getMessage()); - } else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithScannerDeviceDriver) { - standardCoveyorControlWithScannerDeviceDriver = (StandardCoveyorControlWithScannerDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardCoveyorControlWithScannerDeviceDriver.getMode()); - jo.put("move", standardCoveyorControlWithScannerDeviceDriver.getMove()); - jo.put("hasGoods", standardCoveyorControlWithScannerDeviceDriver.getHasGoods()); - jo.put("isOnline", standardCoveyorControlWithScannerDeviceDriver.getIsonline()); - jo.put("error", standardCoveyorControlWithScannerDeviceDriver.getError()); - jo.put("isError", standardCoveyorControlWithScannerDeviceDriver.getIserror()); - jo.put("height", standardCoveyorControlWithScannerDeviceDriver.getHeight()); - jo.put("operation_type", standardCoveyorControlWithScannerDeviceDriver.getOperation_type()); - jo.put("direction", standardCoveyorControlWithScannerDeviceDriver.getDirection()); - jo.put("action", standardCoveyorControlWithScannerDeviceDriver.getAction()); - jo.put("ioaction", standardCoveyorControlWithScannerDeviceDriver.getIoaction()); - jo.put("container", StrUtil.isEmpty(standardCoveyorControlWithScannerDeviceDriver.barcode()) ? "" : standardCoveyorControlWithScannerDeviceDriver.barcode()); - jo.put("message", standardCoveyorControlWithScannerDeviceDriver.getMessage()); - jo.put("requestSucess", standardCoveyorControlWithScannerDeviceDriver.getRequireSucess().toString()); - jo.put("applySucess", standardCoveyorControlWithScannerDeviceDriver.getApplySucess().toString()); - jo.put("instruction_message", standardCoveyorControlWithScannerDeviceDriver.getInst_message()); - } else if (device.getDeviceDriver() instanceof StandardCoveyorControlWithPlcScannerDeviceDriver) { - standardCoveyorControlWithPlcScannerDeviceDriver = (StandardCoveyorControlWithPlcScannerDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardCoveyorControlWithPlcScannerDeviceDriver.getMode()); - jo.put("move", standardCoveyorControlWithPlcScannerDeviceDriver.getMove()); - jo.put("hasGoods", standardCoveyorControlWithPlcScannerDeviceDriver.getHasGoods()); - jo.put("isOnline", standardCoveyorControlWithPlcScannerDeviceDriver.getIsonline()); - jo.put("error", standardCoveyorControlWithPlcScannerDeviceDriver.getError()); - jo.put("isError", standardCoveyorControlWithPlcScannerDeviceDriver.getIserror()); - jo.put("height", standardCoveyorControlWithPlcScannerDeviceDriver.getHeight()); - jo.put("operation_type", standardCoveyorControlWithPlcScannerDeviceDriver.getOperation_type()); - jo.put("direction", standardCoveyorControlWithPlcScannerDeviceDriver.getDirection()); - jo.put("action", standardCoveyorControlWithPlcScannerDeviceDriver.getAction()); - jo.put("ioaction", standardCoveyorControlWithPlcScannerDeviceDriver.getIoaction()); - jo.put("container", StrUtil.isEmpty(standardCoveyorControlWithPlcScannerDeviceDriver.getBarcode()) ? "" : standardCoveyorControlWithPlcScannerDeviceDriver.getBarcode()); - jo.put("message", standardCoveyorControlWithPlcScannerDeviceDriver.getMessage()); - jo.put("requestSucess", standardCoveyorControlWithPlcScannerDeviceDriver.getRequireSucess().toString()); - jo.put("applySucess", standardCoveyorControlWithPlcScannerDeviceDriver.getApplySucess().toString()); - jo.put("instruction_message", standardCoveyorControlWithPlcScannerDeviceDriver.getInst_message()); - } - //检测站点 - else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardInspectSiteDevicedriver.getMode()); - jo.put("move", standardInspectSiteDevicedriver.getMove()); - jo.put("hasGoods", standardInspectSiteDevicedriver.getHasGoods()); - jo.put("isOnline", standardInspectSiteDevicedriver.getIsonline()); - jo.put("error", standardInspectSiteDevicedriver.getError()); - jo.put("isError", standardInspectSiteDevicedriver.getIserror()); - jo.put("container", standardInspectSiteDevicedriver.getContainer()); - jo.put("message", standardInspectSiteDevicedriver.getMessage()); - } - //检测站点-无PLC - else if (device.getDeviceDriver() instanceof NonLineInspectSiteDeviceDriver) { - nonLineInspectSiteDeviceDriver = (NonLineInspectSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", nonLineInspectSiteDeviceDriver.getMode()); - jo.put("move", nonLineInspectSiteDeviceDriver.getMove()); - jo.put("isOnline", nonLineInspectSiteDeviceDriver.getIs_online()); - jo.put("hasGoods", nonLineInspectSiteDeviceDriver.getHasGoods()); - jo.put("error", nonLineInspectSiteDeviceDriver.getError()); - jo.put("isError", nonLineInspectSiteDeviceDriver.getIserror()); - jo.put("container", nonLineInspectSiteDeviceDriver.getContainer()); - jo.put("message", nonLineInspectSiteDeviceDriver.getMessage()); - } - //区域管制站点(机械手) - else if (device.getDeviceDriver() instanceof StandardManipulatorInspectSiteDeviceDriver) { - standardManipulatorInspectSiteDeviceDriver = (StandardManipulatorInspectSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardManipulatorInspectSiteDeviceDriver.getMode()); - jo.put("move", standardManipulatorInspectSiteDeviceDriver.getMove()); - jo.put("action", standardManipulatorInspectSiteDeviceDriver.getActoin()); - jo.put("io_action", standardManipulatorInspectSiteDeviceDriver.getIo_action()); - jo.put("hasGoods", standardManipulatorInspectSiteDeviceDriver.getHasGoods()); - jo.put("isOnline", standardManipulatorInspectSiteDeviceDriver.getIsonline()); - jo.put("error", standardManipulatorInspectSiteDeviceDriver.getError()); - jo.put("isError", standardManipulatorInspectSiteDeviceDriver.getIserror()); - jo.put("container", standardManipulatorInspectSiteDeviceDriver.getContainer()); - jo.put("message", standardManipulatorInspectSiteDeviceDriver.getMessage()); - } - //区域管制站点-无PLC(机械手) - else if (device.getDeviceDriver() instanceof NonLineManipulatorInspectSiteDeviceDriver) { - nonLineManipulatorInspectSiteDeviceDriver = (NonLineManipulatorInspectSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", nonLineManipulatorInspectSiteDeviceDriver.getMode()); - jo.put("move", nonLineManipulatorInspectSiteDeviceDriver.getMove()); - jo.put("action", nonLineManipulatorInspectSiteDeviceDriver.getAction()); - jo.put("io_action", nonLineManipulatorInspectSiteDeviceDriver.getIoaction()); - jo.put("hasGoods", nonLineManipulatorInspectSiteDeviceDriver.getHasGoods()); - jo.put("isOnline", nonLineManipulatorInspectSiteDeviceDriver.getIs_online()); - jo.put("error", nonLineManipulatorInspectSiteDeviceDriver.getError()); - jo.put("isError", nonLineManipulatorInspectSiteDeviceDriver.getIserror()); - jo.put("container", nonLineManipulatorInspectSiteDeviceDriver.getContainer()); - jo.put("message", nonLineManipulatorInspectSiteDeviceDriver.getMessage()); - } - //空盘站点 - else if (device.getDeviceDriver() instanceof StandardEmptyPalletSiteDeviceDriver) { - standardEmptyPalletSiteDeviceDriver = (StandardEmptyPalletSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardEmptyPalletSiteDeviceDriver.getMode()); - jo.put("move", standardEmptyPalletSiteDeviceDriver.getMove()); - jo.put("number", standardEmptyPalletSiteDeviceDriver.getNumber()); - jo.put("hasGoods", standardEmptyPalletSiteDeviceDriver.getHasGoods()); - jo.put("isOnline", standardEmptyPalletSiteDeviceDriver.getIsonline()); - jo.put("isError", standardEmptyPalletSiteDeviceDriver.getIserror()); - jo.put("error", standardEmptyPalletSiteDeviceDriver.getError()); - jo.put("container", standardEmptyPalletSiteDeviceDriver.getContainer()); - jo.put("message", standardEmptyPalletSiteDeviceDriver.getMessage()); - } - //普通站点 - else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { + standardCoveyorMonitorDeviceDriver = (StandardCoveyorMonitorDeviceDriver) device.getDeviceDriver(); + jo.put("device_code", device.getDevice_code()); + jo.put("mode", standardCoveyorMonitorDeviceDriver.getMode()); + jo.put("move", standardCoveyorMonitorDeviceDriver.getMove()); + jo.put("hasGoods", standardCoveyorMonitorDeviceDriver.getHasGoods()); + jo.put("isOnline", standardCoveyorMonitorDeviceDriver.getIsonline()); + jo.put("error", standardCoveyorMonitorDeviceDriver.getError()); + jo.put("isError", standardCoveyorMonitorDeviceDriver.getIserror()); + jo.put("message", standardCoveyorMonitorDeviceDriver.getMessage()); + //普通站点 + } else if (device.getDeviceDriver() instanceof StandardOrdinarySiteDeviceDriver) { standardOrdinarySiteDeviceDriver = (StandardOrdinarySiteDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); jo.put("move", standardOrdinarySiteDeviceDriver.getMove()); @@ -1037,35 +898,6 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("material", standardOrdinarySiteDeviceDriver.getMaterial()); jo.put("batch", standardOrdinarySiteDeviceDriver.getBatch()); - } - //无光电特殊站点 - else if (device.getDeviceDriver() instanceof SpecialOrdinarySiteDeviceDriver) { - specialOrdinarySiteDeviceDriver = (SpecialOrdinarySiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("move", specialOrdinarySiteDeviceDriver.getMove()); - jo.put("container", specialOrdinarySiteDeviceDriver.getContainer()); - jo.put("hasGoods", specialOrdinarySiteDeviceDriver.getHasGoods()); - jo.put("isOnline", true); - //点击弹出 - jo.put("is_click", true); - jo.put("device_type", device.getDevice_type()); - jo.put("error", specialOrdinarySiteDeviceDriver.getError()); - jo.put("isError", specialOrdinarySiteDeviceDriver.getIserror()); - jo.put("container", specialOrdinarySiteDeviceDriver.getContainer()); - jo.put("message", specialOrdinarySiteDeviceDriver.getMessage()); - jo.put("material", specialOrdinarySiteDeviceDriver.getMaterial()); - jo.put("batch", specialOrdinarySiteDeviceDriver.getBatch()); - } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { - standardInspectSiteDevicedriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("mode", standardInspectSiteDevicedriver.getMode()); - jo.put("move", standardInspectSiteDevicedriver.getMove()); - jo.put("hasGoods", standardInspectSiteDevicedriver.getHasGoods()); - jo.put("isOnline", standardInspectSiteDevicedriver.getIsonline()); - jo.put("error", standardInspectSiteDevicedriver.getError()); - jo.put("isError", standardInspectSiteDevicedriver.getIserror()); - jo.put("container", standardInspectSiteDevicedriver.getContainer()); - jo.put("message", standardInspectSiteDevicedriver.getMessage()); } else if (device.getDeviceDriver() instanceof StandardScannerDeviceDriver) { standardScannerDeviceDriver = (StandardScannerDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); @@ -1075,11 +907,7 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("is_click", true); jo.put("ip", standardScannerDeviceDriver.getIp()); jo.put("container", StrUtil.isEmpty(standardScannerDeviceDriver.readBarcode()) ? "" : standardScannerDeviceDriver.readBarcode()); - } else if (device.getDeviceDriver() instanceof WeighingSiteDeviceDriver) { - weighingSiteDeviceDriver = (WeighingSiteDeviceDriver) device.getDeviceDriver(); - jo.put("device_code", device.getDevice_code()); - jo.put("isOnline", true); - jo.put("instruction_message", weighingSiteDeviceDriver.getInst_message()); + } else if (device.getDeviceDriver() instanceof MachinesSiteDeviceDriver) { machinesSiteDeviceDriver = (MachinesSiteDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); @@ -1130,7 +958,9 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { jo.put("barcode", lnshStationDeviceDriver.getBarcode()); jo.put("specifications", lnshStationDeviceDriver.getSpecifications()); jo.put("batch", lnshStationDeviceDriver.getBatch()); - } else if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { + jo.put("pallet_type", lnshStationDeviceDriver.getContainer_type()); + + } else if (device.getDeviceDriver() instanceof LnshPalletizingManipulatorSiteDeviceDriver) { lnshPalletizingManipulatorSiteDeviceDriver = (LnshPalletizingManipulatorSiteDeviceDriver) device.getDeviceDriver(); jo.put("device_code", device.getDevice_code()); jo.put("mode", lnshPalletizingManipulatorSiteDeviceDriver.getMode()); diff --git a/acs/qd/src/views/acs/device/config.vue b/acs/qd/src/views/acs/device/config.vue index 871f0cc..f8bd2e8 100644 --- a/acs/qd/src/views/acs/device/config.vue +++ b/acs/qd/src/views/acs/device/config.vue @@ -135,7 +135,7 @@ export default { electric_fence, lnsh_mixing_mill, lnsh_press, lnsh_palletizing_manipulator, lnsh_fold_disc_site, lnsh_kiln_lane, lnsh_kiln_truss, lnsh_package_line, lnsh_out_kiln_truss, lnsh_package_pallet_manipulator, lnsh_pallet_storage, lnsh_labeling_machine, lnsh_split_manipulator, lnsh_rgv, lnsh_station, lnsh_Laminating_machine, lnsh_package_site, rljn_package_palletSplit_manipulator, standard_rgv, lnsh_palletizing_manipulator_site, - lnsh_one_rgv}, + lnsh_one_rgv }, dicts: ['device_type'], mixins: [crud], data() { diff --git a/acs/qd/src/views/acs/device/driver/lnsh/lnsh_one_rgv.vue b/acs/qd/src/views/acs/device/driver/lnsh/lnsh_one_rgv.vue index fd8aa8b..e5300ae 100644 --- a/acs/qd/src/views/acs/device/driver/lnsh/lnsh_one_rgv.vue +++ b/acs/qd/src/views/acs/device/driver/lnsh/lnsh_one_rgv.vue @@ -59,6 +59,7 @@ diff --git a/acs/qd/src/views/acs/produceshiftorder/index.vue b/acs/qd/src/views/acs/produceshiftorder/index.vue index 81e4222..5e93990 100644 --- a/acs/qd/src/views/acs/produceshiftorder/index.vue +++ b/acs/qd/src/views/acs/produceshiftorder/index.vue @@ -13,7 +13,7 @@ class="filter-item" @keyup.enter.native="crud.toQuery" /> - + @@ -106,7 +106,7 @@ import crudOperation from '@crud/CRUD.operation' import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' import crudProduceshiftorder from '@/api/acs/produceshiftorder/produceshiftorder' -import crudTask from "@/api/acs/task/task"; +import crudTask from '@/api/acs/task/task' const defaultForm = { order_id: null, order_code: null, is_unbundling: null, order_status: null, qty: null, product_code: null, material_code: null, material_name: null, material_uuid: null, cust_code: null, cust_name: null, model: null, molten_pool: null, weight: null, create_by: null, create_time: null, update_by: null, update_time: null, is_deleted: null } export default {