Merge remote-tracking branch 'origin/dev_20230808_OTA' into dev_20230808_OTA

This commit is contained in:
zyx.net
2023-08-24 15:25:01 +08:00
4 changed files with 63 additions and 6 deletions
@@ -57,6 +57,18 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return Result.OK(pages);
}
@AutoLog(value = "全车型列表-分页列表查询")
@ApiOperation(value="全车型列表-分页列表查询", notes="全车型列表-分页列表查询")
@GetMapping(value = "/getAllCarPage")
public Result<?> getAllCarPage(OtaManageApplyEO otaManageApplyEO,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
List<OtaManageApplyEO> list = otaManageApplyEOService.getAllCarPage(otaManageApplyEO);
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return Result.OK(pages);
}
/**
* 分车型列表-分页列表查询
*
@@ -81,7 +81,7 @@
and omr.impact_eu_homo LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.impactHomo}),'%'))
</if>
<if test="otaManageApplyEO.appliedVehicleProject != null and otaManageApplyEO.appliedVehicleProject != ''">
and omr.vehicle_type LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.appliedVehicleProject}),'%')
and omr.applied_vehicle_project LIKE CONCAT(CONCAT('%',#{otaManageApplyEO.appliedVehicleProject}),'%')
</if>
</where>
order by omr.id desc
@@ -66,12 +66,19 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
List<OtaManageApplyEO> queryList();
/**
* OTA管理列表和全车型列表-分页列表查询
* OTA管理列表
* @param otaManageApplyEO
* @return
*/
List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO);
/**
* 全车型列表-分页列表查询
* @param otaManageApplyEO
* @return
*/
List<OtaManageApplyEO> getAllCarPage(OtaManageApplyEO otaManageApplyEO);
/**
* 分车型列表-分页列表查询
* @param otaManageApplyEO
@@ -1,5 +1,6 @@
package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jero.common.constant.enums.CutEnum;
@@ -189,19 +190,38 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
*/
@Override
public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) {
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
boolean otaManager = isOtaManager();
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
List<OtaManageApplyEO> dataList = new ArrayList<>();
//去跟manager和studio权限
if(otaManager){
dataList = otaManageApplyEOList;
}else{
LambdaQueryWrapper<OtaManagePermission> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(OtaManagePermission::getUserId,currentUser.getId());
List<OtaManagePermission> managePermissionList = otaManagePermissionService.list(wrapper);
if(!managePermissionList.isEmpty()){
List<String> applyIdList = managePermissionList.stream().map(OtaManagePermission::getApplyId).distinct().collect(Collectors.toList());
List<OtaManageApplyEO> collect = otaManageApplyEOList.stream().filter(e -> applyIdList.contains(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
dataList = collect;
}
}
List<OtaManageApplyEO> result = new ArrayList<>();
if (!otaManageApplyEOList.isEmpty()) {
if (!dataList.isEmpty()) {
List<String> otaNameList = OtaCarEnum.getOtaNameList();
List<String> plannedBpLaunchBatchList = otaManageApplyEOList.stream()
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 = otaManageApplyEOList.stream()
List<OtaManageApplyEO> otaManageApplyEOS = dataList.stream()
.filter(e -> plannedBpLaunchBatch.equals(e.getPlannedBpLaunchBatch())).collect(Collectors.toList());
if(!otaManageApplyEOS.isEmpty()){
//发布时间
@@ -260,6 +280,24 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
return result;
}
/**
* OTA管理列表和全车型列表-分页列表查询
*
* @param otaManageApplyEO
* @return
*/
@Override
public List<OtaManageApplyEO> getAllCarPage(OtaManageApplyEO otaManageApplyEO) {
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
if (!otaManageApplyEOList.isEmpty()) {
for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) {
manageApplyEO.setVdr(manageApplyEO.getId());
}
//表头排序
heartSort(otaManageApplyEO, otaManageApplyEOList);
}
return otaManageApplyEOList;
}
private void heartSort(OtaManageApplyEO otaManageApplyEO, List<OtaManageApplyEO> otaManageApplyEOList) {
Collator comparator = Collator.getInstance(Locale.CHINESE);
@@ -596,7 +634,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
List<OtaManageApplyEO> list = new ArrayList<>();
String carMarket = otaManageApplyEO.getAppliedVehicleProject();
if (StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !otaManageApplyEOList.isEmpty()) {
if (StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !"All".equals(carMarket) && !otaManageApplyEOList.isEmpty()) {
String[] conditionSplit = carMarket.split(" ");