Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
邬吉朋
rx
Commits
e9c11ac2
Commit
e9c11ac2
authored
Aug 26, 2024
by
wujipeng
Browse files
时区调整
parent
4b86b646
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/ruzhoukj/rx/controller/EquipmentController.java
View file @
e9c11ac2
...
@@ -45,8 +45,8 @@ public class EquipmentController {
...
@@ -45,8 +45,8 @@ public class EquipmentController {
return
Result
.
success
(
equipmentService
.
getTodayByDeviceId
(
deviceId
));
return
Result
.
success
(
equipmentService
.
getTodayByDeviceId
(
deviceId
));
}
}
@ApiOperation
(
value
=
"根据设备id查询
今天
的信息"
)
@ApiOperation
(
value
=
"根据设备id查询
七天内
的信息"
)
@PostMapping
(
"/report/former
/page
"
)
@PostMapping
(
"/report/former"
)
public
Result
getTodayByDeviceId
(
@RequestBody
EquipmentDTO
equipmentDTO
)
{
public
Result
getTodayByDeviceId
(
@RequestBody
EquipmentDTO
equipmentDTO
)
{
return
Result
.
success
(
equipmentService
.
getFormerByDeviceId
(
equipmentDTO
));
return
Result
.
success
(
equipmentService
.
getFormerByDeviceId
(
equipmentDTO
));
}
}
...
...
src/main/java/com/ruzhoukj/rx/service/EquipmentService.java
View file @
e9c11ac2
...
@@ -41,7 +41,7 @@ public interface EquipmentService extends IService<EquipmentEntity> {
...
@@ -41,7 +41,7 @@ public interface EquipmentService extends IService<EquipmentEntity> {
List
<
DeviceVO
>
getTodayByDeviceId
(
String
deviceId
);
List
<
DeviceVO
>
getTodayByDeviceId
(
String
deviceId
);
/**
/**
* 根据设备id查询
之前
的信息
* 根据设备id查询
七天内
的信息
*
*
* @return List<DeviceVO>
* @return List<DeviceVO>
*/
*/
...
...
src/main/java/com/ruzhoukj/rx/service/impl/EquipmentServiceImpl.java
View file @
e9c11ac2
...
@@ -75,14 +75,14 @@ public class EquipmentServiceImpl
...
@@ -75,14 +75,14 @@ public class EquipmentServiceImpl
@Override
@Override
public
List
<
DeviceVO
>
getTodayByDeviceId
(
String
deviceId
)
{
public
List
<
DeviceVO
>
getTodayByDeviceId
(
String
deviceId
)
{
// LocalDate today = LocalDate.now(ZoneId.systemDefault());
// LocalDateTime startOfDay = today.atStartOfDay();
// LocalDateTime endOfDay = today.plusDays(1).atStartOfDay().minusNanos(1);
// return deviceDao.findByDeviceIdAndTimestampBetween(deviceId, startOfDay, endOfDay);
LocalDate
today
=
LocalDate
.
now
(
ZoneId
.
systemDefault
());
LocalDate
today
=
LocalDate
.
now
(
ZoneId
.
systemDefault
());
LocalDateTime
startOfDay
=
today
.
atStartOfDay
()
.
plusHours
(
8
)
;
LocalDateTime
startOfDay
=
today
.
atStartOfDay
();
LocalDateTime
endOfDay
=
today
.
plusDays
(
1
).
atStartOfDay
().
plusHours
(
8
).
minusNanos
(
1
);
LocalDateTime
endOfDay
=
today
.
plusDays
(
1
).
atStartOfDay
().
minusNanos
(
1
);
return
deviceDao
.
findByDeviceIdAndTimestampBetweenOrderByTimestamp
(
deviceId
,
startOfDay
,
endOfDay
);
return
deviceDao
.
findByDeviceIdAndTimestampBetweenOrderByTimestamp
(
deviceId
,
startOfDay
,
endOfDay
);
// LocalDate today = LocalDate.now(ZoneId.systemDefault());
// LocalDateTime startOfDay = today.atStartOfDay().plusHours(8);
// LocalDateTime endOfDay = today.plusDays(1).atStartOfDay().plusHours(8).minusNanos(1);
// return deviceDao.findByDeviceIdAndTimestampBetweenOrderByTimestamp(deviceId, startOfDay, endOfDay);
}
}
@Override
@Override
...
...
src/main/resources/application.yml
View file @
e9c11ac2
...
@@ -15,6 +15,9 @@ spring:
...
@@ -15,6 +15,9 @@ spring:
port
:
27017
port
:
27017
host
:
192.168.10.3
host
:
192.168.10.3
authentication-database
:
admin
authentication-database
:
admin
jackson
:
time-zone
:
Asia/Shanghai
mybatis-plus
:
mybatis-plus
:
mapper-locations
:
classpath:/mapper/*.xml
mapper-locations
:
classpath:/mapper/*.xml
...
@@ -43,3 +46,5 @@ logging:
...
@@ -43,3 +46,5 @@ logging:
level
:
level
:
org.springframework.data.mongodb.core.MongoTemplate
:
DEBUG
org.springframework.data.mongodb.core.MongoTemplate
:
DEBUG
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