icd、删除计划时同时删除与之关联的表
This commit is contained in:
@@ -317,7 +317,8 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
||||
.eq(ObjectUtil.isNotNull(param.getCheckResult()), PqDev::getCheckResult, param.getCheckResult())
|
||||
.eq(ObjectUtil.isNotNull(param.getReportState()), PqDev::getReportState, param.getReportState())
|
||||
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
|
||||
.orderByAsc(PqDev::getCreateTime)
|
||||
.orderByDesc(PqDev::getCreateTime)
|
||||
.orderByAsc(PqDev::getName)
|
||||
.list();
|
||||
|
||||
return pqDevList;
|
||||
|
||||
@@ -21,10 +21,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -43,7 +40,7 @@ public class PqIcdPathController extends BaseController{
|
||||
private final IPqIcdPathService pqIcdPathService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/listAll")
|
||||
@GetMapping("/listAll")
|
||||
@ApiOperation("获取所有icd")
|
||||
public HttpResult<List<PqIcdPath>> listAll() {
|
||||
String methodDescribe = getMethodDescribe("listAll");
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.gather.icd.pojo.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
* @data 2025-02-11
|
||||
*/
|
||||
@Getter
|
||||
public enum IcdPathResponseEnum {
|
||||
|
||||
ICD_PATH_NAME_REPEAT("A004007", "icd名称重复");
|
||||
|
||||
private final String code;
|
||||
private final String message;
|
||||
|
||||
IcdPathResponseEnum(String code, String message) {
|
||||
this.message = message;
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author caozehui
|
||||
@@ -32,5 +31,10 @@ public class PqIcdPath extends BaseEntity implements Serializable {
|
||||
* icd存储地址
|
||||
*/
|
||||
private String path;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,42 @@ import java.util.List;
|
||||
*/
|
||||
public interface IPqIcdPathService extends IService<PqIcdPath> {
|
||||
|
||||
/**
|
||||
* 获取所有Icd
|
||||
*
|
||||
* @return 所有Icd
|
||||
*/
|
||||
List<PqIcdPath> listAll();
|
||||
|
||||
/**
|
||||
* 分页获取Icd
|
||||
*
|
||||
* @param param 分页查询参数
|
||||
* @return
|
||||
*/
|
||||
Page<PqIcdPath> listIcd(PqIcdPathParam.QueryParam param);
|
||||
|
||||
/**
|
||||
* 新增Icd
|
||||
*
|
||||
* @param param 新增Icd参数
|
||||
* @return 成功返回true,失败返回false
|
||||
*/
|
||||
boolean addIcd(PqIcdPathParam param);
|
||||
|
||||
/**
|
||||
* 修改Icd
|
||||
*
|
||||
* @param param 修改Icd参数
|
||||
* @return 成功返回true,失败返回false
|
||||
*/
|
||||
boolean updateIcd(PqIcdPathParam.UpdateParam param);
|
||||
|
||||
/**
|
||||
* 批量删除Icd
|
||||
*
|
||||
* @param ids Icd id列表
|
||||
* @return 成功返回true,失败返回false
|
||||
*/
|
||||
boolean deleteIcd(List<String> ids);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,21 @@
|
||||
package com.njcn.gather.icd.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.gather.icd.mapper.PqIcdPathMapper;
|
||||
import com.njcn.gather.icd.pojo.enums.IcdPathResponseEnum;
|
||||
import com.njcn.gather.icd.pojo.param.PqIcdPathParam;
|
||||
import com.njcn.gather.icd.pojo.po.PqIcdPath;
|
||||
import com.njcn.gather.icd.mapper.PqIcdPathMapper;
|
||||
import com.njcn.gather.icd.service.IPqIcdPathService;
|
||||
import com.njcn.gather.type.pojo.po.DevType;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -23,26 +31,53 @@ public class PqIcdPathServiceImpl extends ServiceImpl<PqIcdPathMapper, PqIcdPath
|
||||
|
||||
@Override
|
||||
public List<PqIcdPath> listAll() {
|
||||
return null;
|
||||
return this.lambdaQuery().eq(PqIcdPath::getState, DataStateEnum.ENABLE.getCode()).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<PqIcdPath> listIcd(PqIcdPathParam.QueryParam param) {
|
||||
return null;
|
||||
LambdaQueryWrapper<PqIcdPath> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PqIcdPath::getState, DataStateEnum.ENABLE.getCode())
|
||||
.like(StrUtil.isNotBlank(param.getName()), PqIcdPath::getName, param.getName())
|
||||
.orderByDesc(PqIcdPath::getCreateTime);
|
||||
Page<PqIcdPath> page = this.page(new Page<>(PageFactory.getPageNum(param), PageFactory.getPageSize(param)), wrapper);
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addIcd(PqIcdPathParam param) {
|
||||
return false;
|
||||
this.checkRepeat(param, false);
|
||||
PqIcdPath pqIcdPath = new PqIcdPath();
|
||||
BeanUtils.copyProperties(param, pqIcdPath);
|
||||
pqIcdPath.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(pqIcdPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateIcd(PqIcdPathParam.UpdateParam param) {
|
||||
return false;
|
||||
this.checkRepeat(param, true);
|
||||
PqIcdPath pqIcdPath = new PqIcdPath();
|
||||
BeanUtils.copyProperties(param, pqIcdPath);
|
||||
return this.updateById(pqIcdPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteIcd(List<String> ids) {
|
||||
return false;
|
||||
return this.lambdaUpdate().in(PqIcdPath::getId, ids).set(PqIcdPath::getState, DataStateEnum.DELETED.getCode()).update();
|
||||
}
|
||||
|
||||
private void checkRepeat(PqIcdPathParam param, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<PqIcdPath> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(PqIcdPath::getName, param.getName())
|
||||
.eq(PqIcdPath::getState, DataStateEnum.ENABLE.getCode());
|
||||
if (isExcludeSelf) {
|
||||
if (param instanceof PqIcdPathParam.UpdateParam) {
|
||||
wrapper.ne(PqIcdPath::getId, ((PqIcdPathParam.UpdateParam) param).getId());
|
||||
}
|
||||
}
|
||||
int count = this.count(wrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException(IcdPathResponseEnum.ICD_PATH_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,6 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
// 修改检测计划、检测源关联
|
||||
adPlanSourceService.updateAdPlanSource(param.getId(), param.getSourceIds());
|
||||
|
||||
|
||||
adPlan.setTestState(pqDevService.bind(param.getId(), param.getDevIds()));
|
||||
|
||||
return this.updateById(adPlan);
|
||||
@@ -161,6 +160,10 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
||||
// 删除检测计划、检测源关联
|
||||
adPlanSourceService.deleteAdPlanSourceByPlanIds(ids);
|
||||
|
||||
// 删除相关检测表格
|
||||
List<String> codeList = this.listByIds(ids).stream().map(plan->String.valueOf(plan.getCode())).collect(Collectors.toList());
|
||||
tableGenService.deleteTable(codeList);
|
||||
|
||||
return this.lambdaUpdate().in(AdPlan::getId, ids).set(AdPlan::getState, DataStateEnum.DELETED.getCode()).update();
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -46,7 +43,7 @@ public class DevTypeController extends BaseController {
|
||||
private final IDevTypeService devTypeService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/listAll")
|
||||
@GetMapping("/listAll")
|
||||
@ApiOperation("获取所有设备类型")
|
||||
public HttpResult<List<DevType>> listAll() {
|
||||
String methodDescribe = getMethodDescribe("listAll");
|
||||
|
||||
@@ -10,7 +10,7 @@ import lombok.Getter;
|
||||
@Getter
|
||||
public enum DevTypeResponseEnum {
|
||||
|
||||
DEV_TYPE_REPEAT("A003007", "设备类型名称重复");
|
||||
DEV_TYPE_NAME_REPEAT("A003007", "设备类型名称重复");
|
||||
|
||||
private final String code;
|
||||
private final String message;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.gather.type.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -54,7 +55,7 @@ public class DevTypeServiceImpl extends ServiceImpl<DevTypeMapper, DevType> impl
|
||||
public Page<DevType> listDevType(DevTypeParam.QueryParam queryParam) {
|
||||
LambdaQueryWrapper<DevType> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(DevType::getState, DataStateEnum.ENABLE.getCode())
|
||||
.like(DevType::getName, queryParam.getName())
|
||||
.like(StrUtil.isNotBlank(queryParam.getName()), DevType::getName, queryParam.getName())
|
||||
.orderByDesc(DevType::getCreateTime);
|
||||
Page<DevType> page = this.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), wrapper);
|
||||
return page;
|
||||
@@ -93,7 +94,7 @@ public class DevTypeServiceImpl extends ServiceImpl<DevTypeMapper, DevType> impl
|
||||
}
|
||||
int count = this.count(wrapper);
|
||||
if (count > 0) {
|
||||
throw new BusinessException(DevTypeResponseEnum.DEV_TYPE_REPEAT);
|
||||
throw new BusinessException(DevTypeResponseEnum.DEV_TYPE_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
package com.njcn.gather.storage.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TableGenService {
|
||||
|
||||
|
||||
void genAdNonHarmonicTable(String code);
|
||||
|
||||
void delAdNonHarmonicTable(String code);
|
||||
/**
|
||||
* 批量删除表 (包括谐波表、谐波结果表、非谐波表、非谐波结果表)
|
||||
*
|
||||
* @param codeList
|
||||
*/
|
||||
void deleteTable(List<String> codeList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.njcn.gather.storage.service.TableGenService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TableGenServiceImpl implements TableGenService {
|
||||
@@ -23,19 +25,19 @@ public class TableGenServiceImpl implements TableGenService {
|
||||
StringBuilder A = new StringBuilder();
|
||||
StringBuilder B = new StringBuilder();
|
||||
StringBuilder C = new StringBuilder();
|
||||
for(int i=1;i<=50;i++){
|
||||
if(i == 1){
|
||||
for (int i = 1; i <= 50; i++) {
|
||||
if (i == 1) {
|
||||
A.append("A_Value_").append(i).append(" json NULL COMMENT 'A相基波',");
|
||||
B.append("B_Value_").append(i).append(" json NULL COMMENT 'B相基波',");
|
||||
C.append("C_Value_").append(i).append(" json NULL COMMENT 'C相基波',");
|
||||
}else {
|
||||
} else {
|
||||
A.append("A_Value_").append(i).append(" json NULL COMMENT '").append(i).append("次A相谐波',");
|
||||
B.append("B_Value_").append(i).append(" json NULL COMMENT '").append(i).append("次B相谐波',");
|
||||
C.append("C_Value_").append(i).append(" json NULL COMMENT '").append(i).append("次C相谐波',");
|
||||
}
|
||||
}
|
||||
|
||||
String sql = "CREATE TABLE AD_Harmonic_"+code+" (\n" +
|
||||
String sql = "CREATE TABLE AD_Harmonic_" + code + " (\n" +
|
||||
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
||||
" Time_Id DATETIME NOT NULL COMMENT '时间',\n" +
|
||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
||||
@@ -43,12 +45,12 @@ public class TableGenServiceImpl implements TableGenService {
|
||||
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
||||
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
||||
" Result_Flag int(1) NULL COMMENT '0.不合格 1.合格',\n" +
|
||||
A+B+C+
|
||||
A + B + C +
|
||||
" PRIMARY KEY (Monitor_Id,Time_Id, Script_Id, Sort, AD_Type)\n" +
|
||||
") COMMENT='监测数据表';";
|
||||
tableGenMapper.genAdHarmonicTable(sql);
|
||||
|
||||
String sql2 = "CREATE TABLE AD_Harmonic_Result_"+code+" (\n" +
|
||||
String sql2 = "CREATE TABLE AD_Harmonic_Result_" + code + " (\n" +
|
||||
" Monitor_Id CHAR(60) NOT NULL COMMENT '监测点Id',\n" +
|
||||
" Time_Id DATETIME NULL COMMENT '时间',\n" +
|
||||
" Script_Id CHAR(32) NOT NULL COMMENT '检测脚本子表Id,字典表',\n" +
|
||||
@@ -56,16 +58,23 @@ public class TableGenServiceImpl implements TableGenService {
|
||||
" AD_Type CHAR(32) NOT NULL COMMENT '检测指标,字典表',\n" +
|
||||
" Data_Type CHAR(32) NOT NULL COMMENT '数据指标,只有数据源为分钟统计时候才会使用(最大、最小、平均、CP95,默认平均值),字典表',\n" +
|
||||
" Result_Flag int(1) NOT NULL COMMENT '1不合格 2合格 4无法处理',\n" +
|
||||
A+B+C+
|
||||
A + B + C +
|
||||
" PRIMARY KEY (Monitor_Id, Script_Id, Sort, AD_Type)\n" +
|
||||
") COMMENT='监测数据表';";
|
||||
tableGenMapper.genAdHarmonicTable(sql2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delAdNonHarmonicTable(String code) {
|
||||
String sql = "DROP TABLE ad_harmonic_"+code+",ad_harmonic_result_"+code+",ad_non_harmonic_"+code+",ad_non_harmonic_result_"+code;
|
||||
tableGenMapper.genAdHarmonicTable(sql);
|
||||
public void deleteTable(List<String> codeList) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String code : codeList) {
|
||||
sb.append("ad_harmonic_").append(code)
|
||||
.append(",ad_harmonic_result_").append(code)
|
||||
.append(",ad_non_harmonic_").append(code)
|
||||
.append(",ad_non_harmonic_result_").append(code).append(",");
|
||||
}
|
||||
sb.deleteCharAt(sb.length() - 1);
|
||||
tableGenMapper.genAdHarmonicTable("DROP TABLE " + sb.toString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,117 +16,117 @@ import java.util.List;
|
||||
@RequestMapping("admin")
|
||||
public class MenuController {
|
||||
|
||||
@RequestMapping("/menu/list")
|
||||
public HttpResult<List<MenuVO>> menuList() {
|
||||
|
||||
List<MenuVO> menuVOList = new ArrayList<>();
|
||||
|
||||
MenuVO menuVO = new MenuVO();
|
||||
menuVO.setPath("/home/index");
|
||||
menuVO.setName("home");
|
||||
menuVO.setComponent("/home/index");
|
||||
|
||||
MetaVO metaVO = new MetaVO();
|
||||
metaVO.setIcon("HomeFilled");
|
||||
metaVO.setTitle("检测计划");
|
||||
metaVO.setIsLink("");
|
||||
metaVO.setHide(false);
|
||||
metaVO.setFull(false);
|
||||
metaVO.setAffix(true);
|
||||
metaVO.setKeepAlive(true);
|
||||
|
||||
menuVO.setMeta(metaVO);
|
||||
menuVOList.add(menuVO);
|
||||
|
||||
MenuVO menuVO1 = getMenuVORedirect("/machine","machine","/machine/testScript","Operation","台账管理");
|
||||
MenuVO menuVO11 = getMenuVO("/machine/testScript","testScript","/machine/testScript/index","Document","检测脚本");
|
||||
MenuVO menuVO12 = getMenuVO("/machine/device","device","/machine/device/index","Cpu","被检设备");
|
||||
MenuVO menuVO13 = getMenuVO("/machine/errorSystem","errorSystem","/machine/errorSystem/index","Tickets","误差体系");
|
||||
MenuVO menuVO14 = getMenuVO("/machine/testSource","testSource","/machine/testSource/index","Help","检测源");
|
||||
MenuVO menuVO15 = getMenuVO("/machine/devType","devType","/machine/devType/index","Cpu","设备类型");
|
||||
menuVO1.setChildren(CollectionUtil.toList(menuVO11,menuVO12,menuVO13,menuVO14,menuVO15));
|
||||
menuVOList.add(menuVO1);
|
||||
|
||||
|
||||
|
||||
MenuVO menuVO2 = getMenuVORedirect("/authority","authority","/authority/user","Menu","权限管理");
|
||||
MenuVO menuVO21 = getMenuVO("/authority/user","user","/authority/user/index","UserFilled","用户管理");
|
||||
MenuVO menuVO22 = getMenuVO("/authority/role","role","/authority/role/index","Avatar","角色管理");
|
||||
MenuVO menuVO23 = getMenuVO("/authority/resource","resource","/authority/resource/index","Connection","菜单管理");
|
||||
menuVO2.setChildren(CollectionUtil.toList(menuVO21,menuVO22,menuVO23));
|
||||
menuVOList.add(menuVO2);
|
||||
|
||||
|
||||
MenuVO menuVO3 = getMenuVORedirect("/system","system","/system/base","Tools","系统配置");
|
||||
MenuVO menuVO31 = getMenuVO("/system/base","base","/system/base/index","UserFilled","通用配置");
|
||||
MenuVO menuVO32 = getMenuVO("/system/dict","dict","/system/dictionary/dictType/index","DataAnalysis","数据字典");
|
||||
MenuVO menuVO33 = getMenuVO("/system/dictTree","dictTree","/system/dictionary/dictTree/index","DataAnalysis","树形字典");
|
||||
MenuVO menuVO34 = getMenuVO("/system/dictPq","dictPq","/system/dictionary/dictPq/index","DataAnalysis","电能质量字典");
|
||||
MenuVO menuVO35 = getMenuVO("/system/template","template","/system/template/index","Memo","报告模板");
|
||||
MenuVO menuVO36 = getMenuVO("/system/versionRegister","versionRegister","/system/versionRegister/index","SetUp","版本注册");
|
||||
menuVO3.setChildren(CollectionUtil.toList(menuVO31,menuVO32,menuVO33,menuVO34,menuVO35,menuVO36));
|
||||
menuVOList.add(menuVO3);
|
||||
|
||||
MenuVO menuVO4 = getMenuVO("/log","log","/log/index","TrendCharts","日志管理");
|
||||
menuVOList.add(menuVO4);
|
||||
|
||||
|
||||
MenuVO menuVO5 = getMenuVO("/analyse","analyse","/analyse/index","Monitor","统计分析");
|
||||
menuVOList.add(menuVO5);
|
||||
|
||||
|
||||
MenuVO menuVO6 = getMenuVORedirect("/demo","demo","/system/demo","Tools","示例");
|
||||
MenuVO menuVO61 = getMenuVO("/system/proTable","table","/demo/proTable/index","UserFilled","普通表格");
|
||||
MenuVO menuVO62 = getMenuVO("/system/proTableTree","tableTree","/demo/proTableTree/index","DataAnalysis","表格树");
|
||||
menuVO6.setChildren(CollectionUtil.toList(menuVO61,menuVO62));
|
||||
menuVOList.add(menuVO6);
|
||||
|
||||
|
||||
|
||||
HttpResult<List<MenuVO>> result = new HttpResult<>();
|
||||
result.setData(menuVOList);
|
||||
result.setCode("A0000");
|
||||
result.setMessage("成功");
|
||||
return result;
|
||||
}
|
||||
|
||||
private static MenuVO getMenuVO(String path, String name, String component,String icon,String title) {
|
||||
MenuVO menu = new MenuVO();
|
||||
menu.setPath(path);
|
||||
menu.setName(name);
|
||||
menu.setComponent(component);
|
||||
|
||||
MetaVO meta = new MetaVO();
|
||||
meta.setIcon(icon);
|
||||
meta.setTitle(title);
|
||||
meta.setIsLink("");
|
||||
meta.setHide(false);
|
||||
meta.setFull(false);
|
||||
meta.setAffix(false);
|
||||
meta.setKeepAlive(true);
|
||||
|
||||
menu.setMeta(meta);
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
private static MenuVO getMenuVORedirect(String path, String name, String component,String icon,String title) {
|
||||
MenuVO menu = new MenuVO();
|
||||
menu.setPath(path);
|
||||
menu.setName(name);
|
||||
menu.setRedirect(component);
|
||||
|
||||
MetaVO meta = new MetaVO();
|
||||
meta.setIcon(icon);
|
||||
meta.setTitle(title);
|
||||
meta.setIsLink("");
|
||||
meta.setHide(false);
|
||||
meta.setFull(false);
|
||||
meta.setAffix(false);
|
||||
meta.setKeepAlive(true);
|
||||
|
||||
menu.setMeta(meta);
|
||||
|
||||
return menu;
|
||||
}
|
||||
// @RequestMapping("/menu/list")
|
||||
// public HttpResult<List<MenuVO>> menuList() {
|
||||
//
|
||||
// List<MenuVO> menuVOList = new ArrayList<>();
|
||||
//
|
||||
// MenuVO menuVO = new MenuVO();
|
||||
// menuVO.setPath("/home/index");
|
||||
// menuVO.setName("home");
|
||||
// menuVO.setComponent("/home/index");
|
||||
//
|
||||
// MetaVO metaVO = new MetaVO();
|
||||
// metaVO.setIcon("HomeFilled");
|
||||
// metaVO.setTitle("检测计划");
|
||||
// metaVO.setIsLink("");
|
||||
// metaVO.setHide(false);
|
||||
// metaVO.setFull(false);
|
||||
// metaVO.setAffix(true);
|
||||
// metaVO.setKeepAlive(true);
|
||||
//
|
||||
// menuVO.setMeta(metaVO);
|
||||
// menuVOList.add(menuVO);
|
||||
//
|
||||
// MenuVO menuVO1 = getMenuVORedirect("/machine","machine","/machine/testScript","Operation","台账管理");
|
||||
// MenuVO menuVO11 = getMenuVO("/machine/testScript","testScript","/machine/testScript/index","Document","检测脚本");
|
||||
// MenuVO menuVO12 = getMenuVO("/machine/device","device","/machine/device/index","Cpu","被检设备");
|
||||
// MenuVO menuVO13 = getMenuVO("/machine/errorSystem","errorSystem","/machine/errorSystem/index","Tickets","误差体系");
|
||||
// MenuVO menuVO14 = getMenuVO("/machine/testSource","testSource","/machine/testSource/index","Help","检测源");
|
||||
// MenuVO menuVO15 = getMenuVO("/machine/devType","devType","/machine/devType/index","Cpu","设备类型");
|
||||
// menuVO1.setChildren(CollectionUtil.toList(menuVO11,menuVO12,menuVO13,menuVO14,menuVO15));
|
||||
// menuVOList.add(menuVO1);
|
||||
//
|
||||
//
|
||||
//
|
||||
// MenuVO menuVO2 = getMenuVORedirect("/authority","authority","/authority/user","Menu","权限管理");
|
||||
// MenuVO menuVO21 = getMenuVO("/authority/user","user","/authority/user/index","UserFilled","用户管理");
|
||||
// MenuVO menuVO22 = getMenuVO("/authority/role","role","/authority/role/index","Avatar","角色管理");
|
||||
// MenuVO menuVO23 = getMenuVO("/authority/resource","resource","/authority/resource/index","Connection","菜单管理");
|
||||
// menuVO2.setChildren(CollectionUtil.toList(menuVO21,menuVO22,menuVO23));
|
||||
// menuVOList.add(menuVO2);
|
||||
//
|
||||
//
|
||||
// MenuVO menuVO3 = getMenuVORedirect("/system","system","/system/base","Tools","系统配置");
|
||||
// MenuVO menuVO31 = getMenuVO("/system/base","base","/system/base/index","UserFilled","通用配置");
|
||||
// MenuVO menuVO32 = getMenuVO("/system/dict","dict","/system/dictionary/dictType/index","DataAnalysis","数据字典");
|
||||
// MenuVO menuVO33 = getMenuVO("/system/dictTree","dictTree","/system/dictionary/dictTree/index","DataAnalysis","树形字典");
|
||||
// MenuVO menuVO34 = getMenuVO("/system/dictPq","dictPq","/system/dictionary/dictPq/index","DataAnalysis","电能质量字典");
|
||||
// MenuVO menuVO35 = getMenuVO("/system/template","template","/system/template/index","Memo","报告模板");
|
||||
// MenuVO menuVO36 = getMenuVO("/system/versionRegister","versionRegister","/system/versionRegister/index","SetUp","版本注册");
|
||||
// menuVO3.setChildren(CollectionUtil.toList(menuVO31,menuVO32,menuVO33,menuVO34,menuVO35,menuVO36));
|
||||
// menuVOList.add(menuVO3);
|
||||
//
|
||||
// MenuVO menuVO4 = getMenuVO("/log","log","/log/index","TrendCharts","日志管理");
|
||||
// menuVOList.add(menuVO4);
|
||||
//
|
||||
//
|
||||
// MenuVO menuVO5 = getMenuVO("/analyse","analyse","/analyse/index","Monitor","统计分析");
|
||||
// menuVOList.add(menuVO5);
|
||||
//
|
||||
//
|
||||
// MenuVO menuVO6 = getMenuVORedirect("/demo","demo","/system/demo","Tools","示例");
|
||||
// MenuVO menuVO61 = getMenuVO("/system/proTable","table","/demo/proTable/index","UserFilled","普通表格");
|
||||
// MenuVO menuVO62 = getMenuVO("/system/proTableTree","tableTree","/demo/proTableTree/index","DataAnalysis","表格树");
|
||||
// menuVO6.setChildren(CollectionUtil.toList(menuVO61,menuVO62));
|
||||
// menuVOList.add(menuVO6);
|
||||
//
|
||||
//
|
||||
//
|
||||
// HttpResult<List<MenuVO>> result = new HttpResult<>();
|
||||
// result.setData(menuVOList);
|
||||
// result.setCode("A0000");
|
||||
// result.setMessage("成功");
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// private static MenuVO getMenuVO(String path, String name, String component,String icon,String title) {
|
||||
// MenuVO menu = new MenuVO();
|
||||
// menu.setPath(path);
|
||||
// menu.setName(name);
|
||||
// menu.setComponent(component);
|
||||
//
|
||||
// MetaVO meta = new MetaVO();
|
||||
// meta.setIcon(icon);
|
||||
// meta.setTitle(title);
|
||||
// meta.setIsLink("");
|
||||
// meta.setHide(false);
|
||||
// meta.setFull(false);
|
||||
// meta.setAffix(false);
|
||||
// meta.setKeepAlive(true);
|
||||
//
|
||||
// menu.setMeta(meta);
|
||||
//
|
||||
// return menu;
|
||||
// }
|
||||
//
|
||||
// private static MenuVO getMenuVORedirect(String path, String name, String component,String icon,String title) {
|
||||
// MenuVO menu = new MenuVO();
|
||||
// menu.setPath(path);
|
||||
// menu.setName(name);
|
||||
// menu.setRedirect(component);
|
||||
//
|
||||
// MetaVO meta = new MetaVO();
|
||||
// meta.setIcon(icon);
|
||||
// meta.setTitle(title);
|
||||
// meta.setIsLink("");
|
||||
// meta.setHide(false);
|
||||
// meta.setFull(false);
|
||||
// meta.setAffix(false);
|
||||
// meta.setKeepAlive(true);
|
||||
//
|
||||
// menu.setMeta(meta);
|
||||
//
|
||||
// return menu;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user