TC查询分析图表优化
This commit is contained in:
parent
ee9c482b11
commit
04a189b08f
@ -19,5 +19,6 @@ public interface AnalysisCommonParametersService {
|
|||||||
ArrayList<AnalysisModelParamterView> selectModelParamByCommon(AnalysisRequest analysisRequest);
|
ArrayList<AnalysisModelParamterView> selectModelParamByCommon(AnalysisRequest analysisRequest);
|
||||||
|
|
||||||
AnalysisModelParamterViewAndParam showReport(ReportRequest analysisRequest);
|
AnalysisModelParamterViewAndParam showReport(ReportRequest analysisRequest);
|
||||||
|
AnalysisModelParamterViewAndParam showReportParamList(ReportRequest analysisRequest);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,6 +81,22 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
@Override
|
@Override
|
||||||
public AnalysisModelParamterViewAndParam showReport(ReportRequest request) {
|
public AnalysisModelParamterViewAndParam showReport(ReportRequest request) {
|
||||||
|
|
||||||
|
return showReport1(request);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//返回参数列表
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnalysisModelParamterViewAndParam showReportParamList(ReportRequest request) {
|
||||||
|
|
||||||
|
// return showReport1(request);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AnalysisModelParamterViewAndParam showReport1(ReportRequest request) {
|
||||||
|
long startTime = System.currentTimeMillis();
|
||||||
List<DataEntryEngineModelPojo> queryResult = businessDatabase.getBusinessDatabase()
|
List<DataEntryEngineModelPojo> queryResult = businessDatabase.getBusinessDatabase()
|
||||||
// .eq("yc_or_oth", request.getYcOrOth())
|
// .eq("yc_or_oth", request.getYcOrOth())
|
||||||
.like("model_name", request.getModelName())
|
.like("model_name", request.getModelName())
|
||||||
@ -115,7 +131,7 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
for (DataEntryEngineModelPojo engineModelPojo : engineModelPojos) {
|
for (DataEntryEngineModelPojo engineModelPojo : engineModelPojos) {
|
||||||
AnalysisModelParamterView analysisModelParamterView = new AnalysisModelParamterView();
|
AnalysisModelParamterView analysisModelParamterView = new AnalysisModelParamterView();
|
||||||
List<EngineParamDetailPojo> pojoList = engineParamDetailService.selectByModelNewVersion(engineModelPojo.getId());
|
List<EngineParamDetailPojo> pojoList = engineParamDetailService.selectByModelNewVersion(engineModelPojo.getId());
|
||||||
// 编号&&零部件名称-参数
|
//
|
||||||
ArrayList<EngineParamDetailPojo> engineParamDetailPojos = tcDataQueryService.tcDataSelectAllByproductNumber(engineModelPojo);
|
ArrayList<EngineParamDetailPojo> engineParamDetailPojos = tcDataQueryService.tcDataSelectAllByproductNumber(engineModelPojo);
|
||||||
if (ObjectUtils.isNotEmpty(engineParamDetailPojos)) {
|
if (ObjectUtils.isNotEmpty(engineParamDetailPojos)) {
|
||||||
pojoList.addAll(engineParamDetailPojos);
|
pojoList.addAll(engineParamDetailPojos);
|
||||||
@ -134,6 +150,8 @@ public class AnalysisCommonParametersServiceImpl implements AnalysisCommonParame
|
|||||||
List<String> strings = list.stream().distinct().collect(Collectors.toList());
|
List<String> strings = list.stream().distinct().collect(Collectors.toList());
|
||||||
andParam.setParamList(strings);
|
andParam.setParamList(strings);
|
||||||
andParam.setPojos(analysisModelParamterViews);
|
andParam.setPojos(analysisModelParamterViews);
|
||||||
|
long endTime = System.currentTimeMillis();
|
||||||
|
// throw new RuntimeException(String.valueOf(endTime-startTime));
|
||||||
return andParam;
|
return andParam;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.xdap.self_development.service.EngineParamDetailService;
|
|||||||
import com.xdap.self_development.service.TcDataQueryService;
|
import com.xdap.self_development.service.TcDataQueryService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@ -54,7 +55,7 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//通过状态代号(产品编号) 返回编号&&零部件名称-参数
|
//通过状态代号(产品编号)
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<EngineParamDetailPojo> tcDataSelectAllByproductNumber(DataEntryEngineModelPojo engineModelPojo) {
|
public ArrayList<EngineParamDetailPojo> tcDataSelectAllByproductNumber(DataEntryEngineModelPojo engineModelPojo) {
|
||||||
String productNumber = engineModelPojo.getProductNumber();
|
String productNumber = engineModelPojo.getProductNumber();
|
||||||
@ -62,27 +63,53 @@ public class TcDataQueryServiceImpl implements TcDataQueryService {
|
|||||||
if (ObjectUtils.isEmpty(productNumber)) {
|
if (ObjectUtils.isEmpty(productNumber)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
ArrayList<EngineParamDetailPojo> engineParamDetailPojos = new ArrayList<>();
|
||||||
|
//查找参数模板TC参数数据
|
||||||
|
List<Parameter> parameters = engineParamDetailService.selectAllAndTcByNewVersion();
|
||||||
|
List<Parameter> collect = parameters.stream().filter(x -> "TC分类表".equals(x.getParameterSource())).collect(Collectors.toList());
|
||||||
|
if (ObjectUtils.isEmpty(collect)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
//通过零部件集合+状态机 查找图号
|
||||||
|
String id = engineModelPojo.getId();
|
||||||
|
|
||||||
|
Map<String, List<Parameter>> stringListMap = collect.stream().collect(Collectors.groupingBy(Parameter::getPartsName));
|
||||||
|
Set<String> partsNames = stringListMap.keySet();
|
||||||
|
for (String partsName : partsNames) {
|
||||||
|
//获取系统内零部件下的参数
|
||||||
|
List<String> parametersOnPartsName = stringListMap.get(partsName).stream().map(x->x.getParameterName()).collect(Collectors.toList());
|
||||||
|
|
||||||
List<EnginePartsCollection> partsCollections = bd.getTCDatabase()
|
List<EnginePartsCollection> partsCollections = bd.getTCDatabase()
|
||||||
.eq("ztj", productNumber)
|
.eq("ztj", productNumber)
|
||||||
|
.eq("lbjmc", partsName)
|
||||||
.doQuery(EnginePartsCollection.class);
|
.doQuery(EnginePartsCollection.class);
|
||||||
ArrayList<EngineParamDetailPojo> engineParamDetailPojos = new ArrayList<>();
|
//查找图号
|
||||||
for (EnginePartsCollection partsCollection : partsCollections) {
|
List<String> allLbjths = partsCollections.stream()
|
||||||
if (partsCollections == null || partsCollection.getLbjth() == null) {
|
.map(EnginePartsCollection::getLbjth)
|
||||||
continue;
|
.filter(ObjectUtils::isNotEmpty)
|
||||||
}
|
.distinct()
|
||||||
List<ClassificationAttribute> list = bd.getTCDatabase()
|
.collect(Collectors.toList());
|
||||||
.eq("pitemId", partsCollection.getLbjth())
|
//查找参数
|
||||||
.doQuery(ClassificationAttribute.class);
|
if (!allLbjths.isEmpty()) {
|
||||||
for (ClassificationAttribute classificationAttribute : list) {
|
List<ClassificationAttribute> allClassifications = bd.getTCDatabase()
|
||||||
|
.in("pitemId", allLbjths)
|
||||||
|
.doQuery(ClassificationAttribute.class)
|
||||||
|
.stream()
|
||||||
|
.filter(attr -> parametersOnPartsName.contains(attr.getIdattrtbutehame()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
|
for (ClassificationAttribute classificationAttribute : allClassifications) {
|
||||||
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
EngineParamDetailPojo engineParamDetailPojo = new EngineParamDetailPojo();
|
||||||
engineParamDetailPojo.setEngineModelId(engineModelPojo.getId());
|
engineParamDetailPojo.setEngineModelId(engineModelPojo.getId());
|
||||||
engineParamDetailPojo.setPartsName(partsCollection.getLbjmc());
|
engineParamDetailPojo.setPartsName(partsName);
|
||||||
engineParamDetailPojo.setParameterName(classificationAttribute.getIdattrtbutehame());
|
engineParamDetailPojo.setParameterName(classificationAttribute.getIdattrtbutehame());
|
||||||
engineParamDetailPojo.setParameterValue(classificationAttribute.getFieldvalue());
|
engineParamDetailPojo.setParameterValue(classificationAttribute.getFieldvalue());
|
||||||
engineParamDetailPojos.add(engineParamDetailPojo);
|
engineParamDetailPojos.add(engineParamDetailPojo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return engineParamDetailPojos;
|
return engineParamDetailPojos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user