commit
222e001c2b
@ -0,0 +1,12 @@
|
||||
package com.api.organization.web;
|
||||
|
||||
import javax.ws.rs.Path;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
@Path("/bs/hrmorganization/commonimport")
|
||||
public class ImportCommonController extends com.engine.organization.web.ImportCommonController {
|
||||
}
|
@ -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,12 @@
|
||||
package com.engine.organization.mapper.hrmresource;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/05/20
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface HrmResourceMapper {
|
||||
|
||||
Long getMaxId();
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
<?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.hrmresource.HrmResourceMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.engine.organization.entity.hrmresource.po.HrmResourcePO">
|
||||
<result column="id" property="id"/>
|
||||
<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.creator
|
||||
, t.delete_type
|
||||
, t.create_time
|
||||
, t.update_time
|
||||
</sql>
|
||||
|
||||
<select id="getMaxId" resultType="java.lang.Long">
|
||||
select max(id)
|
||||
from jcl_org_hrmresource
|
||||
</select>
|
||||
</mapper>
|
@ -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);
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.engine.organization.service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public interface ImportCommonService {
|
||||
/**
|
||||
* 人员导入
|
||||
*
|
||||
* @param params
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
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
@ -0,0 +1,64 @@
|
||||
package com.engine.organization.service.impl;
|
||||
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.entity.hrmresource.param.HrmResourceImportParam;
|
||||
import com.engine.organization.service.HrmResourceImportAdaptService;
|
||||
import com.engine.organization.service.HrmResourceImportProcessService;
|
||||
import com.engine.organization.service.ImportCommonService;
|
||||
import weaver.file.FileUploadToPath;
|
||||
import weaver.general.Util;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ImportCommonServiceImpl extends Service implements ImportCommonService {
|
||||
|
||||
@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();
|
||||
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;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
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.ImportCommonWrapper;
|
||||
import weaver.hrm.HrmUserVarify;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ImportCommonController {
|
||||
|
||||
private ImportCommonWrapper getImportCommonWrapper(User user) {
|
||||
return ServiceUtil.getService(ImportCommonWrapper.class, user);
|
||||
}
|
||||
|
||||
@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(getImportCommonWrapper(user).saveImportResource(map, request));
|
||||
} catch (Exception e) {
|
||||
return ReturnResult.exceptionHandle(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.engine.organization.wrapper;
|
||||
|
||||
import com.engine.common.util.ServiceUtil;
|
||||
import com.engine.core.impl.Service;
|
||||
import com.engine.organization.service.ImportCommonService;
|
||||
import com.engine.organization.service.impl.ImportCommonServiceImpl;
|
||||
import weaver.hrm.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author:dxfeng
|
||||
* @createTime: 2022/06/29
|
||||
* @version: 1.0
|
||||
*/
|
||||
public class ImportCommonWrapper extends Service {
|
||||
|
||||
private ImportCommonService getImportCommonService(User user) {
|
||||
return ServiceUtil.getService(ImportCommonServiceImpl.class, user);
|
||||
}
|
||||
|
||||
public Map<String, Object> saveImportResource(Map<String, Object> params, HttpServletRequest request) {
|
||||
return getImportCommonService(user).saveImportResource(params, request);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue