Commit e9c11ac2 authored by wujipeng's avatar wujipeng
Browse files

时区调整

parent 4b86b646
...@@ -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));
} }
......
...@@ -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>
*/ */
......
...@@ -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
......
...@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment