Commit fb09b100 by baochunxin

#G: 问题修复

parent 0c3b67fb
...@@ -13,7 +13,7 @@ spring: ...@@ -13,7 +13,7 @@ spring:
url: jdbc:mysql://1.116.38.25:3986/dd_smart_school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true url: jdbc:mysql://1.116.38.25:3986/dd_smart_school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
username: root username: root
password: qianhe2022 password: qianhe2022
#二中 # #二中
# master: # master:
# url: jdbc:mysql://10.20.100.201:3306/dd_smart_school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true # url: jdbc:mysql://10.20.100.201:3306/dd_smart_school?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
# username: root # username: root
......
...@@ -24,7 +24,8 @@ ruoyi: ...@@ -24,7 +24,8 @@ ruoyi:
server: server:
# 服务器的HTTP端口,默认为8080 # 服务器的HTTP端口,默认为8080
# port: 8137 # port: 8137
# port: 8849 #二中
# port: 11325
port: 8848 port: 8848
#学校内网PC端口 #学校内网PC端口
# port: 57321 # port: 57321
......
...@@ -43,8 +43,8 @@ public class RyTask ...@@ -43,8 +43,8 @@ public class RyTask
} }
//家校通讯录人员更新 //家校通讯录人员更新
public void updateLabUser(){ public void updateLabUser()throws Exception{
dingJiaXiaoController.updateLabUser(); dingJiaXiaoController.updateLabUser() ;
} }
//钉钉通讯录更新 //钉钉通讯录更新
......
...@@ -151,6 +151,7 @@ public interface SysDeptMapper ...@@ -151,6 +151,7 @@ public interface SysDeptMapper
* @return 部门信息集合 * @return 部门信息集合
*/ */
public List<SysDept> selectGrade(SysDept dept); public List<SysDept> selectGrade(SysDept dept);
public List<SysDept> selectConformDept(Long id);
/** /**
* 根据学年查询级部 * 根据学年查询级部
......
...@@ -139,4 +139,5 @@ public interface ISysDeptService ...@@ -139,4 +139,5 @@ public interface ISysDeptService
* @return 部门信息集合 * @return 部门信息集合
*/ */
public List<SysDept> selectGrade(SysDept dept); public List<SysDept> selectGrade(SysDept dept);
public List<SysDept> selectConformDept(Long userId);
} }
...@@ -375,6 +375,10 @@ public class SysDeptServiceImpl implements ISysDeptService ...@@ -375,6 +375,10 @@ public class SysDeptServiceImpl implements ISysDeptService
return deptMapper.getDeptdByUserId(userId); return deptMapper.getDeptdByUserId(userId);
} }
public List<SysDept> selectConformDept(Long userId) {
return deptMapper.selectConformDept(userId);
}
/** /**
* 查询级部 * 查询级部
* @param dept 部门信息 * @param dept 部门信息
......
...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDeptGroupByUserId" parameterType="Long" resultType="Map"> <select id="selectDeptGroupByUserId" parameterType="Long" resultType="Map">
SELECT d.dept_id as deptId,d.dept_name AS deptName,d.parent_id as parentId FROM sys_user u SELECT d.dept_id as deptId,d.dept_name AS deptName,d.parent_id as parentId FROM sys_user u
LEFT JOIN sys_dd_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id LEFT JOIN sys_dd_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id
WHERE u.user_id = #{dept} AND d.del_flag = 0 WHERE u.user_id = #{userId} AND d.del_flag = 0
</select> </select>
...@@ -212,6 +212,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -212,6 +212,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
WHERE dept_name like concat('%', "级部", '%') AND parent_id = 100 WHERE dept_name like concat('%', "级部", '%') AND parent_id = 100
</select> </select>
<select id = "selectConformDept" parameterType="Long" resultMap="SysDeptResult">
SELECT d.* FROM sys_user u LEFT JOIN sys_user_dept ud on ud.user_id = u.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id WHERE u.user_id = #{id}
</select>
<select id="selectDeptGrade" parameterType="String" resultMap="SysDeptResult"> <select id="selectDeptGrade" parameterType="String" resultMap="SysDeptResult">
<include refid="selectDeptVo"/> <include refid="selectDeptVo"/>
WHERE dept_name like concat('%', #{schoolYear}, '%') AND parent_id = 100 WHERE dept_name like concat('%', #{schoolYear}, '%') AND parent_id = 100
......
...@@ -168,8 +168,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -168,8 +168,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectDeptAncetorsByPernId" parameterType="String" resultMap="SysUserResult"> <select id="selectDeptAncetorsByPernId" parameterType="String" resultMap="SysUserResult">
SELECT u. *,d.* FROM sys_user u LEFT JOIN sys_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id SELECT u.*,d.* FROM sys_user u INNER JOIN sys_user_dept ud on u.user_id = ud.user_id LEFT JOIN sys_dept d on ud.dept_id = d.dept_id where d.ancestors like concat('%', #{deptId}, '%') GROUP BY u.user_id
where d.ancestors like concat('%', #{deptId}, '%') GROUP BY u.user_id union all
SELECT u.*,d.* FROM sys_user u INNER JOIN sys_dept d on u.dept_id = d.dept_id AND d.ancestors like concat('%', #{deptId}, '%')
GROUP BY user_id
</select> </select>
......
...@@ -45,20 +45,19 @@ public class TeacherFilesController extends BaseController ...@@ -45,20 +45,19 @@ public class TeacherFilesController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@PreAuthorize("@ss.hasPermi('teacherFiles:files:list')") // @PreAuthorize("@ss.hasPermi('teacherFiles:files:list')")
@GetMapping("/gradeList") @GetMapping("/gradeList")
public AjaxResult gradeList(TeacherFiles teacherFiles) public AjaxResult gradeList(TeacherFiles teacherFiles)
{ {
AjaxResult ajaxResult = new AjaxResult(); AjaxResult ajaxResult = new AjaxResult();
List<Long> gradeIds = teacherFilesService.getGradeId(teacherFiles.getGradeTeacherId()); List<Long> gradeIds = teacherFilesService.getGradeId(teacherFiles.getGradeTeacherId());
if(gradeIds==null || gradeIds.size()==0){ if(gradeIds==null || gradeIds.size()==0){
// TableDataInfo tableDataInfo = new TableDataInfo();
// tableDataInfo.setCode(500);
// tableDataInfo.setMsg("该用户非级部主任");
ajaxResult.put("code",500); ajaxResult.put("code",500);
ajaxResult.put("msg","该用户非级部主任"); ajaxResult.put("msg","该用户非级部主任");
return ajaxResult; return ajaxResult;
} }
//查询老师所在级部
teacherFiles.setGradeId(gradeIds.get(0)); teacherFiles.setGradeId(gradeIds.get(0));
startPage(); startPage();
List<TeacherFiles> list = teacherFilesService.selectTeacherFilesList(teacherFiles); List<TeacherFiles> list = teacherFilesService.selectTeacherFilesList(teacherFiles);
...@@ -101,7 +100,6 @@ public class TeacherFilesController extends BaseController ...@@ -101,7 +100,6 @@ public class TeacherFilesController extends BaseController
@GetMapping("/getTeachList") @GetMapping("/getTeachList")
public TableDataInfo teachList(TeacherFiles teacherFiles){ public TableDataInfo teachList(TeacherFiles teacherFiles){
startPage(); startPage();
Map map = new HashMap();
List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(teacherFiles); List<TeacherFilesNotice> teacherFilesNotices = teacherFilesService.selctTeacherByUserId(teacherFiles);
return getDataTable(teacherFilesNotices); return getDataTable(teacherFilesNotices);
} }
...@@ -138,7 +136,7 @@ public class TeacherFilesController extends BaseController ...@@ -138,7 +136,7 @@ public class TeacherFilesController extends BaseController
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TeacherFiles teacherFiles) public AjaxResult add(@RequestBody TeacherFiles teacherFiles)
{ {
teacherFiles.setState("0"); teacherFiles.setState("1");
return toAjax(teacherFilesService.insertTeacherFiles(teacherFiles)); return toAjax(teacherFilesService.insertTeacherFiles(teacherFiles));
} }
......
package yangtz.cs.liu.campus.domain.teacherFiles; package yangtz.cs.liu.campus.domain.teacherFiles;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data; import lombok.Data;
...@@ -13,11 +15,12 @@ import org.apache.commons.lang3.builder.ToStringStyle; ...@@ -13,11 +15,12 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2023-09-05 * @date 2023-09-05
*/ */
@Data @Data
public class TeacherFiles extends BaseEntity public class TeacherFiles
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** id */ /** id */
@TableId(value = "id", type = IdType.AUTO)
private Long id; private Long id;
/** 通知id */ /** 通知id */
...@@ -101,7 +104,7 @@ public class TeacherFiles extends BaseEntity ...@@ -101,7 +104,7 @@ public class TeacherFiles extends BaseEntity
private String classTeacherDetails; private String classTeacherDetails;
/** 状态 */ /** 状态 */
@Excel(name = "状态 (1未发布 2已发布 3已填写 4已提交 5已确认 9驳回)" ) @Excel(name = "状态 (初始化为 1 编辑 老师个人提交 4已提交 级部确认过 5已确认 级部驳回 9驳回)" )
private String state; private String state;
private Long gradeTeacherId; private Long gradeTeacherId;
......
...@@ -40,7 +40,7 @@ public class TeacherFilesNotice extends BaseEntity ...@@ -40,7 +40,7 @@ public class TeacherFilesNotice extends BaseEntity
private String noticeName; private String noticeName;
/** 状态 /** 状态
* @Excel(name = "状态 (1未发布 2已发布 3已填写 4已提交 5已确认 9驳回)" ) * @Excel(name = "状态 (1未发布 2已发布 7已结束)" )
* */ * */
@Excel(name = "状态") @Excel(name = "状态")
private String noticeState; private String noticeState;
......
package yangtz.cs.liu.campus.mapper.teacherFiles; package yangtz.cs.liu.campus.mapper.teacherFiles;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import yangtz.cs.liu.campus.domain.schooloffical.SchoolOfficial;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFiles;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesVO;
...@@ -12,7 +14,7 @@ import java.util.Map; ...@@ -12,7 +14,7 @@ import java.util.Map;
* @author ruoyi * @author ruoyi
* @date 2023-09-06 * @date 2023-09-06
*/ */
public interface TeacherFilesMapper public interface TeacherFilesMapper extends BaseMapper<TeacherFiles>
{ {
/** /**
* 查询教师档案 * 查询教师档案
......
package yangtz.cs.liu.campus.mapper.teacherFiles; package yangtz.cs.liu.campus.mapper.teacherFiles;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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.TeacherFiles;
...@@ -17,7 +18,7 @@ import java.util.Map; ...@@ -17,7 +18,7 @@ import java.util.Map;
* @author ruoyi * @author ruoyi
* @date 2023-09-06 * @date 2023-09-06
*/ */
public interface TeacherFilesNoticeMapper public interface TeacherFilesNoticeMapper extends BaseMapper<TeacherFilesNotice>
{ {
/** /**
* 查询教师档案通知 * 查询教师档案通知
......
package yangtz.cs.liu.campus.service.impl.teacherFiles; package yangtz.cs.liu.campus.service.impl.teacherFiles;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SchoolTeacher; import com.ruoyi.common.core.domain.entity.SchoolTeacher;
import com.ruoyi.common.core.domain.entity.SysDept; import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
...@@ -23,19 +24,18 @@ import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper; ...@@ -23,19 +24,18 @@ import yangtz.cs.liu.campus.mapper.schoolgrade.SchoolGradeMapper;
import yangtz.cs.liu.campus.mapper.teacher.SchoolTeacherMapper; import yangtz.cs.liu.campus.mapper.teacher.SchoolTeacherMapper;
import yangtz.cs.liu.campus.mapper.teacherFiles.TeacherFilesMapper; import yangtz.cs.liu.campus.mapper.teacherFiles.TeacherFilesMapper;
import yangtz.cs.liu.campus.mapper.teacherFiles.TeacherFilesNoticeMapper; import yangtz.cs.liu.campus.mapper.teacherFiles.TeacherFilesNoticeMapper;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassMentorService;
import yangtz.cs.liu.campus.service.schoolClass.ISchoolClassService;
import yangtz.cs.liu.campus.service.schoolgrade.ISchoolGradeService;
import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesNoticeService; import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesNoticeService;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolClassByGradeVo; import yangtz.cs.liu.campus.service.teacherFiles.ITeacherFilesService;
import yangtz.cs.liu.campus.vo.teacherFiles.SchoolGradeByClassVo;
import yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo; import yangtz.cs.liu.wechat.vo.schoolClass.SchoolClassVo;
import static java.util.Comparator.comparingLong;
import static java.util.stream.Collectors.collectingAndThen;
import static java.util.stream.Collectors.toCollection;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* 教师档案通知Service业务层处理 * 教师档案通知Service业务层处理
* *
...@@ -43,7 +43,7 @@ import java.util.stream.Collectors; ...@@ -43,7 +43,7 @@ import java.util.stream.Collectors;
* @date 2023-09-06 * @date 2023-09-06
*/ */
@Service @Service
public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService public class TeacherFilesNoticeServiceImpl extends ServiceImpl<TeacherFilesNoticeMapper,TeacherFilesNotice> implements ITeacherFilesNoticeService
{ {
@Autowired @Autowired
private TeacherFilesNoticeMapper teacherFilesNoticeMapper; private TeacherFilesNoticeMapper teacherFilesNoticeMapper;
...@@ -94,6 +94,8 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService ...@@ -94,6 +94,8 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
return teacherFilesNoticeMapper.selectTeacherFilesNoticeList(teacherFilesNotice); return teacherFilesNoticeMapper.selectTeacherFilesNoticeList(teacherFilesNotice);
} }
@Autowired
ITeacherFilesService iTeacherFilesService;
/** /**
* 新增教师档案通知 * 新增教师档案通知
...@@ -131,9 +133,11 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService ...@@ -131,9 +133,11 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
}); });
userList.addAll(sysUsers); userList.addAll(sysUsers);
} }
List<SysUser> collect = userList.stream().filter(SysUser -> SysUser.getUserId() != null).collect(Collectors.toList());
//获取所有老师 去重 //获取所有老师 去重
List<SysUser> trrUserList = userList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() List<SysUser> trrUserList = collect.stream().collect(collectingAndThen(toCollection(() -> new TreeSet<>(comparingLong(SysUser::getUserId))), ArrayList::new));
-> new TreeSet<>(Comparator.comparing(SysUser :: getUserId))), ArrayList::new));
List<TeacherFiles> teacherFilesList = new ArrayList<>(); List<TeacherFiles> teacherFilesList = new ArrayList<>();
for (SysUser user : trrUserList){ for (SysUser user : trrUserList){
//部门 //部门
...@@ -160,7 +164,7 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService ...@@ -160,7 +164,7 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
teacherFiles.setGradeId(schoolGrade.getId()); teacherFiles.setGradeId(schoolGrade.getId());
teacherFiles.setGradeName(schoolGrade.getGradeName()); teacherFiles.setGradeName(schoolGrade.getGradeName());
teacherFiles.setBzrClassName(teahClassName); teacherFiles.setBzrClassName(teahClassName);
teacherFiles.setState("2"); teacherFiles.setState("1");
teacherFiles = teacherFilesAddXx(teacherFiles); //老师个人信息 teacherFiles = teacherFilesAddXx(teacherFiles); //老师个人信息
//找到老师课程 //找到老师课程
// TODO 修改最新学年 // TODO 修改最新学年
...@@ -178,93 +182,7 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService ...@@ -178,93 +182,7 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
teacherFilesList.add(teacherFiles); teacherFilesList.add(teacherFiles);
} }
//导入数据库 //导入数据库
teacherFilesList.forEach(date->{ iTeacherFilesService.saveBatch(teacherFilesList);
teacherFilesMapper.insertTeacherFiles(date);
});
// //获取级部
// List<SchoolGrade> schoolGrades = schoolGradeMapper.selectNowSchoolGrade();
// for(SchoolGrade schoolGrade:schoolGrades){
// Map<Long,TeacherFiles> teacherFilesMap = new HashMap();
// Long gradeId = schoolGrade.getId();
// String gradeName = schoolGrade.getGradeName();
// //获取班级
// List<SchoolClassByGradeVo> schoolClassByGrade = teacherFilesNoticeMapper.getSchoolClassByGrade(gradeId);
// for(SchoolClassByGradeVo schoolClass:schoolClassByGrade){
// Long classId=schoolClass.getId();
// String classAlias=schoolClass.getClassAlias();
//
// if(schoolClass.getTeacherId()!=null){
// if(teacherFilesMap.get(schoolClass.getTeacherId())==null){
// TeacherFiles teacherFiles = new TeacherFiles();
// teacherFiles.setTeacherId(schoolClass.getTeacherId());
// teacherFiles = teacherFilesAddXx(teacherFiles);
// teacherFiles.setNoticeId(noticeId);
// teacherFiles.setFilesSemester(teacherFilesNotice.getNoticeYear()+"学年"+teacherFilesNotice.getNoticeSemester());
// teacherFiles.setGradeId(gradeId);
// teacherFiles.setGradeName(gradeName);
// teacherFiles.setBzrClassName(classAlias);
// teacherFiles.setState("1");
// teacherFilesMap.put(schoolClass.getTeacherId(),teacherFiles);
// }else{
// TeacherFiles teacherFiles = teacherFilesMap.get(schoolClass.getTeacherId());
// String bzrClassName = teacherFiles.getBzrClassName();
// if(bzrClassName==null){
// teacherFiles.setBzrClassName(classAlias);
// }else{
// teacherFiles.setBzrClassName(teacherFiles.getBzrClassName()+"、"+classAlias);
// }
// teacherFilesMap.put(schoolClass.getTeacherId(),teacherFiles);
// }
//
// }
// //获取班级老师
// List<SchoolGradeByClassVo> schoolGradeByClassVos = teacherFilesNoticeMapper.selectTeacherByClass(classId);
// for(SchoolGradeByClassVo grade:schoolGradeByClassVos){
//
// if(teacherFilesMap.get(grade.getTeacherId())==null){
// //没有记录
// TeacherFiles teacherFiles = new TeacherFiles();
// teacherFiles.setTeacherId(grade.getTeacherId());
// teacherFiles = teacherFilesAddXx(teacherFiles);
// teacherFiles.setNoticeId(noticeId);
// teacherFiles.setFilesSemester(teacherFilesNotice.getNoticeYear()+"学年"+teacherFilesNotice.getNoticeSemester());
// teacherFiles.setGradeId(gradeId);
// teacherFiles.setGradeName(gradeName);
// teacherFiles.setCourseName(grade.getCourseName());
// teacherFiles.setClassName(classAlias);
// teacherFiles.setState("1");
// teacherFilesMap.put(grade.getTeacherId(),teacherFiles);
// }else{
// //有记录
// TeacherFiles teacherFiles = teacherFilesMap.get(schoolClass.getTeacherId());
// if(teacherFiles.getClassName()==null){
// teacherFiles.setClassName(classAlias);
// }else{
// if(!teacherFiles.getClassName().contains(classAlias)){
// teacherFiles.setClassName(teacherFiles.getClassName()+"、"+classAlias);
// }
// }
// if(teacherFiles.getCourseName()==null){
// teacherFiles.setCourseName(grade.getCourseName());
// }else{
// if(!teacherFiles.getCourseName().contains(grade.getCourseName())){
// teacherFiles.setCourseName(teacherFiles.getCourseName()+"、"+grade.getCourseName());
// }
// }
// teacherFilesMap.put(schoolClass.getTeacherId(),teacherFiles);
// }
// }
// }
// teacherFilesMap.forEach((teacherId,teacherFiles)->{
// teacherFilesMapper.insertTeacherFiles(teacherFiles);
// });
// }
return i; return i;
} }
...@@ -325,8 +243,8 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService ...@@ -325,8 +243,8 @@ public class TeacherFilesNoticeServiceImpl implements ITeacherFilesNoticeService
teacherFilesNotice.setId(id); teacherFilesNotice.setId(id);
teacherFilesNotice.setUpdateTime(DateUtils.getNowDate()); teacherFilesNotice.setUpdateTime(DateUtils.getNowDate());
teacherFilesNotice.setNoticeState("1"); teacherFilesNotice.setNoticeState("1");
int i = teacherFilesMapper.updateTeacherFilesState1(id); // int i = teacherFilesMapper.updateTeacherFilesState1(id);
teacherFilesNoticeMapper.updateTeacherFilesNotice(teacherFilesNotice); int i = teacherFilesNoticeMapper.updateTeacherFilesNotice(teacherFilesNotice);
return i; return i;
} }
......
package yangtz.cs.liu.campus.service.impl.teacherFiles; package yangtz.cs.liu.campus.service.impl.teacherFiles;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SchoolTeacher; 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.StringUtils;
...@@ -35,7 +36,7 @@ import java.util.*; ...@@ -35,7 +36,7 @@ import java.util.*;
* @date 2023-09-06 * @date 2023-09-06
*/ */
@Service @Service
public class TeacherFilesServiceImpl implements ITeacherFilesService public class TeacherFilesServiceImpl extends ServiceImpl<TeacherFilesMapper, TeacherFiles> implements ITeacherFilesService
{ {
@Autowired @Autowired
private TeacherFilesMapper teacherFilesMapper; private TeacherFilesMapper teacherFilesMapper;
...@@ -255,7 +256,7 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService ...@@ -255,7 +256,7 @@ public class TeacherFilesServiceImpl implements ITeacherFilesService
teacherFiles.setGradeId(byid.getGId()); teacherFiles.setGradeId(byid.getGId());
teacherFiles.setGradeName(byid.getGruoName()); teacherFiles.setGradeName(byid.getGruoName());
teacherFiles.setBzrClassName(teahClassName); teacherFiles.setBzrClassName(teahClassName);
teacherFiles.setState("2"); teacherFiles.setState("1");
teacherFiles = teacherFilesAddXx(teacherFiles); //老师个人信息 teacherFiles = teacherFilesAddXx(teacherFiles); //老师个人信息
//找到老师课程 //找到老师课程
// TODO 修改最新学年 // TODO 修改最新学年
......
package yangtz.cs.liu.campus.service.teacherFiles; package yangtz.cs.liu.campus.service.teacherFiles;
import com.baomidou.mybatisplus.extension.service.IService;
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;
...@@ -11,7 +12,7 @@ import java.util.List; ...@@ -11,7 +12,7 @@ import java.util.List;
* @author ruoyi * @author ruoyi
* @date 2023-09-06 * @date 2023-09-06
*/ */
public interface ITeacherFilesNoticeService public interface ITeacherFilesNoticeService extends IService<TeacherFilesNotice>
{ {
/** /**
* 查询教室档案通知 * 查询教室档案通知
......
package yangtz.cs.liu.campus.service.teacherFiles; package yangtz.cs.liu.campus.service.teacherFiles;
import com.baomidou.mybatisplus.extension.service.IService;
import yangtz.cs.liu.campus.domain.schooloffical.SchoolOfficial;
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.TeacherFilesDeletRecord;
import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice; import yangtz.cs.liu.campus.domain.teacherFiles.TeacherFilesNotice;
...@@ -14,7 +16,7 @@ import java.util.Map; ...@@ -14,7 +16,7 @@ import java.util.Map;
* @author ruoyi * @author ruoyi
* @date 2023-09-06 * @date 2023-09-06
*/ */
public interface ITeacherFilesService public interface ITeacherFilesService extends IService<TeacherFiles>
{ {
/** /**
* 查询教师档案 * 查询教师档案
......
...@@ -6,16 +6,16 @@ package yangtz.cs.liu.dingding.config; ...@@ -6,16 +6,16 @@ package yangtz.cs.liu.dingding.config;
public class Constant { public class Constant {
//测试 事件回调配置 //测试 事件回调配置
public static final String AES_TOKEN="jGt2S7Kqh475czbgxtr7j1cQsXHWYia"; // public static final String AES_TOKEN="jGt2S7Kqh475czbgxtr7j1cQsXHWYia";
//
// public static final String AES_KEY="hz6q2qTgLGD5SHWLvVddOm9HfvrKgKBcDCCf145egyi";
//
// public static final String OWNER_KEY = "dingclpf8qoxvinhksyh";
public static final String AES_KEY="hz6q2qTgLGD5SHWLvVddOm9HfvrKgKBcDCCf145egyi"; //正式 事件回调配置
public static final String AES_TOKEN="awLoV2xJlrg6xUK3wQIF88HhVuSVS7Tmpb5MKFI1j7DaLKcn";
public static final String OWNER_KEY = "dingclpf8qoxvinhksyh"; public static final String AES_KEY="xGO08pQerwFgBOcabx2eUxLUrAOwa5Q2FJtdylY7ksf";
//正式 事件回调配置 public static final String OWNER_KEY = "dingggqchzyvxm9e6e7v";
// public static final String AES_TOKEN="awLoV2xJlrg6xUK3wQIF88HhVuSVS7Tmpb5MKFI1j7DaLKcn";
//
// public static final String AES_KEY="xGO08pQerwFgBOcabx2eUxLUrAOwa5Q2FJtdylY7ksf";
//
// public static final String OWNER_KEY = "dingggqchzyvxm9e6e7v";
} }
...@@ -274,7 +274,7 @@ public class DingJiaXiaoController { ...@@ -274,7 +274,7 @@ public class DingJiaXiaoController {
//更新追加人员信息 //更新追加人员信息
@GetMapping("/updateLabUser") @GetMapping("/updateLabUser")
public String updateLabUser(){ public String updateLabUser() throws Exception {
//查找当前学年 所有的班级 //查找当前学年 所有的班级
String nowSchoolYear = schoolGradeService.selectUpToYear(); String nowSchoolYear = schoolGradeService.selectUpToYear();
SchoolClass schoolClass = new SchoolClass(); SchoolClass schoolClass = new SchoolClass();
...@@ -282,18 +282,27 @@ public class DingJiaXiaoController { ...@@ -282,18 +282,27 @@ public class DingJiaXiaoController {
List<SchoolClass> schoolClassCopies = iSchoolClassService.selectSchoolClassList(schoolClass); List<SchoolClass> schoolClassCopies = iSchoolClassService.selectSchoolClassList(schoolClass);
String token = accessTokenUtils.getToken(); String token = accessTokenUtils.getToken();
for (SchoolClass date : schoolClassCopies){ for (SchoolClass date : schoolClassCopies){
//查询班级下边的人员 包含三种人员查询 //同步家校通讯老师
//学生信息 this.handletTeacherDate(token,"teacher",date);
List<DingJiaXiaoVo.StudentUserInfo> studentUserInfos = new ArrayList<>(); //同步学生
//老师信息 this.handletStdentDate(token,"student",date);
//同步家长
this.handGuardianDate(token,"guardian",date);
}
return "完成";
}
/**
* 老师处理
* @param
* @return
*/
public void handletTeacherDate(String token ,String type ,SchoolClass date ) throws Exception{
List<DingJiaXiaoVo.StudentUserInfo> teacherUserInfos = new ArrayList<>(); List<DingJiaXiaoVo.StudentUserInfo> teacherUserInfos = new ArrayList<>();
//监护人信息*
List<DingJiaXiaoVo.StudentUserInfo> guardianUserInfos = new ArrayList<>();
SchoolTeacherVO schoolTeacher = new SchoolTeacherVO(); SchoolTeacherVO schoolTeacher = new SchoolTeacherVO();
//分页查询,每次查询数据最大只有30条,分5次查询 一个班判断最大150人
for (String type : userTypes) {
if (type.equals("teacher")) {
//同步家校通讯老师
teacherUserInfos = this.addUserList(token, type, date.getDdClassId()); teacherUserInfos = this.addUserList(token, type, date.getDdClassId());
for (DingJiaXiaoVo.StudentUserInfo teachDate : teacherUserInfos){ for (DingJiaXiaoVo.StudentUserInfo teachDate : teacherUserInfos){
// 关联老师跟班级信息 // 关联老师跟班级信息
...@@ -317,7 +326,6 @@ public class DingJiaXiaoController { ...@@ -317,7 +326,6 @@ public class DingJiaXiaoController {
schoolClassHeadmaster.setClassId(date.getId()); schoolClassHeadmaster.setClassId(date.getId());
iSchoolClassHeadmasterService.save(schoolClassHeadmaster); iSchoolClassHeadmasterService.save(schoolClassHeadmaster);
} }
//设置班级 班主任信息 //设置班级 班主任信息
SchoolClass schoolClassss = new SchoolClass(); SchoolClass schoolClassss = new SchoolClass();
schoolClassss.setId(date.getId()); schoolClassss.setId(date.getId());
...@@ -326,13 +334,26 @@ public class DingJiaXiaoController { ...@@ -326,13 +334,26 @@ public class DingJiaXiaoController {
schoolClassss.setTeacherTel(classHeadTeacher.getTeacherTel()); schoolClassss.setTeacherTel(classHeadTeacher.getTeacherTel());
iSchoolClassService.updateById(schoolClassss); iSchoolClassService.updateById(schoolClassss);
}else { }else {
SchoolCurriculum schoolCurriculum = null;
//查找部门 课程没有编写 //查找部门 课程没有编写
SysUser sysUser = sysUserService.selectUserById(classHeadTeacher.getId()); SysUser sysUser = sysUserService.selectUserById(classHeadTeacher.getId());
String deptName = sysUser.getDept().getDeptName(); //根据用户id去查找部门
SchoolCurriculum schoolCurriculum2 = schoolCurriculumMapper.selectCourseName(sysUser.getDept().getDeptName());
//判断主部门
if (null != schoolCurriculum2){
schoolCurriculum = schoolCurriculum2;
}else {
//多个部门
List<Map<String, Object>> maps = sysDeptMapper.selectDeptGroupByUserId(sysUser.getUserId());
for (Map mp :maps){
SchoolCurriculum schoolCurriculum1 = schoolCurriculumMapper.selectCourseName((String) mp.get("deptName"));
if (null != schoolCurriculum1);{
schoolCurriculum = schoolCurriculum1;
break;
}
}
}
//根据部门查找课程信息 //根据部门查找课程信息
SchoolCurriculum schoolCurriculum = schoolCurriculumMapper.selectCourseName(deptName);
LambdaQueryWrapper<SchoolClassMentor> lqw=new LambdaQueryWrapper<>(); LambdaQueryWrapper<SchoolClassMentor> lqw=new LambdaQueryWrapper<>();
lqw.eq(SchoolClassMentor::getTeacherId,classHeadTeacher.getId()); lqw.eq(SchoolClassMentor::getTeacherId,classHeadTeacher.getId());
lqw.eq(SchoolClassMentor::getClassId,date.getId()); lqw.eq(SchoolClassMentor::getClassId,date.getId());
...@@ -342,25 +363,32 @@ public class DingJiaXiaoController { ...@@ -342,25 +363,32 @@ public class DingJiaXiaoController {
SchoolClassMentor schoolClassMentor = new SchoolClassMentor(); SchoolClassMentor schoolClassMentor = new SchoolClassMentor();
schoolClassMentor.setTeacherId(classHeadTeacher.getId()); schoolClassMentor.setTeacherId(classHeadTeacher.getId());
schoolClassMentor.setClassId(date.getId()); schoolClassMentor.setClassId(date.getId());
schoolClassMentor.setCourseName(schoolCurriculum.getCourseName()); schoolClassMentor.setCourseName(schoolCurriculum == null ? null:schoolCurriculum.getCourseName());
schoolClassMentor.setCourseId(schoolCurriculum.getId()); schoolClassMentor.setCourseId(schoolCurriculum == null ? null:schoolCurriculum.getId());
schoolClassMentorService.save(schoolClassMentor); schoolClassMentorService.save(schoolClassMentor);
}else { }else {
SchoolClassMentor schoolClassMentor = list.get(0); SchoolClassMentor schoolClassMentor = list.get(0);
schoolClassMentor.setCourseName(schoolCurriculum.getCourseName()); schoolClassMentor.setCourseName(schoolCurriculum == null ? null:schoolCurriculum.getCourseName());
schoolClassMentor.setCourseId(schoolCurriculum.getId()); schoolClassMentor.setCourseId(schoolCurriculum == null ? null:schoolCurriculum.getId());
schoolClassMentorService.updateById(schoolClassMentor); schoolClassMentorService.updateById(schoolClassMentor);
} }
} }
} }
} else if (type.equals("student")) { }
//学生
/**
* 学生处理
* @param
* @returnguardianguardian
*/
public void handletStdentDate(String token ,String type ,SchoolClass date) throws Exception {
List<DingJiaXiaoVo.StudentUserInfo> studentUserInfos = new ArrayList<>();
studentUserInfos = this.addUserList(token, type, date.getDdClassId()); studentUserInfos = this.addUserList(token, type, date.getDdClassId());
for (DingJiaXiaoVo.StudentUserInfo studentDte : studentUserInfos) { for (DingJiaXiaoVo.StudentUserInfo studentDte : studentUserInfos) {
//当前是否有这个学生 //当前是否有这个学生
Long ddUserId = null; Long ddUserId = null;
ddUserId = schoolStudentService.getDdUserId(studentDte.getUserId()); ddUserId = schoolStudentService.getDdUserId(studentDte.getUserId());
if (null == ddUserId ){ if (null == ddUserId) {
//学生信息 //学生信息
SchoolStudent schoolStudent = new SchoolStudent(); SchoolStudent schoolStudent = new SchoolStudent();
schoolStudent.setStudentName(studentDte.getName()); schoolStudent.setStudentName(studentDte.getName());
...@@ -369,39 +397,35 @@ public class DingJiaXiaoController { ...@@ -369,39 +397,35 @@ public class DingJiaXiaoController {
schoolStudent.setDdUserId(studentDte.getUserId()); schoolStudent.setDdUserId(studentDte.getUserId());
schoolStudentService.save(schoolStudent); schoolStudentService.save(schoolStudent);
ddUserId = schoolStudent.getId(); ddUserId = schoolStudent.getId();
}else { } else {
SchoolStudent schoolStudent = new SchoolStudent(); SchoolStudent schoolStudent = new SchoolStudent();
schoolStudent.setStudentName(studentDte.getName()); schoolStudent.setStudentName(studentDte.getName());
schoolStudent.setClassId(date.getId()); schoolStudent.setClassId(date.getId());
schoolStudent.setStudentStatus("1"); schoolStudent.setStudentStatus("1");
schoolStudent.setDdUserId(studentDte.getUserId()); schoolStudent.setDdUserId(studentDte.getUserId());
schoolStudent.setId(ddUserId); schoolStudent.setId(ddUserId);
schoolStudentService.updateStudent(schoolStudent); schoolStudentService.updateById(schoolStudent);
} }
LambdaQueryWrapper<SchoolStudentClassRelation> lqw = new LambdaQueryWrapper<>();
LambdaQueryWrapper<SchoolStudentClassRelation> lqw=new LambdaQueryWrapper<>(); lqw.eq(SchoolStudentClassRelation::getStudentId, ddUserId);
lqw.eq(SchoolStudentClassRelation::getStudentId,ddUserId); lqw.eq(SchoolStudentClassRelation::getClassId, date.getId());
lqw.eq(SchoolStudentClassRelation::getClassId,date.getId());
List<SchoolStudentClassRelation> list = iSchoolStudentClassRelationService.list(); List<SchoolStudentClassRelation> list = iSchoolStudentClassRelationService.list();
if (list.isEmpty()){ if (list.isEmpty()) {
//学生班级信息 //学生班级信息
SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation(); SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation();
schoolStudentClassRelation.setStudentId(ddUserId); schoolStudentClassRelation.setStudentId(ddUserId);
schoolStudentClassRelation.setClassId(date.getId()); schoolStudentClassRelation.setClassId(date.getId());
iSchoolStudentClassRelationService.save(schoolStudentClassRelation); iSchoolStudentClassRelationService.save(schoolStudentClassRelation);
} }
//学生与班级历史关系 //学生与班级历史关系
SchoolClass school= iSchoolClassService.selectSchoolClassById(date.getId()); SchoolClass school = iSchoolClassService.selectSchoolClassById(date.getId());
LambdaQueryWrapper<SchoolStudentClasses> lsqw = new LambdaQueryWrapper<>();
lsqw.eq(SchoolStudentClasses::getStudentId, ddUserId);
LambdaQueryWrapper<SchoolStudentClasses> lsqw=new LambdaQueryWrapper<>(); lsqw.eq(SchoolStudentClasses::getGrade, school.getGradeName());
lsqw.eq(SchoolStudentClasses::getStudentId,ddUserId); lsqw.eq(SchoolStudentClasses::getClasses, school.getClassName());
lsqw.eq(SchoolStudentClasses:: getGrade,school.getGradeName()); lsqw.eq(SchoolStudentClasses::getTeacherName, school.getTeacherName());
lsqw.eq(SchoolStudentClasses:: getClasses,school.getClassName());
lsqw.eq(SchoolStudentClasses:: getTeacherName,school.getTeacherName());
List<SchoolStudentClasses> list1 = schoolStudentClassesService.list(lsqw); List<SchoolStudentClasses> list1 = schoolStudentClassesService.list(lsqw);
if (list1.isEmpty()){ if (list1.isEmpty()) {
SchoolStudentClasses schoolStudentClasses = new SchoolStudentClasses(); SchoolStudentClasses schoolStudentClasses = new SchoolStudentClasses();
schoolStudentClasses.setStudentId(ddUserId); schoolStudentClasses.setStudentId(ddUserId);
schoolStudentClasses.setGrade(school.getGradeName()); schoolStudentClasses.setGrade(school.getGradeName());
...@@ -410,8 +434,16 @@ public class DingJiaXiaoController { ...@@ -410,8 +434,16 @@ public class DingJiaXiaoController {
schoolStudentClassesService.save(schoolStudentClasses); schoolStudentClassesService.save(schoolStudentClasses);
} }
} }
} else if (type.equals("guardian")) { }
//监护人
/**
* 家长处理
* @param grade
* @return
*/
public void handGuardianDate(String token,String type,SchoolClass date)throws Exception{
List<DingJiaXiaoVo.StudentUserInfo> guardianUserInfos = new ArrayList<>();
guardianUserInfos = this.addUserList(token, type, date.getDdClassId()); guardianUserInfos = this.addUserList(token, type, date.getDdClassId());
for (DingJiaXiaoVo.StudentUserInfo guarDate : guardianUserInfos){ for (DingJiaXiaoVo.StudentUserInfo guarDate : guardianUserInfos){
//找寻学生 //找寻学生
...@@ -419,7 +451,7 @@ public class DingJiaXiaoController { ...@@ -419,7 +451,7 @@ public class DingJiaXiaoController {
Long ddUserId = schoolStudentService.getDdUserId(toUserId); Long ddUserId = schoolStudentService.getDdUserId(toUserId);
Long userId = null; Long userId = null;
//查找监护人 //查找监护人
SysUser sysUser = sysUserService.selectUserByDdUserId(ddUserId.toString()); SysUser sysUser = sysUserService.selectUserByDdUserId(guarDate.getUserId().toString());
if (null == sysUser){ if (null == sysUser){
//创建用户user表 //创建用户user表
SysUser jUser = new SysUser(); SysUser jUser = new SysUser();
...@@ -469,19 +501,15 @@ public class DingJiaXiaoController { ...@@ -469,19 +501,15 @@ public class DingJiaXiaoController {
schoolStudentParent1.setStudentId(ddUserId); schoolStudentParent1.setStudentId(ddUserId);
schoolStudentParent1.setUserId(userId); schoolStudentParent1.setUserId(userId);
schoolStudentParent1.setParentName(guarDate.getName()); schoolStudentParent1.setParentName(guarDate.getName());
schoolStudentParent1.setTelephone(guarDate.getMobile schoolStudentParent1.setTelephone(guarDate.getMobile());
());
Integer patriarch = this.getPatriarch(guarDate.getName().substring(guarDate.getName().length() - 2)); Integer patriarch = this.getPatriarch(guarDate.getName().substring(guarDate.getName().length() - 2));
schoolStudentParent1.setRelationship(String.valueOf(patriarch)); schoolStudentParent1.setRelationship(String.valueOf(patriarch));
iSchoolStudentParentService.updateById(schoolStudentParent1); iSchoolStudentParentService.updateById(schoolStudentParent1);
} }
} }
} }
}
}
return "完成";
}
//获取监护人详情 获取学生userid //获取监护人详情 获取学生userid
public String getToUserId(String token,String fromUserId,String classId){ public String getToUserId(String token,String fromUserId,String classId){
...@@ -517,10 +545,11 @@ public class DingJiaXiaoController { ...@@ -517,10 +545,11 @@ public class DingJiaXiaoController {
return bjDetailsArray; return bjDetailsArray;
} }
private List<DingJiaXiaoVo.StudentUserInfo> addUserList(String token,String type,String classId){ private List<DingJiaXiaoVo.StudentUserInfo> addUserList(String token,String type,String classId) throws Exception{
List<DingJiaXiaoVo.StudentUserInfo> userList = new ArrayList<>(); List<DingJiaXiaoVo.StudentUserInfo> userList = new ArrayList<>();
//分页查询,每次查询数据最大只有30条,分5次查询 一个班判断最大150人 //分页查询,每次查询数据最大只有30条,分5次查询 一个班判断最大150人
for (int k = 1;k <= 4; k++ ){ for (int k = 1;k <= 4; k++ ){
Thread.sleep(200);
//查询班级下边的人员 //查询班级下边的人员
JSONObject ryParme = new JSONObject(); JSONObject ryParme = new JSONObject();
ryParme.put("page_no",k); ryParme.put("page_no",k);
...@@ -547,6 +576,7 @@ public class DingJiaXiaoController { ...@@ -547,6 +576,7 @@ public class DingJiaXiaoController {
studentUserInfo.setStudentNo(userInfo.getJSONObject("feature").get("student_no") ==null ? null:userInfo.getJSONObject("feature").get("student_no").toString()); studentUserInfo.setStudentNo(userInfo.getJSONObject("feature").get("student_no") ==null ? null:userInfo.getJSONObject("feature").get("student_no").toString());
//学生没有手机号 不需要查询手机号 //学生没有手机号 不需要查询手机号
if (!type.equals("student")){ if (!type.equals("student")){
Thread.sleep(200);
String tel = this.getTel(studentUserInfo.getUserId(), token); String tel = this.getTel(studentUserInfo.getUserId(), token);
studentUserInfo.setMobile(tel); studentUserInfo.setMobile(tel);
} }
...@@ -559,169 +589,6 @@ public class DingJiaXiaoController { ...@@ -559,169 +589,6 @@ public class DingJiaXiaoController {
} }
/**
* 钉钉数据同步到数据,
* //班级、级部 、学生、家长、老师、班级关系、
// */
// @GetMapping("/updateJiaXiaoTX")
// public void updateJiaXiaoTX(){
//
// //获取钉钉数据
// List<DingJiaXiaoVo> list = null;
// //循环更新
// for (DingJiaXiaoVo njDate : list){
// //更新年级
// String gradeName = njDate.getGradeName();
// Integer gradeId = njDate.getGradeId();
// SchoolGrade schoolGrade = new SchoolGrade();
// schoolGrade.setGradeName(gradeName.substring(gradeName.length()- 5)+"部");
// schoolGrade.setGradeValue(Integer.valueOf(this.gradeSubt(gradeName.substring(3))));
// schoolGrade.setGradeYear(gradeName.substring(gradeName.length()- 5,4));
// schoolGrade.setSchoolYear(gradeName.substring(gradeName.length()- 5,4));
// schoolGrade.setRemark(gradeName);
// schoolGrade.setId(Long.valueOf(gradeId));
// schoolGradeService.save(schoolGrade);
// //获取班级
// List<DingJiaXiaoVo.ClassInfo> classInfoList = njDate.getClassInfoList();
// //遍历班级
// for (DingJiaXiaoVo.ClassInfo classDate : classInfoList){
//
//
// String teacherName =null;
//
// Integer classId = classDate.getClassId();
// String className = classDate.getClassName();
// Map<String,String> fromUserId = this.getFromUserId(Long.valueOf(classId), accessTokenUtils.getToken());
// SchoolClass schoolClass = new SchoolClass();
// schoolClass.setSchoolYear(Integer.valueOf(schoolGrade.getSchoolYear()));
// schoolClass.setClassType("4");
// schoolClass.setGradeValue(Integer.valueOf(schoolGrade.getGradeYear()));
// schoolClass.setGradeName(schoolGrade.getGradeName());
// schoolClass.setId(Long.valueOf(classId));
// schoolClass.setClassName(className);
// schoolClass.setClassValue(Integer.valueOf(className.substring(className.length()-2,1)));
// schoolClass.setClassAlias(className);
// schoolClass.setGradeId(schoolGrade.getId());
// schoolClass.setGradeId(schoolGrade.getId());
//
// //班级
// iSchoolClassService.save(schoolClass);
//
// //老师
// List<DingJiaXiaoVo.StudentUserInfo> teacherUserInfos = classDate.getTeacherUserInfos();
// for (DingJiaXiaoVo.StudentUserInfo date : teacherUserInfos){
// SysUser sysUser = new SysUser();
// sysUser.setUserId(Long.valueOf(date.getUserId()));
//// sysUser.setDept(); 部门没有
// sysUser.setLoginName(date.getName());
// sysUser.setUserName(date.getName());
// sysUser.setUserType("01");
// sysUser.setUserLoginType("0");
// sysUser.setPhonenumber(date.getMobile());
// sysUser.setPassword(SecurityUtils.encryptPassword("123456"));
// sysUser.setStatus("0");
// sysUser.setDelFlag("0");
// sysUser.setUnionId(date.getUnionid());
// sysUser.setRoleIds(new Long[]{111L});
// //用户表
// sysUserService.insertUser(sysUser);
//
// SchoolTeacher schoolTeacher = new SchoolTeacher();
// schoolTeacher.setTeacherName(date.getName());
// // schoolTeacher.setSex(); 性别没有
// schoolTeacher.setNation("汉族");
//// schoolTeacher.setTeacherCode(); 工作编号
// schoolTeacher.setUserId(sysUser.getUserId());
// schoolTeacher.setTeacherTel(date.getMobile());
// schoolTeacher.setUnionId(date.getUnionid());
// // schoolTeacher.setDeptId(); schoolTeacher.setDeptName(); 部门没有
// //老师表
// schoolTeacherService.save(schoolTeacher);
// //老师与班级关系表 缺少课程信息
//// SchoolClassMentor schoolClassMentor = new SchoolClassMentor();
//// schoolClassMentor.setTeacherId(schoolTeacher.getId());
//// schoolClassMentorService.save(schoolClassMentor);
// if (date.getIsAdviser().equals("1")){
// schoolClass.setTeacherId(schoolTeacher.getId());
// schoolClass.setTeacherName(date.getName());
// schoolClass.setTeacherTel(date.getMobile());
// teacherName = date.getName();
// SchoolClassHeadmaster schoolClassHeadmaster = new SchoolClassHeadmaster();
// schoolClassHeadmaster.setTeacherId(schoolTeacher.getId());
// schoolClassHeadmaster.setClassId(Long.valueOf(classId));
// //班主任和班级关系
// iSchoolClassHeadmasterService.save(schoolClassHeadmaster);
// }
// }
//
// //学生
// List<DingJiaXiaoVo.StudentUserInfo> studentUserInfos = classDate.getStudentUserInfos();
// for (DingJiaXiaoVo.StudentUserInfo date : studentUserInfos){
// //学生表
// SchoolStudent schoolStudent = new SchoolStudent();
// schoolStudent.setStudentName(date.getName());
//// schoolStudent.setSex();
// schoolStudent.setClassId(Long.valueOf(classId));
//// schoolStudent.setIdCard(); 身份证号
// schoolStudent.setNation("汉族");
// schoolStudent.setNationalNumber(date.getStudentNo());
// schoolStudent.setEnrollmentYear(gradeName.substring(gradeName.length()- 5,4));
// schoolStudent.setStudentStatus("1");
// schoolStudent.setId(Long.valueOf(date.getUserId()));
// schoolStudentService.save(schoolStudent);
// //学生与班级关系
// SchoolStudentClassRelation schoolStudentClassRelation = new SchoolStudentClassRelation();
// schoolStudentClassRelation.setClassId(Long.valueOf(classId));
// schoolStudentClassRelation.setStudentId(schoolStudent.getId());
// iSchoolStudentClassRelationService.save(schoolStudentClassRelation);
// //学生历史班级表
// SchoolStudentClasses schoolStudentClasses = new SchoolStudentClasses();
// schoolStudentClasses.setTeacherName(teacherName);
// schoolStudentClasses.setStudentId(schoolStudent.getId());
// schoolStudentClasses.setGrade(gradeName.substring(gradeName.length()- 5,4));
// schoolStudentClasses.setClasses(className);
// schoolStudentClassesService.save(schoolStudentClasses);
// }
// //监护人
// List<DingJiaXiaoVo.StudentUserInfo> guardianUserInfos = classDate.getGuardianUserInfos();
// for (DingJiaXiaoVo.StudentUserInfo date : guardianUserInfos){
// String studentId = fromUserId.get(date.getUserId());
//
// //创建家长用户
// SysUser jUser = new SysUser();
// jUser.setUserId(Long.valueOf(date.getUserId()));
//// sysUser.setDept(); 部门没有
// jUser.setLoginName(date.getName());
// jUser.setUserName(date.getName());
// jUser.setUserType("01");
// jUser.setUserLoginType("1");
// jUser.setPhonenumber(date.getMobile());
// jUser.setPassword(SecurityUtils.encryptPassword("123456"));
// jUser.setStatus("0");
// jUser.setDelFlag("0");
// jUser.setUnionId(date.getUnionid());
// jUser.setRoleIds(new Long[]{111L});
// jUser.setStudentId(Long.valueOf(studentId));
// sysUserService.insertUser(jUser);
// //维护家长表
// SchoolStudentParent schoolStudentParent = new SchoolStudentParent();
// schoolStudentParent.setStudentId(Long.valueOf(studentId));
// schoolStudentParent.setUserId(jUser.getUserId());
// schoolStudentParent.setParentName(date.getName());
// schoolStudentParent.setTelephone(date.getMobile());
// Integer patriarch = this.getPatriarch(date.getName().substring(date.getName().length() - 2));
// schoolStudentParent.setRelationship(patriarch.toString());
// iSchoolStudentParentService.save(schoolStudentParent);
//
// }
//
//
// iSchoolClassService.updateById(schoolClass);
//
//
// }
// }
// }
private String gradeSubt(String grade){ private String gradeSubt(String grade){
...@@ -788,7 +655,10 @@ public class DingJiaXiaoController { ...@@ -788,7 +655,10 @@ public class DingJiaXiaoController {
userParme.put("userid",userId); userParme.put("userid",userId);
String userPost = HttpUtil.post("https://oapi.dingtalk.com/topapi/v2/user/get?access_token="+assToKen, userParme); String userPost = HttpUtil.post("https://oapi.dingtalk.com/topapi/v2/user/get?access_token="+assToKen, userParme);
JSONObject jsonObject = JSONObject.parseObject(userPost); JSONObject jsonObject = JSONObject.parseObject(userPost);
if ((Integer)jsonObject.get("errcode") != 0 ){
log.error(jsonObject.toString());
return null;
}
if (jsonObject.getJSONObject("result").get("mobile")==null){ if (jsonObject.getJSONObject("result").get("mobile")==null){
return null; return null;
}else { }else {
......
...@@ -2,10 +2,12 @@ package yangtz.cs.liu.wechat.controller.timetable; ...@@ -2,10 +2,12 @@ package yangtz.cs.liu.wechat.controller.timetable;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.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.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
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;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -43,7 +45,8 @@ public class WxSchoolTimeTableController extends BaseController { ...@@ -43,7 +45,8 @@ public class WxSchoolTimeTableController extends BaseController {
@Autowired @Autowired
private ISchoolTimeDetailService schoolTimeDetailService; private ISchoolTimeDetailService schoolTimeDetailService;
@Autowired
ISysDeptService deptService;
/** /**
* 获取家长端学生个人课表 * 获取家长端学生个人课表
*/ */
...@@ -61,9 +64,38 @@ public class WxSchoolTimeTableController extends BaseController { ...@@ -61,9 +64,38 @@ public class WxSchoolTimeTableController extends BaseController {
@GetMapping("/getTeacherTable/{userId}") @GetMapping("/getTeacherTable/{userId}")
public TableDataInfo getTeacherTable(@PathVariable Long userId) { public TableDataInfo getTeacherTable(@PathVariable Long userId) {
Long teacherId = userId; Long teacherId = userId;
Boolean flag= false;
//获取当前登录用户 //获取当前登录用户
SysUser user = userService.selectUserById(teacherId); SysUser user = userService.selectUserById(teacherId);
if (user.getEmployeeType().equals(EMPLOYEE)) { //判断当前所在部门是级部还是科室
//找到当前人所有的部门跟主部门
//1.判断主部门
String[] split = user.getDept().getAncestors().split(",");
if (split.length ==2){
//当前是跟部门判断是不是级部
if (user.getDept().getDeptName().contains("级部")){
flag = true;
}
}else {
//子部门就找主部门
SysDept sysDept = deptService.selectDeptById(Long.valueOf(split[2]));
if (sysDept.getDeptName().contains("级部")){
flag = true;
}
}
//2 多个部门下进行判断
List<SysDept> sysDepts = deptService.selectConformDept(userId);
for (SysDept dept : sysDepts){
String[] split1 = dept.getAncestors().split(",");
if (split1.length >= 3){
SysDept sysDept = deptService.selectDeptById(Long.valueOf(split1[2]));
if (sysDept.getDeptName().contains("级部")){
flag = true;
break;
}
}
}
if (!flag) {
//throw new ServiceException("您的用户类型为职工,无法查询个人课表"); //throw new ServiceException("您的用户类型为职工,无法查询个人课表");
return getDataTable(new ArrayList<>()); return getDataTable(new ArrayList<>());
} }
......
...@@ -205,7 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -205,7 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTeacherFilesState" parameterType="String"> <update id="updateTeacherFilesState" parameterType="String">
update teacher_files set state = 2 where notice_id = #{noticeId} update teacher_files set state = 1 where notice_id = #{noticeId}
</update> </update>
<update id="updateTeacherFilesState1" parameterType="String"> <update id="updateTeacherFilesState1" parameterType="String">
......
...@@ -73,6 +73,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -73,6 +73,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTeacherFilesNotice" parameterType="TeacherFilesNotice"> <insert id="insertTeacherFilesNotice" parameterType="TeacherFilesNotice">
insert into teacher_files_notice insert into teacher_files_notice
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
......
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