修改VDR问题

This commit is contained in:
高嵩
2023-09-14 18:02:59 +08:00
parent 1f6bab60ea
commit d38458fe38
10 changed files with 362 additions and 114 deletions
@@ -211,6 +211,16 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "导出文件名")
private String exportName;
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "软件版本创建时间")
private Date createdAt;
@TableField(exist = false)
@ApiModelProperty(value = "发布类型")
private String releaseType;
@TableField(exist = false)
@ApiModelProperty(value = "中英文切换")
private String cut;
@@ -4,6 +4,7 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@@ -71,6 +72,12 @@ public class OtaManageReceiveNsdp implements Serializable {
@ApiModelProperty(value = "发布版本")
private String releaseName;
/**发布版本*/
@Excel(name = "适用车型", width = 15)
@ApiModelProperty(value = "适用车型")
private String vehicle;
/**发布类型*/
@Excel(name = "发布类型", width = 15)
@ApiModelProperty(value = "发布类型")
@@ -93,4 +100,8 @@ public class OtaManageReceiveNsdp implements Serializable {
@ApiModelProperty(value = "创建时间")
private java.util.Date createdAt;
@TableField(exist = false)
private String market;
}
@@ -15,6 +15,8 @@ import org.springframework.stereotype.Service;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@Service
public class OtaDataUpdate implements Job {
@@ -34,6 +36,11 @@ public class OtaDataUpdate implements Job {
*/
@Override
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
//截取版本号中前面数字部分
String regex = "BL\\d+\\.+\\d+\\.(\\d+)";
Pattern pattern = Pattern.compile(regex);
List<OtaManageReceive> omrSyncList = otaManageReceiveService.getReceiveSync();
List<OtaManageReceive> omrList = otaManageReceiveService.queryList();
@@ -66,6 +73,13 @@ public class OtaDataUpdate implements Job {
}
if (addFlag) {
//同步数据中新增
String plannedBpLaunchBatch = omrSync.getPlannedBpLaunchBatch();
if (StringUtils.isNotEmpty(plannedBpLaunchBatch)) {
Matcher matcher = pattern.matcher(plannedBpLaunchBatch);
if (matcher.find()) {
omrSync.setPlannedBpLaunchBatch(matcher.group());
}
}
addList.add(omrSync);
}
}
@@ -115,6 +129,13 @@ public class OtaDataUpdate implements Job {
}
if (addFlag) {
//同步数据中新增
String releaseName = omrnSync.getReleaseName();
if (StringUtils.isNotEmpty(releaseName)) {
Matcher matcher = pattern.matcher(releaseName);
if (matcher.find()) {
omrnSync.setReleaseName(matcher.group());
}
}
addNsdpList.add(omrnSync);
}
//找到最快来临的发布时间
@@ -147,7 +168,7 @@ public class OtaDataUpdate implements Job {
List<OtaManageReceive> dateUpdateList = new ArrayList<>();
List<OtaManageReceive> omrListForDate = otaManageReceiveService.queryList();
for (OtaManageReceive omr : omrListForDate) {
if(releaceDateMap.containsKey(omr.getPlannedBpLaunchBatch())){
if (releaceDateMap.containsKey(omr.getPlannedBpLaunchBatch())) {
omr.setReleaseDate(sdf.format(releaceDateMap.get(omr.getPlannedBpLaunchBatch())));
dateUpdateList.add(omr);
}
@@ -155,15 +176,13 @@ public class OtaDataUpdate implements Job {
if (CollectionUtils.isNotEmpty(dateUpdateList)) {
otaManageReceiveService.updateBatchById(dateUpdateList);
}
System.out.println("===============================OtaDataUpdate定时任务结束===============================");
}
private boolean compareReceive(OtaManageReceiveNsdp omrn, OtaManageReceiveNsdp omrnSync) {
if (!StringUtils.equals(omrn.getPlatformName(), omrnSync.getPlatformName())) {
return false;
}
if (!StringUtils.equals(omrn.getReleaseName(), omrnSync.getReleaseName())) {
return false;
}
if (!StringUtils.equals(omrn.getReleaseType(), omrnSync.getReleaseType())) {
return false;
}
@@ -173,13 +192,13 @@ public class OtaDataUpdate implements Job {
if (!StringUtils.equals(omrn.getReleaseDate(), omrnSync.getReleaseDate())) {
return false;
}
if (!StringUtils.equals(omrn.getVehicle(), omrnSync.getVehicle())) {
return false;
}
return true;
}
private boolean compareReceive(OtaManageReceive omr, OtaManageReceive omrSync) {
if (!StringUtils.equals(omr.getPlannedBpLaunchBatch(), omrSync.getPlannedBpLaunchBatch())) {
return false;
}
if (!StringUtils.equals(omr.getSummary(), omrSync.getSummary())) {
return false;
}
@@ -61,4 +61,6 @@ public interface IOtaManageReceiveNsdpService extends IService<OtaManageReceiveN
List<OtaManageReceiveNsdp> getOtaManageReceiveNsdpSync();
List<OtaManageReceiveNsdp> getListByReleaseName(String releaseName);
}
@@ -11,18 +11,12 @@ import com.jero.common.util.oConvertUtils;
import com.jero.modules.dummy.enums.OrderEnum;
import com.jero.modules.feishu.enums.TemplateInfoEnum2;
import com.jero.modules.feishu.service.IFeishuService;
import com.jero.modules.ota.entity.OtaManageApplyEO;
import com.jero.modules.ota.entity.OtaManageHistory;
import com.jero.modules.ota.entity.OtaManagePermission;
import com.jero.modules.ota.entity.OtaManageReceive;
import com.jero.modules.ota.entity.*;
import com.jero.modules.ota.enums.OtaCarEnum;
import com.jero.modules.ota.enums.OtaHomoImpactEnum;
import com.jero.modules.ota.enums.OtaStatusEnum;
import com.jero.modules.ota.mapper.OtaManageApplyEOMapper;
import com.jero.modules.ota.service.IOtaManageApplyEOService;
import com.jero.modules.ota.service.IOtaManageHistoryService;
import com.jero.modules.ota.service.IOtaManagePermissionService;
import com.jero.modules.ota.service.IOtaManageReceiveService;
import com.jero.modules.ota.service.*;
import com.jero.modules.ota.vo.AllCarExportCnVO;
import com.jero.modules.ota.vo.AllCarExportEnVO;
import com.jero.modules.ota.vo.OneCarExportCnVO;
@@ -63,6 +57,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import java.text.Collator;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -108,6 +103,8 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Autowired
private IOtaManagePermissionService otaManagePermissionService;
@Autowired
private IOtaManageReceiveNsdpService otaManageReceiveNsdpService;
@Autowired
private ISysDictService sysDictService;
@Autowired
@@ -198,6 +195,85 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
return list();
}
public List<OtaManageApplyEO> getNsdpList(OtaManageApplyEO otaManageApplyEO) {
Date today = new Date();
List<OtaManageApplyEO> resList = new ArrayList<>();
List<OtaManageReceiveNsdp> dataList = otaManageReceiveNsdpService.queryList();
Map<String, List<OtaManageReceiveNsdp>> dataMap = dataList.stream().collect(Collectors.groupingBy(OtaManageReceiveNsdp::getReleaseName));
for (String rn : dataMap.keySet()) {
if(StringUtils.isNotEmpty(otaManageApplyEO.getPlannedBpLaunchBatch())&&!otaManageApplyEO.getPlannedBpLaunchBatch().equals(rn)){
continue;
}
List<OtaManageReceiveNsdp> valList = dataMap.get(rn);
if (CollectionUtils.isNotEmpty(valList)) {
Date releaseDate = null;
//市场
Set<String> marketSet = new HashSet<>();
//车型
Set<String> vehicleSet = new HashSet<>();
for (OtaManageReceiveNsdp omrn : valList) {
//找到最快来临的发布时间
try {
Date syncDate = sdf.parse(omrn.getReleaseDate());
if (null == releaseDate) {
releaseDate = syncDate;
} else {
if (syncDate.after(today) && syncDate.before(releaseDate)) {
releaseDate = syncDate;
}
}
} catch (ParseException e) {
e.printStackTrace();
}
String appliedVehicleProject = omrn.getVehicle();
if(StringUtils.isNotEmpty(appliedVehicleProject)){
for (String s : appliedVehicleProject.split(",")) {
String[] split = s.split(" ");
if (split.length == 3) {
vehicleSet.add(split[0]+" "+split[2]);
marketSet.add(split[2]);
}
}
}
}
if(ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeStart()) && ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeEnd())){
if(ObjectUtils.isEmpty(releaseDate) || otaManageApplyEO.getSoftwareIssueTimeStart().after(releaseDate) || otaManageApplyEO.getSoftwareIssueTimeEnd().before(releaseDate)){
continue;
}
}
if (StringUtils.isNotEmpty(otaManageApplyEO.getAppliedVehicleProject()) && !vehicleSet.contains(otaManageApplyEO.getAppliedVehicleProject())) {
continue;
}
if (StringUtils.isNotEmpty(otaManageApplyEO.getMarket()) && !marketSet.contains(otaManageApplyEO.getMarket())) {
continue;
}
OtaManageReceiveNsdp omrn = valList.get(0);
if (StringUtils.isNotEmpty(otaManageApplyEO.getReleaseType()) && !otaManageApplyEO.getReleaseType().equals(omrn.getReleaseType())) {
continue;
}
OtaManageApplyEO oma = new OtaManageApplyEO();
oma.setId(omrn.getId());
oma.setPlannedBpLaunchBatch(omrn.getReleaseName());
if (!marketSet.isEmpty()) {
oma.setMarket(StringUtils.join(marketSet, ","));
}
if (!vehicleSet.isEmpty()) {
oma.setAppliedVehicleProject(StringUtils.join(vehicleSet, ","));
}
if (ObjectUtils.isNotEmpty(releaseDate)) {
oma.setReleaseDate(sdf.format(releaseDate));
}
oma.setCreatedAt(omrn.getCreatedAt());
oma.setReleaseType(omrn.getReleaseType());
resList.add(oma);
}
}
return resList;
}
/**
* OTA管理列表和全车型列表-分页列表查询
*
@@ -208,7 +284,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
boolean otaManager = isOtaManager();
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
List<OtaManageApplyEO> otaManageApplyEOList = this.getNsdpList(otaManageApplyEO);
List<OtaManageApplyEO> dataList = new ArrayList<>();
//去跟manager和studio权限
@@ -223,80 +299,80 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
List<OtaManageApplyEO> result = new ArrayList<>();
// List<OtaManageApplyEO> result = new ArrayList<>();
// if (!dataList.isEmpty()) {
// List<String> otaNameList = OtaCarEnum.getOtaNameList();
// List<String> plannedBpLaunchBatchList = dataList.stream()
// .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
// .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
// if (!plannedBpLaunchBatchList.isEmpty()) {
// for (String plannedBpLaunchBatch : plannedBpLaunchBatchList) {
// OtaManageApplyEO manageApplyEO = new OtaManageApplyEO();
// manageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch);
// manageApplyEO.setId(plannedBpLaunchBatch);
//
// List<OtaManageApplyEO> otaManageApplyEOS = dataList.stream()
// .filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
// if (!otaManageApplyEOS.isEmpty()) {
// //发布时间
// manageApplyEO.setReleaseDate(otaManageApplyEOS.get(0).getReleaseDate());
//
// List<String> appliedVehicleProjectList = otaManageApplyEOS.stream()
// .filter(e -> StringUtils.isNotBlank(e.getAppliedVehicleProject()))
// .map(OtaManageApplyEO::getAppliedVehicleProject).collect(Collectors.toList());
// List<String> carList = new ArrayList<>();
// for (String appliedVehicleProject : appliedVehicleProjectList) {
// carList.addAll(Arrays.asList(appliedVehicleProject.split(",")));
// }
// if (!carList.isEmpty()) {
// //适用车型
// carList = carList.stream().distinct().collect(Collectors.toList());
// manageApplyEO.setAppliedVehicleProject(StringUtils.join(carList, ","));
// //市场
// Set<String> marketSet = new HashSet<>();
// for (String appliedVehicleProject : carList) {
// if(otaNameList.contains(appliedVehicleProject)){
// marketSet.add(appliedVehicleProject);
// }else{
// for (String s : appliedVehicleProject.split(",")) {
// String[] split = s.split(" ");
// if (split.length == 2) {
// if (!otaNameList.contains(s)) {
// marketSet.add(split[1]);
// }
// } else if (split.length == 3) {
// if (!otaNameList.contains(s)) {
// marketSet.add(split[2]);
// }
// }
// }
// }
// }
// if (!marketSet.isEmpty()) {
// manageApplyEO.setMarket(StringUtils.join(marketSet, ","));
// }
// }
// }
// result.add(manageApplyEO);
// }
// }
// }
// if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeStart())) {
// result = result.stream()
// .filter(e -> StringUtils.isNotBlank(e.getReleaseDate())
// && (e.getReleaseNameDate().after(otaManageApplyEO.getSoftwareIssueTimeStart())
// || e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeStart()))).collect(Collectors.toList());
// }
// if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeEnd())) {
// result = result.stream().filter(e -> StringUtils.isNotBlank(e.getReleaseDate())
// && (e.getReleaseNameDate().before(otaManageApplyEO.getSoftwareIssueTimeEnd())
// || e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeEnd()))).collect(Collectors.toList());
// }
if (!dataList.isEmpty()) {
List<String> otaNameList = OtaCarEnum.getOtaNameList();
List<String> plannedBpLaunchBatchList = dataList.stream()
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
.map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
if (!plannedBpLaunchBatchList.isEmpty()) {
for (String plannedBpLaunchBatch : plannedBpLaunchBatchList) {
OtaManageApplyEO manageApplyEO = new OtaManageApplyEO();
manageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch);
manageApplyEO.setId(plannedBpLaunchBatch);
List<OtaManageApplyEO> otaManageApplyEOS = dataList.stream()
.filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
if (!otaManageApplyEOS.isEmpty()) {
//发布时间
manageApplyEO.setReleaseDate(otaManageApplyEOS.get(0).getReleaseDate());
List<String> appliedVehicleProjectList = otaManageApplyEOS.stream()
.filter(e -> StringUtils.isNotBlank(e.getAppliedVehicleProject()))
.map(OtaManageApplyEO::getAppliedVehicleProject).collect(Collectors.toList());
List<String> carList = new ArrayList<>();
for (String appliedVehicleProject : appliedVehicleProjectList) {
carList.addAll(Arrays.asList(appliedVehicleProject.split(",")));
}
if (!carList.isEmpty()) {
//适用车型
carList = carList.stream().distinct().collect(Collectors.toList());
manageApplyEO.setAppliedVehicleProject(StringUtils.join(carList, ","));
//市场
Set<String> marketSet = new HashSet<>();
for (String appliedVehicleProject : carList) {
if(otaNameList.contains(appliedVehicleProject)){
marketSet.add(appliedVehicleProject);
}else{
for (String s : appliedVehicleProject.split(",")) {
String[] split = s.split(" ");
if (split.length == 2) {
if (!otaNameList.contains(s)) {
marketSet.add(split[1]);
}
} else if (split.length == 3) {
if (!otaNameList.contains(s)) {
marketSet.add(split[2]);
}
}
}
}
}
if (!marketSet.isEmpty()) {
manageApplyEO.setMarket(StringUtils.join(marketSet, ","));
}
}
}
result.add(manageApplyEO);
}
}
}
if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeStart())) {
result = result.stream()
.filter(e -> StringUtils.isNotBlank(e.getReleaseDate())
&& (e.getReleaseNameDate().after(otaManageApplyEO.getSoftwareIssueTimeStart())
|| e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeStart()))).collect(Collectors.toList());
}
if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeEnd())) {
result = result.stream().filter(e -> StringUtils.isNotBlank(e.getReleaseDate())
&& (e.getReleaseNameDate().before(otaManageApplyEO.getSoftwareIssueTimeEnd())
|| e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeEnd()))).collect(Collectors.toList());
}
if (!result.isEmpty()) {
//表头排序
heartSort(otaManageApplyEO, result);
heartSort(otaManageApplyEO, dataList);
}
return result;
return dataList;
}
/**
@@ -414,7 +490,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
// 软件发布时间,
if ("releaseName".equals(otaManageApplyEO.getOrderByField())) {
if ("releaseDate".equals(otaManageApplyEO.getOrderByField())) {
if (OrderEnum.POSITIVE.getValue().equals(otaManageApplyEO.getOrderBy())) {
Collections.sort(otaManageApplyEOList, (e1, e2) -> {
String e1ReleaseName = StringUtils.isNotBlank(e1.getReleaseDate()) ? e1.getReleaseDate() : "";
@@ -669,6 +745,22 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
});
}
}
//发布类型
if ("releaseType".equals(otaManageApplyEO.getOrderByField())) {
if (OrderEnum.POSITIVE.getValue().equals(otaManageApplyEO.getOrderBy())) {
Collections.sort(otaManageApplyEOList, (e1, e2) -> {
String e1ReleaseType = StringUtils.isNotBlank(e1.getReleaseType()) ? e1.getReleaseType() : "";
String e2ReleaseType = StringUtils.isNotBlank(e2.getReleaseType()) ? e2.getReleaseType() : "";
return comparator.compare(e1ReleaseType, e2ReleaseType);
});
} else if (OrderEnum.REVERSE.getValue().equals(otaManageApplyEO.getOrderBy())) {
Collections.sort(otaManageApplyEOList, (e1, e2) -> {
String e1ReleaseType = StringUtils.isNotBlank(e1.getReleaseType()) ? e1.getReleaseType() : "";
String e2ReleaseType = StringUtils.isNotBlank(e2.getReleaseType()) ? e2.getReleaseType() : "";
return comparator.compare(e2ReleaseType, e1ReleaseType);
});
}
}
//备注
if ("remark".equals(otaManageApplyEO.getOrderByField())) {
if (OrderEnum.POSITIVE.getValue().equals(otaManageApplyEO.getOrderBy())) {
@@ -685,6 +777,13 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
});
}
}
if(StringUtils.isEmpty(otaManageApplyEO.getOrderByField())){
Collections.sort(otaManageApplyEOList, (e1, e2) -> {
Date e1CreatedAt = ObjectUtils.isNotEmpty(e1.getCreatedAt()) ? e1.getCreatedAt() : new Date(0);
Date e2CreatedAt = ObjectUtils.isNotEmpty(e2.getCreatedAt()) ? e2.getCreatedAt() : new Date(0);
return e2CreatedAt.compareTo(e1CreatedAt);
});
}
}
private boolean hasPermission(String plannedBpLaunchBatch){
@@ -882,7 +981,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
*/
@Override
public Map<String, Object> getPullDownList() {
List<OtaManageApplyEO> otaManageApplyEOS = this.getBaseMapper().getOtaCarList(null);
List<OtaManageApplyEO> otaManageApplyEOS = this.getNsdpList(new OtaManageApplyEO());
Map<String, Object> result = new HashMap<>();
if (!otaManageApplyEOS.isEmpty()) {
//软件版本 planned_bp_launch_batch_
@@ -922,11 +1021,48 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
return result;
}
/**
* 下拉数据-全部和分车型(不含年款)
*
* @return
*/
@Override
public List<String> getCarList(String cut, String plannedBpLaunchBatch) {
List<OtaManageReceiveNsdp> dataList = otaManageReceiveNsdpService.getListByReleaseName(plannedBpLaunchBatch);
//车型
Set<String> vehicleSet = new HashSet<>();
for (OtaManageReceiveNsdp omrn : dataList) {
String appliedVehicleProject = omrn.getVehicle();
if(StringUtils.isNotEmpty(appliedVehicleProject)){
for (String s : appliedVehicleProject.split(",")) {
String[] split = s.split(" ");
if (split.length == 3) {
String projectName = split[0];
String market = split[2];
vehicleSet.add(projectName + " " + market);
}
}
}
}
List<String> resList = new ArrayList<>();
if (CutEnum.CN.getValue().equals(cut)) {
resList.add("全部");
} else {
resList.add("All");
}
resList.addAll(vehicleSet);
return resList;
}
/**
* 下拉数据-全部和分车型(不含年款)
*
* @return
*/
/*.
@Override
public List<String> getCarList(String cut, String plannedBpLaunchBatch) {
Set<String> set = new HashSet<>();
@@ -1003,6 +1139,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
return result;
}
*/
public List<String> getStudioCarList(String plannedBpLaunchBatch) {
Set<String> set = new HashSet<>();
@@ -1231,6 +1368,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override
public void issueNotice(String id) {
if (StringUtils.isNotEmpty(id)) {
/*
//根据版本查出所有vdr
List<OtaManageReceive> omrList = otaManageReceiveService.getReceiveByplanned(id);
List<String> appliedVehicleProjectList = omrList.stream()
@@ -1278,6 +1416,34 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
}
*/
List<OtaManageReceiveNsdp> dataList = otaManageReceiveNsdpService.getListByReleaseName(id);
//车型
Set<String> vehicleSet = new HashSet<>();
for (OtaManageReceiveNsdp omrn : dataList) {
String appliedVehicleProject = omrn.getVehicle();
if(StringUtils.isNotEmpty(appliedVehicleProject)){
for (String s : appliedVehicleProject.split(",")) {
String[] split = s.split(" ");
if (split.length == 3) {
String projectName = split[0].toUpperCase(Locale.ROOT);
String market = "";
if (split[2].equals("CN")) {
market = "China";
} else if (split[2].equals("RHD")) {
market = "UK";
} else {
market = split[2];
}
vehicleSet.add(projectName + " " + market);
}
}
}
}
//查询所有NT2平台的项目
ProjectLibraryBase plbSearch = new ProjectLibraryBase();
plbSearch.setDigitalPlatform("NT2");
@@ -1285,31 +1451,18 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
//存储符合条件的项目中Studio的用户ID
Set<String> matchStudioSet = new HashSet();
for (ProjectLibraryBase plb : plbList) {
boolean flag = false;
if (appMap.containsKey("All")) {
matchStudioSet.add(plb.getStudioEngineer());
continue;
}
String targetMarket = plb.getTargetMarket();
String projectName = plb.getProjectName().toUpperCase(Locale.ROOT);
boolean flag = false;
String targetMarket = plb.getTargetMarket();
String[] targetMarkets = targetMarket.split(",");
for (String tm : targetMarkets) {
if ((appMap.containsKey("CN") && tm.equals("China"))
|| (appMap.containsKey("EU") && tm.equals("EU"))
|| (appMap.containsKey("RHD") && tm.equals("UK"))) {
//三个ALL的市场类型
String vehicleStr =projectName + " " + tm;
if (vehicleSet.contains(vehicleStr)) {
matchStudioSet.add(plb.getStudioEngineer());
continue;
}
if (appMap.containsKey(projectName)) {
Set appSet = appMap.get(projectName);
if (appSet.contains(tm)) {
matchStudioSet.add(plb.getStudioEngineer());
continue;
}
}
}
}
List<OtaManagePermission> ompList = new ArrayList<>();
for (String studioId : matchStudioSet) {
OtaManagePermission omp = new OtaManagePermission();
@@ -1328,12 +1481,12 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
params.put("plannedBpLaunchBatch", id);
params.put("viewBtnUrlCnPhone", backUrlPhone);
String url = backUrl;
if (omrList.size() > 0) {
url = backUrl + "/components/detil?plannedBpLaunchBatch=" + id + "&releaseDate=" + omrList.get(0).getReleaseDate();
if (dataList.size() > 0) {
url = backUrl + "/components/detil?plannedBpLaunchBatch=" + id + "&releaseDate=" + dataList.get(0).getReleaseDate();
}
params.put("viewBtnUrlCn", url);
params.put("viewBtnUrlEn", url);
params.put("appliedVehicleProject", appMap.keySet().stream().collect(Collectors.joining(",")));
params.put("appliedVehicleProject", vehicleSet.stream().collect(Collectors.joining(",")));
params.put("Initiator", " " + currentUser.getUsername());
params.put("initiatorStrCn", "发起人");
params.put("initiatorStrEn", "Initiator");
@@ -1954,7 +2107,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override
public ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO) {
// Step.2 获取导出数据
List<OtaManageApplyEO> pageList = getOtaPage(otaManageApplyEO);
List<OtaManageApplyEO> pageList = getNsdpList(otaManageApplyEO);
List<OtaManageApplyEO> exportList = null;
// 过滤选中数据
@@ -1,5 +1,6 @@
package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.modules.ota.entity.OtaManageReceiveNsdp;
import com.jero.modules.ota.mapper.OtaManageReceiveNsdpMapper;
import com.jero.modules.ota.service.IOtaManageReceiveNsdpService;
@@ -91,4 +92,12 @@ public class OtaManageReceiveNsdpServiceImpl extends ServiceImpl<OtaManageReceiv
public List<OtaManageReceiveNsdp> getOtaManageReceiveNsdpSync() {
return this.getBaseMapper().getOtaManageReceiveNsdpSync();
}
@Override
public List<OtaManageReceiveNsdp> getListByReleaseName(String releaseName) {
LambdaQueryWrapper<OtaManageReceiveNsdp> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OtaManageReceiveNsdp::getReleaseName, releaseName);
return this.list(queryWrapper);
}
}
@@ -1396,7 +1396,7 @@ public class ProjectStatusBoardServiceImpl implements IProjectStatusBoardService
List<ParamsManifestEO> pmEos = pmEoList.stream().filter(pmEo -> {
if(pmEo.getProjectVersion().equals("00")){
if("00".equals(pmEo.getProjectVersion())){
return StringUtils.equals(pmEo.getProjectId(), plbEo.getId());
}else{
return StringUtils.equals(pmEo.getProjectId(), plbEo.getParentId()) && StringUtils.equals(pmEo.getProjectVersion(), plbEo.getProjectVersion());
+1
View File
@@ -1969,4 +1969,5 @@ module.exports = {
Listcreationtime:'List creation time',
Chinesecharacters:'The role code cannot enter Chinese characters',
alreadyexistssystem:'The role encoding already exists',
releaseType:'releaseType',
}
+1
View File
@@ -3925,4 +3925,5 @@ module.exports = {
Fileupload:'文件上传',
Addresslink:'地址链接',
Problemanagement:'问题管理',
releaseType:'发布类型',
}
@@ -103,6 +103,30 @@
</div>
</a-col>
<template v-if="toggleSearchStatus">
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('releaseType')">
<span>{{ $t('releaseType') }}</span>
</div>
<a-select :placeholder="$t('PleaseSelect')+$t('releaseType')"
class="box-input"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
showSearch
optionFilterProp="label"
:autoClearSearchValue="false"
v-model="queryParam.releaseType">
<a-select-option v-for="(item, key) in releaseTypeList"
:label='item'
:key="key"
:value="item">
<span style="display: inline-block;width: 100%" :title=" item">
{{ item }}
</span>
</a-select-option>
</a-select>
</div>
</a-col>
<a-col :md="6" :sm="8">
<div class="box-title-text">
<div class="title-text" :title="$t('softwarereleasetime')">
@@ -139,7 +163,7 @@
</div>
<div>
<a-table ref="table" size="middle" :components="drag(columns, 'columns')" :loading="loading" :pagination="false"
:scroll="{ x: '100%', y: 'calc(100vh - 140px)' }" rowKey="id" :data-source="dataSource"
:scroll="{ x: '100%', y: 'calc(100vh - 140px)' }" rowKey="id" :data-source="dataSource" @change="tableOnChange"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }" :columns="columns">
<!-- -->
<span slot="operation" slot-scope="text,record">
@@ -196,6 +220,7 @@ export default {
queryParam: {
},
formInline: {},
releaseTypeList:['BUILD','MARKETING','POC'],
rules: {
whetherTobring: [
{
@@ -230,6 +255,14 @@ export default {
sorter:true,
dataIndex: 'market'
},
{
title: this.$t('releaseType'),
align: 'left',
width: 150,
ellipsis: true,
sorter:true,
dataIndex: 'releaseType'
},
{
title: this.$t('vehicleType'),
align: 'left',
@@ -255,7 +288,9 @@ export default {
// }
],
userInfoQuery: {},
administrators: false
administrators: false,
orderBy: '1',
orderByField: ''
}
},
mounted() {
@@ -275,6 +310,11 @@ export default {
}
})
},
tableOnChange(pagination, filters, sorter) {
this.orderBy = sorter.order == 'ascend' ? '1' : '2'
this.orderByField = sorter.columnKey
this.getList()
},
handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus
},
@@ -308,6 +348,8 @@ export default {
let query = {
pageNo: this.pageNo,
pageSize: this.pageSize,
orderBy: this.orderBy,
orderByField: this.orderByField,
...queryParam
}
this.loading = true