Sfoglia il codice sorgente

完成 服务 首页显示

weiximei 6 anni fa
parent
commit
0448aa5f07
21 ha cambiato i file con 366 aggiunte e 64 eliminazioni
  1. 30
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java
  2. 2
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java
  3. 5
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpActivityMapper.java
  4. 3
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpAnnouncementMapper.java
  5. 17
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java
  6. 4
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpSocialViewMapper.java
  7. 2
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java
  8. 10
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpActivity.java
  9. 43
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpCarouselSetting.java
  10. 22
    2
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java
  11. 2
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java
  12. 69
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java
  13. 24
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml
  14. 9
    35
      CODE/smart-community/app-api/src/main/resources/mapper/TpAnnouncementMapper.xml
  15. 82
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpCarouselSettingMapper.xml
  16. 11
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpSocialViewMapper.xml
  17. 9
    0
      CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java
  18. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/redis/SingleRedisTemplate.class
  19. BIN
      CODE/smart-community/community-common/target/classes/com/community/commom/utils/HttpClientUtils.class
  20. 11
    11
      文档/MYSQL/smartCommunity.pdb
  21. 11
    11
      文档/MYSQL/smartCommunity.pdm

+ 30
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java Vedi File

@@ -2,6 +2,7 @@ package com.community.huiju.controller;
2 2
 
3 3
 import com.community.commom.constant.Constant;
4 4
 import com.community.commom.mode.ResponseBean;
5
+import com.community.huiju.model.TpActivity;
5 6
 import com.community.huiju.model.TpAnnouncement;
6 7
 import com.community.huiju.model.TpMessage;
7 8
 import com.community.huiju.service.SocialServiceI;
@@ -31,7 +32,8 @@ public class SocialController {
31 32
 
32 33
     @RequestMapping(value = "/announcement/{communityId}", method = RequestMethod.GET)
33 34
     @ApiOperation(value = "论坛公告帖子详情", notes = "获取论坛公告帖子详情")
34
-    @ApiImplicitParams({ @ApiImplicitParam(paramType = "query", dataType = "Long", name = "communityId", value = "小区Id") })
35
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
36
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "id", value = "公告帖子id")})
35 37
     public ResponseBean findAnnouncementDetail(@PathVariable(value = "communityId")Integer communityId, @RequestParam("id") Integer id){
36 38
         ResponseBean responseBean = new ResponseBean();
37 39
         TpAnnouncement tpAnnouncement = socialServiceI.findAnnouncementDetail(id, communityId);
@@ -59,4 +61,31 @@ public class SocialController {
59 61
         responseBean.addSuccess(announcementList);
60 62
         return responseBean;
61 63
     }
64
+
65
+    @ApiOperation(value = "获取公告轮播图", notes = "获取公告轮播图")
66
+    @ApiImplicitParams({
67
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区id"),
68
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "sum",value = "显示的条数")
69
+    })
70
+    @RequestMapping(value = "/announcement/announcementCarouselImg/{communityId}",method = RequestMethod.GET)
71
+    public ResponseBean getAnnouncement(@PathVariable(value = "communityId")Integer communityId ,@RequestParam("sum") Integer sum){
72
+        ResponseBean responseBean = new ResponseBean();
73
+        List<TpAnnouncement> agreement = socialServiceI.getAnnouncement(communityId,sum);
74
+        responseBean.addSuccess(agreement);
75
+        return responseBean;
76
+    }
77
+
78
+    
79
+    @ApiOperation(value = "按小区获取分页活动列表", notes = "按小区获取分页活动列表,公告标题模糊查询")
80
+    @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "String", name = "communityId", value = "小区Id"),
81
+            @ApiImplicitParam(paramType = "query", dataType = "String", name = "title", value = "活动标题"),
82
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageNum", value = "分页第几页"),
83
+            @ApiImplicitParam(paramType = "query", dataType = "integer", name = "pageSize", value = "分页每页长度")})
84
+    @RequestMapping(value = "/activitys/{communityId}",method = RequestMethod.GET)
85
+    public ResponseBean getActivitys(@PathVariable Integer communityId,@RequestParam String title,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
86
+        ResponseBean responseBean = new ResponseBean();
87
+        List<TpActivity> activityList = socialServiceI.getActivitys(communityId,title,pageNum,pageSize);
88
+        responseBean.addSuccess(activityList);
89
+        return responseBean;
90
+    }
62 91
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java Vedi File

