|
@@ -30,11 +30,11 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
/**
|
|
/**
|
|
|
* 房型ID
|
|
* 房型ID
|
|
|
*/
|
|
*/
|
|
|
- public Integer sadad;
|
|
|
|
|
|
|
+ public Integer roomId;
|
|
|
/**
|
|
/**
|
|
|
* 民宿商家ID
|
|
* 民宿商家ID
|
|
|
*/
|
|
*/
|
|
|
- public Integer homestayId;
|
|
|
|
|
|
|
+ public Integer merchantId;
|
|
|
/**
|
|
/**
|
|
|
* 入住时间
|
|
* 入住时间
|
|
|
*/
|
|
*/
|
|
@@ -44,6 +44,38 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
*/
|
|
*/
|
|
|
public String endTime;
|
|
public String endTime;
|
|
|
|
|
|
|
|
|
|
+ public Integer getRoomId() {
|
|
|
|
|
+ return roomId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setRoomId(Integer roomId) {
|
|
|
|
|
+ this.roomId = roomId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Integer getMerchantId() {
|
|
|
|
|
+ return merchantId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setMerchantId(Integer merchantId) {
|
|
|
|
|
+ this.merchantId = merchantId;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getStartTime() {
|
|
|
|
|
+ return startTime;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setStartTime(String startTime) {
|
|
|
|
|
+ this.startTime = startTime;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getEndTime() {
|
|
|
|
|
+ return endTime;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setEndTime(String endTime) {
|
|
|
|
|
+ this.endTime = endTime;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private final HousePriceDto housePriceDto = new HousePriceDto();
|
|
private final HousePriceDto housePriceDto = new HousePriceDto();
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -132,7 +164,7 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
*/
|
|
*/
|
|
|
public String priceCalendar() throws ParseException {
|
|
public String priceCalendar() throws ParseException {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
- if (homestayId == null) {
|
|
|
|
|
|
|
+ if (merchantId == null) {
|
|
|
resultJson.put("message", "商家不能为空");
|
|
resultJson.put("message", "商家不能为空");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
@@ -176,7 +208,7 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
|
|
|
|
|
Collections.sort(dateStrs);
|
|
Collections.sort(dateStrs);
|
|
|
|
|
|
|
|
- List<HousePriceDataVo> hprd = housePriceService.queryHousePriceDatas(homestayId, dateStrs.get(0), dateStrs.get(dateStrs.size() - 1));
|
|
|
|
|
|
|
+ List<HousePriceDataVo> hprd = housePriceService.queryHousePriceDatas(merchantId, dateStrs.get(0), dateStrs.get(dateStrs.size() - 1));
|
|
|
List<HousePriceOneDataVo> oneDatas = new ArrayList<>();
|
|
List<HousePriceOneDataVo> oneDatas = new ArrayList<>();
|
|
|
//将数据处理成单天的
|
|
//将数据处理成单天的
|
|
|
for (HousePriceDataVo hp : hprd) {
|
|
for (HousePriceDataVo hp : hprd) {
|
|
@@ -222,7 +254,7 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
/**
|
|
/**
|
|
|
* 获取该民宿下最低房型价格
|
|
* 获取该民宿下最低房型价格
|
|
|
*/
|
|
*/
|
|
|
- Double minPrice = houseService.getHouseMinPrice(homestayId);
|
|
|
|
|
|
|
+ Double minPrice = houseService.getHouseMinPrice(merchantId);
|
|
|
|
|
|
|
|
for (String str : dateStrs) {
|
|
for (String str : dateStrs) {
|
|
|
HousePriceResultVo data = new HousePriceResultVo();
|
|
HousePriceResultVo data = new HousePriceResultVo();
|
|
@@ -255,7 +287,7 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
public String dailyPrice() throws ParseException {
|
|
public String dailyPrice() throws ParseException {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
JSONObject resultJson = new JSONObject();
|
|
|
|
|
|
|
|
- if (sadad == null) {
|
|
|
|
|
|
|
+ if (roomId == null) {
|
|
|
resultJson.put("message", "房型不能为空");
|
|
resultJson.put("message", "房型不能为空");
|
|
|
resultJson.put("code", 500);
|
|
resultJson.put("code", 500);
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
@@ -273,7 +305,7 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- List<HousePriceDataVo> priceDatas = housePriceService.queryPriceByHouseId(sadad, startTime, TimeExchange.TimeDesD(endTime, -1));
|
|
|
|
|
|
|
+ List<HousePriceDataVo> priceDatas = housePriceService.queryPriceByHouseId(roomId, startTime, TimeExchange.TimeDesD(endTime, -1));
|
|
|
|
|
|
|
|
List<HousePriceOneDataVo> oneDatas = new ArrayList<>();
|
|
List<HousePriceOneDataVo> oneDatas = new ArrayList<>();
|
|
|
//将数据处理成单天的
|
|
//将数据处理成单天的
|
|
@@ -308,7 +340,7 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
/**
|
|
/**
|
|
|
* 获取该房型默认价格
|
|
* 获取该房型默认价格
|
|
|
*/
|
|
*/
|
|
|
- Double housePrice = houseService.queryPriceByHouseId(sadad);
|
|
|
|
|
|
|
+ Double housePrice = houseService.queryPriceByHouseId(roomId);
|
|
|
|
|
|
|
|
DailyPriceVo dpv = new DailyPriceVo();
|
|
DailyPriceVo dpv = new DailyPriceVo();
|
|
|
dpv.setList(new ArrayList<>());
|
|
dpv.setList(new ArrayList<>());
|