招聘需求报表

This commit is contained in:
dxfeng 2025-03-12 16:22:43 +08:00
parent 98f184c802
commit e7a2d39d2c
11 changed files with 217 additions and 59 deletions

View File

@ -0,0 +1,8 @@
package com.api.xmg.web;
import javax.ws.rs.Path;
@Path("/jcl/xmg/demand")
public class RecruitDemandController extends com.engine.xmg.web.RecruitDemandController{
}

View File

@ -1,8 +0,0 @@
package com.api.xxx.web;
import javax.ws.rs.Path;
@Path("/jcl/xxx/demand")
public class RecruitDemandController extends com.engine.xxx.web.RecruitDemandController{
}

View File

@ -0,0 +1,82 @@
package com.engine.xmg.entity.demand.vo;
import com.engine.organization.annotation.OrganizationTable;
import com.engine.organization.annotation.OrganizationTableColumn;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @author:dxfeng
* @createTime: 2025/03/11
* @version: 1.0
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@OrganizationTable(pageId = "2708f6a9-fe47-11ef-9c4e-000c2928e588",
fields = "t.id," +
"t.lcbh," +
"t.sqsj," +
"t.sqbm," +
"t.sqr," +
"t.gw," +
"t.zprs"
,
fromSql = "FROM uf_jcl_zp_zpxq t",
orderby = " t.id ",
sortway = " asc",
primarykey = "id"
)
public class RecruitDemandTable {
@OrganizationTableColumn(column = "id", display = false)
private String id;
/**
* 流程编号
*/
@OrganizationTableColumn(text = "流程编号", width = "25%", column = "lcbh")
private String processNumber;
/**
* 申请时间
*/
@OrganizationTableColumn(text = "申请时间", width = "25%", column = "sqsj")
private String applyTime;
/**
* 申请部门
*/
@OrganizationTableColumn(text = "申请部门", width = "25%", column = "sqbm",transmethod = "com.engine.xmg.transmethod.demand.RecruitDemandTableTransMethod.getDepartmentName")
private String applyDepartment;
/**
* 申请人
*/
@OrganizationTableColumn(text = "申请人", width = "25%", column = "sqr",transmethod = "com.engine.xmg.transmethod.demand.RecruitDemandTableTransMethod.getUserName")
private String applyUser;
/**
* 招聘岗位
*/
@OrganizationTableColumn(text = "招聘岗位", width = "25%", column = "gw",transmethod = "com.engine.xmg.transmethod.demand.RecruitDemandTableTransMethod.getJobtitleName")
private String recruitPost;
/**
* 招聘人数
*/
@OrganizationTableColumn(text = "招聘人数", width = "25%", column = "zprs")
private String recruitNumber;
/**
* 面试人数
*/
@OrganizationTableColumn(text = "面试人数", width = "25%", column = "msrs", otherPara = "column:id", transmethod = "com.engine.xmg.transmethod.demand.RecruitDemandTableTransMethod.getInterviewNumber")
private String interviewNumber;
/**
* 接受offer人数
*/
@OrganizationTableColumn(text = "接受offer人数", width = "25%", column = "offernumber", otherPara = "column:id", transmethod = "com.engine.xmg.transmethod.demand.RecruitDemandTableTransMethod.getOfferNumber")
private String acceptOfferNumber;
/**
* 接受offer人员
*/
@OrganizationTableColumn(text = "接受offer人员", width = "25%", column = "offeruser", otherPara = "column:id", transmethod = "com.engine.xmg.transmethod.demand.RecruitDemandTableTransMethod.getOfferUser")
private String acceptOfferUser;
}

View File

@ -1,4 +1,4 @@
package com.engine.xxx.exception;
package com.engine.xmg.exception;
/**
* @Author weaver_cl

View File

@ -1,4 +1,4 @@
package com.engine.xxx.service;
package com.engine.xmg.service;
import java.util.Map;
@ -9,5 +9,5 @@ import java.util.Map;
*/
public interface RecruitDemandService {
Map<String, Object> getStaffNum(Map<String, Object> param);
Map<String, Object> getRecruitDemandReport(Map<String, Object> param);
}

