From 5cb8aa8a750be09d30262cb78a05aa762e63e560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=B5=A9?= Date: Mon, 21 Aug 2023 19:03:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9OTA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OtaManageApplyEOController.java | 3 +- .../modules/ota/entity/OtaManageReceive.java | 7 +++ .../ota/mapper/OtaManageApplyEOMapper.java | 3 - .../ota/mapper/OtaManageReceiveMapper.java | 1 + .../ota/mapper/xml/OtaManageApplyEOMapper.xml | 8 +-- .../ota/mapper/xml/OtaManageReceiveMapper.xml | 8 +++ .../ota/service/IOtaManageApplyEOService.java | 3 +- .../ota/service/IOtaManageReceiveService.java | 3 + .../impl/OtaManageApplyEOServiceImpl.java | 59 ++++++------------- .../impl/OtaManageReceiveServiceImpl.java | 5 ++ 10 files changed, 46 insertions(+), 54 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java index 5e9864cb0..2e90891c9 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/controller/OtaManageApplyEOController.java @@ -9,6 +9,7 @@ import com.jero.common.aspect.annotation.AutoLog; import com.jero.common.system.base.controller.JeroController; import com.jero.common.util.PageUtil; import com.jero.modules.ota.entity.OtaManageApplyEO; +import com.jero.modules.ota.entity.OtaManageReceive; import com.jero.modules.ota.service.IOtaManageApplyEOService; import com.jero.modules.ota.vo.VersionVO; import io.swagger.annotations.Api; @@ -271,7 +272,7 @@ public class OtaManageApplyEOController extends JeroController getVdrListByProject(String projectId, String cut) { - List resList = otaManageApplyEOService.getVdrListByProject(projectId, cut); + List resList = otaManageApplyEOService.getVdrListByProject(projectId, cut); return Result.OK("操作成功!", resList); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceive.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceive.java index f3226595a..87712f25e 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceive.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/entity/OtaManageReceive.java @@ -111,4 +111,11 @@ public class OtaManageReceive implements Serializable { @ApiModelProperty(value = "适用车型") private String appliedVehicleProject; + /**发布时间*/ + @Excel(name = "发布时间", width = 15) + @ApiModelProperty(value = "发布时间") + private String releaseDate; + + + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageApplyEOMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageApplyEOMapper.java index 82086c564..0fa2821d2 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageApplyEOMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageApplyEOMapper.java @@ -29,9 +29,6 @@ public interface OtaManageApplyEOMapper extends BaseMapper { */ List getOtaCarPage(@Param("otaManageApplyEO") OtaManageApplyEO otaManageApplyEO); - List getReceiveByVdr(@Param("vdrList") List vdrList); - - List getByAppliedVehicleProject(@Param("appliedVehicleProject") String appliedVehicleProject); List getOtaCarList(); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageReceiveMapper.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageReceiveMapper.java index d3ef85bfd..0e0cc0753 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageReceiveMapper.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/mapper/OtaManageReceiveMapper.java @@ -13,5 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; * @Version: V1.0 */ public interface OtaManageReceiveMapper extends BaseMapper { + List getReceiveByVdr(@Param("vdrList") List vdrList); } 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 afccc9060..073f00ed5 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 @@ -43,13 +43,7 @@ order by create_time desc - + + select * from ota_manage_receive + where id in + + #{item} + + \ No newline at end of file diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java index 796a894fb..b4293d068 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageApplyEOService.java @@ -2,6 +2,7 @@ package com.jero.modules.ota.service; import com.baomidou.mybatisplus.extension.service.IService; import com.jero.modules.ota.entity.OtaManageApplyEO; +import com.jero.modules.ota.entity.OtaManageReceive; import com.jero.modules.ota.vo.VersionVO; import org.springframework.web.servlet.ModelAndView; @@ -117,7 +118,7 @@ public interface IOtaManageApplyEOService extends IService { List reject(String ids, String rejectReason,String cut); - List getVdrListByProject(String projectId, String cut); + List getVdrListByProject(String projectId, String cut); List getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut); diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageReceiveService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageReceiveService.java index 414355008..9fb151488 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageReceiveService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/IOtaManageReceiveService.java @@ -1,5 +1,6 @@ package com.jero.modules.ota.service; +import com.jero.modules.ota.entity.OtaManageApplyEO; import com.jero.modules.ota.entity.OtaManageReceive; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; @@ -58,4 +59,6 @@ public interface IOtaManageReceiveService extends IService { * @return */ List queryList(); + + List getReceiveByVdr(List vdrList); } 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 760d10633..78fddfe82 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 @@ -9,8 +9,10 @@ import com.jero.common.system.vo.LoginUser; import com.jero.common.util.DateUtils; import com.jero.common.util.PageUtil; import com.jero.common.util.oConvertUtils; +import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO; import com.jero.modules.dummy.enums.OrderEnum; import com.jero.modules.ota.entity.OtaManageApplyEO; +import com.jero.modules.ota.entity.OtaManageReceive; import com.jero.modules.ota.entity.OtaManageReceiveNsdpEO; import com.jero.modules.ota.enums.OtaCarEnum; import com.jero.modules.ota.enums.OtaHomoImpactEnum; @@ -18,6 +20,7 @@ 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.IOtaManageReceiveService; import com.jero.modules.ota.vo.AllCarExportVO; import com.jero.modules.ota.vo.OneCarExportVO; import com.jero.modules.ota.vo.OtaExportVO; @@ -52,19 +55,7 @@ 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; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.UUID; +import java.util.*; import java.util.stream.Collectors; /** @@ -92,6 +83,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl getVdrListByProject(String projectId, String cut) { - List res = new ArrayList<>(); + public List getVdrListByProject(String projectId, String cut) { + List resList = new ArrayList<>(); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.lambda().eq(OtaManageApplyEO::getProjectVersion, projectId); List otaManageApplyEOS = this.list(queryWrapper); + //查找已维护项目的数据,根据VDR去重 List vdrList = otaManageApplyEOS.stream() .filter(e -> StringUtils.isNotBlank(e.getVdr())) .map(OtaManageApplyEO::getVdr).distinct().collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(vdrList)) { - res = otaManageApplyEOMapper.getReceiveByVdr(vdrList); - List plannedBpLaunchBatchList = res.stream() - .filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch())) - .map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList()); - List manageReceiveNsdpEOList = otaManageApplyEOMapper.getReleaseDate(plannedBpLaunchBatchList); - for (OtaManageApplyEO manageApplyEO : res) { - 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("-", ""))); - } - 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); - } - } + resList = otaManageReceiveService.getReceiveByVdr(vdrList).stream() + .collect(Collectors.collectingAndThen(Collectors + .toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPlannedBpLaunchBatch()))), ArrayList::new)); + for (OtaManageReceive rec : resList) { + rec.setAppliedVehicleProject("全部"); } } - - return res; + return resList; } @Override diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageReceiveServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageReceiveServiceImpl.java index b26af5976..3460e8ef2 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageReceiveServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/ota/service/impl/OtaManageReceiveServiceImpl.java @@ -86,4 +86,9 @@ public class OtaManageReceiveServiceImpl extends ServiceImpl queryList() { return list(); } + + @Override + public List getReceiveByVdr(List vdrList) { + return this.getBaseMapper().getReceiveByVdr(vdrList); + } }