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 } } }