View File

@ -0,0 +1,33 @@
package com.engine.xmg.service.impl;
import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable;
import com.engine.xmg.entity.demand.vo.RecruitDemandTable;
import com.engine.xmg.service.RecruitDemandService;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2024/08/29
* @version: 1.0
*/
public class RecruitDemandServiceImpl extends Service implements RecruitDemandService {
@Override
public Map<String, Object> getRecruitDemandReport(Map<String, Object> param) {
Map<String, Object> resultMap = new HashMap<>();
// 刷新引用状态
OrganizationWeaTable<RecruitDemandTable> table = new OrganizationWeaTable<>(user, RecruitDemandTable.class);
String sqlWhere = " where 1=1 ";
table.setSqlwhere(sqlWhere);
WeaResultMsg result = new WeaResultMsg(false);
result.putAll(table.makeDataResult());
result.success();
resultMap.putAll(result.getResultMap());
return resultMap;
}
}

View File

@ -0,0 +1,78 @@
package com.engine.xmg.transmethod.demand;
import org.apache.commons.lang.StringUtils;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import weaver.hrm.company.DepartmentComInfo;
import weaver.hrm.job.JobTitlesComInfo;
import java.util.ArrayList;
import java.util.List;
/**
* @author:dxfeng
* @createTime: 2025/03/11
* @version: 1.0
*/
public class RecruitDemandTableTransMethod {
public static String getInterviewNumber(String text, String demandId) {
RecordSet rs = new RecordSet();
String sql = "select COUNT( distinct ms.ypz ) as num from uf_jcl_zp_zpxq zpxq left join uf_jcl_zp_zpzw zpzw on zpxq.id = zpzw.zpxqdx left join uf_jcl_yppc yppc on zpzw.id = yppc.ypzw left join uf_jcl_ms ms on yppc.id = ms.ypz where zpxq.id = ?";
rs.executeQuery(sql, demandId);
if (rs.next()) {
return rs.getString("num");
}
return "";
}
public static String getOfferNumber(String text, String demandId) {
RecordSet rs = new RecordSet();
String sql = "select count(uf_jcl_offer.id) as num from uf_jcl_zp_zpxq join uf_jcl_zp_zpzw on uf_jcl_zp_zpxq.id = uf_jcl_zp_zpzw.zpxqdx join uf_jcl_yppc on uf_jcl_zp_zpzw.id = uf_jcl_yppc.ypzw join uf_jcl_offer on uf_jcl_yppc.id = uf_jcl_offer.xm and uf_jcl_offer.zt=3 and uf_jcl_offer.formmodeid is not null where uf_jcl_zp_zpxq.id = ?";
rs.executeQuery(sql, demandId);
if (rs.next()) {
return rs.getString("num");
}
return "";
}
public static String getOfferUser(String text, String demandId) {
RecordSet rs = new RecordSet();
String sql = "select uf_jcl_yppc.xm , uf_jcl_offer.fksj from uf_jcl_zp_zpxq join uf_jcl_zp_zpzw on uf_jcl_zp_zpxq.id = uf_jcl_zp_zpzw.zpxqdx join uf_jcl_yppc on uf_jcl_zp_zpzw.id = uf_jcl_yppc.ypzw join uf_jcl_offer on uf_jcl_yppc.id = uf_jcl_offer.xm and uf_jcl_offer.zt=3 and uf_jcl_offer.formmodeid is not null where uf_jcl_zp_zpxq.id = ?";
rs.executeQuery(sql, demandId);
List<String> userList = new ArrayList<>();
while (rs.next()) {
String name = rs.getString("xm");
String time = rs.getString("fksj");
time = StringUtils.isNotBlank(time) ? "(" + time + ")" : "";
if (StringUtils.isNotBlank(name)) {
userList.add(name + time);
}
}
return StringUtils.join(userList, "<br/>");
}
public static String getDepartmentName(String id) {
if (StringUtils.isBlank(id)) {
return "";
}
return new DepartmentComInfo().getDepartmentname(id);
}
public static String getUserName(String id) {
if (StringUtils.isBlank(id)) {
return "";
}
return new User(Integer.parseInt(id)).getLastname();
}
public static String getJobtitleName(String id) {
if (StringUtils.isBlank(id)) {
return "";
}
return new JobTitlesComInfo().getJobTitlesname(id);
}
}

