|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.weaver.seconddev.jcldoor.cmd;
|
|
|
|
|
|
|
|
|
|
import com.weaver.ebuilder.datasource.api.entity.SqlParamEntity;
|
|
|
|
|
import com.weaver.seconddev.jcldoor.util.DatabaseUtils;
|
|
|
|
|
import com.weaver.teams.domain.user.SimpleEmployee;
|
|
|
|
|
import com.weaver.teams.security.context.UserContext;
|
|
|
|
@ -80,17 +81,25 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
String sql =" select left(k.real_period,10) as real_period,left(k.real_period,7) as period_month,k.kpi_scheme,k.score\n" +
|
|
|
|
|
" from (select real_period,kpi_scheme,score\n" +
|
|
|
|
|
" from hr_kpi_flow \n" +
|
|
|
|
|
" where kpi_user='"+employeeId+"' \n" +
|
|
|
|
|
" where kpi_user=? \n" +
|
|
|
|
|
" and module = 'kpiFlow' \n" +
|
|
|
|
|
" and date_type = 'month' \n" +
|
|
|
|
|
" and delete_type = '0' " +
|
|
|
|
|
" and tenant_key='"+tenant_key+"'\n" +
|
|
|
|
|
" and tenant_key=?\n" +
|
|
|
|
|
" and FLOW_STATUS in('noApprove','approve','finished')\n" +
|
|
|
|
|
" order by real_period desc\n" +
|
|
|
|
|
") k limit 1 ";
|
|
|
|
|
|
|
|
|
|
log.error("sql20-1:"+sql);
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(employeeId);
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if(CollectionUtils.isNotEmpty(recordList)){
|
|
|
|
|
Map<String,Object> recordMap = recordList.get(0);
|
|
|
|
@ -116,14 +125,22 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
if(StringUtils.isNotBlank(kpi_scheme)){
|
|
|
|
|
String sql =" select indicator_type,indicator_description,weight \n" +
|
|
|
|
|
" from hr_kpi_scheme_indicator " +
|
|
|
|
|
" where scheme_id='"+kpi_scheme+"' " +
|
|
|
|
|
" where scheme_id=? " +
|
|
|
|
|
" and indicator_mode='quantify'\n" +
|
|
|
|
|
" and status='on' " +
|
|
|
|
|
" and delete_type = '0'" +
|
|
|
|
|
" and tenant_key = '"+tenant_key+"'" ;
|
|
|
|
|
" and tenant_key = ?" ;
|
|
|
|
|
|
|
|
|
|
log.error("sql2:"+sql);
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(kpi_scheme);
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
|
|
|
|
|
log.error("recordList:"+recordList.size());
|
|
|
|
@ -141,13 +158,13 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
" where kpi_details in( " +
|
|
|
|
|
" select id\n" +
|
|
|
|
|
" from hr_kpi_details " +
|
|
|
|
|
" where KPI_SCHEME='"+kpi_scheme+"'\n" +
|
|
|
|
|
" where KPI_SCHEME=?\n" +
|
|
|
|
|
" and MODULE='kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY='"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY=?\n" +
|
|
|
|
|
" and DELETE_TYPE = 0" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and module = 'kpiSchemeSetting'\n" +
|
|
|
|
|
" and tenant_key = '"+tenant_key+"'\n" +
|
|
|
|
|
" and tenant_key = ?\n" +
|
|
|
|
|
" and delete_type = '0'\n" +
|
|
|
|
|
" and property in('weight', 'describe', 'type')\n" +
|
|
|
|
|
" and data_row in ( \n" +
|
|
|
|
@ -158,21 +175,34 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
" where kpi_details in ( " +
|
|
|
|
|
" select id\n" +
|
|
|
|
|
" from hr_kpi_details " +
|
|
|
|
|
" where KPI_SCHEME='"+kpi_scheme+"'\n" +
|
|
|
|
|
" where KPI_SCHEME=?\n" +
|
|
|
|
|
" and MODULE='kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY='"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY=?\n" +
|
|
|
|
|
" and DELETE_TYPE = 0" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and PROPERTY = 'weight'\n" +
|
|
|
|
|
" and MODULE = 'kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY = '"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY = ?\n" +
|
|
|
|
|
" and DELETE_TYPE = '0'\n" +
|
|
|
|
|
" order by name desc\n" +
|
|
|
|
|
" ) w limit 1 \n" +
|
|
|
|
|
" ) p\n" +
|
|
|
|
|
" )";
|
|
|
|
|
log.error("sql3:"+sql);
|
|
|
|
|
Map<String, Object> result2 = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
|
|
|
|
|
List<String> strlist2 = new ArrayList<>(100);
|
|
|
|
|
strlist2.add(kpi_scheme);
|
|
|
|
|
strlist2.add(tenant_key);
|
|
|
|
|
strlist2.add(tenant_key);
|
|
|
|
|
strlist2.add(kpi_scheme);
|
|
|
|
|
strlist2.add(tenant_key);
|
|
|
|
|
strlist2.add(tenant_key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam2 = databaseUtils.getSqlParamEntity(strlist2);
|
|
|
|
|
Map<String, Object> result2 = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam2);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList2 = databaseUtils.getDataSourceList(result2);
|
|
|
|
|
log.error("recordList2:"+recordList2.size());
|
|
|
|
|
for(int i=0;i<recordList2.size();i++){
|
|
|
|
@ -206,19 +236,28 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
" where kpi_details in( " +
|
|
|
|
|
" select id\n" +
|
|
|
|
|
" from hr_kpi_details " +
|
|
|
|
|
" where KPI_SCHEME='"+kpi_scheme+"'\n" +
|
|
|
|
|
" where KPI_SCHEME=?\n" +
|
|
|
|
|
" and MODULE='kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY='"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY=?\n" +
|
|
|
|
|
" and DELETE_TYPE = 0" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and PROPERTY = 'weight'\n" +
|
|
|
|
|
" and MODULE = 'kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY = '"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY = ?\n" +
|
|
|
|
|
" and DELETE_TYPE = '0'\n" +
|
|
|
|
|
" order by name desc\n" +
|
|
|
|
|
") w limit 2" ;
|
|
|
|
|
log.error("sql4:"+sql);
|
|
|
|
|
Map<String, Object> result3 = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
|
|
|
|
|
List<String> strlist3 = new ArrayList<>(100);
|
|
|
|
|
strlist3.add(kpi_scheme);
|
|
|
|
|
strlist3.add(tenant_key);
|
|
|
|
|
strlist3.add(tenant_key);
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam3 = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
Map<String, Object> result3 = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam3);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList3 = databaseUtils.getDataSourceList(result3);
|
|
|
|
|
for(int k=0;k<recordList3.size();k++){
|
|
|
|
|
Map<String,Object> recordMap3 = recordList3.get(k);
|
|
|
|
@ -232,20 +271,29 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
" where kpi_details in( " +
|
|
|
|
|
" select id\n" +
|
|
|
|
|
" from hr_kpi_details " +
|
|
|
|
|
" where KPI_SCHEME='"+kpi_scheme+"'\n" +
|
|
|
|
|
" where KPI_SCHEME=?\n" +
|
|
|
|
|
" and MODULE='kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY='"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY=?\n" +
|
|
|
|
|
" and DELETE_TYPE = 0" +
|
|
|
|
|
" )\n" +
|
|
|
|
|
" and MODULE = 'kpiSchemeSetting'\n" +
|
|
|
|
|
" and TENANT_KEY = '"+tenant_key+"'\n" +
|
|
|
|
|
" and TENANT_KEY = ?\n" +
|
|
|
|
|
" and DELETE_TYPE = '0'\n" +
|
|
|
|
|
" and property in('weight', 'describe', 'type')\n" +
|
|
|
|
|
" and data_row in("+data_row+")" ;
|
|
|
|
|
" and data_row in(?)" ;
|
|
|
|
|
|
|
|
|
|
log.error("sql5:"+sql);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result2 = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
List<String> strlist2 = new ArrayList<>(100);
|
|
|
|
|
strlist2.add(kpi_scheme);
|
|
|
|
|
strlist2.add(tenant_key);
|
|
|
|
|
strlist2.add(tenant_key);
|
|
|
|
|
strlist2.add(data_row);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam2 = databaseUtils.getSqlParamEntity(strlist2);
|
|
|
|
|
Map<String, Object> result2 = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam2);
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList2 = databaseUtils.getDataSourceList(result2);
|
|
|
|
|
|
|
|
|
|
for(int i=0;i<recordList2.size();i++){
|
|
|
|
@ -299,20 +347,30 @@ public class PortalPerformanceInfoCmd {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String sql =" select score from hr_kpi_flow " +
|
|
|
|
|
" where kpi_user='"+employeeId+"' " +
|
|
|
|
|
" and left(real_period,10) >= '" +startDay+"'" +
|
|
|
|
|
" and left(real_period,10) <='" + endDay +"'" +
|
|
|
|
|
" where kpi_user=? " +
|
|
|
|
|
" and left(real_period,10) >= ?" +
|
|
|
|
|
" and left(real_period,10) <=?" +
|
|
|
|
|
" and module = 'kpiFlow'" +
|
|
|
|
|
" and date_type = 'month'" +
|
|
|
|
|
" and flow_status in('noApprove','approve','finished') \n" +
|
|
|
|
|
" and delete_type = '0'" +
|
|
|
|
|
" and tenant_key='"+tenant_key+"' " ;
|
|
|
|
|
" and tenant_key=? " ;
|
|
|
|
|
|
|
|
|
|
log.error("getWholeYearKpi2-sql:"+sql);
|
|
|
|
|
|
|
|
|
|
dataMap = new HashMap<String,String>();
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = databaseUtils.execute(sourceType, groupId, sql);
|
|
|
|
|
List<String> strlist = new ArrayList<>(100);
|
|
|
|
|
strlist.add(employeeId);
|
|
|
|
|
strlist.add(startDay+"");
|
|
|
|
|
strlist.add(endDay+"");
|
|
|
|
|
strlist.add(tenant_key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<SqlParamEntity> sqlparam = databaseUtils.getSqlParamEntity(strlist);
|
|
|
|
|
Map<String, Object> result = databaseUtils.executeForQuery(sourceType, groupId, sql,sqlparam);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Map<String,Object>> recordList = databaseUtils.getDataSourceList(result);
|
|
|
|
|
if(CollectionUtils.isNotEmpty(recordList)){
|
|
|
|
|
Map<String,Object> recordMap = recordList.get(0);
|
|
|
|
|