修改
This commit is contained in:
parent
dbe91094ec
commit
4b6d66e9b4
@ -104,6 +104,19 @@ public class CompanyStaffController {
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
@PostMapping("/createByExistUser")
|
||||
public CommonResult<?> createByExistUser(@RequestBody CompanyStaffRespVO staffRespVO){
|
||||
staffService.createByExistUser(staffRespVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工
|
||||
*
|
||||
|
@ -16,6 +16,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@ -110,4 +111,23 @@ public class CompanyStaff extends TenantBaseDO {
|
||||
@TableField(exist = false)
|
||||
@ExcelProperty("员工角色")
|
||||
private String roleNames;
|
||||
|
||||
/** 身份证号 */
|
||||
@ExcelProperty("身份证号")
|
||||
private String IdNumber;
|
||||
|
||||
/** 转正时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("转正时间")
|
||||
private LocalDateTime formalDate;
|
||||
|
||||
/** 购买保险时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ExcelProperty("购买保险时间")
|
||||
private LocalDateTime safeDate;
|
||||
|
||||
/** 附件的名称们,手动填写,逗号分隔,没有也要占位,和下面的urls对应 */
|
||||
private String fileNames;
|
||||
}
|
||||
|
@ -139,4 +139,14 @@ public interface CompanyStaffService extends IService<CompanyStaff> {
|
||||
* @return cn.iocoder.yudao.module.staff.entity.CompanyStaff
|
||||
**/
|
||||
CompanyStaffRespVO getMyAdviser(Long tenantId,String sysCode);
|
||||
|
||||
/**
|
||||
* 创建员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
void createByExistUser(CompanyStaffRespVO staffRespVO);
|
||||
|
||||
}
|
||||
|
@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.staff.service.impl;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.log.Log;
|
||||
import cn.iocoder.yudao.common.*;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
||||
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
||||
@ -685,4 +687,28 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
// 啥也不是
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建员工信息,在角色和用户已经存在的情况下用
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:26 2024/12/19
|
||||
* @param staffRespVO 信息
|
||||
**/
|
||||
public void createByExistUser(CompanyStaffRespVO staffRespVO){
|
||||
AdminUserRespDTO loginUser = getLoginUser();
|
||||
// 设置新增员工部门
|
||||
staffRespVO.setDeptId(loginUser.getDeptId());
|
||||
// 1 获取当前登录用户的企业信息给添加的员工
|
||||
DeptRespDTO loginDept = getLoginDept(loginUser.getDeptId());
|
||||
staffRespVO.setCorpId(loginDept.getCorpId());
|
||||
// 2 生成唯一推广码
|
||||
String uniqueCode = uniqueCodeService.createUniqueCode();
|
||||
if (!ObjectUtil.isNotEmpty(uniqueCode)) {
|
||||
throw exception(CommonErrorCodeConstants.UNIQUE_CODE_CREATE_REPEAT);
|
||||
}
|
||||
staffRespVO.setUniqueCode(uniqueCode);
|
||||
// 3 保存员工信息到数据库
|
||||
baseMapper.insert(staffRespVO);
|
||||
}
|
||||
}
|
||||
|
@ -93,6 +93,9 @@ public enum InspectionRoleCommon {
|
||||
/** 安全检验员 */
|
||||
AQJYY("aqjyy", 4),
|
||||
|
||||
/** 授权签字人 */
|
||||
JCSQQZR("jcsqqzr", 4),
|
||||
|
||||
/** 检测员工 */
|
||||
JCWORKER("jcworker", 4);
|
||||
|
||||
|
@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.SUPER_ADMIN_ID;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@ -349,8 +350,10 @@ public class RoleServiceImpl implements RoleService {
|
||||
*/
|
||||
@Override
|
||||
public List<RoleDO> pageByQuery(RoleDO roleDO) {
|
||||
return roleMapper.selectList(new LambdaQueryWrapper<RoleDO>()
|
||||
//去年检测用户
|
||||
List<RoleDO> roleDOS = roleMapper.selectList(new LambdaQueryWrapper<RoleDO>()
|
||||
.eq(RoleDO::getServicePackageId, roleDO.getServicePackageId()));
|
||||
return roleDOS.stream().filter(item -> !item.getCode().equals("jcyh")).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join system_user_role sr on su.id = sr.user_id
|
||||
left join system_role sr2 on sr.role_id = sr2.id
|
||||
<where>
|
||||
su.deleted = 0 and sr2.service_package_id = 'jiance'
|
||||
su.deleted = 0 and sr2.service_package_id = 'jiance' and sr2.code != 'jcyh'
|
||||
<if test="role.roleId != null">
|
||||
and sr.role_id = #{role.roleId}
|
||||
</if>
|
||||
|
Loading…
Reference in New Issue
Block a user