|
@@ -12,10 +12,10 @@ import com.happy.dao.UserVisitsDao;
|
|
|
import com.happy.dto.IPage;
|
|
import com.happy.dto.IPage;
|
|
|
import com.happy.dto.townshipCountDTO;
|
|
import com.happy.dto.townshipCountDTO;
|
|
|
import com.happy.service.*;
|
|
import com.happy.service.*;
|
|
|
-import com.happy.vo.HousePriceDataVo;
|
|
|
|
|
-import com.happy.vo.HousePriceOneDataVo;
|
|
|
|
|
|
|
+import com.happy.vo.*;
|
|
|
import com.opensymphony.xwork2.ActionSupport;
|
|
import com.opensymphony.xwork2.ActionSupport;
|
|
|
import net.sf.json.JSONObject;
|
|
import net.sf.json.JSONObject;
|
|
|
|
|
+import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.struts2.ServletActionContext;
|
|
import org.apache.struts2.ServletActionContext;
|
|
|
import org.apache.struts2.interceptor.ServletRequestAware;
|
|
import org.apache.struts2.interceptor.ServletRequestAware;
|
|
|
|
|
|
|
@@ -23,11 +23,13 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
import java.util.Comparator;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Optional;
|
|
import java.util.Optional;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 首页进去Action请求交互
|
|
* 首页进去Action请求交互
|
|
@@ -46,6 +48,8 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
@Resource
|
|
@Resource
|
|
|
public HotelService hotelService;
|
|
public HotelService hotelService;
|
|
|
@Resource
|
|
@Resource
|
|
|
|
|
+ public HouseService houseService;
|
|
|
|
|
+ @Resource
|
|
|
public FileService fileService;
|
|
public FileService fileService;
|
|
|
@Resource
|
|
@Resource
|
|
|
public AdminManagerService adminManagerService;
|
|
public AdminManagerService adminManagerService;
|
|
@@ -120,20 +124,73 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 进入首页,展示民宿数据列表
|
|
* 进入首页,展示民宿数据列表
|
|
|
* queryValue 查询字段
|
|
* queryValue 查询字段
|
|
|
* hotel_townshipId 所属乡镇
|
|
* hotel_townshipId 所属乡镇
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String homePage()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public String homePage() {
|
|
|
// 获取民宿列表
|
|
// 获取民宿列表
|
|
|
- IPage iPage = appHomePageService.getHotelList(queryValue, hotel_township,type,page,rows);
|
|
|
|
|
|
|
+ IPage<Hotel> iPage = appHomePageService.getHotelList(queryValue, hotel_township, type, page, rows);
|
|
|
|
|
+ List<Integer> managerIds = iPage.getPageList().stream().map(Hotel::getManagerId).collect(Collectors.toList());
|
|
|
|
|
+
|
|
|
|
|
+ //2023-09-22 A-jax 获取最低价
|
|
|
|
|
+ if(managerIds.size() > 0){
|
|
|
|
|
+ List<HotelPriceDataVo> prices = housePriceService.queryHotelPriceDatas(StringUtils.join(managerIds, ","), TimeExchange.getDateStr());
|
|
|
|
|
+
|
|
|
|
|
+ List<HotelPriceOneDataVo> oneDatas = new ArrayList<>();
|
|
|
|
|
+ //获取当天的
|
|
|
|
|
+ for (HotelPriceDataVo hp : prices) {
|
|
|
|
|
+ HotelPriceOneDataVo oneData = new HotelPriceOneDataVo();
|
|
|
|
|
+ oneData.setSetDate(TimeExchange.getDateStr());
|
|
|
|
|
+ oneData.setCreateDate(hp.getCreateDate());
|
|
|
|
|
+ oneData.setPrice(hp.getPrice());
|
|
|
|
|
+ oneData.setManagerId(hp.getManagerId());
|
|
|
|
|
+ oneDatas.add(oneData);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据房型ID处理重复的数据
|
|
|
|
|
+ */
|
|
|
|
|
+ List<HotelPriceOneDataVo> newOneDatas = new ArrayList<>();
|
|
|
|
|
+ if(oneDatas.size() > 0){
|
|
|
|
|
+ for (Integer managerId : managerIds) {
|
|
|
|
|
+ Optional<HotelPriceOneDataVo> one = oneDatas.stream().filter(e -> e.getManagerId().equals(managerId)).sorted(Comparator.comparing(HotelPriceOneDataVo::getCreateDate, Comparator.reverseOrder())).findFirst();
|
|
|
|
|
+ if (one != null && one.isPresent()) {
|
|
|
|
|
+ HotelPriceOneDataVo oneData = new HotelPriceOneDataVo();
|
|
|
|
|
+ oneData.setSetDate(one.get().getSetDate());
|
|
|
|
|
+ oneData.setCreateDate(one.get().getCreateDate());
|
|
|
|
|
+ oneData.setPrice(one.get().getPrice());
|
|
|
|
|
+ oneData.setManagerId(one.get().getManagerId());
|
|
|
|
|
+ newOneDatas.add(oneData);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取商家集合中最低房型价格
|
|
|
|
|
+ */
|
|
|
|
|
+ List<PriceHotelDataVo> mins = houseService.gethotelMinPrice(StringUtils.join(managerIds, ","));
|
|
|
|
|
+ DecimalFormat decimalFormat = new DecimalFormat("#####.##");
|
|
|
|
|
+ for (Hotel hotel: iPage.getPageList()) {
|
|
|
|
|
+ Optional<HotelPriceOneDataVo> one = newOneDatas.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
|
|
|
|
|
+ if(one != null && one.isPresent()){
|
|
|
|
|
+ hotel.setMin_price(decimalFormat.format(one.get().getPrice()));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ Optional<PriceHotelDataVo> min = mins.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
|
|
|
|
|
+ if(min != null && min.isPresent()){
|
|
|
|
|
+ hotel.setMin_price(decimalFormat.format(min.get().getPrice()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 用户访问量数据
|
|
// 用户访问量数据
|
|
|
userVisitsDao.add(userId);
|
|
userVisitsDao.add(userId);
|
|
|
- ResponseUtil.writeJsonIPage(ServletActionContext.getResponse(),iPage);
|
|
|
|
|
|
|
+ ResponseUtil.writeJsonIPage(ServletActionContext.getResponse(), iPage);
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -141,19 +198,19 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
* 用户点击收藏民宿
|
|
* 用户点击收藏民宿
|
|
|
* userId
|
|
* userId
|
|
|
* hotelId
|
|
* hotelId
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String collectHotel()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public String collectHotel() {
|
|
|
if (Func.checkNull(userId) || Func.checkNull(hotelId))
|
|
if (Func.checkNull(userId) || Func.checkNull(hotelId))
|
|
|
return null;
|
|
return null;
|
|
|
|
|
|
|
|
- Users users = userService.addhotelAndUsers(hotelId,userId, TempEnum.收藏);
|
|
|
|
|
|
|
+ Users users = userService.addhotelAndUsers(hotelId, userId, TempEnum.收藏);
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put(B.code,ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.data,users);
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.data, users);
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -161,19 +218,19 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
* 用户点击取消 收藏民宿
|
|
* 用户点击取消 收藏民宿
|
|
|
* userId 用户id
|
|
* userId 用户id
|
|
|
* hotelId 酒店id
|
|
* hotelId 酒店id
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String delCollectHotel()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public String delCollectHotel() {
|
|
|
if (Func.checkNull(userId) || Func.checkNull(hotelId))
|
|
if (Func.checkNull(userId) || Func.checkNull(hotelId))
|
|
|
return null;
|
|
return null;
|
|
|
|
|
|
|
|
- Users users = userService.delhotelAndUsers(hotelId,userId, TempEnum.收藏);
|
|
|
|
|
|
|
+ Users users = userService.delhotelAndUsers(hotelId, userId, TempEnum.收藏);
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
- jsonObject.put(B.code,ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.data,users);
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.data, users);
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -183,29 +240,29 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
* queryEndTime
|
|
* queryEndTime
|
|
|
* userId
|
|
* userId
|
|
|
* 通过酒店的id获取到房间信息
|
|
* 通过酒店的id获取到房间信息
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
public String getHouseByHotelId() throws ParseException {
|
|
public String getHouseByHotelId() throws ParseException {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
// 如果未赋值,则直接跳出
|
|
// 如果未赋值,则直接跳出
|
|
|
- if (Func.checkNull(hotelId) || Func.checkNull(queryStartTime) || Func.checkNull(queryEndTime))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (Func.checkNull(hotelId) || Func.checkNull(queryStartTime) || Func.checkNull(queryEndTime)) {
|
|
|
jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
- jsonObject.put(B.message,ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 使用天去查"yyyy/MM/dd"
|
|
// 使用天去查"yyyy/MM/dd"
|
|
|
String startDate = DateUtil.parseDateToStr((Func.parseDate(queryStartTime)), DateUtil.Time_Formatter_Day);
|
|
String startDate = DateUtil.parseDateToStr((Func.parseDate(queryStartTime)), DateUtil.Time_Formatter_Day);
|
|
|
- String endDate = DateUtil.parseDateToStr((Func.parseDate(queryEndTime)), DateUtil.Time_Formatter_Day);
|
|
|
|
|
|
|
+ String endDate = DateUtil.parseDateToStr((Func.parseDate(queryEndTime)), DateUtil.Time_Formatter_Day);
|
|
|
|
|
|
|
|
- Hotel hotel = appHomePageService.getHotelAndHouseByHotelId(hotelId,startDate, endDate);
|
|
|
|
|
|
|
+ Hotel hotel = appHomePageService.getHotelAndHouseByHotelId(hotelId, startDate, endDate);
|
|
|
hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotelId));
|
|
hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotelId));
|
|
|
|
|
|
|
|
// 添加是否已收藏的酒店
|
|
// 添加是否已收藏的酒店
|
|
|
if (!Func.checkNull(userId))
|
|
if (!Func.checkNull(userId))
|
|
|
- hotel=appHomePageService.assignCollect(userId, hotel);
|
|
|
|
|
|
|
+ hotel = appHomePageService.assignCollect(userId, hotel);
|
|
|
|
|
|
|
|
//region 2023-09-12 A-jax 添加房型均价:入住的每一天的价格之和 / 入住天数
|
|
//region 2023-09-12 A-jax 添加房型均价:入住的每一天的价格之和 / 入住天数
|
|
|
List<HousePriceDataVo> hprd = housePriceService.queryHousePriceDatas(hotel.getManagerId(), queryStartTime, TimeExchange.TimeDesD(queryEndTime, -1));
|
|
List<HousePriceDataVo> hprd = housePriceService.queryHousePriceDatas(hotel.getManagerId(), queryStartTime, TimeExchange.TimeDesD(queryEndTime, -1));
|
|
@@ -243,57 +300,53 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
dateStrs.add(date);
|
|
dateStrs.add(date);
|
|
|
}
|
|
}
|
|
|
List<House> houseList = hotel.getHouseList();
|
|
List<House> houseList = hotel.getHouseList();
|
|
|
- for (House houseData:houseList) {
|
|
|
|
|
|
|
+ for (House houseData : houseList) {
|
|
|
BigDecimal todayPrice = BigDecimal.ZERO;
|
|
BigDecimal todayPrice = BigDecimal.ZERO;
|
|
|
- for (String dateStr:dateStrs){
|
|
|
|
|
- Optional<HousePriceOneDataVo> oneData = oneDatas.stream().filter(e -> e.getHouseId().toString().equals(houseData.getId()) && e.getSetDate().equals(dateStr)).sorted(Comparator.comparing(HousePriceOneDataVo::getCreateDate,Comparator.reverseOrder())).findFirst();
|
|
|
|
|
- if(oneData != null && oneData.isPresent()){
|
|
|
|
|
|
|
+ for (String dateStr : dateStrs) {
|
|
|
|
|
+ Optional<HousePriceOneDataVo> oneData = oneDatas.stream().filter(e -> e.getHouseId().toString().equals(houseData.getId()) && e.getSetDate().equals(dateStr)).sorted(Comparator.comparing(HousePriceOneDataVo::getCreateDate, Comparator.reverseOrder())).findFirst();
|
|
|
|
|
+ if (oneData != null && oneData.isPresent()) {
|
|
|
todayPrice = todayPrice.add(BigDecimal.valueOf(oneData.get().getPrice()));
|
|
todayPrice = todayPrice.add(BigDecimal.valueOf(oneData.get().getPrice()));
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
todayPrice = todayPrice.add(BigDecimal.valueOf(houseData.getPrice()));
|
|
todayPrice = todayPrice.add(BigDecimal.valueOf(houseData.getPrice()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
houseData.setPrice(todayPrice.doubleValue());
|
|
houseData.setPrice(todayPrice.doubleValue());
|
|
|
- if(dateStrs.size() > 0){
|
|
|
|
|
- houseData.setPrice(houseData.getPrice() == 0.0 ? 0.0 : (new BigDecimal(houseData.getPrice()).divide(new BigDecimal(dateStrs.size())).setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue()));
|
|
|
|
|
|
|
+ if (dateStrs.size() > 0) {
|
|
|
|
|
+ houseData.setPrice(houseData.getPrice() == 0.0 ? 0.0 : (new BigDecimal(houseData.getPrice()).divide(new BigDecimal(dateStrs.size())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
//endregion
|
|
//endregion
|
|
|
|
|
|
|
|
// 通过时间区间查询房间信息,并带好是否有房标识给前台
|
|
// 通过时间区间查询房间信息,并带好是否有房标识给前台
|
|
|
- jsonObject.put(B.code,ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.data,ResultUtil.ok(hotel));
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.data, ResultUtil.ok(hotel));
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 通过酒店的id获取到酒店详细信息
|
|
* 通过酒店的id获取到酒店详细信息
|
|
|
* hotelId
|
|
* hotelId
|
|
|
* userId
|
|
* userId
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String getHotelInfoByHotelId()
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public String getHotelInfoByHotelId() {
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
// 如果未赋值,则直接跳出
|
|
// 如果未赋值,则直接跳出
|
|
|
- if (Func.checkNull(hotelId))
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (Func.checkNull(hotelId)) {
|
|
|
jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
- jsonObject.put(B.message,ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.message, ResultStatusCode.BAD_REQUEST.getMsg());
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Hotel hotel = hotelService.getById(Func.parseInt(hotelId));
|
|
Hotel hotel = hotelService.getById(Func.parseInt(hotelId));
|
|
|
- if (hotel == null)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ if (hotel == null) {
|
|
|
jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
jsonObject.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
|
|
|
- jsonObject.put(B.message,"无法查询到当前酒店信息");
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.message, "无法查询到当前酒店信息");
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotelId));
|
|
hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotelId));
|
|
@@ -302,25 +355,25 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
if (!Func.checkNull(userId))
|
|
if (!Func.checkNull(userId))
|
|
|
appHomePageService.assignCollect(userId, hotel);
|
|
appHomePageService.assignCollect(userId, hotel);
|
|
|
|
|
|
|
|
- jsonObject.put(B.code,ResultStatusCode.OK.getStatus());
|
|
|
|
|
- jsonObject.put(B.data,hotel);
|
|
|
|
|
- ResponseUtil.writeJson(ServletActionContext.getResponse(),jsonObject.toString());
|
|
|
|
|
|
|
+ jsonObject.put(B.code, ResultStatusCode.OK.getStatus());
|
|
|
|
|
+ jsonObject.put(B.data, hotel);
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
/**
|
|
/**
|
|
|
* 描述:获取各乡俗民宿级别数量
|
|
* 描述:获取各乡俗民宿级别数量
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String getTownshipCount(){
|
|
|
|
|
|
|
+ public String getTownshipCount() {
|
|
|
JSONObject resultjson = new JSONObject();
|
|
JSONObject resultjson = new JSONObject();
|
|
|
List<townshipCountDTO> list = adminManagerService.getTownshipCount();
|
|
List<townshipCountDTO> list = adminManagerService.getTownshipCount();
|
|
|
- if (list!=null){
|
|
|
|
|
|
|
+ if (list != null) {
|
|
|
resultjson.put("message", "返回成功");
|
|
resultjson.put("message", "返回成功");
|
|
|
resultjson.put("code", 200);
|
|
resultjson.put("code", 200);
|
|
|
- resultjson.put("data",list);
|
|
|
|
|
|
|
+ resultjson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
@@ -332,15 +385,16 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 描述:获取各乡镇剩余房数
|
|
* 描述:获取各乡镇剩余房数
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public String getResidueCount(){
|
|
|
|
|
|
|
+ public String getResidueCount() {
|
|
|
JSONObject resultjson = new JSONObject();
|
|
JSONObject resultjson = new JSONObject();
|
|
|
List<townshipCountDTO> list = adminManagerService.getResidueCount();
|
|
List<townshipCountDTO> list = adminManagerService.getResidueCount();
|
|
|
- if (list!=null){
|
|
|
|
|
|
|
+ if (list != null) {
|
|
|
resultjson.put("message", "返回成功");
|
|
resultjson.put("message", "返回成功");
|
|
|
resultjson.put("code", 200);
|
|
resultjson.put("code", 200);
|
|
|
- resultjson.put("data",list);
|
|
|
|
|
|
|
+ resultjson.put("data", list);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|