Compare commits
22 Commits
master
...
feature/ji
Author | SHA1 | Date |
---|---|---|
|
46d8e99088 | 5 months ago |
|
bbf8408bb4 | 8 months ago |
|
7d0c7282b8 | 8 months ago |
|
5822b37375 | 8 months ago |
|
707aa00417 | 8 months ago |
|
16a23e9e39 | 9 months ago |
|
8d9303f07c | 9 months ago |
|
28884f06a9 | 9 months ago |
|
ffc9a89cd1 | 2 years ago |
|
31436b195e | 2 years ago |
|
0f84ffa2e0 | 2 years ago |
|
33c02ec78e | 2 years ago |
|
1a47555a80 | 2 years ago |
|
ab61cde4a7 | 2 years ago |
|
c3e73c2b44 | 2 years ago |
|
5715a02a47 | 2 years ago |
|
47b8f651a9 | 2 years ago |
|
89554625ca | 3 years ago |
|
44f71e8bee | 3 years ago |
|
e323d12394 | 3 years ago |
|
31ab137195 | 3 years ago |
|
6ad63f5d43 | 3 years ago |
@ -0,0 +1,63 @@
|
||||
<%@ page import="com.engine.organization.thread.CompanyTriggerRunnable" %>
|
||||
<%@ page import="com.engine.organization.thread.DepartmentTriggerRunnable" %>
|
||||
<%@ page import="com.engine.organization.thread.JobTriggerRunnable" %>
|
||||
<%@ page import="org.apache.commons.lang3.StringUtils" %>
|
||||
<%@ page import="weaver.conn.RecordSet" %>
|
||||
<%@ page import="weaver.general.Util" %>
|
||||
<%@ page import="java.util.HashSet" %>
|
||||
<%@ page import="java.util.Set" %>
|
||||
<%@ page import="com.engine.organization.util.db.MapperProxyFactory" %>
|
||||
<%@ page import="com.engine.organization.mapper.job.JobMapper" %>
|
||||
<%@ page import="com.engine.organization.entity.job.po.JobPO" %>
|
||||
<%@ page import="com.engine.organization.entity.department.po.DepartmentPO" %>
|
||||
<%@ page import="com.engine.organization.mapper.department.DepartmentMapper" %>
|
||||
<%@ page import="com.engine.organization.mapper.comp.CompMapper" %>
|
||||
<%@ page import="com.engine.organization.entity.company.po.CompPO" %>
|
||||
<%@ page import="com.engine.organization.initdata.RefreshPlan" %>
|
||||
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||
<%
|
||||
RecordSet rs = new RecordSet();
|
||||
// 刷新岗位
|
||||
Set<Long> jobSet = new HashSet<>();
|
||||
Set<Long> departmentSet = new HashSet<>();
|
||||
Set<Long> companySet = new HashSet<>();
|
||||
rs.executeQuery("select id, parent_job from jcl_org_job where id not in( select ifnull(parent_job, '') from jcl_org_job where delete_type =0 and forbidden_tag=0) and delete_type =0 and forbidden_tag=0");
|
||||
while (rs.next()) {
|
||||
Long jobId = Long.parseLong(Util.null2String(rs.getString("id")));
|
||||
JobPO jobPO = MapperProxyFactory.getProxy(JobMapper.class).getJobById(jobId);
|
||||
RefreshPlan.updateResourceJob(jobId);
|
||||
new JobTriggerRunnable(jobPO, jobPO).run();
|
||||
|
||||
String parentJobId = Util.null2String(rs.getString("parent_job"));
|
||||
if (StringUtils.isNotBlank(parentJobId)) {
|
||||
RefreshPlan.refreshJob(Long.parseLong(parentJobId), jobSet);
|
||||
}
|
||||
}
|
||||
// 刷新部门
|
||||
rs.executeQuery("select id, parent_dept from jcl_org_dept where id not in( select ifnull(parent_dept , '') from jcl_org_dept where delete_type =0 and forbidden_tag=0) and delete_type =0 and forbidden_tag=0");
|
||||
while (rs.next()) {
|
||||
Long departmentId = Long.parseLong(Util.null2String(rs.getString("id")));
|
||||
DepartmentPO deptById = MapperProxyFactory.getProxy(DepartmentMapper.class).getDeptById(departmentId);
|
||||
new DepartmentTriggerRunnable(deptById, deptById).run();
|
||||
|
||||
String parentDepartmentId = Util.null2String(rs.getString("parent_dept"));
|
||||
if (StringUtils.isNotBlank(parentDepartmentId)) {
|
||||
RefreshPlan.refreshDepartment(Long.parseLong(parentDepartmentId), departmentSet);
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新分部
|
||||
rs.executeQuery("select id, parent_company from jcl_org_comp where id not in( select ifnull(parent_company , '') from jcl_org_comp where delete_type =0 and forbidden_tag=0) and delete_type =0 and forbidden_tag=0");
|
||||
while (rs.next()) {
|
||||
Long companyId = Long.parseLong(Util.null2String(rs.getString("id")));
|
||||
CompPO compPO = MapperProxyFactory.getProxy(CompMapper.class).listById(companyId);
|
||||
new CompanyTriggerRunnable(compPO, compPO).run();
|
||||
|
||||
String parentCompanyId = Util.null2String(rs.getString("parent_company"));
|
||||
if (StringUtils.isNotBlank(parentCompanyId)) {
|
||||
RefreshPlan.refreshCompany(Long.parseLong(parentCompanyId), companySet);
|
||||
}
|
||||
}
|
||||
out.println("数据刷新完成");
|
||||
|
||||
%>
|
@ -1,12 +0,0 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/hrmresource")
|
||||
public class HrmResourceController extends com.engine.organization.web.HrmResourceController{
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
@Path("/bs/hrmorganization/detach")
|
||||
public class ManagerDetachController extends com.engine.organization.web.ManagerDetachController {
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/personnelcard")
|
||||
public class PersonnelCardController extends com.engine.organization.web.PersonnelCardController {
|
||||
}
|
@ -1,338 +0,0 @@
|
||||
package com.engine.organization.entity.hrmresource.param;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/27
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HrmResourceImportParam {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* work_code
|
||||
*/
|
||||
private String work_code;
|
||||
|
||||
/**
|
||||
* login_id
|
||||
*/
|
||||
private String login_id;
|
||||
|
||||
/**
|
||||
* last_name
|
||||
*/
|
||||
private String last_name;
|
||||
|
||||
/**
|
||||
* sex
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* account_type
|
||||
*/
|
||||
private String account_type;
|
||||
|
||||
/**
|
||||
* belong_to
|
||||
*/
|
||||
private String belong_to;
|
||||
|
||||
/**
|
||||
* company_id
|
||||
*/
|
||||
private String company_id;
|
||||
|
||||
/**
|
||||
* department_id
|
||||
*/
|
||||
private String department_id;
|
||||
|
||||
/**
|
||||
* job_activity
|
||||
*/
|
||||
private String job_activity;
|
||||
|
||||
/**
|
||||
* job_title
|
||||
*/
|
||||
private String job_title;
|
||||
|
||||
/**
|
||||
* job_call
|
||||
*/
|
||||
private String job_call;
|
||||
|
||||
/**
|
||||
* job_level
|
||||
*/
|
||||
private String job_level;
|
||||
|
||||
/**
|
||||
* job_group_id
|
||||
*/
|
||||
private String job_group_id;
|
||||
|
||||
/**
|
||||
* job_activity_desc
|
||||
*/
|
||||
private String job_activity_desc;
|
||||
|
||||
/**
|
||||
* status
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* system_language
|
||||
*/
|
||||
private String system_language;
|
||||
|
||||
/**
|
||||
* resource_image_id
|
||||
*/
|
||||
private String resource_image_id;
|
||||
|
||||
/**
|
||||
* messager_url
|
||||
*/
|
||||
private String messager_url;
|
||||
|
||||
/**
|
||||
* location_id
|
||||
*/
|
||||
private String location_id;
|
||||
|
||||
/**
|
||||
* manager_id
|
||||
*/
|
||||
private String manager_id;
|
||||
|
||||
/**
|
||||
* assistant_id
|
||||
*/
|
||||
private String assistant_id;
|
||||
|
||||
/**
|
||||
* mobile
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* telephone
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* mobile_call
|
||||
*/
|
||||
private String mobile_call;
|
||||
|
||||
/**
|
||||
* fax
|
||||
*/
|
||||
private String fax;
|
||||
|
||||
/**
|
||||
* email
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* workroom
|
||||
*/
|
||||
private String workroom;
|
||||
|
||||
/**
|
||||
* pass_word
|
||||
*/
|
||||
private String pass_word;
|
||||
|
||||
/**
|
||||
* sec_level
|
||||
*/
|
||||
private String sec_level;
|
||||
|
||||
/**
|
||||
* birthday
|
||||
*/
|
||||
private String birthday;
|
||||
|
||||
/**
|
||||
* folk
|
||||
*/
|
||||
private String folk;
|
||||
|
||||
/**
|
||||
* native_place
|
||||
*/
|
||||
private String native_place;
|
||||
|
||||
/**
|
||||
* reg_resident_place
|
||||
*/
|
||||
private String reg_resident_place;
|
||||
|
||||
/**
|
||||
* certificate_num
|
||||
*/
|
||||
private String certificate_num;
|
||||
|
||||
/**
|
||||
* marital_status
|
||||
*/
|
||||
private String marital_status;
|
||||
|
||||
/**
|
||||
* policy
|
||||
*/
|
||||
private String policy;
|
||||
|
||||
/**
|
||||
* be_member_date
|
||||
*/
|
||||
private String be_member_date;
|
||||
|
||||
/**
|
||||
* be_party_date
|
||||
*/
|
||||
private String be_party_date;
|
||||
|
||||
/**
|
||||
* islabouunion
|
||||
*/
|
||||
private String islabouunion;
|
||||
|
||||
/**
|
||||
* degree
|
||||
*/
|
||||
private String degree;
|
||||
|
||||
/**
|
||||
* health_info
|
||||
*/
|
||||
private String health_info;
|
||||
|
||||
/**
|
||||
* education_level
|
||||
*/
|
||||
private String education_level;
|
||||
|
||||
/**
|
||||
* height
|
||||
*/
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* weight
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* use_kind
|
||||
*/
|
||||
private String use_kind;
|
||||
|
||||
/**
|
||||
* start_date
|
||||
*/
|
||||
private String start_date;
|
||||
|
||||
/**
|
||||
* end_date
|
||||
*/
|
||||
private String end_date;
|
||||
|
||||
/**
|
||||
* probation_end_date
|
||||
*/
|
||||
private String probation_end_date;
|
||||
|
||||
/**
|
||||
* resident_place
|
||||
*/
|
||||
private String resident_place;
|
||||
|
||||
/**
|
||||
* home_address
|
||||
*/
|
||||
private String home_address;
|
||||
|
||||
/**
|
||||
* temp_resident_number
|
||||
*/
|
||||
private String temp_resident_number;
|
||||
|
||||
/**
|
||||
* company_start_date
|
||||
*/
|
||||
private String company_start_date;
|
||||
|
||||
/**
|
||||
* work_start_date
|
||||
*/
|
||||
private String work_start_date;
|
||||
|
||||
/**
|
||||
* accum_fund_account
|
||||
*/
|
||||
private String accum_fund_account;
|
||||
|
||||
/**
|
||||
* account_name
|
||||
*/
|
||||
private String account_name;
|
||||
|
||||
/**
|
||||
* bank_id
|
||||
*/
|
||||
private String bank_id;
|
||||
|
||||
/**
|
||||
* account_id
|
||||
*/
|
||||
private String account_id;
|
||||
|
||||
/**
|
||||
* show_order
|
||||
*/
|
||||
private Integer show_order;
|
||||
|
||||
/**
|
||||
* classification
|
||||
*/
|
||||
private String classification;
|
||||
|
||||
/**
|
||||
* woprk_year
|
||||
*/
|
||||
private String work_year;
|
||||
|
||||
/**
|
||||
* company_work_year
|
||||
*/
|
||||
private String company_work_year;
|
||||
|
||||
private String baseFieldsValue;
|
||||
|
||||
private String baseFields;
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
}
|
@ -1,151 +0,0 @@
|
||||
package com.engine.organization.entity.hrmresource.po;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class HrmResourcePO {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 编号
|
||||
*/
|
||||
private String workCode;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String lastName;
|
||||
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
*/
|
||||
private Integer accountType;
|
||||
|
||||
/**
|
||||
* 主账号
|
||||
*/
|
||||
private Long belongTo;
|
||||
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private Long departmentId;
|
||||
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
private Long companyId;
|
||||
|
||||
/**
|
||||
* 职务
|
||||
*/
|
||||
private Long jobActivity;
|
||||
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
private Long jobTitle;
|
||||
|
||||
/**
|
||||
* 职等
|
||||
*/
|
||||
private String jobLevel;
|
||||
|
||||
/**
|
||||
* 职务类别
|
||||
*/
|
||||
private Long jobGroupId;
|
||||
|
||||
/**
|
||||
* 职责描述
|
||||
*/
|
||||
private String jobActivityDesc;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 照片
|
||||
*/
|
||||
private String resourceImageId;
|
||||
|
||||
/**
|
||||
* 办公地点
|
||||
*/
|
||||
private Integer locationId;
|
||||
|
||||
/**
|
||||
* 移动电话
|
||||
*/
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
* 办公室电话
|
||||
*/
|
||||
private String telephone;
|
||||
|
||||
/**
|
||||
* 电子邮件
|
||||
*/
|
||||
private String email;
|
||||
|
||||
private Long creator;
|
||||
private int deleteType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
private String companyStartDate;
|
||||
|
||||
/**
|
||||
* 参加工作日期
|
||||
*/
|
||||
private String workStartDate;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer showOrder;
|
||||
|
||||
private Long ecDepartment;
|
||||
|
||||
private Long ecCompany;
|
||||
|
||||
private String uuid;
|
||||
|
||||
private String jobGrade;
|
||||
|
||||
private String schemeId;
|
||||
|
||||
private String sequenceId;
|
||||
|
||||
private String baseFieldsValue;
|
||||
|
||||
private String baseFields;
|
||||
|
||||
}
|
@ -0,0 +1,219 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JyChart {
|
||||
private String id;
|
||||
private String fname;
|
||||
private String ftype;
|
||||
private String parentId;
|
||||
private String fnumber;
|
||||
private String fobjid;
|
||||
private String fecid;
|
||||
private String fisvitual;
|
||||
private String expand;
|
||||
private String uuid;
|
||||
private boolean hasChildren;
|
||||
|
||||
private String fleadername;
|
||||
private String fleaderimg;
|
||||
private String fleaderjob;
|
||||
private String fleader;
|
||||
private String fplan;
|
||||
private String fonjob;
|
||||
private String fleaderlv;
|
||||
private String fleaderst;
|
||||
|
||||
protected static final RecordSet rs = new RecordSet();
|
||||
|
||||
// 提供静态方法来获取 RecordSet 实例
|
||||
public static RecordSet getRecordSet() {
|
||||
return rs;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFname() {
|
||||
return fname;
|
||||
}
|
||||
|
||||
public void setFname(String fname) {
|
||||
this.fname = fname;
|
||||
}
|
||||
|
||||
public String getFtype() {
|
||||
return ftype;
|
||||
}
|
||||
|
||||
public void setFtype(String ftype) {
|
||||
this.ftype = ftype;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getFnumber() {
|
||||
return fnumber;
|
||||
}
|
||||
|
||||
public void setFnumber(String fnumber) {
|
||||
this.fnumber = fnumber;
|
||||
}
|
||||
|
||||
public String getFobjid() {
|
||||
// 根据UUID获取聚才林ID
|
||||
if (StringUtils.isNotBlank(uuid)) {
|
||||
if (id.startsWith("s_")) {
|
||||
// 查询聚才林分部的ID
|
||||
rs.executeQuery("select id from jcl_org_comp where uuid = ?",uuid);
|
||||
if(rs.next()){
|
||||
return rs.getString("id");
|
||||
}
|
||||
} else if (id.startsWith("d_")) {
|
||||
// 查询聚才林分部的ID
|
||||
rs.executeQuery("select id from jcl_org_dept where uuid = ?",uuid);
|
||||
if(rs.next()){
|
||||
return rs.getString("id");
|
||||
}
|
||||
}
|
||||
}
|
||||
return fobjid;
|
||||
}
|
||||
|
||||
public void setFobjid(String fobjid) {
|
||||
this.fobjid = fobjid;
|
||||
}
|
||||
|
||||
public String getFecid() {
|
||||
return fecid;
|
||||
}
|
||||
|
||||
public void setFecid(String fecid) {
|
||||
this.fecid = fecid;
|
||||
}
|
||||
|
||||
public String getFisvitual() {
|
||||
return fisvitual;
|
||||
}
|
||||
|
||||
public void setFisvitual(String fisvitual) {
|
||||
this.fisvitual = fisvitual;
|
||||
}
|
||||
|
||||
public String getExpand() {
|
||||
return expand;
|
||||
}
|
||||
|
||||
public void setExpand(String expand) {
|
||||
this.expand = expand;
|
||||
}
|
||||
|
||||
public boolean isHasChildren() {
|
||||
// 都置为true
|
||||
return true;
|
||||
}
|
||||
|
||||
public void setHasChildren(boolean hasChildren) {
|
||||
this.hasChildren = hasChildren;
|
||||
}
|
||||
|
||||
public String getFleadername() {
|
||||
return fleadername;
|
||||
}
|
||||
|
||||
public void setFleadername(String fleadername) {
|
||||
this.fleadername = fleadername;
|
||||
}
|
||||
|
||||
public String getFleaderimg() {
|
||||
return fleaderimg;
|
||||
}
|
||||
|
||||
public void setFleaderimg(String fleaderimg) {
|
||||
this.fleaderimg = fleaderimg;
|
||||
}
|
||||
|
||||
public String getFleaderjob() {
|
||||
return fleaderjob;
|
||||
}
|
||||
|
||||
public void setFleaderjob(String fleaderjob) {
|
||||
this.fleaderjob = fleaderjob;
|
||||
}
|
||||
|
||||
public String getFleader() {
|
||||
return fleader;
|
||||
}
|
||||
|
||||
public void setFleader(String fleader) {
|
||||
this.fleader = fleader;
|
||||
}
|
||||
|
||||
public String getFplan() {
|
||||
return fplan;
|
||||
}
|
||||
|
||||
public void setFplan(String fplan) {
|
||||
this.fplan = fplan;
|
||||
}
|
||||
|
||||
public String getFonjob() {
|
||||
return fonjob;
|
||||
}
|
||||
|
||||
public void setFonjob(String fonjob) {
|
||||
this.fonjob = fonjob;
|
||||
}
|
||||
|
||||
public String getFleaderlv() {
|
||||
return fleaderlv;
|
||||
}
|
||||
|
||||
public void setFleaderlv(String fleaderlv) {
|
||||
this.fleaderlv = fleaderlv;
|
||||
}
|
||||
|
||||
public String getFleaderst() {
|
||||
return fleaderst;
|
||||
}
|
||||
|
||||
public void setFleaderst(String fleaderst) {
|
||||
this.fleaderst = fleaderst;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
JyChart jyChart = (JyChart) o;
|
||||
return id.equals(jyChart.id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JyCompanyChart extends JyChart {
|
||||
|
||||
@Override
|
||||
public String getFleadername() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFplan() {
|
||||
RecordSet rs = getRecordSet();
|
||||
rs.executeQuery("select sum(staff_num) as num from jcl_org_staff and delete_type = 0 ");
|
||||
if(rs.next()){
|
||||
return String.valueOf(Convert.toInt(rs.getString("num"),0));
|
||||
}
|
||||
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFonjob() {
|
||||
RecordSet rs = getRecordSet();
|
||||
// 查询在岗数
|
||||
rs.executeQuery("select count(id) as fonjob from hrmresource where status <4 ");
|
||||
if(rs.next()){
|
||||
return rs.getString("fonjob");
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,65 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.company.DepartmentComInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JyDepartmentChart extends JyChart {
|
||||
@Override
|
||||
public String getFplan() {
|
||||
RecordSet rs = getRecordSet();
|
||||
String fecid = super.getFecid();
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
new DepartmentComInfo().getAllChildDeptByDepId(ids,fecid);
|
||||
ids.add(fecid);
|
||||
String idsStr = StringUtils.join(ids, ",");
|
||||
rs.executeQuery("select sum(staff_num) as num from jcl_org_staff where dept_id in(" + idsStr + ") and delete_type = 0 ");
|
||||
if (rs.next()) {
|
||||
return String.valueOf(Convert.toInt(rs.getString("num"),0));
|
||||
}
|
||||
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFonjob() {
|
||||
RecordSet rs = getRecordSet();
|
||||
String fecid = super.getFecid();
|
||||
if (StringUtils.isNotBlank(fecid)) {
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
new DepartmentComInfo().getAllChildDeptByDepId(ids,fecid);
|
||||
ids.add(fecid);
|
||||
String idsStr = StringUtils.join(ids, ",");
|
||||
|
||||
// 查询在岗数
|
||||
rs.executeQuery("select count(id) as fonjob from hrmresource where status <4 and departmentid in (" + idsStr + ")");
|
||||
if (rs.next()) {
|
||||
return rs.getString("fonjob");
|
||||
}
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFleadername() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JyJobChart extends JyChart {
|
||||
@Override
|
||||
public String getFplan() {
|
||||
RecordSet rs = getRecordSet();
|
||||
rs.executeQuery("select sum(staff_num) as num from jcl_org_staff where job_id = ? and delete_type = 0 ",getFecid());
|
||||
if(rs.next()){
|
||||
return String.valueOf(Convert.toInt(rs.getString("num"),0));
|
||||
}
|
||||
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFonjob() {
|
||||
RecordSet rs = getRecordSet();
|
||||
String fecid = super.getFecid();
|
||||
if (StringUtils.isNotBlank(fecid)) {
|
||||
// 查询在岗数
|
||||
rs.executeQuery("select count(a.id) as fonjob from hrmresource a inner join cus_fielddata b on a.id = b.id and b.scope ='hrmcustomfieldbyinfotype' and b.scopeid ='-1' where a.status <4 and b.field100002 = ?", fecid);
|
||||
if (rs.next()) {
|
||||
return rs.getString("fonjob");
|
||||
}
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFobjid() {
|
||||
return super.getFecid();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JyOrgSelectItem {
|
||||
private String id;
|
||||
private String fnumber;
|
||||
private String fname;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFnumber() {
|
||||
return fnumber;
|
||||
}
|
||||
|
||||
public void setFnumber(String fnumber) {
|
||||
this.fnumber = fnumber;
|
||||
}
|
||||
|
||||
public String getFname() {
|
||||
return fname;
|
||||
}
|
||||
|
||||
public void setFname(String fname) {
|
||||
this.fname = fname;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj instanceof JyOrgSelectItem) {
|
||||
JyOrgSelectItem item = (JyOrgSelectItem) obj;
|
||||
return this.getId().equals(item.getId());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.getId().hashCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
import com.engine.organization.service.impl.JyChartServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JyResourceChart extends JyChart {
|
||||
@Override
|
||||
public String getFleaderjob() {
|
||||
String parentId = getParentId();
|
||||
if (StringUtils.isNotBlank(parentId)) {
|
||||
String chartId = JyChartServiceImpl.getChartId(parentId);
|
||||
if (StringUtils.isNotBlank(chartId)) {
|
||||
RecordSet rs = getRecordSet();
|
||||
rs.executeQuery("select job_name from jcl_org_job where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
return rs.getString("job_name");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package com.engine.organization.entity.jingyou;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.company.SubCompanyComInfo;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2024/07/19
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class JySubCompanyChart extends JyChart {
|
||||
|
||||
@Override
|
||||
public String getFplan() {
|
||||
RecordSet rs = getRecordSet();
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
String fecid = super.getFecid();
|
||||
new SubCompanyComInfo().getSubCompanyLists(fecid, ids);
|
||||
ids.add(fecid);
|
||||
String idsStr = StringUtils.join(ids, ",");
|
||||
rs.executeQuery("select sum(staff_num) as num from jcl_org_staff where comp_id in(" + idsStr + ") and delete_type = 0 ");
|
||||
if (rs.next()) {
|
||||
return String.valueOf(Convert.toInt(rs.getString("num"),0));
|
||||
}
|
||||
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFonjob() {
|
||||
String fecid = super.getFecid();
|
||||
if (StringUtils.isNotBlank(fecid)) {
|
||||
RecordSet rs = getRecordSet();
|
||||
ArrayList<String> ids = new ArrayList<>();
|
||||
new SubCompanyComInfo().getSubCompanyLists(fecid,ids);
|
||||
ids.add(fecid);
|
||||
String idsStr = StringUtils.join(ids, ",");
|
||||
|
||||
// 查询在岗数
|
||||
rs.executeQuery("select count(id) as fonjob from hrmresource where status <4 and subcompanyid1 in (" + idsStr + ")");
|
||||
if (rs.next()) {
|
||||
return rs.getString("fonjob");
|
||||
}
|
||||
}
|
||||
return "0";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFleadername() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return super.equals(o);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return super.hashCode();
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.engine.organization.entity.staff.po;
|
||||
|
||||
import com.engine.organization.transmethod.*;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2023/03/13
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Data
|
||||
public class StaffExportPO {
|
||||
|
||||
/**
|
||||
* 方案id
|
||||
*/
|
||||
private String planId;
|
||||
/**
|
||||
* 分部
|
||||
*/
|
||||
private String compId;
|
||||
/**
|
||||
* 部门
|
||||
*/
|
||||
private String deptId;
|
||||
/**
|
||||
* 岗位
|
||||
*/
|
||||
private String jobId;
|
||||
/**
|
||||
* 编制数
|
||||
*/
|
||||
private Integer staffNum;
|
||||
/**
|
||||
* 在编
|
||||
*/
|
||||
private Integer permanentNum;
|
||||
/**
|
||||
* 冻结数
|
||||
*/
|
||||
private Integer freezeNum;
|
||||
/**
|
||||
* 缺编状态
|
||||
*/
|
||||
private String lackStatus;
|
||||
/**
|
||||
* 编制描述
|
||||
*/
|
||||
private String staffDesc;
|
||||
|
||||
|
||||
public String getPlanId() {
|
||||
return StringUtils.isBlank(planId) ? "" : StaffPlanTransMethod.getSpanById(planId);
|
||||
}
|
||||
|
||||
public String getCompId() {
|
||||
return StringUtils.isBlank(compId) ? "" : CompTransMethod.getSpanById(compId);
|
||||
}
|
||||
|
||||
public String getDeptId() {
|
||||
return StringUtils.isBlank(deptId) ? "" : DepartmentTransMethod.getSpanById(deptId);
|
||||
}
|
||||
|
||||
public String getJobId() {
|
||||
return StringUtils.isBlank(jobId) ? "" : JobTransMethod.getSpanById(jobId);
|
||||
}
|
||||
|
||||
public Integer getStaffNum() {
|
||||
return staffNum;
|
||||
}
|
||||
|
||||
public Integer getPermanentNum() {
|
||||
return permanentNum;
|
||||
}
|
||||
|
||||
public Integer getFreezeNum() {
|
||||
return freezeNum;
|
||||
}
|
||||
|
||||
public String getLackStatus() {
|
||||
return StringUtils.isBlank(lackStatus) ? "" : StaffTransMethod.getLackSpan(lackStatus);
|
||||
}
|
||||
|
||||
public String getStaffDesc() {
|
||||
|
||||
return StringUtils.isBlank(staffDesc) ? "" : staffDesc;
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
package com.engine.organization.initdata;
|
||||
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.mapper.comp.CompMapper;
|
||||
import com.engine.organization.mapper.department.DepartmentMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.thread.CompanyTriggerRunnable;
|
||||
import com.engine.organization.thread.DepartmentTriggerRunnable;
|
||||
import com.engine.organization.thread.HrmResourceTriggerRunnable;
|
||||
import com.engine.organization.thread.JobTriggerRunnable;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/11/07
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class RefreshPlan {
|
||||
|
||||
private static JobMapper getJobMapper() {
|
||||
return MapperProxyFactory.getProxy(JobMapper.class);
|
||||
}
|
||||
|
||||
private static CompMapper getCompMapper() {
|
||||
return MapperProxyFactory.getProxy(CompMapper.class);
|
||||
}
|
||||
|
||||
private static DepartmentMapper getDepartmentMapper() {
|
||||
return MapperProxyFactory.getProxy(DepartmentMapper.class);
|
||||
}
|
||||
|
||||
// 递归刷新岗位
|
||||
public static void refreshJob(Long parentJobId, Set<Long> jobSet) {
|
||||
if (null == parentJobId || jobSet.contains(parentJobId)) {
|
||||
return;
|
||||
}
|
||||
// 获取父级岗位、同步数据
|
||||
JobPO jobById = getJobMapper().getJobById(parentJobId);
|
||||
if (null != jobById) {
|
||||
updateResourceJob(parentJobId);
|
||||
new JobTriggerRunnable(jobById, jobById).run();
|
||||
refreshJob(jobById.getParentJob(), jobSet);
|
||||
}
|
||||
jobSet.add(parentJobId);
|
||||
}
|
||||
|
||||
// 递归刷新部门
|
||||
public static void refreshDepartment(Long parentDepartmentId, Set<Long> departmentSet) {
|
||||
if (null == parentDepartmentId || departmentSet.contains(parentDepartmentId)) {
|
||||
return;
|
||||
}
|
||||
// 获取父级岗位、同步数据
|
||||
DepartmentPO deptById = getDepartmentMapper().getDeptById(parentDepartmentId);
|
||||
if (null != deptById) {
|
||||
new DepartmentTriggerRunnable(deptById, deptById).run();
|
||||
refreshDepartment(deptById.getParentDept(), departmentSet);
|
||||
}
|
||||
departmentSet.add(parentDepartmentId);
|
||||
}
|
||||
|
||||
public static void refreshCompany(Long parentCompanyId, Set<Long> companySet) {
|
||||
if (null == parentCompanyId || companySet.contains(parentCompanyId)) {
|
||||
return;
|
||||
}
|
||||
// 获取父级分部、同步数据
|
||||
CompPO compPO = getCompMapper().listById(parentCompanyId);
|
||||
if (null != compPO) {
|
||||
new CompanyTriggerRunnable(compPO, compPO).run();
|
||||
refreshCompany(compPO.getParentCompany(), companySet);
|
||||
}
|
||||
companySet.add(parentCompanyId);
|
||||
}
|
||||
|
||||
public static void updateResourceJob(Long jobId) {
|
||||
RecordSet rs = new RecordSet();
|
||||
rs.executeQuery("select id from cus_fielddata where scope = 'hrmcustomfieldbyinfotype' and scopeid = -1 and field100002 = ?", jobId);
|
||||
while (rs.next()) {
|
||||
Long resourceId = Long.parseLong(rs.getString("id"));
|
||||
new HrmResourceTriggerRunnable(resourceId).run();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package com.engine.organization.mapper.personnelcard;
|
||||
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import com.engine.organization.entity.personnelcard.po.CardAccessPO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/24
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface CardAccessMapper {
|
||||
|
||||
int insertIgnoreNull(CardAccessPO cardAccessPO);
|
||||
|
||||
int updateCardAccess(CardAccessPO cardAccessPO);
|
||||
|
||||
int deleteByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
ManagerDetachPO selectById(@Param("id") Integer id);
|
||||
}
|
@ -1,225 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.personnelcard.CardAccessMapper">
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.personnelcard.po.CardAccessPO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="type_id" property="typeId"/>
|
||||
<result column="type_name" property="typeName"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="all_people" property="allPeople"/>
|
||||
<result column="superior" property="superior"/>
|
||||
<result column="all_superior" property="allSuperior"/>
|
||||
<result column="custom" property="custom"/>
|
||||
<result column="creator" property="creator"/>
|
||||
<result column="delete_type" property="deleteType"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id
|
||||
, t.type_id
|
||||
, t.type_name
|
||||
, t.status
|
||||
, t.all_people
|
||||
, t.superior
|
||||
, t.all_superior
|
||||
, t.custom
|
||||
, t.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" keyProperty="id"
|
||||
keyColumn="id" useGeneratedKeys="true">
|
||||
INSERT INTO jcl_org_cardaccess
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null ">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
type_name,
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
status,
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
all_people,
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
superior,
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
all_superior,
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
custom,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null ">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
#{typeName},
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
#{allPeople},
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
#{superior},
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
#{allSuperior},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
#{custom},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertIgnoreNull" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO" databaseId="oracle">
|
||||
<selectKey keyProperty="id" resultType="long" order="AFTER">
|
||||
select JCL_ORG_CARDACCESS_ID.currval from dual
|
||||
</selectKey>
|
||||
INSERT INTO jcl_org_cardaccess
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null ">
|
||||
type_id,
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
type_name,
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
status,
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
all_people,
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
superior,
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
all_superior,
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
custom,
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
creator,
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
delete_type,
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
create_time,
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
update_time,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="VALUES (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeId != null ">
|
||||
#{typeId},
|
||||
</if>
|
||||
<if test="typeName != null ">
|
||||
#{typeName},
|
||||
</if>
|
||||
<if test="status != null ">
|
||||
#{status},
|
||||
</if>
|
||||
<if test="allPeople != null ">
|
||||
#{allPeople},
|
||||
</if>
|
||||
<if test="superior != null ">
|
||||
#{superior},
|
||||
</if>
|
||||
<if test="allSuperior != null ">
|
||||
#{allSuperior},
|
||||
</if>
|
||||
<if test="creator != null">
|
||||
#{creator},
|
||||
</if>
|
||||
<if test="custom != null">
|
||||
#{custom},
|
||||
</if>
|
||||
<if test="deleteType != null">
|
||||
#{deleteType},
|
||||
</if>
|
||||
<if test="createTime != null">
|
||||
#{createTime},
|
||||
</if>
|
||||
<if test="updateTime != null">
|
||||
#{updateTime},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCardAccess" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO">
|
||||
update jcl_org_cardaccess
|
||||
<set>
|
||||
type_id=#{typeId},
|
||||
type_name=#{typeName},
|
||||
status=#{status},
|
||||
all_people=#{allPeople},
|
||||
all_superior=#{allSuperior},
|
||||
custom=#{custom},
|
||||
update_time=#{updateTime},
|
||||
</set>
|
||||
WHERE id = #{id} AND delete_type = 0
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE jcl_org_cardaccess
|
||||
SET delete_type = 1
|
||||
WHERE delete_type = 0
|
||||
AND id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_cardaccess t
|
||||
WHERE delete_type = 0
|
||||
AND id = #{id}
|
||||
</select>
|
||||
</mapper>
|
@ -1,28 +0,0 @@
|
||||
package com.engine.organization.mapper.personnelcard;
|
||||
|
||||
import com.engine.organization.entity.personnelcard.ResourceBaseTab;
|
||||
import com.engine.organization.entity.personnelcard.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface PersonnelCardMapper {
|
||||
/**
|
||||
* 获取人员卡片User对象
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
User getUserById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 获取自定义显示栏目
|
||||
* @return
|
||||
*/
|
||||
List<ResourceBaseTab> getResourceBaseTabList();
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.personnelcard.PersonnelCardMapper">
|
||||
<resultMap id="UserMap" type="com.engine.organization.entity.personnelcard.User">
|
||||
<result column="id" property="id"/>
|
||||
<result column="resource_image_id" property="image"/>
|
||||
<result column="last_name" property="name"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="mobile" property="phone"/>
|
||||
<result column="belong_to" property="belongTo"/>
|
||||
<result column="status" property="status"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BaseTabMap" type="com.engine.organization.entity.personnelcard.ResourceBaseTab">
|
||||
<result column="id" property="id"/>
|
||||
<result column="groupname" property="groupName"/>
|
||||
<result column="grouplabel" property="groupLabel"/>
|
||||
<result column="dsporder" property="dspOrder"/>
|
||||
<result column="isopen" property="isOpen"/>
|
||||
<result column="ismand" property="isMand"/>
|
||||
<result column="isused" property="isUsed"/>
|
||||
<result column="issystem" property="isSystem"/>
|
||||
<result column="linkurl" property="linkUrl"/>
|
||||
<result column="tabnum" property="tabNum"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getUserById" resultMap="UserMap">
|
||||
select id,
|
||||
resource_image_id,
|
||||
last_name,
|
||||
sex,
|
||||
email,
|
||||
mobile,
|
||||
belong_to,
|
||||
status
|
||||
from jcl_org_hrmresource
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="getResourceBaseTabList" resultMap="BaseTabMap">
|
||||
select *
|
||||
from HrmResourceBaseTab
|
||||
where isopen = 1
|
||||
order by dsporder
|
||||
</select>
|
||||
</mapper>
|
@ -1,29 +0,0 @@
|
||||
package com.engine.organization.mapper.resource;
|
||||
|
||||
|
||||
import com.engine.organization.entity.hrmresource.po.HrmResourcePO;
|
||||
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/6/28
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface ResourceMapper {
|
||||
|
||||
List<HrmResourceVO> listAll(@Param("ids")List<Long> ids);
|
||||
|
||||
List<HrmResourceVO> listDetachAll(@Param("ids") List<Long> ids, @Param("companyIds") List<Long> companyIds);
|
||||
|
||||
List<HrmResourcePO> getResourceListByJobId(@Param("jobId") Long jobId);
|
||||
|
||||
int updateResourceJob(@Param("originalJobId") Long originalJobId, @Param("targetJobId") Long targetJobId, @Param("parentComp") Long parentComp, @Param("parentDept") Long parentDept, @Param("ecCompany") Long ecCompany, @Param("ecDepartment") Long ecDepartment);
|
||||
|
||||
HrmResourcePO getResourceById(@Param("id") String id);
|
||||
|
||||
List<HrmResourcePO> listByNo(@Param("workCode") String workCode);
|
||||
}
|
@ -1,147 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.engine.organization.mapper.resource.ResourceMapper">
|
||||
<resultMap id="HrmResourceMap" type="com.engine.organization.entity.hrmresource.po.HrmResourcePO">
|
||||
<result column="id" property="id"/>
|
||||
<result column="last_name" property="lastName"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="account_type" property="accountType"/>
|
||||
<result column="belong_to" property="belongTo"/>
|
||||
<result column="company_id" property="companyId"/>
|
||||
<result column="department_id" property="departmentId"/>
|
||||
<result column="job_activity" property="jobActivity"/>
|
||||
<result column="job_title" property="jobTitle"/>
|
||||
<result column="job_level" property="jobLevel"/>
|
||||
<result column="job_group_id" property="jobGroupId"/>
|
||||
<result column="job_activity_desc" property="jobActivityDesc"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="resource_image_id" property="resourceImageId"/>
|
||||
<result column="location_id" property="locationId"/>
|
||||
<result column="mobile" property="mobile"/>
|
||||
<result column="telephone" property="telephone"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="company_start_date" property="companyStartDate"/>
|
||||
<result column="work_start_date" property="workStartDate"/>
|
||||
<result column="show_order" property="showOrder"/>
|
||||
<result column="ec_department" property="ecDepartment"/>
|
||||
<result column="ec_company" property="ecCompany"/>
|
||||
<result column="uuid" property="uuid"/>
|
||||
<result column="job_grade" property="jobGrade"/>
|
||||
<result column="scheme_id" property="schemeId"/>
|
||||
<result column="sequence_id" property="sequenceId"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 表字段 -->
|
||||
<sql id="baseColumns">
|
||||
t.id,t.work_code,t.last_name,t.sex,t.status,t.account_type,
|
||||
t.belong_to,t.ec_company,t.job_title,t.ec_department,t.
|
||||
scheme_id,t.sequence_id,t.job_grade,t.job_level,t.job_group_id,
|
||||
t.job_activity,t.location_id,t.show_order,t.company_start_date,
|
||||
t.work_start_date,t.job_activity_desc,t.resource_image_id,t.mobile,
|
||||
t.telephone,t.email,t.uuid
|
||||
</sql>
|
||||
<update id="updateResourceJob">
|
||||
update jcl_org_hrmresource
|
||||
<set>
|
||||
job_title = #{targetJobId},
|
||||
company_id = #{parentComp},
|
||||
department_id = #{parentDept},
|
||||
ec_company = #{ecCompany},
|
||||
ec_department = #{ecDepartment},
|
||||
</set>
|
||||
where delete_type = 0 and job_title =#{originalJobId}
|
||||
</update>
|
||||
|
||||
<select id="listAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO">
|
||||
SELECT t.last_name as lastName,d.dept_name as departmentName,
|
||||
c.comp_name as companyName,t.mobile,t.telephone,t1.last_name as managerName
|
||||
from jcl_org_hrmresource t
|
||||
left join JCL_ORG_DEPT d on t.department_id = d.id
|
||||
left join jcl_org_comp c on t.company_id = c.id
|
||||
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
|
||||
where 1 = 1
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND t.id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
<!--<include refid="likeSql"/>-->
|
||||
<!--<if test="param.departmentId != null and param.departmentId != ''">-->
|
||||
<!--and t.department_id = #{param.departmentId}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="param.companyId != null and param.companyId != ''">-->
|
||||
<!--and t.company_id = #{param.companyId}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="param.mobile != null and param.mobile != ''">-->
|
||||
<!--and t.mobile = #{param.mobile}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="param.telephone != null and param.telephone != ''">-->
|
||||
<!--and t.telephone = #{param.telephone}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="param.managerId != null and param.managerId != ''">-->
|
||||
<!--and t.manager_id = #{param.managerId}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="param.mobileCall != null and param.mobileCall != ''">-->
|
||||
<!--and t.mobile_call = #{param.mobileCall}-->
|
||||
<!--</if>-->
|
||||
<!--<if test="param.jobTitle != null and param.jobTitle != ''">-->
|
||||
<!--and t.job_title = #{param.jobTitle}-->
|
||||
<!--</if>-->
|
||||
order by t.id asc;
|
||||
</select>
|
||||
<select id="getResourceListByJobId"
|
||||
resultMap="HrmResourceMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_hrmresource t where job_title = #{jobId}
|
||||
</select>
|
||||
<select id="getResourceById" resultType="com.engine.organization.entity.hrmresource.po.HrmResourcePO">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_hrmresource t where delete_type = 0 and id = #{id}
|
||||
</select>
|
||||
<select id="listByNo" resultMap="HrmResourceMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_hrmresource t where delete_type = 0 and work_code = #{workCode}
|
||||
</select>
|
||||
<select id="listDetachAll" resultType="com.engine.organization.entity.hrmresource.vo.HrmResourceVO">
|
||||
SELECT t.last_name as lastName,d.dept_name as departmentName,
|
||||
c.comp_name as companyName,t.mobile,t.telephone,t1.last_name as managerName
|
||||
from jcl_org_hrmresource t
|
||||
left join JCL_ORG_DEPT d on t.department_id = d.id
|
||||
left join jcl_org_comp c on t.company_id = c.id
|
||||
left join jcl_org_hrmresource t1 on t.manager_id = t1.id
|
||||
where 1 = 1
|
||||
<if test="ids != null and ids.size > 0">
|
||||
AND t.id IN
|
||||
<foreach collection="ids" open="(" item="id" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
AND c.id IN
|
||||
<foreach collection="companyIds" open="(" item="companyId" separator="," close=")">
|
||||
#{companyId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<sql id="likeSql">
|
||||
<if test="param.lastName != null and param.lastName != ''">
|
||||
AND t.last_name like CONCAT('%',#{param.lastName},'%')
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="likeSql" databaseId="oracle">
|
||||
<if test="param.lastName != null and param.lastName != ''">
|
||||
AND t.last_name like '%'||#{param.lastName}||'%'
|
||||
</if>
|
||||
</sql>
|
||||
<sql id="likeSql" databaseId="sqlserver">
|
||||
<if test="param.lastName != null and param.lastName != ''">
|
||||
AND t.last_name like '%'+#{param.lastName}+'%'
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
|
||||
</mapper>
|
@ -1,28 +0,0 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.personnelcard.Iframe;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface HrmPersonnelCardService {
|
||||
/**
|
||||
* 获取人事卡片信息
|
||||
*
|
||||
* @param uId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getPersonnelCard(Long uId);
|
||||
|
||||
/**
|
||||
* 获取人事自定义显示栏目
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<Iframe> getIframeList();
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public interface ManagerDetachService {
|
||||
|
||||
/**
|
||||
* 获取table列表
|
||||
* @param params
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> listPage(Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 新建编辑表单
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
Map<String, Object> getForm(Integer id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
int deleteByIds(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int save(ManagerDetachParam param);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
int updateDetach(ManagerDetachParam param);
|
||||
|
||||
/**
|
||||
* 分权开关
|
||||
* @param isDetach
|
||||
*/
|
||||
String doDetach(String isDetach);
|
||||
}
|
@ -0,0 +1,507 @@
|
||||
package com.engine.organization.service.impl;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.jingyou.*;
|
||||
import com.engine.organization.service.OrgChartService;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @className: OrgChartServiceImpl
|
||||
* @author: dengjp
|
||||
* @date: 2022/7/7
|
||||
* @description: 组织架构图ServiceImpl
|
||||
**/
|
||||
public class JyChartServiceImpl extends Service implements OrgChartService {
|
||||
|
||||
private static final String COMPANY_RIGHT = "OrgChart:All";
|
||||
private static final String USER_RIGHT = "OrgPerspective:All";
|
||||
RecordSet rs = new RecordSet();
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getOptionCondition(Map<String, Object> request2Map, User user) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
|
||||
rs.executeQuery("select id, companyname from HrmCompanyVirtual order by id");
|
||||
List<Map<String, Object>> fclasslist = new ArrayList<>();
|
||||
Map<String, Object> defaultItem = new HashMap<>();
|
||||
defaultItem.put("id", "0");
|
||||
defaultItem.put("companyname", "行政维度");
|
||||
fclasslist.add(defaultItem);
|
||||
while (rs.next()) {
|
||||
Map<String, Object> item = new HashMap<>();
|
||||
item.put("id", rs.getString("id"));
|
||||
item.put("companyname", rs.getString("companyname"));
|
||||
fclasslist.add(item);
|
||||
}
|
||||
// 集团数据
|
||||
String sql = "select concat('c_',id) as id, companyname as fname from hrmcompany";
|
||||
rs.executeQuery(sql);
|
||||
Set<JyOrgSelectItem> companySet = new HashSet<>();
|
||||
while (rs.next()) {
|
||||
JyOrgSelectItem item = new JyOrgSelectItem();
|
||||
item.setId("0");
|
||||
//item.setFnumber(rs.getString("fnumber"));
|
||||
item.setFname(rs.getString("fname"));
|
||||
companySet.add(item);
|
||||
}
|
||||
|
||||
|
||||
// 分部数据
|
||||
sql = "select concat('s_',id) as id,subcompanyname as fname, subcompanycode as fnumber from hrmsubcompany where ifnull(canceled,'0')='0' order by showorder ,showOrderOfTree";
|
||||
rs.executeQuery(sql);
|
||||
while (rs.next()) {
|
||||
JyOrgSelectItem item = new JyOrgSelectItem();
|
||||
item.setId(rs.getString("id"));
|
||||
item.setFnumber(rs.getString("fnumber"));
|
||||
item.setFname(rs.getString("fname"));
|
||||
companySet.add(item);
|
||||
}
|
||||
result.put("api_status", true);
|
||||
result.put("fclasslist", fclasslist);
|
||||
result.put("companylist", companySet);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getCompanyData(Map<String, Object> request2Map, User user) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, COMPANY_RIGHT, true);
|
||||
result.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// 根节点
|
||||
String root = (String) request2Map.get("root");
|
||||
// 显示层级
|
||||
String level = (String) request2Map.get("level");
|
||||
int currentLevel = Convert.toInt(level, 3);
|
||||
|
||||
// 维度
|
||||
String fclass = (String) request2Map.get("fclass");
|
||||
|
||||
// 当前维度
|
||||
boolean currentDimension = "0".equals(fclass);
|
||||
|
||||
|
||||
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
||||
if (StringUtils.isBlank(fisvitual)) {
|
||||
fisvitual = "0";
|
||||
}
|
||||
|
||||
|
||||
Set<JyChart> chartList = new LinkedHashSet<>();
|
||||
if (currentDimension) {
|
||||
if ("0".equals(root)) {
|
||||
// 集团
|
||||
rs.executeQuery("select * from hrmcompany");
|
||||
if (rs.next()) {
|
||||
JyChart item = new JyChart();
|
||||
item.setId("0");
|
||||
item.setFname(rs.getString("companyname"));
|
||||
item.setFtype("0");
|
||||
item.setFnumber(rs.getString("companycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand("1");
|
||||
chartList.add(item);
|
||||
buildSubCompanyData(item.getFecid(), "0", item.getId(), currentLevel, chartList);
|
||||
}
|
||||
} else if (root.startsWith("s_")) {
|
||||
// 分部
|
||||
String chartId = getChartId(root);
|
||||
rs.executeQuery("select * from hrmsubcompany where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
JyChart item = new JyChart();
|
||||
item.setId("s_" + rs.getString("id"));
|
||||
item.setFname(rs.getString("subcompanyname"));
|
||||
item.setFtype("1");
|
||||
item.setFnumber(rs.getString("subcompanycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand("1");
|
||||
chartList.add(item);
|
||||
buildSubCompanyData(rs.getString("companyid"), item.getFecid(), item.getId(), currentLevel, chartList);
|
||||
buildDepartmentData(item.getFecid(), "0", item.getId(), currentLevel, chartList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result.put("api_status", true);
|
||||
result.put("data", chartList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> asyncCompanyData(Map<String, Object> request2Map, User user) {
|
||||
String ids = (String) request2Map.get("ids");
|
||||
Set<JyChart> chartList = new LinkedHashSet<>();
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
String[] splitIds = ids.split(",");
|
||||
for (String splitId : splitIds) {
|
||||
if (splitId.startsWith("s_")) {
|
||||
// 分部
|
||||
String chartId = getChartId(splitId);
|
||||
rs.executeQuery("select * from hrmsubcompany where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
JyChart item = new JyChart();
|
||||
item.setId("s_" + rs.getString("id"));
|
||||
item.setParentId(splitId);
|
||||
item.setFname(rs.getString("subcompanyname"));
|
||||
item.setFtype("1");
|
||||
item.setFnumber(rs.getString("subcompanycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand("0");
|
||||
chartList.add(item);
|
||||
buildSubCompanyData(rs.getString("companyid"), item.getFecid(), item.getId(), 0, chartList);
|
||||
buildDepartmentData(item.getFecid(), "0", item.getId(), 0, chartList);
|
||||
}
|
||||
} else if (splitId.startsWith("d_")) {
|
||||
// 分部
|
||||
String chartId = getChartId(splitId);
|
||||
rs.executeQuery("select * from hrmdepartment where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
JyChart jyChart = new JyChart();
|
||||
jyChart.setId("d_" + rs.getString("id"));
|
||||
jyChart.setParentId(splitId);
|
||||
jyChart.setFname(rs.getString("departmentmark"));
|
||||
jyChart.setFtype("2");
|
||||
jyChart.setFnumber(rs.getString("departmentcode"));
|
||||
jyChart.setFecid(rs.getString("id"));
|
||||
jyChart.setUuid(rs.getString("uuid"));
|
||||
jyChart.setFisvitual("0");
|
||||
jyChart.setExpand("0");
|
||||
chartList.add(jyChart);
|
||||
String subCompanyId = rs.getString("subcompanyid1");
|
||||
buildDepartmentData(subCompanyId, jyChart.getFecid(), jyChart.getId(), 0, chartList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("api_status", true);
|
||||
result.put("data", chartList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getUserData(Map<String, Object> request2Map, User user) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, USER_RIGHT, true);
|
||||
result.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return result;
|
||||
}
|
||||
String root = (String) request2Map.get("root"); // 根节点
|
||||
String level = (String) request2Map.get("level"); // 显示层级
|
||||
int currentLevel = Convert.toInt(level, 3);
|
||||
// 维度
|
||||
String fclass = (String) request2Map.get("fclass");
|
||||
|
||||
// 当前维度
|
||||
boolean currentDimension = "0".equals(fclass);
|
||||
|
||||
String fisvitual = (String) request2Map.get("fisvitual"); // 是否显示虚拟组织
|
||||
if (StringUtils.isBlank(fisvitual)) {
|
||||
fisvitual = "0";
|
||||
}
|
||||
|
||||
|
||||
Set<JyChart> chartList = new LinkedHashSet<>();
|
||||
if (currentDimension) {
|
||||
if ("0".equals(root)) {
|
||||
// 集团
|
||||
rs.executeQuery("select * from hrmcompany");
|
||||
if (rs.next()) {
|
||||
JyCompanyChart item = new JyCompanyChart();
|
||||
item.setId("0");
|
||||
item.setFname(rs.getString("companyname"));
|
||||
item.setFtype("0");
|
||||
item.setFnumber(rs.getString("companycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand("1");
|
||||
chartList.add(item);
|
||||
buildSubCompanyUserData(item.getFecid(), "0", item.getId(), currentLevel, chartList);
|
||||
}
|
||||
} else if (root.startsWith("s_")) {
|
||||
// 分部
|
||||
String chartId = getChartId(root);
|
||||
rs.executeQuery("select * from hrmsubcompany where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
JySubCompanyChart item = new JySubCompanyChart();
|
||||
item.setId("s_" + rs.getString("id"));
|
||||
item.setFname(rs.getString("subcompanyname"));
|
||||
item.setFtype("1");
|
||||
item.setFnumber(rs.getString("subcompanycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand("1");
|
||||
chartList.add(item);
|
||||
buildSubCompanyUserData(rs.getString("companyid"), item.getFecid(), item.getId(), currentLevel, chartList);
|
||||
buildDepartmentUserData(item.getFecid(), "0", item.getId(), currentLevel, chartList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
result.put("api_status", true);
|
||||
result.put("data", chartList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> asyncUserData(Map<String, Object> request2Map, User user) {
|
||||
String ids = (String) request2Map.get("ids");
|
||||
Set<JyChart> chartList = new LinkedHashSet<>();
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
String[] splitIds = ids.split(",");
|
||||
for (String splitId : splitIds) {
|
||||
if (splitId.startsWith("s_")) {
|
||||
// 分部
|
||||
String chartId = getChartId(splitId);
|
||||
rs.executeQuery("select * from hrmsubcompany where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
JySubCompanyChart item = new JySubCompanyChart();
|
||||
item.setId("s_" + rs.getString("id"));
|
||||
item.setParentId(splitId);
|
||||
item.setFname(rs.getString("subcompanyname"));
|
||||
item.setFtype("1");
|
||||
item.setFnumber(rs.getString("subcompanycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand("0");
|
||||
chartList.add(item);
|
||||
buildSubCompanyUserData(rs.getString("companyid"), item.getFecid(), item.getId(), 0, chartList);
|
||||
buildDepartmentUserData(item.getFecid(), "0", item.getId(), 0, chartList);
|
||||
}
|
||||
} else if (splitId.startsWith("d_")) {
|
||||
// 部门
|
||||
String chartId = getChartId(splitId);
|
||||
rs.executeQuery("select * from hrmdepartment where id = ?", chartId);
|
||||
if (rs.next()) {
|
||||
JyDepartmentChart jyChart = new JyDepartmentChart();
|
||||
jyChart.setId("d_" + rs.getString("id"));
|
||||
jyChart.setParentId(splitId);
|
||||
jyChart.setFname(rs.getString("departmentmark"));
|
||||
jyChart.setFtype("2");
|
||||
jyChart.setFnumber(rs.getString("departmentcode"));
|
||||
jyChart.setFecid(rs.getString("id"));
|
||||
jyChart.setUuid(rs.getString("uuid"));
|
||||
jyChart.setFisvitual("0");
|
||||
jyChart.setExpand("0");
|
||||
chartList.add(jyChart);
|
||||
String subCompanyId = rs.getString("subcompanyid1");
|
||||
buildDepartmentUserData(subCompanyId, jyChart.getFecid(), jyChart.getId(), 0, chartList);
|
||||
buildJobUserData(jyChart.getFecid(), jyChart.getId(), 0, chartList);
|
||||
}
|
||||
}else if (splitId.startsWith("j_")) {
|
||||
// 岗位
|
||||
String chartId = getChartId(splitId);
|
||||
rs.executeQuery("select * from jcl_org_job where id = ? ", chartId);
|
||||
if (rs.next()) {
|
||||
JyJobChart jyChart = new JyJobChart();
|
||||
jyChart.setId("j_" + rs.getString("id"));
|
||||
jyChart.setParentId(splitId);
|
||||
jyChart.setFname(rs.getString("job_name"));
|
||||
jyChart.setFtype("3");
|
||||
jyChart.setFnumber(rs.getString("job_no"));
|
||||
jyChart.setFecid(rs.getString("id"));
|
||||
jyChart.setUuid(rs.getString("uuid"));
|
||||
jyChart.setFisvitual("0");
|
||||
jyChart.setExpand("0");
|
||||
chartList.add(jyChart);
|
||||
buildResourceUserData(jyChart.getFecid(), jyChart.getId(), 0, chartList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("api_status", true);
|
||||
result.put("data", chartList);
|
||||
return result;
|
||||
}
|
||||
|
||||
void buildSubCompanyData(String companyId, String parentId, String chartPid, int currentLevel, Set<JyChart> chartList) {
|
||||
if (currentLevel < 0) {
|
||||
return;
|
||||
}
|
||||
rs.executeQuery("select * from hrmsubcompany where companyid = " + companyId + " and ifnull(supsubcomid,0) = " + parentId + " and ifnull(canceled,0) = 0 order by showorder ,showOrderOfTree");
|
||||
List<JyChart> subCompanyList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
JyChart item = new JyChart();
|
||||
item.setId("s_" + rs.getString("id"));
|
||||
item.setParentId(chartPid);
|
||||
item.setFname(rs.getString("subcompanyname"));
|
||||
item.setFtype("1");
|
||||
item.setFnumber(rs.getString("subcompanycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand(currentLevel > 0 ? "1" : "0");
|
||||
subCompanyList.add(item);
|
||||
}
|
||||
chartList.addAll(subCompanyList);
|
||||
|
||||
for (JyChart jyChart : subCompanyList) {
|
||||
buildSubCompanyData(companyId, jyChart.getFecid(), jyChart.getId(), currentLevel - 1, chartList);
|
||||
buildDepartmentData(jyChart.getFecid(), "0", jyChart.getId(), currentLevel - 1, chartList);
|
||||
}
|
||||
}
|
||||
|
||||
void buildDepartmentData(String subCompanyId, String parentId, String chartPid, int currentLevel, Set<JyChart> chartList) {
|
||||
if (currentLevel < 0) {
|
||||
return;
|
||||
}
|
||||
rs.executeQuery("select * from hrmdepartment where subcompanyid1 = " + subCompanyId + " and ifnull(supdepid,0) = " + parentId + " and ifnull(canceled,0) = 0 order by showorder ,showorderoftree");
|
||||
List<JyChart> departmentList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
JyChart item = new JyChart();
|
||||
item.setId("d_" + rs.getString("id"));
|
||||
item.setParentId(chartPid);
|
||||
item.setFname(rs.getString("departmentmark"));
|
||||
item.setFtype("2");
|
||||
item.setFnumber(rs.getString("departmentcode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand(currentLevel > 0 ? "1" : "0");
|
||||
departmentList.add(item);
|
||||
}
|
||||
chartList.addAll(departmentList);
|
||||
for (JyChart jyChart : departmentList) {
|
||||
buildDepartmentData(subCompanyId, jyChart.getFecid(), jyChart.getId(), currentLevel - 1, chartList);
|
||||
}
|
||||
}
|
||||
|
||||
void buildSubCompanyUserData(String companyId, String parentId, String chartPid, int currentLevel, Set<JyChart> chartList) {
|
||||
if (currentLevel < 0) {
|
||||
return;
|
||||
}
|
||||
rs.executeQuery("select * from hrmsubcompany where companyid = " + companyId + " and ifnull(supsubcomid,0) = " + parentId + " and ifnull(canceled,0) = 0 order by showorder ,showOrderOfTree");
|
||||
List<JySubCompanyChart> subCompanyList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
JySubCompanyChart item = new JySubCompanyChart();
|
||||
item.setId("s_" + rs.getString("id"));
|
||||
item.setParentId(chartPid);
|
||||
item.setFname(rs.getString("subcompanyname"));
|
||||
item.setFtype("1");
|
||||
item.setFnumber(rs.getString("subcompanycode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand(currentLevel > 0 ? "1" : "0");
|
||||
subCompanyList.add(item);
|
||||
}
|
||||
chartList.addAll(subCompanyList);
|
||||
|
||||
for (JySubCompanyChart jyChart : subCompanyList) {
|
||||
buildSubCompanyUserData(companyId, jyChart.getFecid(), jyChart.getId(), currentLevel - 1, chartList);
|
||||
buildDepartmentUserData(jyChart.getFecid(), "0", jyChart.getId(), currentLevel - 1, chartList);
|
||||
}
|
||||
}
|
||||
|
||||
void buildDepartmentUserData(String subCompanyId, String parentId, String chartPid, int currentLevel, Set<JyChart> chartList) {
|
||||
if (currentLevel < 0) {
|
||||
return;
|
||||
}
|
||||
String sql = "select * from hrmdepartment where subcompanyid1 = " + subCompanyId + " and ifnull(supdepid,0) = " + parentId + " and ifnull(canceled,0) = 0 order by showorder ,showorderoftree";
|
||||
rs.executeQuery(sql);
|
||||
List<JyDepartmentChart> departmentList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
JyDepartmentChart item = new JyDepartmentChart();
|
||||
item.setId("d_" + rs.getString("id"));
|
||||
item.setParentId(chartPid);
|
||||
item.setFname(rs.getString("departmentmark"));
|
||||
item.setFtype("2");
|
||||
item.setFnumber(rs.getString("departmentcode"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand(currentLevel > 0 ? "1" : "0");
|
||||
departmentList.add(item);
|
||||
}
|
||||
chartList.addAll(departmentList);
|
||||
for (JyDepartmentChart jyChart : departmentList) {
|
||||
buildDepartmentUserData(subCompanyId, jyChart.getFecid(), jyChart.getId(), currentLevel - 1, chartList);
|
||||
buildJobUserData(jyChart.getFecid(), jyChart.getId(), currentLevel - 1, chartList);
|
||||
}
|
||||
}
|
||||
|
||||
void buildJobUserData(String departmentId, String chartPid, int currentLevel, Set<JyChart> chartList) {
|
||||
if (currentLevel < 0) {
|
||||
return;
|
||||
}
|
||||
rs.executeQuery("select * from jcl_org_job where ec_department = ? and ifnull(forbidden_tag,0)=0 and ifnull(delete_type,0)=0 order by show_order ", departmentId);
|
||||
List<JyJobChart> jobList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
JyJobChart item = new JyJobChart();
|
||||
item.setId("j_" + rs.getString("id"));
|
||||
item.setParentId(chartPid);
|
||||
item.setFname(rs.getString("job_name"));
|
||||
item.setFtype("3");
|
||||
item.setFnumber(rs.getString("job_no"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand(currentLevel > 0 ? "1" : "0");
|
||||
jobList.add(item);
|
||||
}
|
||||
chartList.addAll(jobList);
|
||||
for (JyJobChart jyChart : jobList) {
|
||||
// 查询人员
|
||||
buildResourceUserData(jyChart.getFecid(), jyChart.getId(), currentLevel - 1, chartList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void buildResourceUserData(String jobId, String chartPid, int currentLevel, Set<JyChart> chartList) {
|
||||
if (currentLevel < 0) {
|
||||
return;
|
||||
}
|
||||
rs.executeQuery("select a.id,a.lastname from hrmresource a inner join cus_fielddata b on a.id = b.id and b.scope ='hrmcustomfieldbyinfotype' and b.scopeid ='-1' where a.status < 4 and b.field100002 = ?", jobId);
|
||||
List<JyResourceChart> resourceList = new ArrayList<>();
|
||||
while (rs.next()) {
|
||||
JyResourceChart item = new JyResourceChart();
|
||||
item.setId("r_" + rs.getString("id"));
|
||||
item.setParentId(chartPid);
|
||||
item.setFname(rs.getString("lastname"));
|
||||
item.setFtype("4");
|
||||
item.setFnumber(rs.getString("hrmresource"));
|
||||
item.setFecid(rs.getString("id"));
|
||||
item.setUuid(rs.getString("uuid"));
|
||||
item.setFisvitual("0");
|
||||
item.setExpand(currentLevel > 0 ? "1" : "0");
|
||||
resourceList.add(item);
|
||||
}
|
||||
chartList.addAll(resourceList);
|
||||
}
|
||||
|
||||
|
||||
public static String getChartId(String id) {
|
||||
if (StringUtils.isNotBlank(id)) {
|
||||
String[] split = id.split("_");
|
||||
if (split.length == 2) {
|
||||
return split[1];
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
@ -1,192 +0,0 @@
|
||||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.api.browser.bean.BrowserBean;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.api.browser.bean.SearchConditionOption;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.component.OrganizationWeaTable;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import com.engine.organization.entity.detach.vo.ManagerDetachVO;
|
||||
import com.engine.organization.mapper.detach.ManagerDetachMapper;
|
||||
import com.engine.organization.mapper.employee.EmployeeMapper;
|
||||
import com.engine.organization.mapper.hrmresource.HrmResourceMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.service.ManagerDetachService;
|
||||
import com.engine.organization.util.HasRightUtil;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.db.DBType;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.engine.organization.util.relation.EcHrmRelationUtil;
|
||||
import com.weaver.file.ConfigOperator;
|
||||
import com.weaver.general.BaseBean;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachServiceImpl extends Service implements ManagerDetachService {
|
||||
|
||||
|
||||
private static final String RIGHT_NAME = "MangerDeatch:All";
|
||||
|
||||
public ManagerDetachMapper getMangeDetachMapper() {
|
||||
return MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
}
|
||||
|
||||
public HrmResourceMapper getHrmResourceMapper() {
|
||||
return MapperProxyFactory.getProxy(HrmResourceMapper.class);
|
||||
}
|
||||
|
||||
public EmployeeMapper getEmployeeMapper() {
|
||||
return MapperProxyFactory.getProxy(EmployeeMapper.class);
|
||||
}
|
||||
|
||||
public SystemDataMapper getSystemDataMapper(){
|
||||
return MapperProxyFactory.getProxy(SystemDataMapper.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
Map<String, Object> resultMap = new HashMap<>();
|
||||
boolean hasRight = HasRightUtil.hasRight(user, RIGHT_NAME, true);
|
||||
resultMap.put("hasRight", hasRight);
|
||||
if (!hasRight) {
|
||||
return resultMap;
|
||||
}
|
||||
String detach = new BaseBean().getPropValue("hrmOrganization", "detach");
|
||||
resultMap.put("isDetach",detach);
|
||||
OrganizationWeaTable<ManagerDetachVO> table = new OrganizationWeaTable<>(user, ManagerDetachVO.class);
|
||||
String sqlWhere = buildSqlWhere(params);
|
||||
table.setSqlwhere(sqlWhere);
|
||||
WeaResultMsg result = new WeaResultMsg(false);
|
||||
result.putAll(table.makeDataResult());
|
||||
result.success();
|
||||
resultMap.putAll(result.getResultMap());
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getForm(Integer id) {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionItem> selectItems = new ArrayList<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionOption> selectOptions = new ArrayList<>();
|
||||
SearchConditionOption moduleOption = new SearchConditionOption("0", "组织管理",true);
|
||||
selectOptions.add(moduleOption);
|
||||
|
||||
SearchConditionItem ecManager = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, true, "管理员", "1", "ecManager", "");
|
||||
ecManager.setRules("required|string");
|
||||
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 3, false, "可维护机构", "194", "ecRolelevel", "");
|
||||
ecRolelevel.setRules("required|string");
|
||||
SearchConditionItem module = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "可管理模块", "module");
|
||||
module.setViewAttr(1);
|
||||
module.setDetailtype(2);
|
||||
module.setHasBorder(true);
|
||||
if (id != null) {
|
||||
ManagerDetachPO detachById = getMangeDetachMapper().getDetachById(id);
|
||||
BrowserBean manager = ecManager.getBrowserConditionParam();
|
||||
manager.setReplaceDatas(getEmployeeMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcManager())).build().getIds()));
|
||||
ecManager.setBrowserConditionParam(manager);
|
||||
BrowserBean roleLevel = ecRolelevel.getBrowserConditionParam();
|
||||
roleLevel.setReplaceDatas(getSystemDataMapper().getBrowserDatas(DeleteParam.builder().ids(String.valueOf(detachById.getEcRolelevel())).build().getIds()));
|
||||
ecRolelevel.setBrowserConditionParam(roleLevel);
|
||||
}
|
||||
selectItems.add(ecManager);
|
||||
selectItems.add(ecRolelevel);
|
||||
selectItems.add(module);
|
||||
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
||||
apiDatas.put("condition", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
return getMangeDetachMapper().deleteByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int save(ManagerDetachParam param) {
|
||||
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
|
||||
.managerType(0)
|
||||
.ecManager(param.getEcManager())
|
||||
.jclManager(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
|
||||
.ecRolelevel(param.getEcRolelevel())
|
||||
.jclRolelevel(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
|
||||
.manageModule("组织管理")
|
||||
.creator((long)user.getUID())
|
||||
.deleteType(0)
|
||||
.createTime(new Date())
|
||||
.updateTime(new Date())
|
||||
.build();
|
||||
|
||||
return getMangeDetachMapper().insertIgnoreNull(managerDetachPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateDetach(ManagerDetachParam param) {
|
||||
ManagerDetachPO managerDetachPO = ManagerDetachPO.builder()
|
||||
.id(param.getId())
|
||||
.ecManager(param.getEcManager())
|
||||
.jclManager(getHrmResourceMapper().getJclResourceId(String.valueOf(param.getEcManager())).intValue())
|
||||
.ecRolelevel(param.getEcRolelevel())
|
||||
.jclRolelevel(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel()) != null ? String.valueOf(EcHrmRelationUtil.getBatchJclCompanyId(param.getEcRolelevel())) : null)
|
||||
.build();
|
||||
return getMangeDetachMapper().updateDetach(managerDetachPO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String doDetach(String isDetach) {
|
||||
ConfigOperator ConfigOperator = new ConfigOperator();
|
||||
ConfigOperator.setProp("hrmOrganization.properties", "detach", isDetach);
|
||||
return new BaseBean().getPropValue("hrmOrganization", "detach");
|
||||
}
|
||||
|
||||
private String buildSqlWhere(Map<String, Object> params) {
|
||||
DBType dbType = DBType.get(new RecordSet().getDBType());
|
||||
String sqlWhere = " where delete_type = 0";
|
||||
String lastName = (String) params.get("ecManager");
|
||||
List<Long> resourceIds = MapperProxyFactory.getProxy(EmployeeMapper.class).getResourceIds(lastName);
|
||||
String ecManager = StringUtils.join(resourceIds,",");
|
||||
if (StringUtils.isNotBlank(lastName)) {
|
||||
sqlWhere += " AND ec_manager in ("+ecManager+") ";
|
||||
}
|
||||
String ecRolelevel = (String) params.get("ecRolelevel");
|
||||
if (StringUtils.isNotBlank(ecRolelevel)) {
|
||||
sqlWhere += " AND " + dbType.concat("ec_rolelevel") + dbType.like(ecRolelevel);
|
||||
}
|
||||
return sqlWhere;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询当前人员所辖分部JCL_ID
|
||||
* @param uId
|
||||
* @return
|
||||
*/
|
||||
public static List<Long> getJclRoleLevels(Integer uId) {
|
||||
List<Long> ecRoleLevels = new ArrayList<>();
|
||||
ManagerDetachMapper mangeDetachMapper = MapperProxyFactory.getProxy(ManagerDetachMapper.class);
|
||||
List<ManagerDetachPO> detachListById = mangeDetachMapper.getDetachListById(uId);
|
||||
for (ManagerDetachPO managerDetachPO : detachListById) {
|
||||
List<Long> ids = Stream.of(managerDetachPO.getJclRolelevel().split(",")).map(Long::parseLong).collect(Collectors.toList());
|
||||
if (CollectionUtils.isNotEmpty(ids)) {
|
||||
ecRoleLevels.addAll(ids);
|
||||
}
|
||||
}
|
||||
return ecRoleLevels;
|
||||
}
|
||||
}
|
@ -0,0 +1,170 @@
|
||||
package com.engine.organization.trigger.cusfielddata;
|
||||
|
||||
import com.engine.organization.entity.commom.RecordInfo;
|
||||
import com.engine.organization.entity.cusfielddata.po.CusFieldData;
|
||||
import com.engine.organization.entity.extend.param.ExtendInfoParams;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.entity.postion.po.PostInfoPO;
|
||||
import com.engine.organization.entity.postion.po.PostPO;
|
||||
import com.engine.organization.entity.scheme.po.GradePO;
|
||||
import com.engine.organization.entity.scheme.po.LevelPO;
|
||||
import com.engine.organization.entity.scheme.po.SchemePO;
|
||||
import com.engine.organization.entity.sequence.po.SequencePO;
|
||||
import com.engine.organization.mapper.extend.ExtMapper;
|
||||
import com.engine.organization.mapper.hrmresource.SystemDataMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.mapper.post.PostInfoMapper;
|
||||
import com.engine.organization.mapper.post.PostMapper;
|
||||
import com.engine.organization.mapper.scheme.GradeMapper;
|
||||
import com.engine.organization.mapper.scheme.LevelMapper;
|
||||
import com.engine.organization.mapper.scheme.SchemeMapper;
|
||||
import com.engine.organization.mapper.sequence.SequenceMapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import com.wbi.util.Util;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/08/01
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class CusFieldDataTrigger {
|
||||
|
||||
|
||||
public static void run(Long id) {
|
||||
if (null == id) {
|
||||
// 查询人员表最新插入的ID
|
||||
id = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmResourceMaxId();
|
||||
if (null == id) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
boolean updateFlag = false;
|
||||
// 查询当前操作的数据
|
||||
CusFieldData sourceData = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmCusFieldDataByIdAndScopeId(id, -1L);
|
||||
String sourceField100001 = sourceData.getField100001();
|
||||
String sourceField100002 = sourceData.getField100002();
|
||||
String sourceField100003 = sourceData.getField100003();
|
||||
|
||||
// 查询需要更新的数据,没有则创建数据
|
||||
CusFieldData directionData = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmCusFieldDataByIdAndScopeId(id, 3L);
|
||||
if (null == directionData) {
|
||||
directionData = new CusFieldData();
|
||||
directionData.setScope("HrmCustomFieldByInfoType");
|
||||
directionData.setScopeId(3L);
|
||||
directionData.setId(id);
|
||||
MapperProxyFactory.getProxy(SystemDataMapper.class).insertCusFieldData(directionData);
|
||||
}
|
||||
|
||||
// field100002更新
|
||||
if (StringUtils.isNotBlank(sourceField100002)) {
|
||||
directionData.setField100002(sourceField100002);
|
||||
Long gwId = Long.parseLong(sourceField100002);
|
||||
JobPO jobById = MapperProxyFactory.getProxy(JobMapper.class).getJobById(gwId);
|
||||
if (null != jobById) {
|
||||
RecordInfo hrmJobTitleByName = MapperProxyFactory.getProxy(SystemDataMapper.class).getHrmJobTitleByName(jobById.getJobName());
|
||||
if(null!=hrmJobTitleByName) {
|
||||
Long ecGwId = StringUtils.isNotBlank(hrmJobTitleByName.getId()) ? Long.parseLong(hrmJobTitleByName.getId()) : null;
|
||||
Long ecBmId = jobById.getEcDepartment();
|
||||
Long ecGsId = jobById.getEcCompany();
|
||||
Map<String, Object> hrmResourceMap = new HashMap<>();
|
||||
// 岗位
|
||||
hrmResourceMap.put("jobtitle", ecGwId);
|
||||
// 部门
|
||||
hrmResourceMap.put("departmentid", ecBmId);
|
||||
// 公司
|
||||
hrmResourceMap.put("subcompanyid1", ecGsId);
|
||||
MapperProxyFactory.getProxy(ExtMapper.class).updateTable(ExtendInfoParams.builder().id(id).tableName("hrmresource").params(hrmResourceMap).build());
|
||||
updateFlag = true;
|
||||
|
||||
// 职等职级为空,从岗位取值、更新
|
||||
if (StringUtils.isBlank(sourceField100001)) {
|
||||
if (StringUtils.isNotBlank(jobById.getLevelId())) {
|
||||
// 通过岗位关联,如有多个职等,选取第一个
|
||||
String[] levelArray = jobById.getLevelId().split(",");
|
||||
LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(Long.parseLong(levelArray[0]));
|
||||
directionData.setField100008(levelByID.getLevelName());
|
||||
} else {
|
||||
directionData.setField100008(null);
|
||||
}
|
||||
// 职等职级方案
|
||||
if (StringUtils.isNotBlank(Util.null2String(jobById.getSchemeId()))) {
|
||||
SchemePO schemeByID = MapperProxyFactory.getProxy(SchemeMapper.class).getSchemeByID(jobById.getSchemeId());
|
||||
directionData.setField100006(schemeByID.getSchemeName());
|
||||
} else {
|
||||
directionData.setField100006(null);
|
||||
}
|
||||
// 职级
|
||||
if (StringUtils.isNotBlank(jobById.getGradeId())) {
|
||||
GradePO gradeByLevelId = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(Long.parseLong(jobById.getGradeId()));
|
||||
directionData.setField100007(gradeByLevelId.getGradeName());
|
||||
} else {
|
||||
directionData.setField100007(null);
|
||||
}
|
||||
// 岗位序列
|
||||
if (StringUtils.isNotBlank(Util.null2String(jobById.getSequenceId()))) {
|
||||
SequencePO sequenceBySchemeId = MapperProxyFactory.getProxy(SequenceMapper.class).getSequenceByID(jobById.getSequenceId());
|
||||
directionData.setField100005(sequenceBySchemeId.getSequenceName());
|
||||
} else {
|
||||
directionData.setField100005(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
directionData.setField100002(null);
|
||||
directionData.setField100008(null);
|
||||
directionData.setField100006(null);
|
||||
directionData.setField100007(null);
|
||||
directionData.setField100005(null);
|
||||
}
|
||||
|
||||
// field100001更新,职等职级
|
||||
if (null != sourceField100001 && sourceField100001.split("A").length == 3) {
|
||||
directionData.setField100001(sourceField100001);
|
||||
String[] field100001Array = sourceField100001.split("A");
|
||||
// 职等
|
||||
long zdId = Long.parseLong(field100001Array[2]);
|
||||
long zjId = Long.parseLong(field100001Array[1]);
|
||||
long xlId = Long.parseLong(field100001Array[0].split("_")[1]);
|
||||
|
||||
LevelPO levelByID = MapperProxyFactory.getProxy(LevelMapper.class).getLevelByID(zdId);
|
||||
directionData.setField100008(levelByID.getLevelName());
|
||||
// 职等职级方案
|
||||
SchemePO schemeByID = MapperProxyFactory.getProxy(SchemeMapper.class).getSchemeByID(levelByID.getSchemeId());
|
||||
directionData.setField100006(schemeByID.getSchemeName());
|
||||
// 职级
|
||||
GradePO gradeByLevelId = MapperProxyFactory.getProxy(GradeMapper.class).getGradeByID(zjId);
|
||||
directionData.setField100007(gradeByLevelId.getGradeName());
|
||||
// 岗位序列
|
||||
SequencePO sequenceBySchemeId = MapperProxyFactory.getProxy(SequenceMapper.class).getSequenceByID(xlId);
|
||||
directionData.setField100005(sequenceBySchemeId.getSequenceName());
|
||||
updateFlag = true;
|
||||
}
|
||||
|
||||
|
||||
if (null != sourceField100003 && sourceField100003.split("_").length == 2) {
|
||||
directionData.setField100003(sourceField100003);
|
||||
String[] field100003Array = sourceField100003.split("_");
|
||||
long zwId = Long.parseLong(field100003Array[1]);
|
||||
// 职务
|
||||
PostInfoPO postInfoByID = MapperProxyFactory.getProxy(PostInfoMapper.class).getPostInfoByID(zwId);
|
||||
directionData.setField100010(postInfoByID.getPostInfoName());
|
||||
// 职务分类
|
||||
PostPO postByID = MapperProxyFactory.getProxy(PostMapper.class).getPostByID(postInfoByID.getPostId());
|
||||
directionData.setField100009(postByID.getPostName());
|
||||
updateFlag = true;
|
||||
}
|
||||
|
||||
// 更新数据
|
||||
if (updateFlag) {
|
||||
MapperProxyFactory.getProxy(SystemDataMapper.class).updateCusFieldData(directionData);
|
||||
}
|
||||
// 刷新组织结构图
|
||||
// new HrmResourceTriggerRunnable(id).run();
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
package com.engine.organization.util.detach;
|
||||
|
||||
import com.engine.organization.entity.company.po.CompPO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.job.dto.JobListDTO;
|
||||
import com.engine.organization.entity.job.po.JobPO;
|
||||
import com.engine.organization.service.impl.ManagerDetachServiceImpl;
|
||||
import com.weaver.general.BaseBean;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/28
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class DetachUtil {
|
||||
private boolean DETACH = "true".equals(new BaseBean().getPropValue("hrmOrganization", "detach"));
|
||||
|
||||
private final List<Long> jclRoleLevels;
|
||||
|
||||
public DetachUtil(Integer uId) {
|
||||
if (1 == uId) {
|
||||
DETACH = false;
|
||||
}
|
||||
if (DETACH) {
|
||||
jclRoleLevels = ManagerDetachServiceImpl.getJclRoleLevels(uId);
|
||||
} else {
|
||||
jclRoleLevels = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterCompanyList(List<CompPO> companyList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(companyList)) {
|
||||
companyList.removeIf(item -> !jclRoleLevels.contains(item.getId()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterDepartmentList(List<DepartmentPO> departmentList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(departmentList)) {
|
||||
departmentList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterJobDTOList(List<JobListDTO> jobList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据分权配置过滤分部
|
||||
*/
|
||||
public void filterJobList(List<JobPO> jobList) {
|
||||
if (DETACH && CollectionUtils.isNotEmpty(jobList)) {
|
||||
jobList.removeIf(item -> !jclRoleLevels.contains(item.getParentComp()));
|
||||
}
|
||||
}
|
||||
|
||||
public String getJclRoleLevels() {
|
||||
return StringUtils.join(jclRoleLevels, ",");
|
||||
}
|
||||
|
||||
public boolean isDETACH() {
|
||||
return DETACH;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -1,228 +0,0 @@
|
||||
package com.engine.organization.web;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.HrmResourceWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class HrmResourceController {
|
||||
public HrmResourceWrapper getHrmResourceWrapper(User user) {
|
||||
return ServiceUtil.getService(HrmResourceWrapper.class, user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 左侧树接口
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getSearchTree")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public Map<String, Object> getSearchTree(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
SearchTreeParams params = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), SearchTreeParams.class);
|
||||
return getHrmResourceWrapper(user).getSearchTree(params);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取list列表
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/listPage")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult listPage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
HrmResourceSearchParam param = JSONObject.toJavaObject((JSON) JSONObject.toJSON(map), HrmResourceSearchParam.class);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).listPage(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新增表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getSaveForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getSaveForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getSaveForm());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/saveBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveBaseForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody Map<String, Object> params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).saveBaseForm(params));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取基础表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getBaseForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getBaseForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getBaseForm(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新表单
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@POST
|
||||
@Path("/updateForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult updateForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).updateForm(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 高级搜索条件
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getSearchCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getSearchCondition(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表页顶部按钮
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@GET
|
||||
@Path("/getHasRight")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getHasRight(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getHasRight());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getTabForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getTabForm(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).getTabForm(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/saveTabForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveTabForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody HrmRelationSaveParam params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).saveTabForm(params));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/updateTabForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult updateTabForm(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody HrmRelationSaveParam params) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getHrmResourceWrapper(user).updateTabForm(params));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,134 +0,0 @@
|
||||
package com.engine.organization.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.DeleteParam;
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.ManagerDetachWrapper;
|
||||
import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.*;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description: 模块管理分权
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachController {
|
||||
|
||||
public ManagerDetachWrapper getManagerDetachWrapper(User user) {
|
||||
return ServiceUtil.getService(ManagerDetachWrapper.class,user);
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getTable")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult listPage(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).listPage(map));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getTableBtn")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getTableBtn(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).getTableBtn());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@GET
|
||||
@Path("/getSearchCondition")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getSearchCondition(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).getSearchCondition());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getForm")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getForm(@Context HttpServletRequest request, @Context HttpServletResponse response,
|
||||
@QueryParam("id") Integer id) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).getForm(id));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/deleteByIds")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult deleteByIds(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody DeleteParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).deleteByIds(param.getIds()));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/save")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveDetach(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ManagerDetachParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).save(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@POST
|
||||
@Path("/update")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult updateDetach(@Context HttpServletRequest request, @Context HttpServletResponse response, @RequestBody ManagerDetachParam param) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).updateDetach(param));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/doDetach")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult doDetach(@Context HttpServletRequest request,@Context HttpServletResponse response,
|
||||
@QueryParam("idDetach") String isDetach) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getManagerDetachWrapper(user).doDetach(isDetach));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
package com.engine.organization.web;
|
||||
|
||||
import com.engine.common.util.ParamUtil;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.util.response.ReturnResult;
|
||||
import com.engine.organization.wrapper.PersonnelCardWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/09
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PersonnelCardController {
|
||||
public PersonnelCardWrapper getPersonnelCardWrapper(User user) {
|
||||
return ServiceUtil.getService(PersonnelCardWrapper.class, user);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getPersonnelCard")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getPersonnelCard(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
Map<String, Object> map = ParamUtil.request2Map(request);
|
||||
String id = Util.null2String(map.get("id"));
|
||||
return ReturnResult.successed(getPersonnelCardWrapper(user).getPersonnelCard(StringUtils.isBlank(id) ? null : Long.parseLong(id)));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/getIframeList")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult getIframeList(@Context HttpServletRequest request, @Context HttpServletResponse response) {
|
||||
try {
|
||||
User user = HrmUserVarify.getUser(request, response);
|
||||
return ReturnResult.successed(getPersonnelCardWrapper(user).getIframeList());
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmRelationSaveParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.service.impl.HrmResourceServiceImpl;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/21
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class HrmResourceWrapper extends OrganizationWrapper {
|
||||
private HrmResourceService getHrmResourceService(User user) {
|
||||
return ServiceUtil.getService(HrmResourceServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> getSearchTree(SearchTreeParams params) {
|
||||
return getHrmResourceService(user).getSearchTree(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> listPage(HrmResourceSearchParam params) {
|
||||
return getHrmResourceService(user).listPage(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getSaveForm() {
|
||||
return getHrmResourceService(user).getSaveForm();
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD, operateModule = LogModuleNameEnum.RESOURCE, operateDesc = "新增人员")
|
||||
public Long saveBaseForm(Map<String, Object> params) {
|
||||
Long resourceId = getHrmResourceService(user).saveBaseForm(params);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), params.get("last_name").toString(), JSON.toJSONString(params), "新增人员");
|
||||
return resourceId;
|
||||
}
|
||||
|
||||
public Map<String, Object> getBaseForm(Map<String, Object> params) {
|
||||
return getHrmResourceService(user).getBaseForm(params);
|
||||
}
|
||||
|
||||
public int updateForm(Map<String, Object> params) {
|
||||
int updateForm = getHrmResourceService(user).updateForm(params);
|
||||
return updateForm;
|
||||
}
|
||||
|
||||
public Map<String, Object> getSearchCondition(Map<String, Object> params) {
|
||||
return getHrmResourceService(user).getSearchCondition(params);
|
||||
}
|
||||
|
||||
public Map<String, Object> getHasRight() {
|
||||
return getHrmResourceService(user).getHasRight();
|
||||
}
|
||||
|
||||
public Map<String, Object> getTabForm(Map<String, Object> params) {
|
||||
return getHrmResourceService(user).getTabForm(params);
|
||||
}
|
||||
|
||||
public long saveTabForm(HrmRelationSaveParam params) {
|
||||
return getHrmResourceService(user).saveTabForm(params);
|
||||
}
|
||||
|
||||
public long updateTabForm(HrmRelationSaveParam params) {
|
||||
return getHrmResourceService(user).updateTabForm(params);
|
||||
}
|
||||
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.annotation.Log;
|
||||
import com.engine.organization.entity.detach.param.ManagerDetachParam;
|
||||
import com.engine.organization.entity.detach.po.ManagerDetachPO;
|
||||
import com.engine.organization.enums.LogModuleNameEnum;
|
||||
import com.engine.organization.enums.OperateTypeEnum;
|
||||
import com.engine.organization.mapper.detach.ManagerDetachMapper;
|
||||
import com.engine.organization.service.ManagerDetachService;
|
||||
import com.engine.organization.service.impl.ManagerDetachServiceImpl;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationFormItemUtil;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import com.engine.organization.util.db.MapperProxyFactory;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @Author weaver_cl
|
||||
* @Description:
|
||||
* @Date 2022/10/21
|
||||
* @Version V1.0
|
||||
**/
|
||||
public class ManagerDetachWrapper extends OrganizationWrapper {
|
||||
|
||||
public ManagerDetachService getManagerDetachService(User user) {
|
||||
return ServiceUtil.getService(ManagerDetachServiceImpl.class,user);
|
||||
}
|
||||
|
||||
public Map<String, Object> listPage(Map<String, Object> params) {
|
||||
return getManagerDetachService(user).listPage(params);
|
||||
}
|
||||
|
||||
public Map<String, List<MenuBtn>> getTableBtn() {
|
||||
return MenuBtn.getCommonBtnDatas();
|
||||
}
|
||||
|
||||
public Map<String, Object> getSearchCondition() {
|
||||
Map<String, Object> apiDatas = new HashMap<>();
|
||||
List<SearchConditionGroup> addGroups = new ArrayList<>();
|
||||
List<SearchConditionItem> conditionItems = new ArrayList<>();
|
||||
SearchConditionItem ecManager = OrganizationFormItemUtil.inputItem(user, 2, 16, 2, 50, "管理员名称", "ecManager");
|
||||
SearchConditionItem ecRolelevel = OrganizationFormItemUtil.browserItem(user, 2, 16, 2, false, "可管理组织机构", "164", "ecRolelevel", "");
|
||||
conditionItems.add(ecManager);
|
||||
conditionItems.add(ecRolelevel);
|
||||
addGroups.add(new SearchConditionGroup("高级搜索条件", true, conditionItems));
|
||||
apiDatas.put("conditions", addGroups);
|
||||
return apiDatas;
|
||||
}
|
||||
|
||||
public Map<String, Object> getForm(Integer id) {
|
||||
return getManagerDetachService(user).getForm(id);
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.DELETE,operateModule = LogModuleNameEnum.DETACH,operateDesc = "删除分权数据")
|
||||
public int deleteByIds(Collection<Long> ids) {
|
||||
List<ManagerDetachPO> managerDetachPOS = MapperProxyFactory.getProxy(ManagerDetachMapper.class).selectByIds(ids);
|
||||
int deleteByIds = getManagerDetachService(user).deleteByIds(ids);
|
||||
for (ManagerDetachPO managerDetachPO : managerDetachPOS) {
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), String.valueOf(managerDetachPO.getEcManager()), JSON.toJSONString(ids), "删除等级方案");
|
||||
}
|
||||
return deleteByIds;
|
||||
}
|
||||
|
||||
|
||||
@Log(operateType = OperateTypeEnum.ADD,operateModule = LogModuleNameEnum.DETACH,operateDesc = "新增分权管理员")
|
||||
public int save(ManagerDetachParam param) {
|
||||
int save = getManagerDetachService(user).save(param);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), String.valueOf(param.getEcManager()), JSON.toJSONString(param), "新增分权管理员");
|
||||
return save;
|
||||
}
|
||||
|
||||
@Log(operateType = OperateTypeEnum.UPDATE, operateModule = LogModuleNameEnum.DETACH, operateDesc = "分权数据更新")
|
||||
public int updateDetach(ManagerDetachParam param) {
|
||||
ManagerDetachPO managerDetachPO = MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachById(param.getId());
|
||||
int result = getManagerDetachService(user).updateDetach(param);
|
||||
writeOperateLog(new Object() {
|
||||
}.getClass(), String.valueOf(managerDetachPO.getEcManager()), JSON.toJSONString(param), managerDetachPO, MapperProxyFactory.getProxy(ManagerDetachMapper.class).getDetachById(param.getId()));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public String doDetach(String isDetach) {
|
||||
return getManagerDetachService(user).doDetach(isDetach);
|
||||
}
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.organization.entity.personnelcard.Iframe;
|
||||
import com.engine.organization.service.HrmPersonnelCardService;
|
||||
import com.engine.organization.service.impl.HrmPersonnelCardServiceImpl;
|
||||
import com.engine.organization.util.OrganizationWrapper;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/10/08
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class PersonnelCardWrapper extends OrganizationWrapper {
|
||||
private HrmPersonnelCardService getHrmPersonnelCardService(User user) {
|
||||
return ServiceUtil.getService(HrmPersonnelCardServiceImpl.class, user);
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> getPersonnelCard(Long uId) {
|
||||
return getHrmPersonnelCardService(user).getPersonnelCard(uId);
|
||||
}
|
||||
|
||||
public List<Iframe> getIframeList() {
|
||||
return getHrmPersonnelCardService(user).getIframeList();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue