Commit a5f5931e authored by 林洋洋's avatar 林洋洋

模板修改

parent 5bb40bed
...@@ -8,6 +8,7 @@ import com.ask.mapper.AskHistoryCollectDataMapper; ...@@ -8,6 +8,7 @@ import com.ask.mapper.AskHistoryCollectDataMapper;
import com.ask.mapper.AskReportDictMapper; import com.ask.mapper.AskReportDictMapper;
import com.ask.utils.ConvertUtils; import com.ask.utils.ConvertUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool; import org.springframework.ai.tool.annotation.Tool;
...@@ -145,6 +146,9 @@ public class ExcelTools { ...@@ -145,6 +146,9 @@ public class ExcelTools {
case 3: case 3:
handleType3(askReportDict.getKey(), params, paramMap, result); handleType3(askReportDict.getKey(), params, paramMap, result);
break; break;
case 4:
handleTypeSum(askReportDict.getKey(), params, paramMap, result);
break;
default: default:
// Handle other types if necessary // Handle other types if necessary
break; break;
...@@ -201,6 +205,27 @@ public class ExcelTools { ...@@ -201,6 +205,27 @@ public class ExcelTools {
paramMap.put(key, percentageResult); paramMap.put(key, percentageResult);
} }
private void handleTypeSum(String key, List<AskReportDict.Params> params, Map<String, Object> paramMap, Map<String, Double> result) {
AskReportDict.Params param = params.get(0);
if (param == null) {
return;
}
String keyC = params.get(0).getParam();
if (StringUtils.isEmpty(keyC)) {
return;
}
AtomicReference<Double> realValue = new AtomicReference<>(0.0);
result.forEach((mapKey, value) -> {
if (mapKey.contains(keyC)) {
realValue.set(realValue.get() + value);
}
});
if (realValue.get() != 0.0) {
paramMap.put(key, realValue.get());
}
}
private Double getParamValue(AskReportDict.Params param, LocalDateTime startTime, LocalDateTime endTime) { private Double getParamValue(AskReportDict.Params param, LocalDateTime startTime, LocalDateTime endTime) {
try { try {
if (param.getType() == 1) { if (param.getType() == 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment