成立单独的冀北技术监督项目

This commit is contained in:
2024-05-09 18:33:14 +08:00
parent e2a44def09
commit f9bec14719
11 changed files with 367 additions and 0 deletions

View File

@@ -21,6 +21,9 @@
<module>pqs-prepare</module>
<module>pqs-process</module>
<module>pqs-influx</module>
<module>pqs-bpm</module>
<module>pqs-supervision</module>
</modules>
<packaging>pom</packaging>
<name>灿能微服务生态系统</name>

View File

@@ -179,6 +179,14 @@ spring:
filters:
- SwaggerHeaderFilter
- StripPrefix=1
- id: supervision-boot
uri: lb://supervision-boot
predicates:
- Path=/supervision-boot/**
filters:
- SwaggerHeaderFilter
- StripPrefix=1
#项目日志的配置
logging:
config: http://@nacos.url@/nacos/v1/cs/configs?tenant=@nacos.namespace@&group=DEFAULT_GROUP&dataId=logback.xml
@@ -221,6 +229,7 @@ whitelist:
- /process-boot/**
- /bpm-boot/**
- /system-boot/**
- /supervision-boot/**
- /user-boot/**
- /user-boot/user/listAllUserByDeptId

25
pqs-supervision/pom.xml Normal file
View File

@@ -0,0 +1,25 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.njcn</groupId>
<artifactId>pqs</artifactId>
<version>1.0.0</version>
</parent>
<modules>
<module>supervision-api</module>
<module>supervision-boot</module>
</modules>
<packaging>pom</packaging>
<artifactId>pqs-supervision</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

View File

@@ -0,0 +1,43 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.njcn</groupId>
<artifactId>pqs-supervision</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>supervision-api</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</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>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-poi</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,29 @@
package com.njcn.supervision.enums;
import lombok.Getter;
/**
* 异常处理类
* @author qijian
* @version 1.0.0
* @date 2022年11月11日 09:56
*/
@Getter
public enum SupervisionResponseEnum {
/**
* 过程监督异常响应码的范围:
* A00550 ~ A00649
*/
SUPERVISION_COMMON_ERROR("A00550","监督管理模块异常"),
;
private final String code;
private final String message;
SupervisionResponseEnum(String code, String message) {
this.code = code;
this.message = message;
}
}

View File

@@ -0,0 +1,44 @@
package com.njcn.supervision.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.supervision.enums.SupervisionResponseEnum;
import javax.validation.constraints.NotNull;
import java.util.Objects;
/**
* @author hongawen
* @version 1.0.0
* @date 2021年12月20日 10:03
*/
public class SupervisionEnumUtil {
public static SupervisionResponseEnum getHarmonicEnumResponseEnumByMessage(@NotNull Object value) {
SupervisionResponseEnum harmonicResponseEnum;
try {
String message = value.toString();
if(message.indexOf(StrUtil.C_COMMA)>0){
value = message.substring(message.indexOf(StrUtil.C_COMMA)+1);
}
harmonicResponseEnum = EnumUtils.valueOf(SupervisionResponseEnum.class, value, SupervisionResponseEnum.class.getMethod(BusinessException.GET_MESSAGE_METHOD));
return Objects.isNull(harmonicResponseEnum) ? SupervisionResponseEnum.SUPERVISION_COMMON_ERROR : harmonicResponseEnum;
} 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.DEVICE_RESPONSE_ENUM) {
return getHarmonicEnumResponseEnumByMessage(result.getMessage());
}
return commonResponseEnum;
}
}

View File

@@ -0,0 +1,94 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.njcn</groupId>
<artifactId>pqs-supervision</artifactId>
<version>1.0.0</version>
</parent>
<artifactId>supervision-boot</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>supervision-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.njcn</groupId>
<artifactId>common-web</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<finalName>supervision-boot</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<compilerArgument>-Xlint:unchecked</compilerArgument>
</configuration>
</plugin>
<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>

View File

@@ -0,0 +1,24 @@
package com.njcn.supervision;
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;
import org.springframework.context.annotation.DependsOn;
/**
* @author hongawen
* @version 1.0.0
* @createTime 2021年05月14日 15:14
*/
@Slf4j
@DependsOn("proxyMapperRegister")
@MapperScan("com.njcn.**.mapper")
@EnableFeignClients(basePackages = "com.njcn")
@SpringBootApplication(scanBasePackages = "com.njcn")
public class SupervisionBootMain {
public static void main(String[] args) {
SpringApplication.run(SupervisionBootMain.class, args);
}
}

View File

@@ -0,0 +1,20 @@
package com.njcn.supervision.mapper.user;
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.supervision.pojo.po.user.UserReportPO;
import com.njcn.supervision.pojo.vo.user.UserReportVO;
import org.apache.ibatis.annotations.Param;
/**
*
* Description:
* Date: 2024/4/25 10:07【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface UserReportPOMapper extends BaseMapper<UserReportPO> {
Page<UserReportVO> page(@Param("page")Page<Object> objectPage, @Param("ew") QueryWrapper<UserReportVO> userReportVOQueryWrapper);
}

View File

@@ -0,0 +1,28 @@
package com.njcn.supervision.service.user;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njcn.supervision.pojo.param.user.UserReportParam;
import com.njcn.supervision.pojo.po.user.UserReportPO;
import com.njcn.supervision.pojo.vo.user.UserReportVO;
import java.util.List;
/**
* Description:
* Date: 2024/4/25 10:07【需求编号】
*
* @author clam
* @version V1.0.0
*/
public interface UserReportPOService extends IService<UserReportPO> {
boolean addUserReport(UserReportParam userReportParam);
boolean auditUserReport(UserReportParam.UserReportUpdate userReportUpdate);
Page<UserReportVO> getUserReport(UserReportParam.UserReportQueryParam userReportQueryParam);
Boolean removeUserReport(List<String> ids);
}

View File

@@ -0,0 +1,48 @@
#当前服务的基本信息
microservice:
ename: @artifactId@
name: '@name@'
version: @version@
sentinel:
url: @sentinel.url@
gateway:
url: @gateway.url@
server:
port: 10232
max-http-header-size: 1048576
#feign接口开启服务熔断降级处理
feign:
sentinel:
enabled: true
spring:
application:
name: @artifactId@
#nacos注册中心以及配置中心的指定
cloud:
nacos:
discovery:
ip: @service.server.url@
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.supervision.pojo
mqtt:
client-id: @artifactId@${random.value}