From b963913d62e28c099654f365dbd589e90c0e7915 Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 29 Jun 2023 17:37:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9E=B6=E6=9E=84=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/chart/TimeLinesBO.java | 29 +++++++++++++++++++ .../organization/service/OrgChartService.java | 8 +++++ .../service/impl/OrgChartServiceImpl.java | 23 +++++++++++++++ .../organization/web/OrgChartController.java | 26 +++++++++++++---- .../organization/wrapper/OrgChartWrapper.java | 3 ++ 5 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 src/com/engine/organization/entity/chart/TimeLinesBO.java diff --git a/src/com/engine/organization/entity/chart/TimeLinesBO.java b/src/com/engine/organization/entity/chart/TimeLinesBO.java new file mode 100644 index 00000000..ee7c20c0 --- /dev/null +++ b/src/com/engine/organization/entity/chart/TimeLinesBO.java @@ -0,0 +1,29 @@ +package com.engine.organization.entity.chart; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @Author liang.cheng + * @Date 2023/6/29 11:19 AM + * @Description: TODO + * @Version 1.0 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class TimeLinesBO { + + private Integer key; + + private Integer id; + + private String title; + + private String color; + + private String time; +} diff --git a/src/com/engine/organization/service/OrgChartService.java b/src/com/engine/organization/service/OrgChartService.java index 676c543a..84d355d7 100644 --- a/src/com/engine/organization/service/OrgChartService.java +++ b/src/com/engine/organization/service/OrgChartService.java @@ -85,4 +85,12 @@ public interface OrgChartService { */ void insertChartVersion(Integer fclass,String description); + /** + * @Description:时间轴查询 + * @Author: liang.cheng + * @Date: 2023/6/29 10:36 AM + * @param: [request2Map] + * @return: java.util.Map + */ + Map searchTimeLines(Map request2Map); } diff --git a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java index 6f7d7e97..720a5e62 100644 --- a/src/com/engine/organization/service/impl/OrgChartServiceImpl.java +++ b/src/com/engine/organization/service/impl/OrgChartServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateUtil; import com.engine.core.impl.Service; import com.engine.organization.entity.chart.CompanyTreePO; +import com.engine.organization.entity.chart.TimeLinesBO; import com.engine.organization.entity.map.JclOrgMap; import com.engine.organization.entity.scheme.po.GradePO; import com.engine.organization.entity.scheme.po.LevelPO; @@ -620,6 +621,28 @@ public class OrgChartServiceImpl extends Service implements OrgChartService { } + @Override + public Map searchTimeLines(Map params) { + Map datas = new HashMap<>(); + RecordSet rs = new RecordSet(); + String fclass = Util.null2String(params.get("fclass")); + List timeLinesBOList = new ArrayList<>(); + timeLinesBOList.add(TimeLinesBO.builder().key(0).id(0).title("当前版本").color("blue").time("").build()); + rs.executeQuery("SELECT id,recorddate,description from JCL_ORG_CHARTVERSION where fclass = ? and deletetype = ?",fclass,0); + while (rs.next()) { + timeLinesBOList.add(TimeLinesBO.builder() + .key(rs.getInt("id")) + .id(rs.getInt("id")) + .title(Util.null2String(rs.getString("description"))) + .color("grey") + .time(Util.null2String(rs.getString("recorddate"))) + .build()); + } + + datas.put("timelineList",timeLinesBOList); + return datas; + } + /** * 刷新在岗、编制数 */ diff --git a/src/com/engine/organization/web/OrgChartController.java b/src/com/engine/organization/web/OrgChartController.java index c3bec336..b4ddc9e8 100644 --- a/src/com/engine/organization/web/OrgChartController.java +++ b/src/com/engine/organization/web/OrgChartController.java @@ -30,9 +30,8 @@ public class OrgChartController { @GET @Path("/getCondition") @Produces(MediaType.APPLICATION_JSON) - public String getCondition(@Context HttpServletRequest request, @Context HttpServletResponse - response) { - Map apidatas = new HashMap(); + public String getCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) { + Map apidatas = new HashMap<>(); try { User user = HrmUserVarify.getUser(request, response); //实例化Service 并调用业务类处理 @@ -47,7 +46,24 @@ public class OrgChartController { return JSONObject.toJSONString(apidatas); } - + @GET + @Path("/timeLines") + @Produces(MediaType.APPLICATION_JSON) + public String searchTimeLines(@Context HttpServletRequest request, @Context HttpServletResponse response) { + Map apidatas = new HashMap<>(); + try { + User user = HrmUserVarify.getUser(request, response); + apidatas = getOrgChartWrapper(user).searchTimeLines(ParamUtil.request2Map(request), user); + } catch (Exception e) { + //异常处理 + e.printStackTrace(); + apidatas.put("api_status", false); + apidatas.put("api_errormsg", "catch exception : " + e.getMessage()); + } + return JSONObject.toJSONString(apidatas); + } + + @GET @Path("/getSubCompanyTree") @@ -77,7 +93,7 @@ public class OrgChartController { @Produces(MediaType.APPLICATION_JSON) public String getCompanyData(@Context HttpServletRequest request, @Context HttpServletResponse response) { - Map apidatas = new HashMap(); + Map apidatas = new HashMap<>(); try { User user = HrmUserVarify.getUser(request, response); //实例化Service 并调用业务类处理 diff --git a/src/com/engine/organization/wrapper/OrgChartWrapper.java b/src/com/engine/organization/wrapper/OrgChartWrapper.java index 6388a796..78502c40 100644 --- a/src/com/engine/organization/wrapper/OrgChartWrapper.java +++ b/src/com/engine/organization/wrapper/OrgChartWrapper.java @@ -48,4 +48,7 @@ public class OrgChartWrapper extends Service { return getOrgChartService(user).synchronousData(request2Map, user); } + public Map searchTimeLines(Map request2Map, User user) { + return getOrgChartService(user).searchTimeLines(request2Map); + } }