修改OTA列表查询

This commit is contained in:
高嵩
2023-08-24 17:43:57 +08:00
parent 8bc58a0edb
commit 3840da7193
2 changed files with 92 additions and 71 deletions
@@ -61,7 +61,7 @@
omr.homologation_impact,omr.homologation, omr.homologation_impact,omr.homologation,
omr.impact_cn_homo,omr.impact_eu_homo, omr.impact_cn_homo,omr.impact_eu_homo,
omr.master_domain,omr.applied_vehicle_project, omr.master_domain,omr.applied_vehicle_project,
oma.id,oma.project_version,oma.attestation_schedule,oma.match_status,oma.remark oma.id,oma.project_version,oma.attestation_schedule,oma.match_status,oma.remark,oma.vehicle_type
from ota_manage_receive omr from ota_manage_receive omr
left join ota_manage_apply oma on oma.vdr = omr.id left join ota_manage_apply oma on oma.vdr = omr.id
<where> <where>
@@ -280,6 +280,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
return result; return result;
} }
/** /**
* OTA管理列表和全车型列表-分页列表查询 * OTA管理列表和全车型列表-分页列表查询
* *
@@ -639,6 +640,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
String[] conditionSplit = carMarket.split(" "); String[] conditionSplit = carMarket.split(" ");
for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) { for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) {
if (StringUtils.isNotEmpty(manageApplyEO.getVehicleType()) && !manageApplyEO.getVehicleType().equals(otaManageApplyEO.getAppliedVehicleProject())) {
continue;
}
if (StringUtils.isEmpty(manageApplyEO.getId()) || manageApplyEO.getId().length() < 20) { if (StringUtils.isEmpty(manageApplyEO.getId()) || manageApplyEO.getId().length() < 20) {
manageApplyEO.setId(UUID.randomUUID().toString().replace("-", "")); manageApplyEO.setId(UUID.randomUUID().toString().replace("-", ""));
} }
@@ -680,6 +684,14 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
List<ProjectTaskPlanning> projectTaskPlanningList = projectTaskPlanningService.queryList(StringUtils.join(projectVersionList, ",")); List<ProjectTaskPlanning> projectTaskPlanningList = projectTaskPlanningService.queryList(StringUtils.join(projectVersionList, ","));
boolean isDisabled = isDisabled(); boolean isDisabled = isDisabled();
for (OtaManageApplyEO manageApplyEO : list) { for (OtaManageApplyEO manageApplyEO : list) {
if (StringUtils.isBlank(manageApplyEO.getVehicleType())) {
manageApplyEO.setVehicleType(otaManageApplyEO.getAppliedVehicleProject());
manageApplyEO.setId(UUID.randomUUID().toString().replace("-", ""));
manageApplyEO.setProjectVersion(null);
manageApplyEO.setAttestationSchedule(null);
manageApplyEO.setMatchStatus(null);
manageApplyEO.setRemark(null);
}
if (StringUtils.isNotBlank(manageApplyEO.getProjectVersion())) { if (StringUtils.isNotBlank(manageApplyEO.getProjectVersion())) {
List<ProjectTaskPlanning> taskPlanningList = projectTaskPlanningList.stream() List<ProjectTaskPlanning> taskPlanningList = projectTaskPlanningList.stream()
.filter(e -> manageApplyEO.getProjectVersion().equals(e.getProjectId())).collect(Collectors.toList()); .filter(e -> manageApplyEO.getProjectVersion().equals(e.getProjectId())).collect(Collectors.toList());
@@ -1061,6 +1073,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override @Override
public void temporarySave(List<OtaManageApplyEO> list, String cut) { public void temporarySave(List<OtaManageApplyEO> list, String cut) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (CollectionUtils.isNotEmpty(list)) {
List<String> idList = list.stream() List<String> idList = list.stream()
.filter(e -> StringUtils.isNotBlank(e.getId())) .filter(e -> StringUtils.isNotBlank(e.getId()))
.map(OtaManageApplyEO::getId).distinct().collect(Collectors.toList()); .map(OtaManageApplyEO::getId).distinct().collect(Collectors.toList());
@@ -1069,8 +1082,13 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
List<OtaManageApplyEO> omaOldList = this.getBaseMapper().selectBatchIds(idList); List<OtaManageApplyEO> omaOldList = this.getBaseMapper().selectBatchIds(idList);
//历史记录 //历史记录
List<OtaManageHistory> hisList = new ArrayList<>(); List<OtaManageHistory> hisList = new ArrayList<>();
List<OtaManageApplyEO> saveList = new ArrayList<>();
for (OtaManageApplyEO oma : list) { for (OtaManageApplyEO oma : list) {
if (oma.getId().length() < 20) {
continue;
}
saveList.add(oma);
boolean flag = false; boolean flag = false;
for (OtaManageApplyEO omaOld : omaOldList) { for (OtaManageApplyEO omaOld : omaOldList) {
flag = true; flag = true;
@@ -1129,9 +1147,12 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
} }
if (saveList.size() > 0) {
this.saveOrUpdateBatch(list); this.saveOrUpdateBatch(list);
otaManageHistoryService.saveBatch(hisList); otaManageHistoryService.saveBatch(hisList);
} }
}
}
@Override @Override
public List<String> submit(List<OtaManageApplyEO> list, String cut) { public List<String> submit(List<OtaManageApplyEO> list, String cut) {