diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageApplyEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageApplyEO.java index 673aa08a4..5408c129a 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageApplyEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageApplyEO.java @@ -89,16 +89,20 @@ public class OtaManageApplyEO implements Serializable { @ApiModelProperty(value = "备注") private java.lang.String remark; + + /**适用车型*/ + @Excel(name = "适用车型", width = 15) @ApiModelProperty(value = "适用车型") - private java.lang.String appliedVehicleProject; - - + private java.lang.String vehicleType; //-------------------------------------------------------- @TableField(exist = false) @ApiModelProperty(value = "软件版本") private java.lang.String plannedBpLaunchBatch; + @TableField(exist = false) + @ApiModelProperty(value = "适用车型") + private java.lang.String appliedVehicleProject; @TableField(exist = false) @@ -107,7 +111,7 @@ public class OtaManageApplyEO implements Serializable { @TableField(exist = false) @ApiModelProperty(value = "软件发布时间") - private String releaseName; + private String releaseDate; @TableField(exist = false) @ApiModelProperty(value = "软件发布时间") diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/xml/OtaManageApplyEOMapper.xml b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/xml/OtaManageApplyEOMapper.xml index cd0b032e9..5a03de097 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/xml/OtaManageApplyEOMapper.xml +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/xml/OtaManageApplyEOMapper.xml @@ -81,7 +81,7 @@ and omr.impact_eu_homo LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.impactHomo}),'%')) - and omr.applied_vehicle_project LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.appliedVehicleProject}),'%' + and omr.vehicle_type LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.appliedVehicleProject}),'%') order by omr.id desc diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java index 2c7f8c45c..25d9ec68b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageApplyEOServiceImpl.java @@ -190,72 +190,75 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl getOtaPage(OtaManageApplyEO otaManageApplyEO) { List otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO); + List result = new ArrayList<>(); if (!otaManageApplyEOList.isEmpty()) { List otaNameList = OtaCarEnum.getOtaNameList(); List plannedBpLaunchBatchList = otaManageApplyEOList.stream() .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())) .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList()); if (!plannedBpLaunchBatchList.isEmpty()) { - List manageReceiveNsdpEOList = this.getBaseMapper().getReleaseDate(plannedBpLaunchBatchList); - for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) { - manageApplyEO.setVdr(manageApplyEO.getId()); - List collect = manageReceiveNsdpEOList.stream() - .filter(e -> StringUtils.isNotBlank(e.getReleaseName()) - && e.getReleaseName().equals(manageApplyEO.getPlannedBpLaunchBatch())).collect(Collectors.toList()); - if (!collect.isEmpty()) { - List releaseDateList = collect.stream().map(OtaManageReceiveNsdpEO::getReleaseDate).distinct().collect(Collectors.toList()); - List list = new ArrayList<>(); - for (String s : releaseDateList) { - list.add(Integer.parseInt(s.replaceAll("-", ""))); + for (String plannedBpLaunchBatch : plannedBpLaunchBatchList) { + OtaManageApplyEO manageApplyEO = new OtaManageApplyEO(); + manageApplyEO.setPlannedBpLaunchBatch(plannedBpLaunchBatch); + + List otaManageApplyEOS = otaManageApplyEOList.stream() + .filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList()); + if(!otaManageApplyEOS.isEmpty()){ + //发布时间 + manageApplyEO.setReleaseDate(otaManageApplyEOS.get(0).getReleaseDate()); + + List appliedVehicleProjectList = otaManageApplyEOS.stream() + .filter(e->StringUtils.isNotBlank(e.getAppliedVehicleProject())) + .map(OtaManageApplyEO::getAppliedVehicleProject).collect(Collectors.toList()); + List carList = new ArrayList<>(); + for (String appliedVehicleProject : appliedVehicleProjectList) { + carList.addAll(Arrays.asList(appliedVehicleProject.split(","))); } - Integer max = Collections.max(list); - try { - //发布时间 - manageApplyEO.setReleaseName(sdf.format(dateFormat.parse(max.toString()))); - manageApplyEO.setReleaseNameDate(dateFormat.parse(max.toString())); - } catch (ParseException e) { - log.error(e.getMessage(), e); - } - } - //市场 - String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject(); - if (StringUtils.isNotBlank(appliedVehicleProject)) { - Set marketSet = new HashSet<>(); - for (String s : appliedVehicleProject.split(",")) { - String[] split = s.split(" "); - if (split.length == 2) { - if (!otaNameList.contains(s)) { - marketSet.add(split[1]); + if(!carList.isEmpty()){ + //适用车型 + carList = carList.stream().distinct().collect(Collectors.toList()); + manageApplyEO.setAppliedVehicleProject(StringUtils.join(carList,",")); + //市场 + for (String appliedVehicleProject : carList) { + Set marketSet = new HashSet<>(); + 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]); + } + } } - } else if (split.length == 3) { - if (!otaNameList.contains(s)) { - marketSet.add(split[2]); + if (!marketSet.isEmpty()) { + manageApplyEO.setMarket(StringUtils.join(marketSet, ",")); } } } - if (!marketSet.isEmpty()) { - manageApplyEO.setMarket(StringUtils.join(marketSet, ",")); - } } + result.add(manageApplyEO); } } } if (ObjectUtils.isNotEmpty(otaManageApplyEO.getSoftwareIssueTimeStart())) { - otaManageApplyEOList = otaManageApplyEOList.stream() - .filter(e -> StringUtils.isNotBlank(e.getReleaseName()) + 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())) { - otaManageApplyEOList = otaManageApplyEOList.stream().filter(e -> StringUtils.isNotBlank(e.getReleaseName()) + result = result.stream().filter(e -> StringUtils.isNotBlank(e.getReleaseDate()) && (e.getReleaseNameDate().before(otaManageApplyEO.getSoftwareIssueTimeEnd()) || e.getReleaseNameDate().equals(otaManageApplyEO.getSoftwareIssueTimeEnd()))).collect(Collectors.toList()); } - if (!otaManageApplyEOList.isEmpty()) { + if (!result.isEmpty()) { //表头排序 - heartSort(otaManageApplyEO, otaManageApplyEOList); + heartSort(otaManageApplyEO, result); } - return otaManageApplyEOList; + return result; } private void heartSort(OtaManageApplyEO otaManageApplyEO, List otaManageApplyEOList) { @@ -312,14 +315,14 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl { - String e1ReleaseName = StringUtils.isNotBlank(e1.getReleaseName()) ? e1.getReleaseName() : ""; - String e2ReleaseName = StringUtils.isNotBlank(e2.getReleaseName()) ? e2.getReleaseName() : ""; + String e1ReleaseName = StringUtils.isNotBlank(e1.getReleaseDate()) ? e1.getReleaseDate() : ""; + String e2ReleaseName = StringUtils.isNotBlank(e2.getReleaseDate()) ? e2.getReleaseDate() : ""; return comparator.compare(e1ReleaseName, e2ReleaseName); }); } else if (OrderEnum.REVERSE.getValue().equals(otaManageApplyEO.getOrderBy())) { Collections.sort(otaManageApplyEOList, (e1, e2) -> { - String e1ReleaseName = StringUtils.isNotBlank(e1.getReleaseName()) ? e1.getReleaseName() : ""; - String e2ReleaseName = StringUtils.isNotBlank(e2.getReleaseName()) ? e2.getReleaseName() : ""; + String e1ReleaseName = StringUtils.isNotBlank(e1.getReleaseDate()) ? e1.getReleaseDate() : ""; + String e2ReleaseName = StringUtils.isNotBlank(e2.getReleaseDate()) ? e2.getReleaseDate() : ""; return comparator.compare(e2ReleaseName, e1ReleaseName); }); } @@ -765,9 +768,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl getCarList(String cut) { List otaManageApplyEOS = this.getBaseMapper().getOtaCarList(); List result = new LinkedList<>(); - if(CutEnum.CN.getValue().equals(cut)){ + if (CutEnum.CN.getValue().equals(cut)) { result.add("全部"); - }else{ + } else { result.add("All"); } if (!otaManageApplyEOS.isEmpty()) { @@ -777,13 +780,13 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl StringUtils.isNotBlank(e.getAppliedVehicleProject())) .map(OtaManageApplyEO::getAppliedVehicleProject).distinct().collect(Collectors.toList()); //过滤掉特殊的适用车型 - List otaNameList = OtaCarEnum.getOtaNameList(); + List otaNameList = OtaCarEnum.getOtaNameList(); for (String appliedVehicleProject : appliedVehicleProjectList) { for (String s : appliedVehicleProject.split(",")) { String[] split = s.split(" "); if (split.length == 2) { - if(!otaNameList.contains(s)){ + if (!otaNameList.contains(s)) { result.add(s); } } else if (split.length == 3) { @@ -1105,14 +1108,15 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); List omaList = this.getListByIds(idList); for (OtaManageApplyEO oma : omaList) { - if (oma.getMatchStatus().equals(OtaStatusEnum.LOCKED.getKey())) { + if (StringUtils.isNotEmpty(oma.getMatchStatus()) && oma.getMatchStatus().equals(OtaStatusEnum.LOCKED.getKey())) { oma.setMatchStatus(OtaStatusEnum.TO_BE_APPROVED.getKey()); oma.setProjectVersion(projectVersion); @@ -1218,7 +1222,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); List omaList = this.getListByIds(idList); for (OtaManageApplyEO oma : omaList) { - if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) { + if (StringUtils.isNotEmpty(oma.getMatchStatus()) && oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) { oma.setMatchStatus(OtaStatusEnum.LOCKED.getKey()); OtaManageHistory his = new OtaManageHistory(); his.setApplyId(oma.getId()); @@ -1249,13 +1253,13 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl idList = Arrays.asList(ids.split(",")); List omaList = this.getListByIds(idList); for (OtaManageApplyEO oma : omaList) { - if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) { + if (StringUtils.isNotEmpty(oma.getMatchStatus()) && oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) { oma.setMatchStatus(OtaStatusEnum.REJECTED.getKey()); OtaManageHistory his = new OtaManageHistory(); his.setApplyId(oma.getId()); - his.setContentCn(user.getUsername() + " 退回了 VDR:" + oma.getVdr()+" 退回原因:" + rejectReason); - his.setContentEn(user.getUsername() + " returned VDR:"+ oma.getVdr()+ " Reason for return:" + rejectReason); + his.setContentCn(user.getUsername() + " 退回了 VDR:" + oma.getVdr() + " 退回原因:" + rejectReason); + his.setContentEn(user.getUsername() + " returned VDR:" + oma.getVdr() + " Reason for return:" + rejectReason); hisList.add(his); } else { //状态不对 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportCnVO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportCnVO.java index 8595e804e..d0ec8f9af 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportCnVO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportCnVO.java @@ -29,6 +29,6 @@ public class OtaExportCnVO { @Excel(name = "软件发布时间", width = 15) @ApiModelProperty(value = "软件发布时间") - private String releaseName; + private String releaseDate; } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportEnVO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportEnVO.java index b1539b2f5..7b4126151 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportEnVO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/vo/OtaExportEnVO.java @@ -26,6 +26,6 @@ public class OtaExportEnVO { @Excel(name = "Software release time", width = 15) @ApiModelProperty(value = "软件发布时间") - private String releaseName; + private String releaseDate; }