人员导入
This commit is contained in:
parent
768713bf09
commit
4eef6f62de
|
|
@ -0,0 +1,338 @@
|
|||
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;
|
||||
}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import weaver.file.FileUploadToPath;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/27
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface HrmResourceImportAdaptService {
|
||||
/**
|
||||
* 用于生成需要导入系统的人员与组织架构数据并放入Map中,同时包含参数和数据有效性验证
|
||||
* 其格式是:
|
||||
*
|
||||
* @return 返回错误提示
|
||||
*/
|
||||
List<String> creatImportMap(FileUploadToPath fu);
|
||||
|
||||
/**
|
||||
* 获得HrmImportMap
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
Map getHrmImportMap();
|
||||
|
||||
/**
|
||||
* 传递同步的人员语言id
|
||||
*/
|
||||
void setUserlanguage(int userlanguage);
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
package com.engine.organization.service;
|
||||
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceImportParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/27
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface HrmResourceImportProcessService {
|
||||
/**
|
||||
* 初始化数据
|
||||
*
|
||||
* @param request
|
||||
*/
|
||||
Map<String, Object> init(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 用于处理把所得到的组织和人员结构信息放入系统
|
||||
*
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
void processMap(Map<String, HrmResourceImportParam> map);
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.engine.organization.service;
|
|||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.searchtree.SearchTreeParams;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -73,4 +74,6 @@ public interface HrmResourceService {
|
|||
* @return
|
||||
*/
|
||||
Map<String, Object> getHasRight();
|
||||
|
||||
Map<String, Object> saveImportResource(Map<String, Object> params, HttpServletRequest request);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -1,5 +1,6 @@
|
|||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.api.browser.bean.SearchConditionGroup;
|
||||
import com.api.browser.bean.SearchConditionItem;
|
||||
import com.cloudstore.eccom.result.WeaResultMsg;
|
||||
|
|
@ -12,6 +13,7 @@ import com.engine.organization.entity.company.po.CompPO;
|
|||
import com.engine.organization.entity.department.bo.DepartmentBO;
|
||||
import com.engine.organization.entity.department.po.DepartmentPO;
|
||||
import com.engine.organization.entity.extend.po.ExtendTitlePO;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceImportParam;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceSearchParam;
|
||||
import com.engine.organization.entity.hrmresource.vo.HrmResourceVO;
|
||||
import com.engine.organization.entity.job.bo.JobBO;
|
||||
|
|
@ -23,6 +25,8 @@ import com.engine.organization.mapper.department.DepartmentMapper;
|
|||
import com.engine.organization.mapper.extend.ExtendTitleMapper;
|
||||
import com.engine.organization.mapper.job.JobMapper;
|
||||
import com.engine.organization.service.ExtService;
|
||||
import com.engine.organization.service.HrmResourceImportAdaptService;
|
||||
import com.engine.organization.service.HrmResourceImportProcessService;
|
||||
import com.engine.organization.service.HrmResourceService;
|
||||
import com.engine.organization.util.MenuBtn;
|
||||
import com.engine.organization.util.OrganizationAssert;
|
||||
|
|
@ -33,10 +37,12 @@ import com.engine.organization.util.tree.SearchTreeUtil;
|
|||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import weaver.conn.RecordSet;
|
||||
import weaver.file.FileUploadToPath;
|
||||
import weaver.general.StringUtil;
|
||||
import weaver.general.Util;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
|
@ -242,6 +248,48 @@ public class HrmResourceServiceImpl extends Service implements HrmResourceServic
|
|||
return btnDatas;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> saveImportResource(Map<String, Object> params, HttpServletRequest request) {
|
||||
|
||||
Map<String, Object> retmap = new HashMap<String, Object>();
|
||||
try {
|
||||
/*综合考虑多数据源后,实现通过配置文件配置适配器和解析类*/
|
||||
List<Object> lsErrorInfo = new ArrayList<Object>();
|
||||
|
||||
HrmResourceImportAdaptService importAdapt = (HrmResourceImportAdaptService) Class.forName("com.engine.organization.service.impl.HrmResourceImportAdaptServiceImpl").newInstance();
|
||||
|
||||
FileUploadToPath fu = new FileUploadToPath(request);
|
||||
|
||||
int language = this.user.getLanguage();
|
||||
importAdapt.setUserlanguage(language);
|
||||
List errorInfo = importAdapt.creatImportMap(fu);
|
||||
|
||||
//如果读取数据和验证模板没有发生错误
|
||||
if (errorInfo.isEmpty()) {
|
||||
Map<String, HrmResourceImportParam> hrMap = importAdapt.getHrmImportMap();
|
||||
System.out.println(JSON.toJSON(hrMap));
|
||||
HrmResourceImportProcessService importProcess = (HrmResourceImportProcessService) Class.forName("com.engine.organization.service.impl.HrmResourceImportProcessServiceImpl").newInstance();
|
||||
importProcess.init(request);
|
||||
importProcess.processMap(hrMap);
|
||||
} else {
|
||||
if (errorInfo != null && !errorInfo.isEmpty()) {
|
||||
Map<String, Object> error;
|
||||
for (int i = 0; i < errorInfo.size(); i++) {
|
||||
error = new HashMap<>();
|
||||
error.put("message", Util.null2String(errorInfo.get(i)));
|
||||
lsErrorInfo.add(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
retmap.put("errorInfo", lsErrorInfo);
|
||||
retmap.put("status", "1");
|
||||
} catch (Exception e) {
|
||||
retmap.put("status", "-1");
|
||||
retmap.put("message", e.getMessage());
|
||||
}
|
||||
return retmap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询条件
|
||||
*
|
||||
|
|
|
|||
|
|
@ -187,4 +187,18 @@ public class HrmResourceController {
|
|||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@POST
|
||||
@Path("/saveImportResource")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
public ReturnResult saveImportResource(@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).saveImportResource(map, request));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.engine.organization.service.HrmResourceService;
|
|||
import com.engine.organization.service.impl.HrmResourceServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
|
|
@ -52,4 +53,8 @@ public class HrmResourceWrapper extends Service {
|
|||
public Map<String, Object> getHasRight() {
|
||||
return getHrmResourceService(user).getHasRight();
|
||||
}
|
||||
|
||||
public Map<String, Object> saveImportResource(Map<String, Object> params, HttpServletRequest request) {
|
||||
return getHrmResourceService(user).saveImportResource(params, request);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue