Commit 8ee5ccf5 zshaohui

1.黑灯工厂增加设备状态推送

2.增加errorcode信息 传给mes
1 个父辈 6e1a4a95
...@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling; ...@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
//@EnableAsync //@EnableAsync
//@EnableScheduling @EnableScheduling
@EnableKafka @EnableKafka
@RestController @RestController
@SpringBootApplication @SpringBootApplication
......
...@@ -760,6 +760,7 @@ public class BaseDeviceHandler implements IDeviceHandler { ...@@ -760,6 +760,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
statusBean.setOp(statusBeanToSave.getOp()); statusBean.setOp(statusBeanToSave.getOp());
statusBean.setSeq(statusBeanToSave.getSeq()); statusBean.setSeq(statusBeanToSave.getSeq());
statusBean.setClientIp(statusBeanToSave.getClientIp()); statusBean.setClientIp(statusBeanToSave.getClientIp());
statusBean.setErrorCode(statusBeanToSave.getErrorCode());
/** /**
* 已解除的报警信息存到数据库中 * 已解除的报警信息存到数据库中
......
...@@ -722,4 +722,14 @@ public class DataCache { ...@@ -722,4 +722,14 @@ public class DataCache {
} }
return 0; return 0;
} }
public List<Storage> getStorageByMachineId(String machineId) {
List<Storage> storageList = new ArrayList<>();
for (Storage storage : getAllStorage().values()) {
if (machineId.equals(storage.getMachineId())){
storageList.add(storage);
}
}
return storageList;
}
} }
package com.neotel.smfcore.custom.lizhen.kafka.bean;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("MachineParameter")
public class MachineParameter {
@JSONField(name = "OccurrenceTime")
@ApiModelProperty("发生时间")
private String OccurrenceTime;
@JSONField(name = "MachineID")
@ApiModelProperty("机台唯一ID")
private String MachineID;
@JSONField(name = "TopicType")
@ApiModelProperty("消息类别")
private String TopicType;
@JSONField(name = "ContentType")
@ApiModelProperty("消息类别")
private String ContentType = "F";
@JSONField(name = "MachineType")
@ApiModelProperty("设备类型")
private String MachineType;
@JSONField(name = "SupplierID")
@ApiModelProperty("供应商")
private String SupplierID = "NEOTEL";
@JSONField(name = "ProgramName")
@ApiModelProperty("程序名称")
private String ProgramName;
@JSONField(name = "ProgramVersion")
@ApiModelProperty("程序版本")
private String ProgramVersion;
@JSONField(name = "SerialNumber")
@ApiModelProperty("序列号")
private String SerialNumber;
@JSONField(name = "Result")
@ApiModelProperty("结果")
private String Result;
@JSONField(name = "EmpNo")
@ApiModelProperty("人员")
private String EmpNo;
@JSONField(name = "ClientIP")
@ApiModelProperty("客户端 IP")
private String ClientIP;
@JSONField(name = "Data")
@ApiModelProperty("Data")
private List<MachineParameterData> Data;
}
package com.neotel.smfcore.custom.lizhen.kafka.bean;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
@Data
@AllArgsConstructor
public class MachineParameterData {
@JSONField(name = "ParaName")
private String ParaName;
@JSONField(name = "ParaValue")
private String ParaValue;
}
...@@ -10,4 +10,10 @@ public class KafkaConfig { ...@@ -10,4 +10,10 @@ public class KafkaConfig {
* 心跳主题 * 心跳主题
*/ */
public static final String HEARTBEAT_TOPIC = "Heartbeat"; public static final String HEARTBEAT_TOPIC = "Heartbeat";
/**
* MachineParameter
*/
public static final String MACHINEPARAMETER_TOPIC = "MachineParameter";
} }
package com.neotel.smfcore.custom.lizhen.kafka.config;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Component
public class StorageExportConfig {
//private final static List<String> exportStrArr = Arrays.asList("MU1_1", "MU4_1", "MU2_1", "MU5_1", "MU1_2", "MU4_2", "MU5_2", "MU3_1");
public static Map<String, String> exportMap = new ConcurrentHashMap<>();
@PostConstruct
public void initMap() {
exportMap.put("MU1_1", "SJ202306205006");
exportMap.put("MU1_2", "SJ202306205007");
exportMap.put("MU2_1", "SJ202306205005");
exportMap.put("MU3_1", "SJ202306205008");
exportMap.put("MU4_1", "SJ202306205003");
exportMap.put("MU4_2", "SJ202306205004");
exportMap.put("MU5_1", "SJ202306205001");
exportMap.put("MU5_2", "SJ202306205002");
}
public static String getMachineId(String key) {
return exportMap.get(key);
}
}
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!