修改OTAbug

This commit is contained in:
高嵩
2023-08-27 23:15:09 +08:00
parent 677f94de39
commit b61e59a979
@@ -299,9 +299,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
public List<OtaManageApplyEO> getAllCarPage(OtaManageApplyEO otaManageApplyEO) { public List<OtaManageApplyEO> getAllCarPage(OtaManageApplyEO otaManageApplyEO) {
List<OtaManageApplyEO> otaManageApplyEOList = new ArrayList<>(); List<OtaManageApplyEO> otaManageApplyEOList = new ArrayList<>();
//studio数据权限 //studio数据权限
if(isOtaManager()) { if (isOtaManager()) {
otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO); otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
}else{ } else {
otaManageApplyEOList = getStudioData(otaManageApplyEO, otaManageApplyEOList); otaManageApplyEOList = getStudioData(otaManageApplyEO, otaManageApplyEOList);
} }
if (!otaManageApplyEOList.isEmpty()) { if (!otaManageApplyEOList.isEmpty()) {
@@ -346,7 +346,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
} }
otaManageApplyEOList= new ArrayList<>(set); otaManageApplyEOList = new ArrayList<>(set);
return otaManageApplyEOList; return otaManageApplyEOList;
} }
@@ -684,23 +684,24 @@ 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<>(); 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 (omaMap.containsKey(manageApplyEO.getVdr()) if (omaMap.containsKey(manageApplyEO.getVdr())
&& StringUtils.isNotEmpty(omaMap.get(manageApplyEO.getVdr()).getVehicleType()) && StringUtils.isNotEmpty(omaMap.get(manageApplyEO.getVdr()).getVehicleType())
&& omaMap.get(manageApplyEO.getVdr()).getVehicleType().equals(otaManageApplyEO.getAppliedVehicleProject())) { && omaMap.get(manageApplyEO.getVdr()).getVehicleType().equals(otaManageApplyEO.getAppliedVehicleProject())) {
continue; continue;
} else { } else {
manageApplyEO.setId(UUID.randomUUID().toString().replace("-", "")); if (!otaManageApplyEO.getAppliedVehicleProject().equals(manageApplyEO.getVehicleType())) {
manageApplyEO.setProjectVersion(null); manageApplyEO.setId(UUID.randomUUID().toString().replace("-", ""));
manageApplyEO.setAttestationSchedule(null); manageApplyEO.setProjectVersion(null);
manageApplyEO.setMatchStatus(null); manageApplyEO.setAttestationSchedule(null);
manageApplyEO.setRemark("--"); manageApplyEO.setMatchStatus(null);
manageApplyEO.setRemark("--");
manageApplyEO.setVehicleType("");
}
} }
String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject(); String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject();
if (StringUtils.isNotBlank(appliedVehicleProject)) { if (StringUtils.isNotBlank(appliedVehicleProject)) {
@@ -708,18 +709,18 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
for (String appliedVehicleProjectTemp : appliedVehicleProjectArr) { for (String appliedVehicleProjectTemp : appliedVehicleProjectArr) {
String[] split = appliedVehicleProjectTemp.split(" "); String[] split = appliedVehicleProjectTemp.split(" ");
if (split.length == 1) { if (split.length == 1) {
omaMap.put(manageApplyEO.getVdr(),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)) {
omaMap.put(manageApplyEO.getVdr(),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)) {
omaMap.put(manageApplyEO.getVdr(),manageApplyEO); omaMap.put(manageApplyEO.getVdr(), manageApplyEO);
break; break;
} }
} }
@@ -884,14 +885,14 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override @Override
public List<String> getCarList(String cut, String plannedBpLaunchBatch) { public List<String> getCarList(String cut, String plannedBpLaunchBatch) {
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
if(!isOtaManager()){ if (!isOtaManager()) {
List<ProjectNameInfoEO> nameInfoEOList = projectNameInfoEOService.list(); List<ProjectNameInfoEO> nameInfoEOList = projectNameInfoEOService.list();
List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode()); List<DictModel> targetMarketList = sysDictService.queryDictItemsByCode(DicCodeEnum.REGION.getCode());
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//studio在项目库所拥有的权限的项目 //studio在项目库所拥有的权限的项目
LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<ProjectLibraryBase> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ProjectLibraryBase::getStudioEngineer,currentUser.getId()); wrapper.eq(ProjectLibraryBase::getStudioEngineer, currentUser.getId());
List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseService.list(wrapper); List<ProjectLibraryBase> libraryBaseList = projectLibraryBaseService.list(wrapper);
for (ProjectLibraryBase projectLibraryBase : libraryBaseList) { for (ProjectLibraryBase projectLibraryBase : libraryBaseList) {
@@ -900,7 +901,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
List<ProjectNameInfoEO> projectNameInfoEOList = nameInfoEOList.stream().filter(e -> e.getId().equals(carId)).collect(Collectors.toList()); List<ProjectNameInfoEO> projectNameInfoEOList = nameInfoEOList.stream().filter(e -> e.getId().equals(carId)).collect(Collectors.toList());
String finalMarket = marketId; String finalMarket = marketId;
List<DictModel> dictModelList = targetMarketList.stream().filter(e -> e.getValue().equals(finalMarket)).collect(Collectors.toList()); List<DictModel> dictModelList = targetMarketList.stream().filter(e -> e.getValue().equals(finalMarket)).collect(Collectors.toList());
if(!projectNameInfoEOList.isEmpty() && !dictModelList.isEmpty()){ if (!projectNameInfoEOList.isEmpty() && !dictModelList.isEmpty()) {
String market = dictModelList.get(0).getTextEn(); String market = dictModelList.get(0).getTextEn();
if ("China".equals(market)) { if ("China".equals(market)) {
//项目库里市场存的是China 不是CN //项目库里市场存的是China 不是CN
@@ -910,7 +911,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
market = "RHD"; market = "RHD";
} }
String car = projectNameInfoEOList.get(0).getProjectName(); String car = projectNameInfoEOList.get(0).getProjectName();
if("FORCE".equals(car)){ if ("FORCE".equals(car)) {
car = "Force"; car = "Force";
} }
set.add(car + " " + market); set.add(car + " " + market);
@@ -947,7 +948,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
result = result.stream().distinct().collect(Collectors.toList()); result = result.stream().distinct().collect(Collectors.toList());
if(!isOtaManager()){ if (!isOtaManager()) {
result.retainAll(set); result.retainAll(set);
if (CutEnum.CN.getValue().equals(cut)) { if (CutEnum.CN.getValue().equals(cut)) {
result.add("全部"); result.add("全部");
@@ -957,6 +958,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
return result; return result;
} }
public List<String> getStudioCarList(String plannedBpLaunchBatch) { public List<String> getStudioCarList(String plannedBpLaunchBatch) {
Set<String> set = new HashSet<>(); Set<String> set = new HashSet<>();
List<ProjectNameInfoEO> nameInfoEOList = projectNameInfoEOService.list(); List<ProjectNameInfoEO> nameInfoEOList = projectNameInfoEOService.list();
@@ -984,7 +986,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
market = "RHD"; market = "RHD";
} }
String car = projectNameInfoEOList.get(0).getProjectName(); String car = projectNameInfoEOList.get(0).getProjectName();
if("FORCE".equals(car)){ if ("FORCE".equals(car)) {
car = "Force"; car = "Force";
} }
set.add(car + " " + market); set.add(car + " " + market);
@@ -1042,12 +1044,12 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
market = "UK"; market = "UK";
} }
} }
if("FORCE".equals(car)){ if ("FORCE".equals(car)) {
car = "Force"; car = "Force";
} }
String finalMarket = market; String finalMarket = market;
List<DictModel> modelList = dictModels.stream().filter(e -> e.getTextEn().equals(finalMarket)).collect(Collectors.toList()); List<DictModel> modelList = dictModels.stream().filter(e -> e.getTextEn().equals(finalMarket)).collect(Collectors.toList());
if(!modelList.isEmpty()){ if (!modelList.isEmpty()) {
market = modelList.get(0).getValue(); market = modelList.get(0).getValue();
} }