|
@@ -24,7 +24,6 @@ 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;
|
|
|
|
|
|
@Repository("taskAnalysisDao")
|
|
@@ -1956,8 +1955,13 @@ hql.append("AND EXISTS (\n" +
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> findEvaluateAnalysis(Map<String, Object> param) {
|
|
|
+ //类型设置筛选
|
|
|
+ Long matterTypeSetting = ParameterUtil.getLong(param, "matterTypeSetting");
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
sql.append(" select t.pname, t.dname, t.score1, t.score2, t.score1+t.score2 as \"score\", ");
|
|
|
+ if(matterTypeSetting!=null){
|
|
|
+ sql.append(" t.score3, t.score4, ");
|
|
|
+ }
|
|
|
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), ");
|
|
@@ -1968,6 +1972,10 @@ hql.append("AND EXISTS (\n" +
|
|
|
sql.append(" max(person.pname) as \"pname\", ");
|
|
|
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\" ");
|
|
|
+ if(matterTypeSetting != null){
|
|
|
+ sql.append(", ROUND(ifnull(sum(case when typeScore.base_score is null then 0 else typeScore.base_score end),0),1) as \"score3\", ");
|
|
|
+ sql.append(" ROUND(ifnull(sum(case when typeScore.eval_score is null then 0 else typeScore.eval_score end),0),1) as \"score4\" ");
|
|
|
+ }
|
|
|
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 ");
|
|
@@ -1976,6 +1984,7 @@ hql.append("AND EXISTS (\n" +
|
|
|
sql.append(" left join org_post post on post.id = person.org_post_id ");
|
|
|
sql.append(" left join org_unit unit on unit.id = person.org_department_id ");
|
|
|
sql.append(" left join task_comment tc on (tc.taskid = tm.task_id and tc.dwid = tm.resource_id) ");
|
|
|
+ sql.append(" left join type_setting_score typeScore on typeScore.enum_id = extend.type_setting ");
|
|
|
sql.append(" left join ( ");
|
|
|
sql.append(" select ROUND(max(cast(extend.field_51 as float))/count(tm.id),1) as \"jcgScore\", tm.task_id ");
|
|
|
sql.append(" from task_member tm ");
|
|
@@ -2012,7 +2021,9 @@ hql.append("AND EXISTS (\n" +
|
|
|
sql.append(" and tm.resource_id = ( :userId) ");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ if(matterTypeSetting != null){
|
|
|
+ sql.append(" and typeScore.enum_id = :matterTypeSetting ");
|
|
|
+ }
|
|
|
sql.append(" group by tm.resource_id ");
|
|
|
sql.append(" ) t ");
|
|
|
sql.append(" order by \"score\" desc ");
|