Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
923a4c29
Commit
923a4c29
authored
Jul 03, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
80c472c7
464fb1ff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
32 deletions
+52
-32
EnergyAccessController.java
...t/module/jxiop/biz/controller/EnergyAccessController.java
+2
-2
EnergyAccessService.java
...os/boot/module/jxiop/biz/service/EnergyAccessService.java
+2
-2
EnergyAccessServiceImpl.java
...odule/jxiop/biz/service/impl/EnergyAccessServiceImpl.java
+48
-28
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/EnergyAccessController.java
View file @
923a4c29
...
...
@@ -23,14 +23,14 @@ public class EnergyAccessController extends BaseController {
@RequestMapping
(
value
=
"/getInstalledCapacity"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取并网容量"
,
notes
=
"获取并网容量"
)
public
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
int
current
,
int
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
public
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
String
current
,
String
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
return
energyAccessServiceImpl
.
getInstalledCapacity
(
current
,
pageSize
,
code
,
sourceStationId
,
tp
);
}
@RequestMapping
(
value
=
"/getQuotaCompleteInfo"
,
method
=
RequestMethod
.
GET
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取片区指标完成情况"
,
notes
=
"获取片区指标完成情况"
)
public
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
int
current
,
int
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
public
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
String
current
,
String
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
return
energyAccessServiceImpl
.
getQuotaCompleteInfo
(
current
,
pageSize
,
code
,
sourceStationId
,
tp
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/EnergyAccessService.java
View file @
923a4c29
...
...
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
java.util.Map
;
public
interface
EnergyAccessService
{
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
int
current
,
int
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
);
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
String
current
,
String
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
);
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
int
current
,
int
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
);
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
String
current
,
String
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
);
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/EnergyAccessServiceImpl.java
View file @
923a4c29
...
...
@@ -9,6 +9,7 @@ import com.yeejoin.amos.boot.module.jxiop.biz.service.EnergyAccessService;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.CollectionUtils
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
...
...
@@ -23,7 +24,7 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
private
HttpRequestUtil
httpRequestUtil
;
@Override
public
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
int
current
,
int
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
public
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
String
current
,
String
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
//改为部盾接口
StringBuilder
requestUrl
=
new
StringBuilder
(
Constants
.
BASE_URL
).
append
(
"?"
).
append
(
Constants
.
get_station_actual_installed_capacity
);
if
(
StringUtils
.
isNotEmpty
(
code
))
{
...
...
@@ -41,21 +42,32 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
Constants
.
resovleRule_data
);
List
returnList
=
data
.
getJSONArray
(
"data"
);
Page
<
Map
<
String
,
Object
>>
pegaIPage
=
new
Page
<
Map
<
String
,
Object
>>();
pegaIPage
.
setCurrent
(
current
);
pegaIPage
.
setSize
(
pageSize
);
pegaIPage
.
setTotal
(
returnList
.
size
());
int
endIndex
=
current
*
pageSize
;
if
(
returnList
.
size
()
>
endIndex
){
pegaIPage
.
setRecords
(
returnList
.
subList
(((
current
-
1
)
*
pageSize
),
endIndex
));
}
else
{
pegaIPage
.
setRecords
(
returnList
.
subList
(((
current
-
1
)
*
pageSize
),
returnList
.
size
()));
Page
<
Map
<
String
,
Object
>>
pageIPage
;
int
newCurrent
=
Integer
.
parseInt
(
current
);
int
newPageSize
=
Integer
.
parseInt
(
pageSize
);
if
(
StringUtils
.
isBlank
(
pageSize
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageIPage
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageIPage
=
new
Page
<>(
newCurrent
,
newPageSize
);
}
if
(
CollectionUtils
.
isEmpty
(
returnList
))
{
return
pageIPage
;
}
return
pegaIPage
;
pageIPage
.
setTotal
(
returnList
.
size
());
int
endIndex
=
newCurrent
*
newPageSize
;
if
(
returnList
.
size
()
>
endIndex
)
{
pageIPage
.
setRecords
(
returnList
.
subList
(((
newCurrent
-
1
)
*
newPageSize
),
endIndex
));
}
else
{
pageIPage
.
setRecords
(
returnList
.
subList
(((
newCurrent
-
1
)
*
newPageSize
),
returnList
.
size
()));
}
return
pageIPage
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
int
current
,
int
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
public
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
String
current
,
String
pageSize
,
String
code
,
String
sourceStationId
,
String
tp
)
{
//改为部盾接口
StringBuilder
requestUrl
=
new
StringBuilder
(
Constants
.
BASE_URL
).
append
(
"?"
).
append
(
Constants
.
get_quota_complate_info
);
LocalDate
currentDate
=
LocalDate
.
now
();
...
...
@@ -78,33 +90,41 @@ public class EnergyAccessServiceImpl implements EnergyAccessService {
List
returnList
=
data
.
getJSONArray
(
"data"
);
//rate的值去掉百分号,名称字段名统一用name代替
Page
<
Map
<
String
,
Object
>>
pageIPage
;
int
newCurrent
=
Integer
.
parseInt
(
current
);
int
newPageSize
=
Integer
.
parseInt
(
pageSize
);
if
(
StringUtils
.
isBlank
(
pageSize
)
||
StringUtils
.
isBlank
(
pageSize
))
{
pageIPage
=
new
Page
<>(
0
,
Long
.
MAX_VALUE
);
}
else
{
pageIPage
=
new
Page
<>(
newCurrent
,
newPageSize
);
}
if
(
CollectionUtils
.
isEmpty
(
returnList
))
{
return
pageIPage
;
}
returnList
.
forEach
(
result
->
{
String
oldName
=
""
;
JSONObject
jsonObject
=
(
JSONObject
)
result
;
JSONObject
jsonObject
=
(
JSONObject
)
result
;
String
rate
=
jsonObject
.
getString
(
"rate"
);
if
(
StringUtils
.
isNotEmpty
(
rate
))
{
jsonObject
.
put
(
"rate"
,
rate
.
replace
(
"%"
,
""
));
if
(
StringUtils
.
isNotEmpty
(
rate
))
{
jsonObject
.
put
(
"rate"
,
rate
.
replace
(
"%"
,
""
));
}
if
(
"1"
.
equals
(
tp
))
{
if
(
"1"
.
equals
(
tp
))
{
oldName
=
jsonObject
.
getString
(
"station_name"
);
jsonObject
.
remove
(
"station_name"
);
}
else
{
}
else
{
oldName
=
jsonObject
.
getString
(
"area_name"
);
jsonObject
.
remove
(
"area_name"
);
}
jsonObject
.
put
(
"name"
,
oldName
);
jsonObject
.
put
(
"name"
,
oldName
);
});
Page
<
Map
<
String
,
Object
>>
pegaIPage
=
new
Page
<
Map
<
String
,
Object
>>();
pegaIPage
.
setCurrent
(
current
);
pegaIPage
.
setSize
(
pageSize
);
pegaIPage
.
setTotal
(
returnList
.
size
());
int
endIndex
=
current
*
pageSize
;
if
(
returnList
.
size
()
>
endIndex
){
pegaIPage
.
setRecords
(
returnList
.
subList
(((
current
-
1
)
*
pageSize
),
endIndex
));
}
else
{
pegaIPage
.
setRecords
(
returnList
.
subList
(((
current
-
1
)
*
pageSize
),
returnList
.
size
()));
pageIPage
.
setTotal
(
returnList
.
size
());
int
endIndex
=
newCurrent
*
newPageSize
;
if
(
returnList
.
size
()
>
endIndex
)
{
pageIPage
.
setRecords
(
returnList
.
subList
(((
newCurrent
-
1
)
*
newPageSize
),
endIndex
));
}
else
{
pageIPage
.
setRecords
(
returnList
.
subList
(((
newCurrent
-
1
)
*
newPageSize
),
returnList
.
size
()));
}
return
p
ega
IPage
;
return
p
age
IPage
;
}
}
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