瀏覽代碼

add 用户的教育类型列表

he2802 3 年之前
父節點
當前提交
2b9b953707

+ 4 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseEducationTypeController.java

@@ -35,6 +35,8 @@ public class CourseEducationTypeController extends BaseController {
 
     private final ICourseEducationTypeService iCourseEducationTypeService;
 
+
+
     /**
      * 查询教育类型列表
      */
@@ -46,4 +48,6 @@ public class CourseEducationTypeController extends BaseController {
         List<CourseEducationTypeVo> list = iCourseEducationTypeService.queryList(bo);
         return getDataTable(list);
     }
+
+
 }

+ 13 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/order/OrderController.java

@@ -8,6 +8,8 @@ import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
+import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
+import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
 import com.zhongzheng.modules.order.bo.*;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
 import com.zhongzheng.modules.order.service.IOrderService;
@@ -42,6 +44,8 @@ public class OrderController extends BaseController {
 
     private final WxTokenService wxTokenService;
 
+    private final ICourseEducationTypeService iCourseEducationTypeService;
+
     /**
      * 查询订单列表
      */
@@ -133,4 +137,13 @@ public class OrderController extends BaseController {
         bo.setUserId(loginUser.getUser().getUserId());
         return AjaxResult.success(iOrderService.resumePcOrder(bo));
     }
+
+    @ApiOperation("查询用户教育类型列表")
+    @GetMapping("/userEduList")
+    public TableDataInfo<CourseEducationTypeVo> userEduList(OrderGoodsQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        startPage();
+        List<CourseEducationTypeVo> list = iCourseEducationTypeService.selectUserEduList(loginUser.getUser().getUserId(),bo.getGoodsType());
+        return getDataTable(list);
+    }
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseEducationTypeMapper.java

@@ -2,6 +2,10 @@ package com.zhongzheng.modules.course.mapper;
 
 import com.zhongzheng.modules.course.domain.CourseEducationType;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.course.vo.CourseEducationTypeVo;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * 教育类型Mapper接口
@@ -10,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  * @date 2021-10-08
  */
 public interface CourseEducationTypeMapper extends BaseMapper<CourseEducationType> {
-
+   List<CourseEducationTypeVo> selectUserEduList(@Param("userId") Long userId,@Param("goodsType") Integer goodsType);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseEducationTypeService.java

@@ -23,6 +23,8 @@ public interface ICourseEducationTypeService extends IService<CourseEducationTyp
 	 */
 	CourseEducationTypeVo queryById(Long id);
 
+	List<CourseEducationTypeVo> selectUserEduList(Long userId,Integer goodsType);
+
 	/**
 	 * 查询列表
 	 */

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

@@ -47,6 +47,11 @@ public class CourseEducationTypeServiceImpl extends ServiceImpl<CourseEducationT
         return BeanUtil.toBean(db, CourseEducationTypeVo.class);
     }
 
+    @Override
+    public List<CourseEducationTypeVo> selectUserEduList(Long userId,Integer goodsType) {
+        return this.baseMapper.selectUserEduList(userId,goodsType);
+    }
+
     @Override
     public List<CourseEducationTypeVo> queryList(CourseEducationTypeQueryBo bo) {
         LambdaQueryWrapper<CourseEducationType> lqw = Wrappers.lambdaQuery();

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderGoodsQueryBo.java

@@ -101,5 +101,7 @@ public class OrderGoodsQueryBo extends BaseEntity {
 	/** 复购老订单商品ID */
 	@ApiModelProperty("复购老订单商品ID")
 	private Integer rebuyOrderGoodsId;
+	@ApiModelProperty("商品类型 1视频2题库 3面授 4服务 5组合")
+	private Integer goodsType;
 
 }

+ 36 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseEducationTypeMapper.xml

@@ -14,5 +14,41 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateTime" column="update_time"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.course.vo.CourseEducationTypeVo" id="CourseEducationTypeVoResult">
+        <result property="id" column="id"/>
+        <result property="educationName" column="education_name"/>
+        <result property="encoder" column="encoder"/>
+        <result property="remark" column="remark"/>
+        <result property="status" column="status"/>
+        <result property="createTime" column="create_time"/>
+        <result property="updateTime" column="update_time"/>
+    </resultMap>
+
+
+    <select id="selectUserEduList" parameterType="map" resultMap="CourseEducationTypeVoResult">
+        SELECT
+            cet.id,
+            cet.education_name
+        FROM
+            (
+                SELECT
+                    og.goods_id
+                FROM
+                    `order` o
+                        LEFT JOIN order_goods og ON o.order_sn = og.order_sn
+                WHERE
+                    o.user_id = #{userId}
+                  AND og.pay_status IN ( 2, 3, 4 )
+                  AND og.refund_status != 2
+                GROUP BY
+                    og.goods_id
+            ) a
+                LEFT JOIN goods g ON a.goods_id = g.goods_id
+                LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
+        where g.goods_type = #{goodsType}
+        GROUP BY
+            cet.id
+
+    </select>
 
 </mapper>

+ 0 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -1030,7 +1030,6 @@
         and irb.remind_id =5
           and cgu.status = 1
         AND unix_timestamp(now()) BETWEEN cg.class_end_time-1728000 and cg.class_end_time-1641600
-        AND (SELECT COUNT(1) FROM inform_user iu where 1=1 and iu.remind_id = 5 and cgu.user_id = iu.user_id and cgu.grade_id = iu.grade_id and iu.system_status=3) &lt; 1
     </select>
 
     <select id="checkSendClassGradeUser" parameterType="map"  resultType="long">

+ 2 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderGoodsMapper.xml

@@ -302,4 +302,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           AND og.goods_id = #{goodsId}
     </select>
 
+
+
 </mapper>