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

模板修改

parent 5bb40bed
......@@ -8,6 +8,7 @@ import com.ask.mapper.AskHistoryCollectDataMapper;
import com.ask.mapper.AskReportDictMapper;
import com.ask.utils.ConvertUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.tool.annotation.Tool;
......@@ -145,6 +146,9 @@ public class ExcelTools {
case 3:
handleType3(askReportDict.getKey(), params, paramMap, result);
break;
case 4:
handleTypeSum(askReportDict.getKey(), params, paramMap, result);
break;
default:
// Handle other types if necessary
break;
......@@ -201,6 +205,27 @@ public class ExcelTools {
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) {
try {
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