he2802 1 anno fa
parent
commit
a2526bd5d5

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java

@@ -188,4 +188,7 @@ private static final long serialVersionUID=1L;
     /** 寄件标签:1是 0否 */
     @TableField(updateStrategy=FieldStrategy.IGNORED)
     private Integer mailSign;
+
+    /** 前培和补考商品关联多个 */
+    private String makeGoodsIds;
 }

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

@@ -44,6 +44,8 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     Long getRandomQuestionNum(@Param("goodsId")Long goodsId,@Param("examPaperId") Long examPaperId);
 
+    List<MakeGoodsVo> getMakeGoodsList(@Param("makeGoodsIds")String makeGoodsIds);
+
     int queryUpGoods();
 
     List<GoodsVo> selectListToInput(GoodsQueryBo bo);

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

@@ -515,6 +515,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 //                goodsVo.setSpecTemplateId(relation.getSpecTemplateId());
 //            }
 //        }
+        if(Validator.isNotEmpty(goodsVo.getMakeGoodsIds())){
+            goodsVo.setMakeGoodsVoList(this.baseMapper.getMakeGoodsList(goodsVo.getMakeGoodsIds()));
+        }
         //多规格下的价格区间
         if (ObjectUtils.isNotNull(goodsVo.getSpecTemplateId())) {
             List<GoodsSpecAttributeRelation> list = goodsSpecAttributeRelationService

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

@@ -415,4 +415,9 @@ public class GoodsVo {
 
 	private Long periodWaitTime;
 
+	@ApiModelProperty("前培和补考商品关联多个")
+	private String makeGoodsIds;
+
+	private List<MakeGoodsVo> makeGoodsVoList;
+
 }

+ 21 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/MakeGoodsVo.java

@@ -0,0 +1,21 @@
+package com.zhongzheng.modules.goods.vo;
+
+import com.zhongzheng.common.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+
+public class MakeGoodsVo {
+    /** 前培和补考商品关联 */
+    @Excel(name = "前培和补考商品关联")
+    @ApiModelProperty("前培和补考商品关联")
+    private Long makeGoodsId;
+
+    /** 前培和补考商品关联 */
+    @Excel(name = "前培和补考商品关联")
+    @ApiModelProperty("前培和补考商品关联商品名")
+    private String makeGoodsName;
+
+    /** 前培和补考商品关联 */
+    @Excel(name = "前培和补考商品关联")
+    @ApiModelProperty("前培和补考商品关联编码")
+    private String makeGoodsCode;
+}

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

@@ -155,6 +155,7 @@
         <result property="firstChoiceGoods" column="first_choice_goods"/>
         <result property="aliasName" column="alias_name"/>
         <result property="moreCertificateStatus" column="more_certificate_status"/>
+        <result property="makeGoodsIds" column="make_goods_ids"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
@@ -659,6 +660,10 @@
                                            WHERE goods_id = #{goodsId} AND type = 3), ''))))
     </select>
 
+    <select id="getMakeGoodsList" parameterType="map" resultType="com.zhongzheng.modules.goods.vo.MakeGoodsVo">
+        select g.goods_id as make_goods_id,g.goods_name as make_goods_name,g.code as make_code from goods g where  FIND_IN_SET(g.goods_id,#{makeGoodsIds})
+    </select>
+
     <select id="getRandomQuestionNum" parameterType="map" resultType="Long">
         SELECT count(DISTINCT eq.question_id) question_num
         FROM exam_question eq