dingxin 6 年前
父节点
当前提交
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
         ResponseBean responseBean = tpHotelServicel.getHotel(userElement);
45
         ResponseBean responseBean = tpHotelServicel.getHotel(userElement);
46
         return responseBean;
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
         return responseBean;
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
     int updateByPrimaryKey(TpHotelImg record);
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
      * @return
25
      * @return
26
      */
26
      */
27
     TpHotel selectCommunityHotel(@Param("communityId") Integer CommunityId);
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
      * @return
28
      * @return
29
      */
29
      */
30
     List<TpShop> selectcommunityIdShop(@Param("communityId") Integer communityId,@Param("houseName") String houseName,@Param("tpShopTypeId") Integer tpShopTypeId);
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
 
5
 
6
 public class TpHotel {
6
 public class TpHotel {
7
     private Integer id;
7
     private Integer id;
8
+
9
+    /**
10
+     * 酒店名称
11
+     */
12
+    private String hotelName;
13
+
8
     /**
14
     /**
9
      * 小区ID
15
      * 小区ID
10
      */
16
      */
60
      */
66
      */
61
     private List<TpHotelRoom> tpHotelRoomsList;
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
     public void setTpHotelRoomsList(List<TpHotelRoom> tpHotelRoomsList) {
77
     public void setTpHotelRoomsList(List<TpHotelRoom> tpHotelRoomsList) {
64
         this.tpHotelRoomsList = tpHotelRoomsList;
78
         this.tpHotelRoomsList = tpHotelRoomsList;
65
     }
79
     }

+ 15
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpRentalHouse.java 查看文件

1
 package com.community.huiju.model;
1
 package com.community.huiju.model;
2
 
2
 
3
 import java.util.Date;
3
 import java.util.Date;
4
+import java.util.List;
4
 
5
 
5
 public class TpRentalHouse {
6
 public class TpRentalHouse {
6
     /**
7
     /**
161
      */
162
      */
162
     private String homeImg;
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
     public String getHomeImg() {
179
     public String getHomeImg() {
165
         return homeImg;
180
         return homeImg;
166
     }
181
     }

+ 29
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpShop.java 查看文件

1
 package com.community.huiju.model;
1
 package com.community.huiju.model;
2
 
2
 
3
 import java.util.Date;
3
 import java.util.Date;
4
+import java.util.List;
4
 
5
 
5
 public class TpShop {
6
 public class TpShop {
6
 
7
 
92
      */
93
      */
93
     private String shopImg;
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
     public String getShopImg() {
124
     public String getShopImg() {
96
         return shopImg;
125
         return shopImg;
97
     }
126
     }

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

17
      * @return
17
      * @return
18
      */
18
      */
19
     ResponseBean getHotel(UserElement userElement);
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
      * @return
26
      * @return
27
      */
27
      */
28
     ResponseBean getShopDetails(UserElement userElement, Integer id);
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
             List<TpHotelRoom> tpHotelRoom = tpHotelRoomMapper.selectHotelRoomList(userElement.getCommunityId(),tpHotel.getId());
47
             List<TpHotelRoom> tpHotelRoom = tpHotelRoomMapper.selectHotelRoomList(userElement.getCommunityId(),tpHotel.getId());
48
             tpHotel.setTpHotelRoomsList(tpHotelRoom);
48
             tpHotel.setTpHotelRoomsList(tpHotelRoom);
49
             // 查询当前酒店所有的banner图
49
             // 查询当前酒店所有的banner图
50
-            List<String> img = tpHotelImgMapper.selectHotelImg(tpHotel.getId(), userElement.getCommunityId());
50
+            List<String> img = tpHotelImgMapper.selectHotelImg(tpHotel.getId(), userElement.getCommunityId(),2);
51
             Map map = new HashMap<>();
51
             Map map = new HashMap<>();
52
             map.put("tpHotel", tpHotel);
52
             map.put("tpHotel", tpHotel);
53
             map.put("img", img);
53
             map.put("img", img);
55
         }
55
         }
56
         return responseBean;
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
         //使用分页插件
42
         //使用分页插件
43
         Page<TpRentalHouse> pageTpRentalHouseList = PageHelper.startPage(pageNum, pageSize);
43
         Page<TpRentalHouse> pageTpRentalHouseList = PageHelper.startPage(pageNum, pageSize);
44
         List<TpRentalHouse> tpRentalHouseList= tpRentalHouseMapper.getRentalHouse(houseName,rentalType,houseType,rentalPrice,priceFluctuate);
44
         List<TpRentalHouse> tpRentalHouseList= tpRentalHouseMapper.getRentalHouse(houseName,rentalType,houseType,rentalPrice,priceFluctuate);
45
+            // 把字符串转数组
46
+        List<String> houseLabel= new ArrayList<>();
45
         for (TpRentalHouse tpRentalHouse:tpRentalHouseList){
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
             // 根据 tpRentalHouse.getId()和img_type为2查询列表图
53
             // 根据 tpRentalHouse.getId()和img_type为2查询列表图
47
             List<TpRentalHouseImg> tpRentalHouseImgList= tpRentalHouseImgMapper.selectRentalHouseImg(tpRentalHouse.getId(),1);
54
             List<TpRentalHouseImg> tpRentalHouseImgList= tpRentalHouseImgMapper.selectRentalHouseImg(tpRentalHouse.getId(),1);
48
              if (null != tpRentalHouseImgList){
55
              if (null != tpRentalHouseImgList){

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

76
         response.addSuccess(hashMap);
76
         response.addSuccess(hashMap);
77
         return response;
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
     from tp_hotel_img
110
     from tp_hotel_img
111
     where community_id = #{communityId,jdbcType=INTEGER}
111
     where community_id = #{communityId,jdbcType=INTEGER}
112
       and hotel_id = #{hotelId,jdbcType=INTEGER}
112
       and hotel_id = #{hotelId,jdbcType=INTEGER}
113
-      and img_type = 2
113
+      and img_type = #{type}
114
   </select>
114
   </select>
115
 
115
 
116
 
116
 

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

12
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
12
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
13
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
13
     <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
14
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
14
     <result column="update_user" property="updateUser" jdbcType="INTEGER" />
15
+    <result column="hotel_name" property="hotelName" jdbcType="VARCHAR" />
15
   </resultMap>
16
   </resultMap>
16
   <resultMap id="ResultMapWithBLOBs" type="com.community.huiju.model.TpHotel" extends="BaseResultMap" >
17
   <resultMap id="ResultMapWithBLOBs" type="com.community.huiju.model.TpHotel" extends="BaseResultMap" >
17
     <result column="hotel_introduction" property="hotelIntroduction" jdbcType="LONGVARCHAR" />
18
     <result column="hotel_introduction" property="hotelIntroduction" jdbcType="LONGVARCHAR" />
18
   </resultMap>
19
   </resultMap>
19
   <sql id="Base_Column_List" >
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
     create_user, update_date, update_user
22
     create_user, update_date, update_user
22
   </sql>
23
   </sql>
23
   <sql id="Blob_Column_List" >
24
   <sql id="Blob_Column_List" >
184
 
185
 
185
   <select id="selectCommunityHotel" parameterType="integer" resultMap="ResultMapWithBLOBs">
186
   <select id="selectCommunityHotel" parameterType="integer" resultMap="ResultMapWithBLOBs">
186
     select
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
     create_user, update_date, update_user,hotel_introduction
189
     create_user, update_date, update_user,hotel_introduction
189
     from tp_hotel
190
     from tp_hotel
190
     where community_id = #{communityId,jdbcType=INTEGER}
191
     where community_id = #{communityId,jdbcType=INTEGER}
191
   </select>
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
 </mapper>
198
 </mapper>

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

276
     </where>
276
     </where>
277
   </select>
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
 </mapper>
287
 </mapper>

+ 1
- 1
CODE/smart-community/property-api/src/main/java/com/community/huiju/service/impl/HotelServiceImpl.java 查看文件

81
         Hotel hotel= tpHotelMapper.selectHotel(userElement.getCommunityId());
81
         Hotel hotel= tpHotelMapper.selectHotel(userElement.getCommunityId());
82
         hotelRoom.setCommunityId(userElement.getCommunityId())
82
         hotelRoom.setCommunityId(userElement.getCommunityId())
83
                 .setHotelId(hotel.getId())
83
                 .setHotelId(hotel.getId())
84
-                .setPrice(String.valueOf(Double.valueOf(hotelRoom.getPrice())))
84
+                .setPrice(String.valueOf(hotelRoom.getPrice()))
85
                 .setCreateDate(LocalDateTime.now())
85
                 .setCreateDate(LocalDateTime.now())
86
                 .setCreateUser(userElement.getId());
86
                 .setCreateUser(userElement.getId());
87
         tpHotelRoomMapper.insert(hotelRoom);
87
         tpHotelRoomMapper.insert(hotelRoom);