generated from dxfeng/secondev-chapanda-feishu
233 lines
8.3 KiB
Java
233 lines
8.3 KiB
Java
package com.engine.recruit.service.impl;
|
|
|
|
import com.engine.core.impl.Service;
|
|
import com.engine.recruit.service.ApplicantResumeService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import weaver.conn.RecordSet;
|
|
import weaver.general.Util;
|
|
import weaver.hrm.resource.ResourceComInfo;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/**
|
|
* @author:dxfeng
|
|
* @createTime: 2023/09/20
|
|
* @version: 1.0
|
|
*/
|
|
public class ApplicantResumeServiceImpl extends Service implements ApplicantResumeService {
|
|
@Override
|
|
public Map<String, Object> getApplicantsName(String ids) {
|
|
Map<String, Object> returnMap = new HashMap<>(1);
|
|
RecordSet rs = new RecordSet();
|
|
String[] split = ids.split(",");
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
for (String id : split) {
|
|
rs.executeQuery("select xm from uf_jcl_yppc where id = ?", id);
|
|
if (rs.next()) {
|
|
Map<String, Object> rowMap = new HashMap<>();
|
|
rowMap.put("id", id);
|
|
rowMap.put("name", rs.getString("xm"));
|
|
list.add(rowMap);
|
|
}
|
|
}
|
|
returnMap.put("rows", list);
|
|
return returnMap;
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Object> getInterviewInfoById(String id) {
|
|
Map<String, Object> returnMap = new HashMap<>(16);
|
|
String sql = "select a.ypz,b.xm,a.ypzw,b.tdsj,b.sjhm,b.dzyx,a.msfs,a.mshj ,a.msc,a.msg ,a.ptmsg,a.msrq,a.msdd ,a.msfkr from uf_jcl_ms a inner join uf_jcl_yppc b on a.ypz = b.id where a.id = ?";
|
|
RecordSet rs = new RecordSet();
|
|
rs.executeQuery(sql, id);
|
|
if (rs.next()) {
|
|
// 应聘者
|
|
returnMap.put("ypz", createApplicantBrowserMap(rs.getString("ypz"), rs.getString("xm")));
|
|
// 应聘职位
|
|
returnMap.put("ypzw", createAppliedPositionBrowserMap(rs.getString("ypzw")));
|
|
// 投递时间
|
|
returnMap.put("tdsj", createApplicantBrowserMap(rs.getString("tdsj")));
|
|
// 手机号码
|
|
returnMap.put("sjhm", createApplicantBrowserMap(rs.getString("sjhm")));
|
|
// 电子邮箱
|
|
returnMap.put("dzyx", createApplicantBrowserMap(rs.getString("dzyx")));
|
|
// 面试方式
|
|
returnMap.put("msfs", createApplicantBrowserMap(rs.getString("msfs")));
|
|
// 面试环节
|
|
returnMap.put("mshj", createApplicantBrowserMap(rs.getString("mshj")));
|
|
// 面试轮次
|
|
returnMap.put("msc", createApplicantBrowserMap(rs.getString("msc")));
|
|
// 面试官
|
|
returnMap.put("msg", createResourceBrowserMap(rs.getString("msg")));
|
|
// 陪同面试官
|
|
returnMap.put("ptmsg", createResourceBrowserMap(rs.getString("ptmsg")));
|
|
// 面试日期
|
|
returnMap.put("msrq", createApplicantBrowserMap(rs.getString("msrq")));
|
|
// 面试地址
|
|
returnMap.put("msdd", createApplicantBrowserMap(rs.getString("msdd")));
|
|
}
|
|
return returnMap;
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Object> getDisplayLayoutId(Map<String, Object> params) {
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
String layoutId = Util.null2String(params.get("layoutid"));
|
|
String modeId = Util.null2String(params.get("modeId"));
|
|
returnMap.put("layoutId", layoutId);
|
|
RecordSet rs = new RecordSet();
|
|
rs.executeQuery("select layoutname from modehtmllayout where modeid = ? and id = ?", modeId, layoutId);
|
|
if (rs.next()) {
|
|
String layoutName = rs.getString("layoutname");
|
|
// 获取相同名称的显示布局ID
|
|
rs.executeQuery("select id from modehtmllayout where type = 0 and modeid = ? and layoutname =?", modeId, layoutName);
|
|
if (rs.next()) {
|
|
returnMap.put("layoutId", rs.getString("id"));
|
|
}
|
|
}
|
|
return returnMap;
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Object> getTabCount(Map<String, Object> params) {
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
String billId = Util.null2String(params.get("billid"));
|
|
List<Integer> countList = new ArrayList<>();
|
|
RecordSet rs = new RecordSet();
|
|
// 部门筛选反馈
|
|
rs.executeQuery("select count(id) as num from uf_jcl_bmsxfk where ypz = ?", billId);
|
|
if (rs.next()) {
|
|
countList.add(rs.getInt("num"));
|
|
}
|
|
// 笔试
|
|
rs.executeQuery("select count(id) as num from uf_jcl_bs where ypz = ?", billId);
|
|
if (rs.next()) {
|
|
countList.add(rs.getInt("num"));
|
|
}
|
|
// 面试
|
|
rs.executeQuery("select count(id) as num from uf_jcl_ms where ypz = ?", billId);
|
|
if (rs.next()) {
|
|
countList.add(rs.getInt("num"));
|
|
}
|
|
// 背调
|
|
rs.executeQuery("select count(id) as num from uf_jcl_bd where ypz = ?", billId);
|
|
if (rs.next()) {
|
|
countList.add(rs.getInt("num"));
|
|
}
|
|
// 薪酬谈判
|
|
rs.executeQuery("select count(id) as num from uf_jcl_xctp where ypz = ?", billId);
|
|
if (rs.next()) {
|
|
countList.add(rs.getInt("num"));
|
|
}
|
|
// 历史投递记录
|
|
rs.executeQuery("select xm,sjhm from uf_jcl_yppc where id = ?", billId);
|
|
if (rs.next()) {
|
|
rs.executeQuery("select count(id) as num from uf_jcl_yppc where xm=? and sjhm =?", rs.getString("xm"), rs.getString("sjhm"));
|
|
if (rs.next()) {
|
|
countList.add(rs.getInt("num"));
|
|
}
|
|
}else{
|
|
countList.add(0);
|
|
}
|
|
|
|
|
|
returnMap.put("countList", countList);
|
|
return returnMap;
|
|
}
|
|
|
|
/**
|
|
* 构建普通数据格式
|
|
*
|
|
* @param value
|
|
* @return
|
|
*/
|
|
private Map<String, Object> createApplicantBrowserMap(String value) {
|
|
if (StringUtils.isBlank(value)) {
|
|
return null;
|
|
}
|
|
Map<String, Object> browserMap = new HashMap<>(1);
|
|
browserMap.put("value", value);
|
|
return browserMap;
|
|
}
|
|
|
|
/**
|
|
* 构建应聘者浏览按钮值
|
|
*
|
|
* @param id
|
|
* @param name
|
|
* @return
|
|
*/
|
|
private Map<String, Object> createApplicantBrowserMap(String id, String name) {
|
|
Map<String, Object> browserMap = new HashMap<>(2);
|
|
if (StringUtils.isBlank(id)) {
|
|
return browserMap;
|
|
}
|
|
browserMap.put("value", id);
|
|
List<Map<String, Object>> objList = new ArrayList<>();
|
|
Map<String, Object> obj = new HashMap<>(2);
|
|
obj.put("id", id);
|
|
obj.put("name", name);
|
|
objList.add(obj);
|
|
browserMap.put("specialobj", objList);
|
|
return browserMap;
|
|
}
|
|
|
|
/**
|
|
* 构建应聘职位浏览按钮
|
|
*
|
|
* @param id
|
|
* @return
|
|
*/
|
|
private Map<String, Object> createAppliedPositionBrowserMap(String id) {
|
|
Map<String, Object> browserMap = new HashMap<>(2);
|
|
if (StringUtils.isBlank(id)) {
|
|
return browserMap;
|
|
}
|
|
browserMap.put("value", id);
|
|
RecordSet rs = new RecordSet();
|
|
rs.executeQuery("select zpzwmc from uf_jcl_zp_zpzw where id = ?", id);
|
|
if (rs.next()) {
|
|
List<Map<String, Object>> objList = new ArrayList<>();
|
|
Map<String, Object> obj = new HashMap<>(2);
|
|
obj.put("id", id);
|
|
obj.put("name", rs.getString("zpzwmc"));
|
|
objList.add(obj);
|
|
browserMap.put("specialobj", objList);
|
|
}
|
|
return browserMap;
|
|
}
|
|
|
|
/**
|
|
* 构建人员浏览按钮值
|
|
*
|
|
* @param ids
|
|
* @return
|
|
*/
|
|
private Map<String, Object> createResourceBrowserMap(String ids) {
|
|
Map<String, Object> browserMap = new HashMap<>(2);
|
|
if (StringUtils.isBlank(ids)) {
|
|
return browserMap;
|
|
}
|
|
browserMap.put("value", ids);
|
|
List<Map<String, Object>> objList = new ArrayList<>();
|
|
String[] split = ids.split(",");
|
|
try {
|
|
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
|
for (String s : split) {
|
|
Map<String, Object> obj = new HashMap<>(2);
|
|
obj.put("id", s);
|
|
obj.put("name", resourceComInfo.getLastname(s));
|
|
objList.add(obj);
|
|
}
|
|
} catch (Exception e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
browserMap.put("specialobj", objList);
|
|
return browserMap;
|
|
|
|
}
|
|
}
|