Эх сурвалжийг харах

Merge branch 'dev' of ssh://10.10.100.21/source/smartschool-platform into dev

zhaoy 6 жил өмнө
parent
commit
1482bd2df1

+ 17 - 8
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/basic/service/impl/StudentServiceImpl.java

@@ -15,10 +15,7 @@ import com.usoftchina.smartschool.school.dto.BatchDealBaseDTO;
 import com.usoftchina.smartschool.school.dto.DocBaseDTO;
 import com.usoftchina.smartschool.school.dto.ListReqDTO;
 import com.usoftchina.smartschool.school.exception.BizExceptionCode;
-import com.usoftchina.smartschool.school.mapper.DataImportMapper;
-import com.usoftchina.smartschool.school.mapper.SysClazzMapper;
-import com.usoftchina.smartschool.school.mapper.SysGradeMapper;
-import com.usoftchina.smartschool.school.mapper.SysStudentMapper;
+import com.usoftchina.smartschool.school.mapper.*;
 import com.usoftchina.smartschool.school.po.*;
 import com.usoftchina.smartschool.school.wxschool.mapper.WxUserMapper;
 import com.usoftchina.smartschool.utils.CollectionUtils;
@@ -48,6 +45,8 @@ public class StudentServiceImpl implements StudentService{
     @Autowired
     private SysGradeMapper sysGradeMapper;
     @Autowired
+    private SysTeacherMapper sysTeacherMapper;
+    @Autowired
     private SysClazzMapper sysClazzMapper;
     @Autowired
     private MessageLogService messageLogService;
@@ -174,12 +173,22 @@ public class StudentServiceImpl implements StudentService{
             //更新账户信息表的手机号
             for (SysParents item : updateDetails) {
                 SysParents sysParents = sysStudentMapper.selectParentById(item.getParent_id());
-                if (ObjectUtils.isEmpty(sysParents)) {
+                if (!ObjectUtils.isEmpty(sysParents)) {
                     if (item.getPa_phone().equals(sysParents.getPa_phone())) {
                         UserDO userDO = new UserDO();
-                        userDO.setUserId(item.getUser_id());
-                        userDO.setUserPhone(item.getPa_phone());
-                        userMapper.update(userDO);
+                        UserDO oldUserDO = userMapper.selectUserByPhone(sysParents.getPa_phone());
+                        if (!ObjectUtils.isEmpty(oldUserDO)) {
+                            userDO.setUserId(oldUserDO.getUserId());
+                            userDO.setUserPhone(item.getPa_phone());
+                            userMapper.update(userDO);
+                            SysTeacher oldSysTeacher = sysTeacherMapper.selectByPhone(sysParents.getPa_phone(), schoolid);
+                            if (!ObjectUtils.isEmpty(oldSysTeacher)){
+                                SysTeacher sysTeacher = new SysTeacher();
+                                sysTeacher.setTeacher_phone(item.getPa_phone());
+                                sysTeacher.setTeacher_id(oldSysTeacher.getTeacher_id());
+                                sysTeacherMapper.updateByPrimaryKeySelective(sysTeacher);
+                            }
+                        }
                     }
                 }
             }

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/business/service/impl/NoticeServiceImpl.java

@@ -165,6 +165,8 @@ public class NoticeServiceImpl implements NoticeService{
 
                 url = baseWechatUrl + "/notifyDetail/person/" + id + "?personId=" + noticer.getPersonId().split(",")[0] +
                         "&type=" + noticer.getType().split(",")[0];
+                noticer.setType(noticer.getType().split(",")[0]);
+                noticer.setPersonId(noticer.getPersonId().split(",")[0]);
                 msg.setUrl(url);
                 msg.setTitle(data.getNotify_title());
                 msg.setKeyword1(school.getSchool_name());