dingxin 6 лет назад
Родитель
Сommit
7ab7ae1d95
17 измененных файлов: 186 добавлений и 6 удалений
  1. 13
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpHotelController.java
  2. 11
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpShopController.java
  3. 1
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpHotelImgMapper.java
  4. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpHotelMapper.java
  5. 14
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpShopMapper.java
  6. 14
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpHotel.java
  7. 15
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpRentalHouse.java
  8. 29
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpShop.java
  9. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpHotelServicel.java
  10. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpShopServicel.java
  11. 21
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpHotelServiceimpl.java
  12. 7
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpRentalHouseServicelImpl.java
  13. 24
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpShopServicelmpl.java
  14. 1
    1
      CODE/smart-community/app-api/src/main/resources/mapper/TpHotelImgMapper.xml
  15. 7
    2
      CODE/smart-community/app-api/src/main/resources/mapper/TpHotelMapper.xml
  16. 7
    0
      CODE/smart-community/app-api/src/main/resources/mapper/TpShopMapper.xml
  17. 1
    1
      CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/HotelServiceImpl.java

+ 13
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpHotelController.java Просмотреть файл

@@ -45,4 +45,17 @@ public class TpHotelController extends BaseController {
45 45
         ResponseBean responseBean = tpHotelServicel.getHotel(userElement);
46 46
         return responseBean;
47 47
     }
48
+
49
+    @ApiOperation(value = "当前小区酒店是否需要展示", notes = "当前小区酒店是否需要展示")
50
+    @ApiImplicitParams({
51
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token")
52
+    })
53
+    @RequestMapping(value = "/CommunityHotel",method = RequestMethod.GET)
54
+    public Object getHotelCommunity(HttpSession session){
55
+        UserElement userElement = getUserElement(session);
56
+        ResponseBean responseBean = tpHotelServicel.getHotelCommunity(userElement);
57
+        return responseBean;
58
+    }
59
+
60
+
48 61
 }

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TpShopController.java Просмотреть файл

@@ -62,6 +62,17 @@ public class TpShopController extends BaseController{
62 62
         return responseBean;
63 63
     }
64 64
 
65
+    @ApiOperation(value = "首页商铺信息", notes = "首页商铺信息")
66
+    @ApiImplicitParams({
67
+            @ApiImplicitParam(paramType = "header",dataType = "String",name = "X-Auth-Token",value = "Token"),
68
+    })
69
+    @RequestMapping(value = "/getShopCommunity",method = RequestMethod.GET)
70
+    public Object getShopCommunity(HttpSession session){
71
+        UserElement userElement = getUserElement(session);
72
+        ResponseBean responseBean = tpShopServicel.getShopCommunity(userElement);
73
+        return responseBean;
74
+    }
75
+
65 76
 
66 77
 
67 78
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpHotelImgMapper.java Просмотреть файл

