!59 Bug修复与功能优化

Merge pull request !59 from 大熊/master
This commit is contained in:
1024创新实验室 2025-03-11 07:26:56 +00:00 committed by Gitee
commit b1cbad8362
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
72 changed files with 974 additions and 459 deletions

View File

@ -28,7 +28,7 @@ public class NoticeQueryForm extends PageParam {
private String documentNumber; private String documentNumber;
@Schema(description = "创建人") @Schema(description = "创建人")
private Long createUserId; private String createUserName;
@Schema(description = "删除标识") @Schema(description = "删除标识")
private Boolean deletedFlag; private Boolean deletedFlag;

View File

@ -208,6 +208,10 @@ public class NoticeService {
} }
NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class); NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class);
NoticeTypeVO noticeType = noticeTypeService.getByNoticeTypeId(noticeEntity.getNoticeTypeId());
updateFormVO.setNoticeTypeName(noticeType.getNoticeTypeName());
updateFormVO.setPublishFlag(updateFormVO.getPublishTime() != null && updateFormVO.getPublishTime().isBefore(LocalDateTime.now()));
if (!updateFormVO.getAllVisibleFlag()) { if (!updateFormVO.getAllVisibleFlag()) {
List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId); List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId);
List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType())) List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType()))

View File

@ -5,7 +5,7 @@ import net.lab1024.sa.base.common.enumeration.BaseEnum;
/** /**
* 数据范围 * 数据可见范围类
* *
* @Author 1024创新实验室: 罗伊 * @Author 1024创新实验室: 罗伊
* @Date 2020/11/28 20:59:17 * @Date 2020/11/28 20:59:17

View File

@ -25,7 +25,7 @@ public class DataScopeSqlConfig {
/** /**
* join sql 具体实现类 * join sql 具体实现类
*/ */
private Class joinSqlImplClazz; private Class<?> joinSqlImplClazz;
private String joinSql; private String joinSql;

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
/** /**
* 数据范围 * 数据可见范围
* *
* @Author 1024创新实验室: 罗伊 * @Author 1024创新实验室: 罗伊
* @Date 2020/11/28 20:59:17 * @Date 2020/11/28 20:59:17

View File

@ -46,6 +46,11 @@ public class DataScopeSqlConfigService {
private static final String DEPARTMENT_PARAM = "#departmentIds"; private static final String DEPARTMENT_PARAM = "#departmentIds";
/**
* 用于拼接查看本人数据范围的 SQL
*/
private static final String CREATE_USER_ID_EQUALS = "create_user_id = ";
private final ConcurrentHashMap<String, DataScopeSqlConfig> dataScopeMethodMap = new ConcurrentHashMap<>(); private final ConcurrentHashMap<String, DataScopeSqlConfig> dataScopeMethodMap = new ConcurrentHashMap<>();
@Resource @Resource
@ -94,14 +99,23 @@ public class DataScopeSqlConfigService {
* 组装需要拼接的sql * 组装需要拼接的sql
*/ */
public String getJoinSql(Map<String, Object> paramMap, DataScopeSqlConfig sqlConfigDTO) { public String getJoinSql(Map<String, Object> paramMap, DataScopeSqlConfig sqlConfigDTO) {
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
String joinSql = sqlConfigDTO.getJoinSql();
Long employeeId = SmartRequestUtil.getRequestUserId(); Long employeeId = SmartRequestUtil.getRequestUserId();
if (employeeId == null) { if (employeeId == null) {
return ""; return "";
} }
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
// 数据权限设置为仅本人可见时 直接返回 create_user_id = employeeId
if (DataScopeViewTypeEnum.ME == viewTypeEnum) {
return CREATE_USER_ID_EQUALS + employeeId;
}
String joinSql = sqlConfigDTO.getJoinSql();
if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) { if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) {
Class strategyClass = sqlConfigDTO.getJoinSqlImplClazz(); Class<?> strategyClass = sqlConfigDTO.getJoinSqlImplClazz();
if (strategyClass == null) { if (strategyClass == null) {
log.warn("data scope custom strategy class is null"); log.warn("data scope custom strategy class is null");
return ""; return "";
@ -111,11 +125,10 @@ public class DataScopeSqlConfigService {
log.warn("data scope custom strategy class{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz()); log.warn("data scope custom strategy class{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz());
return ""; return "";
} }
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
return powerStrategy.getCondition(viewTypeEnum,paramMap, sqlConfigDTO); return powerStrategy.getCondition(viewTypeEnum,paramMap, sqlConfigDTO);
} }
if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) { if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) {
List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(dataScopeTypeEnum, employeeId); List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(viewTypeEnum, employeeId);
if (CollectionUtils.isEmpty(canViewEmployeeIds)) { if (CollectionUtils.isEmpty(canViewEmployeeIds)) {
return ""; return "";
} }
@ -124,7 +137,7 @@ public class DataScopeSqlConfigService {
return sql; return sql;
} }
if (DataScopeWhereInTypeEnum.DEPARTMENT == sqlConfigDTO.getDataScopeWhereInType()) { if (DataScopeWhereInTypeEnum.DEPARTMENT == sqlConfigDTO.getDataScopeWhereInType()) {
List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(dataScopeTypeEnum, employeeId); List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(viewTypeEnum, employeeId);
if (CollectionUtils.isEmpty(canViewDepartmentIds)) { if (CollectionUtils.isEmpty(canViewDepartmentIds)) {
return ""; return "";
} }

View File

@ -44,10 +44,9 @@ public class DataScopeViewService {
private DepartmentService departmentService; private DepartmentService departmentService;
/** /**
* 获取某人可以查看的所有人员信息 * 获取某人可以查看的所有人员数据
*/ */
public List<Long> getCanViewEmployeeId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) { public List<Long> getCanViewEmployeeId(DataScopeViewTypeEnum viewType, Long employeeId) {
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
if (DataScopeViewTypeEnum.ME == viewType) { if (DataScopeViewTypeEnum.ME == viewType) {
return this.getMeEmployeeIdList(employeeId); return this.getMeEmployeeIdList(employeeId);
} }
@ -57,16 +56,17 @@ public class DataScopeViewService {
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) { if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
return this.getDepartmentAndSubEmployeeIdList(employeeId); return this.getDepartmentAndSubEmployeeIdList(employeeId);
} }
// 可以查看所有员工数据
return Lists.newArrayList(); return Lists.newArrayList();
} }
/** /**
* 获取某人可以查看的所有部门信息 * 获取某人可以查看的所有部门数据
*/ */
public List<Long> getCanViewDepartmentId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) { public List<Long> getCanViewDepartmentId(DataScopeViewTypeEnum viewType, Long employeeId) {
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
if (DataScopeViewTypeEnum.ME == viewType) { if (DataScopeViewTypeEnum.ME == viewType) {
return this.getMeDepartmentIdList(employeeId); // 数据可见范围类型为本人时 不可以查看任何部门数据
return Lists.newArrayList(0L);
} }
if (DataScopeViewTypeEnum.DEPARTMENT == viewType) { if (DataScopeViewTypeEnum.DEPARTMENT == viewType) {
return this.getMeDepartmentIdList(employeeId); return this.getMeDepartmentIdList(employeeId);
@ -74,6 +74,7 @@ public class DataScopeViewService {
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) { if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
return this.getDepartmentAndSubIdList(employeeId); return this.getDepartmentAndSubIdList(employeeId);
} }
// 可以查看所有部门数据
return Lists.newArrayList(); return Lists.newArrayList();
} }
@ -91,10 +92,16 @@ public class DataScopeViewService {
* 根据员工id 获取各数据范围最大的可见范围 map<dataScopeType,viewType></> * 根据员工id 获取各数据范围最大的可见范围 map<dataScopeType,viewType></>
*/ */
public DataScopeViewTypeEnum getEmployeeDataScopeViewType(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) { public DataScopeViewTypeEnum getEmployeeDataScopeViewType(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
if (employeeId == null) { EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
if (employeeEntity == null || employeeEntity.getEmployeeId() == null) {
return DataScopeViewTypeEnum.ME; return DataScopeViewTypeEnum.ME;
} }
// 如果是超级管理员 则可查看全部
if (employeeEntity.getAdministratorFlag()) {
return DataScopeViewTypeEnum.ALL;
}
List<Long> roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); List<Long> roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId);
//未设置角色 默认本人 //未设置角色 默认本人
if (CollectionUtils.isEmpty(roleIdList)) { if (CollectionUtils.isEmpty(roleIdList)) {

View File

@ -57,11 +57,11 @@ public class EmployeeController {
return employeeService.updateEmployee(employeeUpdateForm); return employeeService.updateEmployee(employeeUpdateForm);
} }
@Operation(summary = "更新登录人信息 @author 善逸") @Operation(summary = "更新员工个人中心信息 @author 善逸")
@PostMapping("/employee/update/login") @PostMapping("/employee/update/center")
public ResponseDTO<String> updateByLogin(@Valid @RequestBody EmployeeUpdateForm employeeUpdateForm) { public ResponseDTO<String> updateCenter(@Valid @RequestBody EmployeeUpdateCenterForm updateCenterForm) {
employeeUpdateForm.setEmployeeId(SmartRequestUtil.getRequestUserId()); updateCenterForm.setEmployeeId(SmartRequestUtil.getRequestUserId());
return employeeService.updateEmployee(employeeUpdateForm); return employeeService.updateCenter(updateCenterForm);
} }
@Operation(summary = "更新登录人头像 @author 善逸") @Operation(summary = "更新登录人头像 @author 善逸")

View File

@ -34,31 +34,30 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
*/ */
List<EmployeeVO> selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag); List<EmployeeVO> selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 更新单个 * 更新禁用状态
*/ */
void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag); void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag);
/** /**
* 通过登录名查询 * 通过登录名查询
*/ */
EmployeeEntity getByLoginName(@Param("loginName") String loginName, EmployeeEntity getByLoginName(@Param("loginName") String loginName, @Param("deletedFlag") Boolean deletedFlag);
@Param("disabledFlag") Boolean disabledFlag);
/** /**
* 通过姓名查询 * 通过姓名查询
*/ */
EmployeeEntity getByActualName(@Param("actualName") String actualName, EmployeeEntity getByActualName(@Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
@Param("disabledFlag") Boolean disabledFlag
);
/** /**
* 通过手机号查询 * 通过手机号查询
*/ */
EmployeeEntity getByPhone(@Param("phone") String phone, @Param("disabledFlag") Boolean disabledFlag); EmployeeEntity getByPhone(@Param("phone") String phone, @Param("deletedFlag") Boolean deletedFlag);
/**
* 通过邮箱账号查询
*/
EmployeeEntity getByEmail(@Param("email") String email, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取所有员工 * 获取所有员工
@ -67,7 +66,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
/** /**
* 获取某个部门员工数 * 获取某个部门员工数
*
*/ */
Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag); Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
@ -76,39 +74,35 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
*/ */
List<EmployeeVO> getEmployeeByIds(@Param("employeeIds") Collection<Long> employeeIds); List<EmployeeVO> getEmployeeByIds(@Param("employeeIds") Collection<Long> employeeIds);
/** /**
* 查询单个员工信息 * 查询单个员工信息
*/ */
EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId); EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId);
/** /**
* 获取某个部门的员工 * 获取某个部门的员工
*/ */
List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag); List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 查询某些部门下用户名是xxx的员工 * 查询某些部门下用户名是xxx的员工
*/ */
List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("disabledFlag") Boolean disabledFlag); List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取某批部门的员工Id * 获取某批部门的员工Id
*/ */
List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("disabledFlag") Boolean disabledFlag); List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取所有 * 获取所有
*/ */
List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("disabledFlag") Boolean disabledFlag); List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取某个部门的员工Id * 获取某个部门的员工Id
*/ */
List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag); List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 员工重置密码 * 员工重置密码

View File

@ -51,17 +51,19 @@ public class EmployeeAddForm {
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确") @Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
private String phone; private String phone;
@Schema(description = "邮箱") @Schema(description = "邮箱账号")
@NotNull(message = "邮箱账号不能为空")
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
private String email; private String email;
@Schema(description = "职务级别ID")
private Long positionId;
@Schema(description = "角色列表") @Schema(description = "角色列表")
private List<Long> roleIdList; private List<Long> roleIdList;
@Schema(description = "备注") @Schema(description = "备注")
@Length(max = 30, message = "备注最多200字符") @Length(max = 200, message = "备注最多200字符")
private String remark; private String remark;
@Schema(description = "职务级别ID")
private Long positionId;
} }

View File

@ -0,0 +1,56 @@
package net.lab1024.sa.admin.module.system.employee.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import net.lab1024.sa.base.common.enumeration.GenderEnum;
import net.lab1024.sa.base.common.swagger.SchemaEnum;
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
import org.hibernate.validator.constraints.Length;
/**
* 更新员工个人中心信息
*
* @Author 1024创新实验室: 开云
* @Date 2021-12-20 21:06:49
* @Wechat zhuoda1024
* @Email lab1024@163.com
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
*/
@Data
public class EmployeeUpdateCenterForm {
@Schema(hidden = true)
private Long employeeId;
@Schema(description = "姓名")
@NotNull(message = "姓名不能为空")
@Length(max = 30, message = "姓名最多30字符")
private String actualName;
@SchemaEnum(GenderEnum.class)
@CheckEnum(value = GenderEnum.class, message = "性别错误")
private Integer gender;
@Schema(description = "手机号")
@NotNull(message = "手机号不能为空")
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
private String phone;
@Schema(description = "邮箱账号")
@NotNull(message = "邮箱账号不能为空")
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
private String email;
@Schema(description = "职务级别ID")
private Long positionId;
@Schema(description = "头像")
private String avatar;
@Schema(description = "备注")
@Length(max = 200, message = "备注最多200字符")
private String remark;
}

View File

@ -168,19 +168,14 @@ public class EmployeeService {
return ResponseDTO.userErrorParam("部门不存在"); return ResponseDTO.userErrorParam("部门不存在");
} }
// 检查唯一性
EmployeeEntity existEntity = employeeDao.getByLoginName(employeeUpdateForm.getLoginName(), null); ResponseDTO<String> checkResponse = checkUniqueness(employeeId, employeeUpdateForm.getLoginName(), employeeUpdateForm.getPhone(), employeeUpdateForm.getEmail());
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) { if (!checkResponse.getOk()) {
return ResponseDTO.userErrorParam("登录名重复"); return checkResponse;
} }
existEntity = employeeDao.getByPhone(employeeUpdateForm.getPhone(), null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("手机号已存在");
}
// 不更新密码
EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class); EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class);
// 不更新密码
entity.setLoginPwd(null); entity.setLoginPwd(null);
// 更新数据 // 更新数据
@ -192,6 +187,58 @@ public class EmployeeService {
return ResponseDTO.ok(); return ResponseDTO.ok();
} }
/**
* 更新员工个人中心信息
*/
public ResponseDTO<String> updateCenter(EmployeeUpdateCenterForm updateCenterForm) {
Long employeeId = updateCenterForm.getEmployeeId();
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
if (null == employeeEntity) {
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
}
// 检查唯一性 登录账号不能修改则不需要检查
ResponseDTO<String> checkResponse = checkUniqueness(employeeId, "", updateCenterForm.getPhone(), updateCenterForm.getEmail());
if (!checkResponse.getOk()) {
return checkResponse;
}
EmployeeEntity employee = SmartBeanUtil.copy(updateCenterForm, EmployeeEntity.class);
// 不更新密码
employee.setLoginPwd(null);
// 更新数据
employeeDao.updateById(employee);
// 清除员工缓存
loginService.clearLoginEmployeeCache(employeeId);
return ResponseDTO.ok();
}
/**
* 检查唯一性
*/
private ResponseDTO<String> checkUniqueness(Long employeeId, String loginName, String phone, String email) {
EmployeeEntity existEntity = employeeDao.getByLoginName(loginName, null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("登录名重复");
}
existEntity = employeeDao.getByPhone(phone, null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("手机号已存在");
}
existEntity = employeeDao.getByEmail(email, null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("邮箱账号已存在");
}
return ResponseDTO.ok();
}
/** /**
* 更新登录人头像 * 更新登录人头像

View File

@ -46,6 +46,12 @@ public class RequestEmployee implements RequestUser {
@Schema(description = "部门名称") @Schema(description = "部门名称")
private String departmentName; private String departmentName;
@Schema(description = "职务级别ID")
private Long positionId;
@Schema(description = "邮箱")
private String email;
@Schema(description = "是否禁用") @Schema(description = "是否禁用")
private Boolean disabledFlag; private Boolean disabledFlag;

View File

@ -2,6 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao"> <mapper namespace="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao">
<!-- 查询结果列 -->
<sql id="base_columns">
t_notice.notice_id,
t_notice.notice_type_id,
t_notice.title,
t_notice.all_visible_flag,
t_notice.scheduled_publish_flag,
t_notice.publish_time,
t_notice.content_text,
t_notice.content_html,
t_notice.attachment,
t_notice.page_view_count,
t_notice.user_view_count,
t_notice.source,
t_notice.author,
t_notice.document_number,
t_notice.deleted_flag,
t_notice.create_user_id,
t_notice.update_time,
t_notice.create_time
</sql>
<!-- ================================== 可见范围相关 ================================== --> <!-- ================================== 可见范围相关 ================================== -->
<insert id="insertVisibleRange"> <insert id="insertVisibleRange">
@ -35,32 +57,30 @@
<!-- 后管分页查询资讯 --> <!-- 后管分页查询资讯 -->
<select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO"> <select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
SELECT SELECT
t_notice.* , <include refid="base_columns"/>,
t_notice_type.notice_type_name as noticeTypeName, t_notice_type.notice_type_name as noticeTypeName,
t_employee.actual_name as createUserName, t_employee.actual_name as createUserName
t_department.name as departmentName
FROM t_notice FROM t_notice
left join t_notice_type on t_notice_type.notice_type_id = t_notice.notice_type_id LEFT JOIN t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
left join t_employee on t_notice.create_user_id = t_employee.employee_id LEFT JOIN t_employee on t_notice.create_user_id = t_employee.employee_id
left join t_department on t_employee.department_id = t_department.department_id
<where> <where>
<if test="query.noticeTypeId != null"> <if test="query.noticeTypeId != null">
AND t_notice_type.notice_type_id = #{query.noticeTypeId} AND t_notice_type.notice_type_id = #{query.noticeTypeId}
</if> </if>
<if test="query.keywords != null and query.keywords !=''"> <if test="query.keywords != null and query.keywords != ''">
AND ( INSTR(t_notice.title,#{query.keywords}) AND ( INSTR(t_notice.title,#{query.keywords})
OR INSTR(t_notice.author,#{query.keywords}) OR INSTR(t_notice.author,#{query.keywords})
OR INSTR(t_notice.source,#{query.keywords}) OR INSTR(t_notice.source,#{query.keywords})
) )
</if> </if>
<if test="query.documentNumber != null and query.documentNumber !=''"> <if test="query.documentNumber != null and query.documentNumber != ''">
AND INSTR(t_notice.document_number, #{query.documentNumber}) AND INSTR(t_notice.document_number, #{query.documentNumber})
</if> </if>
<if test="query.createUserId != null"> <if test="query.createUserName != null and query.createUserName != ''">
AND t_notice.create_user_id = #{createUserId} AND t_employee.actual_name = #{query.createUserName}
</if> </if>
<if test="query.deletedFlag != null"> <if test="query.deletedFlag != null">
and t_notice.deleted_flag = #{query.deletedFlag} AND t_notice.deleted_flag = #{query.deletedFlag}
</if> </if>
<if test="query.createTimeBegin != null"> <if test="query.createTimeBegin != null">
AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{query.createTimeBegin}, AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{query.createTimeBegin},
@ -84,10 +104,9 @@
</select> </select>
<!-- ================================== 通知公告【员工查看】相关 ================================== --> <!-- ================================== 通知公告【员工查看】相关 ================================== -->
<select id="queryEmployeeNotice" <select id="queryEmployeeNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
select select
t_notice.*, <include refid="base_columns"/>,
t_notice_type.notice_type_name, t_notice_type.notice_type_name,
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and (select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
@ -142,12 +161,11 @@
</where> </where>
order by t_notice.publish_time desc order by t_notice.publish_time desc
</select> </select>
<select id="queryEmployeeNotViewNotice" <select id="queryEmployeeNotViewNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
select * from select * from
( (
select select
t_notice.*, <include refid="base_columns"/>,
t_notice_type.notice_type_name, t_notice_type.notice_type_name,
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and (select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
@ -198,8 +216,7 @@
) t where viewFlag = 0 ) t where viewFlag = 0
order by t.publish_time desc order by t.publish_time desc
</select> </select>
<select id="queryNoticeViewRecordList" <select id="queryNoticeViewRecordList" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
select t_notice_view_record.*, select t_notice_view_record.*,
t_employee.actual_name as employeeName, t_employee.actual_name as employeeName,
t_department.name as departmentName t_department.name as departmentName

View File

@ -33,21 +33,19 @@
</where> </where>
</select> </select>
<update id="updateDisableFlag"> <update id="updateDisableFlag">
UPDATE t_employee UPDATE t_employee
SET disabled_flag = #{disabledFlag} SET disabled_flag = #{disabledFlag}
WHERE employee_id = #{employeeId} WHERE employee_id = #{employeeId}
</update> </update>
<select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity"> <select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * SELECT *
FROM t_employee FROM t_employee
<where> <where>
login_name = #{loginName} login_name = #{loginName}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
@ -57,24 +55,33 @@
FROM t_employee FROM t_employee
<where> <where>
actual_name = #{actualName} actual_name = #{actualName}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
<select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity"> <select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * SELECT *
FROM t_employee FROM t_employee
<where> <where>
phone = #{phone} phone = #{phone}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
<select id="getByEmail" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT *
FROM t_employee
<where>
email = #{email}
<if test="deletedFlag != null">
AND deleted_flag = #{deletedFlag}
</if>
</where>
</select>
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO"> <select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
SELECT * SELECT *
@ -88,22 +95,19 @@
department_id = #{departmentId} AND deleted_flag = #{deletedFlag} department_id = #{departmentId} AND deleted_flag = #{deletedFlag}
</select> </select>
<select id="selectByDepartmentId" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
<select id="selectByDepartmentId"
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * SELECT *
FROM t_employee FROM t_employee
<where> <where>
department_id = #{departmentId} department_id = #{departmentId}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="selectByActualName" <select id="selectByActualName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * FROM t_employee SELECT * FROM t_employee
<where> <where>
actual_name = #{actualName} actual_name = #{actualName}
@ -111,8 +115,8 @@
<foreach collection="departmentIdList" item="item" open="(" close=")" separator=","> <foreach collection="departmentIdList" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
@ -125,20 +129,19 @@
<foreach collection="departmentIds" item="item" open="(" close=")" separator=","> <foreach collection="departmentIds" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="getEmployeeId" resultType="java.lang.Long"> <select id="getEmployeeId" resultType="java.lang.Long">
SELECT employee_id SELECT employee_id
FROM t_employee FROM t_employee
<where> <where>
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
@ -148,8 +151,8 @@
FROM t_employee FROM t_employee
<where> <where>
department_id = #{departmentId} department_id = #{departmentId}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
@ -164,7 +167,6 @@
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO"> <select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
SELECT t_employee.*, SELECT t_employee.*,
t_department.name AS departmentName t_department.name AS departmentName
@ -173,8 +175,7 @@
where t_employee.employee_id = #{employeeId} where t_employee.employee_id = #{employeeId}
</select> </select>
<select id="selectEmployeeByDisabledAndDeleted" <select id="selectEmployeeByDisabledAndDeleted" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
SELECT SELECT
t_employee.*, t_employee.*,
t_department.name AS departmentName t_department.name AS departmentName
@ -196,5 +197,4 @@
WHERE employee_id = #{employeeId} WHERE employee_id = #{employeeId}
</update> </update>
</mapper> </mapper>

View File

@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
/** /**
* 更新删除状态 * 更新删除状态
*/ */
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("deletedFlag")boolean deletedFlag); long updateDeleted(@Param("${primaryKeyFieldName}") ${primaryKeyJavaType} ${primaryKeyFieldName}, @Param("deletedFlag") boolean deletedFlag);
#end #end
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch") #if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
/** /**
* 批量更新删除状态 * 批量更新删除状态
*/ */
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("deletedFlag")boolean deletedFlag); void batchUpdateDeleted(@Param("idList") List<${primaryKeyJavaType}> idList, @Param("deletedFlag") boolean deletedFlag);
#end #end
#end #end

View File

@ -10,13 +10,13 @@ SET @parent_id = NULL;
SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '${basic.description}'; SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '${basic.description}';
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id ) INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
VALUES ( '查询', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:query', 1, @parent_id, 1 ); VALUES ( '查询', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:query', 1, @parent_id, 1 );
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id ) INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
VALUES ( '添加', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:add', 1, @parent_id, 1 ); VALUES ( '添加', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:add', 1, @parent_id, 1 );
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id ) INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
VALUES ( '更新', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:update', 1, @parent_id, 1 ); VALUES ( '更新', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:update', 1, @parent_id, 1 );
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id ) INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
VALUES ( '删除', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:delete', 1, @parent_id, 1 ); VALUES ( '删除', 3, @parent_id, false, false, true, false, '${name.lowerCamel}:delete', 1, @parent_id, 1 );

View File

@ -28,7 +28,7 @@ public class NoticeQueryForm extends PageParam {
private String documentNumber; private String documentNumber;
@Schema(description = "创建人") @Schema(description = "创建人")
private Long createUserId; private String createUserName;
@Schema(description = "删除标识") @Schema(description = "删除标识")
private Boolean deletedFlag; private Boolean deletedFlag;

View File

@ -208,6 +208,10 @@ public class NoticeService {
} }
NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class); NoticeUpdateFormVO updateFormVO = SmartBeanUtil.copy(noticeEntity, NoticeUpdateFormVO.class);
NoticeTypeVO noticeType = noticeTypeService.getByNoticeTypeId(noticeEntity.getNoticeTypeId());
updateFormVO.setNoticeTypeName(noticeType.getNoticeTypeName());
updateFormVO.setPublishFlag(updateFormVO.getPublishTime() != null && updateFormVO.getPublishTime().isBefore(LocalDateTime.now()));
if (!updateFormVO.getAllVisibleFlag()) { if (!updateFormVO.getAllVisibleFlag()) {
List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId); List<NoticeVisibleRangeVO> noticeVisibleRangeList = noticeDao.queryVisibleRange(noticeId);
List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType())) List<Long> employeeIdList = noticeVisibleRangeList.stream().filter(e -> NoticeVisibleRangeDataTypeEnum.EMPLOYEE.getValue().equals(e.getDataType()))

View File

@ -5,7 +5,7 @@ import net.lab1024.sa.base.common.enumeration.BaseEnum;
/** /**
* 数据范围 * 数据可见范围类
* *
* @Author 1024创新实验室: 罗伊 * @Author 1024创新实验室: 罗伊
* @Date 2020/11/28 20:59:17 * @Date 2020/11/28 20:59:17

View File

@ -25,7 +25,7 @@ public class DataScopeSqlConfig {
/** /**
* join sql 具体实现类 * join sql 具体实现类
*/ */
private Class joinSqlImplClazz; private Class<?> joinSqlImplClazz;
private String joinSql; private String joinSql;

View File

@ -5,7 +5,7 @@ import lombok.Builder;
import lombok.Data; import lombok.Data;
/** /**
* 数据范围 * 数据可见范围
* *
* @Author 1024创新实验室: 罗伊 * @Author 1024创新实验室: 罗伊
* @Date 2020/11/28 20:59:17 * @Date 2020/11/28 20:59:17

View File

@ -46,6 +46,11 @@ public class DataScopeSqlConfigService {
private static final String DEPARTMENT_PARAM = "#departmentIds"; private static final String DEPARTMENT_PARAM = "#departmentIds";
/**
* 用于拼接查看本人数据范围的 SQL
*/
private static final String CREATE_USER_ID_EQUALS = "create_user_id = ";
private final ConcurrentHashMap<String, DataScopeSqlConfig> dataScopeMethodMap = new ConcurrentHashMap<>(); private final ConcurrentHashMap<String, DataScopeSqlConfig> dataScopeMethodMap = new ConcurrentHashMap<>();
@Resource @Resource
@ -84,7 +89,6 @@ public class DataScopeSqlConfigService {
/** /**
* 根据调用的方法获取此方法的配置信息 * 根据调用的方法获取此方法的配置信息
*
*/ */
public DataScopeSqlConfig getSqlConfig(String method) { public DataScopeSqlConfig getSqlConfig(String method) {
return this.dataScopeMethodMap.get(method); return this.dataScopeMethodMap.get(method);
@ -94,14 +98,23 @@ public class DataScopeSqlConfigService {
* 组装需要拼接的sql * 组装需要拼接的sql
*/ */
public String getJoinSql(Map<String, Object> paramMap, DataScopeSqlConfig sqlConfigDTO) { public String getJoinSql(Map<String, Object> paramMap, DataScopeSqlConfig sqlConfigDTO) {
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
String joinSql = sqlConfigDTO.getJoinSql();
Long employeeId = SmartRequestUtil.getRequestUserId(); Long employeeId = SmartRequestUtil.getRequestUserId();
if (employeeId == null) { if (employeeId == null) {
return ""; return "";
} }
DataScopeTypeEnum dataScopeTypeEnum = sqlConfigDTO.getDataScopeType();
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
// 数据权限设置为仅本人可见时 直接返回 create_user_id = employeeId
if (DataScopeViewTypeEnum.ME == viewTypeEnum) {
return CREATE_USER_ID_EQUALS + employeeId;
}
String joinSql = sqlConfigDTO.getJoinSql();
if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) { if (DataScopeWhereInTypeEnum.CUSTOM_STRATEGY == sqlConfigDTO.getDataScopeWhereInType()) {
Class strategyClass = sqlConfigDTO.getJoinSqlImplClazz(); Class<?> strategyClass = sqlConfigDTO.getJoinSqlImplClazz();
if (strategyClass == null) { if (strategyClass == null) {
log.warn("data scope custom strategy class is null"); log.warn("data scope custom strategy class is null");
return ""; return "";
@ -111,11 +124,10 @@ public class DataScopeSqlConfigService {
log.warn("data scope custom strategy class{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz()); log.warn("data scope custom strategy class{} ,bean is null", sqlConfigDTO.getJoinSqlImplClazz());
return ""; return "";
} }
DataScopeViewTypeEnum viewTypeEnum = dataScopeViewService.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId); return powerStrategy.getCondition(viewTypeEnum, paramMap, sqlConfigDTO);
return powerStrategy.getCondition(viewTypeEnum,paramMap, sqlConfigDTO);
} }
if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) { if (DataScopeWhereInTypeEnum.EMPLOYEE == sqlConfigDTO.getDataScopeWhereInType()) {
List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(dataScopeTypeEnum, employeeId); List<Long> canViewEmployeeIds = dataScopeViewService.getCanViewEmployeeId(viewTypeEnum, employeeId);
if (CollectionUtils.isEmpty(canViewEmployeeIds)) { if (CollectionUtils.isEmpty(canViewEmployeeIds)) {
return ""; return "";
} }
@ -124,7 +136,7 @@ public class DataScopeSqlConfigService {
return sql; return sql;
} }
if (DataScopeWhereInTypeEnum.DEPARTMENT == sqlConfigDTO.getDataScopeWhereInType()) { if (DataScopeWhereInTypeEnum.DEPARTMENT == sqlConfigDTO.getDataScopeWhereInType()) {
List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(dataScopeTypeEnum, employeeId); List<Long> canViewDepartmentIds = dataScopeViewService.getCanViewDepartmentId(viewTypeEnum, employeeId);
if (CollectionUtils.isEmpty(canViewDepartmentIds)) { if (CollectionUtils.isEmpty(canViewDepartmentIds)) {
return ""; return "";
} }

View File

@ -44,10 +44,9 @@ public class DataScopeViewService {
private DepartmentService departmentService; private DepartmentService departmentService;
/** /**
* 获取某人可以查看的所有人员信息 * 获取某人可以查看的所有人员数据
*/ */
public List<Long> getCanViewEmployeeId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) { public List<Long> getCanViewEmployeeId(DataScopeViewTypeEnum viewType, Long employeeId) {
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
if (DataScopeViewTypeEnum.ME == viewType) { if (DataScopeViewTypeEnum.ME == viewType) {
return this.getMeEmployeeIdList(employeeId); return this.getMeEmployeeIdList(employeeId);
} }
@ -57,16 +56,17 @@ public class DataScopeViewService {
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) { if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
return this.getDepartmentAndSubEmployeeIdList(employeeId); return this.getDepartmentAndSubEmployeeIdList(employeeId);
} }
// 可以查看所有员工数据
return Lists.newArrayList(); return Lists.newArrayList();
} }
/** /**
* 获取某人可以查看的所有部门信息 * 获取某人可以查看的所有部门数据
*/ */
public List<Long> getCanViewDepartmentId(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) { public List<Long> getCanViewDepartmentId(DataScopeViewTypeEnum viewType, Long employeeId) {
DataScopeViewTypeEnum viewType = this.getEmployeeDataScopeViewType(dataScopeTypeEnum, employeeId);
if (DataScopeViewTypeEnum.ME == viewType) { if (DataScopeViewTypeEnum.ME == viewType) {
return this.getMeDepartmentIdList(employeeId); // 数据可见范围类型为本人时 不可以查看任何部门数据
return Lists.newArrayList(0L);
} }
if (DataScopeViewTypeEnum.DEPARTMENT == viewType) { if (DataScopeViewTypeEnum.DEPARTMENT == viewType) {
return this.getMeDepartmentIdList(employeeId); return this.getMeDepartmentIdList(employeeId);
@ -74,6 +74,7 @@ public class DataScopeViewService {
if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) { if (DataScopeViewTypeEnum.DEPARTMENT_AND_SUB == viewType) {
return this.getDepartmentAndSubIdList(employeeId); return this.getDepartmentAndSubIdList(employeeId);
} }
// 可以查看所有部门数据
return Lists.newArrayList(); return Lists.newArrayList();
} }
@ -91,10 +92,16 @@ public class DataScopeViewService {
* 根据员工id 获取各数据范围最大的可见范围 map<dataScopeType,viewType></> * 根据员工id 获取各数据范围最大的可见范围 map<dataScopeType,viewType></>
*/ */
public DataScopeViewTypeEnum getEmployeeDataScopeViewType(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) { public DataScopeViewTypeEnum getEmployeeDataScopeViewType(DataScopeTypeEnum dataScopeTypeEnum, Long employeeId) {
if (employeeId == null) { EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
if (employeeEntity == null || employeeEntity.getEmployeeId() == null) {
return DataScopeViewTypeEnum.ME; return DataScopeViewTypeEnum.ME;
} }
// 如果是超级管理员 则可查看全部
if (employeeEntity.getAdministratorFlag()) {
return DataScopeViewTypeEnum.ALL;
}
List<Long> roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId); List<Long> roleIdList = roleEmployeeDao.selectRoleIdByEmployeeId(employeeId);
//未设置角色 默认本人 //未设置角色 默认本人
if (CollectionUtils.isEmpty(roleIdList)) { if (CollectionUtils.isEmpty(roleIdList)) {

View File

@ -1,8 +1,8 @@
package net.lab1024.sa.admin.module.system.employee.controller; package net.lab1024.sa.admin.module.system.employee.controller;
import cn.dev33.satoken.annotation.SaCheckPermission; import cn.dev33.satoken.annotation.SaCheckPermission;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst; import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
import net.lab1024.sa.admin.module.system.employee.domain.form.*; import net.lab1024.sa.admin.module.system.employee.domain.form.*;
import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO; import net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO;
@ -57,11 +57,11 @@ public class EmployeeController {
return employeeService.updateEmployee(employeeUpdateForm); return employeeService.updateEmployee(employeeUpdateForm);
} }
@Operation(summary = "更新登录人信息 @author 善逸") @Operation(summary = "更新员工个人中心信息 @author 善逸")
@PostMapping("/employee/update/login") @PostMapping("/employee/update/center")
public ResponseDTO<String> updateByLogin(@Valid @RequestBody EmployeeUpdateForm employeeUpdateForm) { public ResponseDTO<String> updateCenter(@Valid @RequestBody EmployeeUpdateCenterForm updateCenterForm) {
employeeUpdateForm.setEmployeeId(SmartRequestUtil.getRequestUserId()); updateCenterForm.setEmployeeId(SmartRequestUtil.getRequestUserId());
return employeeService.updateEmployee(employeeUpdateForm); return employeeService.updateCenter(updateCenterForm);
} }
@Operation(summary = "更新登录人头像 @author 善逸") @Operation(summary = "更新登录人头像 @author 善逸")
@ -117,7 +117,7 @@ public class EmployeeController {
@Operation(summary = "查询员工-根据部门id @author 卓大") @Operation(summary = "查询员工-根据部门id @author 卓大")
@GetMapping("/employee/getAllEmployeeByDepartmentId/{departmentId}") @GetMapping("/employee/getAllEmployeeByDepartmentId/{departmentId}")
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(@PathVariable Long departmentId) { public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(@PathVariable Long departmentId) {
return employeeService.getAllEmployeeByDepartmentId(departmentId, Boolean.FALSE); return employeeService.getAllEmployeeByDepartmentId(departmentId);
} }
@Operation(summary = "查询所有员工 @author 卓大") @Operation(summary = "查询所有员工 @author 卓大")

View File

@ -34,31 +34,30 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
*/ */
List<EmployeeVO> selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag); List<EmployeeVO> selectEmployeeByDisabledAndDeleted(@Param("disabledFlag") Boolean disabledFlag, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 更新单个 * 更新单个
*/ */
void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag); void updateDisableFlag(@Param("employeeId") Long employeeId, @Param("disabledFlag") Boolean disabledFlag);
/** /**
* 通过登录名查询 * 通过登录名查询
*/ */
EmployeeEntity getByLoginName(@Param("loginName") String loginName, EmployeeEntity getByLoginName(@Param("loginName") String loginName, @Param("deletedFlag") Boolean deletedFlag);
@Param("disabledFlag") Boolean disabledFlag);
/** /**
* 通过姓名查询 * 通过姓名查询
*/ */
EmployeeEntity getByActualName(@Param("actualName") String actualName, EmployeeEntity getByActualName(@Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
@Param("disabledFlag") Boolean disabledFlag
);
/** /**
* 通过手机号查询 * 通过手机号查询
*/ */
EmployeeEntity getByPhone(@Param("phone") String phone, @Param("disabledFlag") Boolean disabledFlag); EmployeeEntity getByPhone(@Param("phone") String phone, @Param("deletedFlag") Boolean deletedFlag);
/**
* 通过邮箱账号查询
*/
EmployeeEntity getByEmail(@Param("email") String email, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取所有员工 * 获取所有员工
@ -67,7 +66,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
/** /**
* 获取某个部门员工数 * 获取某个部门员工数
*
*/ */
Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag); Integer countByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
@ -76,39 +74,35 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
*/ */
List<EmployeeVO> getEmployeeByIds(@Param("employeeIds") Collection<Long> employeeIds); List<EmployeeVO> getEmployeeByIds(@Param("employeeIds") Collection<Long> employeeIds);
/** /**
* 查询单个员工信息 * 查询单个员工信息
*/ */
EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId); EmployeeVO getEmployeeById(@Param("employeeId") Long employeeId);
/** /**
* 获取某个部门的员工 * 获取某个部门的员工
*/ */
List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag); List<EmployeeEntity> selectByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 查询某些部门下用户名是xxx的员工 * 查询某些部门下用户名是xxx的员工
*/ */
List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("disabledFlag") Boolean disabledFlag); List<EmployeeEntity> selectByActualName(@Param("departmentIdList") List<Long> departmentIdList, @Param("actualName") String actualName, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取某批部门的员工Id * 获取某批部门的员工Id
*/ */
List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("disabledFlag") Boolean disabledFlag); List<Long> getEmployeeIdByDepartmentIdList(@Param("departmentIds") List<Long> departmentIds, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取所有 * 获取所有
*/ */
List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("disabledFlag") Boolean disabledFlag); List<Long> getEmployeeId(@Param("leaveFlag") Boolean leaveFlag, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 获取某个部门的员工Id * 获取某个部门的员工Id
*/ */
List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("disabledFlag") Boolean disabledFlag); List<Long> getEmployeeIdByDepartmentId(@Param("departmentId") Long departmentId, @Param("deletedFlag") Boolean deletedFlag);
/** /**
* 员工重置密码 * 员工重置密码

View File

@ -4,9 +4,9 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import net.lab1024.sa.base.common.enumeration.GenderEnum; import net.lab1024.sa.base.common.enumeration.GenderEnum;
import net.lab1024.sa.base.common.swagger.SchemaEnum; import net.lab1024.sa.base.common.swagger.SchemaEnum;
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum; import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
@ -51,17 +51,19 @@ public class EmployeeAddForm {
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确") @Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
private String phone; private String phone;
@Schema(description = "邮箱") @Schema(description = "邮箱账号")
@NotNull(message = "邮箱账号不能为空")
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
private String email; private String email;
@Schema(description = "职务级别ID")
private Long positionId;
@Schema(description = "角色列表") @Schema(description = "角色列表")
private List<Long> roleIdList; private List<Long> roleIdList;
@Schema(description = "备注") @Schema(description = "备注")
@Length(max = 30, message = "备注最多200字符") @Length(max = 200, message = "备注最多200字符")
private String remark; private String remark;
@Schema(description = "职务级别ID")
private Long positionId;
} }

View File

@ -0,0 +1,58 @@
package net.lab1024.sa.admin.module.system.employee.domain.form;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import net.lab1024.sa.base.common.enumeration.GenderEnum;
import net.lab1024.sa.base.common.swagger.SchemaEnum;
import net.lab1024.sa.base.common.util.SmartVerificationUtil;
import net.lab1024.sa.base.common.validator.enumeration.CheckEnum;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
* 更新员工个人中心信息
*
* @Author 1024创新实验室: 开云
* @Date 2021-12-20 21:06:49
* @Wechat zhuoda1024
* @Email lab1024@163.com
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
*/
@Data
public class EmployeeUpdateCenterForm {
@Schema(hidden = true)
private Long employeeId;
@Schema(description = "姓名")
@NotNull(message = "姓名不能为空")
@Length(max = 30, message = "姓名最多30字符")
private String actualName;
@SchemaEnum(GenderEnum.class)
@CheckEnum(value = GenderEnum.class, message = "性别错误")
private Integer gender;
@Schema(description = "手机号")
@NotNull(message = "手机号不能为空")
@Pattern(regexp = SmartVerificationUtil.PHONE_REGEXP, message = "手机号格式不正确")
private String phone;
@Schema(description = "邮箱账号")
@NotNull(message = "邮箱账号不能为空")
@Pattern(regexp = SmartVerificationUtil.EMAIL, message = "邮箱账号格式不正确")
private String email;
@Schema(description = "职务级别ID")
private Long positionId;
@Schema(description = "头像")
private String avatar;
@Schema(description = "备注")
@Length(max = 200, message = "备注最多200字符")
private String remark;
}

View File

@ -168,19 +168,14 @@ public class EmployeeService {
return ResponseDTO.userErrorParam("部门不存在"); return ResponseDTO.userErrorParam("部门不存在");
} }
// 检查唯一性
EmployeeEntity existEntity = employeeDao.getByLoginName(employeeUpdateForm.getLoginName(), null); ResponseDTO<String> checkResponse = checkUniqueness(employeeId, employeeUpdateForm.getLoginName(), employeeUpdateForm.getPhone(), employeeUpdateForm.getEmail());
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) { if (!checkResponse.getOk()) {
return ResponseDTO.userErrorParam("登录名重复"); return checkResponse;
} }
existEntity = employeeDao.getByPhone(employeeUpdateForm.getPhone(), null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("手机号已存在");
}
// 不更新密码
EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class); EmployeeEntity entity = SmartBeanUtil.copy(employeeUpdateForm, EmployeeEntity.class);
// 不更新密码
entity.setLoginPwd(null); entity.setLoginPwd(null);
// 更新数据 // 更新数据
@ -192,6 +187,57 @@ public class EmployeeService {
return ResponseDTO.ok(); return ResponseDTO.ok();
} }
/**
* 更新员工个人中心信息
*/
public ResponseDTO<String> updateCenter(EmployeeUpdateCenterForm updateCenterForm) {
Long employeeId = updateCenterForm.getEmployeeId();
EmployeeEntity employeeEntity = employeeDao.selectById(employeeId);
if (null == employeeEntity) {
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
}
// 检查唯一性 登录账号不能修改则不需要检查
ResponseDTO<String> checkResponse = checkUniqueness(employeeId, "", updateCenterForm.getPhone(), updateCenterForm.getEmail());
if (!checkResponse.getOk()) {
return checkResponse;
}
EmployeeEntity employee = SmartBeanUtil.copy(updateCenterForm, EmployeeEntity.class);
// 不更新密码
employee.setLoginPwd(null);
// 更新数据
employeeDao.updateById(employee);
// 清除员工缓存
loginService.clearLoginEmployeeCache(employeeId);
return ResponseDTO.ok();
}
/**
* 检查唯一性
*/
private ResponseDTO<String> checkUniqueness(Long employeeId, String loginName, String phone, String email) {
EmployeeEntity existEntity = employeeDao.getByLoginName(loginName, null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("登录名重复");
}
existEntity = employeeDao.getByPhone(phone, null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("手机号已存在");
}
existEntity = employeeDao.getByEmail(email, null);
if (null != existEntity && !Objects.equals(existEntity.getEmployeeId(), employeeId)) {
return ResponseDTO.userErrorParam("邮箱账号已存在");
}
return ResponseDTO.ok();
}
/** /**
* 更新登录人头像 * 更新登录人头像
@ -337,11 +383,8 @@ public class EmployeeService {
/** /**
* 获取某个部门的员工信息 * 获取某个部门的员工信息
*/ */
public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(Long departmentId, Boolean disabledFlag) { public ResponseDTO<List<EmployeeVO>> getAllEmployeeByDepartmentId(Long departmentId) {
List<EmployeeEntity> employeeEntityList = employeeDao.selectByDepartmentId(departmentId, disabledFlag); List<EmployeeEntity> employeeEntityList = employeeDao.selectByDepartmentId(departmentId, Boolean.FALSE);
if (disabledFlag != null) {
employeeEntityList = employeeEntityList.stream().filter(e -> e.getDisabledFlag().equals(disabledFlag)).collect(Collectors.toList());
}
if (CollectionUtils.isEmpty(employeeEntityList)) { if (CollectionUtils.isEmpty(employeeEntityList)) {
return ResponseDTO.ok(Collections.emptyList()); return ResponseDTO.ok(Collections.emptyList());
@ -382,7 +425,7 @@ public class EmployeeService {
* 根据登录名获取员工 * 根据登录名获取员工
*/ */
public EmployeeEntity getByLoginName(String loginName) { public EmployeeEntity getByLoginName(String loginName) {
return employeeDao.getByLoginName(loginName, null); return employeeDao.getByLoginName(loginName, false);
} }
} }

View File

@ -46,6 +46,12 @@ public class RequestEmployee implements RequestUser {
@Schema(description = "部门名称") @Schema(description = "部门名称")
private String departmentName; private String departmentName;
@Schema(description = "职务级别ID")
private Long positionId;
@Schema(description = "邮箱")
private String email;
@Schema(description = "是否禁用") @Schema(description = "是否禁用")
private Boolean disabledFlag; private Boolean disabledFlag;

View File

@ -2,6 +2,28 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao"> <mapper namespace="net.lab1024.sa.admin.module.business.oa.notice.dao.NoticeDao">
<!-- 查询结果列 -->
<sql id="base_columns">
t_notice.notice_id,
t_notice.notice_type_id,
t_notice.title,
t_notice.all_visible_flag,
t_notice.scheduled_publish_flag,
t_notice.publish_time,
t_notice.content_text,
t_notice.content_html,
t_notice.attachment,
t_notice.page_view_count,
t_notice.user_view_count,
t_notice.source,
t_notice.author,
t_notice.document_number,
t_notice.deleted_flag,
t_notice.create_user_id,
t_notice.update_time,
t_notice.create_time
</sql>
<!-- ================================== 可见范围相关 ================================== --> <!-- ================================== 可见范围相关 ================================== -->
<insert id="insertVisibleRange"> <insert id="insertVisibleRange">
@ -35,32 +57,30 @@
<!-- 后管分页查询资讯 --> <!-- 后管分页查询资讯 -->
<select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO"> <select id="query" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeVO">
SELECT SELECT
t_notice.* , <include refid="base_columns"/>,
t_notice_type.notice_type_name as noticeTypeName, t_notice_type.notice_type_name as noticeTypeName,
t_employee.actual_name as createUserName, t_employee.actual_name as createUserName
t_department.name as departmentName
FROM t_notice FROM t_notice
left join t_notice_type on t_notice_type.notice_type_id = t_notice.notice_type_id LEFT JOIN t_notice_type on t_notice.notice_type_id = t_notice_type.notice_type_id
left join t_employee on t_notice.create_user_id = t_employee.employee_id LEFT JOIN t_employee on t_notice.create_user_id = t_employee.employee_id
left join t_department on t_employee.department_id = t_department.department_id
<where> <where>
<if test="query.noticeTypeId != null"> <if test="query.noticeTypeId != null">
AND t_notice_type.notice_type_id = #{query.noticeTypeId} AND t_notice_type.notice_type_id = #{query.noticeTypeId}
</if> </if>
<if test="query.keywords != null and query.keywords !=''"> <if test="query.keywords != null and query.keywords != ''">
AND ( INSTR(t_notice.title,#{query.keywords}) AND ( INSTR(t_notice.title,#{query.keywords})
OR INSTR(t_notice.author,#{query.keywords}) OR INSTR(t_notice.author,#{query.keywords})
OR INSTR(t_notice.source,#{query.keywords}) OR INSTR(t_notice.source,#{query.keywords})
) )
</if> </if>
<if test="query.documentNumber != null and query.documentNumber !=''"> <if test="query.documentNumber != null and query.documentNumber != ''">
AND INSTR(t_notice.document_number, #{query.documentNumber}) AND INSTR(t_notice.document_number, #{query.documentNumber})
</if> </if>
<if test="query.createUserId != null"> <if test="query.createUserName != null and query.createUserName != ''">
AND t_notice.create_user_id = #{createUserId} AND t_employee.actual_name = #{query.createUserName}
</if> </if>
<if test="query.deletedFlag != null"> <if test="query.deletedFlag != null">
and t_notice.deleted_flag = #{query.deletedFlag} AND t_notice.deleted_flag = #{query.deletedFlag}
</if> </if>
<if test="query.createTimeBegin != null"> <if test="query.createTimeBegin != null">
AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{query.createTimeBegin}, AND DATE_FORMAT(t_notice.create_time, '%Y-%m-%d') &gt;= DATE_FORMAT(#{query.createTimeBegin},
@ -84,10 +104,9 @@
</select> </select>
<!-- ================================== 通知公告【员工查看】相关 ================================== --> <!-- ================================== 通知公告【员工查看】相关 ================================== -->
<select id="queryEmployeeNotice" <select id="queryEmployeeNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
select select
t_notice.*, <include refid="base_columns"/>,
t_notice_type.notice_type_name, t_notice_type.notice_type_name,
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and (select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
@ -142,12 +161,11 @@
</where> </where>
order by t_notice.publish_time desc order by t_notice.publish_time desc
</select> </select>
<select id="queryEmployeeNotViewNotice" <select id="queryEmployeeNotViewNotice" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeEmployeeVO">
select * from select * from
( (
select select
t_notice.*, <include refid="base_columns"/>,
t_notice_type.notice_type_name, t_notice_type.notice_type_name,
(select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and (select count(*) from t_notice_view_record where t_notice_view_record.employee_id = #{requestEmployeeId} and
t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag t_notice_view_record.notice_id = t_notice.notice_id) as viewFlag
@ -198,8 +216,7 @@
) t where viewFlag = 0 ) t where viewFlag = 0
order by t.publish_time desc order by t.publish_time desc
</select> </select>
<select id="queryNoticeViewRecordList" <select id="queryNoticeViewRecordList" resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
resultType="net.lab1024.sa.admin.module.business.oa.notice.domain.vo.NoticeViewRecordVO">
select t_notice_view_record.*, select t_notice_view_record.*,
t_employee.actual_name as employeeName, t_employee.actual_name as employeeName,
t_department.name as departmentName t_department.name as departmentName

View File

@ -33,21 +33,19 @@
</where> </where>
</select> </select>
<update id="updateDisableFlag"> <update id="updateDisableFlag">
UPDATE t_employee UPDATE t_employee
SET disabled_flag = #{disabledFlag} SET disabled_flag = #{disabledFlag}
WHERE employee_id = #{employeeId} WHERE employee_id = #{employeeId}
</update> </update>
<select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity"> <select id="getByLoginName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * SELECT *
FROM t_employee FROM t_employee
<where> <where>
login_name = #{loginName} login_name = #{loginName}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
@ -57,24 +55,33 @@
FROM t_employee FROM t_employee
<where> <where>
actual_name = #{actualName} actual_name = #{actualName}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
<select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity"> <select id="getByPhone" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * SELECT *
FROM t_employee FROM t_employee
<where> <where>
phone = #{phone} phone = #{phone}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
<select id="getByEmail" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT *
FROM t_employee
<where>
email = #{email}
<if test="deletedFlag != null">
AND deleted_flag = #{deletedFlag}
</if>
</where>
</select>
<select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO"> <select id="listAll" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
SELECT * SELECT *
@ -88,22 +95,19 @@
department_id = #{departmentId} AND deleted_flag = #{deletedFlag} department_id = #{departmentId} AND deleted_flag = #{deletedFlag}
</select> </select>
<select id="selectByDepartmentId" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
<select id="selectByDepartmentId"
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * SELECT *
FROM t_employee FROM t_employee
<where> <where>
department_id = #{departmentId} department_id = #{departmentId}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="selectByActualName" <select id="selectByActualName" resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
resultType="net.lab1024.sa.admin.module.system.employee.domain.entity.EmployeeEntity">
SELECT * FROM t_employee SELECT * FROM t_employee
<where> <where>
actual_name = #{actualName} actual_name = #{actualName}
@ -111,8 +115,8 @@
<foreach collection="departmentIdList" item="item" open="(" close=")" separator=","> <foreach collection="departmentIdList" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
@ -125,20 +129,19 @@
<foreach collection="departmentIds" item="item" open="(" close=")" separator=","> <foreach collection="departmentIds" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="getEmployeeId" resultType="java.lang.Long"> <select id="getEmployeeId" resultType="java.lang.Long">
SELECT employee_id SELECT employee_id
FROM t_employee FROM t_employee
<where> <where>
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
</select> </select>
@ -148,8 +151,8 @@
FROM t_employee FROM t_employee
<where> <where>
department_id = #{departmentId} department_id = #{departmentId}
<if test="disabledFlag != null"> <if test="deletedFlag != null">
AND disabled_flag = #{disabledFlag} AND deleted_flag = #{deletedFlag}
</if> </if>
</where> </where>
ORDER BY create_time DESC ORDER BY create_time DESC
@ -164,7 +167,6 @@
ORDER BY create_time DESC ORDER BY create_time DESC
</select> </select>
<select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO"> <select id="getEmployeeById" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
SELECT t_employee.*, SELECT t_employee.*,
t_department.name AS departmentName t_department.name AS departmentName
@ -173,8 +175,7 @@
where t_employee.employee_id = #{employeeId} where t_employee.employee_id = #{employeeId}
</select> </select>
<select id="selectEmployeeByDisabledAndDeleted" <select id="selectEmployeeByDisabledAndDeleted" resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
resultType="net.lab1024.sa.admin.module.system.employee.domain.vo.EmployeeVO">
SELECT SELECT
t_employee.*, t_employee.*,
t_department.name AS departmentName t_department.name AS departmentName
@ -196,5 +197,4 @@
WHERE employee_id = #{employeeId} WHERE employee_id = #{employeeId}
</update> </update>
</mapper> </mapper>

View File

@ -40,7 +40,7 @@ public class MapperVariableService extends CodeGenerateBaseVariableService {
List<String> columnNameList = queryField.getColumnNameList(); List<String> columnNameList = queryField.getColumnNameList();
if (columnNameList.size() == 1) { if (columnNameList.size() == 1) {
// AND INSTR(t_notice.title,#{query.keywords}) // AND INSTR(t_notice.title,#{query.keywords})
stringBuilder.append(" AND INSTR(") stringBuilder.append("AND INSTR(")
.append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(0)) .append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(0))
.append(",#{queryForm.") .append(",#{queryForm.")
.append(queryField.getFieldName()) .append(queryField.getFieldName())
@ -48,7 +48,7 @@ public class MapperVariableService extends CodeGenerateBaseVariableService {
} else { } else {
for (int i = 0; i < columnNameList.size(); i++) { for (int i = 0; i < columnNameList.size(); i++) {
if (i == 0) { if (i == 0) {
stringBuilder.append("AND ( INSTR(") stringBuilder.append("AND (\n INSTR(")
.append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(i)) .append(form.getTableName()).append(".").append(queryField.getColumnNameList().get(i))
.append(",#{queryForm.") .append(",#{queryForm.")
.append(queryField.getFieldName()) .append(queryField.getFieldName())

View File

@ -36,10 +36,10 @@ export const employeeApi = {
return postRequest('/employee/update', params); return postRequest('/employee/update', params);
}, },
/** /**
* 更新登录人信息 * 更新员工个人中心信息
*/ */
updateByLogin: (params) => { updateCenter: (params) => {
return postRequest('/employee/update/login', params); return postRequest('/employee/update/center', params);
}, },
/** /**
* 更新登录人头像 * 更新登录人头像
@ -77,25 +77,22 @@ export const employeeApi = {
updateEmployeePassword: (param) => { updateEmployeePassword: (param) => {
return postEncryptRequest('/employee/update/password', param); return postEncryptRequest('/employee/update/password', param);
}, },
/** /**
* 获取密码复杂度 * 获取密码复杂度
*/ */
getPasswordComplexityEnabled: () => { getPasswordComplexityEnabled: () => {
return getRequest('/employee/getPasswordComplexityEnabled'); return getRequest('/employee/getPasswordComplexityEnabled');
}, },
/** /**
* 更新员工禁用状态 * 更新员工禁用状态
*/ */
updateDisabled: (employeeId) => { updateDisabled: (employeeId) => {
return getRequest(`/employee/update/disabled/${employeeId}`); return getRequest(`/employee/update/disabled/${employeeId}`);
}, },
/** /**
* 查询员工-根据部门id * 查询员工-根据部门id
*/ */
queryEmployeeByDeptId: (departmentId) => { queryEmployeeByDeptId: (departmentId) => {
return getRequest(`/employee/query/dept/${departmentId}`); return getRequest(`/employee/getAllEmployeeByDepartmentId/${departmentId}`);
}, },
}; };

View File

@ -9,7 +9,11 @@
* *
--> -->
<template> <template>
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" :options="optionList" @change="handleChange" /> <a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" @change="handleChange" :disabled="disabled">
<a-checkbox v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }}
</a-checkbox>
</a-checkbox-group>
</template> </template>
<script setup> <script setup>
@ -22,19 +26,32 @@
type: String, type: String,
default: '200px', default: '200px',
}, },
//
disabled: {
type: Boolean,
default: false,
},
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
}); });
// ------------ ------------ // ------------ ------------
const optionList = ref([]); const valueDescList = ref([]);
function buildOptionList() {
onMounted(() => {
const internalInstance = getCurrentInstance(); // const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin; const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
const valueList = smartEnumPlugin.getValueDescList(props.enumName); valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
optionList.value = valueList.map((e) => Object.assign({}, { value: e.value, label: e.desc })); });
}
onMounted(buildOptionList);
// ------------ ------------ // ------------ ------------
@ -43,11 +60,14 @@
watch( watch(
() => props.value, () => props.value,
(newValue) => { (newValue) => {
selectValue.value = newValue; //
} selectValue.value = newValue.filter((item) => !props.hiddenOption.includes(item) && !props.disabledOption.includes(item));
},
{ immediate: true }
); );
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
function handleChange(value) { function handleChange(value) {
emit('update:value', value); emit('update:value', value);
emit('change', value); emit('change', value);

View File

@ -10,15 +10,15 @@
--> -->
<template> <template>
<template v-if="isButton"> <template v-if="isButton">
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid"> <a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid" :disabled="disabled">
<a-radio-button v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value"> <a-radio-button v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }} {{ item.desc }}
</a-radio-button> </a-radio-button>
</a-radio-group> </a-radio-group>
</template> </template>
<template v-else> <template v-else>
<a-radio-group v-model:value="selectValue" @change="handleChange"> <a-radio-group v-model:value="selectValue" @change="handleChange" :disabled="disabled">
<a-radio v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value"> <a-radio v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }} {{ item.desc }}
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
@ -26,7 +26,7 @@
</template> </template>
<script setup> <script setup>
import { ref, watch } from 'vue'; import { ref, watch, onMounted, getCurrentInstance } from 'vue';
const props = defineProps({ const props = defineProps({
enumName: String, enumName: String,
@ -43,19 +43,44 @@
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
disabled: {
type: Boolean,
default: false,
},
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
}); });
const emit = defineEmits(['update:value', 'change']); const valueDescList = ref([]);
onMounted(() => {
const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
});
const selectValue = ref(props.value); const selectValue = ref(props.value);
watch( watch(
() => props.value, () => props.value,
(newValue) => { (newValue) => {
selectValue.value = newValue; //
} selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
},
{ immediate: true }
); );
const emit = defineEmits(['update:value', 'change']);
function handleChange(e) { function handleChange(e) {
emit('update:value', e.target.value); emit('update:value', e.target.value);
emit('change', e.target.value); emit('change', e.target.value);

View File

@ -19,18 +19,18 @@
@change="handleChange" @change="handleChange"
:disabled="disabled" :disabled="disabled"
> >
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value"> <a-select-option v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }} {{ item.desc }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</template> </template>
<script setup> <script setup>
import { ref, watch } from 'vue'; import { ref, watch, onMounted, getCurrentInstance } from 'vue';
const props = defineProps({ const props = defineProps({
enumName: String, enumName: String,
value: [Number,String], value: [Number, String],
width: { width: {
type: String, type: String,
default: '100%', default: '100%',
@ -43,23 +43,44 @@
type: String, type: String,
default: 'default', default: 'default',
}, },
//
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
}); });
const emit = defineEmits(['update:value', 'change']); const valueDescList = ref([]);
onMounted(() => {
const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
});
const selectValue = ref(props.value); const selectValue = ref(props.value);
watch( watch(
() => props.value, () => props.value,
(newValue) => { (newValue) => {
selectValue.value = newValue; //
} selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
},
{ immediate: true }
); );
const emit = defineEmits(['update:value', 'change']);
function handleChange(value) { function handleChange(value) {
emit('update:value', value); emit('update:value', value);
emit('change', value); emit('change', value);

View File

@ -18,6 +18,7 @@
:allowClear="true" :allowClear="true"
:size="size" :size="size"
@change="onChange" @change="onChange"
:disabled="disabled"
> >
<a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode"> <a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode">
{{ item.keyName }} {{ item.keyName }}
@ -27,7 +28,7 @@
</template> </template>
<script setup> <script setup>
import { computed, onMounted, ref, watch, defineExpose } from 'vue'; import { onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict-api'; import { dictApi } from '/@/api/support/dict-api';
defineExpose({ defineExpose({
@ -49,7 +50,7 @@
default: 'default', default: 'default',
}, },
// //
disabledFlag: { disabled: {
type: Number, type: Number,
default: null, default: null,
}, },

View File

@ -20,7 +20,12 @@
@change="onChange" @change="onChange"
:disabled="disabled" :disabled="disabled"
> >
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode"> <a-select-option
v-for="item in dictValueList"
:key="item.valueCode"
:value="item.valueCode"
:disabled="disabledOption.includes(item.valueCode)"
>
{{ item.valueName }} {{ item.valueName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -28,7 +33,7 @@
</template> </template>
<script setup> <script setup>
import { computed, onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict-api'; import { dictApi } from '/@/api/support/dict-api';
const props = defineProps({ const props = defineProps({
@ -50,10 +55,21 @@
type: String, type: String,
default: 'default', default: 'default',
}, },
//
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
}); });
// -------------------------- -------------------------- // -------------------------- --------------------------
@ -61,7 +77,7 @@
const dictValueList = ref([]); const dictValueList = ref([]);
async function queryDict() { async function queryDict() {
let res = await dictApi.valueList(props.keyCode); let res = await dictApi.valueList(props.keyCode);
dictValueList.value = res.data; dictValueList.value = res.data.filter((item) => !props.hiddenOption.includes(item.valueCode));
} }
onMounted(queryDict); onMounted(queryDict);
@ -69,26 +85,24 @@
// -------------------------- -------------------------- // -------------------------- --------------------------
const selectValue = ref(props.value); const selectValue = ref(props.value);
watch( watch(
() => props.value, () => props.value,
(value) => { (newValue) => {
selectValue.value = value; //
if (Array.isArray(newValue)) {
selectValue.value = newValue.filter((item) => !props.disabledOption.includes(item) && !props.hiddenOption.includes(item));
} else {
selectValue.value = props.hiddenOption.includes(newValue) || props.disabledOption.includes(newValue) ? undefined : newValue;
} }
},
{ immediate: true }
); );
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
function onChange(value) { function onChange(value) {
if (!value) {
emit('update:value', []);
emit('change', []);
return;
}
if (Array.isArray(value)) {
emit('update:value', value); emit('update:value', value);
emit('change', value); emit('change', value);
} else {
emit('update:value', value);
emit('change', value);
}
} }
</script> </script>

View File

@ -68,7 +68,15 @@
// columns使 // columns使
let originalColumn = _.cloneDeep(props.modelValue); let originalColumn = _.cloneDeep(props.modelValue);
onMounted(buildUserTableColumns); onMounted(() => {
buildUserTableColumns();
// ESC 退 fullScreenFlag
addEventListener('fullscreenchange', (event) => {
if (document.fullscreenElement === null) {
fullScreenFlag.value = false;
}
});
});
// //
async function buildUserTableColumns() { async function buildUserTableColumns() {

View File

@ -9,7 +9,28 @@
* *
--> -->
<template> <template>
<a-modal :width="700" :open="visible" title="设置列" :destroyOnClose="true" :closable="false"> <a-modal :width="800" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
<div v-if="!tableId">
<a-alert type="error" show-icon class="smart-margin-bottom10">
<template #message> 您尚未设置 TableOperator 组件的 tableId</template>
</a-alert>
<a-alert type="error" class="smart-margin-bottom10">
<template #message>
1. 请在 src\constants\support\table-id-const.js 中配置 tableId 常量
<br />
<br />
2. 在自己的业务表格页面组件中使用如下
<br />
导入: import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
<br />
使用: {{ '<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.XXX" :refresh="queryData" />' }}
<br />
<br />
3. 具体用法可参考员工管理
</template>
</a-alert>
</div>
<div v-else>
<a-alert type="info" show-icon class="smart-margin-bottom10"> <a-alert type="info" show-icon class="smart-margin-bottom10">
<template #icon><smile-outlined /></template> <template #icon><smile-outlined /></template>
<template #message> 可以通过拖拽行直接修改顺序哦 <pushpin-outlined />为固定列不可拖拽 </template> <template #message> 可以通过拖拽行直接修改顺序哦 <pushpin-outlined />为固定列不可拖拽 </template>
@ -28,8 +49,10 @@
<template #bodyCell="{ text, record, index, column }"> <template #bodyCell="{ text, record, index, column }">
<template v-if="column.dataIndex === 'title'"> <template v-if="column.dataIndex === 'title'">
<a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left"> <a-button type="text" :class="record.fixed ? '' : 'handle'" size="small" style="width: 100%; text-align: left">
<template #icon v-if="!record.fixed"> <drag-outlined /> </template> <template #icon>
<template #icon v-if="record.fixed"> <pushpin-outlined /> </template> <drag-outlined v-if="!record.fixed" />
<pushpin-outlined v-else />
</template>
{{ text }} {{ text }}
</a-button> </a-button>
</template> </template>
@ -44,11 +67,12 @@
</template> </template>
</template> </template>
</a-table> </a-table>
</div>
<template #footer> <template #footer>
<a-button key="back" @click="hide">取消</a-button> <a-button key="back" @click="hide">取消</a-button>
<a-button key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button> <a-button v-if="tableId" key="submit" type="primary" :loading="submitLoading" @click="save">保存</a-button>
<a-button key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button> <a-button v-if="tableId" key="back" :loading="submitLoading" @click="reset" danger style="margin-left: 20px">恢复默认</a-button>
</template> </template>
</a-modal> </a-modal>
</template> </template>
@ -67,7 +91,7 @@
defineExpose({ show }); defineExpose({ show });
// ---------------- / -------------------- // ---------------- / --------------------
let tableId = 1; let tableId = null;
const visible = ref(false); const visible = ref(false);
// //
function show(columns, showTableId) { function show(columns, showTableId) {
@ -83,6 +107,9 @@
// //
async function getUserTableColumns(tableId, columns) { async function getUserTableColumns(tableId, columns) {
if (!tableId) {
return;
}
SmartLoading.show(); SmartLoading.show();
let userTableColumnArray = []; let userTableColumnArray = [];
try { try {

View File

@ -21,7 +21,7 @@ export function privilegeDirective(el, binding) {
if (!userPointsList) { if (!userPointsList) {
return false; return false;
} }
// 如果有权限,删除节点 // 如果有权限,删除节点
if (!_.some(userPointsList, ['webPerms', binding.value])) { if (!_.some(userPointsList, ['webPerms', binding.value])) {
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
} }

View File

@ -8,6 +8,7 @@
* @Copyright 1024创新实验室 https://1024lab.net Since 2012 * @Copyright 1024创新实验室 https://1024lab.net Since 2012
*/ */
import { useUserStore } from '/@/store/modules/system/user'; import { useUserStore } from '/@/store/modules/system/user';
import _ from 'lodash';
const privilege = (value) => { const privilege = (value) => {
// 超级管理员 // 超级管理员
@ -19,7 +20,7 @@ const privilege = (value) => {
if (!userPointsList) { if (!userPointsList) {
return false; return false;
} }
return userPointsList && userPointsList.includes(value); return _.some(userPointsList, ['apiPerms', value]);
}; };
export default { export default {

View File

@ -73,7 +73,7 @@ export const useUserStore = defineStore({
} }
return localRead(localKey.USER_TOKEN); return localRead(localKey.USER_TOKEN);
}, },
getNeedUpdatePwdFlag(state){ getNeedUpdatePwdFlag(state) {
return state.needUpdatePwdFlag; return state.needUpdatePwdFlag;
}, },
//是否初始化了 路由 //是否初始化了 路由
@ -206,7 +206,7 @@ export const useUserStore = defineStore({
// @ts-ignore // @ts-ignore
menuTitle: route.meta.title, menuTitle: route.meta.title,
menuQuery: route.query, menuQuery: route.query,
menuIcon:route.meta?.icon, menuIcon: route.meta?.icon,
// @ts-ignore // @ts-ignore
fromMenuName: from.name, fromMenuName: from.name,
fromMenuQuery: from.query, fromMenuQuery: from.query,

View File

@ -11,17 +11,17 @@
<a-card style="margin-bottom: 15px" size="small"> <a-card style="margin-bottom: 15px" size="small">
<a-descriptions :title="noticeDetail.title" :column="4" size="small"> <a-descriptions :title="noticeDetail.title" :column="4" size="small">
<template #extra> <template #extra>
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button> <a-button type="primary" size="small" @click="onEdit">编辑</a-button>
</template> </template>
<a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item> <a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item>
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber }}</a-descriptions-item> <a-descriptions-item label="文号">{{ noticeDetail.documentNumber ? noticeDetail.documentNumber : '无' }}</a-descriptions-item>
<a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item> <a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item>
<a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item> <a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item>
<a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item> <a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item>
<a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item> <a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item>
<a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item> <a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item>
<a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item> <a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item>
<a-descriptions-item label="定时发布">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item> <a-descriptions-item label="发布状态">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
<a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item> <a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item>
<a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件"> <a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件">
<div class="file-list"> <div class="file-list">

View File

@ -35,7 +35,7 @@
</a-button-group> </a-button-group>
</a-form-item> </a-form-item>
</a-row> </a-row>
<a-row class="smart-query-form-row"> </a-row> <a-row class="smart-query-form-row" />
</a-form> </a-form>
<a-card size="small" :bordered="false"> <a-card size="small" :bordered="false">

View File

@ -28,7 +28,7 @@
</a-form-item> </a-form-item>
<a-form-item label="创建人" class="smart-query-form-item"> <a-form-item label="创建人" class="smart-query-form-item">
<a-input style="width: 100px" v-model:value="queryForm.createUserId" placeholder="创建人" /> <a-input style="width: 100px" v-model:value="queryForm.createUserName" placeholder="创建人" />
</a-form-item> </a-form-item>
<a-form-item label="是否删除" class="smart-query-form-item"> <a-form-item label="是否删除" class="smart-query-form-item">
@ -91,6 +91,9 @@
<template v-if="column.dataIndex === 'title'"> <template v-if="column.dataIndex === 'title'">
<a @click="toDetail(record.noticeId)">{{ text }}</a> <a @click="toDetail(record.noticeId)">{{ text }}</a>
</template> </template>
<template v-if="column.dataIndex === 'documentNumber'">
{{ text ? text : '无' }}
</template>
<template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template> <template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template>
<template v-else-if="column.dataIndex === 'publishFlag'"> <template v-else-if="column.dataIndex === 'publishFlag'">
{{ text ? '已发布' : '待发布' }} {{ text ? '已发布' : '待发布' }}
@ -145,7 +148,7 @@
noticeTypeId: undefined, // noticeTypeId: undefined, //
keywords: '', // keywords: '', //
documentNumber: '', // documentNumber: '', //
createUserId: undefined, // createUserName: undefined, //
deletedFlag: undefined, // deletedFlag: undefined, //
createTimeBegin: null, //- createTimeBegin: null, //-
createTimeEnd: null, //- createTimeEnd: null, //-
@ -195,7 +198,7 @@
ellipsis: true, ellipsis: true,
}, },
{ {
title: '发布', title: '发布状态',
dataIndex: 'publishFlag', dataIndex: 'publishFlag',
width: 80, width: 80,
}, },

View File

@ -199,7 +199,7 @@
function setData(tableColumns, config) { function setData(tableColumns, config) {
//------------- ----------------- //------------- -----------------
if (config.insertAndUpdate) { if (config.insertAndUpdate) {
formData.isSupportInsertAndUpdate = config.insertAndUpdate.isSupportInsertAndUpdate ? config.insertAndUpdate.isSupportInsertAndUpdate : true; formData.isSupportInsertAndUpdate = config.insertAndUpdate.isSupportInsertAndUpdate;
formData.pageType = config.insertAndUpdate.pageType; formData.pageType = config.insertAndUpdate.pageType;
formData.width = config.insertAndUpdate.width; formData.width = config.insertAndUpdate.width;
formData.countPerLine = config.insertAndUpdate.countPerLine; formData.countPerLine = config.insertAndUpdate.countPerLine;

View File

@ -107,7 +107,8 @@
<template v-if="column.dataIndex === 'enabledFlag'"> <template v-if="column.dataIndex === 'enabledFlag'">
<a-switch <a-switch
v-model:checked="record.enabledFlag" v-model:checked="record.enabledFlag"
checked-children="已启用" un-checked-children="已禁用" checked-children="已启用"
un-checked-children="已禁用"
@change="(checked) => handleEnabledUpdate(checked, record)" @change="(checked) => handleEnabledUpdate(checked, record)"
:loading="record.enabledLoading" :loading="record.enabledLoading"
/> />
@ -117,7 +118,9 @@
<a-button v-privilege="'support:job:update'" @click="openUpdateModal(record)" type="link">编辑</a-button> <a-button v-privilege="'support:job:update'" @click="openUpdateModal(record)" type="link">编辑</a-button>
<a-button v-privilege="'support:job:execute'" type="link" @click="openExecuteModal(record)">执行</a-button> <a-button v-privilege="'support:job:execute'" type="link" @click="openExecuteModal(record)">执行</a-button>
<a-button v-privilege="'support:job:log:query'" @click="openJobLogModal(record.jobId, record.jobName)" type="link">记录</a-button> <a-button v-privilege="'support:job:log:query'" @click="openJobLogModal(record.jobId, record.jobName)" type="link">记录</a-button>
<a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link">删除</a-button> <a-button danger v-privilege="'support:job:log:delete'" @click="confirmDelete(record.jobId, record.jobName)" type="link"
>删除</a-button
>
</div> </div>
</template> </template>
</template> </template>
@ -140,8 +143,6 @@
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane> <a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
<!-- 表单操作 --> <!-- 表单操作 -->
@ -152,7 +153,7 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import {message, Modal} from 'ant-design-vue'; import { message, Modal } from 'ant-design-vue';
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { jobApi } from '/@/api/support/job-api'; import { jobApi } from '/@/api/support/job-api';
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const'; import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
@ -163,7 +164,7 @@
import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js'; import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js';
import JobFormModal from './components/job-form-modal.vue'; import JobFormModal from './components/job-form-modal.vue';
import JobLogListModal from './components/job-log-list-modal.vue'; import JobLogListModal from './components/job-log-list-modal.vue';
import {SmartLoading} from "/@/components/framework/smart-loading/index.js"; import { SmartLoading } from '/@/components/framework/smart-loading/index.js';
const columns = ref([ const columns = ref([
{ {
@ -241,6 +242,8 @@
}, },
]); ]);
const activeKey = ref('1');
// ---------------- ----------------------- // ---------------- -----------------------
const queryFormState = { const queryFormState = {
@ -333,7 +336,7 @@
// ------------------------------------ ------------------------------------- // ------------------------------------ -------------------------------------
function confirmDelete(jobId, jobName){ function confirmDelete(jobId, jobName) {
Modal.confirm({ Modal.confirm({
title: '警告', title: '警告',
content: `确定要删除【${jobName}】任务吗?`, content: `确定要删除【${jobName}】任务吗?`,
@ -347,15 +350,15 @@
}); });
} }
async function deleteJob(jobId){ async function deleteJob(jobId) {
try{ try {
SmartLoading.show(); SmartLoading.show();
await jobApi.deleteJob(jobId); await jobApi.deleteJob(jobId);
message.success('删除成功!'); message.success('删除成功!');
queryJobList(); queryJobList();
}catch (e){ } catch (e) {
smartSentry.captureError(e); smartSentry.captureError(e);
}finally { } finally {
SmartLoading.hide(); SmartLoading.hide();
} }
} }

View File

@ -11,6 +11,16 @@
<a-form-item label="登录账号" name="loginName"> <a-form-item label="登录账号" name="loginName">
<a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled /> <a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled />
</a-form-item> </a-form-item>
<a-form-item label="部门" name="departmentId">
<DepartmentTreeSelect
class="form-item"
ref="departmentTreeSelect"
width="100%"
:init="false"
v-model:value="form.departmentId"
disabled
/>
</a-form-item>
<a-form-item label="员工名称" name="actualName"> <a-form-item label="员工名称" name="actualName">
<a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" /> <a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" />
</a-form-item> </a-form-item>
@ -20,8 +30,11 @@
<a-form-item label="手机号码" name="phone"> <a-form-item label="手机号码" name="phone">
<a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" /> <a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" />
</a-form-item> </a-form-item>
<a-form-item label="部门" name="departmentId"> <a-form-item label="邮箱" name="email">
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" /> <a-input v-model:value.trim="form.email" placeholder="请输入邮箱" />
</a-form-item>
<a-form-item label="职务" name="positionId">
<PositionSelect v-model:value="form.positionId" placeholder="请选择职务" />
</a-form-item> </a-form-item>
<a-form-item label="备注" name="remark"> <a-form-item label="备注" name="remark">
<a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" /> <a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" />
@ -65,6 +78,7 @@
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { regular } from '/@/constants/regular-const.js'; import { regular } from '/@/constants/regular-const.js';
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue'; import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
import PositionSelect from '/@/components/system/position-select/index.vue';
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue'; import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
import { loginApi } from '/@/api/system/login-api.js'; import { loginApi } from '/@/api/system/login-api.js';
import { useUserStore } from '/@/store/modules/system/user.js'; import { useUserStore } from '/@/store/modules/system/user.js';
@ -93,10 +107,12 @@
phone: '', phone: '',
// id // id
departmentId: undefined, departmentId: undefined,
//
disabledFlag: undefined,
// //
email: undefined, email: undefined,
//
positionId: undefined,
//
disabledFlag: undefined,
// //
remark: '', remark: '',
}; };
@ -111,7 +127,7 @@
{ pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' }, { pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' },
], ],
gender: [{ required: true, message: '性别不能为空' }], gender: [{ required: true, message: '性别不能为空' }],
departmentId: [{ required: true, message: '部门不能为空' }], email: [{ required: true, message: '请输入邮箱' }],
}; };
// //
let avatarUrl = ref(); let avatarUrl = ref();
@ -128,12 +144,13 @@
form.employeeId = data.employeeId; form.employeeId = data.employeeId;
form.loginName = data.loginName; form.loginName = data.loginName;
form.actualName = data.actualName; form.actualName = data.actualName;
form.email = data.email;
form.gender = data.gender; form.gender = data.gender;
form.phone = data.phone; form.phone = data.phone;
form.departmentId = data.departmentId; form.departmentId = data.departmentId;
form.disabledFlag = data.disabledFlag; form.email = data.email;
form.positionId = data.positionId;
form.remark = data.remark; form.remark = data.remark;
form.disabledFlag = data.disabledFlag;
// //
avatarUrl.value = data.avatar; avatarUrl.value = data.avatar;
} catch (e) { } catch (e) {
@ -187,7 +204,7 @@
async function updateEmployee() { async function updateEmployee() {
SmartLoading.show(); SmartLoading.show();
try { try {
await employeeApi.updateByLogin(form); await employeeApi.updateCenter(form);
message.success('更新成功'); message.success('更新成功');
// //
await getLoginInfo(); await getLoginInfo();

View File

@ -119,6 +119,7 @@
phone: undefined, phone: undefined,
roleIdList: undefined, roleIdList: undefined,
positionId: undefined, positionId: undefined,
email: undefined,
}; };
let form = reactive(_.cloneDeep(formDefault)); let form = reactive(_.cloneDeep(formDefault));

View File

@ -29,7 +29,7 @@
let props = defineProps({ let props = defineProps({
tree: { tree: {
type: Array, type: Array,
default: [], default: () => [],
}, },
}); });
defineEmits(['update:value']); defineEmits(['update:value']);

View File

@ -30,7 +30,7 @@
const props = defineProps({ const props = defineProps({
tree: { tree: {
type: Array, type: Array,
default: [], default: () => [],
}, },
index: { index: {
type: Number, type: Number,

View File

@ -21,7 +21,7 @@
const props = defineProps({ const props = defineProps({
tree: { tree: {
type: Array, type: Array,
default: [], default: () => [],
}, },
index: { index: {
type: Number, type: Number,

View File

@ -36,10 +36,10 @@ export const employeeApi = {
return postRequest('/employee/update', params); return postRequest('/employee/update', params);
}, },
/** /**
* *
*/ */
updateByLogin: (params) => { updateCenter: (params) => {
return postRequest('/employee/update/login', params); return postRequest('/employee/update/center', params);
}, },
/** /**
* *
@ -77,25 +77,22 @@ export const employeeApi = {
updateEmployeePassword: (param) => { updateEmployeePassword: (param) => {
return postEncryptRequest('/employee/update/password', param); return postEncryptRequest('/employee/update/password', param);
}, },
/** /**
* *
*/ */
getPasswordComplexityEnabled: () => { getPasswordComplexityEnabled: () => {
return getRequest('/employee/getPasswordComplexityEnabled'); return getRequest('/employee/getPasswordComplexityEnabled');
}, },
/** /**
* *
*/ */
updateDisabled: (employeeId) => { updateDisabled: (employeeId) => {
return getRequest(`/employee/update/disabled/${employeeId}`); return getRequest(`/employee/update/disabled/${employeeId}`);
}, },
/** /**
* -id * -id
*/ */
queryEmployeeByDeptId: (departmentId) => { queryEmployeeByDeptId: (departmentId) => {
return getRequest(`/employee/query/dept/${departmentId}`); return getRequest(`/employee/getAllEmployeeByDepartmentId/${departmentId}`);
}, },
}; };

View File

@ -9,7 +9,11 @@
* *
--> -->
<template> <template>
<a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" :options="optionList" @change="handleChange" /> <a-checkbox-group :style="`width: ${width}`" v-model:value="selectValue" @change="handleChange" :disabled="disabled">
<a-checkbox v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }}
</a-checkbox>
</a-checkbox-group>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -22,19 +26,32 @@
type: String, type: String,
default: '200px', default: '200px',
}, },
//
disabled: {
type: Boolean,
default: false,
},
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
}); });
// ------------ ------------ // ------------ ------------
const optionList = ref([]); const valueDescList = ref([]);
function buildOptionList() {
onMounted(() => {
const internalInstance = getCurrentInstance(); // const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin; const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
const valueList = smartEnumPlugin.getValueDescList(props.enumName); valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
optionList.value = valueList.map((e) => Object.assign({}, { value: e.value, label: e.desc })); });
}
onMounted(buildOptionList);
// ------------ ------------ // ------------ ------------
@ -43,11 +60,14 @@
watch( watch(
() => props.value, () => props.value,
(newValue) => { (newValue) => {
selectValue.value = newValue; //
} selectValue.value = newValue.filter((item) => !props.hiddenOption.includes(item) && !props.disabledOption.includes(item));
},
{ immediate: true }
); );
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
function handleChange(value) { function handleChange(value) {
emit('update:value', value); emit('update:value', value);
emit('change', value); emit('change', value);

View File

@ -10,15 +10,15 @@
--> -->
<template> <template>
<template v-if="isButton"> <template v-if="isButton">
<a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid"> <a-radio-group v-model:value="selectValue" @change="handleChange" button-style="solid" :disabled="disabled">
<a-radio-button v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value"> <a-radio-button v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }} {{ item.desc }}
</a-radio-button> </a-radio-button>
</a-radio-group> </a-radio-group>
</template> </template>
<template v-else> <template v-else>
<a-radio-group v-model:value="selectValue" @change="handleChange"> <a-radio-group v-model:value="selectValue" @change="handleChange" :disabled="disabled">
<a-radio v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value"> <a-radio v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }} {{ item.desc }}
</a-radio> </a-radio>
</a-radio-group> </a-radio-group>
@ -26,7 +26,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref, watch, onMounted, getCurrentInstance } from 'vue';
const props = defineProps({ const props = defineProps({
enumName: String, enumName: String,
@ -43,17 +43,42 @@
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
disabled: {
type: Boolean,
default: false,
},
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
});
const valueDescList = ref([]);
const selectValue = ref(props.value);
onMounted(() => {
const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
}); });
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
watch( watch(
() => props.value, () => props.value,
(newValue) => { (newValue) => {
selectValue.value = newValue; //
} selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
},
{ immediate: true }
); );
function handleChange(e) { function handleChange(e) {

View File

@ -19,18 +19,18 @@
@change="handleChange" @change="handleChange"
:disabled="disabled" :disabled="disabled"
> >
<a-select-option v-for="item in $smartEnumPlugin.getValueDescList(props.enumName)" :key="item.value" :value="item.value"> <a-select-option v-for="item in valueDescList" :key="item.value" :value="item.value" :disabled="disabledOption.includes(item.value)">
{{ item.desc }} {{ item.desc }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, watch } from 'vue'; import { ref, watch, onMounted, getCurrentInstance} from 'vue';
const props = defineProps({ const props = defineProps({
enumName: String, enumName: String,
value: [Number,String], value: [Number, String],
width: { width: {
type: String, type: String,
default: '100%', default: '100%',
@ -43,21 +43,42 @@
type: String, type: String,
default: 'default', default: 'default',
}, },
//
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
});
const valueDescList = ref([]);
const selectValue = ref(props.value);
onMounted(() => {
const internalInstance = getCurrentInstance(); //
const smartEnumPlugin = internalInstance.appContext.config.globalProperties.$smartEnumPlugin;
valueDescList.value = smartEnumPlugin.getValueDescList(props.enumName).filter((item) => !props.hiddenOption.includes(item.value));
}); });
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
const selectValue = ref(props.value);
watch( watch(
() => props.value, () => props.value,
(newValue) => { (newValue) => {
selectValue.value = newValue; //
} selectValue.value = props.disabledOption.includes(newValue) || props.hiddenOption.includes(newValue) ? undefined : newValue;
},
{ immediate: true }
); );
function handleChange(value) { function handleChange(value) {

View File

@ -18,6 +18,7 @@
:allowClear="true" :allowClear="true"
:size="size" :size="size"
@change="onChange" @change="onChange"
:disabled="disabled"
> >
<a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode"> <a-select-option v-for="item in dictKeyCodeList" :key="item.keyCode" :value="item.keyCode">
{{ item.keyName }} {{ item.keyName }}
@ -27,7 +28,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, ref, watch, defineExpose } from 'vue'; import { onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict-api'; import { dictApi } from '/@/api/support/dict-api';
defineExpose({ defineExpose({
@ -49,7 +50,7 @@
default: 'default', default: 'default',
}, },
// //
disabledFlag: { disabled: {
type: Number, type: Number,
default: null, default: null,
}, },

View File

@ -20,7 +20,7 @@
@change="onChange" @change="onChange"
:disabled="disabled" :disabled="disabled"
> >
<a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode"> <a-select-option v-for="item in dictValueList" :key="item.valueCode" :value="item.valueCode" :disabled="disabledOption.includes(item.valueCode)">
{{ item.valueName }} {{ item.valueName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
@ -28,7 +28,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { computed, onMounted, ref, watch } from 'vue'; import { onMounted, ref, watch } from 'vue';
import { dictApi } from '/@/api/support/dict-api'; import { dictApi } from '/@/api/support/dict-api';
const props = defineProps({ const props = defineProps({
@ -50,10 +50,21 @@
type: String, type: String,
default: 'default', default: 'default',
}, },
//
disabled: { disabled: {
type: Boolean, type: Boolean,
default: false, default: false,
}, },
//
disabledOption: {
type: Array,
default: () => [],
},
//
hiddenOption: {
type: Array,
default: () => [],
},
}); });
// -------------------------- -------------------------- // -------------------------- --------------------------
@ -61,7 +72,7 @@
const dictValueList = ref([]); const dictValueList = ref([]);
async function queryDict() { async function queryDict() {
let res = await dictApi.valueList(props.keyCode); let res = await dictApi.valueList(props.keyCode);
dictValueList.value = res.data; dictValueList.value = res.data.filter((item) => !props.hiddenOption.includes(item.valueCode));
} }
onMounted(queryDict); onMounted(queryDict);
@ -69,26 +80,24 @@
// -------------------------- -------------------------- // -------------------------- --------------------------
const selectValue = ref(props.value); const selectValue = ref(props.value);
watch( watch(
() => props.value, () => props.value,
(value) => { (newValue) => {
selectValue.value = value; //
if (Array.isArray(newValue)) {
selectValue.value = newValue.filter((item) => !props.disabledOption.includes(item) && !props.hiddenOption.includes(item));
} else {
selectValue.value = props.hiddenOption.includes(newValue) || props.disabledOption.includes(newValue) ? undefined : newValue;
} }
},
{ immediate: true }
); );
const emit = defineEmits(['update:value', 'change']); const emit = defineEmits(['update:value', 'change']);
function onChange(value) { function onChange(value) {
if (!value) {
emit('update:value', []);
emit('change', []);
return;
}
if (Array.isArray(value)) {
emit('update:value', value); emit('update:value', value);
emit('change', value); emit('change', value);
} else {
emit('update:value', value);
emit('change', value);
}
} }
</script> </script>

View File

@ -21,7 +21,7 @@ export function privilegeDirective(el: { parentNode: { removeChild: (arg0: any)
if (!userPointsList) { if (!userPointsList) {
return false; return false;
} }
// 如果有权限,删除节点 // 如果有权限,删除节点
if (!_.some(userPointsList, ['webPerms', binding.value])) { if (!_.some(userPointsList, ['webPerms', binding.value])) {
el.parentNode.removeChild(el); el.parentNode.removeChild(el);
} }

View File

@ -9,6 +9,7 @@
*/ */
import { useUserStore } from '/@/store/modules/system/user'; import { useUserStore } from '/@/store/modules/system/user';
import { App } from 'vue'; import { App } from 'vue';
import _ from 'lodash';
const privilege = (value: string) => { const privilege = (value: string) => {
// 超级管理员 // 超级管理员
@ -20,7 +21,7 @@ const privilege = (value: string) => {
if (!userPointsList) { if (!userPointsList) {
return false; return false;
} }
return userPointsList && userPointsList.includes(value); return _.some(userPointsList, ['apiPerms', value]);
}; };
export default { export default {

View File

@ -11,17 +11,17 @@
<a-card style="margin-bottom: 15px" size="small"> <a-card style="margin-bottom: 15px" size="small">
<a-descriptions :title="noticeDetail.title" :column="4" size="small"> <a-descriptions :title="noticeDetail.title" :column="4" size="small">
<template #extra> <template #extra>
<a-button v-if="!noticeDetail.publishFlag" type="primary" size="small" @click="onEdit">编辑</a-button> <a-button type="primary" size="small" @click="onEdit">编辑</a-button>
</template> </template>
<a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item> <a-descriptions-item label="分类">{{ noticeDetail.noticeTypeName }}</a-descriptions-item>
<a-descriptions-item label="文号">{{ noticeDetail.documentNumber }}</a-descriptions-item> <a-descriptions-item label="文号">{{ noticeDetail.documentNumber ? noticeDetail.documentNumber : '无' }}</a-descriptions-item>
<a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item> <a-descriptions-item label="来源">{{ noticeDetail.source }}</a-descriptions-item>
<a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item> <a-descriptions-item label="作者">{{ noticeDetail.author }}</a-descriptions-item>
<a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item> <a-descriptions-item label="页面浏览量">{{ noticeDetail.pageViewCount }}</a-descriptions-item>
<a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item> <a-descriptions-item label="用户浏览量">{{ noticeDetail.userViewCount }}</a-descriptions-item>
<a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item> <a-descriptions-item label="创建时间">{{ noticeDetail.createTime }}</a-descriptions-item>
<a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item> <a-descriptions-item label="发布时间">{{ noticeDetail.publishTime }}</a-descriptions-item>
<a-descriptions-item label="定时发布">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item> <a-descriptions-item label="发布状态">{{ noticeDetail.publishFlag ? '已发布' : '待发布' }}</a-descriptions-item>
<a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item> <a-descriptions-item label="删除状态">{{ noticeDetail.deletedFlag ? '已删除' : '未删除' }}</a-descriptions-item>
<a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件"> <a-descriptions-item v-if="!$lodash.isEmpty(noticeDetail.attachment)" label="附件">
<div class="file-list"> <div class="file-list">

View File

@ -35,7 +35,7 @@
</a-button-group> </a-button-group>
</a-form-item> </a-form-item>
</a-row> </a-row>
<a-row class="smart-query-form-row"> </a-row> <a-row class="smart-query-form-row" />
</a-form> </a-form>
<a-card size="small" :bordered="false"> <a-card size="small" :bordered="false">

View File

@ -28,7 +28,7 @@
</a-form-item> </a-form-item>
<a-form-item label="创建人" class="smart-query-form-item"> <a-form-item label="创建人" class="smart-query-form-item">
<a-input style="width: 100px" v-model:value="queryForm.createUserId" placeholder="创建人" /> <a-input style="width: 100px" v-model:value="queryForm.createUserName" placeholder="创建人" />
</a-form-item> </a-form-item>
<a-form-item label="是否删除" class="smart-query-form-item"> <a-form-item label="是否删除" class="smart-query-form-item">
@ -91,6 +91,9 @@
<template v-if="column.dataIndex === 'title'"> <template v-if="column.dataIndex === 'title'">
<a @click="toDetail(record.noticeId)">{{ text }}</a> <a @click="toDetail(record.noticeId)">{{ text }}</a>
</template> </template>
<template v-if="column.dataIndex === 'documentNumber'">
{{ text ? text : '无' }}
</template>
<template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template> <template v-else-if="column.dataIndex === 'allVisibleFlag'"> {{ text ? '全部可见' : '部分可见' }} </template>
<template v-else-if="column.dataIndex === 'publishFlag'"> <template v-else-if="column.dataIndex === 'publishFlag'">
{{ text ? '已发布' : '待发布' }} {{ text ? '已发布' : '待发布' }}
@ -145,7 +148,7 @@
noticeTypeId: undefined, // noticeTypeId: undefined, //
keywords: '', // keywords: '', //
documentNumber: '', // documentNumber: '', //
createUserId: undefined, // createUserName: undefined, //
deletedFlag: undefined, // deletedFlag: undefined, //
createTimeBegin: null, //- createTimeBegin: null, //-
createTimeEnd: null, //- createTimeEnd: null, //-
@ -195,7 +198,7 @@
ellipsis: true, ellipsis: true,
}, },
{ {
title: '发布', title: '发布状态',
dataIndex: 'publishFlag', dataIndex: 'publishFlag',
width: 80, width: 80,
}, },

View File

@ -140,8 +140,6 @@
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane> <a-tab-pane key="2" tab="已删除任务"><DeletedJobList /></a-tab-pane>
</a-tabs> </a-tabs>
</a-card> </a-card>
<!-- 表单操作 --> <!-- 表单操作 -->
@ -152,7 +150,7 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {message, Modal} from 'ant-design-vue'; import { message, Modal } from 'ant-design-vue';
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { jobApi } from '/@/api/support/job-api'; import { jobApi } from '/@/api/support/job-api';
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const'; import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
@ -163,7 +161,7 @@
import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js'; import { TRIGGER_TYPE_ENUM } from '/@/constants/support/job-const.js';
import JobFormModal from './components/job-form-modal.vue'; import JobFormModal from './components/job-form-modal.vue';
import JobLogListModal from './components/job-log-list-modal.vue'; import JobLogListModal from './components/job-log-list-modal.vue';
import {SmartLoading} from "/@/components/framework/smart-loading/index.js"; import { SmartLoading } from "/@/components/framework/smart-loading/index.js";
const columns = ref([ const columns = ref([
{ {
@ -241,6 +239,8 @@
}, },
]); ]);
const activeKey = ref('1');
// ---------------- ----------------------- // ---------------- -----------------------
const queryFormState = { const queryFormState = {

View File

@ -11,6 +11,9 @@
<a-form-item label="登录账号" name="loginName"> <a-form-item label="登录账号" name="loginName">
<a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled /> <a-input class="form-item" v-model:value.trim="form.loginName" placeholder="请输入登录账号" disabled />
</a-form-item> </a-form-item>
<a-form-item label="部门" name="departmentId">
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" disabled />
</a-form-item>
<a-form-item label="员工名称" name="actualName"> <a-form-item label="员工名称" name="actualName">
<a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" /> <a-input class="form-item" v-model:value.trim="form.actualName" placeholder="请输入员工名称" />
</a-form-item> </a-form-item>
@ -20,8 +23,11 @@
<a-form-item label="手机号码" name="phone"> <a-form-item label="手机号码" name="phone">
<a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" /> <a-input class="form-item" v-model:value.trim="form.phone" placeholder="请输入手机号码" />
</a-form-item> </a-form-item>
<a-form-item label="部门" name="departmentId"> <a-form-item label="邮箱" name="email">
<DepartmentTreeSelect class="form-item" ref="departmentTreeSelect" width="100%" :init="false" v-model:value="form.departmentId" /> <a-input v-model:value.trim="form.email" placeholder="请输入邮箱" />
</a-form-item>
<a-form-item label="职务" name="positionId">
<PositionSelect v-model:value="form.positionId" placeholder="请选择职务" />
</a-form-item> </a-form-item>
<a-form-item label="备注" name="remark"> <a-form-item label="备注" name="remark">
<a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" /> <a-textarea class="form-item" v-model:value="form.remark" placeholder="请输入备注" :rows="4" />
@ -65,6 +71,7 @@
import { onMounted, reactive, ref } from 'vue'; import { onMounted, reactive, ref } from 'vue';
import { regular } from '/@/constants/regular-const.js'; import { regular } from '/@/constants/regular-const.js';
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue'; import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
import PositionSelect from '/@/components/system/position-select/index.vue';
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue'; import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
import { loginApi } from '/@/api/system/login-api.js'; import { loginApi } from '/@/api/system/login-api.js';
import { useUserStore } from '/@/store/modules/system/user.js'; import { useUserStore } from '/@/store/modules/system/user.js';
@ -93,10 +100,12 @@
phone: '', phone: '',
// id // id
departmentId: undefined, departmentId: undefined,
//
disabledFlag: undefined,
// //
email: undefined, email: undefined,
//
positionId: undefined,
//
disabledFlag: undefined,
// //
remark: '', remark: '',
}; };
@ -111,7 +120,7 @@
{ pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' }, { pattern: regular.phone, message: '请输入正确的手机号码', trigger: 'blur' },
], ],
gender: [{ required: true, message: '性别不能为空' }], gender: [{ required: true, message: '性别不能为空' }],
departmentId: [{ required: true, message: '部门不能为空' }], email: [{ required: true, message: '请输入邮箱' }],
}; };
// //
let avatarUrl = ref(); let avatarUrl = ref();
@ -128,12 +137,13 @@
form.employeeId = data.employeeId; form.employeeId = data.employeeId;
form.loginName = data.loginName; form.loginName = data.loginName;
form.actualName = data.actualName; form.actualName = data.actualName;
form.email = data.email;
form.gender = data.gender; form.gender = data.gender;
form.phone = data.phone; form.phone = data.phone;
form.departmentId = data.departmentId; form.departmentId = data.departmentId;
form.disabledFlag = data.disabledFlag; form.email = data.email;
form.positionId = data.positionId;
form.remark = data.remark; form.remark = data.remark;
form.disabledFlag = data.disabledFlag;
// //
avatarUrl.value = data.avatar; avatarUrl.value = data.avatar;
} catch (e) { } catch (e) {
@ -187,7 +197,7 @@
async function updateEmployee() { async function updateEmployee() {
SmartLoading.show(); SmartLoading.show();
try { try {
await employeeApi.updateByLogin(form); await employeeApi.updateCenter(form);
message.success('更新成功'); message.success('更新成功');
// //
await getLoginInfo(); await getLoginInfo();

View File

@ -119,6 +119,7 @@
phone: undefined, phone: undefined,
roleIdList: undefined, roleIdList: undefined,
positionId: undefined, positionId: undefined,
email: undefined,
}; };
let form = reactive(_.cloneDeep(formDefault)); let form = reactive(_.cloneDeep(formDefault));

View File

@ -29,7 +29,7 @@
let props = defineProps({ let props = defineProps({
tree: { tree: {
type: Array, type: Array,
default: [], default: () => [],
}, },
}); });
defineEmits(['update:value']); defineEmits(['update:value']);

View File

@ -30,7 +30,7 @@
const props = defineProps({ const props = defineProps({
tree: { tree: {
type: Array, type: Array,
default: [], default: () => [],
}, },
index: { index: {
type: Number, type: Number,

View File

@ -21,7 +21,7 @@
const props = defineProps({ const props = defineProps({
tree: { tree: {
type: Array, type: Array,
default: [], default: () => [],
}, },
index: { index: {
type: Number, type: Number,

View File

@ -243,7 +243,7 @@ CREATE TABLE `t_employee` (
`avatar` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, `avatar` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`gender` tinyint(1) NOT NULL DEFAULT 0 COMMENT '性别', `gender` tinyint(1) NOT NULL DEFAULT 0 COMMENT '性别',
`phone` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码', `phone` varchar(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '手机号码',
`department_id` int(0) NOT NULL COMMENT '部门id', `department_id` bigint(0) NOT NULL COMMENT '部门id',
`position_id` bigint(0) NULL DEFAULT NULL COMMENT '职务ID', `position_id` bigint(0) NULL DEFAULT NULL COMMENT '职务ID',
`email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮箱', `email` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '邮箱',
`disabled_flag` tinyint unsigned NOT NULL COMMENT '是否被禁用 0否1是', `disabled_flag` tinyint unsigned NOT NULL COMMENT '是否被禁用 0否1是',
@ -300,7 +300,7 @@ CREATE TABLE `t_file` (
`file_size` int(0) NULL DEFAULT NULL COMMENT '文件大小', `file_size` int(0) NULL DEFAULT NULL COMMENT '文件大小',
`file_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件key用于文件下载', `file_key` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件key用于文件下载',
`file_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件类型', `file_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '文件类型',
`creator_id` int(0) NULL DEFAULT NULL COMMENT '创建人,即上传人', `creator_id` bigint(0) NULL DEFAULT NULL COMMENT '创建人,即上传人',
`creator_user_type` int(0) NULL DEFAULT NULL COMMENT '创建人用户类型', `creator_user_type` int(0) NULL DEFAULT NULL COMMENT '创建人用户类型',
`creator_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人姓名', `creator_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人姓名',
`update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次更新时间', `update_time` datetime(0) NULL DEFAULT CURRENT_TIMESTAMP COMMENT '上次更新时间',
@ -465,7 +465,7 @@ CREATE TABLE `t_login_fail` (
DROP TABLE IF EXISTS `t_login_log`; DROP TABLE IF EXISTS `t_login_log`;
CREATE TABLE `t_login_log` ( CREATE TABLE `t_login_log` (
`login_log_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键', `login_log_id` bigint(0) NOT NULL AUTO_INCREMENT COMMENT '主键',
`user_id` int(0) NOT NULL COMMENT '用户id', `user_id` bigint(0) NOT NULL COMMENT '用户id',
`user_type` int(0) NOT NULL COMMENT '用户类型', `user_type` int(0) NOT NULL COMMENT '用户类型',
`user_name` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名', `user_name` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名',
`login_ip` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户ip', `login_ip` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '用户ip',
@ -1016,8 +1016,8 @@ INSERT INTO `t_role` VALUES (37, '财务', NULL, '', '2019-08-30 09:31:16', '201
DROP TABLE IF EXISTS `t_role_data_scope`; DROP TABLE IF EXISTS `t_role_data_scope`;
CREATE TABLE `t_role_data_scope` ( CREATE TABLE `t_role_data_scope` (
`id` bigint(0) NOT NULL AUTO_INCREMENT, `id` bigint(0) NOT NULL AUTO_INCREMENT,
`data_scope_type` int(0) NOT NULL COMMENT '数据范围id', `data_scope_type` int(0) NOT NULL COMMENT '数据范围类型',
`view_type` int(0) NOT NULL COMMENT '数据范围类型', `view_type` int(0) NOT NULL COMMENT '数据可见范围类型',
`role_id` bigint(0) NOT NULL COMMENT '角色id', `role_id` bigint(0) NOT NULL COMMENT '角色id',
`update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间', `update_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间',
`create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_time` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',