|
@@ -5,6 +5,7 @@ import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
@@ -16,16 +17,15 @@ import com.github.pagehelper.Page;
|
|
|
import com.zhongzheng.common.exception.CustomException;
|
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
+import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
+import com.zhongzheng.common.utils.http.HttpUtils;
|
|
|
import com.zhongzheng.modules.bank.bo.*;
|
|
|
import com.zhongzheng.modules.bank.domain.Exam;
|
|
|
import com.zhongzheng.modules.bank.domain.ExamQuestion;
|
|
|
import com.zhongzheng.modules.bank.domain.QuestionBusiness;
|
|
|
import com.zhongzheng.modules.bank.domain.QuestionChapterExam;
|
|
|
import com.zhongzheng.modules.bank.mapper.ExamMapper;
|
|
|
-import com.zhongzheng.modules.bank.service.IExamQuestionService;
|
|
|
-import com.zhongzheng.modules.bank.service.IExamService;
|
|
|
-import com.zhongzheng.modules.bank.service.IQuestionBusinessService;
|
|
|
-import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
|
|
|
+import com.zhongzheng.modules.bank.service.*;
|
|
|
import com.zhongzheng.modules.bank.vo.ExamVo;
|
|
|
import com.zhongzheng.modules.bank.vo.QuestionChapterExamVo;
|
|
|
import com.zhongzheng.modules.course.domain.CourseBusiness;
|
|
@@ -39,6 +39,7 @@ import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
|
|
|
import com.zhongzheng.modules.user.bo.CheckUserExamRecordBo;
|
|
|
import com.zhongzheng.modules.user.service.IUserExamRecordService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
@@ -73,6 +74,11 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
private ExamMapper examMapper;
|
|
|
@Autowired
|
|
|
private IUserExamRecordService iUserExamRecordService;
|
|
|
+ @Autowired
|
|
|
+ private IQuestionOtherService iQuestionOtherService;
|
|
|
+
|
|
|
+ @Value("${oldSys.host}")
|
|
|
+ private String OLD_SYS_HOST;
|
|
|
|
|
|
@Override
|
|
|
public ExamVo queryById(Long examId){
|
|
@@ -340,4 +346,37 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
|
|
|
public Exam getExamByTenant(String code, Long newTenantId) {
|
|
|
return baseMapper.getExamByTenant(code, newTenantId);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean getShanDongExam() {
|
|
|
+ Long nowTime = DateUtils.getNowTime();
|
|
|
+ String sign = ToolsUtils.EncoderByMd5WithUtf("152301198304206010"+"土建质量员"+nowTime.toString() + "pubilc2022");
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ map.put("idnum","152301198304206010");
|
|
|
+ map.put("tenantId","867735392558919680");
|
|
|
+ map.put("username","袁红军");
|
|
|
+ map.put("majorname","土建质量员");
|
|
|
+ map.put("stamp",nowTime.toString());
|
|
|
+ map.put("sign",sign);
|
|
|
+ // JSONObject param = JSONObject.parseObject(JSONObject.toJSONString(map));
|
|
|
+ String respone = "";
|
|
|
+ String url = OLD_SYS_HOST+"/system/BussinessApi/InitQdyQuiz";
|
|
|
+ System.out.println(url);
|
|
|
+ try {
|
|
|
+ respone = HttpUtils.postFormBody(url, map);
|
|
|
+ QuestionOtherAddBo addBo = new QuestionOtherAddBo();
|
|
|
+ addBo.setJsonStr(respone);
|
|
|
+ addBo.setFromPlat(1);
|
|
|
+ addBo.setUserId(1L);
|
|
|
+ addBo.setMajorname("土建质量员");
|
|
|
+ iQuestionOtherService.insertByAddBo(addBo);
|
|
|
+ System.out.println(respone);
|
|
|
+ if (!respone.contains("\"msg\":\"获取成功\"")) {
|
|
|
+ throw new CustomException("同步请求错误" + respone);
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ throw new CustomException("同步请求错误" + e.getMessage());
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|