forked from chenwei/weaver-matfron
2-23周香香调整需求
parent
a43575e4ec
commit
3d8284171e
@ -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…
Reference in New Issue