@@ -20,5 +20,5 @@ public interface TpHotelImgMapper {
20 20
     int updateByPrimaryKey(TpHotelImg record);
21 21
 
22 22
 
23
-    List<String> selectHotelImg(@Param("hotelId") Integer id, @Param("communityId") Integer communityId);
23
+    List<String> selectHotelImg(@Param("hotelId") Integer id, @Param("communityId") Integer communityId,@Param("type") Integer type);
24 24
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpHotelMapper.java Просмотреть файл

@@ -25,4 +25,11 @@ public interface TpHotelMapper {
25 25
      * @return
26 26
      */
27 27
     TpHotel selectCommunityHotel(@Param("communityId") Integer CommunityId);
28
+
29
+    /**
30
+     * 酒店开关是否存在
31
+     * @param communityId
32
+     * @return
33
+     */
34
+    String hotelSetting(@Param("communityId") Integer communityId);
28 35
 }

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpShopMapper.java Просмотреть файл

@@ -28,4 +28,18 @@ public interface TpShopMapper {
28 28
      * @return
29 29
      */
30 30
     List<TpShop> selectcommunityIdShop(@Param("communityId") Integer communityId,@Param("houseName") String houseName,@Param("tpShopTypeId") Integer tpShopTypeId);
31
+
32
+    /**
33
+     * 查询当前小区商铺是否展示
34
+     * @param communityId
35
+     * @return
36
+     */
37
+    String shopSetting(@Param("communityId") Integer communityId);
38
+
39
+    /**
40
+     * 查询当前小区下的所有商铺
41
+     * @param communityId
42
+     * @return
43
+     */
44
+    List<TpShop> selectShopCommunity(@Param("communityId") Integer communityId);
31 45
 }

+ 14
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpHotel.java Просмотреть файл

@@ -5,6 +5,12 @@ import java.util.List;
5 5
 
6 6
 public class TpHotel {
7 7
     private Integer id;
8
+
9
+    /**
10
+     * 酒店名称
11
+     */
12
+    private String hotelName;
13
+
8 14
     /**
9 15
      * 小区ID
10 16
      */
@@ -60,6 +66,14 @@ public class TpHotel {
60 66
      */
61 67
     private List<TpHotelRoom> tpHotelRoomsList;
62 68
 
69
+    public String getHotelName() {
70
+        return hotelName;
71
+    }
72
+
73
+    public void setHotelName(String hotelName) {
74
+        this.hotelName = hotelName;
75
+    }
76
+
63 77
     public void setTpHotelRoomsList(List<TpHotelRoom> tpHotelRoomsList) {
64 78
         this.tpHotelRoomsList = tpHotelRoomsList;
65 79
     }

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpRentalHouse.java Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import java.util.Date;
4
+import java.util.List;
4 5
 
5 6
 public class TpRentalHouse {
6 7
     /**
@@ -161,6 +162,20 @@ public class TpRentalHouse {
161 162
      */
162 163
     private String homeImg;
163 164
 
165
+    /**
166
+     * 标签数组
167
+     * @return
168
+     */
169
+    private List<String> houseLabelArr;;
170
+
171
+    public List<String> getHouseLabelArr() {
172
+        return houseLabelArr;
173
+    }
174
+
175
+    public void setHouseLabelArr(List<String> houseLabelArr) {
176
+        this.houseLabelArr = houseLabelArr;
177
+    }
178
+
164 179
     public String getHomeImg() {
165 180
         return homeImg;
166 181
     }

+ 29
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpShop.java Просмотреть файл

@@ -1,6 +1,7 @@
1 1
 package com.community.huiju.model;
2 2
 
3 3
 import java.util.Date;
4
+import java.util.List;
4 5
 
5 6
 public class TpShop {
6 7
 
@@ -92,6 +93,34 @@ public class TpShop {
92 93
      */
93 94
     private String shopImg;
94 95
 
96
+    /**
97
+     * 商铺信息
98
+     * @return
99
+     */
100
+    private List<TpShopImg> tpShopImgList;
101
+
102
+    /**
103
+     * 商铺类型
104
+     * @return
105
+     */
106
+    private List<TpShopType> tpShopTypeList;
107
+
108
+    public List<TpShopType> getTpShopTypeList() {
109
+        return tpShopTypeList;
110
+    }
111
+
112
+    public void setTpShopTypeList(List<TpShopType> tpShopTypeList) {
113
+        this.tpShopTypeList = tpShopTypeList;
114
+    }
115
+
116
+    public List<TpShopImg> getTpShopImgList() {
117
+        return tpShopImgList;
118
+    }
119
+
120
+    public void setTpShopImgList(List<TpShopImg> tpShopImgList) {
121
+        this.tpShopImgList = tpShopImgList;
122
+    }
123
+
95 124
     public String getShopImg() {
96 125
         return shopImg;
97 126
     }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpHotelServicel.java Просмотреть файл

@@ -17,4 +17,11 @@ public interface TpHotelServicel {
17 17
      * @return
18 18
      */
19 19
     ResponseBean getHotel(UserElement userElement);
20
+
21
+    /**
22
+     * 获取当前小区酒店信息
23
+     * @param userElement
24
+     * @return
25
+     */
26
+    ResponseBean getHotelCommunity(UserElement userElement);
20 27
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/TpShopServicel.java Просмотреть файл

@@ -26,4 +26,11 @@ public interface TpShopServicel {
26 26
      * @return
27 27
      */
28 28
     ResponseBean getShopDetails(UserElement userElement, Integer id);
29
+
30
+    /**
31
+     * 获取当前小区下的所有商铺
32
+     * @param userElement
33
+     * @return
34
+     */
35
+    ResponseBean getShopCommunity(UserElement userElement);
29 36
 }

+ 21
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpHotelServiceimpl.java Просмотреть файл

@@ -47,7 +47,7 @@ public class TpHotelServiceimpl implements TpHotelServicel {
47 47
             List<TpHotelRoom> tpHotelRoom = tpHotelRoomMapper.selectHotelRoomList(userElement.getCommunityId(),tpHotel.getId());
48 48
             tpHotel.setTpHotelRoomsList(tpHotelRoom);
49 49
             // 查询当前酒店所有的banner图
50
-            List<String> img = tpHotelImgMapper.selectHotelImg(tpHotel.getId(), userElement.getCommunityId());
50
+            List<String> img = tpHotelImgMapper.selectHotelImg(tpHotel.getId(), userElement.getCommunityId(),2);
51 51
             Map map = new HashMap<>();
52 52
             map.put("tpHotel", tpHotel);
53 53
             map.put("img", img);
@@ -55,4 +55,24 @@ public class TpHotelServiceimpl implements TpHotelServicel {
55 55
         }
56 56
         return responseBean;
57 57
     }
58
+
59
+    @Override
60
+    public ResponseBean getHotelCommunity(UserElement userElement) {
61
+        ResponseBean response= new ResponseBean<>();
62
+        // 查询当前的酒店是否展示
63
+        TpHotel tpHotel = null;
64
+        List<String> img = null;
65
+        String  hotelSetting= tpHotelMapper.hotelSetting(userElement.getCommunityId());
66
+        if (null != hotelSetting){
67
+             tpHotel= tpHotelMapper.selectCommunityHotel(userElement.getCommunityId());
68
+            List<TpHotelRoom> tpHotelRoom = tpHotelRoomMapper.selectHotelRoomList(userElement.getCommunityId(),tpHotel.getId());
69
+            tpHotel.setTpHotelRoomsList(tpHotelRoom);
70
+            img = tpHotelImgMapper.selectHotelImg(tpHotel.getId(), userElement.getCommunityId(),2);
71
+        }
72
+        Map map = new HashMap<>();
73
+        map.put("tpHotel", tpHotel);
74
+        map.put("img", img);
75
+        response.addSuccess(map);
76
+        return response;
77
+    }
58 78
 }

+ 7
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpRentalHouseServicelImpl.java Просмотреть файл

@@ -42,7 +42,14 @@ public class TpRentalHouseServicelImpl implements TpRentalHouseServicel {
42 42
         //使用分页插件
43 43
         Page<TpRentalHouse> pageTpRentalHouseList = PageHelper.startPage(pageNum, pageSize);
44 44
         List<TpRentalHouse> tpRentalHouseList= tpRentalHouseMapper.getRentalHouse(houseName,rentalType,houseType,rentalPrice,priceFluctuate);
45
+            // 把字符串转数组
46
+        List<String> houseLabel= new ArrayList<>();
45 47
         for (TpRentalHouse tpRentalHouse:tpRentalHouseList){
48
+            String [] result = tpRentalHouse.getHouseLabel().split(",");
49
+            for(int a = 0;a<result.length;a++){
50
+                houseLabel.add(result[a]);
51
+                tpRentalHouse.setHouseLabelArr(houseLabel);
52
+            }
46 53
             // 根据 tpRentalHouse.getId()和img_type为2查询列表图
47 54
             List<TpRentalHouseImg> tpRentalHouseImgList= tpRentalHouseImgMapper.selectRentalHouseImg(tpRentalHouse.getId(),1);
48 55
              if (null != tpRentalHouseImgList){

+ 24
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TpShopServicelmpl.java Просмотреть файл

@@ -76,4 +76,28 @@ public class TpShopServicelmpl implements TpShopServicel {
76 76
         response.addSuccess(hashMap);
77 77
         return response;
78 78
     }
79
+
80
+    @Override
81
+    public ResponseBean getShopCommunity(UserElement userElement) {
82
+        ResponseBean response = new ResponseBean<>();
83
+        // 当前线下商铺是否展示
84
+        String shopSetting= tpShopMapper.shopSetting(userElement.getCommunityId());
85
+        List<TpShop> tpShopList = null;
86
+        List<TpShopType> tpShopType =null;
87
+        if (null != shopSetting){
88
+            tpShopList= tpShopMapper.selectShopCommunity(userElement.getCommunityId());
89
+            for (TpShop tpShop:tpShopList){
90
+                // 1 表示查询当前首页图片
91
+                List<TpShopImg> tpShopImgList= tpShopImgMapper.selectShopIdCommunity(userElement.getCommunityId(),tpShop.getId(),1);
92
+                tpShop.setTpShopImgList(tpShopImgList);
93
+            }
94
+            // 查询当前商铺类型
95
+             tpShopType= tpShopTypeMapper.selectCommunityIdShop(userElement.getCommunityId());
96
+        }
97
+        Map<String,Object> hashMap= new HashMap<>();
98
+        hashMap.put("tpShopType",tpShopType);
99
+        hashMap.put("tpShopList",tpShopList);
100
+        response.addSuccess(hashMap);
101
+        return response;
102
+    }
79 103
 }

+ 1
- 1
CODE/smart-community/app-api/src/main/resources/mapper/TpHotelImgMapper.xml Просмотреть файл

@@ -110,7 +110,7 @@
110 110
     from tp_hotel_img
111 111
     where community_id = #{communityId,jdbcType=INTEGER}
112 112
       and hotel_id = #{hotelId,jdbcType=INTEGER}
113
-      and img_type = 2
113
+      and img_type = #{type}
114 114
   </select>
115 115
 
116 116
 

+ 7
- 2
CODE/smart-community/app-api/src/main/resources/mapper/TpHotelMapper.xml Просмотреть файл

@@ -12,12 +12,13 @@
12 12
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
13 13
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
14 14
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
15
+    <result column="hotel_name" property="hotelName" jdbcType="VARCHAR" />
15 16
   </resultMap>
16 17
   <resultMap id="ResultMapWithBLOBs" type="com.community.huiju.model.TpHotel" extends="BaseResultMap" >
17 18
     <result column="hotel_introduction" property="hotelIntroduction" jdbcType="LONGVARCHAR" />
18 19
   </resultMap>
19 20
   <sql id="Base_Column_List" >
20
-    id, community_id, hotel_tel, hotel_address, hotel_longitude, hotel_latitude, create_date, 
21
+    id,hotel_name community_id, hotel_tel, hotel_address, hotel_longitude, hotel_latitude, create_date,
21 22
     create_user, update_date, update_user
22 23
   </sql>
23 24
   <sql id="Blob_Column_List" >
@@ -184,10 +185,14 @@
184 185
 
185 186
   <select id="selectCommunityHotel" parameterType="integer" resultMap="ResultMapWithBLOBs">
186 187
     select
187
-    id, community_id, hotel_tel, hotel_address, hotel_longitude, hotel_latitude, create_date,
188
+    id,hotel_name, community_id, hotel_tel, hotel_address, hotel_longitude, hotel_latitude, create_date,
188 189
     create_user, update_date, update_user,hotel_introduction
189 190
     from tp_hotel
190 191
     where community_id = #{communityId,jdbcType=INTEGER}
191 192
   </select>
193
+  
194
+  <select id="hotelSetting" resultType="integer">
195
+    select id from tp_hotel_setting where  community_id = #{communityId};
196
+  </select>
192 197
 
193 198
 </mapper>

+ 7
- 0
CODE/smart-community/app-api/src/main/resources/mapper/TpShopMapper.xml Просмотреть файл

@@ -276,5 +276,12 @@
276 276
     </where>
277 277
   </select>
278 278
 
279
+  <select id="shopSetting" resultType="string">
280
+    select id from tp_shop_setting where community_id = #{communityId}
281
+  </select>
282
+
283
+  <select id="selectShopCommunity" resultMap="ResultMapWithBLOBs">
284
+    select * from tp_shop WHERE community_id = #{communityId} order by sort desc LIMIT 4
285
+  </select>
279 286
 
280 287
 </mapper>

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/HotelServiceImpl.java Просмотреть файл

@@ -81,7 +81,7 @@ public class HotelServiceImpl extends ServiceImpl<HotelMapper, Hotel> implements
81 81
         Hotel hotel= tpHotelMapper.selectHotel(userElement.getCommunityId());
82 82
         hotelRoom.setCommunityId(userElement.getCommunityId())
83 83
                 .setHotelId(hotel.getId())
84
-                .setPrice(String.valueOf(Double.valueOf(hotelRoom.getPrice())))
84
+                .setPrice(String.valueOf(hotelRoom.getPrice()))
85 85
                 .setCreateDate(LocalDateTime.now())
86 86
                 .setCreateUser(userElement.getId());
87 87
         tpHotelRoomMapper.insert(hotelRoom);