yangdamao 2 år sedan
förälder
incheckning
6294a3a07f
30 ändrade filer med 607 tillägg och 52 borttagningar
  1. 18 0
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/exam/ExamApplyController.java
  2. 3 3
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserSubscribeController.java
  3. 18 6
      zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamApplyController.java
  4. 2 5
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ServletUtils.java
  5. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java
  6. 5 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuExamMapper.java
  7. 3 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java
  8. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseChapterSectionService.java
  9. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseMenuExamService.java
  10. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseModuleChapterService.java
  11. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java
  12. 10 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuExamServiceImpl.java
  13. 5 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java
  14. 18 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  15. 19 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeKnowBo.java
  16. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyService.java
  17. 48 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  18. 19 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamBeforeKnowVo.java
  19. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamUserApplyVo.java
  20. 240 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  21. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsUserVo.java
  22. 18 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java
  23. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java
  24. 11 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserSubscribeQueryBo.java
  25. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserSubscribeService.java
  26. 94 21
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java
  27. 11 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml
  28. 8 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuExamMapper.xml
  29. 13 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml
  30. 15 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserSubscribeMapper.xml

+ 18 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/exam/ExamApplyController.java

@@ -69,6 +69,24 @@ public class ExamApplyController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 获取七大员考前需知
+     */
+    @ApiOperation("获取七大员考前需知")
+    @GetMapping("/before/know")
+    public AjaxResult<ExamBeforeKnowVo> getBeforeKnow() {
+        return AjaxResult.success(iExamApplyService.getBeforeKnow());
+    }
+
+    /**
+     * 七大员考前需知新增/修改
+     */
+    @ApiOperation("七大员考前需知新增/修改")
+    @PostMapping("/saveorup/before/know")
+    public AjaxResult<Void> saveOrUpBeforeKnow(@RequestBody ExamBeforeKnowBo bo) {
+        return toAjax(iExamApplyService.saveOrUpBeforeKnow(bo)? 1 : 0);
+    }
+
     /**
      * 考场邮件信息
      */

+ 3 - 3
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserSubscribeController.java

@@ -67,9 +67,9 @@ public class UserSubscribeController extends BaseController {
      * 根据月份获取当月考试场次
      */
     @ApiOperation("根据月份获取当月考试场次")
-    @GetMapping("/session/{month}")
-    public AjaxResult<List<ExamSessionVo>> getExamSession(@PathVariable("month")Integer month) {
-        List<ExamSessionVo> list = iUserSubscribeService.getExamSession(month);
+    @GetMapping("/session/{applyDate}")
+    public AjaxResult<List<ExamSessionVo>> getExamSession(@PathVariable("applyDate")String applyDate) {
+        List<ExamSessionVo> list = iUserSubscribeService.getExamSession(applyDate);
         return AjaxResult.success(list);
     }
 

+ 18 - 6
zhongzheng-api/src/main/java/com/zhongzheng/controller/exam/ExamApplyController.java

@@ -8,14 +8,19 @@ import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.enums.BusinessType;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.framework.web.service.WxTokenService;
-import com.zhongzheng.modules.exam.bo.*;
-import com.zhongzheng.modules.exam.service.IExamActivityService;
+import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
+import com.zhongzheng.modules.exam.bo.ExamRecommendGoodsQueryBo;
 import com.zhongzheng.modules.exam.service.IExamApplyGoodsService;
 import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.service.IExamApplySiteService;
-import com.zhongzheng.modules.exam.vo.*;
+import com.zhongzheng.modules.exam.vo.ExamBeforeKnowVo;
+import com.zhongzheng.modules.exam.vo.ExamUserApplySiteVo;
+import com.zhongzheng.modules.exam.vo.ExamUserApplyVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
-import com.zhongzheng.modules.user.bo.*;
+import com.zhongzheng.modules.user.bo.UserAppSubscribeEditBo;
+import com.zhongzheng.modules.user.bo.UserSubscribeAddBo;
+import com.zhongzheng.modules.user.bo.UserSubscribeQueryBo;
+import com.zhongzheng.modules.user.bo.UserSubscribeSignReportBo;
 import com.zhongzheng.modules.user.entity.ClientLoginUser;
 import com.zhongzheng.modules.user.service.IUserSubscribeService;
 import com.zhongzheng.modules.user.vo.UserSubscribeVo;
@@ -23,9 +28,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
 
 import java.text.ParseException;
 import java.util.List;
@@ -176,4 +179,13 @@ public class ExamApplyController extends BaseController {
         return iExamApplyService.getRecommendGoodsList(bo);
     }
 
+    /**
+     * 获取七大员考前需知
+     */
+    @ApiOperation("获取七大员考前需知")
+    @GetMapping("/before/know")
+    public AjaxResult<ExamBeforeKnowVo> getBeforeKnow() {
+        return AjaxResult.success(iExamApplyService.getBeforeKnow());
+    }
+
 }

+ 2 - 5
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/ServletUtils.java

@@ -2,7 +2,6 @@ package com.zhongzheng.common.utils;
 
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.StrUtil;
-import org.apache.tomcat.util.http.MimeHeaders;
 import org.springframework.web.context.request.RequestAttributes;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
@@ -11,8 +10,6 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpSession;
 import java.io.IOException;
-import java.lang.reflect.Field;
-import java.util.Map;
 
 /**
  * 客户端工具类
@@ -27,8 +24,8 @@ public class ServletUtils
      */
     public static String getEncoded(String tag)
     {
-        String time = String.valueOf(System.currentTimeMillis()/1000);
-        return tag+Integer.valueOf(time.substring(1))+""+(((int)(Math.random() * 90 + 10)));
+        String time = String.valueOf(System.currentTimeMillis());
+        return tag+Long.valueOf(time.substring(1));
     }
     //导入生成编号使用
     public static String getImportEncoded(String tag)

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseChapterSectionMapper.java

@@ -49,4 +49,7 @@ public interface CourseChapterSectionMapper extends BaseMapper<CourseChapterSect
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdAndTenant(@Param("chapterId") Long chapterId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    CourseChapterSection getByTenant(@Param("newChapterId") Long newChapterId,@Param("newSectionId") Long newSectionId,@Param("newTenantId") Long newTenantId);
 }

+ 5 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuExamMapper.java

@@ -3,10 +3,8 @@ package com.zhongzheng.modules.course.mapper;
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseMenuExamQueryBo;
-import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.domain.CourseMenuExam;
 import com.zhongzheng.modules.course.vo.CourseMenuExamVo;
-import com.zhongzheng.modules.course.vo.CourseVo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -26,4 +24,9 @@ public interface CourseMenuExamMapper extends BaseMapper<CourseMenuExam> {
     @InterceptorIgnore(tenantLine = "true")
     void deleteModuleByIdTenant(@Param("newCourseId")Long newCourseId,@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);
 
+    @InterceptorIgnore(tenantLine = "true")
+    void deleteChapterByIdTenant(@Param("newCourseId")Long newCourseId, @Param("newModuleId")Long newModuleId,@Param("newChapterId") Long newChapterId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void deleteSectionByIdTenant(@Param("newCourseId")Long newCourseId, @Param("newModuleId")Long newModuleId,@Param("newChapterId") Long newChapterId,@Param("newSectionId") Long newSectionId,@Param("newTenantId") Long newTenantId);
 }

+ 3 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseModuleChapterMapper.java

@@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
 import com.zhongzheng.modules.course.domain.CourseModuleChapter;
-import com.zhongzheng.modules.course.vo.CourseChapterSectionVo;
 import com.zhongzheng.modules.course.vo.CourseModuleChapterVo;
-import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
 import com.zhongzheng.modules.course.vo.CourseUserModuleChapterVo;
 import org.apache.ibatis.annotations.Param;
 
@@ -32,4 +30,7 @@ public interface CourseModuleChapterMapper extends BaseMapper<CourseModuleChapte
 
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdAndTenant(@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    CourseModuleChapter getByTenant(@Param("newModuleId") Long newModuleId,@Param("newChapterId") Long newChapterId,@Param("newTenantId") Long newTenantId);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseChapterSectionService.java

@@ -62,4 +62,6 @@ public interface ICourseChapterSectionService extends IService<CourseChapterSect
 	List<CourseUserChapterSectionVo> sectionExamList(CourseMenuQueryBo bo);
 
     void deleteByIdAndTenant(Long chapterId, Long newTenantId);
+
+    CourseChapterSection getByTenant(Long newChapterId, Long newSectionId, Long newTenantId);
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseMenuExamService.java

@@ -55,4 +55,8 @@ public interface ICourseMenuExamService extends IService<CourseMenuExam> {
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
 
     void deleteModuleByIdTenant(Long newCourseId, Long newModuleId, Long newTenantId);
+
+	void deleteChapterByIdTenant(Long newCourseId, Long newModuleId, Long newChapterId, Long newTenantId);
+
+    void deleteSectionByIdTenant(Long newCourseId, Long newModuleId, Long newChapterId, Long newSectionId, Long newTenantId);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseModuleChapterService.java

@@ -56,4 +56,6 @@ public interface ICourseModuleChapterService extends IService<CourseModuleChapte
     List<CourseUserModuleChapterVo> chapterList(CourseMenuQueryBo bo);
 
     void deleteByIdAndTenant(Long newModuleId, Long newTenantId);
+
+    CourseModuleChapter getByTenant(Long newModuleId, Long newChapterId, Long newTenantId);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseChapterSectionServiceImpl.java

@@ -210,4 +210,9 @@ public class CourseChapterSectionServiceImpl extends ServiceImpl<CourseChapterSe
     public void deleteByIdAndTenant(Long chapterId, Long newTenantId) {
         baseMapper.deleteByIdAndTenant(chapterId, newTenantId);
     }
+
+    @Override
+    public CourseChapterSection getByTenant(Long newChapterId, Long newSectionId, Long newTenantId) {
+        return baseMapper.getByTenant(newChapterId,newSectionId, newTenantId);
+    }
 }

+ 10 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseMenuExamServiceImpl.java

@@ -119,4 +119,14 @@ public class CourseMenuExamServiceImpl extends ServiceImpl<CourseMenuExamMapper,
     public void deleteModuleByIdTenant(Long newCourseId, Long newModuleId, Long newTenantId) {
         baseMapper.deleteModuleByIdTenant(newCourseId,newModuleId, newTenantId);
     }
+
+    @Override
+    public void deleteChapterByIdTenant(Long newCourseId, Long newModuleId, Long newChapterId, Long newTenantId) {
+        baseMapper.deleteChapterByIdTenant(newCourseId,newModuleId,newChapterId, newTenantId);
+    }
+
+    @Override
+    public void deleteSectionByIdTenant(Long newCourseId, Long newModuleId, Long newChapterId, Long newSectionId, Long newTenantId) {
+        baseMapper.deleteSectionByIdTenant(newCourseId, newModuleId, newChapterId, newSectionId, newTenantId);
+    }
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseModuleChapterServiceImpl.java

@@ -162,4 +162,9 @@ public class CourseModuleChapterServiceImpl extends ServiceImpl<CourseModuleChap
     public void deleteByIdAndTenant(Long newModuleId, Long newTenantId) {
         baseMapper.deleteByIdAndTenant(newModuleId, newTenantId);
     }
+
+    @Override
+    public CourseModuleChapter getByTenant(Long newModuleId, Long newChapterId, Long newTenantId) {
+        return baseMapper.getByTenant(newModuleId,newChapterId,newTenantId);
+    }
 }

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

@@ -492,6 +492,24 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             }
             goodsUserVo.setSecAllNum(secLong);
             goodsUserVo.setStuAllNum(studyLong);
+            goodsUserVo.setSubscribeSign(2);
+
+            //是否满足预约考试条件
+            if (ObjectUtils.isNotNull(classGradeVo.getPeriodStatus())
+                    && classGradeVo.getPeriodStatus() == 1
+                    && (DateUtils.getNowTime() >= goodsUserVo.getServiceStartTime() && DateUtils.getNowTime() <= goodsUserVo.getServiceEndTime())){
+                UserSubscribe userSubscribe = iUserSubscribeService.getOne(new LambdaQueryWrapper<UserSubscribe>()
+                        .eq(UserSubscribe::getUserId, bo.getUserId())
+                        .eq(UserSubscribe::getGoodsId, goodsUserVo.getGoodsId())
+                        .eq(UserSubscribe::getSubscribeStatus, 1)
+                        .orderByDesc(UserSubscribe::getCreateTime)
+                        .last("limit 1"));
+                if (ObjectUtils.isNull(userSubscribe)){
+                    goodsUserVo.setSubscribeSign(1);
+                }else if (ObjectUtils.isNotNull(userSubscribe.getResult()) && userSubscribe.getResult() == 0){
+                    goodsUserVo.setSubscribeSign(3);
+                }
+            }
 
             //查询对应考试安排
             List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsUserVo.getGoodsId());

+ 19 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamBeforeKnowBo.java

@@ -0,0 +1,19 @@
+package com.zhongzheng.modules.exam.bo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年07月05日 10:49
+ */
+@Data
+public class ExamBeforeKnowBo implements Serializable {
+
+    private String key;
+
+    private String value;
+
+    private String type;
+}

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

@@ -88,4 +88,8 @@ public interface IExamApplyService extends IService<ExamApply> {
 	void examApplyResult(ExamApplyResultBo bo);
 
     List<ExamApplyDetailVo> examApplyDetail(ExamApplyDetailBo bo);
+
+	ExamBeforeKnowVo getBeforeKnow();
+
+	boolean saveOrUpBeforeKnow(ExamBeforeKnowBo bo);
 }

+ 48 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -399,6 +399,15 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         if (examUserApplyVo == null) {
             throw new CustomException("商品无考试计划,无需预约考试");
         }
+        ExamApplySite site = iExamApplySiteService
+                .getOne(new LambdaQueryWrapper<ExamApplySite>()
+                .eq(ExamApplySite::getApplyId, examUserApplyVo.getApplyId())
+                .eq(ExamApplySite::getStatus, 1)
+                .last("limit 1"));
+        if (ObjectUtils.isNotNull(site)){
+            ExamSite examSite = iExamSiteService.getById(site.getSiteId());
+            examUserApplyVo.setApplySite(examSite.getSiteAddress());
+        }
         return examUserApplyVo;
     }
 
@@ -888,6 +897,45 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         return vo;
     }
 
