驾驶舱接口开发
This commit is contained in:
@@ -34,7 +34,7 @@ import java.util.stream.Stream;
|
||||
@Slf4j
|
||||
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields","definition"};
|
||||
private final static String[] WHITE_PARAMETER_NAME = {"password", "mxContent", "docContent", "bgImage","fileContent","flowableXml","bpmnXml","fields","definition","thumbnail"};
|
||||
|
||||
|
||||
public XssRequestWrapper(HttpServletRequest request) {
|
||||
|
||||
@@ -3754,6 +3754,10 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
pqsTerminalPushLogDTO.setDevName(lineMap.get(deviceId).getName());
|
||||
String nodeId = deviceMap.get(deviceId).getNodeId();
|
||||
pqsTerminalPushLogDTO.setNodeId(nodeId);
|
||||
//如果前置删了直接返回
|
||||
if(!nodeMap.containsKey(nodeId)){
|
||||
return;
|
||||
}
|
||||
pqsTerminalPushLogDTO.setNodeName(nodeMap.get(nodeId).getName());
|
||||
pqsTerminalPushLogDTO.setProcessUpdateFlag(false);
|
||||
if(deviceProcesseMap.containsKey(deviceId)){
|
||||
@@ -3776,7 +3780,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
pqsTerminalPushLogDTO.setId(temp.getId());
|
||||
String deviceId = temp.getObjIndex();
|
||||
pqsTerminalPushLogDTO.setDevId(deviceId);
|
||||
pqsTerminalPushLogDTO.setDevName(lineMap.get(deviceId).getName());
|
||||
pqsTerminalPushLogDTO.setDevName(lineMap.containsKey(deviceId)?lineMap.get(deviceId).getName():"删除设备");
|
||||
String nodeId = deviceMap.get(deviceId).getNodeId();
|
||||
pqsTerminalPushLogDTO.setNodeId(nodeId);
|
||||
pqsTerminalPushLogDTO.setNodeName(nodeMap.get(nodeId).getName());
|
||||
@@ -3823,12 +3827,13 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//如果存在说明设备未被删除,不存在说明有一条删除日志,直接return;
|
||||
if(lineMap.containsKey(deviceId)){
|
||||
pqsTerminalPushLogDTO.setDevName(lineMap.get(deviceId).getName());
|
||||
String nodeId = deviceMap.get(deviceId).getNodeId();
|
||||
pqsTerminalPushLogDTO.setNodeId(nodeId);
|
||||
pqsTerminalPushLogDTO.setNodeName(nodeMap.get(nodeId).getName());
|
||||
}else{
|
||||
return;
|
||||
pqsTerminalPushLogDTO.setDevName("删除设备");
|
||||
|
||||
}
|
||||
String nodeId = deviceMap.get(deviceId).getNodeId();
|
||||
pqsTerminalPushLogDTO.setNodeId(nodeId);
|
||||
pqsTerminalPushLogDTO.setNodeName(nodeMap.get(nodeId).getName());
|
||||
|
||||
}
|
||||
|
||||
@@ -3901,7 +3906,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.DELETE_TERMINAL);
|
||||
List<String> finalAddDevIds = addDevIds;
|
||||
//过滤本次新增的设备,因为前置那边还没有新增该装备
|
||||
pqsTerminalPushLogDTOList1 = pqsTerminalPushLogDTOList1.stream().filter(temp-> finalAddDevIds.contains(temp.getDevId())).distinct().collect(Collectors.toList());
|
||||
pqsTerminalPushLogDTOList1 = pqsTerminalPushLogDTOList1.stream().filter(temp-> !finalAddDevIds.contains(temp.getDevId())).distinct().collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(pqsTerminalPushLogDTOList1)){
|
||||
String devNameString = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevName).distinct().collect(Collectors.joining(","));
|
||||
List<String> resultDevIds = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevId).distinct().collect(Collectors.toList());
|
||||
@@ -3923,7 +3928,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
if(collect.containsKey(DeviceRebootType.ADD_TERMINAL)){
|
||||
List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.ADD_TERMINAL);
|
||||
List<String> finalDeleteDevIds = deleteDevIds;
|
||||
pqsTerminalPushLogDTOList1 = pqsTerminalPushLogDTOList1.stream().filter(temp-> finalDeleteDevIds.contains(temp.getDevId())).distinct().collect(Collectors.toList());
|
||||
pqsTerminalPushLogDTOList1 = pqsTerminalPushLogDTOList1.stream().filter(temp-> !finalDeleteDevIds.contains(temp.getDevId())).distinct().collect(Collectors.toList());
|
||||
|
||||
if(!CollectionUtils.isEmpty(pqsTerminalPushLogDTOList1)){
|
||||
String devNameString = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevName).distinct().collect(Collectors.joining(","));
|
||||
@@ -3945,7 +3950,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
List<PqsTerminalPushLogDTO> pqsTerminalPushLogDTOList1 = collect.get(DeviceRebootType.LEDGER_MODIFY);
|
||||
List<String> finalDeleteDevIds1 = deleteDevIds;
|
||||
List<String> finalAddDevIds1 = addDevIds;
|
||||
pqsTerminalPushLogDTOList1 = pqsTerminalPushLogDTOList1.stream().filter(temp-> finalDeleteDevIds1.contains(temp.getDevId())|| finalAddDevIds1.contains(temp.getDevId())).distinct().collect(Collectors.toList());
|
||||
pqsTerminalPushLogDTOList1 = pqsTerminalPushLogDTOList1.stream().filter(temp-> !finalDeleteDevIds1.contains(temp.getDevId())&& !finalAddDevIds1.contains(temp.getDevId())).distinct().collect(Collectors.toList());
|
||||
|
||||
if(!CollectionUtils.isEmpty(pqsTerminalPushLogDTOList1)){
|
||||
String devNameString = pqsTerminalPushLogDTOList1.stream().map(PqsTerminalPushLogDTO::getDevName).distinct().collect(Collectors.joining(","));
|
||||
|
||||
@@ -23,6 +23,7 @@ import org.influxdb.impl.InfluxDBResultMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -136,7 +137,12 @@ public class EventDetailServiceImpl extends ServiceImpl<EventDetailMapper, RmpEv
|
||||
rmpEventDetailPO.setDuration(deatilDTO.getDuration()/1000);
|
||||
rmpEventDetailPO.setFeatureAmplitude(deatilDTO.getAmplitude()/100);
|
||||
rmpEventDetailPO.setPhase(deatilDTO.getPhase());
|
||||
rmpEventDetailPO.setWavePath(deatilDTO.getWavePath());
|
||||
if(StringUtils.isEmpty(deatilDTO.getWavePath())){
|
||||
rmpEventDetailPO.setFileFlag(0);
|
||||
}else {
|
||||
rmpEventDetailPO.setFileFlag(1);
|
||||
}
|
||||
|
||||
rmpEventDetailPO.setEventDescribe(" ");
|
||||
//默认都是其他
|
||||
DictData reason = dicDataFeignClient.getDicDataByCode(DicDataEnum.RESON_REST.getCode()).getData();
|
||||
|
||||
@@ -61,7 +61,9 @@ public enum SystemResponseEnum {
|
||||
LOG_EXCEPTION_TIME("A0302", "导入旧日志文件异常:缺少时间范围"),
|
||||
DELETE_DATA("A0303", "导入旧日志文件异常:删除数据失败"),
|
||||
MULTIPLE_CLICKS_LOG_FILE_WRITER("A0304", "当前文件备份数据未结束,请勿多次点击"),
|
||||
MULTIPLE_CLICKS_RECOVER_LOG_FILE("A0303", "当前文件恢复数据未结束,请勿多次点击")
|
||||
MULTIPLE_CLICKS_RECOVER_LOG_FILE("A0303", "当前文件恢复数据未结束,请勿多次点击"),
|
||||
|
||||
PAGE_SAME_NAME("A00357","页面名称重复"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
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 com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import com.njcn.web.pojo.param.BaseParam;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/05/23 下午 3:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class PqDashboardPageParam {
|
||||
|
||||
|
||||
/**
|
||||
* 页面名称
|
||||
*/
|
||||
@ApiModelProperty("页面名称")
|
||||
private String pageName;
|
||||
|
||||
/**
|
||||
* 页面缩略图URL
|
||||
*/
|
||||
@ApiModelProperty("页面缩略图URL")
|
||||
private String thumbnail;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@ApiModelProperty("备注信息")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 容器集合配置
|
||||
*/
|
||||
@ApiModelProperty("容器集合配置")
|
||||
private String containerConfig;
|
||||
|
||||
/**
|
||||
* 排序序号
|
||||
*/
|
||||
@ApiModelProperty("排序序号")
|
||||
private Integer sort;
|
||||
/**
|
||||
* 0未激活,1激活
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class UpdatePqDashboardPageParam extends PqDashboardPageParam {
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
private String id;
|
||||
}
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class PqDashboardPageQueryParam extends BaseParam {
|
||||
private String pageName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
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/05/23 下午 3:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "pq_dashboard_page")
|
||||
public class PqDashboardPage extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 页面名称
|
||||
*/
|
||||
@TableField(value = "page_name")
|
||||
private String pageName;
|
||||
/**
|
||||
* 页面缩略图URL
|
||||
*/
|
||||
@TableField(value = "thumbnail")
|
||||
private String thumbnail;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 容器集合配置
|
||||
*/
|
||||
@TableField(value = "container_config")
|
||||
private String containerConfig;
|
||||
|
||||
/**
|
||||
* 排序序号
|
||||
*/
|
||||
@TableField(value = "sort")
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 0未激活,1激活
|
||||
*/
|
||||
@TableField(value = "state")
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.njcn.system.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/05/23 下午 3:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class PqDashboardPageVO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 页面名称
|
||||
*/
|
||||
private String pageName;
|
||||
|
||||
/**
|
||||
* 页面缩略图URL
|
||||
*/
|
||||
private String thumbnail;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 容器集合配置
|
||||
*/
|
||||
private String containerConfig;
|
||||
|
||||
/**
|
||||
* 排序序号
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 0未激活,1激活
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 创建用户
|
||||
*/
|
||||
private String createBy;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新用户
|
||||
*/
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime updateTime;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
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.param.PqDashboardPageParam;
|
||||
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||
import com.njcn.system.pojo.vo.PqDashboardPageVO;
|
||||
import com.njcn.system.service.PqDashboardPageService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/05/23 下午 3:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "驾驶舱配置")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/dashboard")
|
||||
public class PqDashboardPageController extends BaseController {
|
||||
|
||||
private final PqDashboardPageService pqDashboardPageService;
|
||||
@PostMapping("/addDashboard")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("新增驾驶舱页面")
|
||||
public HttpResult<Boolean> addDashboard(@RequestBody PqDashboardPageParam pqDashboardPageParam){
|
||||
log.info("新增驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("addDashboard");
|
||||
Boolean result = pqDashboardPageService.addDashboard(pqDashboardPageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/updateDashboard")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("修改驾驶舱页面")
|
||||
public HttpResult<Boolean> updateDashboard(@RequestBody PqDashboardPageParam.UpdatePqDashboardPageParam updatePqDashboardPageParam){
|
||||
log.info("修改驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("updateDashboard");
|
||||
Boolean result = pqDashboardPageService.updateDashboard(updatePqDashboardPageParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/deleteDashboard")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("删除驾驶舱页面")
|
||||
public HttpResult<Boolean> deleteDashboard(@RequestParam("id") String id){
|
||||
log.info("修改驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("deleteDashboard");
|
||||
Boolean result = pqDashboardPageService.removeById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/queryById")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询驾驶舱页面")
|
||||
public HttpResult<PqDashboardPageVO> queryById(@RequestParam("id") String id){
|
||||
log.info("新增驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("queryById");
|
||||
PqDashboardPageVO result = pqDashboardPageService.queryById(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
@PostMapping("/activatePage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("激活的驾驶舱页面")
|
||||
public HttpResult<Boolean> activatePage(@RequestParam("id") String id){
|
||||
log.info("激活的驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("activatePage");
|
||||
Boolean result = pqDashboardPageService.activatePage(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/queryActivatePage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询激活的驾驶舱页面")
|
||||
public HttpResult<PqDashboardPageVO> queryActivatePage(){
|
||||
log.info("新增驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("queryActivatePage");
|
||||
PqDashboardPageVO vo = new PqDashboardPageVO();
|
||||
PqDashboardPage result = pqDashboardPageService.lambdaQuery().eq(PqDashboardPage::getState,1).one();
|
||||
BeanUtils.copyProperties(result,vo);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||
}
|
||||
|
||||
@PostMapping("/queryPage")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("分页查询")
|
||||
public HttpResult<Page<PqDashboardPageVO>> queryPage(@RequestBody PqDashboardPageParam.PqDashboardPageQueryParam pqDashboardPageQueryParam){
|
||||
log.info("新增驾驶舱页面");
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
Page<PqDashboardPageVO> result = pqDashboardPageService.queryPage(pqDashboardPageQueryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class PqFrontLogsController extends BaseController {
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
|
||||
@PostMapping("/query")
|
||||
@ApiOperation("查询审计日志(治理模块)")
|
||||
@ApiOperation("查询前置日志")
|
||||
@ApiImplicitParam(name = "baseParam", value = "查询日志参数", required = true)
|
||||
public HttpResult<Page<PqFrontLogsVO>> queryFrontLogs(@RequestBody PqFrontLogsParam baseParam) {
|
||||
String methodDescribe = getMethodDescribe("queryFrontLogs");
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||
import com.njcn.system.pojo.vo.PqDashboardPageVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2025/05/23 下午 3:22【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqDashboardPageMapper extends BaseMapper<PqDashboardPage> {
|
||||
Page<PqDashboardPageVO> page(@Param("page") Page<Object> objectPage,@Param("ew") QueryWrapper<PqDashboardPage> queryWrapper);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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.PqDashboardPageMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.system.pojo.po.PqDashboardPage">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table pq_dashboard_page-->
|
||||
<id column="Id" jdbcType="CHAR" property="id" />
|
||||
<result column="page_name" jdbcType="VARCHAR" property="pageName" />
|
||||
<result column="thumbnail" jdbcType="VARCHAR" property="thumbnail" />
|
||||
<result column="remark" jdbcType="VARCHAR" property="remark" />
|
||||
<result column="container_config" jdbcType="LONGVARCHAR" property="containerConfig" />
|
||||
<result column="sort" jdbcType="INTEGER" property="sort" />
|
||||
<result column="state" jdbcType="INTEGER" property="state" />
|
||||
<result column="Create_By" jdbcType="CHAR" property="createBy" />
|
||||
<result column="Create_Time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="Update_By" jdbcType="CHAR" property="updateBy" />
|
||||
<result column="Update_Time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
Id, page_name, thumbnail, remark, container_config, sort, `state`, Create_By, Create_Time,
|
||||
Update_By, Update_Time
|
||||
</sql>
|
||||
|
||||
<select id="page" resultType="com.njcn.system.pojo.vo.PqDashboardPageVO">
|
||||
select
|
||||
*
|
||||
from
|
||||
pq_dashboard_page A
|
||||
<where>
|
||||
${ew.sqlSegment}
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.PqDashboardPageParam;
|
||||
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||
import com.njcn.system.pojo.vo.PqDashboardPageVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/05/23 下午 3:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface PqDashboardPageService extends IService<PqDashboardPage> {
|
||||
|
||||
|
||||
Boolean addDashboard(PqDashboardPageParam pqDashboardPageParam);
|
||||
|
||||
Boolean updateDashboard(PqDashboardPageParam.UpdatePqDashboardPageParam updatePqDashboardPageParam);
|
||||
|
||||
PqDashboardPageVO queryById(String id);
|
||||
|
||||
Page<PqDashboardPageVO> queryPage(PqDashboardPageParam.PqDashboardPageQueryParam pqDashboardPageQueryParam);
|
||||
|
||||
Boolean activatePage(String id);
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.pojo.param.NodeParam;
|
||||
import com.njcn.device.pq.pojo.po.Node;
|
||||
import com.njcn.supervision.pojo.po.device.LineWarning;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.TemplateRelMapper;
|
||||
import com.njcn.system.pojo.param.PqDashboardPageParam;
|
||||
import com.njcn.system.pojo.po.TemplateRel;
|
||||
import com.njcn.system.pojo.vo.PqDashboardPageVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import com.njcn.system.mapper.PqDashboardPageMapper;
|
||||
import com.njcn.system.pojo.po.PqDashboardPage;
|
||||
import com.njcn.system.service.PqDashboardPageService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2025/05/23 下午 3:15【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class PqDashboardPageServiceImpl extends ServiceImpl<PqDashboardPageMapper, PqDashboardPage> implements PqDashboardPageService{
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean addDashboard(PqDashboardPageParam pqDashboardPageParam) {
|
||||
PqDashboardPage pqDashboardPage = new PqDashboardPage();
|
||||
checkName(pqDashboardPageParam,false);
|
||||
|
||||
BeanUtils.copyProperties(pqDashboardPageParam,pqDashboardPage);
|
||||
pqDashboardPage.setState(0);
|
||||
this.save(pqDashboardPage);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateDashboard(PqDashboardPageParam.UpdatePqDashboardPageParam updatePqDashboardPageParam) {
|
||||
PqDashboardPage pqDashboardPage = new PqDashboardPage();
|
||||
checkName(updatePqDashboardPageParam,true);
|
||||
BeanUtils.copyProperties(updatePqDashboardPageParam,pqDashboardPage);
|
||||
this.updateById(pqDashboardPage);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PqDashboardPageVO queryById(String id) {
|
||||
PqDashboardPageVO pqDashboardPageVO = new PqDashboardPageVO();
|
||||
PqDashboardPage byId = this.getById(id);
|
||||
BeanUtils.copyProperties(byId,pqDashboardPageVO);
|
||||
return pqDashboardPageVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<PqDashboardPageVO> queryPage(PqDashboardPageParam.PqDashboardPageQueryParam param) {
|
||||
QueryWrapper<PqDashboardPage> queryWrapper = new QueryWrapper<>();
|
||||
if (Objects.nonNull(param.getSearchBeginTime()) && Objects.nonNull(param.getSearchEndTime())) {
|
||||
queryWrapper.between("A.Create_Time", param.getSearchBeginTime(), param.getSearchEndTime());
|
||||
}
|
||||
if(Objects.nonNull(param.getPageName())){
|
||||
queryWrapper.like("A.page_name",param.getPageName());
|
||||
}
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean activatePage(String id) {
|
||||
this.lambdaUpdate().set(PqDashboardPage::getState,1).eq(PqDashboardPage::getId,id).update();
|
||||
this.lambdaUpdate().set(PqDashboardPage::getState,0).ne(PqDashboardPage::getId,id).update();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同编码的字典类型
|
||||
*/
|
||||
private void checkName(PqDashboardPageParam pqDashboardPageParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<PqDashboardPage> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper
|
||||
.eq(PqDashboardPage::getPageName, pqDashboardPageParam.getPageName());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (pqDashboardPageParam instanceof PqDashboardPageParam.UpdatePqDashboardPageParam) {
|
||||
queryWrapper.ne(PqDashboardPage::getId, ((PqDashboardPageParam.UpdatePqDashboardPageParam) pqDashboardPageParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.getBaseMapper().selectCount(queryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(SystemResponseEnum.PAGE_SAME_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user