Merge remote-tracking branch 'origin/master'

This commit is contained in:
zjh 2025-12-14 16:10:06 +08:00
commit 359f9e9999
3 changed files with 45 additions and 23 deletions

View File

@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
@RestController @RestController
@RequestMapping("/custom/analysis") @RequestMapping("/custom/analysis")
@ -31,4 +32,11 @@ public class AnalysisCommonController {
return Response.ok().data(lists); return Response.ok().data(lists);
} }
// //模糊查询下拉列表
// @GetMapping("/analysisShowList")
// public Response analysisShowList(@RequestParam("attribute") String attribute) {
// List<String> lists = analysisCommonParametersService.analysisShowList(attribute);
// return Response.ok().data(lists);
// }
} }

View File

@ -3,16 +3,7 @@ package com.xdap.self_development.controller.request;
import lombok.Data; import lombok.Data;
import java.util.List;
/**
* <p>
* 待办事项表
* </p>
*
* @author Lys111
* @since 2025-11-18
*/
@Data @Data
public class ReportRequest { public class ReportRequest {
@ -25,7 +16,7 @@ public class ReportRequest {
private String projectNumber; private String projectNumber;
private String emission; private String emission;
private String burnType; private String burnType;
private String engineCapacityMin; private Double engineCapacityMin;
private String engineCapacityMax; private Double engineCapacityMax;
} }

View File

@ -1,9 +1,8 @@
package com.xdap.self_development.service.impl; package com.xdap.self_development.service.impl;
import com.definesys.mpaas.query.db.PageQueryResult; import java.util.regex.Matcher;
import com.xdap.api.moudle.department.pojo.entity.XdapDepartments; import java.util.regex.Pattern;
import com.xdap.api.moudle.user.pojo.XdapUsers;
import com.xdap.self_development.config.BusinessDatabase; import com.xdap.self_development.config.BusinessDatabase;
import com.xdap.self_development.controller.request.*; import com.xdap.self_development.controller.request.*;
import com.xdap.self_development.enums.ParamPermissionEnum; import com.xdap.self_development.enums.ParamPermissionEnum;
@ -88,15 +87,39 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
.like("burn_type", request.getBurnType()) .like("burn_type", request.getBurnType())
.doQuery(DataEntryEngineModelPojo.class); .doQuery(DataEntryEngineModelPojo.class);
String engineCapacityMin = request.getEngineCapacityMin(); Double engineCapacityMin = request.getEngineCapacityMin();
String engineCapacityMax = request.getEngineCapacityMax(); Double engineCapacityMax = request.getEngineCapacityMax();
// queryResult.stream().filter(new Predicate<DataEntryEngineModelPojo>() { List<DataEntryEngineModelPojo> engineModelPojos = queryResult.stream().filter(dataEntryEngineModelPojo -> {
// @Override String engineCapacity = dataEntryEngineModelPojo.getEngineCapacity();
// public boolean test(DataEntryEngineModelPojo dataEntryEngineModelPojo) { Double ec = extractDisplacement(engineCapacity);
// dataEntryEngineModelPojo.get return (Double.compare(ec, engineCapacityMin) >= 0 && Double.compare(ec, engineCapacityMax) < 0);
// return false; }).collect(Collectors.toList());
// }
// }) ArrayList<AnalysisModelParamterView> analysisModelParamterViews = new ArrayList<>();
for (DataEntryEngineModelPojo engineModelPojo : engineModelPojos) {
AnalysisModelParamterView analysisModelParamterView = new AnalysisModelParamterView();
List<EngineParamDetailPojo> pojoList = engineParamDetailService.selectByModelNewVersion(engineModelPojo.getId());
analysisModelParamterView.setModelID(engineModelPojo.getId());
analysisModelParamterView.setModelName(engineModelPojo.getModelName());
analysisModelParamterView.setPojos(pojoList);
analysisModelParamterViews.add(analysisModelParamterView);
}
return analysisModelParamterViews;
}
public static Double extractDisplacement(String displacementStr) {
if (displacementStr == null || displacementStr.isEmpty()) {
return null; return null;
} }
// 正则匹配数字包含小数
Pattern pattern = java.util.regex.Pattern.compile("(\\d+\\.?\\d*)");
Matcher matcher = pattern.matcher(displacementStr);
if (matcher.find()) {
return Double.parseDouble(matcher.group(1));
}
return null;
}
} }