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
2958a136
Commit
2958a136
authored
Nov 21, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改逆变器报表接口
parent
edb9b237
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
19 deletions
+47
-19
JpStationDto.java
...m/yeejoin/amos/boot/module/hygf/api/dto/JpStationDto.java
+9
-0
JpInverterController.java
...boot/module/hygf/biz/controller/JpInverterController.java
+23
-12
JpStationController.java
.../boot/module/hygf/biz/controller/JpStationController.java
+15
-7
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/JpStationDto.java
View file @
2958a136
...
...
@@ -194,4 +194,13 @@ public class JpStationDto extends BaseDto {
@ExcelIgnore
String
timeDateYear
;
@ExcelIgnore
String
NBSN
;
@ExcelIgnore
String
CJSN
;
@ExcelIgnore
String
DBSN
;
@ExcelIgnore
String
QXYSN
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpInverterController.java
View file @
2958a136
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
...
...
@@ -241,25 +242,29 @@ public class JpInverterController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/jpInverterDayReport"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表"
,
notes
=
"逆变器日报表"
)
public
ResponseModel
<
Page
<
TdHYGFInverterDayGenerate
>>
jpInverterDayReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
public
ResponseModel
<
Page
<
TdHYGFInverterDayGenerate
>>
jpInverterDayReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
String
snCodes
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
time
)){
time
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
}
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterDayReport
(
current
,
size
,
time
,
snCodes
,
stationIds
));
List
<
String
>
dd
=
snCodes
!=
null
?
JSON
.
parseArray
(
snCodes
,
String
.
class
):
null
;
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterDayReport
(
current
,
size
,
time
,
dd
,
stationIds
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/jpInverterDayReportExport"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表导出"
,
notes
=
"逆变器日报表导出"
)
public
void
jpInverterDayReportExport
(
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
public
void
jpInverterDayReportExport
(
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
String
snCodes
,
HttpServletResponse
response
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
time
)){
time
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd"
);
}
List
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDayReportExport
(
time
,
snCodes
,
stationIds
);
List
<
String
>
dd
=
snCodes
!=
null
?
JSON
.
parseArray
(
snCodes
,
String
.
class
):
null
;
List
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDayReportExport
(
time
,
dd
,
stationIds
);
try
{
setResponseHeadForDowload
(
response
,
"逆变器日报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverterDayGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器日报表"
).
doWrite
(
tdHYGFInverterDayGenerates
);
...
...
@@ -270,25 +275,28 @@ public class JpInverterController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/jpInverterMonthReport"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器月报表"
,
notes
=
"逆变器月报表"
)
public
ResponseModel
<
Page
<
TdHYGFInverterMonthGenerate
>>
jpInverterMonthReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
public
ResponseModel
<
Page
<
TdHYGFInverterMonthGenerate
>>
jpInverterMonthReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
String
snCodes
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
time
)){
time
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM"
);
}
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterMonthReport
(
current
,
size
,
time
,
snCodes
,
stationIds
));
List
<
String
>
dd
=
snCodes
!=
null
?
JSON
.
parseArray
(
snCodes
,
String
.
class
):
null
;
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterMonthReport
(
current
,
size
,
time
,
dd
,
stationIds
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/jpInverterMonthReportExport"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器月报表导出"
,
notes
=
"逆变器月报表导出"
)
public
void
jpInverterMonthReportExport
(
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
public
void
jpInverterMonthReportExport
(
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
String
snCodes
,
HttpServletResponse
response
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
time
)){
time
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM"
);
}
List
<
TdHYGFInverterMonthGenerate
>
tdHYGFInverterMonthGenerates
=
jpInverterServiceImpl
.
jpInverterMonthReportExport
(
time
,
snCodes
,
stationIds
);
List
<
String
>
dd
=
snCodes
!=
null
?
JSON
.
parseArray
(
snCodes
,
String
.
class
):
null
;
List
<
TdHYGFInverterMonthGenerate
>
tdHYGFInverterMonthGenerates
=
jpInverterServiceImpl
.
jpInverterMonthReportExport
(
time
,
dd
,
stationIds
);
try
{
setResponseHeadForDowload
(
response
,
"逆变器月报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverterMonthGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器月报表"
).
doWrite
(
tdHYGFInverterMonthGenerates
);
...
...
@@ -300,25 +308,28 @@ public class JpInverterController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/jpInverterYearReport"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器年报表"
,
notes
=
"逆变器年报表"
)
public
ResponseModel
<
Page
<
TdHYGFInverterYearGenerate
>>
jpInverterYearReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
public
ResponseModel
<
Page
<
TdHYGFInverterYearGenerate
>>
jpInverterYearReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
String
snCodes
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
time
)){
time
=
DateUtil
.
format
(
new
Date
(),
"yyyy"
);
}
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterYearReport
(
current
,
size
,
time
,
snCodes
,
stationIds
));
List
<
String
>
dd
=
snCodes
!=
null
?
JSON
.
parseArray
(
snCodes
,
String
.
class
):
null
;
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterYearReport
(
current
,
size
,
time
,
dd
,
stationIds
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@RequestMapping
(
value
=
"/jpInverterYearReportExport"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器年报表导出"
,
notes
=
"逆变器年报表导出"
)
public
void
jpInverterYearReportExport
(
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
public
void
jpInverterYearReportExport
(
@RequestParam
(
required
=
false
)
String
time
,
@RequestParam
(
required
=
false
)
String
snCodes
,
HttpServletResponse
response
)
{
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
new
JpStationDto
());
List
<
String
>
stationIds
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isEmpty
(
time
)){
time
=
DateUtil
.
format
(
new
Date
(),
"yyyy"
);
}
List
<
TdHYGFInverterYearGenerate
>
tdHYGFInverterYearGenerates
=
jpInverterServiceImpl
.
jpInverterYearReportExport
(
time
,
snCodes
,
stationIds
);
List
<
String
>
dd
=
snCodes
!=
null
?
JSON
.
parseArray
(
snCodes
,
String
.
class
):
null
;
List
<
TdHYGFInverterYearGenerate
>
tdHYGFInverterYearGenerates
=
jpInverterServiceImpl
.
jpInverterYearReportExport
(
time
,
dd
,
stationIds
);
try
{
setResponseHeadForDowload
(
response
,
"逆变器年报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverterYearGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器年报表"
).
doWrite
(
tdHYGFInverterYearGenerates
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpStationController.java
View file @
2958a136
...
...
@@ -9,10 +9,7 @@ import com.yeejoin.amos.boot.module.hygf.api.config.UserLimits;
import
com.yeejoin.amos.boot.module.hygf.api.dto.DropDown
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ReviewDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper
;
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.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.DayGenerateServiceImpl
;
import
com.yeejoin.amos.boot.module.standard.api.entity.PublicAgencyUser
;
import
org.omg.CORBA.OBJ_ADAPTER
;
...
...
@@ -68,7 +65,8 @@ public class JpStationController extends BaseController {
@Autowired
DayGenerateServiceImpl
dayGenerateServiceImpl
;
@Autowired
RegionalCompaniesMapper
regionalCompaniesMapper
;
private
static
Double
CARBON
=
0.997
*
0.001
;
private
static
Double
SULFUR
=
0.03
*
0.001
;
...
...
@@ -135,9 +133,19 @@ public class JpStationController extends BaseController {
List
<
JpInverter
>
jpInverter
=
jpInverterMapper
.
selectList
(
qug
);
LambdaQueryWrapper
<
JpCollector
>
qug1
=
new
LambdaQueryWrapper
<>();
qug1
.
eq
(
JpCollector:
:
getThirdStationId
,
jpStationDto
.
getThirdStationId
());
List
<
JpCollector
>
J
pCollector
=
jpCollectorMapper
.
selectList
(
qug1
);
jpStationDto
.
setJpCollector
(
J
pCollector
);
List
<
JpCollector
>
j
pCollector
=
jpCollectorMapper
.
selectList
(
qug1
);
jpStationDto
.
setJpCollector
(
j
pCollector
);
jpStationDto
.
setJpInverter
(
jpInverter
);
//区域公司
LambdaQueryWrapper
<
RegionalCompanies
>
qug2
=
new
LambdaQueryWrapper
<>();
qug2
.
eq
(
RegionalCompanies:
:
getRegionalCompaniesCode
,
jpStationDto
.
getRegionalCompaniesCode
());
qug2
.
last
(
"LIMIT 1"
);
RegionalCompanies
personnelBusiness
=
regionalCompaniesMapper
.
selectOne
(
qug2
);
String
names
=
jpCollector
.
stream
().
map
(
JpCollector:
:
getSnCode
).
collect
(
Collectors
.
joining
(
","
));
String
name
=
jpInverter
.
stream
().
map
(
JpInverter:
:
getSnCode
).
collect
(
Collectors
.
joining
(
","
));
jpStationDto
.
setNBSN
(
name
);
jpStationDto
.
setCJSN
(
names
);
jpStationDto
.
setRegionalCompaniesName
(
personnelBusiness
.
getRegionalCompaniesName
());
return
ResponseHelper
.
buildResponse
(
jpStationDto
);
}
...
...
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