Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
fee95307
Commit
fee95307
authored
Sep 20, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加电站统计接口
parent
cafc9eac
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
142 additions
and
16 deletions
+142
-16
JpCollectorDto.java
...yeejoin/amos/boot/module/hygf/api/dto/JpCollectorDto.java
+1
-1
JpInverterDto.java
.../yeejoin/amos/boot/module/hygf/api/dto/JpInverterDto.java
+1
-1
JpCollector.java
...yeejoin/amos/boot/module/hygf/api/entity/JpCollector.java
+1
-1
JpInverter.java
.../yeejoin/amos/boot/module/hygf/api/entity/JpInverter.java
+1
-1
JpInverterMapper.java
...in/amos/boot/module/hygf/api/mapper/JpInverterMapper.java
+5
-0
JpStationMapper.java
...oin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
+4
-0
JpInverterMapper.xml
...-api/src/main/resources/mapper/mysql/JpInverterMapper.xml
+29
-0
JpStationMapper.xml
...f-api/src/main/resources/mapper/mysql/JpStationMapper.xml
+68
-1
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+32
-11
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/JpCollectorDto.java
View file @
fee95307
...
...
@@ -25,7 +25,7 @@ public class JpCollectorDto extends BaseDto {
private
String
snCode
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
state
;
private
String
state
;
@ApiModelProperty
(
value
=
"类型"
)
private
String
type
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/JpInverterDto.java
View file @
fee95307
...
...
@@ -26,7 +26,7 @@ public class JpInverterDto extends BaseDto {
private
String
snCode
;
@ApiModelProperty
(
value
=
"状态"
)
private
Integer
state
;
private
String
state
;
@ApiModelProperty
(
value
=
"额定功率"
)
private
Double
ratedPower
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/JpCollector.java
View file @
fee95307
...
...
@@ -32,7 +32,7 @@ public class JpCollector extends BaseEntity {
* 状态
*/
@TableField
(
"state"
)
private
Integer
state
;
private
String
state
;
/**
* 类型
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/JpInverter.java
View file @
fee95307
...
...
@@ -32,7 +32,7 @@ public class JpInverter extends BaseEntity {
* 状态
*/
@TableField
(
"state"
)
private
Integer
state
;
private
String
state
;
/**
* 额定功率
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpInverterMapper.java
View file @
fee95307
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Map
;
/**
* 户用光伏监盘逆变器表 Mapper 接口
...
...
@@ -11,4 +15,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public
interface
JpInverterMapper
extends
BaseMapper
<
JpInverter
>
{
Map
<
String
,
Object
>
queryCountStatus
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/JpStationMapper.java
View file @
fee95307
...
...
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* 第三方场站 Mapper 接口
...
...
@@ -16,4 +17,7 @@ import java.util.List;
*/
public
interface
JpStationMapper
extends
BaseMapper
<
JpStation
>
{
List
<
JpStationDto
>
queryForDealerReviewPage
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
JpStationDto
queryCount
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
Map
<
String
,
Object
>
countState
(
@Param
(
"dto"
)
JpStationDto
reviewDto
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpInverterMapper.xml
View file @
fee95307
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper"
>
<select
id=
"queryCountStatus"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"
>
select
hygf_jp_inverter.`status`,
count(hygf_jp_inverter.sequence_nbr) num
from hygf_jp_inverter left JOIN hygf_jp_station
on hygf_jp_station.third_station_id=hygf_jp_inverter.third_station_id
<where>
<if
test=
"dto.nauserNameme!=null"
>
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if
test=
"dto.area!=null"
>
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if
test=
"dto.statioId!=null"
>
and hygf_jp_station.third_station_id in
<foreach
collection=
"dto.statioId"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item.stationId}
</foreach>
</if>
<if
test=
"dto.thirdStationId!=null"
>
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
</where>
GROUP BY hygf_jp_inverter.`status`
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/JpStationMapper.xml
View file @
fee95307
...
...
@@ -10,7 +10,9 @@
<if
test=
"dto.name!=null"
>
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if
test=
"dto.nauserNameme!=null"
>
and hygf_jp_station.user_name like concat(concat("%",#{dto.nauserNameme}),"%")
</if>
<if
test=
"dto.address!=null"
>
and hygf_jp_station.address like concat(concat("%",#{dto.address}),"%")
</if>
...
...
@@ -31,4 +33,69 @@
</select>
<select
id=
"queryCount"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"
>
select
sum(real_time_power) realTimePower,
sum(capacity) capacity,
sum(day_generate) dayGenerate,
sum(month_generate) monthGenerate,
sum(year_generate) yearGenerate,
sum(accumulated_power) accumulatedPower,
sum(day_income) dayIncome,
sum(month_income) monthIncome,
sum(year_income) yearIncome,
sum(cumulative_income) cumulativeIncome,
sum(day_power_use) dayPowerUse,
sum(month_power_use) monthPowerUse,
sum(year_power_use) yearPowerUse,
count(*) countBuiltNum
from hygf_jp_station
<where>
<if
test=
"dto.nauserNameme!=null"
>
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if
test=
"dto.area!=null"
>
and hygf_jp_station.area like concat(concat("%",#{dto.area}),"%")
</if>
<if
test=
"dto.statioId!=null"
>
and hygf_jp_station.third_station_id in
<foreach
collection=
"dto.statioId"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item.stationId}
</foreach>
</if>
<if
test=
"dto.thirdStationId!=null"
>
and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if>
</where>
</select>
<select
id=
"countState"
resultType=
"map"
>
select
state,
count(*) num
from hygf_jp_station
<where>
<if
test=
"dto.name!=null"
>
and hygf_jp_station.name like concat(concat("%",#{dto.name}),"%")
</if>
<if
test=
"dto.nauserNameme!=null"
>
and hygf_jp_station.user_name like concat(concat("%",#{dto.userName}),"%")
</if>
<if
test=
"dto.statioId!=null"
>
and hygf_jp_station.third_station_id in
<foreach
collection=
"dto.statioId"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item.stationId}
</foreach>
</if>
</where>
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpStationController.java
View file @
fee95307
...
...
@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.PersonnelBusiness
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpStationMapper
;
import
com.yeejoin.amos.boot.module.standard.api.entity.PublicAgencyUser
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -40,6 +41,8 @@ public class JpStationController extends BaseController {
JpStationServiceImpl
jpStationServiceImpl
;
@Autowired
JpPersonStationMapper
pPersonStationMapper
;
@Autowired
JpStationMapper
jpStationMapper
;
/**
* 新增第三方场站
*
...
...
@@ -117,6 +120,26 @@ public class JpStationController extends BaseController {
Page
<
JpStationDto
>
page
=
jpStationServiceImpl
.
queryForJpStationPage
(
current
,
size
,
reviewDto
);
return
ResponseHelper
.
buildResponse
(
page
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/queryPage"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"场站列表"
,
notes
=
"场站列表"
)
public
ResponseModel
<
Map
<
String
,
Object
>>
queryForDealerReviewPage
(
JpStationDto
reviewDto
)
{
//获取当前人管理场站
LambdaQueryWrapper
<
JpPersonStation
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
JpPersonStation:
:
getPersonId
,
getUserInfo
().
getUserId
());
List
<
JpPersonStation
>
pPersonStation
=
pPersonStationMapper
.
selectList
(
qug
);
reviewDto
.
setStatioId
(
pPersonStation
.
isEmpty
()?
null
:
pPersonStation
);
return
ResponseHelper
.
buildResponse
(
jpStationMapper
.
countState
(
reviewDto
));
}
...
...
@@ -162,18 +185,16 @@ public class JpStationController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"电站监控电量收益"
,
notes
=
"电站监控电量收益"
)
@GetMapping
(
value
=
"/getIncomePower"
)
public
ResponseModel
<
List
<
JpStationDto
>>
getIncomePower
()
{
//获取登陆人所管理电站
public
ResponseModel
<
JpStationDto
>
getIncomePower
(
JpStationDto
reviewDto
)
{
//获取当前人管理场站
LambdaQueryWrapper
<
JpPersonStation
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
JpPersonStation:
:
getPersonId
,
getUserInfo
().
getUserId
());
List
<
JpPersonStation
>
pPersonStation
=
pPersonStationMapper
.
selectList
(
qug
);
return
ResponseHelper
.
buildResponse
();
if
(
reviewDto
.
getThirdStationId
()==
null
){
//获取当前人管理场站
LambdaQueryWrapper
<
JpPersonStation
>
qug
=
new
LambdaQueryWrapper
<>();
qug
.
eq
(
JpPersonStation:
:
getPersonId
,
getUserInfo
().
getUserId
());
List
<
JpPersonStation
>
pPersonStation
=
pPersonStationMapper
.
selectList
(
qug
);
reviewDto
.
setStatioId
(
pPersonStation
.
isEmpty
()?
null
:
pPersonStation
);
}
return
ResponseHelper
.
buildResponse
(
jpStationMapper
.
queryCount
(
reviewDto
));
}
...
...
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