+    @Override
+    public ExamBeforeKnowVo getBeforeKnow() {
+        SysConfig config = iSysConfigService.getOne(new LambdaQueryWrapper<SysConfig>()
+                .eq(SysConfig::getConfigKey, "before.exam.know").last("limit 1"));
+        if (ObjectUtils.isNull(config)){
+            return new ExamBeforeKnowVo();
+        }
+        ExamBeforeKnowVo knowVo = new ExamBeforeKnowVo();
+        knowVo.setKey(config.getConfigKey());
+        knowVo.setValue(config.getConfigValue());
+        knowVo.setType(config.getConfigType());
+        return knowVo;
+    }
+
+    @Override
+    public boolean saveOrUpBeforeKnow(ExamBeforeKnowBo bo) {
+        if (StringUtils.isNotBlank(bo.getKey())){
+            //修改
+            iSysConfigService.update(new LambdaUpdateWrapper<SysConfig>()
+            .set(StringUtils.isNotBlank(bo.getValue()),SysConfig::getConfigValue,bo.getValue())
+            .set(StringUtils.isNotBlank(bo.getType()),SysConfig::getConfigType,bo.getType())
+            .eq(SysConfig::getConfigKey,bo.getKey()));
+        }else {
+            //新增
+            SysConfig sysConfig = new SysConfig();
+            sysConfig.setConfigKey("before.exam.know");
+            sysConfig.setConfigName("七大员考前需知");
+            sysConfig.setConfigValue(bo.getValue());
+            sysConfig.setConfigType(bo.getType());
+            sysConfig.setCreateBy("admin");
+            sysConfig.setCreateTime(new Date());
+            sysConfig.setUpdateBy("admin");
+            sysConfig.setUpdateTime(new Date());
+            sysConfig.setConfigModule("sys");
+            iSysConfigService.save(sysConfig);
+        }
+        return true;
+    }
+
     private void userStudyRecord(String userPath, List<UserSubscribe> list) {
         Map<Long, List<UserSubscribe>> map = list.stream().collect(Collectors.groupingBy(UserSubscribe::getUserId));
         map.forEach((k, v) -> {

+ 19 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamBeforeKnowVo.java

@@ -0,0 +1,19 @@
+package com.zhongzheng.modules.exam.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年07月05日 10:49
+ */
+@Data
+public class ExamBeforeKnowVo implements Serializable {
+
+    private String key;
+
+    private String value;
+
+    private String type;
+}

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

@@ -36,6 +36,9 @@ public class ExamUserApplyVo {
 	@ApiModelProperty("考试简介")
 	private String applyIntroduce;
 
+	@ApiModelProperty("考试地点")
+	private String applySite;
+
 	/** 开始日期 */
 	@Excel(name = "开始日期")
 	@ApiModelProperty("开始日期")

+ 240 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -2612,6 +2612,127 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         }
         return null;
     }
+
+    private void disposeChapter(Long oldChapterId,Long oldModuleId,Long newTenantId,Long oldCourseId,Long newCourseId,List<SysGoodsCopyRecord> array){
+        CourseChapter chapter = iCourseChapterService.getById(oldChapterId);
+        if (ObjectUtils.isNotNull(chapter)){
+            Long oid = chapter.getChapterId();
+            Long newChapterId = getNewIdByTenant(oid,GoodsCopyEnum.COURSE_CHAPTER.getType(),newTenantId);
+            if (ObjectUtils.isNull(newChapterId)){
+                chapter.setChapterId(null);
+                chapter.setTenantId(newTenantId);
+                iCourseChapterService.save(chapter);
+                newChapterId = chapter.getChapterId();
+                addSysGoodsRecord(oid,newChapterId,GoodsCopyEnum.COURSE_CHAPTER.getType(),newTenantId,array);
+            }
+            //删除之前的关联
+            iCourseChapterBusinessService.deleteByIdAndTenant(newChapterId,newTenantId);
+            //新关联
+            List<CourseChapterBusiness> chapterBusinessList = iCourseChapterBusinessService
+                    .list(new LambdaQueryWrapper<CourseChapterBusiness>()
+                            .eq(CourseChapterBusiness::getChapterId, oldChapterId));
+            if (CollectionUtils.isNotEmpty(chapterBusinessList)){
+                for (CourseChapterBusiness item : chapterBusinessList) {
+                    item.setId(null);
+                    item.setChapterId(newChapterId);
+                    item.setTenantId(newTenantId);
+                    item.setEducationTypeId(getNewEducationTypeId(item.getEducationTypeId(), newTenantId,array));
+                    item.setBusinessId(getNewBusinessId(item.getBusinessId(), newTenantId,array));
+                    item.setSubjectId(getNewSubjectId(item.getSubjectId(), newTenantId,array));
+                    item.setProjectId(getNewProjectTypeId(item.getProjectId(), newTenantId,array));
+                }
+                iCourseChapterBusinessService.saveBatch(chapterBusinessList);
+            }
+
+            //章节关联
+            iCourseChapterSectionService.deleteByIdAndTenant(newChapterId,newTenantId);
+            List<CourseChapterSection> chapterSectionList = iCourseChapterSectionService
+                    .list(new LambdaQueryWrapper<CourseChapterSection>()
+                            .eq(CourseChapterSection::getChapterId, oldChapterId));
+            if (CollectionUtils.isNotEmpty(chapterSectionList)){
+                for (CourseChapterSection item : chapterSectionList) {
+                    item.setId(null);
+                    item.setChapterId(newChapterId);
+                    item.setTenantId(newTenantId);
+                    item.setSectionId(getNewSectionId(item.getSectionId(),newTenantId,array));
+                }
+                iCourseChapterSectionService.saveBatch(chapterSectionList);
+            }
+
+            if (ObjectUtils.isNotNull(oldModuleId)){
+                //模块章关联
+                Long newModuleId = getNewIdByTenant(oldModuleId,GoodsCopyEnum.COURSE_MODULE.getType(),newTenantId);
+                if (ObjectUtils.isNull(newModuleId)){
+                    throw new CustomException("当前章节模块在对应机构不存在,请检查!");
+                }
+               CourseModuleChapter moduleChapter =  iCourseModuleChapterService.getByTenant(newModuleId,newChapterId,newTenantId);
+                if (ObjectUtils.isNull(moduleChapter)){
+                    //不存在就新增
+                    CourseModuleChapter oldEntity = iCourseModuleChapterService
+                            .getOne(new LambdaQueryWrapper<CourseModuleChapter>()
+                            .eq(CourseModuleChapter::getModuleId, oldModuleId)
+                            .eq(CourseModuleChapter::getChapterId, oldChapterId)
+                            .last("limit 1"));
+                    if (ObjectUtils.isNotNull(oldEntity)){
+                        oldEntity.setId(null);
+                        oldEntity.setModuleId(newModuleId);
+                        oldEntity.setChapterId(newChapterId);
+                        oldEntity.setTenantId(newTenantId);
+                        iCourseModuleChapterService.save(oldEntity);
+                    }
+                }
+
+                //课程章试卷
+                iCourseMenuExamService.deleteChapterByIdTenant(newCourseId,newModuleId,newChapterId,newTenantId);
+                List<CourseMenuExam> examList = iCourseMenuExamService
+                        .list(new LambdaQueryWrapper<CourseMenuExam>()
+                                .eq(CourseMenuExam::getCourseId, oldCourseId)
+                                .eq(CourseMenuExam::getModuleId, oldModuleId)
+                                .eq(CourseMenuExam::getChapterId,oldChapterId));
+                if (CollectionUtils.isNotEmpty(examList)){
+                    for (CourseMenuExam menuExam : examList) {
+                        if (ObjectUtils.isNotNull(menuExam.getSectionId()) || menuExam.getSectionId() != 0){
+                            Long newSectionId = getNewIdByTenant(menuExam.getSectionId(),GoodsCopyEnum.COURSE_SECTION.getType(),newTenantId);
+                            if (ObjectUtils.isNull(newSectionId)){
+                                continue;
+                            }
+                            menuExam.setSectionId(newSectionId);
+                        }
+                        menuExam.setId(null);
+                        menuExam.setCourseId(newCourseId);
+                        menuExam.setModuleId(newModuleId);
+                        menuExam.setChapterId(newChapterId);
+                        menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,array));
+                        menuExam.setTenantId(newTenantId);
+                    }
+                    iCourseMenuExamService.saveBatch(examList);
+                }
+
+            }else {
+                //课程章关联
+                List<CourseMenu> courseMenus = iCourseMenuService.selectByNotTenant(newCourseId,2,newChapterId,newTenantId);
+                if (CollectionUtils.isEmpty(courseMenus)){
+                    //新增
+                    List<CourseMenu> list = iCourseMenuService
+                            .list(new LambdaQueryWrapper<CourseMenu>()
+                            .eq(CourseMenu::getCourseId, oldCourseId)
+                            .eq(CourseMenu::getMenuId, oldChapterId)
+                            .eq(CourseMenu::getType, 2));
+                    if (CollectionUtils.isNotEmpty(list)){
+                        for (CourseMenu item : list) {
+                            item.setId(null);
+                            item.setCourseId(newCourseId);
+                            item.setMenuId(newChapterId);
+                            item.setTenantId(newTenantId);
+                        }
+                        iCourseMenuService.saveBatch(list);
+                    }
+                }
+            }
+
+        }
+    }
+
     private Long getNewSectionId(Long oldSectionId,Long newTenantId,List<SysGoodsCopyRecord> array){
         CourseSection section = iCourseSectionService.getById(oldSectionId);
         if (ObjectUtils.isNotNull(section)){
@@ -2648,6 +2769,109 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         }
         return null;
     }
+
+    private void disposeSection(Long oldSectionId,Long oldChapterId,Long oldModuleId,Long newTenantId,Long oldCourseId,Long newCourseId,List<SysGoodsCopyRecord> array){
+        CourseSection section = iCourseSectionService.getById(oldSectionId);
+        if (ObjectUtils.isNotNull(section)){
+            Long oid = section.getSectionId();
+            Long newSectionId = getNewIdByTenant(oid,GoodsCopyEnum.COURSE_SECTION.getType(),newTenantId);
+            if (ObjectUtils.isNull(newSectionId)){
+                //新增
+                section.setSectionId(null);
+                section.setTenantId(newTenantId);
+                iCourseSectionService.save(section);
+                newSectionId = section.getSectionId();
+                addSysGoodsRecord(oid,newSectionId,GoodsCopyEnum.COURSE_SECTION.getType(),newTenantId,array);
+            }
+            //删除之前的关联
+            iCourseSectionBusinessService.deleteByIdAndTenant(newSectionId,newTenantId);
+            //新关联
+            List<CourseSectionBusiness> sectionBusinessList = iCourseSectionBusinessService
+                    .list(new LambdaQueryWrapper<CourseSectionBusiness>()
+                            .eq(CourseSectionBusiness::getSectionId, oldSectionId));
+            if (CollectionUtils.isNotEmpty(sectionBusinessList)){
+                for (CourseSectionBusiness item : sectionBusinessList) {
+                    item.setId(null);
+                    item.setSectionId(newSectionId);
+                    item.setTenantId(newTenantId);
+                    item.setEducationTypeId(getNewEducationTypeId(item.getEducationTypeId(), newTenantId,array));
+                    item.setBusinessId(getNewBusinessId(item.getBusinessId(), newTenantId,array));
+                    item.setSubjectId(getNewSubjectId(item.getSubjectId(), newTenantId,array));
+                    item.setProjectId(getNewProjectTypeId(item.getProjectId(), newTenantId,array));
+                }
+                iCourseSectionBusinessService.saveBatch(sectionBusinessList);
+            }
+
+            if (ObjectUtils.isNotNull(oldChapterId)){
+                //模块章节关联
+                Long newChapterId = getNewIdByTenant(oldChapterId,GoodsCopyEnum.COURSE_CHAPTER.getType(),newTenantId);
+                if (ObjectUtils.isNull(newChapterId)){
+                    throw new CustomException("当前章节在对应机构不存在,请检查!");
+                }
+                CourseChapterSection moduleChapter =  iCourseChapterSectionService.getByTenant(newChapterId,newSectionId,newTenantId);
+                if (ObjectUtils.isNull(moduleChapter)){
+                    //不存在就新增
+                    CourseChapterSection oldEntity = iCourseChapterSectionService
+                            .getOne(new LambdaQueryWrapper<CourseChapterSection>()
+                                    .eq(CourseChapterSection::getChapterId, oldChapterId)
+                                    .eq(CourseChapterSection::getSectionId, oldSectionId)
+                                    .last("limit 1"));
+                    if (ObjectUtils.isNotNull(oldEntity)){
+                        oldEntity.setId(null);
+                        oldEntity.setSectionId(newSectionId);
+                        oldEntity.setChapterId(newChapterId);
+                        oldEntity.setTenantId(newTenantId);
+                        iCourseChapterSectionService.save(oldEntity);
+                    }
+                }
+                Long newModuleId = getNewIdByTenant(oldModuleId,GoodsCopyEnum.COURSE_MODULE.getType(),newTenantId);
+                //课程章试卷
+                iCourseMenuExamService.deleteSectionByIdTenant(newCourseId,newModuleId,newChapterId,newSectionId,newTenantId);
+                List<CourseMenuExam> examList = iCourseMenuExamService
+                        .list(new LambdaQueryWrapper<CourseMenuExam>()
+                                .eq(CourseMenuExam::getCourseId, oldCourseId)
+                                .eq(CourseMenuExam::getModuleId, oldModuleId)
+                                .eq(CourseMenuExam::getChapterId,oldChapterId)
+                                .eq(CourseMenuExam::getSectionId,oldSectionId));
+                if (CollectionUtils.isNotEmpty(examList)){
+                    for (CourseMenuExam menuExam : examList) {
+                        menuExam.setSectionId(newSectionId);
+                        menuExam.setId(null);
+                        menuExam.setCourseId(newCourseId);
+                        menuExam.setModuleId(newModuleId);
+                        menuExam.setChapterId(newChapterId);
+                        menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,array));
+                        menuExam.setTenantId(newTenantId);
+                    }
+                    iCourseMenuExamService.saveBatch(examList);
+                }
+
+            }else {
+                //课程节关联
+                List<CourseMenu> courseMenus = iCourseMenuService.selectByNotTenant(newCourseId,3,newSectionId,newTenantId);
+                if (CollectionUtils.isEmpty(courseMenus)){
+                    //新增
+                    List<CourseMenu> list = iCourseMenuService
+                            .list(new LambdaQueryWrapper<CourseMenu>()
+                                    .eq(CourseMenu::getCourseId, oldCourseId)
+                                    .eq(CourseMenu::getMenuId, oldChapterId)
+                                    .eq(CourseMenu::getType, 2));
+                    if (CollectionUtils.isNotEmpty(list)){
+                        for (CourseMenu item : list) {
+                            item.setId(null);
+                            item.setCourseId(newCourseId);
+                            item.setMenuId(newSectionId);
+                            item.setTenantId(newTenantId);
+                        }
+                        iCourseMenuService.saveBatch(list);
+                    }
+                }
+            }
+        }
+    }
+
+
+
     private Long getNewCertificateId(Long certificateId,Long newTenantId,List<SysGoodsCopyRecord> array){
         CertificateCommon certificateCommon = iCertificateCommonService.getById(certificateId);
         if (ObjectUtils.isNotNull(certificateCommon)){
@@ -4493,13 +4717,13 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
     }
 
     @Override
+    @Transactional
     public boolean goodsNodeCopyAddTenant(GoodsNodeCopyTenantBo bo) {
         Goods goods = getById(bo.getGoodsId());
         if (ObjectUtils.isNull(goods)){
             throw new CustomException("商品信息获取有误");
         }
         Long oldGoodsId = goods.getGoodsId();
-        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
         switch (bo.getType()){
             case 1://课程复制
                 bo.getTenantId().forEach(newTenantId -> {
@@ -4546,14 +4770,24 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                     if (ObjectUtils.isNull(newCourseId)){
                         throw new CustomException("该机构不存在此商品课程,请先复制商品课程!");
                     }
-//                    disposeModule(bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
+                    disposeChapter(bo.getChapterId(),bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
                 });
                 break;
-
-
+            case 4://节复制
+                Course courseSection = iCourseService.getById(bo.getCourseId());
+                bo.getTenantId().forEach(newTenantId -> {
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    Long newCourseId = iCourseService.getCourseByTenantTwo(courseSection.getCourseName(), courseSection.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newCourseId)){
+                        throw new CustomException("该机构不存在此商品课程,请先复制商品课程!");
+                    }
+                    disposeSection(bo.getSectionId(),bo.getChapterId(),bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
+                });
+                break;
+            default:
+                break;
         }
-
-        return false;
+        return true;
     }
 
     @Override

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

@@ -396,4 +396,6 @@ public class GoodsUserVo {
 	private Long periodWaitTime;
 	@ApiModelProperty("是否是二建二造")
 	private Boolean erJianErZao;
+	@ApiModelProperty("是否可以预约标识:1未参加考试 2已参加考试 3考试成绩未通过")
+	private Integer subscribeSign;
 }

+ 18 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderGoodsServiceImpl.java

@@ -589,7 +589,7 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
                 goodsVo.setInterfaceAccountId(classGradeVo.getInterfaceAccountId());
                 goodsVo.setLearnStatus(classGradeVo.getLearnStatus());
                 goodsVo.setPeriodWaitTime(classGradeVo.getPeriodWaitTime());
-
+                goodsVo.setSubscribeSign(2);
                 LambdaQueryWrapper<UserSubscribe> lq = Wrappers.lambdaQuery();
                 lq.eq(UserSubscribe::getOrderGoodsId, goodsVo.getOrderGoodsId());
                 lq.eq(UserSubscribe::getSubscribeStatus, 1);
@@ -610,6 +610,23 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
                         }
                     }
                 }
