diff --git a/interface/mingfeng/getPortalDepartment.jsp b/interface/mingfeng/getPortalDepartment.jsp index 62276c0..297db2e 100644 --- a/interface/mingfeng/getPortalDepartment.jsp +++ b/interface/mingfeng/getPortalDepartment.jsp @@ -55,7 +55,7 @@ } List deptList = new ArrayList<>(); - sql = " SELECT count(id) as num FROM hrmresource where status < 4 and departmentid in("+deptids+") "+where ; + sql = " SELECT count(id) as num FROM hrmresource where status in (0,1) and departmentid in("+deptids+") "+where ; rs.executeQuery(sql); if (rs.next()) { int num = Util.getIntValue(rs.getString("num")); diff --git a/interface/mingfeng/getPortalDepartment2.jsp b/interface/mingfeng/getPortalDepartment2.jsp index a20a86b..45f6da5 100644 --- a/interface/mingfeng/getPortalDepartment2.jsp +++ b/interface/mingfeng/getPortalDepartment2.jsp @@ -47,7 +47,7 @@ } out.println("deptids:"+deptids+"
"); List deptList = new ArrayList<>(); - sql = " SELECT count(id) as num FROM hrmresource where status < 4 and departmentid in("+deptids+") "+where ; + sql = " SELECT count(id) as num FROM hrmresource where status in (0,1) and departmentid in("+deptids+") "+where ; rs.executeQuery(sql); if (rs.next()) { int num = Util.getIntValue(rs.getString("num")); diff --git a/interface/mingfeng/getPortalLeaveMonth.jsp b/interface/mingfeng/getPortalLeaveMonth.jsp index 0f85f32..019d8e6 100644 --- a/interface/mingfeng/getPortalLeaveMonth.jsp +++ b/interface/mingfeng/getPortalLeaveMonth.jsp @@ -40,7 +40,7 @@ " 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 "+where+" and h.changedate >= ? and h.changedate <= ? group by s.departmentid ) a on t.id = a.departmentid " + + " left join (select s.departmentid,count(1) as sum from lizhi_view h left join hrmresource s on h.resourceid = s.id where 1 = 1 "+where+" and h.changedate >= ? and h.changedate <= ? group by s.departmentid ) a on t.id = a.departmentid " + " "); if(StringUtils.isNotEmpty(departmentIds)) { diff --git a/interface/mingfeng/getPortalLeaveYear.jsp b/interface/mingfeng/getPortalLeaveYear.jsp index 9cd5a43..ae38d8d 100644 --- a/interface/mingfeng/getPortalLeaveYear.jsp +++ b/interface/mingfeng/getPortalLeaveYear.jsp @@ -124,7 +124,7 @@ String sql =" select t.departmentname, t.id," + " case when a.sum IS NULL THEN 0 ELSE a.sum 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 "+ where +" and changedate >= ? and changedate <= ? group by s.departmentid ) a on t.id = a.departmentid " + + " left join (select s.departmentid,count(1) as sum from lizhi_view h left join hrmresource s on h.resourceid = s.id where 1 = 1 "+ where +" and changedate >= ? and changedate <= ? group by s.departmentid ) a on t.id = a.departmentid " + " where t.id = ? and (t.canceled = 0 or t.canceled is null)"; rs.executeQuery(sql,startMonth,endMonth,id); diff --git a/interface/mingfeng/getPortalSubCompany.jsp b/interface/mingfeng/getPortalSubCompany.jsp index cef0d5e..9607d53 100644 --- a/interface/mingfeng/getPortalSubCompany.jsp +++ b/interface/mingfeng/getPortalSubCompany.jsp @@ -28,6 +28,7 @@ public OptionVO getPortalSubCompany(String subcompanyid1) { RecordSet rs = new RecordSet(); LinkedList yData = new LinkedList<>(); + LinkedList monthData = new LinkedList<>(); String where = " and (belongto is null or belongto = -1 ) and subcompanyid1 = "+subcompanyid1; SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); String nowMonth = sdf.format(new Date()); @@ -44,6 +45,7 @@ Integer sum = Util.getIntValue(rs.getString("sum"),0); yData.add(sum); } + monthData.add(selectMonth); } }); @@ -58,6 +60,7 @@ .yMax(roundedMax) .yInterval(ceil) .yData(yData) + .xData(monthData) .legendDataFirst(null) .legendDataTwo(null) .barSeriesData(null) diff --git a/interface/mingfeng/getPortalUserGender.jsp b/interface/mingfeng/getPortalUserGender.jsp index f9ce2fd..8841afd 100644 --- a/interface/mingfeng/getPortalUserGender.jsp +++ b/interface/mingfeng/getPortalUserGender.jsp @@ -26,7 +26,7 @@ RecordSet rs = new RecordSet(); LinkedList barSeriesData = new LinkedList<>(); LinkedList barSeriesDataTwo = new LinkedList<>(); - List ageArr = Arrays.asList("20及以下","21~25","26~30","31~35","36~40","41~45","46~50","51~55","56及以上"); + List ageArr = Arrays.asList("0~20","21~25","26~30","31~35","36~40","41~45","46~50","51~55","56~100"); String where = " and (belongto is null or belongto = -1 ) and subcompanyid1 = "+subcompanyid1; List birthdayListMen = new ArrayList<>(); rs.executeQuery(" select birthday from hrmresource where status < 4 "+where+" and sex is not null and birthday is not null and birthday <> '' and sex = 0"); @@ -39,22 +39,11 @@ return Period.between(birthdate, now).getYears(); }).collect(Collectors.toList()); + for (int i = 0; i < ageArr.size(); i++) { - if(i==0){ - String split0 = "0"; - String split1 = "20"; - List collect = menAge.stream().filter(item -> item >= Integer.parseInt(split0) && item <= Integer.parseInt(split1)).collect(Collectors.toList()); - barSeriesData.add(collect.size()); - }else if(i==(ageArr.size()-1)){ - String split0 = "56"; - String split1 = "100"; - List collect = menAge.stream().filter(item -> item >= Integer.parseInt(split0) && item <= Integer.parseInt(split1)).collect(Collectors.toList()); - barSeriesData.add(collect.size()); - }else{ - 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()); - } + 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); diff --git a/interface/mingfeng/getPortalUserJobTypeNew.jsp b/interface/mingfeng/getPortalUserJobTypeNew.jsp new file mode 100644 index 0000000..36452ed --- /dev/null +++ b/interface/mingfeng/getPortalUserJobTypeNew.jsp @@ -0,0 +1,80 @@ +<%@ page import="weaver.general.*" %> +<%@page import="weaver.conn.RecordSet"%> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="java.util.*" %> +<%@ page import="com.engine.matfron.util.CommonUtils" %> +<%@ page import="com.engine.matfron.entity.OptionVO" %> +<%@ page import="java.time.YearMonth" %> +<%@ page import="com.engine.matfron.util.CommonDateUtil" %> +<%@ page import="java.time.LocalDate" %> +<%@ page import="java.text.SimpleDateFormat" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> + + +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + +<% + String subcompanyid1 = "62"; + JSONObject jsonObject = new JSONObject(); + OptionVO OptionVO = getJobType(subcompanyid1); + jsonObject.put("data",OptionVO); + +%> +<%=jsonObject.toString() %> + +<%! + + public OptionVO getJobType(String subcompanyid1) { + String where = " and 1=1"; + RecordSet rs = new RecordSet(); + LinkedList yData1 = new LinkedList<>(); + LinkedList yData2 = new LinkedList<>(); + LinkedList xData = new LinkedList<>(); + + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + String nowMonth = sdf.format(new Date()); + + List yearMonths = CommonDateUtil.getYearMonths(LocalDate.now()); + yearMonths.forEach(yearMonth -> { + String startMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateStartOfMonth(yearMonth)); + String endMonth = CommonDateUtil.getFormatYear(CommonDateUtil.toDateEndOfMonth(yearMonth)); + + String selectMonth = sdf.format(CommonDateUtil.toDateEndOfMonth(yearMonth)); + if(selectMonth.compareTo(nowMonth)<=0){ + rs.executeQuery("select count(f.id) as cnt from formtable_main_614 f,workflow_requestbase r where f.requestid= r.requestid and r.currentnodetype=3 " + + " and lastoperatedate >=? and lastoperatedate<=? and bdyy='0'" ,selectMonth+"-01",selectMonth+"-31"); + if (rs.next()) { + Integer sum = Util.getIntValue(rs.getString("cnt"),0); + yData1.add(sum); + } + rs.executeQuery("select count(f.id) as cnt from formtable_main_614 f,workflow_requestbase r where f.requestid= r.requestid and r.currentnodetype=3 " + + " and lastoperatedate >=? and lastoperatedate<=? and bdyy!='0'" ,selectMonth+"-01",selectMonth+"-31"); + if (rs.next()) { + Integer sum = Util.getIntValue(rs.getString("cnt"),0); + yData2.add(sum); + } + xData.add(selectMonth); + } + }); + + + int max = Collections.max(yData1); + 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(yData1) + .barSeriesDataTwo(yData2) + .build(); + } + +%> + + + diff --git a/sql/sql b/sql/sql new file mode 100644 index 0000000..811945e --- /dev/null +++ b/sql/sql @@ -0,0 +1,8 @@ +create view lizhi_view as +select distinct * from ( +select resourceid ,changedate from hrmstatushistory where type_n=5 +union +select lzyg as resourceid , zhgzr as changedate from formtable_main_616 f,workflow_requestbase r where f.requestid= r.requestid and r.currentnodetype=3 +) b + +