Commit 895053e3 by 涂亚平

oss

1 parent ac283de3
......@@ -26,7 +26,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* 企业职工线上培训
*/
//@Component
@Component
public class RenSheJuJob {
......@@ -118,7 +118,7 @@ public class RenSheJuJob {
// renSheJuService.getErrorClass();
// }
@Scheduled(cron = "0 50 23 * * ?")
@Scheduled(cron = "0 30 23 * * ?")
@Transactional(rollbackFor = Exception.class)
public void logout(){
//让当前用户下线
......@@ -140,7 +140,7 @@ public class RenSheJuJob {
}
@Scheduled(cron = "0 55 23 * * ?")
@Scheduled(cron = "0 50 23 * * ?")
@Transactional(rollbackFor = Exception.class)
public void cancelLogin() {
......
......@@ -102,26 +102,26 @@ public class RenSheJuServiceImpl implements RenSheJuService {
System.out.println(JSONObject.fromObject(classBaseInfoDTO).toString());
// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString());
// Request request = new Request.Builder()
// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClass")
// .method("POST", body)
// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
// .addHeader("Content-Type", "application/json")
// .build();
// Response response = client.newCall(request).execute();
//
// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
// if (200 == response.code()) {
// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
// } else {
// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
// }
// renshejuHistoryMapper.insert(renshejuHistoryDO);
// return rensheResponseVO;
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classBaseInfoDTO).toString());
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClass")
.method("POST", body)
.addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_2);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classBaseInfoDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
} else {
renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
}
renshejuHistoryMapper.insert(renshejuHistoryDO);
return rensheResponseVO;
// return null;
} else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
......@@ -217,27 +217,27 @@ public class RenSheJuServiceImpl implements RenSheJuService {
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(classHourBehaviorDTO));
if (classHourBasics.size()>0){
// RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
//
// Request request = new Request.Builder()
// .url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior")
// .method("POST", body)
// .addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
// .addHeader("Content-Type", "application/json")
// .build();
// Response response = client.newCall(request).execute();
//
// RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
// RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
// renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
// renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
// if (200 == response.code()) {
// renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
// } else {
// renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
// }
// renshejuHistoryMapper.insert(renshejuHistoryDO);
// return rensheResponseVO;
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(classHourBehaviorDTO).toString());
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadClassHourBehavior")
.method("POST", body)
.addHeader("User-Agent", "Apifox/1.0.0 (https://www.apifox.cn)")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
RensheResponseVO rensheResponseVO = JSON.parseObject(response.body().string(), RensheResponseVO.class);
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
renshejuHistoryDO.setInputParam(JSONObject.fromObject(classHourBehaviorDTO).toString());
if (200 == response.code()) {
renshejuHistoryDO.setOutputParam(rensheResponseVO.getCtt().toString());
} else {
renshejuHistoryDO.setOutputParam(RenSheJuConstant.API_ERROR);
}
renshejuHistoryMapper.insert(renshejuHistoryDO);
return rensheResponseVO;
}else {
RenshejuHistoryDO renshejuHistoryDO = new RenshejuHistoryDO();
renshejuHistoryDO.setInterfaceName(RenSheJuConstant.POST_3);
......@@ -549,7 +549,7 @@ public class RenSheJuServiceImpl implements RenSheJuService {
uploadImage.setImageDetailList(imageDetailLists);
if (imageDetailLists.size() > 0) {
System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage));
// System.out.println(com.alibaba.fastjson.JSONObject.toJSONString(uploadImage));
RequestBody body = RequestBody.create(mediaType, JSONObject.fromObject(uploadImage).toString());
Request request = new Request.Builder()
.url(renSheConfig.getUrl() + "/import/downstream/enterprise/uploadImage")
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!