浏览代码

修改印刷相关的接口

宋悦 7 年之前
父节点
当前提交
d78df25ad2

+ 6 - 0
core-api/src/main/java/cn/com/qmth/examcloud/service/core/api/OrgApi.java

@@ -265,4 +265,10 @@ public class OrgApi {
     public ResponseEntity getAllParentOrg(){
     	return new ResponseEntity(orgRepo.findAllParentOrg(), HttpStatus.OK);
     }
+
+    @ApiOperation(value = "查询所有印刷机构", notes = "查询所有印刷机构")
+    @GetMapping("/allPrint")
+    public ResponseEntity getAllPrintOrg() {
+        return new ResponseEntity(orgRepo.findAllPrintByParentId(0L), HttpStatus.OK);
+    }
 }

+ 4 - 10
core-api/src/main/java/cn/com/qmth/examcloud/service/core/api/UserApi.java

@@ -277,15 +277,9 @@ public class UserApi {
         }
     }
 
-    @ApiOperation(value="查询印刷用户",notes="查询印刷用户")
-    @GetMapping("/all/print")
-    public ResponseEntity getPrintUser(@ModelAttribute User user,
-                                       HttpServletRequest request){
-        AccessUser accessUser = (AccessUser)request.getAttribute("accessUser");
-        if(accessUser != null){
-            return new ResponseEntity(userRepo.findPrintPmByRootOrgId(accessUser.getRootOrgId()),HttpStatus.OK);
-        }else{
-            return new ResponseEntity(new ArrayList<User>(),HttpStatus.OK);
-        }
+    @ApiOperation(value="查询印刷项目经理",notes="查询印刷项目经理")
+    @GetMapping("/allPrintPm")
+    public ResponseEntity getAllPrintPm(){
+        return new ResponseEntity(userRepo.findPrintPm(),HttpStatus.OK);
     }
 }

+ 2 - 2
core-domain/src/main/java/cn/com/qmth/examcloud/service/core/repo/UserRepo.java

@@ -45,6 +45,6 @@ public interface UserRepo extends JpaRepository<User,Long>,QueryByExampleExecuto
             "And us.root_org_id = ? And ur.role_code = 'MARKER' And us.enable = 1 ORDER BY ?#{#pageable}",nativeQuery = true)
     Page<User> findMarkerByRootOrgId(Long rootOrgId, Pageable pageable);
 
-    @Query(nativeQuery = true,value = "SELECT DISTINCT * FROM ecs_core_user us, ecs_core_user_role ur WHERE us.id = ur.user_id And us.root_org_id = ? And ur.role_code = 'PROJECT_MANAGER' And us.enable = 1")
-    List<User> findPrintPmByRootOrgId(Long rootOrgId);
+    @Query(nativeQuery = true,value = "SELECT DISTINCT * FROM ecs_core_user us, ecs_core_user_role ur WHERE us.user_type = 'PRINT' and us.id = ur.user_id and ur.role_code = 'PROJECT_MANAGER' And us.enable = 1")
+    List<User> findPrintPm();
 }