he2802 2 years ago
parent
commit
b53185fc18

+ 15 - 3
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -30,7 +30,9 @@ import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionOtherService;
 import com.zhongzheng.modules.base.bo.ConfigQueryBo;
 import com.zhongzheng.modules.course.bo.ExternalQuestionBo;
+import com.zhongzheng.modules.course.bo.ReplenishExamBo;
 import com.zhongzheng.modules.course.vo.ExternalQuestionVo;
+import com.zhongzheng.modules.course.vo.ReplenishExamVo;
 import com.zhongzheng.modules.distribution.bo.DistributionActivityGoodsQueryBo;
 import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalPayBo;
 import com.zhongzheng.modules.distribution.service.IDistributionActivityGoodsService;
@@ -353,13 +355,23 @@ public class CommonController extends BaseController {
     @ApiOperation("获取外部题库商品(山东题库)")
     @PostMapping("common/external/question")
     public AjaxResult getExternalQuestion(@RequestBody ExternalQuestionBo bo) {
-//        if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
-//            return AjaxResult.error("签名错误");
-//        }
+        if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
+            return AjaxResult.error("签名错误");
+        }
         List<ExternalQuestionVo> questionVos = iGoodsService.getExternalQuestion(bo);
         return AjaxResult.success(questionVos);
     }
 
+    @ApiOperation("获取补考商品")
+    @PostMapping("common/replenish/exam")
+    public AjaxResult getReplenishExam(@RequestBody ReplenishExamBo bo) {
+        if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
+            return AjaxResult.error("签名错误");
+        }
+        List<ReplenishExamVo> questionVos = iGoodsService.getReplenishExam(bo);
+        return AjaxResult.success(questionVos);
+    }
+
 
     @ApiOperation("获取某场考试信息")
     @PostMapping("common/apply/detail")

+ 1 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -145,6 +145,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/get/goods/studyUrl").anonymous()
                 .antMatchers("/common/apply/detail").anonymous()
                 .antMatchers("/common/external/question").anonymous()
+                .antMatchers("/common/replenish/exam").anonymous()
                 .antMatchers("/common/student/image/update").anonymous()
                 .antMatchers("/common/platform/pay").anonymous()
                 .antMatchers("/common/platform/pay/handle").anonymous()

+ 25 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/ReplenishExamBo.java

@@ -0,0 +1,25 @@
+package com.zhongzheng.modules.course.bo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年09月20日 9:05
+ */
+@Data
+public class ReplenishExamBo implements Serializable {
+
+    @ApiModelProperty("当前时间戳")
+    @NotBlank(message = "当前时间戳不能为空")
+    private Long stamp;
+
+    @ApiModelProperty("签名")
+    @NotBlank(message = "签名不能为空")
+    private String sign;
+
+    private Long tenantId;
+}

+ 28 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/ReplenishExamVo.java

@@ -0,0 +1,28 @@
+package com.zhongzheng.modules.course.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author yangdamao
+ * @date 2023年09月12日 8:52
+ */
+@Data
+public class ReplenishExamVo implements Serializable {
+
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+
+    @ApiModelProperty("商品名称")
+    private String goodsName;
+
+    @ApiModelProperty("商品价格")
+    private BigDecimal goodsPrice;
+
+    @ApiModelProperty("封面地址")
+    private String coverUrl;
+
+}

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java

@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.bo.ExternalQuestionBo;
+import com.zhongzheng.modules.course.bo.ReplenishExamBo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.course.vo.ExternalQuestionVo;
+import com.zhongzheng.modules.course.vo.ReplenishExamVo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
@@ -91,4 +93,7 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     @InterceptorIgnore(tenantLine = "true")
     List<ExternalQuestionVo> getExternalQuestion(ExternalQuestionBo bo);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<ReplenishExamVo> getReplenishExam(ReplenishExamBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -3,8 +3,10 @@ package com.zhongzheng.modules.goods.service;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.bo.ExternalQuestionBo;
+import com.zhongzheng.modules.course.bo.ReplenishExamBo;
 import com.zhongzheng.modules.course.vo.CourseModuleFreeExamVo;
 import com.zhongzheng.modules.course.vo.ExternalQuestionVo;
+import com.zhongzheng.modules.course.vo.ReplenishExamVo;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
@@ -152,4 +154,6 @@ public interface IGoodsService extends IService<Goods> {
 	Map<String,String> checkUserAccount(UserGoodsListBo bo);
 
     List<ExternalQuestionVo> getExternalQuestion(ExternalQuestionBo bo);
+
+	List<ReplenishExamVo> getReplenishExam(ReplenishExamBo bo);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -5154,6 +5154,11 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return questionVos;
     }
 
+    @Override
+    public List<ReplenishExamVo> getReplenishExam(ReplenishExamBo bo) {
+        return baseMapper.getReplenishExam(bo);
+    }
+
     private void updateHandoutsId(Long goodsId, Long tenantId, Long handoutsId) {
         baseMapper.updateHandoutsId(goodsId,tenantId,handoutsId);
     }

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -817,6 +817,19 @@
           AND g.`status` = 1
     </select>
 
+    <select id="getReplenishExam" parameterType="com.zhongzheng.modules.course.bo.ReplenishExamBo" resultType="com.zhongzheng.modules.course.vo.ReplenishExamVo">
+        SELECT
+            g.goods_id,
+            g.goods_name,
+            g.stand_price AS goodsPrice,
+            g.cover_url
+        FROM
+            goods g
+        WHERE
+            g.`status` = 1
+            and g.unify_sign = 1
+    </select>
+
     <select id="queryGoodsByIdTenant" parameterType="map" resultType="com.zhongzheng.modules.goods.domain.Goods">
         SELECT *
         FROM `goods`