diff --git a/src/com/api/matfron/web/StatisticsPortalAction.java b/src/com/api/matfron/web/StatisticsPortalAction.java deleted file mode 100644 index bf17ec5..0000000 --- a/src/com/api/matfron/web/StatisticsPortalAction.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.api.matfron.web; - -import javax.ws.rs.Path; - -/** - * @Author liang.cheng - * @Date 2023/9/26 5:49 PM - * @Description: 铭沣科技统计分析门户接口 - * @Version 1.0 - */ - -@Path("/matfron/portal/element") -public class StatisticsPortalAction extends com.engine.matfron.web.StatisticsPortalAction { -} diff --git a/src/com/api/sship/web/OrgChartController.java b/src/com/api/sship/web/OrgChartController.java new file mode 100644 index 0000000..97ddd9a --- /dev/null +++ b/src/com/api/sship/web/OrgChartController.java @@ -0,0 +1,10 @@ +package com.api.sship.web; + +import javax.ws.rs.Path; + +/** + * @author liang.cheng + */ +@Path("/sship/organization/chart") +public class OrgChartController extends com.engine.sship.web.OrgChartController { +} diff --git a/src/com/engine/matfron/entity/DepartmentParam.java b/src/com/engine/matfron/entity/DepartmentParam.java deleted file mode 100644 index 9b25687..0000000 --- a/src/com/engine/matfron/entity/DepartmentParam.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.engine.matfron.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author liang.cheng - * @Date 2023/9/28 10:06 AM - * @Description: TODO - * @Version 1.0 - */ - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class DepartmentParam { - - private Integer departmentId; - - private String name; - - private Integer count; -} diff --git a/src/com/engine/matfron/entity/OptionVO.java b/src/com/engine/matfron/entity/OptionVO.java deleted file mode 100644 index 3c5baa7..0000000 --- a/src/com/engine/matfron/entity/OptionVO.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.engine.matfron.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.LinkedList; - -/** - * @Author liang.cheng - * @Date 2023/9/27 5:30 PM - * @Description: echarts option - * @Version 1.0 - */ - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class OptionVO { - - private String titleText; - - private LinkedList xData; - - private Integer yMin; - - private Integer yMax; - - private Integer yInterval; - - private LinkedList yData; - - private LinkedList legendDataFirst; - - private LinkedList legendDataTwo; - - private LinkedList barSeriesData; - - private LinkedList barSeriesDataTwo; - - private LinkedList barSeriesDataThree; - - private LinkedList seriesData; - -} diff --git a/src/com/engine/matfron/entity/PortalTopVO.java b/src/com/engine/matfron/entity/PortalTopVO.java deleted file mode 100644 index 158207a..0000000 --- a/src/com/engine/matfron/entity/PortalTopVO.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.engine.matfron.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author liang.cheng - * @Date 2023/9/27 3:45 PM - * @Description: - * @Version 1.0 - */ - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class PortalTopVO { - - private String title; - - private T count; - -} diff --git a/src/com/engine/matfron/entity/SeriesParam.java b/src/com/engine/matfron/entity/SeriesParam.java deleted file mode 100644 index b1196fa..0000000 --- a/src/com/engine/matfron/entity/SeriesParam.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.engine.matfron.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author liang.cheng - * @Date 2023/9/28 2:02 PM - * @Description: TODO - * @Version 1.0 - */ - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class SeriesParam { - - private Double value; - - private String name; - - private String color; - - -} diff --git a/src/com/engine/matfron/entity/SurnameParam.java b/src/com/engine/matfron/entity/SurnameParam.java deleted file mode 100644 index 4185263..0000000 --- a/src/com/engine/matfron/entity/SurnameParam.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.engine.matfron.entity; - -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; - -/** - * @Author liang.cheng - * @Date 2023/10/9 1:11 PM - * @Description: TODO - * @Version 1.0 - */ - -@Data -@Builder -@AllArgsConstructor -@NoArgsConstructor -public class SurnameParam { - - private Double companyworkyear; - - private Integer count; - -} diff --git a/src/com/engine/matfron/service/StatisticsPortalService.java b/src/com/engine/matfron/service/StatisticsPortalService.java deleted file mode 100644 index 45faf3d..0000000 --- a/src/com/engine/matfron/service/StatisticsPortalService.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.engine.matfron.service; - -import com.engine.matfron.entity.OptionVO; -import com.engine.matfron.entity.PortalTopVO; - -import java.util.LinkedList; -import java.util.Map; - - -/** - * @Author liang.cheng - * @Date 2023/9/26 5:51 PM - * @Description: 统计分析门户 - * @Version 1.0 - */ -public interface StatisticsPortalService { - - /** - * @Description: 门户顶部 - * @Author: liang.cheng - * @Date: 2023/9/27 4:02 PM - * @param: [] - * @return: com.engine.matfron.entity.PortalTopVO - */ - LinkedList getPortalTop(); - - /** - * @Description: 一级部门人数统计 - * @Author: liang.cheng - * @Date: 2023/9/27 5:40 PM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getPortalDepartment(); - - /** - * @Description: 各月份分部总人数 - * @Author: liang.cheng - * @Date: 2023/9/28 11:23 AM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getPortalSubCompany(); - - /** - * @Description: 民族分析 - * @Author: liang.cheng - * @Date: 2023/10/9 9:52 AM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getPortalEthnic(); - - /** - * @Description: 归属地分析 - * @Author: liang.cheng - * @Date: 2023/10/10 5:57 PM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getHomePlace(); - - /** - * @Description: 学历分析 - * @Author: liang.cheng - * @Date: 2023/10/9 9:53 AM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getEducational(); - - /** - * @Description: 司龄统计 - * @Author: liang.cheng - * @Date: 2023/10/9 11:21 AM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getSurname(); - - /** - * @Description: 年龄与性别分析 - * @Author: liang.cheng - * @Date: 2023/10/9 2:32 PM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getAgeAndSex(); - - /** - * @Description: 职务类别统计 - * @Author: liang.cheng - * @Date: 2023/10/9 5:52 PM - * @param: [] - * @return: com.engine.matfron.entity.OptionVO - */ - OptionVO getJobType(); - - /** - * @Description: 当月多部门离职率统计 - * @Author: liang.cheng - * @Date: 2023/10/9 7:00 PM - * @param: [departmentIds] - * @return: map - */ - Map getLeaveMonth(String departmentIds); - - /** - * @Description: 年度离职率统计 - * @Author: liang.cheng - * @Date: 2023/10/10 9:37 AM - * @param: [departmentIds] - * @return: map - */ - Map getLeaveYear(String departmentIds); - - -} diff --git a/src/com/engine/matfron/service/impl/StatisticsPortalServiceImpl.java b/src/com/engine/matfron/service/impl/StatisticsPortalServiceImpl.java deleted file mode 100644 index f1ecea9..0000000 --- a/src/com/engine/matfron/service/impl/StatisticsPortalServiceImpl.java +++ /dev/null @@ -1,634 +0,0 @@ -package com.engine.matfron.service.impl; - -import com.engine.core.impl.Service; -import com.engine.matfron.entity.*; -import com.engine.matfron.exception.CustomizeRunTimeException; -import com.engine.matfron.service.StatisticsPortalService; -import com.engine.matfron.util.CommonDateUtil; -import com.engine.matfron.util.CommonUtils; -import lombok.SneakyThrows; -import org.apache.commons.lang.StringUtils; -import weaver.conn.RecordSet; -import weaver.general.Util; -import weaver.hrm.company.DepartmentComInfo; - -import java.text.DecimalFormat; -import java.time.LocalDate; -import java.time.Period; -import java.time.YearMonth; -import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Collectors; - - -/** - * @Author liang.cheng - * @Date 2023/9/26 5:52 PM - * @Description: - * @Version 1.0 - */ -public class StatisticsPortalServiceImpl extends Service implements StatisticsPortalService { - - - private final DecimalFormat df = new DecimalFormat("#.00"); - - @Override - public LinkedList getPortalTop() { - RecordSet rs = new RecordSet(); - LinkedList portalTopVOList = new LinkedList<>(); - - rs.executeQuery("select count(1) as count from hrmresource where status < 4"); - rs.next(); - Integer count = Util.getIntValue(rs.getString("count"), 0); - portalTopVOList.add(PortalTopVO.builder().title("在职人数总数").count(count).build()); - portalTopVOList.add(PortalTopVO.builder().title("社保缴纳人数").count(0).build()); - - List birthdayList = new ArrayList<>(); - rs.executeQuery("select birthday from hrmresource where status < 4 and birthday is not null and birthday <> ''"); - while (rs.next()) { - birthdayList.add(Util.null2String(rs.getString("birthday"))); - } - - double averageAge = birthdayList.stream() - .map(CommonUtils::parseLocalDate) - .mapToInt(CommonUtils::calculateAge) - .average() - .orElse(0); - String avgAge = df.format(averageAge); - portalTopVOList.add(PortalTopVO.builder().title("平均年龄").count(avgAge).build()); - - String startMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateStartOfMonth(YearMonth.now())); - String endMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateEndOfMonth(YearMonth.now())); - rs.executeQuery("select count(1) as sum from hrmresource where status < 4 and companystartdate >= ? and companystartdate <= ?",startMonth,endMonth); - rs.next(); - Integer sum = Util.getIntValue(rs.getString("sum"),0); - portalTopVOList.add(PortalTopVO.builder().title("本月新入职人员").count(sum).build()); - - return portalTopVOList; - } - - @SneakyThrows - @Override - public OptionVO getPortalDepartment() { - RecordSet rs = new RecordSet(); - LinkedList xData = new LinkedList<>(); - LinkedList yData = new LinkedList<>(); - DepartmentComInfo comInfo = new DepartmentComInfo(); - - List ids = new ArrayList<>(); - rs.executeQuery("select id,departmentname from hrmdepartment where supdepid = 0 and (canceled = 0 or canceled is null)"); - while (rs.next()) { - xData.add(Util.null2String(rs.getString("departmentname"))); - ids.add(Util.getIntValue(rs.getString("id"))); - } - - List deptList = new ArrayList<>(); - rs.executeQuery("SELECT d.id, CASE WHEN t.count IS NULL THEN 0 ELSE t.count END AS num \n" + - " FROM hrmdepartment d left join (SELECT departmentid, COUNT(1) AS count FROM hrmresource where status < 4 GROUP BY departmentid) t ON d.id = t.departmentid \n" + - " where d.id in ("+StringUtils.join(ids,",")+")"); - while (rs.next()) { - int deptid = Util.getIntValue(rs.getString("id")); - int num = Util.getIntValue(rs.getString("num")); - String allSupDepartment; - allSupDepartment = comInfo.getAllSupDepartment(String.valueOf(deptid)); - if (StringUtils.isNotEmpty(allSupDepartment)) { - int count = countBydeptIds(allSupDepartment); - num = num + count; - } - - yData.add(num); - deptList.add(DepartmentParam.builder().departmentId(deptid).count(num).build()); - } - - - int max = Collections.max(yData); - int ceil =(int) Math.ceil((double) max / 5); - ceil = CommonUtils.roundUpToNearestTen(ceil); - int roundedMax = CommonUtils.roundedMax(ceil, 5); - - return OptionVO.builder() - .titleText("一级部门人数统计") - .xData(xData) - .yMin(0) - .yMax(roundedMax) - .yInterval(ceil) - .yData(yData) - .build(); - } - - @Override - public OptionVO getPortalSubCompany() { - RecordSet rs = new RecordSet(); - LinkedList yData = new LinkedList<>(); - - List yearMonths = CommonDateUtil.getYearMonths(LocalDate.now()); - yearMonths.forEach(yearMonth -> { - String startMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateStartOfMonth(yearMonth)); - String endMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateEndOfMonth(yearMonth)); - rs.executeQuery("select count(1) as sum from hrmresource where status < 4 and companystartdate <= ?",endMonth); - if (rs.next()) { - Integer sum = Util.getIntValue(rs.getString("sum"),0); - yData.add(sum); - } - - }); - - int max = Collections.max(yData); - int ceil =(int) Math.ceil((double) max / 5); - ceil = CommonUtils.roundUpToNearestTen(ceil); - int roundedMax = CommonUtils.roundedMax(ceil, 5); - - return OptionVO.builder() - .titleText("各月份分部总人数") - .yMin(0) - .yMax(roundedMax) - .yInterval(ceil) - .yData(yData) - .build(); - } - - @Override - public OptionVO getPortalEthnic() { - RecordSet rs = new RecordSet(); - List colorList = Arrays.asList("#6e94f3","#faf0e6","#7cfc00","#ao20f0","#00ced1","#83d8ae","#697695","#8ac9e9","#9933fa","#c0ff3e","#ffe4c4","#cd6090"); - LinkedList seriesData = new LinkedList<>(); - LinkedList nameSet = new LinkedList<>(); - - rs.executeQuery("select distinct folk,count(1) as sums from hrmresource where status < 4 \n" + - " and folk is not null group by folk"); - while (rs.next()) { - Random random = new Random(); - String color = colorList.get(random.nextInt(colorList.size())); - String name = Util.null2String(rs.getString("folk")); - seriesData.add(SeriesParam.builder().value(Util.getDoubleValue(rs.getString("sums"))) - .name(name).color(color).build()); - nameSet.add(name); - } - - double percentage = seriesData.stream().mapToDouble(SeriesParam::getValue).sum(); - seriesData.forEach(item -> item.setValue(Double.valueOf(df.format((item.getValue() * 100) / percentage)))); - -// LinkedList legendDataFirst = null; -// if (nameSet.size() > 2) { -// int splitSize = nameSet.size() / 2; -// legendDataFirst = nameSet.stream() -// .collect(Collectors.partitioningBy(e -> nameSet.indexOf(e) < splitSize, -// Collectors.toCollection(LinkedList::new))) -// .get(false); -// nameSet.removeAll(legendDataFirst); -// } - - return OptionVO.builder() - .titleText("民族分析") - .legendDataTwo(nameSet) - .seriesData(seriesData) - .build(); - } - - @Override - public OptionVO getHomePlace() { - RecordSet rs = new RecordSet(); - List colorList = Arrays.asList("#ao20f0","#8ac9e9","#697695","#83d8ae","#faf0e6","#7cfc00","#6e94f3","#9933fa","#c0ff3e","#00ced1","#ffe4c4","#cd6090"); - LinkedList seriesData = new LinkedList<>(); - LinkedList legendData = new LinkedList<>(); - - rs.executeQuery("select h.locationid,l.locationname,count(1) as num from hrmresource h\n" + - " left join hrmlocations l on h.locationid = l.id\n" + - " where h.status < 4 and h.locationid is not null group by h.locationid,l.locationname"); - while (rs.next()) { - String locationname = Util.null2String(rs.getString("locationname")); - legendData.add(locationname); - Random random = new Random(); - String color = colorList.get(random.nextInt(colorList.size())); - seriesData.add(SeriesParam.builder().value(Util.getDoubleValue(rs.getString("num"))).name(locationname).color(color).build()); - } - - List values = seriesData.stream().map(SeriesParam :: getValue).collect(Collectors.toList()); - double percentage = values.stream().mapToDouble(Double::doubleValue).sum(); - seriesData.forEach(item -> item.setValue(Double.valueOf(df.format((item.getValue() * 100) / percentage)))); - - return OptionVO.builder() - .titleText("归属地分析") - .legendDataFirst(legendData) - .seriesData(seriesData) - .build(); - } - - @Override - public OptionVO getEducational() { - RecordSet rs = new RecordSet(); - List colorList = Arrays.asList("#faf0e6","#7cfc00","#ee8164","#9933fa","#f19c45","#6fcecf","#507ef7","#ao20f0"); - LinkedList seriesData = new LinkedList<>(); - LinkedList nameSet = new LinkedList<>(); - - - rs.executeQuery("select distinct h.educationlevel,count(1) as sum,d.name from hrmresource h\n" + - "left join hrmeducationlevel d on h.educationlevel = d.id where status < 4 \n" + - "and h.educationlevel is not null and d.name is not null group by h.educationlevel,d.name "); - int index = 0; - while (rs.next()) { - if (index > colorList.size()){ - index = 0; - } - index++; - String name = Util.formatMultiLang (Util.null2String(rs.getString("name"))); - - seriesData.add(SeriesParam.builder().value(Util.getDoubleValue(rs.getString("sum"))) - .name(name).color(colorList.get(index)).build()); - nameSet.add(name); - } - - double percentage = seriesData.stream().mapToDouble(SeriesParam::getValue).sum(); - seriesData.forEach(item -> item.setValue(Double.valueOf(df.format((item.getValue() * 100) / percentage)))); - - LinkedList legendDataFirst = new LinkedList<>(); - - if (nameSet.size() > 2) { - legendDataFirst = treeSetSplitExample(nameSet); - } - - return OptionVO.builder() - .titleText("学历分析") - .legendDataFirst(legendDataFirst) - .legendDataTwo(nameSet) - .seriesData(seriesData) - .build(); - } - - @Override - public OptionVO getSurname() { - RecordSet rs = new RecordSet(); - LinkedList seriesData = new LinkedList<>(); - - List surnameList = new ArrayList<>(); - rs.executeQuery("select companyworkyear,count(1) as sum from hrmresource where status < 4 " + - " and companyworkyear is not null group by companyworkyear "); - while (rs.next()) { - surnameList.add(SurnameParam.builder().companyworkyear(Util.getDoubleValue(rs.getString("companyworkyear"))).count(Util.getIntValue(rs.getString("sum"))).build()); - } - - List statisticsArr = Arrays.asList(0,1,3,5,10,100); - List statisticsList = new ArrayList<>(); - for (int i = 0; i < 5; i++) { - double count = statisticsSurname(statisticsArr.get(i), statisticsArr.get(i+1), surnameList); - statisticsList.add(count); - } - - double percentage = statisticsList.stream().mapToDouble(Double::doubleValue).sum(); - List newList = statisticsList.stream() - .map(num -> Double.valueOf (df.format((num * 100 ) / percentage))) - .collect(Collectors.toList()); - - newList.forEach(count -> seriesData.add(SeriesParam.builder().value(count).build())); - - return OptionVO.builder() - .titleText("司龄统计") - .seriesData(seriesData) - .build(); - } - - @Override - public OptionVO getAgeAndSex() { - RecordSet rs = new RecordSet(); - LinkedList barSeriesData = new LinkedList<>(); - LinkedList barSeriesDataTwo = new LinkedList<>(); - List ageArr = Arrays.asList("16~20","21~25","26~30","31~35","36~40","41~45","46~50","51~55","56~60","61~65","66~70"); - - List birthdayListMen = new ArrayList<>(); - rs.executeQuery("select birthday from hrmresource where status < 4 and sex is not null and birthday is not null and birthday <> '' and sex = 0"); - while (rs.next()) { - birthdayListMen.add(Util.null2String(rs.getString("birthday"))); - } - List menAge = birthdayListMen.stream() - .map(birthday -> { - LocalDate birthdate = LocalDate.parse(birthday); - LocalDate now = LocalDate.now(); - return Period.between(birthdate, now).getYears(); - }) - .collect(Collectors.toList()); - - - - for (int i = 0; i < ageArr.size(); i++) { - String[] split = ageArr.get(i).split("~"); - List collect = menAge.stream().filter(item -> item > Integer.parseInt(split[0]) && item <= Integer.parseInt(split[1])).collect(Collectors.toList()); - barSeriesData.add(collect.size()); - } - - int yMax = barSeriesData.stream().max(Integer::compare).orElse(0); - - - - List birthdayListWomen = new ArrayList<>(); - rs.executeQuery("select birthday from hrmresource where status < 4 and sex is not null and birthday is not null and sex = 1"); - while (rs.next()) { - birthdayListWomen.add(Util.null2String(rs.getString("birthday"))); - } - List womenAge = birthdayListWomen.stream() - .map(birthday -> { - LocalDate birthdate = LocalDate.parse(birthday); - LocalDate now = LocalDate.now(); - return Period.between(birthdate, now).getYears(); - }) - .collect(Collectors.toList()); - - - LinkedList list = new LinkedList<>(); - for (int i = 0; i < ageArr.size(); i++) { - String[] split = ageArr.get(i).split("~"); - List collect = womenAge.stream().filter(item -> item > Integer.parseInt(split[0]) && item <= Integer.parseInt(split[1])).collect(Collectors.toList()); - barSeriesDataTwo.add(-collect.size()); - list.add(collect.size()); - } - - int yMin = -(list.stream().max(Integer::compare).orElse(0)); - int sum = yMax > Math.abs(yMin) ? yMax : yMin ; - - int divisor = sum % 6; - sum = sum + (6 - divisor) + 12; - int ceil =(int) Math.ceil((double) sum / 3); - int roundedMax = CommonUtils.roundedMax(ceil, 6); - - return OptionVO.builder() - .titleText("年龄与性别分析") - .yMin(-roundedMax) - .yMax(roundedMax) - .yInterval(ceil) - .barSeriesData(barSeriesData) - .barSeriesDataTwo(barSeriesDataTwo) - .build(); - } - - @Override - public OptionVO getJobType() { - RecordSet rs = new RecordSet(); - LinkedList xData = new LinkedList<>(); - LinkedList barSeriesData = new LinkedList<>(); - - rs.executeQuery("select a.*,b.jobgroupname from (select g.id as jobgroupid,count(1) as sum from hrmresource h \n" + - " left join hrmjobtitles j on h.jobtitle = j.id\n" + - " left join hrmjobactivities c on j.jobactivityid = c.id\n" + - " left join hrmjobgroups g on c.jobgroupid = g.id\n" + - " where h.status < 4 and g.id is not null group by g.id) as a left join hrmjobgroups b on a.jobgroupid = b.id"); - - while (rs.next()) { - xData.add(Util.null2String(rs.getString("jobgroupname"))); - barSeriesData.add(Util.getIntValue(rs.getString("sum"))); - } - - int max = Collections.max(barSeriesData); - int ceil =(int) Math.ceil((double) max / 4); - ceil = CommonUtils.roundUpToNearestTen(ceil); - int roundedMax = CommonUtils.roundedMax(ceil, 4); - - return OptionVO.builder() - .titleText("职务类别统计") - .xData(xData) - .yMin(0) - .yMax(roundedMax) - .yInterval(ceil) - .barSeriesData(barSeriesData) - .build(); - } - - @Override - public Map getLeaveMonth(String departmentIds) { - Map data = new HashMap<>(4); - RecordSet rs = new RecordSet(); - String startMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateStartOfMonth(YearMonth.now())); - String endMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateEndOfMonth(YearMonth.now())); - LinkedList xData = new LinkedList<>(); - LinkedList barSeriesData = new LinkedList<>(); - LinkedList browser = new LinkedList<>(); - - StringBuilder sql = new StringBuilder(); - sql.append("select t.departmentname, t.id,CASE \n" + - " WHEN a.sum IS NULL THEN 0 \n" + - " ELSE a.sum \n" + - " END AS num from hrmdepartment t \n" + - " left join (select s.departmentid,count(1) as sum from hrmstatushistory h left join hrmresource s on h.resourceid = s.id " + - " where h.type_n = 5 and h.changedate >= ? and h.changedate <= ? group by s.departmentid ) a\n" + - " on t.id = a.departmentid "); - - if(StringUtils.isNotEmpty(departmentIds)) { - sql.append(" where (t.canceled = 0 or t.canceled is null)"); - sql.append(" and t.id in (").append(departmentIds).append(")"); - - } - - rs.executeQuery(sql.toString(),startMonth,endMonth); - - int i = 0; - while (rs.next() && i < 5) { - i++; - Integer id = Util.getIntValue(rs.getString("id")); - String name = Util.null2String(rs.getString("departmentname")); - int num = Util.getIntValue(rs.getString("num")); - xData.add(name); - int countBydeptId = countBydeptId(id, endMonth) + num; - barSeriesData.add( countBydeptId == 0 ? 0 : (num * 100) / countBydeptId); - browser.add(BrowserParam.builder().id(id).name(name).build()); - } - - int max = Collections.max(barSeriesData); - max = max < 80 ? max + 20 : 100; - int ceil =(int) Math.ceil((double) max / 4); - int roundedMax = CommonUtils.roundedMax(ceil, 4); - - OptionVO optionVo = OptionVO.builder().titleText("当月多部门离职率统计") - .xData(xData) - .yMin(0) - .yMax(roundedMax) - .yInterval(ceil) - .barSeriesData(barSeriesData) - .build(); - - - data.put("replaceDatas",browser); - data.put("optionVo",optionVo); - - return data; - } - - @Override - public Map getLeaveYear(String departmentIds) { - Map data = new HashMap<>(4); - RecordSet rs = new RecordSet(); - LinkedList legendDataFirst = new LinkedList<>(); - LinkedList barSeriesData = new LinkedList<>(); - LinkedList barSeriesDataTwo = new LinkedList<>(); - LinkedList barSeriesDataThree = new LinkedList<>(); - DepartmentComInfo comInfo = new DepartmentComInfo(); - LinkedList browser = new LinkedList<>(); - List deptList = new ArrayList<>(); - - if(StringUtils.isNotEmpty(departmentIds)) { - deptList = Arrays.stream(departmentIds.split(",")).map(Integer::parseInt) - .collect(Collectors.toList()); - - }else { -// rs.executeQuery("select distinct t.id from hrmdepartment t \n" + -// " left join hrmresource h on t.id = h.departmentid\n" + -// " left join hrmstatushistory s on h.id = s.resourceid where s.type_n = 5 "); - rs.executeQuery("select id from hrmdepartment where canceled = 0 or canceled is null"); - while (rs.next()) { - deptList.add(Util.getIntValue(rs.getString("id"))); - } - - } - - deptList = deptList.stream().limit(3).collect(Collectors.toList()); - - deptList.forEach(dept -> { - try { - String departmentName = comInfo.getDepartmentName(String.valueOf(dept)); - legendDataFirst.add(departmentName); - browser.add(BrowserParam.builder().id(dept).name(departmentName).build()); - } catch (Exception e) { - throw new CustomizeRunTimeException("所选部门不存在"); - } - }); - - List yearMonths = CommonDateUtil.getYearMonths(LocalDate.now()); - List finalDeptList = deptList; - yearMonths.forEach(yearMonth -> { - String startMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateStartOfMonth(yearMonth)); - String endMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateEndOfMonth(yearMonth)); - for (int i = 0; i < 3; i++) { - Integer value = calculateLeave(finalDeptList.get(i), startMonth, endMonth); - switch (i) { - case 0: - barSeriesData.add(value); - break; - case 1: - barSeriesDataTwo.add(value); - break; - case 2: - barSeriesDataThree.add(value); - break; - default: - break; - - } - } - - }); - - LinkedList sumData = new LinkedList<>(); - sumData.addAll(barSeriesData); - sumData.addAll(barSeriesDataTwo); - sumData.addAll(barSeriesDataThree); - - int max = Collections.max(sumData); - max = max < 80 ? max + 20 : 100; - int ceil =(int) Math.ceil((double) max / 4); - int roundedMax = CommonUtils.roundedMax(ceil, 4); - - OptionVO optionVo = OptionVO.builder().titleText("年度离职率统计") - .legendDataFirst(legendDataFirst) - .yMin(0) - .yMax(roundedMax) - .yInterval(ceil) - .barSeriesData(barSeriesData) - .barSeriesDataTwo(barSeriesDataTwo) - .barSeriesDataThree(barSeriesDataThree) - .build(); - - data.put("replaceDatas",browser); - data.put("optionVo",optionVo); - - return data; - } - - private Integer calculateLeave(Integer id,String startMonth,String endMonth) { - RecordSet rs = new RecordSet(); - String sql = ("select t.departmentname, t.id,CASE \n" + - " WHEN a.sum IS NULL THEN 0 \n" + - " ELSE a.sum \n" + - " END AS num from hrmdepartment t \n" + - " left join (select s.departmentid,count(1) as sum from hrmstatushistory h left join hrmresource s on h.resourceid = s.id " + - " where type_n = 5 and changedate >= ? and changedate <= ? group by s.departmentid ) a\n" + - " on t.id = a.departmentid where t.id = ? and (t.canceled = 0 or t.canceled is null)"); - rs.executeQuery(sql,startMonth,endMonth,id); - rs.next(); - int countBydeptId = countBydeptId(id, endMonth); - return countBydeptId == 0 ? 0 : ((Util.getIntValue(rs.getString("num")) * 100) / countBydeptId); - } - - - - /** - * 根据日期部门人数统计 - * @param departmentId - * @return - */ - private int countBydeptId(Integer departmentId,String endMonth) { - RecordSet rs = new RecordSet(); - rs.executeQuery("select count(1) as sum from hrmresource where departmentId = ? and status < 4 and companystartdate <= ? ",departmentId,endMonth); - rs.next(); - return Util.getIntValue(rs.getString("sum")); - } - - - /** - * 子部门日数统计 - * @param deptIds - * @return - */ - private int countBydeptIds(String deptIds) { - RecordSet rs = new RecordSet(); - rs.executeQuery("select count(1) as sum from hrmresource where departmentId in ("+deptIds+")"); - rs.next(); - return Util.getIntValue(rs.getString("sum")); - } - - /** - * 根据范围统计司龄的个数 - * @return - */ - private Double statisticsSurname(Integer min,Integer max,List surnameList) { - return surnameList.stream().filter(item -> item.getCompanyworkyear() > min && item.getCompanyworkyear() <= max) - .mapToDouble(SurnameParam::getCount).sum(); - } - - /** - * 平分legendData - * @param nameSet - */ - private LinkedList treeSetSplitExample(LinkedList nameSet) { - int splitSize = nameSet.size() / 2; - LinkedList legendDataFirst = nameSet.stream() - .collect(Collectors.partitioningBy(e -> nameSet.indexOf(e) < splitSize, - Collectors.toCollection(LinkedList::new))) - .get(false); - nameSet.removeAll(legendDataFirst); - return legendDataFirst; - } - - /** - * 多语言匹配中文 - * @param input - * @return - */ - private String chineseSubstringExample(String input) { - - String r = "7.*`~`8"; - Pattern pattern1 = Pattern.compile(r); - Matcher matcher = pattern1.matcher(input); - - while (matcher.find()) { - input = matcher.group(0); - } - - // 使用正则表达式匹配中文 - String pattern = "[\u4E00-\u9FA5\u8FBD-\u9FBB\uFA0E-\uFA29]+"; - Pattern s = Pattern.compile(pattern); - Matcher m = s.matcher(input); - while (m.find()) { - input = m.group(0); - } - return input; - } - -} diff --git a/src/com/engine/matfron/util/CommonDateUtil.java b/src/com/engine/matfron/util/CommonDateUtil.java deleted file mode 100644 index 14add97..0000000 --- a/src/com/engine/matfron/util/CommonDateUtil.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.engine.matfron.util; - -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; - -import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.YearMonth; -import java.time.ZoneId; -import java.time.ZonedDateTime; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Objects; - -/** - * @Author liang.cheng - * @Date 2023/9/27 4:44 PM - * @Description: - * @Version 1.0 - */ - -@Slf4j -public class CommonDateUtil { - - public static final String DATE_FORMATTER_PATTERN = "yyyy-MM-dd"; - - /** - * YearMonth转Date - * 注意dayOfMonth范围:1到31之间,最大值根据月份确定特殊情况,如2月闰年29,非闰年28 - * 如果要转换为当月最后一天,可以使用下面方法:toDateEndOfMonth(YearMonth) - * - * @param yearMonth - * @param dayOfMonth - * @return - */ - public static Date toDate(YearMonth yearMonth, int dayOfMonth) { - Objects.requireNonNull(yearMonth, "yearMonth"); - return localDateToDate(yearMonth.atDay(dayOfMonth)); - } - - - /** - * YearMonth转Date,转换为当月第一天 - * - * @param yearMonth - * @return - */ - public static Date toDateStartOfMonth(YearMonth yearMonth) { - return toDate(yearMonth, 1); - } - - /** - * YearMonth转Date,转换为当月最后一天 - * - * @param yearMonth - * @return - */ - public static Date toDateEndOfMonth(YearMonth yearMonth) { - Objects.requireNonNull(yearMonth, "yearMonth"); - return localDateToDate(yearMonth.atEndOfMonth()); - } - - public static Date localDateToDate(LocalDate localDate) { - if (null == localDate) { - return null; - } - ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault()); - return Date.from(zonedDateTime.toInstant()); - } - - public static String getFormatYear(Date localDate) { - if (localDate == null) { - return StringUtils.EMPTY; - } - try { - SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_FORMATTER_PATTERN); - return simpleDateFormat.format(localDate); - } catch (Exception e) { - log.warn("格式化年份错误", e); - return StringUtils.EMPTY; - } - } - - public static List getYearMonths(LocalDate date) { - List yearMonths = new ArrayList<>(); - for (int month = 1; month <= 12; month++) { - LocalDate firstDayOfMonth = date.withMonth(month); - yearMonths.add(YearMonth.from(firstDayOfMonth)); - } - return yearMonths; - } - -} diff --git a/src/com/engine/matfron/util/CommonUtils.java b/src/com/engine/matfron/util/CommonUtils.java deleted file mode 100644 index 63c5b17..0000000 --- a/src/com/engine/matfron/util/CommonUtils.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.engine.matfron.util; - -import java.time.LocalDate; -import java.time.Period; -import java.time.format.DateTimeFormatter; - -/** - * @Author liang.cheng - * @Date 2023/9/27 4:52 PM - * @Description: TODO - * @Version 1.0 - */ -public class CommonUtils { - - public static LocalDate parseLocalDate(String dateString) { - DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); - return LocalDate.parse(dateString, formatter); - } - - public static int calculateAge(LocalDate birthday) { - LocalDate currentDate = LocalDate.now(); - return Period.between(birthday, currentDate).getYears(); - } - - public static int roundUpToNearestTen(int num) { - return (num + 9) / 10 * 10; - } - - - public static int roundedMax(int ceil,int copies){ - return ceil * copies; - } - -} diff --git a/src/com/engine/matfron/web/StatisticsPortalAction.java b/src/com/engine/matfron/web/StatisticsPortalAction.java deleted file mode 100644 index 9206918..0000000 --- a/src/com/engine/matfron/web/StatisticsPortalAction.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.engine.matfron.web; - -import com.engine.common.util.ServiceUtil; -import com.engine.matfron.entity.OptionVO; -import com.engine.matfron.entity.PortalTopVO; -import com.engine.matfron.service.StatisticsPortalService; -import com.engine.matfron.service.impl.StatisticsPortalServiceImpl; -import com.engine.matfron.util.ResponseResult; -import weaver.hrm.HrmUserVarify; -import weaver.hrm.User; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import java.util.LinkedList; -import java.util.Map; - - -/** - * @Author liang.cheng - * @Date 2023/9/26 5:51 PM - * @Description: - * @Version 1.0 - */ -public class StatisticsPortalAction { - - private StatisticsPortalService getCommonDutyService(User user) { - return ServiceUtil.getService(StatisticsPortalServiceImpl.class,user); - } - - - @GET - @Path("/statistics/top") - @Produces(MediaType.APPLICATION_JSON) - public String getPortalTop(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getCommonDutyService(user) :: getPortalTop); - } - - @GET - @Path("/statistics/department") - @Produces(MediaType.APPLICATION_JSON) - public String getPortalDepartment(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getPortalDepartment); - } - - @GET - @Path("/statistics/subcompany") - @Produces(MediaType.APPLICATION_JSON) - public String getPortalSubCompany(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getPortalSubCompany); - } - - - @GET - @Path("/statistics/homePlace") - @Produces(MediaType.APPLICATION_JSON) - public String getHomePlace(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getHomePlace); - } - - @GET - @Path("/statistics/ethnic") - @Produces(MediaType.APPLICATION_JSON) - public String getPortalEthnic(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getPortalEthnic); - } - - @GET - @Path("/statistics/educational") - @Produces(MediaType.APPLICATION_JSON) - public String getEducational(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getEducational); - } - - @GET - @Path("/statistics/surname") - @Produces(MediaType.APPLICATION_JSON) - public String getSurname(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getSurname); - } - - - @GET - @Path("/statistics/ageAndSex") - @Produces(MediaType.APPLICATION_JSON) - public String getAgeAndSex(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getAgeAndSex); - } - - @GET - @Path("/statistics/jobType") - @Produces(MediaType.APPLICATION_JSON) - public String getJobType(@Context HttpServletRequest request, @Context HttpServletResponse response) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult(user).run(getCommonDutyService(user) :: getJobType); - } - - @GET - @Path("/statistics/leaveMonth") - @Produces(MediaType.APPLICATION_JSON) - public String getLeaveMonth(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("departmentIds") String departmentIds) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getCommonDutyService(user) :: getLeaveMonth,departmentIds); - - } - - @GET - @Path("/statistics/leaveYear") - @Produces(MediaType.APPLICATION_JSON) - public String getLeaveYear(@Context HttpServletRequest request, @Context HttpServletResponse response,@QueryParam("departmentIds") String departmentIds) { - User user = HrmUserVarify.getUser(request, response); - return new ResponseResult>(user).run(getCommonDutyService(user) :: getLeaveYear,departmentIds); - } - - - -} diff --git a/src/com/engine/sship/entity/ChartChildrensVO.java b/src/com/engine/sship/entity/ChartChildrensVO.java new file mode 100644 index 0000000..97f4546 --- /dev/null +++ b/src/com/engine/sship/entity/ChartChildrensVO.java @@ -0,0 +1,26 @@ +package com.engine.sship.entity; + +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author liang.cheng + */ +@Data +@Builder +@AllArgsConstructor +@NoArgsConstructor +public class ChartChildrensVO { + + private Integer id; + + private Integer pid; + + private String label; + + private List childrens; +} diff --git a/src/com/engine/matfron/entity/BrowserParam.java b/src/com/engine/sship/entity/TreeDataVO.java similarity index 51% rename from src/com/engine/matfron/entity/BrowserParam.java rename to src/com/engine/sship/entity/TreeDataVO.java index 7400f11..fcedc55 100644 --- a/src/com/engine/matfron/entity/BrowserParam.java +++ b/src/com/engine/sship/entity/TreeDataVO.java @@ -1,24 +1,24 @@ -package com.engine.matfron.entity; +package com.engine.sship.entity; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -/** - * @Author liang.cheng - * @Date 2023/10/10 1:41 PM - * @Description: TODO - * @Version 1.0 - */ +import java.util.List; + @Data @Builder @AllArgsConstructor @NoArgsConstructor -public class BrowserParam { +public class TreeDataVO { private Integer id; - private String name; + private String label; + + private List childrens; + + } diff --git a/src/com/engine/matfron/exception/CustomizeRunTimeException.java b/src/com/engine/sship/exception/CustomizeRunTimeException.java similarity index 91% rename from src/com/engine/matfron/exception/CustomizeRunTimeException.java rename to src/com/engine/sship/exception/CustomizeRunTimeException.java index ce22409..65b3bd2 100644 --- a/src/com/engine/matfron/exception/CustomizeRunTimeException.java +++ b/src/com/engine/sship/exception/CustomizeRunTimeException.java @@ -1,4 +1,4 @@ -package com.engine.matfron.exception; +package com.engine.sship.exception; /** * @Author weaver_cl diff --git a/src/com/engine/sship/service/OrgChartService.java b/src/com/engine/sship/service/OrgChartService.java new file mode 100644 index 0000000..f1371a1 --- /dev/null +++ b/src/com/engine/sship/service/OrgChartService.java @@ -0,0 +1,20 @@ +package com.engine.sship.service; + + +import com.engine.sship.entity.ChartChildrensVO; + +/** + * @author apple + */ +public interface OrgChartService { + + + /** + * @Description: 集团组织人员图 + * @Author: liang.cheng + * @Date: 2024/1/3 10:07 AM + * @param: [] + * @return: com.engine.sship.entity.ChartChildrensVO + */ + ChartChildrensVO selectResourceChart(); +} diff --git a/src/com/engine/sship/service/impl/OrgChartServiceImpl.java b/src/com/engine/sship/service/impl/OrgChartServiceImpl.java new file mode 100644 index 0000000..c17310f --- /dev/null +++ b/src/com/engine/sship/service/impl/OrgChartServiceImpl.java @@ -0,0 +1,21 @@ +package com.engine.sship.service.impl; + +import com.engine.core.impl.Service; +import com.engine.sship.entity.ChartChildrensVO; +import com.engine.sship.service.OrgChartService; + + +/** + * @Author liang.cheng + * @Date 2023/9/26 5:52 PM + * @Description: + * @Version 1.0 + */ +public class OrgChartServiceImpl extends Service implements OrgChartService { + + + @Override + public ChartChildrensVO selectResourceChart() { + return null; + } +} diff --git a/src/com/engine/matfron/util/CommonAssert.java b/src/com/engine/sship/util/CommonAssert.java similarity index 98% rename from src/com/engine/matfron/util/CommonAssert.java rename to src/com/engine/sship/util/CommonAssert.java index e51cda1..85e1ff1 100644 --- a/src/com/engine/matfron/util/CommonAssert.java +++ b/src/com/engine/sship/util/CommonAssert.java @@ -1,6 +1,6 @@ -package com.engine.matfron.util; +package com.engine.sship.util; -import com.engine.matfron.exception.CustomizeRunTimeException; +import com.engine.sship.exception.CustomizeRunTimeException; import org.apache.commons.lang3.StringUtils; import org.springframework.util.CollectionUtils; import org.springframework.util.ObjectUtils; diff --git a/src/com/engine/matfron/util/ExceptionUtil.java b/src/com/engine/sship/util/ExceptionUtil.java similarity index 92% rename from src/com/engine/matfron/util/ExceptionUtil.java rename to src/com/engine/sship/util/ExceptionUtil.java index 3361513..2dc5f82 100644 --- a/src/com/engine/matfron/util/ExceptionUtil.java +++ b/src/com/engine/sship/util/ExceptionUtil.java @@ -1,4 +1,4 @@ -package com.engine.matfron.util; +package com.engine.sship.util; /** * @Author weaver_cl diff --git a/src/com/engine/matfron/util/ResponseResult.java b/src/com/engine/sship/util/ResponseResult.java similarity index 98% rename from src/com/engine/matfron/util/ResponseResult.java rename to src/com/engine/sship/util/ResponseResult.java index 470d1e3..bcc4277 100644 --- a/src/com/engine/matfron/util/ResponseResult.java +++ b/src/com/engine/sship/util/ResponseResult.java @@ -1,11 +1,11 @@ -package com.engine.matfron.util; +package com.engine.sship.util; import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.serializer.SerializerFeature; import com.engine.core.exception.ECException; -import com.engine.matfron.exception.CustomizeRunTimeException; +import com.engine.sship.exception.CustomizeRunTimeException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.extern.slf4j.Slf4j; diff --git a/src/com/engine/sship/web/OrgChartController.java b/src/com/engine/sship/web/OrgChartController.java new file mode 100644 index 0000000..b0261de --- /dev/null +++ b/src/com/engine/sship/web/OrgChartController.java @@ -0,0 +1,43 @@ +package com.engine.sship.web; + +import com.engine.common.util.ServiceUtil; +import com.engine.sship.entity.ChartChildrensVO; +import com.engine.sship.service.OrgChartService; +import com.engine.sship.service.impl.OrgChartServiceImpl; +import com.engine.sship.util.ResponseResult; +import weaver.hrm.HrmUserVarify; +import weaver.hrm.User; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +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; + + +/** + * @Author liang.cheng + * @Date 2023/9/26 5:51 PM + * @Description: 组织架构图 + * @Version 1.0 + */ +public class OrgChartController { + + private OrgChartService getOrgChartService(User user) { + return ServiceUtil.getService(OrgChartServiceImpl.class,user); + } + + + @GET + @Path("/resource") + @Produces(MediaType.APPLICATION_JSON) + public String selectResourceChart(@Context HttpServletRequest request, @Context HttpServletResponse response) { + User user = HrmUserVarify.getUser(request, response); + return new ResponseResult(user).run(getOrgChartService(user) :: selectResourceChart); + } + + + +} diff --git a/src/test/MainTest.java b/src/test/MainTest.java index 4366487..e0c1a4a 100644 --- a/src/test/MainTest.java +++ b/src/test/MainTest.java @@ -1,14 +1,7 @@ package test; -import com.engine.matfron.entity.SurnameParam; -import com.engine.matfron.util.CommonDateUtil; -import emo.doors.b; - -import java.time.LocalDate; -import java.time.YearMonth; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; + /** * @Author weaver_cl * @Description: