Browse Source

Merge remote-tracking branch 'origin/master'

Administrator 2 years ago
parent
commit
255ff69378

+ 1 - 1
mhotel/src/com/happy/Model/weixin/WeiXinUtil.java

@@ -10,7 +10,7 @@ public class WeiXinUtil {
     public static String account = "1612274012";  // 商户号
 
     public static String ip = "172.16.20.88";
-    public static String ip_h = "https://chtech.ncjti.edu.cn/hotelReservation/zhotel";
+    public static String ip_h = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
     //public static String ip_q = "https://chtech.ncjti.edu.cn/hotelReservation/dist";
     public static String ip_q = "http://192.168.161.227:8000/hotelReservation/dist";
 

+ 1 - 1
mhotel/src/com/happy/Until/HttpUtils.java

@@ -180,7 +180,7 @@ public class HttpUtils {
 		//p12证书的位置
 		//微信公众平台:“微信支付”--》“商户信息”--》“交易数据”--》“详情请登录微信支付商户平台查看”(登录)--》“API安全”--》“API证书”--》“下载证书”
 		//下载证书后将apiclient_cert.p12放在src目录下面(出于安全考虑,请自行下载自己的证书)
-		String apiclient_certLocation = "/usr/mbin/apiclient_cert.p12";
+		String apiclient_certLocation = "/usr/mbin2/apiclient_cert.p12";
 		String str = "";
 		CloseableHttpClient httpClient = null;
 		HttpPost httpPost = null;

+ 1 - 1
mhotel/src/com/happy/Until/PwdDefind.java

@@ -6,7 +6,7 @@ public class PwdDefind {
 
     public static boolean vertify(String pwd){
         //密码至少包含:大小写英文字母、数字、特殊符号,密码长度大于8位,小于20位
-        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&+=<>.,])(?=\\S+$).{8,20}$";
+        String regex = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&+—_=<>.,])(?=\\S+$).{8,20}$";
         return Pattern.matches(regex, pwd);
     }
 }

+ 22 - 0
mhotel/src/com/happy/action/IDCAction.java

@@ -4,6 +4,7 @@ import com.happy.Until.ResUtil;
 import com.happy.dto.IDCBookStatusEto;
 import com.happy.dto.IDCHotelEto;
 import com.happy.dto.IDCRankEto;
+import com.happy.dto.IDCSum;
 import com.happy.service.IDCService;
 import com.opensymphony.xwork2.ActionSupport;
 import net.sf.json.JSONObject;
@@ -145,4 +146,25 @@ public class IDCAction extends ActionSupport implements ServletRequestAware {
         return null;
     }
 
+    /**
+     * 描述:获取销售额排行
+     * @return
+     */
+    public String getSumData(){
+        JSONObject resultJson = new JSONObject();
+
+        IDCSum idcSum = idcService.getSumData();
+        if (idcSum == null) {
+            resultJson.put("message", "数据为空");
+            resultJson.put("code", 500);
+            ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+        resultJson.put("message", "查询成功");
+        resultJson.put("code", 200);
+        resultJson.put("data", idcSum);
+        ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+        return null;
+    }
+
 }

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

@@ -155,7 +155,7 @@ public class hotelAction extends ActionSupport implements ServletRequestAware {
             BeanUtils.copyProperties(hotel,hotelEto);
         }
         StringBuilder fileSqlx = new StringBuilder("");
-        fileSqlx.append("and link_id = '").append(id).append("'");
+        fileSqlx.append("and link_id = '").append(hotel.getId()).append("'");
         List<FileInfo> fileList = fileService.queryList(fileSqlx.toString());
         hotelEto.setFileInfoList(fileList);
         resultJson.put("message", "查询成功");

+ 7 - 0
mhotel/src/com/happy/dao/IDCDao.java

@@ -3,6 +3,7 @@ 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 java.util.List;
 
@@ -33,4 +34,10 @@ public interface IDCDao {
      */
     List<IDCRankEto> getRankSalesAmountData(String sqlx);
 
+    /**
+     * 描述:获取汇总信息
+     * @return
+     */
+    IDCSum getSumData();
+
 }

File diff suppressed because it is too large
+ 1 - 1
mhotel/src/com/happy/dao/impl/HouseImplDao.java


+ 20 - 0
mhotel/src/com/happy/dao/impl/IDCImplDao.java

@@ -5,6 +5,7 @@ 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 org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.jdbc.core.BeanPropertyRowMapper;
 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
@@ -78,4 +79,23 @@ public class IDCImplDao implements IDCDao {
         if(list != null && list.size()>0) return list;
         return null;
     }
