微服务版本相关bug修改
This commit is contained in:
@@ -24,6 +24,7 @@ public class PqIcdPathParam {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty("icd文件名")
|
@ApiModelProperty("icd文件名")
|
||||||
@NotBlank(message = "icd文件名不能为空")
|
@NotBlank(message = "icd文件名不能为空")
|
||||||
|
@Pattern(regexp = PatternRegex.DES32_REGEX, message = "文件名过长")
|
||||||
private String fileName;
|
private String fileName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -421,18 +421,14 @@ public class TerminalBaseController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiOperation("请求前置重启进程")
|
@ApiOperation("请求前置重启进程")
|
||||||
// @PostMapping(value = "askRestartProcess")
|
@PostMapping(value = "askRestartProcess")
|
||||||
// @OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.DELETE)
|
||||||
// @ApiImplicitParams({
|
public HttpResult<Object> askRestartProcess(@RequestBody RestartParam restartParam) {
|
||||||
// @ApiImplicitParam(name = "processNo", value = "进程号", required = true),
|
String methodDescribe = getMethodDescribe("askRestartProcess");
|
||||||
// @ApiImplicitParam(name = "deviceRebootType", value = "重启类型", required = true)
|
terminalBaseService.askRestartProcess(restartParam);
|
||||||
// })
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||||
// public HttpResult<Object> 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("请求前置设备重启")
|
// @ApiOperation("请求前置设备重启")
|
||||||
// @PostMapping(value = "askRestartDevice")
|
// @PostMapping(value = "askRestartDevice")
|
||||||
|
|||||||
@@ -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.bo.excel.TerminalBaseExcel;
|
||||||
import com.njcn.device.pq.pojo.dto.PreCommandDTO;
|
import com.njcn.device.pq.pojo.dto.PreCommandDTO;
|
||||||
import com.njcn.device.pq.pojo.dto.PushResultDTO;
|
import com.njcn.device.pq.pojo.dto.PushResultDTO;
|
||||||
import com.njcn.device.pq.pojo.param.AddTerminalParam;
|
import com.njcn.device.pq.pojo.param.*;
|
||||||
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.po.Line;
|
import com.njcn.device.pq.pojo.po.Line;
|
||||||
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
import com.njcn.device.pq.pojo.vo.DevStatusNumVO;
|
||||||
import com.njcn.device.pq.pojo.vo.LineWiringDiagramVO;
|
import com.njcn.device.pq.pojo.vo.LineWiringDiagramVO;
|
||||||
@@ -297,4 +294,5 @@ public interface TerminalBaseService {
|
|||||||
PushResultDTO getPushResult(String guid);
|
PushResultDTO getPushResult(String guid);
|
||||||
|
|
||||||
|
|
||||||
|
void askRestartProcess( RestartParam restartParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4004,6 +4004,124 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public PushResultDTO getPushResult(String guid) {
|
public PushResultDTO getPushResult(String guid) {
|
||||||
PushResultDTO pushResultDTO = new PushResultDTO();
|
PushResultDTO pushResultDTO = new PushResultDTO();
|
||||||
String stringByKey = redisUtil.getStringByKey(RedisKeyPrefix.TOPIC_REPLY.concat(guid));
|
String stringByKey = redisUtil.getStringByKey(RedisKeyPrefix.TOPIC_REPLY.concat(guid));
|
||||||
@@ -4022,6 +4140,32 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
|||||||
return pushResultDTO;
|
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<String> parseTemplateValues(String template, String actualString) {
|
public List<String> parseTemplateValues(String template, String actualString) {
|
||||||
List<String> values = new ArrayList<>();
|
List<String> values = new ArrayList<>();
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ public class PqFrontLogsDTO {
|
|||||||
private String nodeId;
|
private String nodeId;
|
||||||
private String processNo;
|
private String processNo;
|
||||||
private String businessId;
|
private String businessId;
|
||||||
|
private String code;
|
||||||
private String level;
|
private String level;
|
||||||
private String logType;
|
private String logType;
|
||||||
private String grade;
|
private String grade;
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,10 +18,8 @@ public class PqFrontLogsParam extends BaseParam {
|
|||||||
|
|
||||||
//terminal设备,measurepoint监测点
|
//terminal设备,measurepoint监测点
|
||||||
private String level;
|
private String level;
|
||||||
//"logtype": "com/data", //日志类型
|
|
||||||
private String logType;
|
private String code;
|
||||||
//"grade": "NORMAL/DEBUG", //日志等级
|
|
||||||
private String grade;
|
|
||||||
//前置类型stat稳态/recall补招/realTime实时/comtrade
|
//前置类型stat稳态/recall补招/realTime实时/comtrade
|
||||||
private String frontType;
|
private String frontType;
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,11 @@ public class PqFrontLogs extends BaseEntity {
|
|||||||
private String nodeId;
|
private String nodeId;
|
||||||
private String processNo;
|
private String processNo;
|
||||||
private String businessId;
|
private String businessId;
|
||||||
|
private String code;
|
||||||
private String level;
|
private String level;
|
||||||
private String logType;
|
private String logType;
|
||||||
private String grade;
|
// private String grade;
|
||||||
private String frontType;
|
private String frontType;
|
||||||
private String log;
|
// private String log;
|
||||||
private Integer state;
|
private Integer state;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -32,6 +32,10 @@ public class PqFrontLogsVO extends BaseEntity {
|
|||||||
private String grade;
|
private String grade;
|
||||||
//前置业务类型
|
//前置业务类型
|
||||||
private String frontType;
|
private String frontType;
|
||||||
|
//前置业务类型
|
||||||
|
private String code;
|
||||||
|
//前置业务类型
|
||||||
|
private String codeName;
|
||||||
//日志详情
|
//日志详情
|
||||||
private String log;
|
private String log;
|
||||||
private Integer state;
|
private Integer state;
|
||||||
|
|||||||
@@ -11,7 +11,9 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.system.pojo.dto.PqFrontLogsDTO;
|
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.param.PqFrontLogsParam;
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogsChild;
|
||||||
import com.njcn.system.pojo.po.UserLog;
|
import com.njcn.system.pojo.po.UserLog;
|
||||||
import com.njcn.system.pojo.vo.PqFrontLogsVO;
|
import com.njcn.system.pojo.vo.PqFrontLogsVO;
|
||||||
import com.njcn.system.service.IUserLogService;
|
import com.njcn.system.service.IUserLogService;
|
||||||
@@ -75,5 +77,14 @@ public class PqFrontLogsController extends BaseController {
|
|||||||
Page<PqFrontLogsVO> list = pqFrontLogsService.queryPage(baseParam);
|
Page<PqFrontLogsVO> list = pqFrontLogsService.queryPage(baseParam);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
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<Page<PqFrontLogsChild>> queryLogCHild(@RequestBody PqFrontLogsChildParam baseParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("queryFrontLogs");
|
||||||
|
Page<PqFrontLogsChild> list = pqFrontLogsService.queryLogCHild(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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<PqFrontLogsChild> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.njcn.system.mapper.PqFrontLogsChildMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.njcn.system.pojo.po.PqFrontLogsChild">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table pq_front_logs_child-->
|
||||||
|
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||||
|
<result column="main_id" jdbcType="VARCHAR" property="mainId" />
|
||||||
|
<result column="log" jdbcType="LONGVARCHAR" property="log" />
|
||||||
|
<result column="state" jdbcType="INTEGER" property="state" />
|
||||||
|
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||||
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
|
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||||
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, main_id, log, `state`, create_by, create_time, update_by, update_time
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
@@ -5,11 +5,14 @@
|
|||||||
<select id="page" resultType="com.njcn.system.pojo.vo.PqFrontLogsVO">
|
<select id="page" resultType="com.njcn.system.pojo.vo.PqFrontLogsVO">
|
||||||
select
|
select
|
||||||
A.*,
|
A.*,
|
||||||
line.name businessName
|
line.name businessName,
|
||||||
|
sys.name codeName
|
||||||
from
|
from
|
||||||
PQ_FRONT_LOGS A
|
PQ_FRONT_LOGS A
|
||||||
left join pq_line line
|
left join pq_line line
|
||||||
on line.id =A.business_id
|
on line.id =A.business_id
|
||||||
|
left join sys_dict_data sys
|
||||||
|
on sys.Code = A.code
|
||||||
<where>
|
<where>
|
||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
|
|||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package com.njcn.system.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogsChild;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/09/03 下午 1:52【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
public interface PqFrontLogsChildService extends IService<PqFrontLogsChild> {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.common.pojo.dto.LogInfoDTO;
|
import com.njcn.common.pojo.dto.LogInfoDTO;
|
||||||
import com.njcn.system.pojo.dto.PqFrontLogsDTO;
|
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.param.PqFrontLogsParam;
|
||||||
import com.njcn.system.pojo.po.PqFrontLogs;
|
import com.njcn.system.pojo.po.PqFrontLogs;
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogsChild;
|
||||||
import com.njcn.system.pojo.po.UserLog;
|
import com.njcn.system.pojo.po.UserLog;
|
||||||
import com.njcn.system.pojo.vo.PqFrontLogsVO;
|
import com.njcn.system.pojo.vo.PqFrontLogsVO;
|
||||||
|
|
||||||
@@ -24,4 +26,6 @@ public interface PqFrontLogsService extends IService<PqFrontLogs> {
|
|||||||
void addFrontLogs(PqFrontLogsDTO pqFrontLogsDTO);
|
void addFrontLogs(PqFrontLogsDTO pqFrontLogsDTO);
|
||||||
|
|
||||||
Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam);
|
Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam);
|
||||||
|
|
||||||
|
Page<PqFrontLogsChild> queryLogCHild(PqFrontLogsChildParam baseParam);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.system.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.system.mapper.PqDashboardPageMapper;
|
||||||
|
import com.njcn.system.mapper.PqFrontLogsMapper;
|
||||||
|
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogsChild;
|
||||||
|
import com.njcn.system.mapper.PqFrontLogsChildMapper;
|
||||||
|
import com.njcn.system.service.PqFrontLogsChildService;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2025/09/03 下午 1:52【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PqFrontLogsChildServiceImpl extends ServiceImpl<PqFrontLogsChildMapper, PqFrontLogsChild> implements PqFrontLogsChildService{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,22 +5,29 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.dto.LogInfoDTO;
|
import com.njcn.common.pojo.dto.LogInfoDTO;
|
||||||
|
import com.njcn.device.pq.pojo.vo.TerminalAlarmVO;
|
||||||
import com.njcn.system.mapper.PqFrontLogsMapper;
|
import com.njcn.system.mapper.PqFrontLogsMapper;
|
||||||
import com.njcn.system.mapper.UserLogMapper;
|
import com.njcn.system.mapper.UserLogMapper;
|
||||||
import com.njcn.system.pojo.dto.PqFrontLogsDTO;
|
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.param.PqFrontLogsParam;
|
||||||
import com.njcn.system.pojo.po.PqDashboardPage;
|
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||||
import com.njcn.system.pojo.po.PqFrontLogs;
|
import com.njcn.system.pojo.po.PqFrontLogs;
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogsChild;
|
||||||
import com.njcn.system.pojo.po.UserLog;
|
import com.njcn.system.pojo.po.UserLog;
|
||||||
import com.njcn.system.pojo.vo.PqFrontLogsVO;
|
import com.njcn.system.pojo.vo.PqFrontLogsVO;
|
||||||
import com.njcn.system.service.IUserLogService;
|
import com.njcn.system.service.IUserLogService;
|
||||||
|
import com.njcn.system.service.PqFrontLogsChildService;
|
||||||
import com.njcn.system.service.PqFrontLogsService;
|
import com.njcn.system.service.PqFrontLogsService;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.poi.util.StringUtil;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
|
||||||
@@ -37,34 +44,91 @@ import java.util.Objects;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class PqFrontLogsServiceImpl extends ServiceImpl<PqFrontLogsMapper, PqFrontLogs> implements PqFrontLogsService {
|
public class PqFrontLogsServiceImpl extends ServiceImpl<PqFrontLogsMapper, PqFrontLogs> implements PqFrontLogsService {
|
||||||
|
|
||||||
|
private final PqFrontLogsChildService pqFrontLogsChildService;
|
||||||
@Override
|
@Override
|
||||||
public void addFrontLogs(PqFrontLogsDTO pqFrontLogsDTO) {
|
public void addFrontLogs(PqFrontLogsDTO pqFrontLogsDTO) {
|
||||||
|
|
||||||
|
PqFrontLogs one = this.lambdaQuery()
|
||||||
|
.eq(PqFrontLogs::getLevel, pqFrontLogsDTO.getLevel())
|
||||||
|
.eq(PqFrontLogs::getFrontType, pqFrontLogsDTO.getFrontType())
|
||||||
|
.eq(PqFrontLogs::getCode, pqFrontLogsDTO.getCode())
|
||||||
|
.eq(PqFrontLogs::getBusinessId, pqFrontLogsDTO.getBusinessId())
|
||||||
|
.eq(PqFrontLogs::getState,1).one();
|
||||||
|
if(Objects.nonNull(one)){
|
||||||
|
one.setUpdateTime(LocalDateTime.now());
|
||||||
|
this.updateById(one);
|
||||||
|
|
||||||
|
PqFrontLogsChild pqFrontLogsChild = new PqFrontLogsChild();
|
||||||
|
pqFrontLogsChild.setMainId(one.getId());
|
||||||
|
pqFrontLogsChild.setLog(pqFrontLogsDTO.getLog());
|
||||||
|
pqFrontLogsChild.setState(1);
|
||||||
|
|
||||||
|
|
||||||
|
pqFrontLogsChildService.save(pqFrontLogsChild);
|
||||||
|
}else {
|
||||||
PqFrontLogs pqFrontLogs = new PqFrontLogs();
|
PqFrontLogs pqFrontLogs = new PqFrontLogs();
|
||||||
BeanUtils.copyProperties(pqFrontLogsDTO,pqFrontLogs);
|
BeanUtils.copyProperties(pqFrontLogsDTO,pqFrontLogs);
|
||||||
pqFrontLogs.setState(1);
|
pqFrontLogs.setState(1);
|
||||||
this.save(pqFrontLogs);
|
this.save(pqFrontLogs);
|
||||||
|
|
||||||
|
PqFrontLogsChild pqFrontLogsChild = new PqFrontLogsChild();
|
||||||
|
pqFrontLogsChild.setMainId(pqFrontLogs.getId());
|
||||||
|
pqFrontLogsChild.setLog(pqFrontLogsDTO.getLog());
|
||||||
|
pqFrontLogsChild.setGrade(pqFrontLogsDTO.getGrade());
|
||||||
|
pqFrontLogsChild.setState(1);
|
||||||
|
|
||||||
|
|
||||||
|
pqFrontLogsChildService.save(pqFrontLogsChild);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) {
|
public Page<PqFrontLogsVO> queryPage(PqFrontLogsParam baseParam) {
|
||||||
QueryWrapper<PqFrontLogs> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<PqFrontLogs> queryWrapper = new QueryWrapper<>();
|
||||||
if (Objects.nonNull(baseParam.getSearchBeginTime()) && Objects.nonNull(baseParam.getSearchEndTime())) {
|
if (Objects.nonNull(baseParam.getSearchBeginTime()) && Objects.nonNull(baseParam.getSearchEndTime())) {
|
||||||
queryWrapper.between("A.Create_Time", baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59");
|
queryWrapper.between("A.update_Time", baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Objects.nonNull(baseParam.getSearchValue())){
|
if(Objects.nonNull(baseParam.getSearchValue())){
|
||||||
queryWrapper.like("A.log",baseParam.getSearchValue());
|
queryWrapper.like("line.name", baseParam.getSearchValue());
|
||||||
}
|
}
|
||||||
queryWrapper.orderByDesc("A.Create_Time");
|
queryWrapper.eq(StringUtils.isNotBlank(baseParam.getCode()),"A.code",baseParam.getCode());
|
||||||
|
queryWrapper.eq(StringUtils.isNotBlank(baseParam.getFrontType()),"A.front_type",baseParam.getFrontType()) ;
|
||||||
|
|
||||||
|
queryWrapper.orderByDesc("A.update_Time");
|
||||||
Page<PqFrontLogsVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), queryWrapper);
|
Page<PqFrontLogsVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(baseParam), PageFactory.getPageSize(baseParam)), queryWrapper);
|
||||||
page.getRecords().forEach(temp->{
|
page.getRecords().forEach(temp->{
|
||||||
temp.setLevel(Objects.equals(temp.getLevel(),"terminal")?"设备":"监测点");
|
if(Objects.equals(temp.getLevel(),"terminal")){
|
||||||
|
temp.setLevel("设备");
|
||||||
|
}else if(Objects.equals(temp.getLevel(),"measurepoint")){
|
||||||
|
temp.setLevel("监测点");
|
||||||
|
}else if(Objects.equals(temp.getLevel(),"process")){
|
||||||
|
temp.setLevel("进程");
|
||||||
|
}else {
|
||||||
|
temp.setLevel("/");
|
||||||
|
}
|
||||||
|
|
||||||
temp.setFrontType(getFrontType(temp.getFrontType()));
|
temp.setFrontType(getFrontType(temp.getFrontType()));
|
||||||
|
|
||||||
});
|
});
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<PqFrontLogsChild> queryLogCHild(PqFrontLogsChildParam baseParam) {
|
||||||
|
Page<PqFrontLogsChild> page = new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam));
|
||||||
|
|
||||||
|
QueryWrapper<PqFrontLogsChild> queryWrapper = new QueryWrapper<>();
|
||||||
|
queryWrapper.lambda().eq(PqFrontLogsChild::getMainId,baseParam.getMainId())
|
||||||
|
.between(PqFrontLogsChild::getCreateTime,baseParam.getSearchBeginTime()+" 00:00:00", baseParam.getSearchEndTime()+" 23:59:59")
|
||||||
|
.like(PqFrontLogsChild::getLog,baseParam.getSearchValue()).orderByDesc(PqFrontLogsChild::getCreateTime);
|
||||||
|
|
||||||
|
Page<PqFrontLogsChild> page1 = pqFrontLogsChildService.page(page, queryWrapper);
|
||||||
|
return page1;
|
||||||
|
}
|
||||||
|
|
||||||
public String getFrontType(String frontType){
|
public String getFrontType(String frontType){
|
||||||
// //前置类型stat稳态/recall补招/realTime实时/comtrade
|
// //前置类型stat稳态/recall补招/realTime实时/comtrade
|
||||||
switch (frontType) {
|
switch (frontType) {
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.njcn.system.timer.tasks;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DatePattern;
|
||||||
|
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.njcn.dataProcess.api.DataRecallFeignClient;
|
||||||
|
import com.njcn.message.message.RecallMessage;
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogs;
|
||||||
|
import com.njcn.system.pojo.po.PqFrontLogsChild;
|
||||||
|
import com.njcn.system.service.PqFrontLogsChildService;
|
||||||
|
import com.njcn.system.service.PqFrontLogsService;
|
||||||
|
import com.njcn.system.timer.TimerTaskRunner;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类的介绍:装置算法执行链定时任务
|
||||||
|
*
|
||||||
|
* @author xuyang
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2023/12/6 9:35
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class FrontLogsCleanTaskRunner implements TimerTaskRunner {
|
||||||
|
|
||||||
|
private final PqFrontLogsChildService pqFrontLogsChildService;
|
||||||
|
private final PqFrontLogsService pqFrontLogsService;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void action(String date) {
|
||||||
|
//主表清60d的之前的数据,子表清7天之前的数据
|
||||||
|
QueryWrapper<PqFrontLogsChild> queryWrapper = new QueryWrapper<>();
|
||||||
|
QueryWrapper<PqFrontLogs> pqFrontLogsQueryWrapper = new QueryWrapper<>();
|
||||||
|
LocalDate calDate;
|
||||||
|
if(StrUtil.isBlank(date)){
|
||||||
|
calDate = LocalDate.parse(date, DatePattern.NORM_DATE_FORMATTER);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
calDate =LocalDate.now();
|
||||||
|
}
|
||||||
|
|
||||||
|
queryWrapper.lambda().lt(PqFrontLogsChild::getCreateTime,calDate.minusDays(7).atTime(0,0,0));
|
||||||
|
pqFrontLogsChildService.getBaseMapper().delete(queryWrapper);
|
||||||
|
pqFrontLogsQueryWrapper.lambda().lt(PqFrontLogs::getUpdateTime,calDate.minusDays(60).atTime(0,0,0));
|
||||||
|
pqFrontLogsService.getBaseMapper().delete(pqFrontLogsQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user