招聘工作台

This commit is contained in:
Chengliang 2023-10-24 09:49:11 +08:00
parent 4c11e2bff5
commit 0ad32f4218
4 changed files with 157 additions and 0 deletions

View File

@ -72,4 +72,14 @@ public class WorkBenchPortalController {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, OptionVO>(user).run(getWorkBenchPortal(user) :: getPeopleFrom);
}
@GET
@Path("/recruitProgress")
@Produces(MediaType.APPLICATION_JSON)
public String getRecruitProgress(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, List<RecruitPortalCommonVO>>(user).run(getWorkBenchPortal(user) :: getRecruitProgress);
}
}

View File

@ -26,5 +26,9 @@ public class RecruitPortalCommonVO {
private String icon;
private String color;
private Double scale;
}

View File

@ -58,4 +58,15 @@ public interface WorkBenchPortalService {
* @return: com.engine.recruit.entity.workbench.OptionVO
*/
OptionVO getPeopleFrom();
/**
* @Description: 招聘进度
* @Author: liang.cheng
* @Date: 2023/10/23 11:07 AM
* @param: []
* @return:
*/
List<RecruitPortalCommonVO> getRecruitProgress();
}

View File

@ -147,6 +147,138 @@ public class WorkBenchPortalServiceImpl extends Service implements com.engine.re
.build();
}
@Override
public List<RecruitPortalCommonVO> getRecruitProgress() {
List<RecruitPortalCommonVO> recruitList = new ArrayList<>();
//招聘需求完成进度
recruitList.add(getProgress());
//面试出席率
recruitList.add(getInterview(1));
//面试通过率
recruitList.add(getInterview(2));
//接受offer
recruitList.add(getOffer());
//取消入职
recruitList.add(getEntry(1));
//按期入职
recruitList.add(getEntry(2));
return recruitList;
}
private RecruitPortalCommonVO getEntry(int type) {
RecordSet rs = new RecordSet();
String uId = String.valueOf(user.getUID());
int complete;
String title;
String color;
rs.executeQuery("select count(1) as sum from uf_jcl_rzgl where modedatacreater = ?",uId);
rs.next();
int all = Util.getIntValue(rs.getString("sum"));
if (type == 1) {
rs.executeQuery("select count(1) as complete from uf_jcl_rzgl where modedatacreater = ? and rzzt = 2",uId);
rs.next();
complete = Util.getIntValue(rs.getString("complete"));
title = "取消入职";
color = "#ff2516";
}else {
rs.executeQuery("select count(1) as complete from uf_jcl_rzgl where modedatacreater = ? and rzzt = 2 and rzrq = yjrzrq",uId);
rs.next();
complete = Util.getIntValue(rs.getString("complete"));
title = "按期入职";
color = "#a1e073";
}
double progress = all == 0 ? 0 :((double) complete / all) * 100;
return RecruitPortalCommonVO.builder().title(title).scale(progress).color(color).build();
}
private RecruitPortalCommonVO getOffer() {
RecordSet rs = new RecordSet();
String uId = String.valueOf(user.getUID());
rs.executeQuery("select count(1) as sum from uf_jcl_offer where sqr = ? and zt != 0",uId);
rs.next();
int all = Util.getIntValue(rs.getString("sum"));
rs.executeQuery("select count(1) as complete from uf_jcl_offer where sqr = ? and zt = 3",uId);
rs.next();
int complete = Util.getIntValue(rs.getString("complete"));
double progress = all == 0 ? 0 :((double) complete / all) * 100;
return RecruitPortalCommonVO.builder().title("接受offer").scale(progress).color("#4cbadd").build();
}
private RecruitPortalCommonVO getProgress() {
RecordSet rs = new RecordSet();
List<String> all = new ArrayList<>();
rs.executeQuery("select sqr,zpxqfzr from uf_jcl_zpxqjh");
while (rs.next()) {
String sqr = Util.null2String(rs.getString("sqr"));
String zpxqfzr = Util.null2String(rs.getString("zpxqfzr"));
all.add(mergeStrings(sqr, zpxqfzr));
}
String uId = String.valueOf(user.getUID());
List<String> filterAll = all.stream()
.filter(s -> s.contains(uId))
.collect(Collectors.toList());
List<String> complete = new ArrayList<>();
rs.executeQuery("select sqr from uf_jcl_zpxqjh where xqzt = 1");
while (rs.next()) {
String sqr = Util.null2String(rs.getString("sqr"));
String zpxqfzr = Util.null2String(rs.getString("zpxqfzr"));
complete.add(mergeStrings(sqr, zpxqfzr));
}
List<String> filterComplete = complete.stream()
.filter(s -> s.contains(uId))
.collect(Collectors.toList());
double progress = filterAll.size() == 0 ? 0 : ((double) filterComplete.size() / filterAll.size()) * 100;
return RecruitPortalCommonVO.builder().title("招聘需求完成进度").scale(progress).color("#fdac3a").build();
}
private RecruitPortalCommonVO getInterview(int type) {
RecordSet rs = new RecordSet();
String uId = String.valueOf(user.getUID());
String title;
String color;
rs.executeQuery("select msg,ptmsg from uf_jcl_ms");
List<String> all = new ArrayList<>();
List<String> complete = new ArrayList<>();
while (rs.next()) {
String msg = Util.null2String(rs.getString("msg"));
String ptmsg = Util.null2String(rs.getString("ptmsg"));
all.add(mergeStrings(msg, ptmsg));
}
List<String> filterAll = all.stream()
.filter(s -> s.contains(uId))
.collect(Collectors.toList());
if (type == 1) {
title = "面试出席率";
color = "#5671fb";
rs.executeQuery("select msg,ptmsg from uf_jcl_ms where zt = 1");
while (rs.next()) {
String msg = Util.null2String(rs.getString("msg"));
String ptmsg = Util.null2String(rs.getString("ptmsg"));
complete.add(mergeStrings(msg, ptmsg));
}
}else {
title = "面试通过率";
color = "#42d39e";
rs.executeQuery("select msg,ptmsg from uf_jcl_ms where zt = 1 and jg = 1");
while (rs.next()) {
String msg = Util.null2String(rs.getString("msg"));
String ptmsg = Util.null2String(rs.getString("ptmsg"));
complete.add(mergeStrings(msg, ptmsg));
}
}
List<String> filterComplete = complete.stream()
.filter(s -> s.contains(uId))
.collect(Collectors.toList());
double progress = filterAll.size() == 0 ? 0 : ((double) filterComplete.size() / filterAll.size()) * 100;
return RecruitPortalCommonVO.builder().title(title).scale(progress).color(color).build();
}
private Integer waitHired() {
RecordSet rs = new RecordSet();