Commit 00bbdef8 by xuwenhao

9.17修改实验室代码

parent 01c1925b
......@@ -114,6 +114,7 @@ public class SchoolExperimentPlanController extends BaseController
List<SchoolExperimentPlanVo> list = schoolExperimentPlanService.selectSchoolExperimentPlanList(schoolExperimentPlanVo);
List<SchoolExperimentPlanVo> listNew = new ArrayList<>();
//去除用户所在级部和所在学科组不匹配的数据
if (StringUtils.isNotNull(schoolGradeMentors)){
for (SchoolExperimentPlanVo experimentPlanVo : list) {
......@@ -209,14 +210,26 @@ public class SchoolExperimentPlanController extends BaseController
}
/**
* 根据学年查询级部下拉框
* 查询级部下拉框
*/
@GetMapping("/getGrade/{schoolYear}")
public AjaxResult getGrade(@PathVariable("schoolYear") int schoolYear){
@GetMapping("/getGrade")
public AjaxResult getGrade(){
//获取最新学年
int schoolYear = schoolGradeService.isNewSchoolYear();
return AjaxResult.success(schoolExperimentPlanService.getGrade(schoolYear,null));
}
/**
* 查询级部下拉框(搜索条件)
*/
@GetMapping("/getGradeList")
public AjaxResult getGradeList(){
//获取最新学年
int schoolYear = schoolGradeService.isNewSchoolYear();
return AjaxResult.success(schoolExperimentPlanService.getGradeList(schoolYear));
}
/**
* 根据级部查询对应班级
*/
@GetMapping("/getClass/{gradeId}")
......
......@@ -196,7 +196,7 @@ public class SchoolLabClassYearController extends BaseController
List<SchoolLabClassYearRelation> schoolLabClassYearRelations = schoolLabClassYearRelationService.list(wrapper);
schoolLabClassYearVo.setSchoolLabClassYearRelationList(schoolLabClassYearRelations);
}
return AjaxResult.success();
return AjaxResult.success(schoolLabClassYearVo);
}
/**
......
......@@ -202,4 +202,14 @@ public class SchoolTeacherLabApplyController extends BaseController
public AjaxResult updateState(@RequestBody SchoolTeacherLabApply schoolTeacherLabApply){
return toAjax(schoolTeacherLabApplyService.updateState(schoolTeacherLabApply));
}
/**
* 实验室管理-查看实验室使用记录明细
*/
@GetMapping("/getLabUserDetial")
public TableDataInfo getLabUserDetial(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo){
startPage();
return getDataTable(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo));
}
}
......@@ -73,4 +73,7 @@ public class SchoolTeacherExperimentApply extends OurBaseEntity
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "申报时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 完成状态(0未完成,1已完成) */
private String state;
}
......@@ -106,6 +106,13 @@ public interface SchoolLabClassYearMapper extends BaseMapper<SchoolLabClassYear>
List<Long> seletLabId(@Param("labClassYearIds") List<Long> labClassYearIds);
/**
* 获取实验室id
* @param teacherExperimentIds
* @return
*/
List<Long> seletLabIds(@Param("teacherExperimentIds") List<Long> teacherExperimentIds);
/**
* 实验室管理-年级实验室预约查看详情
* @param id
* @return
......
package yangtz.cs.liu.campus.mapper.schoolLab;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
......@@ -33,6 +34,14 @@ public interface SchoolTeacherExperimentApplyMapper extends BaseMapper<SchoolTea
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 查询教师个人实验申请列表
*
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 教师个人实验申请集合
*/
public List<SchoolTeacherExperimentApplyVo> getTeacherList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 新增教师个人实验申请
*
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
......@@ -78,4 +87,11 @@ public interface SchoolTeacherExperimentApplyMapper extends BaseMapper<SchoolTea
* 删除教师个人实验申请实验室
*/
public int deleteSchoolTeacherExperimentApplyLabsId(Long id);
/**
* 批量新增附件信息
* @param list
* @return
*/
int batchSchoolAccessory(List<SchoolAccessory> list);
}
......@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.mapper.SysUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -83,10 +84,9 @@ public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMappe
throw new ServiceException("该分类编码已存在");
}
//父id
Long parentId = schoolProductCategory.getParentId();
if (null != parentId){
SchoolProductCategory schoolProductCategory1 = productCategoryMapper.selectById(parentId);
schoolProductCategory.setAncestors(schoolProductCategory1.getAncestors() + "," + parentId);
if (StringUtils.isNotNull(schoolProductCategory.getParentId())){
SchoolProductCategory schoolProductCategory1 = productCategoryMapper.selectById(schoolProductCategory.getParentId());
schoolProductCategory.setAncestors(schoolProductCategory1.getAncestors() + "," + schoolProductCategory.getParentId());
}else {
schoolProductCategory.setParentId((long) 0);
schoolProductCategory.setAncestors("0");
......@@ -108,6 +108,26 @@ public class ProductCategoryServiceImpl extends ServiceImpl<ProductCategoryMappe
@Override
@Transactional
public int updateSchoolProductCategory(SchoolProductCategory schoolProductCategory) {
//查询分类编码是否重复
LambdaQueryWrapper<SchoolProductCategory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolProductCategory::getClassificationCode,schoolProductCategory.getClassificationCode())
.notIn(SchoolProductCategory::getId,schoolProductCategory.getId());
List<SchoolProductCategory> schoolProductCategories = productCategoryMapper.selectList(wrapper);
if (schoolProductCategories != null && schoolProductCategories.size() > 0){
throw new ServiceException("该分类编码已存在");
}
//父id
if (StringUtils.isNotNull(schoolProductCategory.getParentId())){
SchoolProductCategory schoolProductCategory1 = productCategoryMapper.selectById(schoolProductCategory.getParentId());
schoolProductCategory.setAncestors(schoolProductCategory1.getAncestors() + "," + schoolProductCategory.getParentId());
}else {
schoolProductCategory.setParentId((long) 0);
schoolProductCategory.setAncestors("0");
}
String[] split = schoolProductCategory.getAncestors().split(",");
schoolProductCategory.setRank((long) split.length);
//根据用户id获取用户名
String userName = sysUserMapper.selectUserById(schoolProductCategory.getAdminId()).getUserName();
schoolProductCategory.setAdmin(userName);
......
......@@ -194,6 +194,20 @@ public class SchoolExperimentPlanServiceImpl extends ServiceImpl<SchoolExperimen
}
/**
* 查询级部(搜索条件)
* @param schoolYear
* @return
*/
@Override
public List<Map<String, Object>> getGradeList(int schoolYear) {
List<Map<String, Object>> gradeList = schoolExperimentPlanMapper.getGrade(schoolYear,null);
if(StringUtils.isNull(gradeList) || gradeList.size() == 0){
throw new ServiceException("当前学年为" + schoolYear + "学年,该学年没有级部信息");
}
return gradeList;
}
/**
* 根据级部查询对应班级
* @param gradeId
* @return
......
......@@ -24,9 +24,7 @@ import yangtz.cs.liu.campus.mapper.schoolLab.*;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLabClassYear;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolExperimentPlanService;
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.*;
/**
* 年级实验室预约Service业务层处理
......@@ -50,9 +48,10 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
private SchoolLabClassYearRelationMapper relationMapper;
@Autowired
private SchoolClassMapper schoolClassMapper;
@Autowired
private SchoolTeacherLabApplyMapper schoolTeacherLabApplyMapper;
@Autowired
private SchoolTeacherExperimentApplyMapper teacherExperimentApplyMapper;
/**
* 查询年级实验室预约
......@@ -275,7 +274,7 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
}
SchoolLabClassYear schoolLabClassYear = new SchoolLabClassYear();
BeanUtils.copyProperties(schoolLabClassYearVo,schoolLabClassYear);
return schoolLabClassYearMapper.updateById(schoolLabClassYear);
return schoolLabClassYearMapper.updateSchoolLabClassYear(schoolLabClassYear);
}
/**
......@@ -294,16 +293,28 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
LambdaQueryWrapper<SchoolLab> wrapper = new LambdaQueryWrapper<>();
List<SchoolLab> schoolLabs = schoolLabMapper.selectList(wrapper);
//查询所有已分配实验室的年级实验室预约
LambdaQueryWrapper<SchoolLabClassYear> lqw = new LambdaQueryWrapper<>();
lqw.eq(SchoolLabClassYear::getDeclareState,"3");
List<SchoolLabClassYear> schoolLabClassYears = schoolLabClassYearMapper.selectList(lqw);
List<String> declareStates = new ArrayList<>();
declareStates.add("2");
declareStates.add("3");
//查询所有已保存已分配实验室的年级实验室预约
SchoolLabClassYearVo labClassYearVo = new SchoolLabClassYearVo();
labClassYearVo.setDeclareStates(declareStates);
List<SchoolLabClassYearVo> schoolLabClassYears = schoolLabClassYearMapper.selectSchoolLabClassYearList(labClassYearVo);
//查询所有已保存已分配实验室的教师个人实验申请
SchoolTeacherExperimentApplyVo teacherExperimentApplyVo = new SchoolTeacherExperimentApplyVo();
teacherExperimentApplyVo.setDeclareStates(declareStates);
List<SchoolTeacherExperimentApplyVo> teacherExperimentApplyVoList = teacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(teacherExperimentApplyVo);
//在时间范围内的年级实验室预约id集合
List<Long> labClassYearIds = new ArrayList<>();
//在时间范围内的教师个人实验申请id集合
List<Long> teacherExperimentIds = new ArrayList<>();
//筛选在计划时间范围内的年级实验室预约
for (SchoolLabClassYear schoolLabClassYear : schoolLabClassYears) {
for (SchoolLabClassYearVo schoolLabClassYear : schoolLabClassYears) {
//开始时间
Date startTime = schoolLabClassYear.getPlannedStartTime();
//结束时间
......@@ -311,10 +322,43 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
if ((startTime.after(plannedStartTime) && startTime.before(plannedEndTime)) || (endTime.after(plannedStartTime) && endTime.before(plannedEndTime))){
labClassYearIds.add(schoolLabClassYear.getId());
}
if (startTime.equals(plannedStartTime) && endTime.equals(plannedEndTime)){
labClassYearIds.add(schoolLabClassYear.getId());
}
}
//筛选在计划时间范围内的教师个人实验申请
for (SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo : teacherExperimentApplyVoList) {
//开始时间
Date startTime = schoolTeacherExperimentApplyVo.getPlannedStartTime();
//结束时间
Date endTime = schoolTeacherExperimentApplyVo.getPlannedEndTime();
if ((startTime.after(plannedStartTime) && startTime.before(plannedEndTime)) || (endTime.after(plannedStartTime) && endTime.before(plannedEndTime))){
teacherExperimentIds.add(schoolTeacherExperimentApplyVo.getId());
}
if (startTime.equals(plannedStartTime) && endTime.equals(plannedEndTime)){
teacherExperimentIds.add(schoolTeacherExperimentApplyVo.getId());
}
}
List<Long> labIds = new ArrayList<>();
if (labClassYearIds.size() > 0){
//根据年级实验室预约主键id查询实验室id
List<Long> labIds = schoolLabClassYearMapper.seletLabId(labClassYearIds);
List<Long> seletLabId = schoolLabClassYearMapper.seletLabId(labClassYearIds);
if (seletLabId.size() > 0){
labIds.addAll(seletLabId);
}
}
if (teacherExperimentIds.size() > 0){
//根据教师个人实验申请主键id查询实验室id
List<Long> labIds1 = schoolLabClassYearMapper.seletLabIds(teacherExperimentIds);
if (labIds1.size() > 0){
labIds.addAll(labIds1);
}
}
if (labIds.size() > 0){
for (SchoolLab schoolLab : schoolLabs) {
Map<String, Object> map = new HashMap<>();
map.put("labId",schoolLab.getId());
......@@ -331,6 +375,7 @@ public class SchoolLabClassYearServiceImpl extends ServiceImpl<SchoolLabClassYea
}
return list;
}
for (SchoolLab schoolLab : schoolLabs) {
Map<String, Object> map = new HashMap<>();
map.put("labId",schoolLab.getId());
......
......@@ -14,6 +14,7 @@ import com.ruoyi.common.utils.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherExperimentApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply;
......@@ -57,6 +58,11 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
return schoolTeacherExperimentApplyMapper.selectSchoolTeacherExperimentApplyList(schoolTeacherExperimentApplyVo);
}
@Override
public List<SchoolTeacherExperimentApplyVo> getTeacherList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo) {
return schoolTeacherExperimentApplyMapper.getTeacherList(schoolTeacherExperimentApplyVo);
}
/**
* 新增教师个人实验申请
*
......@@ -138,4 +144,34 @@ public class SchoolTeacherExperimentApplyServiceImpl extends ServiceImpl<SchoolT
}
return schoolTeacherExperimentApplyMapper.updateSchoolTeacherExperimentApply(schoolTeacherExperimentApplyVo);
}
/**
* 上传实验结果附件
* @param schoolTeacherExperimentApplyVo
* @return
*/
@Override
public int experimentResult(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo) {
//教师个人实验申请id
Long id = schoolTeacherExperimentApplyVo.getId();
//附件信息集合
List<SchoolAccessory> schoolAccessoryList = schoolTeacherExperimentApplyVo.getSchoolAccessoryList();
List<SchoolAccessory> list = new ArrayList<>();
for (SchoolAccessory schoolAccessory : schoolAccessoryList) {
schoolAccessory.setBusinessId(id);
schoolAccessory.setModuleName("教师-教师个人实验申请");
schoolAccessory.setAccessoryType("教师个人实验结果附件");
schoolAccessory.setCreateBy(SecurityUtils.getLoginUser().getUser().getUserName());
schoolAccessory.setCreateTime(DateUtils.getNowDate());
list.add(schoolAccessory);
}
if (list.size() > 0){
schoolTeacherExperimentApplyMapper.batchSchoolAccessory(list);
}
SchoolTeacherExperimentApply schoolTeacherExperimentApply = new SchoolTeacherExperimentApply();
schoolTeacherExperimentApply.setId(id);
schoolTeacherExperimentApply.setState("1");
return schoolTeacherExperimentApplyMapper.updateById(schoolTeacherExperimentApply);
}
}
......@@ -23,6 +23,7 @@ import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherLabApply;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
import yangtz.cs.liu.campus.vo.schoolLab.ClassSituationVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
/**
......@@ -133,9 +134,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Override
public List<Map<String, Object>> getTeacherLab(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//判断实验时间是否在计划之间之内
LambdaQueryWrapper<SchoolLabClassYear> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYear::getId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolLabClassYear schoolLabClassYear = schoolLabClassYearMapper.selectOne(wrapper);
SchoolLabClassYearVo schoolLabClassYear = schoolLabClassYearMapper.selectSchoolLabClassYearById(schoolTeacherLabApplyVo.getLabClassYearId());
//计划开始时间
Date plannedStartTime = schoolLabClassYear.getPlannedStartTime();
//计划结束时间
......@@ -411,9 +410,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
throw new ServiceException("已存在该班级此次实验申请");
}
//判断实验时间是否在计划之间之内
LambdaQueryWrapper<SchoolLabClassYear> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYear::getId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolLabClassYear schoolLabClassYear = schoolLabClassYearMapper.selectOne(wrapper);
SchoolLabClassYearVo schoolLabClassYear = schoolLabClassYearMapper.selectSchoolLabClassYearById(schoolTeacherLabApplyVo.getLabClassYearId());
//计划开始时间
Date plannedStartTime = schoolLabClassYear.getPlannedStartTime();
//计划结束时间
......@@ -446,9 +443,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Transactional
public int updateSchoolTeacherLabApplyVo(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) {
//判断实验时间是否在计划之间之内
LambdaQueryWrapper<SchoolLabClassYear> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolLabClassYear::getId,schoolTeacherLabApplyVo.getLabClassYearId());
SchoolLabClassYear schoolLabClassYear = schoolLabClassYearMapper.selectOne(wrapper);
SchoolLabClassYearVo schoolLabClassYear = schoolLabClassYearMapper.selectSchoolLabClassYearById(schoolTeacherLabApplyVo.getLabClassYearId());
//计划开始时间
Date plannedStartTime = schoolLabClassYear.getPlannedStartTime();
//计划结束时间
......@@ -472,7 +467,7 @@ public class SchoolTeacherLabApplyServiceImpl extends ServiceImpl<SchoolTeacherL
@Override
public List<SchoolTeacherLabApplyVo> getTeacherExperimentList(ClassSituationVo one) {
SchoolTeacherLabApplyVo schoolTeacherLabApply = new SchoolTeacherLabApplyVo();
schoolTeacherLabApply.setLabClassYearId(one.getLabClassYearId().toString());
schoolTeacherLabApply.setLabClassYearId(one.getLabClassYearId());
schoolTeacherLabApply.setSchoolYear(one.getSchoolYear().toString());
schoolTeacherLabApply.setSemester(one.getSemester());
schoolTeacherLabApply.setExperimentTime(StringUtils.isNull(one.getExperimentTime())? null: new Date(one.getExperimentTime()));
......
......@@ -72,6 +72,13 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP
List<Map<String,Object>> getGrade(int schoolYear,Long userId);
/**
* 查询级部下拉框(搜索条件)
* @param schoolYear
* @return
*/
List<Map<String,Object>> getGradeList(int schoolYear);
/**
* 根据级部查询对应班级
* @param gradeId
* @return
......@@ -107,4 +114,6 @@ public interface ISchoolExperimentPlanService extends IService<SchoolExperimentP
* @return
*/
List<Map<String, Object>> gradeCountExperiment(SchoolExperimentPlanVo schoolExperimentPlanVo);
}
......@@ -31,6 +31,14 @@ public interface ISchoolTeacherExperimentApplyService extends IService<SchoolTea
public List<SchoolTeacherExperimentApplyVo> selectSchoolTeacherExperimentApplyList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 查询教师个人实验申请列表
*
* @param schoolTeacherExperimentApplyVo 教师个人实验申请
* @return 教师个人实验申请集合
*/
public List<SchoolTeacherExperimentApplyVo> getTeacherList(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 新增教师个人实验申请
*
* @param schoolTeacherExperimentApply 教师个人实验申请
......@@ -69,4 +77,10 @@ public interface ISchoolTeacherExperimentApplyService extends IService<SchoolTea
*/
int teacherExperimentLabs(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
/**
* 上传实验结果附件
* @param schoolTeacherExperimentApplyVo
* @return
*/
int experimentResult(SchoolTeacherExperimentApplyVo schoolTeacherExperimentApplyVo);
}
......@@ -87,6 +87,8 @@ public class SchoolLabClassYearVo extends BaseEntity
@Excel(name = "申报状态", readConverterExp = "0=未申报,1=已申报,2=已阅读,3=已分配")
private String declareState;
private List<String> declareStates;
/** 申报人id */
private Long applyId;
......
......@@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import yangtz.cs.liu.campus.domain.accessory.SchoolAccessory;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApplyLabs;
/**
......@@ -81,6 +82,8 @@ public class SchoolTeacherExperimentApplyVo extends BaseEntity
@Excel(name = "申报状态", readConverterExp = "0=未申报,1=已申报,2=已阅读,3=已分配")
private String declareState;
private List<String> declareStates;
/** 申报人id */
private Long applyId;
......@@ -93,6 +96,12 @@ public class SchoolTeacherExperimentApplyVo extends BaseEntity
@Excel(name = "申报时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date applyTime;
/** 完成状态(0未完成,1已完成) */
private String state;
/** 教师个人实验申请实验室列表 */
private List<SchoolTeacherExperimentApplyLabs> schoolTeacherExperimentApplyLabsList;
/** 附件信息集合 */
private List<SchoolAccessory> schoolAccessoryList;
}
......@@ -28,7 +28,7 @@ public class SchoolTeacherLabApplyVo extends BaseEntity
private Long id;
/** 年级实验室预约主键id */
private String labClassYearId;
private Long labClassYearId;
/** 教师id */
private Long teacherId;
......@@ -81,6 +81,10 @@ public class SchoolTeacherLabApplyVo extends BaseEntity
@Excel(name = "章节内容")
private String chapterContent;
/** 实验用品 */
@Excel(name = "实验用品")
private String experimentUseGoods;
/** 实验时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "实验时间", width = 30, dateFormat = "yyyy-MM-dd")
......
......@@ -72,6 +72,12 @@
#{gradeId}
</foreach>
</if>
<if test="declareStates != null">
and declare_state in
<foreach item="declareState" collection="declareStates" open="(" separator="," close=")">
#{declareState}
</foreach>
</if>
</where>
order by create_time DESC
</select>
......@@ -236,6 +242,13 @@
</foreach>
</select>
<select id="seletLabIds" resultType="Long">
select lab_id from school_teacher_experiment_apply_labs where del_flag = '0' and teacher_experiment_apply_id in
<foreach item="teacherExperimentId" collection="teacherExperimentIds" open="(" separator="," close=")">
#{teacherExperimentId}
</foreach>
</select>
<select id="getTeacherLabList" parameterType="SchoolLabClassYearVo" resultMap="SchoolLabClassYearVoResult">
<include refid="selectSchoolLabClassYearVo"/>
WHERE del_flag = '0'
......@@ -265,7 +278,6 @@
</select>
<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
LEFT JOIN school_experiment_plan_class pc on ep.id = pc.experiment_plan_id
......
......@@ -20,6 +20,7 @@
<result property="applyId" column="apply_id" />
<result property="applyName" column="apply_name" />
<result property="applyTime" column="apply_time" />
<result property="state" column="state" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
......@@ -28,7 +29,7 @@
</resultMap>
<sql id="selectSchoolTeacherExperimentApplyVo">
select id, sub, grade_id, grade, school_year, semester, planned_start_time, planned_end_time, experiment_name, experiment_classify, experiment_use_goods, declare_state, apply_id, apply_name, apply_time, create_by, create_time, update_by, update_time, del_flag from school_teacher_experiment_apply
select id, sub, grade_id, grade, school_year, semester, planned_start_time, planned_end_time, experiment_name, experiment_classify, experiment_use_goods, declare_state, apply_id, apply_name, apply_time, state, create_by, create_time, update_by, update_time, del_flag from school_teacher_experiment_apply
</sql>
<select id="selectSchoolTeacherExperimentApplyList" parameterType="SchoolTeacherExperimentApplyVo" resultMap="SchoolTeacherExperimentApplyVoResult">
......@@ -51,6 +52,43 @@
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="state != null "> and state = #{state}</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
<if test="declareStates != null">
and declare_state in
<foreach item="declareState" collection="declareStates" open="(" separator="," close=")">
#{declareState}
</foreach>
</if>
</where>
</select>
<select id="getTeacherList" parameterType="SchoolTeacherExperimentApplyVo" resultMap="SchoolTeacherExperimentApplyVoResult">
<include refid="selectSchoolTeacherExperimentApplyVo"/>
<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 = #{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="plannedStartTime != null and plannedEndTime != null">
and planned_start_time between #{plannedStartTime} and #{plannedEndTime}
and planned_end_time between #{plannedStartTime} and #{plannedEndTime}
</if>
<if test="experimentName != null and experimentName != ''"> and experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="experimentClassify != null and experimentClassify != ''"> and experiment_classify = #{experimentClassify}</if>
<if test="experimentUseGoods != null and experimentUseGoods != ''"> and experiment_use_goods = #{experimentUseGoods}</if>
<if test="declareState != null and declareState != ''"> and declare_state != #{declareState}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="state != null "> and state = #{state}</if>
<if test="subs != null ">
and sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
......@@ -82,6 +120,7 @@
<if test="applyId != null">apply_id,</if>
<if test="applyName != null">apply_name,</if>
<if test="applyTime != null">apply_time,</if>
<if test="state != null">state,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
......@@ -103,6 +142,7 @@
<if test="applyId != null">#{applyId},</if>
<if test="applyName != null">#{applyName},</if>
<if test="applyTime != null">#{applyTime},</if>
<if test="state != null">#{state},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
......@@ -128,6 +168,7 @@
<if test="applyId != null">apply_id = #{applyId},</if>
<if test="applyName != null">apply_name = #{applyName},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="state != null">state = #{state},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
......@@ -165,4 +206,11 @@
( #{item.id}, #{item.teacherExperimentApplyId}, #{item.labId},#{item.labName})
</foreach>
</insert>
<insert id="batchSchoolAccessory">
insert into school_accessory( id, business_id, module_name, accessory_type, accessory_url, accessory_name, create_by,create_time) values
<foreach item="item" index="index" collection="list" separator=",">
( 0, #{item.businessId}, #{item.moduleName}, #{item.accessoryType}, #{item.accessoryUrl}, #{item.accessoryName}, #{item.createBy}, #{item.createTime})
</foreach>
</insert>
</mapper>
\ No newline at end of file
......@@ -18,6 +18,7 @@
<result property="classId" column="class_id" />
<result property="className" column="class_name" />
<result property="chapterContent" column="chapter_content" />
<result property="experimentUseGoods" column="experiment_use_goods" />
<result property="experimentTime" column="experiment_time" />
<result property="section" column="section" />
<result property="labId" column="lab_id" />
......@@ -40,37 +41,43 @@
</sql>
<select id="selectSchoolTeacherLabApplyList" parameterType="SchoolTeacherLabApplyVo" resultMap="SchoolTeacherLabApplyVoResult">
<include refid="selectSchoolTeacherLabApplyVo"/>
select tla.id, tla.lab_class_year_id, tla.experiment_classify, tla.experiment_plan_id,
tla.experiment_name, tla.sub, tla.grade_id, tla.grade, tla.school_year,
tla.semester, tla.class_id, tla.class_name, tla.chapter_content, lcy.experiment_use_goods, tla.experiment_time,
tla.section, tla.lab_id, tla.lab_name, tla.apply_state, tla.apply_id, tla.apply_name, tla.apply_time,
tla.remark,tla.state, tla.create_by, tla.create_time, tla.update_by, tla.update_time, tla.del_flag
from school_teacher_lab_apply tla
LEFT JOIN school_lab_class_year lcy ON tla.lab_class_year_id = lcy.id
<where>
del_flag = '0'
<if test="labClassYearId != null and labClassYearId != ''"> and lab_class_year_id = #{labClassYearId}</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="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="classId != null and classId != ''"> and class_id = #{classId}</if>
<if test="className != null and className != ''"> and class_name like concat('%', #{className}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and chapter_content = #{chapterContent}</if>
<if test="startTime != null and endTime != null "> and experiment_time between #{startTime} and #{endTime}</if>
<if test="section != null and section != ''"> and section = #{section}</if>
<if test="labId != null "> and lab_id = #{labId}</if>
<if test="labName != null and labName != ''"> and lab_name like concat('%', #{labName}, '%')</if>
<if test="applyState != null and applyState != ''"> and apply_state = #{applyState}</if>
<if test="applyId != null "> and apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and apply_time = #{applyTime}</if>
<if test="state != null "> and state = #{state}</if>
tla.del_flag = '0'
<if test="labClassYearId != null and labClassYearId != ''"> and tla.lab_class_year_id = #{labClassYearId}</if>
<if test="experimentClassify != null and experimentClassify != ''"> and tla.experiment_classify = #{experimentClassify}</if>
<if test="experimentName != null and experimentName != ''"> and tla.experiment_name like concat('%', #{experimentName}, '%')</if>
<if test="sub != null and sub != ''"> and tla.sub = #{sub}</if>
<if test="gradeId != null"> and tla.grade_id = #{gradeId}</if>
<if test="grade != null and grade != ''"> and tla.grade like concat('%', #{grade}, '%')</if>
<if test="schoolYear != null and schoolYear != ''"> and tla.school_year = #{schoolYear}</if>
<if test="semester != null and semester != ''"> and tla.semester = #{semester}</if>
<if test="classId != null and classId != ''"> and tla.class_id = #{classId}</if>
<if test="className != null and className != ''"> and tla.class_name like concat('%', #{className}, '%')</if>
<if test="chapterContent != null and chapterContent != ''"> and tla.chapter_content = #{chapterContent}</if>
<if test="startTime != null and endTime != null "> and tla.experiment_time between #{startTime} and #{endTime}</if>
<if test="section != null and section != ''"> and tla.section = #{section}</if>
<if test="labId != null "> and tla.lab_id = #{labId}</if>
<if test="labName != null and labName != ''"> and tla.lab_name like concat('%', #{labName}, '%')</if>
<if test="applyState != null and applyState != ''"> and tla.apply_state = #{applyState}</if>
<if test="applyId != null "> and tla.apply_id = #{applyId}</if>
<if test="applyName != null and applyName != ''"> and tla.apply_name like concat('%', #{applyName}, '%')</if>
<if test="applyTime != null "> and tla.apply_time = #{applyTime}</if>
<if test="state != null "> and tla.state = #{state}</if>
<if test="subs != null ">
and sub in
and tla.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where>
order by create_time DESC
order by tla.create_time DESC
</select>
<select id="selectSchoolTeacherLabApplyById" parameterType="Long" resultMap="SchoolTeacherLabApplyVoResult">
......@@ -243,7 +250,10 @@
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 state = 1 THEN state END) ywccount
FROM school_teacher_lab_apply WHERE school_year = #{schoolYear} AND semester = #{semester}
FROM school_teacher_lab_apply WHERE school_year = #{schoolYear}
<if test="semester != null and semester != ''">
AND semester = #{semester}
</if>
<if test="applyName != null and applyName != ''">
AND apply_name like concat('%', #{applyName}, '%')
</if>
......
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