Explorar el Código

fix 商品添加考试安排

tanzh hace 3 años
padre
commit
c530542c30

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

@@ -57,6 +57,7 @@ import com.github.pagehelper.Page;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyGoodsMapper.java

@@ -17,4 +17,6 @@ import java.util.List;
  */
 public interface ExamApplyGoodsMapper extends BaseMapper<ExamApplyGoods> {
     List<ExamApplyGoodsVo> listGoods(ExamApplyGoodsQueryBo bo);
+
+    List<ExamApplyGoodsVo> listByGoodsId(Long goodsId);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyGoodsService.java

@@ -53,4 +53,6 @@ public interface IExamApplyGoodsService extends IService<ExamApplyGoods> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
     boolean addGoods(ExamApplyGoodsAddBo bo);
+
+    List<ExamApplyGoodsVo> listByGoodsId(Long goodsId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyGoodsServiceImpl.java

@@ -154,4 +154,9 @@ public class ExamApplyGoodsServiceImpl extends ServiceImpl<ExamApplyGoodsMapper,
         iExamApplyUserService.saveBatch(coll2);
         return true;
     }
+
+    @Override
+    public List<ExamApplyGoodsVo> listByGoodsId(Long goodsId) {
+        return baseMapper.listByGoodsId(goodsId);
+    }
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyGoodsVo.java

@@ -27,6 +27,9 @@ public class ExamApplyGoodsVo {
 	/** 绑定考试安排ID */
 	@ApiModelProperty("绑定考试安排ID")
 	private Long applyId;
+	/** 考试标题 */
+	@ApiModelProperty("考试标题")
+	private String applyName;
 	/** $column.columnComment */
 	@ApiModelProperty("$column.columnComment")
 	private Long goodsId;

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.goods.vo;
 
 import com.zhongzheng.common.annotation.Excel;
+import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -366,4 +367,8 @@ public class GoodsUserVo {
 	@Excel(name = "官方班级")
 	@ApiModelProperty("官方班级")
 	private String officialName;
+	/** 考试列表 */
+	@Excel(name = "考试列表")
+	@ApiModelProperty("考试列表")
+	private List<ExamApplyGoodsVo> examApplyGoodsList;
 }

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyGoodsMapper.xml

@@ -16,6 +16,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsName" column="goods_name"/>
         <result property="code" column="code"/>
         <result property="goodsId" column="goods_id"/>
+        <result property="applyId" column="apply_id"/>
+        <result property="applyName" column="apply_name"/>
     </resultMap>
 
     <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamApplyGoodsQueryBo" resultMap="ExamApplyGoodsVoResult">
@@ -46,4 +48,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND g.stand_price = #{standPrice}
         </if>
     </select>
+    <select id="listByGoodsId" parameterType="java.lang.Long" resultType="com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo">
+        SELECT
+            eag.apply_id,
+            eag.goods_id,
+            ea.apply_name
+        FROM exam_apply_goods eag
+        LEFT JOIN exam_apply ea ON eag.apply_id = ea.apply_id
+        WHERE
+            goods_id = #{goodsId}
+        ORDER BY ea.apply_start_time
+    </select>
 </mapper>