添加功能
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.cms.util;
|
||||
|
||||
import com.ruoyi.cms.constant.CommonConstant;
|
||||
import com.ruoyi.cms.domain.dto.QueryParamDto;
|
||||
import com.ruoyi.cms.domain.vo.GraduateEmploymentInfoTreadVo;
|
||||
import com.ruoyi.cms.domain.vo.QueryResultVo;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
@@ -140,13 +141,48 @@ public class ParamUtil {
|
||||
if (CollectionUtils.isEmpty(list) || StringUtils.isBlank(dictName)) {
|
||||
return;
|
||||
}
|
||||
for (QueryResultVo vo : list) {
|
||||
vo.setDesc(fillDictName(vo.getCode(), dictName));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 填充字典名称
|
||||
*
|
||||
* @param list 列表
|
||||
* @param dictName 字典名称
|
||||
*/
|
||||
public static void fillDictNameGraduateEmploymentInfoTread(
|
||||
List<GraduateEmploymentInfoTreadVo> list, String dictName) {
|
||||
|
||||
if (CollectionUtils.isEmpty(list) || StringUtils.isBlank(dictName)) {
|
||||
return;
|
||||
}
|
||||
for (GraduateEmploymentInfoTreadVo vo : list) {
|
||||
vo.setDesc(fillDictName(vo.getCode(), dictName));
|
||||
}
|
||||
}
|
||||
|
||||
private static String fillDictName(String code, String dictName){
|
||||
switch (dictName) {
|
||||
case "industry": {
|
||||
for (QueryResultVo vo : list) {
|
||||
vo.setDesc(Optional.ofNullable(CommonConstant.INDUSTRY_MAP.get(vo.getCode())).orElse("未知"));
|
||||
}
|
||||
break;
|
||||
return Optional.ofNullable(CommonConstant.INDUSTRY_MAP.get(code)).orElse("未知");
|
||||
}
|
||||
case "educationLevel": {
|
||||
return Optional.ofNullable(CommonConstant.EDUCATION_LEVEL_MAP.get(code)).orElse("未知");
|
||||
}
|
||||
case "universityType": {
|
||||
return Optional.ofNullable(CommonConstant.UNIVERSITY_TYPE_MAP.get(code)).orElse("未知");
|
||||
}
|
||||
case "gender": {
|
||||
return Optional.ofNullable(CommonConstant.GENDER_MAP.get(code)).orElse("未知");
|
||||
}
|
||||
case "employmentFlow": {
|
||||
return Optional.ofNullable(CommonConstant.EMPLOYMENT_FLOW_MAP.get(code)).orElse("未知");
|
||||
}
|
||||
case "employmentCrowd": {
|
||||
return Optional.ofNullable(CommonConstant.EMPLOYMENT_CROWD_MAP.get(code)).orElse("未知");
|
||||
}
|
||||
default:
|
||||
throw new ServiceException("字典名称错误");
|
||||
|
||||
Reference in New Issue
Block a user