he2802 2 سال پیش
والد
کامیت
d0ac255a79

+ 10 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -75,6 +75,16 @@ public class CourseController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("查询用户拥有的讲义商品")
+    @GetMapping("/goodsHandoutsList")
+    public TableDataInfo<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo) {
+        ClientLoginUser loginUser = wxTokenService.getLoginUser(ServletUtils.getRequest());
+        bo.setUserId(loginUser.getUser().getUserId());
+        startPage();
+        List<GoodsUserVo> list = iCourseService.goodsHandoutsList(bo);
+        return getDataTable(list);
+    }
+
     @ApiOperation("查询用户商品重修状态")
     @GetMapping("/goodsRebuildStatus")
     public AjaxResult<Long> goodsRebuildStatus(CourseQueryBo bo) {

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMapper.java

@@ -36,6 +36,8 @@ public interface CourseMapper extends BaseMapper<Course> {
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
+    List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);
+
     List<CourseUserVo> courseList(CourseQueryBo bo);
 
     CourseUserVo getCourseUserVoInfo(Long id);

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

@@ -74,6 +74,8 @@ public interface ICourseService extends IService<Course> {
 
     List<GoodsUserVo> goodsList(CourseQueryBo bo);
 
+	List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo);
+
 	List<CourseUserVo> courseList(CourseQueryBo bo);
 
 	CourseUserVo getCourseUserVoInfo(Long courseId);

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

@@ -588,6 +588,12 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return goodsUserVos;
     }
 
+    @Override
+    public List<GoodsUserVo> goodsHandoutsList(CourseQueryBo bo) {
+        List<GoodsUserVo> goodsUserVos = baseMapper.goodsHandoutsList(bo);
+        return goodsUserVos;
+    }
+
 
     @Override
     public List<GoodsUserVo> goodsProgressList(CourseQueryBo bo) {

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigGoodsQueryBo.java

@@ -59,4 +59,15 @@ public class OrderBusinessConfigGoodsQueryBo extends BaseEntity {
 	/** 班级类型 1基础班 2强化班 3私塾班 */
 	@ApiModelProperty("班级类型 1基础班 2强化班 3私塾班")
 	private Integer gradeType;
+	/** 项目名称 */
+	@ApiModelProperty("项目名称")
+	private String projectName;
+
+	/** 教育类型名称 */
+	@ApiModelProperty("教育类型名称")
+	private String educationName;
+	@ApiModelProperty("业务名称")
+	private String businessName;
+	@ApiModelProperty("科目名称")
+	private Long subjectName;
 }

+ 9 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/bo/OrderBusinessConfigQueryBo.java

@@ -56,4 +56,13 @@ public class OrderBusinessConfigQueryBo extends BaseEntity {
 	/** 科目ID */
 	@ApiModelProperty("科目ID")
 	private Long subjectId;
+	/** 项目名称 */
+	@ApiModelProperty("项目名称")
+	private String projectName;
+
+	/** 教育类型名称 */
+	@ApiModelProperty("教育类型名称")
+	private String educationName;
+	@ApiModelProperty("业务名称")
+	private String businessName;
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java

@@ -261,7 +261,7 @@ public class WxPayServiceImpl implements IWxPayService {
             data.put("attach", TenantId);
    //         log.info("支付参数:{}", JSON.toJSONString(data));
             Map<String, String> resp = wxpay.unifiedOrder(data);
-    //        log.info("支付结果:{}", JSON.toJSONString(resp));
+            log.info("支付结果:{}", JSON.toJSONString(resp));
             Map<String, String> result = new HashMap<>();
             //         result.put("provider","wxpay");
             result.put("appId", appid);

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

@@ -594,6 +594,53 @@
         </if>
         order by o.create_time desc
     </select>
+
+    <select id="goodsHandoutsList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="GoodsUserVo">
+        SELECT
+        g.*,
+        o.user_id,
+        og.study_count as order_study_count,
+        og.order_goods_id,
+        og.service_start_time,
+        og.service_end_time,
+        cb.goods_learning_order,
+        (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
+        (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
+        (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,
+        (SELECT GROUP_CONCAT(subject_name)  from course_subject where FIND_IN_SET(id,g.subject_ids)) subject_names
+        FROM
+        `order` o
+        LEFT JOIN order_goods og ON og.order_sn = o.order_sn
+        LEFT JOIN goods g on og.goods_id = g.goods_id
+        LEFT JOIN course_business cb on g.business_id = cb.id
+        where 1=1
+        AND og.`status` = 1
+        --         AND og.refund_status in (0,1,3)
+        AND og.refund_status in (0,3)
+        AND og.pay_status in (2,3,4)
+        AND g.goods_type =8
+        <if test="pageNum == null">
+            and (SELECT count(*) from class_grade cg where (cg.class_end_time >  unix_timestamp(now()) or ISNULL(cg.class_end_time)) and cg.grade_id = og.grade_id ) >0
+        </if>
+        <if test="userId != null and userId != ''">
+            and o.user_id = #{userId}
+        </if>
+        <if test="educationTypeId != null and educationTypeId != ''">
+            AND g.education_type_id = #{educationTypeId}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            AND g.business_id = #{businessId}
+        </if>
+        <if test="orderGoodsId != null and orderGoodsId != ''">
+            AND og.order_goods_id = #{orderGoodsId}
+        </if>
+        <if test="goodsId != null and goodsId != ''">
+            AND og.goods_id = #{goodsId}
+        </if>
+        order by o.create_time desc
+    </select>
+
+
     <select id="courseList" parameterType="com.zhongzheng.modules.course.bo.CourseQueryBo"  resultMap="CourseUserVo">
         SELECT
             c.*,

+ 12 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigGoodsMapper.xml

@@ -90,6 +90,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="subjectId != null and subjectId != ''">
             and bcg.subject_id = #{subjectId}
         </if>
+        <if test="businessName != null and businessName != ''">
+            and cb.business_name = #{businessName}
+        </if>
+        <if test="projectName != null and projectName != ''">
+            and cpt.project_name = #{projectName}
+        </if>
+        <if test="educationName != null and educationName != ''">
+            and cet.education_name = #{educationName}
+        </if>
+        <if test="subjectName != null and subjectName != ''">
+            and cs.subject_name = #{subjectName}
+        </if>
     </select>
 
 </mapper>

+ 9 - 0
zhongzheng-system/src/main/resources/mapper/modules/order/OrderBusinessConfigMapper.xml

@@ -51,6 +51,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="educationId != null and educationId != ''">
             and cet.id = #{educationId}
         </if>
+        <if test="businessName != null and businessName != ''">
+            and cb.business_name = #{businessName}
+        </if>
+        <if test="projectName != null and projectName != ''">
+            and cpt.project_name = #{projectName}
+        </if>
+        <if test="educationName != null and educationName != ''">
+            and cet.education_name = #{educationName}
+        </if>
         <if test="subjectId != null and subjectId != ''">
             and (SELECT COUNT(obcg.id) FROM order_business_config_goods obcg  where obcg.subject_id = #{subjectId} AND obcg.config_id = obc.id AND obcg.`status` = 1) > 0
         </if>