Procházet zdrojové kódy

oa添加开放接口

liujc před 1 rokem
rodič
revize
c35ba179af

+ 38 - 42
.idea/httpRequests/http-requests-log.http

@@ -1,3 +1,41 @@
+GET http://127.0.0.1:8005/open/queryAllOrg
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-09-18T100913.200.json
+
+###
+
+POST http://127.0.0.1:8005/open/oaOrgIds?userId=2248313
+Content-Length: 0
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-09-15T234119.200.json
+
+###
+
+POST http://127.0.0.1:8005/open/oaOrgIds?userId=2248313
+Content-Length: 0
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-09-15T233859.200.json
+
+###
+
+GET http://127.0.0.1:8005/open/queryAllOrg
+Connection: Keep-Alive
+User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
+Accept-Encoding: br,deflate,gzip,x-gzip
+
+<> 2023-09-15T233807.200.json
+
+###
+
 GET http://127.0.0.1:9002/teacherCourseSchedule/liveCourseScheduleTime?courseScheduleId=2548
 Authorization: bearer e70c68c9-05e3-4502-aed4-f7001a0e2766
 Proxy-Connection: Keep-Alive
@@ -576,45 +614,3 @@ Accept-Encoding: br,deflate,gzip,x-gzip
 
 ###
 
-GET http://127.0.0.1:9002/teacherCourseSchedule/findCourseAttendanceDetailHeadInfo?courseScheduleId=1701
-authorization: bearer b33a3aed-ca44-4537-b3ae-1fba38c2560a
-Content-Type: application/json
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-08T194906.200.json
-
-###
-
-GET http://127.0.0.1:9002/teacherCourseSchedule/findCourseAttendanceDetailHeadInfo?courseScheduleId=1701
-authorization: bearer 97fd8e85-bb3c-4967-8a07-47c44957f94a
-Content-Type: application/json
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-08T194556.200.json
-
-###
-
-GET http://127.0.0.1:9002/teacherCourseSchedule/findCourseAttendanceDetailHeadInfo?courseScheduleId=1701
-authorization: bearer 97fd8e85-bb3c-4967-8a07-47c44957f94a
-Content-Type: application/json
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-08T171149.200.json
-
-###
-
-GET http://127.0.0.1:8005/task/closeLiveCourseRoom
-Connection: Keep-Alive
-User-Agent: Apache-HttpClient/4.5.14 (Java/17.0.6)
-Accept-Encoding: br,deflate,gzip,x-gzip
-
-<> 2023-06-08T163756.200.json
-
-###
-

+ 27 - 4
mec-web/src/main/java/com/ym/mec/web/controller/education/OaContractsController.java

@@ -1,18 +1,20 @@
 package com.ym.mec.web.controller.education;
 
 import com.ym.mec.biz.dal.dto.OAFinancialDto;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.Organization;
 import com.ym.mec.biz.service.ContractService;
+import com.ym.mec.biz.service.EmployeeService;
 import com.ym.mec.biz.service.FinancialExpenditureService;
+import com.ym.mec.biz.service.OrganizationService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
+import java.util.List;
 import java.util.Map;
 
 @RequestMapping()
@@ -25,6 +27,12 @@ public class OaContractsController extends BaseController {
     @Autowired
     private FinancialExpenditureService financialExpenditureService;
 
+    @Autowired
+    private EmployeeService employeeService;
+
+    @Autowired
+    private OrganizationService organizationService;
+
     @PostMapping("oaContracts/finance")
     public HttpResponseResult<String> transferProduceContract(@RequestBody OAFinancialDto financialDto) {
         String fileUrl = contractService.transferOaFinancial(financialDto);
@@ -44,4 +52,19 @@ public class OaContractsController extends BaseController {
         financialExpenditureService.checkCourseReturnFee(paramMap);
         return succeed();
     }
+
+
+    @GetMapping("/open/oaOrgIds")
+    @ApiOperation("查询用户分部ID集合")
+    public HttpResponseResult<String> oaOrgIds(@RequestParam Long userId) {
+        Employee employee = employeeService.get(Math.toIntExact(userId));
+        return succeed(employee.getOrganIdList());
+    }
+
+    @ApiOperation(value = "获取管乐迷分部列表")
+    @GetMapping("/open/queryAllOrg")
+    public HttpResponseResult<List<Organization>> queryAll() {
+        return succeed(organizationService.queryAll());
+    }
+
 }