change 3 vuotta sitten
vanhempi
commit
c869e846c4

+ 15 - 5
zhongzheng-admin/src/main/java/com/zhongzheng/controller/exam/ExamBeforeController.java

@@ -3,9 +3,10 @@ package com.zhongzheng.controller.exam;
 import java.util.List;
 import java.util.Arrays;
 
-import com.zhongzheng.modules.exam.bo.ExamBeforeUrlQueryBo;
+import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.service.IExamBeforeUrlService;
 import com.zhongzheng.modules.exam.vo.ExamBeforeUrlVo;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -22,9 +23,6 @@ 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.ExamBeforeVo;
-import com.zhongzheng.modules.exam.bo.ExamBeforeQueryBo;
-import com.zhongzheng.modules.exam.bo.ExamBeforeAddBo;
-import com.zhongzheng.modules.exam.bo.ExamBeforeEditBo;
 import com.zhongzheng.modules.exam.service.IExamBeforeService;
 import com.zhongzheng.common.utils.poi.ExcelUtil;
 import com.zhongzheng.common.core.page.TableDataInfo;
@@ -96,12 +94,24 @@ public class ExamBeforeController extends BaseController {
      */
     @ApiOperation("查询前培url列表")
     @PreAuthorize("@ss.hasPermi('system:url:list')")
-    @GetMapping("/list")
+    @GetMapping("/listUrl")
     public TableDataInfo<ExamBeforeUrlVo> list(ExamBeforeUrlQueryBo bo) {
         startPage();
         List<ExamBeforeUrlVo> list = iExamBeforeUrlService.queryList(bo);
         return getDataTable(list);
     }
 
+    /**
+     * 查询考试配置绑定商品列表
+     */
+    @ApiOperation("查询前培商品列表")
+    @PreAuthorize("@ss.hasPermi('system:goods:list')")
+    @GetMapping("/listGoods")
+    public TableDataInfo<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo) {
+        startPage();
+        List<ExamNumberGoodsVo> list = iExamBeforeService.listGoods(bo);
+        return getDataTable(list);
+    }
+
 
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamBeforeMapper.java

@@ -1,7 +1,11 @@
 package com.zhongzheng.modules.exam.mapper;
 
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamBefore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
+
+import java.util.List;
 
 /**
  * 前培安排Mapper接口
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
  */
 public interface ExamBeforeMapper extends BaseMapper<ExamBefore> {
 
+    List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamBeforeService.java

@@ -1,11 +1,13 @@
 package com.zhongzheng.modules.exam.service;
 
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamBefore;
 import com.zhongzheng.modules.exam.vo.ExamBeforeVo;
 import com.zhongzheng.modules.exam.bo.ExamBeforeQueryBo;
 import com.zhongzheng.modules.exam.bo.ExamBeforeAddBo;
 import com.zhongzheng.modules.exam.bo.ExamBeforeEditBo;
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 
 import java.util.Collection;
 import java.util.List;
@@ -49,4 +51,6 @@ public interface IExamBeforeService extends IService<ExamBefore> {
 	 * @return
 	 */
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
+
+    List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo);
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeServiceImpl.java

@@ -3,6 +3,8 @@ package com.zhongzheng.modules.exam.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -102,4 +104,9 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
         }
         return this.removeByIds(ids);
     }
+
+    @Override
+    public List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo) {
+        return baseMapper.listGoods(bo);
+    }
 }

+ 35 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeMapper.xml

@@ -18,4 +18,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </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="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamNumberQueryBo" resultMap="ExamNumberGoodsVoResult">
+        SELECT
+        goods_id,
+        goods_name,
+        CODE,
+        stand_price,
+        (case WHEN (SELECT COUNT(eb.before_id) FROM exam_before eb LEFT JOIN exam_before_goods ebg on eb.before_id =ebg.before_id where 1=1 and ebg.goods_id = g.goods_id and eb.status =1) >0 then 0 ELSE 1 end) as goods_status
+        FROM
+        goods g
+        WHERE
+        1 = 1
+        and g.status in(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>