yangdamao 1 年間 前
コミット
f6f862225f
17 ファイル変更624 行追加33 行削除
  1. 2 0
      zhongzheng-admin-saas/src/main/resources/application-dev.yml
  2. 3 3
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  3. 2 0
      zhongzheng-admin/src/main/resources/application-dev.yml
  4. 2 0
      zhongzheng-api/src/main/resources/application-dev.yml
  5. 1 0
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java
  6. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java
  7. 419 9
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionServiceImpl.java
  8. 27 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildTopicVo.java
  9. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildVo.java
  10. 28 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionDetailVo.java
  11. 23 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionVo.java
  12. 20 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionDetailVo.java
  13. 27 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionInfoVo.java
  14. 44 18
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/service/impl/TopOldOrderServiceImpl.java
  15. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOldOrderVo.java
  16. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopRefundUserVo.java
  17. 1 1
      zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderGoodsMapper.xml

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

@@ -171,6 +171,8 @@ oldOrder:
 oldSys:
     host: http://gdxypx.xy.com
     goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
+    question: http://192.168.1.121:8057/WordData/GetMeasureList
+    questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 3 - 3
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -836,9 +836,9 @@ public class CommonController extends BaseController {
     }
 
     @ApiOperation("新考题库导入")
-    @PostMapping("/common/question/import")
-    public AjaxResult<Void> questionImport(@RequestBody String param) {
-        iQuestionService.questionImport(param);
+    @GetMapping("/common/question/import")
+    public AjaxResult<Void> questionImport() {
+        iQuestionService.questionImport();
         return AjaxResult.success();
     }
 

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

@@ -172,6 +172,8 @@ oldOrder:
 oldSys:
     host: http://gdxypx.xy.com
     goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
+    question: http://192.168.1.121:8057/WordData/GetMeasureList
+    questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

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

@@ -174,6 +174,8 @@ oldOrder:
 oldSys:
     host: http://gdxypx.xy.com
     goods: http://gdxypx.xy.com/System/BussinessApi/NewYxtLogin
+    question: http://192.168.1.121:8057/WordData/GetMeasureList
+    questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 1 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -152,6 +152,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                 .antMatchers("/common/create/tenant/admin").anonymous()
                 .antMatchers("/common/create/tenant/admin/old").anonymous()
                 .antMatchers("/common/update/role").anonymous()
+                .antMatchers("/common/question/import").anonymous()
                 .antMatchers("/common/free/**").anonymous()
                 .antMatchers("/common/download**").anonymous()
                 .antMatchers("/common/download/resource**").anonymous()

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/IQuestionService.java

@@ -109,5 +109,5 @@ public interface IQuestionService extends IService<Question> {
 
 	Long insertByAddBoImportBackId(QuestionAddBo bo, Integer no);
 
-    void questionImport(String param);
+    void questionImport();
 }

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

@@ -6,6 +6,7 @@ import cn.hutool.core.util.StrUtil;
 import cn.hutool.http.HttpStatus;
 import com.alibaba.fastjson.JSON;
 
+import com.alibaba.fastjson.JSONArray;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
@@ -17,21 +18,17 @@ import com.github.pagehelper.PageInfo;
 import com.zhongzheng.common.core.page.TableDataInfo;
 import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
+import com.zhongzheng.common.type.EncryptHandler;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.SecurityUtils;
 import com.zhongzheng.common.utils.ServletUtils;
 import com.zhongzheng.common.utils.ToolsUtils;
+import com.zhongzheng.common.utils.http.HttpUtils;
 import com.zhongzheng.modules.alioss.service.OssService;
 import com.zhongzheng.modules.bank.bo.*;
-import com.zhongzheng.modules.bank.domain.Exam;
-import com.zhongzheng.modules.bank.domain.ExamQuestion;
-import com.zhongzheng.modules.bank.domain.Question;
-import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
-import com.zhongzheng.modules.bank.service.IExamQuestionService;
-import com.zhongzheng.modules.bank.service.IExamService;
-import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
-import com.zhongzheng.modules.bank.service.IQuestionService;
+import com.zhongzheng.modules.bank.service.*;
 import com.zhongzheng.modules.bank.vo.*;
 import com.zhongzheng.modules.course.domain.CourseBusiness;
 import com.zhongzheng.modules.course.domain.CourseEducationType;
@@ -47,7 +44,9 @@ import com.zhongzheng.modules.exam.domain.ExamKnowledge;
 import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
+import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.domain.GoodsExamTime;
+import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
 import com.zhongzheng.modules.goods.service.IGoodsExamTimeService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.BankGoodsExamVo;
@@ -77,6 +76,7 @@ import org.w3c.dom.NodeList;
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.math.BigDecimal;
 import java.text.NumberFormat;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -127,6 +127,21 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private IUserExamSubscriptionService iUserExamSubscriptionService;
 
+    @Autowired
+    private IQuestionModuleService iQuestionModuleService;
+
+    @Autowired
+    private IQuestionChapterService iQuestionChapterService;
+
+    @Autowired
+    private IQuestionChapterExamService iQuestionChapterExamService;
+
+    @Autowired
+    private IQuestionModuleChapterService iQuestionModuleChapterService;
+
+    @Autowired
+    private IGoodsAttachedService iGoodsAttachedService;
+
     @Autowired
     private IUserService iUserService;
 
@@ -145,6 +160,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Value("${aliyun.oss.endpoint}")
     private String ossHost;
 
+    @Value("${oldSys.question}")
+    private String QUESTION;
+
+    @Value("${oldSys.questionDetail}")
+    private String QUESTION_DETAIL;
+
 
     @Override
     public QuestionVo queryById(Long questionId) {
@@ -3090,8 +3111,397 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     @Override
-    public void questionImport(String param) {
+    public void questionImport() {
+        String respone = HttpUtils.sendGet(QUESTION, "");
+        List<ExternalQuestionVo> questionVos = JSONArray.parseArray(respone, 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<ExternalQuestionVo> collect = questionVos.stream().filter(x -> x.getParentId() == 1).collect(Collectors.toList());
+        for (ExternalQuestionVo item : collect) {
+            //创建商品
+            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);
+            iGoodsService.save(goods);
+
+            //题库
+            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);
+                    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);
+                        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());
+                            String topRespone = HttpUtils.sendGet(QUESTION_DETAIL, topParam);
+                            List<ExternalQuestionDetailVo> questionDetailVos = JSONArray.parseArray(topRespone, ExternalQuestionDetailVo.class);
+
+                            if (CollectionUtils.isNotEmpty(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);
+                                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);
+                                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();
+                                                        questionDetailVo.setContent(childVo.getOptionTitle());
+                                                        questionDetailVo.setOptionsId(i);
+                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                            index = i;
+                                                        }
+                                                        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);
+                                                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();
+                                                        questionDetailVo.setContent(childVo.getOptionTitle());
+                                                        questionDetailVo.setOptionsId(i);
+                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                            index.add(i+"");
+                                                        }
+                                                        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);
+                                                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);
+                                                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);
+                                                                        detailVo1.setContent(childVo.getOptionTitle());
+                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                                            index = i;
+                                                                        }
+                                                                        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);
+                                                                        detailVo1.setContent(childVo.getOptionTitle());
+                                                                        if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
+                                                                            indexList.add(i+"");
+                                                                        }
+                                                                        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);
+                                                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;
+                                        }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
 
