From 3d26950c9915a04a06c5f9742743cb254994b766 Mon Sep 17 00:00:00 2001 From: syruan <321359594@qq.com> Date: Wed, 16 Oct 2024 14:14:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E9=85=8D=E7=BD=AE=E7=AE=A1?= =?UTF-8?q?=E7=90=86--=E6=96=B0=E5=BB=BAvo=E5=8F=8A=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E6=A0=91API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ma/controller/MaTypeConfigController.java | 82 +++++++++++++++++++ .../ma/controller/TypeKeeperController.java | 10 +-- .../bonus/material/ma/vo/MaTypeConfigVo.java | 39 +++++++++ 3 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MaTypeConfigController.java create mode 100644 bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeConfigVo.java diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MaTypeConfigController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MaTypeConfigController.java new file mode 100644 index 00000000..6937394f --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MaTypeConfigController.java @@ -0,0 +1,82 @@ +package com.bonus.material.ma.controller; + +import com.bonus.common.biz.domain.TreeSelect; +import com.bonus.common.core.web.controller.BaseController; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.annotation.RequiresPermissions; +import com.bonus.material.ma.service.ITypeKeeperService; +import com.bonus.material.ma.service.ITypeRepairService; +import com.google.common.collect.ImmutableList; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.*; + +/** + * @author : 阮世耀 + * @version : 1.0 + * @PackagePath: com.bonus.material.ma.controller + * @CreateTime: 2024-10-16 10:52 + * @Description: 物资类型配置API + */ +@Api(tags = "物资类型配置API") +@RestController +@RequestMapping("/ma_type_config") +public class MaTypeConfigController extends BaseController { + + /** + * 物资类型库管员配置Service + */ + @Resource + private ITypeKeeperService typeKeeperService; + + /** + * 物资类型维修员配置Service + */ + @Resource + private ITypeRepairService typeRepairService; + + /** + * 查询物资配置左侧组织人员树-tree + */ + @ApiOperation(value = "查询物资配置左侧组织人员树") + @RequiresPermissions("ma:typeConfig:list") + @GetMapping("/getDeptUserTree") + public AjaxResult getDeptUserTree() { + // ---------- 模拟人员Tree数据 -------------- + + // 1.创建一个TreeSelect集合,用于外层放组织部门--公司级 + List treeSelectList1 = new ArrayList<>(); + TreeSelect treeSelect1 = new TreeSelect(1L, "机具设备分公司", 1, null); + TreeSelect treeSelect2 = new TreeSelect(2L, "输电分公司", 1, null); + TreeSelect treeSelect3 = new TreeSelect(5L, "变电分公司", 1, null); + + // 给公司级部门添加子部门 + + // 2.创建一个TreeSelect集合,用于外层放组织部门--部门级 + TreeSelect treeSelect01 = new TreeSelect(11L, "物流库管一班", 2, 1L); + TreeSelect treeSelect001 = new TreeSelect(111L, "王小明", 3, 11L); + TreeSelect treeSelect002 = new TreeSelect(112L, "张小三", 3, 11L); + treeSelect01.setChildren(Arrays.asList(treeSelect001, treeSelect002)); + + TreeSelect treeSelect02 = new TreeSelect(12L, "物流库管二班", 2, 1L); + treeSelect1.setChildren(Arrays.asList(treeSelect01, treeSelect02)); + + + TreeSelect treeSelect03 = new TreeSelect(13L, "宏源库管一班", 2, 5L); + TreeSelect treeSelect003 = new TreeSelect(113L, "李四", 3, 12L); + treeSelect03.setChildren(ImmutableList.of(treeSelect003)); + treeSelect3.setChildren(Collections.singletonList(treeSelect03)); + + // 3.把根节点添加到集合中 + treeSelectList1.add(treeSelect1); + treeSelectList1.add(treeSelect2); + treeSelectList1.add(treeSelect3); + return success(treeSelectList1); + } + +} diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java index b328de4f..1080cdf9 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeKeeperController.java @@ -28,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo; * 库管员配置Controller * @author bonus */ -@Api(tags = "库管员配置接口") +@Api(tags = "库管员配置API") @RestController @RequestMapping("/ma_type_keeper") public class TypeKeeperController extends BaseController { @@ -54,7 +54,7 @@ public class TypeKeeperController extends BaseController { @ApiOperation(value = "导出库管员配置列表") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:export") - @SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "仓储管理->导出库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "物资管理->导出库管员配置") @PostMapping("/export") public void export(HttpServletResponse response, TypeKeeper typeKeeper) { List list = typeKeeperService.selectTypeKeeperList(typeKeeper); @@ -78,7 +78,7 @@ public class TypeKeeperController extends BaseController { @ApiOperation(value = "新增库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:add") - @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "仓储管理->新增库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置") @PostMapping public AjaxResult add(@RequestBody TypeKeeper typeKeeper) { return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper)); @@ -90,7 +90,7 @@ public class TypeKeeperController extends BaseController { @ApiOperation(value = "修改库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:edit") - @SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "仓储管理->修改库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "物资管理->修改库管员配置") @PutMapping public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) { return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper)); @@ -102,7 +102,7 @@ public class TypeKeeperController extends BaseController { @ApiOperation(value = "删除库管员配置") @PreventRepeatSubmit @RequiresPermissions("ma:keeper:remove") - @SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "仓储管理->删除库管员配置") + @SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "物资管理->删除库管员配置") @DeleteMapping("/{IDs}") public AjaxResult remove(@PathVariable Long[] IDs) { diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeConfigVo.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeConfigVo.java new file mode 100644 index 00000000..be776d31 --- /dev/null +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/vo/MaTypeConfigVo.java @@ -0,0 +1,39 @@ +package com.bonus.material.ma.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.ToString; + +/** + * @author : 阮世耀 + * @version : 1.0 + * @PackagePath: com.bonus.material.ma.vo + * @CreateTime: 2024-10-16 10:57 + * @Description: 物资类型配置vo + */ +@Data +@ToString +public class MaTypeConfigVo { + + @ApiModelProperty(value = "配置id") + private Long id; + + @ApiModelProperty(value = "物资类型id") + private Long typeId; + + @ApiModelProperty(value = "物资类型名称") + private String typeName; + + @ApiModelProperty(value = "库管员id") + private String keeperUserId; + + @ApiModelProperty(value = "库管员姓名") + private String keeperUserName; + + @ApiModelProperty(value = "维修员id") + private Long repairUserId; + + @ApiModelProperty(value = "维修员姓名") + private String repairUserName; + +}