|
@@ -1,4 +1,6 @@
|
|
|
package org.jeecg.modules.bus.controller;
|
|
package org.jeecg.modules.bus.controller;
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
|
|
|
+import com.alibaba.druid.support.json.JSONUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -7,6 +9,7 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
+import net.sf.json.JSON;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.jeecg.annotation.ApiLogin;
|
|
import org.jeecg.annotation.ApiLogin;
|
|
@@ -19,6 +22,7 @@ import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
import org.jeecg.common.system.util.JwtUtil;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
|
|
+import org.jeecg.common.util.RedisUtil;
|
|
|
import org.jeecg.common.util.TenantContextHolder;
|
|
import org.jeecg.common.util.TenantContextHolder;
|
|
|
import org.jeecg.common.util.TokenUtils;
|
|
import org.jeecg.common.util.TokenUtils;
|
|
|
import org.jeecg.config.ApiVersion;
|
|
import org.jeecg.config.ApiVersion;
|
|
@@ -29,6 +33,8 @@ import org.jeecg.modules.business.entity.*;
|
|
|
import org.jeecg.modules.business.service.*;
|
|
import org.jeecg.modules.business.service.*;
|
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
import org.jeecg.modules.business.util.MapUtil;
|
|
|
import org.jeecg.modules.business.vo.KeLiItemVo;
|
|
import org.jeecg.modules.business.vo.KeLiItemVo;
|
|
|
|
|
+import org.jeecg.modules.mall.entity.MallHotelOrder;
|
|
|
|
|
+import org.jeecg.modules.mall.service.IMallHotelOrderService;
|
|
|
import org.jeecg.modules.order.entity.CesOrderComment;
|
|
import org.jeecg.modules.order.entity.CesOrderComment;
|
|
|
import org.jeecg.modules.order.service.impl.CesOrderCommentServiceImpl;
|
|
import org.jeecg.modules.order.service.impl.CesOrderCommentServiceImpl;
|
|
|
import org.jeecg.modules.rooms.DTO.CanUseRequestParamDto;
|
|
import org.jeecg.modules.rooms.DTO.CanUseRequestParamDto;
|
|
@@ -42,6 +48,8 @@ import org.jeecg.modules.rooms.service.CesRoomsServiceImpl;
|
|
|
import org.jeecg.modules.rooms.service.ICesRoomLayoutPriceDateService;
|
|
import org.jeecg.modules.rooms.service.ICesRoomLayoutPriceDateService;
|
|
|
import org.jeecg.modules.system.entity.SysTenant;
|
|
import org.jeecg.modules.system.entity.SysTenant;
|
|
|
import org.jeecg.modules.system.service.ISysTenantService;
|
|
import org.jeecg.modules.system.service.ISysTenantService;
|
|
|
|
|
+import org.jeecg.modules.wxuser.entity.MallUserInfo;
|
|
|
|
|
+import org.jeecg.modules.wxuser.entity.ThirdSession;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
@@ -50,10 +58,7 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.Arrays;
|
|
|
|
|
-import java.util.Date;
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 酒店列表
|
|
* 酒店列表
|
|
@@ -82,7 +87,8 @@ public class HotelController extends WebConfig {
|
|
|
private IBusBookingRoomsService busBookingRoomsService;
|
|
private IBusBookingRoomsService busBookingRoomsService;
|
|
|
@Resource
|
|
@Resource
|
|
|
private CesRoomLayoutPriceServiceImpl cesRoomLayoutPriceService;
|
|
private CesRoomLayoutPriceServiceImpl cesRoomLayoutPriceService;
|
|
|
-
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IMallHotelOrderService mallHotelOrderService;
|
|
|
/**
|
|
/**
|
|
|
* 酒店列表查询
|
|
* 酒店列表查询
|
|
|
*
|
|
*
|
|
@@ -144,6 +150,22 @@ public class HotelController extends WebConfig {
|
|
|
@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
public Result<BusHotel> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
public Result<BusHotel> queryById(@RequestParam(name = "id", required = true) String id) {
|
|
|
BusHotel busHotel = busHotelService.getById(id);
|
|
BusHotel busHotel = busHotelService.getById(id);
|
|
|
|
|
+
|
|
|
|
|
+// String token = UUID.randomUUID().toString();
|
|
|
|
|
+// ThirdSession thirdSession = new ThirdSession();
|
|
|
|
|
+// thirdSession.setTenantId("5");
|
|
|
|
|
+// thirdSession.setAppId("wx25c23ef33ba80ee5");
|
|
|
|
|
+// thirdSession.setSessionKey("");
|
|
|
|
|
+// thirdSession.setWxUserId("111111111");
|
|
|
|
|
+// thirdSession.setOpenId("");
|
|
|
|
|
+// thirdSession.setUserId("111111111");
|
|
|
|
|
+//
|
|
|
|
|
+// String key = CommonConstant.PREFIX_WX_APP_USER_TOKEN + token;
|
|
|
|
|
+// // 设置token缓存有效时间
|
|
|
|
|
+// redisUtil.set(key, com.alibaba.fastjson.JSON.toJSONString(thirdSession));
|
|
|
|
|
+//// redisUtil.set(key, JSONUtils.toJSONString(thirdSession));
|
|
|
|
|
+// redisUtil.expire(key, JwtUtil.EXPIRE_TIME * 24 * 30 / 1000);
|
|
|
|
|
+// busHotel.setTenantId(token);
|
|
|
return Result.OK(busHotel);
|
|
return Result.OK(busHotel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -218,6 +240,39 @@ public class HotelController extends WebConfig {
|
|
|
return Result.OK("预定成功", busRoomBookingOrdersService.bookingOrderSave(busRoomBookingOrders, isTeam));
|
|
return Result.OK("预定成功", busRoomBookingOrdersService.bookingOrderSave(busRoomBookingOrders, isTeam));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 生成16位数字+prefix
|
|
|
|
|
+ * @param prefix
|
|
|
|
|
+ * @return
|
|
|
|
|
+ */
|
|
|
|
|
+ private String randomNumber(String prefix) {
|
|
|
|
|
+ int first = new Random(10).nextInt(8) + 1;
|
|
|
|
|
+ int hashCode = UUID.randomUUID().toString().hashCode();
|
|
|
|
|
+ if (hashCode < 0) {
|
|
|
|
|
+ hashCode = -hashCode;
|
|
|
|
|
+ }
|
|
|
|
|
+ return prefix + first + String.format("%015d", hashCode);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @AutoLog(value = "酒店预定订单-添加")
|
|
|
|
|
+ @ApiOperation(value = "酒店预定订单-添加", notes = "酒店预定订单-添加")
|
|
|
|
|
+ @PostMapping(value = "/hotel-order")
|
|
|
|
|
+ @ApiLogin
|
|
|
|
|
+ @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
|
|
|
|
|
+ public Result<String> hotelOrderAdd(@RequestBody MallHotelOrder mallHotelOrder) {
|
|
|
|
|
+ String tenantId = TenantContextHolder.getTenantId();
|
|
|
|
|
+ String userId = ThirdSessionHolder.getUserId();
|
|
|
|
|
+ mallHotelOrder.setTenantId(tenantId);
|
|
|
|
|
+ mallHotelOrder.setMallUserId(userId);
|
|
|
|
|
+ mallHotelOrder.setCreateTime(DateTime.now());
|
|
|
|
|
+ String prefix = "YD";
|
|
|
|
|
+ mallHotelOrder.setCode(randomNumber(prefix));
|
|
|
|
|
+ mallHotelOrder.setPayType(1);
|
|
|
|
|
+ mallHotelOrder.setStatus(5);
|
|
|
|
|
+ mallHotelOrderService.save(mallHotelOrder);
|
|
|
|
|
+ return Result.OK("预定成功");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 预定/入住订单列表
|
|
* 预定/入住订单列表
|