项目版本下拉选
This commit is contained in:
+8
@@ -149,4 +149,12 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
@AutoLog(value = "项目版本下拉数据")
|
||||
@ApiOperation(value="项目版本下拉数据", notes="项目版本下拉数据")
|
||||
@GetMapping(value = "/getProjectVersionList")
|
||||
public Result<?> getProjectVersionList(String carMarket) {
|
||||
List<VersionVO> result = otaManageApplyEOService.getProjectVersionList(carMarket);
|
||||
return Result.OK(result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.jero.modules.ota.vo.VersionVO;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
@@ -162,6 +164,10 @@ public class OtaManageApplyEO implements Serializable {
|
||||
@ApiModelProperty(value = "认证批准")
|
||||
private Date attestationEndTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "项目版本下拉选项")
|
||||
private List<VersionVO> versionVOList;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+3
-2
@@ -24,11 +24,10 @@ public interface OtaManageApplyEOMapper extends BaseMapper<OtaManageApplyEO> {
|
||||
|
||||
/**
|
||||
* 分车型列表-分页列表查询
|
||||
* @param page
|
||||
* @param otaManageApplyEO
|
||||
* @return
|
||||
*/
|
||||
Page<OtaManageApplyEO> getOtaCarPage(Page<OtaManageApplyEO> page, @Param("otaManageApplyEO") OtaManageApplyEO otaManageApplyEO);
|
||||
List<OtaManageApplyEO> getOtaCarPage(@Param("otaManageApplyEO") OtaManageApplyEO otaManageApplyEO);
|
||||
|
||||
List<VersionVO> getByAppliedVehicleProject(@Param("appliedVehicleProject") String appliedVehicleProject);
|
||||
|
||||
@@ -36,4 +35,6 @@ public interface OtaManageApplyEOMapper extends BaseMapper<OtaManageApplyEO> {
|
||||
|
||||
List<OtaManageReceiveNsdpEO> getReleaseDate(@Param("plannedBpLaunchBatchList") List<String> plannedBpLaunchBatchList);
|
||||
|
||||
List<VersionVO> getProjectVersion(@Param("car") String car, @Param("market") String market);
|
||||
|
||||
}
|
||||
|
||||
+15
-2
@@ -73,9 +73,9 @@
|
||||
<!-- </select>-->
|
||||
<select id="getOtaCarPage" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
|
||||
select omr.*,
|
||||
oma.project_version,oma.attestation_schedule.oma.match_status,oma.remark,
|
||||
oma.project_version,oma.attestation_schedule,oma.match_status,oma.remark
|
||||
from ota_manage_receive omr
|
||||
left join ota_manage_apply oma on oma.issue_key = omr.issue_key
|
||||
left join ota_manage_apply oma on oma.issue_key = omr.id
|
||||
<where>
|
||||
1=1
|
||||
<if test="otaManageApplyEO.issueKey != null and otaManageApplyEO.issueKey != ''">
|
||||
@@ -109,4 +109,17 @@
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getProjectVersion" resultType="com.jero.modules.ota.vo.VersionVO">
|
||||
SELECT
|
||||
plb.id projectId,plb.target_market market,plb.studio_engineer studio,plb.project_version versionNumber,
|
||||
pni.project_name car,
|
||||
pyni.year_name yearName from project_library_base plb
|
||||
join project_name_info pni on pni.id = plb.project_name_id
|
||||
join project_year_name_info pyni on pyni.project_name_id = pni.id
|
||||
where plb.target_market =#{market}
|
||||
and pni.project_name =#{car}
|
||||
GROUP BY plb.id
|
||||
ORDER BY project_version asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+7
@@ -91,4 +91,11 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
|
||||
* @return
|
||||
*/
|
||||
List<String> getCarList();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param carMarket
|
||||
* @return
|
||||
*/
|
||||
List<VersionVO> getProjectVersionList(String carMarket);
|
||||
}
|
||||
|
||||
+45
-14
@@ -199,23 +199,38 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
*/
|
||||
@Override
|
||||
public IPage<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO, Integer pageNo, Integer pageSize) {
|
||||
Page<OtaManageApplyEO> page = new Page<OtaManageApplyEO>(pageNo, pageSize);
|
||||
Page<OtaManageApplyEO> otaCarPage = otaManageApplyEOMapper.getOtaCarPage(page, otaManageApplyEO);
|
||||
List<OtaManageApplyEO> records = otaCarPage.getRecords();
|
||||
if(!records.isEmpty()){
|
||||
List<String> appliedVehicleProjectList = records.stream().filter(e-> StringUtils.isNotBlank(e.getAppliedVehicleProject()))
|
||||
.map(OtaManageApplyEO::getAppliedVehicleProject).distinct()
|
||||
.collect(Collectors.toList());
|
||||
List<OtaManageApplyEO> otaManageApplyEOList = otaManageApplyEOMapper.getOtaCarPage(otaManageApplyEO);
|
||||
List<OtaManageApplyEO> list = new ArrayList<>();
|
||||
String carMarket = otaManageApplyEO.getAppliedVehicleProject();
|
||||
if(StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !otaManageApplyEOList.isEmpty()){
|
||||
|
||||
List<String> list = new ArrayList<>();
|
||||
for (String appliedVehicleProject : appliedVehicleProjectList) {
|
||||
list.addAll(Arrays.asList(appliedVehicleProject.split(",")));
|
||||
String[] conditionSplit = carMarket.split(" ");
|
||||
|
||||
for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) {
|
||||
String appliedVehicleProject = manageApplyEO.getAppliedVehicleProject();
|
||||
if(StringUtils.isNotBlank(appliedVehicleProject)){
|
||||
String[] appliedVehicleProjectArr = appliedVehicleProject.split(",");
|
||||
for (String appliedVehicleProjectTemp : appliedVehicleProjectArr) {
|
||||
String[] split = appliedVehicleProjectTemp.split(" ");
|
||||
if(split.length == 1){
|
||||
list.add(manageApplyEO);
|
||||
}else if(split.length == 2){
|
||||
if(Arrays.equals(conditionSplit, split)){
|
||||
list.add(manageApplyEO);
|
||||
}
|
||||
}else if(split.length == 3){
|
||||
List<String> listTemp = Arrays.asList(split);
|
||||
List<String> conditionList = Arrays.asList(conditionSplit);
|
||||
if(listTemp.containsAll(conditionList)){
|
||||
list.add(manageApplyEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
Page pages = PageUtil.getPages(pageNo, pageSize, list);
|
||||
return pages;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -298,4 +313,20 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
result = result.stream().distinct().collect(Collectors.toList());
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<VersionVO> getProjectVersionList(String carMarket) {
|
||||
List<VersionVO> versionVOList = new LinkedList<>();
|
||||
if(StringUtils.isNotBlank(carMarket)){
|
||||
//根据适用车型查询项目版本
|
||||
String[] conditionSplit = carMarket.split(" ");
|
||||
String car = conditionSplit[0];
|
||||
String market = conditionSplit[1];
|
||||
versionVOList = otaManageApplyEOMapper.getProjectVersion(car, market);
|
||||
for (VersionVO versionVO : versionVOList) {
|
||||
versionVO.setVersionName(versionVO.getCar() + "-" + versionVO.getYearName() + "-" + versionVO.getMarket() + "-" +versionVO.getVersionNumber());
|
||||
}
|
||||
}
|
||||
return versionVOList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.jero.modules.ota.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -9,10 +10,11 @@ import java.util.Date;
|
||||
* @date 2023/8/9 11:28
|
||||
* @auth zhn
|
||||
*/
|
||||
@Data
|
||||
public class VersionVO {
|
||||
|
||||
@ApiModelProperty(value = "版本")
|
||||
private String version;
|
||||
@ApiModelProperty(value = "项目id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty(value = "认证开始")
|
||||
private Date attestationStartTime;
|
||||
@@ -22,4 +24,24 @@ public class VersionVO {
|
||||
|
||||
@ApiModelProperty(value = "认证批准")
|
||||
private Date attestationEndTime;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "车型")
|
||||
private String car;
|
||||
|
||||
@ApiModelProperty(value = "年款")
|
||||
private String yearName;
|
||||
|
||||
@ApiModelProperty(value = "市场")
|
||||
private String market;
|
||||
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private String versionNumber;
|
||||
|
||||
@ApiModelProperty(value = "studio")
|
||||
private String studio;
|
||||
|
||||
@ApiModelProperty(value = "项目版本名称")
|
||||
private String versionName;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user