+    public static void main(String[] args) {
+        String encrypt = EncryptHandler.encrypt("440506198204281419");
+        System.out.println("encrypt = " + encrypt);
     }
 
     private boolean checkNameUnique(Question entity) {

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildTopicVo.java

@@ -0,0 +1,27 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionChildTopicVo implements Serializable {
+
+    private Long measureId;
+
+    private String title;
+
+    private Integer topicType;
+
+    private String description;
+
+    private Integer sortNumber;
+
+    private List<ExternalQuestionChildVo> childList;
+
+}

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionChildVo.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionChildVo implements Serializable {
+
+    private Long topicOptionId;
+
+    private String optionTitle;
+
+    private Boolean isAnswer;
+
+}

+ 28 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionDetailVo.java

@@ -0,0 +1,28 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionDetailVo implements Serializable {
+
+    private Long topicId;
+
+    private String title;
+
+    private Integer topicType;
+
+    private String description;
+
+    private Integer sortNumber;
+
+    private List<ExternalQuestionChildVo> childList;
+
+    private List<ExternalQuestionChildTopicVo> childTopicLict;
+}

+ 23 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/ExternalQuestionVo.java

@@ -0,0 +1,23 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年12月06日 16:28
+ */
+@Data
+public class ExternalQuestionVo implements Serializable {
+
+    private Long measureModelId;
+
+    private String name;
+
+    private Long parentId;
+
+    private Boolean isTopic;
+
+    private Integer sortNumber;
+}

+ 20 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionDetailVo.java

@@ -0,0 +1,20 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 第三方题库视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2023-08-03
+ */
+@Data
+public class QuestionDetailVo implements Serializable {
+
+	private String content;
+
+	private Integer optionsId;
+}

+ 27 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionInfoVo.java

@@ -0,0 +1,27 @@
+package com.zhongzheng.modules.bank.vo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+
+/**
+ * 第三方题库视图对象 mall_package
+ *
+ * @author ruoyi
+ * @date 2023-08-03
+ */
+@Data
+public class QuestionInfoVo implements Serializable {
+
+	private String analysisContent;
+
+	private String answerQuestion;
+
+	private String content;
+
+	private Integer type;
+
+	private List<QuestionDetailVo> optionsList;
+}

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

@@ -426,13 +426,13 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     item.setOrderCost(add);
                 }
                 //学员审核状态
-                int userCount = topOrderGoodsService.count(new LambdaQueryWrapper<TopOldOrderGoods>()
-                        .eq(TopOldOrderGoods::getCheckStatus, 0)
-                        .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
-                        .eq(TopOldOrderGoods::getStatus, 1));
-                if (userCount > 0){
-                    item.setUserCheckStatus(0);
-                }
+//                int userCount = topOrderGoodsService.count(new LambdaQueryWrapper<TopOldOrderGoods>()
+//                        .eq(TopOldOrderGoods::getCheckStatus, 0)
+//                        .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
+//                        .eq(TopOldOrderGoods::getStatus, 1));
+//                if (userCount > 0){
+//                    item.setUserCheckStatus(0);
+//                }
                 //退款审核角色
                 if (Arrays.asList(0, 2).contains(item.getRefundStatus())) {
                     String refundSn = "";
@@ -465,19 +465,39 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                     }
                 }
                 //学员审核情况
-                int count = topOrderGoodsService.count(new LambdaQueryWrapper<TopOldOrderGoods>()
+                List<TopOldOrderGoods> list = topOrderGoodsService.list(new LambdaQueryWrapper<TopOldOrderGoods>()
                         .eq(TopOldOrderGoods::getOrderSn, item.getOrderSn())
-                        .eq(TopOldOrderGoods::getCheckStatus, 0)//待审核
+                        .isNotNull(TopOldOrderGoods::getRelSignId)
                         .eq(TopOldOrderGoods::getStatus, 1));
-                if (count > 0) {
-                    item.setStudentCheckStatus(0);
-                } else {
-                    item.setStudentCheckStatus(1);
+                if (CollectionUtils.isNotEmpty(list)){
+                    if (list.stream().anyMatch(x -> x.getCheckStatus() == 0)){
+                        item.setStudentCheckStatus(0);
+                    }else if (list.stream().allMatch(x -> x.getCheckStatus() == 1)){
+                        item.setStudentCheckStatus(1);
+                    }else if (list.stream().allMatch(x -> x.getCheckStatus() == 2)){
+                        item.setStudentCheckStatus(2);
+                    }
                 }
+
                 //订单金额
                 if (ObjectUtils.isNotNull(item.getRepairMoneyTotal())){
                     item.setOrderPrice(item.getOrderPrice().add(item.getRepairMoneyTotal()));
                 }
+                //实际账款:已收金额-税前奖金-退款金额+已付补款金额
+                BigDecimal orderPractical = BigDecimal.ZERO;
+                if (ObjectUtils.isNotNull(item.getOrderReceived())){
+                    orderPractical = orderPractical.add(item.getOrderReceived());
+                }
+                if (ObjectUtils.isNotNull(item.getPretaxBrokerage())){
+                    orderPractical = orderPractical.subtract(item.getPretaxBrokerage());
+                }
+                if (ObjectUtils.isNotNull(item.getOrderRefunded())){
+                    orderPractical = orderPractical.subtract(item.getOrderRefunded());
+                }
+                if (ObjectUtils.isNotNull(item.getPretaxBrokerage())){
+                    orderPractical = orderPractical.add(item.getPretaxBrokerage());
+                }
+                item.setOrderPractical(orderPractical);
             });
         }
         return orderVoList;
