浏览代码

公告轮播图

dingxin 6 年前
父节点
当前提交
9b0ae54e58

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/SocialController.java 查看文件

59
         responseBean.addSuccess(announcementList);
59
         responseBean.addSuccess(announcementList);
60
         return responseBean;
60
         return responseBean;
61
     }
61
     }
62
+
63
+    @ApiOperation(value = "获取公告轮播图", notes = "获取公告轮播图")
64
+    @ApiImplicitParams({
65
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区id"),
66
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "sum",value = "显示的条数")
67
+    })
68
+    @RequestMapping(value = "/announcement/announcementCarouselImg/{communityId}",method = RequestMethod.GET)
69
+    public ResponseBean getAnnouncement(@PathVariable(value = "communityId")Integer communityId ,@RequestParam("sum") Integer sum){
70
+        ResponseBean responseBean = new ResponseBean();
71
+        List<TpAnnouncement> agreement = socialServiceI.getAnnouncement(communityId,sum);
72
+        responseBean.addSuccess(agreement);
73
+        return responseBean;
74
+    }
75
+
62
 }
76
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/UserController.java 查看文件

56
 
56
 
57
     }
57
     }
58
 
58
 
59
+
60
+
59
 }
61
 }

+ 2
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpAnnouncementMapper.java 查看文件

22
     int updateByPrimaryKey(TpAnnouncement record);
22
     int updateByPrimaryKey(TpAnnouncement record);
23
 	
23
 	
24
 	List<TpAnnouncement> getAnnouncements(@Param("communityId") Integer communityId,@Param("title") String title);
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
 }

+ 8
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/SocialServiceI.java 查看文件

21
 	 * @return
21
 	 * @return
22
 	 */
22
 	 */
23
 	List<TpAnnouncement> getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize);
23
 	List<TpAnnouncement> getAnnouncements(Integer communityId, String title, Integer pageNum, Integer pageSize);
24
+
25
+	/**
26
+	 * 公告轮播图
27
+	 * @param communityId
28
+	 * @param sum
29
+	 * @return
30
+	 */
31
+	List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum);
24
 }
32
 }

+ 12
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/SocialServiceImpl.java 查看文件

42
         List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId,title);
42
         List<TpAnnouncement> announcementList = tpAnnouncementMapper.getAnnouncements(communityId,title);
43
         return announcementList;
43
         return announcementList;
44
     }
44
     }
45
+    /**
46
+     * 根据当前小区ID查出轮播图
47
+     * @param communityId 当前小区ID
48
+     * @param sum 当前查询总数
49
+     * @return
50
+     */
51
+    @Override
52
+    public List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum) {
53
+        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId ,sum);
54
+        return listAnnouncement;
55
+    }
56
+
45
 }
57
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpAnnouncementMapper.xml 查看文件

209
       a.sort,
209
       a.sort,
210
       a.create_date DESC
210
       a.create_date DESC
211
   </select>
211
   </select>
212
+
213
+  <select id="getAnnouncement" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpAnnouncement">
214
+    select
215
+    <include refid="Base_Column_List" />
216
+    from tp_announcement
217
+    where community_id = #{communityId,jdbcType=INTEGER}  and status=1 limit  #{sum,jdbcType=INTEGER}
218
+  </select>
212
 </mapper>
219
 </mapper>

二进制
CODE/smart-community/community-common/target/classes/com/community/commom/redis/SingleRedisTemplate.class 查看文件


二进制
CODE/smart-community/community-common/target/classes/com/community/commom/utils/HttpClientUtils.class 查看文件