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;
|
||||
}
|
||||
|
|
@ -40,7 +40,7 @@ public class HrmResourcePO {
|
|||
/**
|
||||
* 性别
|
||||
*/
|
||||
private Integer sex;
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 账号类型
|
||||
|
|
@ -75,7 +75,7 @@ public class HrmResourcePO {
|
|||
/**
|
||||
* 职称
|
||||
*/
|
||||
private Long jobCall;
|
||||
private Integer jobCall;
|
||||
|
||||
/**
|
||||
* 职级
|
||||
|
|
@ -120,12 +120,12 @@ public class HrmResourcePO {
|
|||
/**
|
||||
* 直接上级
|
||||
*/
|
||||
private Long managerId;
|
||||
private Integer managerId;
|
||||
|
||||
/**
|
||||
* 助理
|
||||
*/
|
||||
private Long assistantId;
|
||||
private Integer assistantId;
|
||||
|
||||
/**
|
||||
* 移动电话
|
||||
|
|
@ -161,4 +161,175 @@ public class HrmResourcePO {
|
|||
private int deleteType;
|
||||
private Date createTime;
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String passWord;
|
||||
|
||||
/**
|
||||
* 安全级别
|
||||
*/
|
||||
private Integer secLevel;
|
||||
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private String birthday;
|
||||
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
private String folk;
|
||||
|
||||
/**
|
||||
* 籍贯
|
||||
*/
|
||||
private String nativePlace;
|
||||
|
||||
/**
|
||||
* 户口
|
||||
*/
|
||||
private String regResidentPlace;
|
||||
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String certificateNum;
|
||||
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
private String maritalStatus;
|
||||
|
||||
/**
|
||||
* 政治面貌
|
||||
*/
|
||||
private String policy;
|
||||
|
||||
/**
|
||||
* 入团日期
|
||||
*/
|
||||
private String beMemberDate;
|
||||
|
||||
/**
|
||||
* 入党日期
|
||||
*/
|
||||
private String bePartyDate;
|
||||
|
||||
/**
|
||||
* 工会会员
|
||||
*/
|
||||
private String islabouunion;
|
||||
|
||||
/**
|
||||
* 学位
|
||||
*/
|
||||
private String degree;
|
||||
|
||||
/**
|
||||
* 健康状况
|
||||
*/
|
||||
private String healthInfo;
|
||||
|
||||
/**
|
||||
* 学历
|
||||
*/
|
||||
private Integer educationLevel;
|
||||
|
||||
/**
|
||||
* 身高
|
||||
*/
|
||||
private String height;
|
||||
|
||||
/**
|
||||
* 体重
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 用工性质
|
||||
*/
|
||||
private Integer useKind;
|
||||
|
||||
/**
|
||||
* 合同开始日期
|
||||
*/
|
||||
private String startDate;
|
||||
|
||||
/**
|
||||
* 合同结束日期
|
||||
*/
|
||||
private String endDate;
|
||||
|
||||
/**
|
||||
* 试用期结束日期
|
||||
*/
|
||||
private String probationEndDate;
|
||||
|
||||
/**
|
||||
* 现居住地
|
||||
*/
|
||||
private String residentPlace;
|
||||
|
||||
/**
|
||||
* 家庭联系方式
|
||||
*/
|
||||
private String homeAddress;
|
||||
|
||||
/**
|
||||
* 暂住证号码
|
||||
*/
|
||||
private String tempResidentNumber;
|
||||
|
||||
/**
|
||||
* 入职日期
|
||||
*/
|
||||
private String companyStartDate;
|
||||
|
||||
/**
|
||||
* 参加工作日期
|
||||
*/
|
||||
private String workStartDate;
|
||||
|
||||
/**
|
||||
* 公积金帐户
|
||||
*/
|
||||
private String accumFundAccount;
|
||||
|
||||
/**
|
||||
* 工资账号户名
|
||||
*/
|
||||
private String accountName;
|
||||
|
||||
/**
|
||||
* 工资银行
|
||||
*/
|
||||
private Integer bankId;
|
||||
|
||||
/**
|
||||
* 工资账号
|
||||
*/
|
||||
private String accountId;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer showOrder;
|
||||
|
||||
/**
|
||||
* 人员密级
|
||||
*/
|
||||
private Integer classification;
|
||||
|
||||
|
||||
private String workYear;
|
||||
|
||||
|
||||
private String companyWorkYear;
|
||||
|
||||
private String baseFieldsValue="";
|
||||
|
||||
private String baseFields="";
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ public class PostInfoSearchParam {
|
|||
/**
|
||||
* 职务分类
|
||||
*/
|
||||
private Integer postId;
|
||||
private Long postId;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class PostInfoPO {
|
|||
/**
|
||||
* 职务分类
|
||||
*/
|
||||
private Integer postId;
|
||||
private Long postId;
|
||||
/**
|
||||
* 说明
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -135,7 +135,9 @@
|
|||
#{description},
|
||||
</if>
|
||||
0,
|
||||
#{showOrder},
|
||||
<if test="showOrder != null ">
|
||||
#{showOrder},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -25,8 +25,11 @@ public interface PostInfoMapper {
|
|||
*/
|
||||
List<PostInfoPO> listByNo(@Param("postInfoNo") String postInfoNo);
|
||||
|
||||
PostInfoPO getPostInfoByNameAndPostId(@Param("postInfoName") String postInfoName, @Param("postId") Long postId);
|
||||
|
||||
/**
|
||||
* 获取职务信息根据ID
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -39,10 +42,11 @@ public interface PostInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
@MapKey("id")
|
||||
List<Map<String,Object>> listPostInfosByIds(@Param("ids") Collection<Long> ids);
|
||||
List<Map<String, Object>> listPostInfosByIds(@Param("ids") Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 插入职务信息
|
||||
*
|
||||
* @param postInfoPO
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -63,6 +67,7 @@ public interface PostInfoMapper {
|
|||
* @return
|
||||
*/
|
||||
int updateForbiddenTagById(PostInfoPO postInfoPO);
|
||||
|
||||
/**
|
||||
* 批量删除职务信息方案
|
||||
*
|
||||
|
|
|
|||
|
|
@ -60,6 +60,11 @@
|
|||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
<select id="getPostInfoByNameAndPostId" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_post_info t where post_info_name = #{postInfoName} and post_id = #{postId} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updatePostInfo" parameterType="com.engine.organization.entity.postion.po.PostInfoPO">
|
||||
update jcl_org_post_info
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@ public interface PostMapper {
|
|||
*/
|
||||
PostPO getPostByID(@Param("id") long id);
|
||||
|
||||
List<PostPO> listByName(@Param("postName") String postName);
|
||||
|
||||
/**
|
||||
* 根据ID查询职务分类列表
|
||||
* 浏览按钮赋值、展示用
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@
|
|||
<select id="getTreeData" resultMap="TreeResultMap">
|
||||
select id , post_name from jcl_org_post where delete_type ='0'
|
||||
</select>
|
||||
<select id="listByName" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="baseColumns"/>
|
||||
from jcl_org_post t where post_name = #{postName} AND delete_type = 0
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="com.engine.organization.entity.postion.po.PostPO">
|
||||
update jcl_org_post
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,7 +21,7 @@ public class PageInfoSortUtil {
|
|||
* @return
|
||||
*/
|
||||
public static String getSortSql(String sortParams) {
|
||||
JSONArray jsonArray = JSONObject.parseArray(sortParams);
|
||||
JSONArray jsonArray = JSONObject.parseArray(sortParams);
|
||||
if (CollectionUtils.isNotEmpty(jsonArray)) {
|
||||
JSONObject jsonObject = (JSONObject) jsonArray.get(0);
|
||||
String orderKey = upperCharToUnderLine(jsonObject.getString("orderkey"));
|
||||
|
|
@ -54,4 +54,28 @@ public class PageInfoSortUtil {
|
|||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下划线转驼峰
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static String underlineToHump(String str) {
|
||||
//正则匹配下划线及后一个字符,删除下划线并将匹配的字符转成大写
|
||||
Matcher matcher = Pattern.compile("_([a-z])").matcher(str);
|
||||
StringBuffer sb = new StringBuffer(str);
|
||||
if (matcher.find()) {
|
||||
sb = new StringBuffer();
|
||||
//将当前匹配的子串替换成指定字符串,并且将替换后的子串及之前到上次匹配的子串之后的字符串添加到StringBuffer对象中
|
||||
//正则之前的字符和被替换的字符
|
||||
matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
|
||||
//把之后的字符串也添加到StringBuffer对象中
|
||||
matcher.appendTail(sb);
|
||||
} else {
|
||||
//去除除字母之外的前面带的下划线
|
||||
return sb.toString().replaceAll("_", "");
|
||||
}
|
||||
return underlineToHump(sb.toString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package com.engine.organization.util.excel;
|
||||
|
||||
import com.engine.salary.util.excel.ExcelParseException;
|
||||
import com.engine.salary.util.excel.ExcelProperty;
|
||||
import com.engine.salary.util.excel.ExcelSupport;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
import org.apache.commons.lang3.exception.ContextedRuntimeException;
|
||||
|
|
@ -14,7 +11,7 @@ import java.lang.reflect.Field;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import static com.engine.salary.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
import static com.engine.organization.util.excel.ExcelSupport.EXCEL_TYPE_XLSX;
|
||||
|
||||
/**
|
||||
* Excel 解析工具类
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -52,4 +52,6 @@ public class HrmResourceWrapper extends Service {
|
|||
public Map<String, Object> getHasRight() {
|
||||
return getHrmResourceService(user).getHasRight();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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