Compare commits
7 Commits
40819a9933
...
7c564df4bc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c564df4bc | ||
|
|
b5d140498f | ||
|
|
ffafa16367 | ||
|
|
819430bc73 | ||
|
|
603e962aa9 | ||
|
|
94db55c584 | ||
|
|
d6d271edda |
@ -39,4 +39,12 @@ public class BaseConstants {
|
||||
public static final String LABEL_TYPE = "default";
|
||||
/** 唯一推广码生成长度 */
|
||||
public static final Integer UNIQUE_CODE_LEN = 6;
|
||||
/**企业功能标识*/
|
||||
public static final String FUNC_COMPANY = "company";
|
||||
/**批量操作数据量*/
|
||||
public static final Integer BATCH_SIZE = 100;
|
||||
/**资质临期通知模板*/
|
||||
public static final String QUALS_INTERIM_PERIOD = "quals_interim_period";
|
||||
/**资质过期通知模板*/
|
||||
public static final String QUALS_EXPIRED = "quals_expired";
|
||||
}
|
||||
|
||||
@ -7,5 +7,6 @@ public interface CommonErrorCodeConstants extends ErrorCodeConstants {
|
||||
|
||||
/** 企业管理-员工管理 */
|
||||
ErrorCode UNIQUE_CODE_CREATE_REPEAT = new ErrorCode(2_002_000_000, "唯一推广码生成失败");
|
||||
ErrorCode STAFF_CHANGE_CREATE_REPEAT = new ErrorCode(2_002_000_001, "交出或接收员工已有交接记录");
|
||||
ErrorCode STAFF_CHANGE_CREATE_REPEAT = new ErrorCode(2_002_000_001, "该员工工作已交接");
|
||||
ErrorCode STAFF_NOT_CHANGE = new ErrorCode(2_002_000_003, "该员工还有工作未交接,不可删除");
|
||||
}
|
||||
|
||||
@ -17,5 +17,8 @@ public class DictBaseConstants {
|
||||
public static final String DICT_SIGN_TYPE = "cus_sign_type";
|
||||
/**性别*/
|
||||
public static final String DICT_SYS_USER_SEX = "system_user_sex";
|
||||
|
||||
/**学历*/
|
||||
public static final String COMPANY_STAFF_EDU = "company_staff_edu";
|
||||
/**企业资质临期判定时间*/
|
||||
public static final String COMPANY_QUALS_EXPIRED = "company_quals_expired";
|
||||
}
|
||||
|
||||
@ -2,12 +2,15 @@ package cn.iocoder.yudao.module.company.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.company.entity.Company;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表数据库访问层
|
||||
* @author : http://www.chiner.pro
|
||||
@ -16,4 +19,11 @@ import org.apache.ibatis.annotations.Param;
|
||||
@Mapper
|
||||
public interface CompanyMapper extends BaseMapper<Company>{
|
||||
IPage<Company> selectListPage(@Param("map") CompanyReqVO companyReqVO, Page<Company> page);
|
||||
|
||||
/**
|
||||
* 获取所有企业及对应的管理信息
|
||||
* @author 小李
|
||||
* @date 10:15 2024/8/14
|
||||
**/
|
||||
List<CompanyRespVO> getCompanyAndManager();
|
||||
}
|
||||
@ -2,8 +2,11 @@ package cn.iocoder.yudao.module.company.service;
|
||||
|
||||
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyQualsRespVO;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业资质信息表
|
||||
* @author : http://www.chiner.pro
|
||||
@ -34,4 +37,11 @@ public interface CompanyQualsService extends IService<CompanyQuals> {
|
||||
* @param id 企业资质id
|
||||
**/
|
||||
void removeDataObj(String id);
|
||||
|
||||
/**
|
||||
* 企业资质临期提醒
|
||||
* @author 小李
|
||||
* @date 8:54 2024/8/14
|
||||
**/
|
||||
void noticeCompanyQualsExpired(List<CompanyRespVO> companyRespVOS);
|
||||
}
|
||||
@ -7,6 +7,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表服务接口
|
||||
* @author : http://www.chiner.pro
|
||||
@ -44,4 +46,11 @@ public interface CompanyService extends IService<Company> {
|
||||
* @param id 企业id
|
||||
**/
|
||||
void removeDataObj(String id);
|
||||
|
||||
/**
|
||||
* 获取所有企业及对应的管理信息
|
||||
* @author 小李
|
||||
* @date 10:15 2024/8/14
|
||||
**/
|
||||
List<CompanyRespVO> getCompanyAndManager();
|
||||
}
|
||||
@ -1,19 +1,43 @@
|
||||
package cn.iocoder.yudao.module.company.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.BaseConstants;
|
||||
import cn.iocoder.yudao.common.DictBaseConstants;
|
||||
import cn.iocoder.yudao.module.company.entity.CompanyQuals;
|
||||
import cn.iocoder.yudao.module.company.mapper.CompanyQualsMapper;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyQualsService;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyQualsRespVO;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||
import cn.iocoder.yudao.module.system.api.dict.DictDataApi;
|
||||
import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.notify.NotifyMessageSendApi;
|
||||
import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, CompanyQuals> implements CompanyQualsService {
|
||||
@Resource
|
||||
private CompanyQualsMapper companyQualsMapper;
|
||||
|
||||
@Resource
|
||||
private DictDataApi dataApi;
|
||||
|
||||
@Resource
|
||||
private NotifyMessageSendApi sendApi;
|
||||
|
||||
/**
|
||||
* 新增企业资质信息
|
||||
*
|
||||
@ -49,4 +73,73 @@ public class CompanyQualsServiceImpl extends ServiceImpl<CompanyQualsMapper, Com
|
||||
public void removeDataObj(String id) {
|
||||
this.removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业资质临期提醒
|
||||
*
|
||||
* @author 小李
|
||||
* @date 8:54 2024/8/14
|
||||
**/
|
||||
@Override
|
||||
public void noticeCompanyQualsExpired(List<CompanyRespVO> companyRespVOS) {
|
||||
// 构建分页条件
|
||||
LambdaQueryWrapper<CompanyQuals> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<CompanyQuals> page = new Page<>(0, BaseConstants.BATCH_SIZE);
|
||||
// 获取临期判定时间
|
||||
List<DictDataRespDTO> dictDataList = dataApi.getDictDataList(DictBaseConstants.COMPANY_QUALS_EXPIRED);
|
||||
Long ruleDay = null;
|
||||
if (ObjectUtil.isNotEmpty(dictDataList)) {
|
||||
ruleDay = Long.valueOf(dictDataList.get(0).getValue());
|
||||
}
|
||||
while (ObjectUtil.isNotEmpty(ruleDay)) {
|
||||
// 查询一页数据
|
||||
Page<CompanyQuals> qualsPage = baseMapper.selectPage(page, queryWrapper);
|
||||
// 分类出临期和过期的数据
|
||||
// 这里重新赋值是因为不重新赋值用不了,我也不知道为什么,看到这里的人知道的话可以给我讲讲
|
||||
Long finalRuleDay = ruleDay;
|
||||
qualsPage.getRecords().forEach(item -> {
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
LocalDate endDate = item.getEndDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
// 计算离当前时间还有多少天
|
||||
Long day = ChronoUnit.DAYS.between(currentDate, endDate);
|
||||
// day 小于0是过期了 小于等于finalRuleDay是临期了 其他就正常的
|
||||
if (day < 0) {
|
||||
sendMessage(item, BaseConstants.QUALS_EXPIRED, companyRespVOS, day);
|
||||
} else if (day <= finalRuleDay) {
|
||||
sendMessage(item, BaseConstants.QUALS_INTERIM_PERIOD, companyRespVOS, day);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送站内信
|
||||
*
|
||||
* @param data 要发送的数据
|
||||
* @param templateCode 发送用什么模板
|
||||
* @param companyRespVOS 企业和其管理员数据集
|
||||
* @param day 资质的到期时间到今天还有多少天
|
||||
* @author 小李
|
||||
* @date 9:58 2024/8/14
|
||||
**/
|
||||
private void sendMessage(CompanyQuals data, String templateCode, List<CompanyRespVO> companyRespVOS, Long day) {
|
||||
// 获取记录的企业管理员的id
|
||||
List<CompanyRespVO> collect = companyRespVOS.stream().filter(company -> company.getId() == data.getCorpId()).collect(Collectors.toList());
|
||||
if (ObjectUtil.isNotEmpty(collect)) {
|
||||
Long userId = collect.get(0).getUserDTO().getId();
|
||||
|
||||
// 准备发送参数
|
||||
Map<String, Object> templateParams = new HashMap<>();
|
||||
// 什么资质
|
||||
templateParams.put("qualsName", data.getQualsName());
|
||||
// 还有多少天过期或已过期多少天,可能是负数,绝对值一下
|
||||
templateParams.put("day", Math.abs(day));
|
||||
|
||||
// 发送
|
||||
sendApi.sendSingleMessageToAdmin(new NotifySendSingleToUserReqDTO()
|
||||
.setUserId(userId)
|
||||
.setTemplateCode(templateCode).setTemplateParams(templateParams));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,4 +161,13 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有企业及对应的管理信息
|
||||
* @author 小李
|
||||
* @date 10:15 2024/8/14
|
||||
**/
|
||||
@Override
|
||||
public List<CompanyRespVO> getCompanyAndManager(){
|
||||
return baseMapper.getCompanyAndManager();
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.company.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.company.entity.Company;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@ -20,4 +21,9 @@ public class CompanyRespVO extends Company {
|
||||
* 登录账户密码
|
||||
*/
|
||||
List<String> serviceCodeArray;
|
||||
|
||||
/**
|
||||
* 企业对应的管理员
|
||||
**/
|
||||
private UserDTO userDTO;
|
||||
}
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.custom.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.custom.entity.BasePromotion;
|
||||
import cn.iocoder.yudao.module.custom.service.BasePromotionService;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionReqVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 推广记录表 控制层
|
||||
*
|
||||
* @author 小李
|
||||
* @date 16:42 2024/8/13
|
||||
**/
|
||||
@Tag(name = "管理后台 - 推广记录")
|
||||
@Validated
|
||||
@RestController
|
||||
@RequestMapping("/base/promotion")
|
||||
public class BasePromotionController {
|
||||
|
||||
@Resource
|
||||
private BasePromotionService promotionService;
|
||||
|
||||
/**
|
||||
* 分页查询推广记录
|
||||
*
|
||||
* @param pageReqVO 查询条件对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
* @author 小李
|
||||
* @date 16:50 2024/8/13
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "分页查询推广记录")
|
||||
@PreAuthorize("@ss.hasPermission('base:promotion:query')")
|
||||
public CommonResult<IPage<?>> getBasePromotionPage(BasePromotionReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<BasePromotion> page = new Page<>(pageNo, pageSize);
|
||||
return success(promotionService.queryListPage(pageReqVO, page));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package cn.iocoder.yudao.module.custom.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 推广记录表实体
|
||||
* @author 小李
|
||||
* @date 16:31 2024/8/13
|
||||
**/
|
||||
@TableName(value ="base_promotion")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class BasePromotion extends TenantBaseDO {
|
||||
/** 主键标识 */
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
|
||||
/** 推广用户id(system_users表的id) */
|
||||
private Long oldUserId;
|
||||
|
||||
/** 推广用户姓名 */
|
||||
private String oldUserName;
|
||||
|
||||
/** 推广渠道 */
|
||||
private String promotionChannel;
|
||||
|
||||
/** 被推广用户id(system_users表的id) */
|
||||
private Long newUserId;
|
||||
|
||||
/** 被推广用户姓名 */
|
||||
private String newUserName;
|
||||
|
||||
/** 被推广用户注册时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date registerTime;
|
||||
|
||||
/** 被推广用户注册时填写的推广码 */
|
||||
private String uniqueCode;
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
package cn.iocoder.yudao.module.custom.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.BasePromotion;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 推广记录表 Mapper
|
||||
* @author 小李
|
||||
* @date 16:38 2024/8/13
|
||||
**/
|
||||
@Mapper
|
||||
public interface BasePromotionMapper extends BaseMapper<BasePromotion> {
|
||||
|
||||
/**
|
||||
* 分页查询推广记录
|
||||
*
|
||||
* @param pageReqVO 查询条件对象
|
||||
* @author 小李
|
||||
* @date 16:50 2024/8/13
|
||||
**/
|
||||
IPage<BasePromotionRespVO> queryListPage(@Param("map") BasePromotionReqVO pageReqVO, Page<BasePromotion> page);
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.custom.service;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.BasePromotion;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 推广记录表 接口服务
|
||||
* @author 小李
|
||||
* @date 16:40 2024/8/13
|
||||
**/
|
||||
public interface BasePromotionService extends IService<BasePromotion> {
|
||||
|
||||
/**
|
||||
* 推广记录表 分布查询
|
||||
* @author 小李
|
||||
* @date 12:24 2024/8/14
|
||||
* @param pageReqVO 查询对象
|
||||
* @param page 分页规则
|
||||
**/
|
||||
IPage<BasePromotionRespVO> queryListPage(BasePromotionReqVO pageReqVO, Page<BasePromotion> page);
|
||||
|
||||
/**
|
||||
* 新增推广记录
|
||||
* @author 小李
|
||||
* @date 12:26 2024/8/14
|
||||
* @param promotionRespVO 新增对象
|
||||
**/
|
||||
Boolean createPromotion(BasePromotionRespVO promotionRespVO);
|
||||
}
|
||||
@ -0,0 +1,46 @@
|
||||
package cn.iocoder.yudao.module.custom.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.iocoder.yudao.module.custom.entity.BasePromotion;
|
||||
import cn.iocoder.yudao.module.custom.mapper.BasePromotionMapper;
|
||||
import cn.iocoder.yudao.module.custom.service.BasePromotionService;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionReqVO;
|
||||
import cn.iocoder.yudao.module.custom.vo.BasePromotionRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 推广记录表 接口实现类
|
||||
* @author 小李
|
||||
* @date 16:41 2024/8/13
|
||||
**/
|
||||
@Service
|
||||
public class BasePromotionServiceImpl extends ServiceImpl<BasePromotionMapper, BasePromotion> implements BasePromotionService {
|
||||
|
||||
/**
|
||||
* 分页查询推广记录
|
||||
*
|
||||
* @param pageReqVO 查询条件对象
|
||||
* @author 小李
|
||||
* @date 16:50 2024/8/13
|
||||
**/
|
||||
@Override
|
||||
public IPage<BasePromotionRespVO> queryListPage(BasePromotionReqVO pageReqVO, Page<BasePromotion> page) {
|
||||
return baseMapper.queryListPage(pageReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增推广记录
|
||||
* @author 小李
|
||||
* @date 12:26 2024/8/14
|
||||
* @param promotionRespVO 新增对象
|
||||
**/
|
||||
@Override
|
||||
public Boolean createPromotion(BasePromotionRespVO promotionRespVO){
|
||||
BasePromotion basePromotion = new BasePromotion();
|
||||
BeanUtil.copyProperties(promotionRespVO, basePromotion);
|
||||
return baseMapper.insert(basePromotion) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.BasePromotion;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 推广记录表查询VO
|
||||
* @author 小李
|
||||
* @date 16:36 2024/8/13
|
||||
**/
|
||||
@Data
|
||||
public class BasePromotionReqVO extends BasePromotion {
|
||||
|
||||
@Schema(description = "被推广人注册日期查询范围")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] registerTimeArray;
|
||||
|
||||
/** 推广人类型 */
|
||||
private String userType;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package cn.iocoder.yudao.module.custom.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.custom.entity.BasePromotion;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 推广记录表响应或提交VO
|
||||
* @author 小李
|
||||
* @date 16:37 2024/8/13
|
||||
**/
|
||||
@Data
|
||||
public class BasePromotionRespVO extends BasePromotion {
|
||||
|
||||
/** 推广人 */
|
||||
private UserDTO oldUser;
|
||||
|
||||
/** 被推广人 */
|
||||
private UserDTO newUser;
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.scheduled;
|
||||
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyQualsService;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyService;
|
||||
import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 定时提醒企业管理员资质过期
|
||||
* @author 小李
|
||||
* @date 16:02 2024/8/13
|
||||
**/
|
||||
@Component
|
||||
@TenantJob
|
||||
@Slf4j
|
||||
public class NoticeCompanyQualsExpiredJob implements JobHandler {
|
||||
|
||||
@Resource
|
||||
private CompanyQualsService qualsService;
|
||||
|
||||
@Resource
|
||||
private CompanyService companyService;
|
||||
|
||||
@Override
|
||||
public String execute(String param) throws Exception {
|
||||
// 获取所有企业和其管理员
|
||||
List<CompanyRespVO> companyAndManager = companyService.getCompanyAndManager();
|
||||
// 提醒管理员资质过期
|
||||
qualsService.noticeCompanyQualsExpired(companyAndManager);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -6,29 +6,42 @@
|
||||
SELECT
|
||||
bc.*
|
||||
FROM
|
||||
base_company bc
|
||||
base_company bc
|
||||
WHERE deleted = '0'
|
||||
<if test="map.registDateArray.length>0">
|
||||
AND (bc.regist_date BETWEEN #{map.registDateArray[0]} AND #{map.registDateArray[1]})
|
||||
</if>
|
||||
<if test="map.corpName!='' and map.corpName!=null">
|
||||
AND (bc.corp_name LIKE CONCAT('%',#{map.corpName},'%'))
|
||||
AND (bc.corp_name LIKE CONCAT('%',#{map.corpName},'%'))
|
||||
</if>
|
||||
<if test="map.orgCard!='' and map.orgCard!=null">
|
||||
AND (bc.org_card LIKE CONCAT('%',#{map.orgCard},'%'))
|
||||
AND (bc.org_card LIKE CONCAT('%',#{map.orgCard},'%'))
|
||||
</if>
|
||||
<if test="map.legalName!='' and map.legalName!=null">
|
||||
AND (bc.legal_name LIKE CONCAT('%',#{map.legalName},'%'))
|
||||
AND (bc.legal_name LIKE CONCAT('%',#{map.legalName},'%'))
|
||||
</if>
|
||||
<if test="map.legalCard!='' and map.legalCard!=null">
|
||||
AND (bc.legal_card LIKE CONCAT('%',#{map.legalCard},'%'))
|
||||
AND (bc.legal_card LIKE CONCAT('%',#{map.legalCard},'%'))
|
||||
</if>
|
||||
<if test="map.contactName!='' and map.contactName!=null">
|
||||
AND (bc.contact_name LIKE CONCAT('%',#{map.contactName},'%'))
|
||||
AND (bc.contact_name LIKE CONCAT('%',#{map.contactName},'%'))
|
||||
</if>
|
||||
<if test="map.mobilePhone!='' and map.mobilePhone!=null">
|
||||
AND (bc.mobile_phone LIKE CONCAT('%',#{map.mobilePhone},'%'))
|
||||
AND (bc.mobile_phone LIKE CONCAT('%',#{map.mobilePhone},'%'))
|
||||
</if>
|
||||
ORDER BY bc.create_time DESC
|
||||
</select>
|
||||
|
||||
<resultMap id="QueryResultMap" type="cn.iocoder.yudao.module.company.vo.CompanyRespVO">
|
||||
<id property="id" column="c_id" jdbcType="VARCHAR"/>
|
||||
<association property="userDTO" javaType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
|
||||
<id property="id" column="u_id" jdbcType="BIGINT" />
|
||||
</association>
|
||||
</resultMap>
|
||||
<select id="getCompanyAndManager" resultMap="QueryResultMap">
|
||||
select c.id as c_id,
|
||||
u.id as u_id
|
||||
from base_company c
|
||||
inner join system_users u on c.login_account = u.username
|
||||
</select>
|
||||
</mapper>
|
||||
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.custom.mapper.BasePromotionMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.custom.vo.BasePromotionRespVO">
|
||||
<id property="id" column="bp_id" jdbcType="VARCHAR"/>
|
||||
<result property="oldUserName" column="bp_old_user_name" jdbcType="VARCHAR"/>
|
||||
<result property="promotionChannel" column="bp_promotion_channel" jdbcType="VARCHAR"/>
|
||||
<result property="newUserName" column="bp_new_user_name" jdbcType="VARCHAR"/>
|
||||
<result property="registerTime" column="bp_register_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="uniqueCode" column="bp_unique_code" jdbcType="VARCHAR"/>
|
||||
|
||||
<association property="oldUser" javaType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
|
||||
<result property="mobile" column="os_mobile"/>
|
||||
<result property="userType" column="os_user_type"/>
|
||||
</association>
|
||||
|
||||
<association property="newUser" javaType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
|
||||
<result property="mobile" column="ns_mobile"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<select id="queryListPage" resultMap="BaseResultMap">
|
||||
select bp.id as bp_id,
|
||||
bp.promotion_channel as bp_promotion_channel,
|
||||
bp.register_time as bp_register_time,
|
||||
bp.unique_code as bp_unique_code,
|
||||
bp.old_user_name as bp_old_user_name,
|
||||
bp.new_user_name as bp_new_user_name,
|
||||
os.mobile as os_mobile,
|
||||
os.user_type as os_user_type,
|
||||
ns.mobile as ns_mobile
|
||||
from base_promotion bp
|
||||
INNER JOIN system_users os on bp.old_user_id = os.id
|
||||
INNER JOIN system_users ns on bp.new_user_id = ns.id
|
||||
where bp.deleted = '0'
|
||||
<if test="map.oldUserName != null and map.oldUserName != ''">
|
||||
and (bp.old_user_name like concat('%', #{map.oldUserName}, '%'))
|
||||
</if>
|
||||
<if test="map.uniqueCode != null and map.uniqueCode != ''">
|
||||
and (bp.unique_code like concat('%', #{map.uniqueCode}, '%'))
|
||||
</if>
|
||||
<if test="map.newUserName != null and map.newUserName != ''">
|
||||
and (bp.new_user_name like concat('%', #{map.newUserName}, '%'))
|
||||
</if>
|
||||
<if test="map.promotionChannel != null and map.promotionChannel != ''">
|
||||
and (bp.promotion_channel = #{map.promotionChannel})
|
||||
</if>
|
||||
<if test="map.registerTimeArray != null and map.registerTimeArray.length > 0">
|
||||
and (bp.register_time between #{map.registerTimeArray[0]} and #{map.registerTimeArray[1]})
|
||||
</if>
|
||||
<if test="map.userType != null and map.userType != ''">
|
||||
and (os.user_type = #{map.userType})
|
||||
</if>
|
||||
order by bp.create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -1,10 +1,12 @@
|
||||
package cn.iocoder.yudao.module.staff.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaffChange;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffChangeService;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeRespVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -12,7 +14,6 @@ import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
@ -30,6 +31,12 @@ public class CompanyStaffChangeController {
|
||||
@Resource
|
||||
private CompanyStaffChangeService staffChangeService;
|
||||
|
||||
/**
|
||||
* 创建交接信息
|
||||
* @author 小李
|
||||
* @date 14:30 2024/8/12
|
||||
* @param staffChangeRespVO 交接双方
|
||||
**/
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建企业管理-员工交接表信息")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:change')")
|
||||
@ -39,15 +46,19 @@ public class CompanyStaffChangeController {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询交接双方信息
|
||||
* @author 小李
|
||||
* @date 18:26 2024/8/8
|
||||
* @param id 接收方员工ID
|
||||
**/
|
||||
@GetMapping("/changeItem")
|
||||
* @date 18:56 2024/8/12
|
||||
* @param staffChangeReqVO 查询条件对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "查询企业管理-员工交接表信息及交接双方")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:query')")
|
||||
public CommonResult<CompanyStaffChangeRespVO> getChangeStaff(@RequestParam("id") String id){
|
||||
return success(staffChangeService.getChangeStaff(id));
|
||||
@PreAuthorize("@ss.hasPermission('company:staffChange:query')")
|
||||
public CommonResult<IPage<?>> getStaffChangePage(CompanyStaffChangeReqVO staffChangeReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize){
|
||||
Page<CompanyStaffChange> page = new Page<>(pageNo, pageSize);
|
||||
return success(staffChangeService.getStaffChangePage(staffChangeReqVO, page));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,14 +2,12 @@ package cn.iocoder.yudao.module.staff.controller.admin;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
import cn.iocoder.yudao.module.label.entity.Label;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@ -31,9 +29,10 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 企业管理-员工信息表 控制层
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:14 2024/8/6
|
||||
**/
|
||||
**/
|
||||
@RestController
|
||||
@RequestMapping("/company/staff")
|
||||
@Tag(name = "管理后台 - 企业管理 - 员工管理")
|
||||
@ -45,28 +44,30 @@ public class CompanyStaffController {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param pageReqVO 查询条件对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
* @author 小李
|
||||
* @date 17:19 2024/8/6
|
||||
* @param pageReqVO 查询条件对象
|
||||
* @param pageNo 页码
|
||||
* @param pageSize 条数
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得企业管理-员工信息表信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:query')")
|
||||
public CommonResult<IPage<?>> getCompanyStaffPage(CompanyStaffReqVO pageReqVO,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
Page<CompanyStaff> page = new Page<>(pageNo, pageSize);
|
||||
return success(staffService.queryListPage(pageReqVO, page));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工
|
||||
*
|
||||
* @param staffRespVO 员工对象
|
||||
* @author 小李
|
||||
* @date 17:20 2024/8/6
|
||||
* @param staffRespVO 员工对象
|
||||
**/
|
||||
**/
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建企业管理-员工信息表信息")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:create')")
|
||||
@ -77,10 +78,11 @@ public class CompanyStaffController {
|
||||
|
||||
/**
|
||||
* 修改员工
|
||||
*
|
||||
* @param staffRespVO 员工对象
|
||||
* @author 小李
|
||||
* @date 17:24 2024/8/6
|
||||
* @param staffRespVO 员工对象
|
||||
**/
|
||||
**/
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新企业管理-员工信息表信息")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:update')")
|
||||
@ -91,10 +93,11 @@ public class CompanyStaffController {
|
||||
|
||||
/**
|
||||
* 删除员工
|
||||
*
|
||||
* @param id 员工id
|
||||
* @author 小李
|
||||
* @date 17:28 2024/8/6
|
||||
* @param id 员工id
|
||||
**/
|
||||
**/
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除企业管理-员工信息表信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@ -106,10 +109,11 @@ public class CompanyStaffController {
|
||||
|
||||
/**
|
||||
* 查询员工
|
||||
*
|
||||
* @param id
|
||||
* @author 小李
|
||||
* @date 17:59 2024/8/6
|
||||
* @param id
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得企业管理-员工信息表信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@ -121,44 +125,79 @@ public class CompanyStaffController {
|
||||
|
||||
/**
|
||||
* 导出员工信息表
|
||||
*
|
||||
* @param pageReqVO 查询条件--暂时导出所有
|
||||
* @param response 响应体
|
||||
* @author 小李
|
||||
* @date 18:01 2024/8/6
|
||||
* @param pageReqVO 查询条件--暂时导出所有
|
||||
* @param response 响应体
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出企业管理-员工信息表 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportCompanyStaffExcel(CompanyStaffReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
HttpServletResponse response) throws IOException {
|
||||
List<CompanyStaff> list = staffService.list();
|
||||
// 导出 Excel
|
||||
Map<Integer, Integer> columnWidthMap = new HashMap<>();
|
||||
// 第一列的索引是0,宽度设置为20个字符宽
|
||||
columnWidthMap.put(9, 20);
|
||||
columnWidthMap.put(10, 20);
|
||||
ExcelUtils.write(response, "企业信息表.xls", "数据", CompanyStaff.class, list,columnWidthMap);
|
||||
ExcelUtils.write(response, "企业信息表.xls", "数据", CompanyStaff.class, list, columnWidthMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前功能的标签
|
||||
*
|
||||
* @author 小李
|
||||
* @date 14:59 2024/8/7
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/labels")
|
||||
public CommonResult<List<Label>> getLabels(){
|
||||
@Operation(summary = "获取当前功能的标签")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:query')")
|
||||
public CommonResult<List<Label>> getLabels() {
|
||||
return success(staffService.getLabels());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户部门下所有员工信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:54 2024/8/8
|
||||
**/
|
||||
**/
|
||||
@GetMapping("/list")
|
||||
public CommonResult<List<CompanyStaff>> getStaffList(){
|
||||
@Operation(summary = "获取当前登录用户部门下所有员工信息")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:query')")
|
||||
public CommonResult<List<CompanyStaff>> getStaffList() {
|
||||
return success(staffService.getStaffList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证工号是否重复
|
||||
*
|
||||
* @param workNo 输入的工号
|
||||
* @author 小李
|
||||
* @date 14:03 2024/8/9
|
||||
**/
|
||||
@GetMapping("/checkWorkNo")
|
||||
@Operation(summary = "验证工号是否重复")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:query')")
|
||||
public CommonResult<Boolean> checkWorkNo(@RequestParam("workNo") String workNo) {
|
||||
return success(staffService.checkWorkNo(workNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置员工登录密码
|
||||
*
|
||||
* @param staffRespVO 员工对象
|
||||
* @author 小李
|
||||
* @date 16:21 2024/8/9
|
||||
**/
|
||||
@PostMapping("/resetPassword")
|
||||
@Operation(summary = "重置员工登录密码")
|
||||
@PreAuthorize("@ss.hasPermission('company:staff:resetPassword')")
|
||||
public CommonResult resetPassword(@RequestBody CompanyStaffRespVO staffRespVO) {
|
||||
staffService.resetPassword(staffRespVO);
|
||||
return CommonResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package cn.iocoder.yudao.module.staff.entity;
|
||||
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
@ -15,6 +17,8 @@ import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import static cn.iocoder.yudao.common.DictBaseConstants.*;
|
||||
|
||||
/**
|
||||
* 企业管理-员工信息实体
|
||||
* @author 小李
|
||||
@ -51,7 +55,8 @@ public class CompanyStaff extends TenantBaseDO {
|
||||
private String tel;
|
||||
|
||||
/** 性别 */
|
||||
@ExcelProperty("性别")
|
||||
@ExcelProperty(value = "性别", converter = DictConvert.class)
|
||||
@DictFormat(DICT_SYS_USER_SEX)
|
||||
private String sex;
|
||||
|
||||
/** 家庭住址 */
|
||||
@ -65,7 +70,7 @@ public class CompanyStaff extends TenantBaseDO {
|
||||
private Date workDate;
|
||||
|
||||
/** 工龄 */
|
||||
@ExcelProperty("工龄")
|
||||
@ExcelProperty("工龄(年)")
|
||||
private BigDecimal workYear;
|
||||
|
||||
/** 入职日期 */
|
||||
@ -75,11 +80,12 @@ public class CompanyStaff extends TenantBaseDO {
|
||||
private Date joinedDate;
|
||||
|
||||
/** 司龄 */
|
||||
@ExcelProperty("司龄")
|
||||
@ExcelProperty("司龄(年)")
|
||||
private BigDecimal joinedYear;
|
||||
|
||||
/** 学历 */
|
||||
@ExcelProperty("学历")
|
||||
@ExcelProperty(value = "学历", converter = DictConvert.class)
|
||||
@DictFormat(COMPANY_STAFF_EDU)
|
||||
private String education;
|
||||
|
||||
/** 个人简介 */
|
||||
|
||||
@ -32,8 +32,8 @@ public class CompanyStaffChange extends TenantBaseDO {
|
||||
private Long newUserId;
|
||||
|
||||
/** 交接时间 */
|
||||
@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date changeTime;
|
||||
|
||||
/** 附件urls(infra_file表中的url,多个英文逗号拼接) */
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package cn.iocoder.yudao.module.staff.mapper;
|
||||
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaffChange;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeRespVO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 企业管理-员工交接记录
|
||||
@ -11,4 +16,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
**/
|
||||
@Mapper
|
||||
public interface CompanyStaffChangeMapper extends BaseMapper<CompanyStaffChange> {
|
||||
|
||||
IPage<CompanyStaffChangeRespVO> getStaffChangePage(@Param("map") CompanyStaffChangeReqVO staffChangeReqVO, Page<CompanyStaffChange> page);
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
package cn.iocoder.yudao.module.staff.service;
|
||||
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaffChange;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeRespVO;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 企业管理-员工交接记录 接口
|
||||
* @author 小李
|
||||
@ -22,10 +23,17 @@ public interface CompanyStaffChangeService extends IService<CompanyStaffChange>
|
||||
void createChangeStaff(CompanyStaffChangeRespVO staffChangeRespVO);
|
||||
|
||||
/**
|
||||
* 查询交接双方信息
|
||||
* @author 小李
|
||||
* @date 18:26 2024/8/8
|
||||
* @param id 接收方员工ID
|
||||
* @date 19:00 2024/8/12
|
||||
* @param staffChangeReqVO 分页对象
|
||||
**/
|
||||
IPage<CompanyStaffChangeRespVO> getStaffChangePage(CompanyStaffChangeReqVO staffChangeReqVO, Page<CompanyStaffChange> page);
|
||||
|
||||
/**
|
||||
* 判断交出方工作是否已交接
|
||||
* @author 小李
|
||||
* @date 18:02 2024/8/12
|
||||
* @param userId 交出方ID
|
||||
**/
|
||||
CompanyStaffChangeRespVO getChangeStaff(String id);
|
||||
Boolean checkChangeStatus(Long userId);
|
||||
}
|
||||
|
||||
@ -71,4 +71,27 @@ public interface CompanyStaffService extends IService<CompanyStaff> {
|
||||
* @date 15:54 2024/8/8
|
||||
**/
|
||||
List<CompanyStaff> getStaffList();
|
||||
|
||||
/**
|
||||
* 重置员工登录密码
|
||||
* @author 小李
|
||||
* @date 16:21 2024/8/9
|
||||
* @param staffRespVO 员工对象
|
||||
**/
|
||||
void resetPassword(CompanyStaffRespVO staffRespVO);
|
||||
|
||||
/**
|
||||
* 验证工号是否重复
|
||||
* @author 小李
|
||||
* @date 14:03 2024/8/9
|
||||
* @param workNo 输入的工号
|
||||
**/
|
||||
Boolean checkWorkNo(String workNo);
|
||||
|
||||
/**
|
||||
* 更新员工的工龄和司龄
|
||||
* @author 小李
|
||||
* @date 11:41 2024/8/13
|
||||
**/
|
||||
void updateStaffWorkAndJoinedYears();
|
||||
}
|
||||
|
||||
@ -11,11 +11,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
public interface UniqueCodeService extends IService<UniqueCode> {
|
||||
|
||||
/**
|
||||
* 新增唯一推广码
|
||||
* 生成唯一推广码
|
||||
* @author 小李
|
||||
* @date 9:59 2024/8/8
|
||||
* @param uniqueCode
|
||||
*
|
||||
* @return*/
|
||||
int insertUniqueCode(String uniqueCode);
|
||||
* @return 可使用推广码
|
||||
**/
|
||||
String createUniqueCode();
|
||||
}
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package cn.iocoder.yudao.module.staff.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||
@ -8,13 +7,20 @@ import cn.iocoder.yudao.module.staff.entity.CompanyStaffChange;
|
||||
import cn.iocoder.yudao.module.staff.mapper.CompanyStaffChangeMapper;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffChangeService;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeRespVO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
|
||||
/**
|
||||
@ -36,14 +42,12 @@ public class CompanyStaffChangeServiceImpl extends ServiceImpl<CompanyStaffChang
|
||||
* @author 小李
|
||||
* @date 16:15 2024/8/8
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void createChangeStaff(CompanyStaffChangeRespVO staffChangeRespVO) {
|
||||
// 检查是否已有相同的交接记录或交出方已经交出或接收方已接收其他工作
|
||||
CompanyStaffChange staffChange = baseMapper.selectOne(new QueryWrapper<CompanyStaffChange>().and(itme -> {
|
||||
itme.eq("old_user_id", staffChangeRespVO.getOldUserId())
|
||||
.eq("new_user_id", staffChangeRespVO.getNewUserId());
|
||||
}).or().eq("old_user_id", staffChangeRespVO.getOldUserId())
|
||||
.or().eq("new_user_id", staffChangeRespVO.getNewUserId()));
|
||||
if (ObjectUtil.isNotEmpty(staffChange)) {
|
||||
// 确定交出方目前有没有工作可以交接
|
||||
Boolean flag = checkChangeStatus(staffChangeRespVO.getOldUserId());
|
||||
if (flag) {
|
||||
throw exception(CommonErrorCodeConstants.STAFF_CHANGE_CREATE_REPEAT);
|
||||
}
|
||||
baseMapper.insert(staffChangeRespVO);
|
||||
@ -51,33 +55,67 @@ public class CompanyStaffChangeServiceImpl extends ServiceImpl<CompanyStaffChang
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询交接双方信息
|
||||
* 交接记分页查询
|
||||
*
|
||||
* @param id 接收方员工ID
|
||||
* @param staffChangeReqVO 分页对象
|
||||
* @author 小李
|
||||
* @date 18:26 2024/8/8
|
||||
* @date 19:00 2024/8/12
|
||||
**/
|
||||
@Override
|
||||
public CompanyStaffChangeRespVO getChangeStaff(String id) {
|
||||
/** 构造返回对象 */
|
||||
CompanyStaffChangeRespVO result = null;
|
||||
// 1 根据当前ID获取员工记录
|
||||
CompanyStaff staff = staffService.getOne(new QueryWrapper<CompanyStaff>().eq("id", id));
|
||||
// 2 根据获取的员工信息中的userId获取交接记录
|
||||
CompanyStaffChange staffChange = baseMapper.selectOne(new QueryWrapper<CompanyStaffChange>()
|
||||
.eq("new_user_id", staff.getUserId())
|
||||
.or()
|
||||
.eq("old_user_id", staff.getUserId())
|
||||
);
|
||||
if (ObjectUtil.isNotEmpty(staffChange)) {
|
||||
result = new CompanyStaffChangeRespVO();
|
||||
BeanUtil.copyProperties(staffChange, result);
|
||||
// 3 根据交接记录中新老员工的userId查新老员工信息
|
||||
CompanyStaff oldStaff = staffService.getOne(new QueryWrapper<CompanyStaff>().eq("user_id", staffChange.getOldUserId()));
|
||||
CompanyStaff newStaff = staffService.getOne(new QueryWrapper<CompanyStaff>().eq("user_id", staffChange.getNewUserId()));
|
||||
result.setNewStaff(newStaff);
|
||||
result.setOldStaff(oldStaff);
|
||||
public IPage<CompanyStaffChangeRespVO> getStaffChangePage(CompanyStaffChangeReqVO staffChangeReqVO, Page<CompanyStaffChange> page) {
|
||||
// 如果用户选择了按交接类型搜索(交出、接收),那一定要保证员工姓名、工号、电话有一个不为空才行,不然没有参照
|
||||
if (ObjectUtil.isNotEmpty(staffChangeReqVO.getChangeType()) &&
|
||||
(ObjectUtil.isNotEmpty(staffChangeReqVO.getName()) ||
|
||||
ObjectUtil.isNotEmpty(staffChangeReqVO.getWorkNo()) ||
|
||||
ObjectUtil.isNotEmpty(staffChangeReqVO.getTel())
|
||||
)
|
||||
) {
|
||||
// 根据不为空的那个条件去查员工的userId
|
||||
List<CompanyStaff> list = null;
|
||||
if (ObjectUtil.isNotEmpty(staffChangeReqVO.getName())) {
|
||||
list = staffService.list(new LambdaQueryWrapper<CompanyStaff>()
|
||||
.like(CompanyStaff::getName, staffChangeReqVO.getName())
|
||||
);
|
||||
} else if (ObjectUtil.isNotEmpty(staffChangeReqVO.getWorkNo())) {
|
||||
list = staffService.list(new LambdaQueryWrapper<CompanyStaff>()
|
||||
.like(CompanyStaff::getWorkNo, staffChangeReqVO.getWorkNo())
|
||||
);
|
||||
} else if (ObjectUtil.isNotEmpty(staffChangeReqVO.getTel())) {
|
||||
list = staffService.list(new LambdaQueryWrapper<CompanyStaff>()
|
||||
.like(CompanyStaff::getTel, staffChangeReqVO.getTel())
|
||||
);
|
||||
}
|
||||
// 如果查到了结果才处理,没查到不管
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
List<Long> userIds = list.stream().map(item -> item.getUserId()).collect(Collectors.toList());
|
||||
if (staffChangeReqVO.getChangeType().equals("0")) {
|
||||
staffChangeReqVO.setOldUserIds(userIds);
|
||||
} else {
|
||||
staffChangeReqVO.setNewUserIds(userIds);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
return baseMapper.getStaffChangePage(staffChangeReqVO, page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断交出方工作是否已交接
|
||||
*
|
||||
* @param userId 交出方ID
|
||||
* @author 小李
|
||||
* @date 18:02 2024/8/12
|
||||
**/
|
||||
@Override
|
||||
public Boolean checkChangeStatus(Long userId) {
|
||||
// 获取该员工的最新一条记录
|
||||
CompanyStaffChange staffChange = baseMapper.selectOne(new LambdaQueryWrapper<CompanyStaffChange>()
|
||||
.eq(CompanyStaffChange::getOldUserId, userId)
|
||||
.or()
|
||||
.eq(CompanyStaffChange::getNewUserId, userId)
|
||||
.orderByDesc(CompanyStaffChange::getCreateTime)
|
||||
.last("limit 1")
|
||||
);
|
||||
// 如果为空或者最后一次相关记录他是交出方,那就返回true,代表他交接了工作没有工作可以交
|
||||
return ObjectUtil.isNotEmpty(staffChange) && staffChange.getOldUserId().equals(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,28 +2,24 @@ package cn.iocoder.yudao.module.staff.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.iocoder.yudao.common.BaseConstants;
|
||||
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
||||
import cn.iocoder.yudao.framework.common.util.io.FileUtils;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
|
||||
import cn.iocoder.yudao.framework.datapermission.core.rule.dept.DeptDataPermissionRule;
|
||||
import cn.iocoder.yudao.framework.security.core.LoginUser;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.company.entity.Company;
|
||||
import cn.iocoder.yudao.module.company.service.CompanyService;
|
||||
import cn.iocoder.yudao.module.infra.api.file.FileApi;
|
||||
import cn.iocoder.yudao.module.staff.entity.UniqueCode;
|
||||
import cn.iocoder.yudao.module.staff.service.UniqueCodeService;
|
||||
import cn.iocoder.yudao.module.label.entity.BusiLabel;
|
||||
import cn.iocoder.yudao.module.label.entity.Label;
|
||||
import cn.iocoder.yudao.module.label.service.BusiLabelService;
|
||||
import cn.iocoder.yudao.module.label.service.LabelService;
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaff;
|
||||
import cn.iocoder.yudao.module.staff.mapper.CompanyStaffMapper;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffChangeService;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
||||
import cn.iocoder.yudao.module.staff.service.UniqueCodeService;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffReqVO;
|
||||
import cn.iocoder.yudao.module.staff.vo.CompanyStaffRespVO;
|
||||
import cn.iocoder.yudao.module.system.api.dept.DeptApi;
|
||||
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
|
||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
||||
@ -36,9 +32,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Period;
|
||||
import java.time.ZoneId;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@ -61,16 +60,17 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
@Resource
|
||||
private LabelService labelService;
|
||||
|
||||
@Resource
|
||||
private CompanyService companyService;
|
||||
|
||||
@Resource
|
||||
private BusiLabelService busiLabelService;
|
||||
|
||||
@Resource
|
||||
private UniqueCodeService uniqueCodeService;
|
||||
|
||||
@Resource
|
||||
private DataPermissionRule dataPermissionRule;
|
||||
private DeptApi deptApi;
|
||||
|
||||
@Resource
|
||||
private CompanyStaffChangeService staffChangeService;
|
||||
|
||||
/**
|
||||
* 获得企业管理-员工信息表分页
|
||||
@ -95,25 +95,25 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void saveStaff(CompanyStaffRespVO staffRespVO) {
|
||||
/** 获取当前登录用户的信息 */
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
AdminUserRespDTO user = adminUserApi.getUser(loginUser.getId());
|
||||
// 获取当前登录用户的详细信息
|
||||
AdminUserRespDTO loginUser = getLoginUser();
|
||||
|
||||
/** 创建UserDTO用于给sys_user插入数据 */
|
||||
/* 创建UserDTO用于给sys_user插入数据 */
|
||||
UserDTO userDTO = new UserDTO();
|
||||
userDTO.setUsername(staffRespVO.getLoginAccount());
|
||||
userDTO.setPassword(staffRespVO.getPassword());
|
||||
userDTO.setNickname(staffRespVO.getName());
|
||||
userDTO.setDeptId(user.getDeptId());
|
||||
userDTO.setDeptId(loginUser.getDeptId());
|
||||
userDTO.setMobile(staffRespVO.getTel());
|
||||
userDTO.setSex(staffRespVO.getSex());
|
||||
userDTO.setUserType(USER_TYPE_STAFF);
|
||||
// 获取sys_users中刚插入记录ID给准备添加的员工
|
||||
Long userId = adminUserApi.createUser(userDTO);
|
||||
staffRespVO.setUserId(userId);
|
||||
// 设置新增员工部门
|
||||
staffRespVO.setDeptId(user.getDeptId());
|
||||
staffRespVO.setDeptId(loginUser.getDeptId());
|
||||
|
||||
/** 插入标签库 */
|
||||
/* 插入标签库 */
|
||||
if (ObjectUtil.isNotEmpty(staffRespVO.getLabelsArray())) {
|
||||
// 1 获取标签库中的存在的数据
|
||||
List<Label> labels = getLabelsByLabelName(staffRespVO.getLabelsArray());
|
||||
@ -129,31 +129,20 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
}
|
||||
}
|
||||
|
||||
/** 插入员工库 */
|
||||
/* 插入员工库 */
|
||||
// 1 获取当前登录用户的企业信息给添加的员工
|
||||
Company company = companyService.getOne(new QueryWrapper<Company>().eq("mobile_phone", user.getMobile()));
|
||||
staffRespVO.setCorpId(company.getId());
|
||||
DeptRespDTO loginDept = getLoginDept(loginUser.getDeptId());
|
||||
staffRespVO.setCorpId(loginDept.getCorpId());
|
||||
// 2 生成唯一推广码
|
||||
int count = 0;
|
||||
// 3 生成时判断是否重复,重复就重新生成,最多生成6次
|
||||
while (true) {
|
||||
// 重复生成和长度一样的次数还是重复,就抛异常
|
||||
if (count == BaseConstants.UNIQUE_CODE_LEN) {
|
||||
throw exception(CommonErrorCodeConstants.UNIQUE_CODE_CREATE_REPEAT);
|
||||
}
|
||||
String code = RandomUtil.randomStringUpper(BaseConstants.UNIQUE_CODE_LEN);
|
||||
// 直接新增唯一推码 新增成功就是可以用,反之就是重复
|
||||
int flag = uniqueCodeService.insertUniqueCode(code);
|
||||
if (flag != 0) {
|
||||
staffRespVO.setUniqueCode(code);
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
String uniqueCode = uniqueCodeService.createUniqueCode();
|
||||
if (!ObjectUtil.isNotEmpty(uniqueCode)) {
|
||||
throw exception(CommonErrorCodeConstants.UNIQUE_CODE_CREATE_REPEAT);
|
||||
}
|
||||
staffRespVO.setUniqueCode(uniqueCode);
|
||||
// 3 保存员工信息到数据库
|
||||
this.save(staffRespVO);
|
||||
|
||||
/** 插入标签到业务标签表 */
|
||||
/* 插入标签到业务标签表 */
|
||||
if (ObjectUtil.isNotEmpty(staffRespVO.getLabelsArray())) {
|
||||
// 1 获取所有标签信息
|
||||
List<Label> labels = getLabelsByLabelName(staffRespVO.getLabelsArray());
|
||||
@ -173,9 +162,9 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void updateStaff(CompanyStaffRespVO staffRespVO) {
|
||||
/** 修改标签 */
|
||||
/* 修改标签 */
|
||||
if (ObjectUtil.isNotEmpty(staffRespVO.getLabelsArray())) {
|
||||
/** 检查是否需要新增标签 */
|
||||
/* 检查是否需要新增标签 */
|
||||
// 1 获取标签
|
||||
List<Label> labels = getLabelsByLabelName(staffRespVO.getLabelsArray());
|
||||
List<String> oldLabelNames = labels.stream().map(item -> item.getLabelName()).collect(Collectors.toList());
|
||||
@ -187,7 +176,7 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
labelService.saveBatch(newLabels);
|
||||
}
|
||||
|
||||
/** 检查是否需要更新业务标签 */
|
||||
/* 检查是否需要更新业务标签 */
|
||||
// 1 获取业务标签表中旧数据
|
||||
List<BusiLabel> busiLabels = getBusiLabelsByMainId(staffRespVO.getId());
|
||||
// 2 检查是否需要更新数据, 如果有就更新
|
||||
@ -209,7 +198,7 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
}
|
||||
}
|
||||
|
||||
/** 修改员工表 */
|
||||
/* 修改员工表 */
|
||||
baseMapper.updateById(staffRespVO);
|
||||
}
|
||||
|
||||
@ -223,19 +212,22 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void deleteStaff(String id) {
|
||||
/** 获取删除记录详细信息 */
|
||||
/* 获取删除记录详细信息 */
|
||||
CompanyStaff staff = baseMapper.selectById(id);
|
||||
|
||||
/** 删除sys_users记录 */
|
||||
/* 验证是否已交接工作 */
|
||||
Boolean flag = staffChangeService.checkChangeStatus(staff.getUserId());
|
||||
if (!flag) {
|
||||
throw exception(CommonErrorCodeConstants.STAFF_NOT_CHANGE);
|
||||
}
|
||||
|
||||
/* 删除sys_users记录 */
|
||||
adminUserApi.deleteUser(staff.getUserId());
|
||||
|
||||
/** 删除业务标签表记录 */
|
||||
busiLabelService.remove(new QueryWrapper<BusiLabel>().eq("main_id", staff.getId()));
|
||||
/* 删除业务标签表记录 */
|
||||
busiLabelService.remove(new LambdaQueryWrapper<BusiLabel>().eq(BusiLabel::getMainId, staff.getId()));
|
||||
|
||||
/** 删除唯一推广码表记录 */
|
||||
uniqueCodeService.remove(new QueryWrapper<UniqueCode>().eq("unique_code", staff.getUniqueCode()));
|
||||
|
||||
/** 删除员工表记录 */
|
||||
/* 删除员工表记录 */
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@ -253,7 +245,7 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
// 构建员工响应对象
|
||||
CompanyStaffRespVO staffRespVO = BeanUtil.toBean(staff, CompanyStaffRespVO.class);
|
||||
// 查询业务标签表中属于员工的标签
|
||||
List<BusiLabel> busiLabels = busiLabelService.list(new QueryWrapper<BusiLabel>().eq("main_id", staff.getId()));
|
||||
List<BusiLabel> busiLabels = busiLabelService.list(new LambdaQueryWrapper<BusiLabel>().eq(BusiLabel::getMainId, staff.getId()));
|
||||
// 取出标签名给员工响应对象
|
||||
if (ObjectUtil.isNotEmpty(busiLabels)) {
|
||||
List<String> labelsArray = busiLabels.stream().map(item -> item.getLabelName()).collect(Collectors.toList());
|
||||
@ -270,7 +262,10 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
**/
|
||||
@Override
|
||||
public List<Label> getLabels() {
|
||||
return labelService.list(new QueryWrapper<Label>().eq("system_code", BaseConstants.COMPANY_STAFF));
|
||||
return labelService.list(new LambdaQueryWrapper<Label>().and(item -> {
|
||||
item.eq(Label::getSystemCode, BaseConstants.COMPANY_STAFF)
|
||||
.eq(Label::getType, BaseConstants.FUNC_COMPANY);
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -294,7 +289,7 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
* @date 11:48 2024/8/8
|
||||
**/
|
||||
private List<BusiLabel> getBusiLabelsByMainId(String mainId) {
|
||||
return busiLabelService.list(new QueryWrapper<BusiLabel>().eq("main_id", mainId));
|
||||
return busiLabelService.list(new LambdaQueryWrapper<BusiLabel>().eq(BusiLabel::getMainId, mainId));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -308,8 +303,8 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
return names.stream().map(item -> {
|
||||
Label label = new Label();
|
||||
label.setLabelName(item);
|
||||
label.setType(BaseConstants.COMPANY_SING_STAFF);
|
||||
label.setLabelDesc(BaseConstants.COMPANY_SING_STAFF);
|
||||
label.setType(BaseConstants.FUNC_COMPANY);
|
||||
label.setLabelDesc(item);
|
||||
label.setLabelType(BaseConstants.LABEL_TYPE);
|
||||
label.setSystemCode(BaseConstants.COMPANY_STAFF);
|
||||
return label;
|
||||
@ -340,17 +335,104 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
||||
|
||||
/**
|
||||
* 获取当前登录用户部门下所有员工信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 15:54 2024/8/8
|
||||
**/
|
||||
@Override
|
||||
public List<CompanyStaff> getStaffList(){
|
||||
// 获取当前登录用户的信息,取出部门
|
||||
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
|
||||
Long id = loginUser.getId();
|
||||
AdminUserRespDTO user = adminUserApi.getUser(id);
|
||||
Long deptId = user.getDeptId();
|
||||
// 获取所有该部门下的员工信息
|
||||
return baseMapper.selectList(new QueryWrapper<CompanyStaff>().eq("dept_id", deptId));
|
||||
public List<CompanyStaff> getStaffList() {
|
||||
return baseMapper.selectList(new QueryWrapper<>());
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置员工登录密码
|
||||
*
|
||||
* @param staffRespVO 员工对象
|
||||
* @author 小李
|
||||
* @date 16:21 2024/8/9
|
||||
**/
|
||||
public void resetPassword(CompanyStaffRespVO staffRespVO) {
|
||||
// 修改员工密码
|
||||
adminUserApi.resetPassword(staffRespVO.getUserId(), staffRespVO.getPassword());
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证工号是否重复
|
||||
*
|
||||
* @param workNo 输入的工号
|
||||
* @author 小李
|
||||
* @date 14:03 2024/8/9
|
||||
**/
|
||||
public Boolean checkWorkNo(String workNo) {
|
||||
return staffMapper.selectCount(new LambdaQueryWrapper<CompanyStaff>().and(item -> {
|
||||
item.eq(CompanyStaff::getWorkNo, workNo);
|
||||
})) == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的详细信息
|
||||
*
|
||||
* @author 小李
|
||||
* @date 17:27 2024/8/9
|
||||
**/
|
||||
private AdminUserRespDTO getLoginUser() {
|
||||
Long userId = SecurityFrameworkUtils.getLoginUserId();
|
||||
return adminUserApi.getUser(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的部门详细信息
|
||||
*
|
||||
* @param deptId 部门ID
|
||||
* @author 小李
|
||||
* @date 17:28 2024/8/9
|
||||
**/
|
||||
private DeptRespDTO getLoginDept(Long deptId) {
|
||||
return deptApi.getDept(deptId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新员工的工龄和司龄
|
||||
*
|
||||
* @author 小李
|
||||
* @date 11:41 2024/8/13
|
||||
**/
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void updateStaffWorkAndJoinedYears() {
|
||||
LambdaQueryWrapper<CompanyStaff> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<CompanyStaff> page = new Page<>(0, BaseConstants.BATCH_SIZE);
|
||||
while (true) {
|
||||
// 查询一页的数据
|
||||
Page<CompanyStaff> companyStaffPage = baseMapper.selectPage(page, queryWrapper);
|
||||
// 对每一页数据进行操作更新
|
||||
List<CompanyStaff> result = companyStaffPage.getRecords().stream().map(item -> {
|
||||
// 获取当前时间、工作时间、入职时间
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
LocalDate workDate = item.getWorkDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
LocalDate joinedDate = item.getJoinedDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
||||
|
||||
// 计算工龄
|
||||
BigDecimal workYear = new BigDecimal(Period.between(workDate, currentDate).getYears());
|
||||
item.setWorkYear(workYear);
|
||||
|
||||
// 计算司龄
|
||||
BigDecimal joinedYear = new BigDecimal(Period.between(joinedDate, currentDate).getYears());
|
||||
item.setJoinedYear(joinedYear);
|
||||
|
||||
return item;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
// 批量更新
|
||||
updateBatchById(result);
|
||||
|
||||
// 没有下一页了就退出
|
||||
if (companyStaffPage.getRecords().isEmpty()){
|
||||
break;
|
||||
}
|
||||
|
||||
// 取一页
|
||||
queryWrapper.gt(CompanyStaff::getId, page.getRecords().get(page.getRecords().size() - 1).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package cn.iocoder.yudao.module.staff.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.iocoder.yudao.common.BaseConstants;
|
||||
import cn.iocoder.yudao.module.staff.entity.UniqueCode;
|
||||
import cn.iocoder.yudao.module.staff.mapper.UniqueCodeMapper;
|
||||
import cn.iocoder.yudao.module.staff.service.UniqueCodeService;
|
||||
@ -15,16 +17,23 @@ import org.springframework.stereotype.Service;
|
||||
public class UniqueCodeServiceImpl extends ServiceImpl<UniqueCodeMapper, UniqueCode> implements UniqueCodeService {
|
||||
|
||||
/**
|
||||
* 检查唯一推广码是否存在于数据库
|
||||
* 生成唯一推广码
|
||||
* @author 小李
|
||||
* @date 9:59 2024/8/8
|
||||
* @param uniqueCode
|
||||
*
|
||||
* @return*/
|
||||
* @return 可使用推广码
|
||||
**/
|
||||
@Override
|
||||
public int insertUniqueCode(String uniqueCode){
|
||||
UniqueCode code = new UniqueCode();
|
||||
code.setUniqueCode(uniqueCode);
|
||||
return baseMapper.insert(code);
|
||||
public String createUniqueCode(){
|
||||
int count = 0;
|
||||
while (true){
|
||||
if (count >= BaseConstants.UNIQUE_CODE_LEN) return null;
|
||||
String result = RandomUtil.randomStringUpper(BaseConstants.UNIQUE_CODE_LEN);
|
||||
UniqueCode uniqueCode = new UniqueCode();
|
||||
uniqueCode.setUniqueCode(result);
|
||||
if (baseMapper.insert(uniqueCode) > 0){
|
||||
return result;
|
||||
}
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
package cn.iocoder.yudao.module.staff.vo;
|
||||
|
||||
import cn.iocoder.yudao.module.staff.entity.CompanyStaffChange;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 企业管理-员工交接记录VO
|
||||
@ -10,4 +17,26 @@ import lombok.Data;
|
||||
**/
|
||||
@Data
|
||||
public class CompanyStaffChangeReqVO extends CompanyStaffChange {
|
||||
|
||||
/** 搜索用员工姓名 */
|
||||
private String name;
|
||||
|
||||
/** 搜索用员工工号 */
|
||||
private String workNo;
|
||||
|
||||
/** 搜索用员工电话 */
|
||||
private String tel;
|
||||
|
||||
@Schema(description = "工作交接查询范围")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date[] changeTimeArray;
|
||||
|
||||
/** 搜索用交接类型 */
|
||||
private String changeType;
|
||||
|
||||
/** 搜索用oldUserIds */
|
||||
private List<Long> oldUserIds;
|
||||
|
||||
/** 搜索用newUserIds */
|
||||
private List<Long> newUserIds;
|
||||
}
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.scheduled;
|
||||
|
||||
import cn.iocoder.yudao.framework.quartz.core.handler.JobHandler;
|
||||
import cn.iocoder.yudao.framework.tenant.core.job.TenantJob;
|
||||
import cn.iocoder.yudao.module.staff.service.CompanyStaffService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 定时更新员工的工龄和司龄
|
||||
* @author 小李
|
||||
* @date 14:00 2024/8/13
|
||||
**/
|
||||
@Component
|
||||
@TenantJob
|
||||
@Slf4j
|
||||
public class UpdateCompanyStaffWorkAndJoinedYearsJob implements JobHandler {
|
||||
|
||||
@Resource
|
||||
private CompanyStaffService staffService;
|
||||
|
||||
@Override
|
||||
public String execute(String param) throws Exception {
|
||||
// 执行更新
|
||||
staffService.updateStaffWorkAndJoinedYears();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -3,4 +3,116 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="cn.iocoder.yudao.module.staff.mapper.CompanyStaffChangeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.iocoder.yudao.module.staff.vo.CompanyStaffChangeRespVO">
|
||||
<id property="id" column="csc_id" jdbcType="VARCHAR"/>
|
||||
<result property="oldUserId" column="csc_old_user_id" jdbcType="BIGINT"/>
|
||||
<result property="newUserId" column="csc_new_user_id" jdbcType="BIGINT"/>
|
||||
<result property="changeTime" column="csc_change_time" jdbcType="TIMESTAMP"/>
|
||||
<result property="fileUrls" column="csc_file_urls" jdbcType="VARCHAR"/>
|
||||
<result property="remark" column="csc_remark" jdbcType="VARCHAR"/>
|
||||
|
||||
<association property="oldStaff" javaType="cn.iocoder.yudao.module.staff.entity.CompanyStaff">
|
||||
<id property="id" column="cs_old_id" jdbcType="VARCHAR"/>
|
||||
<result property="workNo" column="cs_old_work_no" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="cs_old_name" jdbcType="VARCHAR"/>
|
||||
<result property="tel" column="cs_old_tel" jdbcType="VARCHAR"/>
|
||||
<result property="sex" column="cs_old_sex" jdbcType="VARCHAR"/>
|
||||
<result property="address" column="cs_old_address" jdbcType="VARCHAR"/>
|
||||
<result property="workDate" column="cs_old_work_date" jdbcType="DATE"/>
|
||||
<result property="workYear" column="cs_old_work_year" jdbcType="DECIMAL"/>
|
||||
<result property="joinedDate" column="cs_old_joined_date" jdbcType="DATE"/>
|
||||
<result property="joinedYear" column="cs_old_joined_year" jdbcType="DECIMAL"/>
|
||||
<result property="education" column="cs_old_education" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="cs_old_content" jdbcType="VARCHAR"/>
|
||||
<result property="uniqueCode" column="cs_old_unique_code" jdbcType="VARCHAR"/>
|
||||
<result property="fileUrls" column="cs_old_file_urls" jdbcType="VARCHAR"/>
|
||||
</association>
|
||||
|
||||
<association property="newStaff" javaType="cn.iocoder.yudao.module.staff.entity.CompanyStaff">
|
||||
<id property="id" column="cs_new_id" jdbcType="VARCHAR"/>
|
||||
<result property="workNo" column="cs_new_work_no" jdbcType="VARCHAR"/>
|
||||
<result property="name" column="cs_new_name" jdbcType="VARCHAR"/>
|
||||
<result property="tel" column="cs_new_tel" jdbcType="VARCHAR"/>
|
||||
<result property="sex" column="cs_new_sex" jdbcType="VARCHAR"/>
|
||||
<result property="address" column="cs_new_address" jdbcType="VARCHAR"/>
|
||||
<result property="workDate" column="cs_new_work_date" jdbcType="DATE"/>
|
||||
<result property="workYear" column="cs_new_work_year" jdbcType="DECIMAL"/>
|
||||
<result property="joinedDate" column="cs_new_joined_date" jdbcType="DATE"/>
|
||||
<result property="joinedYear" column="cs_new_joined_year" jdbcType="DECIMAL"/>
|
||||
<result property="education" column="cs_new_education" jdbcType="VARCHAR"/>
|
||||
<result property="content" column="cs_new_content" jdbcType="VARCHAR"/>
|
||||
<result property="uniqueCode" column="cs_new_unique_code" jdbcType="VARCHAR"/>
|
||||
<result property="fileUrls" column="cs_new_file_urls" jdbcType="VARCHAR"/>
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<select id="getStaffChangePage" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
csc.id as csc_id,
|
||||
csc.old_user_id as csc_old_user_id,
|
||||
csc.new_user_id as csc_new_user_id,
|
||||
csc.change_time as csc_change_time,
|
||||
csc.file_urls as csc_file_urls,
|
||||
csc.remark as csc_remark,
|
||||
cs_old.id as cs_old_id,
|
||||
cs_old.work_no as cs_old_work_no,
|
||||
cs_old.name as cs_old_name,
|
||||
cs_old.tel as cs_old_tel,
|
||||
cs_old.sex as cs_old_sex,
|
||||
cs_old.address as cs_old_address,
|
||||
cs_old.work_date as cs_old_work_date,
|
||||
cs_old.work_year as cs_old_work_year,
|
||||
cs_old.joined_date as cs_old_joined_date,
|
||||
cs_old.joined_year as cs_old_joined_year,
|
||||
cs_old.education as cs_old_education,
|
||||
cs_old.content as cs_old_content,
|
||||
cs_old.unique_code as cs_old_unique_code,
|
||||
cs_old.file_urls as cs_old_file_urls,
|
||||
cs_new.id as cs_new_id,
|
||||
cs_new.work_no as cs_new_work_no,
|
||||
cs_new.name as cs_new_name,
|
||||
cs_new.tel as cs_new_tel,
|
||||
cs_new.sex as cs_new_sex,
|
||||
cs_new.address as cs_new_address,
|
||||
cs_new.work_date as cs_new_work_date,
|
||||
cs_new.work_year as cs_new_work_year,
|
||||
cs_new.joined_date as cs_new_joined_date,
|
||||
cs_new.joined_year as cs_new_joined_year,
|
||||
cs_new.education as cs_new_education,
|
||||
cs_new.content as cs_new_content,
|
||||
cs_new.unique_code as cs_new_unique_code,
|
||||
cs_new.file_urls as cs_new_file_urls
|
||||
FROM company_staff_change csc
|
||||
INNER JOIN company_staff cs_old ON csc.old_user_id = cs_old.user_id
|
||||
INNER JOIN company_staff cs_new ON csc.new_user_id = cs_new.user_id
|
||||
where csc.deleted = '0'
|
||||
<if test="map.name != null and map.name != ''">
|
||||
and (cs_old.name like concat('%', #{map.name}, '%') or cs_new.name like concat('%', #{map.name}, '%'))
|
||||
</if>
|
||||
<if test="map.workNo != null and map.workNo != ''">
|
||||
and (cs_old.work_no like concat('%', #{map.workNo}, '%') or cs_new.work_no like concat('%', #{map.workNo},
|
||||
'%'))
|
||||
</if>
|
||||
<if test="map.tel != null and map.tel != ''">
|
||||
and (cs_old.tel like concat('%', #{map.tel}, '%') or cs_new.tel like concat('%', #{map.tel}, '%'))
|
||||
</if>
|
||||
<if test="map.changeTimeArray != null and map.changeTimeArray.length > 0">
|
||||
and (csc.change_time between #{map.changeTimeArray[0]} and #{map.changeTimeArray[1]})
|
||||
</if>
|
||||
<if test="map.oldUserIds != null and map.oldUserIds.size > 0">
|
||||
and csc.old_user_id in
|
||||
<foreach collection="map.oldUserIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="map.newUserIds != null and map.newUserIds.size > 0">
|
||||
and csc.new_user_id in
|
||||
<foreach collection="map.newUserIds" item="userId" open="(" separator="," close=")">
|
||||
#{userId}
|
||||
</foreach>
|
||||
</if>
|
||||
order by csc.create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -31,19 +31,35 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_SQL">
|
||||
select
|
||||
id,corp_id,user_id,
|
||||
dept_id,work_no,name,
|
||||
tel,sex,address,
|
||||
work_date,work_year,joined_date,
|
||||
joined_year,education,content,
|
||||
unique_code,file_urls,tenant_id,
|
||||
deleted,creator,create_time,
|
||||
updater,update_time
|
||||
from company_staff cs where deleted = '0'
|
||||
select id,
|
||||
corp_id,
|
||||
user_id,
|
||||
dept_id,
|
||||
work_no,
|
||||
name,
|
||||
tel,
|
||||
sex,
|
||||
address,
|
||||
work_date,
|
||||
work_year,
|
||||
joined_date,
|
||||
joined_year,
|
||||
education,
|
||||
content,
|
||||
unique_code,
|
||||
file_urls,
|
||||
tenant_id,
|
||||
deleted,
|
||||
creator,
|
||||
create_time,
|
||||
updater,
|
||||
update_time
|
||||
from company_staff cs
|
||||
where deleted = '0'
|
||||
</sql>
|
||||
|
||||
<select id="selectListPage" resultMap="BaseResultMap">
|
||||
<include refid="Base_SQL" />
|
||||
<include refid="Base_SQL"/>
|
||||
<if test="map.name != null and map.name != ''">
|
||||
and cs.name like concat('%', #{map.name}, '%')
|
||||
</if>
|
||||
@ -77,5 +93,6 @@
|
||||
<if test="map.joinedDateArray.length > 0">
|
||||
and cs.joined_date between #{map.joinedDateArray[0]} and #{map.joinedDateArray[1]}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
@ -8,7 +8,7 @@ import java.lang.annotation.Target;
|
||||
/**
|
||||
* 多租户 Job 注解
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Target({ElementType.TYPE, ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface TenantJob {
|
||||
}
|
||||
|
||||
@ -112,4 +112,13 @@ public interface AdminUserApi {
|
||||
*/
|
||||
void validateUserList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @author 小李
|
||||
* @date 16:39 2024/8/9
|
||||
* @param id 用户ID
|
||||
* @param password 新密码
|
||||
**/
|
||||
void resetPassword(Long id, String password);
|
||||
|
||||
}
|
||||
|
||||
@ -38,4 +38,9 @@ public class UserDTO {
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 用户性别
|
||||
**/
|
||||
private String sex;
|
||||
|
||||
}
|
||||
|
||||
@ -126,4 +126,16 @@ public class AdminUserApiImpl implements AdminUserApi {
|
||||
userService.validateUserList(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
* @author 小李
|
||||
* @date 16:39 2024/8/9
|
||||
* @param id 用户ID
|
||||
* @param password 新密码
|
||||
**/
|
||||
@Override
|
||||
public void resetPassword(Long id, String password){
|
||||
userService.updateUserPassword(id, password);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,12 +2,12 @@ server:
|
||||
port: 48080
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
# exclude中少的内容 - org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
|
||||
spring:
|
||||
# 数据源配置项
|
||||
autoconfigure:
|
||||
exclude:
|
||||
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
|
||||
- org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
|
||||
- de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置
|
||||
- de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
|
||||
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
|
||||
|
||||
Loading…
Reference in New Issue
Block a user