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
cf29606c
Commit
cf29606c
authored
Nov 15, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://36.40.66.175:5000/moa/amos-boot-biz
into developer
parents
6784e9a8
715f3548
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
19 deletions
+63
-19
TdHYGFInverterMonthGenerate.java
...t/module/hygf/api/entity/TdHYGFInverterMonthGenerate.java
+15
-4
TdHYGFInverterYearGenerate.java
...ot/module/hygf/api/entity/TdHYGFInverterYearGenerate.java
+15
-4
JpInverterController.java
...boot/module/hygf/biz/controller/JpInverterController.java
+9
-11
JpInverterServiceImpl.java
...t/module/hygf/biz/service/impl/JpInverterServiceImpl.java
+24
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/TdHYGFInverterMonthGenerate.java
View file @
cf29606c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,31 +16,40 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
...
@@ -14,31 +16,40 @@ public class TdHYGFInverterMonthGenerate implements Serializable {
/**
/**
* 创建时间
* 创建时间
*/
*/
@ExcelIgnore
private
Long
createdTime
;
private
Long
createdTime
;
/**
/**
* 第三方场站id
* 第三方场站id
*/
*/
@ExcelIgnore
private
String
thirdStationId
;
private
String
thirdStationId
;
/**
/**
* sncode
*/
private
String
snCode
;
/**
*日 yyyy-MM-dd
*日 yyyy-MM-dd
*/
*/
@ExcelProperty
(
"时间"
)
private
String
dayTime
;
private
String
dayTime
;
/**
/**
* sncode
*/
@ExcelProperty
(
"SN"
)
private
String
snCode
;
/**
*月 yyyy
*月 yyyy
*/
*/
@ExcelIgnore
private
String
yearMonth
;
private
String
yearMonth
;
/**
/**
* 发电量
* 发电量
*/
*/
@ExcelProperty
(
"日发电量(kWh)"
)
private
Double
generate
;
private
Double
generate
;
/**
/**
* 满发小时数
* 满发小时数
*/
*/
@ExcelProperty
(
"日满发小时数(h)"
)
private
Double
fullhour
;
private
Double
fullhour
;
@ExcelIgnore
private
Double
income
;
private
Double
income
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/TdHYGFInverterYearGenerate.java
View file @
cf29606c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
import
com.alibaba.excel.annotation.ExcelIgnore
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,31 +16,40 @@ public class TdHYGFInverterYearGenerate implements Serializable {
...
@@ -14,31 +16,40 @@ public class TdHYGFInverterYearGenerate implements Serializable {
/**
/**
* 创建时间
* 创建时间
*/
*/
@ExcelIgnore
private
Long
createdTime
;
private
Long
createdTime
;
/**
/**
* 第三方场站id
* 第三方场站id
*/
*/
@ExcelIgnore
private
String
thirdStationId
;
private
String
thirdStationId
;
/**
/**
* sncode
*/
private
String
snCode
;
/**
*日 yyyy-MM
*日 yyyy-MM
*/
*/
@ExcelProperty
(
"时间"
)
private
String
monthTime
;
private
String
monthTime
;
/**
/**
* sncode
*/
@ExcelProperty
(
"SN"
)
private
String
snCode
;
/**
*月 yyyy
*月 yyyy
*/
*/
@ExcelIgnore
private
String
year
;
private
String
year
;
/**
/**
* 发电量
* 发电量
*/
*/
@ExcelProperty
(
"月发电量(kWh)"
)
private
Double
generate
;
private
Double
generate
;
/**
/**
* 满发小时数
* 满发小时数
*/
*/
@ExcelProperty
(
"月满发小时数(h)"
)
private
Double
fullhour
;
private
Double
fullhour
;
@ExcelIgnore
private
Double
income
;
private
Double
income
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpInverterController.java
View file @
cf29606c
...
@@ -7,8 +7,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -7,8 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpStationServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpStationServiceImpl
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -40,7 +39,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -40,7 +39,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
...
@@ -263,10 +261,10 @@ public class JpInverterController extends BaseController {
...
@@ -263,10 +261,10 @@ public class JpInverterController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/jpInverterMonthReport"
)
@GetMapping
(
value
=
"/jpInverterMonthReport"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器月报表"
,
notes
=
"逆变器月报表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器月报表"
,
notes
=
"逆变器月报表"
)
public
ResponseModel
<
Page
<
TdHYGFInverter
Day
Generate
>>
jpInverterMonthReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
public
ResponseModel
<
Page
<
TdHYGFInverter
Year
Generate
>>
jpInverterMonthReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverter
Day
Report
(
current
,
size
,
time
,
snCodes
,
stationIds
));
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverter
Year
Report
(
current
,
size
,
time
,
snCodes
,
stationIds
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
@@ -275,10 +273,10 @@ public class JpInverterController extends BaseController {
...
@@ -275,10 +273,10 @@ public class JpInverterController extends BaseController {
public
void
jpInverterMonthReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
public
void
jpInverterMonthReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
List
<
TdHYGFInverter
DayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDay
ReportExport
(
time
,
snCodes
,
stationIds
);
List
<
TdHYGFInverter
MonthGenerate
>
tdHYGFInverterMonthGenerates
=
jpInverterServiceImpl
.
jpInverterMonth
ReportExport
(
time
,
snCodes
,
stationIds
);
try
{
try
{
setResponseHeadForDowload
(
response
,
"逆变器
日
报表.xls"
);
setResponseHeadForDowload
(
response
,
"逆变器
月
报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverter
DayGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器日报表"
).
doWrite
(
tdHYGFInverterDay
Generates
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverter
MonthGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器月报表"
).
doWrite
(
tdHYGFInverterMonth
Generates
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
@@ -299,10 +297,10 @@ public class JpInverterController extends BaseController {
...
@@ -299,10 +297,10 @@ public class JpInverterController extends BaseController {
public
void
jpInverterYearReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
public
void
jpInverterYearReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
List
<
TdHYGFInverter
DayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDay
ReportExport
(
time
,
snCodes
,
stationIds
);
List
<
TdHYGFInverter
YearGenerate
>
tdHYGFInverterYearGenerates
=
jpInverterServiceImpl
.
jpInverterYear
ReportExport
(
time
,
snCodes
,
stationIds
);
try
{
try
{
setResponseHeadForDowload
(
response
,
"逆变器
日
报表.xls"
);
setResponseHeadForDowload
(
response
,
"逆变器
年
报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverter
DayGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器日报表"
).
doWrite
(
tdHYGFInverterDay
Generates
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverter
YearGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器年报表"
).
doWrite
(
tdHYGFInverterYear
Generates
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/JpInverterServiceImpl.java
View file @
cf29606c
...
@@ -185,6 +185,18 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
...
@@ -185,6 +185,18 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
return
tdHYGFInverterMonthGeneratePage
;
return
tdHYGFInverterMonthGeneratePage
;
}
}
public
List
<
TdHYGFInverterMonthGenerate
>
jpInverterMonthReportExport
(
String
time
,
List
<
String
>
sncodes
,
List
<
String
>
stationIds
)
{
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterMonthGenerate
>()
.
eq
(
"year_month"
,
time
)
.
in
(
"third_station_id"
,
stationIds
);
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
}
queryWrapper
.
orderByDesc
(
"day_time"
);
List
<
TdHYGFInverterMonthGenerate
>
tdHYGFInverterMonthGenerates
=
tdHYGFInverterMonthGenerateMapper
.
selectList
(
queryWrapper
);
return
tdHYGFInverterMonthGenerates
;
}
public
Page
<
TdHYGFInverterYearGenerate
>
jpInverterYearReport
(
int
current
,
int
size
,
String
time
,
List
<
String
>
sncodes
,
List
<
String
>
stationIds
)
{
public
Page
<
TdHYGFInverterYearGenerate
>
jpInverterYearReport
(
int
current
,
int
size
,
String
time
,
List
<
String
>
sncodes
,
List
<
String
>
stationIds
)
{
Page
<
TdHYGFInverterYearGenerate
>
tdHYGFInverterYearGeneratePage
=
new
Page
<>();
Page
<
TdHYGFInverterYearGenerate
>
tdHYGFInverterYearGeneratePage
=
new
Page
<>();
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterYearGenerate
>()
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterYearGenerate
>()
...
@@ -202,6 +214,18 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
...
@@ -202,6 +214,18 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
tdHYGFInverterYearGeneratePage
.
setRecords
(
tdHYGFInverterYearGenerates
);
tdHYGFInverterYearGeneratePage
.
setRecords
(
tdHYGFInverterYearGenerates
);
return
tdHYGFInverterYearGeneratePage
;
return
tdHYGFInverterYearGeneratePage
;
}
}
public
List
<
TdHYGFInverterYearGenerate
>
jpInverterYearReportExport
(
String
time
,
List
<
String
>
sncodes
,
List
<
String
>
stationIds
)
{
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterYearGenerate
>()
.
eq
(
"year"
,
time
)
.
in
(
"third_station_id"
,
stationIds
);
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
}
queryWrapper
.
orderByDesc
(
"month_time"
);
List
<
TdHYGFInverterYearGenerate
>
tdHYGFInverterYearGenerates
=
tdHYGFInverterYearGenerateMapper
.
selectList
(
queryWrapper
);
return
tdHYGFInverterYearGenerates
;
}
public
List
<
Map
<
String
,
String
>>
getInverterSncodes
(
List
<
String
>
stationIds
)
{
public
List
<
Map
<
String
,
String
>>
getInverterSncodes
(
List
<
String
>
stationIds
)
{
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
JpInverter
>()
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
JpInverter
>()
...
...
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