Procházet zdrojové kódy

添加优惠卷查询适用酒店

lijie před 2 roky
rodič
revize
6b3af0c0e6

+ 9 - 0
mhotel/src/com/happy/Model/HotelCoupon.java

@@ -58,6 +58,15 @@ public class HotelCoupon {
 
 
     private Integer reversedNumber; //已核销数量
     private Integer reversedNumber; //已核销数量
 
 
+    private String hotelNames;//酒店名称
+
+    public String getHotelNames() {
+        return hotelNames;
+    }
+
+    public void setHotelNames(String hotelNames) {
+        this.hotelNames = hotelNames;
+    }
 
 
     public String getId() {
     public String getId() {
         return id;
         return id;

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

@@ -599,7 +599,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
     /**
     /**
      * 定时任务
      * 定时任务
      */
      */
-    public void bookTask(){
+    public void setBookStatus(){
         JSONObject resultJson = new JSONObject();
         JSONObject resultJson = new JSONObject();
         try {
         try {
             int i = bookService.updateBookStatus();
             int i = bookService.updateBookStatus();

+ 13 - 3
mhotel/src/com/happy/service/impl/BookImplService.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
@@ -228,12 +229,21 @@ public class BookImplService implements BookService {
                         list.add(houseNumberStatus);
                         list.add(houseNumberStatus);
                     }
                     }
                 }
                 }
-
             });
             });
             return houseNumberStatusService.saveBatch(list);
             return houseNumberStatusService.saveBatch(list);
         }else {
         }else {
-            request.getServerName();
-
+            String ip = request.getServerName();
+            ip += "/mhotel/abkchargeback.action";
+            String finalIp = ip;
+            bookings.forEach(booking -> {
+                Map<String, String> params = new HashMap<String, String>();
+                params.put("bookingId", String.valueOf(booking.getId()));
+                try {
+                    String msg = HttpUtils.post(finalIp, params);
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            });
         }
         }
         return 0;
         return 0;
     }
     }

+ 19 - 0
mhotel/src/com/happy/service/impl/HotelCoupomImplService.java

@@ -1,14 +1,17 @@
 package com.happy.service.impl;
 package com.happy.service.impl;
 
 
 import com.happy.Model.AdminManager;
 import com.happy.Model.AdminManager;
+import com.happy.Model.Hotel;
 import com.happy.Model.HotelCoupon;
 import com.happy.Model.HotelCoupon;
 import com.happy.Until.DateUtil;
 import com.happy.Until.DateUtil;
 import com.happy.dao.HotelCouponDao;
 import com.happy.dao.HotelCouponDao;
+import com.happy.dao.HotelDao;
 import com.happy.dto.IPage;
 import com.happy.dto.IPage;
 import com.happy.service.HotelCoupomService;
 import com.happy.service.HotelCoupomService;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import java.util.Arrays;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 @Service("hotelCoupomService")
 @Service("hotelCoupomService")
@@ -17,6 +20,9 @@ public class HotelCoupomImplService implements HotelCoupomService {
     @Resource
     @Resource
     private HotelCouponDao hotelCouponDao;
     private HotelCouponDao hotelCouponDao;
 
 
+    @Resource
+    public HotelDao hotelDao;
+
     @Override
     @Override
     public int insert(HotelCoupon hotelCoupon) {
     public int insert(HotelCoupon hotelCoupon) {
         return hotelCouponDao.insert(hotelCoupon);
         return hotelCouponDao.insert(hotelCoupon);
@@ -41,6 +47,19 @@ public class HotelCoupomImplService implements HotelCoupomService {
     public IPage<HotelCoupon> queryPage(String sqlx, int page, int rows) {
     public IPage<HotelCoupon> queryPage(String sqlx, int page, int rows) {
         IPage<HotelCoupon> iPage = new IPage();
         IPage<HotelCoupon> iPage = new IPage();
         List<HotelCoupon> hotelCouponList = hotelCouponDao.queryPage(sqlx,page,rows);
         List<HotelCoupon> hotelCouponList = hotelCouponDao.queryPage(sqlx,page,rows);
+        hotelCouponList.forEach(hotelCoupon -> {
+            String hotelIds = hotelCoupon.getHotelIds();
+            String sql = " and id in ( " + hotelIds + " )";
+            List<Hotel> hotels = hotelDao.queryList(sql);
+            if (hotels!=null){
+                StringBuilder stringBuilder = new StringBuilder();
+                hotels.forEach(hotel -> {
+                    stringBuilder.append(hotel.getHname()).append(",");
+                });
+                String hotelNames = stringBuilder.deleteCharAt(stringBuilder.length() - 1).toString();
+                hotelCoupon.setHotelNames(hotelNames);
+            }
+        });
         int total = hotelCouponDao.queryTotal(sqlx);
         int total = hotelCouponDao.queryTotal(sqlx);
         iPage.setPageList(hotelCouponList);
         iPage.setPageList(hotelCouponList);
         iPage.setPage(page);
         iPage.setPage(page);

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

@@ -127,6 +127,7 @@ public class HouseNumberStatusImplService implements HouseNumberStatusService {
                     String numberName = houseNumber.getNumberName();
                     String numberName = houseNumber.getNumberName();
                     houseJsonObject.put("numberName", numberName);
                     houseJsonObject.put("numberName", numberName);
                     houseJsonObject.put("numberStatus", houseNumber.getHouseStatus());
                     houseJsonObject.put("numberStatus", houseNumber.getHouseStatus());
+                    houseJsonObject.put("numberId", houseNumber.getId());
                     dateListBetween.forEach(date -> {
                     dateListBetween.forEach(date -> {
                         JSONObject dateJsonObject = new JSONObject();
                         JSONObject dateJsonObject = new JSONObject();
                         dateJsonObject.put("numberId", houseNumber.getId());
                         dateJsonObject.put("numberId", houseNumber.getId());

+ 28 - 0
mhotel/src/log4j.properties

@@ -0,0 +1,28 @@
+### direct log messages to stdout ###
+
+log4j.rootLogger=INFO,R
+
+
+log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
+log4j.appender.R.DatePattern=yyyy-MM-dd'.log'
+log4j.appender.R.File=/usr/local/tomcat/apache-tomcat-9.0.80/webapps/motel/log/motel.log
+#log4j.appender.R.File=/usr/local/apache-tomcat-7.0.69/webapps/HappysSystem/log/happysys.log
+#log4j.appender.R.File=d:/log/happysys.log
+
+#log4j.appender.R.MaxFileSize=1000KB
+# Keep one backup file
+#log4j.appender.R.MaxBackupIndex=10
+
+log4j.appender.R.layout=org.apache.log4j.PatternLayout
+log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss,SSS} [%c]-[%p] %m%n
+
+#log4j.logger.com.mbi=error
+log4j.logger.com.runway=error
+log4j.logger.org.hibernate=error
+#log4j.logger.com.opensymphony=error
+log4j.logger.org.springframework=error
+log4j.logger.net.sf.ehcache=error
+log4j.logger.org.apache=error
+log4j.logger.uk.ltd=error
+log4j.logger.com.lilu.springdao=error
+log4j.logger.com.lilu.resource=error