Commit e68c8873 by huangjy

fix:修改bug

parent c3fb9d0f
ALTER TABLE `plat_device_other`
ALTER TABLE `plat_device_other`
......@@ -14,4 +14,10 @@ ALTER TABLE `plat_elder_report_month`
MODIFY COLUMN `fail_count` int(11) COMMENT '跌倒次数' AFTER `respiratory_rate`,
MODIFY COLUMN `heart_exception_count` int(11) COMMENT '心率异常次数' AFTER `fail_count`,
MODIFY COLUMN `respiratory_exception_count` int(11) COMMENT '呼吸异常次数' AFTER `heart_exception_count`,
MODIFY COLUMN `behavior_exception_count` int(11) COMMENT '行为异常次数' AFTER `respiratory_exception_count`;
\ No newline at end of file
MODIFY COLUMN `behavior_exception_count` int(11) COMMENT '行为异常次数' AFTER `respiratory_exception_count`;
ALTER TABLE `sys_api_secret`
CHANGE COLUMN `publicKey` `public_key` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '公钥' AFTER `platform`,
CHANGE COLUMN `privateKey` `private_key` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '私钥' AFTER `public_key`,
CHANGE COLUMN `orgId` `org_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '机构id' AFTER `private_key`;
\ No newline at end of file
......@@ -33,6 +33,7 @@ import java.io.IOException;
import java.time.*;
import java.time.format.DateTimeFormatter;
import java.time.temporal.ChronoUnit;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
......@@ -239,6 +240,9 @@ public class IotProductDeviceService extends IotCommonService {
long timestamp = 0;
for (DeviceInfoContentBreathe deviceInfoContentBreathe : deviceInfoContentBreathes) {
breatheProperties = deviceInfoContentBreathe.getProperties();
if (breatheProperties.getPerson() == 0) {
continue;
}
hr += breatheProperties.getHr();
br += breatheProperties.getBr();
bodymove += breatheProperties.getBodymove();
......@@ -255,6 +259,7 @@ public class IotProductDeviceService extends IotCommonService {
}
}
if (CollectionUtils.isNotEmpty(tempList)) {
tempList = tempList.stream().sorted(Comparator.comparing(DeviceInfoContentBreathe::getTimestamp)).collect(Collectors.toList());
return tempList;
}
return Lists.newArrayList();
......
......@@ -210,6 +210,12 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
if (other != null) {
other.setAttribute(dto.getAttribute());
platDeviceOtherService.updateById(other);
} else {
other = new PlatDeviceOther();
other.setDeviceId(db.getId());
other.setOriDeviceId(db.getOriDeviceId());
other.setAttribute(dto.getAttribute());
platDeviceOtherService.save(other);
}
// 写入设备
......@@ -307,6 +313,7 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
}
@Override
@Transactional(rollbackFor = Exception.class)
public void wechatEdit(PlatDeviceEditWechatDTO dto) {
PlatDevice db = getById(dto.getId());
......@@ -456,10 +463,11 @@ public class PlatDeviceServiceImpl extends ServiceImpl<PlatDeviceMapper, PlatDev
platDeviceOtherService.updateById(other);
}
if (dto.getRadarMount() != null) {
PlatDevice platDevice = getOne(new QueryWrapper<PlatDevice>().lambda().eq(PlatDevice::getOriDeviceId, deviceId));
//更新区域设置设备安装方式
platRegionSettingService.update(new UpdateWrapper<PlatRegionSetting>().lambda()
.set(PlatRegionSetting::getInstallType, dto.getRadarMount())
.eq(PlatRegionSetting::getDeviceId, deviceId));
.eq(PlatRegionSetting::getDeviceId, platDevice.getId()));
}
}
......
......@@ -143,7 +143,7 @@ public class PlatElderReportMonthServiceImpl extends ServiceImpl<PlatElderReport
@Override
@TenantIdIgnore
public void reportMonthJob() {
LocalDate nowDate = LocalDate.now().minusDays(6);
LocalDate nowDate = LocalDate.now();
LocalDate yesDate = nowDate.minusDays(1);
LocalDateTime yesStart = LocalDateTimeUtils.getDayStart(yesDate);
......
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 sign in to comment