+
+    @Override
+    public IDCSum getSumData(){
+        String sql = "select *,bookNumDay-bookNumyDay bookNumGrowth,salesAmountDay-salesAmountyDay salesAmountGrowth from (\n" +
+                "\t(select count(1) bookNumDay from booking where order_status = 2 and DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')) a,\n" +
+                "\t(select count(1) bookNumyDay from booking where order_status = 2 and DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')) b,\n" +
+                "\t(select sum(pay_account) salesAmountDay from booking where order_status = 2 and DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(NOW(),'%Y-%m-%d')) c,\n" +
+                "\t(select sum(pay_account) salesAmountyDay from booking where order_status = 2 and DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')) d,\n" +
+                "\t(select count(1) hotelSum from booking where order_status = 2 and DATE_FORMAT(pay_time,'%Y-%m-%d') = DATE_FORMAT(DATE_SUB(NOW(),INTERVAL 1 DAY),'%Y-%m-%d')) e\n" +
+                ")";
+        List<IDCSum> list = null;
+        try{
+            list = namedParameterJdbcTemplate.query(sql, new BeanPropertyRowMapper<>(IDCSum.class));
+        }catch (Exception e){
+            e.printStackTrace();
+        }
+        if(list != null && list.size()>0) return list.get(0);
+        return null;
+    }
 }

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

@@ -14,7 +14,7 @@ import org.springframework.stereotype.Repository;
 import java.util.ArrayList;
 import java.util.List;
 
-@Repository("UserDao")
+@Repository("UsersDao")
 public class UserDaoImpl implements UserDao {
 
     @Autowired

+ 10 - 0
mhotel/src/com/happy/dto/HouseSumEto.java

@@ -16,6 +16,8 @@ public class HouseSumEto {
     private Integer houseResidueNum;
     //总房数
     private Integer houseNum;
+    //日期
+    private String orderStartTime;
 
     public Integer getManagerId() {
         return managerId;
@@ -72,4 +74,12 @@ public class HouseSumEto {
     public void setHouseNum(Integer houseNum) {
         this.houseNum = houseNum;
     }
+
+    public String getOrderStartTime() {
+        return orderStartTime;
+    }
+
+    public void setOrderStartTime(String orderStartTime) {
+        this.orderStartTime = orderStartTime;
+    }
 }

+ 10 - 10
mhotel/src/com/happy/dto/IDCSum.java

@@ -12,9 +12,9 @@ public class IDCSum {
 
     private Double salesAmountyDay;//昨日销售量
 
-    private Double bookNumRatio;//订单量比例
+    private Integer bookNumGrowth;//订单量增长量
 
-    private Double salesAmountRatio;//销售量比例
+    private Double salesAmountGrowth;//销售量增长量
 
     public Integer getHotelSum() {
         return hotelSum;
@@ -56,19 +56,19 @@ public class IDCSum {
         this.salesAmountyDay = salesAmountyDay;
     }
 
-    public Double getBookNumRatio() {
-        return bookNumRatio;
+    public Integer getBookNumGrowth() {
+        return bookNumGrowth;
     }
 
-    public void setBookNumRatio(Double bookNumRatio) {
-        this.bookNumRatio = bookNumRatio;
+    public void setBookNumGrowth(Integer bookNumGrowth) {
+        this.bookNumGrowth = bookNumGrowth;
     }
 
-    public Double getSalesAmountRatio() {
-        return salesAmountRatio;
+    public Double getSalesAmountGrowth() {
+        return salesAmountGrowth;
     }
 
-    public void setSalesAmountRatio(Double salesAmountRatio) {
-        this.salesAmountRatio = salesAmountRatio;
+    public void setSalesAmountGrowth(Double salesAmountGrowth) {
+        this.salesAmountGrowth = salesAmountGrowth;
     }
 }

+ 7 - 0
mhotel/src/com/happy/service/IDCService.java

@@ -3,6 +3,7 @@ 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 java.util.List;
 
@@ -32,4 +33,10 @@ public interface IDCService {
      */
     List<IDCRankEto> getRankSalesAmountData(String sqlx);
 
+    /**
+     * 描述:获取汇总信息
+     * @return
+     */
+    IDCSum getSumData();
+
 }

+ 6 - 0
mhotel/src/com/happy/service/impl/IDCImplService.java

@@ -4,6 +4,7 @@ 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.service.IDCService;
 import org.springframework.stereotype.Service;
 
@@ -35,4 +36,9 @@ public class IDCImplService implements IDCService {
     public List<IDCRankEto> getRankSalesAmountData(String sqlx) {
         return idcDao.getRankSalesAmountData(sqlx);
     }
+
+    @Override
+    public IDCSum getSumData() {
+        return idcDao.getSumData();
+    }
 }