Kaynağa Gözat

接口逻辑完善,考试安排功能接口

change 4 yıl önce
ebeveyn
işleme
4b38d96be9

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/activity/service/impl/ActivityTaskServiceImpl.java

@@ -111,6 +111,7 @@ public class ActivityTaskServiceImpl extends ServiceImpl<ActivityTaskMapper, Act
     public Boolean updateByEditBo(ActivityTaskEditBo bo) {
         ActivityTask update = BeanUtil.toBean(bo, ActivityTask.class);
         validEntityBeforeSave(update);
+        //活动为考试时有分数区域得到等级分数
         if (bo.getTaskType() != null && bo.getTaskType() == 5){
             activityTaskTimeService.removeById(bo.getId());
             bo.getActivityTaskTimeEditBoList().stream().forEach(t -> activityTaskTimeService.save(BeanUtil.toBean(t,ActivityTaskTime.class)));

+ 0 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java

@@ -58,8 +58,6 @@ public class OssServiceImpl implements OssService {
         // 回调
         OssCallbackParam callback = new OssCallbackParam();
         callback.setCallbackUrl(ALIYUN_OSS_CALLBACK);
-      /*  callback.setCallbackBody("{\"filename\":${object},\"size\":${size},\"mimeType\":${mimeType},\"height\":${imageInfo.height},\"width\":${imageInfo.width}}");
-        callback.setCallbackBodyType("application/json");*/
         callback.setCallbackBody("filename=${object}&size=${size}&mimeType=${mimeType}&height=${imageInfo.height}&width=${imageInfo.width}");
         callback.setCallbackBodyType("application/x-www-form-urlencoded");
         // 提交节点

+ 23 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamArrangementServiceImpl.java

@@ -2,6 +2,9 @@ package com.zhongzheng.modules.exam.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.zhongzheng.modules.exam.service.IExamArrangementTimeService;
+import com.zhongzheng.modules.exam.vo.ExamArrangementTimeVo;
+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;
@@ -15,6 +18,7 @@ import com.zhongzheng.modules.exam.mapper.ExamArrangementMapper;
 import com.zhongzheng.modules.exam.vo.ExamArrangementVo;
 import com.zhongzheng.modules.exam.service.IExamArrangementService;
 
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -29,10 +33,17 @@ import java.util.stream.Collectors;
 @Service
 public class ExamArrangementServiceImpl extends ServiceImpl<ExamArrangementMapper, ExamArrangement> implements IExamArrangementService {
 
+    @Autowired
+    private IExamArrangementTimeService examArrangementTimeService;
+
     @Override
     public ExamArrangementVo queryById(Long id){
         ExamArrangement db = this.baseMapper.selectById(id);
-        return BeanUtil.toBean(db, ExamArrangementVo.class);
+        ExamArrangementVo examArrangementVo = BeanUtil.toBean(db, ExamArrangementVo.class);
+        List<ExamArrangementTimeVo> examArrangementTimeVos = new ArrayList<>();
+        BeanUtil.copyProperties(examArrangementTimeService.queryById(examArrangementVo.getId()),examArrangementTimeVos);
+        examArrangementVo.setExamArrangementTimeVo(examArrangementTimeVos);
+        return examArrangementVo;
     }
 
     @Override
@@ -59,7 +70,15 @@ public class ExamArrangementServiceImpl extends ServiceImpl<ExamArrangementMappe
         lqw.eq(StrUtil.isNotBlank(bo.getGradesUrl()), ExamArrangement::getGradesUrl, bo.getGradesUrl());
         lqw.eq(StrUtil.isNotBlank(bo.getScoreLineUrl()), ExamArrangement::getScoreLineUrl, bo.getScoreLineUrl());
         lqw.eq(StrUtil.isNotBlank(bo.getCertificate()), ExamArrangement::getCertificate, bo.getCertificate());
-        return entity2Vo(this.list(lqw));
+        List<ExamArrangementVo> list = new ArrayList<>();
+        BeanUtil.copyProperties(this.list(lqw),list);
+        list.stream().forEach(e -> {
+            List<ExamArrangementTimeVo> examArrangementTimeVos = new ArrayList<>();
+            BeanUtil.copyProperties(examArrangementTimeService.queryById(e.getId()),examArrangementTimeVos);
+            e.setExamArrangementTimeVo(examArrangementTimeVos);
+                }
+            );
+        return entity2Vo(list);
     }
 
     /**
@@ -68,12 +87,12 @@ public class ExamArrangementServiceImpl extends ServiceImpl<ExamArrangementMappe
     * @param collection 实体类集合
     * @return
     */
-    private List<ExamArrangementVo> entity2Vo(Collection<ExamArrangement> collection) {
+    private List<ExamArrangementVo> entity2Vo(Collection<ExamArrangementVo> collection) {
         List<ExamArrangementVo> voList = collection.stream()
                 .map(any -> BeanUtil.toBean(any, ExamArrangementVo.class))
                 .collect(Collectors.toList());
         if (collection instanceof Page) {
-            Page<ExamArrangement> page = (Page<ExamArrangement>)collection;
+            Page<ExamArrangementVo> page = (Page<ExamArrangementVo>)collection;
             Page<ExamArrangementVo> pageVo = new Page<>();
             BeanUtil.copyProperties(page,pageVo);
             pageVo.addAll(voList);

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/vo/ExamArrangementVo.java

@@ -6,7 +6,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import java.util.Date;
-
+import java.util.List;
 
 
 /**
@@ -109,4 +109,9 @@ public class ExamArrangementVo {
 	@ApiModelProperty("申领证书")
 	private String certificate;
 
+	/** 考试时间 */
+	@Excel(name = "考试时间")
+	@ApiModelProperty("考试时间")
+	private List<ExamArrangementTimeVo> examArrangementTimeVo;
+
 }