|
|
@@ -98,9 +98,10 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:修改订单状态接单、入住、退房
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public String updateBookStatus(){
|
|
|
+ public String updateBookStatus() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
if (id == null) {
|
|
|
resultJson.put("message", "请传入订单id");
|
|
|
@@ -110,7 +111,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
//根据id获取当前订单信息
|
|
|
Booking book = bookService.getById(id);
|
|
|
- if(book==null){
|
|
|
+ if (book == null) {
|
|
|
resultJson.put("message", "未查询到订单");
|
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -118,7 +119,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
//获取用户openId
|
|
|
Users user = userService.queryByUserId(book.getCreateUserid());
|
|
|
- if(user.getOpenid()==null){
|
|
|
+ if (user.getOpenid() == null) {
|
|
|
resultJson.put("message", "用户openId为空,请该订单用户授权才能操作。");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -126,10 +127,10 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
String msg = "";
|
|
|
String sendMsg = "";
|
|
|
- try{
|
|
|
- switch (type){
|
|
|
+ try {
|
|
|
+ switch (type) {
|
|
|
case 1://接单
|
|
|
- if(!"2".equals(book.getOrderStatus())){
|
|
|
+ if (!"2".equals(book.getOrderStatus())) {
|
|
|
resultJson.put("message", "已支付状态才能接单");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -144,24 +145,24 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
List<HouseNumber> houseNumberList = houseNumberService.queryByHouseId(book.getHouseId());
|
|
|
List<String> Ids = new ArrayList<>();
|
|
|
AtomicInteger i = new AtomicInteger();
|
|
|
- if (houseNumbers != null){
|
|
|
+ if (houseNumbers != null) {
|
|
|
// houseNumberList.forEach(houseNumber -> {
|
|
|
// //添加的房间不在不可添加的房间当中并且数量小于订房总数
|
|
|
//
|
|
|
// });
|
|
|
List<String> houseStrs = houseNumbers.stream().map(HouseNumber::getId).collect(Collectors.toList());
|
|
|
- for (HouseNumber houseNumber: houseNumberList) {
|
|
|
- if (!houseStrs.contains(houseNumber.getId()) && i.get() < book.getHouseOrderNumber()){
|
|
|
+ for (HouseNumber houseNumber : houseNumberList) {
|
|
|
+ if (!houseStrs.contains(houseNumber.getId()) && i.get() < book.getHouseOrderNumber()) {
|
|
|
Ids.add(houseNumber.getId());
|
|
|
i.getAndIncrement();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//所有房间都可以预定
|
|
|
houseNumberList.forEach(houseNumber -> {
|
|
|
//添加的房间不在不可添加的房间当中并且数量小于订房总数
|
|
|
- if (i.get() < book.getHouseOrderNumber()){
|
|
|
+ if (i.get() < book.getHouseOrderNumber()) {
|
|
|
Ids.add(houseNumber.getId());
|
|
|
i.getAndIncrement();
|
|
|
}
|
|
|
@@ -170,7 +171,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
//添加民宿房态表
|
|
|
List<HouseNumberStatus> list = handleHouseStatus(Ids, 5, book);
|
|
|
int m = houseNumberStatusService.saveBatch(list);
|
|
|
- if (m == 0){
|
|
|
+ if (m == 0) {
|
|
|
resultJson.put("message", "确认失败");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -178,20 +179,20 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
break;
|
|
|
case 2://入住
|
|
|
- if(!"3".equals(book.getOrderStatus())){
|
|
|
+ if (!"3".equals(book.getOrderStatus())) {
|
|
|
resultJson.put("message", "待入住状态才能办理入住");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- if(houseNumberIds == null || "".equals(houseNumberIds)){
|
|
|
+ if (houseNumberIds == null || "".equals(houseNumberIds)) {
|
|
|
resultJson.put("message", "请分配房间号");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
List<String> ids = Arrays.asList(houseNumberIds.split(","));
|
|
|
- if(book.getHouseOrderNumber() != ids.size()){
|
|
|
+ if (book.getHouseOrderNumber() != ids.size()) {
|
|
|
resultJson.put("message", "房间数不一致");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -199,10 +200,10 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
List<HouseNumber> houseNumbers1 = houseNumberService.queryHouseStatus(book);
|
|
|
|
|
|
- if (houseNumbers1!=null){
|
|
|
- for (String id: ids){
|
|
|
- for (HouseNumber houseNumber: houseNumbers1){
|
|
|
- if (houseNumber.getStatus() != null && houseNumber.getStatus()==3 && id.equals(houseNumber.getId())){
|
|
|
+ if (houseNumbers1 != null) {
|
|
|
+ for (String id : ids) {
|
|
|
+ for (HouseNumber houseNumber : houseNumbers1) {
|
|
|
+ if (houseNumber.getStatus() != null && houseNumber.getStatus() == 3 && id.equals(houseNumber.getId())) {
|
|
|
resultJson.put("message", "选择的房间该时间段已有预定!请重新选择房间!");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -213,7 +214,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
//删除 预定房态
|
|
|
int a = houseNumberStatusService.updateHouseNumberStatus(String.valueOf(id));
|
|
|
- if (a == 0){
|
|
|
+ if (a == 0) {
|
|
|
resultJson.put("message", "确认失败");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -222,7 +223,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
//写入 入住数据
|
|
|
List<HouseNumberStatus> list1 = handleHouseStatus(ids, 6, book);
|
|
|
int n = houseNumberStatusService.saveBatch(list1);
|
|
|
- if (n == 0){
|
|
|
+ if (n == 0) {
|
|
|
resultJson.put("message", "确认失败");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -231,11 +232,11 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
book.setOrderStatus("4");
|
|
|
book.setLiveTime(UUIDUtil.getNewDate());
|
|
|
book.setUpdateTime(UUIDUtil.getNewDate());
|
|
|
- userService.addhotelAndUsers(book.getHotelId(),book.getCreateUserid(), TempEnum.住过); // 办理入住,则将信息写入用户入住过的酒店 editor by xieli
|
|
|
+ userService.addhotelAndUsers(book.getHotelId(), book.getCreateUserid(), TempEnum.住过); // 办理入住,则将信息写入用户入住过的酒店 editor by xieli
|
|
|
msg = "入住办理";
|
|
|
break;
|
|
|
case 3://退房
|
|
|
- if(!"4".equals(book.getOrderStatus())){
|
|
|
+ if (!"4".equals(book.getOrderStatus())) {
|
|
|
resultJson.put("message", "已入住状态才能办理退房");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -245,7 +246,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
String sql = " and booking_id = " + id;
|
|
|
List<HouseNumberStatus> houseNumberStatuse = houseNumberStatusService.getList(sql);
|
|
|
int i1 = houseNumberStatusService.updateHouseNumberStatus(String.valueOf(id));
|
|
|
- if (i1 == 0){
|
|
|
+ if (i1 == 0) {
|
|
|
resultJson.put("message", "退房失败");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -254,7 +255,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
//房间设为脏房
|
|
|
String numberIds = houseNumberStatuse.stream().map(HouseNumberStatus::getNumberId).distinct().collect(Collectors.joining());
|
|
|
int i2 = houseNumberService.updateHouseStatus(numberIds);
|
|
|
- if (i2 == 0){
|
|
|
+ if (i2 == 0) {
|
|
|
resultJson.put("message", "退房失败");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -267,19 +268,19 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
|
|
|
//通过订单id找到所属优惠券
|
|
|
- List<HotelCouponStatus> hotelCouponStatusList = hotelCoupomStatusService.getBookingId(book.getId()+"");
|
|
|
+ List<HotelCouponStatus> hotelCouponStatusList = hotelCoupomStatusService.getBookingId(book.getId() + "");
|
|
|
if (hotelCouponStatusList != null && hotelCouponStatusList.size() > 0) {
|
|
|
System.out.println("进入核销优惠券");
|
|
|
for (HotelCouponStatus hotelCouponStatus : hotelCouponStatusList) {
|
|
|
String complaintId = hotelCouponStatus.getComplaintId();
|
|
|
- System.out.println("核销优惠券id:"+complaintId);
|
|
|
+ System.out.println("核销优惠券id:" + complaintId);
|
|
|
HotelCoupon hotelCoupon = hotelCoupomService.getById(complaintId);
|
|
|
- if (hotelCoupon!=null) {
|
|
|
+ if (hotelCoupon != null) {
|
|
|
Integer reversedNumber = hotelCoupon.getReversedNumber();
|
|
|
- if (reversedNumber==null) {
|
|
|
- reversedNumber=0;
|
|
|
+ if (reversedNumber == null) {
|
|
|
+ reversedNumber = 0;
|
|
|
}
|
|
|
- hotelCoupon.setReversedNumber(reversedNumber+1);
|
|
|
+ hotelCoupon.setReversedNumber(reversedNumber + 1);
|
|
|
hotelCoupon.setModifyDate(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
hotelCoupomService.updatReversedNumber(hotelCoupon);
|
|
|
}
|
|
|
@@ -287,7 +288,6 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
break;
|
|
|
// case 4://退单
|
|
|
// if(!"2".equals(book.getOrderStatus())){
|
|
|
@@ -305,12 +305,12 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
int m = bookService.updateBooking(book);
|
|
|
if (m > 0) {
|
|
|
//推送信息
|
|
|
- if(!"".equals(sendMsg)){
|
|
|
- String liveTime = book.getOrderStartTime()!=null ? book.getOrderStartTime().substring(0,10):"";
|
|
|
- String endTime = book.getOrderEndTime()!=null ? book.getOrderEndTime().substring(0,10):"";
|
|
|
- String errmsg = Message.wxErrorMsg(Message.send(user.getOpenid(),book.getHotelName(),book.getOrderStatus(),liveTime,endTime,book.getHouseName()));
|
|
|
- if("请求成功".equals(errmsg)){
|
|
|
- resultJson.put("message", msg+"成功");
|
|
|
+ if (!"".equals(sendMsg)) {
|
|
|
+ String liveTime = book.getOrderStartTime() != null ? book.getOrderStartTime().substring(0, 10) : "";
|
|
|
+ String endTime = book.getOrderEndTime() != null ? book.getOrderEndTime().substring(0, 10) : "";
|
|
|
+ String errmsg = Message.wxErrorMsg(Message.send(user.getOpenid(), book.getHotelName(), book.getOrderStatus(), liveTime, endTime, book.getHouseName()));
|
|
|
+ if ("请求成功".equals(errmsg)) {
|
|
|
+ resultJson.put("message", msg + "成功");
|
|
|
resultJson.put("code", 200);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
@@ -321,17 +321,17 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- resultJson.put("message", msg+"成功");
|
|
|
+ resultJson.put("message", msg + "成功");
|
|
|
resultJson.put("code", 200);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
} else {
|
|
|
- resultJson.put("message", msg+"失败");
|
|
|
+ resultJson.put("message", msg + "失败");
|
|
|
resultJson.put("code", 502);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
resultJson.put("message", "未知异常");
|
|
|
@@ -343,7 +343,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
/**
|
|
|
* 根据传入传入房间号写入状态
|
|
|
*/
|
|
|
- private List<HouseNumberStatus> handleHouseStatus(List<String> Ids,int status,Booking book) throws ParseException {
|
|
|
+ private List<HouseNumberStatus> handleHouseStatus(List<String> Ids, int status, Booking book) throws ParseException {
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
|
|
DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
LocalDateTime str = LocalDateTime.parse(book.getOrderStartTime(), inputFormatter);
|
|
|
@@ -354,8 +354,8 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
LocalDate endDate = LocalDate.parse(B, formatter);
|
|
|
List<HouseNumberStatus> list = new ArrayList<>();
|
|
|
Date now = DateUtil.formateDate(DateUtil.getCurrentDate(), DateUtil.Time_Formatter_Second);
|
|
|
- for (String number : Ids){
|
|
|
- for (LocalDate date = strDate;!date.isAfter(endDate.minusDays(1));date = date.plusDays(1)){
|
|
|
+ for (String number : Ids) {
|
|
|
+ for (LocalDate date = strDate; !date.isAfter(endDate.minusDays(1)); date = date.plusDays(1)) {
|
|
|
HouseNumberStatus houseNumberStatus = new HouseNumberStatus();
|
|
|
houseNumberStatus.setNumberId(number);
|
|
|
houseNumberStatus.setId(String.valueOf(UUID.randomUUID()));
|
|
|
@@ -370,40 +370,42 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 描述:分页查询订单
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public String quearyBookPage(){
|
|
|
+ public String quearyBookPage() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
- if(managerId!=null){
|
|
|
+ if (managerId != null) {
|
|
|
s1.append(" and hotel_manager_id = '").append(managerId).append("'");
|
|
|
}
|
|
|
- if (ledgerParam!=null){
|
|
|
+ if (ledgerParam != null) {
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
}
|
|
|
- if(orderStatus!=null){
|
|
|
+ if (orderStatus != null) {
|
|
|
s1.append(" and order_status = ").append(orderStatus);
|
|
|
}
|
|
|
- if(payStartTime!=null && payEndTime!=null){
|
|
|
+ if (payStartTime != null && payEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') >= '").append(payStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') <= '").append(payEndTime).append("'");
|
|
|
}
|
|
|
- IPage<Booking> bookIPage = bookService.queryPage(s1.toString(),page,rows,"create_time");
|
|
|
+ IPage<Booking> bookIPage = bookService.queryPage(s1.toString(), page, rows, "create_time");
|
|
|
//获取订单汇总信息
|
|
|
BookTypeEto bookTypeEto = bookService.getBookStatusSum(s1.toString());
|
|
|
bookTypeEto.setSumAccount(new BigDecimal(bookTypeEto.getSumAccount()).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
|
|
bookTypeEto.setBookIPage(bookIPage);
|
|
|
|
|
|
- if(bookTypeEto!=null && !"".equals(bookTypeEto)){
|
|
|
+ if (bookTypeEto != null && !"".equals(bookTypeEto)) {
|
|
|
resultJson.put("message", "查询分页成功");
|
|
|
resultJson.put("code", 200);
|
|
|
resultJson.put("data", bookTypeEto);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultJson.put("message", "查询分页失败");
|
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -413,40 +415,41 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:导出订单
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
public String toBookExcel() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
s1.append(" and hotel_manager_id = '").append(managerId).append("'");
|
|
|
- if(managerId==null){
|
|
|
+ if (managerId == null) {
|
|
|
resultJson.put("code", 500);
|
|
|
resultJson.put("message", "managerId禁止为空");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
resultJson.toString());
|
|
|
}
|
|
|
- if (ledgerParam!=null){
|
|
|
+ if (ledgerParam != null) {
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
}
|
|
|
- if(orderStatus!=null){
|
|
|
+ if (orderStatus != null) {
|
|
|
s1.append(" and order_status = ").append(orderStatus);
|
|
|
}
|
|
|
- if(payStartTime!=null && payEndTime!=null){
|
|
|
+ if (payStartTime != null && payEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') >= '").append(payStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') <= '").append(payEndTime).append("'");
|
|
|
}
|
|
|
|
|
|
List<Booking> list = bookService.queryList(s1.toString()); // 查询分页
|
|
|
List<Vector> vectorsList = new ArrayList<>();
|
|
|
- if(list==null){
|
|
|
+ if (list == null) {
|
|
|
resultJson.put("code", 500);
|
|
|
resultJson.put("message", "无数据无法导出");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
resultJson.toString());
|
|
|
}
|
|
|
- for(Booking book:list){
|
|
|
+ for (Booking book : list) {
|
|
|
Vector columnValue = new Vector();
|
|
|
columnValue.add(book.getOrderNum());
|
|
|
columnValue.add(book.getOrderName());
|
|
|
@@ -461,7 +464,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
// 项目路径地址
|
|
|
String path = request.getSession().getServletContext()
|
|
|
.getRealPath("/download/");// File.separator
|
|
|
- try{
|
|
|
+ try {
|
|
|
Vector columnName = new Vector();
|
|
|
columnName.add("订单号");
|
|
|
columnName.add("状态");
|
|
|
@@ -472,7 +475,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
columnName.add("订单金额(元)");
|
|
|
columnName.add("支付时间");
|
|
|
|
|
|
- String filePathName ="订单信息" + UUIDUtil.generateID() +"Report.xls";
|
|
|
+ String filePathName = "订单信息" + UUIDUtil.generateID() + "Report.xls";
|
|
|
// 导出文件
|
|
|
new toExcel().book(vectorsList, path + filePathName,
|
|
|
"sheet1", columnName);
|
|
|
@@ -482,7 +485,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
resultJson.put("message", "导出成功");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
resultJson.toString());
|
|
|
- } catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return null;
|
|
|
@@ -490,51 +493,52 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:分页查询台账(查询以消费订单数据)
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public String quearyLedgerPage(){
|
|
|
+ public String quearyLedgerPage() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
s1.append(" and order_status in ('2','3','4','5','7','8','9','10') ");
|
|
|
- if(managerId!=null){
|
|
|
+ if (managerId != null) {
|
|
|
s1.append(" and hotel_manager_id = '").append(managerId).append("'");
|
|
|
}
|
|
|
- if (ledgerParam!=null){
|
|
|
+ if (ledgerParam != null) {
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
- .append(" or hotel_name like '%").append(ledgerParam).append("%'")//民宿名称
|
|
|
- .append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
- .append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
+ .append(" or hotel_name like '%").append(ledgerParam).append("%'")//民宿名称
|
|
|
+ .append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
+ .append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
}
|
|
|
- if(payStartTime!=null && payEndTime!=null){
|
|
|
+ if (payStartTime != null && payEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') >= '").append(payStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') <= '").append(payEndTime).append("'");
|
|
|
}
|
|
|
- if(leaveStartTime!=null && leaveEndTime!=null){
|
|
|
+ if (leaveStartTime != null && leaveEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(check_out_time,'%Y-%m-%d') >= '").append(leaveStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(check_out_time,'%Y-%m-%d') <= '").append(leaveEndTime).append("'");
|
|
|
}
|
|
|
- if(hotelTownship!=null){
|
|
|
+ if (hotelTownship != null) {
|
|
|
s1.append(" and hotel_township = '").append(hotelTownship).append("'");
|
|
|
}
|
|
|
- if(minTotalPrice!=null){
|
|
|
+ if (minTotalPrice != null) {
|
|
|
s1.append(" and house_total_price >= '").append(minTotalPrice).append("'");
|
|
|
}
|
|
|
- if(maxTotalPrice!=null){
|
|
|
+ if (maxTotalPrice != null) {
|
|
|
s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
|
|
|
}
|
|
|
- if(saccountState!=null){
|
|
|
+ if (saccountState != null) {
|
|
|
s1.append(" and saccount_state = '").append(saccountState).append("'");
|
|
|
}
|
|
|
- IPage<Booking> bookIPage = bookService.queryPage(s1.toString(),page,rows, "check_out_time");
|
|
|
+ IPage<Booking> bookIPage = bookService.queryPage(s1.toString(), page, rows, "check_out_time");
|
|
|
//获取订单汇总信息
|
|
|
BookTypeEto bookTypeEto = bookService.getBookStatusSum(s1.toString());
|
|
|
bookTypeEto.setBookIPage(bookIPage);
|
|
|
- if(bookTypeEto!=null && !"".equals(bookTypeEto)){
|
|
|
+ if (bookTypeEto != null && !"".equals(bookTypeEto)) {
|
|
|
resultJson.put("message", "查询分页成功");
|
|
|
resultJson.put("code", 200);
|
|
|
resultJson.put("data", bookTypeEto);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultJson.put("message", "查询分页失败");
|
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -554,14 +558,15 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
Booking booking = null;
|
|
|
try {
|
|
|
- booking = gson.fromJson(json.toString(), new TypeToken<Booking>() {}.getType());
|
|
|
+ booking = gson.fromJson(json.toString(), new TypeToken<Booking>() {
|
|
|
+ }.getType());
|
|
|
if (booking == null) {
|
|
|
resultjson.put("message", "数据为空");
|
|
|
resultjson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
- if (booking.getSaccountState()==null || booking.getHotelConfigList()==null ){
|
|
|
+ if (booking.getSaccountState() == null || booking.getHotelConfigList() == null) {
|
|
|
resultjson.put("message", "各参数不能为空");
|
|
|
resultjson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
@@ -591,39 +596,40 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:台账统计
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public String queryLedgerTj(){
|
|
|
+ public String queryLedgerTj() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
s1.append(" and order_status in ('2','3','4','5','7','8','9','10') ");
|
|
|
- if(managerId!=null){
|
|
|
+ if (managerId != null) {
|
|
|
s1.append(" and hotel_manager_id = '").append(managerId).append("'");
|
|
|
}
|
|
|
- if (ledgerParam!=null){
|
|
|
+ if (ledgerParam != null) {
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or hotel_name like '%").append(ledgerParam).append("%'")//民宿名称
|
|
|
.append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
}
|
|
|
- if(payStartTime!=null && payEndTime!=null){
|
|
|
+ if (payStartTime != null && payEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') >= '").append(payStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') <= '").append(payEndTime).append("'");
|
|
|
}
|
|
|
- if(leaveStartTime!=null && leaveEndTime!=null){
|
|
|
+ if (leaveStartTime != null && leaveEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(check_out_time,'%Y-%m-%d') >= '").append(leaveStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(check_out_time,'%Y-%m-%d') <= '").append(leaveEndTime).append("'");
|
|
|
}
|
|
|
- if(hotelTownship!=null){
|
|
|
+ if (hotelTownship != null) {
|
|
|
s1.append(" and hotel_township = '").append(hotelTownship).append("'");
|
|
|
}
|
|
|
- if(minTotalPrice!=null){
|
|
|
+ if (minTotalPrice != null) {
|
|
|
s1.append(" and house_total_price >= '").append(minTotalPrice).append("'");
|
|
|
}
|
|
|
- if(maxTotalPrice!=null){
|
|
|
+ if (maxTotalPrice != null) {
|
|
|
s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
|
|
|
}
|
|
|
- if(saccountState!=null){
|
|
|
+ if (saccountState != null) {
|
|
|
s1.append(" and saccount_state = '").append(saccountState).append("'");
|
|
|
}
|
|
|
Tongji orderT = bookService.queryOrderT(s1.toString());
|
|
|
@@ -642,9 +648,10 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:根据Id查询订单详细
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public String getById(){
|
|
|
+ public String getById() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
if (id == null) {
|
|
|
resultJson.put("message", "请传入id");
|
|
|
@@ -661,7 +668,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
resultJson.put("data", book);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
resultJson.put("message", "未查到用户信息");
|
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
@@ -671,51 +678,52 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:导出台账
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
public String toLedgerExcel() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
s1.append(" and order_status in ('2','3','4','5','7','8','9','10') ");
|
|
|
- if(managerId!=null){
|
|
|
+ if (managerId != null) {
|
|
|
s1.append(" and hotel_manager_id = '").append(managerId).append("'");
|
|
|
}
|
|
|
- if (ledgerParam!=null){
|
|
|
+ if (ledgerParam != null) {
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or hotel_name like '%").append(ledgerParam).append("%'")//民宿名称
|
|
|
.append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
}
|
|
|
- if(payStartTime!=null && payEndTime!=null){
|
|
|
+ if (payStartTime != null && payEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') >= '").append(payStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') <= '").append(payEndTime).append("'");
|
|
|
}
|
|
|
- if(leaveStartTime!=null && leaveEndTime!=null){
|
|
|
+ if (leaveStartTime != null && leaveEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(check_out_time,'%Y-%m-%d') >= '").append(leaveStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(check_out_time,'%Y-%m-%d') <= '").append(leaveEndTime).append("'");
|
|
|
}
|
|
|
- if(hotelTownship!=null){
|
|
|
+ if (hotelTownship != null) {
|
|
|
s1.append(" and hotel_township = '").append(hotelTownship).append("'");
|
|
|
}
|
|
|
- if(minTotalPrice!=null){
|
|
|
+ if (minTotalPrice != null) {
|
|
|
s1.append(" and house_total_price >= '").append(minTotalPrice).append("'");
|
|
|
}
|
|
|
- if(maxTotalPrice!=null){
|
|
|
+ if (maxTotalPrice != null) {
|
|
|
s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
|
|
|
}
|
|
|
- if(saccountState!=null){
|
|
|
+ if (saccountState != null) {
|
|
|
s1.append(" and saccount_state = '").append(saccountState).append("'");
|
|
|
}
|
|
|
|
|
|
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("message", "无数据无法导出");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
resultJson.toString());
|
|
|
}
|
|
|
List<Vector> vectorsList = new ArrayList<>();
|
|
|
- for(Booking book:list){
|
|
|
+ for (Booking book : list) {
|
|
|
Vector columnValue = new Vector();
|
|
|
columnValue.add(book.getOrderNum());
|
|
|
columnValue.add(book.getUserName());
|
|
|
@@ -727,9 +735,10 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
// 项目路径地址
|
|
|
String path = request.getSession().getServletContext()
|
|
|
- .getRealPath("/download/");;// File.separator
|
|
|
+ .getRealPath("/download/");
|
|
|
+ ;// File.separator
|
|
|
|
|
|
- try{
|
|
|
+ try {
|
|
|
Vector columnName = new Vector();
|
|
|
columnName.add("订单号");
|
|
|
columnName.add("预定人");
|
|
|
@@ -738,7 +747,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
columnName.add("订单金额");
|
|
|
columnName.add("退房时间");
|
|
|
|
|
|
- String filePathName ="台账信息" + UUIDUtil.generateID() +"Report.xls";
|
|
|
+ String filePathName = "台账信息" + UUIDUtil.generateID() + "Report.xls";
|
|
|
// 导出文件
|
|
|
new toExcel().book(vectorsList, path + filePathName,
|
|
|
"sheet1", columnName);
|
|
|
@@ -748,7 +757,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
resultJson.put("message", "导出成功");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
resultJson.toString());
|
|
|
- } catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return null;
|
|
|
@@ -757,50 +766,51 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
|
/**
|
|
|
* 描述:导出台账 管理端
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
public String toLedgerAdmimnExcel() {
|
|
|
JSONObject resultJson = new JSONObject();
|
|
|
StringBuilder s1 = new StringBuilder("");
|
|
|
s1.append(" and order_status = 5");
|
|
|
- if (ledgerParam!=null){
|
|
|
+ if (ledgerParam != null) {
|
|
|
s1.append(" and (order_num like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_name like '%").append(ledgerParam).append("%'")
|
|
|
.append(" or user_phone like '%").append(ledgerParam).append("%')");
|
|
|
}
|
|
|
- if(payStartTime!=null && payEndTime!=null){
|
|
|
+ if (payStartTime != null && payEndTime != null) {
|
|
|
s1.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') >= '").append(payStartTime).append("'")
|
|
|
.append(" and DATE_FORMAT(pay_time,'%Y-%m-%d') <= '").append(payEndTime).append("'");
|
|
|
}
|
|
|
- if(hotelTownship!=null){
|
|
|
+ if (hotelTownship != null) {
|
|
|
s1.append(" and hotel_township = '").append(payStartTime).append("'");
|
|
|
}
|
|
|
- if(minTotalPrice!=null){
|
|
|
+ if (minTotalPrice != null) {
|
|
|
s1.append(" and house_total_price >= '").append(minTotalPrice).append("'");
|
|
|
}
|
|
|
- if(maxTotalPrice!=null){
|
|
|
+ if (maxTotalPrice != null) {
|
|
|
s1.append(" and house_total_price <= '").append(maxTotalPrice).append("'");
|
|
|
}
|
|
|
|
|
|
List<Booking> list = bookService.queryList(s1.toString() + " order by check_out_time desc"); // 查询列表
|
|
|
List<HotelDict> hotelDicts = hotelDictService.queryList("and code = 10");
|
|
|
Map<Integer, String> dictMap = null;
|
|
|
- if(hotelDicts!=null && hotelDicts.size()>0){
|
|
|
- dictMap = hotelDicts.stream().collect(Collectors.toMap(HotelDict::getId, HotelDict::getName, (key1, key2) -> key1 ));
|
|
|
- }else{
|
|
|
+ if (hotelDicts != null && hotelDicts.size() > 0) {
|
|
|
+ dictMap = hotelDicts.stream().collect(Collectors.toMap(HotelDict::getId, HotelDict::getName, (key1, key2) -> key1));
|
|
|
+ } else {
|
|
|
resultJson.put("message", "未查到民宿乡镇信息");
|
|
|
resultJson.put("code", 500);
|
|
|
ResUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
|
|
|
return null;
|
|
|
}
|
|
|
List<Vector> vectorsList = new ArrayList<>();
|
|
|
- for(Booking book:list){
|
|
|
+ for (Booking book : list) {
|
|
|
Vector columnValue = new Vector();
|
|
|
AdminManager adminManager = adminManagerService.getById(book.getHotelManagerId());
|
|
|
- if(adminManager!=null){
|
|
|
+ if (adminManager != null) {
|
|
|
columnValue.add(dictMap.get(Integer.valueOf(adminManager.getHotelTownship())));//所属乡镇
|
|
|
columnValue.add(adminManager.getHotelName());//乡宿名称
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
columnValue.add("");//所属乡镇
|
|
|
columnValue.add("");//乡宿名称
|
|
|
}
|
|
|
@@ -813,9 +823,9 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
String path = request.getSession().getServletContext()
|
|
|
.getRealPath("/download/");// File.separator
|
|
|
|
|
|
- System.out.println("导出接口:"+path);
|
|
|
+ System.out.println("导出接口:" + path);
|
|
|
|
|
|
- try{
|
|
|
+ try {
|
|
|
Vector columnName = new Vector();
|
|
|
columnName.add("所属乡镇");
|
|
|
columnName.add("民宿名称");
|
|
|
@@ -823,7 +833,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
columnName.add("订单金额(元)");
|
|
|
columnName.add("退房时间");
|
|
|
|
|
|
- String filePathName ="台账信息" + UUIDUtil.generateID() +"Report.xls";
|
|
|
+ String filePathName = "台账信息" + UUIDUtil.generateID() + "Report.xls";
|
|
|
// 导出文件
|
|
|
new toExcel().book(vectorsList, path + filePathName,
|
|
|
"sheet1", columnName);
|
|
|
@@ -833,7 +843,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
resultJson.put("message", "导出成功");
|
|
|
ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
resultJson.toString());
|
|
|
- } catch (Exception e){
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
return null;
|
|
|
@@ -843,11 +853,11 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
/**
|
|
|
* 定时任务
|
|
|
*/
|
|
|
- public void setBookStatus(){
|
|
|
+ public void setBookStatus() {
|
|
|
|
|
|
System.out.println("自动接单定时程序");
|
|
|
|
|
|
- HotelDict respTime = hotelDictService.getById(1000011001);//响应时间
|
|
|
+ HotelDict respTime = hotelDictService.getById(1111111111);//响应时间
|
|
|
|
|
|
System.out.println("自动接单定时程序1");
|
|
|
|
|
|
@@ -858,16 +868,17 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
String sqlx = " and create_time <= DATE_SUB(NOW(), INTERVAL " + respTime.getName() + " MINUTE) and order_status = 2 and hotel_is_order = 1";
|
|
|
List<Booking> bookings = bookService.queryList(sqlx);
|
|
|
|
|
|
- System.out.println("自动接单定时程序3:"+sqlx);
|
|
|
+ System.out.println("自动接单定时程序3:" + sqlx);
|
|
|
|
|
|
- String result =bookings == null ? "" : bookings.stream().map(Booking::getOrderNum).collect(Collectors.joining());
|
|
|
+ String result = bookings == null ? "" : bookings.stream().map(Booking::getOrderNum).collect(Collectors.joining());
|
|
|
|
|
|
- System.out.println("自动接单,订单编号:"+result+";拼接条件:"+sqlx);
|
|
|
+ System.out.println("自动接单,订单编号:" + result + ";拼接条件:" + sqlx);
|
|
|
|
|
|
AtomicInteger n = new AtomicInteger();
|
|
|
- if ("1".equals(operate.getName())){
|
|
|
-
|
|
|
- for (Booking booking:bookings) {
|
|
|
+ if ("1".equals(operate.getName())) {
|
|
|
+ System.out.println("自动接单定时程序4");
|
|
|
+ for (Booking booking : bookings) {
|
|
|
+ System.out.println("自动接单定时程序5");
|
|
|
List<HouseNumberStatus> list = new ArrayList<>();
|
|
|
//不可入住的房间
|
|
|
List<HouseNumber> houseNumbers = houseNumberService.queryHouseStatus(booking);
|
|
|
@@ -875,19 +886,19 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
List<HouseNumber> houseNumberList = houseNumberService.queryByHouseId(booking.getHouseId());
|
|
|
AtomicInteger i = new AtomicInteger();
|
|
|
List<String> Ids = new ArrayList<>();
|
|
|
- if (houseNumbers != null){
|
|
|
+ if (houseNumbers != null) {
|
|
|
houseNumberList.forEach(houseNumber -> {
|
|
|
//添加的房间不在不可添加的房间当中并且数量小于订房总数
|
|
|
- if (!houseNumbers.contains(houseNumber) && i.get() < booking.getHouseOrderNumber()){
|
|
|
+ if (!houseNumbers.contains(houseNumber) && i.get() < booking.getHouseOrderNumber()) {
|
|
|
Ids.add(houseNumber.getId());
|
|
|
i.getAndIncrement();
|
|
|
}
|
|
|
});
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
//所有房间都可以预定
|
|
|
houseNumberList.forEach(houseNumber -> {
|
|
|
//添加的房间不在不可添加的房间当中并且数量小于订房总数
|
|
|
- if (i.get() < booking.getHouseOrderNumber()){
|
|
|
+ if (i.get() < booking.getHouseOrderNumber()) {
|
|
|
Ids.add(houseNumber.getId());
|
|
|
i.getAndIncrement();
|
|
|
}
|
|
|
@@ -908,8 +919,8 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
} catch (ParseException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
- for (String number : Ids){
|
|
|
- for (LocalDate date = strDate; !date.isAfter(endDate.minusDays(1)); date = date.plusDays(1)){
|
|
|
+ for (String number : Ids) {
|
|
|
+ for (LocalDate date = strDate; !date.isAfter(endDate.minusDays(1)); date = date.plusDays(1)) {
|
|
|
HouseNumberStatus houseNumberStatus = new HouseNumberStatus();
|
|
|
houseNumberStatus.setNumberId(number);
|
|
|
houseNumberStatus.setId(String.valueOf(UUID.randomUUID()));
|
|
|
@@ -923,16 +934,17 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
}
|
|
|
}
|
|
|
int m = houseNumberStatusService.saveBatch(list);
|
|
|
- if (m > 0){
|
|
|
+ if (m > 0) {
|
|
|
n.getAndIncrement();
|
|
|
booking.setOrderStatus("3");
|
|
|
booking.setUpdateTime(UUIDUtil.getNewDate());
|
|
|
bookService.updateBooking(booking);
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
+ System.out.println("自动接单定时程序6");
|
|
|
HotelDict dict = hotelDictService.getById(1000011999);
|
|
|
- bookings.forEach(booking -> {
|
|
|
+ for (Booking booking : bookings) {
|
|
|
Map<String, String> params = new HashMap<>();
|
|
|
params.put("bookingId", String.valueOf(booking.getId()));
|
|
|
try {
|
|
|
@@ -940,7 +952,7 @@ public class bookAction extends ActionSupport implements ServletRequestAware {
|
|
|
} catch (IOException e) {
|
|
|
throw new RuntimeException(e);
|
|
|
}
|
|
|
- });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|