傅行帆 6 年之前
父節點
當前提交
300186a251

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

@@ -66,13 +66,12 @@ public class SocialController {
66 66
 
67 67
     @ApiOperation(value = "获取公告轮播图", notes = "获取公告轮播图")
68 68
     @ApiImplicitParams({
69
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区id"),
70
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "sum",value = "显示的条数")
69
+            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区id")
71 70
     })
72
-    @RequestMapping(value = "/announcement/announcementCarouselImg/{communityId}",method = RequestMethod.GET)
73
-    public ResponseBean getAnnouncement(@PathVariable(value = "communityId")Integer communityId ,@RequestParam("sum") Integer sum){
71
+    @RequestMapping(value = "/announcement/Img/{communityId}",method = RequestMethod.GET)
72
+    public ResponseBean getAnnouncement(@PathVariable(value = "communityId")Integer communityId ){
74 73
         ResponseBean responseBean = new ResponseBean();
75
-        List<TpAnnouncement> agreement = socialServiceI.getAnnouncement(communityId,sum);
74
+        List<TpAnnouncement> agreement = socialServiceI.getAnnouncement(communityId);
76 75
         responseBean.addSuccess(agreement);
77 76
         return responseBean;
78 77
     }
@@ -93,7 +92,6 @@ public class SocialController {
93 92
         return responseBean;
94 93
     }
95 94
     
96
-    
97 95
     @ApiOperation(value = "论坛活动帖子详情", notes = "获取论坛活动帖子详情")
98 96
     @ApiImplicitParams({ @ApiImplicitParam(paramType = "path", dataType = "integer", name = "communityId", value = "小区Id"),
99 97
             @ApiImplicitParam(paramType = "query", dataType = "integer", name = "activityId", value = "活动帖子id")})
@@ -104,4 +102,5 @@ public class SocialController {
104 102
         responseBean.addSuccess(activity);
105 103
         return responseBean;
106 104
     }
105
+
107 106
 }

+ 5
- 5
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java 查看文件

@@ -28,12 +28,12 @@ public class TicketController {
28 28
     @RequestMapping(value = "/ticket/service/{communityId}",method = RequestMethod.GET)
29 29
     @ApiOperation(value = "获取 报修/投诉/联系单 各3条数据",notes = "根据 小区编号,第几页,一页多少行")
30 30
     @ApiImplicitParams({
31
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区编号"),
32
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "pageCode",value = "第几页"),
33
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "pageSize",value = "一页多少数据"),
31
+            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区编号"),
32
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageNum",value = "第几页"),
33
+            @ApiImplicitParam(paramType = "query",dataType = "Integer",name = "pageSize",value = "一页多少数据"),
34 34
     })
35 35
     public ResponseBean getService(@PathVariable(value = "communityId") String communityId,
36
-                                   @RequestParam(value = "pageCode",defaultValue = "1") Integer pageCode,
36
+                                   @RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
37 37
                                    @RequestParam(value = "pageSize",defaultValue = "3") Integer pageSize,
38 38
                                    HttpSession session) {
39 39
         ResponseBean response = new ResponseBean();
@@ -44,7 +44,7 @@ public class TicketController {
44 44
         tpTicket.setCommunityId(Integer.valueOf(communityId));
45 45
         tpTicket.setTaUserId(userElement.getId());
46 46
 
47
-        response = iTicketService.getList(tpTicket,pageCode,pageSize);
47
+        response = iTicketService.getList(tpTicket,pageNum,pageSize);
48 48
         return response;
49 49
     }
50 50
 

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

@@ -34,9 +34,9 @@ public class UserController {
34 34
 
35 35
     @ApiOperation(value = "登录", notes = "根据登录名和密码")
36 36
     @ApiImplicitParams({
37
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "communityId",value = "小区"),
38
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginName",value = "手机号"),
39
-            @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginPassword",value = "密码")
37
+            @ApiImplicitParam(paramType = "path",dataType = "String",name = "communityId",value = "小区"),
38
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "loginName",value = "登陆名(手机号)"),
39
+            @ApiImplicitParam(paramType = "query",dataType = "String",name = "code",value = "验证码")
40 40
     })
41 41
     @RequestMapping(value = "/user/login/{communityId}",method = RequestMethod.POST)
42 42
     public ResponseBean login(@RequestParam(value = "loginName") String loginName,

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

@@ -17,5 +17,8 @@ public interface TpCarouselSettingMapper {
17 17
 
18 18
     int updateByPrimaryKey(TpCarouselSetting record);
19 19
 
20
+     int getcarouselNum(String lease);
21
+
20 22
     Integer selectCarouselNum(String carouselType);
23
+
21 24
 }

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

@@ -27,10 +27,9 @@ public interface SocialServiceI {
27 27
 	/**
28 28
 	 * 公告轮播图
29 29
 	 * @param communityId
30
-	 * @param sum
31 30
 	 * @return
32 31
 	 */
33
-	List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum);
32
+	List<TpAnnouncement> getAnnouncement(Integer communityId);
34 33
 	
35 34
 	/**
36 35
 	 * 分页获取活动列表

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

@@ -1,16 +1,11 @@
1 1
 package com.community.huiju.service.impl;
2 2
 
3 3
 import com.community.commom.constant.Constant;
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;
4
+import com.community.huiju.dao.*;
5
+import com.community.huiju.model.*;
8 6
 import com.community.huiju.service.SocialServiceI;
9
-import com.community.huiju.dao.TpActivityMapper;
10 7
 import com.community.huiju.dao.TpAnnouncementMapper;
11
-import com.community.huiju.model.TpActivity;
12 8
 import com.community.huiju.model.TpAnnouncement;
13
-import com.community.huiju.model.TpMessage;
14 9
 import com.community.huiju.service.SocialServiceI;
15 10
 import com.github.pagehelper.PageHelper;
16 11
 import org.springframework.beans.factory.annotation.Autowired;
@@ -37,6 +32,11 @@ public class SocialServiceImpl implements SocialServiceI {
37 32
 
38 33
     @Autowired
39 34
     private TpActivityMapper tpActivityMapper;
35
+
36
+    @Autowired
37
+    private TpCarouselSettingMapper tpCarouselSettingMapper;
38
+
39
+
40 40
     
41 41
     @Override
42 42
     @Transactional
@@ -78,12 +78,12 @@ public class SocialServiceImpl implements SocialServiceI {
78 78
     /**
79 79
      * 根据当前小区ID查出轮播图
80 80
      * @param communityId 当前小区ID
81
-     * @param sum 当前查询总数
82 81
      * @return
83 82
      */
84 83
     @Override
85
-    public List<TpAnnouncement> getAnnouncement(Integer communityId, Integer sum) {
86
-        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId ,sum);
84
+    public List<TpAnnouncement> getAnnouncement(Integer communityId) {
85
+        Integer Num=tpCarouselSettingMapper.getcarouselNum(Constant.ANNOUNCEMENT);
86
+        List<TpAnnouncement> listAnnouncement=tpAnnouncementMapper.getAnnouncement(communityId,Num);
87 87
         return listAnnouncement;
88 88
     }
89 89
 

+ 34
- 79
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java 查看文件

@@ -11,12 +11,9 @@ import com.github.pagehelper.PageHelper;
11 11
 import com.google.common.collect.Lists;
12 12
 import com.google.common.collect.Maps;
13 13
 import lombok.extern.slf4j.Slf4j;
14
-import org.apache.commons.collections.ListUtils;
15
-import org.apache.commons.lang.ObjectUtils;
16 14
 import org.springframework.beans.BeanUtils;
17 15
 import org.springframework.beans.factory.annotation.Autowired;
18 16
 import org.springframework.stereotype.Service;
19
-import sun.security.krb5.internal.Ticket;
20 17
 
21 18
 import java.util.List;
22 19
 import java.util.Map;
@@ -36,17 +33,12 @@ public class TicketServiceImpl implements ITicketService {
36 33
     private TpTicketRecordCommentMapper tpTicketRecordCommentMapper;
37 34
 
38 35
     @Override
39
-    public ResponseBean getList(TpTicket tpTicket,Integer pageCode, Integer pageSize) {
36
+    public ResponseBean getList(TpTicket tpTicket,Integer pageNum, Integer pageSize) {
40 37
 
41 38
         ResponseBean<Map<String,Object>> responseBean = new ResponseBean();
42 39
         // 最终返回值
43 40
         Map<String,Object> result = Maps.newHashMap();
44 41
 
45
-        // 查询参数
46
-        Map<String,Object> lastRecordMap = Maps.newHashMap();
47
-        lastRecordMap.put("size",1);
48
-
49
-
50 42
         Map<String,Object> parameter = Maps.newHashMap();
51 43
         parameter.put("communityId",tpTicket.getCommunityId());
52 44
         parameter.put("taUserId",tpTicket.getTaUserId());
@@ -55,66 +47,26 @@ public class TicketServiceImpl implements ITicketService {
55 47
 
56 48
 
57 49
         // 报修
58
-        PageHelper.startPage(pageCode,pageSize);
50
+        PageHelper.startPage(pageNum,pageSize);
59 51
         List<TpTicket> tpTicketRepairsList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
60
-
61 52
         List<TpTicketVO> repairsList = Lists.newArrayList();
62
-        tpTicketRepairsList.stream().forEach(e->{
63
-            TpTicketVO tpTicketVO = new TpTicketVO();
64
-            BeanUtils.copyProperties(e,tpTicketVO);
65
-            // 设置工单编号
66
-            lastRecordMap.put("tickerId",e.getId());
67
-            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
68
-            if (null != comment) {
69
-                tpTicketVO.setCommentContent(comment.getContent());
70
-                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
71
-            }
72
-
73
-
74
-            repairsList.add(tpTicketVO);
75
-        });
53
+        tpTicketVOConvert(tpTicketRepairsList,repairsList);
76 54
 
77 55
         // 投诉
78 56
         //  0 代表 报修  1 代表 投诉  2代表 联系单
79 57
         parameter.put("type",1);
80
-        PageHelper.startPage(pageCode,pageSize);
58
+        PageHelper.startPage(pageNum,pageSize);
81 59
         List<TpTicket> tpTicketComplaintList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
82
-
83 60
         List<TpTicketVO> complaintList = Lists.newArrayList();
84
-        tpTicketComplaintList.stream().forEach(e->{
85
-            TpTicketVO tpTicketVO = new TpTicketVO();
86
-            BeanUtils.copyProperties(e,tpTicketVO);
87
-            // 设置工单编号
88
-            lastRecordMap.put("tickerId",e.getId());
89
-            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
90
-            if (null != comment) {
91
-                tpTicketVO.setCommentContent(comment.getContent());
92
-                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
93
-            }
94
-
95
-            complaintList.add(tpTicketVO);
96
-        });
61
+        tpTicketVOConvert(tpTicketComplaintList, complaintList);
97 62
 
98 63
         // 联系工单
99 64
         //  0 代表 报修  1 代表 投诉  2代表 联系单
100 65
         parameter.put("type",2);
101
-        PageHelper.startPage(pageCode,pageSize);
66
+        PageHelper.startPage(pageNum,pageSize);
102 67
         List<TpTicket> tpTicketLiaisonList = tpTicketMapper.selectByCommuniytIdAndByTaUserIdAndByType(parameter);
103
-
104 68
         List<TpTicketVO> liaisonList = Lists.newArrayList();
105
-        tpTicketLiaisonList.stream().forEach(e->{
106
-            TpTicketVO tpTicketVO = new TpTicketVO();
107
-            BeanUtils.copyProperties(e,tpTicketVO);
108
-            // 设置工单编号
109
-            lastRecordMap.put("tickerId",e.getId());
110
-            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
111
-            if (null != comment) {
112
-                tpTicketVO.setCommentContent(comment.getContent());
113
-                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
114
-            }
115
-
116
-            liaisonList.add(tpTicketVO);
117
-        });
69
+        tpTicketVOConvert(tpTicketLiaisonList, liaisonList);
118 70
 
119 71
         result.put("repairs",repairsList);
120 72
         result.put("complaint",complaintList);
@@ -136,29 +88,32 @@ public class TicketServiceImpl implements ITicketService {
136 88
                 ?null:list.get(0);
137 89
     }
138 90
 
139
-//    public <T> List<T> setTicketData(T t, List<Ticket> source, Map map){
140
-//        List<T> list = Lists.newArrayList();
141
-//
142
-//        // 查询参数
143
-//        Map<String,Object> lastRecordMap = Maps.newHashMap();
144
-//        lastRecordMap.put("size",1);
145
-//
146
-//        source.stream().forEach(e->{
147
-//            TpTicketVO tpTicketVO = new TpTicketVO();
148
-//            BeanUtils.copyProperties(e,tpTicketVO);
149
-//            // 设置工单编号
150
-//            lastRecordMap.put("tickerId",e.getId());
151
-//            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
152
-//            if (null != comment) {
153
-//                tpTicketVO.setCommentContent(comment.getContent());
154
-//                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
155
-//            }
156
-//
157
-//            liaisonList.add(tpTicketVO);
158
-//        });
159
-
160
-
161
-        //return list;
162
-    //}
91
+    /**
92
+     * 数据转换,并填充数据
93
+     * @param target
94
+     * @param source
95
+     * @return
96
+     */
97
+    public void tpTicketVOConvert(List<TpTicket> source, List<TpTicketVO> target){
98
+
99
+        // 查询参数
100
+        Map<String,Object> lastRecordMap = Maps.newHashMap();
101
+        // 表示查询出最新的一条
102
+        lastRecordMap.put("size",1);
103
+
104
+        source.stream().forEach(e->{
105
+            TpTicketVO tpTicketVO = new TpTicketVO();
106
+            BeanUtils.copyProperties(e,tpTicketVO);
107
+            // 设置工单编号
108
+            lastRecordMap.put("tickerId",e.getId());
109
+            TpTicketRecordComment comment = getTicketRecordComment(lastRecordMap);
110
+            if (null != comment) {
111
+                tpTicketVO.setCommentContent(comment.getContent());
112
+                tpTicketVO.setCommentCreateDate(comment.getCreateDate());
113
+            }
114
+
115
+            target.add(tpTicketVO);
116
+        });
117
+    }
163 118
 
164 119
 }

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

@@ -85,4 +85,9 @@
85 85
       carousel_num = #{carouselNum,jdbcType=INTEGER}
86 86
     where id = #{id,jdbcType=INTEGER}
87 87
   </update>
88
+  <select id="getcarouselNum"  parameterType="java.lang.String" resultType="java.lang.Integer">
89
+    select carousel_num from tp_carousel_setting where  carousel_type=#{lease,jdbcType=VARCHAR}
90
+  </select>
91
+
92
+
88 93
 </mapper>