he2802 2 жил өмнө
parent
commit
4237c4b3c0
23 өөрчлөгдсөн 383 нэмэгдсэн , 71 устгасан
  1. 2 0
      zhongzheng-admin-saas/src/main/resources/application-dev.yml
  2. 2 0
      zhongzheng-admin/src/main/resources/application-dev.yml
  3. 7 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  4. 3 1
      zhongzheng-api/src/main/resources/application-dev.yml
  5. 17 0
      zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java
  6. 55 19
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java
  7. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuExamMapper.java
  8. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java
  9. 2 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/ICourseMenuService.java
  11. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseService.java
  12. 5 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/CourseMenuServiceImpl.java
  14. 22 32
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java
  15. 46 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  16. 13 8
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java
  17. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyDetailVo.java
  18. 4 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyGoodsVo.java
  19. 11 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsNodeCopyTenantBo.java
  20. 158 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  21. 7 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java
  22. 4 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuExamMapper.xml
  23. 4 0
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml

+ 2 - 0
zhongzheng-admin-saas/src/main/resources/application-dev.yml

@@ -170,3 +170,5 @@ oldSys:
 
 
 invoice:
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
+
+liveHost: http://192.168.1.222:6009

+ 2 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -172,3 +172,5 @@ oldSys:
 
 
 invoice:
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
     host: http://192.168.1.222:7077/sys/common/openMplatform/log
+
+liveHost: http://192.168.1.222:6009

+ 7 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -411,4 +411,11 @@ public class CommonController extends BaseController {
         iSmsService.sendLiveSms(bo.getTel());
         iSmsService.sendLiveSms(bo.getTel());
         return AjaxResult.success();
         return AjaxResult.success();
     }
     }
+
+    @ApiOperation("获取7个工作日后的时间")
+    @GetMapping("/live/time")
+    public AjaxResult getLiveTime() {
+        Long time = iCourseService.getLiveTime();
+        return AjaxResult.success(time);
+    }
 }
 }

+ 3 - 1
zhongzheng-api/src/main/resources/application-dev.yml

@@ -172,4 +172,6 @@ oldSys:
     host: http://gdxypx.xy.com
     host: http://gdxypx.xy.com
 
 
 invoice:
 invoice:
-    host: http://192.168.1.222:7077/sys/common/openMplatform/log
+    host: http://192.168.1.222:7077/sys/common/openMplatform/log
+
+liveHost: http://192.168.1.222:6009

+ 17 - 0
zhongzheng-common/src/main/java/com/zhongzheng/common/utils/DateUtils.java

@@ -559,4 +559,21 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
         return c.getTime().getTime()/1000;
         return c.getTime().getTime()/1000;
     }
     }
 
 
+    /**
+     * 指定时间往前或往后推n天
+     *
+     * @param dateTime 指定时间
+     * @param x 指定天数
+     * @return
+     */
+    public static Long getDayAfter(Long dateTime, int x) {
+        Calendar c = Calendar.getInstance();
+        Date date = new Date(dateTime*1000);
+        c.setTime(date);
+        int day = c.get(Calendar.DATE);
+//        c.set(Calendar.DATE, day - x);    //往前推几天
+        c.set(Calendar.DATE, day + x);  //往后推几天
+        return c.getTime().getTime()/1000;
+    }
+
 }
 }

+ 55 - 19
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -1257,19 +1257,40 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         }
         }
 
 
         Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
         Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        //商品ID
         Long goodsId = Long.valueOf(split.get("gid"));
         Long goodsId = Long.valueOf(split.get("gid"));
+        //观看权限
+        String per = split.get("watchPer");
+        //课程ID
+        String cid = split.get("cid");
+        //节ID
+        String sid = split.get("sid");
 
 
         //获取对应商品
         //获取对应商品
         Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
         Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+        User user = new User();
+        if (StringUtils.isNotBlank(per) && Integer.valueOf(per) == 2){
+            //所有人都可以看
+            user = userList.stream().filter(item -> {
+                Long tenantId = item.getTenantId();
+                Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+                Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+                CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+                CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+                Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+                return ObjectUtils.isNotNull(courseId) && ObjectUtils.isNotNull(courseSection) && ObjectUtils.isNotNull(goodsTwo);
+            }).findFirst().orElse(null);
 
 
-        User user = userList.stream().filter(item -> {
-            //判断用户是否购买商品
-            Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
-            return count > 0;
-        }).findFirst().orElse(null);
+        }else {
+            user = userList.stream().filter(item -> {
+                //判断用户是否购买商品
+                Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
+                return count > 0;
+            }).findFirst().orElse(null);
+        }
 
 
         if(Validator.isEmpty(user)){
         if(Validator.isEmpty(user)){
-            throw new CustomException("登录信息错误");
+            throw new CustomException("请联系管理员!");
         }
         }
         else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
         else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
         {
         {
@@ -1310,8 +1331,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 break;
                 break;
         }
         }
 
 
-        String cid = split.get("cid");
-        String sid = split.get("sid");
         Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
         Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
         Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
         Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
         CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
         CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
@@ -1379,7 +1398,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
 
 
         List<User> userList = baseMapper.getUserByTel(bo.getTel());
         List<User> userList = baseMapper.getUserByTel(bo.getTel());
         if (CollectionUtils.isEmpty(userList)){
         if (CollectionUtils.isEmpty(userList)){
-            throw new CustomException("账号不存在!请检查");
+            throw new CustomException("请联系管理员!");
         }
         }
         //参数解析
         //参数解析
         String param = new String(Base64.decode(bo.getParam()));
         String param = new String(Base64.decode(bo.getParam()));
@@ -1388,19 +1407,39 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
         }
         }
 
 
         Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
         Map<String, String> split = Splitter.on("&").withKeyValueSeparator("=").split(param);
+        //商品ID
         Long goodsId = Long.valueOf(split.get("gid"));
         Long goodsId = Long.valueOf(split.get("gid"));
-
+        //观看权限
+        String per = split.get("watchPer");
+        //课程ID
+        String cid = split.get("cid");
+        //节ID
+        String sid = split.get("sid");
         //获取对应商品
         //获取对应商品
         Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
         Goods goods = iGoodsService.getGoodsByIdNotTenant(goodsId);
+        User user = new User();
+        if (StringUtils.isNotBlank(per) && Integer.valueOf(per) == 2){
+            //所有人都可以看
+            user = userList.stream().filter(item -> {
+                Long tenantId = item.getTenantId();
+                Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
+                Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
+                CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
+                CourseSection courseSection = iCourseSectionService.getSectionByTenantTwo(section.getName(),section.getCode(),tenantId);
+                Goods goodsTwo = iGoodsService.getGoodsByTenantTwo(goods.getGoodsName(),goods.getCode(),tenantId);
+                return ObjectUtils.isNotNull(courseId) && ObjectUtils.isNotNull(courseSection) && ObjectUtils.isNotNull(goodsTwo);
+            }).findFirst().orElse(null);
 
 
-        User user = userList.stream().filter(item -> {
-            //判断用户是否购买商品
-            Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
-            return count > 0;
-        }).findFirst().orElse(null);
+        }else {
+            user = userList.stream().filter(item -> {
+                //判断用户是否购买商品
+                Long count = baseMapper.getUserOrderCount(item.getUserId(), item.getTenantId(), goods.getCode(), goods.getGoodsName());
+                return count > 0;
+            }).findFirst().orElse(null);
+        }
 
 
         if(Validator.isEmpty(user)){
         if(Validator.isEmpty(user)){
-            throw new CustomException("登录信息错误");
+            throw new CustomException("账号未注册,请联系管理员!");
         }
         }
         else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
         else if (UserStatus.DISABLE.getCode().equals(user.getStatus()))
         {
         {
@@ -1422,9 +1461,6 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
                 path = "living-room";
                 path = "living-room";
                 break;
                 break;
         }
         }
-
-        String cid = split.get("cid");
-        String sid = split.get("sid");
         Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
         Course course = iCourseService.getCourseByNotTenant(Long.valueOf(cid));
         Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
         Long courseId = iCourseService.getCourseByTenantTwo(course.getCourseName(),course.getCode(),tenantId);
         CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));
         CourseSection section = iCourseSectionService.getSectionByNotTenant(Long.valueOf(sid));

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuExamMapper.java

@@ -22,4 +22,8 @@ public interface CourseMenuExamMapper extends BaseMapper<CourseMenuExam> {
 
 
     @InterceptorIgnore(tenantLine = "true")
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdTenant(@Param("newCourseId") Long newCourseId,@Param("newTenantId") Long newTenantId);
     void deleteByIdTenant(@Param("newCourseId") Long newCourseId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    void deleteModuleByIdTenant(@Param("newCourseId")Long newCourseId,@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);
+
 }
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseMenuMapper.java

@@ -39,4 +39,8 @@ public interface CourseMenuMapper extends BaseMapper<CourseMenu> {
 
 
     @InterceptorIgnore(tenantLine = "true")
     @InterceptorIgnore(tenantLine = "true")
     void deleteByIdTenant(@Param("newCourseId") Long newCourseId,@Param("newTenantId") Long newTenantId);
     void deleteByIdTenant(@Param("newCourseId") Long newCourseId,@Param("newTenantId") Long newTenantId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<CourseMenu> selectByNotTenant(@Param("newCourseId") Long newCourseId,@Param("type") Integer type,@Param("newModuleId") Long newModuleId,@Param("newTenantId") Long newTenantId);
+
 }
 }

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

@@ -53,4 +53,6 @@ public interface ICourseMenuExamService extends IService<CourseMenuExam> {
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 	Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
 
 
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
+
+    void deleteModuleByIdTenant(Long newCourseId, Long newModuleId, Long newTenantId);
 }
 }

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

@@ -66,4 +66,6 @@ public interface ICourseMenuService extends IService<CourseMenu> {
 	List<CourseUserMenuVo> getGoodsRebuildMenuList(CourseMenuQueryBo bo);
 	List<CourseUserMenuVo> getGoodsRebuildMenuList(CourseMenuQueryBo bo);
 
 
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
     void deleteByIdTenant(Long newCourseId, Long newTenantId);
+
+    List<CourseMenu> selectByNotTenant(Long newCourseId, Integer type, Long newModuleId,Long newTenantId);
 }
 }

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

@@ -94,4 +94,6 @@ public interface ICourseService extends IService<Course> {
 
 
 	Long getCourseByTenantTwo(String courseName, String code, Long tenantId);
 	Long getCourseByTenantTwo(String courseName, String code, Long tenantId);
 
 
+	Long getLiveTime();
+
 }
 }

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

@@ -114,4 +114,9 @@ public class CourseMenuExamServiceImpl extends ServiceImpl<CourseMenuExamMapper,
     public void deleteByIdTenant(Long newCourseId, Long newTenantId) {
     public void deleteByIdTenant(Long newCourseId, Long newTenantId) {
         baseMapper.deleteByIdTenant(newCourseId, newTenantId);
         baseMapper.deleteByIdTenant(newCourseId, newTenantId);
     }
     }
+
+    @Override
+    public void deleteModuleByIdTenant(Long newCourseId, Long newModuleId, Long newTenantId) {
+        baseMapper.deleteModuleByIdTenant(newCourseId,newModuleId, newTenantId);
+    }
 }
 }

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

@@ -326,4 +326,9 @@ public class CourseMenuServiceImpl extends ServiceImpl<CourseMenuMapper, CourseM
     public void deleteByIdTenant(Long newCourseId, Long newTenantId) {
     public void deleteByIdTenant(Long newCourseId, Long newTenantId) {
         baseMapper.deleteByIdTenant(newCourseId, newTenantId);
         baseMapper.deleteByIdTenant(newCourseId, newTenantId);
     }
     }
+
+    @Override
+    public List<CourseMenu> selectByNotTenant(Long newCourseId, Integer type, Long newModuleId,Long newTenantId) {
+        return baseMapper.selectByNotTenant(newCourseId, type, newModuleId,newTenantId);
+    }
 }
 }

+ 22 - 32
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseSectionWatchPerServiceImpl.java

@@ -2,13 +2,11 @@ package com.zhongzheng.modules.course.service.impl;
 
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.codec.Base64;
 import cn.hutool.core.codec.Base64;
-
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.DateUtils;
-import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.modules.course.bo.CheckSectionWatchVo;
 import com.zhongzheng.modules.course.bo.CheckSectionWatchVo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerAddBo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerAddBo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerBo;
 import com.zhongzheng.modules.course.bo.SectionWatchPerBo;
@@ -51,40 +49,23 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
     @Value("${liveGotoURL}")
     @Value("${liveGotoURL}")
     private String liveGotoURL;
     private String liveGotoURL;
 
 
