Commit e9c11ac2 authored by wujipeng's avatar wujipeng
Browse files

时区调整

parent 4b86b646
......@@ -45,8 +45,8 @@ public class EquipmentController {
return Result.success(equipmentService.getTodayByDeviceId(deviceId));
}
@ApiOperation(value = "根据设备id查询今天的信息")
@PostMapping("/report/former/page")
@ApiOperation(value = "根据设备id查询七天内的信息")
@PostMapping("/report/former")
public Result getTodayByDeviceId(@RequestBody EquipmentDTO equipmentDTO) {
return Result.success(equipmentService.getFormerByDeviceId(equipmentDTO));
}
......
......@@ -41,7 +41,7 @@ public interface EquipmentService extends IService<EquipmentEntity> {
List<DeviceVO> getTodayByDeviceId(String deviceId);
/**
* 根据设备id查询之前的信息
* 根据设备id查询七天内的信息
*
* @return List<DeviceVO>
*/
......
......@@ -75,14 +75,14 @@ public class EquipmentServiceImpl
@Override
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());
LocalDateTime startOfDay = today.atStartOfDay().plusHours(8);
LocalDateTime endOfDay = today.plusDays(1).atStartOfDay().plusHours(8).minusNanos(1);
LocalDateTime startOfDay = today.atStartOfDay();
LocalDateTime endOfDay = today.plusDays(1).atStartOfDay().minusNanos(1);
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
......
......@@ -15,6 +15,9 @@ spring:
port: 27017
host: 192.168.10.3
authentication-database: admin
jackson:
time-zone: Asia/Shanghai
mybatis-plus:
mapper-locations: classpath:/mapper/*.xml
......@@ -43,3 +46,5 @@ logging:
level:
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