发布优化,数据权限优化
This commit is contained in:
parent
d7b9a677d6
commit
877307a77e
|
@ -77,7 +77,7 @@ spring:
|
||||||
# 单个文件大小
|
# 单个文件大小
|
||||||
max-file-size: 10MB
|
max-file-size: 10MB
|
||||||
# 设置总上传的文件大小
|
# 设置总上传的文件大小
|
||||||
max-request-size: 20MB
|
max-request-size: 50MB
|
||||||
mvc:
|
mvc:
|
||||||
# 设置静态资源路径 防止所有请求都去查静态资源
|
# 设置静态资源路径 防止所有请求都去查静态资源
|
||||||
static-path-pattern: /static/**
|
static-path-pattern: /static/**
|
||||||
|
|
|
@ -37,10 +37,7 @@ import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||||
import org.springframework.util.ClassUtils;
|
import org.springframework.util.ClassUtils;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
@ -133,7 +130,9 @@ public class PlusDataPermissionHandler {
|
||||||
context.setBeanResolver(beanResolver);
|
context.setBeanResolver(beanResolver);
|
||||||
DataPermissionHelper.getContext().forEach(context::setVariable);
|
DataPermissionHelper.getContext().forEach(context::setVariable);
|
||||||
Set<String> conditions = new HashSet<>();
|
Set<String> conditions = new HashSet<>();
|
||||||
for (RoleDTO role : user.getRoles()) {
|
List<RoleDTO> roles = user.getRoles();
|
||||||
|
if (roles != null && !roles.isEmpty()) {
|
||||||
|
for (RoleDTO role : roles) {
|
||||||
user.setRoleId(role.getRoleId());
|
user.setRoleId(role.getRoleId());
|
||||||
// 获取角色权限泛型
|
// 获取角色权限泛型
|
||||||
DataScopeType type = DataScopeType.findCode(role.getDataScope());
|
DataScopeType type = DataScopeType.findCode(role.getDataScope());
|
||||||
|
@ -170,7 +169,7 @@ public class PlusDataPermissionHandler {
|
||||||
conditions.add(joinStr + type.getElseSql());
|
conditions.add(joinStr + type.getElseSql());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (CollUtil.isNotEmpty(conditions)) {
|
if (CollUtil.isNotEmpty(conditions)) {
|
||||||
String sql = StreamUtils.join(conditions, Function.identity(), "");
|
String sql = StreamUtils.join(conditions, Function.identity(), "");
|
||||||
return sql.substring(joinStr.length());
|
return sql.substring(joinStr.length());
|
||||||
|
|
|
@ -126,4 +126,6 @@ public class CounselorVo implements Serializable {
|
||||||
*/
|
*/
|
||||||
private Integer reservationNum;
|
private Integer reservationNum;
|
||||||
|
|
||||||
|
private List<String> qualificationUrlList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,10 @@ import java.util.List;
|
||||||
public class EvaluationRecordWordData {
|
public class EvaluationRecordWordData {
|
||||||
|
|
||||||
private String createTime;
|
private String createTime;
|
||||||
private String schoolName;
|
// private String schoolName;
|
||||||
private String useTime;
|
private String useTime;
|
||||||
private String nickName;
|
private String nickName;
|
||||||
private String deptName;
|
// private String deptName;
|
||||||
private String sex;
|
private String sex;
|
||||||
private String scaleName;
|
private String scaleName;
|
||||||
private String scaleDetails;
|
private String scaleDetails;
|
||||||
|
|
|
@ -17,21 +17,24 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.system.domain.Counselor;
|
import org.dromara.system.domain.Counselor;
|
||||||
import org.dromara.system.domain.CounselorExperience;
|
import org.dromara.system.domain.CounselorExperience;
|
||||||
|
import org.dromara.system.domain.CounselorQualification;
|
||||||
import org.dromara.system.domain.bo.CounselorBo;
|
import org.dromara.system.domain.bo.CounselorBo;
|
||||||
import org.dromara.system.domain.bo.QueryCounselorBo;
|
import org.dromara.system.domain.bo.QueryCounselorBo;
|
||||||
|
import org.dromara.system.domain.bo.SysUserBo;
|
||||||
import org.dromara.system.domain.vo.CounselorVo;
|
import org.dromara.system.domain.vo.CounselorVo;
|
||||||
import org.dromara.system.domain.vo.ScoreRateVo;
|
import org.dromara.system.domain.vo.ScoreRateVo;
|
||||||
|
import org.dromara.system.domain.vo.SysUserVo;
|
||||||
import org.dromara.system.mapper.CounselorExperienceMapper;
|
import org.dromara.system.mapper.CounselorExperienceMapper;
|
||||||
import org.dromara.system.mapper.CounselorMapper;
|
import org.dromara.system.mapper.CounselorMapper;
|
||||||
|
import org.dromara.system.mapper.CounselorQualificationMapper;
|
||||||
import org.dromara.system.mapper.ScoreRecordMapper;
|
import org.dromara.system.mapper.ScoreRecordMapper;
|
||||||
import org.dromara.system.service.ICounselorService;
|
import org.dromara.system.service.ICounselorService;
|
||||||
import org.dromara.system.domain.bo.SysUserBo;
|
|
||||||
import org.dromara.system.domain.vo.SysUserVo;
|
|
||||||
import org.dromara.system.service.ISysUserService;
|
import org.dromara.system.service.ISysUserService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -48,6 +51,7 @@ public class CounselorServiceImpl implements ICounselorService {
|
||||||
|
|
||||||
private final CounselorMapper baseMapper;
|
private final CounselorMapper baseMapper;
|
||||||
private final CounselorExperienceMapper experienceMapper;
|
private final CounselorExperienceMapper experienceMapper;
|
||||||
|
private final CounselorQualificationMapper qualificationMapper;
|
||||||
private final ScoreRecordMapper scoreRecordMapper;
|
private final ScoreRecordMapper scoreRecordMapper;
|
||||||
|
|
||||||
private final DictService dictService;
|
private final DictService dictService;
|
||||||
|
@ -72,7 +76,14 @@ public class CounselorServiceImpl implements ICounselorService {
|
||||||
Long l = experienceMapper.selectCount(new LambdaQueryWrapper<CounselorExperience>()
|
Long l = experienceMapper.selectCount(new LambdaQueryWrapper<CounselorExperience>()
|
||||||
.eq(CounselorExperience::getCounselorId, id));
|
.eq(CounselorExperience::getCounselorId, id));
|
||||||
counselorVo.setExperienceNum(l.intValue());
|
counselorVo.setExperienceNum(l.intValue());
|
||||||
|
List<CounselorQualification> qualificationList = qualificationMapper.selectList(new LambdaQueryWrapper<CounselorQualification>()
|
||||||
|
.eq(CounselorQualification::getCounselorId, id));
|
||||||
|
List<String> imageList = new ArrayList<>(qualificationList.size());
|
||||||
|
for (CounselorQualification qualification : qualificationList) {
|
||||||
|
String s = ossService.selectUrlByIds(qualification.getCertificateImage().toString());
|
||||||
|
imageList.add(s);
|
||||||
|
}
|
||||||
|
counselorVo.setQualificationUrlList(imageList);
|
||||||
Date practiceTime = counselorVo.getPracticeTime();
|
Date practiceTime = counselorVo.getPracticeTime();
|
||||||
String betweenYear = DateUtils.getBetweenYear(practiceTime, new Date());
|
String betweenYear = DateUtils.getBetweenYear(practiceTime, new Date());
|
||||||
counselorVo.setPracticeString(betweenYear);
|
counselorVo.setPracticeString(betweenYear);
|
||||||
|
|
|
@ -15,10 +15,8 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||||
import org.dromara.common.core.constant.TenantConstants;
|
import org.dromara.common.core.constant.TenantConstants;
|
||||||
import org.dromara.common.core.service.DeptService;
|
|
||||||
import org.dromara.common.core.service.OssService;
|
import org.dromara.common.core.service.OssService;
|
||||||
import org.dromara.common.core.utils.DateUtils;
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
@ -40,7 +38,6 @@ import org.dromara.system.mapper.SysEvaluationRecordMapper;
|
||||||
import org.dromara.system.mapper.SysScaleMapper;
|
import org.dromara.system.mapper.SysScaleMapper;
|
||||||
import org.dromara.system.mapper.SysUserMapper;
|
import org.dromara.system.mapper.SysUserMapper;
|
||||||
import org.dromara.system.service.IMyService;
|
import org.dromara.system.service.IMyService;
|
||||||
import org.dromara.system.service.ISysConfigService;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -69,9 +66,9 @@ public class MyServiceImpl implements IMyService {
|
||||||
private final ReservationOrderMapper reservationOrderMapper;
|
private final ReservationOrderMapper reservationOrderMapper;
|
||||||
private final SysUserMapper userMapper;
|
private final SysUserMapper userMapper;
|
||||||
|
|
||||||
private final DeptService deptService;
|
//private final DeptService deptService;
|
||||||
private final OssService ossService;
|
private final OssService ossService;
|
||||||
private final ISysConfigService configService;
|
//private final ISysConfigService configService;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -194,13 +191,13 @@ public class MyServiceImpl implements IMyService {
|
||||||
}
|
}
|
||||||
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
||||||
|
|
||||||
String name = TenantHelper.dynamic(TenantConstants.DEFAULT_TENANT_ID, () -> configService.selectConfigByKey("sys.school.name"));
|
// String name = TenantHelper.dynamic(TenantConstants.DEFAULT_TENANT_ID, () -> configService.selectConfigByKey("sys.school.name"));
|
||||||
if (StringUtils.isEmpty(name)) {
|
// if (StringUtils.isEmpty(name)) {
|
||||||
wordData.setSchoolName(name);
|
// wordData.setSchoolName(name);
|
||||||
} else {
|
// } else {
|
||||||
wordData.setSchoolName("无");
|
// wordData.setSchoolName("无");
|
||||||
}
|
// }
|
||||||
|
// wordData.setSchoolName("云舒心理健康成长平台");
|
||||||
SysEvaluationRecord sysEvaluationRecord = TenantHelper.dynamic(TenantConstants.DEFAULT_TENANT_ID, () -> evaluationRecordMapper.selectById(recordId));
|
SysEvaluationRecord sysEvaluationRecord = TenantHelper.dynamic(TenantConstants.DEFAULT_TENANT_ID, () -> evaluationRecordMapper.selectById(recordId));
|
||||||
Date createTime = sysEvaluationRecord.getCreateTime();
|
Date createTime = sysEvaluationRecord.getCreateTime();
|
||||||
Date updateTime = sysEvaluationRecord.getUpdateTime();
|
Date updateTime = sysEvaluationRecord.getUpdateTime();
|
||||||
|
@ -209,12 +206,12 @@ public class MyServiceImpl implements IMyService {
|
||||||
|
|
||||||
SysUserVo user = userMapper.selectVoById(userId);
|
SysUserVo user = userMapper.selectVoById(userId);
|
||||||
wordData.setNickName(user.getNickName());
|
wordData.setNickName(user.getNickName());
|
||||||
if (user.getDeptId() != null) {
|
// if (user.getDeptId() != null) {
|
||||||
String s = deptService.selectDeptNameByIds(Long.toString(user.getDeptId()));
|
// String s = deptService.selectDeptNameByIds(Long.toString(user.getDeptId()));
|
||||||
wordData.setDeptName(s);
|
// wordData.setDeptName(s);
|
||||||
} else {
|
// } else {
|
||||||
wordData.setDeptName("无");
|
// wordData.setDeptName("无");
|
||||||
}
|
// }
|
||||||
wordData.setSex("0".equals(user.getSex()) ? "男" : "女");
|
wordData.setSex("0".equals(user.getSex()) ? "男" : "女");
|
||||||
|
|
||||||
SysScaleVo scale = TenantHelper.dynamic(TenantConstants.DEFAULT_TENANT_ID, () -> scaleMapper.selectVoById(scaleId));
|
SysScaleVo scale = TenantHelper.dynamic(TenantConstants.DEFAULT_TENANT_ID, () -> scaleMapper.selectVoById(scaleId));
|
||||||
|
|
|
@ -14,7 +14,6 @@ import lombok.RequiredArgsConstructor;
|
||||||
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
import org.apache.poi.xwpf.usermodel.XWPFTable;
|
||||||
import org.dromara.common.core.service.DeptService;
|
import org.dromara.common.core.service.DeptService;
|
||||||
import org.dromara.common.core.utils.DateUtils;
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.system.domain.SysEvaluationRecord;
|
import org.dromara.system.domain.SysEvaluationRecord;
|
||||||
|
@ -127,12 +126,12 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
||||||
}
|
}
|
||||||
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
EvaluationRecordWordData wordData = new EvaluationRecordWordData();
|
||||||
|
|
||||||
String name = configService.selectConfigByKey("sys.school.name");
|
// String name = configService.selectConfigByKey("sys.school.name");
|
||||||
if (StringUtils.isEmpty(name)) {
|
// if (StringUtils.isEmpty(name)) {
|
||||||
wordData.setSchoolName(name);
|
// wordData.setSchoolName(name);
|
||||||
} else {
|
// } else {
|
||||||
wordData.setSchoolName("无");
|
// wordData.setSchoolName("无");
|
||||||
}
|
// }
|
||||||
|
|
||||||
SysEvaluationRecord sysEvaluationRecord = baseMapper.selectById(recordId);
|
SysEvaluationRecord sysEvaluationRecord = baseMapper.selectById(recordId);
|
||||||
Date createTime = sysEvaluationRecord.getCreateTime();
|
Date createTime = sysEvaluationRecord.getCreateTime();
|
||||||
|
@ -142,12 +141,12 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
|
||||||
|
|
||||||
SysUserVo user = userMapper.selectVoById(userId);
|
SysUserVo user = userMapper.selectVoById(userId);
|
||||||
wordData.setNickName(user.getNickName());
|
wordData.setNickName(user.getNickName());
|
||||||
if (user.getDeptId() != null) {
|
// if (user.getDeptId() != null) {
|
||||||
String s = deptService.selectDeptNameByIds(Long.toString(user.getDeptId()));
|
// String s = deptService.selectDeptNameByIds(Long.toString(user.getDeptId()));
|
||||||
wordData.setDeptName(s);
|
// wordData.setDeptName(s);
|
||||||
} else {
|
// } else {
|
||||||
wordData.setDeptName("无");
|
// wordData.setDeptName("无");
|
||||||
}
|
// }
|
||||||
wordData.setSex("0".equals(user.getSex()) ? "男" : "女");
|
wordData.setSex("0".equals(user.getSex()) ? "男" : "女");
|
||||||
|
|
||||||
SysScaleVo scale = scaleMapper.selectVoById(scaleId);
|
SysScaleVo scale = scaleMapper.selectVoById(scaleId);
|
||||||
|
|
|
@ -206,6 +206,7 @@ public class SysScalePublishServiceImpl implements ISysScalePublishService {
|
||||||
record.setDeptId(user.getDeptId());
|
record.setDeptId(user.getDeptId());
|
||||||
record.setBatchNo(batchNo);
|
record.setBatchNo(batchNo);
|
||||||
record.setScaleId(Long.parseLong(scaleId));
|
record.setScaleId(Long.parseLong(scaleId));
|
||||||
|
record.setPublishFlag(1);
|
||||||
//初始化字段
|
//初始化字段
|
||||||
record.setStatus(0);
|
record.setStatus(0);
|
||||||
recordList.add(record);
|
recordList.add(record);
|
||||||
|
|
|
@ -73,7 +73,7 @@
|
||||||
select u.*
|
select u.*
|
||||||
from sys_dept d
|
from sys_dept d
|
||||||
left join sys_user u on u.dept_id = d.dept_id
|
left join sys_user u on u.dept_id = d.dept_id
|
||||||
where u.user_type = 'student'
|
where u.user_type = 'app_user'
|
||||||
and u.del_flag = 0
|
and u.del_flag = 0
|
||||||
and find_in_set(d.dept_id, #{deptIds})
|
and find_in_set(d.dept_id, #{deptIds})
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue