weiximei 6 years ago
parent
commit
81bb911eae

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java View File

72
         ResponseBean responseBean = new ResponseBean();
72
         ResponseBean responseBean = new ResponseBean();
73
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
73
         UserElement userElement = (UserElement) session.getAttribute(Constant.APP_USER_SESSION);
74
         Integer userId=userElement.getId();
74
         Integer userId=userElement.getId();
75
-        ResponseBean response=iTaUserService.upDateloginName(userId,paramets);
75
+        ResponseBean response=iTaUserService.upDateloginName(userId,paramets,userElement.getCommunityId());
76
         return response;
76
         return response;
77
     }
77
     }
78
 
78
 

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

25
     @ResultMap("BaseResultMap")
25
     @ResultMap("BaseResultMap")
26
     @Select("select * from tp_building_owner_info where community_id=#{communityId} and owner_tel=#{ownerTel}")
26
     @Select("select * from tp_building_owner_info where community_id=#{communityId} and owner_tel=#{ownerTel}")
27
     List<TpBuildingOwnerInfo> getByCommunityIdAndOwnerTel(@Param("communityId") Integer communityId, @Param("ownerTel") String ownerTel);
27
     List<TpBuildingOwnerInfo> getByCommunityIdAndOwnerTel(@Param("communityId") Integer communityId, @Param("ownerTel") String ownerTel);
28
+
29
+    TpBuildingOwnerInfo updatOwnerTel(Integer communityId,String OwnerTel);
30
+
31
+    //根据手机号查询当前信息
32
+    TpBuildingOwnerInfo selectOwnerTel(@Param("ownerTel")String ownerTel);
28
 }
33
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/ITaUserService.java View File

39
      * @param id
39
      * @param id
40
      * @return
40
      * @return
41
      */
41
      */
42
-    ResponseBean upDateloginName(Integer id, String paramets);
42
+    ResponseBean upDateloginName(Integer id, String paramets,Integer communityId);
43
 
43
 
44
     /**
44
     /**
45
      * 获取房屋成员列表
45
      * 获取房屋成员列表

+ 26
- 10
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TaUserServiceImpl.java View File

35
 import java.util.*;
35
 import java.util.*;
36
 import java.util.logging.SimpleFormatter;
36
 import java.util.logging.SimpleFormatter;
37
 
37
 
38
+import static com.community.commom.constant.Constant.OWNER;
39
+
38
 /**
40
 /**
39
  * 用户业务 实现
41
  * 用户业务 实现
40
  * @author weiximei
42
  * @author weiximei
239
 
241
 
240
     @Transactional(rollbackFor = Exception.class)
242
     @Transactional(rollbackFor = Exception.class)
241
     @Override
243
     @Override
242
-    public ResponseBean upDateloginName(Integer id, String paramets) {
244
+    public ResponseBean upDateloginName(Integer id, String paramets,Integer communityId) {
243
         ResponseBean response = new ResponseBean();
245
         ResponseBean response = new ResponseBean();
244
 
246
 
245
         JSONObject jsonObject = JSONObject.parseObject(paramets);
247
         JSONObject jsonObject = JSONObject.parseObject(paramets);
288
             response.addError("验证码错误!");
290
             response.addError("验证码错误!");
289
             return response;
291
             return response;
290
         }
292
         }
291
-
292
-
293
             TaUser taUser=new TaUser();
293
             TaUser taUser=new TaUser();
294
             taUser.setLoginName(phone);
294
             taUser.setLoginName(phone);
295
             taUser.setId(userId);
295
             taUser.setId(userId);
296
+            taUser.setUpdateDate(new Date());
297
+            taUser.setUpdateUser(id);
296
             taUserMapper.updateLongName(taUser);
298
             taUserMapper.updateLongName(taUser);
297
             response.addSuccess("修改成功");
299
             response.addSuccess("修改成功");
298
             AppkeyCache.setCache(user.getLoginName(),"null");
300
             AppkeyCache.setCache(user.getLoginName(),"null");
303
              */
305
              */
304
 
306
 
305
             // 修改楼栋信息资料库的手机号
307
             // 修改楼栋信息资料库的手机号
306
-            Map<String, Object> map = Maps.newHashMap();
307
-            map.put("communityId", user.getCommunityId());
308
-            map.put("userId", userId);
309
-            TaSysUserRole taSysUserRole = taSysUserRoleMapper.selectByCommunityIdAndUserId(map);
308
+            Map<String, Object> roleMap = Maps.newHashMap();
309
+            roleMap.put("communityId", user.getCommunityId());
310
+            roleMap.put("userId", userId);
311
+            TaSysUserRole taSysUserRole = taSysUserRoleMapper.selectByCommunityIdAndUserId(roleMap);
310
             // 1 业主 2 租客 3 家属
312
             // 1 业主 2 租客 3 家属
311
             // 只允许业主修改
313
             // 只允许业主修改
312
             if (taSysUserRole.getRoleId().intValue() == 1) {
314
             if (taSysUserRole.getRoleId().intValue() == 1) {
350
         ResponseBean response = new ResponseBean();
352
         ResponseBean response = new ResponseBean();
351
 
353
 
352
         TaUser taUser = taUserMapper.selectByPrimaryKey(user.getId());
354
         TaUser taUser = taUserMapper.selectByPrimaryKey(user.getId());
355
+        HashMap map= new HashMap<>();
356
+                map.put("communityId",taUser.getCommunityId());
357
+                map.put("userId",taUser.getId());
358
+        TaSysUserRole TaSysUserRole= taSysUserRoleMapper.selectByCommunityIdAndUserId(map);
353
         BeanTools.copyProperties(user, taUser);
359
         BeanTools.copyProperties(user, taUser);
354
-
355
-        int result = taUserMapper.updateByPrimaryKeySelective(taUser);
356
-
360
+            int result = taUserMapper.updateByPrimaryKeySelective(taUser);
361
+            int VerifyStatus= Integer.parseInt(taUser.getVerifyStatus());
362
+            int Role= TaSysUserRole.getRoleId();
363
+            if (1==VerifyStatus &&1==Role) {
364
+            TpBuildingOwnerInfo TpBuildingOwnerInfo = new TpBuildingOwnerInfo();
365
+            TpBuildingOwnerInfo.setOwnerName(user.getUserName());
366
+            TpBuildingOwnerInfo.setGender(user.getGender());
367
+            TpBuildingOwnerInfo.setOwnerTel(user.getLoginName());
368
+            TpBuildingOwnerInfo.setUpdateDate(new Date());
369
+            TpBuildingOwnerInfo.setUpdateUser(taUser.getId());
370
+            TpBuildingOwnerInfo.setId(taUser.getBuildingOwnerInfoId());
371
+            tpBuildingOwnerInfoMapper.updateByPrimaryKeySelective(TpBuildingOwnerInfo);
372
+        }
357
         if (result > 0){
373
         if (result > 0){
358
             response.addSuccess("修改成功!");
374
             response.addSuccess("修改成功!");
359
         }else {
375
         }else {

+ 63
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml View File

231
       update_date = #{updateDate,jdbcType=TIMESTAMP}
231
       update_date = #{updateDate,jdbcType=TIMESTAMP}
232
     where id = #{id,jdbcType=INTEGER}
232
     where id = #{id,jdbcType=INTEGER}
233
   </update>
233
   </update>
234
+  <update id="updatOwnerTel" parameterType="com.community.huiju.model.TpBuildingOwnerInfo" >
235
+    update tp_building_owner_info
236
+    <set >
237
+      <if test="communityId != null" >
238
+        community_id = #{communityId,jdbcType=INTEGER},
239
+      </if>
240
+      <if test="idCard != null" >
241
+        id_card = #{idCard,jdbcType=VARCHAR},
242
+      </if>
243
+      <if test="phase != null">
244
+        phase = #{phase,jdbcType=VARCHAR},
245
+      </if>
246
+      <if test="building != null" >
247
+        building = #{building,jdbcType=VARCHAR},
248
+      </if>
249
+      <if test="unit != null" >
250
+        unit = #{unit,jdbcType=VARCHAR},
251
+      </if>
252
+      <if test="level != null" >
253
+        level = #{level,jdbcType=VARCHAR},
254
+      </if>
255
+      <if test="roomNo != null" >
256
+        room_no = #{roomNo,jdbcType=VARCHAR},
257
+      </if>
258
+      <if test="ownerName != null" >
259
+        owner_name = #{ownerName,jdbcType=VARCHAR},
260
+      </if>
261
+      <if test="ownerTel != null" >
262
+        owner_tel = #{ownerTel,jdbcType=VARCHAR},
263
+      </if>
264
+      <if test="gender != null" >
265
+        gender = #{gender,jdbcType=CHAR},
266
+      </if>
267
+      <if test="pairStatus != null" >
268
+        pair_status = #{pairStatus,jdbcType=CHAR},
269
+      </if>
270
+      <if test="verifyStatus != null" >
271
+        verify_status = #{verifyStatus,jdbcType=CHAR},
272
+      </if>
273
+      <if test="createUser != null" >
274
+        create_user = #{createUser,jdbcType=INTEGER},
275
+      </if>
276
+      <if test="createDate != null" >
277
+        create_date = #{createDate,jdbcType=TIMESTAMP},
278
+      </if>
279
+      <if test="updateUser != null" >
280
+        update_user = #{updateUser,jdbcType=INTEGER},
281
+      </if>
282
+      <if test="updateDate != null" >
283
+        update_date = #{updateDate,jdbcType=TIMESTAMP},
284
+      </if>
285
+    </set>
286
+    where community_id = #{communityId,jdbcType=INTEGER} and wnerTel =  owner_tel = #{ownerTel,jdbcType=VARCHAR}
287
+  </update>
288
+
289
+  <select id="selectOwnerTel" resultType="com.community.huiju.model.TpBuildingOwnerInfo" parameterType="string">
290
+    select
291
+    id
292
+    from
293
+    tp_building_owner_info
294
+    where  owner_tel = #{ownerTel,jdbcType=VARCHAR}
295
+  </select>
296
+
234
 </mapper>
297
 </mapper>

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/dao/UserMapper.java View File

16
  */
16
  */
17
 @Mapper
17
 @Mapper
18
 public interface UserMapper extends BaseMapper<User> {
18
 public interface UserMapper extends BaseMapper<User> {
19
-    String selectByIdCreateUserName(@Param("id") Integer id);
19
+    String selectByIdUserName(@Param("id") Integer id);
20
 
20
 
21
 }
21
 }

+ 2
- 2
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/TpAnnouncementServiceImpl.java View File

74
             AnnouncementTable announcementTable = new AnnouncementTable();
74
             AnnouncementTable announcementTable = new AnnouncementTable();
75
             BeanUtils.copyProperties(e, announcementTable);
75
             BeanUtils.copyProperties(e, announcementTable);
76
             //创建人
76
             //创建人
77
-            String createUserName = userMapper.selectByIdCreateUserName(e.getUpdateUser());
77
+            String createUserName = userMapper.selectByIdUserName(e.getUpdateUser());
78
             //修改人
78
             //修改人
79
-            String updateDateName = userMapper.selectByIdCreateUserName(e.getCreateUser());
79
+            String updateDateName = userMapper.selectByIdUserName(e.getCreateUser());
80
             announcementTable.setCreateUserName(createUserName);
80
             announcementTable.setCreateUserName(createUserName);
81
             announcementTable.setUpdateDateName(updateDateName);
81
             announcementTable.setUpdateDateName(updateDateName);
82
             return announcementTable;
82
             return announcementTable;

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

21
           AND announcement_title like concat('%',#{record.announcementTitle,jdbcType=VARCHAR},'%')
21
           AND announcement_title like concat('%',#{record.announcementTitle,jdbcType=VARCHAR},'%')
22
         </if>
22
         </if>
23
           AND community_id = #{record.communityId,jdbcType=INTEGER}
23
           AND community_id = #{record.communityId,jdbcType=INTEGER}
24
-          order by create_date desc
24
+          ORDER BY sort DESC,create_date desc
25
       </where>
25
       </where>
26
   </select>
26
   </select>
27
   <select id="getById" resultType="com.community.huiju.model.TpAnnouncement">
27
   <select id="getById" resultType="com.community.huiju.model.TpAnnouncement">

+ 1
- 0
CODE/smart-community/property-api/src/main/resources/mapper/TpBuildingOwnerInfoMapper.xml View File

32
                 and	(verify_status = 1 or verify_status = 2)
32
                 and	(verify_status = 1 or verify_status = 2)
33
             </if>
33
             </if>
34
             and community_id=#{CommunityId,jdbcType=INTEGER}
34
             and community_id=#{CommunityId,jdbcType=INTEGER}
35
+            order by create_date desc
35
         </where>
36
         </where>
36
     </select>
37
     </select>
37
 
38
 

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

1
 <?xml version="1.0" encoding="UTF-8"?>
1
 <?xml version="1.0" encoding="UTF-8"?>
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3
 <mapper namespace="com.community.huiju.dao.UserMapper">
3
 <mapper namespace="com.community.huiju.dao.UserMapper">
4
-    <select id="selectByIdCreateUserName" parameterType="int" resultType="string">
4
+    <select id="selectByIdUserName" parameterType="int" resultType="string">
5
         SELECT
5
         SELECT
6
          user_name
6
          user_name
7
         FROM
7
         FROM

+ 4
- 4
VUECODE/smart-property-manage/src/router/index.js View File

145
         meta: { title: '活动详情', icon: 'table' }
145
         meta: { title: '活动详情', icon: 'table' }
146
       },
146
       },
147
       {
147
       {
148
-        path: '/announcement',
148
+        path: '/announcement/add',
149
         component: () => import('@/views/social/announcement/add'),
149
         component: () => import('@/views/social/announcement/add'),
150
         name: 'announcement-add',
150
         name: 'announcement-add',
151
         hidden: true,
151
         hidden: true,
152
         meta: { title: '添加公告', icon: 'table' }
152
         meta: { title: '添加公告', icon: 'table' }
153
       },
153
       },
154
       {
154
       {
155
-        path: '/announcement',
155
+        path: '/announcement/edit',
156
         component: () => import('@/views/social/announcement/edit'),
156
         component: () => import('@/views/social/announcement/edit'),
157
         name: 'announcement-edit',
157
         name: 'announcement-edit',
158
         hidden: true,
158
         hidden: true,
166
         meta: { title: '活动报名人', icon: 'table' }
166
         meta: { title: '活动报名人', icon: 'table' }
167
       },
167
       },
168
       {
168
       {
169
-        path: '/announcement',
169
+        path: '/announcement/details',
170
         component: () => import('@/views/social/announcement/details'),
170
         component: () => import('@/views/social/announcement/details'),
171
         name: 'contentParticulars-details',
171
         name: 'contentParticulars-details',
172
         hidden: true,
172
         hidden: true,
173
-        meta: { title: '编辑公告', icon: 'table' }
173
+        meta: { title: '公告详情', icon: 'table' }
174
       }
174
       }
175
     ]
175
     ]
176
   },
176
   },