@@ -1173,7 +1193,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             //旧系统订单
             list = topOrderGoodsService.getListByQuery(query);
             if (CollectionUtils.isNotEmpty(list)) {
-                list = list.stream().filter(x -> x.getCheckStatus() == 0 || x.getCheckStatus() == 1).collect(Collectors.toList());
                 List<TopOldOrderGoods> goodsList = topOrderGoodsService
                         .list(new LambdaQueryWrapper<TopOldOrderGoods>().eq(TopOldOrderGoods::getOrderSn, query.getOrderSn())
                                 .eq(TopOldOrderGoods::getStatus, 1)
@@ -4548,7 +4567,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         vo.setOrderSn(orderVo.getOrderSn());
         vo.setOrderUncollected(orderVo.getOrderUncollected());
         vo.setOrderReceived(orderVo.getOrderReceived());
-        vo.setBrokerage(orderVo.getBrokerage());
+        vo.setBrokerage(orderVo.getPretaxBrokerage());
         vo.setInvoiceStatus(orderVo.getInvoiceStatus());
         Map<String, List<TopOldOrderRefundVo>> map = refunds.stream().collect(Collectors.groupingBy(TopOldOrderRefundVo::getRefundSn));
         if (map.keySet().size() > 1) {
@@ -4567,6 +4586,11 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
                         topRefundUserVo.setRealRefundFee(item.getRealRefundFee());
                         topRefundUserVo.setRefundReason(item.getApplyReason());
                         topRefundUserVo.setOrderSn(orderSn);
+                        BigDecimal money = BigDecimal.ZERO;
+                        if (ObjectUtils.isNotNull(orderVo.getPretaxBrokerage()) && CollectionUtils.isNotEmpty(v)){
+                            money = orderVo.getPretaxBrokerage().divide(new BigDecimal(v.size()));
+                        }
+                        topRefundUserVo.setBrokerage(money);
                         if (item.getRefundType() == 1) {
                             //学员信息
                             Order one = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, item.getOrderSn()));
@@ -4601,13 +4625,17 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             vo.setRefundFee(reduce);
             vo.setRefundReason(refunds.get(0).getApplyReason());
             vo.setApplyTime(refunds.get(0).getCreateTime());
-
             List<TopRefundUserVo> collect = refunds.stream().map(item -> {
                 TopRefundUserVo topRefundUserVo = new TopRefundUserVo();
                 topRefundUserVo.setRefundFee(item.getRefundFee());
                 topRefundUserVo.setRealRefundFee(item.getRealRefundFee());
                 topRefundUserVo.setRefundReason(item.getApplyReason());
                 topRefundUserVo.setOrderSn(orderSn);
+                BigDecimal money = BigDecimal.ZERO;
+                if (ObjectUtils.isNotNull(orderVo.getPretaxBrokerage()) && CollectionUtils.isNotEmpty(refunds)){
+                    money = orderVo.getPretaxBrokerage().divide(new BigDecimal(refunds.size()));
+                }
+                topRefundUserVo.setBrokerage(money);
                 if (item.getRefundType() == 1) {
                     //学员信息
                     Order one = orderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, item.getOrderSn()));
@@ -4800,8 +4828,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             default:
                 break;
         }
-        order.setUpdateTime(DateUtils.getNowTime());
-        updateById(order);
         //消息通知
         informRemindOrderCheck(String.format("【%s】订单审核%s【%s】", bo.getOrderSn(), bo.getCheckResult() == 1 ? "已通过" : "已拒绝", bo.getLoginName()));
         return true;

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopOldOrderVo.java

@@ -228,7 +228,7 @@ public class TopOldOrderVo {
 	@ApiModelProperty("角色名称")
 	private String roleName;
 
-	@ApiModelProperty("学员审核状态:0待审核,1已审核")
+	@ApiModelProperty("学员审核状态:0待审核,1已审核,2未通过")
 	private Integer studentCheckStatus;
 
 	@ApiModelProperty("退款审核角色名称")

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/goods/vo/TopRefundUserVo.java

@@ -50,4 +50,7 @@ public class TopRefundUserVo {
     @ApiModelProperty("退款单号")
     private String refundSn;
 
+    @ApiModelProperty("奖金")
+    private BigDecimal brokerage;
+
 }

+ 1 - 1
zhongzheng-system/src/main/resources/mapper/modules/top/TopOldOrderGoodsMapper.xml

@@ -83,7 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE
             order_sn = #{orderSn}
             AND `status` = 1
-            AND check_status != -1
+            AND check_status in (0,1)
 --           AND refund_status != 2
 -- 	      AND pay_status IN (2,3,4)
         <if test="userCard != null and userCard != ''">