Explorar o código

提交:七大员改造接口

yangdamao %!s(int64=3) %!d(string=hai) anos
pai
achega
a113975d25

+ 11 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/exam/ExamApplyController.java

@@ -7,9 +7,7 @@ import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
 import com.zhongzheng.modules.exam.service.IExamApplySiteService;
 import com.zhongzheng.modules.exam.service.IExamApplyUserService;
-import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
-import com.zhongzheng.modules.exam.vo.ExamApplyUserVo;
-import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
+import com.zhongzheng.modules.exam.vo.*;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -25,7 +23,6 @@ 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.modules.exam.vo.ExamApplyVo;
 import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.common.core.page.TableDataInfo;
@@ -178,4 +175,14 @@ public class ExamApplyController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 获取考试关联的前培安排
+     */
+    @ApiOperation("获取考试关联的前培安排")
+    @GetMapping("/getBefore/{applyId}")
+    public AjaxResult<ExamBeforeVo> getBeforeByApplyId(@PathVariable("applyId" ) Long applyId) {
+        ExamBeforeVo vo = iExamApplyUserService.getBeforeByApplyId(applyId);
+        return AjaxResult.success(vo);
+    }
+
 }

+ 2 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -116,6 +116,8 @@ wx:
 certificate:
     host: http://192.168.1.38:8000/
 
+liveGotoURL: http://120.79.166.78:19014/living-room/
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 3 - 0
zhongzheng-admin/src/main/resources/application-pre.yml

@@ -116,6 +116,9 @@ wx:
 
 certificate:
     host: http://192.168.1.38:8000/
+
+liveGotoURL: http://120.79.166.78:19010/living-room/
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

+ 2 - 0
zhongzheng-admin/src/main/resources/application-prod.yml

@@ -116,6 +116,8 @@ wx:
 certificate:
     host: https://m.xyyxt.net/
 
+liveGotoURL: https://web.xyyxt.net/living-room/
+
 officialPush:
     infoPath: http://jypt-dev.gdcic.net/organjxjy/ShangBaoMingdan
     periodPath: http://jypt-dev.gdcic.net/organjxjy/XueshiShenqing

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

@@ -535,7 +535,7 @@ public class WxLoginService implements IWxLoginService {
         String param = String.format(small_wxEnCodeParam, wxGzhAccessToken);
         String url = small_wxEnCodeUrl + "?" + param;
         JSONObject obj = new JSONObject();
-        obj.put("page", "/pages3/live/detail");
+        obj.put("page", "pages3/live/detail");
         StringBuilder sceneParam = new StringBuilder();
         sceneParam.append("gid=").append(watchPer.getGoodsId()).append("&");
         sceneParam.append("cid=").append(watchPer.getCourseId()).append("&");

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java

@@ -22,6 +22,7 @@ import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import java.util.List;
@@ -42,6 +43,9 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
     @Autowired
     private ICourseSectionService courseSectionService;
 
+    @Value("${liveGotoURL}")
+    private String liveGotoURL;
+
     @Override
     public CourseSectionWatchPerVo getSectionWatchPer(SectionWatchPerBo bo) {
         CourseSectionWatchPerVo vo = new CourseSectionWatchPerVo();
@@ -56,6 +60,10 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
             default:
                 throw new CustomException("课程节类型不正确,请检查");
         }
+        //获取课程节信息
+        CourseSection section = courseSectionService.getById(bo.getSectionId());
+        String url = String.format("%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+        vo.setEnCodePC(url);
         CourseSectionWatchPer watchPer = getOne(new LambdaQueryWrapper<CourseSectionWatchPer>()
                 .eq(ObjectUtils.isNotNull(bo.getCourseId()), CourseSectionWatchPer::getCourseId, bo.getCourseId())
                 .eq(ObjectUtils.isNotNull(bo.getChapterId()), CourseSectionWatchPer::getChapterId, bo.getChapterId())

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseSectionWatchPerVo.java

@@ -59,4 +59,8 @@ public class CourseSectionWatchPerVo implements Serializable {
     /** 小程序二维码 */
     @ApiModelProperty("小程序二维码")
     private String enCode;
+
+    /** 小程序二维码 */
+    @ApiModelProperty("小程序二维码")
+    private String enCodePC;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeAddBo.java

@@ -45,4 +45,6 @@ public class ExamBeforeAddBo {
     /** 1启用 0未启用 -1删除 2过期 */
     @ApiModelProperty("1启用 0未启用 -1删除 2过期")
     private Integer status;
+    @ApiModelProperty("考试ID")
+    private Long applyId;
 }

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyUserService.java

@@ -6,6 +6,7 @@ import com.zhongzheng.modules.exam.bo.ExamApplyUserEditBo;
 import com.zhongzheng.modules.exam.bo.ExamApplyUserQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamApplyUser;
 import com.zhongzheng.modules.exam.vo.ExamApplyUserVo;
+import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -51,4 +52,14 @@ public interface IExamApplyUserService extends IService<ExamApplyUser> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+	/**
+	 * 获取考试关联的前培安排
+	 * @author change
+	 * @date 2022/8/22 10:39
+	 * @param applyId
+	 * @return com.zhongzheng.modules.exam.vo.ExamBeforeVo
+	 */
+    ExamBeforeVo getBeforeByApplyId(Long applyId);
+
 }

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyUserServiceImpl.java

@@ -2,14 +2,21 @@ package com.zhongzheng.modules.exam.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.exam.bo.ExamApplyUserAddBo;
 import com.zhongzheng.modules.exam.bo.ExamApplyUserEditBo;
 import com.zhongzheng.modules.exam.bo.ExamApplyUserQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.domain.ExamBefore;
+import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
 import com.zhongzheng.modules.exam.mapper.ExamApplyUserMapper;
 import com.zhongzheng.modules.exam.service.IExamApplyUserService;
+import com.zhongzheng.modules.exam.service.IExamBeforeApplyService;
+import com.zhongzheng.modules.exam.service.IExamBeforeService;
 import com.zhongzheng.modules.exam.vo.ExamApplyUserVo;
+import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -30,6 +37,11 @@ import java.util.stream.Collectors;
 @Service
 public class ExamApplyUserServiceImpl extends ServiceImpl<ExamApplyUserMapper, ExamApplyUser> implements IExamApplyUserService {
 
+    @Autowired
+    private IExamBeforeApplyService iExamBeforeApplyService;
+    @Autowired
+    private IExamBeforeService iExamBeforeService;
+
     @Override
     public ExamApplyUserVo queryById(Long id){
         ExamApplyUser db = this.baseMapper.selectById(id);
@@ -102,4 +114,19 @@ public class ExamApplyUserServiceImpl extends ServiceImpl<ExamApplyUserMapper, E
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public ExamBeforeVo getBeforeByApplyId(Long applyId) {
+        ExamBeforeApply beforeApply = iExamBeforeApplyService
+                .list(new LambdaQueryWrapper<ExamBeforeApply>()
+                .eq(ExamBeforeApply::getApplyId, applyId)
+                .last("LIMIT 1")).stream().findFirst().orElse(null);
+        if (ObjectUtils.isNull(beforeApply)){
+            return new ExamBeforeVo();
+        }
+        ExamBefore before = iExamBeforeService.getById(beforeApply.getBeforeId());
+        ExamBeforeVo vo = new ExamBeforeVo();
+        BeanUtil.copyProperties(before,vo);
+        return vo;
+    }
 }

+ 10 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeServiceImpl.java

@@ -10,6 +10,7 @@ import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.collect.domain.CollectBank;
 import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.domain.ExamApply;
+import com.zhongzheng.modules.exam.service.IExamBeforeApplyService;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.order.domain.OrderGoods;
 import com.zhongzheng.modules.order.service.IOrderGoodsService;
@@ -38,6 +39,8 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
 
     @Autowired
     private IOrderGoodsService iOrderGoodsService;
+    @Autowired
+    private IExamBeforeApplyService iExamBeforeApplyService;
 
     @Override
     public ExamBeforeVo queryById(Long beforeId){
@@ -100,7 +103,13 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
         add.setCode(ServletUtils.getEncoded("QP"));
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
-        return this.save(add);
+        this.save(add);
+        //保存考试和前培的关联关系
+        ExamBeforeApplyAddBo applyAddBo = new ExamBeforeApplyAddBo();
+        applyAddBo.setApplyIds(Arrays.asList(bo.getApplyId()));
+        applyAddBo.setBeforeId(add.getBeforeId());
+        iExamBeforeApplyService.insertByAddBo(applyAddBo);
+        return true;
     }
 
     @Override

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

@@ -4,6 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zhongzheng.modules.course.mapper.CourseSectionWatchPerMapper">
 
+
     <select id="getUserIdByGoods" parameterType="com.zhongzheng.modules.course.bo.SectionWatchQueryBo" resultType="java.lang.Long">
         SELECT
             o.user_id
@@ -15,7 +16,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND og.refund_status != 2
             AND og.STATUS = 1
             AND o.`status` = 1
-            AND g.`status` = 1
             AND og.goods_id = #{goodsId}
     </select>