yangdamao 1 неделя назад
Родитель
Сommit
89e55f2464

+ 29 - 27
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -192,8 +192,8 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     private String liveGotoURL;
     @Value("${oldSys.goods}")
     private String OLD_GOODS;
-    @Value("${record.downloadPath}")
-    private String RECORD_DOWNLOAD;
+//    @Value("${record.downloadPath}")
+//    private String RECORD_DOWNLOAD;
 //    @Value("${oldSys.userInfo}")
     private String OLD_USERINFO;
 
@@ -2162,31 +2162,33 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
 
     @Override
     public String userDataDownload(UserDownloadBo bo) {
-        if (CollectionUtils.isEmpty(bo.getUserIds())){
-            return null;
-        }
-        //创建学员资料下载
-        SysTask task = new SysTask();
-        task.setTaskName(String.format("<%s>下载:操作人ID(%s),时间:%s",getTaskName(bo.getTypes().get(0)),bo.getCreateSysUserId(),DateUtils.getTime()));
-        String code = ServletUtils.getEncoded("DA");
-        bo.setTaskCode(code);
-        task.setTaskCode(code);
-        task.setTaskNum(1);
-        task.setFinishNum(0);
-        task.setTaskStatus(1);
-        task.setTaskType(2);
-        task.setTaskParam(JSONObject.toJSONString(bo));
-        task.setSysUserId(bo.getCreateSysUserId());
-        task.setStatus(1);
-        task.setCreateTime(DateUtils.getNowTime());
-        task.setUpdateTime(DateUtils.getNowTime());
-        iSysTaskService.save(task);
-        //发送下载请求
-        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
-        HashMap<String, String> map = new HashMap<>();
-        map.put("TenantId", tenantId);
-        String s = HttpUtils.sendPostJsonHeader(RECORD_DOWNLOAD, JSONObject.toJSONString(bo), map);
-        return JSONObject.parseObject(s).get("msg").toString();
+//        if (CollectionUtils.isEmpty(bo.getUserIds())){
+//            return null;
+//        }
+//        //创建学员资料下载
+//        SysTask task = new SysTask();
+//        task.setTaskName(String.format("<%s>下载:操作人ID(%s),时间:%s",getTaskName(bo.getTypes().get(0)),bo.getCreateSysUserId(),DateUtils.getTime()));
+//        String code = ServletUtils.getEncoded("DA");
+//        bo.setTaskCode(code);
+//        task.setTaskCode(code);
+//        task.setTaskNum(1);
+//        task.setFinishNum(0);
+//        task.setTaskStatus(1);
+//        task.setTaskType(2);
+//        task.setTaskParam(JSONObject.toJSONString(bo));
+//        task.setSysUserId(bo.getCreateSysUserId());
+//        task.setStatus(1);
+//        task.setCreateTime(DateUtils.getNowTime());
+//        task.setUpdateTime(DateUtils.getNowTime());
+//        iSysTaskService.save(task);
+//        //发送下载请求
+//        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+//        HashMap<String, String> map = new HashMap<>();
+//        map.put("TenantId", tenantId);
+//        String s = HttpUtils.sendPostJsonHeader(RECORD_DOWNLOAD, JSONObject.toJSONString(bo), map);
+//        return JSONObject.parseObject(s).get("msg").toString();
+
+        return null;
     }
 
     @Override

+ 481 - 481
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java

@@ -181,11 +181,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Value("${oldSys.questionDetail}")
     private String QUESTION_DETAIL;
 
-    @Value("${exam.question}")
-    private String EXAM_QUESTION;
-
-    @Value("${exam.questionDetail}")
-    private String EXAM_QUESTION_DETAIL;
+//    @Value("${exam.question}")
+//    private String EXAM_QUESTION;
+//
+//    @Value("${exam.questionDetail}")
+//    private String EXAM_QUESTION_DETAIL;
 
     @Value("${aliyun.oss.endpoint}")
     private String OSS_PREFIX;
@@ -3766,482 +3766,482 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Override
     @Transactional
     public void questionImport() {
-        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
-        HashMap<String, String> map = new HashMap<>();
-        map.put("TenantId", tenantId);
-        String respone = HttpUtils.sendPostJsonHeader(EXAM_QUESTION, "",map);
-        JSONObject jsonObject1 = JSONObject.parseObject(respone);
-        List<ExternalQuestionVo> questionVos = JSONArray.parseArray(jsonObject1.get("data").toString(), ExternalQuestionVo.class);
-        //考前培训
-        CourseEducationType educationType = iCourseEducationTypeService
-                .getOne(new LambdaQueryWrapper<CourseEducationType>()
-                .eq(CourseEducationType::getEducationName, "考前培训")
-                .eq(CourseEducationType::getStatus, 1)
-                .last("limit 1"));
-
-        //施工现场人员
-        CourseProjectType projectType = iCourseProjectTypeService
-                .getOne(new LambdaQueryWrapper<CourseProjectType>()
-                .eq(CourseProjectType::getProjectName, "施工现场专业人员")
-                .eq(CourseProjectType::getEducationId, educationType.getId())
-                .eq(CourseProjectType::getStatus, 1)
-                .last("limit 1"));
-
-        //七大员
-        CourseBusiness business = iCourseBusinessService
-                .getOne(new LambdaQueryWrapper<CourseBusiness>()
-                .eq(CourseBusiness::getBusinessName, "七大员")
-                .eq(CourseBusiness::getProjectId, projectType.getId())
-                .eq(CourseBusiness::getStatus, 1)
-                .last("limit 1"));
-
-        //专业
-        List<MajorProject> list = iMajorProjectService
-                .list(new LambdaQueryWrapper<MajorProject>()
-                .eq(MajorProject::getProjectId, projectType.getId()));
-        List<Major> majorList = iMajorService.listByIds(list.stream().map(MajorProject::getMajorId).collect(Collectors.toList()));
-
-        //科目
-        List<CourseSubjectProject> list1 = iCourseSubjectProjectService
-                .list(new LambdaQueryWrapper<CourseSubjectProject>()
-                .eq(CourseSubjectProject::getProjectId, projectType.getId()));
-        List<CourseSubject> subjectList = iCourseSubjectService.listByIds(list1.stream().map(CourseSubjectProject::getSubjectId).collect(Collectors.toList()));
-
-
-        //七大员新考题库商品
-        List<ExternalQuestionVo> collect = questionVos.stream().filter(x -> x.getParentId() == 1)
-                .sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber))
-                .collect(Collectors.toList());
-        for (ExternalQuestionVo item : collect) {
-            //专业顺序
-
-            //劳务员考核评价大纲及习题集
-            //施工员考核评价大纲及习题集(土建方向)
-            //施工员考核评价大纲及习题集(市政方向)
-            //施工员考核评价大纲及习题集(装饰方向)
-            //施工员考核评价大纲及习题集(设备方向)
-            //机械员考核评价大纲及习题集
-            //材料员考核评价大纲及习题集
-            //标准员考核评价大纲及习题集
-            //质量员考核评价大纲及习题集(土建方向)
-            //质量员考核评价大纲及习题集(市政方向)
-            //质量员考核评价大纲及习题集(装饰方向)
-            //质量员考核评价大纲及习题集(设备方向)
-            //资料员考核评价大纲及习题集
-            Major major = majorList.stream().filter(x -> x.getCategoryName().equals(item.getTopicNoteTypeNum())).findFirst().orElse(null);
-            Long majorId = 0L;
-            if (ObjectUtils.isNotNull(major)){
-                majorId = major.getId();
-            }
-
-            //科目
-            CourseSubject courseSubject = subjectList.stream().filter(x -> x.getSubjectName().equals(item.getTopicNoteTypeNum())).findFirst().orElse(null);
-            Long subjectId = 0L;
-            if (ObjectUtils.isNotNull(courseSubject)){
-                subjectId = courseSubject.getId();
-            }
-
-            //创建商品
-            Goods goods = new Goods();
-            goods.setGoodsName(item.getName());
-            goods.setYear(2023L);
-            goods.setSupplyId(2L);
-            goods.setCode(ServletUtils.getEncoded("SP"));
-            goods.setGoodsType(2);
-            goods.setEducationTypeId(educationType.getId());
-            goods.setBusinessId(business.getId());
-            goods.setProjectId(projectType.getId().intValue());
-            goods.setStandPrice(new BigDecimal("150.00"));
-            goods.setLowestPrice(new BigDecimal("150.00"));
-            goods.setCreateTime(DateUtils.getNowTime());
-            goods.setUpdateTime(DateUtils.getNowTime());
-            goods.setStatus(1);
-            goods.setGoodsStatus(0);
-            goods.setMajorId(majorId);
-            goods.setSubjectIds(subjectId.toString());
-            iGoodsService.save(goods);
-
-            String upStr1 = "web/Uploads/qdytopic/";
-            //题库
-            List<ExternalQuestionVo> questionVos1 = questionVos.stream()
-                    .filter(x -> x.getParentId().equals(item.getMeasureModelId())).sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber)).collect(Collectors.toList());
-            if (CollectionUtils.isNotEmpty(questionVos1)){
-                for (ExternalQuestionVo item1 : questionVos1) {
-                    //模块卷
-                    QuestionModule module = new QuestionModule();
-                    module.setCode(ServletUtils.getEncoded("MJ"));
-                    module.setModuleName(item1.getName());
-                    module.setPublishStatus(1L);
-                    module.setStatus(1);
-                    module.setCreateTime(DateUtils.getNowTime());
-                    module.setUpdateTime(DateUtils.getNowTime());
-                    iQuestionModuleService.save(module);
-                    //模块卷业务层
-                    QuestionBusiness questionBusiness = new QuestionBusiness();
-                    questionBusiness.setEducationTypeId(educationType.getId());
-                    questionBusiness.setBusinessId(business.getId());
-                    questionBusiness.setProjectId(projectType.getId());
-                    questionBusiness.setMajorId(module.getModuleExamId());
-                    questionBusiness.setType(4);
-                    questionBusiness.setSubjectId(subjectId);
-                    iQuestionBusinessService.save(questionBusiness);
-                    //题库模块关联
-                    GoodsAttached goodsAttached = new GoodsAttached();
-                    goodsAttached.setGoodsId(goods.getGoodsId());
-                    goodsAttached.setMajorId(module.getModuleExamId());
-                    goodsAttached.setType(1);
-                    goodsAttached.setCreateTime(DateUtils.getNowTime());
-                    goodsAttached.setUpdateTime(DateUtils.getNowTime());
-                    iGoodsAttachedService.save(goodsAttached);
-
-                    //章卷
-                    List<ExternalQuestionVo> questionVos2 = questionVos.stream()
-                            .filter(x -> x.getParentId().equals(item1.getMeasureModelId()))
-                            .sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber)).collect(Collectors.toList());
-                    for (ExternalQuestionVo item2 : questionVos2) {
-                        QuestionChapter questionChapter = new QuestionChapter();
-                        questionChapter.setName(item2.getName());
-                        questionChapter.setStatus(1);
-                        questionChapter.setCreateTime(DateUtils.getNowTime());
-                        questionChapter.setUpdateTime(DateUtils.getNowTime());
-                        questionChapter.setPublishStatus(1L);
-                        questionChapter.setCode(ServletUtils.getEncoded("ZJ"));
-                        iQuestionChapterService.save(questionChapter);
-
-                        //章卷业务
-                        QuestionBusiness questionBusiness1 = new QuestionBusiness();
-                        questionBusiness1.setEducationTypeId(educationType.getId());
-                        questionBusiness1.setBusinessId(business.getId());
-                        questionBusiness1.setProjectId(projectType.getId());
-                        questionBusiness1.setMajorId(questionChapter.getChapterExamId());
-                        questionBusiness1.setType(3);
-                        questionBusiness1.setSubjectId(subjectId);
-                        iQuestionBusinessService.save(questionBusiness1);
-
-                        //模块章卷关联
-                        QuestionModuleChapter moduleChapter = new QuestionModuleChapter();
-                        moduleChapter.setModuleExamId(module.getModuleExamId());
-                        moduleChapter.setChapterExamId(questionChapter.getChapterExamId());
-                        moduleChapter.setSort(item2.getSortNumber().longValue());
-                        iQuestionModuleChapterService.save(moduleChapter);
-
-                        if (ObjectUtils.isNotNull(item2.getIsTopic()) && item2.getIsTopic()){
-                            //获取题目内容
-                            String topParam = String.format("MeasureModelId=%s",item2.getMeasureModelId());
-                            log.error(topParam);
-                            String respone2 = HttpUtils.sendPostJsonHeader(EXAM_QUESTION_DETAIL, topParam,map);
-                            JSONObject jsonObject = JSONObject.parseObject(respone2);
-                            log.error(respone2);
-                            List<ExternalQuestionDetailVo> questionDetailVos = JSONArray.parseArray(jsonObject.get("data").toString(), ExternalQuestionDetailVo.class);
-
-                            if (CollectionUtils.isNotEmpty(questionDetailVos)){
-                                //处理图片
-                                handlePhoto(questionDetailVos);
-                                //创建试卷
-                                Exam exam = new Exam();
-                                exam.setCode(ServletUtils.getEncoded("SJ"));
-                                exam.setStatus(1);
-                                exam.setCreateTime(DateUtils.getNowTime());
-                                exam.setUpdateTime(DateUtils.getNowTime());
-                                exam.setExamName(item2.getName() + "测试卷");
-                                exam.setPublishStatus(1L);
-                                exam.setDoType(1);
-                                //试卷类型
-                                ExamPaper paper = iExamPaperService.getOne(new LambdaQueryWrapper<ExamPaper>()
-                                        .eq(ExamPaper::getPaperName, "普通练习")
-                                        .eq(ExamPaper::getStatus, 1)
-                                        .last("limit 1"));
-                                if (ObjectUtils.isNotNull(paper)){
-                                    exam.setExamPaperId(paper.getPaperId());
-                                }
-                                iExamService.save(exam);
-                                //试卷业务
-                                QuestionBusiness questionBusiness2 = new QuestionBusiness();
-                                questionBusiness2.setEducationTypeId(educationType.getId());
-                                questionBusiness2.setBusinessId(business.getId());
-                                questionBusiness2.setProjectId(projectType.getId());
-                                questionBusiness2.setMajorId(exam.getExamId());
-                                questionBusiness2.setType(2);
-                                questionBusiness2.setSubjectId(subjectId);
-                                iQuestionBusinessService.save(questionBusiness2);
-
-                                //章卷关联
-                                QuestionChapterExam chapterExam = new QuestionChapterExam();
-                                chapterExam.setChapterExamId(questionChapter.getChapterExamId());
-                                chapterExam.setExamId(exam.getExamId());
-                                chapterExam.setSort(item2.getSortNumber().longValue());
-                                iQuestionChapterExamService.save(chapterExam);
-                                for (ExternalQuestionDetailVo detailVo : questionDetailVos) {
-                                        switch (detailVo.getTopicType()){
-                                            case 1://单选题
-                                                Question question = new Question();
-                                                question.setContent(detailVo.getTitle());
-                                                question.setType(1);
-                                                question.setStatus(1);
-                                                question.setCreateTime(DateUtils.getNowTime());
-                                                question.setUpdateTime(DateUtils.getNowTime());
-                                                question.setAnalysisContent(detailVo.getDescription());
-                                                question.setPublishStatus(1);
-                                                question.setCode(ServletUtils.getEncoded("TM"));
-                                                question.setCreateBy("(系统)外部题库导入");
-                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
-                                                    List<QuestionDetailVo> detail = new ArrayList<>();
-                                                    Integer index = 0;
-                                                    for (int i = 0; i < detailVo.getChildList().size(); i++) {
-                                                        ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
-                                                        QuestionDetailVo questionDetailVo = new QuestionDetailVo();
-                                                        if (childVo.getOptionTitle().contains(upStr1)){
-                                                            questionDetailVo.setImgUrl(getImgUrl(childVo.getOptionTitle()));
-                                                            questionDetailVo.setContent("如图所示");
-                                                        }else {
-                                                            questionDetailVo.setContent(childVo.getOptionTitle());
-                                                        }
-                                                        questionDetailVo.setOptionsId(i +1);
-                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                            index = i + 1;
-                                                        }
-                                                        detail.add(questionDetailVo);
-                                                    }
-                                                    String s = JSONArray.toJSONString(detail);
-                                                    question.setAnswerQuestion(index.toString());
-                                                    question.setJsonStr(s);
-                                                }
-                                                save(question);
-                                                //题目业务
-                                                QuestionBusiness questionBusiness3 = new QuestionBusiness();
-                                                questionBusiness3.setEducationTypeId(educationType.getId());
-                                                questionBusiness3.setBusinessId(business.getId());
-                                                questionBusiness3.setProjectId(projectType.getId());
-                                                questionBusiness3.setMajorId(question.getQuestionId());
-                                                questionBusiness3.setType(1);
-                                                questionBusiness3.setSubjectId(subjectId);
-                                                iQuestionBusinessService.save(questionBusiness3);
-
-                                                //试卷题目关联
-                                                ExamQuestion examQuestion = new ExamQuestion();
-                                                examQuestion.setExamId(exam.getExamId());
-                                                examQuestion.setQuestionId(question.getQuestionId());
-                                                examQuestion.setSort(detailVo.getSortNumber());
-                                                examQuestion.setScore(BigDecimal.ZERO);
-                                                examQuestion.setPartScore(BigDecimal.ZERO);
-                                                iExamQuestionService.save(examQuestion);
-                                                break;
-                                            case 2://多选题
-                                                Question question1 = new Question();
-                                                question1.setContent(detailVo.getTitle());
-                                                question1.setType(2);
-                                                question1.setStatus(1);
-                                                question1.setCreateTime(DateUtils.getNowTime());
-                                                question1.setUpdateTime(DateUtils.getNowTime());
-                                                question1.setAnalysisContent(detailVo.getDescription());
-                                                question1.setPublishStatus(1);
-                                                question1.setCode(ServletUtils.getEncoded("TM"));
-                                                question1.setCreateBy("(系统)外部题库导入");
-                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
-                                                    List<QuestionDetailVo> detail = new ArrayList<>();
-                                                    List<String> index = new ArrayList<>();
-                                                    for (int i = 0; i < detailVo.getChildList().size(); i++) {
-                                                        ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
-                                                        QuestionDetailVo questionDetailVo = new QuestionDetailVo();
-                                                        if (childVo.getOptionTitle().contains(upStr1)){
-                                                            questionDetailVo.setImgUrl(getImgUrl(childVo.getOptionTitle()));
-                                                            questionDetailVo.setContent("如图所示");
-                                                        }else {
-                                                            questionDetailVo.setContent(childVo.getOptionTitle());
-                                                        }
-                                                        questionDetailVo.setOptionsId(i + 1);
-                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                            Integer x = i + 1;
-                                                            index.add(x +"");
-                                                        }
-                                                        detail.add(questionDetailVo);
-                                                    }
-                                                    String s = JSONArray.toJSONString(detail);
-                                                    question1.setAnswerQuestion(index.stream().collect(Collectors.joining(",")));
-                                                    question1.setJsonStr(s);
-                                                }
-                                                save(question1);
-                                                //题目业务
-                                                QuestionBusiness questionBusiness4 = new QuestionBusiness();
-                                                questionBusiness4.setEducationTypeId(educationType.getId());
-                                                questionBusiness4.setBusinessId(business.getId());
-                                                questionBusiness4.setProjectId(projectType.getId());
-                                                questionBusiness4.setMajorId(question1.getQuestionId());
-                                                questionBusiness4.setType(1);
-                                                questionBusiness4.setSubjectId(subjectId);
-                                                iQuestionBusinessService.save(questionBusiness4);
-
-                                                //试卷题目关联
-                                                ExamQuestion examQuestion1 = new ExamQuestion();
-                                                examQuestion1.setExamId(exam.getExamId());
-                                                examQuestion1.setQuestionId(question1.getQuestionId());
-                                                examQuestion1.setSort(detailVo.getSortNumber());
-                                                examQuestion1.setScore(BigDecimal.ZERO);
-                                                examQuestion1.setPartScore(BigDecimal.ZERO);
-                                                iExamQuestionService.save(examQuestion1);
-                                                break;
-                                            case 4://判断题
-                                                Question question2 = new Question();
-                                                question2.setContent(detailVo.getTitle());
-                                                question2.setType(3);
-                                                question2.setStatus(1);
-                                                question2.setCreateTime(DateUtils.getNowTime());
-                                                question2.setUpdateTime(DateUtils.getNowTime());
-                                                question2.setAnalysisContent(detailVo.getDescription());
-                                                question2.setPublishStatus(1);
-                                                question2.setCode(ServletUtils.getEncoded("TM"));
-                                                question2.setCreateBy("(系统)外部题库导入");
-                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
-                                                    ExternalQuestionChildVo childVo = detailVo.getChildList().stream().filter(x -> ObjectUtils.isNotNull(x.getIsAnswer()) && x.getIsAnswer()).findFirst().orElse(null);
-                                                    if (ObjectUtils.isNotNull(childVo)){
-                                                        if ("正确".equals(childVo.getOptionTitle())){
-                                                            question2.setAnswerQuestion("1");
-                                                        }else {
-                                                            question2.setAnswerQuestion("0");
-                                                        }
-                                                    }
-                                                }
-                                                save(question2);
-                                                //题目业务
-                                                QuestionBusiness questionBusiness5 = new QuestionBusiness();
-                                                questionBusiness5.setEducationTypeId(educationType.getId());
-                                                questionBusiness5.setBusinessId(business.getId());
-                                                questionBusiness5.setProjectId(projectType.getId());
-                                                questionBusiness5.setMajorId(question2.getQuestionId());
-                                                questionBusiness5.setType(1);
-                                                questionBusiness5.setSubjectId(subjectId);
-                                                iQuestionBusinessService.save(questionBusiness5);
-
-                                                //试卷题目关联
-                                                ExamQuestion examQuestion2 = new ExamQuestion();
-                                                examQuestion2.setExamId(exam.getExamId());
-                                                examQuestion2.setQuestionId(question2.getQuestionId());
-                                                examQuestion2.setSort(detailVo.getSortNumber());
-                                                examQuestion2.setScore(BigDecimal.ZERO);
-                                                examQuestion2.setPartScore(BigDecimal.ZERO);
-                                                iExamQuestionService.save(examQuestion2);
-                                                break;
-                                            case 5://案例题
-                                                Question question3 = new Question();
-                                                question3.setContent(detailVo.getTitle());
-                                                question3.setType(4);
-                                                question3.setStatus(1);
-                                                question3.setCreateTime(DateUtils.getNowTime());
-                                                question3.setUpdateTime(DateUtils.getNowTime());
-                                                question3.setPublishStatus(1);
-                                                question3.setCode(ServletUtils.getEncoded("TM"));
-                                                question3.setCreateBy("(系统)外部题库导入");
-                                                if (CollectionUtils.isNotEmpty(detailVo.getChildTopicLict())){
-                                                    List<QuestionInfoVo> infoVoList = new ArrayList<>();
-                                                    for (ExternalQuestionChildTopicVo topicVo : detailVo.getChildTopicLict()) {
-                                                        switch (topicVo.getTopicType()){
-                                                            case 1://单选
-                                                                QuestionInfoVo infoVo = new QuestionInfoVo();
-                                                                infoVo.setContent(topicVo.getTitle());
-                                                                infoVo.setAnalysisContent(topicVo.getDescription());
-                                                                infoVo.setType(1);
-                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
-                                                                    List<QuestionDetailVo> voList = new ArrayList<>();
-                                                                    Integer index = 0;
-                                                                    for (int i = 0; i < topicVo.getChildList().size(); i++) {
-                                                                        ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
-                                                                        QuestionDetailVo detailVo1 = new QuestionDetailVo();
-                                                                        detailVo1.setOptionsId(i + 1);
-                                                                        if (childVo.getOptionTitle().contains(upStr1)){
-                                                                            detailVo1.setImgUrl(getImgUrl(childVo.getOptionTitle()));
-                                                                            detailVo1.setContent("如图所示");
-                                                                        }else {
-                                                                            detailVo1.setContent(childVo.getOptionTitle());
-                                                                        }
-                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                                            index = i + 1;
-                                                                        }
-                                                                        voList.add(detailVo1);
-                                                                    }
-                                                                    infoVo.setAnswerQuestion(index.toString());
-                                                                    infoVo.setOptionsList(voList);
-                                                                }
-                                                                infoVoList.add(infoVo);
-                                                                break;
-                                                            case 2://多选
-                                                                QuestionInfoVo infoVo1 = new QuestionInfoVo();
-                                                                infoVo1.setContent(topicVo.getTitle());
-                                                                infoVo1.setAnalysisContent(topicVo.getDescription());
-                                                                infoVo1.setType(2);
-                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
-                                                                    List<QuestionDetailVo> voList = new ArrayList<>();
-                                                                    List<String> indexList = new ArrayList<>();
-                                                                    for (int i = 0; i < topicVo.getChildList().size(); i++) {
-                                                                        ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
-                                                                        QuestionDetailVo detailVo1 = new QuestionDetailVo();
-                                                                        detailVo1.setOptionsId(i + 1);
-                                                                        if (childVo.getOptionTitle().contains(upStr1)){
-                                                                            detailVo1.setImgUrl(getImgUrl(childVo.getOptionTitle()));
-                                                                            detailVo1.setContent("如图所示");
-                                                                        }else {
-                                                                            detailVo1.setContent(childVo.getOptionTitle());
-                                                                        }
-                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                                            Integer x = i + 1 ;
-                                                                            indexList.add(x+"");
-                                                                        }
-                                                                        voList.add(detailVo1);
-                                                                    }
-                                                                    infoVo1.setAnswerQuestion(indexList.stream().collect(Collectors.joining(",")));
-                                                                    infoVo1.setOptionsList(voList);
-                                                                }
-                                                                infoVoList.add(infoVo1);
-                                                                break;
-                                                            case 4://判断题
-                                                                QuestionInfoVo infoVo2 = new QuestionInfoVo();
-                                                                infoVo2.setContent(topicVo.getTitle());
-                                                                infoVo2.setAnalysisContent(topicVo.getDescription());
-                                                                infoVo2.setType(3);
-                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
-                                                                    ExternalQuestionChildVo childVo = topicVo.getChildList().stream().filter(x -> ObjectUtils.isNotNull(x.getIsAnswer()) && x.getIsAnswer()).findFirst().orElse(null);
-                                                                    if (ObjectUtils.isNotNull(childVo)){
-                                                                        if ("正确".equals(childVo.getOptionTitle())){
-                                                                            infoVo2.setAnswerQuestion("1");
-                                                                        }else {
-                                                                            infoVo2.setAnswerQuestion("0");
-                                                                        }
-                                                                    }
-                                                                }
-                                                                infoVoList.add(infoVo2);
-                                                                break;
-                                                        }
-
-                                                    }
-                                                    question3.setJsonStr(JSONArray.toJSONString(infoVoList));
-                                                }
-                                                save(question3);
-                                                //题目业务
-                                                QuestionBusiness questionBusiness6 = new QuestionBusiness();
-                                                questionBusiness6.setEducationTypeId(educationType.getId());
-                                                questionBusiness6.setBusinessId(business.getId());
-                                                questionBusiness6.setProjectId(projectType.getId());
-                                                questionBusiness6.setMajorId(question3.getQuestionId());
-                                                questionBusiness6.setType(1);
-                                                questionBusiness6.setSubjectId(subjectId);
-                                                iQuestionBusinessService.save(questionBusiness6);
-
-                                                //试卷题目关联
-                                                ExamQuestion examQuestion3 = new ExamQuestion();
-                                                examQuestion3.setExamId(exam.getExamId());
-                                                examQuestion3.setQuestionId(question3.getQuestionId());
-                                                examQuestion3.setSort(detailVo.getSortNumber());
-                                                examQuestion3.setScore(BigDecimal.ZERO);
-                                                examQuestion3.setPartScore(BigDecimal.ZERO);
-                                                iExamQuestionService.save(examQuestion3);
-                                                break;
-                                        }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
-        }
+//        String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+//        HashMap<String, String> map = new HashMap<>();
+//        map.put("TenantId", tenantId);
+//        String respone = HttpUtils.sendPostJsonHeader(EXAM_QUESTION, "",map);
+//        JSONObject jsonObject1 = JSONObject.parseObject(respone);
+//        List<ExternalQuestionVo> questionVos = JSONArray.parseArray(jsonObject1.get("data").toString(), ExternalQuestionVo.class);
+//        //考前培训
+//        CourseEducationType educationType = iCourseEducationTypeService
+//                .getOne(new LambdaQueryWrapper<CourseEducationType>()
+//                .eq(CourseEducationType::getEducationName, "考前培训")
+//                .eq(CourseEducationType::getStatus, 1)
+//                .last("limit 1"));
+//
+//        //施工现场人员
+//        CourseProjectType projectType = iCourseProjectTypeService
+//                .getOne(new LambdaQueryWrapper<CourseProjectType>()
+//                .eq(CourseProjectType::getProjectName, "施工现场专业人员")
+//                .eq(CourseProjectType::getEducationId, educationType.getId())
+//                .eq(CourseProjectType::getStatus, 1)
+//                .last("limit 1"));
+//
+//        //七大员
+//        CourseBusiness business = iCourseBusinessService
+//                .getOne(new LambdaQueryWrapper<CourseBusiness>()
+//                .eq(CourseBusiness::getBusinessName, "七大员")
+//                .eq(CourseBusiness::getProjectId, projectType.getId())
+//                .eq(CourseBusiness::getStatus, 1)
+//                .last("limit 1"));
+//
+//        //专业
+//        List<MajorProject> list = iMajorProjectService
+//                .list(new LambdaQueryWrapper<MajorProject>()
+//                .eq(MajorProject::getProjectId, projectType.getId()));
+//        List<Major> majorList = iMajorService.listByIds(list.stream().map(MajorProject::getMajorId).collect(Collectors.toList()));
+//
+//        //科目
+//        List<CourseSubjectProject> list1 = iCourseSubjectProjectService
+//                .list(new LambdaQueryWrapper<CourseSubjectProject>()
+//                .eq(CourseSubjectProject::getProjectId, projectType.getId()));
+//        List<CourseSubject> subjectList = iCourseSubjectService.listByIds(list1.stream().map(CourseSubjectProject::getSubjectId).collect(Collectors.toList()));
+//
+//
+//        //七大员新考题库商品
+//        List<ExternalQuestionVo> collect = questionVos.stream().filter(x -> x.getParentId() == 1)
+//                .sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber))
+//                .collect(Collectors.toList());
+//        for (ExternalQuestionVo item : collect) {
+//            //专业顺序
+//
+//            //劳务员考核评价大纲及习题集
+//            //施工员考核评价大纲及习题集(土建方向)
+//            //施工员考核评价大纲及习题集(市政方向)
+//            //施工员考核评价大纲及习题集(装饰方向)
+//            //施工员考核评价大纲及习题集(设备方向)
+//            //机械员考核评价大纲及习题集
+//            //材料员考核评价大纲及习题集
+//            //标准员考核评价大纲及习题集
+//            //质量员考核评价大纲及习题集(土建方向)
+//            //质量员考核评价大纲及习题集(市政方向)
+//            //质量员考核评价大纲及习题集(装饰方向)
+//            //质量员考核评价大纲及习题集(设备方向)
+//            //资料员考核评价大纲及习题集
+//            Major major = majorList.stream().filter(x -> x.getCategoryName().equals(item.getTopicNoteTypeNum())).findFirst().orElse(null);
+//            Long majorId = 0L;
+//            if (ObjectUtils.isNotNull(major)){
+//                majorId = major.getId();
+//            }
+//
+//            //科目
+//            CourseSubject courseSubject = subjectList.stream().filter(x -> x.getSubjectName().equals(item.getTopicNoteTypeNum())).findFirst().orElse(null);
+//            Long subjectId = 0L;
+//            if (ObjectUtils.isNotNull(courseSubject)){
+//                subjectId = courseSubject.getId();
+//            }
+//
+//            //创建商品
+//            Goods goods = new Goods();
+//            goods.setGoodsName(item.getName());
+//            goods.setYear(2023L);
+//            goods.setSupplyId(2L);
+//            goods.setCode(ServletUtils.getEncoded("SP"));
+//            goods.setGoodsType(2);
+//            goods.setEducationTypeId(educationType.getId());
+//            goods.setBusinessId(business.getId());
+//            goods.setProjectId(projectType.getId().intValue());
+//            goods.setStandPrice(new BigDecimal("150.00"));
+//            goods.setLowestPrice(new BigDecimal("150.00"));
+//            goods.setCreateTime(DateUtils.getNowTime());
+//            goods.setUpdateTime(DateUtils.getNowTime());
+//            goods.setStatus(1);
+//            goods.setGoodsStatus(0);
+//            goods.setMajorId(majorId);
+//            goods.setSubjectIds(subjectId.toString());
+//            iGoodsService.save(goods);
+//
+//            String upStr1 = "web/Uploads/qdytopic/";
+//            //题库
+//            List<ExternalQuestionVo> questionVos1 = questionVos.stream()
+//                    .filter(x -> x.getParentId().equals(item.getMeasureModelId())).sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber)).collect(Collectors.toList());
+//            if (CollectionUtils.isNotEmpty(questionVos1)){
+//                for (ExternalQuestionVo item1 : questionVos1) {
+//                    //模块卷
+//                    QuestionModule module = new QuestionModule();
+//                    module.setCode(ServletUtils.getEncoded("MJ"));
+//                    module.setModuleName(item1.getName());
+//                    module.setPublishStatus(1L);
+//                    module.setStatus(1);
+//                    module.setCreateTime(DateUtils.getNowTime());
+//                    module.setUpdateTime(DateUtils.getNowTime());
+//                    iQuestionModuleService.save(module);
+//                    //模块卷业务层
+//                    QuestionBusiness questionBusiness = new QuestionBusiness();
+//                    questionBusiness.setEducationTypeId(educationType.getId());
+//                    questionBusiness.setBusinessId(business.getId());
+//                    questionBusiness.setProjectId(projectType.getId());
+//                    questionBusiness.setMajorId(module.getModuleExamId());
+//                    questionBusiness.setType(4);
+//                    questionBusiness.setSubjectId(subjectId);
+//                    iQuestionBusinessService.save(questionBusiness);
+//                    //题库模块关联
+//                    GoodsAttached goodsAttached = new GoodsAttached();
+//                    goodsAttached.setGoodsId(goods.getGoodsId());
+//                    goodsAttached.setMajorId(module.getModuleExamId());
+//                    goodsAttached.setType(1);
+//                    goodsAttached.setCreateTime(DateUtils.getNowTime());
+//                    goodsAttached.setUpdateTime(DateUtils.getNowTime());
+//                    iGoodsAttachedService.save(goodsAttached);
+//
+//                    //章卷
+//                    List<ExternalQuestionVo> questionVos2 = questionVos.stream()
+//                            .filter(x -> x.getParentId().equals(item1.getMeasureModelId()))
+//                            .sorted(Comparator.comparing(ExternalQuestionVo::getSortNumber)).collect(Collectors.toList());
+//                    for (ExternalQuestionVo item2 : questionVos2) {
+//                        QuestionChapter questionChapter = new QuestionChapter();
+//                        questionChapter.setName(item2.getName());
+//                        questionChapter.setStatus(1);
+//                        questionChapter.setCreateTime(DateUtils.getNowTime());
+//                        questionChapter.setUpdateTime(DateUtils.getNowTime());
+//                        questionChapter.setPublishStatus(1L);
+//                        questionChapter.setCode(ServletUtils.getEncoded("ZJ"));
+//                        iQuestionChapterService.save(questionChapter);
+//
+//                        //章卷业务
+//                        QuestionBusiness questionBusiness1 = new QuestionBusiness();
+//                        questionBusiness1.setEducationTypeId(educationType.getId());
+//                        questionBusiness1.setBusinessId(business.getId());
+//                        questionBusiness1.setProjectId(projectType.getId());
+//                        questionBusiness1.setMajorId(questionChapter.getChapterExamId());
+//                        questionBusiness1.setType(3);
+//                        questionBusiness1.setSubjectId(subjectId);
+//                        iQuestionBusinessService.save(questionBusiness1);
+//
+//                        //模块章卷关联
+//                        QuestionModuleChapter moduleChapter = new QuestionModuleChapter();
+//                        moduleChapter.setModuleExamId(module.getModuleExamId());
+//                        moduleChapter.setChapterExamId(questionChapter.getChapterExamId());
+//                        moduleChapter.setSort(item2.getSortNumber().longValue());
+//                        iQuestionModuleChapterService.save(moduleChapter);
+//
+//                        if (ObjectUtils.isNotNull(item2.getIsTopic()) && item2.getIsTopic()){
+//                            //获取题目内容
+//                            String topParam = String.format("MeasureModelId=%s",item2.getMeasureModelId());
+//                            log.error(topParam);
+//                            String respone2 = HttpUtils.sendPostJsonHeader(EXAM_QUESTION_DETAIL, topParam,map);
+//                            JSONObject jsonObject = JSONObject.parseObject(respone2);
+//                            log.error(respone2);
+//                            List<ExternalQuestionDetailVo> questionDetailVos = JSONArray.parseArray(jsonObject.get("data").toString(), ExternalQuestionDetailVo.class);
+//
+//                            if (CollectionUtils.isNotEmpty(questionDetailVos)){
+//                                //处理图片
+//                                handlePhoto(questionDetailVos);
+//                                //创建试卷
+//                                Exam exam = new Exam();
+//                                exam.setCode(ServletUtils.getEncoded("SJ"));
+//                                exam.setStatus(1);
+//                                exam.setCreateTime(DateUtils.getNowTime());
+//                                exam.setUpdateTime(DateUtils.getNowTime());
+//                                exam.setExamName(item2.getName() + "测试卷");
+//                                exam.setPublishStatus(1L);
+//                                exam.setDoType(1);
+//                                //试卷类型
+//                                ExamPaper paper = iExamPaperService.getOne(new LambdaQueryWrapper<ExamPaper>()
+//                                        .eq(ExamPaper::getPaperName, "普通练习")
+//                                        .eq(ExamPaper::getStatus, 1)
+//                                        .last("limit 1"));
+//                                if (ObjectUtils.isNotNull(paper)){
+//                                    exam.setExamPaperId(paper.getPaperId());
+//                                }
+//                                iExamService.save(exam);
+//                                //试卷业务
+//                                QuestionBusiness questionBusiness2 = new QuestionBusiness();
+//                                questionBusiness2.setEducationTypeId(educationType.getId());
+//                                questionBusiness2.setBusinessId(business.getId());
+//                                questionBusiness2.setProjectId(projectType.getId());
+//                                questionBusiness2.setMajorId(exam.getExamId());
+//                                questionBusiness2.setType(2);
+//                                questionBusiness2.setSubjectId(subjectId);
+//                                iQuestionBusinessService.save(questionBusiness2);
+//
+//                                //章卷关联
+//                                QuestionChapterExam chapterExam = new QuestionChapterExam();
+//                                chapterExam.setChapterExamId(questionChapter.getChapterExamId());
+//                                chapterExam.setExamId(exam.getExamId());
+//                                chapterExam.setSort(item2.getSortNumber().longValue());
+//                                iQuestionChapterExamService.save(chapterExam);
+//                                for (ExternalQuestionDetailVo detailVo : questionDetailVos) {
+//                                        switch (detailVo.getTopicType()){
+//                                            case 1://单选题
+//                                                Question question = new Question();
+//                                                question.setContent(detailVo.getTitle());
+//                                                question.setType(1);
+//                                                question.setStatus(1);
+//                                                question.setCreateTime(DateUtils.getNowTime());
+//                                                question.setUpdateTime(DateUtils.getNowTime());
+//                                                question.setAnalysisContent(detailVo.getDescription());
+//                                                question.setPublishStatus(1);
+//                                                question.setCode(ServletUtils.getEncoded("TM"));
+//                                                question.setCreateBy("(系统)外部题库导入");
+//                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+//                                                    List<QuestionDetailVo> detail = new ArrayList<>();
+//                                                    Integer index = 0;
+//                                                    for (int i = 0; i < detailVo.getChildList().size(); i++) {
+//                                                        ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
+//                                                        QuestionDetailVo questionDetailVo = new QuestionDetailVo();
+//                                                        if (childVo.getOptionTitle().contains(upStr1)){
+//                                                            questionDetailVo.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+//                                                            questionDetailVo.setContent("如图所示");
+//                                                        }else {
+//                                                            questionDetailVo.setContent(childVo.getOptionTitle());
+//                                                        }
+//                                                        questionDetailVo.setOptionsId(i +1);
+//                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+//                                                            index = i + 1;
+//                                                        }
+//                                                        detail.add(questionDetailVo);
+//                                                    }
+//                                                    String s = JSONArray.toJSONString(detail);
+//                                                    question.setAnswerQuestion(index.toString());
+//                                                    question.setJsonStr(s);
+//                                                }
+//                                                save(question);
+//                                                //题目业务
+//                                                QuestionBusiness questionBusiness3 = new QuestionBusiness();
+//                                                questionBusiness3.setEducationTypeId(educationType.getId());
+//                                                questionBusiness3.setBusinessId(business.getId());
+//                                                questionBusiness3.setProjectId(projectType.getId());
+//                                                questionBusiness3.setMajorId(question.getQuestionId());
+//                                                questionBusiness3.setType(1);
+//                                                questionBusiness3.setSubjectId(subjectId);
+//                                                iQuestionBusinessService.save(questionBusiness3);
+//
+//                                                //试卷题目关联
+//                                                ExamQuestion examQuestion = new ExamQuestion();
+//                                                examQuestion.setExamId(exam.getExamId());
+//                                                examQuestion.setQuestionId(question.getQuestionId());
+//                                                examQuestion.setSort(detailVo.getSortNumber());
+//                                                examQuestion.setScore(BigDecimal.ZERO);
+//                                                examQuestion.setPartScore(BigDecimal.ZERO);
+//                                                iExamQuestionService.save(examQuestion);
+//                                                break;
+//                                            case 2://多选题
+//                                                Question question1 = new Question();
+//                                                question1.setContent(detailVo.getTitle());
+//                                                question1.setType(2);
+//                                                question1.setStatus(1);
+//                                                question1.setCreateTime(DateUtils.getNowTime());
+//                                                question1.setUpdateTime(DateUtils.getNowTime());
+//                                                question1.setAnalysisContent(detailVo.getDescription());
+//                                                question1.setPublishStatus(1);
+//                                                question1.setCode(ServletUtils.getEncoded("TM"));
+//                                                question1.setCreateBy("(系统)外部题库导入");
+//                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+//                                                    List<QuestionDetailVo> detail = new ArrayList<>();
+//                                                    List<String> index = new ArrayList<>();
+//                                                    for (int i = 0; i < detailVo.getChildList().size(); i++) {
+//                                                        ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
+//                                                        QuestionDetailVo questionDetailVo = new QuestionDetailVo();
+//                                                        if (childVo.getOptionTitle().contains(upStr1)){
+//                                                            questionDetailVo.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+//                                                            questionDetailVo.setContent("如图所示");
+//                                                        }else {
+//                                                            questionDetailVo.setContent(childVo.getOptionTitle());
+//                                                        }
+//                                                        questionDetailVo.setOptionsId(i + 1);
+//                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+//                                                            Integer x = i + 1;
+//                                                            index.add(x +"");
+//                                                        }
+//                                                        detail.add(questionDetailVo);
+//                                                    }
+//                                                    String s = JSONArray.toJSONString(detail);
+//                                                    question1.setAnswerQuestion(index.stream().collect(Collectors.joining(",")));
+//                                                    question1.setJsonStr(s);
+//                                                }
+//                                                save(question1);
+//                                                //题目业务
+//                                                QuestionBusiness questionBusiness4 = new QuestionBusiness();
+//                                                questionBusiness4.setEducationTypeId(educationType.getId());
+//                                                questionBusiness4.setBusinessId(business.getId());
+//                                                questionBusiness4.setProjectId(projectType.getId());
+//                                                questionBusiness4.setMajorId(question1.getQuestionId());
+//                                                questionBusiness4.setType(1);
+//                                                questionBusiness4.setSubjectId(subjectId);
+//                                                iQuestionBusinessService.save(questionBusiness4);
+//
+//                                                //试卷题目关联
+//                                                ExamQuestion examQuestion1 = new ExamQuestion();
+//                                                examQuestion1.setExamId(exam.getExamId());
+//                                                examQuestion1.setQuestionId(question1.getQuestionId());
+//                                                examQuestion1.setSort(detailVo.getSortNumber());
+//                                                examQuestion1.setScore(BigDecimal.ZERO);
+//                                                examQuestion1.setPartScore(BigDecimal.ZERO);
+//                                                iExamQuestionService.save(examQuestion1);
+//                                                break;
+//                                            case 4://判断题
+//                                                Question question2 = new Question();
+//                                                question2.setContent(detailVo.getTitle());
+//                                                question2.setType(3);
+//                                                question2.setStatus(1);
+//                                                question2.setCreateTime(DateUtils.getNowTime());
+//                                                question2.setUpdateTime(DateUtils.getNowTime());
+//                                                question2.setAnalysisContent(detailVo.getDescription());
+//                                                question2.setPublishStatus(1);
+//                                                question2.setCode(ServletUtils.getEncoded("TM"));
+//                                                question2.setCreateBy("(系统)外部题库导入");
+//                                                if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+//                                                    ExternalQuestionChildVo childVo = detailVo.getChildList().stream().filter(x -> ObjectUtils.isNotNull(x.getIsAnswer()) && x.getIsAnswer()).findFirst().orElse(null);
+//                                                    if (ObjectUtils.isNotNull(childVo)){
+//                                                        if ("正确".equals(childVo.getOptionTitle())){
+//                                                            question2.setAnswerQuestion("1");
+//                                                        }else {
+//                                                            question2.setAnswerQuestion("0");
+//                                                        }
+//                                                    }
+//                                                }
+//                                                save(question2);
+//                                                //题目业务
+//                                                QuestionBusiness questionBusiness5 = new QuestionBusiness();
+//                                                questionBusiness5.setEducationTypeId(educationType.getId());
+//                                                questionBusiness5.setBusinessId(business.getId());
+//                                                questionBusiness5.setProjectId(projectType.getId());
+//                                                questionBusiness5.setMajorId(question2.getQuestionId());
+//                                                questionBusiness5.setType(1);
+//                                                questionBusiness5.setSubjectId(subjectId);
+//                                                iQuestionBusinessService.save(questionBusiness5);
+//
+//                                                //试卷题目关联
+//                                                ExamQuestion examQuestion2 = new ExamQuestion();
+//                                                examQuestion2.setExamId(exam.getExamId());
+//                                                examQuestion2.setQuestionId(question2.getQuestionId());
+//                                                examQuestion2.setSort(detailVo.getSortNumber());
+//                                                examQuestion2.setScore(BigDecimal.ZERO);
+//                                                examQuestion2.setPartScore(BigDecimal.ZERO);
+//                                                iExamQuestionService.save(examQuestion2);
+//                                                break;
+//                                            case 5://案例题
+//                                                Question question3 = new Question();
+//                                                question3.setContent(detailVo.getTitle());
+//                                                question3.setType(4);
+//                                                question3.setStatus(1);
+//                                                question3.setCreateTime(DateUtils.getNowTime());
+//                                                question3.setUpdateTime(DateUtils.getNowTime());
+//                                                question3.setPublishStatus(1);
+//                                                question3.setCode(ServletUtils.getEncoded("TM"));
+//                                                question3.setCreateBy("(系统)外部题库导入");
+//                                                if (CollectionUtils.isNotEmpty(detailVo.getChildTopicLict())){
+//                                                    List<QuestionInfoVo> infoVoList = new ArrayList<>();
+//                                                    for (ExternalQuestionChildTopicVo topicVo : detailVo.getChildTopicLict()) {
+//                                                        switch (topicVo.getTopicType()){
+//                                                            case 1://单选
+//                                                                QuestionInfoVo infoVo = new QuestionInfoVo();
+//                                                                infoVo.setContent(topicVo.getTitle());
+//                                                                infoVo.setAnalysisContent(topicVo.getDescription());
+//                                                                infoVo.setType(1);
+//                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
+//                                                                    List<QuestionDetailVo> voList = new ArrayList<>();
+//                                                                    Integer index = 0;
+//                                                                    for (int i = 0; i < topicVo.getChildList().size(); i++) {
+//                                                                        ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
+//                                                                        QuestionDetailVo detailVo1 = new QuestionDetailVo();
+//                                                                        detailVo1.setOptionsId(i + 1);
+//                                                                        if (childVo.getOptionTitle().contains(upStr1)){
+//                                                                            detailVo1.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+//                                                                            detailVo1.setContent("如图所示");
+//                                                                        }else {
+//                                                                            detailVo1.setContent(childVo.getOptionTitle());
+//                                                                        }
+//                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+//                                                                            index = i + 1;
+//                                                                        }
+//                                                                        voList.add(detailVo1);
+//                                                                    }
+//                                                                    infoVo.setAnswerQuestion(index.toString());
+//                                                                    infoVo.setOptionsList(voList);
+//                                                                }
+//                                                                infoVoList.add(infoVo);
+//                                                                break;
+//                                                            case 2://多选
+//                                                                QuestionInfoVo infoVo1 = new QuestionInfoVo();
+//                                                                infoVo1.setContent(topicVo.getTitle());
+//                                                                infoVo1.setAnalysisContent(topicVo.getDescription());
+//                                                                infoVo1.setType(2);
+//                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
+//                                                                    List<QuestionDetailVo> voList = new ArrayList<>();
+//                                                                    List<String> indexList = new ArrayList<>();
+//                                                                    for (int i = 0; i < topicVo.getChildList().size(); i++) {
+//                                                                        ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
+//                                                                        QuestionDetailVo detailVo1 = new QuestionDetailVo();
+//                                                                        detailVo1.setOptionsId(i + 1);
+//                                                                        if (childVo.getOptionTitle().contains(upStr1)){
+//                                                                            detailVo1.setImgUrl(getImgUrl(childVo.getOptionTitle()));
+//                                                                            detailVo1.setContent("如图所示");
+//                                                                        }else {
+//                                                                            detailVo1.setContent(childVo.getOptionTitle());
+//                                                                        }
+//                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+//                                                                            Integer x = i + 1 ;
+//                                                                            indexList.add(x+"");
+//                                                                        }
+//                                                                        voList.add(detailVo1);
+//                                                                    }
+//                                                                    infoVo1.setAnswerQuestion(indexList.stream().collect(Collectors.joining(",")));
+//                                                                    infoVo1.setOptionsList(voList);
+//                                                                }
+//                                                                infoVoList.add(infoVo1);
+//                                                                break;
+//                                                            case 4://判断题
+//                                                                QuestionInfoVo infoVo2 = new QuestionInfoVo();
+//                                                                infoVo2.setContent(topicVo.getTitle());
+//                                                                infoVo2.setAnalysisContent(topicVo.getDescription());
+//                                                                infoVo2.setType(3);
+//                                                                if (CollectionUtils.isNotEmpty(topicVo.getChildList())){
+//                                                                    ExternalQuestionChildVo childVo = topicVo.getChildList().stream().filter(x -> ObjectUtils.isNotNull(x.getIsAnswer()) && x.getIsAnswer()).findFirst().orElse(null);
+//                                                                    if (ObjectUtils.isNotNull(childVo)){
+//                                                                        if ("正确".equals(childVo.getOptionTitle())){
+//                                                                            infoVo2.setAnswerQuestion("1");
+//                                                                        }else {
+//                                                                            infoVo2.setAnswerQuestion("0");
+//                                                                        }
+//                                                                    }
+//                                                                }
+//                                                                infoVoList.add(infoVo2);
+//                                                                break;
+//                                                        }
+//
+//                                                    }
+//                                                    question3.setJsonStr(JSONArray.toJSONString(infoVoList));
+//                                                }
+//                                                save(question3);
+//                                                //题目业务
+//                                                QuestionBusiness questionBusiness6 = new QuestionBusiness();
+//                                                questionBusiness6.setEducationTypeId(educationType.getId());
+//                                                questionBusiness6.setBusinessId(business.getId());
+//                                                questionBusiness6.setProjectId(projectType.getId());
+//                                                questionBusiness6.setMajorId(question3.getQuestionId());
+//                                                questionBusiness6.setType(1);
+//                                                questionBusiness6.setSubjectId(subjectId);
+//                                                iQuestionBusinessService.save(questionBusiness6);
+//
+//                                                //试卷题目关联
+//                                                ExamQuestion examQuestion3 = new ExamQuestion();
+//                                                examQuestion3.setExamId(exam.getExamId());
+//                                                examQuestion3.setQuestionId(question3.getQuestionId());
+//                                                examQuestion3.setSort(detailVo.getSortNumber());
+//                                                examQuestion3.setScore(BigDecimal.ZERO);
+//                                                examQuestion3.setPartScore(BigDecimal.ZERO);
+//                                                iExamQuestionService.save(examQuestion3);
+//                                                break;
+//                                        }
+//                                }
+//                            }
+//                        }
+//                    }
+//                }
+//            }
+//        }
     }
 
     @Override

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

