diff --git a/modules/carbon-track/src/main/java/com/thing/carbontrack/production/dto/IotCarbonProductionVarietyDTO.java b/modules/carbon-track/src/main/java/com/thing/carbontrack/production/dto/IotCarbonProductionVarietyDTO.java index 12a553d..3924b33 100644 --- a/modules/carbon-track/src/main/java/com/thing/carbontrack/production/dto/IotCarbonProductionVarietyDTO.java +++ b/modules/carbon-track/src/main/java/com/thing/carbontrack/production/dto/IotCarbonProductionVarietyDTO.java @@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.media.Schema; import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; import java.util.List; /** @@ -75,10 +76,39 @@ public class IotCarbonProductionVarietyDTO implements Serializable { public String stepsUrl; @Schema(description = "工序拖拉拽json") private String stepsJson; - + @Schema(description = "模型类型,1实采模型,2填报模型") + private String modelType; + @Schema(description = "填报模型开始时间") + private Date boundaryStartTime; + @Schema(description = "填报模型结束时间") + private Date boundaryEndTime; @Schema(description = "产品自定义属性信息") private List customDTOS; + public String getModelType() { + return modelType; + } + + public void setModelType(String modelType) { + this.modelType = modelType; + } + + public Date getBoundaryStartTime() { + return boundaryStartTime; + } + + public void setBoundaryStartTime(Date boundaryStartTime) { + this.boundaryStartTime = boundaryStartTime; + } + + public Date getBoundaryEndTime() { + return boundaryEndTime; + } + + public void setBoundaryEndTime(Date boundaryEndTime) { + this.boundaryEndTime = boundaryEndTime; + } + public List getCustomDTOS() { return customDTOS; } diff --git a/modules/carbon-track/src/main/java/com/thing/carbontrack/production/entity/IotCarbonProductionVarietyEntity.java b/modules/carbon-track/src/main/java/com/thing/carbontrack/production/entity/IotCarbonProductionVarietyEntity.java index 7d66d32..cd49f41 100644 --- a/modules/carbon-track/src/main/java/com/thing/carbontrack/production/entity/IotCarbonProductionVarietyEntity.java +++ b/modules/carbon-track/src/main/java/com/thing/carbontrack/production/entity/IotCarbonProductionVarietyEntity.java @@ -2,6 +2,7 @@ package com.thing.carbontrack.production.entity; import com.mybatisflex.annotation.Table; import com.thing.common.orm.entity.BaseInfoEntity; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -10,6 +11,7 @@ import lombok.experimental.Accessors; import java.io.Serial; import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 产品信息表 @@ -103,4 +105,16 @@ public class IotCarbonProductionVarietyEntity extends BaseInfoEntity implements */ private String stepsJson; + /** + * 模型类型,1实采模型,2填报模型 + */ + private String modelType; + /** + * 填报模型开始时间 + */ + private Date boundaryStartTime; + /** + * 填报模型结束时间 + */ + private Date boundaryEndTime; } \ No newline at end of file diff --git a/modules/thing/src/main/java/com/thing/listener/QueueDeviceEventListener.java b/modules/thing/src/main/java/com/thing/listener/QueueDeviceEventListener.java index f66d52d..9b69e33 100644 --- a/modules/thing/src/main/java/com/thing/listener/QueueDeviceEventListener.java +++ b/modules/thing/src/main/java/com/thing/listener/QueueDeviceEventListener.java @@ -131,11 +131,17 @@ public class QueueDeviceEventListener { item.setAuthNum(count + CollectionUtils.size(keyMap)); }); if(CollectionUtils.isNotEmpty(insertModelList)){ - thingModelService.saveOrUpdateBatch(insertModelList); + try { + thingModelService.saveOrUpdateBatch(insertModelList); + } catch (Exception e) { + } updateModelCache(insertModelList); } if(CollectionUtils.isNotEmpty(distinctStudentFile)){ - entityService.saveOrUpdateBatch(distinctStudentFile); + try { + entityService.saveOrUpdateBatch(distinctStudentFile); + } catch (Exception e) { + } updateEntityCache(distinctStudentFile); } } catch (Exception e) { diff --git a/modules/thing/src/main/resources/mapper/control/IotDeviceControlLogMapper.xml b/modules/thing/src/main/resources/mapper/control/IotDeviceControlLogMapper.xml index 5de83db..17d37fb 100644 --- a/modules/thing/src/main/resources/mapper/control/IotDeviceControlLogMapper.xml +++ b/modules/thing/src/main/resources/mapper/control/IotDeviceControlLogMapper.xml @@ -23,8 +23,8 @@ idc.relation_id, itt.code as thing_code, itt.name as thing_name, - itd.code as attr_code, - itd.name as attr_name, + idr.code as attr_code, + idr.name as attr_name, idcl.in_msg, idcl.out_msg, idcl.error_msg, @@ -34,8 +34,7 @@ iot_device_control_log idcl INNER JOIN iot_device_control idc ON idcl.control_id = idc.id LEFT JOIN iot_thing_entity itt ON idc.thing_id = itt.id - LEFT JOIN iot_thing_dict_relation idr ON itt.ID = idr.from_id and idr.to_id= idc.attr_id - INNER JOIN iot_thing_dict itd ON idc.attr_id = itd.id + INNER JOIN iot_thing_dict_relation idr ON itt.ID = idr.entity_id and idr.id= idc.attr_id LEFT JOIN sys_user su ON idcl.creator = su.id @@ -45,7 +44,7 @@ and (itt.code like #{device} or itt.name like #{device}) - and (itd.code like #{attr} or idr.to_name like #{attr}) + and (idr.code like #{attr} or idr.name like #{attr}) and idc.extend_id = #{extendId}