物资配置管理--新建vo及组织人员树API

This commit is contained in:
syruan 2024-10-16 14:14:28 +08:00
parent 9eeb4b4940
commit 3d26950c99
3 changed files with 126 additions and 5 deletions

View File

@ -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<TreeSelect> 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);
}
}

View File

@ -28,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
* 库管员配置Controller * 库管员配置Controller
* @author bonus * @author bonus
*/ */
@Api(tags = "库管员配置接口") @Api(tags = "库管员配置API")
@RestController @RestController
@RequestMapping("/ma_type_keeper") @RequestMapping("/ma_type_keeper")
public class TypeKeeperController extends BaseController { public class TypeKeeperController extends BaseController {
@ -54,7 +54,7 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "导出库管员配置列表") @ApiOperation(value = "导出库管员配置列表")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:export") @RequiresPermissions("ma:keeper:export")
@SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "仓储管理->导出库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "物资管理->导出库管员配置")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, TypeKeeper typeKeeper) { public void export(HttpServletResponse response, TypeKeeper typeKeeper) {
List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper); List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper);
@ -78,7 +78,7 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "新增库管员配置") @ApiOperation(value = "新增库管员配置")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:add") @RequiresPermissions("ma:keeper:add")
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "仓储管理->新增库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TypeKeeper typeKeeper) { public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper)); return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
@ -90,7 +90,7 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "修改库管员配置") @ApiOperation(value = "修改库管员配置")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:edit") @RequiresPermissions("ma:keeper:edit")
@SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "仓储管理->修改库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "物资管理->修改库管员配置")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) { public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) {
return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper)); return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper));
@ -102,7 +102,7 @@ public class TypeKeeperController extends BaseController {
@ApiOperation(value = "删除库管员配置") @ApiOperation(value = "删除库管员配置")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:remove") @RequiresPermissions("ma:keeper:remove")
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "仓储管理->删除库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "物资管理->删除库管员配置")
@DeleteMapping("/{IDs}") @DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable Long[] IDs) public AjaxResult remove(@PathVariable Long[] IDs)
{ {

View File

@ -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;
}