修改OTA历史记录

This commit is contained in:
高嵩
2023-08-24 23:40:40 +08:00
parent 52baf1abb7
commit 2f931ae002
@@ -673,7 +673,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
if (!list.isEmpty()) { if (!list.isEmpty()) {
List<VersionVO> vprojectVersionList = getProjectVersionList(otaManageApplyEO.getAppliedVehicleProject(),null); List<VersionVO> vprojectVersionList = getProjectVersionList(otaManageApplyEO.getAppliedVehicleProject(), null);
//项目版本id //项目版本id
List<String> projectVersionList = list.stream() List<String> projectVersionList = list.stream()
.map(OtaManageApplyEO::getProjectVersion).distinct().collect(Collectors.toList()); .map(OtaManageApplyEO::getProjectVersion).distinct().collect(Collectors.toList());
@@ -691,7 +691,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
manageApplyEO.setProjectVersion(null); manageApplyEO.setProjectVersion(null);
manageApplyEO.setAttestationSchedule(null); manageApplyEO.setAttestationSchedule(null);
manageApplyEO.setMatchStatus(null); manageApplyEO.setMatchStatus(null);
manageApplyEO.setRemark(null); manageApplyEO.setRemark("--");
} }
if (StringUtils.isNotBlank(manageApplyEO.getProjectVersion())) { if (StringUtils.isNotBlank(manageApplyEO.getProjectVersion())) {
List<ProjectTaskPlanning> taskPlanningList = projectTaskPlanningList.stream() List<ProjectTaskPlanning> taskPlanningList = projectTaskPlanningList.stream()
@@ -732,7 +732,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
manageApplyEO.setDisabled(isDisabled); manageApplyEO.setDisabled(isDisabled);
if (StringUtils.isBlank(manageApplyEO.getRemark())) { if (StringUtils.isBlank(manageApplyEO.getRemark())) {
manageApplyEO.setRemark("-"); manageApplyEO.setRemark("--");
} }
if (OtaHomoImpactEnum.YES.getValue().equals(manageApplyEO.getHomologationImpact()) if (OtaHomoImpactEnum.YES.getValue().equals(manageApplyEO.getHomologationImpact())
|| OtaHomoImpactEnum.INTER_VALID.getValue().equals(manageApplyEO.getHomologationImpact())) { || OtaHomoImpactEnum.INTER_VALID.getValue().equals(manageApplyEO.getHomologationImpact())) {
@@ -816,7 +816,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
* @return * @return
*/ */
@Override @Override
public List<String> getCarList(String cut,String plannedBpLaunchBatch) { public List<String> getCarList(String cut, String plannedBpLaunchBatch) {
List<OtaManageApplyEO> otaManageApplyEOS = this.getBaseMapper().getOtaCarList(plannedBpLaunchBatch); List<OtaManageApplyEO> otaManageApplyEOS = this.getBaseMapper().getOtaCarList(plannedBpLaunchBatch);
List<String> result = new LinkedList<>(); List<String> result = new LinkedList<>();
if (CutEnum.CN.getValue().equals(cut)) { if (CutEnum.CN.getValue().equals(cut)) {
@@ -851,7 +851,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
@Override @Override
public List<VersionVO> getProjectVersionList(String carMarket,String cut) { public List<VersionVO> getProjectVersionList(String carMarket, String cut) {
List<VersionVO> result = new LinkedList<>(); List<VersionVO> result = new LinkedList<>();
if (StringUtils.isNotBlank(carMarket)) { if (StringUtils.isNotBlank(carMarket)) {
@@ -894,9 +894,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
//ComplianceFlowStatusEnum //ComplianceFlowStatusEnum
VersionVO versionVO = new VersionVO(); VersionVO versionVO = new VersionVO();
versionVO.setProjectId("busheji"); versionVO.setProjectId("busheji");
if(CutEnum.CN.getValue().equals(cut)){ if (CutEnum.CN.getValue().equals(cut)) {
versionVO.setVersionName("不涉及"); versionVO.setVersionName("不涉及");
}else{ } else {
versionVO.setVersionName(ComplianceFlowStatusEnum.UNINVOLVED.getEnName()); versionVO.setVersionName(ComplianceFlowStatusEnum.UNINVOLVED.getEnName());
} }
result.add(versionVO); result.add(versionVO);
@@ -912,7 +912,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
* @return * @return
*/ */
@Override @Override
public List<VersionVO> getVersionInfo(String vdr,String car) { public List<VersionVO> getVersionInfo(String vdr, String car) {
//认证进度数据字典 certification_progress //认证进度数据字典 certification_progress
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode("certification_progress"); List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode("certification_progress");
@@ -947,7 +947,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
} }
if(result.isEmpty()){ if (result.isEmpty()) {
VersionVO versionVO = new VersionVO(); VersionVO versionVO = new VersionVO();
versionVO.setVersionName(car); versionVO.setVersionName(car);
result.add(versionVO); result.add(versionVO);
@@ -1086,6 +1086,14 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
return false; return false;
} }
private boolean paramsEquals(String str1, String str2) {
if (null == str1 && null == str2) {
return true;
}
return StringUtils.equals(str1, str2);
}
@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();
@@ -1107,55 +1115,59 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
saveList.add(oma); saveList.add(oma);
boolean flag = false; boolean flag = false;
for (OtaManageApplyEO omaOld : omaOldList) { for (OtaManageApplyEO omaOld : omaOldList) {
flag = true; if (omaOld.getId().equals(oma.getId())) {
if (StringUtils.equals(oma.getProjectVersionText(), omaOld.getProjectVersionText()) flag = true;
|| StringUtils.equals(oma.getAttestationSchedule(), omaOld.getAttestationSchedule()) if (!paramsEquals(oma.getProjectVersion(), omaOld.getProjectVersion())
|| StringUtils.equals(oma.getRemark(), omaOld.getRemark())) { || !paramsEquals(oma.getAttestationSchedule(), omaOld.getAttestationSchedule())
OtaManageHistory his = new OtaManageHistory(); || !paramsEquals(oma.getRemark(), omaOld.getRemark())) {
his.setApplyId(oma.getId()); OtaManageHistory his = new OtaManageHistory();
StringBuilder conSb = new StringBuilder(); his.setApplyId(oma.getId());
StringBuilder conSbEn = new StringBuilder(); StringBuilder conSb = new StringBuilder();
conSb.append(user.getUsername()).append("编辑了 VDR:").append(oma.getVdr()); StringBuilder conSbEn = new StringBuilder();
conSbEn.append(user.getUsername()).append("edited VDR:").append(oma.getVdr()); conSb.append(user.getUsername()).append(" : ");
if (StringUtils.equals(oma.getProjectVersionText(), omaOld.getProjectVersionText())) { conSbEn.append(user.getUsername()).append(" : ");
conSb.append(" 修改了 ").append("项目版本 由 ").append(omaOld.getProjectVersionText()).append(" 改为 ").append(oma.getProjectVersionText()); if (!paramsEquals(oma.getProjectVersion(), omaOld.getProjectVersion())) {
conSbEn.append(" modified ").append("Project Version from ").append(omaOld.getProjectVersionText()).append(" to ").append(oma.getProjectVersionText()); conSb.append("‘项目版本’ 由 ‘").append(omaOld.getProjectVersionText()).append("’ 改为 ‘").append(oma.getProjectVersionText()).append("‘.");
conSbEn.append("‘Project Version‘ change from ‘").append(omaOld.getProjectVersionText()).append("‘ to ‘").append(oma.getProjectVersionText()).append("‘.");
}
if (!paramsEquals(oma.getAttestationSchedule(), omaOld.getAttestationSchedule())) {
conSb.append("’认证进度’ 由 ’").append(CertificationProgressEnum.getByValue(omaOld.getAttestationSchedule()).getName())
.append("’ 改为 ’").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getName()).append("‘.");
conSbEn.append("’Homologation Progress’ change from ’").append(CertificationProgressEnum.getByValue(omaOld.getAttestationSchedule()).getValue())
.append("’ to ’").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getValue()).append("‘.");
}
if (!paramsEquals(oma.getRemark(), omaOld.getRemark()) && (StringUtils.isNotEmpty(oma.getRemark()) && !oma.getRemark().equals("--"))) {
conSb.append("’备注’ 由 ’").append(omaOld.getRemark()).append("’ 改为 ’").append(oma.getRemark()).append("‘.");
conSbEn.append("’Remark’ change from ’").append(omaOld.getRemark()).append("’ to ’").append(oma.getRemark()).append("‘.");
}
his.setContentCn(conSb.toString());
his.setContentEn(conSbEn.toString());
hisList.add(his);
} }
if (StringUtils.equals(oma.getAttestationSchedule(), omaOld.getAttestationSchedule())) { break;
conSb.append(" 修改了 ").append("认证进度 由 ").append(CertificationProgressEnum.getByValue(omaOld.getAttestationSchedule()).getName()).append(" 改为 ").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getName());
conSbEn.append(" modified ").append("Homologation Progress from ").append(CertificationProgressEnum.getByValue(omaOld.getAttestationSchedule()).getValue()).append(" to ").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getValue());
}
if (StringUtils.equals(oma.getRemark(), omaOld.getRemark())) {
conSb.append(" 修改了 ").append("备注 由 ").append(omaOld.getRemark()).append(" 改为 ").append(oma.getRemark());
conSbEn.append(" modified ").append("Remark from ").append(omaOld.getRemark()).append(" to ").append(oma.getRemark());
}
his.setContentCn(conSb.toString());
his.setContentEn(conSbEn.toString());
hisList.add(his);
} }
break;
} }
if (!flag) { if (!flag) {
if (StringUtils.isNotEmpty(oma.getProjectVersionText()) if (StringUtils.isNotEmpty(oma.getProjectVersion())
|| StringUtils.isNotEmpty(oma.getAttestationSchedule()) || StringUtils.isNotEmpty(oma.getAttestationSchedule())
|| StringUtils.isNotEmpty(oma.getRemark())) { || (StringUtils.isNotEmpty(oma.getRemark()) && !oma.getRemark().equals("--"))) {
OtaManageHistory his = new OtaManageHistory(); OtaManageHistory his = new OtaManageHistory();
his.setApplyId(oma.getId()); his.setApplyId(oma.getId());
StringBuilder conSb = new StringBuilder(); StringBuilder conSb = new StringBuilder();
StringBuilder conSbEn = new StringBuilder(); StringBuilder conSbEn = new StringBuilder();
conSb.append(user.getUsername()).append("编辑了 VDR:").append(oma.getVdr()); conSb.append(user.getUsername()).append(" : ");
conSbEn.append(user.getUsername()).append("edited VDR:").append(oma.getVdr()); conSbEn.append(user.getUsername()).append(" : ");
if (StringUtils.isNotEmpty(oma.getProjectVersionText())) { if (StringUtils.isNotEmpty(oma.getProjectVersion())) {
conSb.append(" 修改了 ").append("项目版本 由 空").append(" 改为 ").append(oma.getProjectVersionText()); conSb.append("‘项目版本‘ 由 ‘空‘").append(" 改为 ‘").append(oma.getProjectVersionText()).append("‘.");
conSbEn.append(" modified ").append("Project Version from null").append(" to ").append(oma.getProjectVersionText()); conSbEn.append("‘Project Version‘ change from ‘null‘").append(" to ‘").append(oma.getProjectVersionText()).append("‘.");
} }
if (StringUtils.isNotEmpty(oma.getAttestationSchedule())) { if (StringUtils.isNotEmpty(oma.getAttestationSchedule())) {
conSb.append(" 修改了 ").append("认证进度 由 空").append(" 改为 ").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getName()); conSb.append("‘认证进度‘ 由 ‘空‘").append(" 改为 ‘").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getName()).append("‘.");
conSbEn.append(" modified ").append("Homologation Progress from null").append(" to ").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getValue()); conSbEn.append("‘Homologation Progress‘ change from ‘null‘").append(" to ‘").append(CertificationProgressEnum.getByValue(oma.getAttestationSchedule()).getValue()).append("‘.");
} }
if (StringUtils.isNotEmpty(oma.getRemark())) { if (StringUtils.isNotEmpty(oma.getRemark()) && !oma.getRemark().equals("--")) {
conSb.append(" 修改了 ").append("备注 由 空").append(" 改为 ").append(oma.getRemark()); conSb.append("‘备注‘ 由 ‘空‘").append(" 改为 ‘").append(oma.getRemark()).append("‘.");
conSbEn.append(" modified ").append("Remark from null").append(" to ").append(oma.getRemark()); conSbEn.append("‘Remark‘ change from ‘null‘").append(" to ‘").append(oma.getRemark()).append("‘.");
} }
his.setContentCn(conSb.toString()); his.setContentCn(conSb.toString());
his.setContentEn(conSbEn.toString()); his.setContentEn(conSbEn.toString());
@@ -1164,7 +1176,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
} }
if (saveList.size() > 0) { if (saveList.size() > 0) {
this.saveOrUpdateBatch(list); this.saveOrUpdateBatch(saveList);
otaManageHistoryService.saveBatch(hisList); otaManageHistoryService.saveBatch(hisList);
} }
} }
@@ -1372,8 +1384,8 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Override @Override
public List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) { public List<Map<String, Object>> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) {
List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch); List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch);
List<Map<String,Object>> result = new ArrayList<>(); List<Map<String, Object>> result = new ArrayList<>();
if(!receiveList.isEmpty()){ if (!receiveList.isEmpty()) {
List<String> plannedBpLaunchBatchList = receiveList.stream() List<String> plannedBpLaunchBatchList = receiveList.stream()
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())) .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
.map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList()); .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
@@ -1429,7 +1441,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
} }
Map<String, Object> statisticalMap = new HashMap<>(); Map<String, Object> statisticalMap = new HashMap<>();
statisticalMap.put("plannedBpLaunchBatch",s); statisticalMap.put("plannedBpLaunchBatch", s);
statisticalMap.put("allCount", total); statisticalMap.put("allCount", total);
List<Map<String, Object>> matchStatusMapList = new ArrayList<>(); List<Map<String, Object>> matchStatusMapList = new ArrayList<>();
matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched)); matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched));