夏文涛 před 2 roky
rodič
revize
605fb48294
31 změnil soubory, kde provedl 532 přidání a 202 odebrání
  1. 4 4
      mhotel/src/com/happy/Model/Hotel.java
  2. 32 10
      mhotel/src/com/happy/action/AppHomePageAction.java
  3. 1 1
      mhotel/src/com/happy/action/HouseNumberStatusAction.java
  4. 23 20
      mhotel/src/com/happy/action/IDCAction.java
  5. 7 5
      mhotel/src/com/happy/action/adminManagerAction.java
  6. 10 7
      mhotel/src/com/happy/action/bookAction.java
  7. 2 1
      mhotel/src/com/happy/action/bookComplainAction.java
  8. 66 33
      mhotel/src/com/happy/action/houseAction.java
  9. 9 0
      mhotel/src/com/happy/action/uploadAction.java
  10. 14 0
      mhotel/src/com/happy/dao/AdminManagerDao.java
  11. 8 1
      mhotel/src/com/happy/dao/HouseDao.java
  12. 2 5
      mhotel/src/com/happy/dao/IDCDao.java
  13. 99 52
      mhotel/src/com/happy/dao/impl/AdminManagerImplDao.java
  14. 15 1
      mhotel/src/com/happy/dao/impl/HouseImplDao.java
  15. 8 9
      mhotel/src/com/happy/dao/impl/IDCImplDao.java
  16. 2 2
      mhotel/src/com/happy/dao/impl/WorkflowImplDao.java
  17. 91 0
      mhotel/src/com/happy/dto/HouseDto.java
  18. 3 34
      mhotel/src/com/happy/dto/IDCRankEto.java
  19. 17 0
      mhotel/src/com/happy/dto/IDCSaleEto.java
  20. 35 0
      mhotel/src/com/happy/dto/ManageHouseDto.java
  21. 35 0
      mhotel/src/com/happy/dto/OwnerHouseDto.java
  22. 1 1
      mhotel/src/com/happy/dto/townshipCountDTO.java
  23. 13 0
      mhotel/src/com/happy/service/AdminManagerService.java
  24. 8 1
      mhotel/src/com/happy/service/HouseService.java
  25. 2 5
      mhotel/src/com/happy/service/IDCService.java
  26. 12 0
      mhotel/src/com/happy/service/impl/AdminManagerImplService.java
  27. 2 2
      mhotel/src/com/happy/service/impl/AppBookImplService.java
  28. 1 1
      mhotel/src/com/happy/service/impl/BookingCommentImplService.java
  29. 6 1
      mhotel/src/com/happy/service/impl/HouseImplService.java
  30. 2 1
      mhotel/src/com/happy/service/impl/HousePriceServiceImpl.java
  31. 2 5
      mhotel/src/com/happy/service/impl/IDCImplService.java

+ 4 - 4
mhotel/src/com/happy/Model/Hotel.java

@@ -6,9 +6,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
 /**
 /**
- * @Description  
+ * @Description
  * @Author  raojiaolong
  * @Author  raojiaolong
- * @String 2023-07-29 
+ * @String 2023-07-29
  */
  */
 
 
 public class Hotel {
 public class Hotel {
@@ -85,12 +85,12 @@ public class Hotel {
 	private String leaveTime;
 	private String leaveTime;
 
 
 	/**
 	/**
-	 * 客房数
+	 * 客房剩余
 	 */
 	 */
 	private Integer roomNumber;
 	private Integer roomNumber;
 
 
 	/**
 	/**
-	 * 客房数(实时计算当前民宿的房间数量)
+	 * 客房总数
 	 */
 	 */
 	private String room_number_calc;
 	private String room_number_calc;
 	/**
 	/**

+ 32 - 10
mhotel/src/com/happy/action/AppHomePageAction.java

@@ -10,6 +10,8 @@ import com.happy.Until.Enum.TempEnum;
 import com.happy.constant.ResultStatusCode;
 import com.happy.constant.ResultStatusCode;
 import com.happy.dao.UserVisitsDao;
 import com.happy.dao.UserVisitsDao;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
+import com.happy.dto.ManageHouseDto;
+import com.happy.dto.OwnerHouseDto;
 import com.happy.dto.townshipCountDTO;
 import com.happy.dto.townshipCountDTO;
 import com.happy.service.*;
 import com.happy.service.*;
 import com.happy.vo.*;
 import com.happy.vo.*;
@@ -134,11 +136,11 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
     public String homePage() {
     public String homePage() {
         // 获取民宿列表
         // 获取民宿列表
         IPage<Hotel> iPage = appHomePageService.getHotelList(queryValue, hotel_township, type, page, rows);
         IPage<Hotel> iPage = appHomePageService.getHotelList(queryValue, hotel_township, type, page, rows);
-        if(iPage.getPageList() != null && iPage.getPageList().size() > 0){
+        if (iPage.getPageList() != null && iPage.getPageList().size() > 0) {
             List<Integer> managerIds = iPage.getPageList().stream().map(Hotel::getManagerId).collect(Collectors.toList());
             List<Integer> managerIds = iPage.getPageList().stream().map(Hotel::getManagerId).collect(Collectors.toList());
 
 
             //2023-09-22 A-jax 获取最低价
             //2023-09-22 A-jax 获取最低价
-            if(managerIds.size() > 0){
+            if (managerIds.size() > 0) {
                 List<HotelPriceDataVo> prices = housePriceService.queryHotelPriceDatas(StringUtils.join(managerIds, ","), TimeExchange.getDateStr());
                 List<HotelPriceDataVo> prices = housePriceService.queryHotelPriceDatas(StringUtils.join(managerIds, ","), TimeExchange.getDateStr());
 
 
                 List<HotelPriceOneDataVo> oneDatas = new ArrayList<>();
                 List<HotelPriceOneDataVo> oneDatas = new ArrayList<>();
@@ -156,7 +158,7 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
                  * 根据房型ID处理重复的数据
                  * 根据房型ID处理重复的数据
                  */
                  */
                 List<HotelPriceOneDataVo> newOneDatas = new ArrayList<>();
                 List<HotelPriceOneDataVo> newOneDatas = new ArrayList<>();
-                if(oneDatas.size() > 0){
+                if (oneDatas.size() > 0) {
                     for (Integer managerId : managerIds) {
                     for (Integer managerId : managerIds) {
                         Optional<HotelPriceOneDataVo> one = oneDatas.stream().filter(e -> e.getManagerId().equals(managerId)).sorted(Comparator.comparing(HotelPriceOneDataVo::getCreateDate, Comparator.reverseOrder())).findFirst();
                         Optional<HotelPriceOneDataVo> one = oneDatas.stream().filter(e -> e.getManagerId().equals(managerId)).sorted(Comparator.comparing(HotelPriceOneDataVo::getCreateDate, Comparator.reverseOrder())).findFirst();
                         if (one != null && one.isPresent()) {
                         if (one != null && one.isPresent()) {
@@ -175,13 +177,23 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
                  */
                  */
                 List<PriceHotelDataVo> mins = houseService.gethotelMinPrice(StringUtils.join(managerIds, ","));
                 List<PriceHotelDataVo> mins = houseService.gethotelMinPrice(StringUtils.join(managerIds, ","));
                 DecimalFormat decimalFormat = new DecimalFormat("#####.##");
                 DecimalFormat decimalFormat = new DecimalFormat("#####.##");
-                for (Hotel hotel: iPage.getPageList()) {
+                for (Hotel hotel : iPage.getPageList()) {
+                    //2023-11-09 A-jax 获取剩余房间数
+                    List<OwnerHouseDto> result = adminManagerService.getTotalManageCount(hotel_township, type);
+                    if(result != null && result.size() > 0){
+                        Optional<OwnerHouseDto> mhd = result.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
+                        if(mhd != null && mhd.isPresent()){
+                            hotel.setRoomNumber(mhd.get().getResidueHouseNum());
+                            hotel.setRoom_number_calc(mhd.get().getTotalHouseNum().toString());
+                        }
+                    }
+
                     Optional<HotelPriceOneDataVo> one = newOneDatas.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
                     Optional<HotelPriceOneDataVo> one = newOneDatas.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
-                    if(one != null && one.isPresent()){
+                    if (one != null && one.isPresent()) {
                         hotel.setMin_price(decimalFormat.format(one.get().getPrice()));
                         hotel.setMin_price(decimalFormat.format(one.get().getPrice()));
-                    }else{
+                    } else {
                         Optional<PriceHotelDataVo> min = mins.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
                         Optional<PriceHotelDataVo> min = mins.stream().filter(e -> e.getManagerId().equals(hotel.getManagerId())).findFirst();
-                        if(min != null && min.isPresent()){
+                        if (min != null && min.isPresent()) {
                             hotel.setMin_price(decimalFormat.format(min.get().getPrice()));
                             hotel.setMin_price(decimalFormat.format(min.get().getPrice()));
                         }
                         }
                     }
                     }
@@ -260,7 +272,7 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
         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(hotel.getManagerId()+""));
+        hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotel.getManagerId() + ""));
 
 
         // 添加是否已收藏的酒店
         // 添加是否已收藏的酒店
         if (!Func.checkNull(userId))
         if (!Func.checkNull(userId))
@@ -315,7 +327,7 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
             houseData.setPrice(todayPrice.doubleValue());
             houseData.setPrice(todayPrice.doubleValue());
             if (dateStrs.size() > 0) {
             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()));
 //                houseData.setPrice(houseData.getPrice() == 0.0 ? 0.0 : (new BigDecimal(houseData.getPrice()).divide(new BigDecimal(dateStrs.size())).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()));
-                houseData.setPrice(houseData.getPrice() == 0.0 ? 0.0 : (new BigDecimal(houseData.getPrice()).divide(new BigDecimal(dateStrs.size()),2, BigDecimal.ROUND_HALF_UP).doubleValue()));
+                houseData.setPrice(houseData.getPrice() == 0.0 ? 0.0 : (new BigDecimal(houseData.getPrice()).divide(new BigDecimal(dateStrs.size()), 2, BigDecimal.ROUND_HALF_UP).doubleValue()));
             }
             }
         }
         }
         //endregion
         //endregion
@@ -352,7 +364,7 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
             ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
             ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
             return null;
             return null;
         }
         }
-        hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotel.getManagerId()+""));
+        hotel.setHotelFileInfoList(fileService.queryListByLinkId(hotel.getManagerId() + ""));
 
 
         // 添加是否已收藏的酒店
         // 添加是否已收藏的酒店
         if (!Func.checkNull(userId))
         if (!Func.checkNull(userId))
@@ -394,7 +406,17 @@ public class AppHomePageAction extends ActionSupport implements ServletRequestAw
     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) {
+            List<ManageHouseDto> totalCounts = adminManagerService.getTotalHouseCount();
+
+            for (townshipCountDTO data : list) {
+                Optional<ManageHouseDto> totalCount = totalCounts.stream().filter(e -> e.getName().equals(data.getName())).findFirst();
+                if(totalCount != null && totalCount.isPresent()){
+                    data.setSumNumber(totalCount.get().totalHouseNum);
+                    data.setResidueNumber(totalCount.get().getResidueHouseNum());
+                }
+            }
             resultjson.put("message", "返回成功");
             resultjson.put("message", "返回成功");
             resultjson.put("code", 200);
             resultjson.put("code", 200);
             resultjson.put("data", list);
             resultjson.put("data", list);

+ 1 - 1
mhotel/src/com/happy/action/HouseNumberStatusAction.java

@@ -131,7 +131,7 @@ public class HouseNumberStatusAction extends BaseController implements ModelDriv
                 put("code", 500);
                 put("code", 500);
             }}.toString());
             }}.toString());
         }
         }
-        if(postDataObj.getCreateId() == null){
+        if(postDataObj.getStatus() == 2 && postDataObj.getCreateId() == null){
             ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
             ResUtil.writeJson(ServletActionContext.getResponse(), new JSONObject() {{
                 put("message", "关房类型不能为空");
                 put("message", "关房类型不能为空");
                 put("code", 500);
                 put("code", 500);

+ 23 - 20
mhotel/src/com/happy/action/IDCAction.java

@@ -6,10 +6,7 @@ import com.happy.Until.Enum.VisitsEnum;
 import com.happy.Until.Func;
 import com.happy.Until.Func;
 import com.happy.Until.ResUtil;
 import com.happy.Until.ResUtil;
 import com.happy.dao.UserVisitsDao;
 import com.happy.dao.UserVisitsDao;
-import com.happy.dto.IDCBookStatusEto;
-import com.happy.dto.IDCHotelEto;
-import com.happy.dto.IDCRankEto;
-import com.happy.dto.IDCSum;
+import com.happy.dto.*;
 import com.happy.service.IDCService;
 import com.happy.service.IDCService;
 import com.opensymphony.xwork2.ActionSupport;
 import com.opensymphony.xwork2.ActionSupport;
 import net.sf.json.JSONObject;
 import net.sf.json.JSONObject;
@@ -107,21 +104,24 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
         StringBuilder sqlx = new StringBuilder("");
         StringBuilder sqlx = new StringBuilder("");
         if(type==1){
         if(type==1){
-            sqlx.append("AND DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')");
+            sqlx.append("and DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')");
         }
         }
         if(type==2){
         if(type==2){
-            sqlx.append("AND DATE_FORMAT(pay_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
+            sqlx.append("and DATE_FORMAT(pay_time,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')");
         }
         }
         if(type==3){
         if(type==3){
-            sqlx.append("AND DATE_FORMAT(pay_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
+            sqlx.append("and DATE_FORMAT(pay_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
         }
         }
         List<IDCRankEto> list = idcService.getRankBookNumData(sqlx.toString());
         List<IDCRankEto> list = idcService.getRankBookNumData(sqlx.toString());
-//        if (list == null) {
-//            resultJson.put("message", "数据为空");
-//            resultJson.put("code", 500);
-//            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
-//            return null;
-//        }
+
+        if(list != null){
+            int i = 1;
+            for (IDCRankEto data:list) {
+                data.setRank(i);
+                i++;
+            }
+        }
+
         resultJson.put("message", "查询成功");
         resultJson.put("message", "查询成功");
         resultJson.put("code", 200);
         resultJson.put("code", 200);
         resultJson.put("data", list == null ? new ArrayList<>() : list);
         resultJson.put("data", list == null ? new ArrayList<>() : list);
@@ -145,13 +145,16 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
         if(type==3){
         if(type==3){
             sqlx.append("AND DATE_FORMAT(pay_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
             sqlx.append("AND DATE_FORMAT(pay_time,'%Y') = DATE_FORMAT(NOW(),'%Y')");
         }
         }
-        List<IDCRankEto> list = idcService.getRankSalesAmountData(sqlx.toString());
-//        if (list == null) {
-//            resultJson.put("message", "数据为空");
-//            resultJson.put("code", 500);
-//            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
-//            return null;
-//        }
+        List<IDCSaleEto> list = idcService.getRankSalesAmountData(sqlx.toString());
+
+        if(list != null){
+            int i = 1;
+            for (IDCSaleEto data:list) {
+                data.setRank(i);
+                i++;
+            }
+        }
+
         resultJson.put("message", "查询成功");
         resultJson.put("message", "查询成功");
         resultJson.put("code", 200);
         resultJson.put("code", 200);
         resultJson.put("data", list == null ? new ArrayList<>() : list);
         resultJson.put("data", list == null ? new ArrayList<>() : list);

+ 7 - 5
mhotel/src/com/happy/action/adminManagerAction.java

@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.File;
 import java.util.List;
 import java.util.List;
+import java.util.UUID;
 
 
 public class adminManagerAction extends ActionSupport implements ServletRequestAware{
 public class adminManagerAction extends ActionSupport implements ServletRequestAware{
 
 
@@ -175,13 +176,14 @@ public class adminManagerAction extends ActionSupport implements ServletRequestA
             List<FileInfo> fileInfoList = JSONArray.parseArray(fileListJson, FileInfo.class);
             List<FileInfo> fileInfoList = JSONArray.parseArray(fileListJson, FileInfo.class);
             if(fileInfoList!=null && fileInfoList.size()>0){
             if(fileInfoList!=null && fileInfoList.size()>0){
                 for(FileInfo file : fileInfoList){
                 for(FileInfo file : fileInfoList){
-                    FileInfo fileInfo = fileService.getById(file.getId());
                     file.setLinkId(String.valueOf(admin.getId()));
                     file.setLinkId(String.valueOf(admin.getId()));
-                    if(fileInfo==null){
-                        fileService.insertFile(file);
-                    }else{
-                        fileService.updateFile(file);
+                    file.setId(String.valueOf(UUID.randomUUID()));
+                    int lastSlashIndex = file.getUrl().lastIndexOf("/");
+                    if(lastSlashIndex >= 0){
+                        String result = file.getUrl().substring(lastSlashIndex + 1);
+                        file.setName(result);
                     }
                     }
+                    fileService.insertFile(file);
                 }
                 }
             }
             }
             int m = adminManagerService.insertAdmin(admin);
             int m = adminManagerService.insertAdmin(admin);

+ 10 - 7
mhotel/src/com/happy/action/bookAction.java

@@ -3,6 +3,7 @@ package com.happy.action;
 import com.baidubce.model.User;
 import com.baidubce.model.User;
 import com.happy.Model.*;
 import com.happy.Model.*;
 import com.happy.Model.weixin.Users;
 import com.happy.Model.weixin.Users;
+import com.happy.Model.weixin.WeiXinUtil;
 import com.happy.Until.*;
 import com.happy.Until.*;
 import com.happy.Until.Enum.TempEnum;
 import com.happy.Until.Enum.TempEnum;
 import com.happy.Until.Excel.toExcel;
 import com.happy.Until.Excel.toExcel;
@@ -467,7 +468,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             // 导出文件
             // 导出文件
             new toExcel().book(vectorsList, path + filePathName,
             new toExcel().book(vectorsList, path + filePathName,
                     "sheet1", columnName);
                     "sheet1", columnName);
-            String url = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+            String url = WeiXinUtil.ip_h;//"https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("code", 200);
             resultJson.put("code", 200);
             resultJson.put("message", "导出成功");
             resultJson.put("message", "导出成功");
@@ -583,7 +584,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
             s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
         }
         }
 
 
-        List<Booking> list = bookService.queryList(s1.toString()); // 查询列表
+        List<Booking> list = bookService.queryList(s1.toString() + " order by check_out_time desc"); // 查询列表
         if(list==null){
         if(list==null){
             resultJson.put("code", 500);
             resultJson.put("code", 500);
             resultJson.put("message", "无数据无法导出");
             resultJson.put("message", "无数据无法导出");
@@ -598,7 +599,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             columnValue.add(book.getUserPhone());
             columnValue.add(book.getUserPhone());
             columnValue.add(book.getHouseOrderNumber());
             columnValue.add(book.getHouseOrderNumber());
             columnValue.add(book.getPayAccount());
             columnValue.add(book.getPayAccount());
-            columnValue.add(book.getPayTime());
+            columnValue.add(book.getCheckOutTime());
             vectorsList.add(columnValue);
             vectorsList.add(columnValue);
         }
         }
         // 项目路径地址
         // 项目路径地址
@@ -618,7 +619,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             // 导出文件
             // 导出文件
             new toExcel().book(vectorsList, path + filePathName,
             new toExcel().book(vectorsList, path + filePathName,
                     "sheet1", columnName);
                     "sheet1", columnName);
-            String url = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+            String url = WeiXinUtil.ip_h;//"https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("code", 200);
             resultJson.put("code", 200);
             resultJson.put("message", "导出成功");
             resultJson.put("message", "导出成功");
@@ -658,7 +659,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
             s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
         }
         }
 
 
-        List<Booking> list = bookService.queryList(s1.toString()); // 查询列表
+        List<Booking> list = bookService.queryList(s1.toString() + " order by check_out_time desc"); // 查询列表
         List<HotelDict> hotelDicts = hotelDictService.queryList("and code = 10");
         List<HotelDict> hotelDicts = hotelDictService.queryList("and code = 10");
         Map<Integer, String> dictMap = null;
         Map<Integer, String> dictMap = null;
         if(hotelDicts!=null && hotelDicts.size()>0){
         if(hotelDicts!=null && hotelDicts.size()>0){
@@ -682,13 +683,15 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             }
             }
             columnValue.add(book.getOrderNum());//订单号
             columnValue.add(book.getOrderNum());//订单号
             columnValue.add(book.getPayAccount());//订单金额
             columnValue.add(book.getPayAccount());//订单金额
-            columnValue.add(book.getPayTime());//退房时间
+            columnValue.add(book.getCheckOutTime());//退房时间
             vectorsList.add(columnValue);
             vectorsList.add(columnValue);
         }
         }
         // 项目路径地址
         // 项目路径地址
         String path = request.getSession().getServletContext()
         String path = request.getSession().getServletContext()
                 .getRealPath("/download/");// File.separator
                 .getRealPath("/download/");// File.separator
 
 
+        System.out.println("导出接口:"+path);
+
         try{
         try{
             Vector columnName = new Vector();
             Vector columnName = new Vector();
             columnName.add("所属乡镇");
             columnName.add("所属乡镇");
@@ -701,7 +704,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
             // 导出文件
             // 导出文件
             new toExcel().book(vectorsList, path + filePathName,
             new toExcel().book(vectorsList, path + filePathName,
                     "sheet1", columnName);
                     "sheet1", columnName);
-            String url = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+            String url = WeiXinUtil.ip_h;//"https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("code", 200);
             resultJson.put("code", 200);
             resultJson.put("message", "导出成功");
             resultJson.put("message", "导出成功");

+ 2 - 1
mhotel/src/com/happy/action/bookComplainAction.java

@@ -4,6 +4,7 @@ import com.happy.Model.Booking;
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.BookingComplaint;
 import com.happy.Model.Hotel;
 import com.happy.Model.Hotel;
 import com.happy.Model.House;
 import com.happy.Model.House;
+import com.happy.Model.weixin.WeiXinUtil;
 import com.happy.Until.Excel.toExcel;
 import com.happy.Until.Excel.toExcel;
 import com.happy.Until.ResUtil;
 import com.happy.Until.ResUtil;
 import com.happy.Until.ResponseUtil;
 import com.happy.Until.ResponseUtil;
@@ -157,7 +158,7 @@ public class bookComplainAction extends BaseController implements ServletRequest
             // 导出文件
             // 导出文件
             new toExcel().book(vectorsList, path + filePathName,
             new toExcel().book(vectorsList, path + filePathName,
                     "sheet1", columnName);
                     "sheet1", columnName);
-            String url = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+            String url = WeiXinUtil.ip_h;//"https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("downurl", url + "/download/" + filePathName);
             resultJson.put("code", 200);
             resultJson.put("code", 200);
             resultJson.put("message", "导出成功");
             resultJson.put("message", "导出成功");

+ 66 - 33
mhotel/src/com/happy/action/houseAction.java

@@ -2,14 +2,18 @@ package com.happy.action;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.google.gson.Gson;
 import com.google.gson.Gson;
+import com.alibaba.fastjson.JSONObject;
 import com.google.gson.reflect.TypeToken;
 import com.google.gson.reflect.TypeToken;
 import com.happy.Model.*;
 import com.happy.Model.*;
 import com.happy.Until.*;
 import com.happy.Until.*;
+import com.happy.common.controller.BaseController;
+import com.happy.dto.HouseDto;
+import com.happy.dto.HouseNumberStatusDto;
 import com.happy.dto.HouseSumEto;
 import com.happy.dto.HouseSumEto;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 import com.happy.service.*;
 import com.happy.service.*;
 import com.opensymphony.xwork2.ActionSupport;
 import com.opensymphony.xwork2.ActionSupport;
-import net.sf.json.JSONObject;
+import com.opensymphony.xwork2.ModelDriven;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.ServletActionContext;
 import org.apache.struts2.interceptor.ServletRequestAware;
 import org.apache.struts2.interceptor.ServletRequestAware;
 
 
@@ -19,12 +23,15 @@ import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
 import java.util.List;
 import java.util.List;
-import java.util.Objects;
 
 
-public class houseAction extends ActionSupport implements ServletRequestAware {
+public class houseAction extends BaseController implements ModelDriven<HouseDto> {
 
 
-    private HttpServletRequest request;
-    public HttpServletResponse response;
+    private final HouseDto houseDto = new HouseDto();
+
+    @Override
+    public HouseDto getModel() {
+        return houseDto;
+    }
 
 
     @Resource
     @Resource
     public HouseService houseService;
     public HouseService houseService;
@@ -37,11 +44,6 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
     @Resource
     @Resource
     public HouseNumberService houseNumberService;
     public HouseNumberService houseNumberService;
 
 
-    public Integer id;
-    public Integer managerId;
-    public String hName;//房型名称
-    public int page; // 当前页
-    public int rows;// 每页显示的行数rows
     public String orderTime;//住房时间
     public String orderTime;//住房时间
 
 
     public String fileListJson;
     public String fileListJson;
@@ -73,28 +75,53 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
      */
      */
     public String insterHouser(){
     public String insterHouser(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
-        Gson gson = new Gson();
-        com.alibaba.fastjson.JSONObject json = GetHttpParam.getRequestParameters(request);
-        if (json == null) {
+        if (houseDto == null) {
             resultJson.put("message", "请传入参数");
             resultJson.put("message", "请传入参数");
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             return null;
             return null;
         }
         }
-        House house = null;
+        House house = new House();
         try {
         try {
-            house = gson.fromJson(json.toString(), new TypeToken<House>() {}.getType());
+            house.setManagerId(houseDto.getManagerId());
+            house.sethName(houseDto.getHName());
+            house.sethAreas(houseDto.getHAreas());
+            house.setPrice(houseDto.getPrice());
+            house.setNumber(houseDto.getNumber());
+            house.sethConfig(houseDto.getHConfig());
+            house.setFileInfoList(houseDto.getFileInfoList());
+            house.setHouseNumbers(houseDto.getHouseNumbers());
+            house.setStatus(houseDto.getStatus());
+
             if (house == null) {
             if (house == null) {
                 resultJson.put("message", "数据为空");
                 resultJson.put("message", "数据为空");
                 resultJson.put("code", 500);
                 resultJson.put("code", 500);
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                 return null;
                 return null;
             }
             }
+
             if (house.getManagerId()==null || house.gethName()==null || house.getPrice()==null || house.getNumber()==null || house.gethAreas()==null){
             if (house.getManagerId()==null || house.gethName()==null || house.getPrice()==null || house.getNumber()==null || house.gethAreas()==null){
                 resultJson.put("message", "各参数不能为空");
                 resultJson.put("message", "各参数不能为空");
                 resultJson.put("code", 500);
                 resultJson.put("code", 500);
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                 ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
                 return null;
                 return null;
             }
             }
+            if(houseNumber == null ){
+                resultJson.put("message", "房间号不能为空");
+                resultJson.put("code", 500);
+                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                return null;
+            }
+
+            //2023-09-19 A-jax 房型数量必须和房间数量一致
+            List<String> houseNumberList = Arrays.asList(houseNumber.split(","));
+            if(house.getNumber().intValue() != houseNumberList.size()){
+                resultJson.put("message", "房型数量与房间数量不一致");
+                resultJson.put("code", 500);
+                ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+                return null;
+            }
+
+
             //详细图附件
             //详细图附件
             List<FileInfo> fileList = JSONArray.parseArray(fileListJson, FileInfo.class);
             List<FileInfo> fileList = JSONArray.parseArray(fileListJson, FileInfo.class);
 //            if(fileList==null){
 //            if(fileList==null){
@@ -116,7 +143,6 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
             }
             }
             //房型验证成功添加房号
             //房型验证成功添加房号
             String id = Func.newGuid();
             String id = Func.newGuid();
-            List<String> houseNumberList = Arrays.asList(houseNumber.split(","));
             List<HouseNumber> houseNumbers = new ArrayList<HouseNumber>();
             List<HouseNumber> houseNumbers = new ArrayList<HouseNumber>();
             long count = houseNumberList.stream().distinct().count();
             long count = houseNumberList.stream().distinct().count();
             if (count != houseNumberList.size()){
             if (count != houseNumberList.size()){
@@ -171,16 +197,23 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
      */
      */
     public String updateHouser(){
     public String updateHouser(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
-        Gson gson = new Gson();
-        com.alibaba.fastjson.JSONObject json = GetHttpParam.getRequestParameters(request);
-        if (json == null) {
+        if (houseDto == null) {
             resultJson.put("message", "请传入参数");
             resultJson.put("message", "请传入参数");
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             return null;
             return null;
         }
         }
-        House house = null;
+        House house = new House();
         try {
         try {
-            house = gson.fromJson(json.toString(), new TypeToken<House>() {}.getType());
+            house.setId(houseDto.getId());
+            house.setManagerId(houseDto.getManagerId());
+            house.sethName(houseDto.getHName());
+            house.sethAreas(houseDto.getHAreas());
+            house.setPrice(houseDto.getPrice());
+            house.setNumber(houseDto.getNumber());
+            house.sethConfig(houseDto.getHConfig());
+            house.setFileInfoList(houseDto.getFileInfoList());
+            house.setHouseNumbers(houseDto.getHouseNumbers());
+
             if (house == null) {
             if (house == null) {
                 resultJson.put("message", "数据为空");
                 resultJson.put("message", "数据为空");
                 resultJson.put("code", 500);
                 resultJson.put("code", 500);
@@ -278,13 +311,13 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
      */
      */
     public String delHouser(){
     public String delHouser(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
-        if (id == null) {
+        if (houseDto == null || houseDto.getId() == null) {
             resultJson.put("message", "请传入id");
             resultJson.put("message", "请传入id");
             resultJson.put("code", 500);
             resultJson.put("code", 500);
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             return null;
             return null;
         }
         }
-        int m = houseService.delHouse(id);
+        int m = houseService.delHouse(houseDto.getId());
         if (m > 0) {
         if (m > 0) {
             resultJson.put("message", "删除成功");
             resultJson.put("message", "删除成功");
             resultJson.put("code", 200);
             resultJson.put("code", 200);
@@ -303,13 +336,13 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
      */
      */
     public String getById(){
     public String getById(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
-        if (id == null) {
+        if (houseDto == null || houseDto.getId() == null) {
             resultJson.put("message", "请传入id");
             resultJson.put("message", "请传入id");
             resultJson.put("code", 500);
             resultJson.put("code", 500);
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
             return null;
             return null;
         }
         }
-        House house = houseService.getById(id);
+        House house = houseService.getById(houseDto.getId());
 
 
         StringBuilder fileSqlx = new StringBuilder("");
         StringBuilder fileSqlx = new StringBuilder("");
         fileSqlx.append("and link_id = '").append(id).append("'");
         fileSqlx.append("and link_id = '").append(id).append("'");
@@ -340,11 +373,11 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
     public String queryPage(){
     public String queryPage(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
         StringBuilder s1 = new StringBuilder("");
         StringBuilder s1 = new StringBuilder("");
-        if (hName!=null){
-            s1.append(" and h_name like '%").append(hName).append("%'");
+        if (houseDto != null && houseDto.getHName() !=null){
+            s1.append(" and h_name like '%").append(houseDto.getHName()).append("%'");
         }
         }
-        if (managerId!=null){
-            s1.append(" and manager_id = '").append(managerId).append("'");
+        if (houseDto != null && houseDto.getManagerId() !=null){
+            s1.append(" and manager_id = '").append(houseDto.getManagerId()).append("'");
         }
         }
         IPage<House> houseIPage = houseService.queryPage(s1.toString(),page,rows);
         IPage<House> houseIPage = houseService.queryPage(s1.toString(),page,rows);
         if(houseIPage!=null && !"".equals(houseIPage)){
         if(houseIPage!=null && !"".equals(houseIPage)){
@@ -373,11 +406,11 @@ public class houseAction extends ActionSupport implements ServletRequestAware {
         }else{
         }else{
             orderTime = UUIDUtil.getNewDate().substring(0,10);
             orderTime = UUIDUtil.getNewDate().substring(0,10);
         }
         }
-        if (hName!=null){
-            s2.append("  and a.h_name like '%").append(hName).append("%'");
+        if (houseDto != null && houseDto.getHName() !=null){
+            s2.append("  and a.h_name like '%").append(houseDto.getHName()).append("%'");
         }
         }
-        if (managerId!=null){
-            s2.append("  and a.manager_id = '").append(managerId).append("'");
+        if (houseDto != null && houseDto.getManagerId() !=null){
+            s2.append("  and a.manager_id = '").append(houseDto.getManagerId()).append("'");
         }
         }
         IPage<HouseSumEto> houseIPage = houseService.queryPageHouseSum(orderTime,s2.toString(),page,rows);
         IPage<HouseSumEto> houseIPage = houseService.queryPageHouseSum(orderTime,s2.toString(),page,rows);
         if(houseIPage!=null && !"".equals(houseIPage)){
         if(houseIPage!=null && !"".equals(houseIPage)){

+ 9 - 0
mhotel/src/com/happy/action/uploadAction.java

@@ -92,6 +92,15 @@ public class uploadAction extends ActionSupport implements ServletRequestAware {
     // 上传图片
     // 上传图片
     public String himage(){
     public String himage(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
+
+        if(1==1){
+            resultJson.put("code", 500);
+            resultJson.put("message", "该上传接口停用!");
+            ResponseUtil.writeJson(ServletActionContext.getResponse(),
+                    resultJson.toString());
+            return null;
+        }
+
         String filepath=request.getServletContext().getRealPath("/download/");
         String filepath=request.getServletContext().getRealPath("/download/");
         if (myFile==null){
         if (myFile==null){
             resultJson.put("code", 500);
             resultJson.put("code", 500);

+ 14 - 0
mhotel/src/com/happy/dao/AdminManagerDao.java

@@ -1,6 +1,8 @@
 package com.happy.dao;
 package com.happy.dao;
 
 
 import com.happy.Model.AdminManager;
 import com.happy.Model.AdminManager;
+import com.happy.dto.ManageHouseDto;
+import com.happy.dto.OwnerHouseDto;
 import com.happy.dto.townshipCountDTO;
 import com.happy.dto.townshipCountDTO;
 import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.formula.functions.T;
 
 
@@ -72,4 +74,16 @@ public interface AdminManagerDao {
      */
      */
     List<townshipCountDTO> getResidueCount();
     List<townshipCountDTO> getResidueCount();
 
 
+    /**
+     * 描述:获取各个乡镇下的总房间数
+     * @return
+     */
+    List<ManageHouseDto> getTotalHouseCount();
+
+
+    /**
+     * 描述:获取乡镇下民宿的总房间数
+     * @return
+     */
+    List<OwnerHouseDto> getTotalManageCount(String hotelTownship, Integer type);
 }
 }

+ 8 - 1
mhotel/src/com/happy/dao/HouseDao.java

@@ -31,11 +31,18 @@ public interface HouseDao {
     int delHouse(int id);
     int delHouse(int id);
 
 
     /**
     /**
+     * 描述:删除
+     * @param id
+     * @return
+     */
+    int delHouse(String id);
+
+    /**
      * 描述:根据Id查询详细
      * 描述:根据Id查询详细
      * @param id
      * @param id
      * @return
      * @return
      */
      */
-    House getById(int id);
+    House getById(String id);
 
 
     /**
     /**
      * 描述:分页查询
      * 描述:分页查询

+ 2 - 5
mhotel/src/com/happy/dao/IDCDao.java

@@ -1,9 +1,6 @@
 package com.happy.dao;
 package com.happy.dao;
 
 
-import com.happy.dto.IDCBookStatusEto;
-import com.happy.dto.IDCHotelEto;
-import com.happy.dto.IDCRankEto;
-import com.happy.dto.IDCSum;
+import com.happy.dto.*;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -32,7 +29,7 @@ public interface IDCDao {
      * 描述:获取销售额排行
      * 描述:获取销售额排行
      * @return
      * @return
      */
      */
-    List<IDCRankEto> getRankSalesAmountData(String sqlx);
+    List<IDCSaleEto> getRankSalesAmountData(String sqlx);
 
 
     /**
     /**
      * 描述:获取汇总信息
      * 描述:获取汇总信息

+ 99 - 52
mhotel/src/com/happy/dao/impl/AdminManagerImplDao.java

@@ -6,6 +6,8 @@ import com.happy.Until.Func;
 import com.happy.Until.SqlUtil;
 import com.happy.Until.SqlUtil;
 import com.happy.Until.UUIDUtil;
 import com.happy.Until.UUIDUtil;
 import com.happy.dao.AdminManagerDao;
 import com.happy.dao.AdminManagerDao;
+import com.happy.dto.ManageHouseDto;
+import com.happy.dto.OwnerHouseDto;
 import com.happy.dto.townshipCountDTO;
 import com.happy.dto.townshipCountDTO;
 import org.apache.poi.ss.formula.functions.T;
 import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -31,10 +33,10 @@ public class AdminManagerImplDao implements AdminManagerDao {
     }
     }
 
 
     public String selectSql =
     public String selectSql =
-        "select " +
-        "a.id, a.type, a.manager_id, a.link_pro_url, a.admin_name, a.hotel_name, a.hotel_township, b.name hotel_township_name, a.corpn_name, a.corpn_phone, a.level, a.admin_power, a.bank_card, a.card_name, a.bank_name, a.create_id, DATE_FORMAT(a.create_date,'%Y-%m-%d %T') create_date,DATE_FORMAT(a.modify_date,'%Y-%m-%d %T') modify_date,a.status,a.remark,a.openid " +
-        "from `admin_manager` a " +
-        "left join hotel_dict b on a.hotel_township = b.id";
+            "select " +
+                    "a.id, a.type, a.manager_id, a.link_pro_url, a.admin_name, a.hotel_name, a.hotel_township, b.name hotel_township_name, a.corpn_name, a.corpn_phone, a.level, a.admin_power, a.bank_card, a.card_name, a.bank_name, a.create_id, DATE_FORMAT(a.create_date,'%Y-%m-%d %T') create_date,DATE_FORMAT(a.modify_date,'%Y-%m-%d %T') modify_date,a.status,a.remark,a.openid " +
+                    "from `admin_manager` a " +
+                    "left join hotel_dict b on a.hotel_township = b.id";
 
 
 
 
     @Override
     @Override
@@ -58,19 +60,18 @@ public class AdminManagerImplDao implements AdminManagerDao {
         sps.addValue("card_name", adminManager.getCardName());
         sps.addValue("card_name", adminManager.getCardName());
         sps.addValue("bank_name", adminManager.getBankName());
         sps.addValue("bank_name", adminManager.getBankName());
         sps.addValue("create_id", adminManager.getCreateId());
         sps.addValue("create_id", adminManager.getCreateId());
-        sps.addValue("create_date",UUIDUtil.getNewDate());
+        sps.addValue("create_date", UUIDUtil.getNewDate());
         sps.addValue("status", 1);
         sps.addValue("status", 1);
         sps.addValue("remark", adminManager.getRemark());
         sps.addValue("remark", adminManager.getRemark());
-        if(adminManager.getId()==null){
+        if (adminManager.getId() == null) {
             sps.addValue("id", UUIDUtil.generateID());
             sps.addValue("id", UUIDUtil.generateID());
-        }else{
+        } else {
             sps.addValue("id", adminManager.getId());
             sps.addValue("id", adminManager.getId());
         }
         }
         int num = 0;
         int num = 0;
-        try{
+        try {
             num = namedParameterJdbcTemplate.update(sql, sps);
             num = namedParameterJdbcTemplate.update(sql, sps);
-        }
-        catch(Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
         return num;
         return num;
@@ -79,17 +80,16 @@ public class AdminManagerImplDao implements AdminManagerDao {
     @Override
     @Override
     public int updateAdmin(AdminManager adminManager) {
     public int updateAdmin(AdminManager adminManager) {
 
 
-        StringBuffer stringBuffer =  new StringBuffer(" update `admin_manager` set  ");
+        StringBuffer stringBuffer = new StringBuffer(" update `admin_manager` set  ");
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         // 将要修改的数据填充到查询语句中
         // 将要修改的数据填充到查询语句中
-        appendValue(adminManager,stringBuffer,sps);
+        appendValue(adminManager, stringBuffer, sps);
         stringBuffer.append("  where id=:id  ");
         stringBuffer.append("  where id=:id  ");
         sps.addValue("id", adminManager.getId());
         sps.addValue("id", adminManager.getId());
         int num = 0;
         int num = 0;
-        try{
+        try {
             num = namedParameterJdbcTemplate.update(stringBuffer.toString(), sps);
             num = namedParameterJdbcTemplate.update(stringBuffer.toString(), sps);
-        }
-        catch(Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
         return num;
         return num;
@@ -99,11 +99,11 @@ public class AdminManagerImplDao implements AdminManagerDao {
     public int delAdmin(int id) {
     public int delAdmin(int id) {
         String sql = "update `admin_manager` set status=0 where id=:id";
         String sql = "update `admin_manager` set status=0 where id=:id";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
-        sps.addValue("id",id);
+        sps.addValue("id", id);
         int num = 0;
         int num = 0;
-        try{
+        try {
             num = namedParameterJdbcTemplate.update(sql, sps);
             num = namedParameterJdbcTemplate.update(sql, sps);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
         return num;
         return num;
@@ -113,15 +113,15 @@ public class AdminManagerImplDao implements AdminManagerDao {
     public AdminManager getById(int id) {
     public AdminManager getById(int id) {
         String sql = selectSql + " WHERE a.id = :id ";
         String sql = selectSql + " WHERE a.id = :id ";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
-        sps.addValue("id",id);
+        sps.addValue("id", id);
         List<AdminManager> list = null;
         List<AdminManager> list = null;
-        try{
+        try {
             list = namedParameterJdbcTemplate.query(sql, sps,
             list = namedParameterJdbcTemplate.query(sql, sps,
                     new BeanPropertyRowMapper<>(AdminManager.class));
                     new BeanPropertyRowMapper<>(AdminManager.class));
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        if(list != null && list.size()>0) return list.get(0);
+        if (list != null && list.size() > 0) return list.get(0);
         return null;
         return null;
     }
     }
 
 
@@ -129,7 +129,7 @@ public class AdminManagerImplDao implements AdminManagerDao {
     public List<AdminManager> queryPage(String sqlx, int page, int rows) {
     public List<AdminManager> queryPage(String sqlx, int page, int rows) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
         int start = (page - 1) * rows;// 每页的起始下标
         int start = (page - 1) * rows;// 每页的起始下标
-        String sql = selectSql + " WHERE a.status!=0 "+sqlx+" ORDER BY a.id DESC limit :start,:rows ";
+        String sql = selectSql + " WHERE a.status!=0 " + sqlx + " ORDER BY a.id DESC limit :start,:rows ";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("start", start);
         sps.addValue("start", start);
         sps.addValue("rows", rows);
         sps.addValue("rows", rows);
@@ -142,7 +142,7 @@ public class AdminManagerImplDao implements AdminManagerDao {
     @Override
     @Override
     public int queryTotal(String sqlx) {
     public int queryTotal(String sqlx) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
-        String sql = "SELECT count(*) FROM`admin_manager` where status!=0 "+sqlx;
+        String sql = "SELECT count(*) FROM`admin_manager` where status!=0 " + sqlx;
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         return namedParameterJdbcTemplate.queryForInt(sql, sps);
         return namedParameterJdbcTemplate.queryForInt(sql, sps);
     }
     }
@@ -150,19 +150,19 @@ public class AdminManagerImplDao implements AdminManagerDao {
     @Override
     @Override
     public List<AdminManager> queryList(String sqlx) {
     public List<AdminManager> queryList(String sqlx) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
-        String sql = selectSql + " WHERE a.status!=0 "+sqlx ;
+        String sql = selectSql + " WHERE a.status!=0 " + sqlx;
         List<AdminManager> list = null;
         List<AdminManager> list = null;
-        try{
+        try {
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(AdminManager.class));
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(AdminManager.class));
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        if(list != null && list.size()>0) return list;
+        if (list != null && list.size() > 0) return list;
         return null;
         return null;
     }
     }
 
 
     @Override
     @Override
-    public List<townshipCountDTO> getTownshipCount(){
+    public List<townshipCountDTO> getTownshipCount() {
         String sql = "select a.name,sum(case when b.id is not null then 1 else 0 end) sumNumber,sum(case when b.type=1 then 1 else 0 end) aSum,sum(case when b.type=2 then 1 else 0 end) bSum,sum(case when b.type=3 then 1 else 0 end) cSum from \n" +
         String sql = "select a.name,sum(case when b.id is not null then 1 else 0 end) sumNumber,sum(case when b.type=1 then 1 else 0 end) aSum,sum(case when b.type=2 then 1 else 0 end) bSum,sum(case when b.type=3 then 1 else 0 end) cSum from \n" +
                 "(select * from hotel_dict where code = 10 ) a\n" +
                 "(select * from hotel_dict where code = 10 ) a\n" +
                 "left join (select a.*,b.hstatus from admin_manager a\n" +
                 "left join (select a.*,b.hstatus from admin_manager a\n" +
@@ -170,17 +170,17 @@ public class AdminManagerImplDao implements AdminManagerDao {
                 "where b.hstatus = 1 and a.status = 1) b on b.hotel_township = a.id\n" +
                 "where b.hstatus = 1 and a.status = 1) b on b.hotel_township = a.id\n" +
                 "group by a.id ORDER BY count(1) DESC";
                 "group by a.id ORDER BY count(1) DESC";
         List<townshipCountDTO> list = null;
         List<townshipCountDTO> list = null;
-        try{
+        try {
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(townshipCountDTO.class));
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(townshipCountDTO.class));
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        if(list != null && list.size()>0) return list;
+        if (list != null && list.size() > 0) return list;
         return null;
         return null;
     }
     }
 
 
     @Override
     @Override
-    public List<townshipCountDTO> getResidueCount(){
+    public List<townshipCountDTO> getResidueCount() {
         String sql = "select a.name,ifnull(b.number,0) residueNumber from \n" +
         String sql = "select a.name,ifnull(b.number,0) residueNumber from \n" +
                 "(select * from hotel_dict where code = 10 ) a\n" +
                 "(select * from hotel_dict where code = 10 ) a\n" +
                 "left join (select d.hotel_township,sum(a.number-ifnull(b.number,0)) number from \n" +
                 "left join (select d.hotel_township,sum(a.number-ifnull(b.number,0)) number from \n" +
@@ -192,74 +192,121 @@ public class AdminManagerImplDao implements AdminManagerDao {
                 "GROUP BY d.hotel_township) b on a.id = b.hotel_township\n" +
                 "GROUP BY d.hotel_township) b on a.id = b.hotel_township\n" +
                 "ORDER BY number";
                 "ORDER BY number";
         List<townshipCountDTO> list = null;
         List<townshipCountDTO> list = null;
-        try{
+        try {
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(townshipCountDTO.class));
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(townshipCountDTO.class));
-        }catch (Exception e){
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (list != null && list.size() > 0) return list;
+        return null;
+    }
+
+    @Override
+    public List<ManageHouseDto> getTotalHouseCount() {
+        String sql = "select (select Count(*) from house_number where status = 1 and house_id in (\n" +
+                "select id from house where `status` = 1 and manager_id in (\n" +
+                "(select id from admin_manager\n" +
+                "where hotel_township = hotel_dict.id and status =1)))) as total_house_num," +
+                "(select Count(*) from house_number_status where 1 = 1 and date_format(set_date, '%Y-%m-%d') = date_format(NOW(), '%Y-%m-%d') and status in (2,5,6) and number_id in \n" +
+                "(select id from house_number where status = 1 and house_id in (select id from house where `status` = 1 and manager_id in (\n" +
+                "(select id from admin_manager\n" +
+                "where hotel_township = hotel_dict.id and status =1))))) as used_house_num\n" +
+                ",hotel_dict.name from hotel_dict where code = 10 ";
+        List<ManageHouseDto> list = null;
+        try {
+            list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(ManageHouseDto.class));
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (list != null && list.size() > 0) {
+            return list;
+        }
+        return null;
+    }
+
+    @Override
+    public List<OwnerHouseDto> getTotalManageCount(String hotelTownship, Integer type) {
+        String sql = "select (select Count(*) from house_number where status = 1 and house_id in (\n" +
+                "select id from house where `status` = 1 and manager_id = admin_manager.manager_id)) as totalHouseNum,\n" +
+                "(select Count(*) from house_number_status where 1 = 1 and date_format(set_date, '%Y-%m-%d') = date_format(NOW(), '%Y-%m-%d') and status in (2,5,6) and number_id in \n" +
+                "(select id from house_number where status = 1 and house_id in (select id from house where `status` = 1 and manager_id in (\n" +
+                "(select id from admin_manager\n" +
+                "where hotel_township = :hotelTownship and status =1))))) as used_house_num\n" +
+                ",manager_id from admin_manager where status =1 and type = :type and hotel_township = :hotelTownship ";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("hotelTownship", hotelTownship);
+        sps.addValue("type", type);
+        List<OwnerHouseDto> list = null;
+        try {
+            list = namedParameterJdbcTemplate.query(sql, sps, new BeanPropertyRowMapper<>(OwnerHouseDto.class));
+        } catch (Exception e) {
             e.printStackTrace();
             e.printStackTrace();
         }
         }
-        if(list != null && list.size()>0) return list;
+        if (list != null && list.size() > 0) {
+            return list;
+        }
         return null;
         return null;
     }
     }
 
 
-    public void appendValue(AdminManager adminManager, StringBuffer stringBuffer, MapSqlParameterSource sps){
+    public void appendValue(AdminManager adminManager, StringBuffer stringBuffer, MapSqlParameterSource sps) {
 
 
-        if (!Func.checkNull(String.valueOf(adminManager.getType()))){
+        if (!Func.checkNull(String.valueOf(adminManager.getType()))) {
             stringBuffer.append(" type=:type ,");
             stringBuffer.append(" type=:type ,");
             sps.addValue("type", adminManager.getType());
             sps.addValue("type", adminManager.getType());
         }
         }
-        if (!Func.checkNull(adminManager.getLinkProUrl())){
+        if (!Func.checkNull(adminManager.getLinkProUrl())) {
             stringBuffer.append(" link_pro_url=:link_pro_url ,");
             stringBuffer.append(" link_pro_url=:link_pro_url ,");
             sps.addValue("link_pro_url", adminManager.getLinkProUrl());
             sps.addValue("link_pro_url", adminManager.getLinkProUrl());
         }
         }
-        if (!Func.checkNull(adminManager.getAdminName())){
+        if (!Func.checkNull(adminManager.getAdminName())) {
             stringBuffer.append(" admin_name=:admin_name ,");
             stringBuffer.append(" admin_name=:admin_name ,");
             sps.addValue("admin_name", adminManager.getAdminName());
             sps.addValue("admin_name", adminManager.getAdminName());
         }
         }
-        if (!Func.checkNull(adminManager.getPassword())){
+        if (!Func.checkNull(adminManager.getPassword())) {
             stringBuffer.append(" password=:password ,");
             stringBuffer.append(" password=:password ,");
             sps.addValue("password", adminManager.getPassword());
             sps.addValue("password", adminManager.getPassword());
         }
         }
-        if (!Func.checkNull(adminManager.getHotelName())){
+        if (!Func.checkNull(adminManager.getHotelName())) {
             stringBuffer.append(" hotel_name=:hotel_name ,");
             stringBuffer.append(" hotel_name=:hotel_name ,");
             sps.addValue("hotel_name", adminManager.getHotelName());
             sps.addValue("hotel_name", adminManager.getHotelName());
         }
         }
-        if (!Func.checkNull(adminManager.getHotelTownship())){
+        if (!Func.checkNull(adminManager.getHotelTownship())) {
             stringBuffer.append(" hotel_township=:hotel_township ,");
             stringBuffer.append(" hotel_township=:hotel_township ,");
             sps.addValue("hotel_township", adminManager.getHotelTownship());
             sps.addValue("hotel_township", adminManager.getHotelTownship());
         }
         }
-        if (!Func.checkNull(adminManager.getCorpnName())){
+        if (!Func.checkNull(adminManager.getCorpnName())) {
             stringBuffer.append(" corpn_name=:corpn_name ,");
             stringBuffer.append(" corpn_name=:corpn_name ,");
             sps.addValue("corpn_name", adminManager.getCorpnName());
             sps.addValue("corpn_name", adminManager.getCorpnName());
         }
         }
-        if (!Func.checkNull(adminManager.getCorpnPhone())){
+        if (!Func.checkNull(adminManager.getCorpnPhone())) {
             stringBuffer.append(" corpn_phone=:corpn_phone ,");
             stringBuffer.append(" corpn_phone=:corpn_phone ,");
             sps.addValue("corpn_phone", adminManager.getCorpnPhone());
             sps.addValue("corpn_phone", adminManager.getCorpnPhone());
         }
         }
-        if (!Func.checkNull(adminManager.getLevel())){
+        if (!Func.checkNull(adminManager.getLevel())) {
             stringBuffer.append(" level=:level ,");
             stringBuffer.append(" level=:level ,");
             sps.addValue("level", adminManager.getLevel());
             sps.addValue("level", adminManager.getLevel());
         }
         }
-        if (!Func.checkNull(adminManager.getAdminPower())){
+        if (!Func.checkNull(adminManager.getAdminPower())) {
             stringBuffer.append(" admin_power=:admin_power ,");
             stringBuffer.append(" admin_power=:admin_power ,");
             sps.addValue("admin_power", adminManager.getAdminPower());
             sps.addValue("admin_power", adminManager.getAdminPower());
         }
         }
-        if (!Func.checkNull(String.valueOf(adminManager.getBankCard()))){
+        if (!Func.checkNull(String.valueOf(adminManager.getBankCard()))) {
             stringBuffer.append(" bank_card=:bank_card ,");
             stringBuffer.append(" bank_card=:bank_card ,");
             sps.addValue("bank_card", adminManager.getBankCard());
             sps.addValue("bank_card", adminManager.getBankCard());
         }
         }
-        if (!Func.checkNull(adminManager.getCardName())){
+        if (!Func.checkNull(adminManager.getCardName())) {
             stringBuffer.append(" card_name=:card_name ,");
             stringBuffer.append(" card_name=:card_name ,");
             sps.addValue("card_name", adminManager.getCardName());
             sps.addValue("card_name", adminManager.getCardName());
         }
         }
-        if (!Func.checkNull(adminManager.getBankName())){
+        if (!Func.checkNull(adminManager.getBankName())) {
             stringBuffer.append(" bank_name=:bank_name ,");
             stringBuffer.append(" bank_name=:bank_name ,");
             sps.addValue("bank_name", adminManager.getBankName());
             sps.addValue("bank_name", adminManager.getBankName());
         }
         }
-        if (!Func.checkNull(String.valueOf(adminManager.getStatus()))){
+        if (!Func.checkNull(String.valueOf(adminManager.getStatus()))) {
             stringBuffer.append(" status=:status ,");
             stringBuffer.append(" status=:status ,");
             sps.addValue("status", adminManager.getStatus());
             sps.addValue("status", adminManager.getStatus());
         }
         }
-        if (!Func.checkNull(adminManager.getRemark())){
+        if (!Func.checkNull(adminManager.getRemark())) {
             stringBuffer.append(" remark=:remark ,");
             stringBuffer.append(" remark=:remark ,");
             sps.addValue("remark", adminManager.getRemark());
             sps.addValue("remark", adminManager.getRemark());
         }
         }

+ 15 - 1
mhotel/src/com/happy/dao/impl/HouseImplDao.java

@@ -98,7 +98,21 @@ public class HouseImplDao implements HouseDao {
     }
     }
 
 
     @Override
     @Override
-    public House getById(int id) {
+    public int delHouse(String id) {
+        String sql = "update `house` set status = 0 where id= :id";
+        MapSqlParameterSource sps = new MapSqlParameterSource();
+        sps.addValue("id",id);
+        int num = 0;
+        try{
+            num = namedParameterJdbcTemplate.update(sql, sps);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        return num;
+    }
+
+    @Override
+    public House getById(String id) {
         String sql = "SELECT * FROM `house` WHERE id = :id ";
         String sql = "SELECT * FROM `house` WHERE id = :id ";
         MapSqlParameterSource sps = new MapSqlParameterSource();
         MapSqlParameterSource sps = new MapSqlParameterSource();
         sps.addValue("id",id);
         sps.addValue("id",id);

+ 8 - 9
mhotel/src/com/happy/dao/impl/IDCImplDao.java

@@ -3,10 +3,7 @@ package com.happy.dao.impl;
 import com.happy.Model.House;
 import com.happy.Model.House;
 import com.happy.Until.SqlUtil;
 import com.happy.Until.SqlUtil;
 import com.happy.dao.IDCDao;
 import com.happy.dao.IDCDao;
-import com.happy.dto.IDCBookStatusEto;
-import com.happy.dto.IDCHotelEto;
-import com.happy.dto.IDCRankEto;
-import com.happy.dto.IDCSum;
+import com.happy.dto.*;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
@@ -61,7 +58,7 @@ public class IDCImplDao implements IDCDao {
     @Override
     @Override
     public List<IDCRankEto> getRankBookNumData(String sqlx) {
     public List<IDCRankEto> getRankBookNumData(String sqlx) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
-        String sql = "select a.*,@curRank := @curRank + 1 AS rank from (select hotel_name,count(1) book_num from booking where order_status=2 " +sqlx + " group by hotel_id ORDER BY count(1) DESC) a,(SELECT @curRank := 0) r";
+        String sql = "select 1 as rank,Count(*) as bookNum,hotel_name from booking where order_status=5 " +sqlx + " group by hotel_name order by bookNum desc";
         List<IDCRankEto> list = null;
         List<IDCRankEto> list = null;
         try{
         try{
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IDCRankEto.class));
             list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IDCRankEto.class));
@@ -73,12 +70,14 @@ public class IDCImplDao implements IDCDao {
     }
     }
 
 
     @Override
     @Override
-    public List<IDCRankEto> getRankSalesAmountData(String sqlx) {
+    public List<IDCSaleEto> getRankSalesAmountData(String sqlx) {
         SqlUtil.filterKeyword(sqlx);
         SqlUtil.filterKeyword(sqlx);
-        String sql = "select a.*,@curRank := @curRank + 1 AS rank from (select hotel_name,sum(pay_account) salesAmount from booking where order_status=2 "+sqlx+" group by hotel_id ORDER BY sum(pay_account) DESC) a,(SELECT @curRank := 0) r";
-        List<IDCRankEto> list = null;
+        String sql = "select 1 as rank,SUM(pay_account) as salesAmount,hotel_name from booking where order_status=5 " +sqlx+
+                     "group by hotel_name\n" +
+                     "ORDER BY salesAmount DESC";
+        List<IDCSaleEto> list = null;
         try{
         try{
-            list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IDCRankEto.class));
+            list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IDCSaleEto.class));
         }catch (Exception e){
         }catch (Exception e){
             e.printStackTrace();
             e.printStackTrace();
         }
         }

+ 2 - 2
mhotel/src/com/happy/dao/impl/WorkflowImplDao.java

@@ -33,10 +33,10 @@ public class WorkflowImplDao implements WorkflowDao {
     }
     }
 
 
     private String selectSql = " select a.id,a.link_id,a.type,a.title,a.status,a.remark,a.create_id,date_format(a.workflow_date, '%Y-%m-%d %H:%i:%s') as workflow_date,a.cover_img,date_format(a.create_date, '%Y-%m-%d %H:%i:%s') as create_date,a.workflow_remark,a.workflow_name, " +
     private String selectSql = " select a.id,a.link_id,a.type,a.title,a.status,a.remark,a.create_id,date_format(a.workflow_date, '%Y-%m-%d %H:%i:%s') as workflow_date,a.cover_img,date_format(a.create_date, '%Y-%m-%d %H:%i:%s') as create_date,a.workflow_remark,a.workflow_name, " +
-                                " case when a.type = 1 then b.corpn_name when a.type = 2 then c.user_name else null end as createName "+
+                                " case when a.type = 1 then b.corpn_name when (a.type = 2 or a.type = 3) then c.user_name else null end as createName "+
                                 " from workflow a " +
                                 " from workflow a " +
                                 " left join admin_manager b on a.type = 1 and a.create_id = b.id " +
                                 " left join admin_manager b on a.type = 1 and a.create_id = b.id " +
-                                " left join users c on a.type = 2 and a.create_id = c.id " +
+                                " left join users c on (a.type = 2 or a.type = 3) and a.create_id = c.id " +
                                 " where 1=1";
                                 " where 1=1";
 
 
     @Override
     @Override

+ 91 - 0
mhotel/src/com/happy/dto/HouseDto.java

@@ -0,0 +1,91 @@
+package com.happy.dto;
+
+import com.happy.Model.FileInfo;
+import com.happy.Model.HouseNumber;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @Description
+ * @Author  raojiaolong
+ * @String 2023-07-29
+ */
+@Data
+public class HouseDto {
+
+
+	/**
+	 * id
+	 */
+	private String id;
+
+	/**
+	 * 所属商家Id
+	 */
+	private String managerId;
+
+	/**
+	 * 房型名称
+	 */
+	private String hName;
+
+	/**
+	 * 房型面积
+	 */
+	private String hAreas;
+
+	/**
+	 * 单价
+	 */
+	private Double price;
+
+	/**
+	 * 数量
+	 */
+	private Integer number;
+
+	/**
+	 * 房型配置
+	 */
+	private String hConfig;
+
+	private  List hConfigList;
+	/**
+	 * 备注
+	 */
+	private String remark;
+
+	private String remainRooms;
+
+	/**
+	 * 创建人
+	 */
+	private Integer createId;
+
+	/**
+	 * 创建时间
+	 */
+	private String createDate;
+
+	/**
+	 * 修改时间
+	 */
+	private String modifyDate;
+
+	/**
+	 * 数据状态
+	 */
+	private Integer status;
+
+	/**
+	 * 房型详细图
+	 */
+	private List<FileInfo> fileInfoList;
+
+	/**
+	 * 房间号
+	 */
+	private List<HouseNumber> houseNumbers;
+
+}

+ 3 - 34
mhotel/src/com/happy/dto/IDCRankEto.java

@@ -1,5 +1,8 @@
 package com.happy.dto;
 package com.happy.dto;
 
 
+import lombok.Data;
+
+@Data
 public class IDCRankEto {
 public class IDCRankEto {
 
 
     //排名
     //排名
@@ -11,38 +14,4 @@ public class IDCRankEto {
     //订单量
     //订单量
     private Integer bookNum;
     private Integer bookNum;
 
 
-    //销售额
-    private Double salesAmount;
-
-    public Integer getRank() {
-        return rank;
-    }
-
-    public void setRank(Integer rank) {
-        this.rank = rank;
-    }
-
-    public String getHotelName() {
-        return hotelName;
-    }
-
-    public void setHotelName(String hotelName) {
-        this.hotelName = hotelName;
-    }
-
-    public Integer getBookNum() {
-        return bookNum;
-    }
-
-    public void setBookNum(Integer bookNum) {
-        this.bookNum = bookNum;
-    }
-
-    public Double getSalesAmount() {
-        return salesAmount;
-    }
-
-    public void setSalesAmount(Double salesAmount) {
-        this.salesAmount = salesAmount;
-    }
 }
 }

+ 17 - 0
mhotel/src/com/happy/dto/IDCSaleEto.java

@@ -0,0 +1,17 @@
+package com.happy.dto;
+
+import lombok.Data;
+
+@Data
+public class IDCSaleEto {
+
+    //排名
+    private Integer rank;
+
+    //民宿名称
+    private String hotelName;
+
+    //销售额
+    private Double salesAmount;
+
+}

+ 35 - 0
mhotel/src/com/happy/dto/ManageHouseDto.java

@@ -0,0 +1,35 @@
+package com.happy.dto;
+
+import lombok.Data;
+
+@Data
+public class ManageHouseDto {
+
+    /**
+     * 乡镇名称
+     */
+    public String name;
+
+    /**
+     * 总房间数
+     */
+    public Integer totalHouseNum;
+
+    /**
+     * 已用房间数
+     */
+    public Integer usedHouseNum;
+
+    /**
+     * 剩余房间数
+     */
+    public Integer residueHouseNum;
+
+    public Integer getResidueHouseNum() {
+        return totalHouseNum == null ? 0 : totalHouseNum - (usedHouseNum == null ? 0 : usedHouseNum);
+    }
+
+    public void setResidueHouseNum(Integer residueHouseNum) {
+        this.residueHouseNum = residueHouseNum;
+    }
+}

+ 35 - 0
mhotel/src/com/happy/dto/OwnerHouseDto.java

@@ -0,0 +1,35 @@
+package com.happy.dto;
+
+import lombok.Data;
+
+@Data
+public class OwnerHouseDto {
+
+    /**
+     * 管理ID
+     */
+    public Integer managerId;
+
+    /**
+     * 总房间数
+     */
+    public Integer totalHouseNum;
+
+    /**
+     * 已用房间数
+     */
+    public Integer usedHouseNum;
+
+    /**
+     * 剩余房间数
+     */
+    public Integer residueHouseNum;
+
+    public Integer getResidueHouseNum() {
+        return totalHouseNum == null ? 0 : totalHouseNum - (usedHouseNum == null ? 0 : usedHouseNum);
+    }
+
+    public void setResidueHouseNum(Integer residueHouseNum) {
+        this.residueHouseNum = residueHouseNum;
+    }
+}

+ 1 - 1
mhotel/src/com/happy/dto/townshipCountDTO.java

@@ -10,7 +10,7 @@ public class townshipCountDTO {
 
 
     public Integer bSum;//金数级
     public Integer bSum;//金数级
 
 
-    public Integer cSum;//白金级
+    public Integer cSum;//白金级
 
 
     public Integer residueNumber;//剩余房数
     public Integer residueNumber;//剩余房数
 
 

+ 13 - 0
mhotel/src/com/happy/service/AdminManagerService.java

@@ -2,6 +2,8 @@ package com.happy.service;
 
 
 import com.happy.Model.AdminManager;
 import com.happy.Model.AdminManager;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
+import com.happy.dto.ManageHouseDto;
+import com.happy.dto.OwnerHouseDto;
 import com.happy.dto.townshipCountDTO;
 import com.happy.dto.townshipCountDTO;
 
 
 import java.util.List;
 import java.util.List;
@@ -71,4 +73,15 @@ public interface AdminManagerService {
      */
      */
     List<townshipCountDTO> getResidueCount();
     List<townshipCountDTO> getResidueCount();
 
 
+    /**
+     * 获取各个乡镇下的总房间数
+     * @return
+     */
+    List<ManageHouseDto> getTotalHouseCount();
+
+    /**
+     * 获取乡镇下民宿的总房间数
+     */
+    List<OwnerHouseDto> getTotalManageCount(String hotelTownship, Integer type);
+
 }
 }

+ 8 - 1
mhotel/src/com/happy/service/HouseService.java

@@ -32,11 +32,18 @@ public interface HouseService {
     int delHouse(int id);
     int delHouse(int id);
 
 
     /**
     /**
+     * 描述:删除
+     * @param id
+     * @return
+     */
+    int delHouse(String id);
+
+    /**
      * 描述:根据Id查询详细
      * 描述:根据Id查询详细
      * @param id
      * @param id
      * @return
      * @return
      */
      */
-    House getById(int id);
+    House getById(String id);
 
 
     /**
     /**
      * 描述:分页查询
      * 描述:分页查询

+ 2 - 5
mhotel/src/com/happy/service/IDCService.java

@@ -1,9 +1,6 @@
 package com.happy.service;
 package com.happy.service;
 
 
-import com.happy.dto.IDCBookStatusEto;
-import com.happy.dto.IDCHotelEto;
-import com.happy.dto.IDCRankEto;
-import com.happy.dto.IDCSum;
+import com.happy.dto.*;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -31,7 +28,7 @@ public interface IDCService {
      * 描述:获取销售额排行
      * 描述:获取销售额排行
      * @return
      * @return
      */
      */
-    List<IDCRankEto> getRankSalesAmountData(String sqlx);
+    List<IDCSaleEto> getRankSalesAmountData(String sqlx);
 
 
     /**
     /**
      * 描述:获取汇总信息
      * 描述:获取汇总信息

+ 12 - 0
mhotel/src/com/happy/service/impl/AdminManagerImplService.java

@@ -4,6 +4,8 @@ import com.happy.Model.Admin;
 import com.happy.Model.AdminManager;
 import com.happy.Model.AdminManager;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 import com.happy.dao.AdminManagerDao;
 import com.happy.dao.AdminManagerDao;
+import com.happy.dto.ManageHouseDto;
+import com.happy.dto.OwnerHouseDto;
 import com.happy.dto.townshipCountDTO;
 import com.happy.dto.townshipCountDTO;
 import com.happy.service.AdminManagerService;
 import com.happy.service.AdminManagerService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
@@ -71,4 +73,14 @@ public class AdminManagerImplService implements AdminManagerService {
     public List<townshipCountDTO> getResidueCount() {
     public List<townshipCountDTO> getResidueCount() {
         return adminManagerDao.getResidueCount();
         return adminManagerDao.getResidueCount();
     }
     }
+
+    @Override
+    public List<ManageHouseDto> getTotalHouseCount(){
+        return adminManagerDao.getTotalHouseCount();
+    }
+
+    @Override
+    public List<OwnerHouseDto> getTotalManageCount(String hotelTownship, Integer type){
+        return adminManagerDao.getTotalManageCount(hotelTownship, type);
+    }
 }
 }

+ 2 - 2
mhotel/src/com/happy/service/impl/AppBookImplService.java

@@ -61,7 +61,7 @@ public class AppBookImplService implements AppBookService {
                 || Func.checkNull(houseOrderNumber) || Func.checkNull(userName) || Func.checkNull(userPhone) || Func.checkNull(userId))
                 || Func.checkNull(houseOrderNumber) || Func.checkNull(userName) || Func.checkNull(userPhone) || Func.checkNull(userId))
             return null;
             return null;
 
 
-        House house = houseService.getById(Func.parseInt(houseId));
+        House house = houseService.getById(houseId);
         StringBuilder s1 = new StringBuilder("");
         StringBuilder s1 = new StringBuilder("");
         s1.append(" and manager_id = '").append(house.getManagerId()).append("' ");
         s1.append(" and manager_id = '").append(house.getManagerId()).append("' ");
         Hotel hotel = hotelService.getOen(s1.toString());
         Hotel hotel = hotelService.getOen(s1.toString());
@@ -248,7 +248,7 @@ public class AppBookImplService implements AppBookService {
 
 
     @Override
     @Override
     public String varificationHouse(String houseId, String startTime, String endTime, String houseOrderNumber) {
     public String varificationHouse(String houseId, String startTime, String endTime, String houseOrderNumber) {
-        House house = houseService.getById(Func.parseInt(houseId));
+        House house = houseService.getById(houseId);
         if (house == null)
         if (house == null)
             return "无此房间,请重新查询";
             return "无此房间,请重新查询";
         if (Func.checkNull(houseOrderNumber))
         if (Func.checkNull(houseOrderNumber))

+ 1 - 1
mhotel/src/com/happy/service/impl/BookingCommentImplService.java

@@ -181,7 +181,7 @@ public class BookingCommentImplService implements BookingCommentService {
     @Override
     @Override
     public BookCommentDto getByBookingId(Integer id) {
     public BookCommentDto getByBookingId(Integer id) {
         Booking book = bookService.getById(id);
         Booking book = bookService.getById(id);
-        House house = houseService.getById(Integer.parseInt(book.getHouseId()));
+        House house = houseService.getById(book.getHouseId());
         BookCommentDto bookCommentDto = new BookCommentDto();
         BookCommentDto bookCommentDto = new BookCommentDto();
         bookCommentDto.setBook(book);
         bookCommentDto.setBook(book);
         bookCommentDto.setHouse(house);
         bookCommentDto.setHouse(house);

+ 6 - 1
mhotel/src/com/happy/service/impl/HouseImplService.java

@@ -40,7 +40,12 @@ public class HouseImplService implements HouseService {
     }
     }
 
 
     @Override
     @Override
-    public House getById(int id) {
+    public int delHouse(String id) {
+        return houseDao.delHouse(id);
+    }
+
+    @Override
+    public House getById(String id) {
         House house = houseDao.getById(id);
         House house = houseDao.getById(id);
         house.setHouseNumbers(houseNumberDao.queryByHouseId(String.valueOf(id)));
         house.setHouseNumbers(houseNumberDao.queryByHouseId(String.valueOf(id)));
         return house;
         return house;

+ 2 - 1
mhotel/src/com/happy/service/impl/HousePriceServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.happy.Model.HotelDict;
 import com.happy.Model.HotelDict;
 import com.happy.Model.House;
 import com.happy.Model.House;
 import com.happy.Model.HousePrice;
 import com.happy.Model.HousePrice;
+import com.happy.Model.weixin.WeiXinUtil;
 import com.happy.Until.*;
 import com.happy.Until.*;
 import com.happy.Until.Excel.toExcel;
 import com.happy.Until.Excel.toExcel;
 import com.happy.dao.HotelDictDao;
 import com.happy.dao.HotelDictDao;
@@ -187,7 +188,7 @@ public class HousePriceServiceImpl implements HousePriceService {
         // 导出文件
         // 导出文件
         new toExcel().book(vectorsList, path + filePathName,
         new toExcel().book(vectorsList, path + filePathName,
                 "sheet1", columnName);
                 "sheet1", columnName);
-        String url = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+        String url = WeiXinUtil.ip_h;//"https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
         JSONObject result = new JSONObject();
         JSONObject result = new JSONObject();
         result.put("downurl", url + "/download/" + filePathName);
         result.put("downurl", url + "/download/" + filePathName);
         result.put("code", 200);
         result.put("code", 200);

+ 2 - 5
mhotel/src/com/happy/service/impl/IDCImplService.java

@@ -1,10 +1,7 @@
 package com.happy.service.impl;
 package com.happy.service.impl;
 
 
 import com.happy.dao.IDCDao;
 import com.happy.dao.IDCDao;
-import com.happy.dto.IDCBookStatusEto;
-import com.happy.dto.IDCHotelEto;
-import com.happy.dto.IDCRankEto;
-import com.happy.dto.IDCSum;
+import com.happy.dto.*;
 import com.happy.service.IDCService;
 import com.happy.service.IDCService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -33,7 +30,7 @@ public class IDCImplService implements IDCService {
     }
     }
 
 
     @Override
     @Override
-    public List<IDCRankEto> getRankSalesAmountData(String sqlx) {
+    public List<IDCSaleEto> getRankSalesAmountData(String sqlx) {
         return idcDao.getRankSalesAmountData(sqlx);
         return idcDao.getRankSalesAmountData(sqlx);
     }
     }