处理新员工添加问题
This commit is contained in:
parent
90478a4e1f
commit
b2e2c6d466
@ -156,12 +156,17 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
if(CollectionUtils.isNotEmpty(sysStaff.getTimeClockList())){
|
||||
sysStaff.setTimeClock(sysStaff.getTimeClockList().stream().collect(Collectors.joining(",")));
|
||||
}
|
||||
//新增员工信息到金蝶
|
||||
if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||
}else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||
}
|
||||
|
||||
int i = getBaseMapper().insertSysStaff(sysStaff);
|
||||
if(i < 1){
|
||||
return AjaxResult.error("员工添加失败");
|
||||
}
|
||||
|
||||
//员工详情
|
||||
createStaffDetail(sysStaff);
|
||||
//打卡统计,打卡详情
|
||||
@ -170,14 +175,7 @@ public class SysStaffServiceImpl extends ServiceImpl<SysStaffMapper, SysStaff> i
|
||||
rzRestaurantStatisticsService.createRestaurantStatistics(sysStaff, DateUtils.getNowDate());
|
||||
//处理考勤机相关信息
|
||||
initCheckDevice(sysStaff);
|
||||
//新增员工信息到金蝶
|
||||
if(StringUtils.isNotEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSave(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode(), "jobCode", sysStaff.getJobCode().split("_")[0],"deptCode", sysStaff.getJobCode().split("_")[1])));
|
||||
updateById(sysStaff);
|
||||
}else if(StringUtils.isEmpty(sysStaff.getJobCode())){
|
||||
sysStaff.setExtended(KingdeeRequestUtils.employeeSaveEmptyJob(Collections.asMap("userName", sysStaff.getName(), "userCode", sysStaff.getCode())));
|
||||
updateById(sysStaff);
|
||||
}
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
@ -49,10 +49,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="socialSubsidy" column="social_subsidy" />
|
||||
<result property="imageUrl" column="image_url" />
|
||||
<result property="timeClock" column="time_clock" />
|
||||
<result property="extended" column="extended" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysStaffVo">
|
||||
select user_id,company_name, dept_id, code, name, id_card,is_leader, sex, age, phone, address, level, major, school, bank_number,social_subsidy, bank, employment_date, experience, worker_term, regular_date, quit_date, contract_start, contract_end, contract_type, social_type, seniority, is_overtime_pay, zs_flag, secrecy, injury, insurance, introducer, clock_in, status, wages_ratio_date, remarks, del_flag, create_by, create_time, update_by, update_time, image_url,time_clock,subsidys, job_code, openid from sys_staff
|
||||
select user_id,company_name, dept_id, code, name, id_card,is_leader, sex, age, phone, address, level, major,
|
||||
school, bank_number,social_subsidy, bank, employment_date, experience, worker_term, regular_date,
|
||||
quit_date, contract_start, contract_end, contract_type, social_type, seniority, is_overtime_pay,
|
||||
zs_flag, secrecy, injury, insurance, introducer, clock_in, status,
|
||||
wages_ratio_date, remarks, del_flag, create_by, create_time, update_by,
|
||||
update_time, image_url,time_clock,subsidys, job_code, extended, openid
|
||||
from sys_staff
|
||||
</sql>
|
||||
|
||||
<select id="selectSysStaffList" parameterType="com.evo.system.domain.SysStaff" resultMap="SysStaffResult">
|
||||
@ -134,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="timeClock != null">time_clock,</if>
|
||||
<if test="subsidys != null">subsidys,</if>
|
||||
<if test="jobCode != null">job_code,</if>
|
||||
<if test="extended != null and extended != ''">extended,</if>
|
||||
<if test="openid != null">openid,</if>
|
||||
|
||||
</trim>
|
||||
@ -183,6 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="timeClock != null">#{timeClock},</if>
|
||||
<if test="subsidys != null">#{subsidys},</if>
|
||||
<if test="jobCode != null">#{jobCode},</if>
|
||||
<if test="extended != null and extended != ''">#{extended},</if>
|
||||
<if test="openid != null">#{openid},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -235,6 +244,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="timeClock != null">time_clock = #{timeClock},</if>
|
||||
<if test="subsidys != null">subsidys = #{subsidys},</if>
|
||||
<if test="jobCode != null">job_Code=#{jobCode},</if>
|
||||
<if test="extended != null and extended != ''">extended=#{extended},</if>
|
||||
<if test="openid != null">openid=#{openid},</if>
|
||||
</trim>
|
||||
where user_id = #{userId}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user