feat: 员工离职代码修改

This commit is contained in:
weizhiqiang 2024-08-25 09:35:39 +08:00
parent 5fbecb27e1
commit 4fbaa816e5
4 changed files with 9 additions and 15 deletions

View file

@ -80,7 +80,7 @@ public class SysEveUserStaffController {
*/
@ApiOperation(id = "staff006", value = "员工离职", method = "POST", allUse = "2")
@ApiImplicitParams({
@ApiImplicitParam(id = "rowId", name = "id", value = "员工id", required = "required"),
@ApiImplicitParam(id = "id", name = "id", value = "员工id", required = "required"),
@ApiImplicitParam(id = "quitTime", name = "quitTime", value = "离职时间"),
@ApiImplicitParam(id = "quitReason", name = "quitReason", value = "离职原因")})
@RequestMapping("/post/SysEveUserStaffController/editSysUserStaffState")

View file

@ -21,8 +21,6 @@ import java.util.Map;
*/
public interface SysEveUserStaffDao extends SkyeyeBaseMapper<SysEveUserStaff> {
int editSysUserStaffState(Map<String, Object> map);
List<Map<String, Object>> queryUserMationList(@Param("userIds") String userIds, @Param("staffIds") String staffIds);
int insertStaffCheckWorkTimeRelation(List<Map<String, Object>> staffTimeMation);

View file

@ -281,9 +281,15 @@ public class SysEveUserStaffServiceImpl extends SkyeyeBusinessServiceImpl<SysEve
@Transactional(value = TRANSACTION_MANAGER_VALUE, rollbackFor = Exception.class)
public void editSysUserStaffState(InputObject inputObject, OutputObject outputObject) {
Map<String, Object> map = inputObject.getParams();
map.put("state", UserStaffState.QUIT.getKey());
sysEveUserStaffDao.editSysUserStaffState(map);
String staffId = map.get("id").toString();
// 设置离职信息
UpdateWrapper<SysEveUserStaff> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq(CommonConstants.ID, staffId);
updateWrapper.set(MybatisPlusUtil.toColumns(SysEveUserStaff::getState), UserStaffState.QUIT.getKey());
updateWrapper.set(MybatisPlusUtil.toColumns(SysEveUserStaff::getQuitTime), map.get("quitTime").toString());
updateWrapper.set(MybatisPlusUtil.toColumns(SysEveUserStaff::getQuitReason), map.get("quitReason").toString());
update(updateWrapper);
SysEveUserStaff staffMation = selectById(staffId);
if (!ToolUtil.isBlank(staffMation.getUserId())) {
// 删除redis中缓存的单位下的用户

View file

@ -2,16 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.skyeye.personnel.dao.SysEveUserStaffDao">
<update id="editSysUserStaffState" parameterType="java.util.Map">
UPDATE sys_eve_user_staff a
<set>
a.state = #{state},
a.quit_time = #{quitTime},
a.quit_reason = #{quitReason}
</set>
WHERE a.id = #{id}
</update>
<select id="queryUserMationList" resultType="java.util.Map">
SELECT
a.user_id id,