Commit aa50b82f by Cat
parents 8d65674c f2d2c7a6
...@@ -9,6 +9,8 @@ import com.ruoyi.common.core.domain.entity.SchoolTeacher; ...@@ -9,6 +9,8 @@ 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;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -47,6 +49,9 @@ import java.util.stream.Collectors; ...@@ -47,6 +49,9 @@ import java.util.stream.Collectors;
@RequestMapping("/dd/djtx") @RequestMapping("/dd/djtx")
public class DingJiaXiaoController { public class DingJiaXiaoController {
private static final Logger log = LoggerFactory.getLogger(DingJiaXiaoController.class);
@Autowired @Autowired
private AccessTokenUtils accessTokenUtils; private AccessTokenUtils accessTokenUtils;
...@@ -255,7 +260,7 @@ public class DingJiaXiaoController { ...@@ -255,7 +260,7 @@ public class DingJiaXiaoController {
} }
} }
return ""; return "1";
} }
...@@ -282,13 +287,13 @@ public class DingJiaXiaoController { ...@@ -282,13 +287,13 @@ public class DingJiaXiaoController {
if (type.equals("teacher")) { 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){
// 关联老师跟班级信息 // 关联老师跟班级信息
schoolTeacher.setTeacherName(teachDate.getName()); schoolTeacher.setTeacherName(teachDate.getName());
List<SchoolTeacher> schoolTeacherCopies = schoolTeacherService.selectSchoolTeacherList(schoolTeacher); List<SchoolTeacher> schoolTeacherCopies = schoolTeacherService.selectSchoolTeacherList(schoolTeacher);
if (schoolTeacherCopies.isEmpty()){ if (schoolTeacherCopies.isEmpty()){
throw new RuntimeException("钉钉老师未在系统中找到"); log.error("钉钉老师未在系统中找到:"+teachDate.getName());
continue;
} }
SchoolTeacher classHeadTeacher = schoolTeacherCopies.get(0); SchoolTeacher classHeadTeacher = schoolTeacherCopies.get(0);
//职工跟年级关系 //职工跟年级关系
...@@ -354,7 +359,10 @@ public class DingJiaXiaoController { ...@@ -354,7 +359,10 @@ public class DingJiaXiaoController {
SchoolStudentVO schoolStudentVO = new SchoolStudentVO(); SchoolStudentVO schoolStudentVO = new SchoolStudentVO();
schoolStudentVO.setDdUserId(toUserId); schoolStudentVO.setDdUserId(toUserId);
List<SchoolStudentVO> schoolStudentVOS = schoolStudentService.queryList(schoolStudentVO); List<SchoolStudentVO> schoolStudentVOS = schoolStudentService.queryList(schoolStudentVO);
Long studenId = schoolStudentVOS.get(0).getId(); Long studenId =null;
if (!schoolStudentVOS.isEmpty()){
studenId = schoolStudentVOS.get(0).getId();
}
//创建用户user表 //创建用户user表
SysUser jUser = new SysUser(); SysUser jUser = new SysUser();
......
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