|
@@ -133,36 +133,6 @@ public class OpenApiController {
|
|
|
Optional.ofNullable(callbackPwd).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("配置文件回调密码为空"));
|
|
|
|
|
|
courseCodeSyncTaskService.start(calculateParams);
|
|
|
-// try {
|
|
|
-// BigDecimal progress = new BigDecimal(0);
|
|
|
-// BigDecimal finished = new BigDecimal(1);
|
|
|
-// for (int i = 0; i < calculateParams.getCourseCode().size(); i++) {
|
|
|
-// progress = new BigDecimal(i).divide(new BigDecimal(calculateParams.getCourseCode().size() - 1), 2, BigDecimal.ROUND_HALF_UP).setScale(2, BigDecimal.ROUND_HALF_UP);
|
|
|
-// Long time = System.currentTimeMillis();
|
|
|
-// JSONObject dataObjectJson = new JSONObject();
|
|
|
-// dataObjectJson.put("examId", calculateParams.getExamId());
|
|
|
-// dataObjectJson.put("courseCode", calculateParams.getCourseCode().get(i));
|
|
|
-// dataObjectJson.put("progress", progress);
|
|
|
-// if (progress.compareTo(finished) == 0) {
|
|
|
-// dataObjectJson.put("status", "FINISHED");
|
|
|
-// } else {
|
|
|
-// dataObjectJson.put("status", "RUNNING");
|
|
|
-// }
|
|
|
-// dataObjectJson.put("time", time);
|
|
|
-//
|
|
|
-// String sign = URLEncoder.encode(Base64Util.encode(ShaUtils.sha1(callbackPwd + dataObjectJson.toJSONString())), SystemConstant.CHARSET_NAME);
|
|
|
-// String callbackResult = HttpUtil.postJson(dictionaryConfig.printOpenDomain().getHostUrl() + dictionaryConfig.printOpenDomain().getCallbackUrlApi(), dataObjectJson.toJSONString(), sign, time);
|
|
|
-// if (Objects.nonNull(callbackResult)) {
|
|
|
-// log.info("callbackResult:{}", JacksonUtil.parseJson(callbackResult));
|
|
|
-// }
|
|
|
-// if (progress.compareTo(finished) == 0) {
|
|
|
-// break;
|
|
|
-// }
|
|
|
-//// Thread.sleep(5000);
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// log.error(SystemConstant.LOG_ERROR, e);
|
|
|
-// }
|
|
|
return ResultUtil.ok(true);
|
|
|
}
|
|
|
}
|