Commit 504893a6 by xuwenhao

11.10修改教师个人实验申请获取学科

parent a09370a0
package yangtz.cs.liu.campus.controller.schoolLab;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SysRole;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -27,6 +28,8 @@ import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.service.accessory.IAccessoryService;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
......@@ -51,6 +54,10 @@ public class SchoolTeacherExperimentApplyController extends BaseController
private ISchoollTeacherExperimentApplyLabsService schoollTeacherExperimentApplyLabsService;
@Autowired
private IAccessoryService accessoryService;
@Autowired
private ISchoolClassMentorService schoolClassMentorService;
@Autowired
ISchoolLabClassYearService schoolLabClassYearService;
/**
* 查询教师个人实验申请列表
......@@ -336,4 +343,43 @@ public class SchoolTeacherExperimentApplyController extends BaseController
return toAjax(schoolTeacherExperimentApplyService.experimentResult(schoolTeacherExperimentApplyVo));
}
/**
* 获取当前登录角色学科
*/
@GetMapping("/getSubject")
public AjaxResult getSubject(){
Long userId = SecurityUtils.getUserId();
List<Map<String,String>> subList = new ArrayList<>();
//设置级部
//获取学科
Map<String, String> map = schoolClassMentorService.selectTeacherGroupMentot(userId);
if (map != null && null != map.get("courseId") ) {
String s = map.get("courseId");
List<String> list = Arrays.asList(s.split(","));
List<String> myList = list.stream().distinct().collect(Collectors.toList());
List<String> strings = schoolLabClassYearService.convertMentor(myList);
for (String date : strings) {
if (date.equals("1")) {
Map<String,String> mapList = new HashMap<>();
mapList.put("subName", "物理");
mapList.put("sub", "1");
subList.add(mapList);
} else if (date.equals("2")) {
Map<String,String> mapList = new HashMap<>();
mapList.put("subName", "化学");
mapList.put("sub", "2");
subList.add(mapList);
} else if (date.equals("3")) {
Map<String,String> mapList = new HashMap<>();
mapList.put("subName", "生物");
mapList.put("sub", "3");
subList.add(mapList);
}
}
}
return AjaxResult.success(subList);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment