change 3 жил өмнө
parent
commit
701f906970

+ 13 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/goods/GoodsController.java

@@ -6,6 +6,8 @@ import java.util.Arrays;
 
 import com.zhongzheng.modules.bank.bo.ExamQuestionQueryBo;
 import com.zhongzheng.modules.bank.vo.ExamQuestionVo;
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
@@ -195,5 +197,15 @@ public class GoodsController extends BaseController {
         return toAjax(iGoodsService.updateFrontByEditBo(bo) ? 1 : 0);
     }
 
-
+    /**
+     * 查询考试配置绑定商品列表
+     */
+    @ApiOperation("查询前培或补考商品列表")
+    @PreAuthorize("@ss.hasPermi('system:goods:list')")
+    @GetMapping("/listGoods")
+    public TableDataInfo<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo) {
+        startPage();
+        List<ExamNumberGoodsVo> list = iGoodsService.listGoods(bo);
+        return getDataTable(list);
+    }
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamNumberGoodsQueryBo.java

@@ -57,7 +57,9 @@ public class ExamNumberGoodsQueryBo extends BaseEntity {
 	@ApiModelProperty("业务层次id")
 	private Long businessId;
 	/** 项目ID */
-	@Excel(name = "项目ID")
 	@ApiModelProperty("项目ID")
 	private Long projectId;
+
+	@ApiModelProperty("1 前培 2补考")
+	private Long filtration;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java

@@ -135,4 +135,8 @@ public class GoodsAddBo {
     @ApiModelProperty("学习次数")
     private Long studyCount;
 
+    /** 前培和补考商品关联 */
+    @ApiModelProperty("前培和补考商品关联")
+    private Long makeGoodsId;
+
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java

@@ -164,5 +164,9 @@ public class GoodsEditBo {
     @ApiModelProperty("学习次数")
     private Long studyCount;
 
+    /** 前培和补考商品关联 */
+    @ApiModelProperty("前培和补考商品关联")
+    private Long makeGoodsId;
+
 
 }

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

@@ -110,4 +110,7 @@ private static final long serialVersionUID=1L;
     private Long makeEndTime;
     /** 学习次数 */
     private Long studyCount;
+
+    /** 前培和补考商品关联 */
+    private Long makeGoodsId;
 }

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

@@ -3,6 +3,8 @@ package com.zhongzheng.modules.goods.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
@@ -18,4 +20,6 @@ import java.util.List;
 public interface GoodsMapper extends BaseMapper<Goods> {
     List<GoodsVo> selectList(GoodsQueryBo bo);
     GoodsVo selectDetail(Long goodsId);
+
+    List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo);
 }

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

@@ -1,6 +1,8 @@
 package com.zhongzheng.modules.goods.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
@@ -63,4 +65,6 @@ public interface IGoodsService extends IService<Goods> {
     boolean insertFrontByAddBo(GoodsAddBo bo);
 
 	boolean updateFrontByEditBo(GoodsEditBo bo);
+
+	List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo);
 }

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

@@ -9,6 +9,8 @@ import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CourseChapterSectionListAddBo;
 import com.zhongzheng.modules.course.domain.CourseChapterSection;
 import com.zhongzheng.modules.course.mapper.CourseChapterMapper;
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
@@ -333,4 +335,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         update.setUpdateTime(DateUtils.getNowTime());
         return this.updateById(update);
     }
+
+    @Override
+    public List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo) {
+        return baseMapper.listGoods(bo);
+    }
 }

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

@@ -94,6 +94,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="studyCount" column="study_count"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
+        <result property="id" column="id"/>
+        <result property="examNumberId" column="exam_number_id"/>
+        <result property="goodsId" column="goods_id"/>
+        <result property="goodsName" column="goods_name"/>
+        <result property="code" column="code"/>
+        <result property="standPrice" column="stand_price"/>
+        <result property="goodsStatus" column="goods_status"/>
+    </resultMap>
+
     <select id="selectList" parameterType="com.zhongzheng.modules.goods.bo.GoodsQueryBo" resultMap="GoodsResultVo">
         SELECT
         g.*,
@@ -182,4 +192,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
             g.goods_id = #{goodsId}
     </select>
+
+    <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo" resultMap="ExamNumberGoodsVoResult">
+        SELECT
+        goods_id,
+        goods_name,
+        CODE,
+        stand_price,
+        <if test="filtration != null and filtration == 1">
+            (case WHEN (SELECT COUNT(gs.goods_id) FROM goods gs where 1=1 and gs.make_goods_id = g.goods_id and gs.status =1 and gs.goods_type =4) >0 then 0 ELSE 1 end) as goods_status
+        </if>
+        <if test="filtration != null and filtration == 2">
+        (case WHEN (SELECT COUNT(gs.goods_id) FROM goods gs where 1=1 and gs.make_goods_id = g.goods_id and gs.status =1 and gs.goods_type =3) >0 then 0 ELSE 1 end) as goods_statuss
+        </if>
+        FROM
+        goods g
+        WHERE
+        1 = 1
+        and g.status in(1)
+        and g.goods_type=1
+        <if test="businessId != null and businessId != ''">
+            and g.business_id = #{businessId}
+        </if>
+        <if test="goodsId != null and goodsId != ''">
+            and g.goods_id = #{goodsId}
+        </if>
+        <if test="projectId != null and projectId != ''">
+            and g.project_id = #{projectId}
+        </if>
+        <if test="goodsType != null and goodsType != ''">
+            and g.goods_type = #{goodsType}
+        </if>
+    </select>
 </mapper>