Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gf_back
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tianchao
gf_back
Commits
dbb59cc8
Commit
dbb59cc8
authored
Mar 18, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nocommit
parent
36d9b7fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/WellheadDailyProductionSituationService.java
...tion/service/WellheadDailyProductionSituationService.java
+8
-7
No files found.
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/WellheadDailyProductionSituationService.java
View file @
dbb59cc8
...
@@ -151,16 +151,15 @@ public class WellheadDailyProductionSituationService {
...
@@ -151,16 +151,15 @@ public class WellheadDailyProductionSituationService {
String
token
;
String
token
;
ThirdPartyConfigCache
exist
=
ThirdPartyConfigCache
.
exist
(
context
,
ThirdPartyApiConstant
.
CQ_TOKEN_CACHE_KEY
);
ThirdPartyConfigCache
exist
=
ThirdPartyConfigCache
.
exist
(
context
,
ThirdPartyApiConstant
.
CQ_TOKEN_CACHE_KEY
);
if
(
ObjectUtil
.
isNull
(
exist
))
{
if
(
ObjectUtil
.
isNull
(
exist
))
{
token
=
this
.
getCqToken
();
token
=
this
.
getCqToken
(
context
);
this
.
setThirdPartyConfigCache
(
context
,
token
);
}
else
{
}
else
{
long
between
=
DateUtil
.
between
(
exist
.
getCurrentDate
(),
DateUtil
.
date
(),
DateUnit
.
SECOND
);
long
between
=
DateUtil
.
between
(
exist
.
getCurrentDate
(),
DateUtil
.
date
(),
DateUnit
.
SECOND
);
long
duration
=
(
long
)
exist
.
getDuration
();
long
duration
=
(
long
)
exist
.
getDuration
();
if
(
duration
-
between
<
300
)
{
if
(
duration
-
between
<
300
)
{
token
=
this
.
getCqToken
();
token
=
this
.
getCqToken
(
context
);
this
.
setThirdPartyConfigCache
(
context
,
token
);
}
else
{
token
=
exist
.
getCode
();
}
}
token
=
exist
.
getCode
();
}
}
return
token
;
return
token
;
}
}
...
@@ -170,7 +169,7 @@ public class WellheadDailyProductionSituationService {
...
@@ -170,7 +169,7 @@ public class WellheadDailyProductionSituationService {
*
*
* @return {@link String}
* @return {@link String}
*/
*/
private
String
getCqToken
()
{
private
String
getCqToken
(
XContext
context
)
{
String
url
=
XStartup
.
getCurrent
().
getProperty
(
"third-party.chang-qing.url"
);
String
url
=
XStartup
.
getCurrent
().
getProperty
(
"third-party.chang-qing.url"
);
url
+=
ThirdPartyApiConstant
.
CQ_TOKEN
;
url
+=
ThirdPartyApiConstant
.
CQ_TOKEN
;
Map
<
String
,
String
>
param
=
new
HashMap
<>(
4
);
Map
<
String
,
String
>
param
=
new
HashMap
<>(
4
);
...
@@ -178,7 +177,9 @@ public class WellheadDailyProductionSituationService {
...
@@ -178,7 +177,9 @@ public class WellheadDailyProductionSituationService {
param
.
put
(
"UserPassWord"
,
"PvGroup@147369"
);
param
.
put
(
"UserPassWord"
,
"PvGroup@147369"
);
String
result
=
XHttpUtils
.
postAsForm
(
url
,
param
);
String
result
=
XHttpUtils
.
postAsForm
(
url
,
param
);
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
JSONObject
jsonObject
=
JSONUtil
.
parseObj
(
result
);
return
jsonObject
.
getStr
(
"token"
);
String
token
=
jsonObject
.
getStr
(
"token"
);
this
.
setThirdPartyConfigCache
(
context
,
token
);
return
token
;
}
}
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment