Commit e90450ea by baochunxin

#G:优化代码

parent 37a19642
...@@ -83,6 +83,10 @@ ...@@ -83,6 +83,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId> <artifactId>spring-boot-starter-websocket</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -20,13 +20,8 @@ import com.ruoyi.common.annotation.Log; ...@@ -20,13 +20,8 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import org.springframework.web.multipart.MultipartFile;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlan;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor; import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGradeMentor;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolExperimentPlanMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMentorMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
...@@ -35,11 +30,7 @@ import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeMentorService; ...@@ -35,11 +30,7 @@ import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeMentorService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService; import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import yangtz.cs.liu.campus.vo.schoolgrade.GradeTreeSelect;
import yangtz.cs.liu.campus.vo.student.SchoolStudentVO;
import static yangtz.cs.liu.campus.constant.GradeConstant.NEWTERM;
import static yangtz.cs.liu.campus.constant.GradeConstant.UNNEW;
/** /**
* 实验计划Controller * 实验计划Controller
......
...@@ -36,7 +36,7 @@ public class SchoolLabController extends BaseController ...@@ -36,7 +36,7 @@ public class SchoolLabController extends BaseController
public TableDataInfo list(SchoolLabVo schoolLabVo) public TableDataInfo list(SchoolLabVo schoolLabVo)
{ {
startPage(); startPage();
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo); List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo,null);
return getDataTable(list); return getDataTable(list);
} }
...@@ -47,7 +47,7 @@ public class SchoolLabController extends BaseController ...@@ -47,7 +47,7 @@ public class SchoolLabController extends BaseController
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, SchoolLabVo schoolLabVo) public void export(HttpServletResponse response, SchoolLabVo schoolLabVo)
{ {
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo); List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo,null);
ExcelUtil<SchoolLabVo> util = new ExcelUtil<SchoolLabVo>(SchoolLabVo.class); ExcelUtil<SchoolLabVo> util = new ExcelUtil<SchoolLabVo>(SchoolLabVo.class);
util.exportExcel(response, list, "实验室数据"); util.exportExcel(response, list, "实验室数据");
} }
......
...@@ -174,7 +174,7 @@ public class SchoolTeacherLabApplyController extends BaseController ...@@ -174,7 +174,7 @@ public class SchoolTeacherLabApplyController extends BaseController
*/ */
@GetMapping("/getTeacherClass") @GetMapping("/getTeacherClass")
public AjaxResult getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){ public AjaxResult getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
return AjaxResult.success(schoolTeacherLabApplyService.getTeacherClass(schoolTeacherLabApplyVo)); return AjaxResult.success(schoolTeacherLabApplyService.getTeacherClass(schoolTeacherLabApplyVo,null));
} }
/** /**
......
...@@ -18,7 +18,7 @@ public class SchoolLabClassYearRelation ...@@ -18,7 +18,7 @@ public class SchoolLabClassYearRelation
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
/** 年级实验室预约主键id */ /** 年级实验室预约主键id */
private Long labClassYearId; private Long labClassYearId;
/** 实验室id */ /** 实验室id */
......
...@@ -34,6 +34,7 @@ public interface SchoolExperimentPlanMapper extends BaseMapper<SchoolExperimentP ...@@ -34,6 +34,7 @@ public interface SchoolExperimentPlanMapper extends BaseMapper<SchoolExperimentP
*/ */
public List<SchoolExperimentPlanVo> selectSchoolExperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo); public List<SchoolExperimentPlanVo> selectSchoolExperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo);
public List<Map<String, String>> selectNameByVo(SchoolExperimentPlanVo schoolExperimentPlanVo);
/** /**
* 新增实验计划 * 新增实验计划
* *
......
package yangtz.cs.liu.campus.mapper.schoolgrade; package yangtz.cs.liu.campus.mapper.schoolgrade;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade; import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
...@@ -26,4 +27,8 @@ public interface SchoolGradeMapper extends BaseMapper<SchoolGrade> { ...@@ -26,4 +27,8 @@ public interface SchoolGradeMapper extends BaseMapper<SchoolGrade> {
//获取最新学年 //获取最新学年
int isNewSchoolYear(); int isNewSchoolYear();
public List<String> getYearList();
} }
package yangtz.cs.liu.campus.service.impl.schoolLab; package yangtz.cs.liu.campus.service.impl.schoolLab;
import com.ruoyi.system.mapper.SysUserMapper;
import java.text.DecimalFormat;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.util.List; import java.util.List;
...@@ -43,6 +45,8 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen ...@@ -43,6 +45,8 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
@Autowired @Autowired
private SchoolGradeMentorMapper schoolGradeMentorMapper; private SchoolGradeMentorMapper schoolGradeMentorMapper;
@Autowired
private SysUserMapper sysUserMapper;
/** /**
* 查询实验计划 * 查询实验计划
* *
...@@ -68,6 +72,16 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen ...@@ -68,6 +72,16 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
} }
/** /**
* 获取计划下拉列表
* @param schoolExperimentPlanVo
* @return
*/
@Override
public List<Map<String, String>> selectNameByVo(SchoolExperimentPlanVo schoolExperimentPlanVo) {
return schoolExperimentPlanMapper.selectNameByVo(schoolExperimentPlanVo);
}
/**
* 新增实验计划 * 新增实验计划
* *
* @param schoolExperimentPlanVo 实验计划 * @param schoolExperimentPlanVo 实验计划
...@@ -174,9 +188,13 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen ...@@ -174,9 +188,13 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
*/ */
@Override @Override
public List<Map<String, Object>> getGrade(int schoolYear,Long userId) { public List<Map<String, Object>> getGrade(int schoolYear,Long userId) {
SysUser user = null;
//获取当前登录用户 //获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser(); if(null == userId){
user = SecurityUtils.getLoginUser().getUser();
}else {
user = sysUserMapper.selectUserById(userId);
}
//管理员级部 //管理员级部
if(1L == user.getUserId()){ if(1L == user.getUserId()){
List<Map<String, Object>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,null); List<Map<String, Object>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,null);
......
package yangtz.cs.liu.campus.service.impl.schoolLab; package yangtz.cs.liu.campus.service.impl.schoolLab;
import com.ruoyi.framework.util.UserInfoUtil;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysUserService;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -22,8 +25,13 @@ import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation; ...@@ -22,8 +25,13 @@ import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper; import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.*; import yangtz.cs.liu.campus.mapper.schoolLab.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
import yangtz.cs.liu.campus.vo.schoolLab.*; import yangtz.cs.liu.campus.vo.schoolLab.*;
/** /**
...@@ -48,11 +56,39 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -48,11 +56,39 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
private SchoolLabClassYearRelationMapper relationMapper; private SchoolLabClassYearRelationMapper relationMapper;
@Autowired @Autowired
private SchoolClassMapper schoolClassMapper; private SchoolClassMapper schoolClassMapper;
@Autowired @Autowired
private SchoolTeacherLabApplyMapper schoolTeacherLabApplyMapper; private SchoolTeacherLabApplyMapper schoolTeacherLabApplyMapper;
@Autowired @Autowired
private SchoolTeacherExperimentApplyMapper teacherExperimentApplyMapper; private SchoolTeacherExperimentApplyMapper teacherExperimentApplyMapper;
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private SchoolGradeMapper schoolGradeMapper;
@Autowired
private UserInfoUtil userInfoUtil;
public String getSub(){
String sub = null;
Long userId = userInfoUtil.getMpLoginUser().getUserId();
SysUser sysUser = sysUserMapper.selectUserById(userId);
for (SysRole role : sysUser.getRoles()) {
if (role.getRoleKey().equals("phy_lab_admin")){
sub = "1";
}else if (role.getRoleKey().equals("che_lab_admin")){
sub = "2";
}else if (role.getRoleKey().equals("bio_lab_admin")){
sub = "3";
}
}
return sub ;
}
/** /**
* 查询年级实验室预约 * 查询年级实验室预约
* *
...@@ -88,11 +124,18 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -88,11 +124,18 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
public int insertSchoolLabClassYear(SchoolLabClassYear schoolLabClassYear) public int insertSchoolLabClassYear(SchoolLabClassYear schoolLabClassYear)
{ {
schoolLabClassYear.setCreateTime(DateUtils.getNowDate()); schoolLabClassYear.setCreateTime(DateUtils.getNowDate());
schoolLabClassYear.setDeclareState("0");
int rows = schoolLabClassYearMapper.insertSchoolLabClassYear(schoolLabClassYear); int rows = schoolLabClassYearMapper.insertSchoolLabClassYear(schoolLabClassYear);
insertSchoolLabClassYearRelation(schoolLabClassYear); insertSchoolLabClassYearRelation(schoolLabClassYear);
return rows; return rows;
} }
@Override
public List<String> getYearList() {
return schoolGradeMapper.getYearList();
}
/** /**
* 新增年级实验室预约和实验室关系信息 * 新增年级实验室预约和实验室关系信息
* *
...@@ -167,8 +210,14 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -167,8 +210,14 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
*/ */
@Override @Override
public List<SchoolLabClassYearVo> getLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo) { public List<SchoolLabClassYearVo> getLabClassYear(SchoolLabClassYearVo schoolLabClassYearVo) {
//获取当前登录用户 SysUser user = null;
SysUser user = SecurityUtils.getLoginUser().getUser(); if (schoolLabClassYearVo.getUserId() == null){
//获取当前登录用户
user = SecurityUtils.getLoginUser().getUser();
}else {
user = sysUserMapper.selectUserById(schoolLabClassYearVo.getUserId());
}
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//获取用户角色集合 //获取用户角色集合
List<SysRole> roles = user.getRoles(); List<SysRole> roles = user.getRoles();
...@@ -265,6 +314,10 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -265,6 +314,10 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelationList) for (SchoolLabClassYearRelation schoolLabClassYearRelation : schoolLabClassYearRelationList)
{ {
schoolLabClassYearRelation.setLabClassYearId(id); schoolLabClassYearRelation.setLabClassYearId(id);
//跟进实验是id 查询实验室名称
SchoolLabVo schoolLabVo = schoolLabMapper.selectSchoolLabById(
schoolLabClassYearRelation.getLabId());
schoolLabClassYearRelation.setLabName(schoolLabVo.getLabName());
list.add(schoolLabClassYearRelation); list.add(schoolLabClassYearRelation);
} }
if (list.size() > 0) if (list.size() > 0)
...@@ -272,6 +325,7 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -272,6 +325,7 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
schoolLabClassYearMapper.deleteSchoolLabClassYearRelationByLabClassYearId(id); schoolLabClassYearMapper.deleteSchoolLabClassYearRelationByLabClassYearId(id);
schoolLabClassYearMapper.batchSchoolLabClassYearRelation(list); schoolLabClassYearMapper.batchSchoolLabClassYearRelation(list);
} }
schoolLabClassYearVo.setDeclareState("3");
SchoolLabClassYear schoolLabClassYear = new SchoolLabClassYear(); SchoolLabClassYear schoolLabClassYear = new SchoolLabClassYear();
BeanUtils.copyProperties(schoolLabClassYearVo,schoolLabClassYear); BeanUtils.copyProperties(schoolLabClassYearVo,schoolLabClassYear);
return schoolLabClassYearMapper.updateSchoolLabClassYear(schoolLabClassYear); return schoolLabClassYearMapper.updateSchoolLabClassYear(schoolLabClassYear);
...@@ -375,7 +429,6 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea ...@@ -375,7 +429,6 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
} }
return list; return list;
} }
for (SchoolLab schoolLab : schoolLabs) { for (SchoolLab schoolLab : schoolLabs) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("labId",schoolLab.getId()); map.put("labId",schoolLab.getId());
......
...@@ -6,6 +6,8 @@ import com.ruoyi.common.core.domain.entity.SysUser; ...@@ -6,6 +6,8 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
...@@ -29,7 +31,8 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab> ...@@ -29,7 +31,8 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
@Autowired @Autowired
private SchoolLabMapper schoolLabMapper; private SchoolLabMapper schoolLabMapper;
@Autowired
private SysUserMapper sysUserMapper;
/** /**
* 查询实验室 * 查询实验室
* *
...@@ -49,12 +52,17 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab> ...@@ -49,12 +52,17 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
* @return 实验室 * @return 实验室
*/ */
@Override @Override
public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo) public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo,Long userId)
{ {
SysUser user = null;
List<SchoolLabVo> list = new ArrayList<>(); List<SchoolLabVo> list = new ArrayList<>();
//获取当前登录用户 //获取当前登录用户
SysUser user = SecurityUtils.getLoginUser().getUser(); if (null == userId){
user = SecurityUtils.getLoginUser().getUser();
}else {
user = sysUserMapper.selectUserById(userId);
}
//获取用户角色集合 //获取用户角色集合
List<SysRole> roles = user.getRoles(); List<SysRole> roles = user.getRoles();
......
...@@ -10,19 +10,25 @@ import com.ruoyi.common.exception.ServiceException; ...@@ -10,19 +10,25 @@ import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory; import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolExperimentPlanClass;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYearRelation;
import yangtz.cs.liu.campus.mapper.accessory.AccessoryMapper; import yangtz.cs.liu.campus.mapper.accessory.AccessoryMapper;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolExperimentPlanMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearRelationMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearRelationMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo; import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
...@@ -43,7 +49,11 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL ...@@ -43,7 +49,11 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
private SchoolLabClassYearRelationMapper schoolLabClassYearRelationMapper; private SchoolLabClassYearRelationMapper schoolLabClassYearRelationMapper;
@Autowired @Autowired
private AccessoryMapper accessoryMapper; private AccessoryMapper accessoryMapper;
@Autowired
private ISchoolExperimentPlanService schoolExperimentPlanService;
@Autowired
private SchoolClassMapper schoolClassMapper;
/** /**
* 查询教师实验室申请 * 查询教师实验室申请
* *
...@@ -194,8 +204,14 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL ...@@ -194,8 +204,14 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
* @return * @return
*/ */
@Override @Override
public List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) { public List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo,SysUser sysUser) {
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = null;
if (null == sysUser){
user = SecurityUtils.getLoginUser().getUser();
}else {
user = sysUser;
}
//如果是管理员,返回该实验计划所有班级 //如果是管理员,返回该实验计划所有班级
if (user.isAdmin()){ if (user.isAdmin()){
return schoolTeacherLabApplyMapper.getTeacherClassAll(schoolTeacherLabApplyVo); return schoolTeacherLabApplyMapper.getTeacherClassAll(schoolTeacherLabApplyVo);
...@@ -471,12 +487,36 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL ...@@ -471,12 +487,36 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
schoolTeacherLabApply.setSchoolYear(one.getSchoolYear().toString()); schoolTeacherLabApply.setSchoolYear(one.getSchoolYear().toString());
schoolTeacherLabApply.setSemester(one.getSemester()); schoolTeacherLabApply.setSemester(one.getSemester());
schoolTeacherLabApply.setExperimentTime(StringUtils.isNull(one.getExperimentTime())? null: new Date(one.getExperimentTime())); schoolTeacherLabApply.setExperimentTime(StringUtils.isNull(one.getExperimentTime())? null: new Date(one.getExperimentTime()));
schoolTeacherLabApply.setState(one.getState()); schoolTeacherLabApply.setState(StringUtils.isNull(one.getState())? null: one.getState());
schoolTeacherLabApply.setClassName(one.getClassName()); schoolTeacherLabApply.setClassName(StringUtils.isNull(one.getClassName())? null: one.getClassName());
//1.已经进行的班级 //1.已经进行的班级
List<SchoolTeacherLabApplyVo> schoolTeacherLabApplies = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList( List<SchoolTeacherLabApplyVo> schoolTeacherLabApplies = schoolTeacherLabApplyMapper.selectSchoolTeacherLabApplyList(
schoolTeacherLabApply); schoolTeacherLabApply);
//2.找出未进行中得班级
SchoolLabClassYearVo schoolLabClassYearVo = schoolLabClassYearMapper.selectSchoolLabClassYearById(
one.getLabClassYearId());
SchoolExperimentPlanVo schoolExperimentPlanVo = schoolExperimentPlanService.selectSchoolExperimentPlanById(
schoolLabClassYearVo.getExperimentPlanId());
List<SchoolExperimentPlanClass> schoolExperimentPlanClassList = schoolExperimentPlanVo.getSchoolExperimentPlanClassList();
//有记录
List<String> nameList = schoolTeacherLabApplies.stream().map(o -> o.getClassId()).collect(Collectors.toList());
//无记录
List<Long> collect = schoolExperimentPlanClassList.stream()
.map(SchoolExperimentPlanClass::getClassId).collect(Collectors.toList());
List<String> classList = new ArrayList<>();
for (Long classId :collect){
if (!nameList.contains(classId.toString())){
classList.add(classId.toString());
}
}
classList.forEach(id ->{
SchoolTeacherLabApplyVo schoolTeacherLabApplyVo = new SchoolTeacherLabApplyVo();
schoolTeacherLabApplyVo.setClassId(id);
schoolTeacherLabApplyVo.setClassName(schoolClassMapper.selectById(id).getClassName());
schoolTeacherLabApplyVo.setState("0");
schoolTeacherLabApplies.add(schoolTeacherLabApplyVo);
});
return schoolTeacherLabApplies; return schoolTeacherLabApplies;
} }
...@@ -491,4 +531,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL ...@@ -491,4 +531,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
schoolTeacherLabApply); schoolTeacherLabApply);
return maps; return maps;
} }
} }
...@@ -31,6 +31,7 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP ...@@ -31,6 +31,7 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP
* @return 实验计划集合 * @return 实验计划集合
*/ */
public List<SchoolExperimentPlanVo> selectSchoolExperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo); public List<SchoolExperimentPlanVo> selectSchoolExperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo);
public List<Map<String,String>> selectNameByVo(SchoolExperimentPlanVo schoolExperimentPlanVo);
/** /**
* 新增实验计划 * 新增实验计划
...@@ -114,6 +115,4 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP ...@@ -114,6 +115,4 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP
* @return * @return
*/ */
List<Map<String, Object>> gradeCountExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo); List<Map<String, Object>> gradeCountExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo);
} }
...@@ -40,6 +40,8 @@ public interface ISchoolLabClassYearService extends IService<SchoolLabClassYear> ...@@ -40,6 +40,8 @@ public interface ISchoolLabClassYearService extends IService<SchoolLabClassYear>
* @return 结果 * @return 结果
*/ */
public int insertSchoolLabClassYear(SchoolLabClassYear schoolLabClassYear); public int insertSchoolLabClassYear(SchoolLabClassYear schoolLabClassYear);
public List<String> getYearList();
public String getSub();
/** /**
* 修改年级实验室预约 * 修改年级实验室预约
......
...@@ -30,7 +30,7 @@ public interface ISchoolLabService extends IService<SchoolLab> ...@@ -30,7 +30,7 @@ public interface ISchoolLabService extends IService<SchoolLab>
* @param schoolLabVo 实验室 * @param schoolLabVo 实验室
* @return 实验室集合 * @return 实验室集合
*/ */
public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo); public List<SchoolLabVo> selectSchoolLabList(SchoolLabVo schoolLabVo,Long userId);
/** /**
* 新增实验室 * 新增实验室
......
package yangtz.cs.liu.campus.service.schoolLab; package yangtz.cs.liu.campus.service.schoolLab;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.entity.SysUser;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo; import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
...@@ -76,7 +77,8 @@ public interface ISchoolTeacherLabApplyService extends IService<SchoolTeacherLab ...@@ -76,7 +77,8 @@ public interface ISchoolTeacherLabApplyService extends IService<SchoolTeacherLab
* @param schoolTeacherLabApplyVo * @param schoolTeacherLabApplyVo
* @return * @return
*/ */
List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo); List<Map<String, Object>> getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo,
SysUser sysUser);
/** /**
* 上传附件 * 上传附件
......
...@@ -26,6 +26,11 @@ public class ClassSituationVo { ...@@ -26,6 +26,11 @@ public class ClassSituationVo {
*/ */
private String grade; private String grade;
/** /**
* 学科(1物理,2化学,3生物)
*/
private String sub;
/**
* 班级id * 班级id
*/ */
private Long classId; private Long classId;
...@@ -78,5 +83,8 @@ public class ClassSituationVo { ...@@ -78,5 +83,8 @@ public class ClassSituationVo {
* 完成比例 * 完成比例
*/ */
private Integer proportion; private Integer proportion;
/**
* 移动端模糊查询
*/
private String querText;
} }
package yangtz.cs.liu.campus.vo.schoolLab; package yangtz.cs.liu.campus.vo.schoolLab;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Date; import java.util.Date;
...@@ -106,4 +107,11 @@ public class SchoolLabClassYearVo extends BaseEntity ...@@ -106,4 +107,11 @@ public class SchoolLabClassYearVo extends BaseEntity
/** 年级实验室预约和实验室关系信息 */ /** 年级实验室预约和实验室关系信息 */
private List<SchoolLabClassYearRelation> schoolLabClassYearRelationList; private List<SchoolLabClassYearRelation> schoolLabClassYearRelationList;
private Long userId;
/**
* 时间数组
*/
private String[] dateArrays;
} }
...@@ -130,4 +130,10 @@ public class SchoolTeacherLabApplyVo extends BaseEntity ...@@ -130,4 +130,10 @@ public class SchoolTeacherLabApplyVo extends BaseEntity
/** 附件信息集合 */ /** 附件信息集合 */
private List<SchoolAccessory> schoolAccessoryList; private List<SchoolAccessory> schoolAccessoryList;
/**
* 移动端查询参数
*/
private String querText;
} }
...@@ -3,10 +3,12 @@ package yangtz.cs.liu.wechat.controller.experiment; ...@@ -3,10 +3,12 @@ package yangtz.cs.liu.wechat.controller.experiment;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply; import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherExperimentApplyService;
...@@ -52,9 +54,12 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -52,9 +54,12 @@ public class ExperimentAdministratorsControoler extends BaseController {
@GetMapping("/classYear/list") @GetMapping("/classYear/list")
public AjaxResult classYearList(SchoolLabClassYearVo schoolLabClassYearVo) public AjaxResult classYearList(SchoolLabClassYearVo schoolLabClassYearVo)
{ {
schoolLabClassYearVo.setSub(schoolLabClassYearService.getSub());
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo)); return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo));
} }
/** /**
* 年级实验申请详情 * 年级实验申请详情
*/ */
...@@ -62,24 +67,38 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -62,24 +67,38 @@ public class ExperimentAdministratorsControoler extends BaseController {
@GetMapping(value = "/classYear/{id}") @GetMapping(value = "/classYear/{id}")
public AjaxResult classYearGetInfo(@PathVariable("id") Long id) public AjaxResult classYearGetInfo(@PathVariable("id") Long id)
{ {
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearById(id)); return AjaxResult.success(schoolLabClassYearService.getLabClassYearById(id));
} }
/** /**
* 年级实验申请分配 * 年级实验申请分配
*/ */
@PutMapping("/classYear/update") @PutMapping("/classYear/update")
public AjaxResult classYearUpdate(@RequestBody SchoolLabClassYear schoolLabClassYear) public AjaxResult classYearUpdate(@RequestBody SchoolLabClassYearVo schoolLabClassYear)
{ throws ParseException {
return toAjax(schoolLabClassYearService.updateSchoolLabClassYear(schoolLabClassYear)); SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
//截取时间
String[] dateArrays = schoolLabClassYear.getDateArrays();
String dateArray = dateArrays[0];
String dateArray1 = dateArrays[1];
Date stDate = ft.parse(dateArray);
Date enDate = ft.parse(dateArray1);
schoolLabClassYear.setPlannedStartTime(stDate);
schoolLabClassYear.setPlannedEndTime(enDate);
return toAjax(schoolLabClassYearService.updateLabClassYear(schoolLabClassYear));
} }
/** /**
* 教师实验室预约列表 * 教师实验室预约列表
*/ */
@GetMapping(value = "/teacher/list") @GetMapping(value = "/teacher/list")
public AjaxResult teacherList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) public AjaxResult teacherList(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{ {
schoolTeacherLabApplyVo.setSub(schoolLabClassYearService.getSub());
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo)); return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo));
} }
...@@ -97,6 +116,7 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -97,6 +116,7 @@ public class ExperimentAdministratorsControoler extends BaseController {
@PutMapping("/teacher/update") @PutMapping("/teacher/update")
public AjaxResult teacherUpdate(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply) public AjaxResult teacherUpdate(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply)
{ {
schoolTeacherLabApply.setApplyState("1");
return toAjax(schoolTeacherLabApplyService.updateById(schoolTeacherLabApply)); return toAjax(schoolTeacherLabApplyService.updateById(schoolTeacherLabApply));
} }
...@@ -107,6 +127,7 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -107,6 +127,7 @@ public class ExperimentAdministratorsControoler extends BaseController {
@GetMapping(value = "/apply/list") @GetMapping(value = "/apply/list")
public AjaxResult applyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo) public AjaxResult applyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo)
{ {
schoolTeacherExperimentApplyVo.setSub(schoolLabClassYearService.getSub());
return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo)); return AjaxResult.success(schoolTeacherExperimentApplyService.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo));
} }
...@@ -114,9 +135,9 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -114,9 +135,9 @@ public class ExperimentAdministratorsControoler extends BaseController {
* 个人实验室审批 * 个人实验室审批
*/ */
@PutMapping("/apply/update") @PutMapping("/apply/update")
public AjaxResult applyUpdate(@RequestBody SchoolTeacherExperimentApply schoolTeacherExperimentApply) public AjaxResult applyUpdate(@RequestBody SchoolTeacherExperimentApplyVo schoolTeacherExperimentApply)
{ {
return toAjax(schoolTeacherExperimentApplyService.updateById(schoolTeacherExperimentApply)); return toAjax(schoolTeacherExperimentApplyService.teacherExperimentLabs(schoolTeacherExperimentApply));
} }
/** /**
...@@ -138,6 +159,10 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -138,6 +159,10 @@ public class ExperimentAdministratorsControoler extends BaseController {
return AjaxResult.success(classSituationVos); return AjaxResult.success(classSituationVos);
} }
/** /**
* 实验室完成详情 * 实验室完成详情
*/ */
......
package yangtz.cs.liu.wechat.controller.experiment; package yangtz.cs.liu.wechat.controller.experiment;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import java.util.Calendar;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo; import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolExperimentPlanVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
...@@ -34,6 +42,35 @@ public class ExperimentLevelController extends BaseController { ...@@ -34,6 +42,35 @@ public class ExperimentLevelController extends BaseController {
private ISchoolTeacherLabApplyService schoolTeacherLabApplyService; private ISchoolTeacherLabApplyService schoolTeacherLabApplyService;
@Autowired
private ISchoolGradeService schoolGradeService;
@Autowired
private ISchoolGradeService gradeService;
/**
* 获取当前学年+学期
*/
@GetMapping("/getSemester")
public AjaxResult getSemester(){
AjaxResult ajaxResult = AjaxResult.success();
Calendar cal = Calendar.getInstance();
//获取当前年月
int month = cal.get(Calendar.MONTH) + 1;
//设置当前学期
String term = "1";
//2-7为第二学期,8-1为第一学期
//如果当前月份小于8月,则该学年应为当前年-1 到 当前年,例如当前年月为2023年7月,则该学年为2022-2023年的第二学期
if (month >= 2 && month < 8) {
term = "2";
}
int schoolYear = schoolGradeService.isNewSchoolYear();
ajaxResult.put("semester",term);
ajaxResult.put("schoolYear",schoolYear);
return ajaxResult;
}
@Log(title = "年级实验室预约", businessType = BusinessType.INSERT) @Log(title = "年级实验室预约", businessType = BusinessType.INSERT)
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody SchoolLabClassYear schoolLabClassYear) public AjaxResult add(@RequestBody SchoolLabClassYear schoolLabClassYear)
...@@ -49,7 +86,7 @@ public class ExperimentLevelController extends BaseController { ...@@ -49,7 +86,7 @@ public class ExperimentLevelController extends BaseController {
@GetMapping("/pxperimentPlanList") @GetMapping("/pxperimentPlanList")
public AjaxResult pxperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo) public AjaxResult pxperimentPlanList(SchoolExperimentPlanVo schoolExperimentPlanVo)
{ {
return AjaxResult.success(schoolExperimentPlanService.selectSchoolExperimentPlanList(schoolExperimentPlanVo)); return AjaxResult.success(schoolExperimentPlanService.selectNameByVo(schoolExperimentPlanVo));
} }
/** /**
* 获取实验计划详细信息 * 获取实验计划详细信息
...@@ -60,13 +97,50 @@ public class ExperimentLevelController extends BaseController { ...@@ -60,13 +97,50 @@ public class ExperimentLevelController extends BaseController {
return AjaxResult.success(schoolExperimentPlanService.selectSchoolExperimentPlanById(id)); return AjaxResult.success(schoolExperimentPlanService.selectSchoolExperimentPlanById(id));
} }
@Log(title = "年级预约详情", businessType = BusinessType.INSERT)
@GetMapping("getInfo/{id}")
public AjaxResult getClassInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearById(id));
}
/**
* 获取人员级部
*/
@GetMapping("/getGrades")
public AjaxResult getGrade(SchoolLabClassYearVo schoolLabClassYearVo)
{ //获取最新学年
int schoolYear = gradeService.isNewSchoolYear();
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,schoolLabClassYearVo.getUserId()));
}
/**
* 获取学年下拉表
*/
@GetMapping("/gradeYear")
public AjaxResult gradeYear()
{
return AjaxResult.success(schoolLabClassYearService.getYearList());
}
/**
* 申报
*/
@PutMapping("/report")
public AjaxResult applyReport( @RequestBody SchoolLabClassYear schoolLabClassYear)
{
schoolLabClassYear.setDeclareState("1");
return toAjax(schoolLabClassYearService.updateById(schoolLabClassYear));
}
/** /**
*获取级部预约列表 *获取级部预约列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SchoolLabClassYearVo schoolLabClassYear) public AjaxResult list(SchoolLabClassYearVo schoolLabClassYear)
{ {
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear)); return AjaxResult.success(schoolLabClassYearService.getLabClassYear(schoolLabClassYear));
} }
/** /**
...@@ -122,7 +196,7 @@ public class ExperimentLevelController extends BaseController { ...@@ -122,7 +196,7 @@ public class ExperimentLevelController extends BaseController {
} }
/** /**
* 实验室完成详情 *实验室完成详情
*/ */
@GetMapping("/teacherExperimentList") @GetMapping("/teacherExperimentList")
public AjaxResult teacherExperimentList(ClassSituationVo classSituationVo){ public AjaxResult teacherExperimentList(ClassSituationVo classSituationVo){
...@@ -138,4 +212,13 @@ public class ExperimentLevelController extends BaseController { ...@@ -138,4 +212,13 @@ public class ExperimentLevelController extends BaseController {
return AjaxResult.success(teacherExperimentList); return AjaxResult.success(teacherExperimentList);
} }
/**
* 获取教师所在级部id
*/
@GetMapping("/getGrade/{userId}")
public AjaxResult getGrade(@PathVariable("userId") Long userId) {
return AjaxResult.success(schoolGradeService.getGradeId(userId));
}
} }
package yangtz.cs.liu.wechat.controller.experiment; package yangtz.cs.liu.wechat.controller.experiment;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.framework.util.UserInfoUtil;
import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
...@@ -55,11 +59,11 @@ public class TeacherExperimentController extends BaseController { ...@@ -55,11 +59,11 @@ public class TeacherExperimentController extends BaseController {
* 老师申请实验室 * 老师申请实验室
*/ */
@PostMapping("/add") @PostMapping("/add")
public AjaxResult add(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply) public AjaxResult add(@RequestBody SchoolTeacherLabApplyVo schoolTeacherLabApply)
{ {
schoolTeacherLabApply.setState("0"); schoolTeacherLabApply.setState("0");
schoolTeacherLabApply.setApplyState("0"); schoolTeacherLabApply.setApplyState("0");
return toAjax(schoolTeacherLabApplyService.save(schoolTeacherLabApply)); return toAjax(schoolTeacherLabApplyService.insertSchoolTeacherLabApplyVo(schoolTeacherLabApply));
} }
/** /**
* 获取实验计划详细信息 * 获取实验计划详细信息
...@@ -71,6 +75,34 @@ public class TeacherExperimentController extends BaseController { ...@@ -71,6 +75,34 @@ public class TeacherExperimentController extends BaseController {
} }
/** /**
* 获取实验室状态
*/
@GetMapping(value = "/getTeacherLab")
public AjaxResult getclassYearInfo(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
return AjaxResult.success(schoolTeacherLabApplyService.getTeacherLab(schoolTeacherLabApplyVo));
}
@Autowired
UserInfoUtil userInfoUtil;
@Autowired
ISysUserService userService;
/**
* 获取班级
*/
@GetMapping(value = "/getTeacherClass")
public AjaxResult getTeacherClass(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
Long userId = userInfoUtil.getMpLoginUser().getUserId();
SysUser sysUser = userService.selectUserById(userId);
return AjaxResult.success(schoolTeacherLabApplyService.getTeacherClass(schoolTeacherLabApplyVo,sysUser));
}
/**
* 实验室申请记录 * 实验室申请记录
*/ */
@GetMapping(value = "/list") @GetMapping(value = "/list")
......
package yangtz.cs.liu.wechat.controller.experiment;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.util.UserInfoUtil;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
/**
* 实验室
*/
@RestController
@RequestMapping("/wx/schoolLab")
public class WxSchoolLabControoler extends BaseController {
@Autowired
private ISchoolLabService schoolLabService;
@Autowired
private UserInfoUtil userInfoUtil;
/**
* 查询实验室列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolLabVo schoolLabVo)
{
startPage();
Long teacherUserId = userInfoUtil.getMpLoginUser().getUserId();
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo,teacherUserId);
return getDataTable(list);
}
/**
* 获取实验室详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(schoolLabService.selectSchoolLabById(id));
}
/**
* 新增实验室
*/
@Log(title = "实验室", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody SchoolLab schoolLab)
{
return toAjax(schoolLabService.insertSchoolLab(schoolLab));
}
/**
* 修改实验室
*/
@Log(title = "实验室", businessType = BusinessType.UPDATE)
@PutMapping("/edit")
public AjaxResult edit(@RequestBody SchoolLab schoolLab)
{
return toAjax(schoolLabService.updateSchoolLab(schoolLab));
}
/**
* 删除实验室
*/
@Log(title = "实验室", businessType = BusinessType.DELETE)
@PostMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(schoolLabService.deleteSchoolLabByIds(ids));
}
/**
* 获取实验室负责人下拉框
* @return
*/
@GetMapping("/getLabAdmin")
public AjaxResult getLabAdmin(){
return AjaxResult.success(schoolLabService.getLabAdmin());
}
/**
* 实验室管理员-获取学科下拉框
* @return
*/
@GetMapping("/getSub")
public AjaxResult getSub(){
return AjaxResult.success(schoolLabService.getSub());
}
}
...@@ -65,6 +65,34 @@ ...@@ -65,6 +65,34 @@
order by create_time DESC order by create_time DESC
</select> </select>
<select id="selectNameByVo" parameterType="SchoolExperimentPlanVo" resultType="Map">
SELECT id,experiment_name FROM school_experiment_plan
<where>
del_flag = '0'
<if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="gradeId != null "> and grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="isAppointment != null and isAppointment != ''"> and is_appointment = #{isAppointment}</if>
<if test="plannedStartTime != null and plannedStartTime != ''"> and planned_start_time = #{plannedStartTime}</if>
<if test="plannedEndTime != null and plannedEndTime != ''"> and planned_end_time = #{plannedEndTime}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="gradeIds != null">
and grade_id in
<foreach item="gradeId" collection="gradeIds" open="(" separator="," close=")">
#{gradeId}
</foreach>
</if>
</where>
order by create_time DESC
</select>
<select id="getExperimentList" parameterType="SchoolExperimentPlanVo" resultMap="SchoolExperimentPlanVoResult"> <select id="getExperimentList" parameterType="SchoolExperimentPlanVo" resultMap="SchoolExperimentPlanVoResult">
<include refid="selectSchoolExperimentPlanVo"/> <include refid="selectSchoolExperimentPlanVo"/>
<where> <where>
......
...@@ -274,16 +274,19 @@ ...@@ -274,16 +274,19 @@
left join school_lab_class_year lcy on lcy.experiment_plan_id = ep.id left join school_lab_class_year lcy on lcy.experiment_plan_id = ep.id
WHERE ep.del_flag=0 and epc.del_flag=0 AND ep.school_year = #{schoolYear} AND ep.semester=#{semester} WHERE ep.del_flag=0 and epc.del_flag=0 AND ep.school_year = #{schoolYear} AND ep.semester=#{semester}
and ep.grade_id = #{gradeId} and ep.grade_id = #{gradeId}
<if test="querText !=null and querText != ''">
concat(class_name ,experiment_time) LIKE like concat('%', #{querText}, '%')
</if>
GROUP BY epc.class_id GROUP BY epc.class_id
</select> </select>
<select id="getexperimentList" parameterType="ClassSituationVo" resultType="ClassSituationVo"> <select id="getexperimentList" parameterType="ClassSituationVo" resultType="ClassSituationVo">
SELECT ep.id,ep.experiment_name,ep.school_year,ep.grade, ep.semester,COUNT(pc.class_id) as count FROM school_experiment_plan ep SELECT ep.id,ep.experiment_name,ep.school_year,ep.grade,cy.id labClassYearId, ep.semester,COUNT(pc.class_id) as count,ep.sub FROM school_experiment_plan ep
LEFT JOIN school_experiment_plan_class pc on ep.id = pc.experiment_plan_id LEFT JOIN school_experiment_plan_class pc on ep.id = pc.experiment_plan_id
LEFT JOIN school_lab_class_year cy on cy.experiment_plan_id = ep.id
WHERE ep.school_year = #{schoolYear} AND ep.semester =#{semester} AND ep.del_flag = 0 AND pc.del_flag=0 WHERE ep.school_year = #{schoolYear} AND ep.semester =#{semester} AND ep.del_flag = 0 AND pc.del_flag=0
<if test="experimentName != null "> and ep.experiment_name like concat('%', #{experimentName}, '%') </if> <if test="querText != null "> and concat(ep.experiment_name,ep.grade ) like concat('%', #{querText}, '%') </if>
<if test="grade != null "> and ep.grade = #{grade}</if>
GROUP BY ep.id GROUP BY ep.id
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -49,27 +49,27 @@ ...@@ -49,27 +49,27 @@
from school_teacher_lab_apply tla from school_teacher_lab_apply tla
LEFT JOIN school_lab_class_year lcy ON tla.lab_class_year_id = lcy.id LEFT JOIN school_lab_class_year lcy ON tla.lab_class_year_id = lcy.id
<where> <where>
tla.del_flag = '0' del_flag = '0'
<if test="labClassYearId != null and labClassYearId != ''"> and tla.lab_class_year_id = #{labClassYearId}</if> <if test="labClassYearId != null and labClassYearId != ''"> and lab_class_year_id = #{labClassYearId}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and tla.experiment_classify = #{experimentClassify}</if> <if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentName != null and experimentName != ''"> and tla.experiment_name like concat('%', #{experimentName}, '%')</if> <if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="sub != null and sub != ''"> and tla.sub = #{sub}</if> <if test="sub != null and sub != ''"> and sub = #{sub}</if>
<if test="gradeId != null"> and tla.grade_id = #{gradeId}</if> <if test="gradeId != null"> and grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and tla.grade like concat('%', #{grade}, '%')</if> <if test="grade != null and grade != ''"> and grade like concat('%', #{grade}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and tla.school_year = #{schoolYear}</if> <if test="schoolYear != null and schoolYear != ''"> and school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and tla.semester = #{semester}</if> <if test="semester != null and semester != ''"> and semester = #{semester}</if>
<if test="classId != null and classId != ''"> and tla.class_id = #{classId}</if> <if test="classId != null and classId != ''"> and class_id = #{classId}</if>
<if test="className != null and className != ''"> and tla.class_name like concat('%', #{className}, '%')</if> <if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and tla.chapter_content = #{chapterContent}</if> <if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="startTime != null and endTime != null "> and tla.experiment_time between #{startTime} and #{endTime}</if> <if test="startTime != null and endTime != null "> and experiment_time between #{startTime} and #{endTime}</if>
<if test="section != null and section != ''"> and tla.section = #{section}</if> <if test="section != null and section != ''"> and section = #{section}</if>
<if test="labId != null "> and tla.lab_id = #{labId}</if> <if test="labId != null "> and lab_id = #{labId}</if>
<if test="labName != null and labName != ''"> and tla.lab_name like concat('%', #{labName}, '%')</if> <if test="labName != null and labName != ''"> and lab_name like concat('%', #{labName}, '%')</if>
<if test="applyState != null and applyState != ''"> and tla.apply_state = #{applyState}</if> <if test="applyState != null and applyState != ''"> and apply_state = #{applyState}</if>
<if test="applyId != null "> and tla.apply_id = #{applyId}</if> <if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and tla.apply_name like concat('%', #{applyName}, '%')</if> <if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and tla.apply_time = #{applyTime}</if> <if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="state != null "> and tla.state = #{state}</if> <if test="state != null "> and state = #{state}</if>
<if test="subs != null "> <if test="subs != null ">
and tla.sub in and tla.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")"> <foreach item="sub" collection="subs" open="(" separator="," close=")">
...@@ -307,7 +307,7 @@ ...@@ -307,7 +307,7 @@
</select> </select>
<select id="selectTeacherList" resultType="Map" parameterType="SchoolTeacherLabApply"> <select id="selectTeacherList" resultType="Map" parameterType="SchoolTeacherLabApply">
SELECT apply_name applyName,school_year schoolYear, SELECT apply_name applyName,school_year schoolYear,sub,
COUNT(CASE WHEN experiment_classify = 1 THEN experiment_classify END) as fzcount, COUNT(CASE WHEN experiment_classify = 1 THEN experiment_classify END) as fzcount,
COUNT(CASE WHEN experiment_classify = 2 THEN experiment_classify END) as sycount, COUNT(CASE WHEN experiment_classify = 2 THEN experiment_classify END) as sycount,
COUNT(CASE WHEN experiment_classify = 3 THEN experiment_classify END) as sjcount, COUNT(CASE WHEN experiment_classify = 3 THEN experiment_classify END) as sjcount,
......
...@@ -32,6 +32,14 @@ ...@@ -32,6 +32,14 @@
order by school_year asc order by school_year asc
</select> </select>
<select id="getYearList" resultType="String">
select sg.school_year from school_grade sg
where del_flag = '0'
GROUP BY sg.school_year
order by school_year asc
</select>
<select id="getGradeIdsByYear" resultType="java.lang.Long"> <select id="getGradeIdsByYear" resultType="java.lang.Long">
select distinct id from school_grade select distinct id from school_grade
where del_flag = '0' and school_year = #{schoolYear} where del_flag = '0' and school_year = #{schoolYear}
......
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