Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
涂亚平
/
subsidy
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 895053e3
authored
Jun 07, 2023
by
涂亚平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oss
1 parent
ac283de3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
45 deletions
src/main/java/com/subsidy/jobs/RenSheJuJob.java
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
src/main/java/com/subsidy/jobs/RenSheJuJob.java
View file @
895053e
...
...
@@ -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
5
0 23 * * ?"
)
@Scheduled
(
cron
=
"0
3
0 23 * * ?"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
logout
(){
//让当前用户下线
...
...
@@ -140,7 +140,7 @@ public class RenSheJuJob {
}
@Scheduled
(
cron
=
"0 5
5
23 * * ?"
)
@Scheduled
(
cron
=
"0 5
0
23 * * ?"
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
cancelLogin
()
{
...
...
src/main/java/com/subsidy/service/impl/RenSheJuServiceImpl.java
View file @
895053e
...
...
@@ -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"
)
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment