|
@@ -5,6 +5,9 @@
|
|
|
|
|
|
package com.minto.app.task.dao;
|
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
+
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.minto.app.organization.OrgEnum;
|
|
|
import com.minto.app.organization.beans.OrgRelationBean;
|
|
@@ -21,11 +24,9 @@ import com.minto.core.util.StringUtil;
|
|
|
import com.minto.tap.performmance.dto.TaskScoreParam;
|
|
|
import com.minto.tip.common.exceptions.BusinessException;
|
|
|
import com.minto.tip.common.util.PageInfo;
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
-import java.util.*;
|
|
|
-
|
|
|
@Repository("taskAnalysisDao")
|
|
|
public class TaskAnalysisDaoImpl extends BaseDaoImpl implements ITaskAnalysisDao{
|
|
|
|
|
@@ -1956,12 +1957,17 @@ hql.append("AND EXISTS (\n" +
|
|
|
@Override
|
|
|
public List<Map<String, Object>> findEvaluateAnalysis(Map<String, Object> param) {
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
- sql.append(" select t.pname, t.dname, t.score1, t.score2, t.score1+t.score2 as \"score\" ");
|
|
|
+ sql.append(" select t.pname, t.dname, t.score1, t.score2, t.score1+t.score2 as \"score\", ");
|
|
|
+ sql.append(" CONCAT((case when TRUNC(t.avgtime / 86400000)> 0 then CONCAT(TO_CHAR(TRUNC(t.avgtime / 86400000)),'天') else '' end), ");
|
|
|
+ sql.append(" (case when TRUNC(MOD(t.avgtime / 3600000, 24))> 0 then CONCAT(TO_CHAR(TRUNC(MOD(t.avgtime / 3600000, 24))),'小时') else '' end), ");
|
|
|
+ sql.append(" (case when TRUNC(MOD(t.avgtime / 60000, 60))> 0 then CONCAT(TO_CHAR(TRUNC(MOD(t.avgtime / 60000, 60))),'分钟') else '' end), ");
|
|
|
+ sql.append(" (case when TRUNC(MOD(t.avgtime / 1000, 60))> 0 then CONCAT(TO_CHAR(TRUNC(MOD(t.avgtime / 1000, 60))),'秒') else '' end)) as \"avgtime\" ");
|
|
|
sql.append(" from ( ");
|
|
|
sql.append(" select ROUND( ifnull(sum(case when post.pcode = 'jcg' and ( tt.name = '普通案件' or tt.name = '重点案件' ) then a.jcgScore else cast(extend.field_51 as float) end),0),1) as \"score1\", ");
|
|
|
sql.append(" ifnull(sum(tc.dtc_level),0) \"score2\", ");
|
|
|
sql.append(" max(person.pname) as \"pname\", ");
|
|
|
- sql.append(" max(unit.dname) as \"dname\" ");
|
|
|
+ sql.append(" max(unit.dname) as \"dname\", ");
|
|
|
+ sql.append(" avg(DATEDIFF(ms,IFNULL(ts.draft_date,ts.create_date),IFNULL(tm.complete_date,ts.create_date))) as \"avgtime\" ");
|
|
|
sql.append(" from task_member tm ");
|
|
|
sql.append(" inner join task_summary ts on tm.task_id = ts.id ");
|
|
|
sql.append(" left join dm_dtab_basic_extend extend on extend.reference_id = ts.id ");
|
|
@@ -1990,6 +1996,12 @@ hql.append("AND EXISTS (\n" +
|
|
|
sql.append(" and to_char(ts.create_date,'yyyy') = :year ");
|
|
|
sql.append(" and person.pstate =0 ");
|
|
|
|
|
|
+ //类型筛选
|
|
|
+ String gbTaskTypeId = ParameterUtil.getString(param, "gbTaskTypeId");
|
|
|
+ if(StringUtils.isNotBlank(gbTaskTypeId)){
|
|
|
+ sql.append(" and ts.tasktype_id = :taskTypeId");
|
|
|
+ }
|
|
|
+
|
|
|
//督办管理员看全部,部门主管看本部门所有人员,普通用户只看自己的数据
|
|
|
boolean isTaskAdmin = ParameterUtil.getBoolean(param, "isTaskAdmin",false);
|
|
|
if (!isTaskAdmin){
|
|
@@ -2008,4 +2020,13 @@ hql.append("AND EXISTS (\n" +
|
|
|
List<Map<String, Object>> result = getHibernateTpl().queryBySql(sql.toString(), param);
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Map<String, Object>> findTaskTypes(Long orgAccountId){
|
|
|
+ String sql = "select id,name,parent_id,sort_no from task_type where status = 1 and sub_type = 1 AND "
|
|
|
+ + "org_account_id = :orgAccountId and creator_id <> -1 order by sort_no asc;";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("orgAccountId", orgAccountId);
|
|
|
+ return getHibernateTpl().queryBySql(sql, param);
|
|
|
+ }
|
|
|
}
|