From cef0854af6f3a89055ffa117fbf7223cd8bcc247 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Thu, 19 Oct 2023 14:22:24 +0800 Subject: [PATCH] =?UTF-8?q?OTA=E7=AE=A1=E7=90=86-=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=89=A9=E5=B1=95=E4=BB=BB=E5=8A=A1=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jero-boot/db/蔚来标准sql/dev_third_record.sql | 4 + .../modules/ota/entity/OtaManageApplyEO.java | 4 + .../ota/entity/OtaManageReceiveNsdp.java | 16 ++-- .../jero/modules/ota/job/OtaDataUpdate.java | 22 ++++++ .../impl/OtaManageApplyEOServiceImpl.java | 77 ++----------------- 5 files changed, 45 insertions(+), 78 deletions(-) diff --git a/jero-boot/db/蔚来标准sql/dev_third_record.sql b/jero-boot/db/蔚来标准sql/dev_third_record.sql index 2d7155c58..b7c3cce44 100644 --- a/jero-boot/db/蔚来标准sql/dev_third_record.sql +++ b/jero-boot/db/蔚来标准sql/dev_third_record.sql @@ -1313,6 +1313,10 @@ UPDATE `platform_task_planning` SET `create_by` = NULL, `create_time` = NULL, `u --项目库添加平台件类型字段 2023-10-18 ALTER TABLE `project_library_base` ADD COLUMN `platform_type` varchar(255) NULL COMMENT '平台件类型' AFTER `remark`; +--ota_manage_receive_nsdp添加数量字段 2023-10-18 +ALTER TABLE `ota_manage_receive_nsdp` +ADD COLUMN `extension_item_count` int(10) NULL COMMENT '扩展任务数量' AFTER `created_at`; + 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 31dae5e12..62931d8f9 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 @@ -229,5 +229,9 @@ public class OtaManageApplyEO implements Serializable { @ApiModelProperty(value = "中英文切换") private String cut; + @TableField(exist = false) + @ApiModelProperty(value = "扩展任务数量") + private Integer extensionItemCount; + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceiveNsdp.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceiveNsdp.java index e1b1cb18d..e1a67bb92 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceiveNsdp.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceiveNsdp.java @@ -1,22 +1,19 @@ package com.jero.modules.ota.entity; -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; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import com.jero.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; /** @@ -113,4 +110,7 @@ public class OtaManageReceiveNsdp implements Serializable { @ApiModelProperty(value = "排序") private java.lang.String orderBy; + @ApiModelProperty(value = "扩展任务数量") + private java.lang.Integer extensionItemCount; + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/job/OtaDataUpdate.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/job/OtaDataUpdate.java index 0a9a6cfe4..d3e0e304b 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/job/OtaDataUpdate.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/job/OtaDataUpdate.java @@ -2,10 +2,12 @@ package com.jero.modules.ota.job; import com.jero.modules.ota.entity.OtaManageReceive; import com.jero.modules.ota.entity.OtaManageReceiveNsdp; +import com.jero.modules.ota.enums.OtaHomoImpactEnum; import com.jero.modules.ota.service.IOtaManageReceiveNsdpService; import com.jero.modules.ota.service.IOtaManageReceiveService; import com.jero.modules.system.util.StringUtils; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.ObjectUtils; import org.quartz.Job; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; @@ -247,6 +249,26 @@ public class OtaDataUpdate implements Job { if (CollectionUtils.isNotEmpty(dateUpdateList)) { otaManageReceiveService.updateBatchById(dateUpdateList); } + //扩展任务数量的值为Homo Extension - Paperwork和Homo Extension - Retest的数量和 + List otaManageReceiveList = otaManageReceiveService.queryList(); + List otaManageReceiveNsdpList = otaManageReceiveNsdpService.queryList(); + for (OtaManageReceiveNsdp otaManageReceiveNsdp : otaManageReceiveNsdpList) { + List collect = otaManageReceiveList.stream() + .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()) + && e.getPlannedBpLaunchBatch().equals(otaManageReceiveNsdp.getReleaseName())).collect(Collectors.toList()); + List collect1 = collect.stream() + .filter(e -> OtaHomoImpactEnum.HOMOEX_PAPERWORK.getValue().equals(e.getHomologationImpact()) + || OtaHomoImpactEnum.HOMOEX_RETEST.getValue().equals(e.getHomologationImpact())).collect(Collectors.toList()); + if(ObjectUtils.isNotEmpty(collect1)){ + otaManageReceiveNsdp.setExtensionItemCount(collect1.size()); + }else{ + otaManageReceiveNsdp.setExtensionItemCount(0); + } + } + otaManageReceiveNsdpService.updateBatchById(otaManageReceiveNsdpList); + + + System.out.println("===============================OtaDataUpdate定时任务结束==============================="); } 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 590be3ac0..378f1c07b 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 @@ -219,7 +219,13 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl marketSet = new HashSet<>(); //车型 Set vehicleSet = new HashSet<>(); + int extensionItemCount = 0; for (OtaManageReceiveNsdp omrn : valList) { + if(ObjectUtils.isEmpty(omrn.getExtensionItemCount())){ + extensionItemCount = 0; + }else{ + extensionItemCount = omrn.getExtensionItemCount(); + } //找到最快来临的发布时间 try { if(StringUtils.isNotBlank(omrn.getReleaseDate())){ @@ -275,6 +281,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl result = new ArrayList<>(); -// if (!dataList.isEmpty()) { -// List otaNameList = OtaCarEnum.getOtaNameList(); -// List 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 otaManageApplyEOS = dataList.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(","))); -// } -// if (!carList.isEmpty()) { -// //适用车型 -// carList = carList.stream().distinct().collect(Collectors.toList()); -// manageApplyEO.setAppliedVehicleProject(StringUtils.join(carList, ",")); -// //市场 -// Set 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()) { //表头排序 heartSort(otaManageApplyEO, dataList);