diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java index c30058b..8b1f79f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/service/impl/MaterialbaseServiceImpl.java @@ -119,24 +119,24 @@ public class MaterialbaseServiceImpl implements MaterialbaseService { if (ObjectUtil.isEmpty(furnace_name)) { throw new BadRequestException("物料编码解析错误:未知炉型!"); } - material_detail.put("furnace", furnace_code); + material_detail.put("furnace", furnace_name.getString("label")); String material_brick_code = material_code.substring(2, 5); JSONObject material_brick_type = dict_detail_table.query("name = 'material_brick_type' AND value = '" + material_brick_code + "'").uniqueResult(0); if (ObjectUtil.isEmpty(material_brick_type)) { throw new BadRequestException("物料编码解析错误:未知物料砖类型!"); } - material_detail.put("material_brick_type", material_brick_code); + material_detail.put("material_brick_type", material_brick_type.getString("label")); String bom_code = material_code.substring(5, 11); - JSONObject bom = new JSONObject(); - bom.put("material_id", IdUtil.getSnowflake(1, 1).nextId()); - bom.put("material_code", bom_code); - bom.put("material_type", "2"); - bom.put("create_id", currentUserId); - bom.put("create_name", nickName); - bom.put("create_time", now); JSONObject old_bom = wo.query("material_code = '" + bom_code + "'").uniqueResult(0); if (ObjectUtil.isEmpty(old_bom)) { + JSONObject bom = new JSONObject(); + bom.put("material_id", IdUtil.getSnowflake(1, 1).nextId()); + bom.put("material_code", bom_code); + bom.put("material_type", "2"); + bom.put("create_id", currentUserId); + bom.put("create_name", nickName); + bom.put("create_time", now); wo.insert(bom); } @@ -148,7 +148,7 @@ public class MaterialbaseServiceImpl implements MaterialbaseService { if (ObjectUtil.isEmpty(product_grade)) { throw new BadRequestException("物料编码解析错误:未知牌号!"); } - material_detail.put("product_grade", product_grade_code); + material_detail.put("product_grade", product_grade.getString("label")); material_detail.put("brick_type", material_code.substring(23)); material_detail.put("create_id", currentUserId); material_detail.put("create_name", nickName); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL_DETAIL.wql b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL_DETAIL.wql index f19d666..95d4dc3 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL_DETAIL.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/wql/QMD_ME_MATERIAL_DETAIL.wql @@ -40,15 +40,9 @@ IF 输入.flag = "1" PAGEQUERY SELECT - md.*, - d1.label AS 'furnace_name', - d2.label AS 'material_brick_type_name', - d3.label AS 'product_grade_name' + md.* FROM md_me_material_detail md - LEFT JOIN sys_dict_detail d1 ON d1.`value` = md.furnace AND d1.`name` = 'furnace' - LEFT JOIN sys_dict_detail d2 ON d2.`value` = md.material_brick_type AND d2.`name` = 'material_brick_type' - LEFT JOIN sys_dict_detail d3 ON d3.`value` = md.product_grade AND d3.`name` = 'product_grade' WHERE md.is_delete = '0' ENDSELECT diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java index 7839f30..1501907 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/rest/AcsToWmsController.java @@ -194,4 +194,12 @@ public class AcsToWmsController { public ResponseEntity getVehicleInfo(@RequestBody JSONObject whereJson) { return new ResponseEntity<>(acsToWmsService.getVehicleInfo(whereJson), HttpStatus.OK); } + + @PostMapping("/outKiln") + @Log("出窑分配") + @ApiOperation("出窑分配") + @SaIgnore + public ResponseEntity outKiln(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(acsToWmsService.outKiln(whereJson), HttpStatus.OK); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java index 529a6b0..f995719 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java @@ -106,4 +106,6 @@ public interface AcsToWmsService { JSONObject feedbackVehicleType(JSONObject param); JSONObject getVehicleInfo(JSONObject whereJson); + + JSONObject outKiln(JSONObject whereJson); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index aa78061..c795c91 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -864,4 +864,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { result.put("data", data); return result; } + + @Override + public JSONObject outKiln(JSONObject whereJson) { + String vehicle_code = TaskUtils.formatVehicleCode(whereJson.getString("vehicle_code")); + if ("0000".equals(vehicle_code)) { + throw new BadRequestException("载具编码不能为空!"); + } + + boolean to_package = false; + JSONObject workorder = WQL + .getWO("ACS_TO_WMS") + .addParam("flag", "2") + .addParam("vehicle_code", vehicle_code) + .process() + .uniqueResult(0); + if (ObjectUtil.isNotEmpty(workorder)) { + to_package = TrueOrFalse.trueOrFalse("is_pri"); + } + + JSONObject result = new JSONObject(); + result.put("status", HttpStatus.OK.value()); + result.put("message", "分配完成!"); + result.put("data", to_package); + return result; + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql index c041723..f46c526 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/wql/ACS_TO_WMS.wql @@ -58,3 +58,18 @@ ENDSELECT ENDQUERY ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + workorder.* + FROM + st_ivt_vehicle_detail vd + LEFT JOIN pdm_bd_workorder workorder ON vd.workorder_id = workorder.workorder_id + WHERE + vd.is_delete = '0' + AND vd.vehicle_type = '2' + AND vd.vehicle_code = 输入.vehicle_code + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java index a49143f..fca055b 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/DeviceServiceImpl.java @@ -46,6 +46,7 @@ public class DeviceServiceImpl implements DeviceService { if (!StrUtil.isEmpty(search)) { map.put("search", "%" + search + "%"); } + map.put("region_str", MapUtil.getStr(whereJson, "region_str")); JSONObject json = WQL.getWO("PDM_BI_DEVICE01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "device.device_model ASC, device.device_code ASC"); return json; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java index 5ffa76b..e31f214 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/service/impl/WorkorderServiceImpl.java @@ -58,6 +58,7 @@ public class WorkorderServiceImpl implements WorkordeService { map.put("flag", "1"); map.put("begin_time", begin_time); map.put("end_time", end_time); + map.put("region_code", MapUtil.getStr(whereJson, "region_code")); if (StrUtil.isNotEmpty(order_status)) { order_status = order_status.replace("[\"", "").replace("\"]", "").replace("\"", ""); } @@ -408,12 +409,19 @@ public class WorkorderServiceImpl implements WorkordeService { public void finish(JSONObject param) { String workorder_id = param.getString("workorder_id"); WQLObject workorder_table = WQLObject.getWQLObject("pdm_bd_workorder"); - JSONObject workorder = workorder_table.query("workorder_id = " + workorder_id).uniqueResult(0); + JSONObject workorder = workorder_table.query("is_delete = '0' AND workorder_id = " + workorder_id).uniqueResult(0); + if (ObjectUtil.isEmpty(workorder)) { + throw new BadRequestException("工单不存在或已删除!"); + } if (workorder.getIntValue("order_status") < 5) { workorder.put("order_status", WorkOrderEnum.ORDER_STATUS_FINISH.value()); String qty = param.getString("qty"); if (StrUtil.isBlank(qty)) { + JSONObject device = WQLObject.getWQLObject("pdm_bi_device").query("device_id = " + workorder.getString("device_id")).uniqueResult(0); + if (Region.HL.value().equals(device.getString("region_code"))) { + throw new BadRequestException("重量不能为空!"); + } throw new BadRequestException("数量不能为空!"); } workorder.put("real_qty", qty); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql index 82daba6..44d0927 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/MPS_PRODUCEDURE001.wql @@ -26,6 +26,7 @@ 输入.material TYPEAS s_string 输入.workprocedure_ids TYPEAS f_string 输入.unFinish TYPEAS s_string + 输入.region_code TYPEAS s_string [临时表] @@ -82,6 +83,12 @@ material.material_code like 输入.material ) ENDOPTION + OPTION 输入.region_code <> "" + device.region_code = 'HL' + ENDOPTION + OPTION 输入.region_code = "" + device.region_code IN ('YZ', 'FJ') + ENDOPTION ENDSELECT ENDPAGEQUERY ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql index 5fd0b67..b2de6a3 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pdm/wql/PDM_BI_DEVICE01.wql @@ -15,6 +15,7 @@ ################################################# 输入.flag TYPEAS s_string 输入.search TYPEAS s_string + 输入.region_str TYPEAS f_string [临时表] @@ -54,6 +55,9 @@ (device.device_code like 输入.search or device.device_name like 输入.search) ENDOPTION + OPTION 输入.region_str <> "" + device.region_code IN 输入.region_str + ENDOPTION ENDSELECT ENDPAGEQUERY diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls index 2cbb58c..7d9da0f 100644 Binary files a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls differ diff --git a/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue b/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue index 387b13a..b3caa30 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue +++ b/lms/nladmin-ui/src/views/wms/basedata/material/detail/index.vue @@ -20,36 +20,10 @@ - - - + - - - + @@ -61,20 +35,7 @@ - - - + @@ -104,12 +65,12 @@ :min-width="flexWidth('material_name',crud.data,'物料名称')" /> @@ -129,7 +90,7 @@ :min-width="flexWidth('customer_code',crud.data,'客户编码')" /> diff --git a/lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue b/lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue new file mode 100644 index 0000000..be2dacc --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/pdm/workerorder/hl/index.vue @@ -0,0 +1,429 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue b/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue index 68681a9..8d77062 100644 --- a/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue +++ b/lms/nladmin-ui/src/views/wms/pdm/workerorder/index.vue @@ -107,14 +107,14 @@ style="width: 300px" clearable @focus="deviceShow=true" - @clear="form.device_code=''; form.device_id=''; form.device_name=''" + @clear="form.device_code=''; form.device_id=''; form.device_name=''; form.region_code = ''" /> - + - - - - - - - - + @@ -244,8 +230,7 @@ - - + - +