mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 11:26:50 +08:00
成长路径图,考试绑定
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.ListUtil;
|
||||
import cn.hutool.core.lang.Opt;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.nacos.shaded.com.google.gson.Gson;
|
||||
import com.xboe.api.vo.*;
|
||||
import com.xboe.module.course.vo.StudyCourseVo;
|
||||
import com.xboe.module.course.vo.TeacherInfoVo;
|
||||
@@ -11,11 +12,9 @@ import com.xboe.module.course.vo.TeacherVo;
|
||||
import com.xboe.module.dict.entity.DictDto;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import com.xboe.system.user.dao.UserDao;
|
||||
import com.xboe.system.user.entity.User;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ForkJoinPool;
|
||||
@@ -63,6 +62,9 @@ public class ThirdApi {
|
||||
@Value("${userBasic.getUserIdByWorkNum}")
|
||||
private String getUserIdByWorkNum;
|
||||
|
||||
@Value("${coursesuilt.checkBanding}")
|
||||
private String checkBanding;
|
||||
|
||||
//获取例外人员的id
|
||||
public List<String> getUserId(){
|
||||
String responseBody = Optional.ofNullable(HttpRequest.get(infarasApiUrl+"?pid=316&type=1").execute() //prod 316
|
||||
@@ -237,4 +239,15 @@ public class ThirdApi {
|
||||
HashMap<String, String> result = getUserIdByWorkNumResult.getResult();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public String checkExamBanding(String testId, String token){
|
||||
String url = checkBanding+"?testId=" + testId;
|
||||
String resp = Optional.ofNullable(
|
||||
HttpRequest.get(url).header("token", token).execute().body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||
Gson gson = new Gson();
|
||||
CheckExamBandingBean checkExamBandingBean = gson.fromJson(resp, CheckExamBandingBean.class);
|
||||
return checkExamBandingBean.getData();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.xboe.api.vo;
|
||||
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.xboe.school.study.entity.StudyCourse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Slf4j
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CheckExamBandingBean {
|
||||
|
||||
private boolean show;
|
||||
private String version;
|
||||
private int code;
|
||||
private String msg;
|
||||
private String data;
|
||||
private boolean success;
|
||||
|
||||
public CheckExamBandingBean success() {
|
||||
if (this.code!=200) {
|
||||
log.error("获取绑定关系失败----{}", JSONUtil.toJsonPrettyStr(this));
|
||||
return null;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.xboe.module.exam.api;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.xboe.api.ThirdApi;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -29,6 +32,9 @@ public class ExamTestApi extends ApiBaseController {
|
||||
|
||||
@Resource
|
||||
private IExamTestService examTestService;
|
||||
|
||||
@Resource
|
||||
private ThirdApi thirdApi;
|
||||
|
||||
/**
|
||||
*查询考试,分页,搜索,资源归属,状态
|
||||
@@ -111,11 +117,21 @@ public class ExamTestApi extends ApiBaseController {
|
||||
* */
|
||||
@GetMapping("/delete")
|
||||
@AutoLog(module = "考试",action = "删除考试",info = "删除考试")
|
||||
public JsonResponse<Boolean> delete(String id){
|
||||
public JsonResponse<Boolean> delete(String id, HttpServletRequest request){
|
||||
if(StringUtil.isBlank(id)){
|
||||
return badRequest("缺少必要参数");
|
||||
}
|
||||
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
if (StringUtil.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
|
||||
try {
|
||||
String bandInfo = thirdApi.checkExamBanding(id, token);
|
||||
if (StringUtils.isNotBlank(bandInfo)){
|
||||
return error("删除失败",bandInfo);
|
||||
}
|
||||
examTestService.delete(id);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -74,4 +74,5 @@ manageApi.stu.offcourse=${boe.domain}/manageApi/stu/offcourse/getOffCourseId
|
||||
#获取离职教师id
|
||||
userBasic.getTeacherIds=${boe.domain}/userbasic/user/getTeacherInfo
|
||||
userBasic.getUserIdByWorkNum=${boe.domain}/userbasic/user/getUserIdByWorkNum
|
||||
coursesuilt.getStudyStatus=${boe.domain}/manageApi/stu/project/completeStatus
|
||||
coursesuilt.getStudyStatus=${boe.domain}/manageApi/stu/project/completeStatus
|
||||
coursesuilt.checkBanding=${boe.domain}/manageApi/stu/task/exam/checkBanding
|
||||
Reference in New Issue
Block a user