修改OTAbug

This commit is contained in:
高嵩
2023-08-27 22:50:32 +08:00
parent c75fc7ba48
commit e2be7ca10e
@@ -684,42 +684,42 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
public List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, String cut) { public List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, String cut) {
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO); List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
List<OtaManageApplyEO> list = new ArrayList<>(); List<OtaManageApplyEO> list = new ArrayList<>();
Map<String,OtaManageApplyEO> omaMap = new HashMap<>();
String carMarket = otaManageApplyEO.getAppliedVehicleProject(); String carMarket = otaManageApplyEO.getAppliedVehicleProject();
if (StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !"All".equals(carMarket) && !otaManageApplyEOList.isEmpty()) { if (StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !"All".equals(carMarket) && !otaManageApplyEOList.isEmpty()) {
String[] conditionSplit = carMarket.split(" "); String[] conditionSplit = carMarket.split(" ");
for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) { for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) {
if (StringUtils.isNotEmpty(manageApplyEO.getVehicleType()) if (omaMap.containsKey(manageApplyEO.getVdr())
&& !manageApplyEO.getVehicleType().equals(otaManageApplyEO.getAppliedVehicleProject())) { && StringUtils.isNotEmpty(omaMap.get(manageApplyEO.getVdr()).getVehicleType())
manageApplyEO.setVehicleType(otaManageApplyEO.getAppliedVehicleProject()); && omaMap.get(manageApplyEO.getVdr()).getVehicleType().equals(otaManageApplyEO.getAppliedVehicleProject())) {
continue;
} else {
manageApplyEO.setId(UUID.randomUUID().toString().replace("-", "")); manageApplyEO.setId(UUID.randomUUID().toString().replace("-", ""));
manageApplyEO.setProjectVersion(null); manageApplyEO.setProjectVersion(null);
manageApplyEO.setAttestationSchedule(null); manageApplyEO.setAttestationSchedule(null);
manageApplyEO.setMatchStatus(null); manageApplyEO.setMatchStatus(null);
manageApplyEO.setRemark("--"); manageApplyEO.setRemark("--");
} }
if (StringUtils.isEmpty(manageApplyEO.getId()) || manageApplyEO.getId().length() < 20) {
manageApplyEO.setId(UUID.randomUUID().toString().replace("-", ""));
}
String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject(); String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject();
if (StringUtils.isNotBlank(appliedVehicleProject)) { if (StringUtils.isNotBlank(appliedVehicleProject)) {
String[] appliedVehicleProjectArr = appliedVehicleProject.split(","); String[] appliedVehicleProjectArr = appliedVehicleProject.split(",");
for (String appliedVehicleProjectTemp : appliedVehicleProjectArr) { for (String appliedVehicleProjectTemp : appliedVehicleProjectArr) {
String[] split = appliedVehicleProjectTemp.split(" "); String[] split = appliedVehicleProjectTemp.split(" ");
if (split.length == 1) { if (split.length == 1) {
list.add(manageApplyEO); omaMap.put(manageApplyEO.getVdr(),manageApplyEO);
break; break;
} else if (split.length == 2) { } else if (split.length == 2) {
if (Arrays.equals(conditionSplit, split)) { if (Arrays.equals(conditionSplit, split)) {
list.add(manageApplyEO); omaMap.put(manageApplyEO.getVdr(),manageApplyEO);
break; break;
} }
} else if (split.length == 3) { } else if (split.length == 3) {
List<String> listTemp = Arrays.asList(split); List<String> listTemp = Arrays.asList(split);
List<String> conditionList = Arrays.asList(conditionSplit); List<String> conditionList = Arrays.asList(conditionSplit);
if (listTemp.containsAll(conditionList)) { if (listTemp.containsAll(conditionList)) {
list.add(manageApplyEO); omaMap.put(manageApplyEO.getVdr(),manageApplyEO);
break; break;
} }
} }
@@ -727,6 +727,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
} }
list = new ArrayList<>(omaMap.values());
if (!list.isEmpty()) { if (!list.isEmpty()) {
List<VersionVO> vprojectVersionList = getProjectVersionList(otaManageApplyEO.getAppliedVehicleProject(), null); List<VersionVO> vprojectVersionList = getProjectVersionList(otaManageApplyEO.getAppliedVehicleProject(), null);
//项目版本id //项目版本id