Commit e97c1447 by baochunxin

#G:10.24问题修复

parent 9ab57d6d
......@@ -9,6 +9,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
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.TeacherFilesNotice;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
......@@ -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}")
public TableDataInfo teachList(@PathVariable("userId") Long userId){
public TableDataInfo teachList(@PathVariable("userId") Long userId,TeacherFilesNotice teacherFilesNotice){
startPage();
List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(userId);
List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(userId,teacherFilesNotice);
return getDataTable(teacherFilesNotices);
}
......@@ -127,7 +150,6 @@ public class TeacherFilesController extends BaseController
return toAjax(teacherFilesService.deleteTeacherFilesByIds(ids));
}
/**
* 教师档案同步
*/
......@@ -139,27 +161,34 @@ public class TeacherFilesController extends BaseController
return toAjax(teacherFilesService.synchronous(id));
}
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')")
@Log(title = "教师档案审核通过", businessType = BusinessType.UPDATE)
@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.setId(id);
teacherFiles.setId(id[i]);
teacherFiles.setState("5");
return toAjax(teacherFilesService.updateTeacherFiles(teacherFiles));
date = teacherFilesService.updateTeacherFiles(teacherFiles);
}
return toAjax(date);
}
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')")
@Log(title = "教师档案审核驳回", businessType = BusinessType.UPDATE)
@PutMapping("/reject/{id}")
public AjaxResult reject(@PathVariable("id") Long id)
public AjaxResult reject(@PathVariable("id") Long[] id)
{
TeacherFiles teacherFiles = new TeacherFiles();
teacherFiles.setId(id);
teacherFiles.setState("9");
return toAjax(teacherFilesService.updateTeacherFiles(teacherFiles));
Integer date = null;
for (int i = 0 ; i< id.length ; i++){
TeacherFiles teacherFiles = new TeacherFiles();
teacherFiles.setId(id[i]);
teacherFiles.setState("9");
date = teacherFilesService.updateTeacherFiles(teacherFiles);
}
return toAjax(date);
}
@PreAuthorize("@ss.hasPermi('teacherFiles:notice:edit')")
......
......@@ -48,6 +48,10 @@ public class SchoolEquipmentRepair extends OurBaseEntity
/** 修理人 */
private String repairName;
/**
* 地点
*/
private String place;
/** 修理人联系方式 */
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> {
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")
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;
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"
+ "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")
......@@ -24,7 +24,7 @@ public interface EquipmentRepairMapper extends BaseMapper<SchoolEquipmentRepair>
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"
+ "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"
+ "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();
......
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;
import org.apache.ibatis.annotations.Param;
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.TeacherFilesNoticeTotal;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo;
......@@ -42,8 +43,7 @@ public interface TeacherFilesNoticeMapper
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(Long userId);
public List<TeacherFilesNotice> selctTeacherByUserId(@Param("userId") Long userId, @Param("teacherFiles") TeacherFilesNotice teacherFiles);
/**
* 修改教师档案通知
......
......@@ -50,6 +50,10 @@ public class CirculationServiceImpl extends ServiceImpl<CirculationMapper, Schoo
public SchoolCirculationVo getSchoolCirculationVoByenCode(String 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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
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.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.SchoolTeacherExperimentApplyVo;
import java.util.ArrayList;
import java.util.List;
......@@ -33,6 +36,8 @@ public class SchoolLabServiceImpl extends ServiceImpl<SchoolLabMapper,SchoolLab>
@Autowired
private SysUserMapper sysUserMapper;
@Autowired
private SchoolLabClassYearMapper schoolLabClassYearMapper;
/**
* 查询实验室
*
......
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.StringUtils;
import com.ruoyi.common.utils.TermRange;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import yangtz.cs.liu.campus.domain.award.Award;
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.thesis.Thesis;
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.service.teacherFiles.ITeacherFilesService;
import yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
/**
......@@ -44,7 +52,18 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Autowired
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
@Override
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId) {
return teacherFilesNoticeMapper.selctTeacherByUserId(userId);
public List<TeacherFilesNotice> selctTeacherByUserId(Long userId,TeacherFilesNotice teacherFiles) {
return teacherFilesNoticeMapper.selctTeacherByUserId(userId,teacherFiles);
}
/**
......@@ -113,7 +132,91 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
@Override
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
public List<Long> getGradeId(Long 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> {
SchoolCirculationVo getSchoolCirculationVoById(Long id);
SchoolCirculationVo getSchoolCirculationVoByenCode(String enCode);
SchoolCirculationVo getReturningEquipmentById(String id);
/**
* 查看设备借出归还列表
* @param schoolCirculationVo
......
package yangtz.cs.liu.campus.service.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.TeacherFilesVO;
......@@ -29,7 +30,15 @@ public interface ITeacherFilesService
* @return 教师档案集合
*/
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);
/**
* 新增教师档案
......
......@@ -93,7 +93,7 @@ public class EquipmentLeaseController {
calendar.add(Calendar.DATE,Integer.valueOf(deadline.toString()));
Date targetDate = calendar.getTime();
schoolCirculation.setReturnState("0");
schoolCirculation.setReturnTime(targetDate);
schoolCirculation.setYjuseTime(targetDate);
boolean save = iCirculationService.save(schoolCirculation);
//修改设备表借出状态
SchoolEquipmentLedger byId = iEquipmentService.getById(schoolCirculation.getEquipmentId());
......@@ -258,29 +258,37 @@ public class EquipmentLeaseController {
* 管理员查看详情
*/
@GetMapping("/getReturningEquipmentByList/{encode}")
private AjaxResult getReturningEquipmentByList(@PathVariable("encode") String encode){
private AjaxResult getReturningEquipmentByList(@PathVariable("encode") String encode) {
SchoolCirculationVo schoolCirculationVo = new SchoolCirculationVo();
//先查询物品表有没有借出去
LambdaQueryWrapper<SchoolEquipmentLedger> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolEquipmentLedger::getEncode,encode);
LambdaQueryWrapper<SchoolEquipmentLedger> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(SchoolEquipmentLedger::getEncode, encode);
SchoolEquipmentLedger one = iEquipmentService.getOne(wrapper);
if (one.getIsLend().equals("0")){
if (one.getIsLend().equals("0")) {
//未借出
schoolCirculationVo.setEquipmentId(one.getId());
schoolCirculationVo.setEquipmentName(one.getEquipmentName());
schoolCirculationVo.setModel(one.getModel());
schoolCirculationVo.setIsLend(one.getIsLend());
return AjaxResult.success(schoolCirculationVo);
}else {
return AjaxResult.success(schoolCirculationVo);
} else {
//已借出
SchoolCirculationVo schoolCirculationVoByenCode = iCirculationService
.getSchoolCirculationVoByenCode(encode);
.getSchoolCirculationVoByenCode(encode);
//根据管理员信息查看信息详情
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 {
//修改设备表借出状态
SchoolEquipmentLedger byId = iEquipmentService.getById(schoolCirculation.getEquipmentId());
byId.setIsLend("0");
byId.setEquipmentState(schoolCirculation.getReturnEquipmentCondition());
iEquipmentService.updateById(byId);
return AjaxResult.success(b);
}
......
......@@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
......@@ -54,8 +55,12 @@ public class ExperimentAdministratorsControoler extends BaseController {
@GetMapping("/classYear/list")
public AjaxResult classYearList(SchoolLabClassYearVo schoolLabClassYearVo)
{
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));
}
......
......@@ -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.page.TableDataInfo;
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.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -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.schoolgrade.SchoolGrade;
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.ISchoolLabClassYearService;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolTeacherLabApplyService;
......@@ -30,6 +32,7 @@ import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolTeacherLabApplyVo;
import java.util.List;
import java.util.stream.Collectors;
/**
* 实验室 级部申请
......@@ -57,6 +60,11 @@ public class ExperimentLevelController extends BaseController {
@Autowired
private ISysDeptService deptService;
@Autowired
UserInfoUtil userInfoUtil;
@Autowired
private ISchoolClassMentorService schoolClassMentorService;
/**
* 获取当前学年+学期
*/
......@@ -154,7 +162,17 @@ public class ExperimentLevelController extends BaseController {
@GetMapping("/list")
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));
}
......@@ -205,6 +223,9 @@ public class ExperimentLevelController extends BaseController {
*/
@GetMapping("/getexperimentList")
public AjaxResult getexperimentList(ClassSituationVo classSituationVo){
//获取管理员学科
String sub = schoolLabClassYearService.getSub();
classSituationVo.setSub(sub);
List<ClassSituationVo> classSituationVos = schoolLabClassYearService.getexperimentList(
classSituationVo);
return AjaxResult.success(classSituationVos);
......
......@@ -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.SchoolTeacherLabApplyVo;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
......@@ -145,7 +143,10 @@ public class TeacherExperimentController extends BaseController {
*/
@GetMapping(value = "/list")
public AjaxResult list(SchoolTeacherLabApplyVo schoolTeacherLabApplyVo)
{
Long userId = userInfoUtil.getMpLoginUser().getUserId();
schoolTeacherLabApplyVo.setApplyId(userId);
return AjaxResult.success(schoolTeacherLabApplyService.selectSchoolTeacherLabApplyList(schoolTeacherLabApplyVo));
}
/**
......@@ -183,21 +184,25 @@ public class TeacherExperimentController extends BaseController {
@GetMapping("/getSubject")
public AjaxResult getSubject(){
Long userId = userInfoUtil.getMpLoginUser().getUserId();
List<SysRole> sysRoles = roleService.selectRolesByUserIdDdApp(userId);
for (SysRole role : sysRoles) {
if (role.getRoleKey().equals("phy_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","1"));
}else if (role.getRoleKey().equals("che_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","2"));
}else if (role.getRoleKey().equals("bio_lab_admin")){
return AjaxResult.success(dictDataService.selectDictLabel("lab_sub","3"));
Map<String,String> mapList = new HashMap<>();
//设置级部
//获取学科
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);
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;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.util.UserInfoUtil;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
......@@ -18,7 +19,9 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import yangtz.cs.liu.campus.domain.schoolLab.SchoolLab;
import yangtz.cs.liu.campus.service.impl.schoolLab.SchoolLabClassYearServiceImpl;
import yangtz.cs.liu.campus.service.schoolLab.ISchoolLabService;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabClassYearVo;
import yangtz.cs.liu.campus.vo.schoolLab.SchoolLabVo;
/**
......@@ -33,16 +36,17 @@ public class WxSchoolLabControoler extends BaseController {
@Autowired
private UserInfoUtil userInfoUtil;
@Autowired
private SchoolLabClassYearServiceImpl schoolLabClassYearService;
/**
* 查询实验室列表
*/
@GetMapping("/list")
public TableDataInfo list(SchoolLabVo schoolLabVo)
public AjaxResult list(SchoolLabClassYearVo schoolLabClassYearVo)
{
startPage();
Long teacherUserId = userInfoUtil.getMpLoginUser().getUserId();
List<SchoolLabVo> list = schoolLabService.selectSchoolLabList(schoolLabVo,teacherUserId);
return getDataTable(list);
List<Map<String, Object>> labList = schoolLabClassYearService.getLabList(schoolLabClassYearVo);
return AjaxResult.success(labList);
}
/**
......
......@@ -30,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="delFalg" column="del_flag" />
<result property="place" column="place" />
</resultMap>
<select id="selectSchoolEquipmentRepairVoList" parameterType="SchoolEquipmentRepairVo" resultMap="schoolEquipmentRepairVoResult">
......@@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
el.equipment_name,
el.model,
el.date_of_production,
el.place,
er.place,
el.classification_code,
er.report_repair_time,
er.report_repair_id,
......@@ -76,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
el.equipment_name,
el.model,
el.date_of_production,
el.place,
er.place,
el.classification_code,
er.report_repair_time,
er.report_repair_id,
......@@ -106,22 +107,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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,
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.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>
</select>
<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,
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
<if test="equipmentName != null and equipmentName != ''">and el.equipment_name like concat('%', #{equipmentName}, '%')</if>
ORDER BY er.report_repair_time DESC
</select>
......@@ -134,7 +135,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
el.equipment_name,
el.model,
el.date_of_production,
el.place,
er.place,
el.classification_code,
er.report_repair_time,
er.report_repair_id,
......@@ -156,12 +157,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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.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
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>
ORDER BY er.report_repair_time DESC
</select>
......
......@@ -69,7 +69,7 @@
AND gm.teacher_id = #{teacherId}
</if>
</where>
order by create_time DESC
order by cy.create_time DESC
</select>
<select id="selectExperimentPlanListAdmin" parameterType="SchoolExperimentPlanVo" resultMap="SchoolExperimentPlanVoResult">
......
......@@ -86,6 +86,12 @@
#{declareState}
</foreach>
</if>
<if test="subs != null">
and lcy.sub in
<foreach item="sub" collection="subs" open="(" separator="," close=")">
#{sub}
</foreach>
</if>
</where>
order by create_time DESC
</select>
......@@ -339,6 +345,7 @@
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
<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
</select>
</mapper>
......@@ -44,6 +44,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</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">
<include refid="selectTeacherFilesNoticeTotalVo"/>
<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