commit
943eb167e2
2344 changed files with 233128 additions and 0 deletions
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
# For Java |
||||
*.lck |
||||
target/ |
||||
*.json |
||||
log/ |
||||
logback-test.xml |
||||
|
||||
|
||||
# Compiled class file |
||||
*.class |
||||
|
||||
# Log file |
||||
*.log |
||||
|
||||
# BlueJ files |
||||
*.ctxt |
||||
|
||||
# Mobile Tools for Java (J2ME) |
||||
.mtj.tmp/ |
||||
|
||||
# Package Files # |
||||
|
||||
*.war |
||||
*.nar |
||||
*.ear |
||||
*.zip |
||||
*.tar.gz |
||||
*.rar |
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
||||
hs_err_pid* |
||||
|
||||
# Image snapshot diff |
||||
__diff_output__/ |
||||
/jest-stare |
||||
|
||||
*.iml |
||||
.idea/ |
||||
.ipr |
||||
.iws |
||||
*~ |
||||
~* |
||||
*.diff |
||||
*.patch |
||||
*.bak |
||||
.DS_Store |
||||
Thumbs.db |
||||
.project |
||||
.*proj |
||||
.svn/ |
||||
*.swp |
||||
*.swo |
||||
*.log.* |
||||
*.json.gzip |
||||
node_modules/ |
||||
.buildpath |
||||
.settings |
||||
!**/resources/dist |
||||
npm-debug.log |
||||
nohup.out |
||||
_site |
||||
_data |
||||
report.html |
||||
/lib |
||||
/es |
||||
#elasticsearch-* |
||||
config/base.yaml |
||||
/.vscode/ |
||||
/coverage |
||||
/.history |
||||
*.tmp |
||||
!**/nacos-server/target/** |
||||
!**/seata-server/lib/** |
||||
**/nacos-server/data/* |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-app |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-app/jnpf-app-server/target/*.jar ./jnpf-app.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30012 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-app.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-extend |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-extend/jnpf-extend-server/target/*.jar ./jnpf-extend.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30019 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-extend.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-file |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-file/jnpf-file-server/target/*.jar ./jnpf-file.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30005 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-file.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-form |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-form/jnpf-form-server/target/*.jar ./jnpf-form.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30013 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-form.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-gateway |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-gateway/target/*.jar ./jnpf-gateway.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30000 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-gateway.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-message |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-message/jnpf-message-server/target/*.jar ./jnpf-message.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30008 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-message.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-oauth |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-oauth/jnpf-oauth-server/target/*.jar ./jnpf-oauth.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30001 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-oauth.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u362-b09-jre |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-permission |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-permission/jnpf-permission-server/target/*.jar ./jnpf-permission.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30010 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-permission.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-scheduletask |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-scheduletask/jnpf-scheduletask-server/target/*.jar ./jnpf-scheduletask.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30009 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-scheduletask.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-system |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-system/jnpf-system-server/target/*.jar ./jnpf-system.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30002 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-system.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-visualdata |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-visualdata/jnpf-visualdata-server/target/*.jar ./jnpf-visualdata.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30011 |
||||
|
||||
# 指定容器启动时要运行的命令 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-visualdata.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-visualdev |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-visualdev/jnpf-visualdev-server/target/*.jar ./jnpf-visualdev.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30003 |
||||
|
||||
# 启动服务 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-visualdev.jar"] |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 基础镜像 |
||||
FROM eclipse-temurin:8u392-b08-jre-centos7 |
||||
LABEL maintainer=jnpf-team |
||||
|
||||
# 设置时区 |
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \ |
||||
&& echo 'Asia/Shanghai' >/etc/timezone |
||||
|
||||
# 解决连接SQLServer安全错误 |
||||
# 如您使用SQLServer数据库,把以下注释取消 |
||||
# COPY security/java.security /opt/java/openjdk/lib/security |
||||
|
||||
# 指定运行时的工作目录 |
||||
WORKDIR /wwwroot/jnpfsoft/jnpf-server/jnpf-workflow |
||||
|
||||
# 将构建产物jar包拷贝到运行时目录中 |
||||
COPY jnpf-workflow/jnpf-workflow-server/target/*.jar ./jnpf-workflow.jar |
||||
|
||||
# 指定容器内运行端口 |
||||
EXPOSE 30004 |
||||
|
||||
# 启动服务 |
||||
ENTRYPOINT ["/bin/sh","-c","java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar jnpf-workflow.jar"] |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
<?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>jnpf-app</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-app-api</artifactId> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-app-entity</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-feign</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
package jnpf.app; |
||||
|
||||
import jnpf.app.fallback.AppApiFallback; |
||||
import jnpf.entity.AppDataEntity; |
||||
import jnpf.utils.FeignName; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
|
||||
@FeignClient(name = FeignName.APP_SERVER_NAME, fallback = AppApiFallback.class, path = "/Data") |
||||
public interface AppApi { |
||||
|
||||
/** |
||||
* 删除app常用数据 |
||||
* |
||||
* @return |
||||
*/ |
||||
@GetMapping("/deleObject/{id}") |
||||
void deleObject(@PathVariable("id") String id); |
||||
|
||||
/** |
||||
* 获取常用菜单信息 |
||||
* |
||||
* @return |
||||
*/ |
||||
@GetMapping("/getInfo") |
||||
AppDataEntity getData(@RequestParam("id") String id); |
||||
|
||||
/** |
||||
* 修改常用菜单 |
||||
* |
||||
* @return |
||||
*/ |
||||
@PutMapping("/updateData") |
||||
void updateData(@RequestBody AppDataEntity appDataEntity); |
||||
|
||||
} |
||||
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
package jnpf.app.fallback; |
||||
|
||||
import jnpf.app.AppApi; |
||||
import jnpf.entity.AppDataEntity; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
/** |
||||
* api接口 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021/3/15 11:55 |
||||
*/ |
||||
@Component |
||||
@Slf4j |
||||
public class AppApiFallback implements AppApi { |
||||
|
||||
@Override |
||||
public void deleObject(String id) { |
||||
|
||||
} |
||||
|
||||
@Override |
||||
public AppDataEntity getData(String id) { |
||||
return null; |
||||
} |
||||
|
||||
@Override |
||||
public void updateData(AppDataEntity appDataEntity) { |
||||
|
||||
} |
||||
} |
||||
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
<?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>jnpf-app</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-app-biz</artifactId> |
||||
<dependencies> |
||||
<!-- data模块 --> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-database</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-app-entity</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-permission-api</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-system-api</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-workflow-engine-api</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-file</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
||||
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
package jnpf.mapper; |
||||
|
||||
import jnpf.base.mapper.SuperMapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import jnpf.entity.AppDataEntity; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
public interface AppDataMapper extends SuperMapper<AppDataEntity> { |
||||
|
||||
} |
||||
@ -0,0 +1,89 @@
@@ -0,0 +1,89 @@
|
||||
package jnpf.service; |
||||
|
||||
import jnpf.base.service.SuperService; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.engine.model.flowengine.FlowPagination; |
||||
import jnpf.entity.AppDataEntity; |
||||
import jnpf.model.AppDataListAllVO; |
||||
import jnpf.model.AppFlowListAllVO; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
public interface AppDataService extends SuperService<AppDataEntity> { |
||||
|
||||
/** |
||||
* 列表 |
||||
* |
||||
* @param type 类型 |
||||
* @return |
||||
*/ |
||||
List<AppDataEntity> getList(String type); |
||||
|
||||
/** |
||||
* 列表 |
||||
* |
||||
* @return |
||||
*/ |
||||
List<AppDataEntity> getList(); |
||||
|
||||
/** |
||||
* 信息 |
||||
* |
||||
* @param objectId 对象主键 |
||||
* @return |
||||
*/ |
||||
AppDataEntity getInfo(String objectId); |
||||
|
||||
/** |
||||
* 验证名称 |
||||
* |
||||
* @param objectId 对象主键 |
||||
* @return |
||||
*/ |
||||
boolean isExistByObjectId(String objectId, String systemId); |
||||
|
||||
/** |
||||
* 创建 |
||||
* |
||||
* @param entity 实体对象 |
||||
*/ |
||||
void create(AppDataEntity entity); |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param entity 实体对象 |
||||
*/ |
||||
void delete(AppDataEntity entity); |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param objectId 应用主键 |
||||
*/ |
||||
void delete(String objectId); |
||||
|
||||
/** |
||||
* 流程所有应用 |
||||
* |
||||
* @param pagination |
||||
* @return |
||||
*/ |
||||
List<AppFlowListAllVO> getFlowList(FlowPagination pagination); |
||||
|
||||
/** |
||||
* 流程所有应用 |
||||
* @param type 类型 |
||||
* @return |
||||
*/ |
||||
List<AppDataListAllVO> getDataList(String type); |
||||
|
||||
} |
||||
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
package jnpf.service; |
||||
|
||||
import jnpf.model.AppUserInfoVO; |
||||
import jnpf.model.AppUsersVO; |
||||
|
||||
/** |
||||
* app用户信息 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
public interface AppService { |
||||
|
||||
/** |
||||
* app用户信息 |
||||
* @return |
||||
*/ |
||||
AppUsersVO userInfo(); |
||||
|
||||
/** |
||||
* 通讯录 |
||||
* @return |
||||
*/ |
||||
AppUserInfoVO getInfo(String id); |
||||
|
||||
} |
||||
@ -0,0 +1,188 @@
@@ -0,0 +1,188 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import jnpf.base.service.SuperServiceImpl; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import jnpf.base.ModuleApi; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.base.entity.ModuleEntity; |
||||
import jnpf.base.model.module.ModuleModel; |
||||
import jnpf.base.vo.PageListVO; |
||||
import jnpf.base.vo.PaginationVO; |
||||
import jnpf.engine.FlowTaskApi; |
||||
import jnpf.engine.entity.FlowTemplateEntity; |
||||
import jnpf.engine.model.flowengine.FlowPagination; |
||||
import jnpf.entity.AppDataEntity; |
||||
import jnpf.mapper.AppDataMapper; |
||||
import jnpf.model.AppDataListAllVO; |
||||
import jnpf.model.AppFlowListAllVO; |
||||
import jnpf.model.UserMenuModel; |
||||
import jnpf.permission.AuthorizeApi; |
||||
import jnpf.permission.model.authorize.AuthorizeVO; |
||||
import jnpf.service.AppDataService; |
||||
import jnpf.util.JsonUtil; |
||||
import jnpf.util.RandomUtil; |
||||
import jnpf.util.StringUtil; |
||||
import jnpf.util.UserProvider; |
||||
import jnpf.util.treeutil.SumTree; |
||||
import jnpf.util.treeutil.newtreeutil.TreeDotUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.LinkedList; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
@Service |
||||
public class AppDataServiceImpl extends SuperServiceImpl<AppDataMapper, AppDataEntity> implements AppDataService { |
||||
|
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
@Autowired |
||||
private ModuleApi moduleApi; |
||||
@Autowired |
||||
private AuthorizeApi authorizeApi; |
||||
@Autowired |
||||
private FlowTaskApi flowTaskApi; |
||||
|
||||
@Override |
||||
public List<AppDataEntity> getList(String type) { |
||||
UserInfo userInfo = userProvider.get(); |
||||
QueryWrapper<AppDataEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(AppDataEntity::getObjectType, type).eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()); |
||||
if ("2".equals(type)) { |
||||
List<String> moduleEntities = menuList().stream().map(ModuleModel::getId).collect(Collectors.toList()); |
||||
if (moduleEntities.size() == 0) { |
||||
return new ArrayList<>(); |
||||
} |
||||
queryWrapper.lambda().in(AppDataEntity::getObjectId, moduleEntities); |
||||
} |
||||
List<AppDataEntity> list = this.list(queryWrapper); |
||||
list = list.stream().filter(t -> StringUtil.isNotEmpty(t.getSystemId()) && t.getSystemId().equals(userInfo.getAppSystemId())).collect(Collectors.toList()); |
||||
List<String> idAll = list.stream().map(AppDataEntity::getObjectId).collect(Collectors.toList()); |
||||
List<FlowTemplateEntity> templateList = flowTaskApi.getTemplateList(idAll).stream().filter(t -> t.getEnabledMark() == 1).collect(Collectors.toList()); |
||||
for (int i = 0; i < list.size(); i++) { |
||||
AppDataEntity appDataEntity = list.get(i); |
||||
if ("2".equals(type)) { |
||||
ModuleEntity info = moduleApi.getModuleByList(appDataEntity.getObjectId()); |
||||
if (info == null || info.getEnabledMark() == 0) { |
||||
list.remove(i); |
||||
i--; |
||||
} |
||||
} else { |
||||
FlowTemplateEntity templateEntity = templateList.stream().filter(t -> t.getId().equals(appDataEntity.getObjectId())).findFirst().orElse(null); |
||||
if (templateEntity == null) { |
||||
list.remove(i); |
||||
i--; |
||||
} |
||||
} |
||||
} |
||||
return list; |
||||
} |
||||
|
||||
@Override |
||||
public List<AppDataEntity> getList() { |
||||
QueryWrapper<AppDataEntity> queryWrapper = new QueryWrapper<>(); |
||||
return this.list(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public AppDataEntity getInfo(String objectId) { |
||||
UserInfo userInfo = userProvider.get(); |
||||
QueryWrapper<AppDataEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId).eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()); |
||||
return this.getOne(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public boolean isExistByObjectId(String objectId, String systemId) { |
||||
UserInfo userInfo = userProvider.get(); |
||||
QueryWrapper<AppDataEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId) |
||||
.eq(AppDataEntity::getCreatorUserId, userInfo.getUserId()) |
||||
.eq(AppDataEntity::getSystemId, systemId); |
||||
return this.count(queryWrapper) > 0 ? true : false; |
||||
} |
||||
|
||||
@Override |
||||
public void create(AppDataEntity entity) { |
||||
UserInfo userInfo = userProvider.get(); |
||||
entity.setId(RandomUtil.uuId()); |
||||
entity.setCreatorUserId(userInfo.getUserId()); |
||||
entity.setCreatorTime(new Date()); |
||||
entity.setEnabledMark(1); |
||||
entity.setSystemId(userInfo.getAppSystemId()); |
||||
this.save(entity); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(AppDataEntity entity) { |
||||
this.removeById(entity.getId()); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(String objectId) { |
||||
QueryWrapper<AppDataEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(AppDataEntity::getObjectId, objectId); |
||||
this.remove(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public List<AppFlowListAllVO> getFlowList(FlowPagination pagination) { |
||||
List<String> objectId = getList("1").stream().map(AppDataEntity::getObjectId).collect(Collectors.toList());; |
||||
PageListVO pageModel = flowTaskApi.getListAll(pagination); |
||||
List<FlowTemplateEntity> taskList = JsonUtil.getJsonToList(pageModel.getList(),FlowTemplateEntity.class); |
||||
PaginationVO paginaModel = pageModel.getPagination(); |
||||
List<AppFlowListAllVO> result = new ArrayList<>(); |
||||
for (FlowTemplateEntity entity : taskList) { |
||||
AppFlowListAllVO vo = JsonUtil.getJsonToBean(entity, AppFlowListAllVO.class); |
||||
vo.setIsData(objectId.contains(vo.getId())); |
||||
result.add(vo); |
||||
} |
||||
return pagination.setData(result, paginaModel.getTotal()); |
||||
} |
||||
|
||||
@Override |
||||
public List<AppDataListAllVO> getDataList(String type) { |
||||
List<AppDataEntity> dataList = getList(type); |
||||
AuthorizeVO authorizeModel = authorizeApi.getAuthorize(true, false); |
||||
List<ModuleModel> buttonList = authorizeModel.getModuleList(); |
||||
List<ModuleModel> menuList = menuList(); |
||||
List<UserMenuModel> list = new LinkedList<>(); |
||||
for (ModuleModel module : menuList) { |
||||
boolean count = buttonList.stream().filter(t -> t.getId().equals(module.getId())).count() > 0; |
||||
UserMenuModel userMenuModel = JsonUtil.getJsonToBean(module, UserMenuModel.class); |
||||
if (count) { |
||||
boolean isData = dataList.stream().filter(t -> t.getObjectId().equals(module.getId())).count() > 0; |
||||
userMenuModel.setIsData(isData); |
||||
list.add(userMenuModel); |
||||
} |
||||
} |
||||
List<SumTree<UserMenuModel>> menuAll = TreeDotUtils.convertListToTreeDot(list); |
||||
List<AppDataListAllVO> menuListAll = JsonUtil.getJsonToList(menuAll, AppDataListAllVO.class); |
||||
List<AppDataListAllVO> data = new LinkedList<>(); |
||||
for (AppDataListAllVO appMenu : menuListAll) { |
||||
if ("-1".equals(appMenu.getParentId())) { |
||||
data.add(appMenu); |
||||
} |
||||
} |
||||
return data; |
||||
} |
||||
|
||||
private List<ModuleModel> menuList() { |
||||
String appSystemId = userProvider.get().getAppSystemId(); |
||||
AuthorizeVO authorizeModel = authorizeApi.getAuthorizeByUser(false); |
||||
List<ModuleModel> menuList = authorizeModel.getModuleList().stream().filter(t -> "App".equals(t.getCategory()) && t.getSystemId().equals(appSystemId)).collect(Collectors.toList()); |
||||
return menuList; |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,156 @@
@@ -0,0 +1,156 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import cn.hutool.core.collection.ListUtil; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.model.AppPositionVO; |
||||
import jnpf.model.AppUserInfoVO; |
||||
import jnpf.model.AppUsersVO; |
||||
import jnpf.permission.*; |
||||
import jnpf.permission.entity.*; |
||||
import jnpf.service.AppService; |
||||
import jnpf.util.*; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.*; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* app用户信息 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
@Service |
||||
public class AppServiceImpl implements AppService { |
||||
|
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
@Autowired |
||||
private RedisUtil redisUtil; |
||||
@Autowired |
||||
private UserApi userApi; |
||||
@Autowired |
||||
private PositionApi positionApi; |
||||
@Autowired |
||||
private OrganizeApi organizeApi; |
||||
@Autowired |
||||
private RoleApi roleApi; |
||||
@Autowired |
||||
private UserRelationApi userRelationApi; |
||||
|
||||
@Override |
||||
public AppUsersVO userInfo() { |
||||
UserInfo userInfo = userProvider.get(); |
||||
UserEntity userEntity = userApi.getInfoById(userInfo.getUserId()); |
||||
AppUsersVO usersVO = new AppUsersVO(); |
||||
usersVO.setBirthday(userEntity.getBirthday() != null ? userEntity.getBirthday().getTime() : null); |
||||
usersVO.setEmail(userEntity.getEmail()); |
||||
usersVO.setGender(userEntity.getGender()); |
||||
usersVO.setMobilePhone(userEntity.getMobilePhone()); |
||||
this.data(usersVO, userEntity, userInfo); |
||||
this.userInfo(usersVO, userInfo); |
||||
//岗位
|
||||
PositionEntity position = positionApi.queryInfoById(userEntity.getPositionId()); |
||||
AppPositionVO positionVO = new AppPositionVO(); |
||||
if(position != null){ |
||||
positionVO.setId(position.getId()); |
||||
positionVO.setName(position.getFullName()); |
||||
usersVO.setPositionIds(ListUtil.toList(positionVO)); |
||||
} |
||||
//直属主管
|
||||
if(StringUtil.isNotEmpty(userEntity.getManagerId())){ |
||||
UserEntity menager = userApi.getInfoById(userEntity.getManagerId()); |
||||
usersVO.setManager(menager != null ? menager.getRealName() + "/" + menager.getAccount() : ""); |
||||
} |
||||
//角色
|
||||
List<String> roles = roleApi.getAllRoleIdsByUserIdAndOrgId(userInfo.getUserId(), usersVO.getOrganizeId()); |
||||
List<RoleEntity> roleList = roleApi.getListByIds(roles); |
||||
usersVO.setRoleName(String.join(",", roleList.stream().map(RoleEntity::getFullName).collect(Collectors.toList()))); |
||||
usersVO.setRoleId(String.join(".", roleList.stream().map(RoleEntity::getId).collect(Collectors.toList()))); |
||||
return usersVO; |
||||
} |
||||
|
||||
@Override |
||||
public AppUserInfoVO getInfo(String id) { |
||||
AppUserInfoVO userInfoVO = new AppUserInfoVO(); |
||||
UserEntity entity = userApi.getInfoById(id); |
||||
if (entity != null) { |
||||
userInfoVO = JsonUtil.getJsonToBean(entity, AppUserInfoVO.class); |
||||
List<String> positionIds = StringUtil.isNotEmpty(entity.getPositionId()) ? Arrays.asList(entity.getPositionId().split(",")) : new ArrayList<>(); |
||||
List<String> positionName = positionApi.getPositionName(positionIds, false).stream().map(t -> t.getFullName()).collect(Collectors.toList()); |
||||
userInfoVO.setPositionName(String.join(",", positionName)); |
||||
OrganizeEntity info = organizeApi.getInfoById(entity.getOrganizeId()); |
||||
userInfoVO.setOrganizeName(info != null ? info.getFullName() : ""); |
||||
userInfoVO.setHeadIcon(UploaderUtil.uploaderImg(userInfoVO.getHeadIcon())); |
||||
} |
||||
return userInfoVO; |
||||
} |
||||
/** |
||||
* 赋值 |
||||
* |
||||
* @param userInfo |
||||
* @param userId |
||||
* @param isAdmin |
||||
*/ |
||||
private void userInfo(UserInfo userInfo, String userId, boolean isAdmin,UserEntity userEntity) { |
||||
List<String> userIdList = new ArrayList(){{add(userId);}}; |
||||
List<UserRelationEntity> data = userRelationApi.getListByUserIdAll(userIdList); |
||||
//获取一个字段的值
|
||||
List<String> positionList = data.stream().filter(m -> "Position".equals(m.getObjectType())).map(t -> t.getObjectId()).collect(Collectors.toList()); |
||||
Set<String> id = new LinkedHashSet<>(); |
||||
String[] position = StringUtil.isNotEmpty(userEntity.getPositionId()) ? userEntity.getPositionId().split(",") : new String[]{}; |
||||
List<String> positions = positionList.stream().filter(t->Arrays.asList(position).contains(t)).collect(Collectors.toList()); |
||||
id.addAll(positions); |
||||
id.addAll(positionList); |
||||
userInfo.setPositionIds(id.toArray(new String[id.size()])); |
||||
if (!isAdmin) { |
||||
data = data.stream().filter(m -> "Role".equals(m.getObjectType())).collect(Collectors.toList()); |
||||
} |
||||
List<String> roleList = data.stream().map(t -> t.getObjectId()).collect(Collectors.toList()); |
||||
userInfo.setRoleIds(roleList); |
||||
} |
||||
|
||||
private void data(AppUsersVO usersVO, UserEntity userEntity, UserInfo userInfo) { |
||||
//组织
|
||||
usersVO.setOrganizeId(userEntity.getOrganizeId()); |
||||
List<OrganizeEntity> organizeIdList = organizeApi.getOrganizeId(userEntity.getOrganizeId()); |
||||
Collections.reverse(organizeIdList); |
||||
usersVO.setOrganizeName(organizeIdList.stream().map(OrganizeEntity::getFullName).collect(Collectors.joining("/"))); |
||||
OrganizeEntity organizeEntity = organizeIdList.stream().filter(t->t.getId().equals(userEntity.getOrganizeId())).findFirst().orElse(null); |
||||
if (organizeEntity != null) { |
||||
String[] organizeId = StringUtil.isNotEmpty(organizeEntity.getOrganizeIdTree()) ? organizeEntity.getOrganizeIdTree().split(",") : new String[]{}; |
||||
if (organizeId.length > 0) { |
||||
userInfo.setOrganizeId(organizeId[0]); |
||||
userInfo.setDepartmentId(organizeId[organizeId.length - 1]); |
||||
} |
||||
} |
||||
userInfo.setManagerId(userInfo.getManagerId()); |
||||
boolean b = userInfo.getIsAdministrator(); |
||||
List<String> subordinateIdsList = userApi.getListByManagerId(userInfo.getUserId()).stream().map(UserEntity::getId).collect(Collectors.toList()); |
||||
userInfo.setSubordinateIds(subordinateIdsList); |
||||
this.userInfo(userInfo, userInfo.getUserId(), b,userEntity); |
||||
userInfo.setSubOrganizeIds(new String[]{}); |
||||
//redisUtil.insert(userInfo.getId(), userInfo, DateUtil.getTime(userInfo.getOverdueTime()) - DateUtil.getTime(new Date()));
|
||||
UserProvider.setLoginUser(userInfo); |
||||
UserProvider.setLocalLoginUser(userInfo); |
||||
} |
||||
|
||||
/** |
||||
* 登录信息 |
||||
* |
||||
* @param appUsersVO 返回对象 |
||||
* @param userInfo 回话信息 |
||||
* @return |
||||
*/ |
||||
private void userInfo(AppUsersVO appUsersVO, UserInfo userInfo) { |
||||
appUsersVO.setUserId(userInfo.getUserId()); |
||||
appUsersVO.setHeadIcon(UploaderUtil.uploaderImg(userInfo.getUserIcon())); |
||||
appUsersVO.setUserName(userInfo.getUserName()); |
||||
appUsersVO.setUserAccount(userInfo.getUserAccount()); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
<?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>jnpf-app</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-app-controller</artifactId> |
||||
<dependencies> |
||||
<!--导入aop--> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-springaop</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-app-biz</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-app-api</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
||||
@ -0,0 +1,162 @@
@@ -0,0 +1,162 @@
|
||||
package jnpf.controller; |
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.Parameters; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import jnpf.app.AppApi; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.controller.SuperController; |
||||
import jnpf.base.vo.ListVO; |
||||
import jnpf.base.vo.PageListVO; |
||||
import jnpf.base.vo.PaginationVO; |
||||
import jnpf.constant.MsgCode; |
||||
import jnpf.engine.model.flowengine.FlowPagination; |
||||
import jnpf.entity.AppDataEntity; |
||||
import jnpf.model.AppDataCrForm; |
||||
import jnpf.model.AppDataListAllVO; |
||||
import jnpf.model.AppDataListVO; |
||||
import jnpf.model.AppFlowListAllVO; |
||||
import jnpf.service.AppDataService; |
||||
import jnpf.util.JsonUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Tag(name = "app常用数据", description = "data") |
||||
@RestController |
||||
@RequestMapping("/Data") |
||||
public class AppDataController extends SuperController<AppDataService, AppDataEntity> implements AppApi { |
||||
|
||||
@Autowired |
||||
private AppDataService appDataService; |
||||
|
||||
/** |
||||
* 常用数据 |
||||
* |
||||
* @param type 类型 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "常用数据") |
||||
@GetMapping |
||||
@Parameters({ |
||||
@Parameter(name = "type", description = "类型"), |
||||
}) |
||||
public ActionResult<ListVO<AppDataListVO>> list(@RequestParam("type") String type) { |
||||
List<AppDataEntity> list = appDataService.getList(type); |
||||
List<AppDataListVO> data = JsonUtil.getJsonToList(list, AppDataListVO.class); |
||||
ListVO listVO = new ListVO(); |
||||
listVO.setList(data); |
||||
return ActionResult.success(listVO); |
||||
} |
||||
|
||||
/** |
||||
* 新建 |
||||
* |
||||
* @param appDataCrForm 新建模型 |
||||
* @return |
||||
*/ |
||||
@PostMapping |
||||
@Operation(summary = "新建") |
||||
@Parameters({ |
||||
@Parameter(name = "appDataCrForm", description = "常用模型",required = true), |
||||
}) |
||||
public ActionResult create(@RequestBody @Valid AppDataCrForm appDataCrForm) { |
||||
AppDataEntity entity = JsonUtil.getJsonToBean(appDataCrForm, AppDataEntity.class); |
||||
if (appDataService.isExistByObjectId(entity.getObjectId(), appDataCrForm.getSystemId())) |
||||
return ActionResult.fail(MsgCode.FA036.get()); |
||||
appDataService.create(entity); |
||||
return ActionResult.success(MsgCode.SU001.get()); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param objectId 主键 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "删除") |
||||
@DeleteMapping("/{objectId}") |
||||
@Parameters({ |
||||
@Parameter(name = "objectId", description = "主键", required = true), |
||||
}) |
||||
public ActionResult create(@PathVariable("objectId") String objectId) { |
||||
AppDataEntity entity = appDataService.getInfo(objectId); |
||||
if (entity != null) { |
||||
appDataService.delete(entity); |
||||
return ActionResult.success(MsgCode.SU003.get()); |
||||
} |
||||
return ActionResult.fail(MsgCode.FA003.get()); |
||||
} |
||||
|
||||
/** |
||||
* 所有流程 |
||||
* |
||||
* @param pagination 分页模型 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "所有流程") |
||||
@GetMapping("/getFlowList") |
||||
public ActionResult<PageListVO<AppFlowListAllVO>> getFlowList(FlowPagination pagination) { |
||||
List<AppFlowListAllVO> list = appDataService.getFlowList(pagination); |
||||
PaginationVO paginationVO = JsonUtil.getJsonToBean(pagination, PaginationVO.class); |
||||
return ActionResult.page(list, paginationVO); |
||||
} |
||||
|
||||
/** |
||||
* 所有应用 |
||||
* |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "所有应用") |
||||
@GetMapping("/getDataList") |
||||
public ActionResult<ListVO<AppDataListAllVO>> getAllList() { |
||||
List<AppDataListAllVO> result = appDataService.getDataList("2"); |
||||
ListVO listVO = new ListVO(); |
||||
listVO.setList(result); |
||||
return ActionResult.success(listVO); |
||||
} |
||||
|
||||
/** |
||||
* 删除app常用数据 |
||||
* |
||||
* @param id 主键 |
||||
*/ |
||||
@Override |
||||
@GetMapping("/deleObject/{id}") |
||||
public void deleObject(@PathVariable("id") String id) { |
||||
appDataService.delete(id); |
||||
} |
||||
|
||||
/** |
||||
* 删除app常用数据 |
||||
* |
||||
* @param id 主键 |
||||
*/ |
||||
@Override |
||||
@GetMapping("/getInfo") |
||||
public AppDataEntity getData(@RequestParam("id") String id) { |
||||
return appDataService.getInfo(id); |
||||
} |
||||
|
||||
/** |
||||
* 修改常用菜单 |
||||
* |
||||
* @param appDataEntity 修改常用菜单实体 |
||||
*/ |
||||
@Override |
||||
@PutMapping("/updateData") |
||||
public void updateData(@RequestBody AppDataEntity appDataEntity) { |
||||
appDataService.updateById(appDataEntity); |
||||
} |
||||
} |
||||
@ -0,0 +1,74 @@
@@ -0,0 +1,74 @@
|
||||
package jnpf.controller; |
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.ModuleApi; |
||||
import jnpf.base.Page; |
||||
import jnpf.base.model.module.ModuleModel; |
||||
import jnpf.base.vo.ListVO; |
||||
import jnpf.model.AppMenuListVO; |
||||
import jnpf.model.UserMenuModel; |
||||
import jnpf.permission.AuthorizeApi; |
||||
import jnpf.permission.model.authorize.AuthorizeVO; |
||||
import jnpf.util.JsonUtil; |
||||
import jnpf.util.StringUtil; |
||||
import jnpf.util.UserProvider; |
||||
import jnpf.util.treeutil.ListToTreeUtil; |
||||
import jnpf.util.treeutil.SumTree; |
||||
import jnpf.util.treeutil.newtreeutil.TreeDotUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* app应用 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Tag(name = "app应用", description = "Menu") |
||||
@RestController |
||||
@RequestMapping("/Menu") |
||||
public class AppMenuController { |
||||
|
||||
@Autowired |
||||
private ModuleApi moduleApi; |
||||
@Autowired |
||||
private AuthorizeApi authorizeApi; |
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
|
||||
/** |
||||
* 获取菜单列表 |
||||
* |
||||
* @param page 分页模型 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "获取菜单列表") |
||||
@GetMapping |
||||
public ActionResult<ListVO<AppMenuListVO>> list(Page page) { |
||||
AuthorizeVO authorizeModel = authorizeApi.getAuthorize(true, false); |
||||
List<ModuleModel> buttonListAll = authorizeModel.getModuleList().stream().filter(t -> "App".equals(t.getCategory())).collect(Collectors.toList()); |
||||
// 通过系统id捞取相应的菜单
|
||||
buttonListAll = buttonListAll.stream().filter(t -> userProvider.get().getAppSystemId() != null && userProvider.get().getAppSystemId().equals(t.getSystemId())).collect(Collectors.toList()); |
||||
List<ModuleModel> buttonList = buttonListAll; |
||||
if (StringUtil.isNotEmpty(page.getKeyword())) { |
||||
buttonList = buttonListAll.stream().filter(t -> t.getFullName().contains(page.getKeyword())).collect(Collectors.toList()); |
||||
} |
||||
List<UserMenuModel> list = JsonUtil.getJsonToList(ListToTreeUtil.treeWhere(buttonList, buttonListAll), UserMenuModel.class); |
||||
List<SumTree<UserMenuModel>> menuAll = TreeDotUtils.convertListToTreeDot(list, "-1"); |
||||
List<AppMenuListVO> data = JsonUtil.getJsonToList(menuAll, AppMenuListVO.class); |
||||
ListVO listVO = new ListVO(); |
||||
listVO.setList(data); |
||||
return ActionResult.success(listVO); |
||||
} |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,61 @@
@@ -0,0 +1,61 @@
|
||||
package jnpf.controller; |
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.Parameters; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.model.AppUserInfoVO; |
||||
import jnpf.model.AppUsersVO; |
||||
import jnpf.service.AppService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.PathVariable; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* 用户信息 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Tag(name = "app用户信息", description = "User") |
||||
@RestController |
||||
@RequestMapping("/User") |
||||
public class AppUserController { |
||||
|
||||
@Autowired |
||||
private AppService appService; |
||||
|
||||
/** |
||||
* 用户信息 |
||||
* |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "用户信息") |
||||
@GetMapping |
||||
public ActionResult<AppUsersVO> getInfo() { |
||||
AppUsersVO userAllVO = appService.userInfo(); |
||||
return ActionResult.success(userAllVO); |
||||
} |
||||
|
||||
/** |
||||
* 通讯录详情 |
||||
* |
||||
* @param id 主键 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "通讯录详情") |
||||
@GetMapping("/{id}") |
||||
@Parameters({ |
||||
@Parameter(name = "id", description = "主键", required = true), |
||||
}) |
||||
public ActionResult<AppUserInfoVO> userInfo(@PathVariable("id") String id) { |
||||
AppUserInfoVO userInfoVO = appService.getInfo(id); |
||||
return ActionResult.success(userInfoVO); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,51 @@
@@ -0,0 +1,51 @@
|
||||
package jnpf.controller; |
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.SysConfigApi; |
||||
import jnpf.model.BaseSystemInfo; |
||||
import jnpf.util.NoDataSourceBind; |
||||
import org.apache.commons.collections4.map.HashedMap; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* 获取AppVersion |
||||
* |
||||
* @author :JNPF开发平台组 |
||||
* @version: V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date :2022/3/31 11:26 |
||||
*/ |
||||
@Tag(name = "获取APP版本号", description = "AppVersion") |
||||
@RestController |
||||
@RequestMapping |
||||
public class AppVersionController { |
||||
|
||||
@Autowired |
||||
private SysConfigApi sysConfigApi; |
||||
|
||||
/** |
||||
* 判断是否需要验证码 |
||||
* |
||||
* @return |
||||
*/ |
||||
@NoDataSourceBind |
||||
@Operation(summary = "判断是否需要验证码") |
||||
@GetMapping("/Version") |
||||
public ActionResult getAppVersion() { |
||||
BaseSystemInfo sysConfigInfo = sysConfigApi.getSysConfigInfo(); |
||||
String sysVersion = ""; |
||||
Map<String, String> map = new HashedMap<>(); |
||||
if (sysConfigInfo != null) { |
||||
sysVersion = sysConfigInfo.getSysVersion(); |
||||
} |
||||
map.put("sysVersion", sysVersion); |
||||
return ActionResult.success(map); |
||||
} |
||||
} |
||||
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
<?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>jnpf-app</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-app-entity</artifactId> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-core</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
package jnpf.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import jnpf.base.entity.SuperExtendEntity; |
||||
import lombok.Data; |
||||
|
||||
import java.util.Date; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
@Data |
||||
@TableName("base_app_data") |
||||
public class AppDataEntity extends SuperExtendEntity.SuperExtendDEEntity<String> { |
||||
|
||||
/** |
||||
* 对象类型 |
||||
*/ |
||||
@TableField("f_object_type") |
||||
private String objectType; |
||||
|
||||
/** |
||||
* 对象主键 |
||||
*/ |
||||
@TableField("f_object_id") |
||||
private String objectId; |
||||
|
||||
/** |
||||
* 数据 |
||||
*/ |
||||
@TableField("f_object_data") |
||||
private String objectData; |
||||
|
||||
/** |
||||
* 关联系统id |
||||
*/ |
||||
@TableField("f_system_id") |
||||
private String systemId; |
||||
|
||||
} |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
import javax.validation.constraints.NotBlank; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppDataCrForm { |
||||
@NotBlank(message = "必填") |
||||
@Schema(description ="应用类型") |
||||
private String objectType; |
||||
@NotBlank(message = "必填") |
||||
@Schema(description ="应用主键") |
||||
private String objectId; |
||||
@Schema(description ="数据") |
||||
private String objectData; |
||||
@Schema(description ="系统主键") |
||||
private String systemId; |
||||
} |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppDataListAllVO { |
||||
@Schema(description ="主键") |
||||
private String id; |
||||
@Schema(description ="是否有下级菜单") |
||||
private Boolean hasChildren; |
||||
@Schema(description ="菜单名称") |
||||
private String fullName; |
||||
@Schema(description =" 图标") |
||||
private String icon; |
||||
@Schema(description ="链接地址") |
||||
private String urlAddress; |
||||
@Schema(description ="父级id") |
||||
private String parentId; |
||||
@Schema(description ="菜单类型",example = "1") |
||||
private Integer type; |
||||
@Schema(description ="扩展字段") |
||||
private String propertyJson; |
||||
@Schema(description ="是否常用") |
||||
private Boolean isData; |
||||
@Schema(description ="下级菜单列表") |
||||
private List<AppDataListAllVO> children; |
||||
} |
||||
@ -0,0 +1,24 @@
@@ -0,0 +1,24 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppDataListVO { |
||||
@Schema(description ="主键") |
||||
private String id; |
||||
@Schema(description ="应用主键") |
||||
private String objectId; |
||||
@Schema(description ="数据") |
||||
private String objectData; |
||||
} |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* app常用数据 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppFlowListAllVO { |
||||
@Schema(description ="主键") |
||||
private String id; |
||||
@Schema(description ="名称") |
||||
private String fullName; |
||||
@Schema(description ="图标") |
||||
private String icon; |
||||
@Schema(description ="图标背景色") |
||||
private String iconBackground; |
||||
@Schema(description ="编码") |
||||
private String enCode; |
||||
@Schema(description ="是否常用") |
||||
private Boolean isData; |
||||
} |
||||
@ -0,0 +1,40 @@
@@ -0,0 +1,40 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* app应用 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppMenuListVO { |
||||
@Schema(description ="主键") |
||||
private String id; |
||||
@Schema(description ="是否有下级菜单") |
||||
private Boolean hasChildren; |
||||
@Schema(description ="父级id") |
||||
private String parentId; |
||||
@Schema(description ="菜单名称") |
||||
private String fullName; |
||||
@Schema(description =" 图标") |
||||
private String icon; |
||||
@Schema(description ="是否常用") |
||||
private Boolean isData; |
||||
@Schema(description ="链接地址") |
||||
private String urlAddress; |
||||
@Schema(description ="菜单类型",example = "1") |
||||
private Integer type; |
||||
@Schema(description ="扩展字段") |
||||
private String propertyJson; |
||||
@Schema(description ="下级菜单列表") |
||||
private List<AppMenuListVO> children; |
||||
} |
||||
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
package jnpf.model; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
@Data |
||||
public class AppObjectDataModel { |
||||
|
||||
private String id; |
||||
private boolean hasChildren; |
||||
private String fullName; |
||||
private String icon; |
||||
private String urlAddress; |
||||
private String parentId; |
||||
private Integer type; |
||||
private String propertyJson; |
||||
private boolean isData; |
||||
private String children; |
||||
private String iconBackground; |
||||
private String moduleId; |
||||
|
||||
} |
||||
@ -0,0 +1,22 @@
@@ -0,0 +1,22 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* app应用 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-08-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppPositionVO { |
||||
@Schema(description ="岗位id") |
||||
private String id; |
||||
@Schema(description ="岗位名称") |
||||
private String name; |
||||
} |
||||
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
package jnpf.model; |
||||
|
||||
import jnpf.util.treeutil.SumTree; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
*/ |
||||
@Data |
||||
public class AppTreeModel extends SumTree { |
||||
private String enCode; |
||||
private Long num; |
||||
private String fullName; |
||||
private String formType; |
||||
private String type; |
||||
private String icon; |
||||
private String category; |
||||
private String iconBackground; |
||||
private String visibleType; |
||||
private String creatorUser; |
||||
private Long creatorTime; |
||||
private Long sortCode; |
||||
private Integer enabledMark; |
||||
private Boolean isData; |
||||
} |
||||
@ -0,0 +1,37 @@
@@ -0,0 +1,37 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021/3/12 15:31 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppUserInfoVO { |
||||
@Schema(description ="主键") |
||||
private String id; |
||||
@Schema(description ="户名") |
||||
private String realName; |
||||
@Schema(description ="部门名称") |
||||
private String organizeName; |
||||
@Schema(description ="账号") |
||||
private String account; |
||||
@Schema(description ="岗位名称") |
||||
private String positionName; |
||||
@Schema(description ="办公电话") |
||||
private String telePhone; |
||||
@Schema(description ="办公座机") |
||||
private String landline; |
||||
@Schema(description ="手机号码") |
||||
private String mobilePhone; |
||||
@Schema(description ="用户头像") |
||||
private String headIcon; |
||||
@Schema(description ="邮箱") |
||||
private String email; |
||||
} |
||||
@ -0,0 +1,50 @@
@@ -0,0 +1,50 @@
|
||||
package jnpf.model; |
||||
|
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 用户 |
||||
* |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司 |
||||
* @date 2021-07-08 |
||||
*/ |
||||
@Data |
||||
@Schema(description="常用模型") |
||||
public class AppUsersVO { |
||||
@Schema(description ="用户id") |
||||
private String userId; |
||||
@Schema(description ="用户账号") |
||||
private String userAccount; |
||||
@Schema(description ="用户姓名") |
||||
private String userName; |
||||
@Schema(description ="用户头像") |
||||
private String headIcon; |
||||
@Schema(description ="组织主键") |
||||
private String organizeId; |
||||
@Schema(description ="组织名称") |
||||
private String organizeName; |
||||
@Schema(description ="角色主键") |
||||
private String roleId; |
||||
@Schema(description ="角色名称") |
||||
private String roleName; |
||||
@Schema(description ="性别") |
||||
private String gender; |
||||
@Schema(description ="岗位") |
||||
private List<AppPositionVO> positionIds; |
||||
@Schema(description ="生日") |
||||
private Long birthday; |
||||
@Schema(description ="手机") |
||||
private String mobilePhone; |
||||
@Schema(description ="邮箱") |
||||
private String email; |
||||
@Schema(description ="直属主管") |
||||
private String manager; |
||||
|
||||
} |
||||
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
<?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>jnpf-app</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-app-server</artifactId> |
||||
|
||||
<dependencies> |
||||
|
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-app-controller</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
<build> |
||||
<finalName>jnpf-app-${project.version}</finalName> |
||||
<plugins> |
||||
<plugin> |
||||
<groupId>org.springframework.boot</groupId> |
||||
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
<configuration> |
||||
<!-- 指定该Main Class为全局的唯一入口 --> |
||||
<mainClass>jnpf.JnpfApplication</mainClass> |
||||
<layout>ZIP</layout> |
||||
</configuration> |
||||
<executions> |
||||
<execution> |
||||
<goals> |
||||
<goal>repackage</goal><!--可以把依赖的包都打包到生成的Jar包中--> |
||||
</goals> |
||||
</execution> |
||||
</executions> |
||||
</plugin> |
||||
</plugins> |
||||
</build> |
||||
|
||||
</project> |
||||
@ -0,0 +1,14 @@
@@ -0,0 +1,14 @@
|
||||
package jnpf; |
||||
|
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import org.springframework.cloud.openfeign.EnableFeignClients; |
||||
|
||||
@SpringBootApplication |
||||
@EnableFeignClients |
||||
public class JnpfApplication { |
||||
public static void main(String[] args) { |
||||
SpringApplication.run(JnpfApplication.class, args); |
||||
System.out.println("app启动成功"); |
||||
} |
||||
} |
||||
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
# 应用服务器 |
||||
server: |
||||
tomcat: |
||||
uri-encoding: UTF-8 |
||||
port: 30012 |
||||
|
||||
# Spring |
||||
spring: |
||||
profiles: |
||||
# 环境配置 |
||||
active: test |
||||
|
||||
management: |
||||
endpoints: |
||||
web: |
||||
exposure: |
||||
include: '*' |
||||
endpoint: |
||||
health: |
||||
show-details: always |
||||
# 开启在线日志查看功能 |
||||
logfile: |
||||
enabled: true |
||||
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
spring: |
||||
application: |
||||
# 应用名称 |
||||
name: jnpf-app |
||||
mvc: |
||||
servlet: |
||||
# 启动之后立即加载servlet |
||||
load-on-startup: 0 |
||||
main: |
||||
#解决bean重复定义的。设置为true时,后定义的bean会覆盖之前定义的相同名称的bean |
||||
allow-bean-definition-overriding: true |
||||
allow-circular-references: true |
||||
profiles: |
||||
active: dev |
||||
cloud: |
||||
nacos: |
||||
username: nacos |
||||
password: nacos |
||||
discovery: |
||||
# 服务注册地址 |
||||
server-addr: 127.0.0.1:30099 |
||||
namespace: 69c4eecb-05bd-4041-81fe-1473f95f578c |
||||
config: |
||||
server-addr: ${spring.cloud.nacos.discovery.server-addr} |
||||
file-extension: yaml |
||||
group: DEFAULT_GROUP |
||||
namespace: ${spring.cloud.nacos.discovery.namespace} |
||||
extension-configs: |
||||
- # 数据源及Redis配置 |
||||
data-id: datasource.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 静态资源配置 |
||||
data-id: resources.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 系统配置 |
||||
data-id: system-config.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 框架中间件配置 |
||||
data-id: frame-config.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 日志配置 |
||||
data-id: logger.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
@ -0,0 +1,347 @@
@@ -0,0 +1,347 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<configuration> |
||||
|
||||
<!--日志格式应用spring boot默认的格式,也可以自己更改--> |
||||
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> |
||||
<property name="FILE_LOG_PATTERN" value="[%d{yyyy-MM-dd HH:mm:ss.SSS}] [%-5level] [%thread] [%logger{50}] [%M] [%line] - %msg%n" /> |
||||
<springProperty scope="context" name="SERVICE_NAME" source="spring.application.name" defaultValue="jnpf"/> |
||||
|
||||
<!--定义日志存放的位置,默认存放在项目启动的相对路径的目录--> |
||||
<springProperty scope="context" name="LOG_PATH" source="log.path" defaultValue="log/${SERVICE_NAME}"/> |
||||
<!-- 全局日志等级 --> |
||||
<springProperty scope="context" name="LOG_LEVEL_ROOT" source="log.level.root" defaultValue="INFO"/> |
||||
<!-- 服务自定义等级 如需自定义服务日志等级 修改下方的【自定义服务名】与nacos上的log.level.自定义服务名=等级 --> |
||||
<springProperty scope="context" name="LOG_LEVEL" source="log.level.jnpf-app" defaultValue="${LOG_LEVEL_ROOT}"/> |
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 ERROR 日志 --> |
||||
<appender name="FILE_ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
<file>${LOG_PATH}/log_error.log</file> |
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
||||
<fileNamePattern>${LOG_PATH}/error/%d{yyyy-MM-dd,aux}/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
<!--日志最大的历史7天--> |
||||
<maxHistory>7</maxHistory> |
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
||||
命名日志文件,例如log-error-2013-12-21.0.log --> |
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
<maxFileSize>10MB</maxFileSize> |
||||
</timeBasedFileNamingAndTriggeringPolicy> |
||||
</rollingPolicy> |
||||
|
||||
<!-- 追加方式记录日志 --> |
||||
<append>true</append> |
||||
|
||||
<!-- 日志文件的格式 --> |
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
<pattern>${FILE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
|
||||
<!-- 此日志文件只记录error级别的 --> |
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
<level>error</level> |
||||
<onMatch>ACCEPT</onMatch> |
||||
<onMismatch>DENY</onMismatch> |
||||
</filter> |
||||
</appender> |
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 INFO 日志 --> |
||||
<appender name="FILE_INFO" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
<file>${LOG_PATH}/log_info.log</file> |
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
||||
<fileNamePattern>${LOG_PATH}/info/%d{yyyy-MM-dd,aux}/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
<!--日志最大的历史7天--> |
||||
<maxHistory>7</maxHistory> |
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
||||
命名日志文件,例如log-error-2013-12-21.0.log --> |
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
<maxFileSize>10MB</maxFileSize> |
||||
</timeBasedFileNamingAndTriggeringPolicy> |
||||
</rollingPolicy> |
||||
|
||||
<!-- 追加方式记录日志 --> |
||||
<append>true</append> |
||||
|
||||
<!-- 日志文件的格式 --> |
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
<pattern>${FILE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
|
||||
<!-- 此日志文件只记录info级别的 --> |
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
<level>info</level> |
||||
<onMatch>ACCEPT</onMatch> |
||||
<onMismatch>DENY</onMismatch> |
||||
</filter> |
||||
</appender> |
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 WARN 日志 --> |
||||
<appender name="FILE_WARN" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
<file>${LOG_PATH}/log_warn.log</file> |
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
||||
<fileNamePattern>${LOG_PATH}/warn/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
<!--日志最大的历史7天--> |
||||
<maxHistory>7</maxHistory> |
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
||||
命名日志文件,例如log-error-2013-12-21.0.log --> |
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
<maxFileSize>10MB</maxFileSize> |
||||
</timeBasedFileNamingAndTriggeringPolicy> |
||||
</rollingPolicy> |
||||
|
||||
<!-- 追加方式记录日志 --> |
||||
<append>true</append> |
||||
|
||||
<!-- 日志文件的格式 --> |
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
<pattern>${FILE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
|
||||
<!-- 此日志文件只记录warn级别的 --> |
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
<level>warn</level> |
||||
<onMatch>ACCEPT</onMatch> |
||||
<onMismatch>DENY</onMismatch> |
||||
</filter> |
||||
</appender> |
||||
|
||||
<!-- 日志记录器,日期滚动记录,level为 DEBUG 日志 --> |
||||
<appender name="FILE_DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
<file>${LOG_PATH}/log_debug.log</file> |
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
||||
<fileNamePattern>${LOG_PATH}/debug/%d{yyyy-MM-dd,aux}/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
<!--日志最大的历史7天--> |
||||
<maxHistory>7</maxHistory> |
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
||||
命名日志文件,例如log-error-2013-12-21.0.log --> |
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
<maxFileSize>10MB</maxFileSize> |
||||
</timeBasedFileNamingAndTriggeringPolicy> |
||||
</rollingPolicy> |
||||
|
||||
<!-- 追加方式记录日志 --> |
||||
<append>true</append> |
||||
|
||||
<!-- 日志文件的格式 --> |
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
<pattern>${FILE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
|
||||
<!-- 此日志文件只记录debug级别的 --> |
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
<level>debug</level> |
||||
<onMatch>ACCEPT</onMatch> |
||||
<onMismatch>DENY</onMismatch> |
||||
</filter> |
||||
</appender> |
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,所有日志 --> |
||||
<appender name="FILE_ALL" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
<file>${LOG_PATH}/log_total.log</file> |
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
||||
<fileNamePattern>${LOG_PATH}/total/%d{yyyy-MM-dd,aux}/log-total-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
<!--日志最大的历史7天--> |
||||
<maxHistory>7</maxHistory> |
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
||||
命名日志文件,例如log-error-2013-12-21.0.log --> |
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
<maxFileSize>10MB</maxFileSize> |
||||
</timeBasedFileNamingAndTriggeringPolicy> |
||||
</rollingPolicy> |
||||
|
||||
<!-- 追加方式记录日志 --> |
||||
<append>true</append> |
||||
|
||||
<!-- 日志文件的格式 --> |
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
<pattern>${FILE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
|
||||
<!-- 日志记录器,日期滚动记录,level 根据配置动态输出日志 --> |
||||
<appender name="FILE_RELEASE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
||||
|
||||
<!-- 正在记录的日志文件的路径及文件名 --> |
||||
<file>${LOG_PATH}/log_release.log</file> |
||||
|
||||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
||||
|
||||
<!-- 归档的日志文件的路径,%d{yyyy-MM-dd}指定日期格式,%i指定索引 --> |
||||
<fileNamePattern>${LOG_PATH}/release/%d{yyyy-MM-dd,aux}/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
||||
<!--日志最大的历史7天--> |
||||
<maxHistory>7</maxHistory> |
||||
|
||||
<!-- 除按日志记录之外,还配置了日志文件不能超过2M,若超过2M,日志文件会以索引0开始, |
||||
命名日志文件,例如log-error-2013-12-21.0.log --> |
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
||||
<maxFileSize>10MB</maxFileSize> |
||||
</timeBasedFileNamingAndTriggeringPolicy> |
||||
</rollingPolicy> |
||||
|
||||
<!-- 追加方式记录日志 --> |
||||
<append>true</append> |
||||
|
||||
<!-- 日志文件的格式 --> |
||||
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> |
||||
<pattern>${FILE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
|
||||
<!-- 此日志文件只记录warn级别的 --> |
||||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
||||
<level>${LOG_LEVEL}</level> |
||||
<onMatch>ACCEPT</onMatch> |
||||
<onMismatch>DENY</onMismatch> |
||||
</filter> |
||||
</appender> |
||||
<!-- 异步输出 DEBUG --> |
||||
<appender name="ASYNC_FILE_DEBUG" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<queueSize>256</queueSize> |
||||
<appender-ref ref="FILE_DEBUG"/> |
||||
</appender> |
||||
<!-- 异步输出 INFO --> |
||||
<appender name="ASYNC_FILE_INFO" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<queueSize>256</queueSize> |
||||
<appender-ref ref="FILE_INFO"/> |
||||
</appender> |
||||
<!-- 异步输出 WARN --> |
||||
<appender name="ASYNC_FILE_WARN" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<queueSize>256</queueSize> |
||||
<appender-ref ref="FILE_WARN"/> |
||||
</appender> |
||||
<!-- 异步输出 ERROR --> |
||||
<appender name="ASYNC_FILE_ERROR" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<queueSize>256</queueSize> |
||||
<appender-ref ref="FILE_ERROR"/> |
||||
</appender> |
||||
<!-- 异步输出 ALL --> |
||||
<appender name="ASYNC_FILE_ALL" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<queueSize>256</queueSize> |
||||
<appender-ref ref="FILE_ALL"/> |
||||
</appender> |
||||
|
||||
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> |
||||
<encoder> |
||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern> |
||||
<charset>utf-8</charset> |
||||
</encoder> |
||||
</appender> |
||||
|
||||
|
||||
<!-- 异步输出 控制台 --> |
||||
<appender name="ASYNC_STDOUT" class="ch.qos.logback.classic.AsyncAppender"> |
||||
<discardingThreshold>0</discardingThreshold> |
||||
<queueSize>256</queueSize> |
||||
<appender-ref ref="STDOUT"/> |
||||
</appender> |
||||
|
||||
|
||||
<!--<appender name="LOGSTASH" class="net.logstash.logback.appender.LogstashTcpSocketAppender"> |
||||
<!– 必填:目标:LogStash的 IP:Port –> |
||||
<destination>192.168.0.50:50000</destination> |
||||
<!– 可选:保持程序存活时间 –> |
||||
<keepAliveDuration>5 minutes</keepAliveDuration> |
||||
<!– 可选:重连延迟时长 –> |
||||
<reconnectionDelay>10 second</reconnectionDelay> |
||||
<!– 可选:等待策略 –> |
||||
<waitStrategyType>sleeping</waitStrategyType> |
||||
<!– ============ encoder必须配置,有多种可选 ============= –> |
||||
<!– 编码器二:LoggingEventCompositeJsonEncoder –> |
||||
<encoder charset="UTF-8" class="net.logstash.logback.encoder.LoggingEventCompositeJsonEncoder"> |
||||
<providers> |
||||
<!– 时间戳:时区 –> |
||||
<timestamp> |
||||
<timeZone>UTC</timeZone> |
||||
</timestamp> |
||||
<!– 模式 –> |
||||
<pattern> |
||||
<pattern> |
||||
{ |
||||
"severity": "%level", |
||||
"service": "${SERVICE_NAME:-}", |
||||
"trace": "%X{X-B3-TraceId:-}", |
||||
"span": "%X{X-B3-SpanId:-}", |
||||
"exportable": "%X{X-Span-Export:-}", |
||||
"pid": "${PID:-}", |
||||
"thread": "%thread", |
||||
"class": "%logger{40}", |
||||
"msg": "%message" |
||||
<!–"idx_pre": "elk-original-third-access",–> |
||||
<!–"json": "#asJson{%message}" 这个asJson可以把对应的字符串作为json对象取出来,这样es可以对json里面的字段索引了–> |
||||
} |
||||
</pattern> |
||||
</pattern> |
||||
</providers> |
||||
</encoder> |
||||
</appender>--> |
||||
<!--<appender name="skywalking-log" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender"> |
||||
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> |
||||
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.mdc.TraceIdMDCPatternLogbackLayout"> |
||||
<Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%X{tid}] [%thread] %-5level %logger{36} -%msg%n</Pattern> |
||||
</layout> |
||||
</encoder> |
||||
</appender>--> |
||||
|
||||
|
||||
<root level="${LOG_LEVEL}"> |
||||
<appender-ref ref="ASYNC_STDOUT"/> |
||||
<appender-ref ref="ASYNC_FILE_ERROR"/> |
||||
<appender-ref ref="ASYNC_FILE_INFO"/> |
||||
<appender-ref ref="ASYNC_FILE_WARN"/> |
||||
<appender-ref ref="ASYNC_FILE_DEBUG"/> |
||||
<appender-ref ref="ASYNC_FILE_ALL"/> |
||||
<!--<appender-ref ref="LOGSTASH"/>--> |
||||
<!--<appender-ref ref="skywalking-log"/>--> |
||||
</root> |
||||
|
||||
|
||||
</configuration> |
||||
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
<?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>jnpf-java-cloud</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-app</artifactId> |
||||
<packaging>pom</packaging> |
||||
<modules> |
||||
<module>jnpf-app-entity</module> |
||||
<module>jnpf-app-controller</module> |
||||
<module>jnpf-app-biz</module> |
||||
<module>jnpf-app-server</module> |
||||
<module>jnpf-app-api</module> |
||||
</modules> |
||||
|
||||
<dependencies> |
||||
|
||||
|
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
<?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>jnpf-example</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-example-api</artifactId> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-example-entity</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-feign</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
||||
@ -0,0 +1,18 @@
@@ -0,0 +1,18 @@
|
||||
package jnpf; |
||||
|
||||
import jnpf.fallback.ContractApiFallback; |
||||
import jnpf.model.ContractForm; |
||||
import jnpf.utils.FeignName; |
||||
import jnpf.base.ActionResult; |
||||
import org.springframework.cloud.openfeign.FeignClient; |
||||
import org.springframework.web.bind.annotation.PathVariable; |
||||
import org.springframework.web.bind.annotation.PutMapping; |
||||
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
@FeignClient(name = FeignName.EXAMPLE_SERVER_NAME , fallback = ContractApiFallback.class, path = "/Contract") |
||||
public interface ContractApi { |
||||
@PutMapping("/{id}") |
||||
ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm); |
||||
} |
||||
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
package jnpf.fallback; |
||||
|
||||
|
||||
import jnpf.ContractApi; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.model.ContractForm; |
||||
import org.springframework.stereotype.Component; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
@Component |
||||
public class ContractApiFallback implements ContractApi { |
||||
@Override |
||||
public ActionResult update(String id, @Valid ContractForm contractForm) { |
||||
return null; |
||||
} |
||||
} |
||||
@ -0,0 +1,34 @@
@@ -0,0 +1,34 @@
|
||||
<?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>jnpf-example</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-example-biz</artifactId> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-example-entity</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-example-api</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-generater-base</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package jnpf.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import jnpf.entity.Base_datainterfaceEntity; |
||||
|
||||
/** |
||||
* base_datainterface |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-19 |
||||
*/ |
||||
public interface Base_datainterfaceMapper extends BaseMapper<Base_datainterfaceEntity> { |
||||
|
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package jnpf.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import jnpf.entity.BiddingProjectSubscribeChild; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
public interface BiddingProjectSubscribeChildMapper extends BaseMapper<BiddingProjectSubscribeChild> { |
||||
|
||||
} |
||||
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
package jnpf.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import jnpf.entity.BiddingProjectSubscribeEntity; |
||||
import jnpf.model.bidding_project_subscribe.BiddingProjectSubscribePagination; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* bidding_project_subscribe |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-11 |
||||
*/ |
||||
public interface BiddingProjectSubscribeMapper extends BaseMapper<BiddingProjectSubscribeEntity> { |
||||
|
||||
IPage<BiddingProjectSubscribeEntity> queryList(@Param("page") Page<Object> objectPage, @Param("param") BiddingProjectSubscribePagination biddingProjectSubscribePagination, @Param("ew") Map<String, Object> ew,@Param("sql") String sql); |
||||
|
||||
BiddingProjectSubscribeEntity getInfoById(@Param("id") String id); |
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package jnpf.mapper; |
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import jnpf.entity.BiddingProjectSubscribeStep; |
||||
|
||||
/** |
||||
* <p> |
||||
* Mapper 接口 |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
public interface BiddingProjectSubscribeStepMapper extends BaseMapper<BiddingProjectSubscribeStep> { |
||||
|
||||
} |
||||
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
package jnpf.mapper; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import jnpf.base.entity.DictionaryDataEntity; |
||||
import jnpf.entity.Bidding_project_statisticsEntity; |
||||
import jnpf.model.bidding_project_statistics.Bidding_project_statisticsPagination; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
import org.apache.ibatis.annotations.MapKey; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* bidding_project_statistics |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-13 |
||||
*/ |
||||
public interface Bidding_project_statisticsMapper extends BaseMapper<Bidding_project_statisticsEntity> { |
||||
|
||||
List<Bidding_project_statisticsEntity> queryList(@Param("param")Bidding_project_statisticsPagination bidding_project_statisticsPagination, @Param("ew")Map<String, Object> paramNameValuePairs, @Param("sql") String replace); |
||||
|
||||
@MapKey("id") |
||||
List<Map<String,Object>> queryListDl(@Param("param")Bidding_project_statisticsPagination bidding_project_statisticsPagination, @Param("ew")Map<String, Object> paramNameValuePairs, @Param("sql") String replace,@Param("dataList") List<DictionaryDataEntity> dataList); |
||||
|
||||
|
||||
List<Bidding_project_statisticsEntity> queryListJe(@Param("param")Bidding_project_statisticsPagination bidding_project_statisticsPagination, @Param("ew")Map<String, Object> paramNameValuePairs, @Param("sql") String replace); |
||||
|
||||
List<String> getProjectNameList(@Param("ew")Map<String, Object> paramNameValuePairs,@Param("param") BiddingProjectDto.GetProjectNameList param); |
||||
} |
||||
@ -0,0 +1,17 @@
@@ -0,0 +1,17 @@
|
||||
package jnpf.mapper; |
||||
|
||||
import jnpf.base.mapper.SuperMapper; |
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import jnpf.entity.ContractEntity; |
||||
|
||||
/** |
||||
* |
||||
* Contract |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
public interface ContractMapper extends SuperMapper<ContractEntity> { |
||||
|
||||
} |
||||
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
package jnpf.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.entity.Base_datainterfaceEntity; |
||||
import jnpf.model.base_datainterface.*; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* base_datainterface |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-19 |
||||
*/ |
||||
public interface Base_datainterfaceService extends IService<Base_datainterfaceEntity> { |
||||
List<Base_datainterfaceEntity> getList(Base_datainterfacePagination base_datainterfacePagination); |
||||
|
||||
List<Base_datainterfaceEntity> getTypeList(Base_datainterfacePagination base_datainterfacePagination,String dataType); |
||||
|
||||
Base_datainterfaceEntity getInfo(String id); |
||||
|
||||
void delete(Base_datainterfaceEntity entity); |
||||
|
||||
void create(Base_datainterfaceEntity entity); |
||||
|
||||
boolean update(String id, Base_datainterfaceEntity entity); |
||||
|
||||
//子表方法
|
||||
//副表数据方法
|
||||
String checkForm(Base_datainterfaceForm form,int i); |
||||
|
||||
} |
||||
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
package jnpf.service; |
||||
|
||||
import com.alibaba.fastjson.JSONObject; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.entity.BiddingProjectSubscribeEntity; |
||||
import jnpf.model.bidding_project_subscribe.*; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
import jnpf.permission.entity.UserEntity; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* bidding_project_subscribe |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-11 |
||||
*/ |
||||
public interface BiddingProjectSubscribeService extends IService<BiddingProjectSubscribeEntity> { |
||||
List<BiddingProjectSubscribeEntity> getList(BiddingProjectSubscribePagination biddingProjectSubscribePagination); |
||||
|
||||
List<BiddingProjectSubscribeEntity> getTypeList(BiddingProjectSubscribePagination biddingProjectSubscribePagination, String dataType); |
||||
|
||||
BiddingProjectSubscribeEntity getInfo(String id); |
||||
|
||||
void delete(BiddingProjectSubscribeEntity entity); |
||||
|
||||
void create(BiddingProjectSubscribeEntity entity); |
||||
|
||||
boolean update(String id, BiddingProjectSubscribeEntity entity); |
||||
|
||||
//子表方法
|
||||
//副表数据方法
|
||||
String checkForm(BiddingProjectSubscribeForm form, int i); |
||||
|
||||
void updateFlow(UserEntity userEntity, BiddingProjectSubscribeEntity entity,Boolean add); |
||||
|
||||
void auditing(BiddingProjectDto.AuditingParam param); |
||||
|
||||
void updateFlowByUser(BiddingProjectSubscribeEntity entity); |
||||
|
||||
String obtainHierarchy(); |
||||
|
||||
void archivist(BiddingProjectDto.ArchivistParam param); |
||||
|
||||
void termination(String id); |
||||
|
||||
List<JSONObject> getAllFileInfo(String id); |
||||
|
||||
void temporaryStorage(UserEntity userInfo, BiddingProjectSubscribeEntity entity); |
||||
|
||||
MultipartFile download(String id, String type); |
||||
MultipartFile download(String id, String type,BiddingProjectSubscribeEntity entity); |
||||
|
||||
String obtainHierarchyOfCreate(String id); |
||||
} |
||||
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
package jnpf.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.entity.Bidding_project_statisticsEntity; |
||||
import jnpf.model.bidding_project_statistics.*; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
|
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* bidding_project_statistics |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-13 |
||||
*/ |
||||
public interface Bidding_project_statisticsService extends IService<Bidding_project_statisticsEntity> { |
||||
List<Map<String, Object>> getList(Bidding_project_statisticsPagination bidding_project_statisticsPagination); |
||||
|
||||
List<Map<String, Object>> getTypeList(Bidding_project_statisticsPagination bidding_project_statisticsPagination,String dataType); |
||||
|
||||
Bidding_project_statisticsEntity getInfo(String id); |
||||
|
||||
void delete(Bidding_project_statisticsEntity entity); |
||||
|
||||
void create(Bidding_project_statisticsEntity entity); |
||||
|
||||
boolean update(String id, Bidding_project_statisticsEntity entity); |
||||
|
||||
//子表方法
|
||||
//副表数据方法
|
||||
String checkForm(Bidding_project_statisticsForm form,int i); |
||||
|
||||
List<String> getProjectNameList(BiddingProjectDto.GetProjectNameList param); |
||||
} |
||||
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
package jnpf.service; |
||||
|
||||
import jnpf.base.service.SuperService; |
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.base.Pagination; |
||||
import jnpf.entity.ContractEntity; |
||||
|
||||
import java.util.*; |
||||
|
||||
/** |
||||
* |
||||
* Contract |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
public interface ContractService extends SuperService<ContractEntity> { |
||||
|
||||
List<ContractEntity> getlist(Pagination pagination); |
||||
|
||||
ContractEntity getInfo(String id); |
||||
|
||||
void create(ContractEntity entity); |
||||
|
||||
void update(String id, ContractEntity entity); |
||||
|
||||
void delete(ContractEntity entity); |
||||
} |
||||
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
package jnpf.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import jnpf.permission.model.authorize.AuthorizeConditionModel; |
||||
|
||||
public interface CustomAuthService { |
||||
public <T> QueryWrapper<T> getCondition(AuthorizeConditionModel conditionModel); |
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package jnpf.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.entity.BiddingProjectSubscribeChild; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
public interface IBiddingProjectSubscribeChildService extends IService<BiddingProjectSubscribeChild> { |
||||
|
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package jnpf.service; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService; |
||||
import jnpf.entity.BiddingProjectSubscribeStep; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务类 |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
public interface IBiddingProjectSubscribeStepService extends IService<BiddingProjectSubscribeStep> { |
||||
|
||||
} |
||||
@ -0,0 +1,209 @@
@@ -0,0 +1,209 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import cn.hutool.core.util.ObjectUtil; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import jnpf.database.model.superQuery.ConditionJsonModel; |
||||
import jnpf.database.model.superQuery.SuperQueryConditionModel; |
||||
import jnpf.database.model.superQuery.SuperQueryJsonModel; |
||||
import jnpf.entity.Base_datainterfaceEntity; |
||||
import jnpf.mapper.Base_datainterfaceMapper; |
||||
import jnpf.model.base_datainterface.*; |
||||
import jnpf.permission.model.authorize.AuthorizeConditionModel; |
||||
import jnpf.permission.util.AuthorizeUtil; |
||||
import jnpf.service.Base_datainterfaceService; |
||||
import jnpf.util.*; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.lang.reflect.Field; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.stream.Collectors; |
||||
/** |
||||
* |
||||
* base_datainterface |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-19 |
||||
*/ |
||||
@Service |
||||
public class Base_datainterfaceServiceImpl extends ServiceImpl<Base_datainterfaceMapper, Base_datainterfaceEntity> implements Base_datainterfaceService{ |
||||
@Autowired |
||||
private GeneraterSwapUtil generaterSwapUtil; |
||||
|
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
|
||||
@Autowired |
||||
private AuthorizeUtil authorizeUtil; |
||||
|
||||
@Override |
||||
public List<Base_datainterfaceEntity> getList(Base_datainterfacePagination base_datainterfacePagination){ |
||||
return getTypeList(base_datainterfacePagination,base_datainterfacePagination.getDataType()); |
||||
} |
||||
/** 列表查询 */ |
||||
@Override |
||||
public List<Base_datainterfaceEntity> getTypeList(Base_datainterfacePagination base_datainterfacePagination,String dataType){ |
||||
String userId=userProvider.get().getUserId(); |
||||
List<String> AllIdList =new ArrayList(); |
||||
List<List<String>> intersectionList =new ArrayList<>(); |
||||
int total=0; |
||||
int base_datainterfaceNum =0; |
||||
QueryWrapper<Base_datainterfaceEntity> base_datainterfaceQueryWrapper=new QueryWrapper<>(); |
||||
List<String> allSuperIDlist = new ArrayList<>(); |
||||
String superOp =""; |
||||
if (ObjectUtil.isNotEmpty(base_datainterfacePagination.getSuperQueryJson())){ |
||||
SuperQueryJsonModel superQueryJsonModel = JsonUtil.getJsonToBean(base_datainterfacePagination.getSuperQueryJson(), SuperQueryJsonModel.class); |
||||
String matchLogic = ""; |
||||
List<ConditionJsonModel> superQueryList = new ArrayList<>(); |
||||
for (ConditionJsonModel conditionjson : superQueryList){ |
||||
Map<String, Object> map = JsonUtil.stringToMap(conditionjson.getAttr()); |
||||
Map<String, Object> configMap = JsonUtil.stringToMap(map.get("__config__").toString()); |
||||
String tableName = configMap.get("relationTable")!=null ? String.valueOf(configMap.get("relationTable")) : String.valueOf(configMap.get("tableName")); |
||||
if (map.get("multiple") != null) { |
||||
if (Boolean.valueOf(String.valueOf(map.get("multiple"))) && ObjectUtil.isNull(conditionjson.getFieldValue())) { |
||||
conditionjson.setFieldValue("[]"); |
||||
} |
||||
} |
||||
conditionjson.setTableName(tableName); |
||||
} |
||||
List<String> allSuperList = new ArrayList<>(); |
||||
List<List<String>> intersectionSuperList = new ArrayList<>(); |
||||
|
||||
|
||||
|
||||
int base_datainterfaceNum1 = 0; |
||||
QueryWrapper<Base_datainterfaceEntity> base_datainterfaceSuperWrapper = new QueryWrapper<>(); |
||||
base_datainterfaceNum1 = generaterSwapUtil.getCondition(new SuperQueryConditionModel(base_datainterfaceSuperWrapper,superQueryList,matchLogic,"base_datainterface") |
||||
,new Base_datainterfaceEntity(),base_datainterfaceNum1); |
||||
if (base_datainterfaceNum1>0){ |
||||
List<String> base_datainterfaceList =this.list(base_datainterfaceSuperWrapper).stream().map(Base_datainterfaceEntity::getId).collect(Collectors.toList()); |
||||
allSuperList.addAll(base_datainterfaceList); |
||||
intersectionSuperList.add(base_datainterfaceList); |
||||
} |
||||
superOp = matchLogic; |
||||
//and or
|
||||
if(matchLogic.equalsIgnoreCase("and")){ |
||||
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList); |
||||
}else{ |
||||
allSuperIDlist = allSuperList; |
||||
} |
||||
} |
||||
boolean pcPermission = false; |
||||
boolean appPermission = false; |
||||
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); |
||||
if(isPc && pcPermission){ |
||||
if (!userProvider.get().getIsAdministrator()){ |
||||
Object base_datainterfaceObj=authorizeUtil.getCondition(new AuthorizeConditionModel(base_datainterfaceQueryWrapper,base_datainterfacePagination.getMenuId(),"base_datainterface")); |
||||
if (ObjectUtil.isEmpty(base_datainterfaceObj)){ |
||||
return new ArrayList<>(); |
||||
} else { |
||||
base_datainterfaceQueryWrapper = (QueryWrapper<Base_datainterfaceEntity>)base_datainterfaceObj; |
||||
if( base_datainterfaceQueryWrapper.getExpression().getNormal().size()>0){ |
||||
base_datainterfaceNum++; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
if(!isPc && appPermission){ |
||||
if (!userProvider.get().getIsAdministrator()){ |
||||
Object base_datainterfaceObj=authorizeUtil.getCondition(new AuthorizeConditionModel(base_datainterfaceQueryWrapper,base_datainterfacePagination.getMenuId(),"base_datainterface")); |
||||
if (ObjectUtil.isEmpty(base_datainterfaceObj)){ |
||||
return new ArrayList<>(); |
||||
} else { |
||||
base_datainterfaceQueryWrapper = (QueryWrapper<Base_datainterfaceEntity>)base_datainterfaceObj; |
||||
if( base_datainterfaceQueryWrapper.getExpression().getNormal().size()>0){ |
||||
base_datainterfaceNum++; |
||||
} |
||||
} |
||||
|
||||
|
||||
} |
||||
} |
||||
|
||||
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList); |
||||
if (total>0){ |
||||
if (intersection.size()==0){ |
||||
intersection.add("jnpfNullList"); |
||||
} |
||||
base_datainterfaceQueryWrapper.lambda().in(Base_datainterfaceEntity::getId, intersection); |
||||
} |
||||
//是否有高级查询
|
||||
if (StringUtil.isNotEmpty(superOp)){ |
||||
if (allSuperIDlist.size()==0){ |
||||
allSuperIDlist.add("jnpfNullList"); |
||||
} |
||||
List<String> finalAllSuperIDlist = allSuperIDlist; |
||||
base_datainterfaceQueryWrapper.lambda().and(t->t.in(Base_datainterfaceEntity::getId, finalAllSuperIDlist)); |
||||
} |
||||
|
||||
|
||||
//排序
|
||||
if(StringUtil.isEmpty(base_datainterfacePagination.getSidx())){ |
||||
base_datainterfaceQueryWrapper.lambda().orderByDesc(Base_datainterfaceEntity::getId); |
||||
}else{ |
||||
try { |
||||
String sidx = base_datainterfacePagination.getSidx(); |
||||
String[] strs= sidx.split("_name"); |
||||
Base_datainterfaceEntity base_datainterfaceEntity = new Base_datainterfaceEntity(); |
||||
Field declaredField = base_datainterfaceEntity.getClass().getDeclaredField(strs[0]); |
||||
declaredField.setAccessible(true); |
||||
String value = declaredField.getAnnotation(TableField.class).value(); |
||||
base_datainterfaceQueryWrapper="asc".equals(base_datainterfacePagination.getSort().toLowerCase())?base_datainterfaceQueryWrapper.orderByAsc(value):base_datainterfaceQueryWrapper.orderByDesc(value); |
||||
} catch (NoSuchFieldException e) { |
||||
e.printStackTrace(); |
||||
} |
||||
} |
||||
|
||||
if("0".equals(dataType)){ |
||||
if((total>0 && AllIdList.size()>0) || total==0){ |
||||
Page<Base_datainterfaceEntity> page=new Page<>(base_datainterfacePagination.getCurrentPage(), base_datainterfacePagination.getPageSize()); |
||||
IPage<Base_datainterfaceEntity> userIPage=this.page(page, base_datainterfaceQueryWrapper); |
||||
return base_datainterfacePagination.setData(userIPage.getRecords(),userIPage.getTotal()); |
||||
}else{ |
||||
List<Base_datainterfaceEntity> list = new ArrayList(); |
||||
return base_datainterfacePagination.setData(list, list.size()); |
||||
} |
||||
}else{ |
||||
return this.list(base_datainterfaceQueryWrapper); |
||||
} |
||||
} |
||||
@Override |
||||
public Base_datainterfaceEntity getInfo(String id){ |
||||
QueryWrapper<Base_datainterfaceEntity> queryWrapper=new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(Base_datainterfaceEntity::getId,id); |
||||
return this.getOne(queryWrapper); |
||||
} |
||||
@Override |
||||
public void create(Base_datainterfaceEntity entity){ |
||||
this.save(entity); |
||||
} |
||||
@Override |
||||
public boolean update(String id, Base_datainterfaceEntity entity){ |
||||
return this.updateById(entity); |
||||
} |
||||
@Override |
||||
public void delete(Base_datainterfaceEntity entity){ |
||||
if(entity!=null){ |
||||
this.removeById(entity.getId()); |
||||
} |
||||
} |
||||
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/ |
||||
@Override |
||||
public String checkForm(Base_datainterfaceForm form,int i) { |
||||
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); |
||||
String id=""; |
||||
String countRecover = ""; |
||||
if (isUp){ |
||||
id = form.getId(); |
||||
} |
||||
//主表字段验证
|
||||
return countRecover; |
||||
} |
||||
} |
||||
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import jnpf.entity.BiddingProjectSubscribeChild; |
||||
import jnpf.mapper.BiddingProjectSubscribeChildMapper; |
||||
import jnpf.service.IBiddingProjectSubscribeChildService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
@Service |
||||
public class BiddingProjectSubscribeChildServiceImpl extends ServiceImpl<BiddingProjectSubscribeChildMapper, BiddingProjectSubscribeChild> implements IBiddingProjectSubscribeChildService { |
||||
|
||||
} |
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,20 @@
@@ -0,0 +1,20 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import jnpf.entity.BiddingProjectSubscribeStep; |
||||
import jnpf.mapper.BiddingProjectSubscribeStepMapper; |
||||
import jnpf.service.IBiddingProjectSubscribeStepService; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
/** |
||||
* <p> |
||||
* 服务实现类 |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
@Service |
||||
public class BiddingProjectSubscribeStepServiceImpl extends ServiceImpl<BiddingProjectSubscribeStepMapper, BiddingProjectSubscribeStep> implements IBiddingProjectSubscribeStepService { |
||||
|
||||
} |
||||
@ -0,0 +1,297 @@
@@ -0,0 +1,297 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import cn.hutool.core.collection.CollectionUtil; |
||||
import cn.hutool.core.util.ObjectUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.alibaba.fastjson.JSON; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import jnpf.base.DictionaryDataApi; |
||||
import jnpf.base.entity.DictionaryDataEntity; |
||||
import jnpf.entity.Bidding_project_statisticsEntity; |
||||
import jnpf.exception.DataException; |
||||
import jnpf.mapper.Bidding_project_statisticsMapper; |
||||
import jnpf.model.bidding_project_statistics.*; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
import jnpf.permission.OrganizeApi; |
||||
import jnpf.permission.model.authorize.AuthorizeConditionModel; |
||||
import jnpf.permission.util.AuthorizeUtil; |
||||
import jnpf.service.BiddingProjectSubscribeService; |
||||
import jnpf.service.Bidding_project_statisticsService; |
||||
import jnpf.service.CustomAuthService; |
||||
import jnpf.util.*; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.lang.reflect.Field; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
import java.util.Optional; |
||||
|
||||
/** |
||||
* bidding_project_statistics |
||||
* 版本: V3.5 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2024-06-13 |
||||
*/ |
||||
@Service |
||||
@AllArgsConstructor |
||||
public class Bidding_project_statisticsServiceImpl extends ServiceImpl<Bidding_project_statisticsMapper, Bidding_project_statisticsEntity> implements Bidding_project_statisticsService { |
||||
// @Autowired
|
||||
// private GeneraterSwapUtil generaterSwapUtil;
|
||||
private final DictionaryDataApi dictionaryDataApi; |
||||
private final UserProvider userProvider; |
||||
private final OrganizeApi organizeApi; |
||||
private final CustomAuthService customAuthService; |
||||
private final BiddingProjectSubscribeService biddingProjectSubscribeService; |
||||
|
||||
@Override |
||||
public List<Map<String, Object>> getList(Bidding_project_statisticsPagination bidding_project_statisticsPagination) { |
||||
return getTypeList(bidding_project_statisticsPagination, bidding_project_statisticsPagination.getDataType()); |
||||
} |
||||
|
||||
/** |
||||
* 列表查询 |
||||
*/ |
||||
@Override |
||||
public List<Map<String, Object>> getTypeList(Bidding_project_statisticsPagination bidding_project_statisticsPagination, String dataType) { |
||||
String userId = userProvider.get().getUserId(); |
||||
List<String> AllIdList = new ArrayList(); |
||||
List<List<String>> intersectionList = new ArrayList<>(); |
||||
int total = 0; |
||||
int bidding_project_statisticsNum = 0; |
||||
QueryWrapper<Bidding_project_statisticsEntity> bidding_project_statisticsQueryWrapper = new QueryWrapper<>(); |
||||
boolean pcPermission = true; |
||||
boolean appPermission = false; |
||||
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); |
||||
if (isPc) { |
||||
if (!userProvider.get().getIsAdministrator()) { |
||||
Object bidding_project_statisticsObj = customAuthService.getCondition(new AuthorizeConditionModel(bidding_project_statisticsQueryWrapper, bidding_project_statisticsPagination.getMenuId(), "bidding_project_subscribe")); |
||||
System.out.println("---------------" + JSON.toJSONString(bidding_project_statisticsObj)); |
||||
if (ObjectUtil.isEmpty(bidding_project_statisticsObj)) { |
||||
return new ArrayList<>(); |
||||
} else { |
||||
bidding_project_statisticsQueryWrapper = (QueryWrapper<Bidding_project_statisticsEntity>) bidding_project_statisticsObj; |
||||
if (bidding_project_statisticsQueryWrapper.getExpression().getNormal().size() > 0) { |
||||
bidding_project_statisticsNum++; |
||||
} |
||||
} |
||||
} |
||||
} |
||||
|
||||
|
||||
if (Boolean.TRUE) { |
||||
|
||||
switch (bidding_project_statisticsPagination.getQueryType()) { |
||||
case "1": |
||||
List<Bidding_project_statisticsEntity> bidding_project_statisticsEntities = this.baseMapper.queryList(bidding_project_statisticsPagination, bidding_project_statisticsQueryWrapper.getParamNameValuePairs(), bidding_project_statisticsQueryWrapper.getSqlSegment().replace("paramNameValuePairs.", "")); |
||||
// checkResult(bidding_project_statisticsEntities);
|
||||
|
||||
return JsonUtil.getJsonToList(JSON.parseArray(JSON.toJSONString(bidding_project_statisticsEntities))); |
||||
case "2": |
||||
List<DictionaryDataEntity> dataList = dictionaryDataApi.getList("dc6b2542d94b5434fc61ec1d59592901"); |
||||
dataList.forEach(data -> data.setEnCode("'" + data.getEnCode() + "'")); |
||||
List<Map<String, Object>> maps = this.baseMapper.queryListDl(bidding_project_statisticsPagination, bidding_project_statisticsQueryWrapper.getParamNameValuePairs(), bidding_project_statisticsQueryWrapper.getSqlSegment().replace("paramNameValuePairs.", ""), dataList); |
||||
// for (Map<String, Object> map : maps) {
|
||||
// String reportingUnit = map.get("reportingUnit").toString();
|
||||
// if (StrUtil.isBlank(reportingUnit))continue;
|
||||
// List<String> strings = JSON.parseArray(reportingUnit, String.class);
|
||||
//// List<OrganizeEntity> organizeName = organizeApi.getOrganizeName(strings);
|
||||
// if (CollectionUtil.isEmpty(strings))continue;
|
||||
// map.put("reportingUnit",organizeApi.getInfoById(strings.get(strings.size()-1)).getFullName());
|
||||
//// map.put("reportingUnit",StrUtil.join("/",organizeName.stream().map(OrganizeEntity::getFullName).toList()));
|
||||
// }
|
||||
return maps; |
||||
case "3": |
||||
bidding_project_statisticsEntities = this.baseMapper.queryListJe(bidding_project_statisticsPagination, bidding_project_statisticsQueryWrapper.getParamNameValuePairs(), bidding_project_statisticsQueryWrapper.getSqlSegment().replace("paramNameValuePairs.", "")); |
||||
// checkResult(bidding_project_statisticsEntities);
|
||||
|
||||
return JsonUtil.getJsonToList(JSON.parseArray(JSON.toJSONString(bidding_project_statisticsEntities))); |
||||
} |
||||
} |
||||
|
||||
// if (!isPc && appPermission) {
|
||||
// if (!userProvider.get().getIsAdministrator()) {
|
||||
// Object bidding_project_statisticsObj = authorizeUtil.getCondition(new AuthorizeConditionModel(bidding_project_statisticsQueryWrapper, bidding_project_statisticsPagination.getMenuId(), "bidding_project_statistics"));
|
||||
// if (ObjectUtil.isEmpty(bidding_project_statisticsObj)) {
|
||||
// return new ArrayList<>();
|
||||
// } else {
|
||||
// bidding_project_statisticsQueryWrapper = (QueryWrapper<Bidding_project_statisticsEntity>) bidding_project_statisticsObj;
|
||||
// if (bidding_project_statisticsQueryWrapper.getExpression().getNormal().size() > 0) {
|
||||
// bidding_project_statisticsNum++;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
// List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
|
||||
// if (total > 0) {
|
||||
// if (intersection.size() == 0) {
|
||||
// intersection.add("jnpfNullList");
|
||||
// }
|
||||
// bidding_project_statisticsQueryWrapper.lambda().in(Bidding_project_statisticsEntity::getId, intersection);
|
||||
// }
|
||||
// //是否有高级查询
|
||||
//
|
||||
//
|
||||
// //排序
|
||||
// if (StringUtil.isEmpty(bidding_project_statisticsPagination.getSidx())) {
|
||||
// bidding_project_statisticsQueryWrapper.lambda().orderByDesc(Bidding_project_statisticsEntity::getProjectsNums);
|
||||
// } else {
|
||||
// try {
|
||||
// String sidx = bidding_project_statisticsPagination.getSidx();
|
||||
// String[] strs = sidx.split("_name");
|
||||
// Bidding_project_statisticsEntity bidding_project_statisticsEntity = new Bidding_project_statisticsEntity();
|
||||
// Field declaredField = bidding_project_statisticsEntity.getClass().getDeclaredField(strs[0]);
|
||||
// declaredField.setAccessible(true);
|
||||
// String value = declaredField.getAnnotation(TableField.class).value();
|
||||
// bidding_project_statisticsQueryWrapper = "asc".equals(bidding_project_statisticsPagination.getSort().toLowerCase()) ? bidding_project_statisticsQueryWrapper.orderByAsc(value) : bidding_project_statisticsQueryWrapper.orderByDesc(value);
|
||||
// } catch (NoSuchFieldException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
return new ArrayList<>(); |
||||
|
||||
// if ("0".equals(dataType)) {
|
||||
// if ((total > 0 && AllIdList.size() > 0) || total == 0) {
|
||||
// Page<Bidding_project_statisticsEntity> page = new Page<>(bidding_project_statisticsPagination.getCurrentPage(), bidding_project_statisticsPagination.getPageSize());
|
||||
// IPage<Bidding_project_statisticsEntity> userIPage = this.page(page, bidding_project_statisticsQueryWrapper);
|
||||
// return bidding_project_statisticsPagination.setData(userIPage.getRecords(), userIPage.getTotal());
|
||||
// } else {
|
||||
// List<Bidding_project_statisticsEntity> list = new ArrayList();
|
||||
// return bidding_project_statisticsPagination.setData(list, list.size());
|
||||
// }
|
||||
// } else {
|
||||
// return this.list(bidding_project_statisticsQueryWrapper);
|
||||
// }
|
||||
} |
||||
|
||||
private void checkResult(List<Bidding_project_statisticsEntity> bidding_project_statisticsEntities) { |
||||
|
||||
for (Bidding_project_statisticsEntity bidding_project_statisticsEntity : bidding_project_statisticsEntities) { |
||||
String reportingUnit = bidding_project_statisticsEntity.getReportingUnit(); |
||||
if (StrUtil.isBlank(reportingUnit)) continue; |
||||
List<String> strings = JSON.parseArray(reportingUnit, String.class); |
||||
// List<OrganizeEntity> organizeName = organizeApi.getOrganizeName(strings);
|
||||
if (CollectionUtil.isEmpty(strings)) continue; |
||||
bidding_project_statisticsEntity.setReportingUnit(organizeApi.getInfoById(strings.get(strings.size() - 1)).getFullName()); |
||||
// bidding_project_statisticsEntity.setReportingUnit(StrUtil.join("/",organizeName.stream().map(OrganizeEntity::getFullName).toList()));
|
||||
} |
||||
} |
||||
|
||||
@Override |
||||
public Bidding_project_statisticsEntity getInfo(String id) { |
||||
QueryWrapper<Bidding_project_statisticsEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(Bidding_project_statisticsEntity::getId, id); |
||||
return this.getOne(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
public void create(Bidding_project_statisticsEntity entity) { |
||||
this.save(entity); |
||||
} |
||||
|
||||
@Override |
||||
public boolean update(String id, Bidding_project_statisticsEntity entity) { |
||||
return this.updateById(entity); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(Bidding_project_statisticsEntity entity) { |
||||
if (entity != null) { |
||||
this.removeById(entity.getId()); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 验证表单唯一字段,正则,非空 i-0新增-1修改 |
||||
*/ |
||||
@Override |
||||
public String checkForm(Bidding_project_statisticsForm form, int i) { |
||||
boolean isUp = StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0"); |
||||
String id = ""; |
||||
String countRecover = ""; |
||||
if (isUp) { |
||||
id = form.getId(); |
||||
} |
||||
//主表字段验证
|
||||
return countRecover; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public List<String> getProjectNameList(BiddingProjectDto.GetProjectNameList param) { |
||||
checkParam(param); |
||||
QueryWrapper<Bidding_project_statisticsEntity> bidding_project_statisticsQueryWrapper = new QueryWrapper<>(); |
||||
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); |
||||
if (isPc) { |
||||
if (!userProvider.get().getIsAdministrator()) { |
||||
Object bidding_project_statisticsObj = customAuthService.getCondition(new AuthorizeConditionModel(bidding_project_statisticsQueryWrapper, param.getMenuId(), "bidding_project_subscribe")); |
||||
System.out.println("---------------" + JSON.toJSONString(bidding_project_statisticsObj)); |
||||
if (ObjectUtil.isEmpty(bidding_project_statisticsObj)) { |
||||
return new ArrayList<>(); |
||||
} else { |
||||
bidding_project_statisticsQueryWrapper = (QueryWrapper<Bidding_project_statisticsEntity>) bidding_project_statisticsObj; |
||||
} |
||||
} |
||||
} |
||||
String replace = bidding_project_statisticsQueryWrapper.getSqlSegment().replace("paramNameValuePairs.", ""); |
||||
param.setSql(replace); |
||||
//* 1-项目 * 2-代理 * 3-金额
|
||||
switch (param.getStatisticalType()) { |
||||
case "1": |
||||
case "3": |
||||
String projectTypeCode=getProjectTypeCode(param.getFieldName()); |
||||
param.setCode(projectTypeCode); |
||||
return this.baseMapper.getProjectNameList(bidding_project_statisticsQueryWrapper.getParamNameValuePairs(),param); |
||||
case "2": |
||||
List<DictionaryDataEntity> dataList = dictionaryDataApi.getList("dc6b2542d94b5434fc61ec1d59592901"); |
||||
Optional<DictionaryDataEntity> first = dataList.stream().filter(data -> data.getFullName().equals(param.getFieldName())).findFirst(); |
||||
if (!first.isPresent())return new ArrayList<>(); |
||||
param.setCode(first.get().getEnCode()); |
||||
return this.baseMapper.getProjectNameList(bidding_project_statisticsQueryWrapper.getParamNameValuePairs(),param); |
||||
default: |
||||
return new ArrayList<>(); |
||||
} |
||||
} |
||||
|
||||
private String getProjectTypeCode(String fieldName) { |
||||
switch (fieldName) { |
||||
case "engineering": |
||||
return "1"; |
||||
case "goods": |
||||
return "2"; |
||||
case "service": |
||||
return "3"; |
||||
case "rentOut": |
||||
return "4"; |
||||
case "agency1": |
||||
return "5"; |
||||
case "other": |
||||
return "6"; |
||||
default: |
||||
return ""; |
||||
} |
||||
} |
||||
|
||||
private void checkParam(BiddingProjectDto.GetProjectNameList param) { |
||||
if (StrUtil.isBlank(param.getProjectName())) { |
||||
throw new DataException("参数为空[项目名称]"); |
||||
} |
||||
if (StrUtil.isBlank(param.getStatisticalType())) { |
||||
throw new DataException("参数为空[统计类型]"); |
||||
} |
||||
if (StrUtil.isBlank(param.getFieldName())) { |
||||
throw new DataException("参数为空[字段名称]"); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,84 @@
@@ -0,0 +1,84 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import jnpf.base.service.SuperServiceImpl; |
||||
import com.baomidou.dynamic.datasource.annotation.DSTransactional; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import jnpf.base.Pagination; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.util.RandomUtil; |
||||
import jnpf.util.UserProvider; |
||||
import jnpf.entity.ContractEntity; |
||||
import jnpf.mapper.ContractMapper; |
||||
import jnpf.service.ContractService; |
||||
import org.apache.commons.lang3.StringUtils; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
|
||||
import java.util.List; |
||||
/** |
||||
* |
||||
* Contract |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
@Service |
||||
public class ContractServiceImpl extends SuperServiceImpl<ContractMapper, ContractEntity> implements ContractService { |
||||
|
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
|
||||
@Override |
||||
public List<ContractEntity> getlist(Pagination pagination){ |
||||
//通过UserProvider获取用户信息
|
||||
UserInfo UserProvider = userProvider.get(); |
||||
QueryWrapper<ContractEntity> queryWrapper = new QueryWrapper<>(); |
||||
if (!StringUtils.isEmpty(pagination.getKeyword())) { |
||||
queryWrapper.lambda().and( |
||||
t -> t.like(ContractEntity::getContractName, pagination.getKeyword()) |
||||
.or().like(ContractEntity::getMytelePhone, pagination.getKeyword()) |
||||
); |
||||
} |
||||
//排序
|
||||
if (StringUtils.isEmpty(pagination.getSidx())) { |
||||
} else { |
||||
queryWrapper = "asc".equals(pagination.getSort().toLowerCase()) ? queryWrapper.orderByAsc(pagination.getSidx()) : queryWrapper.orderByDesc(pagination.getSidx()); |
||||
} |
||||
Page<ContractEntity> page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize()); |
||||
IPage<ContractEntity> userIPage = this.page(page, queryWrapper); |
||||
return pagination.setData(userIPage.getRecords(), page.getTotal()); |
||||
} |
||||
|
||||
@Override |
||||
public ContractEntity getInfo(String id){ |
||||
QueryWrapper<ContractEntity> queryWrapper = new QueryWrapper<>(); |
||||
queryWrapper.lambda().eq(ContractEntity::getId, id); |
||||
return this.getOne(queryWrapper); |
||||
} |
||||
|
||||
@Override |
||||
@DSTransactional |
||||
public void create(ContractEntity entity){ |
||||
entity.setId(RandomUtil.uuId()); |
||||
this.save(entity); |
||||
} |
||||
|
||||
@Override |
||||
@Transactional |
||||
public void update(String id, ContractEntity entity){ |
||||
entity.setId(id); |
||||
this.updateById(entity); |
||||
} |
||||
|
||||
@Override |
||||
public void delete(ContractEntity entity) { |
||||
if (entity != null) { |
||||
this.removeById(entity.getId()); |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,222 @@
@@ -0,0 +1,222 @@
|
||||
package jnpf.service.impl; |
||||
|
||||
import cn.hutool.core.util.StrUtil; |
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.base.model.resource.ResourceModel; |
||||
import jnpf.constant.PermissionConst; |
||||
import jnpf.emnus.SearchMethodEnum; |
||||
import jnpf.permission.OrganizeAdminTratorApi; |
||||
import jnpf.permission.OrganizeApi; |
||||
import jnpf.permission.UserSettingApi; |
||||
import jnpf.permission.entity.OrganizeEntity; |
||||
import jnpf.permission.model.authorize.AuthorizeConditionEnum; |
||||
import jnpf.permission.model.authorize.AuthorizeConditionModel; |
||||
import jnpf.permission.model.authorize.AuthorizeVO; |
||||
import jnpf.permission.model.authorize.ConditionModel; |
||||
import jnpf.service.CustomAuthService; |
||||
import jnpf.util.*; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.stereotype.Service; |
||||
|
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.stream.Collectors; |
||||
|
||||
|
||||
@Service |
||||
public class CustomAuthServiceImpl implements CustomAuthService { |
||||
|
||||
@Autowired |
||||
public OrganizeApi organizeApi; |
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
@Autowired |
||||
private OrganizeAdminTratorApi organizeAdminIsTratorApi; |
||||
@Autowired |
||||
private UserSettingApi userSettingApi; |
||||
@Autowired |
||||
private RedisUtil redisUtil; |
||||
@Autowired |
||||
private CacheKeyUtil cacheKeyUtil; |
||||
|
||||
public AuthorizeVO getAuthorize() { |
||||
return userSettingApi.getAuthorize(); |
||||
} |
||||
@Override |
||||
public <T> QueryWrapper<T> getCondition(AuthorizeConditionModel conditionModel) { |
||||
QueryWrapper<T> queryWhere =(QueryWrapper<T>) conditionModel.getObj(); |
||||
String moduleId = conditionModel.getModuleId(); |
||||
String tableName = conditionModel.getTableName(); |
||||
UserInfo userInfo = userProvider.get(); |
||||
AuthorizeVO model = this.getAuthorize(); |
||||
List<ResourceModel> resourceList = model.getResourceList().stream().filter(m -> m.getModuleId().equals(moduleId)).collect(Collectors.toList()); |
||||
if (resourceList.size() == 0) { |
||||
return null; |
||||
} |
||||
List<ResourceModel> resourceList1 = new ArrayList<>(); |
||||
//拼接计数
|
||||
int t = 1; |
||||
long count = resourceList.stream().filter(item -> "jnpf_alldata".equals(item.getEnCode())).count(); |
||||
if (count > 0) { |
||||
return queryWhere; |
||||
} |
||||
for (ResourceModel item : resourceList) { |
||||
if (item.getAllData() != null && item.getAllData() == 1) { |
||||
t = 0; |
||||
break; |
||||
} |
||||
List<ConditionModel> conditionModelList = JsonUtil.getJsonToList(item.getConditionJson(), ConditionModel.class); |
||||
for (int i = 0; i < conditionModelList.size(); i++) { |
||||
ConditionModel conditionItem = conditionModelList.get(i); |
||||
for (int k = 0; k < conditionItem.getGroups().size(); k++) { |
||||
ConditionModel.ConditionItemModel fieldItem = conditionItem.getGroups().get(k); |
||||
String itemTable = fieldItem.getBindTable(); |
||||
if (StringUtil.isNotEmpty(itemTable) && itemTable.equalsIgnoreCase(tableName)) { |
||||
resourceList1.add(item); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
if (t == 1) { |
||||
if (resourceList1.size() > 0) { |
||||
queryWhere.and(tw -> { |
||||
for (ResourceModel item : resourceList1) { |
||||
List<ConditionModel> conditionModelList = JsonUtil.getJsonToList(item.getConditionJson(), ConditionModel.class); |
||||
for (int i = 0; i < conditionModelList.size(); i++) { |
||||
ConditionModel conditionItem = conditionModelList.get(i); |
||||
for (int k = 0; k < conditionItem.getGroups().size(); k++) { |
||||
ConditionModel.ConditionItemModel fieldItem = conditionItem.getGroups().get(k); |
||||
String itemField = fieldItem.getField(); |
||||
String itemValue = fieldItem.getValue(); |
||||
String itemMethod = fieldItem.getOp(); |
||||
Object value; |
||||
if (AuthorizeConditionEnum.USER.getCondition().equals(itemValue)) { //当前用户
|
||||
value = userInfo.getUserId(); |
||||
//任意文本 当前用户 当前组织 包含为模糊查询
|
||||
if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { |
||||
itemMethod = SearchMethodEnum.Like.getMessage(); |
||||
} |
||||
if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { |
||||
itemMethod = SearchMethodEnum.NotLike.getMessage(); |
||||
} |
||||
} else if (AuthorizeConditionEnum.ORGANIZE.getCondition().equals(itemValue)) { //当前组织
|
||||
String orgId = userInfo.getOrganizeId(); |
||||
if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { |
||||
orgId = userInfo.getDepartmentId(); |
||||
} |
||||
if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { |
||||
itemMethod = SearchMethodEnum.Like.getMessage(); |
||||
} |
||||
if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { |
||||
itemMethod = SearchMethodEnum.NotLike.getMessage(); |
||||
} |
||||
value = orgId; |
||||
} else if (AuthorizeConditionEnum.ORGANIZEANDUNDER.getCondition().equals(itemValue)) { //组织及子组织
|
||||
String orgId = userInfo.getOrganizeId(); |
||||
if (StringUtil.isNotEmpty(userInfo.getDepartmentId())) { |
||||
orgId = userInfo.getDepartmentId(); |
||||
} |
||||
List<String> underOrganizations = organizeApi.getUnderOrganizations(orgId); |
||||
underOrganizations.add(orgId); |
||||
value = underOrganizations; |
||||
} else if (AuthorizeConditionEnum.USERANDUNDER.getCondition().equals(itemValue)) { //用户及用户下属
|
||||
List<String> idsList = new ArrayList<>(); |
||||
if (userInfo.getSubordinateIds().size() > 0) { |
||||
idsList = userInfo.getSubordinateIds(); |
||||
} |
||||
idsList.add(userInfo.getUserId()); |
||||
value = idsList; |
||||
} else if (AuthorizeConditionEnum.USERANDUNDERALl.getCondition().equals(itemValue)) { //用户及用户下属
|
||||
List<String> idsList = new ArrayList<>(); |
||||
String organizeId = userInfo.getOrganizeId(); |
||||
OrganizeEntity organize = organizeApi.getInfoById(organizeId); |
||||
if (StrUtil.equals(organize.getCategory(), PermissionConst.DEPARTMENT)){ |
||||
organize = organizeApi.getInfoById(organize.getParentId()); |
||||
} |
||||
List<String> underOrganizations = organizeApi.getUnderOrganizations(organize.getId()); |
||||
underOrganizations.add(organizeId); |
||||
value = underOrganizations; |
||||
} else {//任意文本
|
||||
value = itemValue; |
||||
if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { |
||||
itemMethod = SearchMethodEnum.Like.getMessage(); |
||||
} |
||||
if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { |
||||
itemMethod = SearchMethodEnum.NotLike.getMessage(); |
||||
} |
||||
} |
||||
if ("and".equalsIgnoreCase(conditionItem.getLogic())) { |
||||
if (itemMethod.equals(SearchMethodEnum.Equal.getSymbol())) { |
||||
tw.eq(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.NotEqual.getSymbol())) { |
||||
tw.ne(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.LessThan.getSymbol())) { |
||||
tw.lt(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.LessThanOrEqual.getSymbol())) { |
||||
tw.le(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.GreaterThan.getSymbol())) { |
||||
tw.gt(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.GreaterThanOrEqual.getSymbol())) { |
||||
tw.ge(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.Included.getSymbol())) { |
||||
tw.in(itemField, (List)value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.NotIncluded.getSymbol())) { |
||||
tw.notIn(itemField, (List)value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.Like.getSymbol())) { |
||||
tw.like(itemField, value); |
||||
} else if (itemMethod.equals(SearchMethodEnum.NotLike.getMessage())) { |
||||
tw.notLike(itemField, value); |
||||
} |
||||
} else { |
||||
if (itemMethod.equals(SearchMethodEnum.Equal.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.eq(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.NotEqual.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.ne(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.LessThan.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.lt(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.LessThanOrEqual.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.le(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.GreaterThan.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.gt(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.GreaterThanOrEqual.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.ge(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.Included.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.in(itemField, (List)value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.NotIncluded.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.notIn(itemField, (List)value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.Like.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.like(itemField, value) |
||||
); |
||||
} else if (itemMethod.equals(SearchMethodEnum.NotLike.getMessage())) { |
||||
tw.or( |
||||
qw -> qw.notLike(itemField, value) |
||||
); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
return queryWhere; |
||||
} |
||||
} |
||||
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<?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="jnpf.mapper.Base_datainterfaceMapper"> |
||||
|
||||
|
||||
|
||||
</mapper> |
||||
@ -0,0 +1,5 @@
@@ -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="jnpf.mapper.BiddingProjectSubscribeChildMapper">--> |
||||
|
||||
<!--</mapper>--> |
||||
@ -0,0 +1,148 @@
@@ -0,0 +1,148 @@
|
||||
<!--<?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="jnpf.mapper.BiddingProjectSubscribeMapper">--> |
||||
|
||||
|
||||
<!-- <resultMap id="BiddingProjectSubscribe" type="jnpf.entity.BiddingProjectSubscribeEntity">--> |
||||
<!-- <id property="id" column="id"/>--> |
||||
<!-- <result property="managementStyle" column="management_style"/>--> |
||||
<!-- <result property="projectNumber" column="project_number"/>--> |
||||
<!-- <result property="planSubmissionTime" column="plan_submission_time"/>--> |
||||
<!-- <result property="reportingCorp" column="reporting_corp"/>--> |
||||
<!-- <result property="tenderingEntity" column="tendering_entity"/>--> |
||||
<!-- <result property="projectName" column="project_name"/>--> |
||||
<!-- <result property="itemClassification" column="Item_classification"/>--> |
||||
<!-- <result property="organizationalForm" column="organizational_form"/>--> |
||||
<!-- <result property="biddingMethod" column="bidding_method"/>--> |
||||
<!-- <result property="reportedFileName" column="reported_file_name"/>--> |
||||
<!-- <result property="biddingDocumentId" column="bidding_document_id"/>--> |
||||
<!-- <result property="decisionProcedure" column="decision_procedure"/>--> |
||||
<!-- <result property="approvalDocumentsId" column="approval_documents_id"/>--> |
||||
<!-- <result property="finalApprovalTime" column="final_approval_time"/>--> |
||||
<!-- <result property="settingOwinningBidderOne" column="setting_of_winning_bidder_one"/>--> |
||||
<!-- <result property="settingOwinningBidderTwo" column="setting_of_winning_bidder_two"/>--> |
||||
<!-- <result property="scoringIndicatorSettingsOne" column="scoring_indicator_settings_one"/>--> |
||||
<!-- <result property="scoringIndicatorSettingsTwo" column="scoring_indicator_settings_two"/>--> |
||||
<!-- <result property="scoringIndicatorSettingsThree" column="scoring_indicator_settings_three"/>--> |
||||
<!-- <result property="scoringIndicatorSettingsFour" column="scoring_indicator_settings_four"/>--> |
||||
<!-- <result property="agencyOne" column="agency_one"/>--> |
||||
<!-- <result property="agencyTwo" column="agency_two"/>--> |
||||
<!-- <result property="scoringMethodOne" column="scoring_method_one"/>--> |
||||
<!-- <result property="scoringMethodTwo" column="scoring_method_two"/>--> |
||||
<!-- <result property="approvalDocumentsIdTwo" column="approval_documents_id_two"/>--> |
||||
<!-- <result property="resultReportingTime" column="result_reporting_time"/>--> |
||||
<!-- <result property="resultReportedFileName" column="result_reported_file_name"/>--> |
||||
<!-- <result property="bidOpeningTime" column="bid_opening_time"/>--> |
||||
<!-- <result property="explanationObid" column="explanation_of_bid"/>--> |
||||
<!-- <result property="winningBidderAndWinningAmount" column="winning_bidder_and_winning_amount"/>--> |
||||
<!-- <result property="bidEvaluationCommittee" column="bid_evaluation_committee"/>--> |
||||
<!-- <result property="tenderAgencyFee" column="tender_agency_fee"/>--> |
||||
<!-- <result property="attachmentObiddingResultsOneId" column="attachment_of_bidding_results_one_id"/>--> |
||||
<!-- <result property="attachmentObiddingResultsTwoId" column="attachment_of_bidding_results_two_id"/>--> |
||||
<!-- <result property="winningBidder" column="winning_bidder"/>--> |
||||
<!-- <result property="winningBidderCandidate" column="winning_bidder_candidate"/>--> |
||||
<!-- <result property="filingDecisionProcedure" column="filing_decision_procedure"/>--> |
||||
<!-- <result property="filingResultsOneId" column="filing_results_one_id"/>--> |
||||
<!-- <result property="filingResultsTwoId" column="filing_results_two_id"/>--> |
||||
<!-- <result property="filingResultsThreeId" column="filing_results_three_id"/>--> |
||||
<!-- <result property="approvalTimeForResults" column="approval_time_for_results"/>--> |
||||
<!-- <result property="flowid" column="f_flowid"/>--> |
||||
<!-- <result property="flowtaskid" column="f_flowtaskid"/>--> |
||||
<!-- <result property="annexProgrammeDocument" column="annex_programme_document"/>--> |
||||
<!-- <result property="mainStatus" column="main_status"/>--> |
||||
<!-- <result property="mainStatusName" column="main_status_name"/>--> |
||||
<!-- <result property="bidWinningAmount" column="bid_winning_amount"/>--> |
||||
<!-- <result property="isApproval" column="is_approval"/>--> |
||||
<!-- <result property="queryType" column="query_type"/>--> |
||||
<!-- <result property="approvalDocumentsIdJt" column="approval_documents_id_jt"/>--> |
||||
<!-- <result property="archiveNumber" column="archive_number"/>--> |
||||
<!-- <result property="createTime" column="create_time"/>--> |
||||
<!-- <result property="updateTime" column="update_time"/>--> |
||||
<!-- <result property="projectAmount" column="project_amount"/>--> |
||||
<!-- <result property="winningBidderType" column="winning_bidder_type"/>--> |
||||
<!-- <result property="winningBidderInfo" column="winning_bidder_info" typeHandler="jnpf.model.JsonTypeHandler"/>--> |
||||
<!-- <result property="controlPrice" column="control_price"/>--> |
||||
<!-- <result property="e" column="eval_setting"/>--> |
||||
<!-- <result property="controlPrice" column="contract_period"/>--> |
||||
|
||||
<!-- <collection property="childList" column="id" javaType="list" select="selectChildMap"/>--> |
||||
<!-- <collection property="stepList" column="id" javaType="list" select="selectStepMap"/>--> |
||||
|
||||
<!-- </resultMap>--> |
||||
<!-- <select id="selectChildMap" resultMap="childMap">--> |
||||
<!-- select <include refid="baseChildFields"/> from bidding_project_subscribe_child child where child.main_id = #{id}--> |
||||
<!-- </select>--> |
||||
<!-- <select id="selectStepMap" resultMap="stepMap">--> |
||||
<!-- select <include refid="baseStepFields"/> from bidding_project_subscribe_step step where step.relation_main_id = #{id}--> |
||||
<!-- </select>--> |
||||
|
||||
<!-- <resultMap id="stepMap" type="jnpf.entity.BiddingProjectSubscribeStep">--> |
||||
<!-- <id property="id" column="child_id"/>--> |
||||
<!-- <result property="relationMainId" column="relation_main_id"/>--> |
||||
<!-- <result property="relationType" column="relation_type"/>--> |
||||
<!-- <result property="relationChildId" column="relation_child_id"/>--> |
||||
<!-- <result property="dealType" column="deal_type"/>--> |
||||
<!-- <result property="dealTypeName" column="deal_type_name"/>--> |
||||
<!-- <result property="otherRelationId" column="other_relation_id"/>--> |
||||
<!-- <result property="remake" column="remake"/>--> |
||||
<!-- <result property="createTime" column="create_time"/>--> |
||||
<!-- <result property="createUserId" column="create_user_id"/>--> |
||||
<!-- <result property="createUserName" column="create_user_name"/>--> |
||||
<!-- <result property="createOrganizationId" column="create_organization_id"/>--> |
||||
<!-- <result property="createOrganizationName" column="create_organization_name"/>--> |
||||
|
||||
<!-- </resultMap>--> |
||||
|
||||
<!-- <resultMap id="childMap" type="jnpf.entity.BiddingProjectSubscribeChild">--> |
||||
<!-- <id property="childId" column="child_id"/>--> |
||||
<!-- <result property="mainId" column="main_id"/>--> |
||||
<!-- <result property="childStatus" column="child_status"/>--> |
||||
<!-- <result property="childStatusName" column="child_status_name"/>--> |
||||
<!-- <result property="userDeptId" column="user_dept_id"/>--> |
||||
<!-- <result property="userDeptName" column="user_dept_name"/>--> |
||||
<!-- <result property="userId" column="user_id"/>--> |
||||
<!-- <result property="userName" column="user_name"/>--> |
||||
<!-- <result property="remake" column="remake"/>--> |
||||
<!-- <result property="createTime" column="create_time"/>--> |
||||
<!-- <result property="updateTime" column="update_time"/>--> |
||||
<!-- <result property="rootChildFlag" column="root_child_flag"/>--> |
||||
<!-- <result property="rootChildId" column="root_child_id"/>--> |
||||
<!-- <result property="createUserId" column="create_user_id"/>--> |
||||
<!-- <result property="createUserName" column="create_user_name"/>--> |
||||
|
||||
<!-- </resultMap>--> |
||||
|
||||
<!-- <sql id="baseFields">--> |
||||
<!-- main.id ,main.management_style ,main.project_number ,main.plan_submission_time ,main.reporting_corp ,main.tendering_entity ,main.project_name ,main.Item_classification ,main.organizational_form ,main.bidding_method ,main.reported_file_name ,main.bidding_document_id ,main.decision_procedure ,main.approval_documents_id ,main.final_approval_time ,main.setting_of_winning_bidder_one ,main.setting_of_winning_bidder_two ,main.scoring_indicator_settings_one ,main.scoring_indicator_settings_two ,main.scoring_indicator_settings_three ,main.scoring_indicator_settings_four ,main.agency_one ,main.agency_two ,main.scoring_method_one ,main.scoring_method_two ,main.approval_documents_id_two ,main.result_reporting_time ,main.result_reported_file_name ,main.bid_opening_time ,main.explanation_of_bid ,main.winning_bidder_and_winning_amount ,main.bid_evaluation_committee ,main.tender_agency_fee ,main.attachment_of_bidding_results_one_id ,main.attachment_of_bidding_results_two_id ,main.winning_bidder ,main.winning_bidder_candidate ,main.filing_decision_procedure ,main.filing_results_one_id ,main.filing_results_two_id ,main.approval_time_for_results ,main.f_flowid ,main.f_flowtaskid ,main.annex_programme_document ,main.main_status ,main.main_status_name,bid_winning_amount,is_approval,query_type,approval_documents_id_jt,archive_number,main.create_time,main.update_time,main.winning_bidder_type,main.winning_bidder_info,main.control_price,main.filing_results_three_id,main.project_amount,main.eval_setting,main.contract_period--> |
||||
<!-- </sql>--> |
||||
<!-- <sql id="baseStepFields">--> |
||||
<!-- id,relation_main_id ,relation_type ,relation_child_id ,deal_type ,deal_type_name ,other_relation_id ,remake ,create_time ,create_user_id ,create_user_name ,create_organization_id ,create_organization_name--> |
||||
<!-- </sql>--> |
||||
|
||||
<!-- <sql id="baseChildFields">--> |
||||
<!-- child_id ,main_id ,child_status ,child_status_name ,user_dept_id ,user_dept_name ,user_id ,user_name ,remake ,create_time ,update_time ,root_child_flag ,root_child_id ,create_user_id ,create_user_name--> |
||||
<!-- </sql>--> |
||||
<!-- <select id="queryList" resultMap="BiddingProjectSubscribe" parameterType="jnpf.model.bidding_project_subscribe.BiddingProjectSubscribePagination">--> |
||||
<!-- select distinct <include refid="baseFields"/>--> |
||||
<!-- from jnpf_cloud.bidding_project_subscribe main--> |
||||
<!-- left join jnpf_cloud.bidding_project_subscribe_child child on child.main_id=main.id--> |
||||
<!-- where 1=1--> |
||||
<!-- <if test="sql != null and sql !=''">--> |
||||
<!-- and main.id in (select child.main_id from jnpf_cloud.bidding_project_subscribe_child child where root_child_flag='0' and ${sql})--> |
||||
<!-- </if>--> |
||||
|
||||
<!-- <if test="param.childIdList != null and param.childIdList.size()>0">--> |
||||
<!-- and main.id in--> |
||||
<!-- <foreach collection="param.childIdList" item="item" open="(" separator="," close=")">--> |
||||
<!-- #{item}--> |
||||
<!-- </foreach>--> |
||||
<!-- </if>--> |
||||
<!-- order by main.create_time desc--> |
||||
<!-- </select>--> |
||||
|
||||
<!-- <select id="getInfoById" resultMap="BiddingProjectSubscribe" parameterType="jnpf.model.bidding_project_subscribe.BiddingProjectSubscribePagination">--> |
||||
<!-- select <include refid="baseFields"/>--> |
||||
<!-- from jnpf_cloud.bidding_project_subscribe main--> |
||||
<!-- where main.id=#{id}--> |
||||
<!-- </select>--> |
||||
<!--</mapper>--> |
||||
@ -0,0 +1,5 @@
@@ -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="jnpf.mapper.BiddingProjectSubscribeStepMapper"> |
||||
|
||||
</mapper> |
||||
@ -0,0 +1,126 @@
@@ -0,0 +1,126 @@
|
||||
<!--<?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="jnpf.mapper.Bidding_project_statisticsMapper">--> |
||||
|
||||
|
||||
<!-- <resultMap id="staticDataResultMap" type="jnpf.entity.Bidding_project_statisticsEntity">--> |
||||
<!-- <id property="id" column="child_id"/>--> |
||||
<!-- <result property="reportingUnit" column="zero"/>--> |
||||
<!-- <result property="projectsAmount" column="one"/>--> |
||||
<!-- <result property="projectsNums" column="one"/>--> |
||||
<!-- <result property="engineering" column="two"/>--> |
||||
<!-- <result property="goods" column="tree"/>--> |
||||
<!-- <result property="service" column="four"/>--> |
||||
<!-- <result property="rentOut" column="five"/>--> |
||||
<!-- <result property="agency1" column="six"/>--> |
||||
<!-- <result property="other" column="seven"/>--> |
||||
|
||||
<!-- </resultMap>--> |
||||
<!-- <select id="queryList" resultMap="staticDataResultMap">--> |
||||
<!-- SELECT--> |
||||
<!-- reporting_corp AS zero,--> |
||||
<!-- SUM(CASE WHEN Item_classification BETWEEN '1' AND '6' THEN 1 ELSE 0 END) AS one,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '1' THEN 1 ELSE 0 END) AS two,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '2' THEN 1 ELSE 0 END) AS tree,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '3' THEN 1 ELSE 0 END) AS four,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '4' THEN 1 ELSE 0 END) AS five,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '5' THEN 1 ELSE 0 END) AS six,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '6' THEN 1 ELSE 0 END) AS seven--> |
||||
<!-- FROM--> |
||||
<!-- jnpf_cloud.bidding_project_subscribe main--> |
||||
<!-- where main.id in (--> |
||||
<!-- select main_id from jnpf_cloud.bidding_project_subscribe_child child where 1=1 and root_child_flag='0'and main.main_status='7'--> |
||||
<!-- <if test="sql != null and sql !=''">--> |
||||
<!-- and ${sql}--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.startTime != null and param.startTime !='' and param.endTime != null and param.endTime !=''">--> |
||||
<!-- and child.create_time between #{param.startTime} and #{param.endTime}--> |
||||
<!-- </if>--> |
||||
<!-- )--> |
||||
|
||||
<!-- GROUP BY reporting_corp;--> |
||||
<!-- </select>--> |
||||
|
||||
<!-- <select id="queryListDl" resultType="com.alibaba.fastjson.JSONObject">--> |
||||
<!-- SELECT--> |
||||
<!-- reporting_corp AS reportingUnit,--> |
||||
<!-- SUM(CASE ifnull(agency_one, agency_two) WHEN null THEN 0 ELSE 1 END) projectsNums,--> |
||||
<!-- <if test="dataList != null and dataList.size()>0">--> |
||||
<!-- <foreach collection="dataList" item="item" open="" separator="," close="">--> |
||||
<!-- SUM(CASE ifnull(agency_one, agency_two) WHEN ${item.enCode} THEN 1 ELSE 0 END) ${item.simpleSpelling}--> |
||||
<!-- </foreach>--> |
||||
<!-- </if>--> |
||||
<!-- from--> |
||||
<!-- jnpf_cloud.bidding_project_subscribe main--> |
||||
<!-- where main.id in (--> |
||||
<!-- select main_id from jnpf_cloud.bidding_project_subscribe_child child where 1=1 and root_child_flag='0'and main.main_status='7'--> |
||||
<!-- <if test="sql != null and sql !=''">--> |
||||
<!-- and ${sql}--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.startTime != null and param.startTime !='' and param.endTime != null and param.endTime !=''">--> |
||||
<!-- and child.create_time between #{param.startTime} and #{param.endTime}--> |
||||
<!-- </if>--> |
||||
<!-- )--> |
||||
<!-- GROUP BY reporting_corp--> |
||||
<!-- </select>--> |
||||
|
||||
<!-- <select id="queryListJe" resultMap="staticDataResultMap">--> |
||||
<!-- SELECT--> |
||||
<!-- reporting_corp AS zero,--> |
||||
<!-- SUM(CASE WHEN Item_classification BETWEEN '1' AND '6' THEN project_amount ELSE 0 END) AS one,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '1' THEN project_amount ELSE 0 END) AS two,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '2' THEN project_amount ELSE 0 END) AS tree,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '3' THEN project_amount ELSE 0 END) AS four,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '4' THEN project_amount ELSE 0 END) AS five,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '5' THEN project_amount ELSE 0 END) AS six,--> |
||||
<!-- SUM(CASE WHEN Item_classification = '6' THEN project_amount ELSE 0 END) AS seven--> |
||||
<!-- FROM--> |
||||
<!-- jnpf_cloud.bidding_project_subscribe main--> |
||||
<!-- where main.id in (--> |
||||
<!-- select main_id from jnpf_cloud.bidding_project_subscribe_child child where 1=1 and root_child_flag='0'and main.main_status='7'--> |
||||
<!-- <if test="sql != null and sql !=''">--> |
||||
<!-- and ${sql}--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.startTime != null and param.startTime !='' and param.endTime != null and param.endTime !=''">--> |
||||
<!-- and child.create_time between #{param.startTime} and #{param.endTime}--> |
||||
<!-- </if>--> |
||||
<!-- )--> |
||||
<!-- GROUP BY reporting_corp;--> |
||||
<!-- </select>--> |
||||
<!-- <select id="getProjectNameList" resultType="java.lang.String">--> |
||||
<!-- SELECT--> |
||||
<!-- <if test="param.statisticalType != null and param.statisticalType =='1'.toString()">--> |
||||
<!-- main.project_name--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.statisticalType != null and param.statisticalType =='3'.toString()">--> |
||||
<!-- concat(main.project_name,': ',main.project_amount,'万元')--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.statisticalType != null and param.statisticalType =='2'.toString()">--> |
||||
<!-- main.project_name--> |
||||
<!-- </if>--> |
||||
<!-- FROM--> |
||||
<!-- jnpf_cloud.bidding_project_subscribe main--> |
||||
<!-- <where>--> |
||||
<!-- main.reporting_corp=#{param.projectName}--> |
||||
<!-- <if test="param.statisticalType != null and (param.statisticalType =='1'.toString() or param.statisticalType =='3'.toString())">--> |
||||
<!-- and main.item_classification=#{param.code}--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.statisticalType != null and (param.statisticalType =='2'.toString())">--> |
||||
<!-- and ifnull(main.agency_one, main.agency_two)=#{param.code}--> |
||||
<!-- </if>--> |
||||
|
||||
<!-- and main.id in (--> |
||||
<!-- select main_id from jnpf_cloud.bidding_project_subscribe_child child--> |
||||
<!-- where--> |
||||
<!-- root_child_flag='0'--> |
||||
<!-- and main.main_status='7'--> |
||||
<!-- <if test="param.sql != null and param.sql !=''">--> |
||||
<!-- and ${param.sql}--> |
||||
<!-- </if>--> |
||||
<!-- <if test="param.startTime != null and param.startTime !='' and param.endTime != null and param.endTime !=''">--> |
||||
<!-- and child.create_time between #{param.startTime} and #{param.endTime}--> |
||||
<!-- </if>--> |
||||
<!-- )--> |
||||
<!-- </where>--> |
||||
<!-- </select>--> |
||||
<!--</mapper>--> |
||||
@ -0,0 +1,42 @@
@@ -0,0 +1,42 @@
|
||||
<?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>jnpf-example</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-example-consumers</artifactId> |
||||
<description>此模块仅是为了演示dubbo调用,创建时可忽略该模块</description> |
||||
|
||||
<dependencies> |
||||
<!--使用dubbo调用时--> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-provider-example</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-example-entity</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-core</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.alibaba.cloud</groupId> |
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-swagger</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
||||
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
package jnpf; |
||||
|
||||
import org.springframework.boot.SpringApplication; |
||||
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; |
||||
|
||||
/** |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021-06-21 |
||||
*/ |
||||
@SpringBootApplication |
||||
@EnableDiscoveryClient |
||||
public class ExampleApplication { |
||||
public static void main(String[] args) { |
||||
SpringApplication.run(ExampleApplication.class , args); |
||||
} |
||||
} |
||||
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
package jnpf.consumers.controller; |
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.entity.ContractEntity; |
||||
import jnpf.provider.example.ContractProvider; |
||||
import jnpf.util.ServletUtil; |
||||
import org.apache.dubbo.config.annotation.DubboReference; |
||||
import org.apache.dubbo.rpc.RpcContext; |
||||
import org.springframework.web.bind.annotation.GetMapping; |
||||
import org.springframework.web.bind.annotation.PathVariable; |
||||
import org.springframework.web.bind.annotation.RequestMapping; |
||||
import org.springframework.web.bind.annotation.RestController; |
||||
|
||||
/** |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021-06-21 |
||||
*/ |
||||
@RestController |
||||
@Tag(description = "Contract", name = "Contract") |
||||
@RequestMapping("/Consumers") |
||||
public class DubboConsumersController { |
||||
/** |
||||
* 使用dubbo示例 |
||||
*/ |
||||
@DubboReference |
||||
private ContractProvider contractProvider; |
||||
|
||||
@Operation(summary = "使用dubbo调用,获取详情") |
||||
@GetMapping("/{id}") |
||||
public ActionResult consumers(@PathVariable("id") String id){ |
||||
/** 不建议常规业务使用!!! */ |
||||
/** 若有个别业务需要使用dubbo调用且携带token,使用隐式参数 */ |
||||
//获取token
|
||||
String token = ServletUtil.getRequest().getHeader("Authorization"); |
||||
//传递参数 K,V
|
||||
RpcContext.getContext().setAttachment("Authorization", token); |
||||
ContractEntity entity = contractProvider.getInfo(id); |
||||
return ActionResult.success(entity); |
||||
} |
||||
} |
||||
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
server: |
||||
port: 30101 |
||||
|
||||
spring: |
||||
application: |
||||
# 应用名称 |
||||
name: jnpf-example-consumers |
||||
profiles: |
||||
active: dev |
||||
main: |
||||
allow-bean-definition-overriding: true |
||||
allow-circular-references: true |
||||
cloud: |
||||
nacos: |
||||
discovery: |
||||
# 服务注册地址 |
||||
server-addr: 127.0.0.1:30099 |
||||
config: |
||||
server-addr: ${spring.cloud.nacos.discovery.server-addr} |
||||
file-extension: yaml |
||||
group: DEFAULT_GROUP |
||||
namespace: 69c4eecb-05bd-4041-81fe-1473f95f578c |
||||
extension-configs: |
||||
- # 数据源及Redis配置 |
||||
data-id: datasource.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 静态资源配置 |
||||
data-id: resources.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 系统配置 |
||||
data-id: system-config.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 框架中间件配置 |
||||
data-id: frame-config.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
- # 日志配置 |
||||
data-id: logger.yaml |
||||
group: DEFAULT_GROUP |
||||
refresh: true |
||||
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
<?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>jnpf-example</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-example-controller</artifactId> |
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-springaop</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-example-biz</artifactId> |
||||
<version>${project.version}</version> |
||||
<scope>compile</scope> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
|
||||
</project> |
||||
@ -0,0 +1,168 @@
@@ -0,0 +1,168 @@
|
||||
package jnpf.controller; |
||||
|
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.base.vo.PageListVO; |
||||
import jnpf.base.vo.PaginationVO; |
||||
import jnpf.entity.Base_datainterfaceEntity; |
||||
import jnpf.exception.DataException; |
||||
import jnpf.model.base_datainterface.*; |
||||
import jnpf.permission.entity.UserEntity; |
||||
import jnpf.service.Base_datainterfaceService; |
||||
import jnpf.util.*; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.io.IOException; |
||||
import java.util.ArrayList; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* base_datainterface |
||||
* @版本: V3.5 |
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组 |
||||
* @日期: 2024-06-19 |
||||
*/ |
||||
@Slf4j |
||||
@RestController |
||||
@Tag(name = "base_datainterface" , description = "example") |
||||
@RequestMapping("/Base_datainterface") |
||||
public class Base_datainterfaceController { |
||||
|
||||
@Autowired |
||||
private GeneraterSwapUtil generaterSwapUtil; |
||||
|
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
|
||||
@Autowired |
||||
private Base_datainterfaceService base_datainterfaceService; |
||||
|
||||
|
||||
|
||||
/** |
||||
* 列表 |
||||
* |
||||
* @param base_datainterfacePagination |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "获取列表") |
||||
@PostMapping("/getList") |
||||
public ActionResult list(@RequestBody Base_datainterfacePagination base_datainterfacePagination)throws IOException{ |
||||
List<Base_datainterfaceEntity> list= base_datainterfaceService.getList(base_datainterfacePagination); |
||||
List<Map<String, Object>> realList=new ArrayList<>(); |
||||
for (Base_datainterfaceEntity entity : list) { |
||||
Map<String, Object> base_datainterfaceMap=JsonUtil.entityToMap(entity); |
||||
base_datainterfaceMap.put("id", base_datainterfaceMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
realList.add(base_datainterfaceMap); |
||||
} |
||||
//数据转换
|
||||
realList = generaterSwapUtil.swapDataList(realList, Base_datainterfaceConstant.getFormData(), Base_datainterfaceConstant.getColumnData(), base_datainterfacePagination.getModuleId(),false); |
||||
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO(); |
||||
vo.setList(realList); |
||||
PaginationVO page = JsonUtil.getJsonToBean(base_datainterfacePagination, PaginationVO.class); |
||||
vo.setPagination(page); |
||||
return ActionResult.success(vo); |
||||
} |
||||
/** |
||||
* 创建 |
||||
* |
||||
* @param base_datainterfaceForm |
||||
* @return |
||||
*/ |
||||
@PostMapping() |
||||
@Transactional |
||||
@Operation(summary = "创建") |
||||
public ActionResult create(@RequestBody @Valid Base_datainterfaceForm base_datainterfaceForm) throws DataException { |
||||
String b = base_datainterfaceService.checkForm(base_datainterfaceForm,0); |
||||
if (StringUtil.isNotEmpty(b)){ |
||||
return ActionResult.fail(b ); |
||||
} |
||||
String mainId = RandomUtil.uuId() ; |
||||
UserInfo userInfo=userProvider.get(); |
||||
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); |
||||
base_datainterfaceForm = JsonUtil.getJsonToBean( |
||||
generaterSwapUtil.swapDatetime(Base_datainterfaceConstant.getFormData(),base_datainterfaceForm),Base_datainterfaceForm.class); |
||||
Base_datainterfaceEntity entity = JsonUtil.getJsonToBean(base_datainterfaceForm, Base_datainterfaceEntity.class); |
||||
entity.setId(mainId); |
||||
base_datainterfaceService.save(entity); |
||||
return ActionResult.success("创建成功"); |
||||
} |
||||
/** |
||||
* 编辑 |
||||
* @param id |
||||
* @param base_datainterfaceForm |
||||
* @return |
||||
*/ |
||||
@PutMapping("/{id}") |
||||
@Transactional |
||||
@Operation(summary = "更新") |
||||
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid Base_datainterfaceForm base_datainterfaceForm) throws DataException { |
||||
String b = base_datainterfaceService.checkForm(base_datainterfaceForm,1); |
||||
if (StringUtil.isNotEmpty(b)){ |
||||
return ActionResult.fail(b ); |
||||
} |
||||
UserInfo userInfo=userProvider.get(); |
||||
Base_datainterfaceEntity entity= base_datainterfaceService.getInfo(id); |
||||
if(entity!=null){ |
||||
base_datainterfaceForm = JsonUtil.getJsonToBean( |
||||
generaterSwapUtil.swapDatetime(Base_datainterfaceConstant.getFormData(),base_datainterfaceForm),Base_datainterfaceForm.class); |
||||
Base_datainterfaceEntity subentity=JsonUtil.getJsonToBean(base_datainterfaceForm, Base_datainterfaceEntity.class); |
||||
boolean b1 = base_datainterfaceService.updateById(subentity); |
||||
if (!b1){ |
||||
return ActionResult.fail("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); |
||||
} |
||||
return ActionResult.success("更新成功"); |
||||
}else{ |
||||
return ActionResult.fail("更新失败,数据不存在"); |
||||
} |
||||
} |
||||
/** |
||||
* 删除 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "删除") |
||||
@DeleteMapping("/{id}") |
||||
@Transactional |
||||
public ActionResult delete(@PathVariable("id") String id){ |
||||
Base_datainterfaceEntity entity= base_datainterfaceService.getInfo(id); |
||||
if(entity!=null){ |
||||
//主表数据删除
|
||||
base_datainterfaceService.delete(entity); |
||||
} |
||||
return ActionResult.success("删除成功"); |
||||
} |
||||
/** |
||||
* 获取详情(编辑页) |
||||
* 编辑页面使用-不转换数据 |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "信息") |
||||
@GetMapping("/{id}") |
||||
public ActionResult info(@PathVariable("id") String id){ |
||||
Base_datainterfaceEntity entity= base_datainterfaceService.getInfo(id); |
||||
if(entity==null){ |
||||
return ActionResult.fail("表单数据不存在!"); |
||||
} |
||||
Map<String, Object> base_datainterfaceMap=JsonUtil.entityToMap(entity); |
||||
base_datainterfaceMap.put("id", base_datainterfaceMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
base_datainterfaceMap = generaterSwapUtil.swapDataForm(base_datainterfaceMap,Base_datainterfaceConstant.getFormData(),Base_datainterfaceConstant.TABLEFIELDKEY,Base_datainterfaceConstant.TABLERENAMES); |
||||
return ActionResult.success(base_datainterfaceMap); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,329 @@
@@ -0,0 +1,329 @@
|
||||
package jnpf.controller; |
||||
|
||||
import cn.hutool.core.collection.CollectionUtil; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import cn.xuyanwu.spring.file.storage.FileInfo; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.base.vo.DownloadVO; |
||||
import jnpf.base.vo.PageListVO; |
||||
import jnpf.base.vo.PaginationVO; |
||||
import jnpf.constant.FileTypeConstant; |
||||
import jnpf.entity.BiddingProjectSubscribeEntity; |
||||
import jnpf.exception.DataException; |
||||
import jnpf.file.FileApi; |
||||
import jnpf.file.FileUploadApi; |
||||
import jnpf.model.bidding_project_subscribe.*; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
import jnpf.permission.entity.UserEntity; |
||||
import jnpf.service.BiddingProjectSubscribeService; |
||||
import jnpf.util.*; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.io.IOException; |
||||
import java.time.LocalDateTime; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
/** |
||||
* bidding_project_subscribe |
||||
* |
||||
* @版本: V3.5 |
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组 |
||||
* @日期: 2024-06-11 |
||||
*/ |
||||
@Slf4j |
||||
@RestController |
||||
@Tag(name = "bidding_project_subscribe", description = "example") |
||||
@RequestMapping("/Bidding_project_subscribe") |
||||
@AllArgsConstructor |
||||
public class BiddingProjectSubscribeController { |
||||
|
||||
private final GeneraterSwapUtil generaterSwapUtil; |
||||
private final FileApi fileApi; |
||||
private final FileUploadApi fileUploadApi; |
||||
|
||||
|
||||
private final UserProvider userProvider; |
||||
|
||||
|
||||
private final BiddingProjectSubscribeService biddingProjectSubscribeService; |
||||
|
||||
|
||||
/** |
||||
* 列表 |
||||
* |
||||
* @param biddingProjectSubscribePagination |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "获取列表") |
||||
@PostMapping("/getList") |
||||
public ActionResult list(@RequestBody BiddingProjectSubscribePagination biddingProjectSubscribePagination) throws IOException { |
||||
List<BiddingProjectSubscribeEntity> list = biddingProjectSubscribeService.getList(biddingProjectSubscribePagination); |
||||
List<Map<String, Object>> realList = new ArrayList<>(); |
||||
// // 方式一:使用fastjson
|
||||
// SerializeConfig config = new SerializeConfig();
|
||||
// config.propertyNamingStrategy = PropertyNamingStrategy.SnakeCase;
|
||||
for (BiddingProjectSubscribeEntity entity : list) { |
||||
|
||||
|
||||
Map<String, Object> bidding_project_subscribeMap = JsonUtil.entityToMap(entity); |
||||
|
||||
// Map<String, Object> bidding_project_subscribeMap= JSON.parseObject(text,Map.class);
|
||||
bidding_project_subscribeMap.put("id", bidding_project_subscribeMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
realList.add(bidding_project_subscribeMap); |
||||
} |
||||
//数据转换
|
||||
realList = generaterSwapUtil.swapDataList(realList, BiddingProjectSubscribeConstant.getFormData(), BiddingProjectSubscribeConstant.getColumnData(), biddingProjectSubscribePagination.getModuleId(), false); |
||||
|
||||
// // 创建ObjectMapper实例
|
||||
// ObjectMapper objectMapper = new ObjectMapper();
|
||||
//
|
||||
// // 配置ObjectMapper将驼峰转换为下划线
|
||||
// objectMapper.setPropertyNamingStrategy(Pro pertyNamingStrategies.SNAKE_CASE);
|
||||
//
|
||||
// // 禁用默认的换行输出
|
||||
// objectMapper.configure(SerializationFeature.INDENT_OUTPUT, false);
|
||||
// for (Map<String, Object> map : realList) {
|
||||
// String json = objectMapper.writeValueAsString(map);
|
||||
// System.out.println(json);
|
||||
// }
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO(); |
||||
vo.setList(realList); |
||||
PaginationVO page = JsonUtil.getJsonToBean(biddingProjectSubscribePagination, PaginationVO.class); |
||||
vo.setPagination(page); |
||||
return ActionResult.success(vo); |
||||
} |
||||
|
||||
/** |
||||
* 创建 |
||||
* |
||||
* @param bidding_project_subscribeForm |
||||
* @return |
||||
*/ |
||||
@PostMapping() |
||||
@Transactional |
||||
@Operation(summary = "创建") |
||||
public ActionResult create(@RequestBody @Valid BiddingProjectSubscribeForm bidding_project_subscribeForm) throws DataException { |
||||
String b = biddingProjectSubscribeService.checkForm(bidding_project_subscribeForm, 0); |
||||
if (StringUtil.isNotEmpty(b)) { |
||||
return ActionResult.fail(b); |
||||
} |
||||
String mainId = RandomUtil.uuId(); |
||||
UserInfo userInfo = userProvider.get(); |
||||
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); |
||||
bidding_project_subscribeForm = JsonUtil.getJsonToBean( |
||||
generaterSwapUtil.swapDatetime(BiddingProjectSubscribeConstant.getFormData(), bidding_project_subscribeForm), BiddingProjectSubscribeForm.class); |
||||
BiddingProjectSubscribeEntity entity = JsonUtil.getJsonToBean(bidding_project_subscribeForm, BiddingProjectSubscribeEntity.class); |
||||
entity.setPlanSubmissionTime(new Date()); |
||||
if (bidding_project_subscribeForm.getManagementStyle().equals("2")) { |
||||
entity.setResultReportingTime(new Date()); |
||||
entity.setIsApproval(true); |
||||
} |
||||
entity.setFlowtaskid(mainId); |
||||
entity.setCreateTime(LocalDateTime.now()); |
||||
entity.setUpdateTime(LocalDateTime.now()); |
||||
checkProjectAmount(entity); |
||||
biddingProjectSubscribeService.saveOrUpdate(entity); |
||||
if (StringUtil.equals(bidding_project_subscribeForm.getSaveType(), "1")) { |
||||
//修改流程 查询领导 新增子单数据 记录流程
|
||||
biddingProjectSubscribeService.updateFlow(userEntity, entity, true); |
||||
} else { |
||||
biddingProjectSubscribeService.temporaryStorage(userEntity, entity); |
||||
} |
||||
return ActionResult.success("创建成功"); |
||||
} |
||||
|
||||
private void checkProjectAmount(BiddingProjectSubscribeEntity entity) { |
||||
if (null==entity.getWinningBidderInfo())return; |
||||
if (StrUtil.isBlank(entity.getWinningBidderType()))return; |
||||
switch (entity.getWinningBidderType()){ |
||||
case "1": |
||||
entity.setProjectAmount(entity.getWinningBidderInfo().stream() |
||||
.map(BiddingProjectDto.WinningBidderParam::getAmount) |
||||
.mapToDouble(Double::parseDouble) |
||||
.sum()); |
||||
break; |
||||
case "2": |
||||
Double top = entity.getWinningBidderInfo().stream() |
||||
.map(BiddingProjectDto.WinningBidderParam::getAmount) |
||||
.mapToDouble(Double::parseDouble) |
||||
.sum(); |
||||
for (BiddingProjectDto.WinningBidderParam winningBidderParam : entity.getWinningBidderInfo()) { |
||||
if (CollectionUtil.isEmpty(winningBidderParam.getChildren()))continue; |
||||
top+=winningBidderParam.getChildren().stream() |
||||
.map(BiddingProjectDto.BaseWinningBidderParam::getAmount) |
||||
.mapToDouble(Double::parseDouble) |
||||
.sum(); |
||||
} |
||||
entity.setProjectAmount(top); |
||||
break; |
||||
default: |
||||
return; |
||||
} |
||||
} |
||||
|
||||
|
||||
@Operation(summary = "审核") |
||||
@PostMapping("/auditing") |
||||
public ActionResult auditing(@RequestBody BiddingProjectDto.AuditingParam param) throws IOException { |
||||
biddingProjectSubscribeService.auditing(param); |
||||
return ActionResult.success("审核成功"); |
||||
} |
||||
|
||||
@Operation(summary = "归档") |
||||
@PostMapping("/archivist") |
||||
public ActionResult archivist(@RequestBody BiddingProjectDto.ArchivistParam param) throws IOException { |
||||
biddingProjectSubscribeService.archivist(param); |
||||
return ActionResult.success("归档完成"); |
||||
} |
||||
|
||||
|
||||
@Operation(summary = "获取当前人层级层级") |
||||
@GetMapping("/obtainHierarchy") |
||||
public ActionResult obtainHierarchy() throws IOException { |
||||
String hierarchy = biddingProjectSubscribeService.obtainHierarchy(); |
||||
return ActionResult.success(hierarchy); |
||||
} |
||||
|
||||
@Operation(summary = "获取招标填报人员层级") |
||||
@GetMapping("/obtainHierarchyOfCreate") |
||||
public ActionResult obtainHierarchyOfCreate(@RequestParam String id) throws IOException { |
||||
String hierarchy = biddingProjectSubscribeService.obtainHierarchyOfCreate(id); |
||||
return ActionResult.success(hierarchy); |
||||
} |
||||
|
||||
@Operation(summary = "终止项目") |
||||
@PostMapping("/termination") |
||||
public ActionResult termination(@RequestParam String id) throws IOException { |
||||
biddingProjectSubscribeService.termination(id); |
||||
return ActionResult.success("操作成功"); |
||||
} |
||||
|
||||
@Operation(summary = "获取全部文件") |
||||
@GetMapping("/getAllFileInfo") |
||||
public ActionResult getAllFileInfo(@RequestParam String id) throws IOException { |
||||
return ActionResult.success(biddingProjectSubscribeService.getAllFileInfo(id)); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param id |
||||
* @param bidding_project_subscribeForm |
||||
* @return |
||||
*/ |
||||
@PutMapping("/{id}") |
||||
@Transactional |
||||
@Operation(summary = "更新") |
||||
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid BiddingProjectSubscribeForm bidding_project_subscribeForm) throws DataException { |
||||
String b = biddingProjectSubscribeService.checkForm(bidding_project_subscribeForm, 1); |
||||
if (StringUtil.isNotEmpty(b)) { |
||||
return ActionResult.fail(b); |
||||
} |
||||
UserInfo userInfo = userProvider.get(); |
||||
BiddingProjectSubscribeEntity entity = biddingProjectSubscribeService.getInfo(id); |
||||
if (entity != null) { |
||||
bidding_project_subscribeForm = JsonUtil.getJsonToBean( |
||||
generaterSwapUtil.swapDatetime(BiddingProjectSubscribeConstant.getFormData(), bidding_project_subscribeForm), BiddingProjectSubscribeForm.class); |
||||
BiddingProjectSubscribeEntity subentity = JsonUtil.getJsonToBean(bidding_project_subscribeForm, BiddingProjectSubscribeEntity.class); |
||||
subentity.setUpdateTime(LocalDateTime.now()); |
||||
subentity.setCreateTime(entity.getCreateTime()); |
||||
checkProjectAmount(subentity); |
||||
// subentity.setWinningBidderInfo(entity.getWinningBidderInfo());
|
||||
// subentity.setWinningBidderType(entity.getWinningBidderType());
|
||||
boolean b1 = biddingProjectSubscribeService.updateById(subentity); |
||||
if (!b1) { |
||||
return ActionResult.fail("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); |
||||
} |
||||
biddingProjectSubscribeService.updateFlowByUser(entity); |
||||
return ActionResult.success("更新成功"); |
||||
} else { |
||||
return ActionResult.fail("更新失败,数据不存在"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "删除") |
||||
@DeleteMapping("/{id}") |
||||
@Transactional |
||||
public ActionResult delete(@PathVariable("id") String id) { |
||||
BiddingProjectSubscribeEntity entity = biddingProjectSubscribeService.getInfo(id); |
||||
if (entity != null) { |
||||
//主表数据删除
|
||||
biddingProjectSubscribeService.delete(entity); |
||||
|
||||
} |
||||
return ActionResult.success("删除成功"); |
||||
} |
||||
|
||||
/** |
||||
* 获取详情(编辑页) |
||||
* 编辑页面使用-不转换数据 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "信息") |
||||
@GetMapping("/{id}") |
||||
public ActionResult info(@PathVariable("id") String id) { |
||||
BiddingProjectSubscribeEntity entity = biddingProjectSubscribeService.getInfo(id); |
||||
if (entity == null) { |
||||
return ActionResult.fail("表单数据不存在!"); |
||||
} |
||||
Map<String, Object> bidding_project_subscribeMap = JsonUtil.entityToMap(entity); |
||||
bidding_project_subscribeMap.put("id", bidding_project_subscribeMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
bidding_project_subscribeMap = generaterSwapUtil.swapDataForm(bidding_project_subscribeMap, BiddingProjectSubscribeConstant.getFormData(), BiddingProjectSubscribeConstant.TABLEFIELDKEY, BiddingProjectSubscribeConstant.TABLERENAMES); |
||||
return ActionResult.success(bidding_project_subscribeMap); |
||||
} |
||||
|
||||
/** |
||||
* @param type 1-备案表 2-审批 3-结果 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "下载文件") |
||||
@GetMapping("/download/{id}/{type}") |
||||
public ActionResult download(@PathVariable("id") String id, @PathVariable("type") String type) { |
||||
DownloadVO vo = DownloadVO.builder().build(); |
||||
MultipartFile multipartFile = biddingProjectSubscribeService.download(id, type); |
||||
String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY); |
||||
FileInfo fileInfo = fileUploadApi.uploadFile(multipartFile, temporaryFilePath, multipartFile.getOriginalFilename()); |
||||
vo.setName(fileInfo.getFilename()); |
||||
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + multipartFile.getOriginalFilename()); |
||||
return ActionResult.success(vo); |
||||
} |
||||
|
||||
@Operation(summary = "下载文件") |
||||
@PostMapping("/download/{id}/{type}") |
||||
public ActionResult download2(@PathVariable("id") String id, @PathVariable("type") String type,@RequestBody BiddingProjectSubscribeForm form) { |
||||
DownloadVO vo = DownloadVO.builder().build(); |
||||
BiddingProjectSubscribeEntity entity = JsonUtil.getJsonToBean(form, BiddingProjectSubscribeEntity.class); |
||||
MultipartFile multipartFile = biddingProjectSubscribeService.download(id, type,entity); |
||||
String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY); |
||||
FileInfo fileInfo = fileUploadApi.uploadFile(multipartFile, temporaryFilePath, multipartFile.getOriginalFilename()); |
||||
vo.setName(fileInfo.getFilename()); |
||||
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + multipartFile.getOriginalFilename()); |
||||
return ActionResult.success(vo); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,445 @@
@@ -0,0 +1,445 @@
|
||||
package jnpf.controller; |
||||
|
||||
import cn.afterturn.easypoi.excel.ExcelExportUtil; |
||||
import cn.afterturn.easypoi.excel.entity.ExportParams; |
||||
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; |
||||
import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity; |
||||
import cn.hutool.core.util.StrUtil; |
||||
import cn.xuyanwu.spring.file.storage.FileInfo; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.DictionaryDataApi; |
||||
import jnpf.base.UserInfo; |
||||
import jnpf.base.entity.DictionaryDataEntity; |
||||
import jnpf.base.vo.DownloadVO; |
||||
import jnpf.base.vo.PageListVO; |
||||
import jnpf.base.vo.PaginationVO; |
||||
import jnpf.config.ConfigValueUtil; |
||||
import jnpf.constant.FileTypeConstant; |
||||
import jnpf.entity.Bidding_project_statisticsEntity; |
||||
import jnpf.exception.DataException; |
||||
import jnpf.file.FileApi; |
||||
import jnpf.file.FileUploadApi; |
||||
import jnpf.model.bidding_project_statistics.*; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
import jnpf.permission.entity.UserEntity; |
||||
import jnpf.service.Bidding_project_statisticsService; |
||||
import jnpf.util.*; |
||||
import lombok.Cleanup; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
||||
import org.apache.poi.ss.usermodel.Workbook; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.transaction.annotation.Transactional; |
||||
import org.springframework.web.bind.annotation.*; |
||||
import org.springframework.web.multipart.MultipartFile; |
||||
|
||||
import javax.annotation.Resource; |
||||
import javax.validation.Valid; |
||||
import java.io.IOException; |
||||
import java.util.*; |
||||
import java.util.stream.Collectors; |
||||
|
||||
/** |
||||
* bidding_project_statistics |
||||
* |
||||
* @版本: V3.5 |
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组 |
||||
* @日期: 2024-06-13 |
||||
*/ |
||||
@Slf4j |
||||
@RestController |
||||
@Tag(name = "bidding_project_statistics", description = "example") |
||||
@RequestMapping("/Bidding_project_statistics") |
||||
public class Bidding_project_statisticsController { |
||||
|
||||
@Autowired |
||||
private GeneraterSwapUtil generaterSwapUtil; |
||||
|
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
|
||||
@Autowired |
||||
private Bidding_project_statisticsService bidding_project_statisticsService; |
||||
@Resource |
||||
private DictionaryDataApi dictionaryDataApi; |
||||
|
||||
|
||||
@Autowired |
||||
private ConfigValueUtil configValueUtil; |
||||
|
||||
@Autowired |
||||
private FileUploadApi fileUploadApi; |
||||
|
||||
@Autowired |
||||
private FileApi fileApi; |
||||
|
||||
/** |
||||
* 列表 |
||||
* |
||||
* @param bidding_project_statisticsPagination |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "获取列表") |
||||
@PostMapping("/getList") |
||||
public ActionResult list(@RequestBody Bidding_project_statisticsPagination bidding_project_statisticsPagination) throws IOException { |
||||
List<Map<String, Object>> list = bidding_project_statisticsService.getList(bidding_project_statisticsPagination); |
||||
List<Map<String, Object>> realList = new ArrayList<>(); |
||||
if (StrUtil.equalsAny(bidding_project_statisticsPagination.getQueryType(), "1","3")) { |
||||
for (Map<String, Object> entity : list) { |
||||
Map<String, Object> bidding_project_statisticsMap = JsonUtil.entityToMap(entity); |
||||
bidding_project_statisticsMap.put("id", bidding_project_statisticsMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
realList.add(bidding_project_statisticsMap); |
||||
} |
||||
} else { |
||||
List<DictionaryDataEntity> dataList = dictionaryDataApi.getList("dc6b2542d94b5434fc61ec1d59592901"); |
||||
for (Map<String, Object> entity : list) { |
||||
Map<String, Object> bidding_project_statisticsMap = new TreeMap<>(new Comparator<String>() { |
||||
@Override |
||||
public int compare(String o1, String o2) { |
||||
// 检查o1是否为"上报单位",如果是,则将其排在所有其他字符串之前
|
||||
if (StrUtil.equals(o1, "上报单位")) { |
||||
return -1; // 返回-1,表示o1应该排在o2之前
|
||||
} |
||||
if (StrUtil.equals(o1, "机构数量")) { |
||||
// 如果o2是"上报单位",则o1(即"机构数量")应该排在o2之后
|
||||
if (StrUtil.equals(o2, "上报单位")) { |
||||
return 1; // 返回1,表示o1应该排在o2之后
|
||||
} |
||||
return -1; // 返回-1,表示o1应该排在o2之前
|
||||
} |
||||
// 如果o1既不是"上报单位"也不是"机构数量",则检查o2是否为这两个特殊字符串之一
|
||||
if (StrUtil.equals(o2, "上报单位") || StrUtil.equals(o2, "机构数量")) { |
||||
return 1; // 返回1,表示o1应该排在o2之后
|
||||
} |
||||
if (StrUtil.equals(o1, "无")) { |
||||
return 1; |
||||
} |
||||
return o1.compareTo(o2); |
||||
} |
||||
}); |
||||
for (String key : entity.keySet()) { |
||||
if (StrUtil.equals(key, "reportingUnit")) { |
||||
bidding_project_statisticsMap.put("上报单位", entity.get(key)); |
||||
continue; |
||||
} |
||||
if (StrUtil.equals(key, "projectsNums")) { |
||||
bidding_project_statisticsMap.put("机构数量", entity.get(key)); |
||||
continue; |
||||
} |
||||
Optional<DictionaryDataEntity> first = dataList.stream().filter(data -> data.getSimpleSpelling().equals(key)).findFirst(); |
||||
if (!first.isPresent()) { |
||||
continue; |
||||
} |
||||
bidding_project_statisticsMap.put(first.get().getFullName(), entity.get(key)); |
||||
} |
||||
realList.add(bidding_project_statisticsMap); |
||||
} |
||||
} |
||||
//数据转换
|
||||
// realList = generaterSwapUtil.swapDataList(realList, Bidding_project_statisticsConstant.getFormData(), Bidding_project_statisticsConstant.getColumnData(), bidding_project_statisticsPagination.getModuleId(),false);
|
||||
|
||||
//返回对象
|
||||
PageListVO vo = new PageListVO(); |
||||
vo.setList(realList); |
||||
PaginationVO page = JsonUtil.getJsonToBean(bidding_project_statisticsPagination, PaginationVO.class); |
||||
vo.setPagination(page); |
||||
return ActionResult.success(realList); |
||||
} |
||||
|
||||
/** |
||||
* 导出Excel |
||||
* |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "导出Excel") |
||||
@PostMapping("/Actions/Export") |
||||
public ActionResult Export(@RequestBody Bidding_project_statisticsPagination bidding_project_statisticsPagination) throws IOException { |
||||
List<Map<String, Object>> list = bidding_project_statisticsService.getList(bidding_project_statisticsPagination); |
||||
List<Map<String, Object>> realList = new ArrayList<>(); |
||||
for (Map<String, Object> entity : list) { |
||||
Map<String, Object> bidding_project_statisticsMap = JsonUtil.entityToMap(entity); |
||||
bidding_project_statisticsMap.put("id", bidding_project_statisticsMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
realList.add(bidding_project_statisticsMap); |
||||
} |
||||
//数据转换
|
||||
// realList = generaterSwapUtil.swapDataList(realList, Bidding_project_statisticsConstant.getFormData(), Bidding_project_statisticsConstant.getColumnData(), bidding_project_statisticsPagination.getModuleId(), false);
|
||||
UserInfo userInfo = userProvider.get(); |
||||
DownloadVO vo = null; |
||||
if (StrUtil.equalsAny(bidding_project_statisticsPagination.getQueryType(), "1")) { |
||||
String[] keys = {"reportingUnit", |
||||
"projectsNums", |
||||
"engineering", |
||||
"goods", |
||||
"service", |
||||
"rentOut", |
||||
"agency1", |
||||
"other" |
||||
}; |
||||
vo = this.creatModelExcel(fileApi.getPath(FileTypeConstant.TEMPORARY), realList, Arrays.asList(keys), userInfo, bidding_project_statisticsPagination.getQueryType()); |
||||
|
||||
}else if (StrUtil.equalsAny(bidding_project_statisticsPagination.getQueryType(), "3")){ |
||||
String[] keys = {"reportingUnit", |
||||
"projectsAmount", |
||||
"engineering", |
||||
"goods", |
||||
"service", |
||||
"rentOut", |
||||
"agency1", |
||||
"other" |
||||
}; |
||||
vo = this.creatModelExcel(fileApi.getPath(FileTypeConstant.TEMPORARY), realList, Arrays.asList(keys), userInfo, bidding_project_statisticsPagination.getQueryType()); |
||||
}else { |
||||
//查询字典表
|
||||
List<DictionaryDataEntity> dataList = dictionaryDataApi.getList("dc6b2542d94b5434fc61ec1d59592901"); |
||||
vo = this.creatModelExcel(fileApi.getPath(FileTypeConstant.TEMPORARY), realList, dataList.stream().map(DictionaryDataEntity::getSimpleSpelling).collect(Collectors.toList()), userInfo, bidding_project_statisticsPagination.getQueryType()); |
||||
|
||||
} |
||||
return ActionResult.success(vo); |
||||
} |
||||
|
||||
/** |
||||
* 导出表格方法 |
||||
*/ |
||||
public DownloadVO creatModelExcel(String path, List<Map<String, Object>> list, List<String> keys, UserInfo userInfo, String queryType) { |
||||
DownloadVO vo = DownloadVO.builder().build(); |
||||
List<ExcelExportEntity> entitys = new ArrayList<>(); |
||||
if (StrUtil.equals(queryType, "1")) { |
||||
if (keys.size() > 0) { |
||||
for (String key : keys) { |
||||
switch (key) { |
||||
case "reportingUnit": |
||||
entitys.add(new ExcelExportEntity("上报单位", "reportingUnit",21)); |
||||
break; |
||||
case "projectsNums": |
||||
entitys.add(new ExcelExportEntity("项目数量", "projectsNums",20)); |
||||
break; |
||||
case "engineering": |
||||
entitys.add(new ExcelExportEntity("工程", "engineering",10)); |
||||
break; |
||||
case "goods": |
||||
entitys.add(new ExcelExportEntity("货物", "goods",10)); |
||||
break; |
||||
case "service": |
||||
entitys.add(new ExcelExportEntity("服务", "service",10)); |
||||
break; |
||||
case "rentOut": |
||||
entitys.add(new ExcelExportEntity("不动产出租", "rentOut",14)); |
||||
break; |
||||
case "agency1": |
||||
entitys.add(new ExcelExportEntity("资产处置", "agency1",11)); |
||||
break; |
||||
case "other": |
||||
entitys.add(new ExcelExportEntity("其他", "other",10)); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
List<String> keylist = keys; |
||||
} |
||||
} else if (StrUtil.equals(queryType, "3")) { |
||||
if (keys.size() > 0) { |
||||
for (String key : keys) { |
||||
switch (key) { |
||||
case "reportingUnit": |
||||
entitys.add(new ExcelExportEntity("上报单位", "reportingUnit",21)); |
||||
break; |
||||
case "projectsAmount": |
||||
entitys.add(new ExcelExportEntity("项目总金额", "projectsAmount",21)); |
||||
break; |
||||
case "engineering": |
||||
entitys.add(new ExcelExportEntity("工程", "engineering",10)); |
||||
break; |
||||
case "goods": |
||||
entitys.add(new ExcelExportEntity("货物", "goods",10)); |
||||
break; |
||||
case "service": |
||||
entitys.add(new ExcelExportEntity("服务", "service",10)); |
||||
break; |
||||
case "rentOut": |
||||
entitys.add(new ExcelExportEntity("不动产出租", "rentOut",14)); |
||||
break; |
||||
case "agency1": |
||||
entitys.add(new ExcelExportEntity("资产处置", "agency1",11)); |
||||
break; |
||||
case "other": |
||||
entitys.add(new ExcelExportEntity("其他", "other",10)); |
||||
break; |
||||
default: |
||||
break; |
||||
} |
||||
} |
||||
List<String> keylist = keys; |
||||
} |
||||
} else { |
||||
List<DictionaryDataEntity> dataList = dictionaryDataApi.getList("dc6b2542d94b5434fc61ec1d59592901"); |
||||
entitys.add(new ExcelExportEntity("上报单位", "reportingUnit",21)); |
||||
entitys.add(new ExcelExportEntity("机构数量", "projectsNums",20)); |
||||
for (DictionaryDataEntity dictionaryDataEntity : dataList) { |
||||
entitys.add(new ExcelExportEntity(dictionaryDataEntity.getFullName(), dictionaryDataEntity.getSimpleSpelling(),21)); |
||||
} |
||||
|
||||
} |
||||
String excelName = StrUtil.equals(queryType, "1") ? "项目数量统计" : "机构数量统计"; |
||||
ExportParams exportParams = new ExportParams(null, excelName); |
||||
exportParams.setType(ExcelType.XSSF); |
||||
try { |
||||
@Cleanup Workbook workbook = new HSSFWorkbook(); |
||||
if (entitys.size() > 0) { |
||||
if (list.size() == 0) { |
||||
list.add(new HashMap<>()); |
||||
} |
||||
//去除空数据
|
||||
List<Map<String, Object>> dataList = new ArrayList<>(); |
||||
for (Map<String, Object> map : list) { |
||||
int i = 0; |
||||
for (String key : keys) { |
||||
//子表
|
||||
if (key.toLowerCase().startsWith("tablefield")) { |
||||
String tableField = key.substring(0, key.indexOf("-")); |
||||
String field = key.substring(key.indexOf("-") + 1); |
||||
Object o = map.get(tableField); |
||||
if (o != null) { |
||||
List<Map<String, Object>> childList = (List<Map<String, Object>>) o; |
||||
for (Map<String, Object> childMap : childList) { |
||||
if (childMap.get(field) != null) { |
||||
i++; |
||||
} |
||||
} |
||||
} |
||||
} else { |
||||
Object o = map.get(key); |
||||
if (o != null) { |
||||
i++; |
||||
} |
||||
} |
||||
} |
||||
if (i > 0) { |
||||
dataList.add(map); |
||||
} |
||||
} |
||||
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, dataList); |
||||
} |
||||
String fileName = excelName + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx"; |
||||
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName); |
||||
String temporaryFilePath = fileApi.getPath(FileTypeConstant.TEMPORARY); |
||||
FileInfo fileInfo = fileUploadApi.uploadFile(multipartFile, temporaryFilePath, fileName); |
||||
vo.setName(fileInfo.getFilename()); |
||||
vo.setUrl(UploaderUtil.uploaderFile(fileInfo.getFilename() + "#" + "Temporary") + "&name=" + fileName); |
||||
} catch (Exception e) { |
||||
log.error("信息导出Excel错误:{}", e.getMessage()); |
||||
e.printStackTrace(); |
||||
} |
||||
return vo; |
||||
} |
||||
|
||||
@Operation(summary = "根据统计类型,单位名称,以及字段名称查询项目名称列表") |
||||
@PostMapping("/getProjectNameList") |
||||
public ActionResult getProjectNameList(@RequestBody BiddingProjectDto.GetProjectNameList param) { |
||||
return ActionResult.success(bidding_project_statisticsService.getProjectNameList(param)); |
||||
} |
||||
|
||||
/** |
||||
* 创建 |
||||
* |
||||
* @param bidding_project_statisticsForm |
||||
* @return |
||||
*/ |
||||
@PostMapping() |
||||
@Transactional |
||||
@Operation(summary = "创建") |
||||
public ActionResult create(@RequestBody @Valid Bidding_project_statisticsForm bidding_project_statisticsForm) throws DataException { |
||||
String b = bidding_project_statisticsService.checkForm(bidding_project_statisticsForm, 0); |
||||
if (StringUtil.isNotEmpty(b)) { |
||||
return ActionResult.fail(b); |
||||
} |
||||
String mainId = RandomUtil.uuId(); |
||||
UserInfo userInfo = userProvider.get(); |
||||
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId()); |
||||
bidding_project_statisticsForm = JsonUtil.getJsonToBean( |
||||
generaterSwapUtil.swapDatetime(Bidding_project_statisticsConstant.getFormData(), bidding_project_statisticsForm), Bidding_project_statisticsForm.class); |
||||
Bidding_project_statisticsEntity entity = JsonUtil.getJsonToBean(bidding_project_statisticsForm, Bidding_project_statisticsEntity.class); |
||||
entity.setId(mainId); |
||||
bidding_project_statisticsService.save(entity); |
||||
return ActionResult.success("创建成功"); |
||||
} |
||||
|
||||
/** |
||||
* 编辑 |
||||
* |
||||
* @param id |
||||
* @param bidding_project_statisticsForm |
||||
* @return |
||||
*/ |
||||
@PutMapping("/{id}") |
||||
@Transactional |
||||
@Operation(summary = "更新") |
||||
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid Bidding_project_statisticsForm bidding_project_statisticsForm) throws DataException { |
||||
String b = bidding_project_statisticsService.checkForm(bidding_project_statisticsForm, 1); |
||||
if (StringUtil.isNotEmpty(b)) { |
||||
return ActionResult.fail(b); |
||||
} |
||||
UserInfo userInfo = userProvider.get(); |
||||
Bidding_project_statisticsEntity entity = bidding_project_statisticsService.getInfo(id); |
||||
if (entity != null) { |
||||
bidding_project_statisticsForm = JsonUtil.getJsonToBean( |
||||
generaterSwapUtil.swapDatetime(Bidding_project_statisticsConstant.getFormData(), bidding_project_statisticsForm), Bidding_project_statisticsForm.class); |
||||
Bidding_project_statisticsEntity subentity = JsonUtil.getJsonToBean(bidding_project_statisticsForm, Bidding_project_statisticsEntity.class); |
||||
boolean b1 = bidding_project_statisticsService.updateById(subentity); |
||||
if (!b1) { |
||||
return ActionResult.fail("当前表单原数据已被调整,请重新进入该页面编辑并提交数据"); |
||||
} |
||||
return ActionResult.success("更新成功"); |
||||
} else { |
||||
return ActionResult.fail("更新失败,数据不存在"); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "删除") |
||||
@DeleteMapping("/{id}") |
||||
@Transactional |
||||
public ActionResult delete(@PathVariable("id") String id) { |
||||
Bidding_project_statisticsEntity entity = bidding_project_statisticsService.getInfo(id); |
||||
if (entity != null) { |
||||
//主表数据删除
|
||||
bidding_project_statisticsService.delete(entity); |
||||
} |
||||
return ActionResult.success("删除成功"); |
||||
} |
||||
|
||||
/** |
||||
* 获取详情(编辑页) |
||||
* 编辑页面使用-不转换数据 |
||||
* |
||||
* @param id |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "信息") |
||||
@GetMapping("/{id}") |
||||
public ActionResult info(@PathVariable("id") String id) { |
||||
Bidding_project_statisticsEntity entity = bidding_project_statisticsService.getInfo(id); |
||||
if (entity == null) { |
||||
return ActionResult.fail("表单数据不存在!"); |
||||
} |
||||
Map<String, Object> bidding_project_statisticsMap = JsonUtil.entityToMap(entity); |
||||
bidding_project_statisticsMap.put("id", bidding_project_statisticsMap.get("id")); |
||||
//副表数据
|
||||
//子表数据
|
||||
bidding_project_statisticsMap = generaterSwapUtil.swapDataForm(bidding_project_statisticsMap, Bidding_project_statisticsConstant.getFormData(), Bidding_project_statisticsConstant.TABLEFIELDKEY, Bidding_project_statisticsConstant.TABLERENAMES); |
||||
return ActionResult.success(bidding_project_statisticsMap); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,124 @@
@@ -0,0 +1,124 @@
|
||||
package jnpf.controller; |
||||
|
||||
|
||||
import io.swagger.v3.oas.annotations.Parameter; |
||||
import io.swagger.v3.oas.annotations.Parameters; |
||||
import jnpf.base.controller.SuperController; |
||||
import io.swagger.v3.oas.annotations.tags.Tag; |
||||
import io.swagger.v3.oas.annotations.Operation; |
||||
import jnpf.base.ActionResult; |
||||
import jnpf.base.Pagination; |
||||
import jnpf.base.vo.PageListVO; |
||||
import jnpf.base.vo.PaginationVO; |
||||
import jnpf.constant.MsgCode; |
||||
import jnpf.entity.ContractEntity; |
||||
import jnpf.model.ContractForm; |
||||
import jnpf.model.ContractInfoVO; |
||||
import jnpf.model.ContractListVO; |
||||
import jnpf.service.ContractService; |
||||
import jnpf.util.JsonUtil; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* Contract |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
@RestController |
||||
@Tag(name = "示例接口", description = "Contract") |
||||
@RequestMapping("/Contract") |
||||
public class ContractController extends SuperController<ContractService, ContractEntity> { |
||||
|
||||
@Autowired |
||||
private ContractService contractService; |
||||
|
||||
/** |
||||
* 获取列表 |
||||
* |
||||
* @param pagination 分页模型 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "获取列表") |
||||
@GetMapping("/List") |
||||
public ActionResult<PageListVO<ContractListVO>> list(Pagination pagination) { |
||||
List<ContractEntity> entity = contractService.getlist(pagination); |
||||
List<ContractListVO> listVo = JsonUtil.getJsonToList(JsonUtil.getObjectToStringDateFormat(entity, "yyyy-MM-dd HH:mm:ss"), ContractListVO.class); |
||||
PaginationVO vo = JsonUtil.getJsonToBean(pagination, PaginationVO.class); |
||||
return ActionResult.page(listVo, vo); |
||||
} |
||||
|
||||
/** |
||||
* 获取详情 |
||||
* |
||||
* @param id 主键 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "获取详情") |
||||
@GetMapping("/{id}") |
||||
@Parameters({ |
||||
@Parameter(name = "id", description = "主键", required = true), |
||||
}) |
||||
public ActionResult<ContractInfoVO> info(@PathVariable("id") String id) { |
||||
ContractEntity entity = contractService.getInfo(id); |
||||
ContractInfoVO vo = JsonUtil.getJsonToBean(entity, ContractInfoVO.class); |
||||
return ActionResult.success(vo); |
||||
} |
||||
|
||||
/** |
||||
* 新建 |
||||
* |
||||
* @param contractForm 新建模型 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "新建") |
||||
@PostMapping |
||||
@Parameters({ |
||||
@Parameter(name = "contractForm", description = "示例模型",required = true), |
||||
}) |
||||
public ActionResult create(@RequestBody @Valid ContractForm contractForm) { |
||||
ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class); |
||||
contractService.create(entity); |
||||
return ActionResult.success(MsgCode.SU002.get()); |
||||
} |
||||
|
||||
/** |
||||
* @param id 主键 |
||||
* @param contractForm 修改模型 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "修改") |
||||
@PutMapping("/{id}") |
||||
@Parameters({ |
||||
@Parameter(name = "contractForm", description = "示例模型",required = true), |
||||
@Parameter(name = "id", description = "主键", required = true), |
||||
}) |
||||
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid ContractForm contractForm) { |
||||
ContractEntity entity = JsonUtil.getJsonToBean(contractForm, ContractEntity.class); |
||||
contractService.update(id, entity); |
||||
return ActionResult.success(MsgCode.SU002.get()); |
||||
} |
||||
|
||||
/** |
||||
* 删除 |
||||
* |
||||
* @param id 主键 |
||||
* @return |
||||
*/ |
||||
@Operation(summary = "删除") |
||||
@DeleteMapping("/{id}") |
||||
@Parameters({ |
||||
@Parameter(name = "id", description = "主键", required = true), |
||||
}) |
||||
public ActionResult delete(@PathVariable("id") String id) { |
||||
ContractEntity entity = contractService.getInfo(id); |
||||
contractService.delete(entity); |
||||
return ActionResult.success(MsgCode.SU003.get()); |
||||
} |
||||
|
||||
} |
||||
@ -0,0 +1,38 @@
@@ -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>jnpf-example</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-example-dubboservice</artifactId> |
||||
<description>Dubbo服务提供业务实现</description> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.alibaba.cloud</groupId> |
||||
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.alibaba.csp</groupId> |
||||
<artifactId>sentinel-apache-dubbo-adapter</artifactId> |
||||
</dependency> |
||||
|
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-provider-example</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-example-biz</artifactId> |
||||
<version>${project.version}</version> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -0,0 +1,35 @@
@@ -0,0 +1,35 @@
|
||||
package jnpf.example.dubboservice; |
||||
|
||||
import jnpf.base.UserInfo; |
||||
import jnpf.entity.ContractEntity; |
||||
import jnpf.provider.example.ContractProvider; |
||||
import jnpf.service.ContractService; |
||||
import jnpf.util.UserProvider; |
||||
import org.apache.dubbo.config.annotation.DubboService; |
||||
import org.apache.dubbo.rpc.RpcContext; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
||||
/** |
||||
* @author JNPF开发平台组 |
||||
* @version V3.1.0 |
||||
* @copyright 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @date 2021-06-21 |
||||
*/ |
||||
@DubboService |
||||
public class ContractProviderImpl implements ContractProvider { |
||||
@Autowired |
||||
private ContractService contractService; |
||||
@Autowired |
||||
private UserProvider userProvider; |
||||
|
||||
@Override |
||||
public ContractEntity getInfo(String id) { |
||||
/** 获取传递过来的值 */ |
||||
String token = RpcContext.getContext().getAttachment("Authorization"); |
||||
//通过token获取当前登录信息
|
||||
UserInfo userInfo = userProvider.get(token); |
||||
/** 使用dubbo传输的类必须序列化 */ |
||||
ContractEntity entity = contractService.getInfo(id); |
||||
return entity; |
||||
} |
||||
} |
||||
@ -0,0 +1,21 @@
@@ -0,0 +1,21 @@
|
||||
<?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>jnpf-example</artifactId> |
||||
<groupId>com.jnpf</groupId> |
||||
<version>3.7.0-RELEASE</version> |
||||
</parent> |
||||
<modelVersion>4.0.0</modelVersion> |
||||
|
||||
<artifactId>jnpf-example-entity</artifactId> |
||||
|
||||
<dependencies> |
||||
<dependency> |
||||
<groupId>com.jnpf</groupId> |
||||
<artifactId>jnpf-common-database</artifactId> |
||||
</dependency> |
||||
</dependencies> |
||||
|
||||
</project> |
||||
@ -0,0 +1,75 @@
@@ -0,0 +1,75 @@
|
||||
package jnpf.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.util.Date; |
||||
/** |
||||
* 数据接口 |
||||
* |
||||
* @版本: V3.5 |
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组 |
||||
* @日期: 2024-06-19 |
||||
*/ |
||||
@Data |
||||
@TableName("base_datainterface") |
||||
public class Base_datainterfaceEntity { |
||||
@TableId(value ="F_ID" ) |
||||
private String id; |
||||
@TableField(value = "F_CATEGORYID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String categoryid; |
||||
@TableField(value = "F_FULLNAME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String fullname; |
||||
@TableField("F_PATH") |
||||
private String path; |
||||
@TableField(value = "F_REQUESTMETHOD" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String requestmethod; |
||||
@TableField(value = "F_RESPONSETYPE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String responsetype; |
||||
@TableField("F_QUERY") |
||||
private String query; |
||||
@TableField("F_REQUESTPARAMETERS") |
||||
private String requestparameters; |
||||
@TableField("F_IPADDRESS") |
||||
private String ipaddress; |
||||
@TableField("F_ENCODE") |
||||
private String encode; |
||||
@TableField("F_SORTCODE") |
||||
private Long sortcode; |
||||
@TableField("F_ENABLEDMARK") |
||||
private Integer enabledmark; |
||||
@TableField("F_DESCRIPTION") |
||||
private String description; |
||||
@TableField("F_CREATORTIME") |
||||
private Date creatortime; |
||||
@TableField("F_CREATORUSERID") |
||||
private String creatoruserid; |
||||
@TableField("F_LASTMODIFYTIME") |
||||
private Date lastmodifytime; |
||||
@TableField("F_LASTMODIFYUSERID") |
||||
private String lastmodifyuserid; |
||||
@TableField(value = "F_DELETEMARK" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Integer deletemark; |
||||
@TableField("F_DELETETIME") |
||||
private Date deletetime; |
||||
@TableField("F_DELETEUSERID") |
||||
private String deleteuserid; |
||||
@TableField("F_DBLINKID") |
||||
private String dblinkid; |
||||
@TableField("F_DATATYPE") |
||||
private Integer datatype; |
||||
@TableField("F_CHECKTYPE") |
||||
private Integer checktype; |
||||
@TableField("F_REQUESTHEADERS") |
||||
private String requestheaders; |
||||
@TableField("F_DATAPROCESSING") |
||||
private String dataprocessing; |
||||
@TableField("F_TENANTID") |
||||
private String tenantid; |
||||
@TableField("F_FLOWID") |
||||
private String flowid; |
||||
} |
||||
@ -0,0 +1,91 @@
@@ -0,0 +1,91 @@
|
||||
package jnpf.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Builder; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* <p> |
||||
* |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
@Data |
||||
@TableName("bidding_project_subscribe_child") |
||||
@Builder |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class BiddingProjectSubscribeChild implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@TableId(value = "child_id", type = IdType.INPUT) |
||||
private String childId; |
||||
|
||||
@TableField(value = "main_id") |
||||
private String mainId; |
||||
|
||||
// @ApiModelProperty("状态")
|
||||
@TableField(value = "child_status") |
||||
private String childStatus; |
||||
|
||||
// @ApiModelProperty("状态名称")
|
||||
@TableField(value = "child_status_name") |
||||
private String childStatusName; |
||||
|
||||
// @ApiModelProperty("人员所属部门")
|
||||
@TableField(value = "user_dept_id") |
||||
private String userDeptId; |
||||
|
||||
// @ApiModelProperty("人员所属部门名称")
|
||||
@TableField(value = "user_dept_name") |
||||
private String userDeptName; |
||||
|
||||
// @ApiModelProperty("操作人员id")
|
||||
@TableField(value = "user_id") |
||||
private String userId; |
||||
|
||||
// @ApiModelProperty("操作人员名称")
|
||||
@TableField(value = "user_name") |
||||
private String userName; |
||||
|
||||
// @ApiModelProperty("描述")
|
||||
@TableField(value = "remake") |
||||
private String remake; |
||||
|
||||
// @ApiModelProperty("创建时间")
|
||||
@TableField(value = "create_time") |
||||
private LocalDateTime createTime; |
||||
|
||||
// @ApiModelProperty("更新时间")
|
||||
@TableField(value = "update_time") |
||||
private LocalDateTime updateTime; |
||||
//根子单标记 "1" 非根子单 "0"
|
||||
@TableField(value = "root_child_flag") |
||||
private String rootChildFlag; |
||||
|
||||
|
||||
//非根子单时根子单的id
|
||||
@TableField(value = "root_child_id") |
||||
private String rootChildId; |
||||
|
||||
//创建人id
|
||||
@TableField(value = "create_user_id") |
||||
private String createUserId; |
||||
|
||||
//创建人姓名
|
||||
@TableField(value = "create_user_name") |
||||
private String createUserName; |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,173 @@
@@ -0,0 +1,173 @@
|
||||
package jnpf.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.*; |
||||
import jnpf.enump.BiddingProjectEnum; |
||||
import jnpf.model.JsonTypeHandler; |
||||
import jnpf.model.dto.BiddingProjectDto; |
||||
import lombok.Data; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.ArrayList; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 招标项目表申请表 |
||||
* |
||||
* @版本: V3.5 |
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组 |
||||
* @日期: 2024-06-11 |
||||
*/ |
||||
@Data |
||||
@TableName(value = "bidding_project_subscribe",autoResultMap = true) |
||||
public class BiddingProjectSubscribeEntity { |
||||
@TableId(value ="ID" ,type = IdType.AUTO ) |
||||
private Integer id; |
||||
@TableField(value = "MANAGEMENT_STYLE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String managementStyle; |
||||
@TableField(value = "PROJECT_NUMBER" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String projectNumber; |
||||
@TableField(value = "PLAN_SUBMISSION_TIME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Date planSubmissionTime; |
||||
@TableField(value = "REPORTING_CORP" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String reportingCorp; |
||||
@TableField(value = "TENDERING_ENTITY" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String tenderingEntity; |
||||
@TableField(value = "PROJECT_NAME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String projectName; |
||||
@TableField(value = "ITEM_CLASSIFICATION" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String itemClassification; |
||||
@TableField(value = "ORGANIZATIONAL_FORM" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String organizationalForm; |
||||
@TableField(value = "BIDDING_METHOD" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String biddingMethod; |
||||
@TableField("REPORTED_FILE_NAME") |
||||
private String reportedFileName; |
||||
@TableField(value = "BIDDING_DOCUMENT_ID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String biddingDocumentId; |
||||
@TableField(value = "DECISION_PROCEDURE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String decisionProcedure; |
||||
@TableField(value = "APPROVAL_DOCUMENTS_ID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String approvalDocumentsId; |
||||
@TableField(value = "FINAL_APPROVAL_TIME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Date finalApprovalTime; |
||||
@TableField(value = "SETTING_OF_WINNING_BIDDER_ONE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String settingOwinningBidderOne; |
||||
@TableField(value = "SETTING_OF_WINNING_BIDDER_TWO" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String settingOwinningBidderTwo; |
||||
@TableField(value = "SCORING_INDICATOR_SETTINGS_ONE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String scoringIndicatorSettingsOne; |
||||
@TableField("SCORING_INDICATOR_SETTINGS_TWO") |
||||
private String scoringIndicatorSettingsTwo; |
||||
@TableField("SCORING_INDICATOR_SETTINGS_THREE") |
||||
private String scoringIndicatorSettingsThree; |
||||
@TableField("SCORING_INDICATOR_SETTINGS_FOUR") |
||||
private String scoringIndicatorSettingsFour; |
||||
@TableField(value = "AGENCY_ONE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String agencyOne; |
||||
@TableField("AGENCY_TWO") |
||||
private String agencyTwo; |
||||
@TableField(value = "SCORING_METHOD_ONE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String scoringMethodOne; |
||||
@TableField(value = "SCORING_METHOD_TWO" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String scoringMethodTwo; |
||||
@TableField("APPROVAL_DOCUMENTS_ID_TWO") |
||||
private String approvalDocumentsIdTwo; |
||||
@TableField(value = "RESULT_REPORTING_TIME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Date resultReportingTime; |
||||
@TableField(value = "RESULT_REPORTED_FILE_NAME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String resultReportedFileName; |
||||
@TableField(value = "BID_OPENING_TIME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Date bidOpeningTime; |
||||
@TableField(value = "EXPLANATION_OF_BID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String explanationObid; |
||||
@TableField(value = "WINNING_BIDDER_AND_WINNING_AMOUNT" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String winningBidderAndWinningAmount; |
||||
@TableField(value = "BID_EVALUATION_COMMITTEE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String bidEvaluationCommittee; |
||||
@TableField(value = "TENDER_AGENCY_FEE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String tenderAgencyFee; |
||||
@TableField(value = "ATTACHMENT_OF_BIDDING_RESULTS_ONE_ID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String attachmentObiddingResultsOneId; |
||||
@TableField("ATTACHMENT_OF_BIDDING_RESULTS_TWO_ID") |
||||
private String attachmentObiddingResultsTwoId; |
||||
@TableField("WINNING_BIDDER") |
||||
private String winningBidder; |
||||
@TableField(value = "WINNING_BIDDER_CANDIDATE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String winningBidderCandidate; |
||||
@TableField(value = "FILING_DECISION_PROCEDURE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String filingDecisionProcedure; |
||||
@TableField(value = "FILING_RESULTS_ONE_ID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String filingResultsOneId; |
||||
@TableField("FILING_RESULTS_TWO_ID") |
||||
private String filingResultsTwoId; |
||||
@TableField(value = "APPROVAL_TIME_FOR_RESULTS" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Date approvalTimeForResults; |
||||
@TableField("F_FLOWID") |
||||
private String flowid; |
||||
@TableField("F_FLOWTASKID") |
||||
private String flowtaskid; |
||||
@TableField(value = "ANNEX_PROGRAMME_DOCUMENT" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String annexProgrammeDocument; |
||||
@TableField("MAIN_STATUS") |
||||
private String mainStatus; |
||||
@TableField("MAIN_STATUS_NAME") |
||||
private String mainStatusName; |
||||
@TableField("BID_WINNING_AMOUNT") |
||||
private String bidWinningAmount; |
||||
@TableField("IS_APPROVAL") |
||||
private Boolean isApproval; |
||||
@TableField(value = "QUERY_TYPE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String queryType; |
||||
@TableField(value = "APPROVAL_DOCUMENTS_ID_JT" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String approvalDocumentsIdJt; |
||||
@TableField(value = "ARCHIVE_NUMBER" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String archiveNumber; |
||||
@TableField(value = "CONTROL_PRICE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private Double controlPrice; |
||||
@TableField(value = "FILING_RESULTS_THREE_ID" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String filingResultsThreeId; |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@TableField(value = "WINNING_BIDDER_INFO",typeHandler = JsonTypeHandler.class) |
||||
private List<BiddingProjectDto.WinningBidderParam> winningBidderInfo; |
||||
/** |
||||
*1-单一 2-多标段 3-入围机制 |
||||
*/ |
||||
@TableField("project_amount") |
||||
private Double projectAmount; |
||||
@TableField("WINNING_BIDDER_TYPE") |
||||
private String winningBidderType; |
||||
@TableField(value = "CREATE_TIME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private LocalDateTime createTime; |
||||
@TableField(value = "UPDATE_TIME" , updateStrategy = FieldStrategy.IGNORED) |
||||
private LocalDateTime updateTime; |
||||
@TableField(exist = false) |
||||
private List<BiddingProjectSubscribeChild> childList; |
||||
@TableField(exist = false) |
||||
private List<BiddingProjectSubscribeStep> stepList; |
||||
|
||||
|
||||
@TableField(exist = false) |
||||
private List<BiddingProjectEnum.Button> buttonList=new ArrayList<>(); |
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,97 @@
@@ -0,0 +1,97 @@
|
||||
package jnpf.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Builder; |
||||
import lombok.Data; |
||||
import lombok.NoArgsConstructor; |
||||
|
||||
import java.io.Serializable; |
||||
import java.time.LocalDateTime; |
||||
|
||||
/** |
||||
* <p> |
||||
* |
||||
* </p> |
||||
* |
||||
* @author admin |
||||
* @since 2024-06-11 |
||||
*/ |
||||
@TableName("bidding_project_subscribe_step") |
||||
@Builder |
||||
@Data |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
//@apiModel(value = "BiddingProjectSubscribeStep对象", description = "")
|
||||
public class BiddingProjectSubscribeStep implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
//@apiModelProperty("主键")
|
||||
@TableId(value = "id", type = IdType.AUTO) |
||||
private Integer id; |
||||
|
||||
//@apiModelProperty("关联id")
|
||||
@TableField(value = "relation_main_id") |
||||
private String relationMainId; |
||||
|
||||
//@apiModelProperty("关联类型")
|
||||
@TableField(value = "relation_type") |
||||
|
||||
private String relationType; |
||||
|
||||
//@apiModelProperty("子单关联id")
|
||||
@TableField(value = "relation_child_id") |
||||
|
||||
private String relationChildId; |
||||
|
||||
//@apiModelProperty("处理类型")
|
||||
@TableField(value = "deal_type") |
||||
|
||||
private String dealType; |
||||
|
||||
//@apiModelProperty("处理类型名称")
|
||||
@TableField(value = "deal_type_name") |
||||
|
||||
private String dealTypeName; |
||||
|
||||
//@apiModelProperty("第三方关联id")
|
||||
@TableField(value = "other_relation_id") |
||||
|
||||
private String otherRelationId; |
||||
|
||||
//@apiModelProperty("描述")
|
||||
@TableField(value = "remake") |
||||
|
||||
private String remake; |
||||
|
||||
//@apiModelProperty("创建时间")
|
||||
@TableField(value = "create_time") |
||||
|
||||
private LocalDateTime createTime; |
||||
|
||||
//@apiModelProperty("创建人id")
|
||||
@TableField(value = "create_user_id") |
||||
|
||||
private String createUserId; |
||||
|
||||
//@apiModelProperty("创建人姓名")
|
||||
@TableField(value = "create_user_name") |
||||
|
||||
private String createUserName; |
||||
|
||||
//@apiModelProperty("创建者组织id")
|
||||
@TableField(value = "create_organization_id") |
||||
|
||||
private String createOrganizationId; |
||||
|
||||
//@apiModelProperty("创建人组织名称")
|
||||
@TableField(value = "create_organization_name") |
||||
|
||||
private String createOrganizationName; |
||||
|
||||
|
||||
} |
||||
@ -0,0 +1,55 @@
@@ -0,0 +1,55 @@
|
||||
package jnpf.entity; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldStrategy; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* 招标情况统计表 |
||||
* |
||||
* @版本: V3.5 |
||||
* @版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* @作者: JNPF开发平台组 |
||||
* @日期: 2024-06-13 |
||||
*/ |
||||
@Data |
||||
@TableName("bidding_project_statistics") |
||||
public class Bidding_project_statisticsEntity { |
||||
@TableId(value ="ID" ) |
||||
private String id; |
||||
@TableField("F_FLOWID") |
||||
private String flowid; |
||||
@TableField("REPORTING_UNIT") |
||||
private String reportingUnit; |
||||
@TableField("PROJECTS_NUMS") |
||||
private String projectsNums; |
||||
|
||||
@TableField(exist = false) |
||||
private String projectsAmount; |
||||
@TableField(value = "F_ENGINEERING" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String engineering; |
||||
@TableField(value = "F_GOODS" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String goods; |
||||
@TableField(value = "F_SERVICE" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String service; |
||||
@TableField(value = "RENT_OUT" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String rentOut; |
||||
@TableField(value = "F_OTHER" , updateStrategy = FieldStrategy.IGNORED) |
||||
private String other; |
||||
@TableField("REPORTING_UNIT_2") |
||||
private String reportingUnit2; |
||||
@TableField("PROJECTS_NUMS_2") |
||||
private String projectsNums2; |
||||
@TableField("F_AGENCY_1") |
||||
private String agency1; |
||||
@TableField("F_AGENCY_2") |
||||
private String agency2; |
||||
@TableField("F_AGENCY_3") |
||||
private String agency3; |
||||
@TableField("F_AGENCY_4") |
||||
private String agency4; |
||||
@TableField("F_OTHER_2") |
||||
private String other2; |
||||
} |
||||
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
package jnpf.entity; |
||||
|
||||
import jnpf.base.entity.SuperBaseEntity; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* |
||||
* Contract |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
@Data |
||||
@TableName("test_contract") |
||||
public class ContractEntity extends SuperBaseEntity.SuperTBaseEntity<String> implements Serializable { |
||||
|
||||
@TableField("F_CONTRACTNAME") |
||||
private String contractName; |
||||
|
||||
@TableField("F_MYTELEPHONE") |
||||
private String mytelePhone; |
||||
|
||||
@TableField("F_FILEJSON") |
||||
private String fileJson; |
||||
|
||||
} |
||||
@ -0,0 +1,266 @@
@@ -0,0 +1,266 @@
|
||||
package jnpf.enump; |
||||
|
||||
import lombok.Builder; |
||||
import lombok.Data; |
||||
|
||||
public class BiddingProjectEnum { |
||||
|
||||
public enum ChildStatusEnum { |
||||
TO_BE_EDIT("0", "待修改"), |
||||
//待审核
|
||||
PENDING_REVIEW("1", "待审核"), |
||||
//已退回
|
||||
RETURNED("2", "已驳回"), |
||||
//已通过
|
||||
PASS("3", "已通过"), |
||||
TO_BE_SUBMITTED("4", "待提交"), |
||||
SUBMITTED("5", "已提交/修改"), |
||||
TO_BE_ARCHIVED("6", "待归档"), |
||||
ARCHIVED("7", "已归档"), |
||||
; |
||||
|
||||
private String code; |
||||
private String describe; |
||||
|
||||
ChildStatusEnum(String code, String describe) { |
||||
this.code = code; |
||||
this.describe = describe; |
||||
|
||||
} |
||||
|
||||
//根据roleKey返回 enum
|
||||
// public static CoordinationEnum.RoleEnum getNameByRoleKey(String roleKey) {
|
||||
// for (CoordinationEnum.RoleEnum enm : CoordinationEnum.RoleEnum.values()) {
|
||||
// if (enm.getRoleKey().equals(roleKey)) {
|
||||
// return enm;
|
||||
// }
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getDescribe() { |
||||
return describe; |
||||
} |
||||
|
||||
public void setDescribe(String describe) { |
||||
this.describe = describe; |
||||
} |
||||
} |
||||
|
||||
|
||||
public enum MainStatusEnum { |
||||
//待审核
|
||||
PENDING_REVIEW("1", "待审核(子集团)"), |
||||
PENDING_REVIEW_JT("2", "待审核(集团)"), |
||||
PENDING_REVIEW_XM("8", "待审核(项目单位)"), |
||||
//已退回
|
||||
RETURNED("3", "已驳回"), |
||||
//已通过
|
||||
PASS("4", "审核通过"), |
||||
BE_SUBMITTED("6", "待提交(招标结果)"), |
||||
//已归档
|
||||
ARCHIVIST("5", "待归档"), |
||||
ARCHIVED("7", "已归档"), |
||||
PROJECT_TERMINATION("9", "已终止"), |
||||
TO_BE_SUBMITTED("10", "待提交"), |
||||
; |
||||
|
||||
private String code; |
||||
private String describe; |
||||
|
||||
MainStatusEnum(String code, String describe) { |
||||
this.code = code; |
||||
this.describe = describe; |
||||
|
||||
} |
||||
|
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getDescribe() { |
||||
return describe; |
||||
} |
||||
|
||||
public void setDescribe(String describe) { |
||||
this.describe = describe; |
||||
} |
||||
} |
||||
|
||||
|
||||
//部分角色枚举 用用到就加进来
|
||||
public enum RootFlagEnum { |
||||
//发布类型
|
||||
ROOT_FLAG("1", "根子单"), |
||||
NOT_ROOT_FLAG("0", "非根子单"), |
||||
; |
||||
|
||||
private String code; |
||||
private String describe; |
||||
|
||||
RootFlagEnum(String code, String describe) { |
||||
this.code = code; |
||||
this.describe = describe; |
||||
|
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getDescribe() { |
||||
return describe; |
||||
} |
||||
|
||||
public void setDescribe(String describe) { |
||||
this.describe = describe; |
||||
} |
||||
} |
||||
|
||||
//关联类型枚举
|
||||
public enum StepRelationTypeEnum { |
||||
//发布类型
|
||||
BIDDING("1", "招标"), |
||||
; |
||||
|
||||
private String code; |
||||
private String describe; |
||||
|
||||
StepRelationTypeEnum(String code, String describe) { |
||||
this.code = code; |
||||
this.describe = describe; |
||||
|
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getDescribe() { |
||||
return describe; |
||||
} |
||||
|
||||
public void setDescribe(String describe) { |
||||
this.describe = describe; |
||||
} |
||||
} |
||||
|
||||
//步骤状态枚举
|
||||
public enum StepTypeEnum { |
||||
LAUNCH("1", "流程发起"), |
||||
//三级发起/二级审核后/一级发起
|
||||
AUTOMATIC_DISPATCH("2", "系统自动流转"), |
||||
AUDITING_AGREE("3", "上级审核同意"), |
||||
AUDITING_DISAGREE("4", "上级审核不同意"), |
||||
ARCHIVIST("5", "归档"), |
||||
MATERIAL_MODIFICATION("6", "材料修改/上传"), |
||||
ARCHIVE_UPLOAD("7", "归档材料上传"), |
||||
PROCESS_TERMINATION("8", "流程终止"), |
||||
; |
||||
|
||||
private String code; |
||||
private String describe; |
||||
|
||||
StepTypeEnum(String code, String describe) { |
||||
this.code = code; |
||||
this.describe = describe; |
||||
|
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getDescribe() { |
||||
return describe; |
||||
} |
||||
|
||||
public void setDescribe(String describe) { |
||||
this.describe = describe; |
||||
} |
||||
} |
||||
|
||||
@Data |
||||
@Builder |
||||
public static class Button { |
||||
// @ApiModelProperty("按钮动作")
|
||||
private String act; |
||||
// @ApiModelProperty("按钮名称")
|
||||
private String buttonName; |
||||
|
||||
} |
||||
|
||||
//业务部门管理状态
|
||||
public enum ButtonEnum { |
||||
CHECK("1", "查看"), |
||||
AUDITING("2", "审核"), |
||||
EDIT("3", "编辑"), |
||||
ARCHIVIST("4", "归档"), |
||||
TERMINATION("5", "终止"), |
||||
DOWNLOAD("6", "下载"), |
||||
|
||||
; |
||||
|
||||
|
||||
private String code; |
||||
private String name; |
||||
|
||||
ButtonEnum(String action, String name) { |
||||
this.code = action; |
||||
this.name = name; |
||||
|
||||
} |
||||
|
||||
|
||||
public static ButtonEnum getEnumByCode(String code) { |
||||
for (ButtonEnum enm : ButtonEnum.values()) { |
||||
if (enm.getCode().equals(code)) { |
||||
return enm; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
public String getCode() { |
||||
return code; |
||||
} |
||||
|
||||
public void setCode(String code) { |
||||
this.code = code; |
||||
} |
||||
|
||||
public String getName() { |
||||
return name; |
||||
} |
||||
|
||||
public void setName(String name) { |
||||
this.name = name; |
||||
} |
||||
} |
||||
} |
||||
@ -0,0 +1,25 @@
@@ -0,0 +1,25 @@
|
||||
package jnpf.model; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
@Data |
||||
public class ContractForm { |
||||
|
||||
@Schema(description ="姓名") |
||||
private String contractName; |
||||
|
||||
@Schema(description ="手机号") |
||||
private String mytelePhone; |
||||
|
||||
@Schema(description ="文件") |
||||
private String fileJson; |
||||
|
||||
} |
||||
@ -0,0 +1,26 @@
@@ -0,0 +1,26 @@
|
||||
package jnpf.model; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
@Data |
||||
public class ContractInfoVO { |
||||
@Schema(description ="主键") |
||||
private String id; |
||||
|
||||
@Schema(description ="姓名") |
||||
private String contractName; |
||||
|
||||
@Schema(description ="手机号") |
||||
private String mytelePhone; |
||||
|
||||
@Schema(description ="文件") |
||||
private String fileJson; |
||||
} |
||||
@ -0,0 +1,16 @@
@@ -0,0 +1,16 @@
|
||||
package jnpf.model; |
||||
import io.swagger.v3.oas.annotations.media.Schema; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* |
||||
* |
||||
* 版本: V3.0.0 |
||||
* 版权: 引迈信息技术有限公司(https://www.jnpfsoft.com)
|
||||
* 作者: JNPF开发平台组 |
||||
* 日期: 2020-12-31 |
||||
*/ |
||||
@Data |
||||
public class ContractListVO extends ContractInfoVO { |
||||
|
||||
} |
||||
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
package jnpf.model; |
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import org.apache.ibatis.type.BaseTypeHandler; |
||||
import org.apache.ibatis.type.JdbcType; |
||||
import org.apache.ibatis.type.MappedJdbcTypes; |
||||
import org.apache.ibatis.type.MappedTypes; |
||||
|
||||
import java.sql.CallableStatement; |
||||
import java.sql.PreparedStatement; |
||||
import java.sql.ResultSet; |
||||
import java.sql.SQLException; |
||||
import java.util.List; |
||||
|
||||
|
||||
@MappedTypes({List.class}) |
||||
@MappedJdbcTypes(JdbcType.VARCHAR) |
||||
public class JsonTypeHandler<T> extends BaseTypeHandler<T> { |
||||
|
||||
private final Class<T> type; |
||||
|
||||
public JsonTypeHandler(Class<T> type) { |
||||
if (type == null) { |
||||
throw new IllegalArgumentException("Type argument cannot be null"); |
||||
} |
||||
this.type = type; |
||||
} |
||||
|
||||
@Override |
||||
public void setNonNullParameter(PreparedStatement ps, int i, T parameter, JdbcType jdbcType) throws SQLException { |
||||
// 将对象转换为JSON字符串并设置到PreparedStatement中
|
||||
ps.setString(i, JSON.toJSONString(parameter)); |
||||
} |
||||
|
||||
@Override |
||||
public T getNullableResult(ResultSet rs, String columnName) throws SQLException { |
||||
// 从ResultSet中获取JSON字符串并转换为指定类型的对象
|
||||
String jsonString = rs.getString(columnName); |
||||
return JSON.parseObject(jsonString, type); |
||||
} |
||||
|
||||
@Override |
||||
public T getNullableResult(ResultSet rs, int columnIndex) throws SQLException { |
||||
// 从ResultSet中获取JSON字符串并转换为指定类型的对象
|
||||
String jsonString = rs.getString(columnIndex); |
||||
return JSON.parseObject(jsonString, type); |
||||
} |
||||
|
||||
@Override |
||||
public T getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { |
||||
// 从CallableStatement中获取JSON字符串并转换为指定类型的对象
|
||||
String jsonString = cs.getString(columnIndex); |
||||
return JSON.parseObject(jsonString, type); |
||||
} |
||||
|
||||
} |
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue