diff --git a/src/main/java/aiyh/utils/httpUtil/HttpMultipartFile.java b/src/main/java/aiyh/utils/httpUtil/HttpMultipartFile.java new file mode 100644 index 0000000..0d7f2fa --- /dev/null +++ b/src/main/java/aiyh/utils/httpUtil/HttpMultipartFile.java @@ -0,0 +1,35 @@ +package aiyh.utils.httpUtil; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.InputStream; + +/** + *

文件上传类

+ * + *

create: 2022-11-21 11:54

+ * + * @author youHong.ai + */ + +@Setter +@Getter +@ToString +public class HttpMultipartFile { + /** + * 文件名 + */ + String fileName; + /** + * 上传文件的key + */ + String fileKey; + /** + * 文件流信息 + */ + InputStream stream; + + Long fileSize; +} diff --git a/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/controller/OrgChartController.java b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/controller/OrgChartController.java new file mode 100644 index 0000000..f07666b --- /dev/null +++ b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/controller/OrgChartController.java @@ -0,0 +1,42 @@ +package com.api.youhong.ai.pcn.organization.orgchart.controller; + +import aiyh.utils.ApiResult; +import com.api.youhong.ai.pcn.organization.orgchart.service.OrgChartService; +import com.api.youhong.ai.pcn.organization.orgchart.vo.OrgChartNodeVo; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Context; +import javax.ws.rs.core.MediaType; +import java.util.List; + +/** + *

人员组织架构图后端接口

+ * + *

create: 2022-12-01 11:58

+ * + * @author youHong.ai + */ + +@Path("/aiyh/orgchart/") +public class OrgChartController { + + private final OrgChartService service = new OrgChartService(); + + + @Path("get") + @GET + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public String getOrgChartTree(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User logInUser = HrmUserVarify.getUser(request, response); + List treeList = service.getOrgChartTree(logInUser); + return ApiResult.success(treeList); + } +} diff --git a/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/mapper/OrgChartMapper.java b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/mapper/OrgChartMapper.java new file mode 100644 index 0000000..26234ca --- /dev/null +++ b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/mapper/OrgChartMapper.java @@ -0,0 +1,23 @@ +package com.api.youhong.ai.pcn.organization.orgchart.mapper; + +import aiyh.utils.annotation.recordset.Select; +import aiyh.utils.annotation.recordset.SqlMapper; +import com.api.youhong.ai.pcn.organization.orgchart.pojo.HrmResource; + +import java.util.List; + +/** + *

人员组织架构图查询

+ * + *

create: 2022-12-01 12:14

+ * + * @author youHong.ai + */ + +@SqlMapper +public interface OrgChartMapper { + + + @Select("select * from hrmresource") + List selectAll(); +} diff --git a/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/pojo/HrmResource.java b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/pojo/HrmResource.java new file mode 100644 index 0000000..9e438a9 --- /dev/null +++ b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/pojo/HrmResource.java @@ -0,0 +1,19 @@ +package com.api.youhong.ai.pcn.organization.orgchart.pojo; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +/** + *

人员数据信息

+ * + *

create: 2022-12-01 15:10

+ * + * @author youHong.ai + */ + +@Setter +@Getter +@ToString +public class HrmResource { +} diff --git a/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/service/OrgChartService.java b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/service/OrgChartService.java new file mode 100644 index 0000000..5a3b552 --- /dev/null +++ b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/service/OrgChartService.java @@ -0,0 +1,32 @@ +package com.api.youhong.ai.pcn.organization.orgchart.service; + +import aiyh.utils.Util; +import com.api.youhong.ai.pcn.organization.orgchart.mapper.OrgChartMapper; +import com.api.youhong.ai.pcn.organization.orgchart.vo.OrgChartNodeVo; +import weaver.hrm.User; + +import java.util.List; + +/** + *

人员组织架构图逻辑处理

+ * + *

create: 2022-12-01 12:00

+ * + * @author youHong.ai + */ + +public class OrgChartService { + + private final OrgChartMapper mapper = Util.getMapper(OrgChartMapper.class); + + /** + *

获取人员组织架构图数据

+ * + * @param logInUser 当前登陆对象 + * @return 组织架构图数据 + */ + public List getOrgChartTree(User logInUser) { + int userId = logInUser.getUID(); + return null; + } +} diff --git a/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/vo/OrgChartNodeVo.java b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/vo/OrgChartNodeVo.java new file mode 100644 index 0000000..0b1a5cf --- /dev/null +++ b/src/main/java/com/api/youhong/ai/pcn/organization/orgchart/vo/OrgChartNodeVo.java @@ -0,0 +1,80 @@ +package com.api.youhong.ai.pcn.organization.orgchart.vo; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.List; + +/** + *

人员组织架构图节点VO对象

+ * + *

create: 2022-12-01 12:23

+ * + * @author youHong.ai + */ +@Setter +@Getter +@ToString +public class OrgChartNodeVo { + + /** + * 人员id + */ + private Integer id; + + /** + * 人员姓名 + */ + private String name; + + /** + * 人员头像 + */ + private String avatar; + + /** + * 人员部门 + */ + private String department; + + /** + * 人员职位 + */ + private String job; + + /** + * 人员国籍类型 + */ + private String type; + + /** + * 是否展示 + */ + private Integer show; + + /** + * 是否展示下级兄弟 + */ + private Integer showBrother; + + /** + * 是否是当前的登陆人员 + */ + private boolean current; + + /** + * 是否是当前登陆人员的直属上级 + */ + private boolean currenParent; + + /** + * 是否展示子节点 + */ + private Integer showChildren; + + /** + * 子节点 + */ + private List children; +} diff --git a/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java b/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java index 6522823..e9229b5 100644 --- a/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java +++ b/src/main/java/weaver/xiao/commons/config/service/DealWithMapping.java @@ -308,6 +308,24 @@ public class DealWithMapping extends ToolUtil { return rootList; } + + /** + *

方法重载 通过主表数据map转为请求参数

+ * + * @param mainMap 主表数据集合 + * @param requestMappingConfig 配置树 + * @return 请求参数 + */ + public Map getRequestParam(Map mainMap, RequestMappingConfig requestMappingConfig) { + this.fileInputStreams.clear(); + this.multipartFileList.clear(); + this.fileNames.clear(); + Map requestParam = new HashMap<>(); + List configDetail = requestMappingConfig.getConfigDetail(); + this.objValueDeal(mainMap, null, configDetail, requestParam); + return requestParam; + } + /** * 解析请求参数配置树,转换成请求参数 * diff --git a/常用信息.md b/常用信息.md index dd762ac..d34e1dd 100644 --- a/常用信息.md +++ b/常用信息.md @@ -416,7 +416,8 @@ from workflow_nodebase nb > 维护人员:xuanran.wang ```java -User logInUser=HrmUserVarify.getUser(request,response)); +//@Context HttpServletRequest request, @Context HttpServletResponse response +User logInUser=HrmUserVarify.getUser(request,response); // 传入id会将此人员信息带出 User user=new User(id); // 获取人员id