Ver código fonte

修复bug 4455, 4456

魏熙美 6 anos atrás
pai
commit
3ff3cccfc1

+ 11
- 4
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java Ver arquivo

@@ -1,10 +1,7 @@
1 1
 package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpBuildingOwnerInfo;
4
-import org.apache.ibatis.annotations.Mapper;
5
-import org.apache.ibatis.annotations.Param;
6
-import org.apache.ibatis.annotations.ResultMap;
7
-import org.apache.ibatis.annotations.Select;
4
+import org.apache.ibatis.annotations.*;
8 5
 
9 6
 import java.util.List;
10 7
 
@@ -76,4 +73,14 @@ public interface TpBuildingOwnerInfoMapper {
76 73
     @ResultMap("BaseResultMap")
77 74
     @Select("select * from tp_building_owner_info where ta_user_verify_id = #{userVerifyId}")
78 75
     TpBuildingOwnerInfo selectByUserVerifyId(@Param("userVerifyId") Integer userVerifyId);
76
+
77
+    /**
78
+     * 根据手机号更新手机号
79
+     * @param oldPhone
80
+     * @param newPhone
81
+     * @return
82
+     */
83
+    @ResultType(Integer.class)
84
+    @Update("update tp_building_owner_info set owner_tel = #{newPhone} where owner_tel = #{oldPhone}")
85
+    Integer updateAllByPhone(String oldPhone, String newPhone);
79 86
 }

+ 2
- 16
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java Ver arquivo

@@ -356,22 +356,8 @@ public class TaUserServiceImpl implements ITaUserService {
356 356
         taUserMapper.updateLongName(taUser);
357 357
         response.addSuccess("修改成功");
358 358
 
359
-        /**
360
-         * 如果是 家属或者租客,修改手机号, 就不允许修改资料库的信息
361
-         * 根据房产判断 当前是否是 业主
362
-         */
363
-
364
-        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
365
-        TaSysRole sysRole = taSysRoleMapper.selectByPrimaryKey(userVerify.getRoleId());
366
-
367
-        // 修改楼栋信息资料库的手机号
368
-        // 1 业主 2 租客 3 家属
369
-        // 只允许业主修改
370
-        if (null != sysRole && sysRole.getId().intValue() == 1) {
371
-            TpBuildingOwnerInfo buildingOwnerInfo = tpBuildingOwnerInfoMapper.selectByPrimaryKey(userVerify.getRoomNoId());
372
-            buildingOwnerInfo.setOwnerTel(phone);
373
-            tpBuildingOwnerInfoMapper.updateByPrimaryKeySelective(buildingOwnerInfo);
374
-        }
359
+        // 修改楼栋资料库手机号
360
+        tpBuildingOwnerInfoMapper.updateAllByPhone(user.getLoginName(), phone);
375 361
 
376 362
         // 给前端返回一个空数组
377 363
         response.addSuccess(new String[0]);