Kaynağa Gözat

Merge branch 'master' of http://49.4.53.36:3000/hotel/hotel-saas-backend

覃浩 2 yıl önce
ebeveyn
işleme
5f302029eb
18 değiştirilmiş dosya ile 451 ekleme ve 81 silme
  1. 6 7
      jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/CouponsCashUsedController.java
  2. 60 5
      jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/HotelController.java
  3. 4 27
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/controller/MallCollectHotelController.java
  4. 1 23
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/controller/MallContactController.java
  5. 1 4
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/MallCollectHotelMapper.java
  6. 0 3
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/MallContactMapper.java
  7. 2 2
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/xml/MallCollectHotelMapper.xml
  8. 2 2
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/xml/MallContactMapper.xml
  9. 1 1
      jeecg-mall-api/src/main/java/org/jeecg/modules/mall/service/IMallCollectHotelService.java
  10. 0 1
      jeecg-mall-api/src/main/java/org/jeecg/modules/wxuser/controller/WxUserController.java
  11. 13 6
      jeecg-mall-api/src/main/java/org/jeecg/modules/wxuser/service/impl/UserInfoServiceImpl.java
  12. 4 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusMarketCouponsCashUsed.java
  13. 178 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/controller/MallHotelOrderController.java
  14. 124 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/entity/MallHotelOrder.java
  15. 17 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/mapper/MallHotelOrderMapper.java
  16. 5 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/mapper/xml/MallHotelOrderMapper.xml
  17. 14 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/service/IMallHotelOrderService.java
  18. 19 0
      jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/service/impl/MallHotelOrderServiceImpl.java

+ 6 - 7
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/CouponsCashUsedController.java

@@ -25,11 +25,9 @@ import org.jeecg.config.WebConfig;
 import org.jeecg.modules.business.dto.CouponsGenerateDto;
 import org.jeecg.modules.business.dto.PostDataDto;
 import org.jeecg.modules.business.dto.ProvideCouponsUsedDto;
-import org.jeecg.modules.business.entity.BusMarketCoupons;
-import org.jeecg.modules.business.entity.BusMarketCouponsCashUsed;
-import org.jeecg.modules.business.entity.BusMarketCouponsUsed;
-import org.jeecg.modules.business.entity.BusMarketMealCouponsUsed;
+import org.jeecg.modules.business.entity.*;
 import org.jeecg.modules.business.enums.CouponsStatusEnum;