+
+                //是否满足预约考试条件
+                if (ObjectUtils.isNotNull(classGradeVo.getPeriodStatus())
+                        && classGradeVo.getPeriodStatus() == 1
+                        && (DateUtils.getNowTime() >= goodsVo.getServiceStartTime() && DateUtils.getNowTime() <= goodsVo.getServiceEndTime())){
+                    UserSubscribe subscribe = iUserSubscribeService.getOne(new LambdaQueryWrapper<UserSubscribe>()
+                            .eq(UserSubscribe::getUserId, bo.getUserId())
+                            .eq(UserSubscribe::getGoodsId, goodsVo.getGoodsId())
+                            .eq(UserSubscribe::getSubscribeStatus, 1)
+                            .orderByDesc(UserSubscribe::getCreateTime)
+                            .last("limit 1"));
+                    if (ObjectUtils.isNull(subscribe)){
+                        goodsVo.setSubscribeSign(1);
+                    }else if (ObjectUtils.isNotNull(subscribe.getResult()) && subscribe.getResult() == 0){
+                        goodsVo.setSubscribeSign(3);
+                    }
+                }
                 //查询对应考试安排
                 List<ExamApplyGoodsVo> examApplyGoodsVoList = iExamApplyGoodsService.listByGoodsId(goodsVo.getGoodsId());
                 if (examApplyGoodsVoList != null && examApplyGoodsVoList.size() > 0) {

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/vo/OrderGoodsVo.java

@@ -343,4 +343,7 @@ public class OrderGoodsVo {
 	private Boolean erJianErZao;
 	@ApiModelProperty("1未开始 2已开始")
 	private Integer studyStatus;
+
+	@ApiModelProperty("是否可以预约标识:1未参加考试 2已参加考试 3考试成绩未通过")
+	private Integer subscribeSign;
 }

+ 11 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserSubscribeQueryBo.java

@@ -1,16 +1,12 @@
 package com.zhongzheng.modules.user.bo;
 
+import com.zhongzheng.common.core.domain.BaseEntity;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 
-import java.util.Date;
 import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-
-import com.zhongzheng.common.core.domain.BaseEntity;
 
 /**
  * 用户预约考试分页查询对象 user_subscribe
@@ -166,4 +162,14 @@ public class UserSubscribeQueryBo extends BaseEntity {
 	@ApiModelProperty("考试日期")
 	private Long applySiteExamTime;
 
+	/** 月份 */
+	@ApiModelProperty("时间")
+	private String ApplyDateTime;
+
+	@ApiModelProperty("月份开始时间")
+	private Long monthStartTime;
+
+	@ApiModelProperty("月份结束时间")
+	private Long monthEndTime;
+
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserSubscribeService.java

@@ -103,5 +103,5 @@ public interface IUserSubscribeService extends IService<UserSubscribe> {
 
 	Long saveByAddBo(UserSubscribeAddBo bo) throws ParseException;
 
-	List<ExamSessionVo> getExamSession(Integer month);
+	List<ExamSessionVo> getExamSession(String applyDate);
 }

+ 94 - 21
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -35,10 +35,12 @@ import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeJson;
 import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeTwoAddBo;
 import com.zhongzheng.modules.exam.domain.ExamApplySite;
 import com.zhongzheng.modules.exam.domain.ExamApplySiteTime;
+import com.zhongzheng.modules.exam.domain.ExamSite;
 import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
 import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.service.IExamApplySiteService;
 import com.zhongzheng.modules.exam.service.IExamApplySiteTimeService;
+import com.zhongzheng.modules.exam.service.IExamSiteService;
 import com.zhongzheng.modules.exam.vo.ExamApplySiteTimeTwoVo;
 import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
 import com.zhongzheng.modules.exam.vo.ExamApplyVo;
@@ -132,6 +134,9 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
     @Autowired
     private IExamApplySiteTimeService iExamApplySiteTimeService;
 
+    @Autowired
+    private IExamSiteService iExamSiteService;
+
     @Autowired
     private IMajorService majorService;
 
@@ -767,6 +772,32 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
     @Override
     @DataScope(businessAlias = "cb")
     public List<UserSubscribeVo> listSubscribe(UserSubscribeQueryBo bo) {
+        if (ObjectUtils.isNotNull(bo.getApplyDateTime()) && bo.getApplyDateTime().length() == 6){
+            //根据月份筛选
+            String dateStr = String.format(bo.getApplyDateTime()); // 指定年月
+            LocalDate date = LocalDate.parse(dateStr + "01", DateTimeFormatter.BASIC_ISO_DATE);
+            LocalDate dateFirst = date.with(TemporalAdjusters.firstDayOfMonth()); // 指定年月的第一天
+            LocalDate dateEnd = date.with(TemporalAdjusters.lastDayOfMonth()); // 指定年月的最后一天
+            ZonedDateTime zonedDateTime1 = dateFirst.atStartOfDay(ZoneId.systemDefault());
+            Date date1 = Date.from(zonedDateTime1.toInstant());
+            ZonedDateTime zonedDateTime = dateEnd.atStartOfDay(ZoneId.systemDefault());
+            Date date2 = Date.from(zonedDateTime.toInstant());
+            Long startTime = date1.getTime()/1000;
+            Long endTime = (date2.getTime()/1000) + 86400;
+            bo.setMonthStartTime(startTime);
+            bo.setMonthEndTime(endTime);
+        }else if (ObjectUtils.isNotNull(bo.getApplyDateTime()) && bo.getApplyDateTime().length() > 6){
+            //根据某天筛选
+            String dateStr = String.format(bo.getApplyDateTime());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+            try {
+                Date parse = sdf.parse(dateStr);
+                bo.setMonthStartTime(parse.getTime()/1000);
+                bo.setMonthEndTime(parse.getTime()/1000);
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
         List<UserSubscribeVo> userSubscribeVos = baseMapper.listSubscribe(bo);
         return userSubscribeVos;
     }
@@ -2004,6 +2035,30 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
 
     @Override
     public Long saveByAddBo(UserSubscribeAddBo bo) throws ParseException{
+        ExamApplySite site = iExamApplySiteService
+                .getOne(new LambdaQueryWrapper<ExamApplySite>()
+                        .eq(ExamApplySite::getApplyId, bo.getApplyId())
+                        .eq(ExamApplySite::getStatus, 1)
+                        .last("limit 1"));
+        if (ObjectUtils.isNotNull(site)){
+            ExamApplySiteTime siteTime = iExamApplySiteTimeService.getOne(new LambdaQueryWrapper<ExamApplySiteTime>()
+                    .eq(ExamApplySiteTime::getApplyId, bo.getApplyId())
+                    .eq(ExamApplySiteTime::getApplySiteId, site.getId())
+                    .last("limit 1"));
+            if (ObjectUtils.isNotNull(siteTime)){
+                List<ExamApplySiteTimeTwoAddBo> timeTwoAddBos = JSONArray.parseArray(siteTime.getSiteTime(), ExamApplySiteTimeTwoAddBo.class);
+                ExamApplySiteTimeTwoAddBo twoAddBo = timeTwoAddBos.stream().findFirst().orElse(null);
+                if (ObjectUtils.isNotNull(twoAddBo)){
+                    bo.setApplySiteExamTime(siteTime.getExamTime());
+                    bo.setApplySiteStartTime(twoAddBo.getStartTime());
+                    bo.setApplySiteEndTime(twoAddBo.getEndTime());
+                }
+                ExamSite examSite = iExamSiteService.getById(site.getSiteId());
+                bo.setApplySiteAddress(examSite.getSiteAddress());
+                bo.setSiteId(examSite.getSiteId());
+            }
+        }
+
         UserSubscribe add = BeanUtil.toBean(bo, UserSubscribe.class);
         if(Validator.isEmpty(add.getOrderGoodsId())){
             throw new CustomException("缺失订单商品ID");
@@ -2078,6 +2133,7 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
                 throw new CustomException("考点人数已满");
             }
         }
+
         validEntityBeforeSave(add);
         add.setSubscribeStatus(1);
         add.setExamStatus(0);
@@ -2086,16 +2142,16 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         add.setExamineeCode(ServletUtils.getEncoded("ZZ"+ ToolsUtils.autoGenericCode(String.valueOf(add.getApplyId()),4) +ToolsUtils.autoGenericCode(String.valueOf(add.getUserId()),4)));
         this.save(add);
         //签署疫情防控书
-        if (org.apache.commons.lang3.StringUtils.isNotBlank(bo.getSignImageStr())){
-            UserSubscribeSignReportBo reportBo = new UserSubscribeSignReportBo();
-            reportBo.setSubscribeId(add.getSubscribeId());
-            User user = iUserService.getById(bo.getUserId());
-            reportBo.setUserId(bo.getUserId());
-            reportBo.setPhone(user.getTelphone());
-            reportBo.setIdCard(user.getIdCard());
-            reportBo.setSignImageStr(bo.getSignImageStr());
-            this.signReport(reportBo);
-        }
+//        if (org.apache.commons.lang3.StringUtils.isNotBlank(bo.getSignImageStr())){
+//            UserSubscribeSignReportBo reportBo = new UserSubscribeSignReportBo();
+//            reportBo.setSubscribeId(add.getSubscribeId());
+//            User user = iUserService.getById(bo.getUserId());
+//            reportBo.setUserId(bo.getUserId());
+//            reportBo.setPhone(user.getTelphone());
+//            reportBo.setIdCard(user.getIdCard());
+//            reportBo.setSignImageStr(bo.getSignImageStr());
+//            this.signReport(reportBo);
+//        }
 
         //发送预约考试消息
         sendExamSucceed(bo);
@@ -2103,18 +2159,35 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
     }
 
     @Override
-    public List<ExamSessionVo> getExamSession(Integer month) {
+    public List<ExamSessionVo> getExamSession(String applyDate) {
         //根据月份筛选
-        String dateStr = String.format("20230%s",month); // 指定年月
-        LocalDate date = LocalDate.parse(dateStr + "01", DateTimeFormatter.BASIC_ISO_DATE);
-        LocalDate dateFirst = date.with(TemporalAdjusters.firstDayOfMonth()); // 指定年月的第一天
-        LocalDate dateEnd = date.with(TemporalAdjusters.lastDayOfMonth()); // 指定年月的最后一天
-        ZonedDateTime zonedDateTime1 = dateFirst.atStartOfDay(ZoneId.systemDefault());
-        Date date1 = Date.from(zonedDateTime1.toInstant());
-        ZonedDateTime zonedDateTime = dateEnd.atStartOfDay(ZoneId.systemDefault());
-        Date date2 = Date.from(zonedDateTime.toInstant());
-        Long startTime = date1.getTime()/1000;
-        Long endTime = (date2.getTime()/1000) + 86400;
+        Long startTime = 0L;
+        Long endTime = 0L;
+        if (applyDate.length() == 6){
+            String dateStr = String.format(applyDate); // 指定年月
+            LocalDate date = LocalDate.parse(dateStr + "01", DateTimeFormatter.BASIC_ISO_DATE);
+            LocalDate dateFirst = date.with(TemporalAdjusters.firstDayOfMonth()); // 指定年月的第一天
+            LocalDate dateEnd = date.with(TemporalAdjusters.lastDayOfMonth()); // 指定年月的最后一天
+            ZonedDateTime zonedDateTime1 = dateFirst.atStartOfDay(ZoneId.systemDefault());
+            Date date1 = Date.from(zonedDateTime1.toInstant());
+            ZonedDateTime zonedDateTime = dateEnd.atStartOfDay(ZoneId.systemDefault());
+            Date date2 = Date.from(zonedDateTime.toInstant());
+            startTime = date1.getTime()/1000;
+            endTime = (date2.getTime()/1000) + 86400;
+        }else {
+
+            //根据某天筛选
+            String dateStr = String.format(applyDate);
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
+            try {
+                Date date1 = sdf.parse(dateStr);
+                Date date2 =  sdf.parse(dateStr);
+                startTime = date1.getTime()/1000;
+                endTime = (date2.getTime()/1000) + 86400;
+            } catch (ParseException e) {
+                e.printStackTrace();
+            }
+        }
 
         List<ExamApplySiteTime> siteTimes = iExamApplySiteTimeService
                 .list(new LambdaQueryWrapper<ExamApplySiteTime>()

+ 11 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseChapterSectionMapper.xml

@@ -333,4 +333,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <delete id="deleteByIdAndTenant" parameterType="map" >
         delete from course_chapter_section where chapter_id = #{chapterId} and tenant_id = #{newTenantId}
     </delete>
+
+    <select id="getByTenant" parameterType="map"  resultType="com.zhongzheng.modules.course.domain.CourseChapterSection">
+        SELECT
+            *
+        FROM
+            course_chapter_section
+        WHERE
+            chapter_id =#{newChapterId}
+          AND section_id = #{newSectionId}
+          AND tenant_id = #{newTenantId}
+    </select>
 </mapper>

+ 8 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuExamMapper.xml

@@ -53,4 +53,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from course_menu_exam where course_id = #{newCourseId} and module_id = #{newModuleId} and tenant_id = #{newTenantId}
     </delete>
 
+    <delete id="deleteChapterByIdTenant" parameterType="map">
+        delete from course_menu_exam where course_id = #{newCourseId} and module_id = #{newModuleId} and chapter_id = #{newChapterId} and tenant_id = #{newTenantId}
+    </delete>
+
+    <delete id="deleteSectionByIdTenant" parameterType="map">
+        delete from course_menu_exam where course_id = #{newCourseId} and module_id = #{newModuleId} and chapter_id = #{newChapterId} and section_id = #{newSectionId} and tenant_id = #{newTenantId}
+    </delete>
+
 </mapper>

+ 13 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleChapterMapper.xml

@@ -166,4 +166,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        delete from course_module_chapter where module_id = #{newModuleId} and tenant_id = #{newTenantId}
     </delete>
 
+
+    <select id="getByTenant" parameterType="map"  resultType="com.zhongzheng.modules.course.domain.CourseModuleChapter">
+        SELECT
+            *
+        FROM
+            course_module_chapter
+        WHERE
+            module_id = #{newModuleId}
+          AND chapter_id = #{newChapterId}
+          AND tenant_id = #{newTenantId}
+    </select>
+
+
 </mapper>

+ 15 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserSubscribeMapper.xml

@@ -204,6 +204,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="subscribeId != null and subscribeId != '' ">
             and us.subscribe_id = #{subscribeId}
         </if>
+        <if test="applySiteExamTime != null and applySiteExamTime != '' ">
+            and us.apply_site_exam_time = #{applySiteExamTime}
+        </if>
+        <if test="monthStartTime != null and monthStartTime != '' ">
+            and us.apply_site_exam_time &gt;= #{monthStartTime}
+        </if>
+        <if test="monthEndTime != null and monthEndTime != '' ">
+            and us.apply_site_exam_time &lt;= #{monthEndTime}
+        </if>
+        <if test="applySiteStartTime != null and applySiteStartTime != '' ">
+            and us.apply_site_start_time = #{applySiteStartTime}
+        </if>
+        <if test="applySiteEndTime != null and applySiteEndTime != '' ">
+            and us.apply_site_end_time = #{applySiteEndTime}
+        </if>
         <if test="subscribeStatus != null and subscribeStatus != '' ">
             and us.subscribe_status = #{subscribeStatus}
         </if>