@@ -130,17 +130,17 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
     private ISysConfigService iSysConfigService;
     @Autowired
     private IUserProfileService iUserProfileService;
-    @Value("${exam.applyDelete}")
-    private String EXAM_APPLY_DELETE;
+//    @Value("${exam.applyDelete}")
+//    private String EXAM_APPLY_DELETE;
     @Value("${aliyun.oss.endpoint}")
     private String ALIYUN_OSS_ENDPOINT;
 
     @Value("${zhongzheng.profile}")
     private String ZHONGZHENG_PROFILE;
-    @Value("${exam.subscribeAddExamResult}")
-    private String EXAM_SUBSCRIBE_SAVE_RESULT;
-    @Value("${exam.subscribeAddCertificate}")
-    private String EXAM_SUBSCRIBE_SAVE_RESULT_CERTIFICATE;
+//    @Value("${exam.subscribeAddExamResult}")
+//    private String EXAM_SUBSCRIBE_SAVE_RESULT;
+//    @Value("${exam.subscribeAddCertificate}")
+//    private String EXAM_SUBSCRIBE_SAVE_RESULT_CERTIFICATE;
 
     @Override
     public ExamApplyVo queryById(Long applyId) {
@@ -310,15 +310,15 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
                 throw new RuntimeException("该考试计划存在预约数据,无法删除");
             }
 
-            //通知B端
-            //删除考场同步B端
-            CdExamRoomUpdateBo roomBo = new CdExamRoomUpdateBo();
-            roomBo.setSignId(bo.getApplyId());
-            roomBo.setDataFrom(1);
-            roomBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
-            String param = JSONObject.toJSONString(roomBo);
-            Map<String, String> headersMap = new HashMap<>();
-            HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_DELETE, param, headersMap);
+//            //通知B端
+//            //删除考场同步B端
+//            CdExamRoomUpdateBo roomBo = new CdExamRoomUpdateBo();
+//            roomBo.setSignId(bo.getApplyId());
+//            roomBo.setDataFrom(1);
+//            roomBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
+//            String param = JSONObject.toJSONString(roomBo);
+//            Map<String, String> headersMap = new HashMap<>();
+//            HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_DELETE, param, headersMap);
 
         }
         validEntityBeforeSave(update);
@@ -1341,10 +1341,10 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             iUserSubscribeService.updateByIdNoTenant(subscribe);
         });
 
-        //通知B端系统
-        String param = JSONArray.toJSONString(exportBo);
-        Map<String, String> headersMap = new HashMap<>();
-        HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_RESULT, param, headersMap);
+//        //通知B端系统
+//        String param = JSONArray.toJSONString(exportBo);
+//        Map<String, String> headersMap = new HashMap<>();
+//        HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_RESULT, param, headersMap);
     }
 
     @Override
@@ -1409,12 +1409,12 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             }
             iUserSubscribeService.updateByIdNoTenant(subscribe);
         });
-        //通知B端系统
-        if (CollectionUtils.isNotEmpty(certificateBos)){
-            String param = JSONArray.toJSONString(certificateBos);
-            Map<String, String> headersMap = new HashMap<>();
-            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_RESULT_CERTIFICATE, param, headersMap);
-        }
+//        //通知B端系统
+//        if (CollectionUtils.isNotEmpty(certificateBos)){
+//            String param = JSONArray.toJSONString(certificateBos);
+//            Map<String, String> headersMap = new HashMap<>();
+//            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_RESULT_CERTIFICATE, param, headersMap);
+//        }
         return msgList.stream().collect(Collectors.joining(","));
     }
 

+ 49 - 49
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplySiteServiceImpl.java

@@ -44,8 +44,8 @@ public class ExamApplySiteServiceImpl extends ServiceImpl<ExamApplySiteMapper, E
     private IExamApplyService iExamApplyService;
     @Autowired
     private IExamSiteService iExamSiteService;
-    @Value("${exam.applySave}")
-    private String EXAM_APPLY_SAVE;
+//    @Value("${exam.applySave}")
+//    private String EXAM_APPLY_SAVE;
 
     @Override
     public ExamApplySiteVo queryById(Long id) {
@@ -147,53 +147,53 @@ public class ExamApplySiteServiceImpl extends ServiceImpl<ExamApplySiteMapper, E
             }
         }
 
-        List<ExamApplySiteTimeAddBo> examApplySiteTime = bo.get(0).getExamApplySiteTime();
-        ExamSite site = iExamSiteService.getById(bo.get(0).getSiteId());
-        ExamApplySiteTimeAddBo timeAddBo = examApplySiteTime.stream().findFirst().orElse(null);
-        if (ObjectUtils.isNotNull(timeAddBo)) {
-            if (remove) {
-                //修改
-                //修改考场同步B端
-                ExamApply apply = iExamApplyService.getById(applyId);
-                CdExamRoomUpdateBo roomBo = new CdExamRoomUpdateBo();
-                roomBo.setSignId(apply.getApplyId());
-                roomBo.setDataFrom(1);
-                roomBo.setTenantId(apply.getTenantId());
-                roomBo.setExamType(apply.getApplyNature());
-                roomBo.setExamTime(timeAddBo.getExamTime());
-                ExamApplySiteTimeTwoAddBo twoAddBo = timeAddBo.getExamApplySiteTimeTwo().stream().findFirst().orElse(null);
-                roomBo.setExamStartTime(twoAddBo.getStartTime());
-                roomBo.setExamEndTime(twoAddBo.getEndTime());
-                roomBo.setExamSite(site.getSiteAddress());
-                roomBo.setExamNum(twoAddBo.getNum().intValue());
-                roomBo.setScheduledNum(0);
-                String param = JSONObject.toJSONString(roomBo);
-                Map<String, String> headersMap = new HashMap<>();
-                HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_SAVE, param, headersMap);
-
-            } else {
-                //新增
-                //考场创建同步B端
-                ExamApply apply = iExamApplyService.getById(applyId);
-                CdExamRoomBo roomBo = new CdExamRoomBo();
-                roomBo.setSignId(apply.getApplyId());
-                roomBo.setDataFrom(1);
-                roomBo.setTenantId(apply.getTenantId());
-                roomBo.setType(1);//七大员预约
-                roomBo.setExamType(apply.getApplyNature());
-                roomBo.setExamTime(timeAddBo.getExamTime());
-                ExamApplySiteTimeTwoAddBo twoAddBo = timeAddBo.getExamApplySiteTimeTwo().stream().findFirst().orElse(null);
-                roomBo.setExamStartTime(twoAddBo.getStartTime());
-                roomBo.setExamEndTime(twoAddBo.getEndTime());
-                roomBo.setExamSite(site.getSiteAddress());
-                roomBo.setExamNum(twoAddBo.getNum().intValue());
-                roomBo.setScheduledNum(0);
-                String param = JSONObject.toJSONString(roomBo);
-                Map<String, String> headersMap = new HashMap<>();
-                HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_SAVE, param, headersMap);
-            }
-
-        }
+//        List<ExamApplySiteTimeAddBo> examApplySiteTime = bo.get(0).getExamApplySiteTime();
+//        ExamSite site = iExamSiteService.getById(bo.get(0).getSiteId());
+//        ExamApplySiteTimeAddBo timeAddBo = examApplySiteTime.stream().findFirst().orElse(null);
+//        if (ObjectUtils.isNotNull(timeAddBo)) {
+//            if (remove) {
+//                //修改
+//                //修改考场同步B端
+//                ExamApply apply = iExamApplyService.getById(applyId);
+//                CdExamRoomUpdateBo roomBo = new CdExamRoomUpdateBo();
+//                roomBo.setSignId(apply.getApplyId());
+//                roomBo.setDataFrom(1);
+//                roomBo.setTenantId(apply.getTenantId());
+//                roomBo.setExamType(apply.getApplyNature());
+//                roomBo.setExamTime(timeAddBo.getExamTime());
+//                ExamApplySiteTimeTwoAddBo twoAddBo = timeAddBo.getExamApplySiteTimeTwo().stream().findFirst().orElse(null);
+//                roomBo.setExamStartTime(twoAddBo.getStartTime());
+//                roomBo.setExamEndTime(twoAddBo.getEndTime());
+//                roomBo.setExamSite(site.getSiteAddress());
+//                roomBo.setExamNum(twoAddBo.getNum().intValue());
+//                roomBo.setScheduledNum(0);
+//                String param = JSONObject.toJSONString(roomBo);
+//                Map<String, String> headersMap = new HashMap<>();
+//                HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_SAVE, param, headersMap);
+//
+//            } else {
+//                //新增
+//                //考场创建同步B端
+//                ExamApply apply = iExamApplyService.getById(applyId);
+//                CdExamRoomBo roomBo = new CdExamRoomBo();
+//                roomBo.setSignId(apply.getApplyId());
+//                roomBo.setDataFrom(1);
+//                roomBo.setTenantId(apply.getTenantId());
+//                roomBo.setType(1);//七大员预约
+//                roomBo.setExamType(apply.getApplyNature());
+//                roomBo.setExamTime(timeAddBo.getExamTime());
+//                ExamApplySiteTimeTwoAddBo twoAddBo = timeAddBo.getExamApplySiteTimeTwo().stream().findFirst().orElse(null);
+//                roomBo.setExamStartTime(twoAddBo.getStartTime());
+//                roomBo.setExamEndTime(twoAddBo.getEndTime());
+//                roomBo.setExamSite(site.getSiteAddress());
+//                roomBo.setExamNum(twoAddBo.getNum().intValue());
+//                roomBo.setScheduledNum(0);
+//                String param = JSONObject.toJSONString(roomBo);
+//                Map<String, String> headersMap = new HashMap<>();
+//                HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_SAVE, param, headersMap);
+//            }
+//
+//        }
         return true;
     }
 }

