Merge remote-tracking branch 'origin/main'

This commit is contained in:
yu 2024-12-16 16:19:09 +08:00
commit dd967451fd
14 changed files with 1270 additions and 1196 deletions

View File

@ -1256,12 +1256,12 @@ BOOLEAN CRYDevice::processRyFTP2MinioParam(const Json::Value jsonRoot, int pid)
config_config.processes[pid].option.ftp2minio.net.bind_addr = INADDR_ANY;
config_config.processes[pid].option.ftp2minio.net.bind_port = 0;
config_config.processes[pid].option.ftp2minio.net.target_addr = INADDR_ANY;
config_config.processes[pid].option.ftp2minio.net.target_port = 502;
config_config.processes[pid].option.ftp2minio.net.target_port = 21;
if (jsonRoot["targetAddr"].isInt()) {
config_config.processes[pid].option.ftp2minio.net.target_addr = jsonRoot["targetAddr"].asInt();
} else if (jsonRoot["targetAddr"].isString()) {
if (inet_pton(AF_INET, jsonRoot["targetAddr"].asCString(), &config_config.processes[pid].option.ftp2minio.net.target_addr) == 1) {
if (jsonRoot["ftpHost"].isInt()) {
config_config.processes[pid].option.ftp2minio.net.target_addr = jsonRoot["ftpHost"].asInt();
} else if (jsonRoot["ftpHost"].isString()) {
if (inet_pton(AF_INET, jsonRoot["ftpHost"].asCString(), &config_config.processes[pid].option.ftp2minio.net.target_addr) == 1) {
vLog(LOG_DEBUG, "IPv4 地址转换成功,网络字节序为: %u.\n", config_config.processes[pid].option.ftp2minio.net.target_addr);
} else {
vLog(LOG_ERROR, "inet_pton error(%d,%s).\n", errno, strerror(errno));

View File

@ -996,6 +996,8 @@ BOOLEAN CHostADSBFProcess::OnTimer(void)
if (!m_turbine->IsConnected())
{
vLog(LOG_DEBUG, "%s device not connected.\n", m_pidName.c_str());
delete m_turbine;
m_turbine = NULL;
return TRUE;
}
m_apdu_t0_begin = system32.timers;

View File

@ -79,6 +79,10 @@ AmsConnection::AmsConnection(Router& __router, const struct addrinfo* const dest
struct in_addr ss{htonl(remoteIp)};
LOG_INFO("Socket connect["<<std::string(inet_ntoa(ss))<<"] is done.");
}
else
{
socket.Shutdown();
}
}
AmsConnection::~AmsConnection()

View File

@ -21,4 +21,18 @@ public interface SysAuthorityIds {
* 设备控制控制权限
*/
Integer SYS_AUTHORITY_ID_DEVICE_CTRL=104;
/**
* 查看涉密数据权限
*/
Integer SYS_AUTHORITY_ID_VIEW_CONFIDENTIAL_DATA=105;
/**
* AGC&AVC控制权限
*/
Integer SYS_AUTHORITY_ID_AGC_AVC_CTRL=106;
/**
* 温度限值设置权限
*/
Integer SYS_AUTHORITY_ID_TEMPERATURE_LIMIT_SETTING=107;
}

View File

@ -26,9 +26,13 @@ public class SysAuthorityServiceImpl implements SysAuthorityService {
@PostConstruct
public void init() {
List<SysAuthority> list = new ArrayList<>();
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_ADMIN,"SYS_AUTHORITY_ID_ADMIN","系统管理权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_MGR,"SYS_AUTHORITY_ID_DEVICE_MGR","设备台账维护权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_VIEW,"SYS_AUTHORITY_ID_DEVICE_VIEW","设备台账浏览权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_ADMIN,"ADMIN","系统管理权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_MGR,"DEVICE_MGR","设备台账维护权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_VIEW,"DEVICE_VIEW","设备台账浏览权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_CTRL,"DEVICE_CTRL","设备控制控制权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_VIEW_CONFIDENTIAL_DATA,"VIEW_CONFIDENTIAL_DATA","查看涉密数据权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_AGC_AVC_CTRL,"AGC_AVC_CTRL","AGC&AVC控制权限"));
list.add(new SysAuthority(SysAuthorityIds.SYS_AUTHORITY_ID_TEMPERATURE_LIMIT_SETTING,"TEMPERATURE_LIMIT_SETTING","温度限值设置权限"));
try {
// 性能优化先查询所有需要的权限是否存在减少数据库访问次数

View File

@ -216,7 +216,7 @@ public class SysIotModelController {
return R.success();
}
/** 物模型导出 */
/** 物模型属性导出 */
@PostMapping("/export")
public void exportSysIotModel(@RequestBody SysIotModelDto sysIotModelDto, HttpServletRequest request, HttpServletResponse response) {
@ -227,7 +227,7 @@ public class SysIotModelController {
}
/** 物模型导入 */
/** 物模型属性导入 */
@PostMapping("/import")
public R<Void> importSysIotModel(String id, @RequestParam("file") MultipartFile file) throws IOException {

View File

@ -77,5 +77,5 @@ public class SysIotModelFieldDto implements Serializable {
private String stateDesc;
private Integer confidential;
}

View File

@ -70,4 +70,6 @@ public class SysIotModelFieldVo {
private String stateDesc;
private Integer confidential;
}

View File

@ -111,4 +111,11 @@ public class SysIotModelField extends BaseEntity {
*/
@TableField("statedesc")
private String stateDesc;
/**
* 是否为敏感数据
*/
@TableField("confidential")
private Integer confidential;
}

View File

@ -311,8 +311,9 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put("dataType", "*数据类型");
map.put("visible", "是否可见0不可见1可见");
map.put("highSpeed", "*属性频度0低频属性1高频属性");
map.put("level","离散量级别:0提示;1告警;2故障");
map.put("stateDesc","告警级别描述");
map.put("level", "离散量级别:0提示;1告警;2故障");
map.put("stateDesc", "告警级别描述");
map.put("confidential","是否为敏感数据(0非敏感数据1敏感数据)");
sheetDTO.setSheetName("物模型属性");
sheetDTO.setFieldAndAlias(map);
sheetDTO.setCollection(sysIotModelFieldVoList);
@ -460,7 +461,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
//创建低频超级表
tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "l_", map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","新增低频TD超级表字段,"+"表名l_" +sysIotModel.getIotModelCode()+",字段:"+map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "新增低频TD超级表字段," + "表名l_" + sysIotModel.getIotModelCode() + ",字段:" + map);
addModelFieldCache(lowCreateList.get(i));
}
}
@ -476,7 +477,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
//创建高频超级表
tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "h_", map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","新增低频TD超级表字段,"+"表名h_" +sysIotModel.getIotModelCode()+",字段:"+map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "新增低频TD超级表字段," + "表名h_" + sysIotModel.getIotModelCode() + ",字段:" + map);
addModelFieldCache(highCreateList.get(i));
}
}
@ -514,10 +515,13 @@ public class SysIotModelServiceImpl implements SysIotModelService {
private static void buildFieldInfo(String iotModelId, List<Object> row, SysIotModelField field) {
//参数校验
boolean allNotEmpty = ObjectUtil.isAllNotEmpty(row.get(3), row.get(4), row.get(5), row.get(7), row.get(9), row.get(11));
boolean allNotEmpty = ObjectUtil.isAllNotEmpty(row.get(3), row.get(4), row.get(5), row.get(7), row.get(9), row.get(11), row.get(14));
if (!allNotEmpty) {
throw new ServiceException("字段不可为空请检查excel文件{}" + row);
}
if (!(row.get(14).toString().equals("0") || row.get(14).toString().equals("1"))){
throw new ServiceException("参数是否为敏感字段不符合规范请输入0或者1");
}
field.setAttributeCode(row.get(3).toString());
field.setAttributeName(row.get(4).toString());
field.setAttributeType(Integer.valueOf(row.get(5).toString()));
@ -530,6 +534,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
field.setHighSpeed(Integer.valueOf(row.get(11).toString()));
field.setLevel(ObjectUtil.isEmpty(row.get(12)) ? null : Integer.valueOf(row.get(12).toString()));
field.setStateDesc(ObjectUtil.isEmpty(row.get(13)) ? null : row.get(13).toString());
field.setConfidential(Integer.valueOf(row.get(14).toString()));
field.setIotModelId(Long.valueOf(iotModelId));
}
@ -544,7 +549,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
if (sysIotModelField.getAttributeType() == 199) {
String modelCode = dataService.iotModelMap.get(sysIotModelField.getIotModelId().toString());
tdEngineService.createCalStable(modelCode, sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
sysRecordLogService.createRecordLog("/系统管理/物模型配置","创建计算超级表"+"c_" + modelCode + "_" + sysIotModelField.getAttributeCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "创建计算超级表" + "c_" + modelCode + "_" + sysIotModelField.getAttributeCode());
} else {
//创建type为138 139 140的超级表
//如果新增的是第一条记录 创建tdengine超级表 分为高频和低频
@ -559,7 +564,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
//创建低频超级表
tdEngineService.createStable(sysIotModel.getIotModelCode(), "l_", map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","创建低频TD超级表"+"l_" +sysIotModel.getIotModelCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "创建低频TD超级表" + "l_" + sysIotModel.getIotModelCode());
}
if (sysIotModelField.getHighSpeed() == 1) {
SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId());
@ -567,7 +572,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
//创建高频超级表
tdEngineService.createStable(sysIotModel.getIotModelCode(), "h_", map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","创建高频TD超级表"+"h_" +sysIotModel.getIotModelCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "创建高频TD超级表" + "h_" + sysIotModel.getIotModelCode());
}
} else {
//stable已经存在,新增stable列
@ -577,7 +582,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
//创建低频超级表
tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "l_", map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","新增低频TD超级表字段,"+"表名l_" +sysIotModel.getIotModelCode()+",字段:"+map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "新增低频TD超级表字段," + "表名l_" + sysIotModel.getIotModelCode() + ",字段:" + map);
}
if (sysIotModelField.getHighSpeed() == 1) {
SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId());
@ -585,7 +590,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
map.put(sysIotModelField.getAttributeCode(), sysIotModelField.getDataType());
//创建高频超级表
tdEngineService.addStableColumn(sysIotModel.getIotModelCode(), "h_", map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","新增高频TD超级表字段,"+"表名h_" +sysIotModel.getIotModelCode()+",字段:"+map);
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "新增高频TD超级表字段," + "表名h_" + sysIotModel.getIotModelCode() + ",字段:" + map);
}
}
}
@ -601,7 +606,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
Long iotModelId = sysIotModelField.getIotModelId();
String modelCode = dataService.iotModelMap.get(iotModelId.toString());
tdEngineService.deleteStable("c_" + modelCode + "_" + sysIotModelField.getAttributeCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置","删除TD超级表"+"c_" + modelCode + "_" + sysIotModelField.getAttributeCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "删除TD超级表" + "c_" + modelCode + "_" + sysIotModelField.getAttributeCode());
} else {
String stableName = null;
SysIotModel sysIotModel = sysIotModelMapper.selectById(sysIotModelField.getIotModelId());
@ -617,12 +622,12 @@ public class SysIotModelServiceImpl implements SysIotModelService {
List<SysIotModelField> sysIotModelFields = sysIotModelFieldMapper.selectList(queryWrapper);
if (CollectionUtils.isNotEmpty(sysIotModelFields) && sysIotModelFields.size() > 1) {
tdEngineService.deleteColumn(stableName, sysIotModelField.getAttributeCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置","删除TD超级表"+ stableName +"中字段:"+ sysIotModelField.getAttributeCode());
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "删除TD超级表" + stableName + "中字段:" + sysIotModelField.getAttributeCode());
}
//物模型属性只剩下最后一个删除表
if (CollectionUtils.isNotEmpty(sysIotModelFields) && sysIotModelFields.size() == 1) {
tdEngineService.deleteStable(stableName);
sysRecordLogService.createRecordLog("/系统管理/物模型配置","删除TD超级表"+ stableName);
sysRecordLogService.createRecordLog("/系统管理/物模型配置", "删除TD超级表" + stableName);
}
}
@ -635,13 +640,12 @@ public class SysIotModelServiceImpl implements SysIotModelService {
Map<String, String> fieldCodeNameMap = dataService.fieldCodeNameMap.get(modelCode);
if (fieldCodeNameMap == null) {
Map<String, String> fieldCodeName = new HashMap<>();
fieldCodeName.put(sysIotModelField.getAttributeCode(),sysIotModelField.getAttributeName());
dataService.fieldCodeNameMap.put(modelCode,fieldCodeName);
}
else {
fieldCodeName.put(sysIotModelField.getAttributeCode(), sysIotModelField.getAttributeName());
dataService.fieldCodeNameMap.put(modelCode, fieldCodeName);
} else {
fieldCodeNameMap.put(sysIotModelField.getAttributeCode(), sysIotModelField.getAttributeName());
}
if (sysIotModelField.getLevel() != null){
if (sysIotModelField.getLevel() != null) {
Map<String, Integer> levelMap = dataService.eventLevelMap.get(modelCode);
if (levelMap == null) {
Map<String, Integer> calMap = new HashMap<>();
@ -652,7 +656,7 @@ public class SysIotModelServiceImpl implements SysIotModelService {
}
}
if (sysIotModelField.getStateDesc() != null){
if (sysIotModelField.getStateDesc() != null) {
Map<String, String> stateDescMap = dataService.stateDescMap.get(modelCode);
if (stateDescMap == null) {
Map<String, String> calMap = new HashMap<>();
@ -710,10 +714,10 @@ public class SysIotModelServiceImpl implements SysIotModelService {
String modelCode = dataService.iotModelMap.get(sysIotModelField.getIotModelId().toString());
Map<String, String> fieldCodeName = dataService.fieldCodeNameMap.get(modelCode);
fieldCodeName.remove(sysIotModelField.getAttributeCode());
if (sysIotModelField.getLevel() != null){
if (sysIotModelField.getLevel() != null) {
dataService.eventLevelMap.remove(sysIotModelField.getAttributeCode());
}
if (sysIotModelField.getStateDesc() != null){
if (sysIotModelField.getStateDesc() != null) {
dataService.stateDescMap.remove(sysIotModelField.getAttributeCode());
}
if (sysIotModelField.getAttributeType() == 199) {

View File

@ -51,7 +51,7 @@ public class FaultRecorderController {
String code = jsonObject.getString("deviceCode");
String startTime = jsonObject.getString("startTime");
String endTime = jsonObject.getString("endTime");
List<FileNode> result = faultRecorderService.getDirOrFileList("Tracelog",code,startTime,endTime);
List<FileNode> result = faultRecorderService.getDirOrFileList("Statuscode",code,startTime,endTime);
return R.success(result);
}

View File

@ -26,7 +26,7 @@ import java.util.List;
import java.util.Map;
/**
* 故障录波controller
* 运行日志controller
*/
@Slf4j
@RequestMapping("/api/plc")
@ -44,7 +44,7 @@ public class PlcLogsController {
String code = jsonObject.getString("deviceCode");
String startTime = jsonObject.getString("startTime");
String endTime = jsonObject.getString("endTime");
List<FileNode> result = plcLogService.getDirOrFileList("Statuscode",code,startTime,endTime);
List<FileNode> result = plcLogService.getDirOrFileList("Tracelog",code,startTime,endTime);
return R.success(result);
}

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,9 @@
@click="handleClick(item)"
@contextmenu.prevent="windContextMenu($event,item)"
>
<div class="FanList-panel" :class="{
'wind-mark': item.standard==1,
'wind-default': item.standard==0,
<div class="FanList-panel wind-default" :class="{
'': item.standard==1,
'': item.standard==0,
'wind-offline': item.attributeMap.processedoperationmode == 33
}">
@ -95,6 +95,18 @@
class="control-btn"
type="primary">锁定</el-button>
<el-button @click="sendManualCommand(0)" v-else class="control-btn" type="primary">解锁</el-button>
<el-button
class="control-btn"
type="primary"
@click=""
v-if="realTimeData.standard == 0"
>标杆设置</el-button>
<el-button
class="control-btn"
type="primary"
@click=""
v-else
>标杆取消</el-button>
</div>
</template>
</ContextMenu>
@ -121,14 +133,25 @@ const getAnimationStyle = (item) => {
const irotorspeed = item.attributeMap?.irotorspeed ?? 0
let animationDuration;
animationDuration = 60 / irotorspeed / 3
return {
'animation-duration': `${animationDuration}s`,
'animation-timing-function': 'linear',
'animation-iteration-count': 'infinite',
'animation-direction': 'normaL',
const processedoperationmode = item.attributeMap?.processedoperationmode ?? 0
if(processedoperationmode==33){
return {
'animation-duration': `0s`,
'animation-timing-function': 'linear',
'animation-iteration-count': 'infinite',
'animation-direction': 'normaL',
}
}else{
return {
'animation-duration': `${animationDuration}s`,
'animation-timing-function': 'linear',
'animation-iteration-count': 'infinite',
'animation-direction': 'normaL',
}
}
}
const handleClick = (row) => {
@ -166,7 +189,8 @@ const realTimeData = ref<any>({
processedoperationmode: 1111,
locked: 0,
deviceId: '',
name:''
name:'',
standard:''
})
const windContextMenu = (event: any,curnodeData) => {
contextMenuPos.value.x = event.pageX
@ -175,6 +199,7 @@ const windContextMenu = (event: any,curnodeData) => {
realTimeData.value.locked=curnodeData.attributeMap.locked
realTimeData.value.deviceId=curnodeData.irn
realTimeData.value.name=curnodeData.name
realTimeData.value.standard=curnodeData.standard
OperateVisible.value = true
}
const sendCommand = (type: 'setTurbineFastStart' | 'setTurbineStop' | 'setTurbineResetStatusCode') => {