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
bae94151
Commit
bae94151
authored
Mar 18, 2024
by
ZWT
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nocommit
parent
cee6219f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
10 deletions
+58
-10
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/WellheadDailyProductionSituationService.java
...tion/service/WellheadDailyProductionSituationService.java
+35
-6
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/data/wellhead_daily_production_situation/GetWellRealPvOutput.java
...lhead_daily_production_situation/GetWellRealPvOutput.java
+23
-4
No files found.
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/WellheadDailyProductionSituationService.java
View file @
bae94151
...
@@ -8,6 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -8,6 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.page.PageMethod
;
import
com.github.pagehelper.page.PageMethod
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
pps.cloud.base.service.IBasePowerLineCloudService
;
import
pps.cloud.base.service.data.base_power_line_wellhead.DynamicQueryBasePowerLineWellheadInput
;
import
pps.cloud.base.service.data.base_power_line_wellhead.DynamicQueryBasePowerLineWellheadViewOutput
;
import
pps.core.auth.HttpRequestClient
;
import
pps.core.auth.HttpRequestClient
;
import
pps.core.prediction.constant.ThirdPartyApiConstant
;
import
pps.core.prediction.constant.ThirdPartyApiConstant
;
import
pps.core.prediction.entity.WellheadDailyProductionSituationEnt
;
import
pps.core.prediction.entity.WellheadDailyProductionSituationEnt
;
...
@@ -26,10 +29,8 @@ import xstartup.feature.api.annotation.XApiAnonymous;
...
@@ -26,10 +29,8 @@ import xstartup.feature.api.annotation.XApiAnonymous;
import
xstartup.feature.api.annotation.XApiGet
;
import
xstartup.feature.api.annotation.XApiGet
;
import
xstartup.feature.api.annotation.XApiPost
;
import
xstartup.feature.api.annotation.XApiPost
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.stream.Collectors
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 井口生产情况模块
* 井口生产情况模块
...
@@ -101,10 +102,31 @@ public class WellheadDailyProductionSituationService {
...
@@ -101,10 +102,31 @@ public class WellheadDailyProductionSituationService {
return
XListResult
.
success
(
outputs
);
return
XListResult
.
success
(
outputs
);
}
}
/**
* 油井状态
* POST /prediction/wellhead-daily-production-situation/query-well-real-pv-data
* 接口ID:156558765
* 接口地址:https://app.apifox.com/project/3196988/apis/api-156558765
*
* @param context 上下文
* @param input 输入
* @return {@link XListResult}<{@link GetWellRealPvOutput}>
*/
@XApiAnonymous
@XApiAnonymous
@XText
(
"井口生产情况--油井状态"
)
@XText
(
"井口生产情况--油井状态"
)
@XApiPost
@XApiPost
public
XListResult
<
GetWellRealPvOutput
>
queryWellRealPvData
(
XContext
context
,
GetWellRealPvInput
input
)
{
public
XListResult
<
GetWellRealPvOutput
>
queryWellRealPvData
(
XContext
context
,
GetWellRealPvInput
input
)
{
IBasePowerLineCloudService
service
=
context
.
getBean
(
IBasePowerLineCloudService
.
class
);
XListResult
<
DynamicQueryBasePowerLineWellheadViewOutput
>
result
=
service
.
getPowerLineWellheadList
(
context
,
DynamicQueryBasePowerLineWellheadInput
.
builder
()
.
lineId
(
input
.
getLineId
())
.
build
()
);
result
.
throwIfFail
();
List
<
GetWellRealPvOutput
>
outputs
;
List
<
DynamicQueryBasePowerLineWellheadViewOutput
>
list
=
result
.
getResult
();
if
(
CollUtil
.
isEmpty
(
list
))
{
return
XListResult
.
success
(
new
ArrayList
<>(
0
));
}
String
token
=
ServiceUtil
.
getToken
(
context
);
String
token
=
ServiceUtil
.
getToken
(
context
);
HttpRequestClient
client
=
new
HttpRequestClient
(
token
);
HttpRequestClient
client
=
new
HttpRequestClient
(
token
);
String
url
=
XStartup
.
getCurrent
().
getProperty
(
"third-party.chang-qing.url"
);
String
url
=
XStartup
.
getCurrent
().
getProperty
(
"third-party.chang-qing.url"
);
...
@@ -112,9 +134,16 @@ public class WellheadDailyProductionSituationService {
...
@@ -112,9 +134,16 @@ public class WellheadDailyProductionSituationService {
String
resultStr
=
client
.
doPostForm
(
url
,
new
HashMap
<>(
0
));
String
resultStr
=
client
.
doPostForm
(
url
,
new
HashMap
<>(
0
));
JSONObject
jsonObject
=
JSON
.
parseObject
(
resultStr
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
resultStr
);
String
data
=
jsonObject
.
getString
(
"data"
);
String
data
=
jsonObject
.
getString
(
"data"
);
List
<
GetWellRealPvOutput
>
outputs
=
JSON
.
parseArray
(
data
,
GetWellRealPvOutput
.
class
);
outputs
=
JSON
.
parseArray
(
data
,
GetWellRealPvOutput
.
class
);
if
(
CollUtil
.
isEmpty
(
outputs
))
{
if
(
CollUtil
.
isEmpty
(
outputs
))
{
outputs
=
new
ArrayList
<>(
0
);
return
XListResult
.
success
(
new
ArrayList
<>(
0
));
}
else
{
Set
<
String
>
collect
=
list
.
stream
()
.
map
(
DynamicQueryBasePowerLineWellheadViewOutput:
:
getWellNumber
)
.
collect
(
Collectors
.
toSet
());
outputs
=
outputs
.
stream
()
.
filter
(
o
->
collect
.
contains
(
o
.
getWellNumber
()))
.
collect
(
Collectors
.
toList
());
}
}
return
XListResult
.
success
(
outputs
);
return
XListResult
.
success
(
outputs
);
}
}
...
...
C12-prediction/pps-core-prediction/src/main/java/pps/core/prediction/service/data/wellhead_daily_production_situation/GetWellRealPvOutput.java
View file @
bae94151
package
pps.core.prediction.service.data.wellhead_daily_production_situation
;
package
pps.core.prediction.service.data.wellhead_daily_production_situation
;
import
jakarta.validation.constraints.NotBlank
;
import
com.alibaba.fastjson2.annotation.JSONField
;
import
lombok.Data
;
import
lombok.Data
;
import
xstartup.annotation.XText
;
import
xstartup.annotation.XText
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
/**
* 油井状态
* 油井状态
*
*
...
@@ -13,7 +16,23 @@ import xstartup.annotation.XText;
...
@@ -13,7 +16,23 @@ import xstartup.annotation.XText;
@Data
@Data
public
class
GetWellRealPvOutput
{
public
class
GetWellRealPvOutput
{
@XText
(
"线路ID"
)
@XText
(
"井号"
)
@NotBlank
(
message
=
"缺少线路ID"
)
@JSONField
(
name
=
"welL_NAME"
)
private
String
lineId
;
private
String
wellNumber
;
@XText
(
"下次启停时间"
)
@JSONField
(
name
=
"next_ExecDate"
)
private
Date
nextTime
;
@XText
(
"井口状态:停井/开井"
)
@JSONField
(
name
=
"status"
)
private
String
status
;
@XText
(
"累计产液量"
)
@JSONField
(
name
=
"reaL_LIQUID_DAILY"
)
private
BigDecimal
realLiquidProduction
;
@XText
(
"累计开井时长"
)
@JSONField
(
name
=
"starthours"
)
private
Integer
hours
;
}
}
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