初始化
This commit is contained in:
24
pqs-system/pom.xml
Normal file
24
pqs-system/pom.xml
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>pqs-system</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>系统配置服务聚合</name>
|
||||
<modules>
|
||||
<module>system-boot</module>
|
||||
<module>system-api</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
38
pqs-system/system-api/pom.xml
Normal file
38
pqs-system/system-api/pom.xml
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs-system</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>system-api</artifactId>
|
||||
<name>系统配置服务对外接口</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-db</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-microservice</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.system.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.fallback.AreaFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:11
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SYSTEM,path = "/area",fallbackFactory = AreaFeignClientFallbackFactory.class)
|
||||
public interface AreaFeignClient {
|
||||
|
||||
/**
|
||||
* 根据行政区域id查询详情
|
||||
*
|
||||
* @param id 行政区域id
|
||||
* @return 行政区域基本信息
|
||||
*/
|
||||
@GetMapping("/selectIdArea/{id}")
|
||||
HttpResult<Area> selectIdArea(@PathVariable("id") String id);
|
||||
|
||||
/**
|
||||
* 根据行政区域id查询详情
|
||||
*
|
||||
* @param list 行政区域id集合
|
||||
* @return 行政区域基本信息
|
||||
*/
|
||||
@PostMapping("/areaNameByList")
|
||||
HttpResult<List<Area>> areaNameByList(@RequestBody List<String> list);
|
||||
|
||||
/**
|
||||
* 查询所有的行政区域树
|
||||
*/
|
||||
@PostMapping("/areaDeptTree")
|
||||
HttpResult<List<AreaTreeDTO>> areaDeptTree(@RequestParam("id")String id , @RequestParam("type")Integer type);
|
||||
|
||||
/**
|
||||
* 根据区域id获取省份信息
|
||||
*/
|
||||
@PostMapping("/areaPro")
|
||||
HttpResult<Area> areaPro(@RequestParam("id")String id , @RequestParam("type")Integer type);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据行政区域名称查询详细
|
||||
*
|
||||
* @param name 行政区域名称
|
||||
* @return 行政区域详情
|
||||
*/
|
||||
@GetMapping("/selectAreaByName/{name}")
|
||||
HttpResult<Area> selectAreaByName(@PathVariable("name") String name);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.system.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.fallback.ConfigFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:11
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SYSTEM, path = "/config", fallbackFactory = ConfigFeignClientFallbackFactory.class)
|
||||
public interface ConfigFeignClient {
|
||||
|
||||
/**
|
||||
* 获取系统配置
|
||||
*
|
||||
* @return 配置信息
|
||||
*/
|
||||
@GetMapping("/getSysConfig")
|
||||
HttpResult<Config> getSysConfig();
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.njcn.system.api;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.fallback.DicDataFeignClientFallbackFactory;
|
||||
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.awt.image.RenderedImage;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2021/6/24
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SYSTEM, path = "/dictData", fallbackFactory = DicDataFeignClientFallbackFactory.class)
|
||||
public interface DicDataFeignClient {
|
||||
|
||||
@GetMapping("/getDicDataById")
|
||||
HttpResult<DictData> getDicDataById(@RequestParam("dicIndex") String dicIndex);
|
||||
|
||||
@GetMapping("/getDicDataByTypeName")
|
||||
HttpResult<List<DictData>> getDicDataByTypeName(@RequestParam("dictTypeName") String dictTypeName);
|
||||
|
||||
@GetMapping("/getDicDataByName")
|
||||
HttpResult<DictData> getDicDataByName(@RequestParam("dicName") String dicName);
|
||||
|
||||
@GetMapping("/getLoadTypeBySys")
|
||||
HttpResult<List<DictData>> getLoadTypeBySys();
|
||||
|
||||
/**
|
||||
* 后台新增字典数据
|
||||
*
|
||||
* @param dicTypeName 类型名称
|
||||
* @param dicDataName 数据名称
|
||||
* @return 新增后的字典数据
|
||||
*/
|
||||
@GetMapping("/addDicData")
|
||||
HttpResult<DictData> addDicData(@RequestParam("dicTypeName") String dicTypeName, @RequestParam("dicDataName") String dicDataName);
|
||||
|
||||
/**
|
||||
* 根据字典类型名称&数据名称获取字典数据
|
||||
*
|
||||
* @param dicTypeName 字典类型名称
|
||||
* @param dicDataName 字典数据名称
|
||||
* @return 字典数据
|
||||
*/
|
||||
@GetMapping("/getDicDataByNameAndTypeName")
|
||||
HttpResult<DictData> getDicDataByNameAndTypeName(@RequestParam("dicTypeName") String dicTypeName, @RequestParam("dicDataName") String dicDataName);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.system.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.fallback.AreaFeignClientFallbackFactory;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.SYSTEM,path = "/theme",fallbackFactory = AreaFeignClientFallbackFactory.class)
|
||||
public interface ThemeFeignClient {
|
||||
|
||||
/**
|
||||
* 功能描述: 获取当前主题
|
||||
* @return
|
||||
* @author xy
|
||||
* @date 2022/2/14 11:30
|
||||
*/
|
||||
@GetMapping("/getTheme")
|
||||
HttpResult<Theme> getTheme();
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.njcn.system.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.AreaFeignClient;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.utils.SystemEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AreaFeignClientFallbackFactory implements FallbackFactory<AreaFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public AreaFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = SystemEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new AreaFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Area> selectIdArea(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据行政区域id查询详情",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<Area>> areaNameByList(List<String> list) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据行政区域id集合查询名称",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<AreaTreeDTO>> areaDeptTree(String id, Integer type) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询区域详情",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Area> areaPro(String id, Integer type) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据区域id查询省份信息",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Area> selectAreaByName(String name) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据行政区域名称查询详细",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.system.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.ConfigFeignClient;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
import com.njcn.system.utils.SystemEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ConfigFeignClientFallbackFactory implements FallbackFactory<ConfigFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public ConfigFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = SystemEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new ConfigFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Config> getSysConfig() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取系统配置",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.system.api.fallback;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.utils.SystemEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年09月09日 15:19
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DicDataFeignClientFallbackFactory implements FallbackFactory<DicDataFeignClient> {
|
||||
@Override
|
||||
public DicDataFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = SystemEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new DicDataFeignClient() {
|
||||
@Override
|
||||
public HttpResult<DictData> getDicDataById(String dicIndex) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据字典索引获取字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DictData>> getDicDataByTypeName(String dictTypeName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据字典类型名称获取字典数据集合",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<DictData> getDicDataByName(String dicName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据字典名称获取字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<DictData>> getLoadTypeBySys() {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据系统类型获取不同指标参数",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<DictData> addDicData(String dicTypeName, String dicDataName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","后台新增字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<DictData> getDicDataByNameAndTypeName(String typeName, String dicDataName) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据字典类型名称&数据名称获取字典数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.njcn.system.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.api.ThemeFeignClient;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import com.njcn.system.utils.SystemEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ThemeFeignClientFallbackFactory implements FallbackFactory<ThemeFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ThemeFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = SystemEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new ThemeFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Theme> getTheme() {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取当前主题",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/10
|
||||
* A00500~A00520 行政区域枚举
|
||||
*/
|
||||
@Getter
|
||||
public enum AreaEnum {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2021/8/5 21:56
|
||||
*/
|
||||
@Getter
|
||||
public enum DicDataEnum {
|
||||
|
||||
/**
|
||||
* 字典数据名称
|
||||
*/
|
||||
PLPC_ENUM("频率偏差", "PLPC"),
|
||||
DYPC_ENUM("电压偏差", "DYPC"),
|
||||
SXDYBPHD_ENUM("三相电压不平衡度", "SXDYBPHD"),
|
||||
XBDY_ENUM("谐波电压", "XBDY"),
|
||||
CSSB_ENUM("长时闪变", "CSSB"),
|
||||
XBDL_ENUM("谐波电流", "XBDL"),
|
||||
FXDL_ENUM("负序电流", "FXDL"),
|
||||
JXBDY_ENUM("间谐波电压", "JXBDY");
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String code;
|
||||
|
||||
DicDataEnum(String name, String code){
|
||||
this.name=name;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2021/8/5 21:56
|
||||
*/
|
||||
@Getter
|
||||
public enum DicDataTypeEnum {
|
||||
/**
|
||||
* 字典类型名称
|
||||
*/
|
||||
FRONT_TYPE("前置类型"),
|
||||
DEV_TYPE("终端类型"),
|
||||
DEV_FUN("终端功能"),
|
||||
DEV_STATUS("终端状态"),
|
||||
DEV_LEVEL("终端等级"),
|
||||
DEV_CONNECT("接线方式"),
|
||||
DEV_MANUFACTURER("制造厂商"),
|
||||
DEV_VOLTAGE("电压等级"),
|
||||
EVENT_REASON("暂降原因"),
|
||||
EVENT_TYPE("暂降类型"),
|
||||
BUSINESS_TYPE("行业类型"),
|
||||
INTERFERENCE_SOURCE_TYPE("干扰源类型"),
|
||||
ALARM_TYPE("告警类型"),
|
||||
DEV_OPS("运维日志"),
|
||||
INDICATOR_TYPE("指标类型"),
|
||||
COMMUNICATE_TYPE("通讯类型"),
|
||||
RATE_TYPE("费率类型"),
|
||||
ELE_LOAD_TYPE("用能负荷类型"),
|
||||
ELE_STATISTICAL_TYPE("用能统计类型"),
|
||||
LINE_MARK("监测点评分等级")
|
||||
|
||||
;
|
||||
|
||||
|
||||
|
||||
private final String name;
|
||||
|
||||
DicDataTypeEnum(String name){
|
||||
this.name=name;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月20日 09:56
|
||||
*/
|
||||
@Getter
|
||||
public enum SystemResponseEnum {
|
||||
|
||||
/**
|
||||
* 系统模块异常响应码的范围:
|
||||
* A00350 ~ A00449
|
||||
*/
|
||||
SYSTEM_COMMON_ERROR("A00350","系统模块异常"),
|
||||
DICT_TYPE_NAME_REPEAT("A00351", "字典类型名称重复"),
|
||||
DICT_DATA_NAME_REPEAT("A00352", "字典数据名称重复"),
|
||||
AREA_CODE_REPEAT("A00353","行政区域编码重复"),
|
||||
LOAD_TYPE_EMPTY("A00354","用能负荷数据为空"),
|
||||
LINE_MARK_EMPTY("A00355","字典监测点评分等级数据为空")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
SystemResponseEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.system.enums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/12 14:17
|
||||
*/
|
||||
@Getter
|
||||
public enum ThemeEnum {
|
||||
|
||||
/**
|
||||
* 系统主题
|
||||
*/
|
||||
SAME_THEME_NAME("A0102", "主题名称重复"),
|
||||
|
||||
LOGO_FILE_BLANK("A0102", "logo图片为空"),
|
||||
|
||||
FAVICON_FILE_BLANK("A0102", "favicon图片为空")
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
||||
private final String message;
|
||||
|
||||
ThemeEnum(String code, String message) {
|
||||
this.code = code;
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.system.pojo.constant;
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface SystemType {
|
||||
|
||||
/**
|
||||
* 系统类型:0-省级系统;1-企业系统;2-数据中心
|
||||
*/
|
||||
int PROVINCIAL_SYSTEM = 0;
|
||||
int ENTERPRISE_SYSTEM = 1;
|
||||
int DATA_CENTER = 2;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.njcn.system.pojo.constant;
|
||||
|
||||
|
||||
/**
|
||||
* @author 徐扬
|
||||
*/
|
||||
public interface ThemeState {
|
||||
|
||||
/**
|
||||
* 主题状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
int DELETE = 0;
|
||||
int NORMAL = 1;
|
||||
|
||||
/**
|
||||
* 激活状态 0-未激活;1-激活;默认未激活
|
||||
*/
|
||||
int INACTIVATED = 0;
|
||||
int ACTIVATION = 1;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.system.pojo.dto;
|
||||
|
||||
import com.njcn.web.pojo.dto.BaseDTO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/10 10:33
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class AreaTreeDTO extends BaseDTO {
|
||||
@ApiModelProperty("是否被绑定")
|
||||
private Integer isFalse = 0;
|
||||
@ApiModelProperty("子节点")
|
||||
private List<AreaTreeDTO> children;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.system.pojo.enums;
|
||||
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年03月18日 13:27
|
||||
*/
|
||||
@Getter
|
||||
public enum StatisticsEnum {
|
||||
|
||||
/**
|
||||
* 统计类型字典枚举
|
||||
*/
|
||||
POWER_NETWORK("网络拓扑", "Power_Network"),
|
||||
VOLTAGE_LEVEL("电压等级", "Voltage_Level"),
|
||||
LOAD_TYPE("干扰源类型", "Load_Type"),
|
||||
MANUFACTURER("终端厂家", "Manufacturer"),
|
||||
REPORT_TYPE("上报类型", "Report_Type");
|
||||
|
||||
private final String name;
|
||||
|
||||
private final String code;
|
||||
|
||||
StatisticsEnum(String name, String code) {
|
||||
this.name = name;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 没有匹配到,则默认为网络拓扑
|
||||
* @param code 统计类型code
|
||||
* @return 统计枚举实例
|
||||
*/
|
||||
public static StatisticsEnum getStatisticsEnumByCode(String code) {
|
||||
return Arrays.stream(StatisticsEnum.values())
|
||||
.filter(statisticsEnum -> statisticsEnum.getCode().equalsIgnoreCase(code))
|
||||
.findAny()
|
||||
.orElse(POWER_NETWORK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
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.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年1月5日 8:59
|
||||
*/
|
||||
@Data
|
||||
public class AreaParam {
|
||||
|
||||
@ApiModelProperty("父节点")
|
||||
@NotBlank(message = ValidMessage.PID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEMS_ID, message = ValidMessage.PID_FORMAT_ERROR)
|
||||
private String pid;
|
||||
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("简称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String shortName;
|
||||
|
||||
|
||||
@ApiModelProperty("排序(编号)")
|
||||
@NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.CODE_FORMAT_ERROR)
|
||||
private String areaCode;
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty("区域类型 0-省级区域;1-企业区域; ")
|
||||
private Integer type;
|
||||
|
||||
@ApiModelProperty("中心点经度")
|
||||
private BigDecimal lng;
|
||||
|
||||
@ApiModelProperty("中心点纬度")
|
||||
private BigDecimal lat;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class AreaUpdateParam extends AreaParam {
|
||||
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class QueryParam extends BaseParam {
|
||||
/**
|
||||
* 区域类型 0-省级区域;1-企业区域
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月17日 15:49
|
||||
*/
|
||||
@Data
|
||||
public class DictDataParam {
|
||||
|
||||
|
||||
@ApiModelProperty("字典类型id")
|
||||
@NotBlank(message = ValidMessage.DICT_TYPE_ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.DICT_TYPE_ID_FORMAT_ERROR)
|
||||
private String typeId;
|
||||
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
|
||||
@ApiModelProperty("编码")
|
||||
@NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.CODE_FORMAT_ERROR)
|
||||
private String code;
|
||||
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = ValidMessage.SORT_NOT_NULL)
|
||||
@Min(value = 0, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
@Max(value = 999, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
|
||||
@ApiModelProperty("事件等级:0-普通;1-中等;2-严重(默认为0)")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("与高级算法内部Id描述对应")
|
||||
private Integer algoDescribe;
|
||||
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DictDataUpdateParam extends DictDataParam {
|
||||
|
||||
/**
|
||||
* 表Id
|
||||
*/
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DictDataQueryParam extends BaseParam {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型id分页查询字典数据
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DicTypeIdQueryParam extends BaseParam {
|
||||
@ApiModelProperty("字典类型id")
|
||||
@NotBlank(message = ValidMessage.DICT_TYPE_ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.DICT_TYPE_ID_FORMAT_ERROR)
|
||||
private String typeId;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
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.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月17日 09:40
|
||||
*/
|
||||
@Data
|
||||
public class DictTypeParam {
|
||||
|
||||
@ApiModelProperty("名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.DIC_REGEX, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("编码")
|
||||
@NotBlank(message = ValidMessage.CODE_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.ALL_CHAR_1_20, message = ValidMessage.CODE_FORMAT_ERROR)
|
||||
private String code;
|
||||
|
||||
|
||||
@ApiModelProperty("排序")
|
||||
@NotNull(message = ValidMessage.SORT_NOT_NULL)
|
||||
@Min(value = 0, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
@Max(value = 999, message = ValidMessage.SORT_FORMAT_ERROR)
|
||||
private Integer sort;
|
||||
|
||||
|
||||
@ApiModelProperty("开启等级:0-不开启;1-开启,默认不开启")
|
||||
@NotNull(message = ValidMessage.OPEN_LEVEL_NOT_NULL)
|
||||
@Min(value = 0, message = ValidMessage.OPEN_LEVEL_FORMAT_ERROR)
|
||||
@Max(value = 1, message = ValidMessage.OPEN_LEVEL_FORMAT_ERROR)
|
||||
private Integer openLevel;
|
||||
|
||||
|
||||
@ApiModelProperty("开启算法描述:0-不开启;1-开启,默认不开启")
|
||||
@NotNull(message = ValidMessage.OPEN_DESCRIBE_NOT_NULL)
|
||||
@Min(value = 0, message = ValidMessage.OPEN_DESCRIBE_FORMAT_ERROR)
|
||||
@Max(value = 1, message = ValidMessage.OPEN_DESCRIBE_FORMAT_ERROR)
|
||||
private Integer openDescribe;
|
||||
|
||||
|
||||
@ApiModelProperty("描述")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 更新操作实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DictTypeUpdateParam extends DictTypeParam {
|
||||
|
||||
|
||||
@ApiModelProperty("id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询实体
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class DictTypeQueryParam extends BaseParam {
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class MxGraphParam {
|
||||
|
||||
@ApiModelProperty(name = "title",value = "组态标题",required = true)
|
||||
@NotBlank(message = "组态标题不可为空")
|
||||
private String title;
|
||||
|
||||
@ApiModelProperty(name = "mxContent",value = "组态内容",required = true)
|
||||
@NotBlank(message = "内容不可为空")
|
||||
private String mxContent;
|
||||
|
||||
@ApiModelProperty(name = "bgImage",value = "组态背景图")
|
||||
private String bgImage;
|
||||
|
||||
@ApiModelProperty(name = "sort",value = "排序",required = true)
|
||||
@NotNull(message = "排序不可为空")
|
||||
private Integer sort;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.system.pojo.param;
|
||||
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
/**
|
||||
* 类的介绍:
|
||||
*
|
||||
* @author xuyang
|
||||
* @version 1.0.0
|
||||
* @createTime 2022/1/12 13:45
|
||||
*/
|
||||
@Data
|
||||
public class ThemeParam {
|
||||
|
||||
@ApiModelProperty("主题名称")
|
||||
@NotBlank(message = ValidMessage.NAME_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.NORMAL, message = ValidMessage.NAME_FORMAT_ERROR)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("主题描述")
|
||||
@NotBlank(message = ValidMessage.REMARK_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.NORMAL, message = ValidMessage.REMARK_FORMAT_ERROR)
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("主题颜色")
|
||||
@NotBlank(message = ValidMessage.COLOR_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.COLOR_REGEX, message = ValidMessage.COLOR_FORMAT_ERROR)
|
||||
private String color;
|
||||
|
||||
@ApiModelProperty("logo图片")
|
||||
@NotNull(message = ValidMessage.LOGO_NOT_BLANK)
|
||||
private MultipartFile logoFile;
|
||||
|
||||
@ApiModelProperty("favicon图标")
|
||||
@NotNull(message = ValidMessage.FAVICON_NOT_BLANK)
|
||||
private MultipartFile faviconFile;
|
||||
|
||||
/**
|
||||
* 用户更新操作实体
|
||||
*
|
||||
* 需要填写的参数:用户的id
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class ThemeUpdateParam extends ThemeParam {
|
||||
|
||||
@ApiModelProperty("主题表Id")
|
||||
@NotBlank(message = ValidMessage.ID_NOT_BLANK)
|
||||
@Pattern(regexp = PatternRegex.SYSTEM_ID, message = ValidMessage.ID_FORMAT_ERROR)
|
||||
private String id;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_area")
|
||||
public class Area extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 区域Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 父节点(0为根节点)
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
* 上层所有节点
|
||||
*/
|
||||
private String pids;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 简称
|
||||
*/
|
||||
private String shortName;
|
||||
|
||||
/**
|
||||
* 排序(编号)
|
||||
*/
|
||||
private String areaCode;
|
||||
|
||||
/**
|
||||
* 区域类型 0-省级区域;1-企业区域;
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 中心点经度
|
||||
*/
|
||||
private BigDecimal lng;
|
||||
|
||||
/**
|
||||
* 中心点纬度
|
||||
*/
|
||||
private BigDecimal lat;
|
||||
|
||||
/**
|
||||
* 区域状态 0-删除;1-正常;默认正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_config")
|
||||
public class Config extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 配置Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 系统类型:0-省级系统;1-企业系统;2-数据中心
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 数据上报(以逗号分割,比如:冀北,网公司)默认为空
|
||||
*/
|
||||
private String dataReport;
|
||||
|
||||
/**
|
||||
* 审计日志大小(MB)
|
||||
*/
|
||||
private BigDecimal logSize;
|
||||
|
||||
/**
|
||||
* 审计日志存储时间(1-6个月,默认3个月)
|
||||
*/
|
||||
private Boolean logTime;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dict_data")
|
||||
public class DictData extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 字典数据表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 字典类型表Id
|
||||
*/
|
||||
private String typeId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 事件等级:0-普通;1-中等;2-严重(默认为0)
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 与高级算法内部Id描述对应;
|
||||
*/
|
||||
private Integer algoDescribe;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_dict_type")
|
||||
public class DictType extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 字典类型表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 开启等级:0-不开启;1-开启,默认不开启
|
||||
*/
|
||||
private Integer openLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 开启描述:0-不开启;1-开启,默认不开启
|
||||
*/
|
||||
private Integer openDescribe;
|
||||
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 组态表
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_mxgraph")
|
||||
public class MxGraph extends BaseEntity {
|
||||
private String id;
|
||||
|
||||
private String title;
|
||||
|
||||
private String mxContent;
|
||||
|
||||
private String bgImage;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
private Integer state;
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_resource")
|
||||
public class Resource extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 资源Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 资源类型(关联字典表)
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 路径
|
||||
*/
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_task")
|
||||
public class Task extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 任务Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 触发器策略(触发器执行时间)
|
||||
*/
|
||||
private String strategy;
|
||||
|
||||
/**
|
||||
* 任务是否执行(0-停止,1-执行)
|
||||
*/
|
||||
private Boolean execute;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.system.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_theme")
|
||||
public class Theme extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主题Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 主题名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* logo名称
|
||||
*/
|
||||
private String logoUrl;
|
||||
|
||||
/**
|
||||
* favicon名称
|
||||
*/
|
||||
private String faviconUrl;
|
||||
|
||||
/**
|
||||
* 主题颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 0-未激活 1-激活,所有数据只有一条数据处于激活状态
|
||||
*/
|
||||
private Integer active;
|
||||
|
||||
/**
|
||||
* 主题描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.njcn.system.pojo.vo;
|
||||
|
||||
import com.njcn.web.pojo.vo.AreaIdVO;
|
||||
import com.njcn.web.pojo.vo.BaseVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @date 2022/1/6 10:03
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class AreaTreeVO extends BaseVO {
|
||||
|
||||
@ApiModelProperty("上层所有节点")
|
||||
private String pids;
|
||||
|
||||
@ApiModelProperty("区域名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("简称")
|
||||
private String shortName;
|
||||
|
||||
@ApiModelProperty("排序(编号)")
|
||||
private String areaCode;
|
||||
|
||||
|
||||
@ApiModelProperty("中心点经度")
|
||||
private BigDecimal lng;
|
||||
|
||||
@ApiModelProperty("中心点纬度")
|
||||
private BigDecimal lat;
|
||||
|
||||
|
||||
@ApiModelProperty("子节点详细信息")
|
||||
private List<AreaTreeVO> children ;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.njcn.system.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年03月24日 16:06
|
||||
*/
|
||||
@Data
|
||||
public class DictDataCache implements Serializable {
|
||||
|
||||
private String id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String code;
|
||||
|
||||
private int sort;
|
||||
|
||||
private String typeId;
|
||||
|
||||
private String typeName;
|
||||
|
||||
private String typeCode;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.njcn.system.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月20日 15:52
|
||||
*/
|
||||
@Data
|
||||
public class DictDataVO implements Serializable {
|
||||
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 字典数据表Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 字典类型表名称
|
||||
*/
|
||||
private String typeName;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 事件等级:0-普通;1-中等;2-严重(默认为0)
|
||||
*/
|
||||
private Integer level;
|
||||
|
||||
/**
|
||||
* 与高级算法内部Id描述对应;
|
||||
*/
|
||||
private Integer algoDescribe;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.njcn.system.utils;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月20日 10:03
|
||||
*/
|
||||
public class SystemEnumUtil {
|
||||
|
||||
|
||||
/**
|
||||
* 获取UserResponseEnum实例
|
||||
*/
|
||||
public static SystemResponseEnum getSystemEnumResponseEnumByMessage(@NotNull Object value) {
|
||||
SystemResponseEnum systemResponseEnum;
|
||||
try {
|
||||
String message = value.toString();
|
||||
if(message.indexOf(StrUtil.C_COMMA)>0){
|
||||
value = message.substring(message.indexOf(StrUtil.C_COMMA)+1);
|
||||
}
|
||||
systemResponseEnum = EnumUtils.valueOf(SystemResponseEnum.class, value, SystemResponseEnum.class.getMethod(BusinessException.GET_MESSAGE_METHOD));
|
||||
return Objects.isNull(systemResponseEnum) ? SystemResponseEnum.SYSTEM_COMMON_ERROR : systemResponseEnum;
|
||||
} catch (NoSuchMethodException e) {
|
||||
throw new BusinessException(CommonResponseEnum.INTERNAL_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
public static Enum<?> getExceptionEnum(HttpResult<Object> result){
|
||||
//如果返回错误,且为内部错误,则直接抛出异常
|
||||
CommonResponseEnum commonResponseEnum = EnumUtils.getCommonResponseEnumByCode(result.getCode());
|
||||
if (commonResponseEnum == CommonResponseEnum.SYSTEM_RESPONSE_ENUM) {
|
||||
return getSystemEnumResponseEnumByMessage(result.getMessage());
|
||||
}
|
||||
return commonResponseEnum;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
5
pqs-system/system-boot/Dockerfile
Normal file
5
pqs-system/system-boot/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
||||
FROM openjdk:8-jdk-alpine
|
||||
ADD target/systemboot.jar systemboot.jar
|
||||
ENTRYPOINT ["java","-jar","/systemboot.jar"]
|
||||
EXPOSE 10207
|
||||
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \&& echo 'Asia/Shanghai' >/etc/timezone
|
||||
93
pqs-system/system-boot/pom.xml
Normal file
93
pqs-system/system-boot/pom.xml
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>pqs-system</artifactId>
|
||||
<groupId>com.njcn</groupId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>system-boot</artifactId>
|
||||
<name>系统配置服务模块</name>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>system-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>user-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-web</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>common-swagger</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>systemboot</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>com.spotify</groupId>
|
||||
<artifactId>docker-maven-plugin</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>build-image</id>
|
||||
<phase>${docker.operate}</phase>
|
||||
<goals>
|
||||
<goal>build</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!--<serverId>36dockerHarbor</serverId>-->
|
||||
<registryUrl>http://${docker.repostory}</registryUrl>
|
||||
<!-- 镜像名称 -->
|
||||
<imageName>${docker.repostory}/${docker.registry.name}/${project.artifactId}</imageName>
|
||||
<imageTags>
|
||||
<imageTag>latest</imageTag>
|
||||
</imageTags>
|
||||
<dockerHost>${docker.url}</dockerHost>
|
||||
<dockerDirectory>${basedir}/</dockerDirectory>
|
||||
<resources>
|
||||
<resource>
|
||||
<targetPath>/ROOT</targetPath>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<include>${project.build.finalName}.jar</include>
|
||||
</resource>
|
||||
</resources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.system;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @createTime 2021年05月14日 15:14
|
||||
*/
|
||||
@Slf4j
|
||||
@MapperScan("com.njcn.**.mapper")
|
||||
@EnableFeignClients(basePackages = "com.njcn")
|
||||
@SpringBootApplication(scanBasePackages = "com.njcn")
|
||||
public class SystemBootMain {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(SystemBootMain.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,261 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.param.AreaParam;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.AreaTreeVO;
|
||||
import com.njcn.system.service.IAreaService;
|
||||
import io.swagger.annotations.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器(行政区域)
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/area")
|
||||
@Api(tags = "行政区域管理")
|
||||
@AllArgsConstructor
|
||||
public class AreaController extends BaseController {
|
||||
|
||||
private final IAreaService areaService;
|
||||
|
||||
/**
|
||||
* 分页查询行政区域
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询企业区域")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<Area>> list(@RequestBody @Validated AreaParam.QueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<Area> result = areaService.listDictData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据行政区域id详情
|
||||
*
|
||||
* @param id 行政区域id
|
||||
* @return 行政区域详情
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/selectIdArea/{id}")
|
||||
@ApiOperation("根据行政区域id查询详情")
|
||||
@ApiImplicitParam(name = "id", value = "查询参数", required = true)
|
||||
public HttpResult<Area> selectIdArea(@PathVariable("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("selectIdArea");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
||||
Area result = areaService.selectIdArea(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据行政区域id详情
|
||||
*
|
||||
* @param list 行政区域id集合
|
||||
* @return 行政区域详情
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/areaNameByList")
|
||||
@ApiOperation("根据行政区域id集合查询名称")
|
||||
@ApiImplicitParam(name = "list", value = "查询参数", required = true)
|
||||
public HttpResult<List<Area>> areaNameByList(@RequestBody List<String> list) {
|
||||
String methodDescribe = getMethodDescribe("areaNameByList");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, list);
|
||||
List<Area> result = areaService.selectAreaByList(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取行政区域树(所有行政区域)
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/areaTree")
|
||||
@ApiOperation("行政区域树")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = false),
|
||||
@ApiImplicitParam(name = "type", value = "区域类型", required = true)
|
||||
})
|
||||
public HttpResult<Object> areaTree(@RequestParam(required = false) @ApiParam("id") String id, @RequestParam("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("areaTree");
|
||||
List<AreaTreeVO> result = areaService.areaTree(id, type);
|
||||
if (!result.isEmpty()) {
|
||||
try {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} catch (Exception e) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增企业区域
|
||||
*
|
||||
* @param areaParam 企业区域
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增企业区域")
|
||||
@ApiImplicitParam(name = "areaParam", value = "企业区域数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated AreaParam areaParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},字典类型数据为:{}", methodDescribe, areaParam);
|
||||
boolean result = areaService.addAreaParam(areaParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改企业区域
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改企业区域")
|
||||
@ApiImplicitParam(name = "updateParam", value = "企业区域", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated AreaParam.AreaUpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = areaService.updateArea(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据选中的行政区域id查询是否含有子节点
|
||||
*
|
||||
* @param ids 行政区域ids
|
||||
* @return 行政区域查看所有子节点
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/selectPid")
|
||||
@ApiOperation("根据行政区域id查询")
|
||||
@ApiImplicitParam(name = "ids", value = "查询参数", required = true)
|
||||
public HttpResult<Object> selectPid(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("selectPid");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, ids);
|
||||
List<Area> result = areaService.selectPid(ids);
|
||||
if (result.size() > 0) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_EXIST, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.DELETE_PID_UNEXIST, null, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除企业区域
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除企业区域")
|
||||
@ApiImplicitParam(name = "ids", value = "企业区域索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},企业区域数据为:{}", methodDescribe, ids);
|
||||
boolean result = areaService.deleteArea(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取行政区域树(所有行政区域)
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/areaDeptTree")
|
||||
@ApiOperation("获取新增部门区域树")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = false),
|
||||
@ApiImplicitParam(name = "type", value = "区域类型", required = true)
|
||||
})
|
||||
public HttpResult<List<AreaTreeDTO>> areaDeptTree(@RequestParam(required = false) @ApiParam("id") String id, @RequestParam("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("areaDeptTree");
|
||||
List<AreaTreeDTO> result = areaService.areaDeptTree(id, type);
|
||||
if (!result.isEmpty()) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据区域id获取省份
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/areaPro")
|
||||
@ApiOperation("根据区域id获取省份")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "id", value = "区域id", required = false),
|
||||
@ApiImplicitParam(name = "type", value = "区域类型", required = true)
|
||||
})
|
||||
public HttpResult<Area> areaPro(@RequestParam(required = false) @ApiParam("id") String id, @RequestParam("type") Integer type) {
|
||||
String methodDescribe = getMethodDescribe("areaDeptTree");
|
||||
Area result = areaService.areaPro(id, type);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所在的区域树
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getDeptIdAreaTree")
|
||||
@ApiOperation("根据登录用户获取所在的区域树")
|
||||
public HttpResult<List<AreaTreeVO>> getDeptIdAreaTree() {
|
||||
String methodDescribe = getMethodDescribe("getDeptIdAreaTree");
|
||||
List<AreaTreeVO> result = areaService.getDeptIdAreaTree();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据行政区域名称查询详细
|
||||
*
|
||||
* @param name 行政区域名称
|
||||
* @return 行政区域详情
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/selectAreaByName/{name}")
|
||||
@ApiOperation("根据行政区域名称查询详细")
|
||||
@ApiImplicitParam(name = "name", value = "查询参数", required = true)
|
||||
public HttpResult<Area> selectAreaByName(@PathVariable("name") String name) {
|
||||
String methodDescribe = getMethodDescribe("selectAreaByName");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, name);
|
||||
Area result = areaService.selectAreaByName(name);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
import com.njcn.system.service.IConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "系统配置操作")
|
||||
@RestController
|
||||
@RequestMapping("/config")
|
||||
@RequiredArgsConstructor
|
||||
public class ConfigController extends BaseController {
|
||||
|
||||
private final IConfigService iConfigService;
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getSysConfig")
|
||||
@ApiOperation("获取系统配置")
|
||||
public HttpResult<Config> getSysConfig() {
|
||||
String methodDescribe = getMethodDescribe("getSysConfig");
|
||||
LogUtil.njcnDebug(log, "{}", methodDescribe, methodDescribe);
|
||||
Config config = iConfigService.lambdaQuery()
|
||||
.eq(Config::getState, DataStateEnum.ENABLE.getCode())
|
||||
.one();
|
||||
if (Objects.isNull(config)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, config, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import com.njcn.system.service.IDictDataService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
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.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@Api(tags = "字典数据操作")
|
||||
@RestController
|
||||
@RequestMapping("/dictData")
|
||||
@RequiredArgsConstructor
|
||||
public class DictDataController extends BaseController {
|
||||
|
||||
private final IDictDataService dictDataService;
|
||||
|
||||
/**
|
||||
* 分页查询字典类型数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询字典数据")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<DictDataVO>> list(@RequestBody @Validated DictDataParam.DictDataQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<DictDataVO> result = dictDataService.listDictData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增字典数据
|
||||
*
|
||||
* @param dictDataParam 字典数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增字典数据")
|
||||
@ApiImplicitParam(name = "dictDataParam", value = "字典数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated DictDataParam dictDataParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, dictDataParam);
|
||||
boolean result = dictDataService.addDictData(dictDataParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改字典数据")
|
||||
@ApiImplicitParam(name = "updateParam", value = "字典数据", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated DictDataParam.DictDataUpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},字典数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = dictDataService.updateDictData(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除字典数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除字典数据")
|
||||
@ApiImplicitParam(name = "ids", value = "字典索引", required = true, dataTypeClass = List.class)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},字典ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||
boolean result = dictDataService.deleteDictData(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型id分页查询字典数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/getTypeIdData")
|
||||
@ApiOperation("根据字典类型id查询字典数据")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<DictDataVO>> getTypeIdData(@RequestBody @Validated DictDataParam.DicTypeIdQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<DictDataVO> result = dictDataService.getTypeIdData(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getDicDataById")
|
||||
@ApiOperation("根据字典id查询字典数据")
|
||||
@ApiImplicitParam(name = "dicIndex", value = "查询参数", required = true)
|
||||
public HttpResult<DictData> getDicDataById(@RequestParam("dicIndex") String dicIndex) {
|
||||
String methodDescribe = getMethodDescribe("getDicDataById");
|
||||
DictData result = dictDataService.getDicDataById(dicIndex);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getDicDataByTypeName")
|
||||
@ApiOperation("根据字典类型名称查询字典数据")
|
||||
@ApiImplicitParam(name = "dictTypeName", value = "查询参数", required = true)
|
||||
public HttpResult<List<DictData>> getDicDataByTypeName(@RequestParam("dictTypeName") String dictTypeName) {
|
||||
String methodDescribe = getMethodDescribe("getDicDataByTypeName");
|
||||
List<DictData> result = dictDataService.getDicDataByTypeName(dictTypeName);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getDicDataByName")
|
||||
@ApiOperation("根据字典名称查询字典数据")
|
||||
@ApiImplicitParam(name = "dicName", value = "查询参数", required = true)
|
||||
public HttpResult<DictData> getDicDataByName(@RequestParam("dicName") String dicName) {
|
||||
String methodDescribe = getMethodDescribe("getDicDataByName");
|
||||
DictData result = dictDataService.getDicDataByName(dicName);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据系统类型获取不同指标参数
|
||||
*/
|
||||
@OperateInfo
|
||||
@GetMapping("/getLoadTypeBySys")
|
||||
@ApiOperation("根据系统类型获取不同指标参数")
|
||||
@ApiIgnore
|
||||
public HttpResult<List<DictData>> getLoadTypeBySys() {
|
||||
String methodDescribe = getMethodDescribe("getLoadTypeBySys");
|
||||
List<DictData> list = dictDataService.getLoadTypeBySys();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 后台新增字典数据
|
||||
*
|
||||
* @param dicTypeName 类型名称
|
||||
* @param dicDataName 数据名称
|
||||
* @return 新增后的字典数据
|
||||
*/
|
||||
@ApiIgnore
|
||||
@OperateInfo
|
||||
@GetMapping("/addDicData")
|
||||
@ApiOperation("后台新增字典数据")
|
||||
public HttpResult<DictData> addDicData(String dicTypeName, String dicDataName) {
|
||||
String methodDescribe = getMethodDescribe("addDicData");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dictDataService.addDictData(dicTypeName,dicDataName), methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型名称&数据名称获取字典数据
|
||||
*
|
||||
* @param dicTypeName 字典类型名称
|
||||
* @param dicDataName 字典数据名称
|
||||
* @return 字典数据
|
||||
*/
|
||||
@ApiIgnore
|
||||
@OperateInfo
|
||||
@GetMapping("/getDicDataByNameAndTypeName")
|
||||
@ApiOperation("根据字典类型名称&数据名称获取字典数据")
|
||||
public HttpResult<DictData> getDicDataByNameAndTypeName(String dicTypeName, String dicDataName) {
|
||||
String methodDescribe = getMethodDescribe("getDicDataByNameAndTypeName");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dictDataService.getDicDataByNameAndTypeName(dicTypeName,dicDataName), methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.dto.SimpleTreeDTO;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.DictTypeParam;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.service.IDictTypeService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
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.*;
|
||||
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags = "字典类型表操作")
|
||||
@RestController
|
||||
@RequestMapping("/dictType")
|
||||
@RequiredArgsConstructor
|
||||
public class DictTypeController extends BaseController {
|
||||
|
||||
private final IDictTypeService dictTypeService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询字典类型数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@PostMapping("/list")
|
||||
@ApiOperation("查询字典类型")
|
||||
@ApiImplicitParam(name = "queryParam", value = "查询参数", required = true)
|
||||
public HttpResult<Page<DictType>> list(@RequestBody @Validated DictTypeParam.DictTypeQueryParam queryParam) {
|
||||
String methodDescribe = getMethodDescribe("list");
|
||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, queryParam);
|
||||
Page<DictType> result = dictTypeService.listDictTypes(queryParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增字典类型
|
||||
*
|
||||
* @param dictTypeParam 字典类型数据
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.ADD)
|
||||
@PostMapping("/add")
|
||||
@ApiOperation("新增字典类型")
|
||||
@ApiImplicitParam(name = "dictTypeParam", value = "字典类型数据", required = true)
|
||||
public HttpResult<Object> add(@RequestBody @Validated DictTypeParam dictTypeParam) {
|
||||
String methodDescribe = getMethodDescribe("add");
|
||||
LogUtil.njcnDebug(log, "{},字典类型数据为:{}", methodDescribe, dictTypeParam);
|
||||
boolean result = dictTypeService.addDictType(dictTypeParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("修改字典类型")
|
||||
@ApiImplicitParam(name = "updateParam", value = "字典类型数据", required = true)
|
||||
public HttpResult<Object> update(@RequestBody @Validated DictTypeParam.DictTypeUpdateParam updateParam) {
|
||||
String methodDescribe = getMethodDescribe("update");
|
||||
LogUtil.njcnDebug(log, "{},字典类型数据为:{}", methodDescribe, updateParam);
|
||||
boolean result = dictTypeService.updateDictType(updateParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除字典类型
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.DELETE)
|
||||
@PostMapping("/delete")
|
||||
@ApiOperation("删除字典类型")
|
||||
@ApiImplicitParam(name = "ids", value = "字典索引", required = true)
|
||||
public HttpResult<Object> delete(@RequestBody List<String> ids) {
|
||||
String methodDescribe = getMethodDescribe("delete");
|
||||
LogUtil.njcnDebug(log, "{},字典ID数据为:{}", methodDescribe, String.join(StrUtil.COMMA, ids));
|
||||
boolean result = dictTypeService.deleteDictType(ids);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有字典数据基础信息
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/dictDataCache")
|
||||
@ApiOperation("获取所有字典数据基础信息")
|
||||
public HttpResult<List<SimpleTreeDTO>> dictDataCache() {
|
||||
String methodDescribe = getMethodDescribe("dictDataCache");
|
||||
LogUtil.njcnDebug(log, "{},获取所有字典数据基础信息", methodDescribe);
|
||||
List<SimpleTreeDTO> dictData = dictTypeService.dictDataCache();
|
||||
if (CollectionUtil.isNotEmpty(dictData)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, dictData, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.MxGraphParam;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
import com.njcn.system.service.IMxGraphService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 组态管理
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@Api(tags = "组态管理")
|
||||
@RequestMapping("/king")
|
||||
@AllArgsConstructor
|
||||
public class MxGraphController extends BaseController {
|
||||
|
||||
private final IMxGraphService iMxGraphService;
|
||||
|
||||
/**
|
||||
* 新增组态
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_MEDIUM)
|
||||
@PostMapping("/addKingView")
|
||||
@ApiOperation("新增组态")
|
||||
@ApiImplicitParam(name = "mxGraphParam", value = "组件实体", required = true)
|
||||
HttpResult addKingView(@RequestBody @Validated MxGraphParam mxGraphParam){
|
||||
String methodDescribe = getMethodDescribe("addKingView");
|
||||
boolean result = iMxGraphService.addKingView(mxGraphParam);
|
||||
LogUtil.njcnDebug(log, "{},组态实体:{}", methodDescribe, mxGraphParam);
|
||||
if (result) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, null, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_MEDIUM)
|
||||
@GetMapping("/getKingViewList")
|
||||
@ApiOperation("查询组态")
|
||||
HttpResult<Object> getKingViewList(){
|
||||
String methodDescribe = getMethodDescribe("getKingViewList");
|
||||
List<MxGraph> result = iMxGraphService.getKingViewList();
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.SYSTEM_MEDIUM)
|
||||
@GetMapping("/getKingViewById")
|
||||
@ApiOperation("查询组态")
|
||||
HttpResult<Object> getKingViewById(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("getKingViewById");
|
||||
MxGraph result = iMxGraphService.getKingViewById(id);
|
||||
if (Objects.nonNull(result)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, result, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/resource")
|
||||
public class ResourceController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
public class TaskController extends BaseController {
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.njcn.system.controller;
|
||||
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
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.common.utils.LogUtil;
|
||||
import com.njcn.system.pojo.param.ThemeParam;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import com.njcn.system.service.IThemeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/theme")
|
||||
@Api(tags = "主题管理")
|
||||
@AllArgsConstructor
|
||||
public class ThemeController extends BaseController {
|
||||
|
||||
private final IThemeService themeService;
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getAllThemes")
|
||||
@ApiOperation("主题列表")
|
||||
public HttpResult<List<Theme>> getAllThemes(){
|
||||
String methodDescribe = getMethodDescribe("getAllThemes");
|
||||
List<Theme> list = themeService.getAllThemes();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON)
|
||||
@GetMapping("/getTheme")
|
||||
@ApiOperation("当前主题")
|
||||
public HttpResult<Theme> getTheme(){
|
||||
String methodDescribe = getMethodDescribe("getTheme");
|
||||
Theme theme = themeService.getTheme();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,theme,methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/addTheme")
|
||||
@ApiOperation("新增主题")
|
||||
public HttpResult<Boolean> addTheme(@Validated ThemeParam theme) {
|
||||
String methodDescribe = getMethodDescribe("addTheme");
|
||||
boolean result = themeService.addTheme(theme);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@PutMapping("/updateTheme")
|
||||
@ApiOperation("修改主题")
|
||||
public HttpResult<Boolean> updateTheme(@Validated ThemeParam.ThemeUpdateParam theme) {
|
||||
String methodDescribe = getMethodDescribe("updateTheme");
|
||||
boolean result = themeService.updateTheme(theme);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.DELETE)
|
||||
@DeleteMapping("/deleteTheme")
|
||||
@ApiOperation("删除主题")
|
||||
@ApiImplicitParam(name = "id", value = "主题id", required = true)
|
||||
public HttpResult<Boolean> deleteTheme(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("deleteTheme");
|
||||
LogUtil.njcnDebug(log, "{},删除的主题id为:{}", methodDescribe, id);
|
||||
boolean result = themeService.deleteTheme(id);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.SYSTEM_COMMON,operateType = OperateType.UPDATE)
|
||||
@PutMapping("/activateTheme")
|
||||
@ApiOperation("激活主题")
|
||||
@ApiImplicitParam(name = "id", value = "主题id", required = true)
|
||||
public HttpResult<Boolean> activateTheme(@RequestParam @Validated String id) {
|
||||
String methodDescribe = getMethodDescribe("activateTheme");
|
||||
LogUtil.njcnDebug(log, "{},启用的主题id为:{}", methodDescribe, id);
|
||||
boolean result = themeService.activateTheme(id);
|
||||
if (result){
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.FAIL, false, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
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.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.AreaTreeVO;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface AreaMapper extends BaseMapper<Area> {
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 行政区域树(首次)
|
||||
*/
|
||||
List<AreaTreeVO> getAreaTree(@Param("id")String id,@Param("type") Integer type,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 行政区域树(首次)
|
||||
*/
|
||||
List<AreaTreeVO> getAreaIdTree(@Param("type") Integer type,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
* 查询父节点的所有上层节点
|
||||
* @param id
|
||||
* @return 父节点的所有上层节点
|
||||
*/
|
||||
String getIdString(@Param("id")String id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ids id
|
||||
* @param state 状态
|
||||
* @return 返回的结果
|
||||
*/
|
||||
List<Area> selectPid(@Param("ids")List<String> ids,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param ids id
|
||||
* @param state 状态
|
||||
* @return 返回的结果
|
||||
*/
|
||||
List<String> getPid(@Param("ids")List<String> ids,@Param("state")Integer state);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return 行政区域树(首次)
|
||||
*/
|
||||
List<AreaTreeDTO> getAreaDeptTree(@Param("type") Integer type, @Param("state")Integer state);
|
||||
|
||||
/**
|
||||
* 查询所有区域
|
||||
* @return
|
||||
*/
|
||||
List<AreaTreeVO> getAreaAll();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface ConfigMapper extends BaseMapper<Config> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
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.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface DictDataMapper extends BaseMapper<DictData> {
|
||||
|
||||
/**
|
||||
* 分页查询字典数据
|
||||
* @param page 分页数据
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 字典数据
|
||||
*/
|
||||
Page<DictDataVO> page(@Param("page")Page<DictDataVO> page, @Param("ew")QueryWrapper<DictDataVO> queryWrapper);
|
||||
|
||||
/**
|
||||
* @param dictypeName 字典类型名称
|
||||
* @return 根据字典类型名称查询字典数据
|
||||
*/
|
||||
List<DictData> getDicDataByTypeName(@Param("dictypeName")String dictypeName);
|
||||
|
||||
DictData getDicDataByName(@Param("dicName")String dicName);
|
||||
|
||||
/**
|
||||
* 根据字典类型名称&数据名称获取字典数据
|
||||
*
|
||||
* @param dicTypeName 字典类型名称
|
||||
* @param dicDataName 字典数据名称
|
||||
* @return 字典数据
|
||||
*/
|
||||
DictData getDicDataByNameAndTypeName(@Param("dicTypeName")String dicTypeName, @Param("dicDataName")String dicDataName);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataCache;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface DictTypeMapper extends BaseMapper<DictType> {
|
||||
|
||||
/**
|
||||
* 查询所有的字典简单信息
|
||||
* @return 字典信息
|
||||
*/
|
||||
List<DictDataCache> dictDataCache();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
public interface MxGraphMapper extends BaseMapper<MxGraph> {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface ResourceMapper extends BaseMapper<Resource> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.Task;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface TaskMapper extends BaseMapper<Task> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface ThemeMapper extends BaseMapper<Theme> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
<?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.AreaMapper">
|
||||
<!--行政区域树-->
|
||||
<select id="getAreaTree" resultType="AreaTreeVO">
|
||||
SELECT sys_area.id id,
|
||||
sys_area.name name,
|
||||
sys_area.pid pid,
|
||||
sys_area.pids pids,
|
||||
sys_area.short_name shortName,
|
||||
sys_area.area_code areaCode,
|
||||
sys_area.lng lng,
|
||||
sys_area.lat lat
|
||||
FROM sys_area sys_area
|
||||
WHERE sys_area.type = #{type}
|
||||
AND sys_area.state = #{state}
|
||||
AND sys_area.pid = #{id}
|
||||
</select>
|
||||
|
||||
<!--行政区域树-->
|
||||
<select id="getAreaIdTree" resultType="AreaTreeVO">
|
||||
SELECT sys_area.id id,
|
||||
sys_area.name name,
|
||||
sys_area.pid pid,
|
||||
sys_area.pids pids,
|
||||
sys_area.short_name shortName,
|
||||
sys_area.area_code areaCode,
|
||||
sys_area.lng lng,
|
||||
sys_area.lat lat
|
||||
FROM sys_area sys_area
|
||||
WHERE sys_area.type = #{type}
|
||||
AND sys_area.state = #{state}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="selectPid" resultType="Area">
|
||||
SELECT sys_area.*
|
||||
FROM sys_area sys_area
|
||||
WHERE sys_area.pid in
|
||||
<foreach item="item" index="index" collection="ids" open="("
|
||||
separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND sys_area.type = 1
|
||||
AND sys_area.state = #{state}
|
||||
</select>
|
||||
|
||||
<select id="getIdString" resultType="String">
|
||||
SELECT sys_area.pids pids
|
||||
FROM sys_area sys_area
|
||||
WHERE sys_area.id = #{id}
|
||||
</select>
|
||||
|
||||
<!--行政区域树-->
|
||||
<select id="getAreaDeptTree" resultType="AreaTreeDTO">
|
||||
SELECT sys_area.id id,
|
||||
sys_area.name name,
|
||||
sys_area.pid pid,
|
||||
sys_area.pids pids,
|
||||
sys_area.short_name shortName,
|
||||
sys_area.area_code areaCode,
|
||||
sys_area.lng lng,
|
||||
sys_area.lat lat
|
||||
FROM sys_area sys_area
|
||||
WHERE sys_area.type = #{type}
|
||||
AND sys_area.state = #{state}
|
||||
</select>
|
||||
|
||||
<select id="getAreaAll" resultType="AreaTreeVO">
|
||||
SELECT sys_area.*
|
||||
FROM sys_area sys_area
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.ConfigMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
<?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.DictDataMapper">
|
||||
|
||||
|
||||
<!--获取字典分页列表-->
|
||||
<select id="page" resultType="DictDataVO">
|
||||
SELECT sys_dict_data.*,
|
||||
sys_dict_type.name typeName
|
||||
FROM sys_dict_data sys_dict_data
|
||||
,sys_dict_type sys_dict_type
|
||||
WHERE sys_dict_data.type_id = sys_dict_type.id
|
||||
AND ${ew.sqlSegment}
|
||||
</select>
|
||||
|
||||
<!-- 根据字典类型名称查询字典数据-->
|
||||
<select id="getDicDataByTypeName" resultType="DictData">
|
||||
SELECT sys_dict_data.*
|
||||
FROM sys_dict_data sys_dict_data,
|
||||
sys_dict_type sys_dict_type
|
||||
WHERE sys_dict_data.type_id = sys_dict_type.id
|
||||
AND sys_dict_type.name = #{dictypeName}
|
||||
order by sort
|
||||
</select>
|
||||
<!-- 根据字典名称查询字典数据-->
|
||||
<select id="getDicDataByName" resultType="DictData">
|
||||
SELECT sys_dict_data.*
|
||||
FROM sys_dict_data sys_dict_data
|
||||
WHERE sys_dict_data.name = #{dicName}
|
||||
</select>
|
||||
|
||||
<select id="getDicDataByNameAndTypeName" resultType="DictData">
|
||||
SELECT
|
||||
T2.*
|
||||
FROM
|
||||
sys_dict_type t1,
|
||||
sys_dict_data t2
|
||||
WHERE
|
||||
t1.id = t2.Type_Id
|
||||
AND T1.State = 1
|
||||
AND T2.State = 1
|
||||
AND t1.NAME = #{dicTypeName}
|
||||
AND t2.NAME = #{dicDataName}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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.DictTypeMapper">
|
||||
|
||||
<select id="dictDataCache" resultType="DictDataCache">
|
||||
select
|
||||
t1.id id,
|
||||
t1.name name,
|
||||
t1.code code,
|
||||
t1.sort sort,
|
||||
t2.id typeId,
|
||||
t2.name typeName,
|
||||
t2.code typeCode
|
||||
from
|
||||
sys_dict_data t1,
|
||||
sys_dict_type t2
|
||||
where
|
||||
t1.Type_Id = t2.id
|
||||
and
|
||||
t1.state = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.ResourceMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.TaskMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?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.ThemeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,106 @@
|
||||
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.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.param.AreaParam;
|
||||
import com.njcn.system.pojo.param.DictTypeParam;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.AreaTreeVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IAreaService extends IService<Area> {
|
||||
|
||||
/**
|
||||
* 根据前台传递参数,分页查询行政区域信息
|
||||
*
|
||||
* @param queryParam 查询参数
|
||||
* @return 行政区域列表
|
||||
*/
|
||||
Page<Area> listDictData(AreaParam.QueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 根据行政区域id查询详情
|
||||
*
|
||||
* @param id 行政区域id
|
||||
* @return 行政区域详情详情
|
||||
*/
|
||||
Area selectIdArea(String id);
|
||||
|
||||
/**
|
||||
* 根据行政区域id查询详情
|
||||
*
|
||||
* @param list 行政区域id集合
|
||||
* @return 行政区域详情详情
|
||||
*/
|
||||
List<Area> selectAreaByList(List<String> list);
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
List<Area> selectPid(List<String> ids);
|
||||
|
||||
/**
|
||||
* 行政区域树
|
||||
*
|
||||
* @param type 区域类型
|
||||
* @return 树形结构
|
||||
*/
|
||||
List<AreaTreeVO> areaTree(String id, Integer type);
|
||||
|
||||
/**
|
||||
* 新增企业区域
|
||||
* @param areaParam 企业区域
|
||||
* @return 新增结果
|
||||
*/
|
||||
boolean addAreaParam(AreaParam areaParam);
|
||||
|
||||
/**
|
||||
* 修改企业区域
|
||||
* @param updateParam 企业区域数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean updateArea(AreaParam.AreaUpdateParam updateParam);
|
||||
|
||||
/**
|
||||
* 批量逻辑删除企业区域数据
|
||||
* @param ids 企业区域id集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean deleteArea(List<String> ids);
|
||||
|
||||
/**
|
||||
* 行政区域树
|
||||
*
|
||||
* @param type 区域类型
|
||||
* @return 树形结构
|
||||
*/
|
||||
List<AreaTreeDTO> areaDeptTree(String id, Integer type);
|
||||
|
||||
/**
|
||||
* 根据区域id获取省份信息
|
||||
*
|
||||
* @param type 区域类型
|
||||
* @return 树形结构
|
||||
*/
|
||||
Area areaPro(String id, Integer type);
|
||||
|
||||
List<AreaTreeVO> getDeptIdAreaTree();
|
||||
|
||||
/**
|
||||
* 根据行政区域名称查询详细
|
||||
*
|
||||
* @param name 行政区域名称
|
||||
* @return 行政区域详情
|
||||
*/
|
||||
Area selectAreaByName(String name);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IConfigService extends IService<Config> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IDictDataService extends IService<DictData> {
|
||||
|
||||
/**
|
||||
* 根据前台传递参数,分页查询字典数据
|
||||
* @param queryParam 查询参数
|
||||
* @return 字典列表
|
||||
*/
|
||||
Page<DictDataVO> listDictData(DictDataParam.DictDataQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 新增数据字典
|
||||
* @param dictDataParam 字典数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean addDictData(DictDataParam dictDataParam);
|
||||
|
||||
/**
|
||||
* 更新字典数据
|
||||
* @param updateParam 字典数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean updateDictData(DictDataParam.DictDataUpdateParam updateParam);
|
||||
|
||||
/**
|
||||
* 批量逻辑删除字典数据
|
||||
* @param ids 字典id集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean deleteDictData(List<String> ids);
|
||||
|
||||
/**
|
||||
* 根据字典类型id查询字典信息
|
||||
*/
|
||||
Page<DictDataVO> getTypeIdData(DictDataParam.DicTypeIdQueryParam queryParam);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param dicIndex 字典id
|
||||
* @return 根据字典id查询字典数据
|
||||
*/
|
||||
DictData getDicDataById(String dicIndex);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param dictypeName 字典类型名称
|
||||
* @return 根据字典类型名称查询字典数据
|
||||
*/
|
||||
List<DictData> getDicDataByTypeName(String dictypeName);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param dicName 字典名称
|
||||
* @return 根据字典名称查询字典数据
|
||||
*/
|
||||
DictData getDicDataByName(String dicName);
|
||||
|
||||
/**
|
||||
* 根据系统获取指标参数
|
||||
* @return 操作结果
|
||||
*/
|
||||
List<DictData> getLoadTypeBySys();
|
||||
|
||||
/**
|
||||
* 根据字典类型名称&数据名称获取字典数据
|
||||
*
|
||||
* @param dicTypeName 字典类型名称
|
||||
* @param dicDataName 字典数据名称
|
||||
* @return 字典数据
|
||||
*/
|
||||
DictData getDicDataByNameAndTypeName(String dicTypeName, String dicDataName);
|
||||
|
||||
/**
|
||||
* 后台新增字典数据
|
||||
* @param dicTypeName 类型名称
|
||||
* @param dicDataName 数据名称
|
||||
* @return 新增后的字典数据
|
||||
*/
|
||||
DictData addDictData(String dicTypeName, String dicDataName);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.dto.SimpleTreeDTO;
|
||||
import com.njcn.system.pojo.param.DictTypeParam;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IDictTypeService extends IService<DictType> {
|
||||
|
||||
/**
|
||||
* 根据前台传递参数,分页查询字典类型数据
|
||||
* @param queryParam 查询参数
|
||||
* @return 字典列表
|
||||
*/
|
||||
Page<DictType> listDictTypes(DictTypeParam.DictTypeQueryParam queryParam);
|
||||
|
||||
/**
|
||||
* 新增字典类型数据
|
||||
*
|
||||
* @param dictTypeParam 字典类型数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean addDictType(DictTypeParam dictTypeParam);
|
||||
|
||||
/**
|
||||
* 修改字典类型
|
||||
*
|
||||
* @param updateParam 字典类型数据
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean updateDictType(DictTypeParam.DictTypeUpdateParam updateParam);
|
||||
|
||||
/**
|
||||
* 批量逻辑删除字典类型数据
|
||||
* @param ids id集合
|
||||
* @return 操作结果
|
||||
*/
|
||||
boolean deleteDictType(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获取所有字典数据基础信息
|
||||
* @return 返回所有字典数据
|
||||
*/
|
||||
List<SimpleTreeDTO> dictDataCache();
|
||||
|
||||
/**
|
||||
* 根据名称获取字典类型数据
|
||||
* @param dicTypeName 类型名称
|
||||
* @return 类型数据
|
||||
*/
|
||||
DictType getByName(String dicTypeName);
|
||||
|
||||
/**
|
||||
* 根据名称新增字典类型数据
|
||||
* @param dicTypeName 类型名称
|
||||
* @return 类型数据
|
||||
*/
|
||||
DictType addByName(String dicTypeName);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.MxGraphParam;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
public interface IMxGraphService extends IService<MxGraph> {
|
||||
|
||||
/**
|
||||
* 新增组态
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
boolean addKingView(MxGraphParam mxGraphParam);
|
||||
|
||||
/**
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
List<MxGraph> getKingViewList();
|
||||
|
||||
|
||||
MxGraph getKingViewById(String id);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.po.Resource;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IResourceService extends IService<Resource> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.po.Task;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface ITaskService extends IService<Task> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.njcn.system.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.system.pojo.param.ThemeParam;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import com.sun.org.apache.xpath.internal.operations.Bool;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
public interface IThemeService extends IService<Theme> {
|
||||
|
||||
/**
|
||||
* 功能描述: 新增主题
|
||||
* TODO
|
||||
*
|
||||
* @param themeParam
|
||||
* @return java.lang.Boolean
|
||||
* @author xy
|
||||
* @date 2022/1/12 14:13
|
||||
*/
|
||||
boolean addTheme(ThemeParam themeParam);
|
||||
|
||||
/**
|
||||
* 功能描述: 修改主题
|
||||
* TODO
|
||||
*
|
||||
* @param themeParam
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/13 11:30
|
||||
*/
|
||||
boolean updateTheme(ThemeParam.ThemeUpdateParam themeParam);
|
||||
|
||||
/**
|
||||
* 功能描述: 获取所有主题
|
||||
* TODO
|
||||
*
|
||||
* @param
|
||||
* @return java.util.List<com.njcn.system.pojo.po.Theme>
|
||||
* @author xy
|
||||
* @date 2022/1/12 15:38
|
||||
*/
|
||||
List<Theme> getAllThemes();
|
||||
|
||||
/**
|
||||
* 功能描述: 获取当前主题
|
||||
* TODO
|
||||
*
|
||||
* @param
|
||||
* @return com.njcn.system.pojo.po.Theme
|
||||
* @author xy
|
||||
* @date 2022/1/12 15:39
|
||||
*/
|
||||
Theme getTheme();
|
||||
|
||||
/**
|
||||
* 功能描述: 删除主题
|
||||
* TODO
|
||||
*
|
||||
* @param id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/12 16:48
|
||||
*/
|
||||
boolean deleteTheme(String id);
|
||||
|
||||
/**
|
||||
* 功能描述: 激活主题
|
||||
* TODO
|
||||
*
|
||||
* @param id
|
||||
* @return boolean
|
||||
* @author xy
|
||||
* @date 2022/1/12 16:48
|
||||
*/
|
||||
boolean activateTheme(String id);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.AreaMapper;
|
||||
import com.njcn.system.pojo.dto.AreaTreeDTO;
|
||||
import com.njcn.system.pojo.param.AreaParam;
|
||||
import com.njcn.system.pojo.po.Area;
|
||||
import com.njcn.system.pojo.vo.AreaTreeVO;
|
||||
import com.njcn.system.service.IAreaService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.pojo.po.Dept;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class AreaServiceImpl extends ServiceImpl<AreaMapper, Area> implements IAreaService {
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
@Override
|
||||
public Page<Area> listDictData(AreaParam.QueryParam queryParam) {
|
||||
QueryWrapper<Area> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
//查询参数不为空,进行条件填充
|
||||
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
|
||||
//部门根据名称模糊查询
|
||||
queryWrapper
|
||||
.and(param -> param.like("sys_area.name", queryParam.getSearchValue()));
|
||||
}
|
||||
}
|
||||
queryWrapper.ne("sys_area.state", DataStateEnum.DELETED.getCode());
|
||||
queryWrapper.ge("sys_area.type", queryParam.getType());
|
||||
//初始化分页数据
|
||||
return this.baseMapper.selectPage(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Area selectIdArea(String id) {
|
||||
return this.baseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Area> selectAreaByList(List<String> list) {
|
||||
return this.lambdaQuery().in(Area::getId, list).list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Area> selectPid(List<String> ids) {
|
||||
return this.baseMapper.selectPid(ids, DataStateEnum.ENABLE.getCode());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaTreeVO> areaTree(String id, Integer type) {
|
||||
List<AreaTreeVO> areaTreeVOList = new ArrayList<>();
|
||||
if (id.equals("") || id == null) {
|
||||
/**
|
||||
* 用于首次访问区域。此处需要获取当前用户所绑定的部门下的行政区域id
|
||||
* 现在默认为0
|
||||
*/
|
||||
id = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
}
|
||||
List<AreaTreeVO> areaTreeVOS = new ArrayList<>();
|
||||
if (type == 1) {
|
||||
areaTreeVOList = this.baseMapper.getAreaIdTree(type, DataStateEnum.ENABLE.getCode());
|
||||
List<AreaTreeVO> finalAreaTreeVOList = areaTreeVOList;
|
||||
areaTreeVOS = areaTreeVOList.stream().filter(deptTreeVO ->
|
||||
deptTreeVO.getPid().equals("0")
|
||||
).map((deptFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
deptFirst.setChildren(getChildrens(deptFirst, finalAreaTreeVOList));
|
||||
return deptFirst;
|
||||
}).collect(Collectors.toList());
|
||||
} else {
|
||||
areaTreeVOS = this.baseMapper.getAreaTree(id, type, DataStateEnum.ENABLE.getCode());
|
||||
;
|
||||
}
|
||||
return areaTreeVOS;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查找所有企业的下级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<AreaTreeVO> getChildrens(AreaTreeVO areaTreeVO, List<AreaTreeVO> allArea) {
|
||||
List<AreaTreeVO> chilrdenList = allArea.stream().filter(area -> {
|
||||
//在全部数据中,找到和一级部门deptFirst的valueId相等的parentId
|
||||
return area.getPid().equals(areaTreeVO.getId());
|
||||
}).map(deptId -> {
|
||||
//递归查询找到下级部门
|
||||
deptId.setChildren(getChildrens(deptId, allArea));
|
||||
return deptId;
|
||||
}).collect(Collectors.toList());
|
||||
return chilrdenList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAreaParam(AreaParam areaParam) {
|
||||
checkAreaCode(areaParam, false);
|
||||
Area area = new Area();
|
||||
BeanUtil.copyProperties(areaParam, area);
|
||||
if (areaParam.getPid().equals("0")) {
|
||||
//上层节点
|
||||
area.setPids("0");
|
||||
} else {
|
||||
String pids = "," + areaParam.getPid();
|
||||
String pid = this.baseMapper.getIdString(area.getPid());
|
||||
//上层节点
|
||||
area.setPids(pid + pids);
|
||||
}
|
||||
//默认为正常状态
|
||||
area.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(area);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateArea(AreaParam.AreaUpdateParam updateParam) {
|
||||
checkAreaCode(updateParam, true);
|
||||
Area area = new Area();
|
||||
if (updateParam.getPid().equals("0")) {
|
||||
//上层节点
|
||||
area.setPids("0");
|
||||
} else {
|
||||
String pids = "," + updateParam.getPid();
|
||||
String pid = this.baseMapper.getIdString(area.getPid());
|
||||
//上层节点
|
||||
area.setPids(pid + pids);
|
||||
}
|
||||
BeanUtil.copyProperties(updateParam, area);
|
||||
return this.updateById(area);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteArea(List<String> ids) {
|
||||
/**
|
||||
* 查询子节点
|
||||
*/
|
||||
List<Area> list = this.baseMapper.selectPid(ids, DataStateEnum.ENABLE.getCode());
|
||||
/**
|
||||
* 将子节点叶添加到需要删除中
|
||||
*/
|
||||
if (list.size() > 0) {
|
||||
for (Area area : list) {
|
||||
ids.add(area.getId());
|
||||
}
|
||||
}
|
||||
return this.lambdaUpdate().set(Area::getState, DataStateEnum.DELETED.getCode()).in(Area::getId, ids).update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaTreeDTO> areaDeptTree(String id, Integer type) {
|
||||
List<AreaTreeDTO> areaTreeVOList = new ArrayList<>();
|
||||
List<AreaTreeDTO> areaTreeVOS = new ArrayList<>();
|
||||
if (id.equals("") || id == null) {
|
||||
/**
|
||||
* 用于首次访问区域。此处需要获取当前用户所绑定的部门下的行政区域id
|
||||
* 现在默认为0
|
||||
*/
|
||||
|
||||
id = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
}
|
||||
areaTreeVOList = this.baseMapper.getAreaDeptTree(type, DataStateEnum.ENABLE.getCode());
|
||||
List<AreaTreeDTO> finalAreaTreeVOList = areaTreeVOList;
|
||||
String finalId = id;
|
||||
areaTreeVOS = areaTreeVOList.stream().filter(deptTreeVO ->
|
||||
deptTreeVO.getPid().equals(finalId)
|
||||
).map((deptFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
deptFirst.setChildren(getChildrens(deptFirst, finalAreaTreeVOList));
|
||||
return deptFirst;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return areaTreeVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Area areaPro(String id, Integer type) {
|
||||
QueryWrapper<Area> areaQueryWrapper = new QueryWrapper<>();
|
||||
areaQueryWrapper.eq("sys_area.id", id);
|
||||
areaQueryWrapper.eq("sys_area.type", type);
|
||||
areaQueryWrapper.eq("sys_area.state", DataStateEnum.ENABLE.getCode());
|
||||
Area area = this.baseMapper.selectOne(areaQueryWrapper);
|
||||
if (!area.getPid().equals("0")) {
|
||||
id = area.getPid();
|
||||
area = areaPro(id, type);
|
||||
}
|
||||
return area;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AreaTreeVO> getDeptIdAreaTree() {
|
||||
|
||||
//获取当前系统登录的部门信息
|
||||
String areaId = deptFeignClient.getAreaIdByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
List<AreaTreeVO> areaTreeVOS = this.baseMapper.getAreaAll();
|
||||
List<AreaTreeVO> areaTreeVOLists = areaTreeVOS.stream().filter(areaTreeVO ->
|
||||
areaTreeVO.getId().equals(areaId)
|
||||
).map((areaFirst) -> {
|
||||
//map映射方法改变结果,调用getChildrens()方法,把一级部门deptFirst和所有数据allDept作为参数传递,查询所有下级部门
|
||||
areaFirst.setChildren(getChildrens(areaFirst, areaTreeVOS));
|
||||
return areaFirst;
|
||||
}).collect(Collectors.toList());
|
||||
return areaTreeVOLists;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Area selectAreaByName(String name) {
|
||||
LambdaQueryWrapper<Area> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(Area::getName, name);
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查找所有企业的下级
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private List<AreaTreeDTO> getChildrens(AreaTreeDTO areaTreeVO, List<AreaTreeDTO> allArea) {
|
||||
List<AreaTreeDTO> chilrdenList = allArea.stream().filter(area -> {
|
||||
//在全部数据中,找到和一级部门deptFirst的valueId相等的parentId
|
||||
return area.getPid().equals(areaTreeVO.getId());
|
||||
}).map(deptId -> {
|
||||
//递归查询找到下级部门
|
||||
deptId.setChildren(getChildrens(deptId, allArea));
|
||||
return deptId;
|
||||
}).collect(Collectors.toList());
|
||||
return chilrdenList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同编码的企业区域
|
||||
*/
|
||||
private void checkAreaCode(AreaParam areaParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<Area> dictTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dictTypeLambdaQueryWrapper
|
||||
.eq(Area::getAreaCode, areaParam.getAreaCode())
|
||||
.eq(Area::getState, DataStateEnum.ENABLE.getCode());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (areaParam instanceof AreaParam.AreaUpdateParam) {
|
||||
dictTypeLambdaQueryWrapper.ne(Area::getId, ((AreaParam.AreaUpdateParam) areaParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.count(dictTypeLambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(SystemResponseEnum.AREA_CODE_REPEAT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.njcn.system.mapper.ConfigMapper;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
import com.njcn.system.service.IConfigService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Service
|
||||
public class ConfigServiceImpl extends ServiceImpl<ConfigMapper, Config> implements IConfigService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.DicDataEnum;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.DictDataMapper;
|
||||
import com.njcn.system.pojo.constant.SystemType;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.po.Config;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataVO;
|
||||
import com.njcn.system.service.IConfigService;
|
||||
import com.njcn.system.service.IDictDataService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.system.service.IDictTypeService;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DictDataServiceImpl extends ServiceImpl<DictDataMapper, DictData> implements IDictDataService {
|
||||
|
||||
private final IConfigService iConfigService;
|
||||
|
||||
private final IDictTypeService dictTypeService;
|
||||
|
||||
@Override
|
||||
public Page<DictDataVO> listDictData(DictDataParam.DictDataQueryParam queryParam) {
|
||||
QueryWrapper<DictDataVO> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
//查询参数不为空,进行条件填充
|
||||
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
|
||||
//字典类型表,仅提供名称、编码模糊查询
|
||||
queryWrapper
|
||||
.and(param -> param.like("sys_dict_data.name", queryParam.getSearchValue())
|
||||
.or().like("sys_dict_data.code", queryParam.getSearchValue()));
|
||||
}
|
||||
//排序
|
||||
if (ObjectUtil.isAllNotEmpty(queryParam.getSortBy(), queryParam.getOrderBy())) {
|
||||
queryWrapper.orderBy(true, queryParam.getOrderBy().equals(DbConstant.ASC), StrUtil.toUnderlineCase(queryParam.getSortBy()));
|
||||
} else {
|
||||
//没有排序参数,默认根据sort字段排序,没有排序字段的,根据updateTime更新时间排序
|
||||
queryWrapper.orderBy(true, true, "sys_dict_data.sort");
|
||||
}
|
||||
}
|
||||
queryWrapper.ne("sys_dict_data.state", DataStateEnum.DELETED.getCode());
|
||||
//初始化分页数据
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addDictData(DictDataParam dictDataParam) {
|
||||
checkDicDataName(dictDataParam, false);
|
||||
DictData dictData = new DictData();
|
||||
BeanUtil.copyProperties(dictDataParam, dictData);
|
||||
//默认为正常状态
|
||||
dictData.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(dictData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDictData(DictDataParam.DictDataUpdateParam updateParam) {
|
||||
checkDicDataName(updateParam, true);
|
||||
DictData dictData = new DictData();
|
||||
BeanUtil.copyProperties(updateParam, dictData);
|
||||
return this.updateById(dictData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteDictData(List<String> ids) {
|
||||
return this.lambdaUpdate()
|
||||
.set(DictData::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(DictData::getId, ids)
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<DictDataVO> getTypeIdData(DictDataParam.DicTypeIdQueryParam queryParam) {
|
||||
QueryWrapper<DictDataVO> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
//查询参数不为空,进行条件填充
|
||||
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
|
||||
//字典类型表,仅提供名称、编码模糊查询
|
||||
queryWrapper
|
||||
.and(param -> param.like("sys_dict_data.name", queryParam.getSearchValue())
|
||||
.or().like("sys_dict_data.code", queryParam.getSearchValue()));
|
||||
}
|
||||
//排序
|
||||
if (ObjectUtil.isAllNotEmpty(queryParam.getSortBy(), queryParam.getOrderBy())) {
|
||||
queryWrapper.orderBy(true, queryParam.getOrderBy().equals(DbConstant.ASC), StrUtil.toUnderlineCase(queryParam.getSortBy()));
|
||||
} else {
|
||||
//没有排序参数,默认根据sort字段排序,没有排序字段的,根据updateTime更新时间排序
|
||||
queryWrapper.orderBy(true, true, "sys_dict_data.sort");
|
||||
}
|
||||
}
|
||||
queryWrapper.ne("sys_dict_data.state", DataStateEnum.DELETED.getCode());
|
||||
queryWrapper.eq("sys_dict_data.type_id", queryParam.getTypeId());
|
||||
//初始化分页数据
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData getDicDataById(String dicIndex) {
|
||||
|
||||
return this.baseMapper.selectById(dicIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictData> getDicDataByTypeName(String dictTypeName) {
|
||||
return this.baseMapper.getDicDataByTypeName(dictTypeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData getDicDataByName(String dicName) {
|
||||
return this.baseMapper.getDicDataByName(dicName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DictData> getLoadTypeBySys() {
|
||||
List<DictData> list = new ArrayList<>();
|
||||
Config config = iConfigService.lambdaQuery()
|
||||
.eq(Config::getState, DataStateEnum.ENABLE.getCode())
|
||||
.one();
|
||||
if (Objects.equals(config.getType(), SystemType.ENTERPRISE_SYSTEM)) {
|
||||
List<DictData> dataList = this.baseMapper.getDicDataByTypeName(DicDataTypeEnum.INDICATOR_TYPE.getName());
|
||||
return dataList.stream().filter(item -> Objects.equals(item.getName(), DicDataEnum.XBDY_ENUM.getName()) || Objects.equals(item.getName(), DicDataEnum.XBDL_ENUM.getName())).collect(Collectors.toList());
|
||||
} else {
|
||||
list = this.baseMapper.getDicDataByTypeName(DicDataTypeEnum.INDICATOR_TYPE.getName()).stream().sorted(Comparator.comparing(DictData::getSort)).collect(Collectors.toList());
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData getDicDataByNameAndTypeName(String dicTypeName, String dicDataName) {
|
||||
return this.baseMapper.getDicDataByNameAndTypeName(dicTypeName,dicDataName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictData addDictData(String dicTypeName, String dicDataName) {
|
||||
//根据type名称获取index,如果不存在该字典类型,则新增该字典类型
|
||||
DictType dictType = dictTypeService.getByName(dicTypeName);
|
||||
if (Objects.isNull(dictType)) {
|
||||
dictType = dictTypeService.addByName(dicTypeName);
|
||||
}
|
||||
DictData dictData = new DictData();
|
||||
dictData.setTypeId(dictType.getId());
|
||||
dictData.setName(dicDataName);
|
||||
dictData.setCode(dicDataName);
|
||||
dictData.setSort(0);
|
||||
dictData.setLevel(0);
|
||||
dictData.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.save(dictData);
|
||||
return dictData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同名称的字典类型
|
||||
*/
|
||||
private void checkDicDataName(DictDataParam dictDataParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<DictData> dictDataLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dictDataLambdaQueryWrapper
|
||||
.eq(DictData::getName, dictDataParam.getName())
|
||||
.eq(DictData::getTypeId, dictDataParam.getTypeId())
|
||||
.eq(DictData::getState, DataStateEnum.ENABLE.getCode());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (dictDataParam instanceof DictDataParam.DictDataUpdateParam) {
|
||||
dictDataLambdaQueryWrapper.ne(DictData::getId, ((DictDataParam.DictDataUpdateParam) dictDataParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.count(dictDataLambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(SystemResponseEnum.DICT_DATA_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
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.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.common.pojo.dto.SimpleTreeDTO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.mapper.DictTypeMapper;
|
||||
import com.njcn.system.pojo.param.DictTypeParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.DictType;
|
||||
import com.njcn.system.pojo.vo.DictDataCache;
|
||||
import com.njcn.system.service.IDictTypeService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, DictType> implements IDictTypeService {
|
||||
|
||||
@Override
|
||||
public Page<DictType> listDictTypes(DictTypeParam.DictTypeQueryParam queryParam) {
|
||||
QueryWrapper<DictType> queryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotNull(queryParam)) {
|
||||
//查询参数不为空,进行条件填充
|
||||
if (StrUtil.isNotBlank(queryParam.getSearchValue())) {
|
||||
//字典类型表,仅提供名称、编码模糊查询
|
||||
queryWrapper
|
||||
.and(param -> param.like("sys_dict_type.name", queryParam.getSearchValue())
|
||||
.or().like("sys_dict_type.code", queryParam.getSearchValue())
|
||||
);
|
||||
}
|
||||
//排序
|
||||
if (ObjectUtil.isAllNotEmpty(queryParam.getSortBy(), queryParam.getOrderBy())) {
|
||||
queryWrapper.orderBy(true, queryParam.getOrderBy().equals(DbConstant.ASC), StrUtil.toUnderlineCase(queryParam.getSortBy()));
|
||||
} else {
|
||||
//没有排序参数,默认根据sort字段排序,没有排序字段的,根据updateTime更新时间排序
|
||||
queryWrapper.orderBy(true, true, "sys_dict_type.sort");
|
||||
}
|
||||
}
|
||||
queryWrapper.ne("sys_dict_type.state", DataStateEnum.DELETED.getCode());
|
||||
return this.baseMapper.selectPage(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addDictType(DictTypeParam dictTypeParam) {
|
||||
checkDicTypeName(dictTypeParam, false);
|
||||
DictType dictType = new DictType();
|
||||
BeanUtil.copyProperties(dictTypeParam, dictType);
|
||||
//默认为正常状态
|
||||
dictType.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(dictType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateDictType(DictTypeParam.DictTypeUpdateParam updateParam) {
|
||||
checkDicTypeName(updateParam, true);
|
||||
DictType dictType = new DictType();
|
||||
BeanUtil.copyProperties(updateParam, dictType);
|
||||
return this.updateById(dictType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteDictType(List<String> ids) {
|
||||
return this.lambdaUpdate()
|
||||
.set(DictType::getState, DataStateEnum.DELETED.getCode())
|
||||
.in(DictType::getId, ids)
|
||||
.update();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<SimpleTreeDTO> dictDataCache() {
|
||||
List<DictDataCache> allDictData = this.baseMapper.dictDataCache();
|
||||
Map<Object, List<DictDataCache>> dictDataCacheMap = allDictData.stream()
|
||||
.collect(Collectors.groupingBy(dictDataCache -> dictDataCache.getTypeId()));
|
||||
List<SimpleTreeDTO> dictTypeList = dictDataCacheMap.keySet().stream().map(typeId -> {
|
||||
SimpleTreeDTO simpleTreeDTO = new SimpleTreeDTO();
|
||||
List<DictDataCache> dictDataCaches = dictDataCacheMap.get(typeId);
|
||||
List<SimpleDTO> simpleDTOs = dictDataCaches.stream().map(dictDataCache -> {
|
||||
simpleTreeDTO.setCode(dictDataCache.getTypeCode());
|
||||
simpleTreeDTO.setId(dictDataCache.getTypeId());
|
||||
simpleTreeDTO.setName(dictDataCache.getTypeName());
|
||||
SimpleDTO simpleDTO = new SimpleDTO();
|
||||
simpleDTO.setCode(dictDataCache.getCode());
|
||||
simpleDTO.setId(dictDataCache.getId());
|
||||
simpleDTO.setName(dictDataCache.getName());
|
||||
simpleDTO.setSort(dictDataCache.getSort());
|
||||
return simpleDTO;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
simpleTreeDTO.setChildren(simpleDTOs);
|
||||
return simpleTreeDTO;
|
||||
}).collect(Collectors.toList());
|
||||
return dictTypeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictType getByName(String dicTypeName) {
|
||||
LambdaQueryWrapper<DictType> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(DictType::getName, dicTypeName)
|
||||
.eq(DictType::getState, DataStateEnum.ENABLE.getCode());
|
||||
return this.baseMapper.selectOne(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DictType addByName(String dicTypeName) {
|
||||
DictType dictType = new DictType();
|
||||
dictType.setName(dicTypeName);
|
||||
dictType.setCode(dicTypeName);
|
||||
dictType.setSort(0);
|
||||
dictType.setOpenDescribe(0);
|
||||
dictType.setOpenLevel(0);
|
||||
dictType.setState(DataStateEnum.ENABLE.getCode());
|
||||
this.save(dictType);
|
||||
return dictType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,检查是否存在相同名称的字典类型
|
||||
*/
|
||||
private void checkDicTypeName(DictTypeParam dictTypeParam, boolean isExcludeSelf) {
|
||||
LambdaQueryWrapper<DictType> dictTypeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dictTypeLambdaQueryWrapper
|
||||
.eq(DictType::getName, dictTypeParam.getName())
|
||||
.eq(DictType::getState, DataStateEnum.ENABLE.getCode());
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (dictTypeParam instanceof DictTypeParam.DictTypeUpdateParam) {
|
||||
dictTypeLambdaQueryWrapper.ne(DictType::getId, ((DictTypeParam.DictTypeUpdateParam) dictTypeParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.count(dictTypeLambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(SystemResponseEnum.DICT_TYPE_NAME_REPEAT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.system.mapper.MxGraphMapper;
|
||||
import com.njcn.system.pojo.param.MxGraphParam;
|
||||
import com.njcn.system.pojo.po.MxGraph;
|
||||
import com.njcn.system.service.IMxGraphService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2022/1/26
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class MxGraphServiceImpl extends ServiceImpl<MxGraphMapper, MxGraph> implements IMxGraphService {
|
||||
|
||||
private final MxGraphMapper mxGraphMapper;
|
||||
|
||||
@Override
|
||||
public boolean addKingView(MxGraphParam mxGraphParam) {
|
||||
MxGraph mxGraph = new MxGraph();
|
||||
BeanUtils.copyProperties(mxGraphParam,mxGraph);
|
||||
mxGraph.setState(DataStateEnum.ENABLE.getCode());
|
||||
return this.save(mxGraph);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MxGraph> getKingViewList() {
|
||||
LambdaQueryWrapper<MxGraph> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByAsc(MxGraph::getSort);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MxGraph getKingViewById(String id) {
|
||||
return this.getById(id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.njcn.system.mapper.ResourceMapper;
|
||||
import com.njcn.system.pojo.po.Resource;
|
||||
import com.njcn.system.service.IResourceService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Service
|
||||
public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource> implements IResourceService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import com.njcn.system.mapper.TaskMapper;
|
||||
import com.njcn.system.pojo.po.Task;
|
||||
import com.njcn.system.service.ITaskService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Service
|
||||
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements ITaskService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.njcn.system.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.system.enums.SystemResponseEnum;
|
||||
import com.njcn.system.enums.ThemeEnum;
|
||||
import com.njcn.system.mapper.ThemeMapper;
|
||||
import com.njcn.system.pojo.constant.ThemeState;
|
||||
import com.njcn.system.pojo.param.DictDataParam;
|
||||
import com.njcn.system.pojo.param.ThemeParam;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import com.njcn.system.pojo.po.Theme;
|
||||
import com.njcn.system.service.IThemeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author hongawen
|
||||
* @since 2021-12-13
|
||||
*/
|
||||
@Service
|
||||
public class ThemeServiceImpl extends ServiceImpl<ThemeMapper, Theme> implements IThemeService {
|
||||
|
||||
@Override
|
||||
public boolean addTheme(ThemeParam themeParam) {
|
||||
checkThemeParam(themeParam,false);
|
||||
Theme theme = new Theme();
|
||||
theme.setName(themeParam.getName());
|
||||
theme.setColor(themeParam.getColor());
|
||||
theme.setActive(ThemeState.INACTIVATED);
|
||||
theme.setRemark(themeParam.getRemark());
|
||||
theme.setState(ThemeState.NORMAL);
|
||||
theme.setLogoUrl(generateBase64(themeParam.getLogoFile()));
|
||||
theme.setFaviconUrl(generateBase64(themeParam.getFaviconFile()));
|
||||
return this.save(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateTheme(ThemeParam.ThemeUpdateParam themeParam) {
|
||||
checkThemeParam(themeParam,true);
|
||||
Theme theme = new Theme();
|
||||
theme.setLogoUrl(generateBase64(themeParam.getLogoFile()));
|
||||
theme.setFaviconUrl(generateBase64(themeParam.getFaviconFile()));
|
||||
BeanUtil.copyProperties(themeParam, theme);
|
||||
return this.updateById(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Theme> getAllThemes() {
|
||||
return this.lambdaQuery().eq(Theme::getState,ThemeState.NORMAL).select().list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Theme getTheme() {
|
||||
return this.lambdaQuery()
|
||||
.eq(Theme::getActive,ThemeState.ACTIVATION).one();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deleteTheme(String id) {
|
||||
return this.lambdaUpdate()
|
||||
.set(Theme::getState, ThemeState.DELETE)
|
||||
.in(Theme::getId,id)
|
||||
.update();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean activateTheme(String id) {
|
||||
this.lambdaUpdate()
|
||||
.eq(Theme::getActive,ThemeState.ACTIVATION)
|
||||
.set(Theme::getActive, ThemeState.INACTIVATED)
|
||||
.update();
|
||||
return this.lambdaUpdate()
|
||||
.set(Theme::getActive, ThemeState.ACTIVATION)
|
||||
.in(Theme::getId,id)
|
||||
.update();
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验参数,
|
||||
* 1.检查是否存在相同名称的主题
|
||||
* 2.检查图片是否为空
|
||||
*/
|
||||
private void checkThemeParam(ThemeParam themeParam, boolean isExcludeSelf) {
|
||||
if (themeParam.getLogoFile().isEmpty()) {
|
||||
throw new BusinessException(ThemeEnum.LOGO_FILE_BLANK);
|
||||
}
|
||||
if (themeParam.getFaviconFile().isEmpty()) {
|
||||
throw new BusinessException(ThemeEnum.FAVICON_FILE_BLANK);
|
||||
}
|
||||
LambdaQueryWrapper<Theme> themeLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
themeLambdaQueryWrapper
|
||||
.eq(Theme::getName, themeParam.getName())
|
||||
.eq(Theme::getState, ThemeState.NORMAL);
|
||||
//更新的时候,需排除当前记录
|
||||
if (isExcludeSelf) {
|
||||
if (themeParam instanceof ThemeParam.ThemeUpdateParam) {
|
||||
themeLambdaQueryWrapper.ne(Theme::getId, ((ThemeParam.ThemeUpdateParam) themeParam).getId());
|
||||
}
|
||||
}
|
||||
int countByAccount = this.count(themeLambdaQueryWrapper);
|
||||
//大于等于1个则表示重复
|
||||
if (countByAccount >= 1) {
|
||||
throw new BusinessException(ThemeEnum.SAME_THEME_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* MultipartFile转换成base64
|
||||
*/
|
||||
public static String generateBase64(MultipartFile file){
|
||||
String base64EncoderImg= null;
|
||||
try {
|
||||
BASE64Encoder bEncoder=new BASE64Encoder();
|
||||
String[] suffixArra=file.getOriginalFilename().split("\\.");
|
||||
String preffix="data:image/jpg;base64,".replace("jpg", suffixArra[suffixArra.length - 1]);
|
||||
base64EncoderImg = preffix + bEncoder.encode(file.getBytes()).replaceAll("[\\s*\t\n\r]", "");
|
||||
} catch (IOException e) {
|
||||
e.getMessage();
|
||||
}
|
||||
return base64EncoderImg;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
48
pqs-system/system-boot/src/main/resources/bootstrap.yml
Normal file
48
pqs-system/system-boot/src/main/resources/bootstrap.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
#当前服务的基本信息
|
||||
microservice:
|
||||
ename: @artifactId@
|
||||
name: '@name@'
|
||||
version: @version@
|
||||
sentinel:
|
||||
url: @sentinel.url@
|
||||
gateway:
|
||||
url: @gateway.url@
|
||||
server:
|
||||
port: 10207
|
||||
#feign接口开启服务熔断降级处理
|
||||
feign:
|
||||
sentinel:
|
||||
enabled: true
|
||||
spring:
|
||||
application:
|
||||
name: @artifactId@
|
||||
#nacos注册中心以及配置中心的指定
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
config:
|
||||
server-addr: @nacos.url@
|
||||
namespace: @nacos.namespace@
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- data-id: share-config.yaml
|
||||
refresh: true
|
||||
- data-Id: share-config-datasource-db.yaml
|
||||
refresh: true
|
||||
main:
|
||||
allow-bean-definition-overriding: true
|
||||
|
||||
|
||||
|
||||
#项目日志的配置
|
||||
logging:
|
||||
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
|
||||
level:
|
||||
root: info
|
||||
|
||||
#mybatis配置信息
|
||||
mybatis-plus:
|
||||
#别名扫描
|
||||
type-aliases-package: com.njcn.system.pojo
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.njcn;
|
||||
|
||||
import com.njcn.system.SystemBootMain;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import org.springframework.test.context.web.WebAppConfiguration;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月10日 15:05
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@WebAppConfiguration
|
||||
@SpringBootTest(classes = SystemBootMain.class)
|
||||
public class BaseJunitTest {
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn;
|
||||
|
||||
import com.njcn.system.service.IDictTypeService;
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2021年12月14日 12:55
|
||||
*/
|
||||
public class DictDataTest extends BaseJunitTest{
|
||||
|
||||
@Autowired
|
||||
private IDictTypeService dictTypeService;
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
dictTypeService.dictDataCache();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user