From 69b1ad21ffbb42de3ef91c1a9658e495e6b55a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Wed, 31 Aug 2022 14:15:11 +0800 Subject: [PATCH 01/10] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=A1=A8=E5=8D=95=EF=BC=8C=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=89=98=E7=9B=98=E7=B1=BB=E5=9E=8B=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=B6=89=E5=8F=8A=E6=89=98=E7=9B=98=E7=B1=BB=E5=9E=8B=E7=9A=84?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/nl/wms/.~lock.wms.xls# | 1 + .../org/nl/wms/common/StructFindUtil.java | 2 + .../org/nl/wms/common/wql/QSTRUCT_RULE.wql | 59 ++++--- .../wms/ext/acs/rest/AcsToWmsController.java | 11 +- .../acs/service/impl/AcsToWmsServiceImpl.java | 14 +- .../nl/wms/sch/manage/VehicleTypeEnum.java | 10 +- .../sch/manage/buss/CallEmptyVehicleTask.java | 30 ++-- .../wms/sch/manage/buss/SendMaterialTask.java | 8 +- .../java/org/nl/wms/sch/wql/BUSSTASK_001.wql | 56 +++++++ .../service/impl/SectattrServiceImpl.java | 2 +- .../views/wms/pdm/produceTask/MaterDialog.vue | 155 ++++++++++++++++++ .../src/views/wms/pdm/produceTask/index.vue | 44 ++--- 12 files changed, 317 insertions(+), 75 deletions(-) create mode 100644 wms/hd/nladmin-system/src/main/java/org/nl/wms/.~lock.wms.xls# create mode 100644 wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/wql/BUSSTASK_001.wql create mode 100644 wms/qd/src/views/wms/pdm/produceTask/MaterDialog.vue 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/common/StructFindUtil.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java index dba858e..accbde6 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 @@ -38,6 +38,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"); + String vehicle_type = jsonObject.getString("vehicle_type"); if (StrUtil.isEmpty(material_id)) { throw new BadRequestException("物料不能为空!"); @@ -53,6 +54,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; 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..839aa94 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 @@ -15,12 +15,13 @@ ################################################# 输入.flag TYPEAS s_string 输入.code TYPEAS s_string - 输入.material_id TYPEAS s_string - 输入.sect_id 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 + 输入.workprocedure_id TYPEAS s_string + 输入.is_full TYPEAS s_string + 输入.vehicle_type TYPEAS s_string [临时表] @@ -103,28 +104,32 @@ 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, + 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 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..5185bf7 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", "200"); + 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", "200"); + result.put("message", "发送任务成功"); + return new ResponseEntity<>(result, HttpStatus.OK); } 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..c86dc0d 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 @@ -78,7 +78,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { produceInfoByCode = this.getProduceInfoByCode(device_code); //批次 物料,客户要从排产单里面去取 jsonObject.put("pcsn", "pcsn"); - jsonObject.put("material_id", "1515940603542769664"); + jsonObject.put("material_id", produceInfoByCode.getString("material_id")); jsonObject.put("cust_id", "1516368197694132224"); callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject)); break; @@ -324,6 +324,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 +339,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/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..ce19bed 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,9 +205,9 @@ 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: @@ -211,13 +222,12 @@ 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; default: - vehicle_type = VehicleTypeEnum.LZ.getCode(); + vehicle_type = VehicleTypeEnum.DLZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); } JSONObject param = new JSONObject(); 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..6fa18bf 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: @@ -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("未找到合适的入库仓位!"); 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/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 } } } From 695a50f416c8095ca14bd37a30faeb5b4f7e07b7 Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Wed, 31 Aug 2022 14:19:39 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=80=81=E7=A9=BA?= =?UTF-8?q?=E6=89=98=E7=9B=98=E7=9A=84=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=B7=9Facs=E4=BA=A4=E4=BA=92=E7=9A=84=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/common/PointUpdateUtil.java | 33 ++++++++++++++++++ .../wms/ext/acs/rest/WmsToAcsController.java | 8 +++++ .../wms/ext/acs/service/WmsToAcsService.java | 6 ++++ .../acs/service/impl/WmsToAcsServiceImpl.java | 10 ++++-- .../sch/manage/buss/CallEmptyVehicleTask.java | 3 +- .../src/main/java/org/nl/wms/wms.xls | Bin 399872 -> 399872 bytes 6 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 wms/hd/nladmin-system/src/main/java/org/nl/wms/common/PointUpdateUtil.java 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/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/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/sch/manage/buss/CallEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java index ce19bed..d2b1f3d 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 @@ -212,7 +212,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { // 压制工序 case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); - start_area = AreaEnum.CYHJ.getCode(); + start_area = AreaEnum.KGTDDQ.getCode(); + break; //烧制工序 case SZGX: 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 467a391b41aa383abd8bfb6340a41b258e8f6e65..5b7382a3b9a08a6ee21b8da4768b726b5eb1a2aa 100644 GIT binary patch delta 45 ucmZqJBGIr#VnYrKn?TUw+eUkui&)x=SQvqr35c127{q7YUc|!ICkg;>^bTAA delta 45 ucmZqJBGIr#VnYrK+XTVq_hgne7qPS#u`mKL6A&{4F^JE)y@-XaPZR)rxDK`e From b530ec8590be33517021ce68d79f03f831526e74 Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Wed, 31 Aug 2022 15:03:51 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/nl/wms/WorkProcedureEnum.java | 3 +- .../org/nl/wms/common/StructFindUtil.java | 23 +++++++++++-- .../org/nl/wms/common/wql/QSTRUCT_RULE.wql | 32 ++++++++++--------- .../org/nl/wms/ext/acs/wql/ACSTOMES_001.wql | 19 +++++++++++ .../sch/manage/buss/CallEmptyVehicleTask.java | 22 ++++++++++--- .../sch/manage/buss/SendEmptyVehicleTask.java | 4 +-- 6 files changed, 78 insertions(+), 25 deletions(-) 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..7450757 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,8 @@ 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", "分拣工序", ""); //顺序号 private int index; //工序标识 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 accbde6..b6d1270 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; @@ -63,9 +65,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.KGTDDQ).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)) { @@ -76,18 +83,30 @@ 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,"KGTPDDW05")){ + JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).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); + .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 839aa94..58a4b00 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,15 +13,16 @@ ################################################# ## 表字段对应输入参数 ################################################# - 输入.flag TYPEAS s_string - 输入.code 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 + 输入.area_type TYPEAS s_string 输入.vehicle_type TYPEAS s_string - 输入.workprocedure_id TYPEAS s_string + 输入.workprocedure_id TYPEAS s_string 输入.is_full TYPEAS s_string 输入.vehicle_type TYPEAS s_string + 输入.point_code TYPEAS s_string [临时表] @@ -149,13 +150,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 ) @@ -163,12 +162,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 @@ -181,8 +180,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 @@ -196,6 +193,11 @@ IF 输入.flag = "5" OPTION 输入.vehicle_type <> "" vehicle.vehicle_type = 输入.vehicle_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/wql/ACSTOMES_001.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql index 13a4e9a..f387989 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 @@ -61,3 +61,22 @@ ENDSELECT ENDQUERY ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + + point.point_code as device_code + FROM + sch_base_point point + WHERE + 1=1 + 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/sch/manage/buss/CallEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java index d2b1f3d..f46aaaf 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 @@ -115,17 +115,17 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { vehicle_type = VehicleTypeEnum.XLZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); break; - // 压制工序 + // 压制工序 case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); start_area = AreaEnum.KLHJ.getCode(); break; - //烧制工序 + //烧制工序 case SZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); start_area = AreaEnum.KLHJ.getCode(); break; - //分拣工序 + //分拣工序 case FJGX: // 根据点位code查找对应设备,根据设备查找对应工单,从工单中取托盘类型 vehicle_type = WQL.getWO("BUSSTASK_001") @@ -141,7 +141,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { start_area = AreaEnum.KLHJ.getCode(); } //寻找一个合适的仓位 - param.put("vehicle_type",vehicle_type); + param.put("vehicle_type", vehicle_type); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); if (ObjectUtil.isEmpty(outStructObj)) { continue; @@ -213,7 +213,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); start_area = AreaEnum.KGTDDQ.getCode(); - + start_point_code = "KGTPDDW05"; break; //烧制工序 case SZGX: @@ -227,6 +227,13 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { 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.DLZ.getCode(); start_area = AreaEnum.KLHJ.getCode(); @@ -234,6 +241,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { 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("未找到合适的空托盘点位"); @@ -258,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/SendEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java index 2b9df6c..e138990 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) @@ -186,6 +184,7 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { //分拣工序 case FJGX: next_area = AreaEnum.KGTDDQ.getCode(); + next_point_code = "KGTPDDW05"; break; default: next_area = AreaEnum.KLHJ.getCode(); @@ -193,6 +192,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"); } From afaac0aafea6ac852663df4be1531ba91804e863 Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Wed, 31 Aug 2022 16:55:55 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E6=89=8B=E6=8C=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CallMaterialServiceImpl.java | 19 ++++++------------- .../wms/sch/manage/buss/CallMaterialTask.java | 3 --- 2 files changed, 6 insertions(+), 16 deletions(-) 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/buss/CallMaterialTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallMaterialTask.java index 52a3589..b655488 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 @@ -179,9 +179,6 @@ public class CallMaterialTask extends AbstractAcsTask { if (StrUtil.isEmpty(material_id)) { throw new BadRequestException("物料标识不能为空!"); } - if (StrUtil.isEmpty(cust_id)) { - throw new BadRequestException("客户不能为空!"); - } if (StrUtil.isEmpty(create_mode)) { throw new BadRequestException("创建方式不能为空!"); } From e8128dc341c4130669bc99381c16f30bb0e5ddef Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Wed, 31 Aug 2022 17:03:39 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=91=BC=E5=8F=AB=E7=A9=BA=E6=89=98?= =?UTF-8?q?=E7=9B=98=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/common/StructFindUtil.java | 30 ++++++++++++------- .../org/nl/wms/common/wql/QSTRUCT_RULE.wql | 22 +++++++++++++- 2 files changed, 40 insertions(+), 12 deletions(-) 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 b6d1270..0854dbd 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 @@ -69,7 +69,7 @@ public class StructFindUtil { if (StrUtil.isEmpty(vehicle_code)) { throw new BadRequestException("托盘不能为空!"); } - if (StrUtil.equals(point_code,"KGTPDDW05")){ + if (StrUtil.equals(point_code, "KGTPDDW05")) { JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); } @@ -93,20 +93,28 @@ public class StructFindUtil { 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"); + String point_code = jsonObject.getString("point_code"); + if (StrUtil.isEmpty(area_type)) { + throw new BadRequestException("区域不能为空!"); + } + JSONObject result = new JSONObject(); //如果是堆叠位5 需要更新 设备状态 - if(StrUtil.equals(point_code,"KGTPDDW05")){ + if (StrUtil.equals(point_code, "KGTPDDW05")) { JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).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); } - 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) - .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 58a4b00..a8ef5dc 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 @@ -196,8 +196,28 @@ IF 输入.flag = "5" 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 From c5a4ca275cbf2c20d5ef4023970723b799015e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Wed, 31 Aug 2022 17:05:21 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E9=92=A2=E6=89=98=E5=89=8D=E7=BC=80?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20KGTDDW05?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/nl/wms/common/StructFindUtil.java | 4 ++-- .../java/org/nl/wms/ext/acs/rest/AcsToWmsController.java | 4 ++-- .../src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql | 7 +++++-- .../org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) 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 b6d1270..c90f966 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 @@ -95,8 +95,8 @@ public class StructFindUtil { String vehicle_type = jsonObject.getString("vehicle_type"); String point_code = jsonObject.getString("point_code"); //如果是堆叠位5 需要更新 设备状态 - if(StrUtil.equals(point_code,"KGTPDDW05")){ - JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); + if(StrUtil.equals(point_code,"KGTDDW05")){ + JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); } if (StrUtil.isEmpty(area_type)) { 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 5185bf7..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 @@ -36,7 +36,7 @@ public class AcsToWmsController { public ResponseEntity receiveTaskFromAcs(@RequestBody Map whereJson) { acsToWmsService.receiveTaskFromAcs(whereJson); JSONObject result = new JSONObject(); - result.put("status", "200"); + result.put("status", HttpStatus.OK.value()); result.put("message", "发送任务成功"); return new ResponseEntity<>(result, HttpStatus.OK); } @@ -47,7 +47,7 @@ public class AcsToWmsController { public ResponseEntity manipulatorApply(@RequestBody Map whereJson) { acsToWmsService.manipulatorApply(whereJson); JSONObject result = new JSONObject(); - result.put("status", "200"); + 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/wql/ACSTOMES_001.wql b/wms/hd/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACSTOMES_001.wql index f387989..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 [临时表] --这边列出来的临时表就会在运行期动态创建 @@ -71,6 +73,7 @@ sch_base_point point WHERE 1=1 + AND point.is_delete = '0' OPTION 输入.area_type <> "" point.area_type = 输入.area_type ENDOPTION 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 f46aaaf..56522a1 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 @@ -213,7 +213,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); start_area = AreaEnum.KGTDDQ.getCode(); - start_point_code = "KGTPDDW05"; + start_point_code = "KGTDDW05"; break; //烧制工序 case SZGX: From 6cc74bac060ebbae10a35517df3e2cbd62d8c78a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Wed, 31 Aug 2022 17:26:36 +0800 Subject: [PATCH 07/10] no message --- .../main/java/org/nl/wms/common/StructFindUtil.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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 892b3d5..b8771fa 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 @@ -93,22 +93,22 @@ public class StructFindUtil { public static JSONObject getEmptyVehicleOutStruct(JSONObject jsonObject) { String area_type = jsonObject.getString("area_type"); String vehicle_type = jsonObject.getString("vehicle_type"); -<<<<<<< HEAD String point_code = jsonObject.getString("point_code"); //如果是堆叠位5 需要更新 设备状态 if(StrUtil.equals(point_code,"KGTDDW05")){ - JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); + JSONArray pointarr = WQL.getWO("ACSTOMES_001") + .addParam("area_type", AreaEnum.KGTDDQ.getCode()) + .addParam("point_code","KGTDDW05") + .addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); } -======= - String point_code = jsonObject.getString("point_code"); ->>>>>>> e8128dc341c4130669bc99381c16f30bb0e5ddef + if (StrUtil.isEmpty(area_type)) { throw new BadRequestException("区域不能为空!"); } JSONObject result = new JSONObject(); //如果是堆叠位5 需要更新 设备状态 - if (StrUtil.equals(point_code, "KGTPDDW05")) { + if (StrUtil.equals(point_code, "KGTDDW05")) { JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6") From b7c969a35e219b3bc6f8889abbce410def4f62d5 Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Thu, 1 Sep 2022 10:00:30 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/nl/wms/common/StructFindUtil.java | 6 +----- .../main/java/org/nl/wms/common/wql/QSTRUCT_RULE.wql | 1 + .../wms/ext/acs/service/impl/AcsToWmsServiceImpl.java | 11 ++++++++--- .../org/nl/wms/sch/manage/buss/CallMaterialTask.java | 6 +++--- 4 files changed, 13 insertions(+), 11 deletions(-) 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 b8771fa..8958fe4 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 @@ -41,10 +41,6 @@ public class StructFindUtil { String is_full = jsonObject.getString("is_full"); String workprocedure_id = jsonObject.getString("workprocedure_id"); String vehicle_type = jsonObject.getString("vehicle_type"); - - if (StrUtil.isEmpty(material_id)) { - throw new BadRequestException("物料不能为空!"); - } if (StrUtil.isEmpty(area_type)) { throw new BadRequestException("区域不能为空!"); } @@ -109,7 +105,7 @@ public class StructFindUtil { JSONObject result = new JSONObject(); //如果是堆叠位5 需要更新 设备状态 if (StrUtil.equals(point_code, "KGTDDW05")) { - JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); + JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "6") .addParam("area_type", area_type) 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 a8ef5dc..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 @@ -114,6 +114,7 @@ IF 输入.flag = "3" ivt.qty_unit_id, ivt.pcsn, ivt.qty_unit_id, + ivt.material_id, ruledis.out_seq_no FROM st_ivt_structivt ivt 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 c86dc0d..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", produceInfoByCode.getString("material_id")); + 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"); 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 b655488..dba2ff4 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 @@ -176,9 +176,6 @@ public class CallMaterialTask extends AbstractAcsTask { if (StrUtil.isEmpty(next_point_code)) { throw new BadRequestException("终点不能为空!"); } - if (StrUtil.isEmpty(material_id)) { - throw new BadRequestException("物料标识不能为空!"); - } if (StrUtil.isEmpty(create_mode)) { throw new BadRequestException("创建方式不能为空!"); } @@ -296,6 +293,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); From 404e71d265efa3687604ed53eb7b9682751a6318 Mon Sep 17 00:00:00 2001 From: 18188916393 <2562295436@qq.com> Date: Thu, 1 Sep 2022 13:36:03 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/nl/wms/WorkProcedureEnum.java | 3 ++- .../src/main/java/org/nl/wms/common/StructFindUtil.java | 7 +++---- .../src/main/java/org/nl/wms/sch/manage/AreaEnum.java | 7 ++++--- .../org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java | 2 +- .../org/nl/wms/sch/manage/buss/SendEmptyVehicleTask.java | 9 +++++++-- 5 files changed, 17 insertions(+), 11 deletions(-) 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 7450757..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 @@ -12,7 +12,8 @@ public enum WorkProcedureEnum { YZGX(2, "1514444247439380480", "02", "压制工序", ""), SZGX(3, "1514444321896665088", "03", "烧制工序", ""), FJGX(4, "1514444386174373888", "04", "分拣工序", ""), - DPGX(4, "1514444386174373888", "05", "分拣工序", ""); + 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/StructFindUtil.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/common/StructFindUtil.java index 8958fe4..7255776 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 @@ -66,7 +66,7 @@ public class StructFindUtil { throw new BadRequestException("托盘不能为空!"); } if (StrUtil.equals(point_code, "KGTPDDW05")) { - JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ).addParam("flag", "2").process().getResultJSONArray(0); + JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTCPQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); } //根据托盘找托盘类型, @@ -93,8 +93,7 @@ public class StructFindUtil { //如果是堆叠位5 需要更新 设备状态 if(StrUtil.equals(point_code,"KGTDDW05")){ JSONArray pointarr = WQL.getWO("ACSTOMES_001") - .addParam("area_type", AreaEnum.KGTDDQ.getCode()) - .addParam("point_code","KGTDDW05") + .addParam("area_type", AreaEnum.KGTCPQ.getCode()) .addParam("flag", "2").process().getResultJSONArray(0); PointUpdateUtil.updatePoint(pointarr); } @@ -105,7 +104,7 @@ public class StructFindUtil { JSONObject result = new JSONObject(); //如果是堆叠位5 需要更新 设备状态 if (StrUtil.equals(point_code, "KGTDDW05")) { - JSONArray pointarr = WQL.getWO("ACSTOMES_001").addParam("area_type", AreaEnum.KGTDDQ.getCode()).addParam("flag", "2").process().getResultJSONArray(0); + 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) 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/buss/CallEmptyVehicleTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/CallEmptyVehicleTask.java index 56522a1..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 @@ -212,7 +212,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { // 压制工序 case YZGX: vehicle_type = VehicleTypeEnum.GTP.getCode(); - start_area = AreaEnum.KGTDDQ.getCode(); + start_area = AreaEnum.KGTCPQ.getCode(); start_point_code = "KGTDDW05"; break; //烧制工序 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 e138990..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 @@ -183,8 +183,13 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { break; //分拣工序 case FJGX: - next_area = AreaEnum.KGTDDQ.getCode(); - next_point_code = "KGTPDDW05"; + 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(); From 7372060d55446e2cd5bf0dbaec3e027fd89582a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Thu, 1 Sep 2022 17:33:34 +0800 Subject: [PATCH 10/10] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/common/StructFindUtil.java | 15 +++++++++++--- .../wms/sch/manage/buss/CallMaterialTask.java | 20 ++++++++++--------- .../wms/sch/manage/buss/SendMaterialTask.java | 13 ++++++++---- 3 files changed, 32 insertions(+), 16 deletions(-) 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 7255776..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 @@ -19,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 + "' 托盘信息!"); } @@ -30,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; } 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 dba2ff4..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,15 +164,14 @@ 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("终点不能为空!"); } @@ -183,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") + "' 未完成!"); @@ -216,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); @@ -316,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/SendMaterialTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/SendMaterialTask.java index 6fa18bf..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 @@ -258,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: @@ -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);