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
3e289e90
Commit
3e289e90
authored
Nov 14, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.逆变器日报表接口及导出增加权限。
parent
cbf46ebf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
JpInverterController.java
...boot/module/hygf/biz/controller/JpInverterController.java
+10
-2
JpInverterServiceImpl.java
...t/module/hygf/biz/service/impl/JpInverterServiceImpl.java
+6
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpInverterController.java
View file @
3e289e90
...
@@ -4,7 +4,9 @@ import cn.hutool.core.date.DateUtil;
...
@@ -4,7 +4,9 @@ import cn.hutool.core.date.DateUtil;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.JpStation
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate
;
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
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -56,6 +58,8 @@ public class JpInverterController extends BaseController {
...
@@ -56,6 +58,8 @@ public class JpInverterController extends BaseController {
@Autowired
@Autowired
JpInverterServiceImpl
jpInverterServiceImpl
;
JpInverterServiceImpl
jpInverterServiceImpl
;
@Autowired
JpStationServiceImpl
jpStationServiceImpl
;
@Autowired
@Autowired
JpPersonStationMapper
pPersonStationMapper
;
JpPersonStationMapper
pPersonStationMapper
;
...
@@ -221,14 +225,18 @@ public class JpInverterController extends BaseController {
...
@@ -221,14 +225,18 @@ public class JpInverterController extends BaseController {
@GetMapping
(
value
=
"/jpInverterDayReport"
)
@GetMapping
(
value
=
"/jpInverterDayReport"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表"
,
notes
=
"逆变器日报表"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表"
,
notes
=
"逆变器日报表"
)
public
ResponseModel
<
Page
<
TdHYGFInverterDayGenerate
>>
jpInverterDayReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
public
ResponseModel
<
Page
<
TdHYGFInverterDayGenerate
>>
jpInverterDayReport
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
)
{
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterDayReport
(
current
,
size
,
time
,
snCodes
));
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
null
);
List
<
String
>
stationids
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
return
ResponseHelper
.
buildResponse
(
jpInverterServiceImpl
.
jpInverterDayReport
(
current
,
size
,
time
,
snCodes
,
stationids
));
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/jpInverterDayReportExport"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/jpInverterDayReportExport"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表导出"
,
notes
=
"逆变器日报表导出"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表导出"
,
notes
=
"逆变器日报表导出"
)
public
void
jpInverterDayReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
public
void
jpInverterDayReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
List
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDayReportExport
(
time
,
snCodes
);
List
<
JpStation
>
jpStation
=
jpStationServiceImpl
.
getJpStation
(
null
);
List
<
String
>
stationids
=
jpStation
.
stream
().
map
(
jpStation1
->
jpStation1
.
getThirdStationId
()).
collect
(
Collectors
.
toList
());
List
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDayReportExport
(
time
,
snCodes
,
stationids
);
try
{
try
{
setResponseHeadForDowload
(
response
,
"逆变器日报表.xls"
);
setResponseHeadForDowload
(
response
,
"逆变器日报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverterDayGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器日报表"
).
doWrite
(
tdHYGFInverterDayGenerates
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverterDayGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器日报表"
).
doWrite
(
tdHYGFInverterDayGenerates
);
...
...
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 @
3e289e90
...
@@ -89,14 +89,15 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
...
@@ -89,14 +89,15 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
}
}
public
Page
<
TdHYGFInverterDayGenerate
>
jpInverterDayReport
(
int
current
,
int
size
,
String
time
,
List
<
String
>
sncodes
)
{
public
Page
<
TdHYGFInverterDayGenerate
>
jpInverterDayReport
(
int
current
,
int
size
,
String
time
,
List
<
String
>
sncodes
,
List
<
String
>
stationIds
)
{
Page
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGeneratePage
=
new
Page
<>();
Page
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGeneratePage
=
new
Page
<>();
Date
date
=
DateUtil
.
parse
(
time
,
"yyyy-MM-dd"
);
Date
date
=
DateUtil
.
parse
(
time
,
"yyyy-MM-dd"
);
String
startTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"00:00:00"
;
String
startTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"00:00:00"
;
String
endTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"23:59:59"
;
String
endTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"23:59:59"
;
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterDayGenerate
>()
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterDayGenerate
>()
.
ge
(
"created_time"
,
startTime
)
.
ge
(
"created_time"
,
startTime
)
.
le
(
"created_time"
,
endTime
);
.
le
(
"created_time"
,
endTime
)
.
in
(
"third_station_id"
,
stationIds
);;
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
}
}
...
@@ -114,13 +115,14 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
...
@@ -114,13 +115,14 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
return
tdHYGFInverterDayGeneratePage
;
return
tdHYGFInverterDayGeneratePage
;
}
}
public
List
<
TdHYGFInverterDayGenerate
>
jpInverterDayReportExport
(
String
time
,
List
<
String
>
sncodes
)
{
public
List
<
TdHYGFInverterDayGenerate
>
jpInverterDayReportExport
(
String
time
,
List
<
String
>
sncodes
,
List
<
String
>
stationIds
)
{
Date
date
=
DateUtil
.
parse
(
time
,
"yyyy-MM-dd"
);
Date
date
=
DateUtil
.
parse
(
time
,
"yyyy-MM-dd"
);
String
startTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"00:00:00"
;
String
startTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"00:00:00"
;
String
endTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"23:59:59"
;
String
endTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"23:59:59"
;
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterDayGenerate
>()
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterDayGenerate
>()
.
ge
(
"created_time"
,
startTime
)
.
ge
(
"created_time"
,
startTime
)
.
le
(
"created_time"
,
endTime
);
.
le
(
"created_time"
,
endTime
)
.
in
(
"third_station_id"
,
stationIds
);
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
}
}
...
...
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