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
4a4fe47f
Commit
4a4fe47f
authored
Jul 03, 2024
by
lilongyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、新增获取并网容量,获取片区指标完成情况接口
parent
b955e5d3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
174 additions
and
0 deletions
+174
-0
EnergyAccessController.java
...t/module/jxiop/biz/controller/EnergyAccessController.java
+38
-0
InstalledCapacity.java
...oin/amos/boot/module/jxiop/biz/dto/InstalledCapacity.java
+15
-0
EnergyAccessService.java
...os/boot/module/jxiop/biz/service/EnergyAccessService.java
+11
-0
EnergyAccessServiceImpl.java
...odule/jxiop/biz/service/impl/EnergyAccessServiceImpl.java
+110
-0
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
0 → 100644
View file @
4a4fe47f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.EnergyAccessServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
java.util.Map
;
@RestController
@Api
(
tags
=
"能源接入相关接口"
)
@RequestMapping
(
value
=
"/energyAccess"
)
public
class
EnergyAccessController
extends
BaseController
{
@Autowired
EnergyAccessServiceImpl
energyAccessServiceImpl
;
@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
)
{
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
)
{
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/dto/InstalledCapacity.java
0 → 100644
View file @
4a4fe47f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
dto
;
import
lombok.Data
;
@Data
public
class
InstalledCapacity
{
//片区名
String
areaName
;
//场站名
String
stationName
;
//场站数量
String
stationCount
;
//装机容量
String
actualInstalledCapacity
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-bigscreen-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/EnergyAccessService.java
0 → 100644
View file @
4a4fe47f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
;
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
>>
getQuotaCompleteInfo
(
int
current
,
int
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
0 → 100644
View file @
4a4fe47f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.Constants
;
import
com.yeejoin.amos.boot.module.jxiop.api.util.HttpRequestUtil
;
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
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
@Service
public
class
EnergyAccessServiceImpl
implements
EnergyAccessService
{
@Autowired
private
HttpRequestUtil
httpRequestUtil
;
@Override
public
Page
<
Map
<
String
,
Object
>>
getInstalledCapacity
(
int
current
,
int
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
))
{
requestUrl
.
append
(
"&code="
).
append
(
code
);
}
if
(
StringUtils
.
isNotEmpty
(
sourceStationId
))
{
requestUrl
.
append
(
"&source_station_id="
).
append
(
sourceStationId
);
}
if
(
StringUtils
.
isNotEmpty
(
tp
))
{
requestUrl
.
append
(
"&tp="
).
append
(
tp
);
}
JSONObject
data
=
httpRequestUtil
.
getResPonse
(
requestUrl
.
toString
(),
Constants
.
REQUEST_GET
,
""
,
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
()));
}
return
pegaIPage
;
}
@Override
public
Page
<
Map
<
String
,
Object
>>
getQuotaCompleteInfo
(
int
current
,
int
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
();
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd"
);
String
formattedDate
=
currentDate
.
format
(
formatter
);
requestUrl
.
append
(
"&reporting_data="
).
append
(
formattedDate
);
if
(
StringUtils
.
isNotEmpty
(
code
))
{
requestUrl
.
append
(
"&code="
).
append
(
code
);
}
if
(
StringUtils
.
isNotEmpty
(
sourceStationId
))
{
requestUrl
.
append
(
"&source_station_id="
).
append
(
sourceStationId
);
}
if
(
StringUtils
.
isNotEmpty
(
tp
))
{
requestUrl
.
append
(
"&tp="
).
append
(
tp
);
}
JSONObject
data
=
httpRequestUtil
.
getResPonse
(
requestUrl
.
toString
(),
Constants
.
REQUEST_GET
,
""
,
Constants
.
resovleRule_data
);
List
returnList
=
data
.
getJSONArray
(
"data"
);
//rate的值去掉百分号,名称字段名统一用name代替
returnList
.
forEach
(
result
->
{
String
oldName
=
""
;
JSONObject
jsonObject
=
(
JSONObject
)
result
;
String
rate
=
jsonObject
.
getString
(
"rate"
);
if
(
StringUtils
.
isNotEmpty
(
rate
)){
jsonObject
.
put
(
"rate"
,
rate
.
replace
(
"%"
,
""
));
}
if
(
"1"
.
equals
(
tp
)){
oldName
=
jsonObject
.
getString
(
"station_name"
);
jsonObject
.
remove
(
"station_name"
);
}
else
{
oldName
=
jsonObject
.
getString
(
"area_name"
);
jsonObject
.
remove
(
"area_name"
);
}
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
()));
}
return
pegaIPage
;
}
}
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