Browse Source

修复bug 4455, 4456

魏熙美 6 years ago
parent
commit
3ff3cccfc1

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

1
 package com.community.huiju.dao;
1
 package com.community.huiju.dao;
2
 
2
 
3
 import com.community.huiju.model.TpBuildingOwnerInfo;
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
 import java.util.List;
6
 import java.util.List;
10
 
7
 
76
     @ResultMap("BaseResultMap")
73
     @ResultMap("BaseResultMap")
77
     @Select("select * from tp_building_owner_info where ta_user_verify_id = #{userVerifyId}")
74
     @Select("select * from tp_building_owner_info where ta_user_verify_id = #{userVerifyId}")
78
     TpBuildingOwnerInfo selectByUserVerifyId(@Param("userVerifyId") Integer userVerifyId);
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 View File

356
         taUserMapper.updateLongName(taUser);
356
         taUserMapper.updateLongName(taUser);
357
         response.addSuccess("修改成功");
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
         response.addSuccess(new String[0]);
363
         response.addSuccess(new String[0]);