+ 2
- 0
VUECODE/smart-property-manage/src/views/social/announcement/add.vue View File

112
           return false
112
           return false
113
         }
113
         }
114
       })
114
       })
115
+       // 关闭加载框
116
+      loading.close()
115
     },
117
     },
116
     resetForm(formName,status) {
118
     resetForm(formName,status) {
117
       console.log(status)
119
       console.log(status)

+ 8
- 9
VUECODE/smart-property-manage/src/views/social/announcement/details.vue View File

24
     </div> -->
24
     </div> -->
25
     <!-- <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span> -->
25
     <!-- <span>报名截止时间:{{ formatDate(ruleForm.registrationEndTime) }}</span> -->
26
     <div class="bom-button">
26
     <div class="bom-button">
27
-      <el-button type="primary" style="width: 150px;" @click="ediActivity">修改</el-button>
27
+      <el-button type="primary" style="width: 150px;" @click="edi">修改</el-button>
28
     </div>
28
     </div>
29
   </div>
29
   </div>
30
 </template>
30
 </template>
64
       this.ruleForm.announcementCarouselImg=resData.tpAnnouncement.announcementCarouselImg // 轮播图
64
       this.ruleForm.announcementCarouselImg=resData.tpAnnouncement.announcementCarouselImg // 轮播图
65
       this.sort=resData.tpAnnouncement.sort// 权重
65
       this.sort=resData.tpAnnouncement.sort// 权重
66
         //多张图片进行遍历
66
         //多张图片进行遍历
67
-        for (let i = 0; i <=resData.studentList.length; i++) {
68
-        //  this.ruleForm.contentImg.push({ url: resData.studentList[i].imageUrl })
69
-        
70
-        console.log("sssss:",resData.studentList.imageUrl[i])
67
+        for (let i = 0; i <resData.studentList.length; i++) {
68
+          this.ruleForm.contentImg.push({ url: resData.studentList[i].imageUrl })
71
         }
69
         }
72
       })
70
       })
73
-
74
-      console.log(this.ruleForm.contentImg)
75
     },
71
     },
76
     formatDate(val) {
72
     formatDate(val) {
77
       var value = new Date(val)
73
       var value = new Date(val)
84
       // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
80
       // return year + '-' + month + '-' + day + ' ' + hour + ':' + minutes + ':' + seconds
85
       return year + '-' + month + '-' + day
81
       return year + '-' + month + '-' + day
86
     },
82
     },
87
-    ediActivity() { // 修改活动
88
-      this.$router.push({ name: 'activity-edi', params: { id: this.ruleForm.id }})
83
+    edi() { // 修改活动
84
+        this.$router.push({ name: 'announcement-edit' , params: { id: this.ruleForm.id }})
85
+        console.log("123")
86
+        //   this.$router.push({ name: 'announcement-edit', params: { id: this.ruleForm.id }})
87
+      
89
     }
88
     }
90
   }
89
   }
91
 }
90
 }