解决 非 web 上下文无法获取 HttpServletRequest 问题

This commit is contained in:
cjw 2024-04-22 15:17:05 +08:00
parent 747f6eea2a
commit 771239b6da
5 changed files with 9 additions and 5 deletions

View File

@ -81,8 +81,8 @@ public class SysEvaluationRecordServiceImpl implements ISysEvaluationRecordServi
Long batchNo = bo.getBatchNo();
List<String> scaleIds = bo.getScaleIds();
//判断人数
boolean flag = deptService.isParent(deptId);
List<SysUser> sysUsers = userMapper.selectStudentListByDeptId(deptId, flag);
boolean parent = deptService.isParent(deptId);
List<SysUser> sysUsers = userMapper.selectStudentListByDeptId(deptId, parent);
List<SysEvaluationRecord> recordList = new ArrayList<>();
for (String scaleId : scaleIds) {
for (SysUser user : sysUsers) {

View File

@ -237,7 +237,6 @@ public class WebServiceImpl implements IWebService {
List<String> questionNum = questionMapByFactor.get(factorId.toString());
List<String> questionIds = new ArrayList<>();
questionNum.forEach(q -> {
questionIds.add(q);
Long questionId = Long.parseLong(q);

View File

@ -45,4 +45,6 @@ public interface SysDeptMapper extends BaseMapperPlus<SysDept, SysDeptVo> {
*/
List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);
String selectAncestorsById(Long deptId);
}

View File

@ -328,8 +328,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
@Override
public boolean isParent(Long deptId) {
SysDeptVo dept = baseMapper.selectDeptById(deptId);
List<String> split = StrUtil.split(dept.getAncestors(), StringUtils.SEPARATOR);
String ancestors = baseMapper.selectAncestorsById(deptId);
List<String> split = StrUtil.split(ancestors, StringUtils.SEPARATOR);
if (split.size() <= 2) {
return true;
} else {

View File

@ -26,4 +26,7 @@
order by d.parent_id, d.order_num
</select>
<select id="selectAncestorsById" resultType="java.lang.String">
select ancestors from sys_dept where dept_id = #{deptId}
</select>
</mapper>