|
@@ -6,6 +6,7 @@
|
|
|
package com.minto.app.task.manager;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -42,6 +43,8 @@ import com.minto.tap.task.api.TaskApi;
|
|
|
import com.minto.tip.common.authenticate.bo.User;
|
|
|
import com.minto.tip.common.exceptions.BusinessException;
|
|
|
import com.minto.tip.organization.enums.RelationValueName;
|
|
|
+import freemarker.core.ArithmeticEngine;
|
|
|
+import org.apache.commons.math3.dfp.DfpField;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
@@ -1595,33 +1598,22 @@ public class TaskAnalysisManagerImpl implements ITaskAnalysisManager{
|
|
|
|
|
|
@Override
|
|
|
public List<Map<String, Object>> findTypeScopeTaskCountAnalysis(Map<String, Object> param) throws BusinessException{
|
|
|
- List<Map<String, Object>> list = taskAnalysisDao.findTypeScopeCount(param);
|
|
|
-
|
|
|
- if(!list.isEmpty()){
|
|
|
- Map<String, Map<Long, BigDecimal>> reachAndCaseProportionMap =
|
|
|
- taskTypeSettingManager.findReachPerGroupByTypeId(
|
|
|
- param);
|
|
|
- Map<Long, BigDecimal> reachMap = reachAndCaseProportionMap.get("reachMap");
|
|
|
- Map<Long, BigDecimal> caseProportionMap = reachAndCaseProportionMap.get("caseProportionMap");
|
|
|
- list.stream().forEach(e -> {
|
|
|
- long id = Long.parseLong(e.get("id").toString());
|
|
|
- if(null != reachMap && reachMap.containsKey(id)){
|
|
|
- e.put("reachPer", reachMap.get(id) + "%");
|
|
|
- }
|
|
|
- if(null != caseProportionMap && caseProportionMap.containsKey(id)){
|
|
|
- e.put("caseProportion", "1:" + caseProportionMap.get(id));
|
|
|
+ //办件量是c,现在不显示办件量,所以先注释掉
|
|
|
+ //List<Map<String, Object>> list = taskAnalysisDao.findTypeScopeCount(param);
|
|
|
+ List<Map<String, Object>> list = taskAnalysisDao.findTaskTypeSettingDataAnalysis(param);
|
|
|
+ list.forEach(e -> {
|
|
|
+ BigDecimal c1 = new BigDecimal(e.get("c1").toString());
|
|
|
+ BigDecimal c2 = new BigDecimal(e.get("c2").toString());
|
|
|
+ String value = "";
|
|
|
+ if(c2.compareTo(BigDecimal.ZERO) != 0){
|
|
|
+ if(e.get("type") == null || "1".equals(e.get("type").toString())){
|
|
|
+ value = c1.divide(c2, 2, RoundingMode.HALF_UP).toPlainString() + "%";
|
|
|
+ } else{
|
|
|
+ value = "1:" + c1.divide(c2, 1, RoundingMode.HALF_DOWN).toPlainString();
|
|
|
}
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- Map<String, Object> caseProportionMap = taskTypeSettingManager.calculateCaseProportion(param);
|
|
|
- String allNum = caseProportionMap.get("allNum").toString();
|
|
|
- caseProportionMap.put("c", allNum);
|
|
|
- if(!"0".equals(allNum)){
|
|
|
- caseProportionMap.put("caseProportion", "1:" + caseProportionMap.get("caseProportion"));
|
|
|
- }
|
|
|
- list.add(caseProportionMap);
|
|
|
-
|
|
|
+ }
|
|
|
+ e.put("value", value);
|
|
|
+ });
|
|
|
return list;
|
|
|
}
|
|
|
|