+import org.jeecg.modules.business.service.IBusMarketCouponsCashService;
 import org.jeecg.modules.business.service.IBusMarketCouponsCashUsedService;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -68,7 +66,8 @@ public class CouponsCashUsedController extends WebConfig {
     private IBusMarketCouponsCashUsedService busMarketCouponsCashUsedService;
     @Resource
     private IBusMarketCouponsService busMarketCouponsService;
-
+    @Resource
+private IBusMarketCouponsCashService busMarketCouponsCashService;
     /**
      * 获取我的可用优惠券分页列表查询
      *
@@ -95,9 +94,9 @@ public class CouponsCashUsedController extends WebConfig {
         Page<BusMarketCouponsCashUsed> page = new Page<BusMarketCouponsCashUsed>(pageNo, pageSize);
         IPage<BusMarketCouponsCashUsed> pageList = busMarketCouponsCashUsedService.page(page, queryWrapper);
         pageList.getRecords().forEach(item -> {
-            BusMarketCoupons coupons = busMarketCouponsService.getById(item.getCouponsId());
+            BusMarketCouponsCash coupons = busMarketCouponsCashService.getById(item.getCouponsId());
             if (coupons != null) {
-                item.setConponsName(coupons.getName());
+                item.setBusMarketCouponsCash(coupons);
             }
             CouponsStatusEnum couponsStatusEnum = CouponsStatusEnum.val(item.getStatus());
             if (couponsStatusEnum != null) {

+ 60 - 5
jeecg-mall-api/src/main/java/org/jeecg/modules/bus/controller/HotelController.java

@@ -1,4 +1,6 @@
 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.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -7,6 +9,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
+import net.sf.json.JSON;
 import org.apache.commons.lang3.ObjectUtils;
 import org.apache.commons.lang3.StringUtils;
 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.util.JwtUtil;
 import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.common.util.RedisUtil;
 import org.jeecg.common.util.TenantContextHolder;
 import org.jeecg.common.util.TokenUtils;
 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.util.MapUtil;
 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.service.impl.CesOrderCommentServiceImpl;
 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.system.entity.SysTenant;
 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.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
@@ -50,10 +58,7 @@ import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 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;
     @Resource
     private CesRoomLayoutPriceServiceImpl cesRoomLayoutPriceService;
-
+    @Resource
+    private IMallHotelOrderService mallHotelOrderService;
     /**
      * 酒店列表查询
      *
@@ -144,6 +150,22 @@ public class HotelController extends WebConfig {
     @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result<BusHotel> queryById(@RequestParam(name = "id", required = true) String 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);
     }
 
@@ -218,6 +240,39 @@ public class HotelController extends WebConfig {
         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("预定成功");
+    }
+
 
     /**
      * 预定/入住订单列表

+ 4 - 27
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/controller/MallCollectHotelController.java

@@ -1,15 +1,7 @@
 package org.jeecg.modules.mall.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import org.jeecg.annotation.ApiLogin;
@@ -17,37 +9,22 @@ import org.jeecg.com.util.ThirdSessionHolder;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.TenantContextHolder;
-import org.jeecg.common.util.oConvertUtils;
 import org.jeecg.config.ApiVersion;
 import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.config.WebConfig;
 import org.jeecg.modules.mall.entity.MallCollectHotel;
-import org.jeecg.modules.mall.entity.MallContact;
 import org.jeecg.modules.mall.service.IMallCollectHotelService;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.jeecg.common.aspect.annotation.AutoLog;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 
- /**
+/**
  * @Description: mall_collect_hotel
  * @Author: jeecg-boot
  * @Date:   2023-04-27
@@ -75,9 +52,9 @@ public class MallCollectHotelController extends WebConfig {
 	@ApiLogin
 	@ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
 	public Result<IPage<MallCollectHotel>> queryPageList(MallCollectHotel mallCollectHotel,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
+														 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+														 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+														 HttpServletRequest req) {
 		LambdaQueryWrapper<MallCollectHotel> queryWrapper = QueryGenerator.initQueryWrapper(mallCollectHotel, req.getParameterMap()).lambda();
 		String userId = ThirdSessionHolder.getUserId();
 		queryWrapper.eq(MallCollectHotel::getUserId,userId);

+ 1 - 23
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/controller/MallContactController.java

@@ -1,15 +1,7 @@
 package org.jeecg.modules.mall.controller;
 
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 
@@ -18,9 +10,7 @@ import org.jeecg.com.util.ThirdSessionHolder;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.TenantContextHolder;
-import org.jeecg.common.util.oConvertUtils;
 
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
@@ -30,24 +20,12 @@ import org.jeecg.config.ApiVersionConstant;
 import org.jeecg.config.WebConfig;
 import org.jeecg.modules.mall.entity.MallContact;
 import org.jeecg.modules.mall.service.IMallContactService;
-import org.jeecgframework.poi.excel.ExcelImportUtil;
-import org.jeecgframework.poi.excel.def.NormalExcelConstants;
-import org.jeecgframework.poi.excel.entity.ExportParams;
-import org.jeecgframework.poi.excel.entity.ImportParams;
-import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
-import org.jeecg.common.system.base.controller.JeecgController;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-import org.springframework.web.multipart.MultipartHttpServletRequest;
-import org.springframework.web.servlet.ModelAndView;
-import com.alibaba.fastjson.JSON;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.jeecg.common.aspect.annotation.AutoLog;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
 
- /**
+/**
  * @Description: mall_contact
  * @Author: jeecg-boot
  * @Date:   2023-04-26

+ 1 - 4
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/MallCollectHotelMapper.java

@@ -1,10 +1,7 @@
 package org.jeecg.modules.mall.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
-import org.jeecg.modules.mall.entity.MallCollectHotel;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.mall.entity.MallCollectHotel;
 
 /**
  * @Description: mall_collect_hotel

+ 0 - 3
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/MallContactMapper.java

@@ -1,8 +1,5 @@
 package org.jeecg.modules.mall.mapper;
 
-import java.util.List;
-
-import org.apache.ibatis.annotations.Param;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.jeecg.modules.mall.entity.MallContact;
 

+ 2 - 2
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/xml/MallCollectHotelMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.demo.mall.mapper.MallCollectHotelMapper">
+<mapper namespace="org.jeecg.modules.mall.mapper.MallCollectHotelMapper">
 
-</mapper>
+</mapper>

+ 2 - 2
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/mapper/xml/MallContactMapper.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="org.jeecg.modules.demo.mall.mapper.MallContactMapper">
+<mapper namespace="org.jeecg.modules.mall.mapper.MallContactMapper">
 
-</mapper>
+</mapper>

+ 1 - 1
jeecg-mall-api/src/main/java/org/jeecg/modules/mall/service/IMallCollectHotelService.java

@@ -1,7 +1,7 @@
 package org.jeecg.modules.mall.service;
 
-import org.jeecg.modules.mall.entity.MallCollectHotel;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.mall.entity.MallCollectHotel;
 
 /**
  * @Description: mall_collect_hotel

+ 0 - 1
jeecg-mall-api/src/main/java/org/jeecg/modules/wxuser/controller/WxUserController.java

@@ -62,7 +62,6 @@ public class WxUserController extends WebConfig {
      */
     @ApiOperation(value = "通过小程序授权手机号一键登录商城")
     @PostMapping("/ma-phone-login")
-    @ApiLogin
     @ApiVersion(group = ApiVersionConstant.FAP_MALLAPI101)
     public Result loginByPhoneMa(HttpServletRequest request, @RequestBody WxOpenDataDto dto) {
         try {

+ 13 - 6
jeecg-mall-api/src/main/java/org/jeecg/modules/wxuser/service/impl/UserInfoServiceImpl.java

@@ -4,6 +4,7 @@ import cn.binarywang.wx.miniapp.api.WxMaUserService;
 import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
 import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;
 import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo;
+import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.util.StrUtil;
 import com.alibaba.druid.support.json.JSONUtils;
@@ -50,7 +51,7 @@ public class UserInfoServiceImpl extends ServiceImpl<UserInfoMapper, MallUserInf
 private IWxAppConfigService wxAppConfigService;
     @Resource
     private  RedisTemplate redisTemplate;
-    @Autowired
+    @Resource
     private RedisUtil redisUtil;
     @Resource
     private IWxUserService wxUserService;
@@ -73,7 +74,8 @@ private IWxAppConfigService wxAppConfigService;
         //通过code获取微信用户信息
         try {
             WxMaInRedisConfigStorage configStorage = new WxMaInRedisConfigStorage(redisTemplate);
-            configStorage.setAppid(wxApp.getId());
+//            WxMaDefaultConfigImpl configStorage = new WxMaDefaultConfigImpl();
+            configStorage.setAppid(wxApp.getAppId());
             configStorage.setSecret(wxApp.getAppSecret());
             WxMaService wxMaService = new WxMaServiceImpl();
             wxMaService.setWxMaConfig(configStorage);
@@ -92,6 +94,7 @@ private IWxAppConfigService wxAppConfigService;
             wxUser.setUnionId(jscode2session.getUnionid());
         } catch (WxErrorException e) {
             e.printStackTrace();
+
             throw new JeecgBootException("小程序获取登录后的微信用户失败:" + e.getMessage());
         }
         System.out.println("【授权登录前】" + wxUser.toString());
@@ -99,6 +102,7 @@ private IWxAppConfigService wxAppConfigService;
         if (wxUser == null || StrUtil.isBlank(wxUser.getId())) {
             //新增微信用户
             wxUser.setAppId(wxApp.getId());
+            wxUser.setTenantId(TenantContextHolder.getTenantId());
             wxUser.setAppType(wxApp.getAppType());
             wxUserService.saveOrUpdate(wxUser);
         }
@@ -113,7 +117,7 @@ private IWxAppConfigService wxAppConfigService;
         String token = UUID.randomUUID().toString();
         ThirdSession thirdSession = new ThirdSession();
         thirdSession.setTenantId(wxApp.getTenantId());
-        thirdSession.setAppId(wxApp.getId());
+        thirdSession.setAppId(wxApp.getAppId());
         thirdSession.setSessionKey(wxUser.getSessionKey());
         thirdSession.setWxUserId(wxUser.getId());
         thirdSession.setOpenId(wxUser.getOpenId());
@@ -122,7 +126,7 @@ private IWxAppConfigService wxAppConfigService;
         String key = CommonConstant.PREFIX_WX_APP_USER_TOKEN + token;
 
         // 设置token缓存有效时间
-        redisUtil.set(key, JSONUtils.toJSONString(thirdSession));
+        redisUtil.set(key, com.alibaba.fastjson.JSON.toJSONString(thirdSession));
         redisUtil.expire(key, JwtUtil.EXPIRE_TIME * 24 * 30 / 1000);
         userInfo.setToken(token);
         return userInfo;
@@ -137,6 +141,7 @@ private IWxAppConfigService wxAppConfigService;
         ThirdSession thirdSession = ThirdSessionHolder.getThirdSession();
         String key = CommonConstant.PREFIX_WX_APP_USER_TOKEN + token;
         dto.setSessionKey(thirdSession.getSessionKey());
+        dto.setAppId(thirdSession.getAppId());
         //解密获取手机号
         LambdaQueryWrapper<WxAppConfig> lambdaQueryWrapper = new LambdaQueryWrapper<>();
         lambdaQueryWrapper.eq(WxAppConfig::getAppId, dto.getAppId());
@@ -147,7 +152,7 @@ private IWxAppConfigService wxAppConfigService;
         String phone = "";
         try {
             WxMaInRedisConfigStorage configStorage = new WxMaInRedisConfigStorage(redisTemplate);
-            configStorage.setAppid(wxApp.getId());
+            configStorage.setAppid(wxApp.getAppId());
             configStorage.setSecret(wxApp.getAppSecret());
             WxMaService wxMaService = new WxMaServiceImpl();
             wxMaService.setWxMaConfig(configStorage);
@@ -172,6 +177,7 @@ private IWxAppConfigService wxAppConfigService;
                 .eq(MallUserInfo::getMobile, mobile));
         if (userInfo == null) {//不是商城用户,则新增
             userInfo = new MallUserInfo();
+            userInfo.setTenantId(TenantContextHolder.getTenantId());
             userInfo.setCreateTime(DateTime.now());
             userInfo.setUpdateTime(DateTime.now());
         }
@@ -210,6 +216,7 @@ private IWxAppConfigService wxAppConfigService;
         String mallUserId = userInfo.getId();
         wxUser.setUserId(mallUserId);
         wxUser.setMobile(mobile);
+        wxUserService.saveOrUpdate(wxUser);
 
         userInfo.setToken(StrUtil.removeAll(key, CommonConstant.PREFIX_WX_APP_USER_TOKEN));
         //更新微信用户
@@ -217,7 +224,7 @@ private IWxAppConfigService wxAppConfigService;
         //更新redis中的thirdSession
         thirdSession.setUserId(mallUserId);
         // 设置token缓存有效时间
-        redisUtil.set(key, JSONUtils.toJSONString(thirdSession));
+        redisUtil.set(key, com.alibaba.fastjson.JSON.toJSONString(thirdSession));
         redisUtil.expire(key, JwtUtil.EXPIRE_TIME * 24 * 30 / 1000);
         return userInfo;
     }

+ 4 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusMarketCouponsCashUsed.java

@@ -95,6 +95,10 @@ public class BusMarketCouponsCashUsed implements Serializable {
     @TableField(exist = false)
     private String conponsName;
 
+
+    @TableField(exist = false)
+    private BusMarketCouponsCash busMarketCouponsCash;
+
     @TableField(exist = false)
     private String statusName;
 }

+ 178 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/controller/MallHotelOrderController.java

@@ -0,0 +1,178 @@
+package org.jeecg.modules.mall.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.mall.entity.MallHotelOrder;
+import org.jeecg.modules.mall.service.IMallHotelOrderService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+import org.jeecg.common.system.base.controller.JeecgController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+
+ /**
+ * @Description: mall_hotel_order
+ * @Author: jeecg-boot
+ * @Date:   2023-05-05
+ * @Version: V1.0
+ */
+@Api(tags="mall_hotel_order")
+@RestController
+@RequestMapping("/mall/mallHotelOrder")
+@Slf4j
+public class MallHotelOrderController extends JeecgController<MallHotelOrder, IMallHotelOrderService> {
+	@Autowired
+	private IMallHotelOrderService mallHotelOrderService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param mallHotelOrder
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "mall_hotel_order-分页列表查询")
+	@ApiOperation(value="mall_hotel_order-分页列表查询", notes="mall_hotel_order-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<MallHotelOrder>> queryPageList(MallHotelOrder mallHotelOrder,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<MallHotelOrder> queryWrapper = QueryGenerator.initQueryWrapper(mallHotelOrder, req.getParameterMap());
+		Page<MallHotelOrder> page = new Page<MallHotelOrder>(pageNo, pageSize);
+		IPage<MallHotelOrder> pageList = mallHotelOrderService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param mallHotelOrder
+	 * @return
+	 */
+	@AutoLog(value = "mall_hotel_order-添加")
+	@ApiOperation(value="mall_hotel_order-添加", notes="mall_hotel_order-添加")
+	//@RequiresPermissions("mall:mall_hotel_order:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody MallHotelOrder mallHotelOrder) {
+		mallHotelOrderService.save(mallHotelOrder);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param mallHotelOrder
+	 * @return
+	 */
+	@AutoLog(value = "mall_hotel_order-编辑")
+	@ApiOperation(value="mall_hotel_order-编辑", notes="mall_hotel_order-编辑")
+	//@RequiresPermissions("mall:mall_hotel_order:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody MallHotelOrder mallHotelOrder) {
+		mallHotelOrderService.updateById(mallHotelOrder);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "mall_hotel_order-通过id删除")
+	@ApiOperation(value="mall_hotel_order-通过id删除", notes="mall_hotel_order-通过id删除")
+	//@RequiresPermissions("mall:mall_hotel_order:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		mallHotelOrderService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "mall_hotel_order-批量删除")
+	@ApiOperation(value="mall_hotel_order-批量删除", notes="mall_hotel_order-批量删除")
+	//@RequiresPermissions("mall:mall_hotel_order:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.mallHotelOrderService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "mall_hotel_order-通过id查询")
+	@ApiOperation(value="mall_hotel_order-通过id查询", notes="mall_hotel_order-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<MallHotelOrder> queryById(@RequestParam(name="id",required=true) String id) {
+		MallHotelOrder mallHotelOrder = mallHotelOrderService.getById(id);
+		if(mallHotelOrder==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(mallHotelOrder);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param mallHotelOrder
+    */
+    //@RequiresPermissions("mall:mall_hotel_order:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, MallHotelOrder mallHotelOrder) {
+        return super.exportXls(request, mallHotelOrder, MallHotelOrder.class, "mall_hotel_order");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("mall:mall_hotel_order:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, MallHotelOrder.class);
+    }
+
+}

+ 124 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/entity/MallHotelOrder.java

@@ -0,0 +1,124 @@
+package org.jeecg.modules.mall.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: mall_hotel_order
+ * @Author: jeecg-boot
+ * @Date:   2023-05-05
+ * @Version: V1.0
+ */
+@Data
+@TableName("mall_hotel_order")
+@Accessors(chain = true)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="mall_hotel_order对象", description="mall_hotel_order")
+public class MallHotelOrder implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "主键")
+    private String id;
+	/**关联租户*/
+	@Excel(name = "关联租户", width = 15)
+    @ApiModelProperty(value = "关联租户")
+    private String tenantId;
+	/**关联酒店*/
+	@Excel(name = "关联酒店", width = 15)
+    @ApiModelProperty(value = "关联酒店")
+    private String hotelId;
+	/**订单号*/
+	@Excel(name = "订单号", width = 15)
+    @ApiModelProperty(value = "订单号")
+    private String code;
+	/**商城用户id*/
+	@Excel(name = "商城用户id", width = 15)
+    @ApiModelProperty(value = "商城用户id")
+    private String mallUserId;
+	/**会员卡用户id*/
+	@Excel(name = "会员卡用户id", width = 15)
+    @ApiModelProperty(value = "会员卡用户id")
+    private String memberCardId;
+	/**入住时间*/
+	@Excel(name = "入住时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "入住时间")
+    private Date startDate;
+	/**离店时间*/
+	@Excel(name = "离店时间", width = 15, format = "yyyy-MM-dd")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "离店时间")
+    private Date endDate;
+	/**到店时间*/
+	@Excel(name = "到店时间", width = 15)
+    @ApiModelProperty(value = "到店时间")
+    private String arriveTime;
+	/**数量*/
+	@Excel(name = "数量", width = 15)
+    @ApiModelProperty(value = "数量")
+    private Integer num;
+	/**天数*/
+	@Excel(name = "天数", width = 15)
+    @ApiModelProperty(value = "天数")
+    private Integer day;
+	/**房型*/
+	@Excel(name = "房型", width = 15)
+    @ApiModelProperty(value = "房型")
+    private String layoutId;
+	/**预定人*/
+	@Excel(name = "预定人", width = 15)
+    @ApiModelProperty(value = "预定人")
+    private String contactName;
+	/**联系电话*/
+	@Excel(name = "联系电话", width = 15)
+    @ApiModelProperty(value = "联系电话")
+    private String mobile;
+	/**价格*/
+	@Excel(name = "价格", width = 15)
+    @ApiModelProperty(value = "价格")
+    private BigDecimal money;
+	/**状态 1未付款 2已付款 3已取消 4 已完成 5待入住 6已入住 7退款中*/
+	@Excel(name = "状态 1未付款 2已付款 3已取消 4 已完成 5待入住 6已入住 7退款中", width = 15)
+    @ApiModelProperty(value = "状态 1未付款 2已付款 3已取消 4 已完成 5待入住 6已入住 7退款中")
+    private Integer status;
+	/**优惠券id*/
+	@Excel(name = "优惠券id", width = 15)
+    @ApiModelProperty(value = "优惠券id")
+    private String couponId;
+	/**会员折扣金额*/
+	@Excel(name = "会员折扣金额", width = 15)
+    @ApiModelProperty(value = "会员折扣金额")
+    private BigDecimal memberZk;
+	/**付款类型 1到店支付 2微信支付*/
+	@Excel(name = "付款类型 1到店支付 2微信支付", width = 15)
+    @ApiModelProperty(value = "付款类型 1到店支付 2微信支付")
+    private Integer payType;
+	/**备注*/
+	@Excel(name = "备注", width = 15)
+    @ApiModelProperty(value = "备注")
+    private String remark;
+	/**创建时间*/
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "创建时间")
+    private Date createTime;
+}

