소스 검색

修复 bug 4175

魏熙美 6 년 전
부모
커밋
daddef247a

+ 12
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpBuildingOwnerInfoMapper.java 파일 보기

@@ -82,5 +82,16 @@ public interface TpBuildingOwnerInfoMapper {
82 82
      */
83 83
     @ResultType(Integer.class)
84 84
     @Update("update tp_building_owner_info set owner_tel = #{newPhone} where owner_tel = #{oldPhone}")
85
-    Integer updateAllByPhone(String oldPhone, String newPhone);
85
+    Integer updateAllByPhone(@Param("oldPhone") String oldPhone, @Param("newPhone") String newPhone);
86
+
87
+    /**
88
+     * 根据手机号更新 性别 和 姓名
89
+     * @param phone
90
+     * @param gender
91
+     * @param userName
92
+     * @return
93
+     */
94
+    @ResultType(Integer.class)
95
+    @Update("update tp_building_owner_info set owner_name = #{userName}, gender = #{gender} where owner_tel = #{phone}")
96
+    int updateGenderAndOwnerNameByPhone(@Param("phone") String phone, @Param("gender") String gender, @Param("userName") String userName);
86 97
 }

+ 4
- 18
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java 파일 보기

@@ -413,26 +413,12 @@ public class TaUserServiceImpl implements ITaUserService {
413 413
         // 数据库数据
414 414
         TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
415 415
 
416
-        /**
417
-         * 判断是否 是业主,如果业主就连着 楼栋资料库 信息修改
418
-         */
419
-
420
-        TaUserVerify userVerify = taUserVerifyMapper.selectByPrimaryKey(userElement.getUserVerifyId());
421
-        TaSysRole sysRole = taSysRoleMapper.selectByPrimaryKey(userVerify.getRoleId());
422
-
423 416
         BeanTools.copyProperties(user, taUser);
424 417
         int result = taUserMapper.updateByPrimaryKeySelective(taUser);
425
-        // int VerifyStatus= Integer.parseInt(taUser.getVerifyStatus());
426
-        if (1 == sysRole.getId()) {
427
-            TpBuildingOwnerInfo tpBuildingOwnerInfo = new TpBuildingOwnerInfo();
428
-            tpBuildingOwnerInfo.setOwnerName(user.getUserName());
429
-            tpBuildingOwnerInfo.setGender(user.getGender());
430
-            tpBuildingOwnerInfo.setOwnerTel(user.getLoginName());
431
-            tpBuildingOwnerInfo.setUpdateDate(new Date());
432
-            tpBuildingOwnerInfo.setUpdateUser(taUser.getId());
433
-            tpBuildingOwnerInfo.setId(userElement.getRoomNoId());
434
-            tpBuildingOwnerInfoMapper.updateByPrimaryKeySelective(tpBuildingOwnerInfo);
435
-        }
418
+
419
+        // 修改楼栋资料库手机号
420
+        result = tpBuildingOwnerInfoMapper.updateGenderAndOwnerNameByPhone(taUser.getLoginName(), user.getGender(), user.getUserName());
421
+
436 422
         if (result > 0) {
437 423
             response.addSuccess("修改成功!");
438 424
         } else {

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml 파일 보기

@@ -285,7 +285,7 @@
285 285
       <if test="faceStatus != null" >
286 286
         face_status = #{faceStatus,jdbcType=CHAR},
287 287
       </if>
288
-      <if test="idCard != null">
288
+      <if test="idCard != null and idCard != ''">
289 289
         id_card = #{idCard,jdbcType=VARCHAR},
290 290
       </if>
291 291
       <if test="openid != null" >