he2802 1 anno fa
parent
commit
191a49586a

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

@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.github.pagehelper.Page;
@@ -30,18 +31,15 @@ import com.zhongzheng.modules.bank.domain.*;
 import com.zhongzheng.modules.bank.mapper.QuestionMapper;
 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;
-import com.zhongzheng.modules.course.domain.CourseProjectType;
-import com.zhongzheng.modules.course.domain.CourseSubject;
-import com.zhongzheng.modules.course.service.ICourseBusinessService;
-import com.zhongzheng.modules.course.service.ICourseEducationTypeService;
-import com.zhongzheng.modules.course.service.ICourseProjectTypeService;
-import com.zhongzheng.modules.course.service.ICourseSubjectService;
+import com.zhongzheng.modules.course.domain.*;
+import com.zhongzheng.modules.course.service.*;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeAddBo;
 import com.zhongzheng.modules.exam.bo.ExamKnowledgeBusinessAddBo;
 import com.zhongzheng.modules.exam.domain.ExamKnowledge;
+import com.zhongzheng.modules.exam.domain.ExamPaper;
+import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.service.IExamKnowledgeService;
+import com.zhongzheng.modules.exam.service.IExamPaperService;
 import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.domain.Goods;
 import com.zhongzheng.modules.goods.domain.GoodsAttached;
@@ -109,6 +107,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private ICourseSubjectService iCourseSubjectService;
 
+    @Autowired
+    private ICourseSubjectProjectService iCourseSubjectProjectService;
+
     @Autowired
     private IExamKnowledgeService iExamKnowledgeService;
 
@@ -148,6 +149,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private IExamService iExamService;
 
+    @Autowired
+    private IExamPaperService iExamPaperService;
+
     @Autowired
     private IGoodsService iGoodsService;
 
@@ -157,6 +161,12 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Autowired
     private OssService ossService;
 
+    @Autowired
+    private IMajorService iMajorService;
+
+    @Autowired
+    private IMajorProjectService iMajorProjectService;
+
     @Value("${aliyun.oss.endpoint}")
     private String ossHost;
 
@@ -166,6 +176,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     @Value("${oldSys.questionDetail}")
     private String QUESTION_DETAIL;
 
+    @Value("${aliyun.oss.endpoint}")
+    private String OSS_PREFIX;
+
 
     @Override
     public QuestionVo queryById(Long questionId) {
@@ -3111,6 +3124,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
     }
 
     @Override
+    @Transactional
     public void questionImport() {
         String respone = HttpUtils.sendGet(QUESTION, "");
         List<ExternalQuestionVo> questionVos = JSONArray.parseArray(respone, ExternalQuestionVo.class);
@@ -3137,10 +3151,52 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                 .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).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());
@@ -3157,6 +3213,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
             goods.setUpdateTime(DateUtils.getNowTime());
             goods.setStatus(1);
             goods.setGoodsStatus(0);
+            goods.setMajorId(majorId);
+            goods.setSubjectIds(subjectId.toString());
             iGoodsService.save(goods);
 
             //题库
@@ -3180,6 +3238,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                     questionBusiness.setProjectId(projectType.getId());
                     questionBusiness.setMajorId(module.getModuleExamId());
                     questionBusiness.setType(4);
+                    questionBusiness.setSubjectId(subjectId);
                     iQuestionBusinessService.save(questionBusiness);
                     //题库模块关联
                     GoodsAttached goodsAttached = new GoodsAttached();
@@ -3211,6 +3270,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                         questionBusiness1.setProjectId(projectType.getId());
                         questionBusiness1.setMajorId(questionChapter.getChapterExamId());
                         questionBusiness1.setType(3);
+                        questionBusiness1.setSubjectId(subjectId);
                         iQuestionBusinessService.save(questionBusiness1);
 
                         //模块章卷关联
