全车型和分车型详情

This commit is contained in:
zhn
2023-08-18 20:33:42 +08:00
parent 77545d2453
commit 18fc09df16
6 changed files with 54 additions and 18 deletions
@@ -161,7 +161,7 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
@ApiOperation(value="分车型详情", notes="分车型详情")
@GetMapping(value = "/getVersionInfo")
public Result<?> getVersionInfo(String vdr) {
List<OtaManageApplyEO> result = otaManageApplyEOService.getVersionInfo(vdr);
List<VersionVO> result = otaManageApplyEOService.getVersionInfo(vdr);
return Result.OK(result);
}
@@ -37,6 +37,6 @@ public interface OtaManageApplyEOMapper extends BaseMapper<OtaManageApplyEO> {
List<VersionVO> getProjectVersion(@Param("car") String car, @Param("market") String market);
List<OtaManageApplyEO> getVersionInfo(@Param("vdr") String vdr);
List<VersionVO> getVersionInfo(@Param("vdr") String vdr);
}
@@ -131,24 +131,25 @@
</select>
<select id="getVersionInfo" resultType="com.jero.modules.ota.vo.VersionVO">
SELECT
plb.id projectId,
plb.parent_id parentId,
plb.target_market market,
plb.project_version versionNumber,
ptp.attestation_start_time,
ptp.attestation_end_time,
ptp.certification_submission,
oma.attestation_schedule,
plb.id projectId,
plb.target_market market,
plb.project_version versionNumber,
oma.project_version,
pni.project_name,
pyni.year_name
FROM
ota_manage_apply oma
LEFT JOIN project_task_planning ptp ON oma.project_version = ptp.project_id
join project_library_base plb on plb.id = ptp.project_id
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
project_library_base plb
LEFT JOIN project_task_planning ptp ON plb.id = ptp.project_id
LEFT JOIN ota_manage_apply oma ON oma.project_version = plb.id
LEFT JOIN project_name_info pni ON pni.id = plb.project_name_id
LEFT JOIN project_year_name_info pyni ON pyni.project_name_id = pni.id
WHERE oma.issue_key = #{vdr}
GROUP BY plb.id
ORDER BY project_version asc
</select>
</mapper>
@@ -104,5 +104,5 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
* @param vdr
* @return
*/
List<OtaManageApplyEO> getVersionInfo(String vdr);
List<VersionVO> getVersionInfo(String vdr);
}
@@ -407,15 +407,41 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
* @return
*/
@Override
public List<OtaManageApplyEO> getVersionInfo(String vdr) {
public List<VersionVO> getVersionInfo(String vdr) {
//认证进度数据字典 certification_progress
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode("certification_progress");
List<VersionVO> versionVOList = otaManageApplyEOMapper.getVersionInfo(vdr);
List<VersionVO> result = new LinkedList<>();
if(!versionVOList.isEmpty()){
List<VersionVO> oneList = versionVOList.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList());
List<VersionVO> twoList = versionVOList.stream().filter(e -> StringUtils.isNotBlank(e.getParentId())).collect(Collectors.toList());
List<OtaManageApplyEO> versionInfoList = otaManageApplyEOMapper.getVersionInfo(vdr);
return new ArrayList<>();
for (VersionVO versionVO : oneList) {
result.add(versionVO);
List<VersionVO> collect = twoList.stream().filter(e -> versionVO.getProjectId().equals(e.getParentId())).collect(Collectors.toList());
Collections.sort(collect, new Comparator<VersionVO>() {
@Override
public int compare(VersionVO o1, VersionVO o2) {
return Integer.valueOf(o1.getVersionNumber()).compareTo(Integer.valueOf(o2.getVersionNumber()));
}
});
result.addAll(collect);
}
for (VersionVO versionVO : result) {
if(StringUtils.isBlank(versionVO.getProjectVersion())){
versionVO.setVersionName(versionVO.getCar() + "-" + versionVO.getMarket());
}else{
versionVO.setVersionName(versionVO.getCar() + "-" + versionVO.getYearName() + "-" + versionVO.getMarket() + "-" +versionVO.getVersionNumber());
}
//认证进度
if(StringUtils.isNotBlank(versionVO.getAttestationSchedule())){
List<SysDictItem> collect = regionDictList.stream()
.filter(e -> e.getItemValue().equals(versionVO.getAttestationSchedule())).collect(Collectors.toList());
versionVO.setAttestationScheduleText(collect.get(0).getItemText());
}
}
}
return result;
}
}
@@ -28,6 +28,12 @@ public class VersionVO {
@ApiModelProperty(value = "认证批准")
private Date attestationEndTime;
@ApiModelProperty(value = "认证进度")
private String attestationSchedule;
@ApiModelProperty(value = "认证进度")
private String attestationScheduleText;
@ApiModelProperty(value = "车型")
private String car;
@@ -47,4 +53,7 @@ public class VersionVO {
@ApiModelProperty(value = "项目版本名称")
private String versionName;
@ApiModelProperty(value = "项目版本-id")
private java.lang.String projectVersion;
}