Browse Source

产品基本信息新增产品模型类别

thing_master
xiachao 1 year ago
parent
commit
feb61eaf83
  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. 10
      modules/thing/src/main/java/com/thing/listener/QueueDeviceEventListener.java

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

10
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) {

Loading…
Cancel
Save