分车型列表

This commit is contained in:
zhn
2023-08-18 15:31:05 +08:00
parent ad46dbbb38
commit eca7f6002e
2 changed files with 53 additions and 2 deletions
@@ -155,6 +155,10 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "R&H Studio")
private java.lang.String studio;
@TableField(exist = false)
@ApiModelProperty(value = "R&H Studio中文名")
private java.lang.String studioText;
@TableField(exist = false)
@ApiModelProperty(value = "认证开始")
private Date attestationStartTime;
@@ -173,7 +177,7 @@ public class OtaManageApplyEO implements Serializable {
@ApiModelProperty(value = "项目版本-中文")
@TableField(exist = false)
private java.lang.String projectVersionName;
private java.lang.String projectVersionText;
@@ -3,7 +3,7 @@ package com.jero.modules.ota.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hankcs.hanlp.dependency.nnparser.util.Log;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.PageUtil;
import com.jero.modules.ota.entity.OtaManageApplyEO;
import com.jero.modules.ota.entity.OtaManageReceiveNsdpEO;
@@ -11,6 +11,9 @@ import com.jero.modules.ota.enums.OtaCarEnum;
import com.jero.modules.ota.mapper.OtaManageApplyEOMapper;
import com.jero.modules.ota.service.IOtaManageApplyEOService;
import com.jero.modules.ota.vo.VersionVO;
import com.jero.modules.project.entity.ProjectTaskPlanning;
import com.jero.modules.project.service.impl.ProjectTaskPlanningServiceImpl;
import com.jero.modules.system.service.impl.SysBaseApiImpl;
import com.jero.modules.system.util.StringUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -41,6 +44,10 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
@Autowired
private OtaManageApplyEOMapper otaManageApplyEOMapper;
@Autowired
private ProjectTaskPlanningServiceImpl projectTaskPlanningService;
@Autowired
private SysBaseApiImpl sysBaseApi;
/**
* 保存
*
@@ -230,6 +237,46 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
}
}
if(!list.isEmpty()){
//项目版本id
List<String> projectVersionList = list.stream()
.map(OtaManageApplyEO::getProjectVersion).distinct().collect(Collectors.toList());
//studio
List<String> userIdList = list.stream().map(OtaManageApplyEO::getStudio).distinct().collect(Collectors.toList());
List<LoginUser> loginUserList = new ArrayList<>();
if(!userIdList.isEmpty()){
loginUserList = sysBaseApi.queryAllUserByIds(userIdList.toArray(new String[userIdList.size()]));
}
List<ProjectTaskPlanning> projectTaskPlanningList = projectTaskPlanningService.queryList(StringUtils.join(projectVersionList,","));
for (OtaManageApplyEO manageApplyEO : list) {
if(StringUtils.isNotBlank(manageApplyEO.getProjectVersion())){
List<ProjectTaskPlanning> taskPlanningList = projectTaskPlanningList.stream()
.filter(e -> manageApplyEO.getProjectVersion().equals(e.getProjectId())).collect(Collectors.toList());
//设置认证开始,认证批准,认证申报
if(!taskPlanningList.isEmpty()){
Date attestationStartTime = taskPlanningList.get(0).getAttestationStartTime();//认证开始
Date attestationEndTime = taskPlanningList.get(0).getAttestationEndTime();//认证批准
Date certificationSubmission = taskPlanningList.get(0).getCertificationSubmission();//认证申报
manageApplyEO.setAttestationStartTime(attestationStartTime);
manageApplyEO.setAttestationEndTime(attestationEndTime);
manageApplyEO.setCertificationSubmission(certificationSubmission);
}
//设置studio
if(StringUtils.isNotBlank(manageApplyEO.getStudio())){
List<LoginUser> userList = loginUserList.stream()
.filter(e -> manageApplyEO.getStudio().equals(e.getId())).collect(Collectors.toList());
if(!userList.isEmpty()){
manageApplyEO.setStudioText(userList.get(0).getUsername());
}
}
}
}
}
Page pages = PageUtil.getPages(pageNo, pageSize, list);
return pages;
}