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
cbf46ebf
Commit
cbf46ebf
authored
Nov 14, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.户用光伏td实体类修改。
2.户用光伏逆变器日报表数据导出接口。
parent
830a6152
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
149 additions
and
37 deletions
+149
-37
TdHYGFInverterDayGenerate.java
...oot/module/hygf/api/entity/TdHYGFInverterDayGenerate.java
+90
-33
JpInverterController.java
...boot/module/hygf/biz/controller/JpInverterController.java
+39
-4
JpInverterServiceImpl.java
...t/module/hygf/biz/service/impl/JpInverterServiceImpl.java
+20
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/TdHYGFInverterDayGenerate.java
View file @
cbf46ebf
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
lombok.Data
;
...
...
@@ -11,120 +13,175 @@ public class TdHYGFInverterDayGenerate implements Serializable {
/**
* 创建时间
*/
@ExcelIgnore
private
Long
createdTime
;
/**
* 创建时间
*/
@ExcelProperty
(
"时间"
)
private
String
createdTimeStr
;
/**
* 第三方场站id
*/
@ExcelIgnore
private
String
thirdStationId
;
/**
* sncode
*/
@ExcelProperty
(
"SN"
)
private
String
snCode
;
/**
* 工作状态
*/
@ExcelProperty
(
"工作状态"
)
private
String
workStatus
;
/**
* 交流电压1
*/
private
Double
dcv1
;
/**
* 交流电压2
*/
private
Double
dcv2
;
/**
* 交流电压3
*/
private
Double
dcv3
;
/**
* 交流电压4
*/
private
Double
dcv4
;
/**
* 交流电流1
*/
private
Double
dcc1
;
/**
* 交流电流2
*/
private
Double
dcc2
;
/**
* 交流电流3
*/
private
Double
dcc3
;
/**
* 交流电流4
*/
private
Double
dcc4
;
/**
* 直流电压1
*/
@ExcelProperty
(
"直流电压1(V)"
)
private
Double
acv1
;
/**
* 直流电压2
*/
@ExcelProperty
(
"直流电压2(V)"
)
private
Double
acv2
;
/**
* 直流电压3
*/
@ExcelProperty
(
"直流电压3(V)"
)
private
Double
acv3
;
/**
* 直流电压4
*/
@ExcelProperty
(
"直流电压4(V)"
)
private
Double
acv4
;
/**
* 直流电流1
*/
@ExcelProperty
(
"直流电流1(A)"
)
private
Double
acc1
;
/**
* 直流电流2
*/
@ExcelProperty
(
"直流电流2(A)"
)
private
Double
acc2
;
/**
* 直流电流3
*/
@ExcelProperty
(
"直流电流3(A)"
)
private
Double
acc3
;
/**
* 直流电流4
*/
@ExcelProperty
(
"直流电流4(A)"
)
private
Double
acc4
;
/**
* 交流电压1
*/
@ExcelProperty
(
"交流电压1(V)"
)
private
Double
dcv1
;
/**
* 交流电压2
*/
@ExcelProperty
(
"交流电压2(V)"
)
private
Double
dcv2
;
/**
* 交流电压3
*/
@ExcelProperty
(
"交流电压3(V)"
)
private
Double
dcv3
;
/**
* 交流电压4
*/
@ExcelProperty
(
"交流电压4(V)"
)
private
Double
dcv4
;
/**
* 交流电流1
*/
@ExcelProperty
(
"交流电流1(A)"
)
private
Double
dcc1
;
/**
* 交流电流2
*/
@ExcelProperty
(
"交流电流2(A)"
)
private
Double
dcc2
;
/**
* 交流电流3
*/
@ExcelProperty
(
"交流电流3(A)"
)
private
Double
dcc3
;
/**
* 交流电流4
*/
@ExcelProperty
(
"交流电流4(A)"
)
private
Double
dcc4
;
/**
* 总功率
*/
@ExcelProperty
(
"总功率(kWh)"
)
private
Double
totalPower
;
/**
* 频率
*/
@ExcelProperty
(
"交流频率(Hz)"
)
private
String
frequency
;
/**
* 功率因数
*/
@ExcelProperty
(
"功率因数"
)
private
Double
powerFactor
;
/**
* 日发电量
*/
@ExcelProperty
(
"日发电量(kWh)"
)
private
Double
dayGen
;
/**
* 月发电量
*/
@ExcelProperty
(
"月发电量(kWh)"
)
private
Double
monthGen
;
/**
* 年发电量
*/
@ExcelProperty
(
"年发电量(kWh)"
)
private
Double
yearGen
;
/**
* 累计发电量
*/
@ExcelProperty
(
"总发电量(kWh)"
)
private
Double
totalGen
;
/**
* IGBT温度
*/
private
Double
igbtTmep
;
@ExcelProperty
(
"IGBT温度(℃)"
)
private
Double
igbtTemp
;
/**
* 直流电流1
*/
@ExcelIgnore
private
Double
pv1
;
/**
* 直流电流2
*/
@ExcelIgnore
private
Double
pv2
;
/**
* 直流电流3
*/
@ExcelIgnore
private
Double
pv3
;
/**
* 直流电流4
*/
@ExcelIgnore
private
Double
pv4
;
@ExcelIgnore
private
Double
income
;
@ExcelIgnore
private
Double
fullhour
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/JpInverterController.java
View file @
cbf46ebf
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.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.TdHYGFInverterDayGenerate
;
import
org.apache.commons.io.IOUtils
;
...
...
@@ -12,11 +15,10 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import
org.springframework.core.io.Resource
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.nio.charset.StandardCharsets
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl
;
...
...
@@ -25,6 +27,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -220,4 +223,36 @@ public class JpInverterController extends BaseController {
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
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@RequestMapping
(
value
=
"/jpInverterDayReportExport"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"逆变器日报表导出"
,
notes
=
"逆变器日报表导出"
)
public
void
jpInverterDayReportExport
(
String
time
,
@RequestParam
(
required
=
false
)
List
<
String
>
snCodes
,
HttpServletResponse
response
)
{
List
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGenerates
=
jpInverterServiceImpl
.
jpInverterDayReportExport
(
time
,
snCodes
);
try
{
setResponseHeadForDowload
(
response
,
"逆变器日报表.xls"
);
EasyExcel
.
write
(
response
.
getOutputStream
()).
head
(
TdHYGFInverterDayGenerate
.
class
).
excelType
(
ExcelTypeEnum
.
XLS
).
sheet
(
"逆变器日报表"
).
doWrite
(
tdHYGFInverterDayGenerates
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
}
/**
* 设置响应头
*
* @param response 响应体
* @param dowloadFileName 下载文件名称
*/
public
void
setResponseHeadForDowload
(
HttpServletResponse
response
,
String
dowloadFileName
)
{
try
{
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setHeader
(
"content-Type"
,
"application/vnd.ms-excel"
);
response
.
setHeader
(
"Access-Control-Expose-Headers"
,
"Content-Disposition"
);
response
.
setHeader
(
"content-disposition"
,
"attachment;filename="
+
URLEncoder
.
encode
(
dowloadFileName
,
"UTF-8"
));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
}
}
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 @
cbf46ebf
...
...
@@ -113,4 +113,23 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
tdHYGFInverterDayGeneratePage
.
setRecords
(
tdHYGFInverterDayGenerates
);
return
tdHYGFInverterDayGeneratePage
;
}
public
List
<
TdHYGFInverterDayGenerate
>
jpInverterDayReportExport
(
String
time
,
List
<
String
>
sncodes
)
{
Date
date
=
DateUtil
.
parse
(
time
,
"yyyy-MM-dd"
);
String
startTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"00:00:00"
;
String
endTime
=
DateUtil
.
format
(
date
,
"yyyy-MM-dd"
)
+
"23:59:59"
;
QueryWrapper
queryWrapper
=
new
QueryWrapper
<
TdHYGFInverterDayGenerate
>()
.
ge
(
"created_time"
,
startTime
)
.
le
(
"created_time"
,
endTime
);
if
(
CollectionUtil
.
isNotEmpty
(
sncodes
))
{
queryWrapper
.
in
(
"sn_code"
,
sncodes
);
}
queryWrapper
.
orderByDesc
(
"created_time"
);
List
<
TdHYGFInverterDayGenerate
>
tdHYGFInverterDayGenerates
=
tdHYGFInverterDayGenerateMapper
.
selectList
(
queryWrapper
);
tdHYGFInverterDayGenerates
.
forEach
(
tdHYGFInverterDayGenerate
->
{
Date
date1
=
new
Date
(
tdHYGFInverterDayGenerate
.
getCreatedTime
());
tdHYGFInverterDayGenerate
.
setCreatedTimeStr
(
DateUtil
.
format
(
date1
,
DatePattern
.
NORM_DATETIME_PATTERN
));
});
return
tdHYGFInverterDayGenerates
;
}
}
\ No newline at end of file
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