change 3 жил өмнө
parent
commit
7d420849cd
15 өөрчлөгдсөн 194 нэмэгдсэн , 9 устгасан
  1. 16 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyGoodsAddBo.java
  2. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyQueryBo.java
  3. 16 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeGoodsAddBo.java
  4. 2 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeQueryBo.java
  5. 13 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamBefore.java
  6. 7 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java
  7. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamBeforeMapper.java
  8. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyGoodsServiceImpl.java
  9. 17 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  10. 14 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeGoodsServiceImpl.java
  11. 5 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeServiceImpl.java
  12. 0 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplySiteTimeVo.java
  13. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyVo.java
  14. 40 0
      zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml
  15. 39 0
      zhongzheng-system/src/main/resources/mapper/modules/exam/ExamBeforeMapper.xml

+ 16 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyGoodsAddBo.java

@@ -27,6 +27,22 @@ public class ExamApplyGoodsAddBo {
     /** 修改时间 */
     @ApiModelProperty("修改时间")
     private Long updateTime;
+
+    /** 商品类型 1视频2题库 3补考 4前培  */
+    @ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")
+    private Integer goodsType;
+
+    /** 教育类型id */
+    @ApiModelProperty("教育类型id")
+    private Long educationTypeId;
+
+    /** 业务层次id */
+    @ApiModelProperty("业务层次id")
+    private Long businessId;
+
+    /** 项目ID */
+    @ApiModelProperty("项目ID")
+    private Long projectId;
     /** 绑定商品*/
     @ApiModelProperty("绑定商品")
     private Long[] goodsId;

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyQueryBo.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -56,7 +57,7 @@ public class ExamApplyQueryBo extends BaseEntity {
 	private Long applyEndTime;
 	/** 1 启用 0未启用 -1删除 2已过期 */
 	@ApiModelProperty("1 启用 0未启用 -1删除 2已过期")
-	private Integer status;
+	private List<Integer> status;
 
 	/** 商品类型 1视频2题库 3补考 4前培  */
 	@ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")

+ 16 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeGoodsAddBo.java

@@ -30,4 +30,20 @@ public class ExamBeforeGoodsAddBo {
     /** $column.columnComment */
     @ApiModelProperty("$column.columnComment")
     private Long[] goodsId;
+
+    /** 商品类型 1视频2题库 3补考 4前培  */
+    @ApiModelProperty("商品类型 1视频2题库 3补考 4前培 ")
+    private Integer goodsType;
+
+    /** 教育类型id */
+    @ApiModelProperty("教育类型id")
+    private Long educationTypeId;
+
+    /** 业务层次id */
+    @ApiModelProperty("业务层次id")
+    private Long businessId;
+
+    /** 项目ID */
+    @ApiModelProperty("项目ID")
+    private Long projectId;
 }

+ 2 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeQueryBo.java

@@ -6,6 +6,7 @@ import lombok.Data;
 import lombok.EqualsAndHashCode;
 
 import java.util.Date;
+import java.util.List;
 import java.util.Map;
 import java.util.HashMap;
 
@@ -56,5 +57,5 @@ public class ExamBeforeQueryBo extends BaseEntity {
 	private Long beforeUrl;
 	/** 1启用 0未启用 -1删除 2过期 */
 	@ApiModelProperty("1启用 0未启用 -1删除 2过期")
-	private Integer status;
+	private List<Integer> status;
 }

+ 13 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamBefore.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.exam.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -46,4 +47,16 @@ private static final long serialVersionUID=1L;
     private Long updateTime;
     /** 1启用 0未启用 -1删除 2过期 */
     private Integer status;
+
+    /** 商品类型 1视频2题库 3补考 4前培  */
+    private Integer goodsType;
+
+    /** 教育类型id */
+    private Long educationTypeId;
+
+    /** 业务层次id */
+    private Long businessId;
+
+    /** 项目ID */
+    private Long projectId;
 }

+ 7 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -3,7 +3,10 @@ package com.zhongzheng.modules.exam.mapper;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
 import com.zhongzheng.modules.exam.domain.ExamApply;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.exam.vo.ExamApplySiteTimeVo;
+import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
+import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 
@@ -20,4 +23,8 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
     List<Long> countGoods(Long applyId);
 
     List<ExamNumberGoodsVo> examNumberGoodsVos(Long applyId);
+
+    List<ExamApplySiteVo> addressExam(@Param("applyId") Long applyId,@Param("status") int i);
+
+    List<ExamApplySiteTimeVo> addressTimeExam(Long id);
 }

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

@@ -3,6 +3,7 @@ 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.ExamBeforeVo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
 
 import java.util.List;
@@ -16,4 +17,8 @@ import java.util.List;
 public interface ExamBeforeMapper extends BaseMapper<ExamBefore> {
 
     List<ExamNumberGoodsVo> listGoods(ExamNumberGoodsQueryBo bo);
+
+    List<ExamNumberGoodsVo> examNumberGoodsVos(Long beforeId);
+
+    ExamBeforeVo selectByBefore(Long beforeId);
 }

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

@@ -3,6 +3,9 @@ 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.domain.ExamApply;
+import com.zhongzheng.modules.exam.service.IExamApplyService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -30,6 +33,9 @@ import java.util.stream.Collectors;
 @Service
 public class ExamApplyGoodsServiceImpl extends ServiceImpl<ExamApplyGoodsMapper, ExamApplyGoods> implements IExamApplyGoodsService {
 
+    @Autowired
+    private IExamApplyService examApplyService;
+
     @Override
     public ExamApplyGoodsVo queryById(Long id){
         ExamApplyGoods db = this.baseMapper.selectById(id);
@@ -100,6 +106,14 @@ public class ExamApplyGoodsServiceImpl extends ServiceImpl<ExamApplyGoodsMapper,
 
     @Override
     public boolean addGoods(ExamApplyGoodsAddBo bo) {
+        ExamApply examApply = new ExamApply();
+        examApply.setApplyId(bo.getApplyId());
+        examApply.setEducationTypeId(bo.getEducationTypeId());
+        examApply.setProjectId(bo.getProjectId());
+        examApply.setUpdateTime(DateUtils.getNowTime());
+        examApply.setBusinessId(bo.getBusinessId());
+        examApply.setGoodsType(bo.getGoodsType());
+        examApplyService.updateById(examApply);
         LambdaQueryWrapper<ExamApplyGoods> lqw = Wrappers.lambdaQuery();
         lqw.eq(ExamApplyGoods::getApplyId, bo.getApplyId());
         this.remove(lqw);

+ 17 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -6,7 +6,10 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
+import com.zhongzheng.modules.exam.vo.ExamApplySiteTimeVo;
+import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
 import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
+import io.swagger.annotations.ApiModelProperty;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -39,6 +42,19 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         ExamApply db = this.baseMapper.selectById(applyId);
         ExamApplyVo examApplyVo = BeanUtil.toBean(db, ExamApplyVo.class);
         List<ExamNumberGoodsVo> examNumberGoodsVos = baseMapper.examNumberGoodsVos(applyId);
+        List<ExamApplySiteVo> examApplySite = baseMapper.addressExam(applyId,1);
+        for (ExamApplySiteVo examApplySiteVo : examApplySite) {
+            List<ExamApplySiteTimeVo> examApplySiteTime = baseMapper.addressTimeExam(examApplySiteVo.getId());
+            examApplySiteVo.setExamApplySiteTime(examApplySiteTime);
+        }
+        List<ExamApplySiteVo> examApplySiteTrain = baseMapper.addressExam(applyId,2);
+        for (ExamApplySiteVo examApplySiteVo : examApplySiteTrain) {
+            List<ExamApplySiteTimeVo> examApplySiteTime = baseMapper.addressTimeExam(examApplySiteVo.getId());
+            examApplySiteVo.setExamApplySiteTime(examApplySiteTime);
+        }
+        examApplyVo.setExamNumberGoods(examNumberGoodsVos);
+        examApplyVo.setExamApplySite(examApplySite);
+        examApplyVo.setExamApplySiteTrain(examApplySiteTrain);
         return examApplyVo;
     }
 
@@ -51,7 +67,7 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         lqw.eq(bo.getApplyStatus() != null, ExamApply::getApplyStatus, bo.getApplyStatus());
         lqw.eq(bo.getApplyStartTime() != null, ExamApply::getApplyStartTime, bo.getApplyStartTime());
         lqw.eq(bo.getApplyEndTime() != null, ExamApply::getApplyEndTime, bo.getApplyEndTime());
-        lqw.eq(bo.getStatus() != null, ExamApply::getStatus, bo.getStatus());
+        lqw.in(bo.getStatus() != null, ExamApply::getStatus, bo.getStatus());
         return entity2Vo(this.list(lqw));
     }
 

+ 14 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeGoodsServiceImpl.java

@@ -4,6 +4,9 @@ import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.modules.exam.domain.ExamApplyGoods;
+import com.zhongzheng.modules.exam.domain.ExamBefore;
+import com.zhongzheng.modules.exam.service.IExamBeforeService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -31,6 +34,9 @@ import java.util.stream.Collectors;
 @Service
 public class ExamBeforeGoodsServiceImpl extends ServiceImpl<ExamBeforeGoodsMapper, ExamBeforeGoods> implements IExamBeforeGoodsService {
 
+    @Autowired
+    private IExamBeforeService examBeforeService;
+
     @Override
     public ExamBeforeGoodsVo queryById(Long id){
         ExamBeforeGoods db = this.baseMapper.selectById(id);
@@ -67,6 +73,14 @@ public class ExamBeforeGoodsServiceImpl extends ServiceImpl<ExamBeforeGoodsMappe
 
     @Override
     public Boolean insertByAddBo(ExamBeforeGoodsAddBo bo) {
+        ExamBefore examBefore = new ExamBefore();
+        examBefore.setBeforeId(bo.getBeforeId());
+        examBefore.setEducationTypeId(bo.getEducationTypeId());
+        examBefore.setProjectId(bo.getProjectId());
+        examBefore.setUpdateTime(DateUtils.getNowTime());
+        examBefore.setBusinessId(bo.getBusinessId());
+        examBefore.setGoodsType(bo.getGoodsType());
+        examBeforeService.updateById(examBefore);
         LambdaQueryWrapper<ExamBeforeGoods> lqw = Wrappers.lambdaQuery();
         lqw.eq(ExamBeforeGoods::getBeforeId, bo.getBeforeId());
         this.remove(lqw);

+ 5 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamBeforeServiceImpl.java

@@ -34,8 +34,10 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
 
     @Override
     public ExamBeforeVo queryById(Long beforeId){
-        ExamBefore db = this.baseMapper.selectById(beforeId);
-        return BeanUtil.toBean(db, ExamBeforeVo.class);
+        ExamBeforeVo examBeforeVo = baseMapper.selectByBefore(beforeId);
+        List<ExamNumberGoodsVo> examNumberGoodsVos = baseMapper.examNumberGoodsVos(beforeId);
+        examBeforeVo.setExamNumberGoods(examNumberGoodsVos);
+        return examBeforeVo;
     }
 
     @Override
@@ -47,7 +49,7 @@ public class ExamBeforeServiceImpl extends ServiceImpl<ExamBeforeMapper, ExamBef
         lqw.eq(bo.getBeforeEndTime() != null, ExamBefore::getBeforeEndTime, bo.getBeforeEndTime());
         lqw.eq(bo.getBeforeStatus() != null, ExamBefore::getBeforeStatus, bo.getBeforeStatus());
         lqw.eq(bo.getBeforeUrl() != null, ExamBefore::getBeforeUrl, bo.getBeforeUrl());
-        lqw.eq(bo.getStatus() != null, ExamBefore::getStatus, bo.getStatus());
+        lqw.in(bo.getStatus() != null, ExamBefore::getStatus, bo.getStatus());
         return entity2Vo(this.list(lqw));
     }
 

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

@@ -38,7 +38,4 @@ public class ExamApplySiteTimeVo {
 	@ApiModelProperty("考试日期")
 	private Long examTime;
 
-	/** 考试时间段 */
-	@ApiModelProperty("考试时间段")
-	private List<ExamApplySiteTimeTwoAddBo> examApplySiteTimeTwo;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyVo.java

@@ -72,6 +72,10 @@ public class ExamApplyVo {
 	@ApiModelProperty("考试地点时间")
 	private List<ExamApplySiteVo> examApplySite;
 
+
+	@ApiModelProperty("考陪地点")
+	private List<ExamApplySiteVo> examApplySiteTrain;
+
 	@ApiModelProperty("商品")
 	private List<ExamNumberGoodsVo> examNumberGoods;
 }

+ 40 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -27,6 +27,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="goodsStatus" column="goods_status"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.exam.vo.ExamApplySiteVo" id="ExamApplySiteVo">
+        <result property="id" column="id"/>
+        <result property="siteId" column="site_id"/>
+        <result property="applyId" column="apply_id"/>
+        <result property="status" column="status"/>
+        <result property="status" column="status"/>
+        <result property="siteAddress" column="site_address"/>
+        <result property="people" column="people"/>
+    </resultMap>
+
+    <resultMap type="com.zhongzheng.modules.exam.vo.ExamApplySiteTimeVo" id="ExamApplySiteTimeVo">
+        <result property="id" column="id"/>
+        <result property="applySiteId" column="apply_site_id"/>
+        <result property="siteTime" column="site_time"/>
+        <result property="examTime" column="exam_time"/>
+    </resultMap>
+
     <select id="listGoods" parameterType="com.zhongzheng.modules.exam.bo.ExamNumberQueryBo" resultMap="ExamNumberGoodsVoResult">
         SELECT
         goods_id,
@@ -77,4 +94,27 @@ and (SELECT COUNT(eay.apply_id) FROM exam_apply eay LEFT JOIN exam_apply_goods e
           AND eag.apply_id =#{applyId}
 
     </select>
+
+    <select id="addressExam" parameterType="map" resultMap="ExamApplySiteVo">
+        SELECT
+            *,
+            es.site_address,
+            es.people
+
+        FROM
+            exam_apply_site eas
+                LEFT JOIN exam_site es on eas.site_id = es.site_id
+        WHERE
+            eas.apply_id =#{applyId}
+          and eas.`status` =#{status}
+    </select>
+
+    <select id="addressTimeExam" parameterType="map" resultMap="ExamApplySiteTimeVo">
+        SELECT
+            *
+        FROM
+            exam_apply_site_time east
+        where 1=1
+          and east.apply_site_id =1
+    </select>
 </mapper>

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

@@ -17,6 +17,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="status" column="status"/>
     </resultMap>
 
+    <resultMap type="com.zhongzheng.modules.exam.vo.ExamBeforeVo" id="ExamBeforeVo">
+        <result property="beforeId" column="before_id"/>
+        <result property="code" column="code"/>
+        <result property="beforeName" column="before_name"/>
+        <result property="beforeStartTime" column="before_start_time"/>
+        <result property="beforeEndTime" column="before_end_time"/>
+        <result property="beforeStatus" column="before_status"/>
+        <result property="beforeUrl" column="before_url"/>
+        <result property="status" column="status"/>
+        <result property="urlName" column="url_name"/>
+        <result property="url" column="url"/>
+    </resultMap>
+
 
     <resultMap type="com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo" id="ExamNumberGoodsVoResult">
         <result property="id" column="id"/>
@@ -53,4 +66,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and g.goods_type = #{goodsType}
         </if>
     </select>
+
+    <select id="examNumberGoodsVos" parameterType="long" resultMap="ExamNumberGoodsVoResult">
+        SELECT
+            g.goods_id,
+            g.goods_name,
+            g.CODE,
+            g.stand_price
+        FROM
+            goods g
+                LEFT JOIN exam_before_goods ebg ON g.goods_id = ebg.goods_id
+        WHERE
+            1 = 1
+          AND g.STATUS IN ( 1 )
+          AND ebg.before_id =#{beforeId}
+
+    </select>
+
+    <select id="selectByBefore" parameterType="long" resultMap="ExamBeforeVo">
+        SELECT
+            *
+        FROM
+            exam_before eb
+                LEFT JOIN exam_before_url ebu on eb.before_url=ebu.before_url_id
+        where 1=1
+          and eb.before_id = #{beforeId}
+    </select>
 </mapper>