shangke 2 年之前
父節點
當前提交
f9ff8634ca
共有 1 個文件被更改,包括 26 次插入1 次删除
  1. 26 1
      mec-web/src/main/java/com/ym/mec/web/controller/open/OpenSchoolController.java

+ 26 - 1
mec-web/src/main/java/com/ym/mec/web/controller/open/OpenSchoolController.java

@@ -1,24 +1,30 @@
 package com.ym.mec.web.controller.open;
 
 import com.alibaba.fastjson.JSONObject;
-import com.ym.mec.biz.dal.enums.school.ESchoolStaffType;
+import com.ym.mec.biz.dal.entity.CooperationOrgan;
 import com.ym.mec.biz.dal.wrapper.SchoolStaffWrapper;
+import com.ym.mec.biz.service.CooperationOrganService;
 import com.ym.mec.biz.service.SchoolStaffService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import com.ym.mec.web.vo.SchoolStaffVo;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
 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.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
 import java.util.Objects;
+import java.util.Optional;
 
 @Slf4j
 @Validated
@@ -29,6 +35,9 @@ public class OpenSchoolController extends BaseController {
 
     @Autowired
     private SchoolStaffService schoolStaffService;
+    @Autowired
+    private CooperationOrganService cooperationOrganService;
+
 
     @ApiOperation(value = "学校员工新增", notes = "学校员工- 传入 SchoolStaffWrapper.SchoolStaff")
 	@PostMapping("/staffSave")
@@ -46,4 +55,20 @@ public class OpenSchoolController extends BaseController {
         
         return succeed();
 	}
+
+    @ApiOperation(value = "合作单位查询", notes = "合作单位学校查询- 主键Id")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "id", value = "合作单位ID", dataType = "long")
+    })
+    @GetMapping("/cooperation")
+    public HttpResponseResult<CooperationOrgan> queryCooperationById(@RequestParam Long id) {
+
+    	CooperationOrgan cooperationOrgan = cooperationOrganService.get(Optional.ofNullable(id).orElse(-1L).intValue());
+        if (Objects.isNull(cooperationOrgan)) {
+            throw new BizException("合作单位编号无效");
+        }
+
+    	return succeed(cooperationOrgan);
+    }
+
 }