Explorar o código

增加 graduateYears 接口

mingfu hai 1 mes
pai
achega
29a8a80b75

+ 27 - 1
ie-admin/src/main/java/com/ruoyi/web/controller/front/UserController.java

@@ -17,6 +17,7 @@ import com.ruoyi.web.service.SysLoginService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.math.NumberUtils;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
@@ -79,7 +80,7 @@ public class UserController {
 
     @GetMapping(value = "examMajors")
     @Anonymous
-    @ApiOperation("专业类列表")
+    @ApiOperation("专业类列表")
     public AjaxResult examMajor(@RequestParam String location, @RequestParam ExamType examType)
     {
         List<JSONObject> list = new ArrayList<>();
@@ -96,6 +97,31 @@ public class UserController {
         return AjaxResult.success(list);
     }
 
+    @GetMapping(value = "graduateYears")
+    @Anonymous
+    @ApiOperation("毕业年份列表")
+    public AjaxResult graduateYear(@RequestParam String location, @RequestParam ExamType examType)
+    {
+        DzControl cond = new DzControl();
+        cond.setIsValid(1);
+        cond.setLocation(location);
+        List<DzControl> list = dzControlService.selectDzControlList(cond);
+        Integer year;
+        if(!CollectionUtils.isEmpty(list) && StringUtils.isNotBlank(list.get(0).getSubmitYear())) {
+            year = NumberUtils.toInt(list.get(0).getSubmitYear(), Calendar.getInstance().get(Calendar.YEAR));
+        } else {
+            year = Calendar.getInstance().get(Calendar.YEAR);
+        }
+        List<JSONObject> resultList = new ArrayList<>();
+        for(int i = year; i <= year + 6; i++) {
+            JSONObject o = new JSONObject();
+            o.put("dictValue", year);
+            o.put("dictLabel", year.toString());
+            resultList.add(o);
+        }
+        return AjaxResult.success(resultList);
+    }
+
     /**
      * 登录方法
      *