This commit is contained in:
xiaofajia 2024-12-19 17:48:24 +08:00
parent dbe91094ec
commit 4b6d66e9b4
7 changed files with 77 additions and 2 deletions

View File

@ -104,6 +104,19 @@ public class CompanyStaffController {
return CommonResult.ok(); 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();
}
/** /**
* 修改员工 * 修改员工
* *

View File

@ -16,6 +16,7 @@ import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -110,4 +111,23 @@ public class CompanyStaff extends TenantBaseDO {
@TableField(exist = false) @TableField(exist = false)
@ExcelProperty("员工角色") @ExcelProperty("员工角色")
private String roleNames; 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;
} }

View File

@ -139,4 +139,14 @@ public interface CompanyStaffService extends IService<CompanyStaff> {
* @return cn.iocoder.yudao.module.staff.entity.CompanyStaff * @return cn.iocoder.yudao.module.staff.entity.CompanyStaff
**/ **/
CompanyStaffRespVO getMyAdviser(Long tenantId,String sysCode); CompanyStaffRespVO getMyAdviser(Long tenantId,String sysCode);
/**
* 创建员工信息在角色和用户已经存在的情况下用
*
* @author 小李
* @date 17:26 2024/12/19
* @param staffRespVO 信息
**/
void createByExistUser(CompanyStaffRespVO staffRespVO);
} }

View File

@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.staff.service.impl;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.log.Log;
import cn.iocoder.yudao.common.*; 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.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
@ -685,4 +687,28 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
// 啥也不是 // 啥也不是
return ""; 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);
}
} }

View File

@ -93,6 +93,9 @@ public enum InspectionRoleCommon {
/** 安全检验员 */ /** 安全检验员 */
AQJYY("aqjyy", 4), AQJYY("aqjyy", 4),
/** 授权签字人 */
JCSQQZR("jcsqqzr", 4),
/** 检测员工 */ /** 检测员工 */
JCWORKER("jcworker", 4); JCWORKER("jcworker", 4);

View File

@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; 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.config.CommonStr.SUPER_ADMIN_ID;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -349,8 +350,10 @@ public class RoleServiceImpl implements RoleService {
*/ */
@Override @Override
public List<RoleDO> pageByQuery(RoleDO roleDO) { 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())); .eq(RoleDO::getServicePackageId, roleDO.getServicePackageId()));
return roleDOS.stream().filter(item -> !item.getCode().equals("jcyh")).collect(Collectors.toList());
} }
@Override @Override

View File

@ -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_user_role sr on su.id = sr.user_id
left join system_role sr2 on sr.role_id = sr2.id left join system_role sr2 on sr.role_id = sr2.id
<where> <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"> <if test="role.roleId != null">
and sr.role_id = #{role.roleId} and sr.role_id = #{role.roleId}
</if> </if>