|
|
@@ -14,6 +14,7 @@ import com.ym.mec.util.date.DateUtil;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
@@ -21,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
|
+import static com.ym.mec.biz.dal.enums.PracticeGroupType.CHARGE;
|
|
|
+
|
|
|
@Api(tags = "网管课-教师端")
|
|
|
@RequestMapping("teacherPracticeGroup")
|
|
|
@RestController
|
|
|
@@ -59,4 +62,29 @@ public class TeacherPracticeGroupController extends BaseController {
|
|
|
return practiceGroupService.createActivityPracticeGroup(practiceGroupApplyDto);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @ApiOperation(value = "网管课申请")
|
|
|
+ @PostMapping("/practiceGroupApply")
|
|
|
+ public Object practiceGroupApply(@RequestBody PracticeGroupApplyDto practiceGroupApplyDto){
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ if (sysUser == null) {
|
|
|
+ return failed("用户信息获取失败");
|
|
|
+ }
|
|
|
+ PracticeGroupApplyBaseInfoDto applyBaseInfoDto = practiceGroupApplyDto.getPracticeGroupApplyBaseInfoDto();
|
|
|
+ Teacher teacher = teacherDao.get(sysUser.getId());
|
|
|
+ if(Objects.isNull(teacher)){
|
|
|
+ return failed("请指定指导老师!");
|
|
|
+ }
|
|
|
+ if(Objects.isNull(applyBaseInfoDto.getOrganId())){
|
|
|
+ SysUser student = teacherDao.getUser(applyBaseInfoDto.getStudentId());
|
|
|
+ if(Objects.isNull(student)||Objects.isNull(student.getOrganId())){
|
|
|
+ return failed("学员信息异常");
|
|
|
+ }
|
|
|
+ applyBaseInfoDto.setOrganId(student.getOrganId());
|
|
|
+ }
|
|
|
+ applyBaseInfoDto.setType(CHARGE);
|
|
|
+ applyBaseInfoDto.setMemo("指导老师老师端申请网管课");
|
|
|
+ return practiceGroupService.createPracticeGroup(practiceGroupApplyDto);
|
|
|
+ }
|
|
|
+
|
|
|
}
|