1
0
Fork 0

2-23周香香调整需求

dev
xh 1 year ago
parent a43575e4ec
commit 3d8284171e

@ -55,7 +55,7 @@
}
List<DepartmentParam> 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"));

@ -47,7 +47,7 @@
}
out.println("deptids:"+deptids+"</br>");
List<DepartmentParam> 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"));

@ -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)) {

@ -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);

@ -28,6 +28,7 @@
public OptionVO getPortalSubCompany(String subcompanyid1) {
RecordSet rs = new RecordSet();
LinkedList<Integer> yData = new LinkedList<>();
LinkedList<String> 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)

@ -26,7 +26,7 @@
RecordSet rs = new RecordSet();
LinkedList<Integer> barSeriesData = new LinkedList<>();
LinkedList<Integer> barSeriesDataTwo = new LinkedList<>();
List<String> ageArr = Arrays.asList("20及以下","21~25","26~30","31~35","36~40","41~45","46~50","51~55","56及以上");
List<String> 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<String> 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<Integer> 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<Integer> 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<Integer> 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<Integer> 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);

@ -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" %>
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="bb" class="weaver.general.BaseBean" scope="page" />
<%@ 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<Integer> yData1 = new LinkedList<>();
LinkedList<Integer> yData2 = new LinkedList<>();
LinkedList<String> xData = new LinkedList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
String nowMonth = sdf.format(new Date());
List<YearMonth> 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();
}
%>

@ -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
Loading…
Cancel
Save