项目详情-ota管理-软件版本下拉

This commit is contained in:
zhn
2024-01-18 14:17:27 +08:00
parent 355e3b69fd
commit 060c9071ef
3 changed files with 62 additions and 2 deletions
@@ -293,10 +293,17 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
@AutoLog(value = "查询项目涉及的VDR版本")
@ApiOperation(value = "查询项目涉及的VDR版本", notes = "查询项目涉及的VDR版本")
@GetMapping(value = "/getVdrListByProject")
public Result<?> getVdrListByProject(String projectId, String cut) {
List<OtaManageApplyEO> resList = otaManageApplyEOService.getVdrListByProject(projectId, cut);
public Result<?> getVdrListByProjectId(String projectId, String cut) {
List<OtaManageApplyEO> resList = otaManageApplyEOService.getVdrListByProjectId(projectId, cut);
return Result.OK("操作成功!", resList);
}
// @AutoLog(value = "查询项目涉及的VDR版本")
// @ApiOperation(value = "查询项目涉及的VDR版本", notes = "查询项目涉及的VDR版本")
// @GetMapping(value = "/getVdrListByProject")
// public Result<?> getVdrListByProject(String projectId, String cut) {
// List<OtaManageApplyEO> resList = otaManageApplyEOService.getVdrListByProject(projectId, cut);
// return Result.OK("操作成功!", resList);
// }
@AutoLog(value = "通过软件版本和项目ID查询状态")
@ApiOperation(value = "通过软件版本和项目ID查询状态", notes = "通过软件版本和项目ID查询状态")
@@ -126,6 +126,8 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
List<String> reject(String ids, String rejectReason,String cut);
List<OtaManageApplyEO> getVdrListByProjectId(String projectId, String cut);
List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut);
List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut,List<ProjectLibraryBase> projectLibraryBaseList);
@@ -2000,6 +2000,57 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
return msgList;
}
@Override
public List<OtaManageApplyEO> getVdrListByProjectId(String projectId, String cut) {
ProjectLibraryBase plb = projectLibraryBaseService.selectById(projectId);
String name ="";
if (StringUtils.isNotEmpty(plb.getProjectName()) && plb.getProjectName().equals("FORCE")) {
name = "Force";
} else {
name = plb.getProjectName();
}
List<String> projectNameAndTargetMarketList = new ArrayList<>();
if (StringUtils.isNotEmpty(plb.getTargetMarket())) {
String[] marketStrs = plb.getTargetMarket().split(",");
for (String marketStr : marketStrs) {
if(marketStr.equals("China")){
projectNameAndTargetMarketList.add(name+" China");
}else if(marketStr.equals("UK")){
projectNameAndTargetMarketList.add(name+" RHD");
}else{
projectNameAndTargetMarketList.add(name+" "+marketStr);
}
}
}
List<OtaManageReceive> otaManageReceiveList = otaManageReceiveService.list();
List<String> plannedBpLaunchBatchList = new ArrayList<>();
List<OtaManageApplyEO> otaManageApplyEOList = new ArrayList<>();
if(ObjectUtils.isNotEmpty(otaManageReceiveList)){
for (String s : projectNameAndTargetMarketList) {
List<String> collect = otaManageReceiveList.stream()
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())
&& StringUtils.isNotBlank(e.getVehicleMatch())
&& e.getVehicleMatch().contains(s))
.map(OtaManageReceive::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
if(ObjectUtils.isNotEmpty(collect)){
plannedBpLaunchBatchList.addAll(collect);
}
}
if(ObjectUtils.isNotEmpty(plannedBpLaunchBatchList)){
Collator comparator = Collator.getInstance(Locale.CHINESE);
//排序
Collections.sort(plannedBpLaunchBatchList, (e1, e2) -> {
return comparator.compare(e1, e2);
});
for (String s : plannedBpLaunchBatchList) {
OtaManageApplyEO otaManageApplyEO = new OtaManageApplyEO();
otaManageApplyEO.setPlannedBpLaunchBatch(s);
otaManageApplyEOList.add(otaManageApplyEO);
}
}
}
return otaManageApplyEOList;
}
@Override
public List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut) {
List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, "");