|
@ -209,6 +209,7 @@ public class BaseStatistsService {
|
|
|
map.put(firstColumnField, secondMap.get(firstColumnField));
|
|
|
for(int i = 0 ;i < moleDimensions.length ; i++){
|
|
|
map.put(moleDimensions[i], secondMap.get(moleDimensions[i]).toString());
|
|
|
map.put(moleDimensions[i] + "Code", secondMap.get(moleDimensions[i] + "Code").toString());
|
|
|
}
|
|
|
double point = 0;
|
|
|
double secondResultVal = Double.valueOf(secondMap.get("result") == null ? "0" : secondMap.get(resultField).toString());
|
|
@ -458,6 +459,21 @@ public class BaseStatistsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Double moleVal = caculateResult(moleList);
|
|
|
Double denoVal = caculateResult(denoList);
|
|
|
if (0 != denoVal) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
double result = 0;
|
|
|
if(operation == 1) {
|
|
|
result = (moleVal / denoVal) * operationValue;
|
|
|
} else if(operation == 2) {
|
|
|
result = (moleVal / denoVal) / operationValue;
|
|
|
}
|
|
|
map.put("result", basesicUtil.decimalPointHandle(result));
|
|
|
map.put("firstColumn", "合计");
|
|
|
map.put(dimension, "合计");
|
|
|
divisionResultList.add(map);
|
|
|
}
|
|
|
return divisionResultList;
|
|
|
}
|
|
|
|
|
@ -1495,6 +1511,16 @@ public class BaseStatistsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
Double moleVal = caculateResult(moleList);
|
|
|
Double denoVal = caculateResult(denoList);
|
|
|
if (0 != denoVal) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
double result = (moleVal - denoVal) / denoVal * operationValue;
|
|
|
map.put("result", basesicUtil.decimalPointHandle(result));
|
|
|
map.put("firstColumn", "合计");
|
|
|
map.put(dimension, "合计");
|
|
|
divisionResultList.add(map);
|
|
|
}
|
|
|
return divisionResultList;
|
|
|
}
|
|
|
|
|
@ -1905,4 +1931,16 @@ public class BaseStatistsService {
|
|
|
return filters;
|
|
|
}
|
|
|
|
|
|
public Double caculateResult(List<Map<String, Object>> listMap) {
|
|
|
Map<String, Double> map = new HashMap<>();
|
|
|
map.put("result", 0d);
|
|
|
listMap.forEach(item -> {
|
|
|
item.forEach((k,v) -> {
|
|
|
if ("result".equals(k)) {
|
|
|
map.put("result", map.get("result") + Double.parseDouble(v + ""));
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
return map.get("result");
|
|
|
}
|
|
|
}
|