+ 44 - 44
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -222,8 +222,8 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     @Value("${oldStudySys.syncPath}")
     private String SYNC_PATH;
 
-    @Value("${exam.subscribeSave}")
-    private String EXAM_SUBSCRIBE_SAVE;
+//    @Value("${exam.subscribeSave}")
+//    private String EXAM_SUBSCRIBE_SAVE;
 
     @Value("${aliyun.oss.endpoint}")
     private String ALIYUN_OSS_ENDPOINT;
@@ -569,48 +569,48 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             sendPeriodSMS(bo);
             sendPeriodSevenSMS(bo);
         }
-        int count = iExamApplyGoodsService.count(new LambdaQueryWrapper<ExamApplyGoods>().eq(ExamApplyGoods::getGoodsId, goods.getGoodsId()));
-        if (count > 0){
-            //商品存在考试计划
-            //学员信息推送B端
-            CdUserSubscribeBo subscribeBo = new CdUserSubscribeBo();
-            User user = iUserService.getById(classGradeUser.getUserId());
-            subscribeBo.setUserId(user.getUserId());
-            subscribeBo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
-            subscribeBo.setUserPhone(EncryptHandler.decrypt(user.getTelphone()));
-            subscribeBo.setUserName(user.getRealname());
-            subscribeBo.setOrderGoodsId(bo.getOrderGoodsId());
-            subscribeBo.setGoodsName(goods.getGoodsName());
-            CourseBusinessQueryBo courseBusinessQueryBo = new CourseBusinessQueryBo();
-            courseBusinessQueryBo.setId(goods.getBusinessId());
-            String businessName = iCourseBusinessService.queryFullName(courseBusinessQueryBo);
-            subscribeBo.setBusinessName(businessName);
-            if (ObjectUtils.isNotNull(goods.getMajorId())){
-                Major major = iMajorService.getById(goods.getMajorId());
-                subscribeBo.setMajor(major.getCategoryName());
-            }
-            subscribeBo.setTenantId(goods.getTenantId());
-            subscribeBo.setDataFrom(1);
-            subscribeBo.setCompanyName(user.getCompanyName());
-            subscribeBo.setType(1);//七大员新考
-            OrderGoods orderGoods = iOrderGoodsService.getById(bo.getOrderGoodsId());
-            Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, orderGoods.getOrderSn()));
-            subscribeBo.setOldCompanyId(order.getOldCompanyId());
-            subscribeBo.setOldCustomerId(order.getOldCustomerId());
-            subscribeBo.setOldInstitutionId(order.getOldInstitutionId());
-            //考试和补考次数
-            UserExamGoods examGoods = iUserExamGoodsService
-                    .getOne(new LambdaQueryWrapper<UserExamGoods>()
-                    .eq(UserExamGoods::getUserId, bo.getUserId())
-                    .eq(UserExamGoods::getOrderGoodsId, classGradeUser.getOrderGoodsId())
-                    .last("limit 1"));
-            if (ObjectUtils.isNotNull(examGoods)){
-                subscribeBo.setExamNum(examGoods.getExamNumber().intValue());
-            }
-            String param = JSONObject.toJSONString(subscribeBo);
-            Map<String, String> headersMap = new HashMap<>();
-            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE, param, headersMap);
-        }
+//        int count = iExamApplyGoodsService.count(new LambdaQueryWrapper<ExamApplyGoods>().eq(ExamApplyGoods::getGoodsId, goods.getGoodsId()));
+//        if (count > 0){
+//            //商品存在考试计划
+//            //学员信息推送B端
+//            CdUserSubscribeBo subscribeBo = new CdUserSubscribeBo();
+//            User user = iUserService.getById(classGradeUser.getUserId());
+//            subscribeBo.setUserId(user.getUserId());
+//            subscribeBo.setUserCard(EncryptHandler.decrypt(user.getIdCard()));
+//            subscribeBo.setUserPhone(EncryptHandler.decrypt(user.getTelphone()));
+//            subscribeBo.setUserName(user.getRealname());
+//            subscribeBo.setOrderGoodsId(bo.getOrderGoodsId());
+//            subscribeBo.setGoodsName(goods.getGoodsName());
+//            CourseBusinessQueryBo courseBusinessQueryBo = new CourseBusinessQueryBo();
+//            courseBusinessQueryBo.setId(goods.getBusinessId());
+//            String businessName = iCourseBusinessService.queryFullName(courseBusinessQueryBo);
+//            subscribeBo.setBusinessName(businessName);
+//            if (ObjectUtils.isNotNull(goods.getMajorId())){
+//                Major major = iMajorService.getById(goods.getMajorId());
+//                subscribeBo.setMajor(major.getCategoryName());
+//            }
+//            subscribeBo.setTenantId(goods.getTenantId());
+//            subscribeBo.setDataFrom(1);
+//            subscribeBo.setCompanyName(user.getCompanyName());
+//            subscribeBo.setType(1);//七大员新考
+//            OrderGoods orderGoods = iOrderGoodsService.getById(bo.getOrderGoodsId());
+//            Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, orderGoods.getOrderSn()));
+//            subscribeBo.setOldCompanyId(order.getOldCompanyId());
+//            subscribeBo.setOldCustomerId(order.getOldCustomerId());
+//            subscribeBo.setOldInstitutionId(order.getOldInstitutionId());
+//            //考试和补考次数
+//            UserExamGoods examGoods = iUserExamGoodsService
+//                    .getOne(new LambdaQueryWrapper<UserExamGoods>()
+//                    .eq(UserExamGoods::getUserId, bo.getUserId())
+//                    .eq(UserExamGoods::getOrderGoodsId, classGradeUser.getOrderGoodsId())
+//                    .last("limit 1"));
+//            if (ObjectUtils.isNotNull(examGoods)){
+//                subscribeBo.setExamNum(examGoods.getExamNumber().intValue());
+//            }
+//            String param = JSONObject.toJSONString(subscribeBo);
+//            Map<String, String> headersMap = new HashMap<>();
+//            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE, param, headersMap);
+//        }
         return true;
     }
 

+ 19 - 19
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -431,8 +431,8 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
     @Value("${aliyun.sms.signCommitmentRemind}")
     private String signCommitmentRemind;
 
-    @Value("${exam.applySave}")
-    private String EXAM_APPLY_SAVE;
+//    @Value("${exam.applySave}")
+//    private String EXAM_APPLY_SAVE;
 
 
     @Override
@@ -1947,23 +1947,23 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 siteTime.setSendmail(0);
                 iExamApplySiteTimeService.save(siteTime);
 
-                //考场创建同步B端
-                ExamApply apply = iExamApplyService.getById(examApply.getApplyId());
-                CdExamRoomBo roomBo = new CdExamRoomBo();
-                roomBo.setSignId(apply.getApplyId());
-                roomBo.setDataFrom(1);
-                roomBo.setTenantId(apply.getTenantId());
-                roomBo.setType(1);//七大员预约
-                roomBo.setExamType(apply.getApplyNature());
-                roomBo.setExamTime(millisecond);
-                roomBo.setExamStartTime(item.getStartTime());
-                roomBo.setExamEndTime(item.getEndTime());
-                roomBo.setExamSite(examSite.getSiteAddress());
-                roomBo.setExamNum(item.getNum().intValue());
-                roomBo.setScheduledNum(0);
-                String param = JSONObject.toJSONString(roomBo);
-                Map<String, String> headersMap = new HashMap<>();
-                HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_SAVE, param,headersMap);
+//                //考场创建同步B端
+//                ExamApply apply = iExamApplyService.getById(examApply.getApplyId());
+//                CdExamRoomBo roomBo = new CdExamRoomBo();
+//                roomBo.setSignId(apply.getApplyId());
+//                roomBo.setDataFrom(1);
+//                roomBo.setTenantId(apply.getTenantId());
+//                roomBo.setType(1);//七大员预约
+//                roomBo.setExamType(apply.getApplyNature());
+//                roomBo.setExamTime(millisecond);
+//                roomBo.setExamStartTime(item.getStartTime());
+//                roomBo.setExamEndTime(item.getEndTime());
+//                roomBo.setExamSite(examSite.getSiteAddress());
+//                roomBo.setExamNum(item.getNum().intValue());
+//                roomBo.setScheduledNum(0);
+//                String param = JSONObject.toJSONString(roomBo);
+//                Map<String, String> headersMap = new HashMap<>();
+//                HttpUtils.sendPostJsonHeaderAsync(EXAM_APPLY_SAVE, param,headersMap);
 
             }
         }

+ 6 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java

@@ -182,8 +182,8 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
     @Autowired
     private ISysTenantService iSysTenantService;
 
-    @Value("${fileHost}")
-    private String fileHost;
+//    @Value("${fileHost}")
+//    private String fileHost;
 
     @Override
     public UserStudyRecordVo queryById(Long recordId) {
@@ -1719,10 +1719,10 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             vo.setDateTime(zeroTime);
             vo.setFromPlat(1);
         }
-        String url = fileHost + "/common/free/ranking/log/batchAdd";
-        JSONObject obj = new JSONObject();
-        obj.put("list", userList);
-        String result = HttpUtils.sendPost(url,obj);
+//        String url = fileHost + "/common/free/ranking/log/batchAdd";
+//        JSONObject obj = new JSONObject();
+//        obj.put("list", userList);
+//        String result = HttpUtils.sendPost(url,obj);
         return null;
     }
 

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

@@ -224,11 +224,11 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
     @Autowired
     private IWxLoginService iWxLoginService;
 
-    @Value("${exam.subscribeSaveExam}")
-    private String EXAM_SUBSCRIBE_SAVE_EXAM;
+//    @Value("${exam.subscribeSaveExam}")
+//    private String EXAM_SUBSCRIBE_SAVE_EXAM;
 
-    @Value("${exam.subscribeUpdateExam}")
-    private String EXAM_SUBSCRIBE_UPDATE_EXAM;
+//    @Value("${exam.subscribeUpdateExam}")
+//    private String EXAM_SUBSCRIBE_UPDATE_EXAM;
 
     @Autowired
     private com.zhongzheng.modules.alisms.service.IAliSmsService IAliSmsService;
@@ -358,19 +358,19 @@ 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);
 
