瀏覽代碼

bug修改

xiaof 4 年之前
父節點
當前提交
43957267da

+ 7 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/CommonService.java

@@ -155,4 +155,11 @@ public interface CommonService {
      * @param paperNumber
      * @param paperNumber
      */
      */
     public void checkData(Long schoolId, String courseCode, String paperNumber) throws IOException;
     public void checkData(Long schoolId, String courseCode, String paperNumber) throws IOException;
+
+    /**
+     * 根据orgId查询所有子机构ID集合
+     * @param orgId
+     * @return
+     */
+    public List<Long> listSubOrgIds(Long orgId);
 }
 }

+ 12 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/CommonServiceImpl.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.qmth.boot.core.enums.Platform;
 import com.qmth.boot.core.enums.Platform;
 import com.qmth.distributed.print.business.bean.auth.AuthBean;
 import com.qmth.distributed.print.business.bean.auth.AuthBean;
+import com.qmth.distributed.print.business.bean.dto.OrgDto;
 import com.qmth.distributed.print.business.bean.dto.PrivilegeCacheDto;
 import com.qmth.distributed.print.business.bean.dto.PrivilegeCacheDto;
 import com.qmth.distributed.print.business.bean.result.PrivilegeResult;
 import com.qmth.distributed.print.business.bean.result.PrivilegeResult;
 import com.qmth.distributed.print.business.bean.result.RolePrivilegeResult;
 import com.qmth.distributed.print.business.bean.result.RolePrivilegeResult;
@@ -89,6 +90,9 @@ public class CommonServiceImpl implements CommonService {
     @Resource
     @Resource
     AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
     AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
 
 
+    @Autowired
+    private SysOrgService sysOrgService;
+
     /**
     /**
      * 新增用户权限
      * 新增用户权限
      *
      *
@@ -162,7 +166,7 @@ public class CommonServiceImpl implements CommonService {
                 List<SysRole> sysRoleList = sysRoleService.list(sysRoleQueryWrapper);
                 List<SysRole> sysRoleList = sysRoleService.list(sysRoleQueryWrapper);
                 long count = 0;
                 long count = 0;
                 if (Objects.nonNull(sysRoleList) && sysRoleList.size() > 0) {
                 if (Objects.nonNull(sysRoleList) && sysRoleList.size() > 0) {
-                    count = sysRoleList.stream().filter(s -> s.getType() == RoleTypeEnum.ADMIN || s.getType() == RoleTypeEnum.CUSTOMER).count();
+                    count = sysRoleList.stream().filter(s -> s.getType() == RoleTypeEnum.ADMIN).count();
                 }
                 }
                 QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
                 QueryWrapper<SysPrivilege> sysPrivilegeQueryWrapper = new QueryWrapper<>();
                 if (count > 0) {//超级系统管理员
                 if (count > 0) {//超级系统管理员
@@ -171,7 +175,7 @@ public class CommonServiceImpl implements CommonService {
                     List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
                     List<SysPrivilege> sysPrivilegeList = sysPrivilegeService.list(sysPrivilegeQueryWrapper);
                     authBean = new AuthBean(sysRoleList, sysPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
                     authBean = new AuthBean(sysRoleList, sysPrivilegeList.stream().map(s -> s.getUrl()).collect(Collectors.toSet()));
                 } else {
                 } else {
-                    BasicSchool tbSchool = cacheService.schoolCache(user.getSchoolId());
+                    BasicSchool tbSchool = Objects.nonNull(user.getOrgId()) ? cacheService.schoolCache(user.getSchoolId()) : null;
                     SysOrg org = Objects.nonNull(user.getOrgId()) ? cacheService.orgCache(user.getOrgId()) : null;
                     SysOrg org = Objects.nonNull(user.getOrgId()) ? cacheService.orgCache(user.getOrgId()) : null;
                     sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, privilegeIds)
                     sysPrivilegeQueryWrapper.lambda().in(SysPrivilege::getId, privilegeIds)
                             .eq(SysPrivilege::getProperty, PrivilegePropertyEnum.AUTH);
                             .eq(SysPrivilege::getProperty, PrivilegePropertyEnum.AUTH);
@@ -526,6 +530,12 @@ public class CommonServiceImpl implements CommonService {
         }
         }
     }
     }
 
 
+    @Override
+    public List<Long> listSubOrgIds(Long orgId) {
+        List<OrgDto> orgDtos = sysOrgService.listOrgTree();
+        return null;
+    }
+
     public static void outputFile(HttpServletResponse response, File file, String fileName) {
     public static void outputFile(HttpServletResponse response, File file, String fileName) {
         try {
         try {
 
 

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/SysUserServiceImpl.java

@@ -111,7 +111,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         }
         }
         // 修改
         // 修改
         else {
         else {
-            if (sysUser != null && user.getId() != sysUser.getId()) {
+            if (sysUser != null && user.getId().longValue() != sysUser.getId().longValue()) {
                 throw ExceptionResultEnum.ERROR.exception("用户名已存在");
                 throw ExceptionResultEnum.ERROR.exception("用户名已存在");
             }
             }
             sysUser.setRealName(user.getRealName());
             sysUser.setRealName(user.getRealName());
@@ -136,7 +136,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             List<SysRolePrivilege> rolePrivileges = sysRolePrivilegeService.listByRoleId(roleId);
             List<SysRolePrivilege> rolePrivileges = sysRolePrivilegeService.listByRoleId(roleId);
             for (SysRolePrivilege rolePrivilege : rolePrivileges) {
             for (SysRolePrivilege rolePrivilege : rolePrivileges) {
                 SysUserRole userRole = new SysUserRole();
                 SysUserRole userRole = new SysUserRole();
-                userRole.setUserId(sysUser.getId());
+                userRole.setUserId(user.getId());
                 userRole.setRoleId(roleId);
                 userRole.setRoleId(roleId);
                 userRole.setPrivilegeId(rolePrivilege.getPrivilegeId());
                 userRole.setPrivilegeId(rolePrivilege.getPrivilegeId());
                 sysUserRoleService.save(userRole);
                 sysUserRoleService.save(userRole);
@@ -293,7 +293,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         }
         }
         // 修改
         // 修改
         else {
         else {
-            if (sysUser != null && user.getId() != sysUser.getId()) {
+            if (sysUser != null && user.getId().longValue() != sysUser.getId().longValue()) {
                 throw ExceptionResultEnum.ERROR.exception("用户名已存在");
                 throw ExceptionResultEnum.ERROR.exception("用户名已存在");
             }
             }
             sysUser.setRealName(user.getRealName());
             sysUser.setRealName(user.getRealName());

+ 1 - 1
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -246,7 +246,7 @@
             CASE
             CASE
                 WHEN a.review_status IS NULL THEN ''
                 WHEN a.review_status IS NULL THEN ''
                 ELSE a.review_status
                 ELSE a.review_status
-            END reviewStatus,
+            END reviewStatus
         FROM
         FROM
             exam_task a
             exam_task a
         LEFT JOIN
         LEFT JOIN