diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqIcdPathParam.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqIcdPathParam.java index e23d7a9ea..0072c6dac 100644 --- a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqIcdPathParam.java +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/PqIcdPathParam.java @@ -24,6 +24,7 @@ public class PqIcdPathParam { */ @ApiModelProperty("icd文件名") @NotBlank(message = "icd文件名不能为空") + @Pattern(regexp = PatternRegex.DES32_REGEX, message = "文件名过长") private String fileName; /** diff --git a/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/RestartParam.java b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/RestartParam.java new file mode 100644 index 000000000..624d37c58 --- /dev/null +++ b/pqs-device/pq-device/pq-device-api/src/main/java/com/njcn/device/pq/pojo/param/RestartParam.java @@ -0,0 +1,20 @@ +package com.njcn.device.pq.pojo.param; + +import lombok.Data; + +/** + * Description: + * Date: 2025/08/29 上午 8:44【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@Data +public class RestartParam { + + private Integer processNo; + //type 1:前置 2,进程 + private String deviceRebootType; + private String nodeId; + +} diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java index c0bcbc652..82d9c4bf5 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/controller/TerminalBaseController.java @@ -421,18 +421,14 @@ public class TerminalBaseController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } -// @ApiOperation("请求前置重启进程") -// @PostMapping(value = "askRestartProcess") -// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE) -// @ApiImplicitParams({ -// @ApiImplicitParam(name = "processNo", value = "进程号", required = true), -// @ApiImplicitParam(name = "deviceRebootType", value = "重启类型", required = true) -// }) -// public HttpResult askRestartProcess(@RequestParam("processNo")Integer processNo,@RequestParam("processType")String processType,@RequestParam("deviceRebootType")String deviceRebootType) { -// String methodDescribe = getMethodDescribe("askRestartProcess"); -// terminalBaseService.askRestartProcess(processNo,processType,deviceRebootType); -// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe); -// } + @ApiOperation("请求前置重启进程") + @PostMapping(value = "askRestartProcess") + @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE) + public HttpResult askRestartProcess(@RequestBody RestartParam restartParam) { + String methodDescribe = getMethodDescribe("askRestartProcess"); + terminalBaseService.askRestartProcess(restartParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe); + } // @ApiOperation("请求前置设备重启") // @PostMapping(value = "askRestartDevice") diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/TerminalBaseService.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/TerminalBaseService.java index 572f83579..cdc3f4c08 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/TerminalBaseService.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/TerminalBaseService.java @@ -6,10 +6,7 @@ import com.njcn.device.pq.pojo.bo.DeviceType; import com.njcn.device.pq.pojo.bo.excel.TerminalBaseExcel; import com.njcn.device.pq.pojo.dto.PreCommandDTO; import com.njcn.device.pq.pojo.dto.PushResultDTO; -import com.njcn.device.pq.pojo.param.AddTerminalParam; -import com.njcn.device.pq.pojo.param.DeviceInfoParam; -import com.njcn.device.pq.pojo.param.SyncTerminalParam; -import com.njcn.device.pq.pojo.param.UpdateTerminalParam; +import com.njcn.device.pq.pojo.param.*; import com.njcn.device.pq.pojo.po.Line; import com.njcn.device.pq.pojo.vo.DevStatusNumVO; import com.njcn.device.pq.pojo.vo.LineWiringDiagramVO; @@ -297,4 +294,5 @@ public interface TerminalBaseService { PushResultDTO getPushResult(String guid); + void askRestartProcess( RestartParam restartParam); } diff --git a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java index 2bac34db4..5966e0897 100644 --- a/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java +++ b/pqs-device/pq-device/pq-device-boot/src/main/java/com/njcn/device/pq/service/impl/TerminalBaseServiceImpl.java @@ -4004,6 +4004,124 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple } @Override + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + public PushResultDTO getPushResult(String guid) { PushResultDTO pushResultDTO = new PushResultDTO(); String stringByKey = redisUtil.getStringByKey(RedisKeyPrefix.TOPIC_REPLY.concat(guid)); @@ -4022,6 +4140,32 @@ public class TerminalBaseServiceImpl extends ServiceImpl imple return pushResultDTO; } + @Override + public void askRestartProcess( RestartParam restartParam) { + + ProcessRebootMessage procesRebootMessage = new ProcessRebootMessage(); + + Node nodeById = nodeService.getNodeById(restartParam.getNodeId()); + procesRebootMessage.setIndex(restartParam.getProcessNo()); + if(Objects.equals("1",restartParam.getDeviceRebootType())){ + procesRebootMessage.setFun("reset"); + procesRebootMessage.setProcessNum(nodeById.getMaxProcessNum()); + procesRebootMessage.setProcessNo(1); + + }else { + procesRebootMessage.setFun("delete"); + procesRebootMessage.setProcessNo(restartParam.getProcessNo()); + + } + procesRebootMessage.setFrontType("all"); + procesRebootMessage.setNodeId(restartParam.getNodeId()); + String guid = IdUtil.simpleUUID(); + + procesRebootMessage.setGuid(guid); + produceFeignClient.askRestartProcess(procesRebootMessage); + + } + //反解析日志 public List parseTemplateValues(String template, String actualString) { List values = new ArrayList<>(); diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/PqFrontLogsDTO.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/PqFrontLogsDTO.java index e028bde83..4d84ec79a 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/PqFrontLogsDTO.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/dto/PqFrontLogsDTO.java @@ -18,6 +18,7 @@ public class PqFrontLogsDTO { private String nodeId; private String processNo; private String businessId; + private String code; private String level; private String logType; private String grade; diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsChildParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsChildParam.java new file mode 100644 index 000000000..19e9c5ce8 --- /dev/null +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsChildParam.java @@ -0,0 +1,19 @@ +package com.njcn.system.pojo.param; + +import com.njcn.web.pojo.param.BaseParam; +import lombok.Data; + +/** + * Description: + * Date: 2025/05/15 下午 2:19【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@Data +public class PqFrontLogsChildParam extends BaseParam { + + //terminal设备,measurepoint监测点 + private String mainId; + +} diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsParam.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsParam.java index b46e04f3c..f174161e9 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsParam.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/param/PqFrontLogsParam.java @@ -18,10 +18,8 @@ public class PqFrontLogsParam extends BaseParam { //terminal设备,measurepoint监测点 private String level; - //"logtype": "com/data", //日志类型 - private String logType; - //"grade": "NORMAL/DEBUG", //日志等级 - private String grade; + + private String code; //前置类型stat稳态/recall补招/realTime实时/comtrade private String frontType; diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogs.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogs.java index 2759c0466..56720230c 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogs.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogs.java @@ -22,10 +22,11 @@ public class PqFrontLogs extends BaseEntity { private String nodeId; private String processNo; private String businessId; + private String code; private String level; private String logType; - private String grade; +// private String grade; private String frontType; - private String log; +// private String log; private Integer state; } diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogsChild.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogsChild.java new file mode 100644 index 000000000..9c626c24f --- /dev/null +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/po/PqFrontLogsChild.java @@ -0,0 +1,40 @@ +package com.njcn.system.pojo.po; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.time.LocalDateTime; + +import com.njcn.db.bo.BaseEntity; +import lombok.Data; + +/** + * Description: + * Date: 2025/09/03 下午 1:53【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +@Data +@TableName(value = "pq_front_logs_child") +public class PqFrontLogsChild extends BaseEntity { + @TableId(value = "id", type = IdType.ASSIGN_UUID) + private String id; + + /** + * 主表id + */ + @TableField(value = "main_id") + private String mainId; + + @TableField(value = "log") + private String log; + + @TableField(value = "grade") + private String grade; + + @TableField(value = "`state`") + private Integer state; + +} \ No newline at end of file diff --git a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/PqFrontLogsVO.java b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/PqFrontLogsVO.java index 2df32a904..3080ded1f 100644 --- a/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/PqFrontLogsVO.java +++ b/pqs-system/system-api/src/main/java/com/njcn/system/pojo/vo/PqFrontLogsVO.java @@ -32,6 +32,10 @@ public class PqFrontLogsVO extends BaseEntity { private String grade; //前置业务类型 private String frontType; + //前置业务类型 + private String code; + //前置业务类型 + private String codeName; //日志详情 private String log; private Integer state; diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/PqFrontLogsController.java b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/PqFrontLogsController.java index 674d1788b..a30df0736 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/controller/PqFrontLogsController.java +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/controller/PqFrontLogsController.java @@ -11,7 +11,9 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum; import com.njcn.common.pojo.response.HttpResult; import com.njcn.common.utils.HttpResultUtil; import com.njcn.system.pojo.dto.PqFrontLogsDTO; +import com.njcn.system.pojo.param.PqFrontLogsChildParam; import com.njcn.system.pojo.param.PqFrontLogsParam; +import com.njcn.system.pojo.po.PqFrontLogsChild; import com.njcn.system.pojo.po.UserLog; import com.njcn.system.pojo.vo.PqFrontLogsVO; import com.njcn.system.service.IUserLogService; @@ -75,5 +77,14 @@ public class PqFrontLogsController extends BaseController { Page list = pqFrontLogsService.queryPage(baseParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); } + @OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY) + @PostMapping("/queryLogCHild") + @ApiOperation("查询前置日志") + @ApiImplicitParam(name = "baseParam", value = "查询日志参数", required = true) + public HttpResult> queryLogCHild(@RequestBody PqFrontLogsChildParam baseParam) { + String methodDescribe = getMethodDescribe("queryFrontLogs"); + Page list = pqFrontLogsService.queryLogCHild(baseParam); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe); + } } diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/PqFrontLogsChildMapper.java b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/PqFrontLogsChildMapper.java new file mode 100644 index 000000000..352397309 --- /dev/null +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/PqFrontLogsChildMapper.java @@ -0,0 +1,15 @@ +package com.njcn.system.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.system.pojo.po.PqFrontLogsChild; + +/** + * Description: + * Date: 2025/09/03 下午 1:53【需求编号】 + * + * @author clam + * @version V1.0.0 + */ +public interface PqFrontLogsChildMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsChildMapper.xml b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsChildMapper.xml new file mode 100644 index 000000000..50c5158b8 --- /dev/null +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsChildMapper.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + id, main_id, log, `state`, create_by, create_time, update_by, update_time + + \ No newline at end of file diff --git a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsMapper.xml b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsMapper.xml index 2cc38d82b..3979ff26c 100644 --- a/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsMapper.xml +++ b/pqs-system/system-boot/src/main/java/com/njcn/system/mapper/mapping/PqFrontLogsMapper.xml @@ -5,11 +5,14 @@