yangdamao hace 2 años
padre
commit
686c9345a7
Se han modificado 27 ficheros con 629 adiciones y 31 borrados
  1. 55 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/EnterpriseController.java
  2. 26 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  3. 7 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/user/LoginController.java
  4. 1 1
      zhongzheng-api/src/main/resources/application-dev.yml
  5. 320 2
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  6. 6 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java
  7. 6 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseSectionMapper.java
  8. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java
  9. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java
  10. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java
  11. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  12. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java
  13. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java
  14. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  15. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/Order.java
  16. 2 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java
  17. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java
  18. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java
  19. 3 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAppTelphoneLoginBo.java
  20. 45 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserLiveAccountLoginBo.java
  21. 10 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java
  22. 8 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java
  23. 29 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserLiveAccountLoginVo.java
  24. 8 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml
  25. 10 1
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml
  26. 7 0
      zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml
  27. 42 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

+ 55 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/EnterpriseController.java

@@ -0,0 +1,55 @@
+package com.zhongzheng.controller.common;
+
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
+import com.zhongzheng.modules.course.bo.CourseEducationTypeQueryBo;
+import com.zhongzheng.modules.course.service.ICourseBusinessService;
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.vo.CourseBusinessVo;
+import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月28日 11:39
+ */
+@Api(value = "B端接口控制器", tags = {"B端接口控制器"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/enterprise/api")
+public class EnterpriseController {
+
+    private final ICourseEducationTypeService iCourseEducationTypeService;
+
+    private final ICourseBusinessService iCourseBusinessService;
+
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询教育类型列表")
+    @GetMapping("/education/list")
+    public AjaxResult<List<CourseEducationTypeVo>> getEducationList(CourseEducationTypeQueryBo bo) {
+        bo.setStatus(Arrays.asList(0,1));
+        return AjaxResult.success(iCourseEducationTypeService.queryList(bo));
+    }
+
+    /**
+     * 查询教育类型列表
+     */
+    @ApiOperation("查询教育类型列表")
+    @GetMapping("/business/list")
+    public AjaxResult<List<CourseBusinessVo>> getBusinessList(CourseBusinessQueryBo bo) {
+        bo.setStatus(Arrays.asList(0,1));
+        return AjaxResult.success(iCourseBusinessService.queryList(bo));
+    }
+
+}

+ 26 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -36,6 +36,9 @@ import com.zhongzheng.modules.order.domain.Printer;
 import com.zhongzheng.modules.system.bo.SysTenantQueryBo;
 import com.zhongzheng.modules.system.service.ISysConfigService;
 import com.zhongzheng.modules.system.service.ISysTenantService;
+import com.zhongzheng.modules.user.bo.UserLiveAccountLoginBo;
+import com.zhongzheng.modules.user.service.IUserService;
+import com.zhongzheng.modules.user.vo.UserLiveAccountLoginVo;
 import com.zhongzheng.modules.wx.bo.WxInfoBo;
 import com.zhongzheng.modules.wx.bo.WxInfoQuery;
 import com.zhongzheng.modules.wx.bo.WxServerBody;
@@ -48,7 +51,6 @@ import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -91,6 +93,8 @@ public class CommonController extends BaseController {
 
     private final IDistributionActivityGoodsService iDistributionActivityGoodsService;
 
+    private final IUserService iUserService;
+
     @PostMapping("/returnStream")
     public AjaxResult returnStream(MultipartFile file, HttpServletResponse response) throws IOException {
         ServletOutputStream out = null;
@@ -375,4 +379,25 @@ public class CommonController extends BaseController {
     public void loginAuthFailOffLine() {
         throw new CustomException("用户验证错误",409);
     }
+
+    @ApiOperation("直播短信统一登录")
+    @PostMapping("/live/sms_login")
+    public AjaxResult<UserLiveAccountLoginVo> sms_login(@RequestBody UserLiveAccountLoginBo bo) {
+        UserLiveAccountLoginVo vo = iUserService.smsLiveUnifyLogin(bo);
+        return AjaxResult.success(vo);
+    }
+
+    @ApiOperation("直播账号统一登录")
+    @PostMapping("/live/account_login")
+    public AjaxResult<UserLiveAccountLoginVo> account_login(@RequestBody UserLiveAccountLoginBo bo) {
+        UserLiveAccountLoginVo vo = iUserService.liveUnifyLogin(bo);
+        return AjaxResult.success(vo);
+    }
+
+    @ApiOperation("直播账号统一登录刷新")
+    @PostMapping("/live/account_login/refresh")
+    public AjaxResult<UserLiveAccountLoginVo> account_loginRefresh(@RequestBody UserLiveAccountLoginBo bo) {
+        UserLiveAccountLoginVo vo = iUserService.liveUnifyLoginRefresh(bo);
+        return AjaxResult.success(vo);
+    }
 }

+ 7 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/LoginController.java

@@ -64,4 +64,11 @@ public class LoginController extends BaseController {
         Map<String,Object> map = iUserService.telphone_login(bo);
         return AjaxResult.success(map);
     }
+
+    @ApiOperation("用户账号自动登入")
+    @PostMapping("/automatic/account_login")
+    public AjaxResult automaticAccountLogin(@RequestBody UserAppTelphoneLoginBo bo) {
+        Map<String,Object> map = iUserService.automaticAccountLogin(bo);
+        return AjaxResult.success(map);
+    }
 }

+ 1 - 1
zhongzheng-api/src/main/resources/application-dev.yml

@@ -121,7 +121,7 @@ certificate:
 
 
 
-liveGotoURL: http://120.79.166.78:19014/
+liveGotoURL: http://
 
 
 enCodeVersion: trial

+ 320 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.framework.web.service;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.codec.Base64;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.ObjectUtil;
@@ -14,6 +15,7 @@ import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
+import com.google.common.base.Splitter;
 import com.zhongzheng.common.constant.Constants;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.core.redis.RedisCache;
@@ -30,20 +32,30 @@ import com.zhongzheng.modules.collect.domain.CollectNote;
 import com.zhongzheng.modules.collect.mapper.CollectBankMapper;
 import com.zhongzheng.modules.collect.mapper.CollectCourseMapper;
 import com.zhongzheng.modules.collect.mapper.CollectNoteMapper;
+import com.zhongzheng.modules.course.domain.Course;
+import com.zhongzheng.modules.course.domain.CourseSection;
 import com.zhongzheng.modules.course.domain.CourseSubject;
+import com.zhongzheng.modules.course.service.ICourseSectionService;
+import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
 import com.zhongzheng.modules.grade.vo.ClassGradeUserGoodsVo;
-import com.zhongzheng.modules.inform.domain.InformRemind;
+import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysConfigService;
+import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.user.bo.*;
-import com.zhongzheng.modules.user.domain.*;
+import com.zhongzheng.modules.user.domain.User;
+import com.zhongzheng.modules.user.domain.UserStudyLog;
+import com.zhongzheng.modules.user.domain.UserVisitLog;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.mapper.UserMapper;
 import com.zhongzheng.modules.user.service.*;
 import com.zhongzheng.modules.user.vo.*;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
@@ -115,6 +127,17 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     private IUserLoginErrorService iUserLoginErrorService;
     @Autowired
     private  ISysConfigService configService;
+    @Autowired
+    private IGoodsService iGoodsService;
+    @Autowired
+    private ISysTenantService iSysTenantService;
+
+    @Autowired
+    private ICourseService iCourseService;
+    @Autowired
+    private ICourseSectionService iCourseSectionService;
+    @Value("${liveGotoURL}")
+    private String liveGotoURL;
 
 
     @Override
@@ -1089,6 +1112,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         });
     }
 
+
+
     private Long findSubjectId(String subject){
         if(subject!=null){
             String key = "SUB_"+subject;
@@ -1212,6 +1237,299 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         return this.updateById(update);
     }
 
+    @Override
+    public UserLiveAccountLoginVo liveUnifyLogin(UserLiveAccountLoginBo bo) {
+        if (bo.getType() != 1){
+            throw new CustomException("登录错误");
+        }
+        if(Validator.isEmpty(bo.getAccount())){
+            throw new CustomException("账号不能为空");
+        }
+
+        List<User> userList = baseMapper.getUserByTel(bo.getAccount());
+        if (CollectionUtils.isEmpty(userList)){
+            throw new CustomException("账号不存在!请检查");
+        }
+        //参数解析
+        String param = new String(Base64.decode(bo.getParam()));
+        if (StringUtils.isBlank(param)){
+            throw new CustomException("参数为空");
+        }
+
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        Long goodsId = Long.valueOf(split.get("gid"));
+
+        //获取对应商品
+        Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+
+        User user = userList.stream().filter(item -> {
+            //判断用户是否购买商品
+            Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
+            return count > 0;
+        }).findFirst().orElse(null);
+
+        if(Validator.isEmpty(user)){
+            throw new CustomException("登录信息错误");
+        }
+        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
+        {
+            throw new BaseException("对不起,您的账号:已停用");
+        }
+        String password = null;
+        if(bo.getPwd().length()>20){
+            String rsaPrivate = null;
+            try {
+                InputStream certStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("config/pri.key");
+                rsaPrivate = AES.getStringByInputStream_1(certStream);
+                certStream.close();
+                password = AES.decrypt(bo.getPwd(),rsaPrivate);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }else{
+            password = bo.getPwd();
+        }
+        if (!SecurityUtils.matchesPassword(password,user.getPassword()))
+        {
+            iUserLoginErrorService.saveErrorLog(bo.getAccount());
+            throw new BaseException("登录信息错误");
+        }
+        Long tenantId = user.getTenantId();
+        //组装跳转路径
+        SysTenant tenant = iSysTenantService.getById(tenantId);
+        String post = "";
+        String path = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                post = tenant.getHostH5();
+                path = "pages/webview/index";
+                break;
+            case 2://PC
+                post = tenant.getHostPc();
+                path = "living-room";
+                break;
+        }
+
+        String cid = split.get("cid");
+        String sid = split.get("sid");
+        Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+        Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+        CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+        CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+        Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+
+        String url = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                String format1 = String.format("cid=%s&gid=%s&sid=%s&a=1", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s1 = Base64.encode(format1);
+                url = String.format("%s/%s/%s?scene=%s",liveGotoURL, post,path, s1);
+                break;
+            case 2://Pc
+                String format = String.format("cid=%s&gid=%s&sid=%s", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s = Base64.encode(format);
+                url = String.format("%s/%s/%s/%s?a=1&%s",liveGotoURL, post,path,courseSection.getLiveUrl(), s);
+                break;
+            default:
+                break;
+        }
+
+        UserLiveAccountLoginVo vo = new UserLiveAccountLoginVo();
+        vo.setTel(user.getTelphone());
+        vo.setUser_account(user.getUserAccount());
+        vo.setUrl(url);
+        vo.setTenantId(tenantId);
+        return vo;
+    }
+
+    @Override
+    public Map<String, Object> automaticAccountLogin(UserAppTelphoneLoginBo bo) {
+        User user = baseMapper.getUserByAccount(bo.getUserAccount());
+
+        if(Validator.isEmpty(user)){
+            throw new CustomException("该账号不存在");
+        }
+        ClientLoginUser loginUser = new ClientLoginUser();
+        loginUser.setUser(user);
+        Map<String,Object> map = new HashMap<>();
+        map.put(Constants.TOKEN,wxTokenService.createToken(loginUser));
+        map.put("user_account",user.getUserAccount());
+        map.put("full_info",Validator.isEmpty(user.getIdCard())?false:true); //是否完善身份信息
+        return map;
+    }
+
+    @Override
+    public UserLiveAccountLoginVo smsLiveUnifyLogin(UserLiveAccountLoginBo bo) {
+        if(bo.getTel()==null){
+            throw new CustomException("手机号不能为空");
+        }
+        String key = Constants.LOGIN_SMS + bo.getTel();
+        String code =  redisCache.getCacheObject(key);
+        if(code==null){
+            throw new CustomException("验证码错误");
+        }
+        if(!code.equals(bo.getCode())){
+            throw new CustomException("验证码错误");
+        }
+        redisCache.deleteObject(key);
+
+        if (bo.getType() != 1){
+            throw new CustomException("登录错误");
+        }
+
+        List<User> userList = baseMapper.getUserByTel(bo.getTel());
+        if (CollectionUtils.isEmpty(userList)){
+            throw new CustomException("账号不存在!请检查");
+        }
+        //参数解析
+        String param = new String(Base64.decode(bo.getParam()));
+        if (StringUtils.isBlank(param)){
+            throw new CustomException("参数为空");
+        }
+
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        Long goodsId = Long.valueOf(split.get("gid"));
+
+        //获取对应商品
+        Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+
+        User user = userList.stream().filter(item -> {
+            //判断用户是否购买商品
+            Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
+            return count > 0;
+        }).findFirst().orElse(null);
+
+        if(Validator.isEmpty(user)){
+            throw new CustomException("登录信息错误");
+        }
+        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
+        {
+            throw new BaseException("对不起,您的账号:已停用");
+        }
+
+        Long tenantId = user.getTenantId();
+        //组装跳转路径
+        SysTenant tenant = iSysTenantService.getById(tenantId);
+        String post = "";
+        String path = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                post = tenant.getHostH5();
+                path = "pages/webview/index";
+                break;
+            case 2://PC
+                post = tenant.getHostPc();
+                path = "living-room";
+                break;
+        }
+
+        String cid = split.get("cid");
+        String sid = split.get("sid");
+        Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+        Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+        CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+        CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+        Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+
+        String url = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                String format1 = String.format("cid=%s&gid=%s&sid=%s&a=1", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s1 = Base64.encode(format1);
+                url = String.format("%s/%s/%s?scene=%s",liveGotoURL, post,path, s1);
+                break;
+            case 2://Pc
+                String format = String.format("cid=%s&gid=%s&sid=%s", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s = Base64.encode(format);
+                url = String.format("%s/%s/%s/%s?a=1&%s",liveGotoURL, post,path,courseSection.getLiveUrl(), s);
+                break;
+            default:
+                break;
+        }
+
+        UserLiveAccountLoginVo vo = new UserLiveAccountLoginVo();
+        vo.setTel(user.getTelphone());
+        vo.setUser_account(user.getUserAccount());
+        vo.setUrl(url);
+        vo.setTenantId(tenantId);
+        return vo;
+    }
+
+    @Override
+    public UserLiveAccountLoginVo liveUnifyLoginRefresh(UserLiveAccountLoginBo bo) {
+        if(Validator.isEmpty(bo.getUser_account())){
+            throw new CustomException("账号不能为空");
+        }
+
+        User user = baseMapper.getUserByAccount(bo.getUser_account());
+        if(Validator.isEmpty(user)){
+            throw new CustomException("登录信息错误");
+        }
+        else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
+        {
+            throw new BaseException("对不起,您的账号:已停用");
+        }
+        //参数解析
+        String param = new String(Base64.decode(bo.getParam()));
+        if (StringUtils.isBlank(param)){
+            throw new CustomException("参数为空");
+        }
+
+        Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        Long goodsId = Long.valueOf(split.get("gid"));
+
+        //获取对应商品
+        Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+
+        Long tenantId = user.getTenantId();
+        //组装跳转路径
+        SysTenant tenant = iSysTenantService.getById(tenantId);
+        String post = "";
+        String path = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                post = tenant.getHostH5();
+                path = "pages/webview/index";
+                break;
+            case 2://PC
+                post = tenant.getHostPc();
+                path = "living-room";
+                break;
+        }
+
+        String cid = split.get("cid");
+        String sid = split.get("sid");
+        Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+        Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+        CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+        CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+        Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+
+        String url = "";
+        switch (bo.getUrlType()){
+            case 1://H5
+                String format1 = String.format("cid=%s&gid=%s&sid=%s&a=1", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s1 = Base64.encode(format1);
+                url = String.format("%s/%s/%s?scene=%s",liveGotoURL, post,path, s1);
+                break;
+            case 2://Pc
+                String format = String.format("cid=%s&gid=%s&sid=%s", courseId, goodsTwo.getGoodsId(), courseSection.getSectionId());
+                String s = Base64.encode(format);
+                url = String.format("%s/%s/%s/%s?a=1&%s",liveGotoURL, post,path,courseSection.getLiveUrl(), s);
+                break;
+            default:
+                break;
+        }
+
+        UserLiveAccountLoginVo vo = new UserLiveAccountLoginVo();
+        vo.setTel(user.getTelphone());
+        vo.setUser_account(user.getUserAccount());
+        vo.setUrl(url);
+        vo.setTenantId(tenantId);
+        return vo;
+    }
+
+
     @Override
     public Map<String, Object> accountLogin(UserAppAccountLoginBo bo) {
         if(Validator.isEmpty(bo.getAccount())){

+ 6 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -3,8 +3,6 @@ package com.zhongzheng.modules.course.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.zhongzheng.common.core.domain.entity.SysRole;
-import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.domain.Course;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
@@ -18,7 +16,6 @@ import com.zhongzheng.modules.user.bo.UserPlanQueryBo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Map;
 
 /**
  * 课程Mapper接口
@@ -59,4 +56,10 @@ public interface CourseMapper extends BaseMapper<Course> {
 
     @InterceptorIgnore(tenantLine = "true")
     Course getCourseByTenant(@Param("code") String code,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Course getCourseByNotTenant(@Param("cid") Long cid);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long getCourseByTenantTwo(@Param("courseName") String courseName,@Param("code") String code,@Param("tenantId") Long tenantId);
 }

+ 6 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseSectionMapper.java

@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseSectionQueryBo;
 import com.zhongzheng.modules.course.domain.CourseSection;
-import com.zhongzheng.modules.course.domain.CourseStreamingBusiness;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
-import com.zhongzheng.modules.grade.vo.ClassGradeVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -30,4 +28,10 @@ public interface CourseSectionMapper extends BaseMapper<CourseSection> {
 
     @InterceptorIgnore(tenantLine = "true")
     CourseSection getSectionByTenant(@Param("code") String code,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    CourseSection getSectionByNotTenant(@Param("sid") Long sid);
+
+    @InterceptorIgnore(tenantLine = "true")
+    CourseSection getSectionByTenantTwo(@Param("name") String name,@Param("code") String code,@Param("tenantId") Long tenantId);
 }

+ 5 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseSectionService.java

@@ -2,7 +2,6 @@ package com.zhongzheng.modules.course.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.zhongzheng.modules.bank.vo.QuestionImport;
 import com.zhongzheng.modules.course.bo.CourseSectionAddBo;
 import com.zhongzheng.modules.course.bo.CourseSectionBusinessAddBo;
 import com.zhongzheng.modules.course.bo.CourseSectionEditBo;
@@ -13,7 +12,6 @@ import com.zhongzheng.modules.course.vo.CourseSectionImport;
 import com.zhongzheng.modules.course.vo.CourseSectionVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import net.polyv.live.v1.entity.chat.LiveGetMessageListResponse;
-import org.apache.ibatis.annotations.Param;
 
 import java.io.IOException;
 import java.security.NoSuchAlgorithmException;
@@ -79,4 +77,9 @@ public interface ICourseSectionService extends IService<CourseSection> {
     boolean batchDelSection(GoodsBatchDelBo bo);
 
     CourseSection getSectionByTenant(String code, Long newTenantId);
+
+    CourseSection getSectionByNotTenant(Long sid);
+
+	CourseSection getSectionByTenantTwo(String name, String code, Long tenantId);
+
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java

@@ -89,4 +89,9 @@ public interface ICourseService extends IService<Course> {
     Course getCourseByTenant(String code, Long newTenantId);
 
 	Boolean checkTime();
+
+    Course getCourseByNotTenant(Long cid);
+
+	Long getCourseByTenantTwo(String courseName, String code, Long tenantId);
+
 }

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionServiceImpl.java

@@ -659,6 +659,16 @@ public class CourseSectionServiceImpl extends ServiceImpl<CourseSectionMapper, C
         return baseMapper.getSectionByTenant(code, newTenantId);
     }
 
+    @Override
+    public CourseSection getSectionByNotTenant(Long sid) {
+        return baseMapper.getSectionByNotTenant(sid);
+    }
+
+    @Override
+    public CourseSection getSectionByTenantTwo(String name, String code, Long tenantId) {
+        return baseMapper.getSectionByTenantTwo(name, code, tenantId);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     public String insertByAddBoImport(CourseSectionAddBo bo, String errorLog, Integer no) {
         CourseSection add = BeanUtil.toBean(bo, CourseSection.class);

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -622,6 +622,16 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return true;
     }
 
+    @Override
+    public Course getCourseByNotTenant(Long cid) {
+        return baseMapper.getCourseByNotTenant(cid);
+    }
+
+    @Override
+    public Long getCourseByTenantTwo(String courseName, String code, Long tenantId) {
+        return baseMapper.getCourseByTenantTwo(courseName, code, tenantId);
+    }
+
     private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
         List<UserStudyRecordPhotoVo> voList = collection.stream()
                 .map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java

@@ -72,4 +72,7 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     @InterceptorIgnore(tenantLine = "true")
     Goods getGoodsByIdNotTenant(Long goodsId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Goods getGoodsByTenantTwo(@Param("goodsName") String goodsName,@Param("code") String code,@Param("tenantId") Long tenantId);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -130,4 +130,6 @@ public interface IGoodsService extends IService<Goods> {
     List<GoodsVo> getAlikeGoods(AlikeGoodsBo bo);
 
 	Goods getGoodsByIdNotTenant(Long goodsId);
+
+    Goods getGoodsByTenantTwo(String goodsName, String code, Long tenantId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -4387,6 +4387,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return baseMapper.getGoodsByIdNotTenant(goodsId);
     }
 
+    @Override
+    public Goods getGoodsByTenantTwo(String goodsName, String code, Long tenantId) {
+        return baseMapper.getGoodsByTenantTwo(goodsName,code,tenantId);
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public boolean updateGoodsRepair(UpdateGoodsRepairBo bo) {

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/domain/Order.java

@@ -141,7 +141,7 @@ private static final long serialVersionUID=1L;
     /** 审核状态:0待审核,1已通过,2未通过,3已撤销 */
     private Integer checkStatus;
     /** 退款状态:0待审核,1正常,2未退款,3已完成,4未通过 */
-    private Integer refundStatus;
+    private Integer orderRefundStatus;
     /** 账款状态:0未结清,1已结清 */
     private Integer creditStatus;
     /** 发票状态:0未开票,1已开票 */

+ 2 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsRefundServiceImpl.java

@@ -18,7 +18,6 @@ import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
-import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.activity.domain.ActivityOrder;
@@ -35,7 +34,6 @@ import com.zhongzheng.modules.distribution.service.IDistributionRebateService;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
-import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.domain.ClassGradeUser;
 import com.zhongzheng.modules.grade.service.IClassGradeService;
 import com.zhongzheng.modules.grade.service.IClassGradeUserService;
@@ -58,10 +56,8 @@ import com.zhongzheng.modules.order.vo.OrderGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderShareGoodsVo;
 import com.zhongzheng.modules.order.vo.OrderShareToOldVo;
 import com.zhongzheng.modules.system.service.ISysUserService;
-import com.zhongzheng.modules.top.financial.bo.OrderRefundPayBo;
 import com.zhongzheng.modules.top.goods.domain.TopOldOrderCheck;
 import com.zhongzheng.modules.top.goods.domain.TopOldOrderCheckLog;
-import com.zhongzheng.modules.top.goods.domain.TopOldOrderRefund;
 import com.zhongzheng.modules.top.goods.service.ITopOldOrderCheckLogService;
 import com.zhongzheng.modules.top.goods.service.ITopOldOrderCheckService;
 import com.zhongzheng.modules.top.goods.service.ITopOldOrderRefundService;
@@ -283,7 +279,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
         this.save(add);
         //订单状态修改
         iOrderService.update(new LambdaUpdateWrapper<Order>()
-                        .set(Order::getRefundStatus,0)//待审核
+                        .set(Order::getOrderRefundStatus,0)//待审核
                         .set(Order::getOrderRefund,orderGoods.getGoodsReceived())
                         .eq(Order::getOrderSn,orderGoods.getOrderSn()));
         //修改订单状态
@@ -473,7 +469,7 @@ public class OrderGoodsRefundServiceImpl extends ServiceImpl<OrderGoodsRefundMap
             order.setUpdateTime(DateUtils.getNowTime());
             order.setOrderStatus(Order.REFUND_PART);
         }
-        order.setRefundStatus(3);//退款已完成
+        order.setOrderRefundStatus(3);//退款已完成
 
         //已退金额
         BigDecimal add = BigDecimal.ZERO;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -975,7 +975,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
     private void orderCostHandle(Order add,Integer type) {
         add.setCheckStatus(1);//C端订单不需要审核
-        add.setRefundStatus(1);
+        add.setOrderRefundStatus(1);
         add.setInvoiceStatus(0);
         add.setFinishStatus(type == 1? 1:0);
         add.setCreditStatus(0);

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -2262,7 +2262,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                         .in(OrderGoods::getOrderGoodsId, orderGoodsIds));
 
                 orderService.update(new LambdaUpdateWrapper<Order>()
-                        .set(Order::getRefundStatus, 4) //未通过
+                        .set(Order::getOrderRefundStatus, 4) //未通过
                         .eq(Order::getOrderSn, refundList.get(0).getOrderSn()));
             }
 
@@ -2385,7 +2385,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
 
             if (periodStatus == 2) {
                 orderService.update(new LambdaUpdateWrapper<Order>()
-                        .set(Order::getRefundStatus, 2) //未退款
+                        .set(Order::getOrderRefundStatus, 2) //未退款
                         .eq(Order::getOrderSn, refundList.get(0).getOrderSn()));
             }
         }

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserAppTelphoneLoginBo.java

@@ -4,8 +4,6 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
-import javax.validation.constraints.NotNull;
-
 
 /**
  * 客户端用户编辑对象 user
@@ -18,7 +16,9 @@ import javax.validation.constraints.NotNull;
 public class UserAppTelphoneLoginBo {
 
     @ApiModelProperty("标识")
-    @NotNull(message = "标识不能为空")
     private String sign;
 
+    @ApiModelProperty("用户账号")
+    private String userAccount;
+
 }

+ 45 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserLiveAccountLoginBo.java

@@ -0,0 +1,45 @@
+package com.zhongzheng.modules.user.bo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+
+
+/**
+ * 客户端用户编辑对象 user
+ *
+ * @author ruoyi
+ * @date 2021-06-08
+ */
+@Data
+@ApiModel("客户端用户账号直播统一登录对象")
+public class UserLiveAccountLoginBo {
+    @ApiModelProperty("手机号/身份证")
+    @NotNull(message = "账号不能为空")
+    private String account;
+    @ApiModelProperty("密码")
+    @NotNull(message = "密码不能为空")
+    private String pwd;
+
+    @ApiModelProperty("手机号")
+    private String tel;
+    @ApiModelProperty("验证码")
+    private String code;
+
+    @ApiModelProperty("直播路径")
+    private String liveUrl;
+
+    @ApiModelProperty("用户账号")
+    private String user_account;
+
+    @ApiModelProperty("参数")
+    private String param;
+
+    @ApiModelProperty("路径类型:1,H5 2,PC")
+    private Integer urlType;
+
+    @ApiModelProperty("登录类型:1直播")
+    private Integer type;
+}

+ 10 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java

@@ -1,14 +1,13 @@
 package com.zhongzheng.modules.user.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.user.bo.RanKingUserQuery;
 import com.zhongzheng.modules.user.bo.UserQueryBo;
 import com.zhongzheng.modules.user.bo.UserStudyRecordQueryBo;
 import com.zhongzheng.modules.user.domain.User;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.user.vo.RanKingUser;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
-import com.zhongzheng.modules.user.vo.UserVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -64,4 +63,13 @@ public interface UserMapper extends BaseMapper<User> {
 
     @InterceptorIgnore(tenantLine = "true")
     void editUserInfo(UserQueryBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<User> getUserByTel(@Param("account")String account);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Long getUserOrderCount(@Param("userId")Long userId,@Param("tenantId") Long tenantId,@Param("code") String code,@Param("goodsName") String goodsName);
+
+    @InterceptorIgnore(tenantLine = "true")
+    User getUserByAccount(@Param("userAccount")String userAccount);
 }

+ 8 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -1,12 +1,9 @@
 package com.zhongzheng.modules.user.service;
 
-import com.zhongzheng.common.core.domain.entity.SysUser;
-import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
+import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.vo.*;
-import com.baomidou.mybatisplus.extension.service.IService;
-import org.apache.ibatis.annotations.Param;
 
 import java.math.BigDecimal;
 import java.util.Collection;
@@ -129,4 +126,11 @@ public interface IUserService extends IService<User> {
 
 	void batchUpdateTelId();
 
+	UserLiveAccountLoginVo liveUnifyLogin(UserLiveAccountLoginBo bo);
+
+	Map<String, Object> automaticAccountLogin(UserAppTelphoneLoginBo bo);
+
+	UserLiveAccountLoginVo smsLiveUnifyLogin(UserLiveAccountLoginBo bo);
+
+	UserLiveAccountLoginVo liveUnifyLoginRefresh(UserLiveAccountLoginBo bo);
 }

+ 29 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserLiveAccountLoginVo.java

@@ -0,0 +1,29 @@
+package com.zhongzheng.modules.user.vo;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+
+/**
+ * 客户端用户编辑对象 user
+ *
+ * @author ruoyi
+ * @date 2021-06-08
+ */
+@Data
+@ApiModel("客户端用户账号直播统一登录对象")
+public class UserLiveAccountLoginVo {
+
+    @ApiModelProperty("手机号/身份证")
+    private String user_account;
+
+    @ApiModelProperty("手机号")
+    private String tel;
+
+    @ApiModelProperty("跳转路径")
+    private String url;
+
+    @ApiModelProperty("机构ID")
+    private Long tenantId;
+}

+ 8 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -770,4 +770,12 @@
     <select id="getCourseByTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.Course">
         select * from course where code = #{code} and tenant_id = #{newTenantId}
     </select>
+
+    <select id="getCourseByNotTenant" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.course.domain.Course">
+        select * from course where course_id = #{cid}
+    </select>
+
+    <select id="getCourseByTenantTwo" parameterType="map" resultType="java.lang.Long">
+        select * from course where course_name = #{courseName} and code = #{code} and tenant_id = #{tenantId}
+    </select>
 </mapper>

+ 10 - 1
zhongzheng-system/src/main/resources/mapper/modules/course/CourseSectionMapper.xml

@@ -252,6 +252,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
     <select id="getSectionByTenant" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseSection">
-        SELECT * from course_section where code = #{code} and teacher_id = #{newTenantId}
+        SELECT * from course_section where code = #{code} and tenant_id = #{newTenantId}
     </select>
+
+    <select id="getSectionByNotTenant" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.course.domain.CourseSection">
+        SELECT * from course_section where section_id = #{sid}
+    </select>
+
+    <select id="getSectionByTenantTwo" parameterType="map" resultType="com.zhongzheng.modules.course.domain.CourseSection">
+        SELECT * from course_section where `name` = #{name} and code = #{code} and tenant_id = #{tenantId}
+    </select>
+
 </mapper>

+ 7 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -785,6 +785,13 @@
         FROM `goods`
         WHERE goods_id = #{goodsId}
     </select>
+
+    <select id="getGoodsByTenantTwo" parameterType="map" resultType="com.zhongzheng.modules.goods.domain.Goods">
+        SELECT *
+        FROM `goods`
+        WHERE goods_name = #{goodsName} and code = #{code} and tenant_id = #{tenantId}
+    </select>
+
     <update id="updateByTenant" parameterType="com.zhongzheng.modules.goods.domain.Goods">
         UPDATE goods
         SET `year`                  = #{year},

+ 42 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -463,4 +463,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             user_id = #{userId}
     </select>
 
+    <select id="getUserByTel" parameterType="java.lang.String" resultType="com.zhongzheng.modules.user.domain.User">
+        SELECT
+            *
+        FROM
+            `user`
+        WHERE
+            status = 1
+            AND(id_card = #{account,typeHandler=com.zhongzheng.common.type.EncryptHandler}
+            OR telphone = #{account,typeHandler=com.zhongzheng.common.type.EncryptHandler})
+    </select>
+
+    <select id="getUserByAccount" parameterType="java.lang.String" resultType="com.zhongzheng.modules.user.domain.User">
+        SELECT
+            *
+        FROM
+            `user`
+        WHERE
+            status = 1
+          AND user_account = #{userAccount}
+    </select>
+
+    <select id="getUserOrderCount" parameterType="map" resultType="java.lang.Long">
+        SELECT
+            COUNT(o.order_sn)
+        FROM
+            `order` o
+                INNER JOIN order_goods og ON o.order_sn = og.order_sn
+                AND og.tenant_id = #{tenantId}
+                INNER JOIN goods g ON og.goods_id = g.goods_id
+                AND g.tenant_id = #{tenantId}
+        WHERE
+            o.`status` = 1
+            AND o.user_id = #{userId}
+            AND g.`code` = #{code}
+            AND g.goods_name = #{goodsName}
+            AND og.refund_status != 2
+	        AND og.pay_status IN ( 2, 3, 4 )
+	        AND g.`status` = 1
+	        AND og.`status` = 1
+	        AND o.tenant_id = #{tenantId}
+    </select>
+
 </mapper>