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
238f5f42
Commit
238f5f42
authored
Sep 22, 2023
by
wujiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://39.98.45.134:8090/moa/amos-boot-biz
into developer
parents
f86d0e7e
6056d9dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
37 deletions
+43
-37
JpStationServiceImpl.java
...ot/module/hygf/biz/service/impl/JpStationServiceImpl.java
+25
-33
MonthPowerServiceImpl.java
...t/module/hygf/biz/service/impl/MonthPowerServiceImpl.java
+18
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/JpStationServiceImpl.java
View file @
238f5f42
...
...
@@ -60,11 +60,11 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
map
=
gethourList
();
data
=
monthPowerMapper
.
getDayPowercount
(
date
,
statioId
);
}
else
if
(
type
.
equals
(
"month"
)){
map
=
getDayListOfMonth
();
map
=
getDayListOfMonth
(
date
);
data
=
monthPowerMapper
.
getMonthPower
(
date
,
statioId
);
}
else
if
(
type
.
equals
(
"year"
)){
map
=
getyearListOfMonth
();
map
=
getyearListOfMonth
(
date
);
data
=
monthPowerMapper
.
getYearPower
(
date
,
statioId
);
}
else
{
map
=
getyearList
();
...
...
@@ -105,31 +105,36 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
public
static
Map
<
String
,
List
<
Object
>>
getDayListOfMonth
()
{
public
static
Map
<
String
,
List
<
Object
>>
getDayListOfMonth
(
String
date
)
{
Map
<
String
,
List
<
Object
>>
map
=
new
HashMap
<>();
List
<
Object
>
listx
=
new
ArrayList
<>();
List
<
Object
>
listy
=
new
ArrayList
<>();
Calendar
aCalendar
=
Calendar
.
getInstance
(
Locale
.
CHINA
);
int
year
=
aCalendar
.
get
(
Calendar
.
YEAR
);
//年份
int
month
=
aCalendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//月份
int
day
=
aCalendar
.
getActualMaximum
(
Calendar
.
DATE
);
for
(
int
i
=
1
;
i
<=
day
;
i
++)
{
String
aDate
=
month
+
"-"
+
i
;
listx
.
add
(
aDate
);
listy
.
add
(
0
);
try
{
List
<
Object
>
listx
=
new
ArrayList
<>();
List
<
Object
>
listy
=
new
ArrayList
<>();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM"
);
Date
dat
=
sdf
.
parse
(
date
);
Calendar
aCalendar
=
Calendar
.
getInstance
();
aCalendar
.
setTime
(
dat
);
int
month
=
aCalendar
.
get
(
Calendar
.
MONTH
)
+
1
;
//月份
int
day
=
aCalendar
.
getActualMaximum
(
Calendar
.
DATE
);
for
(
int
i
=
1
;
i
<=
day
;
i
++)
{
String
aDate
=
month
+
"-"
+
i
;
listx
.
add
(
aDate
);
listy
.
add
(
0
);
}
map
.
put
(
"x"
,
listx
);
map
.
put
(
"y"
,
listy
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
RuntimeException
(
"系统异常!"
);
}
map
.
put
(
"x"
,
listx
);
map
.
put
(
"y"
,
listy
);
return
map
;
}
public
static
Map
<
String
,
List
<
Object
>>
getyearListOfMonth
()
{
public
static
Map
<
String
,
List
<
Object
>>
getyearListOfMonth
(
String
date
)
{
Map
<
String
,
List
<
Object
>>
map
=
new
HashMap
<>();
List
<
Object
>
listx
=
new
ArrayList
<>();
List
<
Object
>
listy
=
new
ArrayList
<>();
Calendar
aCalendar
=
Calendar
.
getInstance
(
Locale
.
CHINA
);
int
year
=
aCalendar
.
get
(
Calendar
.
YEAR
);
//年份
for
(
int
i
=
1
;
i
<=
12
;
i
++)
{
String
aDate
=
String
.
valueOf
(
year
)
+
"-"
+
i
;
String
aDate
=
date
+
"-"
+
i
;
listx
.
add
(
aDate
);
listy
.
add
(
0
);
}
...
...
@@ -159,18 +164,9 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
List
<
Object
>
listx
=
new
ArrayList
<>();
List
<
Object
>
listy
=
new
ArrayList
<>();
try
{
Date
day
=
new
Date
();
SimpleDateFormat
df
=
new
SimpleDateFormat
(
"yyyy-MM-dd 00:00:00"
);
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"HH:mm"
);
String
s
=
df
.
format
(
day
);
Date
date
=
df
.
parse
(
s
);
ArrayList
<
String
>
dates
=
new
ArrayList
<
String
>();
for
(
int
i
=
0
;
i
<
24
;
i
++)
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
add
(
Calendar
.
HOUR
,
1
);
date
=
cal
.
getTime
();
String
s1
=
format
.
format
(
date
);
String
s1
=
i
+
":00"
;
listx
.
add
(
s1
);
listy
.
add
(
0
);
}
...
...
@@ -185,7 +181,4 @@ public class JpStationServiceImpl extends BaseService<JpStationDto,JpStation,JpS
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/MonthPowerServiceImpl.java
View file @
238f5f42
...
...
@@ -53,13 +53,27 @@ public class MonthPowerServiceImpl extends BaseService<MonthPowerDto,MonthPower,
@Override
@Async
@Transactional
public
void
getMonthPower
()
{
List
<
MonthPower
>
list
=
monthPowerMapper
.
getMonthPowerint
();
this
.
saveBatch
(
list
);
LocalDateTime
now
=
LocalDateTime
.
now
();
DateTimeFormatter
formatterday
=
DateTimeFormatter
.
ofPattern
(
"YYYY-MM-dd"
);
String
formattedDateday
=
now
.
format
(
formatterday
);
LambdaQueryWrapper
<
MonthPower
>
wrapperday
=
new
LambdaQueryWrapper
<>();
wrapperday
.
eq
(
MonthPower:
:
getDay
,
formattedDateday
);
List
<
MonthPower
>
listdday
=
this
.
list
(
wrapperday
);
if
(
listdday
!=
null
&&!
listdday
.
isEmpty
()){
for
(
MonthPower
monthPower
:
listdday
)
{
for
(
MonthPower
power
:
list
)
{
if
(
monthPower
.
getThirdStationId
().
equals
(
power
.
getThirdStationId
())){
monthPower
.
setPower
(
power
.
getPower
());
}
}
}
this
.
saveBatch
(
listdday
);
}
else
{
this
.
saveBatch
(
list
);
}
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"YYYY-MM"
);
String
formattedDate
=
now
.
format
(
formatter
);
List
<
YearPower
>
listd
=
monthPowerMapper
.
getSumMonthPower
(
formattedDate
);
...
...
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