From 9bf767afb50aa12c2dbe698f89c7ba02d52e7f3a Mon Sep 17 00:00:00 2001 From: "youHong.ai" <774495953@qq.com> Date: Thu, 1 Dec 2022 16:35:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=84=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0push=E7=BC=BA=E5=B0=91=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/httpUtil/HttpMultipartFile.java | 35 ++++++++ .../controller/OrgChartController.java | 42 ++++++++++ .../orgchart/mapper/OrgChartMapper.java | 23 ++++++ .../orgchart/pojo/HrmResource.java | 19 +++++ .../orgchart/service/OrgChartService.java | 32 ++++++++ .../orgchart/vo/OrgChartNodeVo.java | 80 +++++++++++++++++++ .../config/service/DealWithMapping.java | 18 +++++ 常用信息.md | 3 +- 8 files changed, 251 insertions(+), 1 deletion(-) create mode 100644 src/main/java/aiyh/utils/httpUtil/HttpMultipartFile.java create mode 100644 src/main/java/com/api/youhong/ai/pcn/organization/orgchart/controller/OrgChartController.java create mode 100644 src/main/java/com/api/youhong/ai/pcn/organization/orgchart/mapper/OrgChartMapper.java create mode 100644 src/main/java/com/api/youhong/ai/pcn/organization/orgchart/pojo/HrmResource.java create mode 100644 src/main/java/com/api/youhong/ai/pcn/organization/orgchart/service/OrgChartService.java create mode 100644 src/main/java/com/api/youhong/ai/pcn/organization/orgchart/vo/OrgChartNodeVo.java 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); + Listcreate: 2022-12-01 12:14
+ * + * @author youHong.ai + */ + +@SqlMapper +public interface OrgChartMapper { + + + @Select("select * from hrmresource") + Listcreate: 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); + + /** + *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