Bläddra i källkod

新增教研分析回调

wangliang 3 år sedan
förälder
incheckning
a17a9af2b0

+ 0 - 12
distributed-print/src/main/java/com/qmth/distributed/print/api/TSAuthController.java

@@ -157,17 +157,5 @@ public class TSAuthController {
         if (Objects.nonNull(result)) {
             log.info("result:{}", JacksonUtil.parseJson(result));
         }
-
-//        /**
-//         * 测试删除分析课程(试卷)
-//         */
-//        Map<String, Object> map = new HashMap<>();
-//        map.computeIfAbsent("examId", v -> 262946761763454976L);
-//        map.computeIfAbsent("courseCode", v -> 2022052700001L + "A");//试卷编号+卷型
-//        String accessToken = SignatureEntity.build(SignatureType.SECRET, SystemConstant.METHOD, dictionaryConfig.reportOpenDomain().getCourseDelApi(), timestamp, basicSchool.getAccessKey(), basicSchool.getAccessSecret());
-//        String result = HttpUtil.postJson(dictionaryConfig.reportOpenDomain().getHostUrl() + dictionaryConfig.reportOpenDomain().getCourseDelApi(), JacksonUtil.parseJson(map), accessToken, timestamp);
-//        if (Objects.nonNull(result)) {
-//            log.info("result:{}", JacksonUtil.parseJson(result));
-//        }
     }
 }

+ 11 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/params/BasicSemesterParams.java

@@ -42,6 +42,9 @@ public class BasicSemesterParams implements Serializable {
     @DBVerify(value = "学期结束时间", required = true, min = 1)
     private Long endTime;
 
+    @ApiModelProperty(value = "启用/禁用,ture:启用,false:禁用,默认启用")
+    Boolean enable = true;
+
     public BasicSemesterParams() {
 
     }
@@ -68,6 +71,14 @@ public class BasicSemesterParams implements Serializable {
         Optional.ofNullable(this.getEndTime()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("学期结束时间为空"));
     }
 
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
     public Long getId() {
         return id;
     }

+ 11 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/params/CourseParam.java

@@ -33,6 +33,9 @@ public class CourseParam implements Serializable {
     @ApiModelProperty(value = "开课机构名称(命题机构)")
     private String teachCollegeName;
 
+    @ApiModelProperty(value = "启用/禁用,ture:启用,false:禁用,默认启用")
+    Boolean enable = true;
+
     /**
      * 参数校验
      */
@@ -51,6 +54,14 @@ public class CourseParam implements Serializable {
         Optional.ofNullable(this.getTeachCollegeName()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("开课机构名称为空"));
     }
 
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 11 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/bean/params/TBExamParam.java

@@ -40,6 +40,9 @@ public class TBExamParam {
     @Range(min = 1L, message = "请输入所属学期id")
     private Long semesterId;
 
+    @ApiModelProperty(value = "启用/禁用,ture:启用,false:禁用,默认启用")
+    Boolean enable = true;
+
     /**
      * 参数校验
      */
@@ -49,6 +52,14 @@ public class TBExamParam {
         Optional.ofNullable(this.getSemesterId()).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("学期id为空"));
     }
 
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
     public Long getId() {
         return id;
     }

+ 0 - 28
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/OpenApiController.java

@@ -1,7 +1,6 @@
 package com.qmth.teachcloud.report.api;
 
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.qmth.boot.api.annotation.Aac;
 import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
@@ -9,7 +8,6 @@ import com.qmth.teachcloud.common.SignatureEntityTest;
 import com.qmth.teachcloud.common.bean.params.BasicSemesterParams;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.service.BasicCourseService;
@@ -17,7 +15,6 @@ import com.qmth.teachcloud.common.service.BasicSemesterService;
 import com.qmth.teachcloud.common.util.*;
 import com.qmth.teachcloud.report.business.bean.params.CourseParam;
 import com.qmth.teachcloud.report.business.bean.params.TBExamParam;
-import com.qmth.teachcloud.report.business.entity.TBExamCourse;
 import com.qmth.teachcloud.report.business.service.TBExamCourseService;
 import com.qmth.teachcloud.report.business.service.TBExamService;
 import io.swagger.annotations.*;
@@ -116,31 +113,6 @@ public class OpenApiController {
         return ResultUtil.ok(true);
     }
 
-    @ApiOperation(value = "分析课程(试卷)删除接口")
-    @ApiResponses({@ApiResponse(code = 200, message = "分析课程(试卷)删除接口", response = Object.class)})
-    @RequestMapping(value = "/course_del", method = RequestMethod.POST)
-    @Aac(auth = BOOL.FALSE)
-    @Transactional
-    public Result courseDel(@ApiParam(value = "接收分析课程(试卷)数据信息", required = true) @RequestBody String result) throws IOException, InterruptedException {
-        Optional.ofNullable(result).orElseThrow(() -> ExceptionResultEnum.PARAMS_ERROR.exception("数据为空"));
-        String decodeJson = URLDecoder.decode(result, SystemConstant.CHARSET_NAME);
-        log.info("courseDel进来了进来了,result:{}", decodeJson);
-        CourseParam courseParam = JacksonUtil.readJson(decodeJson, CourseParam.class);
-        courseParam.validParamsExamIdAndCourseCode();
-        BasicSchool basicSchool = AuthThirdUtil.hasPermission();
-        QueryWrapper<BasicCourse> basicCourseQueryWrapper = new QueryWrapper<>();
-        basicCourseQueryWrapper.lambda().eq(BasicCourse::getSchoolId, basicSchool.getId())
-                .eq(BasicCourse::getCode, courseParam.getCourseCode());
-        basicCourseService.remove(basicCourseQueryWrapper);
-
-        QueryWrapper<TBExamCourse> tbExamCourseQueryWrapper = new QueryWrapper<>();
-        tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getSchoolId, basicSchool.getId())
-                .eq(TBExamCourse::getCourseCode, courseParam.getCourseCode())
-                .eq(TBExamCourse::getExamId, courseParam.getExamId());
-        tbExamCourseService.remove(tbExamCourseQueryWrapper);
-        return ResultUtil.ok(true);
-    }
-
     @ApiOperation(value = "生成课程(试卷)分析报告接口")
     @ApiResponses({@ApiResponse(code = 200, message = "生成课程(试卷)分析报告接口", response = Object.class)})
     @RequestMapping(value = "/calculate", method = RequestMethod.POST)