View File

@ -1,4 +1,4 @@
package com.engine.xxx.util;
package com.engine.xmg.util;
/**
* @Author weaver_cl

View File

@ -1,11 +1,11 @@
package com.engine.xxx.util;
package com.engine.xmg.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.engine.core.exception.ECException;
import com.engine.xxx.exception.CustomizeRunTimeException;
import com.engine.xmg.exception.CustomizeRunTimeException;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
@ -50,7 +50,7 @@ public class ResponseResult<T, R> {
log.info("run api , param {}", t);
}
return getJsonString(f.apply(t));
} catch (com.engine.xxx.exception.CustomizeRunTimeException e) {
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {
@ -72,7 +72,7 @@ public class ResponseResult<T, R> {
log.info("run api , param {}", t);
}
return Ok(f.apply(t));
} catch (com.engine.xxx.exception.CustomizeRunTimeException e) {
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {
@ -95,7 +95,7 @@ public class ResponseResult<T, R> {
}
f.accept(t);
return Ok();
} catch (com.engine.xxx.exception.CustomizeRunTimeException e) {
} catch (CustomizeRunTimeException e) {
log.error("api run fail", e);
return Error(e.getMessage());
} catch (ECException e) {

View File

@ -1,10 +1,10 @@
package com.engine.xxx.web;
package com.engine.xmg.web;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.xxx.service.RecruitDemandService;
import com.engine.xxx.service.impl.RecruitDemandServiceImpl;
import com.engine.xxx.util.ResponseResult;
import com.engine.xmg.service.RecruitDemandService;
import com.engine.xmg.service.impl.RecruitDemandServiceImpl;
import com.engine.xmg.util.ResponseResult;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
@ -28,12 +28,12 @@ public class RecruitDemandController {
}
@GET
@Path("/getStaffNum")
@Path("/getRecruitDemandReport")
@Produces(MediaType.APPLICATION_JSON)
public String getStaffNum(@Context HttpServletRequest request, @Context HttpServletResponse response) {
public String getRecruitDemandReport(@Context HttpServletRequest request, @Context HttpServletResponse response) {
User user = HrmUserVarify.getUser(request, response);
Map<String, Object> params = ParamUtil.request2Map(request);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getStaffNum, params);
return new ResponseResult<Map<String, Object>, Map<String, Object>>(user).run(getService(user)::getRecruitDemandReport, params);
}
}

View File

@ -1,35 +0,0 @@
package com.engine.xxx.service.impl;
import com.engine.core.impl.Service;
import com.engine.xxx.service.RecruitDemandService;
import weaver.conn.RecordSet;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map;
/**
* @author:dxfeng
* @createTime: 2024/08/29
* @version: 1.0
*/
public class RecruitDemandServiceImpl extends Service implements RecruitDemandService {
@Override
public Map<String, Object> getStaffNum(Map<String, Object> param) {
Map<String, Object> returnMap = new HashMap<>();
RecordSet rs = new RecordSet();
String sqbm = Util.null2String(param.get("sqbm"));
String xqgw = Util.null2String(param.get("xqgw"));
rs.executeQuery("select a.staff_num, a.permanent_num from jcl_org_staff a inner join JCL_ORG_STAFFPLAN b on a.plan_id = b.id and b.forbidden_tag = 0 and b.delete_type = 0 where a.delete_type = 0 and a.ec_department = ? and a.job_id = ? order by a.id desc", sqbm, xqgw);
if(rs.next()) {
String staffNum = rs.getString("staff_num");
String permanentNum = rs.getString("permanent_num");
returnMap.put("staffNum", staffNum);
returnMap.put("permanentNum", permanentNum);
}
return returnMap;
}
}