ソースを参照

1、添加教务老师字段
2、布置作业

Joburgess 5 年 前
コミット
b9f01278f7

+ 14 - 1
mec-student/src/main/java/com/ym/mec/student/controller/PracticeGroupController.java

@@ -73,6 +73,12 @@ public class PracticeGroupController extends BaseController {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
         Map<String,Object> result=practiceGroupService.checkCanApplyFreePracticeGroup(sysUser.getId());
+        if(ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
+            Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(sysUser.getId());
+            result.put("canApply", applyTimes < 1 ? 1 : 0);
+        }else{
+            result.put("canApply", 0);
+        }
         result.put("organId", sysUser.getOrganId());
         return succeed(result);
     }
@@ -84,7 +90,14 @@ public class PracticeGroupController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        return succeed(practiceGroupService.getPracticeApplyParams(sysUser.getId()));
+        Map<String,Object> result=practiceGroupService.getPracticeApplyParams(sysUser.getId());
+        if(ENABLE_APPLY_ORGANIDS.contains(sysUser.getOrganId())){
+            Integer applyTimes = practiceGroupDao.countUserPracticeApplyRecord(sysUser.getId());
+            result.put("enableApply", applyTimes < 1 ? 1 : 0);
+        }else{
+            result.put("enableApply", 0);
+        }
+        return succeed();
     }
 
     @ApiOperation("获取可以预约的教师")