@@ -56,4 +56,6 @@ public class UserController {
56 56
 
57 57
     }
58 58
 
59
+
60
+
59 61
 }

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

@@ -3,6 +3,9 @@ package com.community.huiju.dao;
3 3
 
4 4
 import com.community.huiju.model.TpActivity;
5 5
 import org.apache.ibatis.annotations.Mapper;
6
+import org.apache.ibatis.annotations.Param;
7
+
8
+import java.util.List;
6 9
 
7 10
 @Mapper
8 11
 public interface TpActivityMapper {
@@ -17,4 +20,6 @@ public interface TpActivityMapper {
17 20
     int updateByPrimaryKeySelective(TpActivity record);
18 21
 
19 22
     int updateByPrimaryKey(TpActivity record);
23
+    
24
+    List<TpActivity> getActivitys(@Param("communityId")Integer communityId,@Param("title") String title);
20 25
 }

+ 3
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpAnnouncementMapper.java Vedi File

@@ -17,9 +17,11 @@ public interface TpAnnouncementMapper {
17 17
 
18 18
     TpAnnouncement selectByPrimaryKey(@Param("id") Integer id, @Param("communityId") Integer communityId);
19 19
 
20
-    int updateByPrimaryKeySelective(TpAnnouncement record);
20
+    int updateByPrimaryKeySelective(@Param("id")Integer id, @Param("viewCount")Integer viewCount);
21 21
 
22 22
     int updateByPrimaryKey(TpAnnouncement record);
23 23
 	
24 24
 	List<TpAnnouncement> getAnnouncements(@Param("communityId") Integer communityId,@Param("title") String title);
25
+
26
+    List<TpAnnouncement> getAnnouncement(@Param("communityId")Integer communityId, @Param("sum")Integer sum);
25 27
 }

+ 17
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpCarouselSettingMapper.java Vedi File

@@ -0,0 +1,17 @@
1
+package com.community.huiju.dao;
2
+
3
+import com.community.huiju.model.TpCarouselSetting;
4
+
5
+public interface TpCarouselSettingMapper {
6
+    int deleteByPrimaryKey(Integer id);
7
+
8
+    int insert(TpCarouselSetting record);
9
+
10
+    int insertSelective(TpCarouselSetting record);
11
+
12
+    TpCarouselSetting selectByPrimaryKey(Integer id);
13
+
14
+    int updateByPrimaryKeySelective(TpCarouselSetting record);
15
+
16
+    int updateByPrimaryKey(TpCarouselSetting record);
17
+}

+ 4
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpSocialViewMapper.java Vedi File

@@ -1,7 +1,9 @@
1 1
 package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpSocialView;
4
+import org.apache.ibatis.annotations.Mapper;
4 5
 
6
+@Mapper
5 7
 public interface TpSocialViewMapper {
6 8
     int deleteByPrimaryKey(Integer id);
7 9
 
@@ -14,4 +16,6 @@ public interface TpSocialViewMapper {
14 16
     int updateByPrimaryKeySelective(TpSocialView record);
15 17
 
16 18
     int updateByPrimaryKey(TpSocialView record);
19
+
20
+    Integer selectViewNum(TpSocialView tpSocialView);
17 21
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpTransactionMapper.java Vedi File

@@ -1,7 +1,9 @@
1 1
 package com.community.huiju.dao;
2 2
 
3 3
 import com.community.huiju.model.TpTransaction;
4
+import org.apache.ibatis.annotations.Mapper;
4 5
 
6
+@Mapper
5 7
 public interface TpTransactionMapper {
6 8
     int deleteByPrimaryKey(Integer id);
7 9
 

+ 10
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpActivity.java Vedi File

@@ -38,6 +38,8 @@ public class TpActivity {
38 38
     private Integer updateUser;
39 39
 
40 40
     private Date updateDate;
41
+    
42
+    private String userName;
41 43
 
42 44
     public Integer getId() {
43 45
         return id;
@@ -182,4 +184,12 @@ public class TpActivity {
182 184
     public void setUpdateDate(Date updateDate) {
183 185
         this.updateDate = updateDate;
184 186
     }
187
+    
188
+    public String getUserName() {
189
+        return userName;
190
+    }
191
+    
192
+    public void setUserName(String userName) {
193
+        this.userName = userName;
194
+    }
185 195
 }

+ 43
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpCarouselSetting.java Vedi File

@@ -0,0 +1,43 @@
1
+package com.community.huiju.model;
2
+
3
+public class TpCarouselSetting {
4
+    private Integer id;
5
+
6
+    private Integer communityId;
7
+
8
+    private String carouselType;
9
+
10
+    private Integer carouselNum;
11
+
12
+    public Integer getId() {
13
+        return id;
14
+    }
15
+
16
+    public void setId(Integer id) {
17
+        this.id = id;
18
+    }
19
+
20
+    public Integer getCommunityId() {
21
+        return communityId;
22
+    }
23
+
24
+    public void setCommunityId(Integer communityId) {
25
+        this.communityId = communityId;
26
+    }
27
+
28
+    public String getCarouselType() {
29
+        return carouselType;
30
+    }
31
+
32
+    public void setCarouselType(String carouselType) {
33
+        this.carouselType = carouselType == null ? null : carouselType.trim();
34
+    }
35
+
36
+    public Integer getCarouselNum() {
37
+        return carouselNum;
38
+    }
39
+
40
+    public void setCarouselNum(Integer carouselNum) {
41
+        this.carouselNum = carouselNum;
42
+    }
43
+}

+ 22
- 2
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java Vedi File

@@ -1,7 +1,8 @@
1 1
 package com.community.huiju.service;
2 2
 
3
+import com.community.huiju.model.TpActivity;
3 4
 import com.community.huiju.model.TpAnnouncement;
4
-import com.community.huiju.model.TpMessage;
5
+import com.community.huiju.model.TpSocialView;
5 6
 
6 7
 import java.util.List;
7 8
 
@@ -12,13 +13,32 @@ import java.util.List;
12 13
  */
13 14
 public interface SocialServiceI {
14 15
     TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId);
15
-	
16
+
16 17
 	/**
17 18
 	 * 分页获取公告列表
18 19
 	 * @param communityId
20
+	 * @param title
19 21
 	 * @param pageNum
20 22
 	 * @param pageSize
21 23
 	 * @return
22 24
 	 */
23 25
 	List<TpAnnouncement> getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize);
26
+
27
+	/**
28
+	 * 公告轮播图
29
+	 * @param communityId
30
+	 * @param sum
31
+	 * @return
32
+	 */
33
+	List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum);
34
+	
35
+	/**
36
+	 * 分页获取活动列表
37
+	 * @param communityId
38
+	 * @param title
39
+	 * @param pageNum
40
+	 * @param pageSize
41
+	 * @return
42
+	 */
43
+	List<TpActivity> getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize);
24 44
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/MessageServiceImpl.java Vedi File

@@ -27,6 +27,7 @@ public class MessageServiceImpl implements MessageServiceI {
27 27
 	 */
28 28
 	@Override
29 29
 	public Map<String, Object> getMessageTotal(Integer communityId) {
30
+		//todo
30 31
 		Integer userId = 1;
31 32
 		return tpMessageMapper.getMessageTotal(userId,communityId);
32 33
 	}
@@ -41,6 +42,7 @@ public class MessageServiceImpl implements MessageServiceI {
41 42
 	 */
42 43
 	@Override
43 44
 	public List<TpMessage> getMessages(Integer communityId, Integer pageNum, Integer pageSize,Integer modelType) {
45
+		//todo
44 46
 		Integer userId = 1;
45 47
 		pageNum = null == pageNum ? 1 : pageNum;
46 48
 		pageSize = null == pageSize ? 10 : pageSize;

+ 69
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java Vedi File

@@ -1,33 +1,68 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3
+import com.community.commom.constant.Constant;
3 4
 import com.community.huiju.dao.TpAnnouncementMapper;
5
+import com.community.huiju.dao.TpSocialViewMapper;
6
+import com.community.huiju.model.TpAnnouncement;
7
+import com.community.huiju.model.TpSocialView;
8
+import com.community.huiju.service.SocialServiceI;
9
+import com.community.huiju.dao.TpActivityMapper;
10
+import com.community.huiju.dao.TpAnnouncementMapper;
11
+import com.community.huiju.model.TpActivity;
4 12
 import com.community.huiju.model.TpAnnouncement;
5 13
 import com.community.huiju.model.TpMessage;
6 14
 import com.community.huiju.service.SocialServiceI;
7 15
 import com.github.pagehelper.PageHelper;
8 16
 import org.springframework.beans.factory.annotation.Autowired;
9 17
 import org.springframework.stereotype.Service;
18
+import org.springframework.transaction.annotation.Transactional;
19
+
20
+import java.util.Date;
10 21
 
11 22
 import java.util.List;
12 23
 
13 24
 /**
14
- * @author admin
25
+ * @author weichaochao
15 26
  * @Title: SocialServiceImpl
16
- * @Description: TODO
17 27
  * @date 2018/10/23
18 28
  */
19 29
 @Service("SocialService")
20 30
 public class SocialServiceImpl implements SocialServiceI {
31
+
21 32
     @Autowired
22 33
     private TpAnnouncementMapper tpAnnouncementMapper;
34
+
35
+    @Autowired
36
+    private TpSocialViewMapper tpSocialViewMapper;
37
+
38
+    @Autowired
39
+    private TpActivityMapper tpActivityMapper;
40
+    
23 41
     @Override
42
+    @Transactional
24 43
     public TpAnnouncement findAnnouncementDetail(Integer id, Integer communityId) {
44
+        TpSocialView tpSocialView = new TpSocialView();
45
+        //TODO
46
+        tpSocialView.setTaUserId(1);
47
+        tpSocialView.setSocialType(Constant.ANNOUNCEMENT);
48
+        tpSocialView.setCommunityId(communityId);
49
+        tpSocialView.setUuid(id);
50
+        Integer viewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
51
+
52
+        if (viewNum == 0){
53
+            tpSocialView.setCreateDate(new Date());
54
+            tpSocialViewMapper.insertSelective(tpSocialView);
55
+            tpSocialView.setTaUserId(null);
56
+            Integer allViewNum = tpSocialViewMapper.selectViewNum(tpSocialView);
57
+            tpAnnouncementMapper.updateByPrimaryKeySelective(id, allViewNum);
58
+        }
25 59
         return tpAnnouncementMapper.selectByPrimaryKey(id, communityId);
26 60
     }
27
-    
61
+
28 62
     /**
29 63
      * 分页获取公告列表
30 64
      * @param communityId
65
+     * @param title
31 66
      * @param pageNum
32 67
      * @param pageSize
33 68
      * @return
@@ -42,4 +77,35 @@ public class SocialServiceImpl implements SocialServiceI {
42 77
         List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId,title);
43 78
         return announcementList;
44 79
     }
80
+    /**
81
+     * 根据当前小区ID查出轮播图
82
+     * @param communityId 当前小区ID
83
+     * @param sum 当前查询总数
84
+     * @return
85
+     */
86
+    @Override
87
+    public List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum) {
88
+        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId ,sum);
89
+        return listAnnouncement;
90
+    }
91
+
92
+    
93
+    /**
94
+     * 分页获取活动列表
95
+     * @param communityId
96
+     * @param title
97
+     * @param pageNum
98
+     * @param pageSize
99
+     * @return
100
+     */
101
+    @Override
102
+    public List<TpActivity> getActivitys(Integer communityId, String title, Integer pageNum, Integer pageSize) {
103
+        pageNum = null == pageNum ? 1 : pageNum;
104
+        pageSize = null == pageSize ? 10 : pageSize;
105
+        //使用分页插件
106
+        PageHelper.startPage(pageNum, pageSize);
107
+        // 获取数据
108
+        List<TpActivity> activityList = tpActivityMapper.getActivitys(communityId,title);
109
+        return activityList;
110
+    }
45 111
 }

+ 24
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpActivityMapper.xml Vedi File

@@ -7,6 +7,7 @@
7 7
     <result column="activity_title" property="activityTitle" jdbcType="VARCHAR" />
8 8
     <result column="activity_carousel_img" property="activityCarouselImg" jdbcType="VARCHAR" />
9 9
     <result column="activity_content" property="activityContent" jdbcType="VARCHAR" />
10
+    <result column="user_name" property="userName" jdbcType="VARCHAR" />
10 11
     <result column="sort" property="sort" jdbcType="INTEGER" />
11 12
     <result column="sign_up_count" property="signUpCount" jdbcType="INTEGER" />
12 13
     <result column="sign_up_max" property="signUpMax" jdbcType="INTEGER" />
@@ -246,4 +247,27 @@
246 247
       update_date = #{updateDate,jdbcType=TIMESTAMP}
247 248
     where id = #{id,jdbcType=INTEGER}
248 249
   </update>
250
+
251
+  <select id="getActivitys" resultMap="BaseResultMap">
252
+    SELECT
253
+      a.id,
254
+      a.activity_title,
255
+      a.activity_content,
256
+      a.create_date,
257
+      u.user_name AS user_name,
258
+      a.sort,
259
+      a.view_count,
260
+      a.sign_up_count
261
+  FROM
262
+      tp_activity a
263
+      LEFT JOIN tp_user u ON a.create_user = u.id
264
+      AND u.community_id = #{communityId,jdbcType=INTEGER}
265
+  WHERE
266
+      a.community_id = #{communityId,jdbcType=INTEGER}
267
+      AND ( a.STATUS = 1 OR a.STATUS = 3 )
268
+      AND a.activity_title LIKE concat('%',#{title,jdbcType=VARCHAR},'%')
269
+  ORDER BY
270
+      a.sort,
271
+      a.create_date DESC
272
+  </select>
249 273
 </mapper>

+ 9
- 35
CODE/smart-community/app-api/src/main/resources/mapper/TpAnnouncementMapper.xml Vedi File

@@ -129,45 +129,12 @@
129 129
       </if>
130 130
     </trim>
131 131
   </insert>
132
-  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpAnnouncement" >
132
+  <update id="updateByPrimaryKeySelective" >
133 133
     update tp_announcement
134 134
     <set >
135
-      <if test="communityId != null" >
136
-        community_id = #{communityId,jdbcType=INTEGER},
137
-      </if>
138
-      <if test="announcementTitle != null" >
139
-        announcement_title = #{announcementTitle,jdbcType=VARCHAR},
140
-      </if>
141
-      <if test="announcementCarouselImg != null" >
142
-        announcement_carousel_img = #{announcementCarouselImg,jdbcType=VARCHAR},
143
-      </if>
144
-      <if test="announcementContent != null" >
145
-        announcement_content = #{announcementContent,jdbcType=VARCHAR},
146
-      </if>
147
-      <if test="sort != null" >
148
-        sort = #{sort,jdbcType=INTEGER},
149
-      </if>
150 135
       <if test="viewCount != null" >
151 136
         view_count = #{viewCount,jdbcType=INTEGER},
152 137
       </if>
153
-      <if test="setUpCarousel != null" >
154
-        set_up_carousel = #{setUpCarousel,jdbcType=CHAR},
155
-      </if>
156
-      <if test="status != null" >
157
-        status = #{status,jdbcType=CHAR},
158
-      </if>
159
-      <if test="createUser != null" >
160
-        create_user = #{createUser,jdbcType=INTEGER},
161
-      </if>
162
-      <if test="createDate != null" >
163
-        create_date = #{createDate,jdbcType=TIMESTAMP},
164
-      </if>
165
-      <if test="updateUser != null" >
166
-        update_user = #{updateUser,jdbcType=INTEGER},
167
-      </if>
168
-      <if test="updateDate != null" >
169
-        update_date = #{updateDate,jdbcType=TIMESTAMP},
170
-      </if>
171 138
     </set>
172 139
     where id = #{id,jdbcType=INTEGER}
173 140
   </update>
@@ -204,9 +171,16 @@
204 171
   WHERE
205 172
       a.community_id = #{communityId,jdbcType=INTEGER}
206 173
       AND ( a.STATUS = 1 OR a.STATUS = 3 )
207
-      and announcement_title like concat('%',#{title,jdbcType=VARCHAR},'%')
174
+      and a.announcement_title like concat('%',#{title,jdbcType=VARCHAR},'%')
208 175
   ORDER BY
209 176
       a.sort,
210 177
       a.create_date DESC
211 178
   </select>
179
+
180
+  <select id="getAnnouncement" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpAnnouncement">
181
+    select
182
+    <include refid="Base_Column_List" />
183
+    from tp_announcement
184
+    where community_id = #{communityId,jdbcType=INTEGER}  and status=1 limit  #{sum,jdbcType=INTEGER}
185
+  </select>
212 186
 </mapper>

+ 82
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpCarouselSettingMapper.xml Vedi File

@@ -0,0 +1,82 @@
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" >
3
+<mapper namespace="com.community.huiju.dao.TpCarouselSettingMapper" >
4
+  <resultMap id="BaseResultMap" type="com.community.huiju.model.TpCarouselSetting" >
5
+    <id column="id" property="id" jdbcType="INTEGER" />
6
+    <result column="community_id" property="communityId" jdbcType="INTEGER" />
7
+    <result column="carousel_type" property="carouselType" jdbcType="VARCHAR" />
8
+    <result column="carousel_num" property="carouselNum" jdbcType="INTEGER" />
9
+  </resultMap>
10
+  <sql id="Base_Column_List" >
11
+    id, community_id, carousel_type, carousel_num
12
+  </sql>
13
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
14
+    select 
15
+    <include refid="Base_Column_List" />
16
+    from tp_carousel_setting
17
+    where id = #{id,jdbcType=INTEGER}
18
+  </select>
19
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
20
+    delete from tp_carousel_setting
21
+    where id = #{id,jdbcType=INTEGER}
22
+  </delete>
23
+  <insert id="insert" parameterType="com.community.huiju.model.TpCarouselSetting" >
24
+    insert into tp_carousel_setting (id, community_id, carousel_type, 
25
+      carousel_num)
26
+    values (#{id,jdbcType=INTEGER}, #{communityId,jdbcType=INTEGER}, #{carouselType,jdbcType=VARCHAR}, 
27
+      #{carouselNum,jdbcType=INTEGER})
28
+  </insert>
29
+  <insert id="insertSelective" parameterType="com.community.huiju.model.TpCarouselSetting" >
30
+    insert into tp_carousel_setting
31
+    <trim prefix="(" suffix=")" suffixOverrides="," >
32
+      <if test="id != null" >
33
+        id,
34
+      </if>
35
+      <if test="communityId != null" >
36
+        community_id,
37
+      </if>
38
+      <if test="carouselType != null" >
39
+        carousel_type,
40
+      </if>
41
+      <if test="carouselNum != null" >
42
+        carousel_num,
43
+      </if>
44
+    </trim>
45
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
46
+      <if test="id != null" >
47
+        #{id,jdbcType=INTEGER},
48
+      </if>
49
+      <if test="communityId != null" >
50
+        #{communityId,jdbcType=INTEGER},
51
+      </if>
52
+      <if test="carouselType != null" >
53
+        #{carouselType,jdbcType=VARCHAR},
54
+      </if>
55
+      <if test="carouselNum != null" >
56
+        #{carouselNum,jdbcType=INTEGER},
57
+      </if>
58
+    </trim>
59
+  </insert>
60
+  <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpCarouselSetting" >
61
+    update tp_carousel_setting
62
+    <set >
63
+      <if test="communityId != null" >
64
+        community_id = #{communityId,jdbcType=INTEGER},
65
+      </if>
66
+      <if test="carouselType != null" >
67
+        carousel_type = #{carouselType,jdbcType=VARCHAR},
68
+      </if>
69
+      <if test="carouselNum != null" >
70
+        carousel_num = #{carouselNum,jdbcType=INTEGER},
71
+      </if>
72
+    </set>
73
+    where id = #{id,jdbcType=INTEGER}
74
+  </update>
75
+  <update id="updateByPrimaryKey" parameterType="com.community.huiju.model.TpCarouselSetting" >
76
+    update tp_carousel_setting
77
+    set community_id = #{communityId,jdbcType=INTEGER},
78
+      carousel_type = #{carouselType,jdbcType=VARCHAR},
79
+      carousel_num = #{carouselNum,jdbcType=INTEGER}
80
+    where id = #{id,jdbcType=INTEGER}
81
+  </update>
82
+</mapper>

+ 11
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpSocialViewMapper.xml Vedi File

@@ -114,4 +114,15 @@
114 114
       create_date = #{createDate,jdbcType=TIMESTAMP}
115 115
     where id = #{id,jdbcType=INTEGER}
116 116
   </update>
117
+
118
+  <select id="selectViewNum" resultType="java.lang.Integer" parameterType="com.community.huiju.model.TpSocialView">
119
+    select count(*) from tp_social_view
120
+    where
121
+    <if test="taUserId != null" >
122
+      ta_user_id = #{taUserId} and
123
+    </if>
124
+    uuid = #{uuid}
125
+    and community_id = #{communityId}
126
+    and social_type = #{socialType}
127
+  </select>
117 128
 </mapper>

+ 9
- 0
CODE/smart-community/community-common/src/main/java/com/community/commom/constant/Constant.java Vedi File

@@ -36,4 +36,13 @@ public class Constant {
36 36
     /** 住户APP端待办 **/
37 37
     public static final Integer MODEL_TYPE_UPCOMING = 2;
38 38
 
39
+    /** 社交公告类型**/
40
+    public static final String ANNOUNCEMENT = "announcement";
41
+
42
+    /** 社交活动类型**/
43
+    public static final String ACTIVITY = "activity";
44
+
45
+    /** 社交二手租赁类型**/
46
+    public static final String LEASE = "lease";
47
+
39 48
 }

BIN
CODE/smart-community/community-common/target/classes/com/community/commom/redis/SingleRedisTemplate.class Vedi File


BIN
CODE/smart-community/community-common/target/classes/com/community/commom/utils/HttpClientUtils.class Vedi File


+ 11
- 11
文档/MYSQL/smartCommunity.pdb Vedi File

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1540265676" Name="smartCommunity" Objects="588" Symbols="68" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
2
+<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1540286027" Name="smartCommunity" Objects="595" Symbols="69" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
3 3
 <!-- do not edit this file -->
4 4
 
5 5
 <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@@ -12,7 +12,7 @@
12 12
 <a:Code>smartCommunity</a:Code>
13 13
 <a:CreationDate>1539048464</a:CreationDate>
14 14
 <a:Creator>szc</a:Creator>
15
-<a:ModificationDate>1540189341</a:ModificationDate>
15
+<a:ModificationDate>1540285906</a:ModificationDate>
16 16
 <a:Modifier>szc</a:Modifier>
17 17
 <a:PackageOptionsText>[FolderOptions]
18 18
 
@@ -3698,7 +3698,7 @@ PhysOpts=</a:ModelOptionsText>
3698 3698
 <a:Code>PhysicalDiagram_1</a:Code>
3699 3699
 <a:CreationDate>1539048464</a:CreationDate>
3700 3700
 <a:Creator>szc</a:Creator>
3701
-<a:ModificationDate>1540189341</a:ModificationDate>
3701
+<a:ModificationDate>1540285906</a:ModificationDate>
3702 3702
 <a:Modifier>szc</a:Modifier>
3703 3703
 <a:DisplayPreferences>[DisplayPreferences]
3704 3704
 
@@ -7920,13 +7920,13 @@ LABL 0 新宋体,8,N</a:FontList>
7920 7920
 </o:Table>
7921 7921
 <o:Table Id="o113">
7922 7922
 <a:ObjectID>E1A7CF79-7543-479E-B18A-516582F0951D</a:ObjectID>
7923
-<a:Name>tp_social_setting</a:Name>
7924
-<a:Code>tp_social_setting</a:Code>
7923
+<a:Name>tp_carousel_setting</a:Name>
7924
+<a:Code>tp_carousel_setting</a:Code>
7925 7925
 <a:CreationDate>1539140281</a:CreationDate>
7926 7926
 <a:Creator>szc</a:Creator>
7927
-<a:ModificationDate>1539141938</a:ModificationDate>
7927
+<a:ModificationDate>1540286027</a:ModificationDate>
7928 7928
 <a:Modifier>szc</a:Modifier>
7929
-<a:Comment>物业端社交设置表 (设置住户端公告和活动轮播数)</a:Comment>
7929
+<a:Comment>轮播数设置表</a:Comment>
7930 7930
 <a:TotalSavingCurrency/>
7931 7931
 <c:Columns>
7932 7932
 <o:Column Id="o293">
@@ -7956,13 +7956,13 @@ LABL 0 新宋体,8,N</a:FontList>
7956 7956
 </o:Column>
7957 7957
 <o:Column Id="o295">
7958 7958
 <a:ObjectID>6571CBA9-911D-4751-9D38-280D5CDC1641</a:ObjectID>
7959
-<a:Name>social_type</a:Name>
7960
-<a:Code>social_type</a:Code>
7959
+<a:Name>carousel_type</a:Name>
7960
+<a:Code>carousel_type</a:Code>
7961 7961
 <a:CreationDate>1539141779</a:CreationDate>
7962 7962
 <a:Creator>szc</a:Creator>
7963
-<a:ModificationDate>1539142002</a:ModificationDate>
7963
+<a:ModificationDate>1540285970</a:ModificationDate>
7964 7964
 <a:Modifier>szc</a:Modifier>
7965
-<a:Comment>社交类型: announcement 表示公告  activity 表示活动</a:Comment>
7965
+<a:Comment>轮播类型: announcement 表示公告  activity 表示活动  banner表示运营banner</a:Comment>
7966 7966
 <a:DataType>varchar(80)</a:DataType>
7967 7967
 <a:Length>80</a:Length>
7968 7968
 </o:Column>

+ 11
- 11
文档/MYSQL/smartCommunity.pdm Vedi File

@@ -1,5 +1,5 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2
-<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1540265676" Name="smartCommunity" Objects="588" Symbols="68" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
2
+<?PowerDesigner AppLocale="UTF16" ID="{1EFA7B8F-E5BE-422B-A0AE-B907AA87924F}" Label="" LastModificationDate="1540286027" Name="smartCommunity" Objects="595" Symbols="69" Target="MySQL 5.0" Type="{CDE44E21-9669-11D1-9914-006097355D9B}" signature="PDM_DATA_MODEL_XML" version="16.5.0.3982"?>
3 3
 <!-- do not edit this file -->
4 4
 
5 5
 <Model xmlns:a="attribute" xmlns:c="collection" xmlns:o="object">
@@ -12,7 +12,7 @@
12 12
 <a:Code>smartCommunity</a:Code>
13 13
 <a:CreationDate>1539048464</a:CreationDate>
14 14
 <a:Creator>szc</a:Creator>
15
-<a:ModificationDate>1540189341</a:ModificationDate>
15
+<a:ModificationDate>1540285906</a:ModificationDate>
16 16
 <a:Modifier>szc</a:Modifier>
17 17
 <a:PackageOptionsText>[FolderOptions]
18 18
 
@@ -3698,7 +3698,7 @@ PhysOpts=</a:ModelOptionsText>
3698 3698
 <a:Code>PhysicalDiagram_1</a:Code>
3699 3699
 <a:CreationDate>1539048464</a:CreationDate>
3700 3700
 <a:Creator>szc</a:Creator>
3701
-<a:ModificationDate>1540189341</a:ModificationDate>
3701
+<a:ModificationDate>1540285906</a:ModificationDate>
3702 3702
 <a:Modifier>szc</a:Modifier>
3703 3703
 <a:DisplayPreferences>[DisplayPreferences]
3704 3704
 
@@ -7920,13 +7920,13 @@ LABL 0 新宋体,8,N</a:FontList>
7920 7920
 </o:Table>
7921 7921
 <o:Table Id="o113">
7922 7922
 <a:ObjectID>E1A7CF79-7543-479E-B18A-516582F0951D</a:ObjectID>
7923
-<a:Name>tp_social_setting</a:Name>
7924
-<a:Code>tp_social_setting</a:Code>
7923
+<a:Name>tp_carousel_setting</a:Name>
7924
+<a:Code>tp_carousel_setting</a:Code>
7925 7925
 <a:CreationDate>1539140281</a:CreationDate>
7926 7926
 <a:Creator>szc</a:Creator>
7927
-<a:ModificationDate>1539141938</a:ModificationDate>
7927
+<a:ModificationDate>1540286027</a:ModificationDate>
7928 7928
 <a:Modifier>szc</a:Modifier>
7929
-<a:Comment>物业端社交设置表 (设置住户端公告和活动轮播数)</a:Comment>
7929
+<a:Comment>轮播数设置表</a:Comment>
7930 7930
 <a:TotalSavingCurrency/>
7931 7931
 <c:Columns>
7932 7932
 <o:Column Id="o293">
@@ -7956,13 +7956,13 @@ LABL 0 新宋体,8,N</a:FontList>
7956 7956
 </o:Column>
7957 7957
 <o:Column Id="o295">
7958 7958
 <a:ObjectID>6571CBA9-911D-4751-9D38-280D5CDC1641</a:ObjectID>
7959
-<a:Name>social_type</a:Name>
7960
-<a:Code>social_type</a:Code>
7959
+<a:Name>carousel_type</a:Name>
7960
+<a:Code>carousel_type</a:Code>
7961 7961
 <a:CreationDate>1539141779</a:CreationDate>
7962 7962
 <a:Creator>szc</a:Creator>
7963
-<a:ModificationDate>1539142002</a:ModificationDate>
7963
+<a:ModificationDate>1540285970</a:ModificationDate>
7964 7964
 <a:Modifier>szc</a:Modifier>
7965
-<a:Comment>社交类型: announcement 表示公告  activity 表示活动</a:Comment>
7965
+<a:Comment>轮播类型: announcement 表示公告  activity 表示活动  banner表示运营banner</a:Comment>
7966 7966
 <a:DataType>varchar(80)</a:DataType>
7967 7967
 <a:Length>80</a:Length>
7968 7968
 </o:Column>