diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/.~lock.wms.xls# b/wms/hd/nladmin-system/src/main/java/org/nl/wms/.~lock.wms.xls# new file mode 100644 index 0000000..57d870a --- /dev/null +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/.~lock.wms.xls# @@ -0,0 +1 @@ +,DESKTOP-BT6HP4E/zhang,DESKTOP-BT6HP4E,29.08.2022 16:51,file:///C:/Users/zhang/AppData/Roaming/LibreOffice/4; \ No newline at end of file diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java index b985737..7c3e9d6 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/WorkProcedureEnum.java @@ -11,7 +11,9 @@ public enum WorkProcedureEnum { HNGX(1, "1514444198529601536", "01", "混碾工序", ""), YZGX(2, "1514444247439380480", "02", "压制工序", ""), SZGX(3, "1514444321896665088", "03", "烧制工序", ""), - FJGX(4, "1514444386174373888", "04", "分拣工序", ""); + FJGX(4, "1514444386174373888", "04", "分拣工序", ""), + DPGX(4, "1514444386174373888", "05", "叠盘工序", ""), + CPGX(4, "1514444386174373888", "06", "拆盘工序", ""); //顺序号 private int index; //工序标识 diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java new file mode 100644 index 0000000..6a0e96d --- /dev/null +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java @@ -0,0 +1,33 @@ +package org.nl.wms.common; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.nl.modules.system.service.impl.ParamServiceImpl; +import org.nl.utils.SpringContextHolder; +import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl; +import org.nl.wql.core.bean.WQLObject; + +public class PointUpdateUtil { + public static void updatePoint(JSONArray arr) { + WmsToAcsServiceImpl wmsToAcsServiceImpl = new WmsToAcsServiceImpl(); + String isConnect = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("IS_CONNECT_ACS").getValue(); + if (StrUtil.equals("0", isConnect)) { + return; + } + JSONObject joo = wmsToAcsServiceImpl.queryPointStatus(arr); + JSONArray pointarr = joo.getJSONArray("data"); + WQLObject pointTable = WQLObject.getWQLObject("sch_base_point"); + for (int i = 0; i < pointarr.size(); i++) { + JSONObject pointjo = pointarr.getJSONObject(i); + String point_status = "0" + pointjo.getString("move"); + String device_code = pointjo.getString("device_code"); + pointjo.put("point_status", point_status); + JSONObject pointObj = pointTable.query("point_code ='" + device_code + "'").uniqueResult(0); + pointObj.put("point_status", point_status); + pointTable.update(pointObj); + } + } + + +} diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java index dba858e..ee865d9 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java @@ -2,9 +2,11 @@ package org.nl.wms.common; import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import org.nl.exception.BadRequestException; import org.nl.start.day01.Struct; +import org.nl.wms.sch.manage.AreaEnum; import org.nl.wql.WQL; import org.nl.wql.core.bean.WQLObject; @@ -17,7 +19,10 @@ public class StructFindUtil { throw new BadRequestException("托盘不能为空!"); } //根据托盘找托盘类型, - JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0); + JSONObject vehicleObj = WQLObject + .getWQLObject("md_pb_vehicle") + .query("vehicle_code='" + vehicle_code + "'") + .uniqueResult(0); if (ObjectUtil.isEmpty(vehicleObj)) { throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!"); } @@ -28,8 +33,14 @@ public class StructFindUtil { throw new BadRequestException("区域不能为空!"); } String vehice_type = vehicleObj.getString("vehicle_type"); - JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "2") - .addParam("material_id", material_id).addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0); + JSONObject result = WQL + .getWO("QSTRUCT_RULE") + .addParam("flag", "2") + .addParam("material_id", material_id) + .addParam("area_type", area_type) + .addParam("vehice_type", vehice_type) + .process() + .uniqueResult(0); return result; } @@ -38,10 +49,7 @@ public class StructFindUtil { String area_type = jsonObject.getString("area_type"); String is_full = jsonObject.getString("is_full"); String workprocedure_id = jsonObject.getString("workprocedure_id"); - - if (StrUtil.isEmpty(material_id)) { - throw new BadRequestException("物料不能为空!"); - } + String vehicle_type = jsonObject.getString("vehicle_type"); if (StrUtil.isEmpty(area_type)) { throw new BadRequestException("区域不能为空!"); } @@ -53,6 +61,7 @@ public class StructFindUtil { } JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3") .addParam("material_id", material_id).addParam("area_type", area_type) + .addParam("vehicle_type", vehicle_type) .addParam("is_full", is_full).addParam("workprocedure_id", workprocedure_id) .process().uniqueResult(0); return result; @@ -61,9 +70,14 @@ public class StructFindUtil { public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) { String area_type = jsonObject.getString("area_type"); String vehicle_code = jsonObject.getString("vehicle_code"); + String point_code = jsonObject.getString("point_code"); if (StrUtil.isEmpty(vehicle_code)) { throw new BadRequestException("托盘不能为空!"); } + if (StrUtil.equals(point_code, "KGTPDDW05")) { + JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); + PointUpdateUtil.updatePoint(pointarr); + } //根据托盘找托盘类型, JSONObject vehicleObj = WQLObject.getWQLObject("md_pb_vehicle").query("vehicle_code='" + vehicle_code + "'").uniqueResult(0); if (ObjectUtil.isEmpty(vehicleObj)) { @@ -74,18 +88,46 @@ public class StructFindUtil { } String vehice_type = vehicleObj.getString("vehicle_type"); JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "4") - .addParam("area_type", area_type).addParam("vehice_type", vehice_type).process().uniqueResult(0); + .addParam("area_type", area_type) + .addParam("vehice_type", vehice_type) + .addParam("point_code", point_code) + .process().uniqueResult(0); return result; } public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) { String area_type = jsonObject.getString("area_type"); String vehicle_type = jsonObject.getString("vehicle_type"); + String point_code = jsonObject.getString("point_code"); + //如果是堆叠位5 需要更新 设备状态 + if(StrUtil.equals(point_code,"KGTDDW05")){ + JSONArray pointarr = WQL.getWO("ACSTOMES_001") + .addParam("area_type", AreaEnum.KGTCPQ.getCode()) + .addParam("flag", "2").process().getResultJSONArray(0); + PointUpdateUtil.updatePoint(pointarr); + } + if (StrUtil.isEmpty(area_type)) { throw new BadRequestException("区域不能为空!"); } - JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5") - .addParam("area_type", area_type).addParam("vehicle_type", vehicle_type).process().uniqueResult(0); + JSONObject result = new JSONObject(); + //如果是堆叠位5 需要更新 设备状态 + if (StrUtil.equals(point_code, "KGTDDW05")) { + JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); + PointUpdateUtil.updatePoint(pointarr); + result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6") + .addParam("area_type", area_type) + .addParam("vehicle_type", vehicle_type) + .addParam("point_code", point_code) + .process().uniqueResult(0); + } else { + result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "5") + .addParam("area_type", area_type) + .addParam("vehicle_type", vehicle_type) + .addParam("point_code", point_code) + .process().uniqueResult(0); + } + return result; } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql index 9f4219a..089633c 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql @@ -13,14 +13,16 @@ ################################################# ## 表字段对应输入参数 ################################################# - 输入.flag TYPEAS s_string - 输入.code TYPEAS s_string - 输入.material_id TYPEAS s_string - 输入.sect_id TYPEAS s_string - 输入.area_type TYPEAS s_string - 输入.vehicle_type TYPEAS s_string - 输入.workprocedure_id TYPEAS s_string - 输入.is_full TYPEAS s_string + 输入.flag TYPEAS s_string + 输入.code TYPEAS s_string + 输入.material_id TYPEAS s_string + 输入.sect_id TYPEAS s_string + 输入.area_type TYPEAS s_string + 输入.vehicle_type TYPEAS s_string + 输入.workprocedure_id TYPEAS s_string + 输入.is_full TYPEAS s_string + 输入.vehicle_type TYPEAS s_string + 输入.point_code TYPEAS s_string [临时表] @@ -103,28 +105,33 @@ ENDIF IF 输入.flag = "3" QUERY SELECT DISTINCT - point.point_code AS struct_code, - point.point_id AS struct_id, - point.point_name AS struct_name, - point.vehicle_code, - ivt.canuse_qty, - ivt.workprocedure_id, - ivt.qty_unit_id, - ivt.pcsn, - ivt.qty_unit_id, - ruledis.out_seq_no - FROM - st_ivt_structivt ivt - LEFT JOIN sch_base_point point ON point.point_id = ivt.struct_id - left join st_rule_IOdisStruct ruledis on ruledis.struct_uuid = ivt.struct_id - WHERE - ivt.canuse_qty > 0 - AND point.point_status = '02' - AND point.lock_type = '00' - AND point.is_used ='1' - and TIME_TO_SEC(timediff(now(),ivt.instorage_time)) >=ivt.stewing_time*60 - OPTION 输入.material_id <> "" - ivt.material_id = 输入.material_id + point.point_code AS struct_code, + point.point_id AS struct_id, + point.point_name AS struct_name, + point.vehicle_code, + ivt.canuse_qty, + ivt.workprocedure_id, + ivt.qty_unit_id, + ivt.pcsn, + ivt.qty_unit_id, + ivt.material_id, + ruledis.out_seq_no + FROM + st_ivt_structivt ivt + LEFT JOIN sch_base_point point ON point.point_id = ivt.struct_id + left join st_rule_IOdisStruct ruledis on ruledis.struct_uuid = ivt.struct_id + left join md_pb_vehicle vehicle on vehicle.vehicle_code =ivt.vehicle_code + WHERE + ivt.canuse_qty > 0 + AND point.point_status = '02' + AND point.lock_type = '00' + AND point.is_used ='1' + and TIME_TO_SEC(timediff(now(),ivt.instorage_time)) >=ivt.stewing_time*60 + OPTION 输入.material_id <> "" + ivt.material_id = 输入.material_id + ENDOPTION + OPTION 输入.vehicle_type <> "" + vehicle.vehicle_type = 输入.vehicle_type ENDOPTION OPTION 输入.area_type <> "" point.area_type = 输入.area_type @@ -144,13 +151,11 @@ ENDIF IF 输入.flag = "4" QUERY SELECT DISTINCT - structattr.struct_id, - structattr.struct_code, - structattr.struct_name + point.point_id as struct_id, + point.point_code as struct_code, + point.point_name as struct_name FROM - st_ivt_structattr structattr - LEFT JOIN sch_base_point point ON point.point_id = structattr.struct_id - LEFT JOIN ST_IVT_StructRelaVehicleType rulevehicle ON rulevehicle.struct_id = structattr.struct_id + sch_base_point point ON point.point_id = structattr.struct_id WHERE point.lock_type = '00' AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL ) @@ -158,12 +163,12 @@ IF 输入.flag = "4" OPTION 输入.area_type <> "" point.area_type = 输入.area_type ENDOPTION - OPTION 输入.sect_id <> "" - point.structattr = 输入.sect_id - ENDOPTION OPTION 输入.vehicle_type <> "" rulevehicle.vehicle_type = 输入.vehicle_type ENDOPTION + OPTION 输入.point_code <> "" + point.point_code = 输入.point_code + ENDOPTION ENDSELECT ENDQUERY ENDIF @@ -176,8 +181,6 @@ IF 输入.flag = "5" point.point_code AS struct_code, point.point_name AS struct_name, point.vehicle_code - - FROM sch_base_point point LEFT JOIN md_pb_vehicle vehicle ON vehicle.vehicle_code = point.vehicle_code @@ -191,6 +194,31 @@ IF 输入.flag = "5" OPTION 输入.vehicle_type <> "" vehicle.vehicle_type = 输入.vehicle_type ENDOPTION + OPTION 输入.point_code <> "" + point.point_code = 输入.point_code + ENDOPTION + ENDSELECT + ENDQUERY +ENDIF + +IF 输入.flag = "6" + QUERY + SELECT DISTINCT + point.point_id AS struct_id, + point.point_code AS struct_code, + point.point_name AS struct_name, + point.vehicle_code + FROM + sch_base_point point + WHERE + point.lock_type = '00' + AND point.point_status = '01' + OPTION 输入.area_type <> "" + point.area_type = 输入.area_type + ENDOPTION + OPTION 输入.point_code <> "" + point.point_code = 输入.point_code + ENDOPTION ENDSELECT ENDQUERY ENDIF \ No newline at end of file diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java index a8a393c..b1b7391 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java @@ -2,6 +2,7 @@ package org.nl.wms.ext.acs.rest; +import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -34,7 +35,10 @@ public class AcsToWmsController { @ApiOperation("ACS给WMS发送任务") public ResponseEntity receiveTaskFromAcs(@RequestBody Map whereJson) { acsToWmsService.receiveTaskFromAcs(whereJson); - return new ResponseEntity<>(HttpStatus.OK); + JSONObject result = new JSONObject(); + result.put("status", HttpStatus.OK.value()); + result.put("message", "发送任务成功"); + return new ResponseEntity<>(result, HttpStatus.OK); } @PostMapping("/manipulatorApply") @@ -42,7 +46,10 @@ public class AcsToWmsController { @ApiOperation("ACS机械手给WMS发送任务") public ResponseEntity manipulatorApply(@RequestBody Map whereJson) { acsToWmsService.manipulatorApply(whereJson); - return new ResponseEntity<>(HttpStatus.OK); + JSONObject result = new JSONObject(); + result.put("status", HttpStatus.OK.value()); + result.put("message", "发送任务成功"); + return new ResponseEntity<>(result, HttpStatus.OK); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java index bab4ed6..690b815 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/WmsToAcsController.java @@ -64,5 +64,13 @@ public class WmsToAcsController { return new ResponseEntity<>(wmsToAcsService.action(arr), HttpStatus.OK); } + @PostMapping("/queryPointStatus") + @Log("查询点位状态") + @ApiOperation("查询点位状态") + public ResponseEntity queryPointStatus(@RequestBody Map whereJson) { + JSONArray arr = JSONArray.parseArray(JSON.toJSONString(whereJson.get("data"))); + return new ResponseEntity<>(wmsToAcsService.queryPointStatus(arr), HttpStatus.OK); + } + } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java index b1f74c1..1bf1593 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/WmsToAcsService.java @@ -40,6 +40,12 @@ public interface WmsToAcsService { * @return */ Map action(JSONArray arr); + /** + * 下发动作信号 + * @param arr + * @return + */ + Map queryPointStatus(JSONArray arr); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 3a639d2..b4601bf 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -75,10 +75,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { //叫料出库 jsonObject.put("next_point_code", device_code); jsonObject.put("create_mode", "01"); - produceInfoByCode = this.getProduceInfoByCode(device_code); + //批次 物料,客户要从排产单里面去取 jsonObject.put("pcsn", "pcsn"); - jsonObject.put("material_id", "1515940603542769664"); + if (!StrUtil.equals(device_code,"RYW")){ + produceInfoByCode = this.getProduceInfoByCode(device_code); + jsonObject.put("material_id", produceInfoByCode.getString("material_id")); + + } + jsonObject.put("cust_id", "1516368197694132224"); callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); break; @@ -150,7 +155,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { JSONObject produceInfoByCode = new JSONObject(); String device_code = (String) jsonObject.get("device_code"); String vehicle_code = (String) jsonObject.get("vehicle_code"); - String qty = (String) jsonObject.get("qty"); + String qty = String.valueOf(jsonObject.get("qty")) ; produceInfoByCode = this.getProduceInfoByCode(device_code); String material_id = (String) produceInfoByCode.get("material_id"); String cust_id = (String) produceInfoByCode.get("cust_id"); @@ -324,6 +329,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { if (ObjectUtil.isEmpty(taskObj)) { throw new BadRequestException("未找到工单号为'" + producetask_code + "'的工单信息!"); } + JSONObject materialObj = WQLObject.getWQLObject("md_me_material").query("material_code = '" + material_code + "'").uniqueResult(0); //1为确认 //2为生产中 //3为完成 @@ -338,15 +344,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { throw new BadRequestException("物料编码不能为空!"); } - //根据设备去找设备id - JSONObject deviceObj = WQLObject.getWQLObject("PDM_BASE_DEVICE").query("device_code='" + device_code + "'").uniqueResult(0); - //根据物料code 去找物料id - JSONObject materiObj = WQLObject.getWQLObject("MD_ME_Material").query("material_code='" + material_code + "'").uniqueResult(0); - if (!StrUtil.equals(deviceObj.getString("device_id"), taskObj.getString("device_id"))) { - throw new BadRequestException("设备标识不一样!"); - } - if (!StrUtil.equals(materiObj.getString("material_id"), taskObj.getString("material_id"))) { - throw new BadRequestException("物料标识不一样!"); + if (!StrUtil.equals(materialObj.getString("material_id"), taskObj.getString("material_id"))) { + throw new BadRequestException("物料标识不一样!"); } taskObj.put("producetask_status", "04"); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java index f957a5e..89cc9cc 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/WmsToAcsServiceImpl.java @@ -40,9 +40,13 @@ public class WmsToAcsServiceImpl implements WmsToAcsService { return AcsUtil.notifyAcs(api, arr); } - public static void main(String[] args) { - String format = DateUtil.format(new Date(), "yyyy-MM-dd"); - System.out.println(format); + @Override + public JSONObject queryPointStatus(JSONArray arr) { + String api = "api/wms/querydevice"; + return AcsUtil.notifyAcs(api, arr); + } + + } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql index 13a4e9a..db95d7a 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql @@ -13,9 +13,11 @@ ################################################# ## 表字段对应输入参数 ################################################# - 输入.flag TYPEAS s_string - 输入.workprocedure_id TYPEAS s_string + 输入.flag TYPEAS s_string + 输入.workprocedure_id TYPEAS s_string 输入.material_id TYPEAS s_string + 输入.area_type TYPEAS s_string + 输入.point_code TYPEAS s_string [临时表] --这边列出来的临时表就会在运行期动态创建 @@ -61,3 +63,23 @@ ENDSELECT ENDQUERY ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + + point.point_code as device_code + FROM + sch_base_point point + WHERE + 1=1 + AND point.is_delete = '0' + OPTION 输入.area_type <> "" + point.area_type = 输入.area_type + ENDOPTION + OPTION 输入.point_code <> "" + point.point_code = 输入.point_code + ENDOPTION + ENDSELECT + ENDQUERY + ENDIF \ No newline at end of file diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java index 4cb364c..069621f 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/callMaterial/service/impl/CallMaterialServiceImpl.java @@ -53,6 +53,7 @@ public class CallMaterialServiceImpl implements CallMaterialService { public Map bussConfirm(@RequestBody Map param) { String is_full = param.get("is_full"); String next_point_code = param.get("point_code"); + String material_id = param.get("material_id"); if (StrUtil.isEmpty(is_full)) { throw new PdaRequestException("是否满拖不能为空!"); } @@ -65,13 +66,7 @@ public class CallMaterialServiceImpl implements CallMaterialService { String point_type = pointObj.getString("point_type"); //如果是压机上料位置则走转储的流程 if (StrUtil.equals(point_type, "05")) { - //查询当前压机对应的排产单的物料信息是 - JSONObject TaskObj = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + pointObj.getString("device_id") + "' and producetask_status in ('02','03','04') and is_delete='0'").uniqueResult(0); - if (ObjectUtil.isEmpty(TaskObj)) { - throw new BadRequestException("未找到该点位设备的工单信息!"); - } - String material_id = TaskObj.getString("material_id"); - String startArea_type = AreaEnum.KLHJ.getCode(); + String startArea_type = AreaEnum.KLHJ.getCode(); JSONObject param1 = new JSONObject(); param1.put("material_id", material_id); param1.put("area_type", startArea_type); @@ -133,12 +128,10 @@ public class CallMaterialServiceImpl implements CallMaterialService { jsonObject.put("next_point_code", next_point_code); jsonObject.put("create_mode", "03"); //批次 物料,客户要从排产单里面去取 - jsonObject.put("pcsn", "pcsn"); - JSONObject produceInfoByCode = this.getProduceInfoByCode(next_point_code); - jsonObject.put("material_id", produceInfoByCode.getString("material_id")); - jsonObject.put("cust_id", produceInfoByCode.getString("cust_id")); - jsonObject.put("stewing_time", produceInfoByCode.getString("stewing_time")); - jsonObject.put("producetask_id", produceInfoByCode.getString("producetask_id")); + // jsonObject.put("pcsn", "pcsn"); + //JSONObject produceInfoByCode = this.getProduceInfoByCode(next_point_code); + jsonObject.put("material_id", material_id); + //jsonObject.put("producetask_id", produceInfoByCode.getString("producetask_id")); jsonObject.put("is_full", is_full); callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/AreaEnum.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/AreaEnum.java index f8f4e00..1b135f7 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/AreaEnum.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/AreaEnum.java @@ -14,10 +14,11 @@ public enum AreaEnum { YZQY("22", "压制区域"), YYJLZ("23", "液压机料盅架"), YQU("24", "窑区域"), - KGTDDQ("25", "空钢托堆叠区"), + KGTCPQ("25", "空钢拆盘区"), ZDCDX("26", "自动柴垛线"), - RGCPQ("26", "人工拆盘区域"), - BZQ("26", "包装区"); + RGCPQ("27", "人工拆盘区域"), + BZQ("28", "包装区"), + KGTPDPQ("29", "空钢托叠盘区"); private final String name; private final String code; diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/VehicleTypeEnum.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/VehicleTypeEnum.java index 03c9a3d..355402a 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/VehicleTypeEnum.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/VehicleTypeEnum.java @@ -6,9 +6,15 @@ package org.nl.wms.sch.manage; * 24 窑区域 25 空钢托堆叠区 26 自动柴垛线 */ public enum VehicleTypeEnum { - LZ("01", "料盅"), + DLZ("01", "大料盅"), GTP("02", "钢托盘"), - MTP("03", "木托盘"); + MTP1("03", "类型一木托盘"), + MTP2("04", "类型二木托盘"), + MTP3("05", "类型三木托盘"), + MTP4("06", "类型四木托盘"), + MTP5("07", "类型五木托盘"), + TP6("08", "类型六托盘"), + XLZ("09", "小料盅"); private final String name; private final String code; diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java index 4d2fd4b..64cedc7 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java @@ -112,25 +112,36 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { switch (workProcedureEnum) { //混黏工序 case HNGX: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + vehicle_type = VehicleTypeEnum.XLZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); - // 压制工序 + break; + // 压制工序 case YZGX: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + vehicle_type = VehicleTypeEnum.GTP.getCode(); start_area = AreaEnum.KLHJ.getCode(); - //烧制工序 + break; + //烧制工序 case SZGX: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + vehicle_type = VehicleTypeEnum.GTP.getCode(); start_area = AreaEnum.KLHJ.getCode(); - //分拣工序 + break; + //分拣工序 case FJGX: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + // 根据点位code查找对应设备,根据设备查找对应工单,从工单中取托盘类型 + vehicle_type = WQL.getWO("BUSSTASK_001") + .addParam("flag", "1") + .addParam("point_code", next_point_code) + .process() + .uniqueResult(0) + .getString("vehicle_type"); start_area = AreaEnum.KLHJ.getCode(); + break; default: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + vehicle_type = VehicleTypeEnum.XLZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); } //寻找一个合适的仓位 + param.put("vehicle_type", vehicle_type); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); if (ObjectUtil.isEmpty(outStructObj)) { continue; @@ -194,14 +205,15 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { switch (workProcedureEnum) { //混黏工序 case HNGX: - vehicle_type = VehicleTypeEnum.LZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); - + //托盘类型取当前工单生产的托盘类型 + vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type"); break; // 压制工序 case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); - start_area = AreaEnum.CYHJ.getCode(); + start_area = AreaEnum.KGTCPQ.getCode(); + start_point_code = "KGTDDW05"; break; //烧制工序 case SZGX: @@ -211,18 +223,25 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { //分拣工序 case FJGX: //托盘类型取当前工单生产的托盘类型 - JSONObject produceObj = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0); - vehicle_type = produceObj.getString("vehicle_type"); + vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type"); start_area = AreaEnum.CYZC.getCode(); is_auto_issue = "0"; break; + //叠盘工序 + case DPGX: + //托盘类型取当前工单生产的托盘类型 + vehicle_type = VehicleTypeEnum.GTP.getCode(); + start_area = AreaEnum.CYHJ.getCode(); + is_auto_issue = "0"; + break; default: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + vehicle_type = VehicleTypeEnum.DLZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); } JSONObject param = new JSONObject(); param.put("vehicle_type", vehicle_type); param.put("area_type", start_area); + param.put("point_code", start_point_code); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); if (ObjectUtil.isEmpty(outStructObj)) { throw new BadRequestException("未找到合适的空托盘点位"); @@ -247,6 +266,10 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { } String task_id = IdUtil.getSnowflake(1, 1).nextId() + ""; //生成空载具搬运单据 + //如果载具点位上取不到,则给一个默认的999 + if (StrUtil.isEmpty(vehicle_code)) { + vehicle_code = "999"; + } JSONObject EmptyVehicleObj = new JSONObject(); EmptyVehicleObj.put("record_uuid", IdUtil.getSnowflake(1, 1).nextId()); EmptyVehicleObj.put("bill_code", CodeUtil.getNewCode("KZJ_BILL_CODE")); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java index 52a3589..b648484 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java @@ -164,24 +164,17 @@ public class CallMaterialTask extends AbstractAcsTask { String start_point_code = form.getString("start_point_code"); String next_point_code = form.getString("next_point_code"); String vehicle_code = form.getString("vehicle_code"); - String task_status = TaskStatusEnum.SURE_START.getCode(); String material_id = form.getString("material_id"); String cust_id = form.getString("cust_id"); String create_mode = form.getString("create_mode"); String pcsn = form.getString("pcsn"); String is_full = form.getString("is_full"); String workprocedure_id = form.getString("workprocedure_id"); - WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task"); String iostorinv_id = form.getString("iostorinv_id"); + WQLObject taskTable = WQLObject.getWQLObject("SCH_BASE_Task"); if (StrUtil.isEmpty(next_point_code)) { throw new BadRequestException("终点不能为空!"); } - if (StrUtil.isEmpty(material_id)) { - throw new BadRequestException("物料标识不能为空!"); - } - if (StrUtil.isEmpty(cust_id)) { - throw new BadRequestException("客户不能为空!"); - } if (StrUtil.isEmpty(create_mode)) { throw new BadRequestException("创建方式不能为空!"); } @@ -189,8 +182,8 @@ public class CallMaterialTask extends AbstractAcsTask { throw new BadRequestException("是否满托不能为空!"); } //判断终点有没有未完成的指令 - JSONObject beforTaskObj = taskTable. - query("is_delete='0' and next_point_code='" + next_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'") + JSONObject beforTaskObj = taskTable + .query("is_delete='0' and next_point_code='" + next_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'") .uniqueResult(0); if (ObjectUtil.isNotEmpty(beforTaskObj)) { throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!"); @@ -222,12 +215,15 @@ public class CallMaterialTask extends AbstractAcsTask { } PointDto nextPoint = pointService.findByCode(next_point_code); - //如果没给终点,根据起点去找工序,找一个合适的仓位 并且生成入库单,并且锁定点位 + //如果没给起点,根据重点去找工序,找一个合适的仓位 并且生成出库单,并且锁定点位 if (StrUtil.isEmpty(start_point_code)) { if (StrUtil.isEmpty(workprocedure_id)) { - - JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", next_point_code) - .process().uniqueResult(0); + JSONObject workInfo = WQL + .getWO("QSTRUCT_RULE") + .addParam("flag", "1") + .addParam("code", next_point_code) + .process() + .uniqueResult(0); workprocedure_id = workInfo.getString("workprocedure_id"); WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id); @@ -299,6 +295,9 @@ public class CallMaterialTask extends AbstractAcsTask { iosObj.put("bill_type", bill_type); iosObj.put("workprocedure_id", workprocedure_id); iosObj.put("ivt_workprocedure_id", ivt_workprocedure_id); + if (StrUtil.isEmpty(material_id)) { + material_id = outStructObj.getString("material_id"); + } iosObj.put("material_id", material_id); iosObj.put("vehicle_code", outStructObj.getString("vehicle_code")); iosObj.put("qty", qty); @@ -319,7 +318,7 @@ public class CallMaterialTask extends AbstractAcsTask { WQLObject.getWQLObject("ST_IVT_workProcedureIOS").insert(iosObj); } - task_status = TaskStatusEnum.START_AND_POINT.getCode(); + String task_status = TaskStatusEnum.START_AND_POINT.getCode(); PointDto startPoint = pointService.findByCode(start_point_code); start_area = nextPoint.getArea_type(); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java index 2b9df6c..a247419 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java @@ -154,7 +154,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { if (StrUtil.isEmpty(vehicle_code)) { throw new BadRequestException("载具未找到!"); } - //判断起点有没有未完成的指令 JSONObject beforTaskObj = taskTable. query("is_delete='0' and start_point_code='" + start_point_code + "' and task_status <>'" + TaskStatusEnum.FINISHED.getCode() + "'") @@ -162,7 +161,6 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { if (ObjectUtil.isNotEmpty(beforTaskObj)) { throw new BadRequestException("存在指令号为'" + beforTaskObj.getString("task_code") + "' 未完成!"); } - //根据起点去找工序,找一个合适的仓位 并且生成单据 if (StrUtil.isEmpty(next_point_code)) { JSONObject workInfo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("code", start_point_code) @@ -185,7 +183,13 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { break; //分拣工序 case FJGX: - next_area = AreaEnum.KGTDDQ.getCode(); + next_area = AreaEnum.KGTPDPQ.getCode(); + next_point_code = "KGTDTW01"; + break; + //拆盘工序 + case DPGX: + next_area = AreaEnum.KGTCPQ.getCode(); + next_point_code = "KGTDDW01"; break; default: next_area = AreaEnum.KLHJ.getCode(); @@ -193,6 +197,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { JSONObject param = new JSONObject(); param.put("area_type", next_area); param.put("vehicle_code", vehicle_code); + param.put("point_code", next_point_code); JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param); next_point_code = inStructObj.getString("struct_code"); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java index a871c37..9bbf446 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java @@ -15,10 +15,7 @@ import org.nl.utils.SpringContextHolder; import org.nl.wms.BussConstant; import org.nl.wms.WorkProcedureEnum; import org.nl.wms.common.StructFindUtil; -import org.nl.wms.sch.manage.AbstractAcsTask; -import org.nl.wms.sch.manage.AreaEnum; -import org.nl.wms.sch.manage.BillTypeEnum; -import org.nl.wms.sch.manage.TaskStatusEnum; +import org.nl.wms.sch.manage.*; import org.nl.wms.sch.service.PointService; import org.nl.wms.sch.service.dto.PointDto; import org.nl.wms.sch.service.impl.PointServiceImpl; @@ -236,6 +233,7 @@ public class SendMaterialTask extends AbstractAcsTask { .process().uniqueResult(0); String workprocedure_id = workInfo.getString("workprocedure_id"); WorkProcedureEnum workProcedureEnum = WorkProcedureEnum.get(workprocedure_id); + String vehilce_type=""; switch (workProcedureEnum) { //混黏工序 @@ -243,6 +241,7 @@ public class SendMaterialTask extends AbstractAcsTask { qty_unit_id = BussConstant.HN_IN_QTY_UNIT_ID; endArea_type = AreaEnum.KLHJ.getCode(); bill_type = BillTypeEnum.HNRK.getCode(); + vehilce_type = VehicleTypeEnum.XLZ.getCode(); break; // 压制工序 case YZGX: @@ -259,7 +258,7 @@ public class SendMaterialTask extends AbstractAcsTask { //分拣工序 case FJGX: qty_unit_id = BussConstant.HN_IN_QTY_UNIT_ID; - bill_type = BillTypeEnum.SZRK.getCode(); + bill_type = BillTypeEnum.FJRK.getCode(); endArea_type = AreaEnum.BZZC.getCode(); break; default: @@ -270,6 +269,7 @@ public class SendMaterialTask extends AbstractAcsTask { param.put("material_id", material_id); param.put("area_type", endArea_type); param.put("vehicle_code", vehicle_code); + param.put("vehilce_type", vehilce_type); JSONObject inStructObj = StructFindUtil.getInStruct(param); if (ObjectUtil.isEmpty(inStructObj)) { throw new BadRequestException("未找到合适的入库仓位!"); @@ -278,8 +278,11 @@ public class SendMaterialTask extends AbstractAcsTask { //创建入库单据 //假如静置时间为0 或者为空,则取物料表上的静置时间 if (StrUtil.isEmpty(stewing_time) || StrUtil.equals(stewing_time, "0")) { - stewing_time = WQLObject.getWQLObject("md_me_material").query("material_id ='" + material_id + "'"). - uniqueResult(0).getString("stewing_time"); + stewing_time = WQLObject + .getWQLObject("md_me_material") + .query("material_id ='" + material_id + "'") + .uniqueResult(0) + .getString("stewing_time"); } JSONObject iosObj = new JSONObject(); iosObj.put("iostorinv_id", IdUtil.getSnowflake(1, 1).nextId()); @@ -315,7 +318,9 @@ public class SendMaterialTask extends AbstractAcsTask { //终点点加锁 HashMap lock_map = new HashMap(); lock_map.put("lock_type", "01"); - WQLObject.getWQLObject("sch_base_point").update(lock_map, "point_code = '" + next_point_code + "'"); + WQLObject + .getWQLObject("sch_base_point") + .update(lock_map, "point_code = '" + next_point_code + "'"); CodeUtil.getNewCode("TASK_CODE"); JSONObject taskObj = new JSONObject(); taskObj.put("task_id", task_id); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/BUSSTASK_001.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/BUSSTASK_001.wql new file mode 100644 index 0000000..beef090 --- /dev/null +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/BUSSTASK_001.wql @@ -0,0 +1,56 @@ +[交易说明] + 交易名: ACS发送请求给mes + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.workprocedure_id TYPEAS s_string + 输入.point_code TYPEAS s_string + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + task.vehicle_type + FROM + pdm_mg_producetask task + right JOIN sch_base_point point ON task.device_id = point.device_id + WHERE + task.producetask_status IN ('03', '04') + OPTION 输入.point_code <> "" + point.point_code = 输入.point_code + ENDOPTION + ENDSELECT + ENDQUERY + ENDIF diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/SectattrServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/SectattrServiceImpl.java index 4646446..e181c0f 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/SectattrServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/st/basedata/service/impl/SectattrServiceImpl.java @@ -205,7 +205,7 @@ public class SectattrServiceImpl implements SectattrService { JSONArray sect_ja = new JSONArray(); for (int j = 0; j < sect_arr.size(); j++) { JSONObject sect_jo = sect_arr.getJSONObject(j); - net.sf.json.JSONObject sect_cas = new net.sf.json.JSONObject(); + JSONObject sect_cas = new JSONObject(); sect_cas.put("value", sect_jo.getString("sect_id")); sect_cas.put("label", sect_jo.getString("sect_name")); sect_ja.add(sect_cas); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls index 467a391..5b7382a 100644 Binary files a/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/wms/hd/nladmin-system/src/main/java/org/nl/wms/wms.xls differ diff --git a/wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue b/wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue new file mode 100644 index 0000000..c4fafa4 --- /dev/null +++ b/wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/wms/qd/src/views/wms/pdm/produceTask/index.vue b/wms/qd/src/views/wms/pdm/produceTask/index.vue index bc1d109..4b2d08b 100644 --- a/wms/qd/src/views/wms/pdm/produceTask/index.vue +++ b/wms/qd/src/views/wms/pdm/produceTask/index.vue @@ -128,15 +128,9 @@ - - - - + + + @@ -148,7 +142,7 @@ /> - + - + @@ -298,6 +292,7 @@ + @@ -311,12 +306,13 @@ import pagination from '@crud/Pagination' import UploadDialog from '@/views/wms/pdm/produceTask/UploadDialog' import CopyDialog from '@/views/wms/pdm/produceTask/CopyDialog' import SortDialog from '@/views/wms/pdm/produceTask/SortDialog' +import MaterDialog from './MaterDialog.vue' -const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null } +const defaultForm = { producetask_id: null, producetask_code: null, producetask_status: null, material_id: null, material_name: null, device_id: null, produceline_id: null, cust_id: null, seq_no: null, plan_qty: null, real_qty: null, plan_start_time: null, real_start_time: null, plan_end_time: null, real_end_time: null, producetask_finish_type: null, stand_hour: null, remark: null, create_id: null, create_name: null, create_time: null, update_optid: null, update_optname: null, update_time: null, is_delete: null, model: null, molten_pool: null, is_package: '0' } export default { name: 'Producetask', dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'], - components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog, CopyDialog, SortDialog }, + components: { pagination, crudOperation, rrOperation, udOperation, UploadDialog, CopyDialog, SortDialog, MaterDialog }, mixins: [presenter(), header(), form(defaultForm), crud()], cruds() { return CRUD({ title: '生产任务', url: 'api/producetask', idField: 'producetask_id', sort: 'producetask_id,desc', optShow: { add: true, edit: false, del: false, download: false, reset: true }, crudMethod: { ...crudProducetask }}) @@ -340,16 +336,15 @@ export default { sort_update: false, openParam: {}, currentRow: null, + materDialog: false, + materType: '', rules: { - material_id: [ - { required: true, message: '物料标识不能为空', trigger: 'blur' } - ], device_id: [ { required: true, message: '设备标识不能为空', trigger: 'blur' } ], - produceline_id: [ - { required: true, message: '产线标识不能为空', trigger: 'blur' } - ], + // produceline_id: [ + // { required: true, message: '产线标识不能为空', trigger: 'blur' } + // ], seq_no: [ { required: true, message: '生产顺序不能为空', trigger: 'blur' } ], @@ -364,6 +359,9 @@ export default { ], stand_hour: [ { required: true, message: '静置时间不能为空', trigger: 'blur' } + ], + material_name: [ + { required: true, message: '物料不能为空', trigger: 'change' } ] }, queryTypeOptions: [ @@ -499,6 +497,14 @@ export default { }, tableChanged1() { this.crud.toQuery() + }, + getMater() { + this.materDialog = true + }, + tableChanged4(row) { + console.log(row) + this.form.material_id = row.material_id + this.form.material_name = row.material_name } } }