@@ -3227,6 +3287,8 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                             List<ExternalQuestionDetailVo> questionDetailVos = JSONArray.parseArray(topRespone, ExternalQuestionDetailVo.class);
 
                             if (CollectionUtils.isNotEmpty(questionDetailVos)){
+                                //处理图片
+                                handlePhoto(questionDetailVos);
                                 //创建试卷
                                 Exam exam = new Exam();
                                 exam.setCode(ServletUtils.getEncoded("SJ"));
@@ -3236,6 +3298,14 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 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();
@@ -3244,6 +3314,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                 questionBusiness2.setProjectId(projectType.getId());
                                 questionBusiness2.setMajorId(exam.getExamId());
                                 questionBusiness2.setType(2);
+                                questionBusiness2.setSubjectId(subjectId);
                                 iQuestionBusinessService.save(questionBusiness2);
 
                                 //章卷关联
@@ -3272,9 +3343,9 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                         ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
                                                         QuestionDetailVo questionDetailVo = new QuestionDetailVo();
                                                         questionDetailVo.setContent(childVo.getOptionTitle());
-                                                        questionDetailVo.setOptionsId(i);
+                                                        questionDetailVo.setOptionsId(i +1);
                                                         if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                            index = i;
+                                                            index = i + 1;
                                                         }
                                                         detail.add(questionDetailVo);
                                                     }
@@ -3290,6 +3361,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                 questionBusiness3.setProjectId(projectType.getId());
                                                 questionBusiness3.setMajorId(question.getQuestionId());
                                                 questionBusiness3.setType(1);
+                                                questionBusiness3.setSubjectId(subjectId);
                                                 iQuestionBusinessService.save(questionBusiness3);
 
                                                 //试卷题目关联
@@ -3319,9 +3391,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                         ExternalQuestionChildVo childVo = detailVo.getChildList().get(i);
                                                         QuestionDetailVo questionDetailVo = new QuestionDetailVo();
                                                         questionDetailVo.setContent(childVo.getOptionTitle());
-                                                        questionDetailVo.setOptionsId(i);
+                                                        questionDetailVo.setOptionsId(i + 1);
                                                         if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                            index.add(i+"");
+                                                            Integer x = i + 1;
+                                                            index.add(x +"");
                                                         }
                                                         detail.add(questionDetailVo);
                                                     }
@@ -3337,6 +3410,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                 questionBusiness4.setProjectId(projectType.getId());
                                                 questionBusiness4.setMajorId(question1.getQuestionId());
                                                 questionBusiness4.setType(1);
+                                                questionBusiness4.setSubjectId(subjectId);
                                                 iQuestionBusinessService.save(questionBusiness4);
 
                                                 //试卷题目关联
@@ -3377,6 +3451,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                 questionBusiness5.setProjectId(projectType.getId());
                                                 questionBusiness5.setMajorId(question2.getQuestionId());
                                                 questionBusiness5.setType(1);
+                                                questionBusiness5.setSubjectId(subjectId);
                                                 iQuestionBusinessService.save(questionBusiness5);
 
                                                 //试卷题目关联
@@ -3413,10 +3488,10 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                                     for (int i = 0; i < topicVo.getChildList().size(); i++) {
                                                                         ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
                                                                         QuestionDetailVo detailVo1 = new QuestionDetailVo();
-                                                                        detailVo1.setOptionsId(i);
+                                                                        detailVo1.setOptionsId(i + 1);
                                                                         detailVo1.setContent(childVo.getOptionTitle());
                                                                         if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                                            index = i;
+                                                                            index = i + 1;
                                                                         }
                                                                         voList.add(detailVo1);
                                                                     }
@@ -3436,10 +3511,11 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                                     for (int i = 0; i < topicVo.getChildList().size(); i++) {
                                                                         ExternalQuestionChildVo childVo = topicVo.getChildList().get(i);
                                                                         QuestionDetailVo detailVo1 = new QuestionDetailVo();
-                                                                        detailVo1.setOptionsId(i);
+                                                                        detailVo1.setOptionsId(i + 1);
                                                                         detailVo1.setContent(childVo.getOptionTitle());
                                                                         if (ObjectUtils.isNotNull(childVo.getIsAnswer()) && childVo.getIsAnswer()){
-                                                                            indexList.add(i+"");
+                                                                            Integer x = i + 1 ;
+                                                                            indexList.add(x+"");
                                                                         }
                                                                         voList.add(detailVo1);
                                                                     }
