|
@@ -171,44 +171,25 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
if (startTime == null) {
|
|
if (startTime == 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());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ int days = TimeExchange.getMonthDays(startTime, Integer.valueOf(startTime.substring(5, 7)));
|
|
|
|
|
+ String[] months = TimeExchange.getCurrentMonthTimeFrame(startTime);
|
|
|
|
|
+ String startDate = months[0];
|
|
|
|
|
+ String endDate = months[1];
|
|
|
List<HousePriceResultVo> result = new ArrayList<>();
|
|
List<HousePriceResultVo> result = new ArrayList<>();
|
|
|
List<String> dateStrs = new ArrayList<>();
|
|
List<String> dateStrs = new ArrayList<>();
|
|
|
- String DateNow = TimeExchange.DateToString(new Date(), "yyyy-MM-dd");
|
|
|
|
|
- //离店时间为空的话 则拿入店时间的前三天和后七天数据
|
|
|
|
|
- boolean IsDurStart = TimeExchange.CompareDate(DateNow, startTime, "yyyy-MM-dd");
|
|
|
|
|
- if (IsDurStart) {
|
|
|
|
|
- for (int i = 1; i <= 3; i++) {
|
|
|
|
|
- String date = TimeExchange.TimeDesD(startTime, -i);
|
|
|
|
|
- if (date.equals(DateNow)) {
|
|
|
|
|
- dateStrs.add(date);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- dateStrs.add(date);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- dateStrs.add(startTime);
|
|
|
|
|
-
|
|
|
|
|
- int dateNum = 7;
|
|
|
|
|
- if (endTime != null) {
|
|
|
|
|
- //后七天
|
|
|
|
|
- dateNum = TimeExchange.daysBetween(startTime, endTime);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- for (int i = 1; i <= dateNum; i++) {
|
|
|
|
|
|
|
+ for (int i = 0; i < days; i++) {
|
|
|
String date = TimeExchange.TimeDesD(startTime, i);
|
|
String date = TimeExchange.TimeDesD(startTime, i);
|
|
|
dateStrs.add(date);
|
|
dateStrs.add(date);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
Collections.sort(dateStrs);
|
|
Collections.sort(dateStrs);
|
|
|
|
|
|
|
|
- List<HousePriceDataVo> hprd = housePriceService.queryHousePriceDatas(merchantId, dateStrs.get(0), dateStrs.get(dateStrs.size() - 1));
|
|
|
|
|
|
|
+ List<HousePriceDataVo> hprd = housePriceService.queryHousePriceDatas(merchantId, startDate, endDate);
|
|
|
List<HousePriceOneDataVo> oneDatas = new ArrayList<>();
|
|
List<HousePriceOneDataVo> oneDatas = new ArrayList<>();
|
|
|
//将数据处理成单天的
|
|
//将数据处理成单天的
|
|
|
for (HousePriceDataVo hp : hprd) {
|
|
for (HousePriceDataVo hp : hprd) {
|
|
@@ -262,9 +243,9 @@ public class HousePriceAction extends BaseController implements ModelDriven<Hous
|
|
|
List<HousePriceOneDataVo> priceDatas = oneDatas.stream().filter(e -> e.getSetDate().equals(str)).sorted(Comparator.comparing(HousePriceOneDataVo::getPrice)).collect(Collectors.toList());
|
|
List<HousePriceOneDataVo> priceDatas = oneDatas.stream().filter(e -> e.getSetDate().equals(str)).sorted(Comparator.comparing(HousePriceOneDataVo::getPrice)).collect(Collectors.toList());
|
|
|
|
|
|
|
|
if (priceDatas.size() > 0) {
|
|
if (priceDatas.size() > 0) {
|
|
|
- data.setTopinfo("¥" + priceDatas.get(0).getPrice());
|
|
|
|
|
|
|
+ data.setTopinfo("¥" + priceDatas.get(0).getPrice() + "起");
|
|
|
} else {
|
|
} else {
|
|
|
- data.setTopinfo("¥" + minPrice);
|
|
|
|
|
|
|
+ data.setTopinfo("¥" + minPrice + "起");
|
|
|
}
|
|
}
|
|
|
result.add(data);
|
|
result.add(data);
|
|
|
}
|
|
}
|