From 5ba84741a0470525dbdaf15f401530d41d07799c Mon Sep 17 00:00:00 2001 From: sxu <602087911@qq.com> Date: Wed, 6 Nov 2024 16:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BAmatype?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/controller/TypeController.java | 28 +++++++++++++ .../bonus/material/ma/mapper/TypeMapper.java | 4 ++ .../material/ma/service/ITypeService.java | 4 ++ .../ma/service/impl/TypeServiceImpl.java | 42 +++++++++++++++++++ .../mapper/material/ma/TypeMapper.xml | 2 +- 5 files changed, 79 insertions(+), 1 deletion(-) diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 01f022de..a259b412 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -153,6 +153,34 @@ public class TypeController extends BaseController { util.exportExcel(response, list, "物资类型管理数据"); } + /** + * 导出物资类型管理列表(库管员) + */ + @ApiOperation(value = "导出物资类型列表(库管员)") + @PreventRepeatSubmit + @RequiresPermissions("ma:type:export") + @SysLog(title = "物资类型管理(库管员)", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型(库管员)") + @PostMapping("/export4Keeper") + public void export4Keeper(HttpServletResponse response, Type type) { + List list = typeService.selectTypeList4Keeper(type); + ExcelUtil util = new ExcelUtil(Type.class); + util.exportExcel(response, list, "物资类型管理数据(库管员)"); + } + + /** + * 导出物资类型管理列表(维修员) + */ + @ApiOperation(value = "导出物资类型列表(维修员)") + @PreventRepeatSubmit + @RequiresPermissions("ma:type:export") + @SysLog(title = "物资类型管理(维修员)", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型(维修员)") + @PostMapping("/export4Repair") + public void export4Repair(HttpServletResponse response, Type type) { + List list = typeService.selectTypeList4Repair(type); + ExcelUtil util = new ExcelUtil(Type.class); + util.exportExcel(response, list, "物资类型管理数据(维修员)"); + } + /** * 获取物资类型管理详细信息 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index ebdcc70d..e9e4b029 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -59,6 +59,10 @@ public interface TypeMapper { */ List selectTypeList(Type type); + List selectTypeList4Keeper(Type type); + + List selectTypeList4Repair(Type type); + /** * 查询物资类型列表 -- 并且查询当前节点的父级节点名称 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java index 1e36e423..34472b5c 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -44,6 +44,10 @@ public interface ITypeService { */ List selectTypeList(Type type); + List selectTypeList4Keeper(Type type); + + List selectTypeList4Repair(Type type); + List selectTypeListAndParentInfo(Type type); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index 5efa5a31..d7b3cbfb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -132,6 +132,48 @@ public class TypeServiceImpl implements ITypeService { return typeMapper.selectTypeList(type); } + /** + * 查询物资类型管理列表(库管员) + * + * @param type 物资类型管理(库管员) + * @return 物资类型管理(库管员) + */ + @Override + public List selectTypeList4Keeper(Type type) { + if (type != null ) { + if (StringUtils.isEmpty(type.getDelFlag())) { + // 如果没赋值,则默认查询正常数据状态 + type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode())); + } + // 如果是顶级节点,则查询所有子节点 + if ("0".equals(type.getLevel())) { + type.setLevel(null); + } + } + return typeMapper.selectTypeList4Keeper(type); + } + + /** + * 查询物资类型管理列表(维修员) + * + * @param type 物资类型管理(维修员) + * @return 物资类型管理(维修员) + */ + @Override + public List selectTypeList4Repair(Type type) { + if (type != null ) { + if (StringUtils.isEmpty(type.getDelFlag())) { + // 如果没赋值,则默认查询正常数据状态 + type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode())); + } + // 如果是顶级节点,则查询所有子节点 + if ("0".equals(type.getLevel())) { + type.setLevel(null); + } + } + return typeMapper.selectTypeList4Repair(type); + } + /** * 查询物资类型管理列表 -- 并获取父级信息 * diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index 6ff03471..e9b90480 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -580,7 +580,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" order by type_id - select mt4.type_id, mt4.type_name, mt4.parent_id, mt4.storage_num, mt4.type_code, mt4.model_code, mt4.unit_id, mt4.unit_name, mt4.manage_type, mt4.lease_price, mt4.eff_time, mt4.rent_price, mt4.buy_price, mt4.pay_ratio, mt4.pay_price, mt4.tax_ratio, mt4.level, mt4.rated_load, mt4.test_load, mt4.holding_time, mt4.warn_num,