Merge branch 'develop' of http://221.226.25.34:3000/dxfeng/weaver-hrm-recruit into feature/dxf

This commit is contained in:
dxfeng 2023-10-27 15:19:22 +08:00
commit 7720d0479a
8 changed files with 210 additions and 26 deletions

View File

@ -2,16 +2,16 @@ package com.engine.recruit.controller;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.recruit.entity.workbench.OptionVO;
import com.engine.recruit.util.ResponseResult;
import com.engine.recruit.wrapper.InductionManageWrapper;
import com.icbc.api.internal.apache.http.impl.cookie.S;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.*;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;
@ -52,4 +52,12 @@ public class InductionManageController {
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getInductionManageWrapper(user)::checkLoginInfo, params);
}
@GET
@Path("/infoSubmit")
@Produces(MediaType.APPLICATION_JSON)
public String infoSubmit(@Context HttpServletRequest request, @Context HttpServletResponse response, @QueryParam("id") String id) {
User user = HrmUserVarify.getUser(request, response);
return new ResponseResult<String, Map<String, Object>>(user).run(getInductionManageWrapper(user) :: infoSubmit,id);
}
}

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

@ -32,4 +32,13 @@ public interface InductionManageService {
* @return
*/
Map<String, Object> checkLoginInfo(Map<String, Object> param);
/**
* @Description:
* @Author: liang.cheng
* @Date: 2023/10/25 10:30 AM
* @param: [id]
* @return: java.util.Map<java.lang.String,java.lang.Object>
*/
Map<String, Object> infoSubmit(String id);
}

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

@ -100,13 +100,31 @@ public class InductionManageServiceImpl extends Service implements InductionMana
@Override
public Map<String, Object> checkLoginInfo(Map<String, Object> param) {
RecordSet rs = new RecordSet();
HashMap<String, Object> map = new HashMap<>(2);
String mobile = Util.null2String(param.get("mobile"));
String pwd = Util.null2String(param.get("pwd"));
rs.executeQuery("select id from uf_jcl_xxcj where sjh = ? and mm = ?", mobile, pwd);
rs.executeQuery("select count(1) as sum from uf_jcl_rzgl where sjhm = ? and rzzt != 2",mobile);
rs.next();
return new HashMap<String, Object>() {{
put("id", Util.getIntValue(rs.getString("id")));
}};
if (Util.getIntValue(rs.getString("sum")) == 0) {
map.put("message","当前链接已失效且不可操作");
return map;
}
rs.executeQuery("select id from uf_jcl_xxcj where sjh = ? and mm = ?", mobile, pwd);
if (rs.next()) {
map.put("id", Util.getIntValue(rs.getString("id")));
}else {
map.put("message","手机号或密码错误");
}
return map;
}
@Override
public Map<String, Object> infoSubmit(String id) {
RecordSet rs = new RecordSet();
rs.executeQuery("update uf_jcl_rzgl set xxcj = 2 where id = ?",id);
return null;
}
/**

View File

@ -58,25 +58,13 @@ public class WorkBenchPortalServiceImpl extends Service implements com.engine.re
public OptionVO getJobTenure() {
RecordSet rs = new RecordSet();
List<RecruitPortalCommonVO> list = new ArrayList<>();
rs.executeQuery("select id,xxnr from uf_sjzd where zdlxmc = 9");
rs.executeQuery("select a.xxnr,b.sum from uf_sjzd a \n" +
"left join (select gznx,count(1) as sum from uf_jcl_zp_zpzw group by gznx) b \n" +
"on a.id = b.gznx where a.zdlxmc = 9");
while (rs.next()) {
list.add(RecruitPortalCommonVO.builder().id(Util.getIntValue(rs.getString("id)"))).title(Util.null2String(rs.getString("xxnr"))).count(0).build());
list.add(RecruitPortalCommonVO.builder().count(Util.getIntValue(rs.getString("sum"),0)).title(Util.null2String(rs.getString("xxnr"))).build());
}
List<RecruitPortalCommonVO> list1 = new ArrayList<>();
rs.executeQuery("select gznx,count(1) as sum from uf_jcl_zp_zpzw group by gznx;");
while (rs.next()) {
list1.add(RecruitPortalCommonVO.builder().id(Util.getIntValue(rs.getString("gznx)"))).count(Util.getIntValue(rs.getString("sum"))).build());
}
for (RecruitPortalCommonVO item1 : list) {
for (RecruitPortalCommonVO item2 : list1) {
if (item1.getId().equals(item2.getId())) {
item1.setCount(item2.getCount());
break;
}
}
}
List<String> xData = list.stream()
.map(RecruitPortalCommonVO::getTitle)
@ -96,12 +84,11 @@ public class WorkBenchPortalServiceImpl extends Service implements com.engine.re
@Override
public OptionVO getWaitStepPerson() {
RecordSet rs = new RecordSet();
rs.executeQuery("select a.xxnr,b.sum from uf_sjzd a \n" +
"left join (select gznx,count(1) as sum from uf_jcl_zp_zpzw group by gznx) b \n" +
"on a.id = b.gznx where a.zdlxmc = 9");
rs.executeQuery("select dqypjd,count(1) as sum from uf_jcl_yppc where dqypjd is not null group by dqypjd");
List<String> xData = new ArrayList<>();
List<Integer> barSeriesData = new ArrayList<>();
while (rs.next()) {
xData.add(Util.null2String(rs.getString("xxnr")));
barSeriesData.add(Util.getIntValue(rs.getString("sum")),0);
}
@ -160,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();

View File

@ -2,6 +2,7 @@ package com.engine.recruit.wrapper;
import com.engine.common.util.ServiceUtil;
import com.engine.core.impl.Service;
import com.engine.recruit.entity.workbench.OptionVO;
import com.engine.recruit.service.InductionManageService;
import com.engine.recruit.service.impl.InductionManageServiceImpl;
import weaver.hrm.User;
@ -29,4 +30,8 @@ public class InductionManageWrapper extends Service {
public Map<String, Object> checkLoginInfo(Map<String, Object> param) {
return getInductionManageService(user).checkLoginInfo(param);
}
public Map<String, Object> infoSubmit(String id) {
return getInductionManageService(user).infoSubmit(id);
}
}