yangdamao 1 rok temu
rodzic
commit
3ffb493186

+ 0 - 10
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -649,16 +649,6 @@ public class CommonController extends BaseController {
         return AjaxResult.success(iUserService.getStudyTimeByCard(idCard,type));
     }
 
-    @ApiOperation("获取用户同专业下课程")
-    @PostMapping("common/free/getUserBusinessGoods")
-    public AjaxResult<List<UserBusinessGoodsVo>> getUserBusinessGoods(@RequestBody List<UserBusinessGoodsBo> bos) {
-        UserBusinessGoodsBo bo = bos.get(0);
-        if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
-            throw new CustomException("签名错误");
-        }
-        return AjaxResult.success(iUserService.getUserBusinessGoods(bos));
-    }
-
     /**
      * 获取企业ID
      */

+ 13 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -1,13 +1,16 @@
 package com.zhongzheng.controller.user;
 
 import cn.hutool.core.lang.Validator;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.zhongzheng.common.annotation.Log;
 import com.zhongzheng.common.core.controller.BaseController;
 import com.zhongzheng.common.core.domain.AjaxResult;
 import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
+import com.zhongzheng.common.utils.ToolsUtils;
 import com.zhongzheng.framework.web.service.WxLoginService;
 import com.zhongzheng.framework.web.service.WxTokenService;
 import com.zhongzheng.modules.system.domain.SysTenant;
@@ -19,6 +22,7 @@ import com.zhongzheng.modules.user.service.IUserLoginKeyService;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserVisitLogService;
 import com.zhongzheng.modules.user.service.IUserWxFollowService;
+import com.zhongzheng.modules.user.vo.UserBusinessGoodsVo;
 import com.zhongzheng.modules.user.vo.UserVo;
 import com.zhongzheng.modules.wx.bo.WxIdBody;
 import com.zhongzheng.modules.wx.bo.WxLoginBody;
@@ -32,6 +36,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -218,4 +223,12 @@ public class UserController extends BaseController {
         editBo.setUserKey(loginUser.getToken());
         return toAjax(iUserLoginKeyService.offline(editBo) ? 1 : 0);
     }
+
+    @ApiOperation("获取用户同专业下课程")
+    @PostMapping("/getUserBusinessGoods")
+    public AjaxResult<List<UserBusinessGoodsVo>> getUserBusinessGoods(@RequestBody List<UserBusinessGoodsBo> bos) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bos.forEach(x -> x.setUserId(loginUser.getUser().getUserId()));
+        return AjaxResult.success(iUserService.getUserBusinessGoods(bos));
+    }
 }

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

@@ -2095,11 +2095,10 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     public List<UserBusinessGoodsVo> getUserBusinessGoods(List<UserBusinessGoodsBo> bos) {
         List<UserBusinessGoodsVo> goodsBoList = new ArrayList<>();
         for (UserBusinessGoodsBo item : bos) {
-            User user = baseMapper.getByCardTenant(item.getIdNum(), item.getTenantId());
+            User user = getById(item.getUserId());
             if (ObjectUtils.isNull(user)) {
                 continue;
             }
-            item.setUserId(user.getUserId());
             //查询购买课程
             UserBusinessGoodsVo goodsVo = baseMapper.getCourseByUser(item);
             goodsVo.setIdNum(item.getIdNum());

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

@@ -16,6 +16,7 @@ import com.github.pagehelper.Page;
 import com.zhongzheng.common.core.domain.entity.SysUser;
 import com.zhongzheng.common.core.domain.model.LoginUser;
 import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ToolsUtils;

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java

@@ -95,6 +95,5 @@ public interface UserMapper extends BaseMapper<User> {
     @InterceptorIgnore(tenantLine = "true")
     Long getFistStudyTime(@Param("userId")Long userId,@Param("tenantId")Long tenantId,@Param("businessName")String businessName);
 
-    @InterceptorIgnore(tenantLine = "true")
     UserBusinessGoodsVo getCourseByUser(UserBusinessGoodsBo item);
 }

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsRefundMapper.xml

@@ -139,6 +139,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN order_goods og ON gr.order_goods_id = og.order_goods_id
         WHERE
         1 = 1
+        AND (SELECT COUNT(o.order_sn) FROM `order` o WHERE o.order_sn = og.order_sn AND o.order_handle IS NULL) > 0
         <if test="userId != null and userId != ''">
             AND gr.user_id = #{userId}
         </if>

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

@@ -707,7 +707,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN `user` u ON o.user_id = u.user_id
         WHERE
             o.`status` = 1
-          AND o.tenant_id = #{tenantId}
           AND og.`status` = 1
           AND o.user_id = #{userId}
           AND INSTR( CONCAT( cet.education_name, cb.business_name, cpt.project_name ), #{businessName} )