Commit a3a5b6e4 authored by huyuchen's avatar huyuchen

huyc 项目档案代码提交

parent c8b53d80
package com.yifu.cloud.plus.v1.yifu.archives.constants;
/**
* @author huyc
* @date 2022年06月21日
* <p>
* 档案服务常量
*/
public class ArchivesConstants {
/**
* 复档
*/
public static final String EMP_CONTENT = "复档";
/**
* 复项
*/
public static final String PROJECT_CONTENT = "复项";
/**
* 复档复项
*/
public static final String EMP_PROJECT_CONTENT = "复档复项";
/**
* 减档减项
*/
public static final String REDUCE_EMP_PROJECT_CONTENT = "减档减项";
}
......@@ -243,36 +243,6 @@ public class TEmployeeProject extends BaseEntity {
@Schema(description ="是否删除 0否/1是")
private String deleteFlag;
/**
* 创建人id
*/
@Schema(description ="创建人id")
private String createBy;
/**
* 创建人姓名
*/
@Schema(description ="创建人姓名")
private String createName;
/**
* 创建时间
*/
@Schema(description ="创建时间")
private LocalDateTime createTime;
/**
* 更新人id
*/
@Schema(description ="更新人id")
private String updateBy;
/**
* 更新时间
*/
@Schema(description ="更新时间")
private LocalDateTime updateTime;
/**
* 备注
*/
......
......@@ -86,7 +86,6 @@ public class EmployeeProjectVO implements Serializable {
/**
* 合同类型(字典值)
*/
@NotNull(message = "合同类型不能为空")
@ExcelProperty(value ="合同类型")
private String contractType;
......
......@@ -18,8 +18,12 @@
package com.yifu.cloud.plus.v1.yifu.archives.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目档案表
......@@ -30,4 +34,17 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface TEmployeeProjectMapper extends BaseMapper<TEmployeeProject> {
void updateExcelEmpProject(@Param("list") List<TEmployeeProject> list);
int insertExcelEmpProject(@Param("list") List<TEmployeeProject> list);
void updateEmpIdById(@Param("list") List<TEmployeeInfo> list);
/**
* 通过部门编码获取最大员工编码
* @param deptNo
* @return
*/
String findEmployeeMaxOnlyNoByDepId(@Param("deptNo") String deptNo);
}
......@@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pig4cloud.plugin.excel.vo.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmpEducationUpdateExcelVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeProjectVO;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import org.springframework.validation.BindingResult;
......@@ -42,4 +43,6 @@ public interface TEmployeeProjectService extends IService<TEmployeeProject> {
R deleteEmpPro(TEmployeeProject tEmployeeProject);
R<List<ErrorMessage>> importListAdd(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult, String isAdd);
R<List<ErrorMessage>> importEmpProjectUpdate(List<EmployeeProjectVO> excelVOList, BindingResult bindingResult);
}
......@@ -45,4 +45,295 @@
<result property="updateTime" column="UPDATE_TIME"/>
<result property="remark" column="REMARK"/>
</resultMap>
<update id="updateExcelEmpProject" parameterType="java.util.List">
update t_employee_project
<trim prefix="set" suffixOverrides=",">
<trim prefix="EMP_NATRUE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empNatrue!=null">
when ID=#{i.id} then #{i.empNatrue}
</if>
</foreach>
</trim>
<trim prefix="EMP_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empName!=null">
when ID=#{i.id} then #{i.empName}
</if>
</foreach>
</trim>
<trim prefix="EMP_IDCARD =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empIdcard!=null">
when ID=#{i.id} then #{i.empIdcard}
</if>
</foreach>
</trim>
<trim prefix="PROJECT_STATUS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then 0
</foreach>
</trim>
<trim prefix="UPDATE_TIME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then now()
</foreach>
</trim>
<trim prefix="UPDATE_BY =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.updateBy!=null">
when ID=#{i.id} then #{i.updateBy}
</if>
</foreach>
</trim>
<trim prefix="DEPT_NO =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptNo!=null">
when ID=#{i.id} then #{i.deptNo}
</if>
</foreach>
</trim>
<trim prefix="CONTRACT_TYPE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.contractType!=null">
when ID=#{i.id} then #{i.contractType}
</if>
</foreach>
</trim>
<trim prefix="WORKING_HOURS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.workingHours!=null">
when ID=#{i.id} then #{i.workingHours}
</if>
</foreach>
</trim>
<trim prefix="POST =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.post!=null">
when ID=#{i.id} then #{i.post}
</if>
</foreach>
</trim>
<trim prefix="TRY_PERIOD =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.tryPeriod!=null">
when ID=#{i.id} then #{i.tryPeriod}
</if>
</foreach>
</trim>
<trim prefix="ENJOIN_DATE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.enjoinDate!=null">
when ID=#{i.id} then #{i.enjoinDate}
</if>
</foreach>
</trim>
<trim prefix="BANK_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankName!=null">
when ID=#{i.id} then #{i.bankName}
</if>
</foreach>
</trim>
<trim prefix="BANK_NO =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankNo!=null">
when ID=#{i.id} then #{i.bankNo}
</if>
</foreach>
</trim>
<trim prefix="BANK_SUB_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankSubName!=null">
when ID=#{i.id} then #{i.bankSubName}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
ID=#{i.id}
</foreach>
</update>
<update id="updateExcelEmpProject" parameterType="java.util.List">
update t_employee_project
<trim prefix="set" suffixOverrides=",">
<trim prefix="EMP_NATRUE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empNatrue!=null">
when ID=#{i.id} then #{i.empNatrue}
</if>
</foreach>
</trim>
<trim prefix="EMP_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empName!=null">
when ID=#{i.id} then #{i.empName}
</if>
</foreach>
</trim>
<trim prefix="EMP_IDCARD =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.empIdcard!=null">
when ID=#{i.id} then #{i.empIdcard}
</if>
</foreach>
</trim>
<trim prefix="PROJECT_STATUS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then 0
</foreach>
</trim>
<trim prefix="UPDATE_TIME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
when ID=#{i.id} then now()
</foreach>
</trim>
<trim prefix="UPDATE_BY =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.updateBy!=null">
when ID=#{i.id} then #{i.updateBy}
</if>
</foreach>
</trim>
<trim prefix="DEPT_NO =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.deptNo!=null">
when ID=#{i.id} then #{i.deptNo}
</if>
</foreach>
</trim>
<trim prefix="CONTRACT_TYPE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.contractType!=null">
when ID=#{i.id} then #{i.contractType}
</if>
</foreach>
</trim>
<trim prefix="WORKING_HOURS =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.workingHours!=null">
when ID=#{i.id} then #{i.workingHours}
</if>
</foreach>
</trim>
<trim prefix="POST =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.post!=null">
when ID=#{i.id} then #{i.post}
</if>
</foreach>
</trim>
<trim prefix="TRY_PERIOD =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.tryPeriod!=null">
when ID=#{i.id} then #{i.tryPeriod}
</if>
</foreach>
</trim>
<trim prefix="ENJOIN_DATE =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.enjoinDate!=null">
when ID=#{i.id} then #{i.enjoinDate}
</if>
</foreach>
</trim>
<trim prefix="BANK_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankName!=null">
when ID=#{i.id} then #{i.bankName}
</if>
</foreach>
</trim>
<trim prefix="BANK_NO =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankNo!=null">
when ID=#{i.id} then #{i.bankNo}
</if>
</foreach>
</trim>
<trim prefix="BANK_SUB_NAME =case" suffix="end,">
<foreach collection="list" item="i" index="index">
<if test="i.bankSubName!=null">
when ID=#{i.id} then #{i.bankSubName}
</if>
</foreach>
</trim>
</trim>
where
<foreach collection="list" separator="or" item="i" index="index" >
ID=#{i.id}
</foreach>
</update>
<insert id="insertExcelEmpProject" parameterType="java.util.List">
insert into t_employee_project
(ID,EMP_ID,EMP_NATRUE,EMP_NAME,EMP_IDCARD,STATUS,PROJECT_STATUS,EMP_CODE,DEPT_NO,CONTRACT_TYPE,POST,EMP_NO,
TRY_PERIOD,ENJOIN_DATE,BANK_NAME,BANK_NO,BANK_SUB_NAME,DELETE_FLAG,CREATE_BY,CREATE_NAME,CREATE_TIME)
VALUES
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id,jdbcType=VARCHAR},
#{item.empId,jdbcType=VARCHAR},
#{item.empNatrue,jdbcType=VARCHAR},
#{item.empName,jdbcType=VARCHAR},
#{item.empIdcard,jdbcType=VARCHAR},
#{item.status,jdbcType=VARCHAR},
0,
#{item.empCode,jdbcType=VARCHAR},
#{item.deptNo,jdbcType=VARCHAR},
#{item.contractType,jdbcType=VARCHAR},
#{item.post,jdbcType=VARCHAR},
#{item.empNo,jdbcType=VARCHAR},
#{item.tryPeriod,jdbcType=VARCHAR},
#{item.enjoinDate,jdbcType=DATE},
#{item.bankName,jdbcType=VARCHAR},
#{item.bankNo,jdbcType=VARCHAR},
#{item.bankSubName,jdbcType=VARCHAR},
#{item.deleteFlag,jdbcType=VARCHAR},
#{item.createBy,jdbcType=VARCHAR},
#{item.createName,jdbcType=VARCHAR},
now()
)
</foreach>
</insert>
<!--查询部门编码和最大员工数-->
<select id="findEmployeeMaxOnlyNoByDepId" resultMap="EmployeeNoResultMap">
SELECT
(
SELECT
MAX(EMP_NO)
FROM
t_employee_project
WHERE
DELETE_FLAG = 0
and id not like '%abc'
and
EMP_NO LIKE CONCAT(
(
SELECT
DEPART_NO
FROM
t_settle_domain
WHERE
DEPT_NO = #{deptNo}
),
'%'
)
) AS 'empNo'
FROM
DUAL
</select>
<update id="updateEmpIdById" parameterType="java.util.List">
update t_employee_project
SET EMP_ID = #{i.id}
where
<foreach collection="list" separator="or" item="i" index="index" >
EMP_IDCARD=#{i.empIdcard} AND DEPT_NO =#{i.deptNo}
</foreach>
</update>
</mapper>
......@@ -198,4 +198,20 @@ public interface CommonConstants {
//int 4
int FOUR_INT = 4;
String TEN_STRING = "10";
/**
* 员工初始序列
* @Author pwang
* @Date 2020-05-14 11:13
* @param null
* @return
**/
public static final String EMPLOYEE_INIT_NO = "0001";
/**
* 员工的的前缀位数
* @Author pwang
* @Date 2020-05-14 14:10
**/
public static final int EMPLOYEE_INIT_NO_START = 7;
}
......@@ -205,4 +205,20 @@ public interface ErrorCodes {
* 银行卡号校验传参有误:姓名、身份证号、银行卡号 必填
*/
String CHECKS_BANK_NO_REQUEST_PARAM_ERROR = "checks.bank.no.request.param.error";
/**
* 存在已减档的档案和已减项的项目,禁止导入
*/
String CHECKS_EMP_PROJECT_ERROR = "checks.emp.project.error";
/**
* 存在已减档的档案,禁止导入
*/
String CHECKS_REDUCE_EMP_ERROR = "checks.reduce.emp.error";
/**
* 存在已减项的项目,禁止导入
*/
String CHECKS_REDUCE_PROJECT_ERROR = "checks.reduce.project.error";
/**
* 人员不在该项目,无法更新
*/
String CHECKS_EMP_EXIT_ERROR = "checks.emp.exit.error";
}
......@@ -54,6 +54,12 @@ checks.mobile.request.error=\u6821\u9A8C\u8BF7\u6C42\u5F02\u5E38
checks.mobile.request.limit.hundred=\u5355\u6B21\u53F7\u7801\u72B6\u6001\u6821\u9A8C\u8BF7\u6C42\u4E0A\u9650100
checks.bank.no.request.param.error=\u94F6\u884C\u5361\u53F7\u6821\u9A8C\u4F20\u53C2\u6709\u8BEF\uFF1A\u59D3\u540D\u3001\u8EAB\u4EFD\u8BC1\u53F7\u3001\u94F6\u884C\u5361\u53F7 \u5FC5\u586B
checks.emp.project.error=\u5B58\u5728\u5DF2\u51CF\u6863\u7684\u6863\u6848\u548C\u5DF2\u51CF\u9879\u7684\u9879\u76EE\uFF0C\u7981\u6B62\u5BFC\u5165
checks.reduce.emp.error=\u5B58\u5728\u5DF2\u51CF\u6863\u7684\u6863\u6848\uFF0C\u7981\u6B62\u5BFC\u5165
checks.reduce.project.error=\u5B58\u5728\u5DF2\u51CF\u9879\u7684\u9879\u76EE\uFF0C\u7981\u6B62\u5BFC\u5165
checks.emp.exit.error=\u4EBA\u5458\u4E0D\u5728\u8BE5\u9879\u76EE\uFF0C\u65E0\u6CD5\u66F4\u65B0
......
......@@ -241,7 +241,7 @@ public class UserController {
* @return R
*/
@SysLog("从ldap中获取用户")
@PostMapping("inner/updateUser")
@PostMapping("/inner/updateUser")
@Inner
public R innerUpdateByLdap() {
return R.ok(userService.updateByLdap());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment