|
|
|
@ -148,7 +148,6 @@ public class RecipeDeviceRecordController {
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 批量创建设备点位采集记录和配方点位记录
|
|
|
|
* 批量创建设备点位采集记录和配方点位记录
|
|
|
|
* @param recipeId 配方ID
|
|
|
|
|
|
|
|
* @return 创建结果
|
|
|
|
* @return 创建结果
|
|
|
|
* @throws JsonProcessingException JSON处理异常
|
|
|
|
* @throws JsonProcessingException JSON处理异常
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ -198,6 +197,8 @@ public class RecipeDeviceRecordController {
|
|
|
|
|
|
|
|
|
|
|
|
Map<Long, Map<String, Object>> deviceDataMap = deviceService.createDeviceDataMap(device.getId());//recipeRespVO.getDeviceId()
|
|
|
|
Map<Long, Map<String, Object>> deviceDataMap = deviceService.createDeviceDataMap(device.getId());//recipeRespVO.getDeviceId()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Map<String, Object> map = tDengineService.newSelectLatestRow(device.getId());
|
|
|
|
|
|
|
|
|
|
|
|
// OpcUtils.connect(device.getId(),device.getUrl(),device.getUsername(),device.getPassword(),10);
|
|
|
|
// OpcUtils.connect(device.getId(),device.getUrl(),device.getUsername(),device.getPassword(),10);
|
|
|
|
|
|
|
|
|
|
|
|
for (RecipeDeviceAttributeDO attributeDO : attributeList) {
|
|
|
|
for (RecipeDeviceAttributeDO attributeDO : attributeList) {
|
|
|
|
@ -216,9 +217,10 @@ public class RecipeDeviceRecordController {
|
|
|
|
recipeDeviceRecordDO.setDeviceId(deviceContactModelDO.getDeviceId());
|
|
|
|
recipeDeviceRecordDO.setDeviceId(deviceContactModelDO.getDeviceId());
|
|
|
|
recipeDeviceRecordDO.setDataUnit(deviceContactModelDO.getDataUnit());
|
|
|
|
recipeDeviceRecordDO.setDataUnit(deviceContactModelDO.getDataUnit());
|
|
|
|
// recipeDeviceRecordDO.setValue((String) OpcUtils.readValues(device.getId(),deviceContactModelDO.getAddress()));
|
|
|
|
// recipeDeviceRecordDO.setValue((String) OpcUtils.readValues(device.getId(),deviceContactModelDO.getAddress()));
|
|
|
|
if (data.get("addressValue") != null && data.get("addressValue").toString() != null) {
|
|
|
|
// if (data.get("addressValue") != null && data.get("addressValue").toString() != null) {
|
|
|
|
recipeDeviceRecordDO.setValue(data.get("addressValue").toString());
|
|
|
|
// recipeDeviceRecordDO.setValue(data.get("addressValue").toString());
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
recipeDeviceRecordDO.setValue(map.get(deviceContactModelDO.getAttributeCode()));
|
|
|
|
|
|
|
|
|
|
|
|
recipeDeviceRecordService.createRecipeDeviceRecord(BeanUtils.toBean(recipeDeviceRecordDO, RecipeDeviceRecordSaveReqVO.class));
|
|
|
|
recipeDeviceRecordService.createRecipeDeviceRecord(BeanUtils.toBean(recipeDeviceRecordDO, RecipeDeviceRecordSaveReqVO.class));
|
|
|
|
|
|
|
|
|
|
|
|
|