+    @Value("${liveHost}")
+    private String liveHost;
+
     @Override
     @Override
     public CourseSectionWatchPerVo getSectionWatchPer(SectionWatchPerBo bo) {
     public CourseSectionWatchPerVo getSectionWatchPer(SectionWatchPerBo bo) {
         CourseSectionWatchPerVo vo = new CourseSectionWatchPerVo();
         CourseSectionWatchPerVo vo = new CourseSectionWatchPerVo();
-        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
-        //获取课程节信息
-        CourseSection section = courseSectionService.getById(bo.getSectionId());
-//        String url = "";
-        String live = "living-room/";
-        vo.setEnCode(wxLoginService.getLiveEnCode(bo));
-        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-
-        String s = Base64.encode(format);
+//        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+//        //获取课程节信息
+//        CourseSection section = courseSectionService.getById(bo.getSectionId());
+//        String live = "living-room/";
+//        vo.setEnCode(wxLoginService.getLiveEnCode(bo));
+//        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+//        String s = Base64.encode(format);
+//        String domainPc =  iSysTenantService.getById(tenantId).getHostPc();
+//        String url = String.format("%s%s/%s%s?a=1&%s",liveGotoURL, domainPc,live,section.getLiveUrl(), s);
+//        vo.setEnCodePC(url);
 
 
-//        String s = DigestUtils.md5Hex(format);
-//        String url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-        // https://web.xyyxt.net/
-        String domainPc =  iSysTenantService.getById(tenantId).getHostPc();
-        String url = String.format("%s%s/%s%s?a=1&%s",liveGotoURL, domainPc,live,section.getLiveUrl(), s);
-//        //生成微信小程序码
-//        switch (bo.getSectionType()){
-//            case 2://直播 living-room/
-//                String live = "living-room/";
-//                vo.setEnCode(wxLoginService.getLiveEnCode(bo));
-//                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,live,section.getLiveUrl(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-//                break;
-//            case 3://回放 my-live-detail/
-//                String detail = "my-live-detail/";
-//                vo.setEnCode(wxLoginService.getBackEnCode(bo));
-//                url = String.format("%s%s%s?a=1&cid=%s&gid=%s&sid=%s", liveGotoURL,detail,bo.getGoodsId(), bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
-//                break;
-//            default:
-//                throw new CustomException("课程节类型不正确,请检查");
-//        }
-        vo.setEnCodePC(url);
         CourseSectionWatchPer watchPer = getOne(new LambdaQueryWrapper<CourseSectionWatchPer>()
         CourseSectionWatchPer watchPer = getOne(new LambdaQueryWrapper<CourseSectionWatchPer>()
                 .eq(ObjectUtils.isNotNull(bo.getCourseId()), CourseSectionWatchPer::getCourseId, bo.getCourseId())
                 .eq(ObjectUtils.isNotNull(bo.getCourseId()), CourseSectionWatchPer::getCourseId, bo.getCourseId())
                 .eq(ObjectUtils.isNotNull(bo.getChapterId()), CourseSectionWatchPer::getChapterId, bo.getChapterId())
                 .eq(ObjectUtils.isNotNull(bo.getChapterId()), CourseSectionWatchPer::getChapterId, bo.getChapterId())
@@ -93,6 +74,15 @@ public class CourseSectionWatchPerServiceImpl extends ServiceImpl<CourseSectionW
                 .eq(ObjectUtils.isNotNull(bo.getGoodsId()), CourseSectionWatchPer::getGoodsId, bo.getGoodsId())
                 .eq(ObjectUtils.isNotNull(bo.getGoodsId()), CourseSectionWatchPer::getGoodsId, bo.getGoodsId())
                 .eq(CourseSectionWatchPer::getStatus, 1)
                 .eq(CourseSectionWatchPer::getStatus, 1)
                 .last("LIMIT 1"));
                 .last("LIMIT 1"));
+
+        String format = String.format("cid=%s&gid=%s&sid=%s", bo.getCourseId(), bo.getGoodsId(), bo.getSectionId());
+        if (ObjectUtils.isNotNull(watchPer)){
+            format = format + "&watchPer="+watchPer.getWatchPer();
+        }
+        String s = Base64.encode(format);
+        String url = String.format("%s?param=%s",liveHost,s);
+        vo.setEnCodePC(url);
+        vo.setEnCode(url);
         if (ObjectUtils.isNull(watchPer)){
         if (ObjectUtils.isNull(watchPer)){
             return vo;
             return vo;
         }
         }

+ 46 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -3,9 +3,11 @@ package com.zhongzheng.modules.course.service.impl;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
 import com.github.pagehelper.Page;
@@ -22,10 +24,8 @@ import com.zhongzheng.modules.course.service.ICoursePhotoLogService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.service.ICourseService;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseUserVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
-import com.zhongzheng.modules.exam.domain.ExamApply;
-import com.zhongzheng.modules.exam.domain.ExamApplyUser;
-import com.zhongzheng.modules.exam.domain.ExamBefore;
-import com.zhongzheng.modules.exam.domain.ExamBeforeApply;
+import com.zhongzheng.modules.exam.bo.ExamApplySiteTimeTwoAddBo;
+import com.zhongzheng.modules.exam.domain.*;
 import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.exam.vo.ExamApplyGoodsVo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
 import com.zhongzheng.modules.goods.bo.GoodsBatchDelBo;
@@ -63,6 +63,7 @@ import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Collection;
 import java.util.Collection;
 import java.util.List;
 import java.util.List;
 import java.util.stream.Collectors;
 import java.util.stream.Collectors;
@@ -112,6 +113,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
     @Autowired
     @Autowired
     private IExamApplyUserService iExamApplyUserService;
     private IExamApplyUserService iExamApplyUserService;
 
 
+    @Autowired
+    private IExamApplySiteTimeService iExamApplySiteTimeService;
+
     @Autowired
     @Autowired
     private IExamBeforeApplyService iExamBeforeApplyService;
     private IExamBeforeApplyService iExamBeforeApplyService;
 
 
@@ -496,6 +500,19 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
                 List<ExamApplyGoodsVo> examApplyGoodsVos2 = new ArrayList<>();
                 List<ExamApplyGoodsVo> examApplyGoodsVos2 = new ArrayList<>();
                 examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
                 examApplyGoodsVoList.forEach(examApplyGoodsVo -> {
                     ExamApply examApply = iExamApplyService.getById(examApplyGoodsVo.getApplyId());
                     ExamApply examApply = iExamApplyService.getById(examApplyGoodsVo.getApplyId());
+                    List<ExamApplySiteTime> siteTimes = iExamApplySiteTimeService.list(new LambdaQueryWrapper<ExamApplySiteTime>()
+                            .eq(ExamApplySiteTime::getApplyId, examApplyGoodsVo.getApplyId()));
+                    if (CollectionUtils.isNotEmpty(siteTimes)){
+                        ExamApplySiteTime timeTime = siteTimes.get(0);
+                        List<ExamApplySiteTimeTwoAddBo> siteTimeTwoAddBos = JSONArray.parseArray(timeTime.getSiteTime(), ExamApplySiteTimeTwoAddBo.class);
+                        ExamApplySiteTimeTwoAddBo twoAddBo = siteTimeTwoAddBos.get(0);
+                        if (ObjectUtils.isNotNull(twoAddBo)){
+                           Long time = timeTime.getExamTime()+28800L;
+                           String format = String.format("%s-%s", twoAddBo.getStartTime(), twoAddBo.getEndTime());
+                            examApplyGoodsVo.setApplyTime(time);
+                            examApplyGoodsVo.setApplyMoment(format);
+                        }
+                    }
                     switch (examApply.getApplyNature()){
                     switch (examApply.getApplyNature()){
                         case 1: //普通场
                         case 1: //普通场
                             LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
                             LambdaQueryWrapper<ExamApplyUser> lqw = Wrappers.lambdaQuery();
@@ -632,6 +649,31 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
         return baseMapper.getCourseByTenantTwo(courseName, code, tenantId);
         return baseMapper.getCourseByTenantTwo(courseName, code, tenantId);
     }
     }
 
 
+    @Override
+    public Long getLiveTime() {
+        Long nowTime = DateUtils.getNowTime();
+        Long aLong = liveTime(nowTime, 7);
+        return aLong;
+    }
+
+    private Long liveTime(Long nowTime, Integer day) {
+        Long dayAfter = DateUtils.getDayAfter(nowTime, day);
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(DateUtils.timeToDate(dayAfter));
+        int index = calendar.get(Calendar.DAY_OF_WEEK) - 1;
+        String[] weeks = new String[]{"星期天", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"};
+        if (weeks[index].equals("星期六") || weeks[index].equals("星期天")) {
+            //周末
+            liveTime(nowTime,day + 1);
+        }
+
+        //判断当前是否为工作日
+        if (!DateUtils.isWorkingDay(dayAfter)) {
+            liveTime(nowTime,day + 1);
+        }
+        return dayAfter;
+    }
+
     private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
     private List<UserStudyRecordPhotoVo> entity2PhotoVo(Collection<UserStudyRecordPhoto> collection) {
         List<UserStudyRecordPhotoVo> voList = collection.stream()
         List<UserStudyRecordPhotoVo> voList = collection.stream()
                 .map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))
                 .map(any -> BeanUtil.toBean(any, UserStudyRecordPhotoVo.class))

+ 13 - 8
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -30,15 +30,9 @@ import com.zhongzheng.modules.bank.domain.QuestionBusiness;
 import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
 import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.bo.*;
-import com.zhongzheng.modules.exam.domain.ExamApply;
-import com.zhongzheng.modules.exam.domain.ExamApplySite;
-import com.zhongzheng.modules.exam.domain.ExamApplySiteTime;
-import com.zhongzheng.modules.exam.domain.ExamApplyUser;
+import com.zhongzheng.modules.exam.domain.*;
 import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
 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.IExamApplyUserService;
+import com.zhongzheng.modules.exam.service.*;
 import com.zhongzheng.modules.exam.vo.*;
 import com.zhongzheng.modules.exam.vo.*;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
@@ -85,6 +79,8 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
     @Autowired
     @Autowired
     private IExamService iExamService;
     private IExamService iExamService;
     @Autowired
     @Autowired
+    private IExamSiteService iExamSiteService;
+    @Autowired
     private IActivityRecommendService iActivityRecommendService;
     private IActivityRecommendService iActivityRecommendService;
     @Autowired
     @Autowired
     private IActivityRecommendGoodsService iActivityRecommendGoodsService;
     private IActivityRecommendGoodsService iActivityRecommendGoodsService;
@@ -869,6 +865,15 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         }
         }
         //获取考试学员
         //获取考试学员
         vo.forEach(item -> {
         vo.forEach(item -> {
+            //考场名称和考试名称
+            ExamSite site = iExamSiteService.getById(item.getSiteId());
+            if (ObjectUtils.isNotNull(site)){
+                item.setSiteName(site.getSiteAddress());
+            }
+            ExamApply examApply = getById(item.getApplyId());
+            if (ObjectUtils.isNotNull(examApply)){
+                item.setApplyName(examApply.getApplyName());
+            }
             List<ExamApplyUserDetailVo> examUserInfo = baseMapper.getExamUserInfo(item);
             List<ExamApplyUserDetailVo> examUserInfo = baseMapper.getExamUserInfo(item);
             if (CollectionUtils.isNotEmpty(examUserInfo)){
             if (CollectionUtils.isNotEmpty(examUserInfo)){
                 examUserInfo.forEach(user -> {
                 examUserInfo.forEach(user -> {

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

@@ -16,6 +16,10 @@ public class ExamApplyDetailVo implements Serializable {
     private Long siteId;
     private Long siteId;
     @ApiModelProperty("考试日期")
     @ApiModelProperty("考试日期")
     private Long examTime;
     private Long examTime;
+    @ApiModelProperty("考场名称")
+    private String siteName;
+    @ApiModelProperty("考试名称")
+    private String applyName;
     @ApiModelProperty("开始时间")
     @ApiModelProperty("开始时间")
     private String startTime;
     private String startTime;
     @ApiModelProperty("结束时间")
     @ApiModelProperty("结束时间")

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamApplyGoodsVo.java

@@ -1,11 +1,9 @@
 package com.zhongzheng.modules.exam.vo;
 package com.zhongzheng.modules.exam.vo;
 
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
 import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.fasterxml.jackson.annotation.JsonFormat;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.Data;
-import java.util.Date;
 
 
 
 
 
 
@@ -41,4 +39,8 @@ public class ExamApplyGoodsVo {
 	/** 考试开始时间段 */
 	/** 考试开始时间段 */
 	@Excel(name = "商品标题",width = 30)
 	@Excel(name = "商品标题",width = 30)
 	private String goodsName;
 	private String goodsName;
+	@ApiModelProperty("考试时间段")
+	private String applyMoment;
+	@ApiModelProperty("考试时间")
+	private Long applyTime;
 }
 }

+ 11 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsNodeCopyTenantBo.java

@@ -14,10 +14,18 @@ import java.util.List;
 public class GoodsNodeCopyTenantBo implements Serializable {
 public class GoodsNodeCopyTenantBo implements Serializable {
 
 
     @ApiModelProperty("机构ID")
     @ApiModelProperty("机构ID")
-    private Long tenantId;
+    private List<Long> tenantId;
 
 
-    @ApiModelProperty("标识ID")
-    private Long signId;
+    @ApiModelProperty("商品ID")
+    private Long goodsId;
+    @ApiModelProperty("课程ID")
+    private Long courseId;
+    @ApiModelProperty("模块ID")
+    private Long modelId;
+    @ApiModelProperty("章ID")
+    private Long chapterId;
+    @ApiModelProperty("节ID")
+    private Long sectionId;
 
 
     @ApiModelProperty("类型:1课程 2模块 3章 4节")
     @ApiModelProperty("类型:1课程 2模块 3章 4节")
     private Integer type;
     private Integer type;

+ 158 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -1625,7 +1625,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
                 disposeGoodsCourse(oldGoodsId,newGoodsId,newTenantId,newCourseMenuExamList,recordList);
                 disposeGoodsCourse(oldGoodsId,newGoodsId,newTenantId,newCourseMenuExamList,recordList);
                 //课程双师
                 //课程双师
                 disposeGoodsCourseTeacher(oldGoodsId,newGoodsId,newTenantId);
                 disposeGoodsCourseTeacher(oldGoodsId,newGoodsId,newTenantId);
-                //商品试卷
+                //题库商品
                 disposeGoodsAttached(oldGoodsId,newGoodsId,newTenantId,recordList);
                 disposeGoodsAttached(oldGoodsId,newGoodsId,newTenantId,recordList);
 
 
                 //处理商品试卷
                 //处理商品试卷
@@ -2461,6 +2461,106 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         }
         }
         return null;
         return null;
     }
     }
+
+    private void disposeModule(Long oldModuleId,Long newTenantId,Long oldCourseId,Long newCourseId,List<SysGoodsCopyRecord> array){
+        CourseModule module = iCourseModuleService.getById(oldModuleId);
+        if (ObjectUtils.isNotNull(module)){
+            Long oid = module.getModuleId();
+            Long newModuleId = getNewIdByTenant(oid,GoodsCopyEnum.COURSE_MODULE.getType(),newTenantId);
+            if (ObjectUtils.isNull(newModuleId)){
+                module.setModuleId(null);
+                module.setTenantId(newTenantId);
+                iCourseModuleService.save(module);
+                newModuleId = module.getModuleId();
+                addSysGoodsRecord(oid,newModuleId,GoodsCopyEnum.COURSE_MODULE.getType(),newTenantId,array);
+            }
+
+            //删除之前的关联
+            iCourseModuleBusinessService.deleteByIdAndTenant(newModuleId,newTenantId);
+            //新关联
+            List<CourseModuleBusiness> moduleBusinessList = iCourseModuleBusinessService
+                    .list(new LambdaQueryWrapper<CourseModuleBusiness>()
+                            .eq(CourseModuleBusiness::getModuleId, oldModuleId));
+            if (CollectionUtils.isNotEmpty(moduleBusinessList)){
+                for (CourseModuleBusiness item : moduleBusinessList) {
+                    item.setId(null);
+                    item.setTenantId(newTenantId);
+                    item.setModuleId(newModuleId);
+                    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));
+                }
+                iCourseModuleBusinessService.saveBatch(moduleBusinessList);
+            }
+
+            //模块章
+            iCourseModuleChapterService.deleteByIdAndTenant(newModuleId,newTenantId);
+            List<CourseModuleChapter> moduleChapterList = iCourseModuleChapterService
+                    .list(new LambdaQueryWrapper<CourseModuleChapter>()
+                            .eq(CourseModuleChapter::getModuleId, oldModuleId));
+            if (CollectionUtils.isNotEmpty(moduleChapterList)){
+                for (CourseModuleChapter item : moduleChapterList) {
+                    item.setId(null);
+                    item.setModuleId(newModuleId);
+                    item.setTenantId(newTenantId);
+                    item.setChapterId(getNewChapterId(item.getChapterId(),newTenantId,array));
+                }
+                iCourseModuleChapterService.saveBatch(moduleChapterList);
+            }
+
+            //课程模块关联
+            List<CourseMenu> courseMenus = iCourseMenuService.selectByNotTenant(newCourseId,1,newModuleId,newTenantId);
+            if (CollectionUtils.isEmpty(courseMenus)){
+                List<CourseMenu> list = iCourseMenuService.list(new LambdaQueryWrapper<CourseMenu>()
+                        .eq(CourseMenu::getCourseId, oldCourseId)
+                        .eq(CourseMenu::getMenuId, oid)
+                        .eq(CourseMenu::getType, 1));
+                if (CollectionUtils.isNotEmpty(list)){
+                    for (CourseMenu item : list) {
+                        item.setId(null);
+                        item.setCourseId(newCourseId);
+                        item.setMenuId(newModuleId);
+                        item.setTenantId(newTenantId);
+                    }
+                    iCourseMenuService.saveBatch(list);
+                }
+            }
+
+            //课程模块试卷
+            iCourseMenuExamService.deleteModuleByIdTenant(newCourseId,newModuleId,newTenantId);
+            List<CourseMenuExam> examList = iCourseMenuExamService
+                    .list(new LambdaQueryWrapper<CourseMenuExam>()
+                    .eq(CourseMenuExam::getCourseId, oldCourseId)
+                    .eq(CourseMenuExam::getModuleId, oldModuleId));
+            if (CollectionUtils.isNotEmpty(examList)){
+                for (CourseMenuExam menuExam : examList) {
+                    if (ObjectUtils.isNotNull(menuExam.getChapterId()) || menuExam.getChapterId() != 0){
+                        Long newChapterId = getNewIdByTenant(menuExam.getChapterId(),GoodsCopyEnum.COURSE_CHAPTER.getType(),newTenantId);
+                        if (ObjectUtils.isNull(newChapterId)){
+                            continue;
+                        }
+                        menuExam.setChapterId(newChapterId);
+                    }
+                    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.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,array));
+                    menuExam.setTenantId(newTenantId);
+                }
+                iCourseMenuExamService.saveBatch(examList);
+            }
+        }
+
+    }
+
     private Long getNewChapterId(Long oldChapterId,Long newTenantId,List<SysGoodsCopyRecord> array){
     private Long getNewChapterId(Long oldChapterId,Long newTenantId,List<SysGoodsCopyRecord> array){
         CourseChapter chapter = iCourseChapterService.getById(oldChapterId);
         CourseChapter chapter = iCourseChapterService.getById(oldChapterId);
         if (ObjectUtils.isNotNull(chapter)){
         if (ObjectUtils.isNotNull(chapter)){
@@ -4394,7 +4494,64 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
 
 
     @Override
     @Override
     public boolean goodsNodeCopyAddTenant(GoodsNodeCopyTenantBo bo) {
     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 -> {
+                    Goods newGoods = getGoodsByTenantTwo(goods.getGoodsName(), goods.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newGoods)){
+                        throw new CustomException("该机构不存在此商品,请先复制商品!");
+                    }
+                    Long newGoodsId = newGoods.getGoodsId();
+                    //商品课程
+                    List<CourseMenuExam> newCourseMenuExamList = new ArrayList<>();
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    if (goods.getGoodsType() == 2){
+                        //题库商品
+                        disposeGoodsAttached(oldGoodsId,newGoodsId,newTenantId,recordList);
+                    }else {
+                        disposeGoodsCourse(oldGoodsId,newGoodsId,newTenantId,newCourseMenuExamList,recordList);
+                    }
 
 
+                    //处理商品试卷
+                    if (CollectionUtils.isNotEmpty(newCourseMenuExamList)){
+                        for (CourseMenuExam menuExam : newCourseMenuExamList) {
+                            menuExam.setExamId(getNewExamId(menuExam.getExamId(),newTenantId,recordList));
+                        }
+                        iCourseMenuExamService.saveBatch(newCourseMenuExamList);
+                    }
+                });
+                break;
+            case 2://模块复制
+                Course course = iCourseService.getById(bo.getCourseId());
+                bo.getTenantId().forEach(newTenantId -> {
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    Long  newCourseId = iCourseService.getCourseByTenantTwo(course.getCourseName(), course.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newCourseId)){
+                        throw new CustomException("该机构不存在此商品课程,请先复制商品课程!");
+                    }
+                    disposeModule(bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
+                });
+                break;
+            case 3://章复制
+                Course courseTwo = iCourseService.getById(bo.getCourseId());
+                bo.getTenantId().forEach(newTenantId -> {
+                    List<SysGoodsCopyRecord> recordList = new ArrayList<>();
+                    Long newCourseId = iCourseService.getCourseByTenantTwo(courseTwo.getCourseName(), courseTwo.getCode(), newTenantId);
+                    if (ObjectUtils.isNull(newCourseId)){
+                        throw new CustomException("该机构不存在此商品课程,请先复制商品课程!");
+                    }
+//                    disposeModule(bo.getModelId(),newTenantId,bo.getCourseId(),newCourseId,recordList);
+                });
+                break;
+
+
+        }
 
 
         return false;
         return false;
     }
     }

+ 7 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java

@@ -2018,7 +2018,13 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             //新云学堂C端
             //新云学堂C端
             User user = userService.getById(orderVo.getUserId());
             User user = userService.getById(orderVo.getUserId());
             vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(), user.getRealname()));
             vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(), user.getRealname()));
-        } else {
+        }else if (orderVo.getOrderFrom() == 2){
+            vo.setPayType(orderVo.getPayType());
+            List<TopOldOrderGoods> list = topOrderGoodsService
+                    .list(new LambdaQueryWrapper<TopOldOrderGoods>()
+                    .eq(TopOldOrderGoods::getOrderSn, orderVo.getOrderSn()));
+            vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(),list.get(0).getUserName()));
+        }else {
             vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(), orderVo.getCreateUsername()));
             vo.setApplyName(String.format("%s(%s)", tenant.getTenantName(), orderVo.getCreateUsername()));
         }
         }
         vo.setCheckType(1);
         vo.setCheckType(1);

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

@@ -49,4 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         delete from course_menu_exam where course_id = #{newCourseId} and tenant_id = #{newTenantId}
         delete from course_menu_exam where course_id = #{newCourseId} and tenant_id = #{newTenantId}
     </delete>
     </delete>
 
 
+    <delete id="deleteModuleByIdTenant" parameterType="map">
+        delete from course_menu_exam where course_id = #{newCourseId} and module_id = #{newModuleId} and tenant_id = #{newTenantId}
+    </delete>
+
 </mapper>
 </mapper>

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMenuMapper.xml

@@ -368,4 +368,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and usr.course_id=#{courseId}
             and usr.course_id=#{courseId}
             AND usr.current_status =1
             AND usr.current_status =1
     </select>
     </select>
+
+    <select id="selectByNotTenant" parameterType="map"  resultType="com.zhongzheng.modules.course.domain.CourseMenu">
+        SELECT * FROM `course_menu` WHERE course_id = #{newCourseId} AND menu_id = #{newModuleId} AND type = #{type} AND tenant_id = #{newTenantId}
+    </select>
 </mapper>
 </mapper>