-        //预约成功推送新B端
-        CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
-        cdExamSubscribeBo.setUserId(add.getUserId());
-        cdExamSubscribeBo.setOrderGoodsId(add.getOrderGoodsId());
-        cdExamSubscribeBo.setExamApplyId(add.getApplyId());
-        cdExamSubscribeBo.setSign(1);
-        cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
-        cdExamSubscribeBo.setDataFrom(1);
-        cdExamSubscribeBo.setType(1);//默认七大员新考
-        cdExamSubscribeBo.setSeatNumber(tNum);
-        String param = JSONObject.toJSONString(cdExamSubscribeBo);
-        Map<String, String> headersMap = new HashMap<>();
-        HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_EXAM, param, headersMap);
+//        //预约成功推送新B端
+//        CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
+//        cdExamSubscribeBo.setUserId(add.getUserId());
+//        cdExamSubscribeBo.setOrderGoodsId(add.getOrderGoodsId());
+//        cdExamSubscribeBo.setExamApplyId(add.getApplyId());
+//        cdExamSubscribeBo.setSign(1);
+//        cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
+//        cdExamSubscribeBo.setDataFrom(1);
+//        cdExamSubscribeBo.setType(1);//默认七大员新考
+//        cdExamSubscribeBo.setSeatNumber(tNum);
+//        String param = JSONObject.toJSONString(cdExamSubscribeBo);
+//        Map<String, String> headersMap = new HashMap<>();
+//        HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_EXAM, param, headersMap);
         //发送预约考试消息
         sendExamSucceed(bo);
         return null;
@@ -601,20 +601,20 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
             }
             update.setUpdateTime(DateUtils.getNowTime());
             boolean b = this.updateById(update);
-            if (bo.getSubscribeStatus() == 2) {
-                //取消预约推送新B端
-                CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
-                cdExamSubscribeBo.setUserId(userSubscribeVo.getUserId());
-                cdExamSubscribeBo.setOrderGoodsId(userSubscribeVo.getOrderGoodsId());
-                cdExamSubscribeBo.setExamApplyId(userSubscribeVo.getApplyId());
-                cdExamSubscribeBo.setSign(1);
-                cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
-                cdExamSubscribeBo.setDataFrom(1);
-                cdExamSubscribeBo.setType(1);//默认七大员新考
-                String param = JSONObject.toJSONString(cdExamSubscribeBo);
-                Map<String, String> headersMap = new HashMap<>();
-                HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_UPDATE_EXAM, param, headersMap);
-            }
+//            if (bo.getSubscribeStatus() == 2) {
+//                //取消预约推送新B端
+//                CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
+//                cdExamSubscribeBo.setUserId(userSubscribeVo.getUserId());
+//                cdExamSubscribeBo.setOrderGoodsId(userSubscribeVo.getOrderGoodsId());
+//                cdExamSubscribeBo.setExamApplyId(userSubscribeVo.getApplyId());
+//                cdExamSubscribeBo.setSign(1);
+//                cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
+//                cdExamSubscribeBo.setDataFrom(1);
+//                cdExamSubscribeBo.setType(1);//默认七大员新考
+//                String param = JSONObject.toJSONString(cdExamSubscribeBo);
+//                Map<String, String> headersMap = new HashMap<>();
+//                HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_UPDATE_EXAM, param, headersMap);
+//            }
             if (b && Validator.isNotEmpty(bo.getResult())) {
                 if (!bo.getResult().equals(userSubscribeVo.getResult())) {
                     //考试结果有变更,发送短信
@@ -710,20 +710,20 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
             }
             update.setUpdateTime(DateUtils.getNowTime());
             b = this.updateById(update);
-            if (editBo.getSubscribeStatus() == 2) {
-                //取消预约推送新B端
-                CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
-                cdExamSubscribeBo.setUserId(userSubscribeVo.getUserId());
-                cdExamSubscribeBo.setOrderGoodsId(userSubscribeVo.getOrderGoodsId());
-                cdExamSubscribeBo.setExamApplyId(userSubscribeVo.getApplyId());
-                cdExamSubscribeBo.setSign(1);
-                cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
-                cdExamSubscribeBo.setDataFrom(1);
-                cdExamSubscribeBo.setType(1);//默认七大员新考
-                String param = JSONObject.toJSONString(cdExamSubscribeBo);
-                Map<String, String> headersMap = new HashMap<>();
-                HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_UPDATE_EXAM, param, headersMap);
-            }
+//            if (editBo.getSubscribeStatus() == 2) {
+//                //取消预约推送新B端
+//                CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
+//                cdExamSubscribeBo.setUserId(userSubscribeVo.getUserId());
+//                cdExamSubscribeBo.setOrderGoodsId(userSubscribeVo.getOrderGoodsId());
+//                cdExamSubscribeBo.setExamApplyId(userSubscribeVo.getApplyId());
+//                cdExamSubscribeBo.setSign(1);
+//                cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
+//                cdExamSubscribeBo.setDataFrom(1);
+//                cdExamSubscribeBo.setType(1);//默认七大员新考
+//                String param = JSONObject.toJSONString(cdExamSubscribeBo);
+//                Map<String, String> headersMap = new HashMap<>();
+//                HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_UPDATE_EXAM, param, headersMap);
+//            }
             if (Validator.isNotEmpty(update.getResult())) {
                 if (!update.getResult().equals(userSubscribeVo.getResult())) {
                     //考试结果有变更,发送短信
@@ -892,18 +892,18 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
                 iGoodsQuestionRelService.updateById(questionRel);
             }
 
-            //取消预约推送新B端
-            CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
-            cdExamSubscribeBo.setUserId(userSubscribeVo.getUserId());
-            cdExamSubscribeBo.setOrderGoodsId(userSubscribeVo.getOrderGoodsId());
-            cdExamSubscribeBo.setExamApplyId(userSubscribeVo.getApplyId());
-            cdExamSubscribeBo.setSign(1);
-            cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
-            cdExamSubscribeBo.setDataFrom(1);
-            cdExamSubscribeBo.setType(1);//默认七大员新考
-            String param = JSONObject.toJSONString(cdExamSubscribeBo);
-            Map<String, String> headersMap = new HashMap<>();
-            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_UPDATE_EXAM, param, headersMap);
+//            //取消预约推送新B端
+//            CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
+//            cdExamSubscribeBo.setUserId(userSubscribeVo.getUserId());
+//            cdExamSubscribeBo.setOrderGoodsId(userSubscribeVo.getOrderGoodsId());
+//            cdExamSubscribeBo.setExamApplyId(userSubscribeVo.getApplyId());
+//            cdExamSubscribeBo.setSign(1);
+//            cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
+//            cdExamSubscribeBo.setDataFrom(1);
+//            cdExamSubscribeBo.setType(1);//默认七大员新考
+//            String param = JSONObject.toJSONString(cdExamSubscribeBo);
+//            Map<String, String> headersMap = new HashMap<>();
+//            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_UPDATE_EXAM, param, headersMap);
 
             //发送消息
 //            sendExamcancel(userSubscribeEditBo);
@@ -2698,19 +2698,19 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
             iGoodsQuestionRelService.updateById(questionRel);
         }
 
-        //预约成功推送新B端
-        CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
-        cdExamSubscribeBo.setUserId(bo.getUserId());
-        cdExamSubscribeBo.setOrderGoodsId(bo.getOrderGoodsId());
-        cdExamSubscribeBo.setExamApplyId(bo.getApplyId());
-        cdExamSubscribeBo.setSign(1);
-        cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
-        cdExamSubscribeBo.setDataFrom(1);
-        cdExamSubscribeBo.setType(1);//默认七大员新考
-        cdExamSubscribeBo.setSeatNumber(tNum);
-        String param = JSONObject.toJSONString(cdExamSubscribeBo);
-        Map<String, String> headersMap = new HashMap<>();
-        HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_EXAM, param, headersMap);
+//        //预约成功推送新B端
+//        CdExamSubscribeBo cdExamSubscribeBo = new CdExamSubscribeBo();
+//        cdExamSubscribeBo.setUserId(bo.getUserId());
+//        cdExamSubscribeBo.setOrderGoodsId(bo.getOrderGoodsId());
+//        cdExamSubscribeBo.setExamApplyId(bo.getApplyId());
+//        cdExamSubscribeBo.setSign(1);
+//        cdExamSubscribeBo.setTenantId(Long.valueOf(ServletUtils.getRequest().getHeader("TenantId")));
+//        cdExamSubscribeBo.setDataFrom(1);
+//        cdExamSubscribeBo.setType(1);//默认七大员新考
+//        cdExamSubscribeBo.setSeatNumber(tNum);
+//        String param = JSONObject.toJSONString(cdExamSubscribeBo);
+//        Map<String, String> headersMap = new HashMap<>();
+//        HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_EXAM, param, headersMap);
 
         //发送预约考试消息
         sendExamSucceed(bo);

+ 10 - 10
zhongzheng-system/src/main/java/com/zhongzheng/modules/wx/service/impl/WxPayServiceImpl.java

@@ -250,8 +250,8 @@ public class WxPayServiceImpl implements IWxPayService {
     private String gzh_tokenUrl = "https://api.weixin.qq.com/cgi-bin/token";
 
     private String gzh_tokenParam = "grant_type=client_credential&appid=%s&secret=%s";
-    @Value("${exam.subscribeAddExamNum}")
-    private String EXAM_SUBSCRIBE_ADD_EXAM_NUM;
+//    @Value("${exam.subscribeAddExamNum}")
+//    private String EXAM_SUBSCRIBE_ADD_EXAM_NUM;
 
 
     public void initData(){
@@ -1175,14 +1175,14 @@ public class WxPayServiceImpl implements IWxPayService {
                     userExamGoodsSupplementAddBo.setOrderGoodsId(g.getOrderGoodsId());
                     userExamGoodsSupplementService.insertByAddBo(userExamGoodsSupplementAddBo);
                     userExamGoodsService.updateById(examGoods);
-                    //新B端同步考试次数
-                    AddExamApplyNumBo addExamApplyNum = new AddExamApplyNumBo();
-                    addExamApplyNum.setUserId(order.getUserId());
-                    addExamApplyNum.setOrderGoodsId(orderGoods.getOrderGoodsId());
-                    addExamApplyNum.setNum(1);
-                    String param = JSONObject.toJSONString(addExamApplyNum);
-                    Map<String, String> headersMap = new HashMap<>();
-                    HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_ADD_EXAM_NUM, param, headersMap);
+//                    //新B端同步考试次数
+//                    AddExamApplyNumBo addExamApplyNum = new AddExamApplyNumBo();
+//                    addExamApplyNum.setUserId(order.getUserId());
+//                    addExamApplyNum.setOrderGoodsId(orderGoods.getOrderGoodsId());
+//                    addExamApplyNum.setNum(1);
+//                    String param = JSONObject.toJSONString(addExamApplyNum);
+//                    Map<String, String> headersMap = new HashMap<>();
+//                    HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_ADD_EXAM_NUM, param, headersMap);
                 }
             }else {
 //                UserExamGoodsQueryBo userExamGoodsQueryBo = new UserExamGoodsQueryBo();