+ 17 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/mapper/MallHotelOrderMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.mall.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.mall.entity.MallHotelOrder;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: mall_hotel_order
+ * @Author: jeecg-boot
+ * @Date:   2023-05-05
+ * @Version: V1.0
+ */
+public interface MallHotelOrderMapper extends BaseMapper<MallHotelOrder> {
+
+}

+ 5 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/mapper/xml/MallHotelOrderMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.mall.mapper.MallHotelOrderMapper">
+
+</mapper>

+ 14 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/service/IMallHotelOrderService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.mall.service;
+
+import org.jeecg.modules.mall.entity.MallHotelOrder;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: mall_hotel_order
+ * @Author: jeecg-boot
+ * @Date:   2023-05-05
+ * @Version: V1.0
+ */
+public interface IMallHotelOrderService extends IService<MallHotelOrder> {
+
+}

+ 19 - 0
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/mall/service/impl/MallHotelOrderServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.mall.service.impl;
+
+import org.jeecg.modules.mall.entity.MallHotelOrder;
+import org.jeecg.modules.mall.mapper.MallHotelOrderMapper;
+import org.jeecg.modules.mall.service.IMallHotelOrderService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: mall_hotel_order
+ * @Author: jeecg-boot
+ * @Date:   2023-05-05
+ * @Version: V1.0
+ */
+@Service
+public class MallHotelOrderServiceImpl extends ServiceImpl<MallHotelOrderMapper, MallHotelOrder> implements IMallHotelOrderService {
+
+}