Commit e97c1447 by baochunxin

#G:10.24问题修复

parent 9ab57d6d
...@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil; ...@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import yangtz.cs.liu.campus.controller.A;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService; import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
...@@ -60,12 +61,34 @@ public class TeacherFilesController extends BaseController ...@@ -60,12 +61,34 @@ public class TeacherFilesController extends BaseController
} }
/** /**
* 老师查看自己的档案任务 * 新增教师档案
* @param
* @return
*/
@GetMapping("/teacherAdd/{ids}")
public AjaxResult teacherAdd(Long[] ids){
return AjaxResult.success(teacherFilesService.teacherAdd(ids));
}
/**
* 获取教师列表
* @param
* @return
*/
@GetMapping("/getTeacherRocer/{tId}")
public AjaxResult getTeacherRocer(@PathVariable("tId") String tId){
return AjaxResult.success(teacherFilesService.getTeacherRocer(tId));
}
/**
*
* @param userId
* @param
* @return
*/ */
@GetMapping("getTeachList/{userId}") @GetMapping("getTeachList/{userId}")
public TableDataInfo teachList(@PathVariable("userId") Long userId){ public TableDataInfo teachList(@PathVariable("userId") Long userId,TeacherFilesNotice teacherFilesNotice){
startPage(); startPage();
List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(userId); List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(userId,teacherFilesNotice);
return getDataTable(teacherFilesNotices); return getDataTable(teacherFilesNotices);
} }
...@@ -127,7 +150,6 @@ public class TeacherFilesController extends BaseController ...@@ -127,7 +150,6 @@ public class TeacherFilesController extends BaseController
return toAjax(teacherFilesService.deleteTeacherFilesByIds(ids)); return toAjax(teacherFilesService.deleteTeacherFilesByIds(ids));
} }
/** /**
* 教师档案同步 * 教师档案同步
*/ */
...@@ -139,27 +161,34 @@ public class TeacherFilesController extends BaseController ...@@ -139,27 +161,34 @@ public class TeacherFilesController extends BaseController
return toAjax(teacherFilesService.synchronous(id)); return toAjax(teacherFilesService.synchronous(id));
} }
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')") @PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')")
@Log(title = "教师档案审核通过", businessType = BusinessType.UPDATE) @Log(title = "教师档案审核通过", businessType = BusinessType.UPDATE)
@PutMapping("/passThrough/{id}") @PutMapping("/passThrough/{id}")
public AjaxResult passThrough(@PathVariable("id") Long id) public AjaxResult passThrough(@PathVariable("id") Long[] id)
{ {
Integer date = null;
for (int i = 0 ; i< id.length ; i++){
TeacherFiles teacherFiles = new TeacherFiles(); TeacherFiles teacherFiles = new TeacherFiles();
teacherFiles.setId(id); teacherFiles.setId(id[i]);
teacherFiles.setState("5"); teacherFiles.setState("5");
return toAjax(teacherFilesService.updateTeacherFiles(teacherFiles)); date = teacherFilesService.updateTeacherFiles(teacherFiles);
}
return toAjax(date);
} }
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')") @PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')")
@Log(title = "教师档案审核驳回", businessType = BusinessType.UPDATE) @Log(title = "教师档案审核驳回", businessType = BusinessType.UPDATE)
@PutMapping("/reject/{id}") @PutMapping("/reject/{id}")
public AjaxResult reject(@PathVariable("id") Long id) public AjaxResult reject(@PathVariable("id") Long[] id)
{ {
TeacherFiles teacherFiles = new TeacherFiles(); Integer date = null;
teacherFiles.setId(id); for (int i = 0 ; i< id.length ; i++){
teacherFiles.setState("9"); TeacherFiles teacherFiles = new TeacherFiles();
return toAjax(teacherFilesService.updateTeacherFiles(teacherFiles)); teacherFiles.setId(id[i]);
teacherFiles.setState("9");
date = teacherFilesService.updateTeacherFiles(teacherFiles);
}
return toAjax(date);
} }
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')") @PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')")
......
...@@ -48,6 +48,10 @@ public class SchoolEquipmentRepair extends OurBaseEntity ...@@ -48,6 +48,10 @@ public class SchoolEquipmentRepair extends OurBaseEntity
/** 修理人 */ /** 修理人 */
private String repairName; private String repairName;
/**
* 地点
*/
private String place;
/** 修理人联系方式 */ /** 修理人联系方式 */
private Long repairPhone; private Long repairPhone;
......
package yangtz.cs.liu.campus.domain.teacherFiles;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 教师档案删除对象 TeacherFilesDeletRecord
*
* @author ruoyi
* @date 2023-09-05
*/
@Data
public class TeacherFilesDeletRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
* id
*/
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 通知id
*/
private String tId;
/**
* 级部id
*/
private Long gId;
/**
* 身份证
*/
private String tel;
/**
* 级部
*/
private String gruoName;
/**
*用户名称
*/
private String userName;
}
...@@ -50,9 +50,12 @@ public interface CirculationMapper extends BaseMapper<SchoolCirculation> { ...@@ -50,9 +50,12 @@ public interface CirculationMapper extends BaseMapper<SchoolCirculation> {
SchoolCirculationVo getSchoolCirculationVoById(@Param("id")Long id); SchoolCirculationVo getSchoolCirculationVoById(@Param("id")Long id);
@Select("SELECT sc.id,el.encode,sc.equipment_id,el.equipment_name,el.model,sc.borrow_time,sc.borrow_by_id,sc.borrow_by,sc.purpose,sc.deadline,sc.return_state,el.is_lend,sc.return_time,sc.return_equipment_condition,sc.received_by_id,sc.received_by,sc.yjuse_time,sc.sjuse_time,sc.remark from school_equipment_ledger el LEFT JOIN school_circulation sc on el.id = sc.equipment_id \n" @Select("SELECT sc.id,el.encode,sc.equipment_id,el.equipment_name,el.model,sc.borrow_time,sc.borrow_by_id,sc.borrow_by,sc.purpose,sc.deadline,sc.return_state,sc.yjuse_time,sc.sjuse_time,el.is_lend,sc.return_time,sc.return_equipment_condition,sc.received_by_id,sc.received_by,sc.yjuse_time,sc.sjuse_time,sc.remark from school_equipment_ledger el LEFT JOIN school_circulation sc on el.id = sc.equipment_id \n"
+ "WHERE el.encode = #{encode} AND sc.return_state=0 and el.del_flag=0") + "WHERE el.encode = #{encode} AND sc.return_state=0 and el.del_flag=0")
SchoolCirculationVo getSchoolCirculationVoByenCode(@Param("encode")String encode); SchoolCirculationVo getSchoolCirculationVoByenCode(@Param("encode")String encode);
@Select("SELECT sc.id,el.encode,sc.equipment_id,el.equipment_name,sc.return_equipment_condition ,el.model,sc.borrow_time,sc.borrow_by_id,sc.borrow_by,sc.purpose,sc.deadline,sc.return_state,el.is_lend,sc.return_time,sc.return_equipment_condition,sc.received_by_id,sc.received_by,sc.yjuse_time,sc.sjuse_time,sc.remark from school_circulation sc LEFT JOIN school_equipment_ledger el on el.id = sc.equipment_id WHERE sc.id=#{id} and el.del_flag=0")
SchoolCirculationVo getReturningEquipmentById(@Param("id")String id);
} }
...@@ -14,7 +14,7 @@ import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolReceiveQuery; ...@@ -14,7 +14,7 @@ import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolReceiveQuery;
public interface EquipmentRepairMapper extends BaseMapper<SchoolEquipmentRepair> { public interface EquipmentRepairMapper extends BaseMapper<SchoolEquipmentRepair> {
@Select("SELECT er.id,er.equipment_id,el.encode,el.equipment_name,er.dispose_state,el.model,el.date_of_production,el.place ,\n" @Select("SELECT er.id,er.equipment_id,el.encode,el.equipment_name,er.dispose_state,er.place,el.model,el.date_of_production,el.place ,\n"
+ "el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,\n" + "el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,\n"
+ "er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark\n" + "er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark\n"
+ "FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id WHERE er.id=#{id} and er.del_flag=0") + "FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id WHERE er.id=#{id} and er.del_flag=0")
...@@ -24,7 +24,7 @@ public interface EquipmentRepairMapper extends BaseMapper<SchoolEquipmentRepair> ...@@ -24,7 +24,7 @@ public interface EquipmentRepairMapper extends BaseMapper<SchoolEquipmentRepair>
public List<SchoolEquipmentRepairVo> getMaintenanceList(SchoolReceiveQuery schoolReceiveQuery); public List<SchoolEquipmentRepairVo> getMaintenanceList(SchoolReceiveQuery schoolReceiveQuery);
@Select("SELECT er.id,er.equipment_id,el.encode,er.dispose_state,el.equipment_name,el.model,el.date_of_production,el.place ,\n" @Select("SELECT er.id,er.equipment_id,el.encode,er.dispose_state,el.equipment_name,el.model,el.date_of_production,el.place ,\n"
+ "el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,\n" + "el.classification_code,er.report_repair_time,er.place,er.report_repair_id,er.report_repair,er.problem,\n"
+ "er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark\n" + "er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark\n"
+ "FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id where er.del_flag=0 ") + "FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id where er.del_flag=0 ")
public List<SchoolEquipmentRepairVo> getlist(); public List<SchoolEquipmentRepairVo> getlist();
......
package yangtz.cs.liu.campus.mapper.teacherFiles;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesDeletRecord;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO;
import java.util.List;
import java.util.Map;
/**
* 教师档案删除记录mapper
*
* @author ruoyi
* @date 2023-09-06
*/
@Mapper
public interface TeacherFilesDeletRecordMapper
{
/**
* 添加记录
*/
@Insert("insert into teacher_file_delet_record (user_id,tel,gruo_name,user_name,t_id,g_id) VALUES (#{userId},#{tel},#{gruoName},#{userName},#{tId},#{gId}) ")
public Integer addTeacherFilesDeletRecord(TeacherFilesDeletRecord teacherFilesDeletRecord);
/**
* 删除记录
*/
@Delete("delete from teacher_file_delet_record where id =#{id} ")
public Integer deletRecord(Long id);
/**
* 查询老师
* @param tId
* @return
*/
@Select("select * from teacher_file_delet_record where t_id =#{tId} ")
public List<TeacherFilesDeletRecord> getTeacherRocer(String tId);
@Select("select * from teacher_file_delet_record where id =#{id} ")
public TeacherFilesDeletRecord getByid(Long id);
}
...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.mapper.teacherFiles; ...@@ -2,6 +2,7 @@ package yangtz.cs.liu.campus.mapper.teacherFiles;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNoticeTotal; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNoticeTotal;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo; import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo;
...@@ -42,8 +43,7 @@ public interface TeacherFilesNoticeMapper ...@@ -42,8 +43,7 @@ public interface TeacherFilesNoticeMapper
public int insertTeacherFilesNotice(TeacherFilesNotice teacherFilesNotice); public int insertTeacherFilesNotice(TeacherFilesNotice teacherFilesNotice);
@Select("SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId} and fn.notice_state = 2") public List<TeacherFilesNotice> selctTeacherByUserId(@Param("userId") Long userId, @Param("teacherFiles") TeacherFilesNotice teacherFiles);
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId);
/** /**
* 修改教师档案通知 * 修改教师档案通知
......
...@@ -50,6 +50,10 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo ...@@ -50,6 +50,10 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo
public SchoolCirculationVo getSchoolCirculationVoByenCode(String enCode) { public SchoolCirculationVo getSchoolCirculationVoByenCode(String enCode) {
return circulationMapper.getSchoolCirculationVoByenCode(enCode); return circulationMapper.getSchoolCirculationVoByenCode(enCode);
} }
@Override
public SchoolCirculationVo getReturningEquipmentById(String id) {
return circulationMapper.getReturningEquipmentById(id);
}
/** /**
......
...@@ -10,9 +10,12 @@ import com.ruoyi.system.mapper.SysUserMapper; ...@@ -10,9 +10,12 @@ import com.ruoyi.system.mapper.SysUserMapper;
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;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabClassYearMapper;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoolLabMapper;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -33,6 +36,8 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab> ...@@ -33,6 +36,8 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
@Autowired @Autowired
private SysUserMapper sysUserMapper; private SysUserMapper sysUserMapper;
@Autowired
private SchoolLabClassYearMapper schoolLabClassYearMapper;
/** /**
* 查询实验室 * 查询实验室
* *
......
package yangtz.cs.liu.campus.service.impl.teacherFiles; package yangtz.cs.liu.campus.service.impl.teacherFiles;
import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.TermRange; import com.ruoyi.common.utils.TermRange;
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.award.Award; import yangtz.cs.liu.campus.domain.award.Award;
import yangtz.cs.liu.campus.domain.material.Material; import yangtz.cs.liu.campus.domain.material.Material;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClass;
import yangtz.cs.liu.campus.domain.schoolClass.SchoolClassMentor;
import yangtz.cs.liu.campus.domain.teacherFiles.*; import yangtz.cs.liu.campus.domain.teacherFiles.*;
import yangtz.cs.liu.campus.domain.thesis.Thesis; import yangtz.cs.liu.campus.domain.thesis.Thesis;
import yangtz.cs.liu.campus.domain.training.Training; import yangtz.cs.liu.campus.domain.training.Training;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMapper;
import yangtz.cs.liu.campus.mapper.schoolClass.SchoolClassMentorMapper;
import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.mapper.teacher.SchoolTeacherMapper;
import yangtz.cs.liu.campus.mapper.teacherFiles.*; import yangtz.cs.liu.campus.mapper.teacherFiles.*;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService; import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
import yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo;
import java.util.HashMap; import java.text.SimpleDateFormat;
import java.util.List; import java.util.*;
import java.util.Map;
/** /**
...@@ -44,7 +52,18 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService ...@@ -44,7 +52,18 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Autowired @Autowired
private TeacherFilesNoticeMapper teacherFilesNoticeMapper; private TeacherFilesNoticeMapper teacherFilesNoticeMapper;
@Autowired
private TeacherFilesDeletRecordMapper teacherFilesDeletRecordMapper;
@Autowired
private SchoolClassMapper schoolClassMapper;
@Autowired
private SchoolTeacherMapper schoolTeacherMapper;
@Autowired
private SchoolGradeMapper gradeMapper;
@Autowired
private SchoolClassMentorMapper classMentorMapper;
/** /**
* 查询教师档案 * 查询教师档案
* *
...@@ -76,8 +95,8 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService ...@@ -76,8 +95,8 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Override @Override
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId) { public List<TeacherFilesNotice> selctTeacherByUserId(Long userId,TeacherFilesNotice teacherFiles) {
return teacherFilesNoticeMapper.selctTeacherByUserId(userId); return teacherFilesNoticeMapper.selctTeacherByUserId(userId,teacherFiles);
} }
/** /**
...@@ -113,7 +132,91 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService ...@@ -113,7 +132,91 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Override @Override
public int deleteTeacherFilesByIds(Long[] ids) public int deleteTeacherFilesByIds(Long[] ids)
{ {
return teacherFilesMapper.deleteTeacherFilesByIds(ids); //1.保留人员到删除信息表中
for (int i=0 ; i < ids.length ;i++){
TeacherFilesVO teacherFilesVO = teacherFilesMapper.selectTeacherFilesById(ids[i]);
TeacherFilesDeletRecord teacherFilesDeletRecord = new TeacherFilesDeletRecord();
teacherFilesDeletRecord.setTel(teacherFilesVO.getIdCard() == null ? "" : teacherFilesVO.getIdCard());
teacherFilesDeletRecord.setUserName(teacherFilesVO.getTeacherName());
teacherFilesDeletRecord.setGruoName(teacherFilesVO.getGradeName());
teacherFilesDeletRecord.setUserId(teacherFilesVO.getTeacherId());
teacherFilesDeletRecord.setTId(teacherFilesVO.getNoticeId());
teacherFilesDeletRecord.setGId(teacherFilesVO.getGradeId());
teacherFilesDeletRecordMapper.addTeacherFilesDeletRecord(teacherFilesDeletRecord);
}
//2.删除人员
int i = teacherFilesMapper.deleteTeacherFilesByIds(ids);
return i;
}
/**
* 查询老师
* @param tId
* @return
*/
@Override
public List<TeacherFilesDeletRecord> getTeacherRocer(String tId) {
List<TeacherFilesDeletRecord> teacherRocer = teacherFilesDeletRecordMapper.getTeacherRocer(tId);
return teacherRocer;
}
/**
* 新增老师数据
* @param ids
* @return
*/
@Override
public Integer teacherAdd(Long[] ids) {
List<TeacherFiles> teacherFilesList = new ArrayList<>();
for (int i =0; i< ids.length ;i++){
TeacherFilesDeletRecord byid = teacherFilesDeletRecordMapper.getByid(ids[i]);
TeacherFilesNotice teacherFilesNotice = teacherFilesNoticeMapper.selectTeacherFilesNoticeById(byid.getTId().toString());
List<SchoolClassVo> schoolClassVos = schoolClassMapper.selectTeacherByTeachId(byid.getUserId());
String teahClassName = null;
String className = null;
//只取第一个
if (!schoolClassVos.isEmpty()){
teahClassName = schoolClassVos.get(0).getClassName();
className = schoolClassVos.get(0).getClassName();
}
//班主任信息
TeacherFiles teacherFiles = new TeacherFiles();
teacherFiles.setTeacherId(byid.getUserId());
teacherFiles = teacherFilesAddXx(teacherFiles);
teacherFiles.setNoticeId(byid.getTId().toString());
teacherFiles.setFilesSemester(teacherFilesNotice.getNoticeYear()+"学年"+teacherFilesNotice.getNoticeSemester());
teacherFiles.setGradeId(byid.getGId());
teacherFiles.setGradeName(byid.getGruoName());
teacherFiles.setBzrClassName(teahClassName);
teacherFiles.setState("2");
teacherFiles = teacherFilesAddXx(teacherFiles); //老师个人信息
//找到老师课程
// TODO 修改最新学年
int schoolYear = gradeMapper.isNewSchoolYear();
List<SchoolClassMentor> mentorByTeacherId = classMentorMapper.getMentorByTeacherId(byid.getUserId(), schoolYear);
if (!mentorByTeacherId.isEmpty()){
teacherFiles.setCourseName(mentorByTeacherId.get(0).getCourseName());
if (StringUtils.isEmpty(className)){
//根据课程关联找寻班级
SchoolClass schoolClass = schoolClassMapper.selectById(mentorByTeacherId.get(0).getClassId());
className = schoolClass.getClassName();
}
}
teacherFiles.setClassName(className);
teacherFilesList.add(teacherFiles);
teacherFilesDeletRecordMapper.deletRecord(ids[i]);
}
//导入数据库
teacherFilesList.forEach(date->{
teacherFilesMapper.insertTeacherFiles(date);
});
//删除id
return 1;
} }
/** /**
...@@ -185,4 +288,24 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService ...@@ -185,4 +288,24 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
public List<Long> getGradeId(Long teacherId) { public List<Long> getGradeId(Long teacherId) {
return teacherFilesMapper.getGradeId(teacherId); return teacherFilesMapper.getGradeId(teacherId);
} }
TeacherFiles teacherFilesAddXx(TeacherFiles teacherFiles){
SchoolTeacher schoolTeacher = schoolTeacherMapper.selectSchoolTeacherById(teacherFiles.getTeacherId());
teacherFiles.setTeacherName(schoolTeacher.getTeacherName());
teacherFiles.setIdCard(schoolTeacher.getIdCard());
teacherFiles.setSex(schoolTeacher.getSex());
teacherFiles.setEducation(schoolTeacher.getEducation());
Date birthday = schoolTeacher.getBirthday();
if(birthday!=null){
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy");
Integer birthdayYear = Integer.valueOf(dateFormat.format(birthday));
Date date = new Date();
Integer nowYear = Integer.valueOf(dateFormat.format(date));
teacherFiles.setAge(nowYear-birthdayYear);
}
teacherFiles.setTitle("");
teacherFiles.setAppearance("");
return teacherFiles;
}
} }
...@@ -15,6 +15,9 @@ public interface ICirculationService extends IService<SchoolCirculation> { ...@@ -15,6 +15,9 @@ public interface ICirculationService extends IService<SchoolCirculation> {
SchoolCirculationVo getSchoolCirculationVoById(Long id); SchoolCirculationVo getSchoolCirculationVoById(Long id);
SchoolCirculationVo getSchoolCirculationVoByenCode(String enCode); SchoolCirculationVo getSchoolCirculationVoByenCode(String enCode);
SchoolCirculationVo getReturningEquipmentById(String id);
/** /**
* 查看设备借出归还列表 * 查看设备借出归还列表
* @param schoolCirculationVo * @param schoolCirculationVo
......
package yangtz.cs.liu.campus.service.teacherFiles; package yangtz.cs.liu.campus.service.teacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesDeletRecord;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO;
...@@ -29,7 +30,15 @@ public interface ITeacherFilesService ...@@ -29,7 +30,15 @@ public interface ITeacherFilesService
* @return 教师档案集合 * @return 教师档案集合
*/ */
public List<TeacherFiles> selectTeacherFilesList(TeacherFiles teacherFiles); public List<TeacherFiles> selectTeacherFilesList(TeacherFiles teacherFiles);
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId); public List<TeacherFilesNotice> selctTeacherByUserId(Long userId,TeacherFilesNotice teacherFiles);
public List<TeacherFilesDeletRecord> getTeacherRocer(String tId);
/**
* 新增教师档案
* @param ids
* @return
*/
public Integer teacherAdd(Long[] ids);
/** /**
* 新增教师档案 * 新增教师档案
......
...@@ -5,6 +5,7 @@ import cn.hutool.http.HttpUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.common.core.domain.entity.SchoolTeacher; import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
...@@ -304,11 +305,19 @@ public class DingJiaXiaoController { ...@@ -304,11 +305,19 @@ public class DingJiaXiaoController {
} }
SchoolTeacher classHeadTeacher = schoolTeacherCopies.get(0); SchoolTeacher classHeadTeacher = schoolTeacherCopies.get(0);
if ("1".equals(teachDate.getIsAdviser())){ if ("1".equals(teachDate.getIsAdviser())){
//当前老师是班主任 记录班主任跟班级关系 //查询数据库中是否有 没有新增
SchoolClassHeadmaster schoolClassHeadmaster = new SchoolClassHeadmaster(); LambdaQueryWrapper<SchoolClassHeadmaster> lqw=new LambdaQueryWrapper<>();
schoolClassHeadmaster.setTeacherId(classHeadTeacher.getId()); lqw.eq(SchoolClassHeadmaster::getTeacherId,classHeadTeacher.getId());
schoolClassHeadmaster.setClassId(date.getId()); lqw.eq(SchoolClassHeadmaster::getClassId,date.getId());
iSchoolClassHeadmasterService.save(schoolClassHeadmaster); List<SchoolClassHeadmaster> list = iSchoolClassHeadmasterService.list(lqw);
if (list.isEmpty()){
//当前老师是班主任 记录班主任跟班级关系
SchoolClassHeadmaster schoolClassHeadmaster = new SchoolClassHeadmaster();
schoolClassHeadmaster.setTeacherId(classHeadTeacher.getId());
schoolClassHeadmaster.setClassId(date.getId());
iSchoolClassHeadmasterService.save(schoolClassHeadmaster);
}
//设置班级 班主任信息 //设置班级 班主任信息
SchoolClass schoolClassss = new SchoolClass(); SchoolClass schoolClassss = new SchoolClass();
schoolClassss.setId(date.getId()); schoolClassss.setId(date.getId());
...@@ -317,44 +326,89 @@ public class DingJiaXiaoController { ...@@ -317,44 +326,89 @@ public class DingJiaXiaoController {
schoolClassss.setTeacherTel(classHeadTeacher.getTeacherTel()); schoolClassss.setTeacherTel(classHeadTeacher.getTeacherTel());
iSchoolClassService.updateById(schoolClassss); iSchoolClassService.updateById(schoolClassss);
}else { }else {
//查找部门 课程没有编写 //查找部门 课程没有编写
SysUser sysUser = sysUserService.selectUserById(classHeadTeacher.getId()); SysUser sysUser = sysUserService.selectUserById(classHeadTeacher.getId());
String deptName = sysUser.getDept().getDeptName(); String deptName = sysUser.getDept().getDeptName();
//根据部门查找课程信息 //根据部门查找课程信息
SchoolCurriculum schoolCurriculum = schoolCurriculumMapper.selectCourseName(deptName); SchoolCurriculum schoolCurriculum = schoolCurriculumMapper.selectCourseName(deptName);
//任课老师 跟班级关系
SchoolClassMentor schoolClassMentor = new SchoolClassMentor(); LambdaQueryWrapper<SchoolClassMentor> lqw=new LambdaQueryWrapper<>();
schoolClassMentor.setTeacherId(classHeadTeacher.getId()); lqw.eq(SchoolClassMentor::getTeacherId,classHeadTeacher.getId());
schoolClassMentor.setClassId(date.getId()); lqw.eq(SchoolClassMentor::getClassId,date.getId());
schoolClassMentor.setCourseName(schoolCurriculum.getCourseName()); List<SchoolClassMentor> list = schoolClassMentorService.list(lqw);
schoolClassMentor.setCourseId(schoolCurriculum.getId()); if (list.isEmpty()){
schoolClassMentorService.save(schoolClassMentor); //任课老师 跟班级关系
SchoolClassMentor schoolClassMentor = new SchoolClassMentor();
schoolClassMentor.setTeacherId(classHeadTeacher.getId());
schoolClassMentor.setClassId(date.getId());
schoolClassMentor.setCourseName(schoolCurriculum.getCourseName());
schoolClassMentor.setCourseId(schoolCurriculum.getId());
schoolClassMentorService.save(schoolClassMentor);
}else {
SchoolClassMentor schoolClassMentor = list.get(0);
schoolClassMentor.setCourseName(schoolCurriculum.getCourseName());
schoolClassMentor.setCourseId(schoolCurriculum.getId());
schoolClassMentorService.updateById(schoolClassMentor);
}
} }
} }
} else if (type.equals("student")) { } else if (type.equals("student")) {
//学生 //学生
studentUserInfos = this.addUserList(token, type, date.getDdClassId()); studentUserInfos = this.addUserList(token, type, date.getDdClassId());
for (DingJiaXiaoVo.StudentUserInfo studentDte : studentUserInfos) { for (DingJiaXiaoVo.StudentUserInfo studentDte : studentUserInfos) {
//学生信息 //当前是否有这个学生
SchoolStudent schoolStudent = new SchoolStudent(); Long ddUserId = null;
schoolStudent.setStudentName(studentDte.getName()); ddUserId = schoolStudentService.getDdUserId(studentDte.getUserId());
schoolStudent.setClassId(date.getId()); if (null == ddUserId ){
schoolStudent.setStudentStatus("1"); //学生信息
schoolStudent.setDdUserId(studentDte.getUserId()); SchoolStudent schoolStudent = new SchoolStudent();
schoolStudentService.save(schoolStudent); schoolStudent.setStudentName(studentDte.getName());
//学生班级信息 schoolStudent.setClassId(date.getId());
SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation(); schoolStudent.setStudentStatus("1");
schoolStudentClassRelation.setStudentId(schoolStudent.getId()); schoolStudent.setDdUserId(studentDte.getUserId());
schoolStudentClassRelation.setClassId(date.getId()); schoolStudentService.save(schoolStudent);
iSchoolStudentClassRelationService.save(schoolStudentClassRelation); ddUserId = schoolStudent.getId();
}else {
SchoolStudent schoolStudent = new SchoolStudent();
schoolStudent.setStudentName(studentDte.getName());
schoolStudent.setClassId(date.getId());
schoolStudent.setStudentStatus("1");
schoolStudent.setDdUserId(studentDte.getUserId());
schoolStudent.setId(ddUserId);
schoolStudentService.updateStudent(schoolStudent);
}
LambdaQueryWrapper<SchoolStudentClassRelation> lqw=new LambdaQueryWrapper<>();
lqw.eq(SchoolStudentClassRelation::getStudentId,ddUserId);
lqw.eq(SchoolStudentClassRelation::getClassId,date.getId());
List<SchoolStudentClassRelation> list = iSchoolStudentClassRelationService.list();
if (list.isEmpty()){
//学生班级信息
SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation();
schoolStudentClassRelation.setStudentId(ddUserId);
schoolStudentClassRelation.setClassId(date.getId());
iSchoolStudentClassRelationService.save(schoolStudentClassRelation);
}
//学生与班级历史关系 //学生与班级历史关系
SchoolClass school= iSchoolClassService.selectSchoolClassById(date.getId()); SchoolClass school= iSchoolClassService.selectSchoolClassById(date.getId());
SchoolStudentClasses schoolStudentClasses = new SchoolStudentClasses();
schoolStudentClasses.setStudentId(schoolStudent.getId());
schoolStudentClasses.setGrade(school.getGradeName()); LambdaQueryWrapper<SchoolStudentClasses> lsqw=new LambdaQueryWrapper<>();
schoolStudentClasses.setClasses(school.getClassName()); lsqw.eq(SchoolStudentClasses::getStudentId,ddUserId);
schoolStudentClasses.setTeacherName(school.getTeacherName()); lsqw.eq(SchoolStudentClasses:: getGrade,school.getGradeName());
schoolStudentClassesService.save(schoolStudentClasses); lsqw.eq(SchoolStudentClasses:: getClasses,school.getClassName());
lsqw.eq(SchoolStudentClasses:: getTeacherName,school.getTeacherName());
List<SchoolStudentClasses> list1 = schoolStudentClassesService.list(lsqw);
if (list1.isEmpty()){
SchoolStudentClasses schoolStudentClasses = new SchoolStudentClasses();
schoolStudentClasses.setStudentId(ddUserId);
schoolStudentClasses.setGrade(school.getGradeName());
schoolStudentClasses.setClasses(school.getClassName());
schoolStudentClasses.setTeacherName(school.getTeacherName());
schoolStudentClassesService.save(schoolStudentClasses);
}
} }
} else if (type.equals("guardian")) { } else if (type.equals("guardian")) {
//监护人 //监护人
...@@ -363,31 +417,63 @@ public class DingJiaXiaoController { ...@@ -363,31 +417,63 @@ public class DingJiaXiaoController {
//找寻学生 //找寻学生
String toUserId = this.getToUserId(token, guarDate.getUserId(), date.getDdClassId()); String toUserId = this.getToUserId(token, guarDate.getUserId(), date.getDdClassId());
Long ddUserId = schoolStudentService.getDdUserId(toUserId); Long ddUserId = schoolStudentService.getDdUserId(toUserId);
Long userId = null;
//创建用户user表 //查找监护人
SysUser jUser = new SysUser(); SysUser sysUser = sysUserService.selectUserByDdUserId(ddUserId.toString());
jUser.setLoginName(guarDate.getName()); if (null == sysUser){
jUser.setUserName(guarDate.getName()); //创建用户user表
jUser.setUserType("01"); SysUser jUser = new SysUser();
jUser.setUserLoginType("1"); jUser.setLoginName(guarDate.getName());
jUser.setPhonenumber(guarDate.getMobile()); jUser.setUserName(guarDate.getName());
jUser.setPassword(SecurityUtils.encryptPassword("123#@!")); jUser.setUserType("01");
jUser.setStatus("0"); jUser.setUserLoginType("1");
jUser.setDelFlag("0"); jUser.setPhonenumber(guarDate.getMobile());
jUser.setUnionId(guarDate.getUnionid()); jUser.setPassword(SecurityUtils.encryptPassword("123#@!"));
jUser.setDdUserId(guarDate.getUserId()); jUser.setStatus("0");
jUser.setRoleIds(new Long[]{111L}); jUser.setDelFlag("0");
jUser.setStudentId(ddUserId); jUser.setUnionId(guarDate.getUnionid());
sysUserService.insertUser(jUser); jUser.setDdUserId(guarDate.getUserId());
jUser.setRoleIds(new Long[]{111L});
jUser.setStudentId(ddUserId);
sysUserService.insertUser(jUser);
userId = jUser.getUserId();
}else {
userId = sysUser.getUserId();
sysUser.setLoginName(guarDate.getName());
sysUser.setUserName(guarDate.getName());
sysUser.setUserType("01");
sysUser.setUserLoginType("1");
sysUser.setPhonenumber(guarDate.getMobile());
sysUser.setStatus("0");
sysUser.setUnionId(guarDate.getUnionid());
sysUser.setDdUserId(guarDate.getUserId());
sysUser.setStudentId(ddUserId);
sysUserService.updateUser(sysUser);
}
//家长表 //家长表
SchoolStudentParent schoolStudentParent = new SchoolStudentParent() ; LambdaQueryWrapper<SchoolStudentParent> lsqw=new LambdaQueryWrapper<>();
schoolStudentParent.setStudentId(ddUserId); lsqw.eq(SchoolStudentParent::getUserId,userId);
schoolStudentParent.setUserId(jUser.getUserId()); lsqw.eq(SchoolStudentParent::getStudentId,ddUserId);
schoolStudentParent.setParentName(guarDate.getName()); List<SchoolStudentParent> list = iSchoolStudentParentService.list(lsqw);
schoolStudentParent.setTelephone(guarDate.getMobile()); if (list.isEmpty()){
Integer patriarch = this.getPatriarch(guarDate.getName().substring(guarDate.getName().length() - 2)); SchoolStudentParent schoolStudentParent = new SchoolStudentParent() ;
schoolStudentParent.setRelationship(String.valueOf(patriarch)); schoolStudentParent.setStudentId(ddUserId);
iSchoolStudentParentService.save(schoolStudentParent); schoolStudentParent.setUserId(userId);
schoolStudentParent.setParentName(guarDate.getName());
schoolStudentParent.setTelephone(guarDate.getMobile());
Integer patriarch = this.getPatriarch(guarDate.getName().substring(guarDate.getName().length() - 2));
schoolStudentParent.setRelationship(String.valueOf(patriarch));
iSchoolStudentParentService.save(schoolStudentParent);
}else {
SchoolStudentParent schoolStudentParent1 = list.get(0);
schoolStudentParent1.setStudentId(ddUserId);
schoolStudentParent1.setUserId(userId);
schoolStudentParent1.setParentName(guarDate.getName());
schoolStudentParent1.setTelephone(guarDate.getMobile());
Integer patriarch = this.getPatriarch(guarDate.getName().substring(guarDate.getName().length() - 2));
schoolStudentParent1.setRelationship(String.valueOf(patriarch));
iSchoolStudentParentService.updateById(schoolStudentParent1);
}
} }
} }
} }
......
...@@ -93,7 +93,7 @@ public class EquipmentLeaseController { ...@@ -93,7 +93,7 @@ public class EquipmentLeaseController {
calendar.add(Calendar.DATE,Integer.valueOf(deadline.toString())); calendar.add(Calendar.DATE,Integer.valueOf(deadline.toString()));
Date targetDate = calendar.getTime(); Date targetDate = calendar.getTime();
schoolCirculation.setReturnState("0"); schoolCirculation.setReturnState("0");
schoolCirculation.setReturnTime(targetDate); schoolCirculation.setYjuseTime(targetDate);
boolean save = iCirculationService.save(schoolCirculation); boolean save = iCirculationService.save(schoolCirculation);
//修改设备表借出状态 //修改设备表借出状态
SchoolEquipmentLedger byId = iEquipmentService.getById(schoolCirculation.getEquipmentId()); SchoolEquipmentLedger byId = iEquipmentService.getById(schoolCirculation.getEquipmentId());
...@@ -258,29 +258,37 @@ public class EquipmentLeaseController { ...@@ -258,29 +258,37 @@ public class EquipmentLeaseController {
* 管理员查看详情 * 管理员查看详情
*/ */
@GetMapping("/getReturningEquipmentByList/{encode}") @GetMapping("/getReturningEquipmentByList/{encode}")
private AjaxResult getReturningEquipmentByList(@PathVariable("encode") String encode){ private AjaxResult getReturningEquipmentByList(@PathVariable("encode") String encode) {
SchoolCirculationVo schoolCirculationVo = new SchoolCirculationVo(); SchoolCirculationVo schoolCirculationVo = new SchoolCirculationVo();
//先查询物品表有没有借出去 //先查询物品表有没有借出去
LambdaQueryWrapper<SchoolEquipmentLedger> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolEquipmentLedger> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolEquipmentLedger::getEncode,encode); wrapper.eq(SchoolEquipmentLedger::getEncode, encode);
SchoolEquipmentLedger one = iEquipmentService.getOne(wrapper); SchoolEquipmentLedger one = iEquipmentService.getOne(wrapper);
if (one.getIsLend().equals("0")){ if (one.getIsLend().equals("0")) {
//未借出 //未借出
schoolCirculationVo.setEquipmentId(one.getId()); schoolCirculationVo.setEquipmentId(one.getId());
schoolCirculationVo.setEquipmentName(one.getEquipmentName()); schoolCirculationVo.setEquipmentName(one.getEquipmentName());
schoolCirculationVo.setModel(one.getModel()); schoolCirculationVo.setModel(one.getModel());
schoolCirculationVo.setIsLend(one.getIsLend()); schoolCirculationVo.setIsLend(one.getIsLend());
return AjaxResult.success(schoolCirculationVo); return AjaxResult.success(schoolCirculationVo);
}else { } else {
//已借出 //已借出
SchoolCirculationVo schoolCirculationVoByenCode = iCirculationService SchoolCirculationVo schoolCirculationVoByenCode = iCirculationService
.getSchoolCirculationVoByenCode(encode); .getSchoolCirculationVoByenCode(encode);
//根据管理员信息查看信息详情 //根据管理员信息查看信息详情
return AjaxResult.success(schoolCirculationVoByenCode); return AjaxResult.success(schoolCirculationVoByenCode);
}
}
}
@GetMapping("/getReturningEquipmentById/{id}")
public AjaxResult getReturningEquipmentById(@PathVariable("id") String id){
SchoolCirculationVo schoolCirculationVoByenCode = iCirculationService
.getReturningEquipmentById(id);
//根据管理员信息查看信息详情
return AjaxResult.success(schoolCirculationVoByenCode);
} }
/** /**
* 管理员归还操作 * 管理员归还操作
*/ */
...@@ -291,6 +299,7 @@ public class EquipmentLeaseController { ...@@ -291,6 +299,7 @@ public class EquipmentLeaseController {
//修改设备表借出状态 //修改设备表借出状态
SchoolEquipmentLedger byId = iEquipmentService.getById(schoolCirculation.getEquipmentId()); SchoolEquipmentLedger byId = iEquipmentService.getById(schoolCirculation.getEquipmentId());
byId.setIsLend("0"); byId.setIsLend("0");
byId.setEquipmentState(schoolCirculation.getReturnEquipmentCondition());
iEquipmentService.updateById(byId); iEquipmentService.updateById(byId);
return AjaxResult.success(b); return AjaxResult.success(b);
} }
......
...@@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController; ...@@ -5,6 +5,7 @@ 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.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date; 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.*;
...@@ -54,8 +55,12 @@ public class ExperimentAdministratorsControoler extends BaseController { ...@@ -54,8 +55,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()); schoolLabClassYearVo.setSub(schoolLabClassYearService.getSub());
List<String> listSt =new ArrayList<>();
listSt.add("1");
listSt.add("2");
listSt.add("3");
schoolLabClassYearVo.setDeclareStates(listSt);
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo)); return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYearVo));
} }
......
...@@ -8,9 +8,10 @@ import com.ruoyi.common.core.domain.entity.SysDept; ...@@ -8,9 +8,10 @@ import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo; 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 java.util.*;
import com.ruoyi.framework.util.UserInfoUtil;
import com.ruoyi.system.service.ISysDeptService; import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,6 +21,7 @@ import yangtz.cs.liu.campus.domain.schoolLab.SchoolTeacherExperimentApply; ...@@ -20,6 +21,7 @@ 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.domain.schoolgrade.SchoolGrade; import yangtz.cs.liu.campus.domain.schoolgrade.SchoolGrade;
import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper; import yangtz.cs.liu.campus.mapper.schoolLab.SchoolTeacherLabApplyMapper;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService;
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;
...@@ -30,6 +32,7 @@ import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo; ...@@ -30,6 +32,7 @@ import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 实验室 级部申请 * 实验室 级部申请
...@@ -57,6 +60,11 @@ public class ExperimentLevelController extends BaseController { ...@@ -57,6 +60,11 @@ public class ExperimentLevelController extends BaseController {
@Autowired @Autowired
private ISysDeptService deptService; private ISysDeptService deptService;
@Autowired
UserInfoUtil userInfoUtil;
@Autowired
private ISchoolClassMentorService schoolClassMentorService;
/** /**
* 获取当前学年+学期 * 获取当前学年+学期
*/ */
...@@ -154,7 +162,17 @@ public class ExperimentLevelController extends BaseController { ...@@ -154,7 +162,17 @@ public class ExperimentLevelController extends BaseController {
@GetMapping("/list") @GetMapping("/list")
public AjaxResult list(SchoolLabClassYearVo schoolLabClassYear) public AjaxResult list(SchoolLabClassYearVo schoolLabClassYear)
{ {
schoolLabClassYear.setApplyId(schoolLabClassYear.getUserId()); Long userId = userInfoUtil.getMpLoginUser().getUserId();
Long gradeId = schoolGradeService.getGradeId(userId);
//根据当前角色查看对应的学科
//获取学科
Map<String, String> map = schoolClassMentorService.selectTeacherGroupMentot(userId);
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);
schoolLabClassYear.setSubs(strings);
schoolLabClassYear.setGradeId(gradeId);
return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear)); return AjaxResult.success(schoolLabClassYearService.selectSchoolLabClassYearList(schoolLabClassYear));
} }
...@@ -205,6 +223,9 @@ public class ExperimentLevelController extends BaseController { ...@@ -205,6 +223,9 @@ public class ExperimentLevelController extends BaseController {
*/ */
@GetMapping("/getexperimentList") @GetMapping("/getexperimentList")
public AjaxResult getexperimentList(ClassSituationVo classSituationVo){ public AjaxResult getexperimentList(ClassSituationVo classSituationVo){
//获取管理员学科
String sub = schoolLabClassYearService.getSub();
classSituationVo.setSub(sub);
List<ClassSituationVo> classSituationVos = schoolLabClassYearService.getexperimentList( List<ClassSituationVo> classSituationVos = schoolLabClassYearService.getexperimentList(
classSituationVo); classSituationVo);
return AjaxResult.success(classSituationVos); return AjaxResult.success(classSituationVos);
......
...@@ -29,9 +29,7 @@ import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo; ...@@ -29,9 +29,7 @@ import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherExperimentApplyVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.Arrays; import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -145,7 +143,10 @@ public class TeacherExperimentController extends BaseController { ...@@ -145,7 +143,10 @@ public class TeacherExperimentController extends BaseController {
*/ */
@GetMapping(value = "/list") @GetMapping(value = "/list")
public AjaxResult list(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo) public AjaxResult list(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{ {
Long userId = userInfoUtil.getMpLoginUser().getUserId();
schoolTeacherLabApplyVo.setApplyId(userId);
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo)); return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo));
} }
/** /**
...@@ -183,21 +184,25 @@ public class TeacherExperimentController extends BaseController { ...@@ -183,21 +184,25 @@ public class TeacherExperimentController extends BaseController {
@GetMapping("/getSubject") @GetMapping("/getSubject")
public AjaxResult getSubject(){ public AjaxResult getSubject(){
Long userId = userInfoUtil.getMpLoginUser().getUserId(); Long userId = userInfoUtil.getMpLoginUser().getUserId();
List<SysRole> sysRoles = roleService.selectRolesByUserIdDdApp(userId); Map<String,String> mapList = new HashMap<>();
for (SysRole role : sysRoles) { //设置级部
if (role.getRoleKey().equals("phy_lab_admin")){ //获取学科
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","1")); Map<String, String> map = schoolClassMentorService.selectTeacherGroupMentot(userId);
}else if (role.getRoleKey().equals("che_lab_admin")){ String s = map.get("courseId");
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","2")); List<String> list = Arrays.asList(s.split(","));
}else if (role.getRoleKey().equals("bio_lab_admin")){ List<String> myList = list.stream().distinct().collect(Collectors.toList());
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","3")); List<String> strings = schoolLabClassYearService.convertMentor(myList);
for (String date : strings){
if (date.equals("1")){
mapList.put("物理","1");
}else if (date.equals("2")){
mapList.put("化学","2");
}else if (date.equals("3")){
mapList.put("生物","3");
} }
} }
return AjaxResult.success("当前用户未分配学科角色"); return AjaxResult.success(mapList);
} }
/** /**
*新增申请 *新增申请
*/ */
......
...@@ -8,6 +8,7 @@ import com.ruoyi.common.enums.BusinessType; ...@@ -8,6 +8,7 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.util.UserInfoUtil; import com.ruoyi.framework.util.UserInfoUtil;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -18,7 +19,9 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -18,7 +19,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab; import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.service.impl.schoolLab.SchoolLabClassYearServiceImpl;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService; import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo; import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
/** /**
...@@ -33,16 +36,17 @@ public class WxSchoolLabControoler extends BaseController { ...@@ -33,16 +36,17 @@ public class WxSchoolLabControoler extends BaseController {
@Autowired @Autowired
private UserInfoUtil userInfoUtil; private UserInfoUtil userInfoUtil;
@Autowired
private SchoolLabClassYearServiceImpl schoolLabClassYearService;
/** /**
* 查询实验室列表 * 查询实验室列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(SchoolLabVo schoolLabVo) public AjaxResult list(SchoolLabClassYearVo schoolLabClassYearVo)
{ {
startPage(); List<Map<String, Object>> labList = schoolLabClassYearService.getLabList(schoolLabClassYearVo);
Long teacherUserId = userInfoUtil.getMpLoginUser().getUserId(); return AjaxResult.success(labList);
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo,teacherUserId);
return getDataTable(list);
} }
/** /**
......
...@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="delFalg" column="del_flag" /> <result property="delFalg" column="del_flag" />
<result property="place" column="place" />
</resultMap> </resultMap>
<select id="selectSchoolEquipmentRepairVoList" parameterType="SchoolEquipmentRepairVo" resultMap="schoolEquipmentRepairVoResult"> <select id="selectSchoolEquipmentRepairVoList" parameterType="SchoolEquipmentRepairVo" resultMap="schoolEquipmentRepairVoResult">
...@@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
el.equipment_name, el.equipment_name,
el.model, el.model,
el.date_of_production, el.date_of_production,
el.place, er.place,
el.classification_code, el.classification_code,
er.report_repair_time, er.report_repair_time,
er.report_repair_id, er.report_repair_id,
...@@ -76,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -76,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
el.equipment_name, el.equipment_name,
el.model, el.model,
el.date_of_production, el.date_of_production,
el.place, er.place,
el.classification_code, el.classification_code,
er.report_repair_time, er.report_repair_time,
er.report_repair_id, er.report_repair_id,
...@@ -106,22 +107,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -106,22 +107,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getMaintenanceUserList" parameterType="SchoolReceiveQuery" resultMap="schoolEquipmentRepairVoResult"> <select id="getMaintenanceUserList" parameterType="SchoolReceiveQuery" resultMap="schoolEquipmentRepairVoResult">
SELECT er.id,er.equipment_id,el.encode,er.dispose_state,el.equipment_name,el.model,el.date_of_production,el.place , SELECT er.id,er.equipment_id,el.encode,er.dispose_state,er.place,el.equipment_name,el.model,el.date_of_production,el.place ,
el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem, el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,
er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark
FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id
where er.del_flag=0 where er.del_flag=0 and er.dispose_state = 0
<if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if> <if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if>
</select> </select>
<select id="getMaintenanceList" parameterType="SchoolReceiveQuery" resultMap="schoolEquipmentRepairVoResult"> <select id="getMaintenanceList" parameterType="SchoolReceiveQuery" resultMap="schoolEquipmentRepairVoResult">
SELECT er.id,er.equipment_id,el.encode,er.dispose_state,el.equipment_name,el.model,el.date_of_production,el.place , SELECT er.id,er.equipment_id,el.encode,er.dispose_state,er.place,el.equipment_name,el.model,el.date_of_production,el.place ,
el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem, el.classification_code,er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,
er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark er.repair_id,er.evaluate,er.repair_name,er.repair_phone,er.repair_time,er.repair_state,er.remark
FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id WHERE er.report_repair_id=#{reportRepairid} and er.del_flag=0 FROM school_equipment_repair er LEFT JOIN school_equipment_ledger el ON er.equipment_id=el.id WHERE er.report_repair_id=#{reportRepairid} and er.del_flag=0
<if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if> <if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if>
ORDER BY er.report_repair_time DESC
</select> </select>
...@@ -134,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -134,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
el.equipment_name, el.equipment_name,
el.model, el.model,
el.date_of_production, el.date_of_production,
el.place, er.place,
el.classification_code, el.classification_code,
er.report_repair_time, er.report_repair_time,
er.report_repair_id, er.report_repair_id,
...@@ -156,12 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -156,12 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="getAdminList" parameterType="SchoolReceiveQuery" resultMap="schoolEquipmentRepairVoResult"> <select id="getAdminList" parameterType="SchoolReceiveQuery" resultMap="schoolEquipmentRepairVoResult">
SELECT er.id,er.equipment_id,el.encode,el.equipment_name,el.model,el.date_of_production,el.place,el.classification_code, SELECT er.id,er.equipment_id,el.encode,el.equipment_name,el.model,el.date_of_production,er.place,el.place,el.classification_code,
er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,er.repair_id,er.repair_name,er.repair_phone, er.report_repair_time,er.report_repair_id,er.report_repair,er.problem,er.repair_id,er.repair_name,er.repair_phone,
er.repair_time,er.repair_state,er.dispose_state,er.evaluate,er.remark FROM school_equipment_repair er LEFT JOIN er.repair_time,er.repair_state,er.dispose_state,er.evaluate,er.remark FROM school_equipment_repair er LEFT JOIN
school_equipment_ledger el on er.equipment_id = el.id LEFT JOIN school_product_category pc school_equipment_ledger el on er.equipment_id = el.id LEFT JOIN school_product_category pc
on pc.classification_code = el.classification_code WHERE pc.admin_id=#{reportRepairid} AND er.del_flag=0 on pc.classification_code = el.classification_code WHERE pc.admin_id=#{reportRepairid} AND er.del_flag=0
<if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if> <if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if>
ORDER BY er.report_repair_time DESC
</select> </select>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
AND gm.teacher_id = #{teacherId} AND gm.teacher_id = #{teacherId}
</if> </if>
</where> </where>
order by create_time DESC order by cy.create_time DESC
</select> </select>
<select id="selectExperimentPlanListAdmin" parameterType="SchoolExperimentPlanVo" resultMap="SchoolExperimentPlanVoResult"> <select id="selectExperimentPlanListAdmin" parameterType="SchoolExperimentPlanVo" resultMap="SchoolExperimentPlanVoResult">
......
...@@ -86,6 +86,12 @@ ...@@ -86,6 +86,12 @@
#{declareState} #{declareState}
</foreach> </foreach>
</if> </if>
<if test="subs != null">
and lcy.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where> </where>
order by create_time DESC order by create_time DESC
</select> </select>
...@@ -339,6 +345,7 @@ ...@@ -339,6 +345,7 @@
LEFT JOIN school_lab_class_year cy on cy.experiment_plan_id = ep.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="querText != null "> and concat(ep.experiment_name,ep.grade ) like concat('%', #{querText}, '%') </if> <if test="querText != null "> and concat(ep.experiment_name,ep.grade ) like concat('%', #{querText}, '%') </if>
<if test="sub != null "> and ep.sub = #{sub} </if>
GROUP BY ep.id GROUP BY ep.id
</select> </select>
</mapper> </mapper>
...@@ -44,6 +44,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -44,6 +44,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where> </where>
</select> </select>
<select id="selctTeacherByUserId" resultType="yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice">
SELECT fn.*,tf.state,tf.id as fId from teacher_files tf LEFT JOIN teacher_files_notice fn on fn.id= tf.notice_id WHERE tf.teacher_id = #{userId}
and fn.notice_state = 2
<if test="noticeRange != null and noticeRange != ''"> and fn.notice_range = #{teacherFiles.noticeRange}</if>
<if test="noticeYear != null and noticeYear != ''"> and fn.notice_year = #{teacherFiles.noticeYear}</if>
<if test="noticeSemester != null and noticeSemester != ''"> and fn.notice_semester = #{teacherFiles.noticeSemester}</if>
<if test="noticeName != null and noticeName != ''"> and fn.notice_name like concat('%', #{teacherFiles.noticeName}, '%')</if>
<if test="noticeState != null and noticeState != ''"> and fn.notice_state = #{teacherFiles.noticeState}</if>
<if test="startTime != null "> and start_time = #{teacherFiles.startTime}</if>
<if test="endTime != null "> and end_time = #{teacherFiles.endTime}</if>
</select>
<select id="selectTeacherFilesNoticeListByUser" parameterType="TeacherFilesNotice" resultType="TeacherFilesNoticeTotal"> <select id="selectTeacherFilesNoticeListByUser" parameterType="TeacherFilesNotice" resultType="TeacherFilesNoticeTotal">
<include refid="selectTeacherFilesNoticeTotalVo"/> <include refid="selectTeacherFilesNoticeTotalVo"/>
<where> <where>
......
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