OTA-状态统计

This commit is contained in:
zhn
2024-01-18 16:49:30 +08:00
parent 060c9071ef
commit 316ec47c1a
9 changed files with 178 additions and 18 deletions
@@ -308,9 +308,9 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
@AutoLog(value = "通过软件版本和项目ID查询状态")
@ApiOperation(value = "通过软件版本和项目ID查询状态", notes = "通过软件版本和项目ID查询状态")
@GetMapping(value = "/getStatisticalStatus")
public Result<?> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) {
public Result<?> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut,String appliedVehicleProject) {
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
List<Map<String, Object>> res = otaManageApplyEOService.getStatisticalStatus(projectId, plannedBpLaunchBatch, cut,projectLibraryBaseList);
List<Map<String, Object>> res = otaManageApplyEOService.getStatisticalStatus(projectId, plannedBpLaunchBatch, cut,projectLibraryBaseList,appliedVehicleProject);
if(!res.isEmpty()){
return Result.OK("操作成功!", res.get(0));
}else{
@@ -130,7 +130,9 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut);
List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut,List<ProjectLibraryBase> projectLibraryBaseList);
List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch,
String cut,List<ProjectLibraryBase> projectLibraryBaseList,
String appliedVehicleProject);
ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO);
@@ -792,9 +792,11 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
if (StringUtils.isNotBlank(appliedVehicleProject)) {
String[] appliedVehicleProjectArr = appliedVehicleProject.split(",");
for (String appliedVehicleProjectTemp : appliedVehicleProjectArr) {
if(carMarket.equals(appliedVehicleProjectTemp)){
omaMap.put(manageApplyEO.getVdr(), manageApplyEO);
break;
for (String s : carMarket.split(",")) {
if(s.equals(appliedVehicleProjectTemp)){
omaMap.put(manageApplyEO.getVdr(), manageApplyEO);
break;
}
}
// String[] split = appliedVehicleProjectTemp.split(" ");
// if (split.length == 1) {
@@ -2084,15 +2086,28 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
return receiveList;
}
@Override
public List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut, List<ProjectLibraryBase> plbEoList) {
public List<Map<String, Object>> getStatisticalStatus(String projectId,
String plannedBpLaunchBatch,
String cut,
List<ProjectLibraryBase> plbEoList,
String appliedVehicleProject) {
List<Map<String, Object>> result = new ArrayList<>();
List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
if (ObjectUtils.isNotEmpty(plbEoList)) {
projectLibraryBaseList = plbEoList.stream().filter(e -> e.getId().equals(projectId)).collect(Collectors.toList());
}
List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch);
// List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch);
OtaManageApplyEO otaManageApplyEO = new OtaManageApplyEO();
otaManageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch);
otaManageApplyEO.setAppliedVehicleProject(appliedVehicleProject);
List<OtaManageApplyEO> receiveList = getOtaCarPage(otaManageApplyEO,cut);
// List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(null, plannedBpLaunchBatch);
// receiveList = receiveList.stream()
// .filter(e -> (StringUtils.isNotBlank(e.getProjectVersion()) && projectId.equals(e.getProjectVersion()))
// || (StringUtils.isBlank(e.getProjectVersion()) && "to_be_matched".equals(e.getMatchStatus())))
// .collect(Collectors.toList());
if (!receiveList.isEmpty()) {
List<String> plannedBpLaunchBatchList = receiveList.stream()
@@ -2119,7 +2134,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
int stored = 0;//部件报告已入库
for (OtaManageApplyEO oma : otaManageApplyEOList) {
if (StringUtils.isBlank(oma.getMatchStatus()) || oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_MATCHED.getKey())) {
// if (StringUtils.isBlank(oma.getMatchStatus()) || oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_MATCHED.getKey())) {
if ((OtaStatusEnum.TO_BE_MATCHED.getKey().equals(oma.getMatchStatus())
&& (StringUtils.isBlank(oma.getProjectVersion()) || projectId.equals(oma.getProjectVersion())))) {
toBeMatched++;
} else if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) {
toBeApproved++;
@@ -2127,9 +2144,10 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
locked++;
} else if (oma.getMatchStatus().equals(OtaStatusEnum.REJECTED.getKey())) {
rejected++;
} else {
toBeMatched++;
}
// else {
// toBeMatched++;
// }
if (StringUtils.isBlank(oma.getAttestationSchedule()) || oma.getAttestationSchedule().equals(CertificationProgressEnum.NOT_START.getValue())) {
notStart++;
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.IN_PROGRESS.getValue())) {
@@ -2194,6 +2212,115 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
return result;
}
// @Override
// public List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut, List<ProjectLibraryBase> plbEoList) {
// List<Map<String, Object>> result = new ArrayList<>();
// List<ProjectLibraryBase> projectLibraryBaseList = new ArrayList<>();
// if (ObjectUtils.isNotEmpty(plbEoList)) {
// projectLibraryBaseList = plbEoList.stream().filter(e -> e.getId().equals(projectId)).collect(Collectors.toList());
// }
// List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch);
//
// if (!receiveList.isEmpty()) {
// List<String> plannedBpLaunchBatchList = receiveList.stream()
// .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
// .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
//
// for (String s : plannedBpLaunchBatchList) {
// List<OtaManageApplyEO> otaManageApplyEOList = receiveList.stream()
// .filter(e -> s.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
//
// int total = otaManageApplyEOList.size();
// //匹配状态
// int toBeMatched = 0;//待匹配
// int toBeApproved = 0;//待审批
// int locked = 0;//锁定
// int rejected = 0;//退回
// //认证进度
// int notStart = 0;//未开始
// int inProgress = 0;//进行中
// int testPassed = 0;//实验通过
// int testFailed = 0;//实验失败
// int notSubmitted = 0;//部件报告未提交
// int submitted = 0;//部件报告已提交
// int stored = 0;//部件报告已入库
//
// for (OtaManageApplyEO oma : otaManageApplyEOList) {
// if (StringUtils.isBlank(oma.getMatchStatus()) || oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_MATCHED.getKey())) {
// toBeMatched++;
// } else if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) {
// toBeApproved++;
// } else if (oma.getMatchStatus().equals(OtaStatusEnum.LOCKED.getKey())) {
// locked++;
// } else if (oma.getMatchStatus().equals(OtaStatusEnum.REJECTED.getKey())) {
// rejected++;
// } else {
// toBeMatched++;
// }
// if (StringUtils.isBlank(oma.getAttestationSchedule()) || oma.getAttestationSchedule().equals(CertificationProgressEnum.NOT_START.getValue())) {
// notStart++;
// } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.IN_PROGRESS.getValue())) {
// inProgress++;
// } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_PASSED.getValue())) {
// testPassed++;
// } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_FAILED.getValue())) {
// testFailed++;
// } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue())) {
// notSubmitted++;
// } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue())) {
// submitted++;
// } else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue())) {
// stored++;
// } else {
// notStart++;
// }
// }
//
// Map<String, Object> statisticalMap = new HashMap<>();
// statisticalMap.put("plannedBpLaunchBatch", s);
// statisticalMap.put("allCount", total);
// List<Map<String, Object>> matchStatusMapList = new ArrayList<>();
// matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched));
// matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved));
// matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.LOCKED.getKey(), locked));
// matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.REJECTED.getKey(), rejected));
// statisticalMap.put("matchStatusMapList", matchStatusMapList);
//
// Map<String, Object> matchStatusMap = new HashMap<>();
// matchStatusMap.put(OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched);
// matchStatusMap.put(OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved);
// matchStatusMap.put(OtaStatusEnum.LOCKED.getKey(), locked);
// matchStatusMap.put(OtaStatusEnum.REJECTED.getKey(), rejected);
// statisticalMap.put("matchStatusMap", matchStatusMap);
//
// List<Map<String, Object>> attestationScheduleMapList = new ArrayList<>();
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.NOT_START.getValue(), notStart));
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.IN_PROGRESS.getValue(), inProgress));
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_PASSED.getValue(), testPassed));
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_FAILED.getValue(), testFailed));
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue(), notSubmitted));
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue(), submitted));
// attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue(), stored));
// statisticalMap.put("attestationScheduleMapList", attestationScheduleMapList);
//
// Map<String, Object> attestationScheduleMap = new HashMap<>();
// attestationScheduleMap.put(CertificationProgressEnum.NOT_START.getValue().replace(" ", "_"), notStart);
// attestationScheduleMap.put(CertificationProgressEnum.IN_PROGRESS.getValue().replace(" ", "_"), inProgress);
// attestationScheduleMap.put(CertificationProgressEnum.TEST_PASSED.getValue().replace(" ", "_"), testPassed);
// attestationScheduleMap.put(CertificationProgressEnum.TEST_FAILED.getValue().replace(" ", "_"), testFailed);
// attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue().replace(" ", "_"), notSubmitted);
// attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue().replace(" ", "_"), submitted);
// attestationScheduleMap.put(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue().replace(" ", "_"), stored);
// statisticalMap.put("attestationScheduleMap", attestationScheduleMap);
//
// if (!projectLibraryBaseList.isEmpty()) {
// statisticalMap.put("showName", projectLibraryBaseList.get(0).getShowName());
// }
// result.add(statisticalMap);
// }
// }
// return result;
// }
private Map<String, Object> wrapStatMap(String key, String val, String keyStr, Object valObj) {
Map<String, Object> map = new HashMap<>();
@@ -3295,7 +3295,7 @@ public class PlatformProjectLibraryBaseServiceImpl extends ServiceImpl<PlatformP
}
String projectLibraryId = (String) params.get("projectLibraryId");
List<Map<String, Object>> mapList = otaManageApplyEOService.getStatisticalStatus(projectLibraryId, null, cut,null);
List<Map<String, Object>> mapList = otaManageApplyEOService.getStatisticalStatus(projectLibraryId, null, cut,null,null);
if(ObjectUtils.isNotEmpty(mapList)){
int dataIndex = 2;
@@ -269,6 +269,9 @@ public class ProjectLibraryBase implements Comparable<ProjectLibraryBase> {
@ApiModelProperty(value = "平台件类型")
private String platformType;
@TableField(exist = false)
private String appliedVehicleProject;
@Override
public int compareTo(ProjectLibraryBase o) {
@@ -1288,6 +1288,29 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
//目标市场数据字典
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
for(ProjectLibraryBase projectLibraryBase: records){
//setOtaProjectName ota状态统计传参使用
String projectName = projectLibraryBase.getProjectName();
if("FORCE".equals(projectName)){
projectName = "Force";
}
String market = projectLibraryBase.getTargetMarket();
List<String> projectNameAndTargetMarketList = new ArrayList<>();
if(StringUtils.isNotBlank(market)){
for (String marketStr : market.split(",")) {
if(marketStr.equals("China")){
projectNameAndTargetMarketList.add(projectName+" China");
}else if(marketStr.equals("UK")){
projectNameAndTargetMarketList.add(projectName+" RHD");
}else{
projectNameAndTargetMarketList.add(projectName+" "+marketStr);
}
}
}
if(ObjectUtils.isNotEmpty(projectNameAndTargetMarketList)){
projectLibraryBase.setAppliedVehicleProject(StringUtils.join(projectNameAndTargetMarketList,","));
}
//历史数据的主版本没有版本号,所以默认给00
if(StringUtils.isBlank(projectLibraryBase.getParentId()) && StringUtils.isBlank(projectLibraryBase.getProjectVersion())){
projectLibraryBase.setProjectVersion("00");
@@ -4017,7 +4040,7 @@ public class ProjectLibraryBaseServiceImpl extends ServiceImpl<ProjectLibraryBas
}
String projectLibraryId = (String) params.get("projectLibraryId");
List<Map<String, Object>> mapList = otaManageApplyEOService.getStatisticalStatus(projectLibraryId, null, cut,null);
List<Map<String, Object>> mapList = otaManageApplyEOService.getStatisticalStatus(projectLibraryId, null, cut,null,null);
if(ObjectUtils.isNotEmpty(mapList)){
int dataIndex = 2;
@@ -686,7 +686,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
for (String projectId : projectIdListTemp) {
List<Map<String, Object>> statisticalStatus = otaManageApplyEOService.getStatisticalStatus(projectId,
"",
projectLibraryBase.getCut(),plbEoList);
projectLibraryBase.getCut(),plbEoList,null);
mapList.addAll(statisticalStatus);
}
}
@@ -105,7 +105,11 @@
idList: {
type: Array,
default: []
}
},
queryForm:{
type: Object,
default: {}
},
},
data() {
return {
@@ -149,7 +153,8 @@
getData() {
let query = {
...this.queryParam,
projectId:this.$route.query.id
projectId:this.$route.query.id,
appliedVehicleProject:this.queryForm.appliedVehicleProject
}
getAction('ota/otaManageApplyEO/getStatisticalStatus', query).then((res) => {
if (res.success) {
@@ -26,7 +26,7 @@
v-if="activeKey == $t('parameterCollectionProgressManagement')"/>
</a-tab-pane>
<a-tab-pane :key="$t('otastatus')" :tab="$t('otastatus')">
<otastatus @currentStatus="currentStatus" :idList="idList" v-if="activeKey == $t('otastatus')"/>
<otastatus :queryForm="queryForm" ref="otastatusRef" @currentStatus="currentStatus" :idList="idList" v-if="activeKey == $t('otastatus')"/>
</a-tab-pane>
<a-tab-pane :key="$t('Problemanagement')" :tab="$t('Problemanagement')">
<nonConformance ref="nonConformanceRef" @currentStatus="currentStatus"