Browse Source

500接口提交

花田厝 4 months ago
parent
commit
0237a89a21
19 changed files with 608 additions and 128 deletions
  1. 109 0
      jsjp-admin/src/main/java/com/miaxis/app/controller/video/VideoFiveTeachingController.java
  2. 6 1
      jsjp-admin/src/main/java/com/miaxis/app/controller/wx/WxJsjpController.java
  3. 1 1
      jsjp-admin/src/main/resources/application-dev.yml
  4. 1 1
      jsjp-admin/src/main/resources/application-prod.yml
  5. 1 1
      jsjp-admin/src/main/resources/application-prodtest.yml
  6. 50 0
      jsjp-admin/src/test/java/com/miaxis/test/WxFenZhangTest.java
  7. 14 0
      jsjp-service/pom.xml
  8. 6 0
      jsjp-service/src/main/java/com/miaxis/order/domain/OrderSplit.java
  9. 2 0
      jsjp-service/src/main/java/com/miaxis/order/service/IOrderInfoService.java
  10. 166 122
      jsjp-service/src/main/java/com/miaxis/order/service/impl/OrderInfoServiceImpl.java
  11. 74 0
      jsjp-service/src/main/java/com/miaxis/video/domain/VideoFiveTeaching.java
  12. 52 0
      jsjp-service/src/main/java/com/miaxis/video/dto/VideoFiveTeachingDto.java
  13. 24 0
      jsjp-service/src/main/java/com/miaxis/video/mapper/VideoFiveTeachingMapper.java
  14. 23 0
      jsjp-service/src/main/java/com/miaxis/video/service/IVideoFiveTeachingService.java
  15. 34 0
      jsjp-service/src/main/java/com/miaxis/video/service/impl/VideoFiveTeachingServiceImpl.java
  16. 2 2
      jsjp-service/src/main/java/com/miaxis/wx/domain/WxJsOrder.java
  17. 3 0
      jsjp-service/src/main/java/com/miaxis/wx/dto/WxOrderDTO.java
  18. 2 0
      jsjp-service/src/main/resources/mapper/order/OrderSplitMapper.xml
  19. 38 0
      jsjp-service/src/main/resources/mapper/video/VideoFiveTeachingMapper.xml

+ 109 - 0
jsjp-admin/src/main/java/com/miaxis/app/controller/video/VideoFiveTeachingController.java

@@ -0,0 +1,109 @@
+package com.miaxis.app.controller.video;
+
+import com.miaxis.common.constant.Constants;
+import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
+import com.miaxis.common.utils.poi.ExcelUtil;
+import com.miaxis.framework.web.service.TokenService;
+import com.miaxis.video.domain.VideoFiveTeaching;
+import com.miaxis.video.dto.VideoFiveTeachingDto;
+import com.miaxis.video.service.IVideoFiveTeachingService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【精选500题教学视频】Controller
+ *
+ * @author miaxis
+ * @date 2024-11-20
+ */
+@RestController
+@RequestMapping(Constants.OPEN_PREFIX + "/video/fiveTeaching")
+@Api(tags = {"【app-精选500题教学视频】"})
+public class VideoFiveTeachingController extends BaseController {
+    @Autowired
+    private IVideoFiveTeachingService videoFiveTeachingService;
+
+
+
+
+    @Autowired
+    private TokenService tokenService;
+    /**
+     * 查询精选500题教学视频列表
+     */
+    @GetMapping("/list")
+    @ApiOperation("查询精选500题教学视频列表")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
+    })
+    public ResponsePageInfo<VideoFiveTeaching> list(@ModelAttribute VideoFiveTeachingDto videoFiveTeachingDto) {
+        startPage();
+        List<VideoFiveTeaching> list = videoFiveTeachingService.selectVideoFiveTeachingList(videoFiveTeachingDto);
+        return toResponsePageInfo(list);
+    }
+
+    /**
+     * 导出精选500题教学视频列表
+     */
+    @GetMapping("/export")
+    @ApiOperation("导出精选500题教学视频列表Excel")
+    public Response<String> export(@ModelAttribute VideoFiveTeachingDto videoFiveTeachingDto) {
+        List<VideoFiveTeaching> list = videoFiveTeachingService.selectVideoFiveTeachingList(videoFiveTeachingDto);
+        ExcelUtil<VideoFiveTeaching> util = new ExcelUtil<VideoFiveTeaching>(VideoFiveTeaching.class);
+        return util.exportExcel(list, "teaching");
+    }
+
+    /**
+     * 获取精选500题教学视频详细信息
+     */
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取精选500题教学视频详细信息")
+    public Response<VideoFiveTeaching> getInfo(
+            @ApiParam(name = "id", value = "精选500题教学视频参数", required = true)
+            @PathVariable("id") Long id
+    ) {
+        return Response.success(videoFiveTeachingService.getById(id));
+    }
+
+    /**
+     * 新增精选500题教学视频
+     */
+    @PostMapping
+    @ApiOperation("新增精选500题教学视频")
+    public Response<Integer> add(@RequestBody VideoFiveTeaching videoFiveTeaching) {
+        return toResponse(videoFiveTeachingService.save(videoFiveTeaching) ? 1 : 0);
+    }
+
+    /**
+     * 修改精选500题教学视频
+     */
+    @PutMapping
+    @ApiOperation("修改精选500题教学视频")
+    public Response<Integer> edit(@RequestBody VideoFiveTeaching videoFiveTeaching) {
+        return toResponse(videoFiveTeachingService.updateById(videoFiveTeaching) ? 1 : 0);
+    }
+
+    /**
+     * 删除精选500题教学视频
+     */
+    @DeleteMapping("/{ids}")
+    @ApiOperation("删除精选500题教学视频")
+    public Response<Integer> remove(
+            @ApiParam(name = "ids", value = "精选500题教学视频ids参数", required = true)
+            @PathVariable Long[] ids
+    ) {
+        return toResponse(videoFiveTeachingService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
+    }
+
+
+
+
+
+}

+ 6 - 1
jsjp-admin/src/main/java/com/miaxis/app/controller/wx/WxJsjpController.java

@@ -139,7 +139,12 @@ public class WxJsjpController extends BaseController {
             order.setIsFz(0); //不分账
         }
 
-        order.setGoodsType(1);
+        if(wxOrderDTO.getGoodsType()!=null) {
+            order.setGoodsType(wxOrderDTO.getGoodsType());
+        } else {
+            order.setGoodsType(1);
+        }
+
         order.setPhoneType(wxOrderDTO.getPhoneType());  //手机类型
         if ("yntms".equals(gzptUserInfo.getCity())) { //如果是一诺地市
             order.setDqbh(gzptUserInfo.getCountry().substring(0,4));

+ 1 - 1
jsjp-admin/src/main/resources/application-dev.yml

@@ -164,7 +164,7 @@ applepay:
 #分账设置 version 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
 fz:
     type: "MERCHANT_ID"
-    account: "account"
+    account: "1616445600"
     relationType: "PARTNER"
     name: "闽侯县上街逗趣乐工作室"
     description: "主播授权视频分账30%"

+ 1 - 1
jsjp-admin/src/main/resources/application-prod.yml

@@ -174,7 +174,7 @@ wai:
 #分账设置 version 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
 fz:
     type: "MERCHANT_ID"
-    account: "account"
+    account: "1616445600"
     relationType: "PARTNER"
     name: "闽侯县上街逗趣乐工作室"
     description: "主播授权视频分账30%"

+ 1 - 1
jsjp-admin/src/main/resources/application-prodtest.yml

@@ -147,7 +147,7 @@ applepay:
 #分账设置 version 正式版为 "release",体验版为 "trial",开发版为 "develop"。默认是正式版。
 fz:
     type: "MERCHANT_ID"
-    account: "account"
+    account: "1616445600"
     relationType: "PARTNER"
     name: "闽侯县上街逗趣乐工作室"
     description: "主播授权视频分账30%"

+ 50 - 0
jsjp-admin/src/test/java/com/miaxis/test/WxFenZhangTest.java

@@ -0,0 +1,50 @@
+package com.miaxis.test;
+
+import com.miaxis.JsjpApplication;
+import com.miaxis.order.domain.OrderInfo;
+import com.miaxis.order.service.IOrderInfoService;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import java.util.List;
+
+@SpringBootTest(classes = JsjpApplication.class)
+@RunWith(SpringRunner.class)
+public class WxFenZhangTest {
+
+
+    @Autowired
+    private IOrderInfoService orderInfoService;
+
+
+    @Test
+    public void test1() throws Exception {
+
+        List<OrderInfo> orderInfoList = orderInfoService.selectOrderInfoByWaitProfit();
+
+        for (int i = 0; i < orderInfoList.size(); i++) {
+            OrderInfo orderInfo = orderInfoList.get(i);
+            orderInfoService.wxAddFenZhang(orderInfo); //添加
+            boolean flag = orderInfoService.wxProfitsharing(orderInfoList.get(i));
+
+        }
+
+
+    }
+
+    @Test
+    public void test2() throws Exception {
+
+        OrderInfo orderInfo = orderInfoService.getByOutTradeNo("12025020710535648621586410006527");
+        orderInfoService.wxAddFenZhang(orderInfo); //添加
+        boolean flag = orderInfoService.wxProfitsharing(orderInfo);
+
+    }
+
+
+
+}
+

+ 14 - 0
jsjp-service/pom.xml

@@ -49,6 +49,20 @@
             <version>0.2.1</version>
         </dependency>
 
+        <!--
+                <dependency>
+                    <groupId>com.github.wechatpay-apiv3</groupId>
+                    <artifactId>wechatpay-java</artifactId>
+                    <version>0.2.15</version>
+                    <exclusions>
+                        <exclusion>
+
+                    <groupId>com.squareup.okhttp3</groupId>
+                    <artifactId>okhttp</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+        -->
 
     </dependencies>
 

+ 6 - 0
jsjp-service/src/main/java/com/miaxis/order/domain/OrderSplit.java

@@ -32,6 +32,12 @@ public class OrderSplit extends BaseBusinessEntity {
     @ApiModelProperty(value = "微信支付系统生成的订单号")
     private String transactionId;
 
+
+    /** 微信分账单号,微信支付系统返回的唯一标识*/
+    @TableField("order_id")
+    @ApiModelProperty(value = "微信分账单号,微信支付系统返回的唯一标识")
+    private String orderId;
+
     /** 商户内部分账订单ID */
     @Excel(name = "商户内部分账订单ID")
     @TableField("out_split_no")

+ 2 - 0
jsjp-service/src/main/java/com/miaxis/order/service/IOrderInfoService.java

@@ -58,4 +58,6 @@ public interface IOrderInfoService extends IService<OrderInfo> {
     @Transactional
     boolean wxProfitsharing(OrderInfo orderInfo) throws Exception;
 
+//    @Transactional
+//    boolean wxProfitsharingRetrun(OrderInfo orderInfo) throws Exception;
 }

File diff suppressed because it is too large
+ 166 - 122
jsjp-service/src/main/java/com/miaxis/order/service/impl/OrderInfoServiceImpl.java


+ 74 - 0
jsjp-service/src/main/java/com/miaxis/video/domain/VideoFiveTeaching.java

@@ -0,0 +1,74 @@
+package com.miaxis.video.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.miaxis.common.annotation.Excel;
+import com.miaxis.common.core.domain.BaseBusinessEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ * 精选500题教学视频对象 video_five_teaching
+ *
+ * @author miaxis
+ * @date 2024-11-20
+ */
+@Data
+@TableName("video_five_teaching")
+@ApiModel(value = "VideoFiveTeaching", description = "精选500题教学视频对象 video_five_teaching")
+public class VideoFiveTeaching extends BaseBusinessEntity {
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    @TableId(value = "id")
+    @ApiModelProperty(value = "$column.columnComment")
+    private Long id;
+
+
+    /** 视频名称 */
+    @Excel(name = "视频名称")
+    @TableField("video_name")
+    @ApiModelProperty(value = "视频名称")
+    private String videoName;
+
+    /** 视频封面 */
+    @Excel(name = "视频封面")
+    @TableField("video_cover")
+    @ApiModelProperty(value = "视频封面")
+    private String videoCover;
+
+    /** 视频地址 */
+    @Excel(name = "视频地址")
+    @TableField("video_url")
+    @ApiModelProperty(value = "视频地址")
+    private String videoUrl;
+
+    /** 1:科目一 2:科目二 3:科目三 4:科目四 */
+    @Excel(name = "1:科目一 2:科目二 3:科目三 4:科目四")
+    @TableField("video_subject")
+    @ApiModelProperty(value = "1:科目一 2:科目二 3:科目三 4:科目四")
+    private Long videoSubject;
+
+    /** 0未开启 1已开启 */
+    @Excel(name = "0未开启 1已开启")
+    @TableField("state")
+    @ApiModelProperty(value = "0未开启 1已开启")
+    private Long state;
+
+    /** 0:竖  1:横 */
+    @Excel(name = "0:竖  1:横")
+    @TableField("horizontal")
+    @ApiModelProperty(value = "0:竖  1:横")
+    private Long horizontal;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    @TableField("video_order")
+    @ApiModelProperty(value = "排序")
+    private Long videoOrder;
+
+
+
+}

+ 52 - 0
jsjp-service/src/main/java/com/miaxis/video/dto/VideoFiveTeachingDto.java

@@ -0,0 +1,52 @@
+package com.miaxis.video.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+ *
+ * @author miaxis
+ * @date 2023-02-20
+ */
+@Data
+@ApiModel(value = "VideoTeachingDto", description = "教练视频对象DTO")
+public class VideoFiveTeachingDto {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    /** 视频名称 */
+    @ApiModelProperty(value = "视频名称")
+    private String videoName;
+
+    /** 视频封面 */
+    @ApiModelProperty(value = "视频封面")
+    private String videoCover;
+
+    /** 视频地址 */
+    @ApiModelProperty(value = "视频地址")
+    private String videoUrl;
+
+    /** 1:科目一 2:科目二 3:科目三 4:科目四 */
+    @ApiModelProperty(value = "1:科目一 2:科目二 3:科目三 4:科目四")
+    private Long videoSubject;
+
+
+    /** 0未开启 1已开启 */
+    @ApiModelProperty(value = "0未开启 1已开启")
+    private Long state;
+
+
+    /** 0竖屏 1横屏*/
+    @ApiModelProperty(value = "竖屏 1横屏")
+    private Integer horizontal;
+
+    /** 视频排序*/
+    @ApiModelProperty(value = "视频排序")
+    private Integer videoOrder;
+
+
+
+}

+ 24 - 0
jsjp-service/src/main/java/com/miaxis/video/mapper/VideoFiveTeachingMapper.java

@@ -0,0 +1,24 @@
+package com.miaxis.video.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.miaxis.video.domain.VideoFiveTeaching;
+import com.miaxis.video.dto.VideoFiveTeachingDto;
+
+import java.util.List;
+
+/**
+ * 精选500题教学视频Mapper接口
+ *
+ * @author miaxis
+ * @date 2024-11-20
+ */
+public interface VideoFiveTeachingMapper extends BaseMapper<VideoFiveTeaching> {
+    /**
+     * 查询精选500题教学视频列表
+     *
+     * @param videoFiveTeachingDto 精选500题教学视频
+     * @return 精选500题教学视频集合
+     */
+    public List<VideoFiveTeaching> selectVideoFiveTeachingList(VideoFiveTeachingDto videoFiveTeachingDto);
+
+}

+ 23 - 0
jsjp-service/src/main/java/com/miaxis/video/service/IVideoFiveTeachingService.java

@@ -0,0 +1,23 @@
+package com.miaxis.video.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.miaxis.video.domain.VideoFiveTeaching;
+import com.miaxis.video.dto.VideoFiveTeachingDto;
+
+import java.util.List;
+
+/**
+ * 精选500题教学视频Service接口
+ *
+ * @author miaxis
+ * @date 2024-11-20
+ */
+public interface IVideoFiveTeachingService extends IService<VideoFiveTeaching>{
+    /**
+     * 查询精选500题教学视频列表
+     *
+     * @param videoFiveTeachingDto 精选500题教学视频
+     * @return 精选500题教学视频集合
+     */
+    public List<VideoFiveTeaching> selectVideoFiveTeachingList(VideoFiveTeachingDto videoFiveTeachingDto);
+}

+ 34 - 0
jsjp-service/src/main/java/com/miaxis/video/service/impl/VideoFiveTeachingServiceImpl.java

@@ -0,0 +1,34 @@
+package com.miaxis.video.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.miaxis.video.domain.VideoFiveTeaching;
+import com.miaxis.video.dto.VideoFiveTeachingDto;
+import com.miaxis.video.mapper.VideoFiveTeachingMapper;
+import com.miaxis.video.service.IVideoFiveTeachingService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 精选500题教学视频Service业务层处理
+ *
+ * @author miaxis
+ * @date 2024-11-20
+ */
+@Service
+public class VideoFiveTeachingServiceImpl extends ServiceImpl<VideoFiveTeachingMapper, VideoFiveTeaching> implements IVideoFiveTeachingService {
+    @Autowired
+    private VideoFiveTeachingMapper videoFiveTeachingMapper;
+
+    /**
+     * 查询精选500题教学视频列表
+     *
+     * @param videoFiveTeachingDto 精选500题教学视频
+     * @return 精选500题教学视频
+     */
+    @Override
+    public List<VideoFiveTeaching> selectVideoFiveTeachingList(VideoFiveTeachingDto videoFiveTeachingDto){
+        return videoFiveTeachingMapper.selectVideoFiveTeachingList(videoFiveTeachingDto);
+    }
+}

+ 2 - 2
jsjp-service/src/main/java/com/miaxis/wx/domain/WxJsOrder.java

@@ -186,9 +186,9 @@ public class WxJsOrder extends BaseBusinessEntity{
     private int isShare;
 
     /** 是否分账 */
-    @Excel(name = "是否分给教练 0:不分账  1:分账")
+    @Excel(name = "是否分给教练 0:不分账  1:分账")
     @TableField("is_fz")
-    @ApiModelProperty(value = "是否分给教练 0:不分账  1:分账")
+    @ApiModelProperty(value = "是否分给教练 0:不分账  1:分账")
     private int isFz;
 
     /** 驾校编号 */

+ 3 - 0
jsjp-service/src/main/java/com/miaxis/wx/dto/WxOrderDTO.java

@@ -14,6 +14,9 @@ public class WxOrderDTO {
     @ApiModelProperty(value = "用户id",required = true)
     private Long userId;
 
+    @ApiModelProperty(value = "商品类型 1:VIP 2:考场 3:实物 4:特训包")
+    private Integer goodsType;
+
     @ApiModelProperty(value = "手机类型 1苹果 2安卓")
     private Integer phoneType;  // 1苹果 2安卓
 }

+ 2 - 0
jsjp-service/src/main/resources/mapper/order/OrderSplitMapper.xml

@@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="OrderSplit" id="OrderSplitResult">
         <result property="id"    column="id"    />
         <result property="transactionId"    column="transaction_id"    />
+        <result property="orderId"    column="order_id"    />
         <result property="outSplitNo"    column="out_split_no"    />
         <result property="outTradeNo"    column="out_trade_no"    />
         <result property="amount"    column="amount"    />
@@ -25,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select * from order_split
         <where>
             <if test="transactionId != null  and transactionId != ''"> and transaction_id = #{transactionId}</if>
+            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
             <if test="outSplitNo != null  and outSplitNo != ''"> and out_split_no = #{outSplitNo}</if>
             <if test="outTradeNo != null  and outTradeNo != ''"> and out_trade_no = #{outTradeNo}</if>
             <if test="amount != null ">and amount = #{amount}</if>

+ 38 - 0
jsjp-service/src/main/resources/mapper/video/VideoFiveTeachingMapper.xml

@@ -0,0 +1,38 @@
+<?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="com.miaxis.video.mapper.VideoFiveTeachingMapper">
+
+    <resultMap type="VideoFiveTeaching" id="VideoFiveTeachingResult">
+        <result property="id"    column="id"    />
+        <result property="videoName"    column="video_name"    />
+        <result property="videoCover"    column="video_cover"    />
+        <result property="videoUrl"    column="video_url"    />
+        <result property="videoSubject"    column="video_subject"    />
+        <result property="state"    column="state"    />
+        <result property="horizontal"    column="horizontal"    />
+        <result property="videoOrder"    column="video_order"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+    </resultMap>
+
+    <sql id="selectVideoFiveTeachingVo">
+        select * from video_five_teaching
+    </sql>
+
+    <select id="selectVideoFiveTeachingList" parameterType="com.miaxis.video.dto.VideoFiveTeachingDto" resultMap="VideoFiveTeachingResult">
+        <include refid="selectVideoFiveTeachingVo"/>
+        <where>
+            <if test="videoName != null  and videoName != ''"> and video_name like concat('%', #{videoName}, '%')</if>
+            <if test="videoCover != null  and videoCover != ''"> and video_cover = #{videoCover}</if>
+            <if test="videoUrl != null  and videoUrl != ''"> and video_url = #{videoUrl}</if>
+            <if test="videoSubject != null "> and video_subject = #{videoSubject}</if>
+            <if test="state != null "> and state = #{state}</if>
+            <if test="horizontal != null "> and horizontal = #{horizontal}</if>
+            <if test="videoOrder != null "> and video_order = #{videoOrder}</if>
+            order by video_order asc
+        </where>
+    </select>
+
+</mapper>

Some files were not shown because too many files changed in this diff