diff --git a/HMS/src/main/java/com/hqyj/seven/controller/AlipayCallbackController.java b/HMS/src/main/java/com/hqyj/seven/controller/AlipayCallbackController.java index c534349b188bc8d676ab9d2ee0a42d1edd7a0534..cf330eebaf0128b6b182dd9f1191aeec771e6ef7 100644 --- a/HMS/src/main/java/com/hqyj/seven/controller/AlipayCallbackController.java +++ b/HMS/src/main/java/com/hqyj/seven/controller/AlipayCallbackController.java @@ -96,9 +96,7 @@ public class AlipayCallbackController { //注意: //付款完成后,支付宝系统发送该交易状态通知 } - out.println("success"); - } else {//验证失败 out.println("fail"); diff --git a/HMS/src/main/java/com/hqyj/seven/pojo/Enter.java b/HMS/src/main/java/com/hqyj/seven/pojo/Enter.java index f31f348f84df8564c54f2a5286bf9277a2d85d6d..cef247d67f4badd6780b26d76a434110a725c640 100644 --- a/HMS/src/main/java/com/hqyj/seven/pojo/Enter.java +++ b/HMS/src/main/java/com/hqyj/seven/pojo/Enter.java @@ -12,7 +12,7 @@ public class Enter { private Date end_time_estimate; private Date end_time_actual; private double fee_total; - private int fee_info; + private String fee_info; private int user_id; private String state; private double price; @@ -21,6 +21,20 @@ public class Enter { private String end_time_estimate1; private String end_time_actual1; + public Enter(int house_id, int customer_id, int customer_info, Date start_time, Date end_time_estimate, Date end_time_actual, double fee_total, String fee_info, int user_id, String state, double price) { + this.house_id = house_id; + this.customer_id = customer_id; + this.customer_info = customer_info; + this.start_time = start_time; + this.end_time_estimate = end_time_estimate; + this.end_time_actual = end_time_actual; + this.fee_total = fee_total; + this.fee_info = fee_info; + this.user_id = user_id; + this.state = state; + this.price = price; + } + public String getStart_time1() { return start_time1; } @@ -135,13 +149,7 @@ public class Enter { this.fee_total = fee_total; } - public int getFee_info() { - return fee_info; - } - public void setFee_info(int fee_info) { - this.fee_info = fee_info; - } public int getUser_id() { return user_id; @@ -159,14 +167,20 @@ public class Enter { this.state = state; } + public String getFee_info() { + return fee_info; + } + public void setFee_info(String fee_info) { + this.fee_info = fee_info; + } public void setPrice(float price) { this.price = price; } - - public Enter(int house_id, int customer_id, int customer_info, Date start_time, Date end_time_estimate, Date end_time_actual, double fee_total, int fee_info, int user_id, String state, double price) { + public Enter(int house_id, int customer_id, int customer_info, Date start_time, Date end_time_estimate, Date end_time_actual, double fee_total, String fee_info, int user_id, String state, double price, String start_time1, String end_time_estimate1, String end_time_actual1, List customers) { + this.enter_id = enter_id; this.house_id = house_id; this.customer_id = customer_id; this.customer_info = customer_info; @@ -178,27 +192,12 @@ public class Enter { this.user_id = user_id; this.state = state; this.price = price; + this.start_time1 = start_time1; + this.end_time_estimate1 = end_time_estimate1; + this.end_time_actual1 = end_time_actual1; + this.customers = customers; } public Enter() { } - - @Override - public String toString() { - return "Enter{" + - "enter_id=" + enter_id + - ", house_id='" + house_id + '\'' + - ", customer_id=" + customer_id + - ", customer_info='" + customer_info + '\'' + - ", start_time1='" + start_time1 + '\'' + - ", end_time_estimate1='" + end_time_estimate1 + '\'' + - ", end_time_actual1='" + end_time_actual1 + '\'' + - ", fee_total=" + fee_total + - ", fee_info=" + fee_info + - ", user_id=" + user_id + - ", state='" + state + '\'' + - ", price=" + price + - ", customers=" + customers + - '}'; - } } diff --git a/HMS/src/main/java/com/hqyj/seven/service/impl/HouseServiceImpl.java b/HMS/src/main/java/com/hqyj/seven/service/impl/HouseServiceImpl.java index e5a847abb6069ed32dd7fbf452eb7145840496ef..dba4110dbefc455d673836aa191d054ee1b5966a 100644 --- a/HMS/src/main/java/com/hqyj/seven/service/impl/HouseServiceImpl.java +++ b/HMS/src/main/java/com/hqyj/seven/service/impl/HouseServiceImpl.java @@ -332,6 +332,7 @@ public class HouseServiceImpl implements HouseService { Date time3 = new Date(time2); //如果房间是空闲则之间可以入住 SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String fee_info = Long.toString(System.currentTimeMillis()); if (house.getState().equals("空闲")) { double money = house.getPrice() * day; //如果余额不足则会提示 @@ -340,7 +341,7 @@ public class HouseServiceImpl implements HouseService { customerDao.updataByCustomerIdToremainder(0, customerId); //插入顾客表 enterDao.inserintoEnter(new Enter(house.getHouseId(), customerId, - numberOfPeople, time, time3, null, 0, 1, userId, "未结账", house.getPrice())); + numberOfPeople, time, time3, null, 0, fee_info, userId, "未结账", house.getPrice())); //设置时间格式为yyyy-MM-dd HH:mm:ss以便插入 //规范化插入表时的时间和获取的时间有点误差 Enter enter = enterDao.queryByHouseIdAndLimitOne(house.getHouseId()); @@ -354,9 +355,10 @@ public class HouseServiceImpl implements HouseService { } else { //更新顾客表余额的数据 customerDao.updataByCustomerIdToremainder(money, customerId); + //插入顾客表 enterDao.inserintoEnter(new Enter(house.getHouseId(), customerId, - numberOfPeople, time, time3, null, money, 1, userId, "已结账", house.getPrice())); + numberOfPeople, time, time3, null, money, fee_info,userId, "已结账", house.getPrice())); //设置时间格式为yyyy-MM-dd HH:mm:ss以便插入 //规范化插入表时的时间和获取的时间有点误差 Enter enter = enterDao.queryByHouseIdAndLimitOne(house.getHouseId()); @@ -379,7 +381,7 @@ public class HouseServiceImpl implements HouseService { customerDao.updataByCustomerIdToremainder(0, customerId); //插入顾客表 enterDao.inserintoEnter(new Enter(house.getHouseId(), customerId, - numberOfPeople, time, time3, null, 0, 1, userId, "未缴费", house.getPrice())); + numberOfPeople, time, time3, null, 0, fee_info, userId, "未缴费", house.getPrice())); //设置时间格式为yyyy-MM-dd HH:mm:ss以便插入 //规范化插入表时的时间和获取的时间有点误差 Enter enter = enterDao.queryByHouseIdAndLimitOne(house.getHouseId()); @@ -397,7 +399,7 @@ public class HouseServiceImpl implements HouseService { customerDao.updataByCustomerIdToremainder(money, customerId); //插入顾客表 enterDao.inserintoEnter(new Enter(house.getHouseId(), customerId, - numberOfPeople, time, time3, null, money, 1, userId, "已结账", house.getPrice())); + numberOfPeople, time, time3, null, money, fee_info, userId, "已结账", house.getPrice())); //设置时间格式为yyyy-MM-dd HH:mm:ss以便插入 //规范化插入表时的时间和获取的时间有点误差 Enter enter = enterDao.queryByHouseIdAndLimitOne(house.getHouseId());