generated from dxfeng/secondev-chapanda-feishu
346 lines
13 KiB
Java
346 lines
13 KiB
Java
package com.engine.recruit.service.impl;
|
|
|
|
import cn.hutool.core.convert.Convert;
|
|
import com.engine.core.impl.Service;
|
|
import com.engine.recruit.enums.ApplicantOperateEnum;
|
|
import com.engine.recruit.enums.ApplicationStatusEnum;
|
|
import com.engine.recruit.service.ApplicantResumeService;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import weaver.conn.RecordSet;
|
|
import weaver.docs.docs.DocCoder;
|
|
import weaver.docs.docs.DocComInfo;
|
|
import weaver.docs.docs.DocImageManager;
|
|
import weaver.docs.docs.DocManager;
|
|
import weaver.file.ImageFileManager;
|
|
import weaver.general.TimeUtil;
|
|
import weaver.general.Util;
|
|
import weaver.hrm.User;
|
|
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;
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Object> updateApplicantsInfo(Map<String, Object> params) {
|
|
Map<String, Object> returnMap = new HashMap<>();
|
|
String operateType = Util.null2String(params.get("operateType"));
|
|
RecordSet rs = new RecordSet();
|
|
if (ApplicantOperateEnum.ELIMINATE.getOperateType().equals(operateType)) {
|
|
String ids = Util.null2String(params.get("ids"));
|
|
rs.executeUpdate("update uf_jcl_yppc set zt = ? where id in (" + ids + ")", ApplicationStatusEnum.OBSOLETE.getValue());
|
|
}
|
|
if (ApplicantOperateEnum.TRANSFER.getOperateType().equals(operateType)) {
|
|
String dqypjd = Util.null2String(params.get("dqypjd"));
|
|
String billid = Util.null2String(params.get("billid"));
|
|
rs.executeUpdate("update uf_jcl_yppc set dqypjd = ? where id = ?", dqypjd, billid);
|
|
}
|
|
return returnMap;
|
|
}
|
|
|
|
@Override
|
|
public Map<String, Object> fullOriginalResumeId(Map<String, Object> params) {
|
|
int imageFileId = Convert.toInt(params.get("imageFileId"));
|
|
int resumeId = Convert.toInt(params.get("resumeId"));
|
|
int secCategory = Convert.toInt(params.get("secCategory"));
|
|
RecordSet rs = new RecordSet();
|
|
try {
|
|
int docId = createDocId(secCategory, imageFileId, user);
|
|
// 更新原始简历信息,设置应聘状态未待分配
|
|
rs.executeUpdate("update uf_jcl_yppc set ysjl=?,zt=? where id = ?", docId, 0, resumeId);
|
|
|
|
} catch (Exception e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
|
|
return new HashMap<>();
|
|
}
|
|
|
|
/**
|
|
* 构建普通数据格式
|
|
*
|
|
* @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;
|
|
|
|
}
|
|
|
|
/**
|
|
* 原始简历imageFieldId生成docId
|
|
*
|
|
* @param secCategory
|
|
* @param imageFieldId
|
|
* @param user
|
|
* @return
|
|
* @throws Exception
|
|
*/
|
|
public int createDocId(int secCategory, int imageFieldId, User user) throws Exception {
|
|
ImageFileManager manager = new ImageFileManager();
|
|
manager.getImageFileInfoById(imageFieldId);
|
|
String filenameqc = manager.getImageFileName();
|
|
String filenamebc = filenameqc.substring(0, filenameqc.lastIndexOf("."));
|
|
RecordSet rs = new RecordSet();
|
|
DocManager dm = new DocManager();
|
|
DocImageManager imgManger = new DocImageManager();
|
|
|
|
imgManger.setDocfiletype("2");
|
|
|
|
int docId = dm.getNextDocId(rs);
|
|
imgManger.setDocid(docId);
|
|
imgManger.setImagefileid(imageFieldId);
|
|
imgManger.setImagefilename(filenameqc);
|
|
imgManger.setIsextfile("1");
|
|
imgManger.AddDocImageInfo();
|
|
|
|
String date = TimeUtil.getCurrentDateString();
|
|
String time = TimeUtil.getOnlyCurrentTimeString();
|
|
dm.setId(docId);
|
|
dm.setMaincategory(0);
|
|
dm.setSubcategory(0);
|
|
dm.setSeccategory(secCategory);
|
|
dm.setLanguageid(user.getLanguage());
|
|
|
|
dm.setDocstatus("1");
|
|
dm.setDocsubject(filenamebc);
|
|
dm.setDoccreaterid(user.getUID());
|
|
dm.setDocCreaterType(user.getLogintype());
|
|
dm.setUsertype(user.getLogintype());
|
|
dm.setOwnerid(user.getUID());
|
|
dm.setOwnerType(user.getLogintype());
|
|
dm.setDoclastmoduserid(user.getUID());
|
|
dm.setDocLastModUserType(user.getLogintype());
|
|
dm.setDoccreatedate(date);
|
|
dm.setDoclastmoddate(date);
|
|
dm.setDoccreatetime(time);
|
|
dm.setDoclastmodtime(time);
|
|
dm.setDoclangurage(user.getLanguage());
|
|
dm.setKeyword(filenameqc);
|
|
dm.setIsapprover("0");
|
|
dm.setIsreply("");
|
|
dm.setDocdepartmentid(user.getUserDepartment());
|
|
dm.setDocreplyable("1");
|
|
dm.setAccessorycount(1);
|
|
dm.setParentids("" + docId);
|
|
dm.setUserid(user.getUID());
|
|
DocCoder docCoder = new DocCoder();
|
|
dm.setDocCode(docCoder.getDocCoder("" + secCategory));
|
|
dm.setDocEditionId(dm.getNextEditionId(rs));
|
|
dm.setDocEdition(1);
|
|
dm.AddDocInfo();
|
|
dm.AddShareInfo();
|
|
DocComInfo dc = new DocComInfo();
|
|
dc.addDocInfoCache("" + docId);
|
|
return docId;
|
|
}
|
|
}
|