From ac4fdc11737b754d36084c7e872c37d80c658821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E7=8E=AE?= Date: Wed, 30 Nov 2022 18:37:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E5=AE=8C=E6=88=90=E4=B8=80?= =?UTF-8?q?=E5=8D=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CallMaterialServiceImpl.java | 24 +- ...LLMATERIAL_01.wql => PDA_CALLMATERIAL.wql} | 20 +- .../callvehicle/wql/PDA_CALLVEHICLE_01.wql | 75 --- .../wms/pda/check/rest/CheckController.java | 89 ++++ .../wms/pda/check/service/CheckService.java | 50 ++ .../check/service/impl/CheckServiceImpl.java | 80 +++ .../org/nl/wms/pda/check/wql/PDA_CHECK.wql | 91 ++++ .../main/java/org/nl/wms/pda/login/test.java | 9 - .../nl/wms/pda/login/wql/QPADSTSETSERVICE.wql | 492 ------------------ .../sendempty/rest/SendEmptyController.java | 88 ++++ .../sendempty/service/SendEmptyService.java | 38 ++ .../service/impl/SendEmptyServiceImpl.java | 63 +++ .../wms/pda/sendempty/wql/PDA_SENDEMPTY.wql | 67 +++ .../sendmaterial/wql/PDA_SENDMATERIAL_01.wql | 75 --- .../sendvehicle/wql/PDA_SENDVEHICLE_01.wql | 96 ---- .../java/org/nl/wms/pda/util/PdaUtils.java | 66 +++ 16 files changed, 652 insertions(+), 771 deletions(-) rename lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/{PDA_CALLMATERIAL_01.wql => PDA_CALLMATERIAL.wql} (84%) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/check/rest/CheckController.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/CheckService.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/impl/CheckServiceImpl.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/check/wql/PDA_CHECK.wql delete mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/login/test.java delete mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/login/wql/QPADSTSETSERVICE.wql create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/rest/SendEmptyController.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/SendEmptyService.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/impl/SendEmptyServiceImpl.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/wql/PDA_SENDEMPTY.wql create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/service/impl/CallMaterialServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/service/impl/CallMaterialServiceImpl.java index 7c1ac15..5c152c6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/service/impl/CallMaterialServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/service/impl/CallMaterialServiceImpl.java @@ -20,21 +20,15 @@ public class CallMaterialServiceImpl implements CallMaterialService { @Override public JSONObject queryPoint() { - JSONObject result = new JSONObject(); - // 1.查询区域:油漆区域 YQQY01 - JSONArray regionArr = WQL.getWO("PDA_CALLMATERIAL_01").addParam("flag", "1").process().getResultJSONArray(0); - // 2.根据区域查询对应的物料上料位 - JSONObject resultJson = new JSONObject(); - for (int i = 0; i < regionArr.size(); i++) { - JSONObject jsonRegion = regionArr.getJSONObject(i); - JSONArray pointArr = WQL.getWO("PDA_CALLMATERIAL_01").addParam("flag", "2").addParam("region_id", jsonRegion.getString("region_id")).process().getResultJSONArray(0); - jsonRegion.put("pointArr", pointArr); - } - resultJson.put("regionja", regionArr); - result.put("result", resultJson); - result.put("code", "1"); - result.put("desc", "查询成功"); - return result; + JSONObject resultJSON = new JSONObject(); + + // 查询压机 9 10 的料盅位 + JSONArray points = WQL.getWO("PDA_CALLMATERIAL").addParam("flag", "1").process().getResultJSONArray(0); + + resultJSON.put("code", "1"); + resultJSON.put("desc", "操作成功!"); + resultJSON.put("result", points); + return resultJSON; } @Override diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/PDA_CALLMATERIAL_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/PDA_CALLMATERIAL.wql similarity index 84% rename from lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/PDA_CALLMATERIAL_01.wql rename to lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/PDA_CALLMATERIAL.wql index 41b449f..5c04541 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/PDA_CALLMATERIAL_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/callmaterial/wql/PDA_CALLMATERIAL.wql @@ -40,15 +40,17 @@ IF 输入.flag = "1" QUERY - SELECT - region_id, - region_code, - region_name - FROM - sch_base_region - WHERE - region_code = 'YQQY01' - + SELECT + point_id, + point_code, + point_name + FROM + sch_base_point + WHERE + is_used = '1' + AND is_delete = '0' + AND region_code = 'KLHJ' + AND point_type = '3' ENDSELECT ENDQUERY ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/callvehicle/wql/PDA_CALLVEHICLE_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/callvehicle/wql/PDA_CALLVEHICLE_01.wql index 65bdadd..e69de29 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/callvehicle/wql/PDA_CALLVEHICLE_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/callvehicle/wql/PDA_CALLVEHICLE_01.wql @@ -1,75 +0,0 @@ -[交易说明] - 交易名: 手持呼叫空托盘查询 - 所属模块: - 功能简述: - 版权所有: - 表引用: - 版本经历: - -[数据库] - --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 - -[IO定义] - ################################################# - ## 表字段对应输入参数 - ################################################# - 输入.flag TYPEAS s_string - 输入.region_id TYPEAS s_string - -[临时表] - --这边列出来的临时表就会在运行期动态创建 - -[临时变量] - --所有中间过程变量均可在此处定义 - -[业务过程] - - ########################################## - # 1、输入输出检查 # - ########################################## - - - ########################################## - # 2、主过程前处理 # - ########################################## - - - ########################################## - # 3、业务主过程 # - ########################################## - - IF 输入.flag = "1" - QUERY - SELECT - region_id, - region_code, - region_name - FROM - sch_base_region - WHERE - region_code in ('YQQY01','GJQY01') - - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "2" - QUERY - SELECT - point_id, - point_code, - point_name - FROM - sch_base_point - WHERE - is_used = '1' - AND is_delete = '0' - AND point_type = '1' - - OPTION 输入.region_id <> "" - region_id = 输入.region_id - ENDOPTION - - ENDSELECT - ENDQUERY - ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/rest/CheckController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/rest/CheckController.java new file mode 100644 index 0000000..a186d82 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/rest/CheckController.java @@ -0,0 +1,89 @@ +package org.nl.wms.pda.check.rest; + +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.annotation.Log; +import org.nl.wms.pda.check.service.CheckService; +import org.nl.wms.pda.util.PdaUtils; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 辽宁晟华盘点管理控制层 + * + * @author 张江玮 + * @date 2022/11/30 14:47 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "盘点管理") +@RequestMapping("api/pda/check") +@Slf4j +public class CheckController { + + private final CheckService checkService; + + @PostMapping("/queryMaterial") + @Log("查询物料") + @ApiOperation("查询物料") + public ResponseEntity queryMaterial() { + log.info("手持 [盘点管理]-[查询物料] 接口被访问"); + + return PdaUtils.buildSuccessResponseEntity(checkService.queryMaterial()); + } + + @PostMapping("/queryIvt") + @Log("查询盘点单据") + @ApiOperation("查询盘点单据") + public ResponseEntity queryIvt() { + log.info("手持 [盘点管理]-[查询盘点单据] 接口被访问"); + + return PdaUtils.buildSuccessResponseEntity(checkService.queryIvt()); + } + + @PostMapping("/confirm") + @Log("盘点确定") + @ApiOperation("盘点确定") + public ResponseEntity confirm(@RequestBody JSONObject param) { + log.info("手持 [盘点管理]-[盘点确定] 接口被访问, 请求参数-{}", param); + + JSONArray structs = param.getJSONArray("JSONarray"); + if (ObjectUtil.isEmpty(structs)) { + return PdaUtils.buildFailResponseEntity("请选择仓位"); + } + + return PdaUtils.buildSuccessResponseEntity(checkService.confirm(structs)); + } + + @PostMapping("/querySectCode") + @Log("查询库区") + @ApiOperation("查询库区") + public ResponseEntity querySectCode() { + log.info("手持 [盘点管理]-[查询库区] 接口被访问"); + + return PdaUtils.buildSuccessResponseEntity(checkService.querySectCode()); + } + + @PostMapping("/queryStructCode") + @Log("查询仓位") + @ApiOperation("查询仓位") + public ResponseEntity queryStructCode(@RequestBody JSONObject param) { + log.info("手持 [盘点管理]-[查询仓位] 接口被访问, 请求参数-{}", param); + + String region_id = param.getString("sect_uuid"); + if (StrUtil.isEmpty(region_id)) { + return PdaUtils.buildFailResponseEntity("库区不能为空"); + } + + return PdaUtils.buildSuccessResponseEntity(checkService.queryStructCode(region_id)); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/CheckService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/CheckService.java new file mode 100644 index 0000000..50273f6 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/CheckService.java @@ -0,0 +1,50 @@ +package org.nl.wms.pda.check.service; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +/** + * 辽宁晟华盘点管理服务层接口 + * + * @author 张江玮 + * @date 2022/11/30 14:50 + */ +public interface CheckService { + + /** + * 查询物料 + * + * @return 物料信息 + */ + JSONArray queryMaterial(); + + /** + * 查询盘点单据 + * + * @return 盘点单据信息 + */ + JSONObject queryIvt(); + + /** + * 盘点确定 + * + * @param structs 选择的仓位 + * @return 操作提示 + */ + JSONObject confirm(JSONArray structs); + + /** + * 查询库区 + * + * @return 库区信息 + */ + JSONArray querySectCode(); + + /** + * 查询仓位 + * + * @param region_id 库区id + * @return 仓位信息 + */ + JSONArray queryStructCode(String region_id); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/impl/CheckServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/impl/CheckServiceImpl.java new file mode 100644 index 0000000..bc6ae2b --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/service/impl/CheckServiceImpl.java @@ -0,0 +1,80 @@ +package org.nl.wms.pda.check.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.wql.WQL; +import org.nl.wms.pda.check.service.CheckService; +import org.springframework.stereotype.Service; + +/** + * 辽宁晟华盘点管理服务层实现类 + * + * @author 张江玮 + * @date 2022/11/30 14:50 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class CheckServiceImpl implements CheckService { + + @Override + public JSONArray queryMaterial() { + return WQL + .getWO("PDA_CHECK") + .addParam("flag", "1") + .process() + .getResultJSONArray(0); + } + + /** + * 查询盘点单据 + * + * @return 盘点单据信息 + */ + @Override + public JSONObject queryIvt() { + return null; + } + + /** + * 盘点确定 + * + * @param structs 选择的仓位 + * @return 操作提示 + */ + @Override + public JSONObject confirm(JSONArray structs) { + return null; + } + + /** + * 查询库区 + * + * @return 库区信息 + */ + @Override + public JSONArray querySectCode() { + return WQL + .getWO("PDA_CHECK") + .addParam("flag", "4") + .process() + .getResultJSONArray(0); + } + + /** + * 查询仓位 + * + * @param region_id 库区id + * @return 仓位信息 + */ + @Override + public JSONArray queryStructCode(String region_id) { + return WQL + .getWO("PDA_CHECK") + .addParam("flag", "5") + .process() + .getResultJSONArray(0); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/wql/PDA_CHECK.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/wql/PDA_CHECK.wql new file mode 100644 index 0000000..e41ebd5 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/check/wql/PDA_CHECK.wql @@ -0,0 +1,91 @@ +[交易说明] + 交易名: 手持叫料查询 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.region_id TYPEAS s_string + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + material_id AS 'material_uuid', + material_code, + material_name + FROM + md_me_materialbase + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "2" + ENDIF + + IF 输入.flag = "3" + ENDIF + + IF 输入.flag = "4" + QUERY + SELECT + region_id AS 'sect_uuid', + region_code AS 'sect_code', + region_name AS 'sect_name' + FROM + sch_base_region + WHERE + region_code IN ( 'KLHJ', 'RYZCQ', 'CYZCQ', 'BZZCQ' ) + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "5" + QUERY + SELECT + point_id AS 'struct_uuid', + point_code AS 'struct_code', + point_name AS 'struct_name' + FROM + sch_base_point + WHERE + is_used = '1' + AND is_delete = '0' + OPTION 输入.region_id <> "" + region_id = 输入.region_id + ENDOPTION + ORDER BY + point_code + ENDSELECT + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/login/test.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/login/test.java deleted file mode 100644 index 6ff556d..0000000 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/login/test.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.nl.wms.pda.login; - -/** - * @author: lyd - * @description: - * @Date: 2022/10/22 - */ -public class test { -} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/login/wql/QPADSTSETSERVICE.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/login/wql/QPADSTSETSERVICE.wql deleted file mode 100644 index a2aece6..0000000 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/login/wql/QPADSTSETSERVICE.wql +++ /dev/null @@ -1,492 +0,0 @@ -[交易说明] - 交易名: 库区分页查询 - 所属模块: - 功能简述: - 版权所有: - 表引用: - 版本经历: - -[数据库] - --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 - -[IO定义] - ################################################# - ## 表字段对应输入参数 - ################################################# - 输入.flag TYPEAS s_string - 输入.searchbar TYPEAS s_string - 输入.option_type TYPEAS s_string - 输入.bag_id TYPEAS s_string - 输入.bucketunique TYPEAS s_string - 输入.class_code TYPEAS s_string - 输入.component TYPEAS s_string - 输入.pid TYPEAS s_string - 输入.accountId TYPEAS s_string - 输入.workprocedure_code TYPEAS s_string - 输入.dict_type TYPEAS s_string - - - - - -[临时表] - --这边列出来的临时表就会在运行期动态创建 - -[临时变量] - --所有中间过程变量均可在此处定义 - -[业务过程] - - ########################################## - # 1、输入输出检查 # - ########################################## - - - ########################################## - # 2、主过程前处理 # - ########################################## - - - ########################################## - # 3、业务主过程 # - ########################################## - - IF 输入.flag = "1" - PAGEQUERY - SELECT - class.class_name, - class.class_code, - base.material_id, - base.material_code, - base.material_name, - base.material_spec, - base.material_type_id, - class.class_desc AS material_dtl_scode_name, - base.base_unit_id, - unit.unit_name AS base_unit_id_name, - ext.standard_weight as standard_weight1 , - "50" as standard_weight - FROM - MD_ME_MaterialBase base - LEFT JOIN md_pb_classstandard class ON class.class_id = base.material_type_id - LEFT JOIN MD_PB_MeasureUnit unit ON unit.measure_unit_id = base.base_unit_id - LEFT JOIN MD_ME_ProducMaterialExt ext ON ext.material_id = base.material_id - WHERE - 1 = 1 - OPTION 输入.searchbar <> "" - (base.material_code like "%" 输入.searchbar "%" - OR - base.material_name like "%" 输入.searchbar "%") - ENDOPTION - OPTION 输入.class_code <> "" - class.class_code = 输入.class_code - ENDOPTION - ENDSELECT - ENDPAGEQUERY - ENDIF - - - IF 输入.flag = "2" - QUERY - SELECT - bag.bagrecord_id, - bag.bag_id, - bag.material_id, - material.material_code as material_code , - material.material_name as material_name, - bag.pcsn, - bag.qty_unit_id, - bag.qty_unit_name, - bag.storage_qty, - bag.return_person, - bag.status, - case bag.status when '01' then '生成' - when '02' then '组桶' - when '03' then '清洗' - else '' end as status_name, - bag.waste_type, - dictdtl.label as waste_type_name - FROM - MD_PB_BagRecord AS bag - LEFT JOIN MD_ME_MaterialBase material ON material.material_id = bag.material_id - left join sys_dict_detail dictdtl on dictdtl.value =bag.waste_type and dictdtl.dict_id='46' - WHERE - 1 =1 - OPTION 输入.bag_id <> "" - bag.bag_id = 输入.bag_id - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - - IF 输入.flag = "3" - QUERY - SELECT - curdate( ) AS create_date, - bag.bagrecord_id, - bag.bag_id, - bag.material_id, - ext_id, - material.material_code, - material.material_name, - bag.print_type, - bag.return_person, - bag.pcsn, - bag.storage_qty, - bag.print_times, - DATE_FORMAT( bag.input_time, '%Y-%m-%d' ) as input_time - FROM - MD_PB_BagRecord AS bag - LEFT JOIN md_me_materialbase AS material ON material.material_id = bag.material_id - where 1=1 - OPTION 输入.bag_id <> "" - bag.bag_id = 输入.bag_id - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - - IF 输入.flag = "4" - QUERY - SELECT - max( sys_user.user_id )as accountId, - max( sys_user.username ) as username, - max( sys_roles_menus.menu_id ) as menu_id, - max( sys_menu.component ) as component, - max( sys_menu.path ) as path, - max( sys_menu.NAME ) as name - FROM - sys_user AS sys_user - LEFT JOIN sys_users_roles AS sys_users_roles ON sys_users_roles.user_id = sys_user.user_id - LEFT JOIN sys_role AS sys_role ON sys_role.role_id = sys_users_roles.role_id - LEFT JOIN sys_roles_menus AS sys_roles_menus ON sys_roles_menus.role_id = sys_role.role_id - LEFT JOIN sys_menu AS sys_menu ON sys_menu.menu_id = sys_roles_menus.menu_id - WHERE - sys_menu.path LIKE 'RF%' - AND sys_menu.hidden = 1 - OPTION 输入.accountId <> "" - sys_user.user_id = 输入.accountId - ENDOPTION - OPTION 输入.component <> "" - sys_menu.component = 输入.component - ENDOPTION - OPTION 输入.pid <> "" - sys_menu.pid = 输入.pid - ENDOPTION - - GROUP BY - sys_menu.menu_id, - sys_menu.title, - sys_menu.component, - sys_menu.path, - sys_menu.NAME, - sys_menu.menu_sort - ORDER BY sys_menu.menu_sort - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "5" - QUERY - SELECT - bucket.bucket_record_id, - bucket.bucketunique, - bucket.material_id, - bucket.print_type, - material_code, - material_name, - bucket.pcsn, - bucket.qty_unit_id, - bucket.qty_unit_name, - bucket.storage_qty, - bucket.STATUS, - bucket.record_order, - DATE_FORMAT( bucket.create_time, '%Y-%m-%d' ) AS date, - DATE_FORMAT( bucket.create_time, '%Y-%m-%d' ) as input_time, - ext_id, - bucket.record_order, - bucket.is_active, - "否" as is_new_name, - "0" as is_new, - case bucket.status when '01' then '生成' - when '02' then '组盘' - when '03' then '入库' - when '04' then '出库' - when '05' then '入立库' - else '' end as status_name - FROM - md_pb_bucketrecord bucket - LEFT JOIN md_me_materialbase material ON material.material_id = bucket.material_id - where 1=1 - OPTION 输入.bucketunique <> "" - bucket.bucketunique = 输入.bucketunique - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - - IF 输入.flag = "6" - QUERY - SELECT - bag.bag_id, - bag.material_id, - material.material_code, - material.material_name, - bag.print_type, - bag.storage_qty , - "否" as is_new_name, - "0" as is_new, - bag.pcsn, - bag.return_person, - DATE_FORMAT( bag.input_time, '%Y-%m-%d' ) AS date, - DATE_FORMAT( bag.input_time, '%Y-%m-%d' ) AS input_time, - bag.bucketunique, - ext_id - FROM - MD_PB_BagRecord AS bag - LEFT JOIN md_me_materialbase AS material ON material.material_id = bag.material_id - where 1=1 - OPTION 输入.bucketunique <> "" - bag.bucketunique = 输入.bucketunique - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "7" - QUERY - SELECT - bag.bag_id, - bag.material_id, - material.material_code, - material.material_name, - bag.print_type, - bag.storage_qty, - bag.pcsn, - "是" as is_new_name, - "1" as is_new, - bag.bucketunique - FROM - MD_PB_BagRecord AS bag - LEFT JOIN md_me_materialbase AS material ON material.material_id = bag.material_id - where 1=1 - OPTION 输入.bag_id <> "" - bag.bag_id = 输入.bag_id - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "8" - QUERY - SELECT - curdate( ) AS create_date, - DATE_FORMAT( bucket.create_time, '%Y-%m-%d' ) as input_time, - ext_id, - bucket.bucket_record_id, - bucket.record_order, - bucket.is_active, - bucket.bucketunique, - bucket.material_id, - material_code, - material_name, - bucket.pcsn, - bucket.qty_unit_id, - bucket.qty_unit_name, - bucket.storage_qty, - bucket.print_type - FROM - md_pb_bucketrecord bucket - LEFT JOIN md_me_materialbase material ON material.material_id = bucket.material_id - WHERE - 1 =1 - OPTION 输入.bucketunique <> "" - bucket.bucketunique = 输入.bucketunique - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - - IF 输入.flag = "9" - QUERY - SELECT - bucket.bucket_record_id, - bucket.bucketunique, - bucket.material_id, - material_code, - material_name, - bucket.pcsn, - bucket.qty_unit_id, - bucket.qty_unit_name, - bucket.storage_qty, - bucket.STATUS, - case bucket.status when '01' then '生成' - when '02' then '组盘' - when '03' then '入库' - when '04' then '出库' - when '05' then '入立库' - else '' end as status_name - FROM - md_pb_bucketrecord bucket - LEFT JOIN md_me_materialbase material ON material.material_id = bucket.material_id - where 1=1 - OPTION 输入.bucketunique <> "" - bucket.bucketunique = 输入.bucketunique - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - - IF 输入.flag = "10" - QUERY - SELECT - dtl.VALUE AS waste_type, - dtl.label AS waste_type_name - FROM - sys_dict dict - LEFT JOIN sys_dict_detail dtl ON dict.dict_id = dtl.dict_id - WHERE - dict.NAME = 'MD_MATERIAL_WASTE_TYPE' - ENDSELECT - ENDQUERY - ENDIF - - - IF 输入.flag = "11" - PAGEQUERY - SELECT - device.device_id, - device.device_code, - device.device_name, - device.device_model, - device.device_specification, - device.workprocedure_id, - device.workprocedure_code, - device.workprocedure_name - FROM - em_bi_deviceinfo device - WHERE - 1 = 1 - OPTION 输入.searchbar <> "" - (device.device_code like "%" 输入.searchbar "%" - OR - device.device_name like "%" 输入.searchbar "%") - ENDOPTION - OPTION 输入.workprocedure_code <> "" - device.workprocedure_code = 输入.workprocedure_code - ENDOPTION - ENDSELECT - ENDPAGEQUERY - ENDIF - - IF 输入.flag = "12" - QUERY - SELECT - bucket.bucket_record_id, - bucket.bucketunique, - bucket.material_id, - material_code, - material_name, - bucket.pcsn, - bucket.qty_unit_id, - bucket.qty_unit_name, - bucket.storage_qty, - bucket.STATUS, - bucket.record_order, - case bucket.status when '01' then '生成' - when '02' then '组盘' - when '03' then '入库' - when '04' then '出库' - when '05' then '入立库' - when '06' then '线下处理' - else '' end as status_name, - case bucket.status when '06' then '1' - else '0' end as is_offline_hand - FROM - md_pb_bucketrecord bucket - LEFT JOIN md_me_materialbase material ON material.material_id = bucket.material_id - where 1=1 - and bucket.status in(01,02,03,06) - OPTION 输入.bucketunique <> "" - bucket.bucketunique = 输入.bucketunique - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "13" - QUERY - SELECT - bucket.*, - mb.material_code, - mb.ext_id, - mb.material_name, - DATE_FORMAT( bucket.create_time, '%Y-%m-%d' ) as input_time - FROM - pdm_bi_formulabucketrecord bucket - LEFT JOIN md_me_materialbase mb ON mb.material_id = bucket.material_id - WHERE - 1=1 - AND - bucket.bucketunique = 输入.bucketunique - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "14" - QUERY - SELECT - bucket.*, - mb.material_code, - mb.material_name, - mb.ext_id, - DATE_FORMAT( bucket.create_time, '%Y-%m-%d' ) as input_time - FROM - md_pb_bucketrecord bucket - LEFT JOIN md_me_materialbase mb ON mb.material_id = bucket.material_id - WHERE - 1=1 - AND - bucket.bucketunique = 输入.bucketunique - AND - bucket.status IN ('01','02','03') - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "15" - QUERY - SELECT - detaial.label, - detaial.`value` - FROM - sys_dict_detail detaial - LEFT JOIN sys_dict dict ON dict.dict_id = detaial.dict_id - WHERE - dict.`name` = 输入.dict_type - OPTION 输入.dict_type = "sch_area_type" - detaial.value IN ('22','23','24') - ENDOPTION - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "16" - QUERY - SELECT - point.point_id, - point.point_code, - point.point_name - FROM - sch_base_point point - WHERE - point_name LIKE '分拣机械手%' - and device_point_type='01' - ENDSELECT - ENDQUERY - ENDIF \ No newline at end of file diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/rest/SendEmptyController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/rest/SendEmptyController.java new file mode 100644 index 0000000..0135ab5 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/rest/SendEmptyController.java @@ -0,0 +1,88 @@ +package org.nl.wms.pda.sendempty.rest; + +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONObject; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.logging.annotation.Log; +import org.nl.wms.pda.sendempty.service.SendEmptyService; +import org.nl.wms.pda.util.PdaUtils; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 辽宁晟华托盘点位绑定控制层 + * + * @author 张江玮 + * @date 2022/11/30 16:29 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "托盘点位绑定") +@RequestMapping("api/pda") +@Slf4j +public class SendEmptyController { + + private final SendEmptyService sendEmptyService; + + @PostMapping("/sendEmpty/queryArea") + @Log("查询区域") + @ApiOperation("查询区域") + public ResponseEntity queryArea() { + log.info("手持 [托盘点位绑定]-[查询区域] 接口被访问"); + + return PdaUtils.buildSuccessResponseEntity(sendEmptyService.queryArea()); + } + + @PostMapping("/sendEmpty/queryPointByArea") + @Log("根据区域查询点位") + @ApiOperation("根据区域查询点位") + public ResponseEntity queryPointByArea(@RequestBody JSONObject param) { + log.info("手持 [托盘点位绑定]-[根据区域查询点位] 接口被访问, 请求参数-{}", param); + + String region_code = param.getString("area_code"); + if (StrUtil.isEmpty(region_code)) { + return PdaUtils.buildFailResponseEntity("区域不能为空"); + } + + return PdaUtils.buildSuccessResponseEntity(sendEmptyService.queryPointByArea(region_code)); + } + + @PostMapping("/binding/confirm") + @Log("托盘点位绑定确认") + @ApiOperation("托盘点位绑定确认") + public ResponseEntity confirm(@RequestBody JSONObject param) { + log.info("手持 [托盘点位绑定]-[托盘点位绑定确认] 接口被访问, 请求参数-{}", param); + + String point_code = param.getString("point_code"); + if (StrUtil.isEmpty(point_code)) { + return PdaUtils.buildFailResponseEntity("点位不能为空"); + } + String vehicle_code = param.getString("vehicle_code"); + if (StrUtil.isEmpty(vehicle_code)) { + return PdaUtils.buildFailResponseEntity("托盘条码不能为空"); + } + String point_status = param.getString("point_status"); + if (StrUtil.isEmpty(point_status)) { + return PdaUtils.buildFailResponseEntity("点位状态不能为空"); + } + String lock_type = param.getString("is_lock"); + if (StrUtil.isEmpty(lock_type)) { + return PdaUtils.buildFailResponseEntity("是否锁定不能为空"); + } + + sendEmptyService.confirm( + point_code, + vehicle_code, + String.valueOf(Integer.parseInt(point_status.substring(1)) + 1), + lock_type + ); + + return PdaUtils.buildSuccessResponseEntity(null); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/SendEmptyService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/SendEmptyService.java new file mode 100644 index 0000000..e3719a2 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/SendEmptyService.java @@ -0,0 +1,38 @@ +package org.nl.wms.pda.sendempty.service; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; + +/** + * 辽宁晟华托盘点位绑定服务层接口 + * + * @author 张江玮 + * @date 2022/11/30 16:51 + */ +public interface SendEmptyService { + + /** + * 查询区域 + * + * @return 所有区域 + */ + JSONArray queryArea(); + + /** + * 根据区域查询点位 + * + * @param region_code 区域编码 + * @return 该区域下的所有点位信息 + */ + JSONArray queryPointByArea(String region_code); + + /** + * 托盘点位绑定确认 + * + * @param point_code 点位编码 + * @param vehicle_code 托盘编码 + * @param point_status 点位状态 + * @param lock_type 是否锁定 + */ + void confirm(String point_code, String vehicle_code, String point_status, String lock_type); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/impl/SendEmptyServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/impl/SendEmptyServiceImpl.java new file mode 100644 index 0000000..d641793 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/service/impl/SendEmptyServiceImpl.java @@ -0,0 +1,63 @@ +package org.nl.wms.pda.sendempty.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.modules.wql.WQL; +import org.nl.wms.pda.sendempty.service.SendEmptyService; +import org.springframework.stereotype.Service; + +/** + * 辽宁晟华托盘点位绑定服务层实现类 + * + * @author 张江玮 + * @date 2022/11/30 16:51 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class SendEmptyServiceImpl implements SendEmptyService { + + /** + * 查询区域 + * + * @return 所有区域 + */ + @Override + public JSONArray queryArea() { + return WQL + .getWO("PDA_SENDEMPTY") + .addParam("flag", "1") + .process() + .getResultJSONArray(0); + } + + /** + * 根据区域查询点位 + * + * @param region_code 区域编码 + * @return 该区域下的所有点位信息 + */ + @Override + public JSONArray queryPointByArea(String region_code) { + return WQL + .getWO("PDA_SENDEMPTY") + .addParam("flag", "2") + .process() + .getResultJSONArray(0); + } + + /** + * 托盘点位绑定确认 + * + * @param point_code 点位编码 + * @param vehicle_code 托盘编码 + * @param point_status 点位状态 + * @param lock_type 是否锁定 + */ + @Override + public void confirm(String point_code, String vehicle_code, String point_status, String lock_type) { + + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/wql/PDA_SENDEMPTY.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/wql/PDA_SENDEMPTY.wql new file mode 100644 index 0000000..2545d81 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendempty/wql/PDA_SENDEMPTY.wql @@ -0,0 +1,67 @@ +[交易说明] + 交易名: 手持叫料查询 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.region_code TYPEAS s_string + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + IF 输入.flag = "1" + QUERY + SELECT + region_code AS 'area_code', + region_name AS 'area_name' + FROM + sch_base_region + ENDSELECT + ENDQUERY + ENDIF + + IF 输入.flag = "2" + QUERY + SELECT + point_id, + point_code, + point_name + FROM + sch_base_point + WHERE + is_used = '1' + AND is_delete = '0' + OPTION 输入.region_code <> "" + region_code = 输入.region_code + ENDOPTION + ENDQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/wql/PDA_SENDMATERIAL_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/wql/PDA_SENDMATERIAL_01.wql index 4632d02..e69de29 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/wql/PDA_SENDMATERIAL_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendmaterial/wql/PDA_SENDMATERIAL_01.wql @@ -1,75 +0,0 @@ -[交易说明] - 交易名: 手持送料查询 - 所属模块: - 功能简述: - 版权所有: - 表引用: - 版本经历: - -[数据库] - --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 - -[IO定义] - ################################################# - ## 表字段对应输入参数 - ################################################# - 输入.flag TYPEAS s_string - 输入.region_id TYPEAS s_string - -[临时表] - --这边列出来的临时表就会在运行期动态创建 - -[临时变量] - --所有中间过程变量均可在此处定义 - -[业务过程] - - ########################################## - # 1、输入输出检查 # - ########################################## - - - ########################################## - # 2、主过程前处理 # - ########################################## - - - ########################################## - # 3、业务主过程 # - ########################################## - - IF 输入.flag = "1" - QUERY - SELECT - region_id, - region_code, - region_name - FROM - sch_base_region - WHERE - region_code in ('HKQY01','GJQY01') - - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "2" - QUERY - SELECT - point_id, - point_code, - point_name - FROM - sch_base_point - WHERE - is_used = '1' - AND is_delete = '0' - AND point_type = '3' - - OPTION 输入.region_id <> "" - region_id = 输入.region_id - ENDOPTION - - ENDSELECT - ENDQUERY - ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendvehicle/wql/PDA_SENDVEHICLE_01.wql b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendvehicle/wql/PDA_SENDVEHICLE_01.wql index b8bb4a3..e69de29 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendvehicle/wql/PDA_SENDVEHICLE_01.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/sendvehicle/wql/PDA_SENDVEHICLE_01.wql @@ -1,96 +0,0 @@ -[交易说明] - 交易名: 手持送空托盘查询 - 所属模块: - 功能简述: - 版权所有: - 表引用: - 版本经历: - -[数据库] - --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 - -[IO定义] - ################################################# - ## 表字段对应输入参数 - ################################################# - 输入.flag TYPEAS s_string - 输入.region_id TYPEAS s_string - -[临时表] - --这边列出来的临时表就会在运行期动态创建 - -[临时变量] - --所有中间过程变量均可在此处定义 - -[业务过程] - - ########################################## - # 1、输入输出检查 # - ########################################## - - - ########################################## - # 2、主过程前处理 # - ########################################## - - - ########################################## - # 3、业务主过程 # - ########################################## - - IF 输入.flag = "1" - QUERY - SELECT - region_id, - region_code, - region_name - FROM - sch_base_region - WHERE - region_code in ('SSX01','YQQY01') - - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "2" - QUERY - SELECT - point_id, - point_code, - point_name - FROM - sch_base_point - WHERE - is_used = '1' - AND is_delete = '0' - AND point_type = '6' - - OPTION 输入.region_id <> "" - region_id = 输入.region_id - ENDOPTION - - ENDSELECT - ENDQUERY - ENDIF - - IF 输入.flag = "3" - QUERY - SELECT - point_id, - point_code, - point_name - FROM - sch_base_point - WHERE - is_used = '1' - AND is_delete = '0' - AND point_type = '4' - - OPTION 输入.region_id <> "" - region_id = 输入.region_id - ENDOPTION - - ENDSELECT - ENDQUERY - ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java new file mode 100644 index 0000000..5d5838d --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/util/PdaUtils.java @@ -0,0 +1,66 @@ +package org.nl.wms.pda.util; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; + +/** + * 辽宁晟华手持工具类 + * + * @author 张江玮 + * @date 2022/11/30 15:53 + */ +public final class PdaUtils { + + /** + * 控制层调用方法 + * 创建操作成功返回的 ResponseEntity 并携带需要返回的数据 + * + * @param result 需要返回的数据 + * @return 携带了返回数据的 ResponseEntity + */ + public static ResponseEntity buildSuccessResponseEntity(JSON result) { + return new ResponseEntity<>(buildSuccessJSON(result), HttpStatus.OK); + } + + /** + * 控制层调用方法 + * 创建操作失败返回的 ResponseEntity + * + * @param desc 错误提示 + * @return 自定义错误提示的 ResponseEntity + */ + public static ResponseEntity buildFailResponseEntity(String desc) { + return new ResponseEntity<>(buildFailJSON(desc), HttpStatus.OK); + } + + /** + * 服务层调用方法 + * 创建操作成功的 JSONObject 并携带需要返回的数据 + * + * @param result 返回数据 + * @return 携带了返回数据的 JSONObject + */ + public static JSONObject buildSuccessJSON(JSON result) { + JSONObject resultJSON = new JSONObject(); + resultJSON.put("code", "1"); + resultJSON.put("desc", "操作成功"); + resultJSON.put("result", result); + return resultJSON; + } + + /** + * 服务层调用方法 + * 创建操作失败的 JSONObject + * + * @param desc 错误提示 + * @return 自定义错误提示的 JSONObject + */ + public static JSONObject buildFailJSON(String desc) { + JSONObject resultJSON = new JSONObject(); + resultJSON.put("code", "0"); + resultJSON.put("desc", desc); + return resultJSON; + } +}