@@ -3478,6 +3554,7 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
                                                 questionBusiness6.setProjectId(projectType.getId());
                                                 questionBusiness6.setMajorId(question3.getQuestionId());
                                                 questionBusiness6.setType(1);
+                                                questionBusiness6.setSubjectId(subjectId);
                                                 iQuestionBusinessService.save(questionBusiness6);
 
                                                 //试卷题目关联
@@ -3499,6 +3576,64 @@ public class QuestionServiceImpl extends ServiceImpl<QuestionMapper, Question> i
         }
     }
 
+    private void handlePhoto(List<ExternalQuestionDetailVo> questionDetailVos) {
+        String prefix = "\\Uploads\\qdytopic\\";
+        String upStr = OSS_PREFIX + "/web/Uploads/qdytopic/";
+        for (ExternalQuestionDetailVo detailVo : questionDetailVos) {
+            if (StringUtils.isNotBlank(detailVo.getTitle()) && detailVo.getTitle().contains(prefix)){
+                String title = detailVo.getTitle();
+                String replace = title.replace(prefix, upStr);
+                detailVo.setTitle(replace);
+            }
+
+            if (StringUtils.isNotBlank(detailVo.getDescription()) && detailVo.getDescription().contains(prefix)){
+                String description = detailVo.getDescription();
+                String replace = description.replace(prefix, upStr);
+                detailVo.setDescription(replace);
+            }
+
+            if (CollectionUtils.isNotEmpty(detailVo.getChildList())){
+                List<ExternalQuestionChildVo> childList = detailVo.getChildList();
+                for (ExternalQuestionChildVo childVo : childList) {
+                    if (StringUtils.isNotBlank(childVo.getOptionTitle()) && childVo.getOptionTitle().contains(prefix)){
+                        String optionTitle = childVo.getOptionTitle();
+                        String replace = optionTitle.replace(prefix, upStr);
+                        childVo.setOptionTitle(replace);
+                    }
+                }
+            }
+
+            if (CollectionUtils.isNotEmpty(detailVo.getChildTopicLict())){
+                List<ExternalQuestionChildTopicVo> childTopicLict = detailVo.getChildTopicLict();
+                for (ExternalQuestionChildTopicVo childTopicVo : childTopicLict) {
+                    if (StringUtils.isNotBlank(childTopicVo.getTitle()) && childTopicVo.getTitle().contains(prefix)){
+                        String optionTitle = childTopicVo.getTitle();
+                        String replace = optionTitle.replace(prefix, upStr);
+                        childTopicVo.setTitle(replace);
+                    }
+
+                    if (StringUtils.isNotBlank(childTopicVo.getDescription()) && childTopicVo.getDescription().contains(prefix)){
+                        String description = childTopicVo.getDescription();
+                        String replace = description.replace(prefix, upStr);
+                        childTopicVo.setDescription(replace);
+                    }
+
+                    if (CollectionUtils.isNotEmpty(childTopicVo.getChildList())){
+                        List<ExternalQuestionChildVo> childList = childTopicVo.getChildList();
+                        for (ExternalQuestionChildVo childVo : childList) {
+                            if (StringUtils.isNotBlank(childVo.getOptionTitle()) && childVo.getOptionTitle().contains(prefix)){
+                                String optionTitle = childVo.getOptionTitle();
+                                String replace = optionTitle.replace(prefix, upStr);
+                                childVo.setOptionTitle(replace);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+
+    }
+
     private boolean checkNameUnique(Question entity) {
         Question info = getOne(new LambdaQueryWrapper<Question>()
                 .eq(Question::getPrefixName, entity.getPrefixName()).eq(Question::getContent, entity.getContent()).ne(Question::getStatus, -1).last("limit 1"));

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

@@ -20,4 +20,6 @@ public class ExternalQuestionVo implements Serializable {
     private Boolean isTopic;
 
     private Integer sortNumber;
+
+    private String topicNoteTypeNum;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsAddBo.java

@@ -214,4 +214,7 @@ public class GoodsAddBo {
     /** 1单证书 2多证书 */
     @ApiModelProperty("1单证书 2多证书")
     private Integer moreCertificateStatus;
+    /** 关联题库ids */
+    @ApiModelProperty("关联题库ids")
+    private String questionRelIds;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/bo/GoodsEditBo.java

@@ -248,4 +248,7 @@ public class GoodsEditBo {
     /** 1单证书 2多证书 */
     @ApiModelProperty("1单证书 2多证书")
     private Integer moreCertificateStatus;
+    /** 关联题库ids */
+    @ApiModelProperty("关联题库ids")
+    private String questionRelIds;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/domain/Goods.java

@@ -178,4 +178,6 @@ private static final long serialVersionUID=1L;
     private Long firstChoiceGoods;
     /** 1单证书 2多证书 */
     private Integer moreCertificateStatus;
+    /** 关联题库ids */
+    private String questionRelIds;
 }

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

@@ -398,4 +398,7 @@ public class GoodsVo {
 	@Excel(name = "1单证书 2多证书")
 	@ApiModelProperty("1单证书 2多证书")
 	private Integer moreCertificateStatus;
+	/** 关联题库ids */
+	@ApiModelProperty("关联题库ids")
+	private String questionRelIds;
 }

+ 30 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderServiceImpl.java

@@ -908,13 +908,42 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
             //开通题库
             questionHandleTwo(orderGoods,goods);
         }else if (ObjectUtils.isNotNull(goods.getQuestionGoodsId())){
+            externalQuestionGoodsHandle(orderGoods,goods);
+        }
+        if (StringUtils.isNotBlank(goods.getQuestionRelIds())){
+            //关联题库商品
             questionGoodsHandle(orderGoods,goods);
         }
+
 //        //商品是否有活动模考
 //        iUserMockSubscribeService.addActivityMock(orderGoods.getGoodsId(),order.getUserId());
     }
 
-    private void questionGoodsHandle(OrderGoods orderGoods,Goods goods) {
+    private void questionGoodsHandle(OrderGoods orderGoods, Goods goods) {
+        List<String> goodsIds = Arrays.stream(goods.getQuestionRelIds().split(",")).collect(Collectors.toList());
+
+        for (String goodsId : goodsIds) {
+            //创建七大员题库商品订单
+            Goods questionGoods = iGoodsService.getById(goodsId);
+            OrderGoods add = new OrderGoods();
+            add.setOrderSn(orderGoods.getOrderSn());
+            add.setGoodsId(questionGoods.getGoodsId());
+            add.setGoodsYear(questionGoods.getYear().toString());
+            add.setGoodsPrice(questionGoods.getStandPrice());
+            add.setGoodsRealPrice(questionGoods.getStandPrice());
+            add.setCreateTime(DateUtils.getNowTime());
+            add.setUpdateTime(DateUtils.getNowTime());
+            add.setStatus(1);
+            add.setGoodsReceived(questionGoods.getStandPrice());
+            add.setRefundStatus(0);
+            add.setPayStatus(3);
+            add.setServiceStartTime(orderGoods.getServiceStartTime());
+            add.setServiceEndTime(orderGoods.getServiceEndTime());
+            iOrderGoodsService.save(add);
+        }
+    }
+
+    private void externalQuestionGoodsHandle(OrderGoods orderGoods,Goods goods) {
         //第三方题库商品
         Goods questionGoods = iGoodsService.getById(goods.getQuestionGoodsId());
         if (ObjectUtils.isNull(questionGoods) || questionGoods.getGoodsType() != 9){

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

@@ -1784,7 +1784,7 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         }
         //退款金额
         BigDecimal refundPrice = orderRefundList.stream().map(TopOldOrderRefundVo::getRefundFee).reduce(BigDecimal.ZERO, BigDecimal::add);
-        if (order.getOrderFrom() == 3 && bo.getPayType() == 2) {
+        if (order.getOrderFrom() == 3 && bo.getPayType() != 1) {
             if (Validator.isEmpty(bo.getToBankAcount()) || Validator.isEmpty(bo.getToBankName()) || Validator.isEmpty(bo.getToBankTypeName())) {
                 throw new CustomException("支付参数错误");
             }
@@ -4597,7 +4597,6 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
         BigDecimal decimal = orderVo.getPretaxBrokerage();
         if (ObjectUtils.isNotNull(decimal) && count > 0){
             decimal = orderVo.getPretaxBrokerage().divide(new BigDecimal(count), 2, RoundingMode.HALF_UP);
-            vo.setBrokerage(decimal);
         }
         vo.setInvoiceStatus(orderVo.getInvoiceStatus());
         Map<String, List<TopOldOrderRefundVo>> map = refunds.stream().collect(Collectors.groupingBy(TopOldOrderRefundVo::getRefundSn));
@@ -4694,6 +4693,8 @@ public class TopOldOrderServiceImpl extends ServiceImpl<TopOldOrderMapper, TopOl
             }).collect(Collectors.toList());
             vo.setRefundUserList(collect);
         }
+        int size = vo.getRefundUserList().size();
+        vo.setBrokerage(decimal.multiply(new BigDecimal(size)));
         // 申请退款审核人
         SysTenant tenant = sysTenantService.getById(orderVo.getTenantId());
         if (orderVo.getOrderFrom() == 1) {

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

@@ -536,6 +536,8 @@ public class WxPayServiceImpl implements IWxPayService {
                         distributionRebate(g);
                     }
                     //第三方题库商品
+                    externalQuestionGoodsHandle(g);
+                    //关联题库商品
                     questionGoodsHandle(g);
                 }
                 shareToOldSys(order,goodsList);
@@ -554,6 +556,34 @@ public class WxPayServiceImpl implements IWxPayService {
     }
 
     private void questionGoodsHandle(OrderGoods orderGoods) {
+        Goods goods = iGoodsService.getById(orderGoods.getGoodsId());
+        if (ObjectUtils.isNull(goods.getQuestionGoodsId()) || StringUtils.isBlank(goods.getQuestionRelIds())){
+            return;
+        }
+        List<String> goodsIds = Arrays.stream(goods.getQuestionRelIds().split(",")).collect(Collectors.toList());
+
+        for (String goodsId : goodsIds) {
+            //创建七大员题库商品订单
+            Goods questionGoods = iGoodsService.getById(goodsId);
+            OrderGoods add = new OrderGoods();
+            add.setOrderSn(orderGoods.getOrderSn());
+            add.setGoodsId(questionGoods.getGoodsId());
+            add.setGoodsYear(questionGoods.getYear().toString());
+            add.setGoodsPrice(questionGoods.getStandPrice());
+            add.setGoodsRealPrice(questionGoods.getStandPrice());
+            add.setCreateTime(DateUtils.getNowTime());
+            add.setUpdateTime(DateUtils.getNowTime());
+            add.setStatus(1);
+            add.setGoodsReceived(questionGoods.getStandPrice());
+            add.setRefundStatus(0);
+            add.setPayStatus(3);
+            add.setServiceStartTime(orderGoods.getServiceStartTime());
+            add.setServiceEndTime(orderGoods.getServiceEndTime());
+            iOrderGoodsService.save(add);
+        }
+    }
+
+    private void externalQuestionGoodsHandle(OrderGoods orderGoods) {
         Goods goods = iGoodsService.getById(orderGoods.getGoodsId());
         if (ObjectUtils.isNull(goods.getQuestionGoodsId())){
             return;