浏览代码

Merge remote-tracking branch 'origin/dev' into dev

yangdamao 2 年之前
父节点
当前提交
9621cb83aa
共有 15 个文件被更改,包括 119 次插入13 次删除
  1. 11 0
      zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstitutionController.java
  2. 1 1
      zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsQuestionRelExamController.java
  3. 3 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionAddBo.java
  4. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionEditBo.java
  5. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionOtherAddBo.java
  6. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionOtherEditBo.java
  7. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/Question.java
  8. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/QuestionOther.java
  9. 23 7
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionOtherServiceImpl.java
  10. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionOtherVo.java
  11. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionVo.java
  12. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsQuestionRelExamService.java
  13. 49 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsQuestionRelExamServiceImpl.java
  14. 8 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/service/impl/TopOrderBankPayServiceImpl.java
  15. 1 0
      zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

+ 11 - 0
zhongzheng-admin-saas/src/main/java/com/zhongzheng/controller/top/TopInstitutionController.java

@@ -9,6 +9,8 @@ import com.zhongzheng.modules.top.system.bo.TopInstitutionEditBo;
 import com.zhongzheng.modules.top.system.bo.TopInstitutionQueryBo;
 import com.zhongzheng.modules.top.system.service.ITopInstitutionService;
 import com.zhongzheng.modules.top.system.vo.TopInstitutionVo;
+import com.zhongzheng.modules.user.bo.UserQueryBo;
+import com.zhongzheng.modules.user.vo.UserExportVo;
 import lombok.RequiredArgsConstructor;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -55,6 +57,15 @@ public class TopInstitutionController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("导出职能机构列表")
+    @PreAuthorize("@ss.hasPermi('app:user:list')")
+    @GetMapping("/listExport")
+    public AjaxResult<TopInstitutionVo> listExport(TopInstitutionQueryBo bo) {
+        List<TopInstitutionVo> list = iTopInstitutionService.queryList(bo);
+        ExcelUtil<TopInstitutionVo> util = new ExcelUtil<>(TopInstitutionVo.class);
+        return util.exportExcel(list,"导出职能机构列表");
+    }
+
     @ApiOperation("成本分类查询职能机构列表")
     @PreAuthorize("@ss.hasPermi('system:institution:list')")
     @GetMapping("/listByCat")

+ 1 - 1
zhongzheng-api/src/main/java/com/zhongzheng/controller/goods/GoodsQuestionRelExamController.java

@@ -76,5 +76,5 @@ public class GoodsQuestionRelExamController extends BaseController {
         return toAjax(iGoodsQuestionRelExamService.insertByAddBo(bo) ? 1 : 0);
     }
 
-   
+
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionAddBo.java

@@ -76,5 +76,7 @@ public class QuestionAddBo {
     /** 山东题库ID */
     @ApiModelProperty("山东题库ID")
     private Long sdQid;
-
+    /** 来源平台 1自有 2山东 */
+    @ApiModelProperty("来源平台 1自有 2山东")
+    private Integer fromPlat;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionEditBo.java

@@ -87,4 +87,7 @@ public class QuestionEditBo {
     /** 山东题库ID */
     @ApiModelProperty("山东题库ID")
     private Long sdQid;
+    /** 来源平台 1自有 2山东 */
+    @ApiModelProperty("来源平台 1自有 2山东")
+    private Integer fromPlat;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionOtherAddBo.java

@@ -39,4 +39,7 @@ public class QuestionOtherAddBo {
     /** 1 山东题库 */
     @ApiModelProperty("1 山东题库")
     private Integer fromPlat;
+    /** 试卷ID */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/bo/QuestionOtherEditBo.java

@@ -46,4 +46,7 @@ public class QuestionOtherEditBo {
     @ApiModelProperty("1 山东题库")
     private Integer fromPlat;
 
+    /** 试卷ID */
+    @ApiModelProperty("试卷ID")
+    private Long examId;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/Question.java

@@ -66,4 +66,6 @@ private static final long serialVersionUID=1L;
     private Long oId;
     /** 山东题库ID */
     private Long sdQid;
+    /** 来源平台 1自有 2山东 */
+    private Integer fromPlat;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/domain/QuestionOther.java

@@ -42,4 +42,6 @@ private static final long serialVersionUID=1L;
     private String jsonStr;
     /** 1 山东题库 */
     private Integer fromPlat;
+    /** 试卷ID */
+    private Long examId;
 }

+ 23 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/QuestionOtherServiceImpl.java

@@ -13,8 +13,10 @@ import com.zhongzheng.modules.bank.domain.QuestionOldChild;
 import com.zhongzheng.modules.bank.domain.QuestionOldOptions;
 import com.zhongzheng.modules.bank.domain.QuestionOther;
 import com.zhongzheng.modules.bank.mapper.QuestionOtherMapper;
+import com.zhongzheng.modules.bank.service.IExamService;
 import com.zhongzheng.modules.bank.service.IQuestionOtherService;
 import com.zhongzheng.modules.bank.service.IQuestionService;
+import com.zhongzheng.modules.bank.vo.ExamVo;
 import com.zhongzheng.modules.bank.vo.QuestionOtherVo;
 import com.zhongzheng.modules.course.service.ICourseMenuExamService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -42,6 +44,9 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
     @Autowired
     private IQuestionService iQuestionService;
 
+    @Autowired
+    private IExamService iExamService;
+
     @Override
     public QuestionOtherVo queryById(Long id){
         QuestionOther db = this.baseMapper.selectById(id);
@@ -50,8 +55,8 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
         if (!db.getJsonStr().contains("\"msg\":\"获取成功\"")) {
             throw new CustomException("同步请求错误");
         }
-        int i = 100;
-        List<Long> qIdList = new ArrayList<>();
+        int i = 1;
+        List<ExamQuestionAddBo> qIdList = new ArrayList<>();
         for(QuestionOld old : qList){
             QuestionAddBo childAddBo = new QuestionAddBo();
             String importNo = ServletUtils.getEncoded("IMPORT");
@@ -120,9 +125,6 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
                         addBo.setType(3);
                     }
                     addBo.setAnalysisContent(oldChild.getAnalysis());
-                    if(oldChild.getAnalysis().startsWith("检查各类面层")){
-                        System.out.println(oldChild.getAnalysis());
-                    }
                     if(oldChild.getQuiztype()<3){
                         String answerQuestion="";
                         List<QuestionOptionsAddBo> optionsItemList = new ArrayList<>();
@@ -155,11 +157,25 @@ public class QuestionOtherServiceImpl extends ServiceImpl<QuestionOtherMapper, Q
                 }
                 childAddBo.setOptionsList(optionsList);
             }
+            childAddBo.setFromPlat(2);
             Long qId = iQuestionService.insertByAddBoImportBackId(childAddBo,i);
-            qIdList.add(qId);
+            ExamQuestionAddBo questionAddBo = new ExamQuestionAddBo();
+            questionAddBo.setQuestionId(qId);
+            questionAddBo.setSort(i);
+            qIdList.add(questionAddBo);
             i++;
-            System.out.println(qIdList.size());
         }
+        ExamAddBo examAddBo = new ExamAddBo();
+        examAddBo.setExamName("七大员新考试卷");
+        examAddBo.setDoType(1);
+        examAddBo.setStatus(1);
+        examAddBo.setPublishStatus(1L);
+        examAddBo.setQuestionList(qIdList);
+        ExamVo examVo = iExamService.insertByAddBo(examAddBo);
+        QuestionOtherEditBo editBo = new QuestionOtherEditBo();
+        editBo.setId(id);
+        editBo.setExamId(examVo.getExamId());
+        updateByEditBo(editBo);
         return BeanUtil.toBean(db, QuestionOtherVo.class);
     }
 

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionOtherVo.java

@@ -44,4 +44,8 @@ public class QuestionOtherVo {
 	@Excel(name = "1 山东题库")
 	@ApiModelProperty("1 山东题库")
 	private Integer fromPlat;
+	/** 试卷ID */
+	@Excel(name = "试卷ID")
+	@ApiModelProperty("试卷ID")
+	private Long examId;
 }

+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/vo/QuestionVo.java

@@ -131,4 +131,8 @@ public class QuestionVo {
 	@ApiModelProperty("多选 每项部分分,默认0分则不开启")
 	private BigDecimal partScore;
 	private Long sdQid;
+	/** 来源平台 1自有 2山东 */
+	@Excel(name = "来源平台 1自有 2山东")
+	@ApiModelProperty("来源平台 1自有 2山东")
+	private Integer fromPlat;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsQuestionRelExamService.java

@@ -36,6 +36,8 @@ public interface IGoodsQuestionRelExamService extends IService<GoodsQuestionRelE
 	 */
 	Boolean insertByAddBo(GoodsQuestionRelExamAddBo bo);
 
+	GoodsQuestionRelExamVo makeExam(GoodsQuestionRelExamAddBo bo);
+
 	/**
 	 * 根据编辑业务对象修改三方题库试卷记录
 	 * @param bo 三方题库试卷记录编辑业务对象

+ 49 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsQuestionRelExamServiceImpl.java

@@ -1,15 +1,24 @@
 package com.zhongzheng.modules.goods.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
+import com.zhongzheng.modules.course.domain.CourseTopic;
 import com.zhongzheng.modules.goods.bo.GoodsQuestionRelExamAddBo;
 import com.zhongzheng.modules.goods.bo.GoodsQuestionRelExamEditBo;
 import com.zhongzheng.modules.goods.bo.GoodsQuestionRelExamQueryBo;
+import com.zhongzheng.modules.goods.domain.GoodsQuestionRel;
 import com.zhongzheng.modules.goods.domain.GoodsQuestionRelExam;
 import com.zhongzheng.modules.goods.mapper.GoodsQuestionRelExamMapper;
+import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsQuestionRelExamService;
+import com.zhongzheng.modules.goods.service.IGoodsQuestionRelService;
 import com.zhongzheng.modules.goods.vo.GoodsQuestionRelExamVo;
+import com.zhongzheng.modules.order.domain.OrderGoods;
+import com.zhongzheng.modules.order.service.IOrderGoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -31,6 +40,12 @@ import java.util.stream.Collectors;
 @Service
 public class GoodsQuestionRelExamServiceImpl extends ServiceImpl<GoodsQuestionRelExamMapper, GoodsQuestionRelExam> implements IGoodsQuestionRelExamService {
 
+    @Autowired
+    private IGoodsQuestionRelService iGoodsQuestionRelService;
+
+    @Autowired
+    private IOrderGoodsService iOrderGoodsService;
+
     @Override
     public GoodsQuestionRelExamVo queryById(Long id){
         GoodsQuestionRelExam db = this.baseMapper.selectById(id);
@@ -78,6 +93,40 @@ public class GoodsQuestionRelExamServiceImpl extends ServiceImpl<GoodsQuestionRe
         return this.save(add);
     }
 
+    @Override
+    public GoodsQuestionRelExamVo makeExam(GoodsQuestionRelExamAddBo bo) {
+        if(Validator.isEmpty(bo.getRelId())){
+            throw new CustomException("参数缺失");
+        }
+        GoodsQuestionRelExam detail = getOne(new LambdaQueryWrapper<GoodsQuestionRelExam>()
+                .eq(GoodsQuestionRelExam::getRelId, bo.getRelId()).eq(GoodsQuestionRelExam::getStatus, 1)
+                .ge(GoodsQuestionRelExam::getExpTime, DateUtils.getNowTime()).last("limit 1"));
+        if(Validator.isNotEmpty(detail)){
+            return BeanUtil.toBean(detail,GoodsQuestionRelExamVo.class);
+        }
+        GoodsQuestionRelExam add = BeanUtil.toBean(bo, GoodsQuestionRelExam.class);
+        validEntityBeforeSave(add);
+        add.setCreateTime(DateUtils.getNowTime());
+        add.setUpdateTime(DateUtils.getNowTime());
+        add.setExpTime(DateUtils.getNowTime()+7*24*3600);
+        GoodsQuestionRel questionRel = iGoodsQuestionRelService.getOne(new LambdaQueryWrapper<GoodsQuestionRel>()
+                .eq(GoodsQuestionRel::getId, bo.getRelId()).eq(GoodsQuestionRel::getStatus, 1));
+        if(Validator.isEmpty(questionRel)){
+            throw new CustomException("该题库商品无法访问");
+        }
+        OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>()
+                .eq(OrderGoods::getOrderGoodsId, questionRel.getQsOrderGoodsId()));
+        if(Validator.isEmpty(orderGoods)||orderGoods.getServiceEndTime()<DateUtils.getNowTime()||orderGoods.getServiceStartTime()>DateUtils.getNowTime()){
+            throw new CustomException("未在服务期内无法访问");
+
+        }
+        if(questionRel.getQuestionDoNum()<1){
+            throw new CustomException("该题库商品试卷可用次数不足");
+        }
+        this.save(add);
+        return BeanUtil.toBean(add,GoodsQuestionRelExamVo.class);
+    }
+
     @Override
     public Boolean updateByEditBo(GoodsQuestionRelExamEditBo bo) {
         GoodsQuestionRelExam update = BeanUtil.toBean(bo, GoodsQuestionRelExam.class);

+ 8 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/top/order/service/impl/TopOrderBankPayServiceImpl.java

@@ -159,8 +159,10 @@ public class TopOrderBankPayServiceImpl extends ServiceImpl<TopOrderBankPayMappe
             if(Validator.isEmpty(bo.getOrderSn())||Validator.isEmpty(bo.getTenantId())){
                 throw new CustomException("参数错误");
             }
-            if(Validator.isEmpty(bo.getToBankAcount())||Validator.isEmpty(bo.getToBankName())||Validator.isEmpty(bo.getToBankTypeName())){
-                throw new CustomException("支付参数错误");
+            if(bo.getPayType()!=4){
+                if(Validator.isEmpty(bo.getToBankAcount())||Validator.isEmpty(bo.getToBankName())||Validator.isEmpty(bo.getToBankTypeName())){
+                    throw new CustomException("支付参数错误");
+                }
             }
             //校验当前角色审核权限
             List<TopSysUserRole> userRoleList = topSysUserRoleService.list(new LambdaQueryWrapper<TopSysUserRole>().eq(TopSysUserRole::getUserId, bo.getLoginId()));
@@ -265,8 +267,10 @@ public class TopOrderBankPayServiceImpl extends ServiceImpl<TopOrderBankPayMappe
             if(Validator.isEmpty(bo.getDivideLogId())||Validator.isEmpty(bo.getTenantId())){
                 throw new CustomException("参数错误");
             }
-            if(Validator.isEmpty(bo.getToBankAcount())||Validator.isEmpty(bo.getToBankName())||Validator.isEmpty(bo.getToBankTypeName())){
-                throw new CustomException("支付参数错误");
+            if(bo.getPayType()!=4){
+                if(Validator.isEmpty(bo.getToBankAcount())||Validator.isEmpty(bo.getToBankName())||Validator.isEmpty(bo.getToBankTypeName())){
+                    throw new CustomException("支付参数错误");
+                }
             }
             //校验当前角色审核权限
             List<TopSysUserRole> userRoleList = topSysUserRoleService.list(new LambdaQueryWrapper<TopSysUserRole>().eq(TopSysUserRole::getUserId, bo.getLoginId()));

+ 1 - 0
zhongzheng-system/src/main/resources/mapper/modules/bank/QuestionMapper.xml

@@ -23,6 +23,7 @@
         <result property="createBy" column="create_by"/>
         <result property="importSort" column="import_sort"/>
         <result property="sdQid" column="sd_qid"/>
+        <result property="fromPlat" column="from_plat"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.bank.vo.QuestionVo" id="QuestionResultVo">