From 7b1a7afa7d3055faddeac796cb651317a34999f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Tue, 6 Sep 2022 19:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E6=B6=B2=E5=8E=8B=E6=9C=BA?= =?UTF-8?q?=E5=87=BA=E5=BA=93=E5=90=8E=E5=B0=86=E7=82=B9=E4=BD=8D=E7=BD=AE?= =?UTF-8?q?=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/nl/wms/common/StructFindUtil.java | 6 ++-- .../org/nl/wms/common/wql/QSTRUCT_RULE.wql | 25 ++++++++-------- .../service/impl/CallMaterialServiceImpl.java | 2 ++ .../service/impl/PressureOutServiceImpl.java | 9 +++++- .../wms/pdm/rest/ProducetaskController.java | 2 +- .../wms/pdm/service/ProducetaskService.java | 2 +- .../service/impl/ProducetaskServiceImpl.java | 30 ++++++------------- .../sch/manage/buss/CallEmptyVehicleTask.java | 12 ++++++-- .../org/nl/wms/sch/manage/buss/DumpTask.java | 8 +++-- .../sch/manage/buss/SendEmptyVehicleTask.java | 3 ++ .../wms/sch/service/impl/TaskServiceImpl.java | 2 +- .../src/views/wms/pdm/produceTask/index.vue | 11 +++---- 12 files changed, 60 insertions(+), 52 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 47145e9..980430b 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 @@ -74,7 +74,7 @@ public class StructFindUtil { } public static JSONObject getEmptyVehicleInStruct(JSONObject jsonObject) { - String vehice_type = ""; + String vehicle_type = ""; String area_type = jsonObject.getString("area_type"); String vehicle_code = jsonObject.getString("vehicle_code"); String point_code = jsonObject.getString("point_code"); @@ -87,13 +87,13 @@ public class StructFindUtil { if (ObjectUtil.isEmpty(vehicleObj)) { throw new BadRequestException("未找到托盘号为'" + vehicle_code + "' 托盘信息!"); } - vehice_type = vehicleObj.getString("vehicle_type"); + vehicle_type = vehicleObj.getString("vehicle_type"); } JSONObject result = WQL .getWO("QSTRUCT_RULE") .addParam("flag", "4") .addParam("area_type", area_type) - .addParam("vehice_type", vehice_type) + .addParam("vehicle_type", vehicle_type) .addParam("point_code", point_code) .process() .uniqueResult(0); 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 a03eced..8c89c47 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,17 +13,17 @@ ################################################# ## 表字段对应输入参数 ################################################# - 输入.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 - 输入.vehicle_type TYPEAS s_string - 输入.workprocedure_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 - 输入.point_vehicle_type TYPEAS s_string + 输入.vehicle_type TYPEAS s_string + 输入.point_code TYPEAS s_string + 输入.point_vehicle_type TYPEAS s_string [临时表] @@ -155,11 +155,12 @@ IF 输入.flag = "4" point.point_id as struct_id, point.point_code as struct_code, point.point_name as struct_name - FROM - sch_base_point point - WHERE + FROM + sch_base_point point + LEFT JOIN ST_IVT_StructRelaVehicleType rulevehicle ON rulevehicle.struct_id = point.point_id + WHERE point.lock_type = '00' - AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL ) + AND ( point.vehicle_code = '' OR point.vehicle_code IS NULL ) AND point.point_status = '00' OPTION 输入.area_type <> "" point.area_type = 输入.area_type 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 069621f..276f70b 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 @@ -19,6 +19,7 @@ import org.nl.wms.common.StructFindUtil; import org.nl.wms.pda.callMaterial.service.CallMaterialService; import org.nl.wms.pda.exception.PdaRequestException; import org.nl.wms.sch.manage.AreaEnum; +import org.nl.wms.sch.manage.VehicleTypeEnum; import org.nl.wms.sch.manage.buss.CallEmptyVehicleTask; import org.nl.wms.sch.manage.buss.CallMaterialTask; import org.nl.wms.sch.manage.buss.DumpTask; @@ -71,6 +72,7 @@ public class CallMaterialServiceImpl implements CallMaterialService { param1.put("material_id", material_id); param1.put("area_type", startArea_type); param1.put("workprocedure_id", WorkProcedureEnum.HNGX.getId()); + param1.put("vehicle_type", VehicleTypeEnum.DLZ.getCode()); param1.put("is_full", is_full); JSONObject outStructObj = StructFindUtil.getOutStruct(param1); if (ObjectUtil.isEmpty(outStructObj)) { diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/pressout/service/impl/PressureOutServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/pressout/service/impl/PressureOutServiceImpl.java index 31ca13b..67d8c79 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/pressout/service/impl/PressureOutServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pda/pressout/service/impl/PressureOutServiceImpl.java @@ -63,7 +63,7 @@ public class PressureOutServiceImpl implements PressurelOutService { } //创建出库单据 JSONObject iosObj = new JSONObject(); - String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + ""; + String iostorinv_id = IdUtil.getSnowflake(1, 1).nextId() + ""; iosObj.put("iostorinv_id", iostorinv_id); iosObj.put("bill_code", CodeUtil.getNewCode("OUT_STORE_CODE")); iosObj.put("io_type", "1"); @@ -100,6 +100,13 @@ public class PressureOutServiceImpl implements PressurelOutService { jo.put("struct_id", point_id); StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl(); ivtService.addIvtFlow(jo, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE); + + // 将点位置空 + JSONObject empty = new JSONObject(); + empty.put("point_status", "00"); + empty.put("vehicle_code", ""); + WQLObject.getWQLObject("sch_base_point").update(empty, "point_code = '" + point_code + "'"); + JSONObject returnjo = new JSONObject(); returnjo.put("code", "1"); returnjo.put("desc", "操作成功!"); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java index c70efaa..386d474 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/rest/ProducetaskController.java @@ -172,7 +172,7 @@ public class ProducetaskController { @PostMapping("/getVehicleType") @Log("通过设备查询可用载具类型") @ApiOperation("通过设备查询可用载具类型") - public ResponseEntity getVehicleTypeByDeviceId(@RequestBody JSONObject device) { + public ResponseEntity getVehicleTypeByDeviceId(@RequestBody JSONObject device) { return new ResponseEntity<>(producetaskService.getVehicleTypeByDeviceId(device.getLong("device_id")), HttpStatus.OK); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java index 542744f..e665b7d 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/ProducetaskService.java @@ -148,5 +148,5 @@ public interface ProducetaskService { * @param deviceId 设备id * @return 字典表数组 */ - JSONObject getVehicleTypeByDeviceId(Long deviceId); + JSONArray getVehicleTypeByDeviceId(Long deviceId); } diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java index a1c4a36..59f1c66 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/ProducetaskServiceImpl.java @@ -420,14 +420,11 @@ public class ProducetaskServiceImpl implements ProducetaskService { } @Override - public JSONObject getVehicleTypeByDeviceId(Long deviceId) { + public JSONArray getVehicleTypeByDeviceId(Long deviceId) { WQLObject dict = WQLObject.getWQLObject("sys_dict_detail"); - JSONObject result = new JSONObject(); - result.put("isHLJ", false); if (ObjectUtil.isEmpty(deviceId)) { // 如果请求参数为空返回所有 - result.put("vehicleTypeList", dict.query("dict_id = 25").getResultJSONArray(0)); - return result; + return dict.query("dict_id = 25").getResultJSONArray(0); } // 根据设备id查询设备 @@ -449,32 +446,23 @@ public class ProducetaskServiceImpl implements ProducetaskService { assert workProcedure != null; switch (workProcedure) { case HNGX: - result.put("isHLJ", true); // 混料机只能使用料盅 - result.put("vehicleTypeList", - dict + return dict .query("dict_id = 25 AND (value = '01' OR value = '09')") - .getResultJSONArray(0)); - break; + .getResultJSONArray(0); case YZGX: // 压制机只能使用钢托 - result.put("vehicleTypeList", - dict + return dict .query("dict_id = 25 AND value = '02'") - .getResultJSONArray(0)); - break; + .getResultJSONArray(0); case FJGX: // 分拣机只能使用木托盘 - result.put("vehicleTypeList", - dict + return dict .query("dict_id = 25 AND value IN ('03', '04', '05', '06', '07', '08')") - .getResultJSONArray(0)); - break; + .getResultJSONArray(0); default: // 其它返回所有 - result.put("vehicleTypeList", dict.query("dict_id = 25").getResultJSONArray(0)); + return dict.query("dict_id = 25").getResultJSONArray(0); } - - return result; } } 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 adfefd6..12c0cd3 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 @@ -188,6 +188,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { } String start_point_code = form.getString("start_point_code"); String vehicle_type = form.getString("vehicle_type"); + String point_vehicle_type =""; WQLObject taskTable = WQLObject.getWQLObject("sch_base_task"); //判断起点有没有未完成的指令 JSONObject beforTaskObj = taskTable @@ -213,7 +214,11 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { case HNGX: 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"); + vehicle_type = WQLObject + .getWQLObject("PDM_MG_produceTask") + .query("device_id='" + device_id + "' and producetask_status='04'") + .uniqueResult(0) + .getString("vehicle_type"); break; // 压制工序 case YZGX: @@ -229,7 +234,7 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { //分拣工序 case FJGX: //托盘类型取当前工单生产的托盘类型 - vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type"); + point_vehicle_type = WQLObject.getWQLObject("PDM_MG_produceTask").query("device_id='" + device_id + "' and producetask_status='04'").uniqueResult(0).getString("vehicle_type"); start_area = AreaEnum.RGCPQ.getCode(); is_auto_issue = "0"; //更新设备点位。 @@ -250,7 +255,8 @@ public class CallEmptyVehicleTask extends AbstractAcsTask { start_area = AreaEnum.KLHJ.getCode(); } JSONObject param = new JSONObject(); - param.put("point_vehicle_type", vehicle_type); + param.put("vehicle_type", vehicle_type); + param.put("point_vehicle_type", point_vehicle_type); param.put("area_type", start_area); param.put("point_code", start_point_code); JSONObject outStructObj = StructFindUtil.getEmptyVehicleOutStruct(param); diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/DumpTask.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/DumpTask.java index 0aac09e..56f137d 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/DumpTask.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/manage/buss/DumpTask.java @@ -98,15 +98,16 @@ public class DumpTask extends AbstractAcsTask { taskObj.put("task_id", IdUtil.getSnowflake(1,1).nextId()); } taskObj.put("task_code", CodeUtil.getNewCode("TASK_CODE")); - taskObj.put("task_type", "04"); String task_status = TaskStatusEnum.START_AND_POINT.getCode(); taskObj.put("task_status", task_status); taskObj.put("start_point_code", form.getString("start_point_code")); taskObj.put("next_point_code", form.getString("next_point_code")); taskObj.put("vehicle_code", form.getString("vehicle_code")); taskObj.put("create_id", SecurityUtils.getCurrentUserId()); + taskObj.put("create_name", SecurityUtils.getNickName()); taskObj.put("create_time", DateUtil.now()); taskObj.put("handle_class", THIS_CLASS); + taskObj.put("task_type", "05"); //任务基础表【sch_base_task】 WQLObject.getWQLObject("sch_base_task").insert(taskObj); return taskObj.getString("task_id"); @@ -119,7 +120,10 @@ public class DumpTask extends AbstractAcsTask { if (StrUtil.isEmpty(task_id)) { throw new BadRequestException("任务id不能为空!"); } - JSONObject taskjo = WQLObject.getWQLObject("sch_base_task").query("task_id='" + task_id + "'").uniqueResult(0); + JSONObject taskjo = WQLObject + .getWQLObject("sch_base_task") + .query("task_id='" + task_id + "'") + .uniqueResult(0); taskjo.getString("taskfinish_mode"); this.updateTaskStatus(taskjo, TaskStatusEnum.FINISHED.getCode()); } 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 566e547..56732b1 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 @@ -203,6 +203,9 @@ public class SendEmptyVehicleTask extends AbstractAcsTask { param.put("vehicle_code", vehicle_code); param.put("point_code", next_point_code); JSONObject inStructObj = StructFindUtil.getEmptyVehicleInStruct(param); + if (ObjectUtil.isEmpty(inStructObj)) { + throw new BadRequestException("未找到合适的入库点位"); + } next_point_code = inStructObj.getString("struct_code"); } String bill_status = "10"; diff --git a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java index d3411e1..92cfacc 100644 --- a/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java +++ b/wms/hd/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/TaskServiceImpl.java @@ -185,7 +185,7 @@ public class TaskServiceImpl implements TaskService { Class clz = Class.forName(processing_class); Object obj = clz.newInstance(); // 调用每个任务类的method_name()强制结束方法 - Method m = obj.getClass().getMethod(method_name, String.class); + Method m = clz.getMethod(method_name, String.class); JSONObject result = (JSONObject) m.invoke(obj, task_id); if (ObjectUtil.isEmpty(result)) return; JSONArray arr = result.getJSONArray("errArr"); diff --git a/wms/qd/src/views/wms/pdm/produceTask/index.vue b/wms/qd/src/views/wms/pdm/produceTask/index.vue index 171b403..373d8d4 100644 --- a/wms/qd/src/views/wms/pdm/produceTask/index.vue +++ b/wms/qd/src/views/wms/pdm/produceTask/index.vue @@ -166,8 +166,8 @@ - - + + @@ -308,7 +308,7 @@ 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, 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, stewing_time: null, is_package: '0' } +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, stewing_time: 0, is_package: '0' } export default { name: 'Producetask', dicts: ['PRODUCETASK_STATUS', 'PRODUCETASK_STATUS_TYPE', 'MD_EVEHICLE_TYPE'], @@ -339,7 +339,6 @@ export default { materDialog: false, materType: '', vehicleTypeList: [], - isHLJ: false, rules: { device_id: [ { required: true, message: '设备标识不能为空', trigger: 'blur' } @@ -515,9 +514,7 @@ export default { } const data = { device_id: this.form.device_id } crudProducetask.getVehicleType(data).then(res => { - console.log(res) - this.vehicleTypeList = res.vehicleTypeList - this.isHLJ = res.isHLJ + this.vehicleTypeList = res }) } }