dingxin 6 years ago
parent
commit
688a5395b0

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

82
      */
82
      */
83
     @ResultType(Integer.class)
83
     @ResultType(Integer.class)
84
     @Update("update tp_building_owner_info set owner_tel = #{newPhone} where owner_tel = #{oldPhone}")
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 View File

413
         // 数据库数据
413
         // 数据库数据
414
         TaUser taUser = taUserMapper.selectByPrimaryKey(userElement.getId());
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
         BeanTools.copyProperties(user, taUser);
416
         BeanTools.copyProperties(user, taUser);
424
         int result = taUserMapper.updateByPrimaryKeySelective(taUser);
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
         if (result > 0) {
422
         if (result > 0) {
437
             response.addSuccess("修改成功!");
423
             response.addSuccess("修改成功!");
438
         } else {
424
         } else {

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TaUserMapper.xml View File

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