20260411:细节,日志只保留7天;数据推送接口支持修改[配置名称/通知模板]

This commit is contained in:
George 2026-04-11 12:16:28 +08:00
parent 9f2f4f3ee3
commit 3bef373309
4 changed files with 13 additions and 12 deletions

View File

@ -71,8 +71,8 @@
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志文件名格式 --> <!-- 日志文件名格式 -->
<fileNamePattern>${log.path}/sys-all.%d{yyyy-MM-dd}.log</fileNamePattern> <fileNamePattern>${log.path}/sys-all.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 10天 --> <!-- 日志最大的历史 7天 -->
<maxHistory>10</maxHistory> <maxHistory>7</maxHistory>
</rollingPolicy> </rollingPolicy>
<encoder> <encoder>
<pattern>${log.pattern}</pattern> <pattern>${log.pattern}</pattern>
@ -89,8 +89,8 @@
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily --> <!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern> <fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 10天 --> <!-- 日志最大的历史 7天 -->
<maxHistory>10</maxHistory> <maxHistory>7</maxHistory>
</rollingPolicy> </rollingPolicy>
<encoder> <encoder>
<pattern>${log.pattern}</pattern> <pattern>${log.pattern}</pattern>

View File

@ -60,7 +60,7 @@ public class ThingsModelPushController extends BaseController {
return toAjax(pushConfigService.insertConfig(config)); return toAjax(pushConfigService.insertConfig(config));
} }
/** 修改 */ /** 修改配置(名称、--设备--、模板、间隔、物模型项、接收用户等;不含仅改状态时请用 /status) */
@ApiOperation("修改推送配置") @ApiOperation("修改推送配置")
@PreAuthorize("@ss.hasPermi('iot:push:edit')") @PreAuthorize("@ss.hasPermi('iot:push:edit')")
@Log(title = "推送配置", businessType = BusinessType.UPDATE) @Log(title = "推送配置", businessType = BusinessType.UPDATE)

View File

@ -2,23 +2,20 @@ package com.fastbee.iot.service.impl;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.fastbee.common.enums.scenemodel.SceneModelVariableTypeEnum; import com.fastbee.common.enums.scenemodel.SceneModelVariableTypeEnum;
import com.fastbee.common.utils.CalculateUtils;
import com.fastbee.common.utils.DateUtils; import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.SecurityUtils; import com.fastbee.common.utils.SecurityUtils;
import com.fastbee.common.utils.StringUtils; import com.fastbee.common.utils.StringUtils;
import com.fastbee.common.utils.CalculateUtils;
import com.fastbee.iot.cache.SceneModelTagCache; import com.fastbee.iot.cache.SceneModelTagCache;
import com.fastbee.iot.domain.*; import com.fastbee.iot.domain.*;
import com.fastbee.iot.model.AlertCountVO; import com.fastbee.iot.model.*;
import com.fastbee.iot.model.DeviceHistoryParam;
import com.fastbee.iot.model.HistoryModel;
import com.fastbee.iot.model.SubDeviceCompareParam;
import com.fastbee.iot.model.ThingsModelLogCountVO;
import com.fastbee.iot.model.dto.ThingsModelDTO; import com.fastbee.iot.model.dto.ThingsModelDTO;
import com.fastbee.iot.model.gateWay.ProductSubGatewayVO; import com.fastbee.iot.model.gateWay.ProductSubGatewayVO;
import com.fastbee.iot.model.gateWay.SubDeviceListVO; import com.fastbee.iot.model.gateWay.SubDeviceListVO;
import com.fastbee.iot.model.param.DataCenterParam; import com.fastbee.iot.model.param.DataCenterParam;
import com.fastbee.iot.model.scenemodel.SceneHistoryParam; import com.fastbee.iot.model.scenemodel.SceneHistoryParam;
import com.fastbee.iot.service.*; import com.fastbee.iot.service.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -35,6 +32,7 @@ import java.util.stream.Collectors;
* @description: 数据中心服务类 * @description: 数据中心服务类
* @date 2024-06-13 15:29 * @date 2024-06-13 15:29
*/ */
@Slf4j
@Service @Service
public class DataCenterServiceImpl implements DataCenterService { public class DataCenterServiceImpl implements DataCenterService {
@ -387,6 +385,8 @@ public class DataCenterServiceImpl implements DataCenterService {
hm.setValue(computed); hm.setValue(computed);
computedHistory.add(hm); computedHistory.add(hm);
} catch (Exception ignored) { } catch (Exception ignored) {
// 网关计算跨设备公式失败
log.error("The gateway failed to calculate the formula across devices", ignored);
} }
} }
} }

View File

@ -71,7 +71,8 @@ public class ThingsModelPushConfigServiceImpl implements IThingsModelPushConfigS
public int updateConfig(ThingsModelPushConfig config) { public int updateConfig(ThingsModelPushConfig config) {
ThingsModelPushConfig update = new ThingsModelPushConfig(); ThingsModelPushConfig update = new ThingsModelPushConfig();
update.setId(config.getId()); update.setId(config.getId());
update.setStatus(config.getStatus()); update.setConfigName(config.getConfigName());
update.setTemplateId(config.getTemplateId());
update.setUpdateBy(SecurityUtils.getUsername()); update.setUpdateBy(SecurityUtils.getUsername());
update.setUpdateTime(DateUtils.getNowDate()); update.setUpdateTime(DateUtils.getNowDate());
if (config.getPushInterval() != null) { if (config.getPushInterval() != null) {