fix:修改机构表的获取字段,统一从name修改为分部门级别的namePath字段

This commit is contained in:
miaowenbo
2025-11-27 16:11:11 +08:00
parent d9cbc9a24d
commit 8b9fb576c8
2 changed files with 19 additions and 8 deletions

View File

@@ -28,6 +28,7 @@ import com.xboe.school.study.dto.*;
import com.xboe.school.study.entity.*;
import com.xboe.school.study.service.*;
import com.xboe.school.vo.StudyTimeVo;
import com.xboe.system.organization.entity.Organization;
import com.xboe.system.organization.service.IOrganizationService;
import com.xboe.system.user.entity.User;
import com.xboe.system.user.service.IUserService;
@@ -200,7 +201,9 @@ public class StudyCourseApi extends ApiBaseController{
? userInfo.getUserNo()
: "");
// 3. 填部门通过departId查部门名称
String departName = organizationService.getName(userInfo.getDepartId());
// 获取部门信息参考现有机构表获取namePath字段
Organization organization = organizationService.get(userInfo.getDepartId());
String departName = organization != null ? organization.getNamePath() : "";
resultVo.setOrgInfo(StringUtils.isNotBlank(departName)
? departName
: "");
@@ -418,7 +421,10 @@ public class StudyCourseApi extends ApiBaseController{
if (Objects.equals(userId, studyCourse1.getAid())) {
log.info("【导出课程学习记录】查询boe人员表机构id{}", userInfo.getDepartId());
// 和技术沟通后确认这里机构名称是redis获取的获取不到返回null因此正常遍历没有效率和空值问题
studyCourse1.setOrgInfo(organizationService.getName(userInfo.getDepartId()));
// 获取部门信息参考现有机构表获取namePath字段
Organization organization = organizationService.get(userInfo.getDepartId());
String departName = organization != null ? organization.getNamePath() : "";
studyCourse1.setOrgInfo(departName);
// 取userNo为工号
studyCourse1.setUserNo(userInfo.getUserNo());
}
@@ -1331,8 +1337,9 @@ public class StudyCourseApi extends ApiBaseController{
UserSimpleVo userSimpleVo = new UserSimpleVo();
userSimpleVo.setAid(userInfo.getId());
userSimpleVo.setCode(userInfo.getUserNo());
// 获取部门信息
String departName = organizationService.getName(userInfo.getDepartId());
// 获取部门信息参考现有机构表获取namePath字段
Organization organization = organizationService.get(userInfo.getDepartId());
String departName = organization != null ? organization.getNamePath() : "";
userSimpleVo.setOrgInfo(StringUtils.isNotBlank(departName) ? departName : "");
userList.add(userSimpleVo);
log.info("【资源学习情况导出-考试信息】查询boe人员表用户id{}", userId);
@@ -1468,8 +1475,9 @@ public class StudyCourseApi extends ApiBaseController{
UserSimpleVo userSimpleVo = new UserSimpleVo();
userSimpleVo.setAid(userInfo.getId());
userSimpleVo.setCode(userInfo.getUserNo());
// 获取部门信息
String departName = organizationService.getName(userInfo.getDepartId());
// 获取部门信息参考现有机构表获取namePath字段
Organization organization = organizationService.get(userInfo.getDepartId());
String departName = organization != null ? organization.getNamePath() : "";
userSimpleVo.setOrgInfo(StringUtils.isNotBlank(departName) ? departName : "");
userList.add(userSimpleVo);
log.info("【资源学习情况导出-作业信息】查询boe人员表用户id{}", userId);

View File

@@ -16,6 +16,7 @@ import com.xboe.school.study.entity.StudyCourseItem;
import com.xboe.school.study.entity.StudySignup;
import com.xboe.school.study.service.IStudyCourseService;
import com.xboe.school.study.service.IStudySignupService;
import com.xboe.system.organization.entity.Organization;
import com.xboe.system.organization.service.IOrganizationService;
import com.xboe.system.user.entity.User;
import com.xboe.system.user.service.IUserService;
@@ -216,8 +217,10 @@ public class StudyCourseServiceImpl implements IStudyCourseService{
for (StudyCourse studyCourse1 : studyCourses) {
if (Objects.equals(userId, studyCourse1.getAid())) {
log.info("【分页查询课程学习记录】查询boe人员表机构id{}", userInfo.getDepartId());
// 和技术沟通后确认这里机构名称是redis获取的获取不到返回null因此正常遍历没有效率和空值问题
studyCourse1.setOrgInfo(organizationService.getName(userInfo.getDepartId()));
// 获取部门信息参考现有机构表获取namePath字段
Organization organization = organizationService.get(userInfo.getDepartId());
String departName = organization != null ? organization.getNamePath() : "";
studyCourse1.setOrgInfo(departName);
// 取userNo为工号
studyCourse1.setUserNo(userInfo.getUserNo());
}