From 981634fa893b787f2991d99ebf60276eee8d28c7 Mon Sep 17 00:00:00 2001 From: liyj <1003249715@qq.com> Date: Sat, 24 Aug 2024 19:01:44 +0800 Subject: [PATCH] 1、新增disp、mediate、sys服务 2、集成工作流流程设计器 --- dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/web/CtUnitWebController.java | 68 ++++++++++++++++++++++++++-------- 1 files changed, 52 insertions(+), 16 deletions(-) diff --git a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/web/CtUnitWebController.java b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/web/CtUnitWebController.java index edab2ef..ca19698 100644 --- a/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/web/CtUnitWebController.java +++ b/dyh-service/dyh-cust/src/main/java/cn/huge/module/ctuser/controller/web/CtUnitWebController.java @@ -1,9 +1,12 @@ -package cn.huge.module.ctuser.controller; +package cn.huge.module.ctuser.controller.web; import cn.huge.base.common.utils.ReturnFailUtils; import cn.huge.base.common.utils.ReturnSucUtils; +import cn.huge.base.config.CurrentUser; import cn.huge.module.ctuser.domain.po.CtUnit; +import cn.huge.module.ctuser.domain.po.CtUser; import cn.huge.module.ctuser.service.CtUnitService; +import cn.huge.module.ctuser.service.CtUserService; import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -14,16 +17,15 @@ import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; +import java.util.List; import java.util.Map; -import java.util.stream.Collectors; -import java.util.stream.Stream; /** - * @title: 客户组织信息表接口api - * @description: 客户组织信息表接口api + * @title: 客户组织信息表接口api-web端 + * @description: 客户组织信息表接口api-web端 * @company: hugeinfo * @author: liyj - * @time: 2024-08-17 15:30:57 + * @time: 2024-08-19 20:04:19 * @version: 1.0.0 */ @Slf4j @@ -36,6 +38,9 @@ @Autowired private CtUnitService service; + @Autowired + private CtUserService ctUserService; + /** * 获取请求URL参数 @@ -276,19 +281,15 @@ } /** - * 根据主键单个/批量删除 - * @url {ctx}/api/web/ctUnit/deleteByIds - * @param ids 主键编号 + * 根据主键单个 + * @url {ctx}/api/web/ctUnit/deleteById + * @param id 主键编号 * @return Object */ - @GetMapping("/deleteByIds") - public Object deleteByIds(@RequestParam(value = "ids") String ids) { + @GetMapping("/deleteById") + public Object deleteById(@RequestParam(value = "id") String id) { try { - if (ids.indexOf(",") != -1) { - service.removeByIds(Stream.of(ids.split(",")).collect(Collectors.toList())); - }else{ - service.removeById(ids); - } + service.removeById(id); return ReturnSucUtils.getRepInfo(); } catch (Exception e) { return ReturnFailUtils.getRepInfo(); @@ -311,4 +312,39 @@ } } + /** + * 获取所有组织(包含所有下级子组织)树形结构 + * @url {ctx}/api/v1/ctUnit/listUnitTree + * @param userId 登录用户标识称 + * @return Object + */ + @GetMapping("/listUnitTree") + public Object listUnitTree(@CurrentUser String userId) { + try { + // 获取当前登录用户 + CtUser ctUser = ctUserService.getById(userId); + // 查询当前登录用户下的所有单位 + List<CtUnit> ctUnits = service.listUnitTree(ctUser.getCustId(), ctUser.getUnitId()); + return ReturnSucUtils.getRepInfo( "查询成功", ctUnits); + } catch (Exception e) { + return ReturnFailUtils.getRepInfo( "查询失败", null); + } + } + + /** + * 获取组织详情(包含组织下的部门详情) + * @url {ctx}/api/v1/ctUnit/getUnitAndDept?id= + * @param id 组织编号 + * @return Object + */ + @GetMapping("/getUnitAndDept") + public Object getUnitAndDept(@RequestParam(value = "id") String id) { + try { + //查询该用户组织和部门 + CtUnit ctUnit = service.getUnitAndDept(id); + return ReturnSucUtils.getRepInfo( "查询成功", ctUnit); + } catch (Exception e) { + return ReturnFailUtils.getRepInfo( "查询失败", null); + } + } } -- Gitblit v1.8.0