Browse Source

Merge pull request 'master' (#50) from master into V3

Reviewed-on: http://git.lrdaiot.cn:9000/thing/thing_api/pulls/50
qingyuan_dev_new
李帅 1 year ago
parent
commit
c9685f014d
  1. 32
      modules/carbon-track/src/main/java/com/thing/carbontrack/production/dto/IotCarbonProductionVarietyDTO.java
  2. 14
      modules/carbon-track/src/main/java/com/thing/carbontrack/production/entity/IotCarbonProductionVarietyEntity.java
  3. 6
      modules/thing/src/main/java/com/thing/listener/QueueDeviceEventListener.java
  4. 9
      modules/thing/src/main/resources/mapper/control/IotDeviceControlLogMapper.xml

32
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<IotCarbonProductionCustomDTO> 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<IotCarbonProductionCustomDTO> getCustomDTOS() {
return customDTOS;
}

14
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;
}

6
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)){
try {
thingModelService.saveOrUpdateBatch(insertModelList);
} catch (Exception e) {
}
updateModelCache(insertModelList);
}
if(CollectionUtils.isNotEmpty(distinctStudentFile)){
try {
entityService.saveOrUpdateBatch(distinctStudentFile);
} catch (Exception e) {
}
updateEntityCache(distinctStudentFile);
}
} catch (Exception e) {

9
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
<where>
<if test="name != null and name.trim() != ''">
@ -45,7 +44,7 @@
and (itt.code like #{device} or itt.name like #{device})
</if>
<if test="attr != null and attr.trim() != ''">
and (itd.code like #{attr} or idr.to_name like #{attr})
and (idr.code like #{attr} or idr.name like #{attr})
</if>
<if test="extendId != null">
and idc.extend_id = #{extendId}

Loading…
Cancel
Save