Commit f401c154 authored by 赵灿灿's avatar 赵灿灿

增加外部专家接口

parent 4c9fd737
Pipeline #22453 passed with stages
in 3 minutes and 25 seconds
...@@ -57,6 +57,8 @@ public class MvcInterceptConfiguration implements WebMvcConfigurer { ...@@ -57,6 +57,8 @@ public class MvcInterceptConfiguration implements WebMvcConfigurer {
adminInterceptor.excludePathPatterns("/oa/sync-organization"); adminInterceptor.excludePathPatterns("/oa/sync-organization");
// 智能体请求不拦截 // 智能体请求不拦截
adminInterceptor.excludePathPatterns("/expertApi/selectExpertInformation"); adminInterceptor.excludePathPatterns("/expertApi/selectExpertInformation");
// 智能体请求不拦截
adminInterceptor.excludePathPatterns("/expertApi/selectExternalExpertInformation");
} }
@Bean @Bean
......
...@@ -31,6 +31,16 @@ public class expertController { ...@@ -31,6 +31,16 @@ public class expertController {
return Result.successData(map); return Result.successData(map);
} }
/**
* 根据条件查询列表
**/
@PostMapping("selectExternalExpertInformation")
public Result selectExternalExpertInformation(@RequestBody ExpertInformationCriteria criteria) {
criteria.removeMapNullOrEmpty();
Map<String, Object> map = service.selectExternalExpertInformation(criteria);
return Result.successData(map);
}
......
...@@ -641,4 +641,23 @@ public class ExpertInformationCriteria extends AbstractCriteria { ...@@ -641,4 +641,23 @@ public class ExpertInformationCriteria extends AbstractCriteria {
} }
//endregion //endregion
//region 专家类型
public boolean byExpertType() {
return this.andMap.containsKey("ExpertType");
}
private String expertType;
public String getExpertType() {
if (byExpertType())
return expertType;
return null;
}
public void setExpertType(String value) {
this.expertType = value;
this.andMap.put("ExpertType", value);
}
//endregion
} }
\ No newline at end of file
...@@ -87,10 +87,49 @@ public class ExpertInformationService { ...@@ -87,10 +87,49 @@ public class ExpertInformationService {
public Map<String, Object> selectExpertInformation( ExpertInformationCriteria criteria) { public Map<String, Object> selectExpertInformation( ExpertInformationCriteria criteria) {
try { try {
criteria.removeMapNullOrEmpty(); criteria.removeMapNullOrEmpty();
Map<String, Object> map = new HashMap<>();
if(StringUtils.isEmpty(criteria.getExpertType()))
{
if(criteria.getPageSize()==null||criteria.getPageSize()==0)
criteria.setPageSize(10);
List<Map<String,Object>> entityList = repository.selectExpertByPage(criteria,1,criteria.getPageSize());
map.put("entityList", entityList);
return map;
}else {
//内部专家
if("a".equals(criteria.getExpertType())) {
if(criteria.getPageSize()==null||criteria.getPageSize()==0) if(criteria.getPageSize()==null||criteria.getPageSize()==0)
criteria.setPageSize(10); criteria.setPageSize(10);
List<Map<String,Object>> entityList = repository.selectExpertByPage(criteria,1,criteria.getPageSize()); List<Map<String,Object>> entityList = repository.selectExpertByPage(criteria,1,criteria.getPageSize());
map.put("entityList", entityList);
return map;
}
//外部专家
if("b".equals(criteria.getExpertType())) {
if(criteria.getPageSize()==null||criteria.getPageSize()==0)
criteria.setPageSize(10);
List<Map<String,Object>> entityList = repository.selectExpertOutByPage(criteria,1,criteria.getPageSize());
map.put("entityList", entityList);
return map;
}
}
return map;
} catch (Exception e) {
LogHelper.info(e.getMessage());
throw new ValidationException("根据条件查询 专家信息表 列表 数据 失败。");
}
}
/**
* 根据条件查询列表
**/
public Map<String, Object> selectExternalExpertInformation( ExpertInformationCriteria criteria) {
try {
criteria.removeMapNullOrEmpty();
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if(criteria.getPageSize()==null||criteria.getPageSize()==0)
criteria.setPageSize(10);
List<Map<String,Object>> entityList = repository.selectExpertOutByPage(criteria,1,criteria.getPageSize());
map.put("entityList", entityList); map.put("entityList", entityList);
return map; return map;
} catch (Exception e) { } catch (Exception e) {
......
...@@ -74,6 +74,12 @@ public interface IExpertInformationRepository { ...@@ -74,6 +74,12 @@ public interface IExpertInformationRepository {
* @param: [criteria, pageNum, pageSize] * @param: [criteria, pageNum, pageSize]
*/ */
List<Map<String,Object>> selectExpertByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize); List<Map<String,Object>> selectExpertByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize);
/**
* 根据查询条件分页查询对象结合
* @param: [criteria, pageNum, pageSize]
*/
List<Map<String,Object>> selectExpertOutByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize);
/** /**
* 根据条件查询对象总记录数 * 根据条件查询对象总记录数
* @param: [criteria] * @param: [criteria]
......
...@@ -271,6 +271,54 @@ public class ExpertInformationRepository implements IExpertInformationRepository ...@@ -271,6 +271,54 @@ public class ExpertInformationRepository implements IExpertInformationRepository
} }
} }
/**
* 根据查询条件分页查询对象结合
*/
@Override
public List<Map<String,Object>> selectExpertOutByPage(ExpertInformationCriteria criteria, int pageNum, int pageSize) {
StringBuffer buffer = new StringBuffer("select eei_id 专家id,\n" +
"eei_name 专家姓名,\n" +
"eei_nation 专家民族,\n" +
"eei_level 专家职称,\n" +
"eei_political_outlook 政治面貌,\n" +
"eei_education 学历,\n" +
"eei_academic_degree 学位,\n" +
"eei_graduation_school 毕业院校,\n" +
"eei_major 所学专业,\n" +
"eei_graduation_time 毕业时间,\n" +
"eei_work_unit 工作单位,\n" +
"eei_post 职务,\n" +
"eei_title 职称高等级证书,\n" +
"eei_work_profession 从事专业,\n" +
"eei_professional_years 专业年限,\n" +
"eei_id_number 身份证号,\n" +
"eei_declaration_major 申报专业,\n" +
"eei_postal_address 通讯地址,\n" +
"eei_mailbox 专家邮箱,\n" +
"eei_telephone 专家电话,\n" +
"eei_work_experience 工作履历,\n" +
"eei_main_academic 主要学术或管理成就,\n" +
"eei_opinions 推荐单位意见,\n" +
"eei_recommended_units 推荐单位,\n" +
"eei_expert_unit_price 专家单价,\n" +
"eei_coverage_area 服务覆盖区域,\n" +
"eei_grade 专家等级,\n" +
"eei_achieve_professional 专业水平,MERGED_NAMES 支撑能力 from T_EXTERNAL_EXPERT_INFO left join (\n" +
"select ec_eei_id, LISTAGG(nameCl, ',') WITHIN GROUP (ORDER BY nameCl) AS merged_names from(\n" +
"select ec_eei_id,eei_one_classification ||'-'|| eei_two_classification \n" +
"||'-'|| eei_three_classification ||'-'|| eei_four_classification nameCl\n" +
"from T_EXPERT_CLASSIFICATION)\n" +
"group by ec_eei_id) on eei_id=ec_eei_id");
List<Object> list = OracleUtils.combinationSql(buffer, createCriteriaOutSql(criteria), pageNum, pageSize,"EI_ID");
try {
return jdbcTemplate.queryForList(buffer.toString(), list.toArray());
} catch (Exception e) {
LogHelper.info(e.getMessage());
return null;
}
}
/** /**
* 根据条件查询对象总记录数 * 根据条件查询对象总记录数
*/ */
...@@ -403,7 +451,7 @@ public class ExpertInformationRepository implements IExpertInformationRepository ...@@ -403,7 +451,7 @@ public class ExpertInformationRepository implements IExpertInformationRepository
andMap.put(criteria.getExpertIntroduction() == null ? " EI_EXPERT_INTRODUCTION IS NULL " : " EI_EXPERT_INTRODUCTION = ? ", criteria.getExpertIntroduction()); andMap.put(criteria.getExpertIntroduction() == null ? " EI_EXPERT_INTRODUCTION IS NULL " : " EI_EXPERT_INTRODUCTION = ? ", criteria.getExpertIntroduction());
//专家简介(LIKE) //专家简介(LIKE)
if (criteria.byExpertIntroductionContain()) if (criteria.byExpertIntroductionContain())
andMap.put(" EI_EXPERT_INTRODUCTION LIKE ? ", "%" + criteria.getExpertIntroductionContain() + "%"); andMap.put(" EI_EXPERT_INTRODUCTION||EI_SPECIALIZES_FIELDS LIKE ? ", "%" + criteria.getExpertIntroductionContain() + "%");
//所属OA组织编码 //所属OA组织编码
if (criteria.byOrganizationalCode()) if (criteria.byOrganizationalCode())
andMap.put(criteria.getOrganizationalCode() == null ? " EI_ORGANIZATIONAL_CODE IS NULL " : " EI_ORGANIZATIONAL_CODE = ? ", criteria.getOrganizationalCode()); andMap.put(criteria.getOrganizationalCode() == null ? " EI_ORGANIZATIONAL_CODE IS NULL " : " EI_ORGANIZATIONAL_CODE = ? ", criteria.getOrganizationalCode());
...@@ -428,4 +476,53 @@ public class ExpertInformationRepository implements IExpertInformationRepository ...@@ -428,4 +476,53 @@ public class ExpertInformationRepository implements IExpertInformationRepository
return andMap; return andMap;
} }
/**
* 创建查询条件
*/
private Map<String, Object> createCriteriaOutSql(ExpertInformationCriteria criteria) {
Map<String, Object> andMap = new LinkedHashMap<>();
if (criteria == null)
return andMap;
//if (criteria.byId())
// andMap.put(criteria.getId() == null ? " T_Id IS NULL " : " T_Id = ? ", criteria.getId());
//专家姓名
if (criteria.byName())
andMap.put(criteria.getName() == null ? " EEI_NAME IS NULL " : " EEI_NAME = ? ", criteria.getName());
//专家姓名(LIKE)
if (criteria.byNameContain())
andMap.put(" EEI_NAME LIKE ? ", "%" + criteria.getNameContain() + "%");
//专家邮箱
if (criteria.byMailbox())
andMap.put(criteria.getMailbox() == null ? " EEI_MAILBOX IS NULL " : " EEI_MAILBOX = ? ", criteria.getMailbox());
//专家邮箱(LIKE)
if (criteria.byMailboxContain())
andMap.put(" EEI_MAILBOX LIKE ? ", "%" + criteria.getMailboxContain() + "%");
//专家电话
if (criteria.byTelephone())
andMap.put(criteria.getTelephone() == null ? " EEI_TELEPHONE IS NULL " : " EEI_TELEPHONE = ? ", criteria.getTelephone());
//专家电话(LIKE)
if (criteria.byTelephoneContain())
andMap.put(" EEI_TELEPHONE LIKE ? ", "%" + criteria.getTelephoneContain() + "%");
//专家部门
if (criteria.byDepartment())
andMap.put(criteria.getDepartment() == null ? " EEI_WORK_UNIT IS NULL " : " EEI_WORK_UNIT = ? ", criteria.getDepartment());
//专家部门(LIKE)
if (criteria.byDepartmentContain())
andMap.put(" EEI_WORK_UNIT LIKE ? ", "%" + criteria.getDepartmentContain() + "%");
//专家职称
if (criteria.byLevel())
andMap.put(criteria.getLevel() == null ? " EEI_LEVEL IS NULL " : " EEI_LEVEL = ? ", criteria.getLevel());
//专家职称(LIKE)
if (criteria.byLevelContain())
andMap.put(" EEI_LEVEL LIKE ? ", "%" + criteria.getLevelContain() + "%");
//专家简介(LIKE)
if (criteria.byExpertIntroductionContain())
andMap.put(" EEI_MAIN_ACADEMIC||EEI_ACHIEVE_PROFESSIONAL||MERGED_NAMES LIKE ? ", "%" + criteria.getExpertIntroductionContain() + "%");
return andMap;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment