Explorar el Código

Merge remote-tracking branch 'origin/dev'

chenw hace 6 años
padre
commit
776dab4af2

+ 1 - 4
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxUserServiceImpl.java

@@ -640,10 +640,7 @@ public class WxUserServiceImpl implements WxUserService {
 					if (code.equals(userDO.getUserCode())) {
 						userDO.setUserPhone(userPhone);
 						//更新家长信息表中的手机号
-						ParentsDO updateParentsDO = new ParentsDO();
-                        updateParentsDO.setParentId(parentsDO.getParentId());
-                        updateParentsDO.setPaPhone(userPhone);
-						parentsMapper.update(updateParentsDO);
+						parentsMapper.updateMobile(parentsDO.getPaPhone(), userPhone);
 						//更新账户的手机号
 						return userMapper.update(userDO);
 					}else {

+ 2 - 0
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/mapper/WxParentsMapper.java

@@ -33,4 +33,6 @@ public interface WxParentsMapper {
 	ParentsDO getBySchoolAndOpenid(@Param("schoolId") Long schoolId, @Param("openid") String openid);
 
 	List<ParentsDO> getByStuId(Long stuId);
+
+	void updateMobile(@Param("oldMobile") String oldMobile, @Param("newMobile") String newMobile);
 }

+ 4 - 0
applications/school/school-server/src/main/resources/mapper/WxParentsMapper.xml

@@ -136,4 +136,8 @@
 		</where>
 	</select>
 
+  <update id="updateMobile">
+    UPDATE sys_parents set pa_phone = #{newMobile} where pa_phone = #{oldMobile}
+  </update>
+
 </mapper>