2.0版本分离
This commit is contained in:
32
.gitignore
vendored
Normal file
32
.gitignore
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
!.mvn/wrapper/maven-wrapper.jar
|
||||||
|
!**/src/main/**
|
||||||
|
!**/src/test/**
|
||||||
|
|
||||||
|
### STS ###
|
||||||
|
.apt_generated
|
||||||
|
.classpath
|
||||||
|
.factorypath
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
.springBeans
|
||||||
|
.sts4-cache
|
||||||
|
|
||||||
|
### IntelliJ IDEA ###
|
||||||
|
.idea
|
||||||
|
*.iws
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|
||||||
|
### NetBeans ###
|
||||||
|
/nbproject/private/
|
||||||
|
/nbbuild/
|
||||||
|
/dist/
|
||||||
|
/nbdist/
|
||||||
|
/.nb-gradle/
|
||||||
|
build/
|
||||||
|
|
||||||
|
### VS Code ###
|
||||||
|
.vscode/
|
||||||
|
/cert/
|
||||||
10
.idea/.gitignore
generated
vendored
Normal file
10
.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# 默认忽略的文件
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# 基于编辑器的 HTTP 客户端请求
|
||||||
|
/httpRequests/
|
||||||
|
# 依赖于环境的 Maven 主目录路径
|
||||||
|
/mavenHomeManager.xml
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
391
pom.xml
Normal file
391
pom.xml
Normal file
@@ -0,0 +1,391 @@
|
|||||||
|
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.gxwebsoft</groupId>
|
||||||
|
<artifactId>com-gxwebsoft-modules</artifactId>
|
||||||
|
<version>1.5.0</version>
|
||||||
|
|
||||||
|
<name>com-gxwebsoft-api</name>
|
||||||
|
<description>WebSoftApi project for Spring Boot</description>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- spring-boot-devtools -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-aop -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-configuration-processor -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mysql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- druid -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
<version>1.2.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.4.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus 连表插件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.yulichang</groupId>
|
||||||
|
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||||
|
<version>1.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus-generator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
|
<version>3.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- hutool -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-extra</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-http</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-crypto</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- easy poi -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tika, 用于FileServer获取content-type -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tika</groupId>
|
||||||
|
<artifactId>tika-core</artifactId>
|
||||||
|
<version>2.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- open office, 用于文档转pdf实现在线预览 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.livesense</groupId>
|
||||||
|
<artifactId>jodconverter-core</artifactId>
|
||||||
|
<version>1.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-mail -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 模板引擎, 用于邮件、代码生成等 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ibeetl</groupId>
|
||||||
|
<artifactId>beetl</artifactId>
|
||||||
|
<version>3.6.1.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- jjwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.11.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.11.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 图形验证码 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--Redis-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里SDK -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
|
<version>4.4.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!--阿里支付 老版本 SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.35.0.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<version>1.70</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>2.0.20</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--二维码-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.zxing</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>3.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin.external.google</groupId>
|
||||||
|
<artifactId>android-json</artifactId>
|
||||||
|
<version>0.0.20131108.vaadin1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- socketio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.corundumstudio.socketio</groupId>
|
||||||
|
<artifactId>netty-socketio</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 微信支付 APIv3 Java SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
|
<artifactId>wechatpay-java</artifactId>
|
||||||
|
<version>0.2.17</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MQTT -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-mqtt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
|
<version>1.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
|
<version>4.6.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-mp</artifactId>
|
||||||
|
<version>4.6.0</version> <!-- 请替换为最新版本号 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里云 OSS -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.17.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 快递100-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.kuaidi100-api</groupId>
|
||||||
|
<artifactId>sdk</artifactId>
|
||||||
|
<version>1.0.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--诺诺开票接口-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuonuo</groupId>
|
||||||
|
<artifactId>open-sdk</artifactId>
|
||||||
|
<version>1.0.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 机器翻译 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>alimt20181012</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>tea-openapi</artifactId>
|
||||||
|
<version>0.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.freewayso</groupId>
|
||||||
|
<artifactId>image-combiner</artifactId>
|
||||||
|
<version>2.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*Mapper.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>aliYunMaven</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
</project>
|
||||||
31
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
31
src/main/java/com/gxwebsoft/WebSoftApplication.java
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
package com.gxwebsoft;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
|
import com.gxwebsoft.common.core.config.MqttProperties;
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||||
|
import org.springframework.web.socket.config.annotation.EnableWebSocket;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动类
|
||||||
|
* Created by WebSoft on 2018-02-22 11:29:03
|
||||||
|
*/
|
||||||
|
@EnableAsync
|
||||||
|
@EnableTransactionManagement
|
||||||
|
@MapperScan("com.gxwebsoft.**.mapper")
|
||||||
|
@EnableConfigurationProperties({ConfigProperties.class, MqttProperties.class})
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableScheduling
|
||||||
|
@EnableWebSocket
|
||||||
|
public class WebSoftApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(WebSoftApplication.class, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-报名记录控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-报名记录管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-bm")
|
||||||
|
public class BszxBmController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxBmService bszxBmService;
|
||||||
|
@Resource
|
||||||
|
private CmsArticleService cmsArticleService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||||
|
@ApiOperation("分页查询百色中学-报名记录")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxBm>> page(BszxBmParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxBmService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||||
|
@ApiOperation("查询全部百色中学-报名记录")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxBm>> list(BszxBmParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxBmService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||||
|
@ApiOperation("根据id查询百色中学-报名记录")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxBm> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxBmService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("申请报名生成邀请函")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxBm bszxBm) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (bszxBm.getName() == null) {
|
||||||
|
return fail("请填写姓名");
|
||||||
|
}
|
||||||
|
if (loginUser != null) {
|
||||||
|
bszxBm.setUserId(loginUser.getUserId());
|
||||||
|
if (bszxBmService.count(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId,loginUser.getUserId())) > 0) {
|
||||||
|
return fail("您已经报名过了",null);
|
||||||
|
}
|
||||||
|
if (bszxBmService.save(bszxBm)) {
|
||||||
|
cmsArticleService.saveInc(bszxBm.getFormId());
|
||||||
|
return success("报名成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改报名信息")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxBm bszxBm) {
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
if(loginUser == null){
|
||||||
|
return fail("请先登录");
|
||||||
|
}
|
||||||
|
if (bszxBmService.updateById(bszxBm)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除报名记录")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxBmService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-报名记录")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxBm> list) {
|
||||||
|
if (bszxBmService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-报名记录")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBm> batchParam) {
|
||||||
|
if (batchParam.update(bszxBmService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-报名记录")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxBmService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询我的报名记录")
|
||||||
|
@GetMapping("/myPage")
|
||||||
|
public ApiResult<PageResult<BszxBm>> myPage(BszxBmParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
if (getLoginUser() != null) {
|
||||||
|
param.setUserId(getLoginUserId());
|
||||||
|
return success(bszxBmService.pageRel(param));
|
||||||
|
}
|
||||||
|
return fail("请先登录",null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取海报地址")
|
||||||
|
@GetMapping("/generatePoster")
|
||||||
|
public ApiResult<?> generatePoster() throws Exception {
|
||||||
|
if (getLoginUser() == null) {
|
||||||
|
return fail("请先登录",null);
|
||||||
|
}
|
||||||
|
final BszxBm bm = bszxBmService.getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, getLoginUser().getUserId()).last("limit 1"));
|
||||||
|
return success("生成宣传海报",bszxBmService.generatePoster(bm));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBranchService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-分部控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-17 17:18:22
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-分部管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-branch")
|
||||||
|
public class BszxBranchController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxBranchService bszxBranchService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询百色中学-分部")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxBranch>> page(BszxBranchParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxBranchService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部百色中学-分部")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxBranch>> list(BszxBranchParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxBranchService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询百色中学-分部")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxBranch> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxBranchService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加百色中学-分部")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxBranch bszxBranch) {
|
||||||
|
if (bszxBranchService.save(bszxBranch)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改百色中学-分部")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxBranch bszxBranch) {
|
||||||
|
if (bszxBranchService.updateById(bszxBranch)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除百色中学-分部")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxBranchService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-分部")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxBranch> list) {
|
||||||
|
if (bszxBranchService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-分部")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBranch> batchParam) {
|
||||||
|
if (batchParam.update(bszxBranchService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-分部")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxBranchService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,156 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBranchService;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxEraService;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxGradeService;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-班级控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-班级管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-class")
|
||||||
|
public class BszxClassController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxClassService bszxClassService;
|
||||||
|
@Resource
|
||||||
|
private BszxGradeService bszxGradeService;
|
||||||
|
@Resource
|
||||||
|
private BszxBranchService bszxBranchService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询百色中学-班级")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxClass>> page(BszxClassParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxClassService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部百色中学-班级")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxClass>> list(BszxClassParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxClassService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询百色中学-班级")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxClass> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxClassService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("百色中学-年级班级数据")
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public ApiResult<List<BszxBranch>> tree() {
|
||||||
|
final List<BszxBranch> list = bszxBranchService.list();
|
||||||
|
final BszxGradeParam bszxGradeParam = new BszxGradeParam();
|
||||||
|
final List<BszxGrade> gradeList = bszxGradeService.listRel(bszxGradeParam);
|
||||||
|
final BszxClassParam bszxClassParam = new BszxClassParam();
|
||||||
|
final List<BszxClass> bszxClasseList = bszxClassService.listRel(bszxClassParam);
|
||||||
|
final Map<Integer, List<BszxClass>> collectClass = bszxClasseList.stream().collect(Collectors.groupingBy(BszxClass::getGradeId));
|
||||||
|
gradeList.forEach(d -> {
|
||||||
|
d.setChildren(collectClass.get(d.getId()));
|
||||||
|
});
|
||||||
|
final Map<Integer, List<BszxGrade>> collectGrade = gradeList.stream().collect(Collectors.groupingBy(BszxGrade::getBranch));
|
||||||
|
|
||||||
|
list.forEach(d -> {
|
||||||
|
d.setChildren(collectGrade.get(d.getId()));
|
||||||
|
});
|
||||||
|
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加百色中学-班级")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxClass bszxClass) {
|
||||||
|
if (bszxClassService.save(bszxClass)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改百色中学-班级")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxClass bszxClass) {
|
||||||
|
if (bszxClassService.updateById(bszxClass)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除百色中学-班级")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxClassService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-班级")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxClass> list) {
|
||||||
|
if (bszxClassService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-班级")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxClass> batchParam) {
|
||||||
|
if (batchParam.update(bszxClassService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-班级")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxClassService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxEraService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年代控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-年代管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-era")
|
||||||
|
public class BszxEraController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxEraService bszxEraService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询百色中学-年代")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxEra>> page(BszxEraParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxEraService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部百色中学-年代")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxEra>> list(BszxEraParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxEraService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询百色中学-年代")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxEra> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxEraService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加百色中学-年代")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxEra bszxEra) {
|
||||||
|
if (bszxEraService.save(bszxEra)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改百色中学-年代")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxEra bszxEra) {
|
||||||
|
if (bszxEraService.updateById(bszxEra)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除百色中学-年代")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxEraService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-年代")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxEra> list) {
|
||||||
|
if (bszxEraService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-年代")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxEra> batchParam) {
|
||||||
|
if (batchParam.update(bszxEraService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-年代")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxEraService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxGradeService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年级控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-年级管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-grade")
|
||||||
|
public class BszxGradeController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxGradeService bszxGradeService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询百色中学-年级")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxGrade>> page(BszxGradeParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxGradeService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部百色中学-年级")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxGrade>> list(BszxGradeParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxGradeService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询百色中学-年级")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxGrade> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxGradeService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加百色中学-年级")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxGrade bszxGrade) {
|
||||||
|
if (bszxGradeService.save(bszxGrade)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改百色中学-年级")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxGrade bszxGrade) {
|
||||||
|
if (bszxGradeService.updateById(bszxGrade)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除百色中学-年级")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxGradeService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-年级")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxGrade> list) {
|
||||||
|
if (bszxGradeService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-年级")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxGrade> batchParam) {
|
||||||
|
if (batchParam.update(bszxGradeService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-年级")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxGradeService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||||
|
import com.gxwebsoft.shop.param.ShopOrderParam;
|
||||||
|
import com.gxwebsoft.shop.service.ShopOrderService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-订单管理
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-订单管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-order")
|
||||||
|
public class BszxOrderController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxPayService bszxPayService;
|
||||||
|
@Resource
|
||||||
|
private BszxBmService bszxBmService;
|
||||||
|
@Resource
|
||||||
|
private ShopOrderService shopOrderService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询百色中学-订单列表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<ShopOrder>> page(ShopOrderParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
final PageResult<ShopOrder> result = shopOrderService.pageRel(param);
|
||||||
|
if(!CollectionUtils.isEmpty(result.getList())){
|
||||||
|
final Set<Integer> userIds = result.getList().stream().map(ShopOrder::getUserId).collect(Collectors.toSet());
|
||||||
|
final List<BszxBm> bmList = bszxBmService.list(new LambdaQueryWrapper<BszxBm>().in(BszxBm::getUserId, userIds).isNotNull(BszxBm::getName));
|
||||||
|
final Map<Integer, List<BszxBm>> collect = bmList.stream().collect(Collectors.groupingBy(BszxBm::getUserId));
|
||||||
|
final Set<String> orderNos = result.getList().stream().map(ShopOrder::getOrderNo).collect(Collectors.toSet());
|
||||||
|
final BszxPayParam bszxPayParam = new BszxPayParam();
|
||||||
|
bszxPayParam.setOrderNos(orderNos);
|
||||||
|
final List<BszxPay> bszxPays = bszxPayService.listRel(bszxPayParam);
|
||||||
|
final Map<String, List<BszxPay>> collectByOrderNo = bszxPays.stream().collect(Collectors.groupingBy(BszxPay::getOrderNo));
|
||||||
|
|
||||||
|
result.getList().forEach(d -> {
|
||||||
|
final List<BszxPay> pays = collectByOrderNo.get(d.getOrderNo());
|
||||||
|
if(!CollectionUtils.isEmpty(pays)){
|
||||||
|
d.setDeliveryStatus(20);
|
||||||
|
}
|
||||||
|
final List<BszxBm> bmList1 = collect.get(d.getUserId());
|
||||||
|
if(!CollectionUtils.isEmpty(bmList1)){
|
||||||
|
final BszxBm bm = bmList1.get(0);
|
||||||
|
d.setBm(bm);
|
||||||
|
d.setRealName(bm.getName());
|
||||||
|
if(bm.getPhone() != null){
|
||||||
|
d.setPhone(bm.getPhone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,337 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateField;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.NumberUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||||
|
import com.wechat.pay.java.core.notification.*;
|
||||||
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.Payment;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||||
|
import com.gxwebsoft.shop.service.ShopOrderService;
|
||||||
|
import com.wechat.pay.java.core.notification.RequestParam;
|
||||||
|
import com.wechat.pay.java.service.partnerpayments.jsapi.JsapiService;
|
||||||
|
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款记录控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-捐款记录管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-pay")
|
||||||
|
public class BszxPayController extends BaseController {
|
||||||
|
public static JsapiService service;
|
||||||
|
@Resource
|
||||||
|
private BszxPayService bszxPayService;
|
||||||
|
@Resource
|
||||||
|
private BszxBmService bszxBmService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private ShopOrderService shopOrderService;
|
||||||
|
@Resource
|
||||||
|
private ConfigProperties conf;
|
||||||
|
@Value("${spring.profiles.active}")
|
||||||
|
String active;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||||
|
@ApiOperation("分页查询百色中学-捐款记录")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxPay>> page(BszxPayParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxPayService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||||
|
@ApiOperation("查询全部百色中学-捐款记录")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxPay>> list(BszxPayParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxPayService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||||
|
@ApiOperation("根据id查询百色中学-捐款记录")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxPay> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxPayService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("活动捐款")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxPay bszxPay, HttpServletRequest request) {
|
||||||
|
if (bszxPay.getPrice().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
return fail("金额不能为0");
|
||||||
|
}
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
bszxPay.setUserId(loginUser.getUserId());
|
||||||
|
// 微信openid(必填)
|
||||||
|
if (StrUtil.isBlank(loginUser.getOpenid())) {
|
||||||
|
return fail("微信openid(必填)");
|
||||||
|
}
|
||||||
|
final BszxBm bmInfo = bszxBmService.getByUserId(loginUser.getUserId());
|
||||||
|
bszxPay.setName(bmInfo.getName());
|
||||||
|
bszxPay.setSex(bmInfo.getSex());
|
||||||
|
bszxPay.setPhone(bmInfo.getPhone());
|
||||||
|
bszxPay.setBranchName(bmInfo.getBranchName());
|
||||||
|
bszxPay.setGradeName(bmInfo.getGradeName());
|
||||||
|
bszxPay.setClassName(bmInfo.getClassName());
|
||||||
|
bszxPay.setAddress(bmInfo.getAddress());
|
||||||
|
bszxPay.setWorkUnit(bmInfo.getWorkUnit());
|
||||||
|
bszxPay.setPosition(bmInfo.getPosition());
|
||||||
|
bszxPay.setAge(bmInfo.getAge());
|
||||||
|
bszxPay.setNumber(bmInfo.getNumber());
|
||||||
|
}
|
||||||
|
if (bszxPayService.save(bszxPay)) {
|
||||||
|
// 调起支付
|
||||||
|
return success("下单成功", bszxPay);
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改百色中学-捐款记录")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxPay bszxPay) {
|
||||||
|
if (bszxPayService.updateById(bszxPay)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除百色中学-捐款记录")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxPayService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-捐款记录")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxPay> list) {
|
||||||
|
if (bszxPayService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-捐款记录")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPay> batchParam) {
|
||||||
|
if (batchParam.update(bszxPayService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-捐款记录")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxPayService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询我的报名记录")
|
||||||
|
@GetMapping("/myPage")
|
||||||
|
public ApiResult<PageResult<BszxPay>> myPage(BszxPayParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
if (getLoginUser() != null) {
|
||||||
|
param.setUserId(getLoginUserId());
|
||||||
|
return success(bszxPayService.pageRel(param));
|
||||||
|
}
|
||||||
|
return fail("请先登录", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("统计捐款总金额与人次")
|
||||||
|
@GetMapping("/getCount")
|
||||||
|
public ApiResult<?> getCount() {
|
||||||
|
final HashMap<String, Object> map = new HashMap<>();
|
||||||
|
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
final BigDecimal bigDecimal = bszxPayService.sumMoney(wrapper);
|
||||||
|
final int count = bszxPayService.count(new LambdaQueryWrapper<BszxPay>());
|
||||||
|
map.put("numbers", count);
|
||||||
|
map.put("totalMoney", bigDecimal);
|
||||||
|
return success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiModelProperty("异步通知")
|
||||||
|
@PostMapping("/notify/{tenantId}")
|
||||||
|
public String wxNotify(@RequestHeader Map<String, String> header, @RequestBody String body,HttpServletRequest request, @PathVariable("tenantId") Integer tenantId) {
|
||||||
|
// 获取支付配置信息用于解密
|
||||||
|
String key = "Payment:1:".concat(tenantId.toString());
|
||||||
|
Payment payment = redisUtil.get(key, Payment.class);
|
||||||
|
String uploadPath = conf.getUploadPath();
|
||||||
|
|
||||||
|
// 开发环境
|
||||||
|
String mid = "1242289702";
|
||||||
|
String apiV3Key = "0b2996803383c3e3391abd9183b54key";
|
||||||
|
String serialNumber = "3B458EB14A28160DC094431A21C0508EFA712D1C";
|
||||||
|
String privateKey = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/apiclient_key.pem";
|
||||||
|
String apiclientCert = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/apiclient_cert.pem";
|
||||||
|
String pubKey = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/0f65a8517c284acb90aa83dd0c23e8f6.pem";
|
||||||
|
String pubId = "PUB_KEY_ID_0112422897022025011300326200001208";
|
||||||
|
// 生产环境
|
||||||
|
if (ObjectUtil.isNotEmpty(payment)) {
|
||||||
|
// 检查 payment 字段是否为空,并避免直接解析为数字
|
||||||
|
mid = payment.getMchId();
|
||||||
|
apiV3Key = payment.getApiKey();
|
||||||
|
serialNumber = payment.getMerchantSerialNumber();
|
||||||
|
privateKey = payment.getApiclientKey();
|
||||||
|
apiclientCert = conf.getUploadPath().concat("/file").concat(payment.getApiclientCert());
|
||||||
|
pubKey = uploadPath.concat("file").concat(payment.getPubKey());
|
||||||
|
pubId = payment.getPubKeyId();
|
||||||
|
}
|
||||||
|
RequestParam requestParam = new RequestParam.Builder()
|
||||||
|
.serialNumber(header.get("wechatpay-serial"))
|
||||||
|
.nonce(header.get("wechatpay-nonce"))
|
||||||
|
.signature(header.get("wechatpay-signature"))
|
||||||
|
.timestamp(header.get("wechatpay-timestamp"))
|
||||||
|
.body(body)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
// NotificationConfig config = new RSAPublicKeyConfig.Builder()
|
||||||
|
// .merchantId(mid)
|
||||||
|
// .publicKeyFromPath(pubKey)
|
||||||
|
// .publicKeyId(pubId)
|
||||||
|
// .privateKeyFromPath(privateKey)
|
||||||
|
// .merchantSerialNumber(serialNumber)
|
||||||
|
// .apiV3Key(apiV3Key)
|
||||||
|
// .build();
|
||||||
|
|
||||||
|
NotificationConfig config = new RSAPublicKeyNotificationConfig.Builder()
|
||||||
|
.publicKeyFromPath(pubKey)
|
||||||
|
.publicKeyId(pubId)
|
||||||
|
.apiV3Key(apiV3Key)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
|
||||||
|
// 初始化 NotificationParser
|
||||||
|
NotificationParser parser = new NotificationParser(config);
|
||||||
|
|
||||||
|
// 以支付通知回调为例,验签、解密并转换成 Transaction
|
||||||
|
try {
|
||||||
|
Transaction transaction = parser.parse(requestParam, Transaction.class);
|
||||||
|
final String outTradeNo = transaction.getOutTradeNo();
|
||||||
|
final String transactionId = transaction.getTransactionId();
|
||||||
|
final Integer total = transaction.getAmount().getTotal();
|
||||||
|
final String tradeStateDesc = transaction.getTradeStateDesc();
|
||||||
|
final Transaction.TradeStateEnum tradeState = transaction.getTradeState();
|
||||||
|
final Transaction.TradeTypeEnum tradeType = transaction.getTradeType();
|
||||||
|
System.out.println("transaction = " + transaction);
|
||||||
|
System.out.println("tradeStateDesc = " + tradeStateDesc);
|
||||||
|
System.out.println("tradeType = " + tradeType);
|
||||||
|
System.out.println("tradeState = " + tradeState);
|
||||||
|
System.out.println("outTradeNo = " + outTradeNo);
|
||||||
|
System.out.println("amount = " + total);
|
||||||
|
|
||||||
|
if (StrUtil.equals("支付成功", tradeStateDesc)) {
|
||||||
|
// 1. 查询要处理的订单
|
||||||
|
ShopOrder order = shopOrderService.getByOutTradeNo(outTradeNo);
|
||||||
|
// 2. 已支付则跳过
|
||||||
|
if (order.getPayStatus().equals(true)) {
|
||||||
|
return "SUCCESS";
|
||||||
|
}
|
||||||
|
// 2. 未支付则处理更新订单状态
|
||||||
|
if (order.getPayStatus().equals(false)) {
|
||||||
|
// 5. TODO 处理订单状态
|
||||||
|
order.setPayTime(DateUtil.date());
|
||||||
|
order.setPayStatus(true);
|
||||||
|
order.setTransactionId(transactionId);
|
||||||
|
order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", total * 0.01)));
|
||||||
|
order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 10));
|
||||||
|
System.out.println("实际付款金额 = " + order.getPayPrice());
|
||||||
|
return "SUCCESS";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
System.out.println($e.getMessage());
|
||||||
|
System.out.println(Arrays.toString($e.getStackTrace()));
|
||||||
|
}
|
||||||
|
|
||||||
|
return "fail";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:shopOrder:update')")
|
||||||
|
@ApiOperation("修复订单")
|
||||||
|
@PutMapping("/repair")
|
||||||
|
public ApiResult<?> repair(@RequestBody ShopOrder shopOrder) {
|
||||||
|
if (shopOrderService.queryOrderByOutTradeNo(shopOrder)) {
|
||||||
|
if (bszxPayService.count(new LambdaQueryWrapper<BszxPay>().eq(BszxPay::getOrderNo, shopOrder.getOrderNo())) == 0) {
|
||||||
|
final BszxPay bszxPay = new BszxPay();
|
||||||
|
final BszxBm bm = shopOrder.getBm();
|
||||||
|
if (ObjectUtil.isNotEmpty(bm)) {
|
||||||
|
bszxPay.setName(bm.getName());
|
||||||
|
bszxPay.setSex(bm.getSex());
|
||||||
|
bszxPay.setClassName(bm.getClassName());
|
||||||
|
bszxPay.setGradeName(bm.getGradeName());
|
||||||
|
bszxPay.setAddress(bm.getAddress());
|
||||||
|
bszxPay.setWorkUnit(bm.getWorkUnit());
|
||||||
|
bszxPay.setPosition(bm.getPosition());
|
||||||
|
bszxPay.setPrice(shopOrder.getPayPrice());
|
||||||
|
bszxPay.setOrderNo(shopOrder.getOrderNo());
|
||||||
|
bszxPay.setUserId(shopOrder.getUserId());
|
||||||
|
bszxPay.setFormId(shopOrder.getFormId());
|
||||||
|
bszxPay.setComments(shopOrder.getComments());
|
||||||
|
bszxPayService.save(bszxPay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success("修复成功");
|
||||||
|
}
|
||||||
|
return fail("修复失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取捐款证书")
|
||||||
|
@GetMapping("/generatePayCert/{id}")
|
||||||
|
public ApiResult<?> generatePayCert(@PathVariable("id") Integer id) throws Exception {
|
||||||
|
return success("获取捐款证书", bszxPayService.generatePayCert(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,199 @@
|
|||||||
|
package com.gxwebsoft.bszx.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayRankingService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款排行控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-25 08:54:09
|
||||||
|
*/
|
||||||
|
@Api(tags = "百色中学-捐款排行管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/bszx/bszx-pay-ranking")
|
||||||
|
public class BszxPayRankingController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private BszxPayRankingService bszxPayRankingService;
|
||||||
|
@Resource
|
||||||
|
private CmsArticleService cmsArticleService;
|
||||||
|
@Resource
|
||||||
|
private BszxPayService bszxPayService;
|
||||||
|
@Resource
|
||||||
|
private BszxClassService bszxClassService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||||
|
@ApiOperation("分页查询百色中学-捐款排行")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<BszxPayRanking>> page(BszxPayRankingParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxPayRankingService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||||
|
@ApiOperation("查询全部百色中学-捐款排行")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<BszxPayRanking>> list(BszxPayRankingParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxPayRankingService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部百色中学-捐款排行榜")
|
||||||
|
@GetMapping("/ranking")
|
||||||
|
public ApiResult<List<BszxPayRanking>> ranking(BszxPayRankingParam param) {
|
||||||
|
final ArrayList<BszxPayRanking> rankings = new ArrayList<>();
|
||||||
|
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
final List<CmsArticle> list = cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>().eq(CmsArticle::getCategoryId, 2444));
|
||||||
|
|
||||||
|
list.forEach(item -> {
|
||||||
|
final BszxPayRanking ranking = new BszxPayRanking();
|
||||||
|
wrapper.clear();
|
||||||
|
// 按时间段查询
|
||||||
|
if(param.getCreateTimeStart() != null && param.getCreateTimeEnd() != null){
|
||||||
|
final String timeStart = param.getCreateTimeStart();
|
||||||
|
final String timeEnd = param.getCreateTimeEnd();
|
||||||
|
wrapper.ge(BszxPay::getCreateTime, timeStart);
|
||||||
|
wrapper.le(BszxPay::getCreateTime, timeEnd);
|
||||||
|
}
|
||||||
|
wrapper.eq(BszxPay::getFormId, item.getArticleId());
|
||||||
|
ranking.setFormId(item.getArticleId());
|
||||||
|
ranking.setFormName(item.getTitle());
|
||||||
|
ranking.setNumber(bszxPayService.count(wrapper));
|
||||||
|
ranking.setTotalPrice(bszxPayService.sumMoney(wrapper));
|
||||||
|
rankings.add(ranking);
|
||||||
|
});
|
||||||
|
// totalPrice按大到小排序
|
||||||
|
rankings.sort((o1, o2) -> o2.getTotalPrice().compareTo(o1.getTotalPrice()));
|
||||||
|
return success(rankings);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("查询全部百色中学-千班万元")
|
||||||
|
@GetMapping("/ranking2")
|
||||||
|
public ApiResult<List<BszxClass>> ranking2(BszxClassParam param) {
|
||||||
|
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
final List<BszxClass> list = bszxClassService.listRel(param);
|
||||||
|
|
||||||
|
String key = "BSZX:UpdateRanking2";
|
||||||
|
final String isTimeOut = redisUtil.get(key);
|
||||||
|
if(StrUtil.isNotBlank(isTimeOut)){
|
||||||
|
list.sort((o1, o2) -> o2.getTotalMoney().compareTo(o1.getTotalMoney()));
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
list.forEach(item -> {
|
||||||
|
System.out.println("item = " + item);
|
||||||
|
wrapper.clear();
|
||||||
|
wrapper.eq(BszxPay::getGradeName,item.getGradeName());
|
||||||
|
wrapper.eq(BszxPay::getClassName, item.getName());
|
||||||
|
item.setTotalMoney(bszxPayService.sumMoney(wrapper));
|
||||||
|
bszxClassService.updateById(item);
|
||||||
|
});
|
||||||
|
// totalPrice按大到小排序
|
||||||
|
list.sort((o1, o2) -> o2.getTotalMoney().compareTo(o1.getTotalMoney()));
|
||||||
|
redisUtil.set(key, 1,1L, TimeUnit.DAYS);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||||
|
@ApiOperation("根据id查询百色中学-捐款排行")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<BszxPayRanking> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(bszxPayRankingService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加百色中学-捐款排行")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody BszxPayRanking bszxPayRanking) {
|
||||||
|
if (bszxPayRankingService.save(bszxPayRanking)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改百色中学-捐款排行")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody BszxPayRanking bszxPayRanking) {
|
||||||
|
if (bszxPayRankingService.updateById(bszxPayRanking)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除百色中学-捐款排行")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (bszxPayRankingService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加百色中学-捐款排行")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<BszxPayRanking> list) {
|
||||||
|
if (bszxPayRankingService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改百色中学-捐款排行")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPayRanking> batchParam) {
|
||||||
|
if (batchParam.update(bszxPayRankingService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除百色中学-捐款排行")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (bszxPayRankingService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
149
src/main/java/com/gxwebsoft/bszx/entity/BszxBm.java
Normal file
149
src/main/java/com/gxwebsoft/bszx/entity/BszxBm.java
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-报名记录
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxBm对象", description = "百色中学-报名记录")
|
||||||
|
public class BszxBm implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0校友 1单位 2爱心人士")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别 1男 2女")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String sexName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级ID")
|
||||||
|
private Integer classId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部ID")
|
||||||
|
private Integer branchId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String branchName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "居住地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作单位")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职务")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否能到场")
|
||||||
|
private String present;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "人数")
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "额外信息")
|
||||||
|
private String extra;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "生成的邀请函存放路径")
|
||||||
|
private String certificate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预定日期")
|
||||||
|
private LocalDate dateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单ID")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "活动名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章对象")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsArticle article;
|
||||||
|
|
||||||
|
public String getSexName() {
|
||||||
|
if (this.sex == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return this.sex.equals("1") ? "男" : "女";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/bszx/entity/BszxBranch.java
Normal file
43
src/main/java/com/gxwebsoft/bszx/entity/BszxBranch.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-分部
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-17 17:18:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxBranch对象", description = "百色中学-分部")
|
||||||
|
public class BszxBranch implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部名称 ")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<BszxGrade> children;
|
||||||
|
|
||||||
|
}
|
||||||
70
src/main/java/com/gxwebsoft/bszx/entity/BszxClass.java
Normal file
70
src/main/java/com/gxwebsoft/bszx/entity/BszxClass.java
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-班级
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxClass对象", description = "百色中学-班级")
|
||||||
|
public class BszxClass implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时代ID")
|
||||||
|
private Integer eraId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时代名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String eraName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级ID")
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "累计捐款金额")
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部")
|
||||||
|
private Integer branch;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String branchName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("子分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<BszxClass> children;
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/bszx/entity/BszxEra.java
Normal file
43
src/main/java/com/gxwebsoft/bszx/entity/BszxEra.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年代
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxEra对象", description = "百色中学-年代")
|
||||||
|
public class BszxEra implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年代")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<BszxGrade> children;
|
||||||
|
|
||||||
|
}
|
||||||
53
src/main/java/com/gxwebsoft/bszx/entity/BszxGrade.java
Normal file
53
src/main/java/com/gxwebsoft/bszx/entity/BszxGrade.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年级
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxGrade对象", description = "百色中学-年级")
|
||||||
|
public class BszxGrade implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年代")
|
||||||
|
private Integer eraId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部")
|
||||||
|
private Integer branch;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty("子分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<BszxClass> children;
|
||||||
|
|
||||||
|
}
|
||||||
141
src/main/java/com/gxwebsoft/bszx/entity/BszxPay.java
Normal file
141
src/main/java/com/gxwebsoft/bszx/entity/BszxPay.java
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||||
|
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款记录
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxPay对象", description = "百色中学-捐款记录")
|
||||||
|
public class BszxPay implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别 1男 2女")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部")
|
||||||
|
private String branchName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "居住地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作单位")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职务")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "付费金额")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "额外信息")
|
||||||
|
private String extra;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预定日期")
|
||||||
|
private LocalDate dateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "捐赠证书")
|
||||||
|
private String certificate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源表ID")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "活动名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private CmsArticle article;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private ShopOrder shopOrder;
|
||||||
|
|
||||||
|
public String getSexName() {
|
||||||
|
return this.sex.equals("1") ? "男" : "女";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
65
src/main/java/com/gxwebsoft/bszx/entity/BszxPayRanking.java
Normal file
65
src/main/java/com/gxwebsoft/bszx/entity/BszxPayRanking.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
package com.gxwebsoft.bszx.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款排行
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-25 08:54:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "BszxPayRanking对象", description = "百色中学-捐款排行")
|
||||||
|
public class BszxPayRanking implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源表ID(文章ID)")
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "项目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String formName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "获得捐款总金额")
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxBmMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxBmMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-报名记录Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxBmMapper extends BaseMapper<BszxBm> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxBm>
|
||||||
|
*/
|
||||||
|
List<BszxBm> selectPageRel(@Param("page") IPage<BszxBm> page,
|
||||||
|
@Param("param") BszxBmParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxBm> selectListRel(@Param("param") BszxBmParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-分部Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-17 17:18:22
|
||||||
|
*/
|
||||||
|
public interface BszxBranchMapper extends BaseMapper<BszxBranch> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxBranch>
|
||||||
|
*/
|
||||||
|
List<BszxBranch> selectPageRel(@Param("page") IPage<BszxBranch> page,
|
||||||
|
@Param("param") BszxBranchParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxBranch> selectListRel(@Param("param") BszxBranchParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxClassMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxClassMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-班级Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxClassMapper extends BaseMapper<BszxClass> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxClass>
|
||||||
|
*/
|
||||||
|
List<BszxClass> selectPageRel(@Param("page") IPage<BszxClass> page,
|
||||||
|
@Param("param") BszxClassParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxClass> selectListRel(@Param("param") BszxClassParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxEraMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxEraMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年代Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxEraMapper extends BaseMapper<BszxEra> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxEra>
|
||||||
|
*/
|
||||||
|
List<BszxEra> selectPageRel(@Param("page") IPage<BszxEra> page,
|
||||||
|
@Param("param") BszxEraParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxEra> selectListRel(@Param("param") BszxEraParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxGradeMapper.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/mapper/BszxGradeMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年级Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxGradeMapper extends BaseMapper<BszxGrade> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxGrade>
|
||||||
|
*/
|
||||||
|
List<BszxGrade> selectPageRel(@Param("page") IPage<BszxGrade> page,
|
||||||
|
@Param("param") BszxGradeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxGrade> selectListRel(@Param("param") BszxGradeParam param);
|
||||||
|
|
||||||
|
}
|
||||||
42
src/main/java/com/gxwebsoft/bszx/mapper/BszxPayMapper.java
Normal file
42
src/main/java/com/gxwebsoft/bszx/mapper/BszxPayMapper.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款记录Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxPayMapper extends BaseMapper<BszxPay> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxPay>
|
||||||
|
*/
|
||||||
|
List<BszxPay> selectPageRel(@Param("page") IPage<BszxPay> page,
|
||||||
|
@Param("param") BszxPayParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxPay> selectListRel(@Param("param") BszxPayParam param);
|
||||||
|
|
||||||
|
BigDecimal selectSumMoney(@Param("ew") Wrapper<?> wrapper);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款排行Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-25 08:54:09
|
||||||
|
*/
|
||||||
|
public interface BszxPayRankingMapper extends BaseMapper<BszxPayRanking> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxPayRanking>
|
||||||
|
*/
|
||||||
|
List<BszxPayRanking> selectPageRel(@Param("page") IPage<BszxPayRanking> page,
|
||||||
|
@Param("param") BszxPayRankingParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<BszxPayRanking> selectListRel(@Param("param") BszxPayRankingParam param);
|
||||||
|
|
||||||
|
}
|
||||||
113
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxBmMapper.xml
Normal file
113
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxBmMapper.xml
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.bszx.mapper.BszxBmMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.title as formName, c.name as branchName, u.phone as mobile,u.avatar,u.nickname
|
||||||
|
FROM bszx_bm a
|
||||||
|
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
||||||
|
LEFT JOIN bszx_branch c ON a.branch_id = c.id
|
||||||
|
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
|
<if test="param.sex != null">
|
||||||
|
AND a.sex = #{param.sex}
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.branchId != null">
|
||||||
|
AND a.branch_id = #{param.branchId}
|
||||||
|
</if>
|
||||||
|
<if test="param.className != null">
|
||||||
|
AND a.class_name LIKE CONCAT('%', #{param.className}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.gradeName != null">
|
||||||
|
AND a.grade_name LIKE CONCAT('%', #{param.gradeName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.address != null">
|
||||||
|
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.workUnit != null">
|
||||||
|
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.position != null">
|
||||||
|
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.present != null">
|
||||||
|
AND a.present = #{param.present}
|
||||||
|
</if>
|
||||||
|
<if test="param.age != null">
|
||||||
|
AND a.age = #{param.age}
|
||||||
|
</if>
|
||||||
|
<if test="param.number != null">
|
||||||
|
AND a.number = #{param.number}
|
||||||
|
</if>
|
||||||
|
<if test="param.extra != null">
|
||||||
|
AND a.extra LIKE CONCAT('%', #{param.extra}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.certificate != null">
|
||||||
|
AND a.certificate LIKE CONCAT('%', #{param.certificate}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.dateTime != null">
|
||||||
|
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.formData != null">
|
||||||
|
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.formId != null">
|
||||||
|
AND a.form_id = #{param.formId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.phone = #{param.keywords}
|
||||||
|
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxBm">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxBm">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.bszx.mapper.BszxBranchMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM bszx_branch a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxBranch">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxBranch">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.bszx.mapper.BszxClassMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.name as gradeName, c.name as eraName, d.name as branchName
|
||||||
|
FROM bszx_class a
|
||||||
|
LEFT JOIN bszx_grade b ON a.grade_id = b.id
|
||||||
|
LEFT JOIN bszx_era c ON a.era_id = c.id
|
||||||
|
LEFT JOIN bszx_branch d ON a.branch = d.id
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.eraId != null">
|
||||||
|
AND a.era_id = #{param.eraId}
|
||||||
|
</if>
|
||||||
|
<if test="param.gradeId != null">
|
||||||
|
AND a.grade_id = #{param.gradeId}
|
||||||
|
</if>
|
||||||
|
<if test="param.gradeName != null">
|
||||||
|
AND b.name = #{param.gradeName}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name = #{param.name}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.branch != null">
|
||||||
|
AND a.branch = #{param.branch}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxClass">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxClass">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.bszx.mapper.BszxEraMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM bszx_era a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxEra">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxEra">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.bszx.mapper.BszxGradeMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM bszx_grade a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.eraId != null">
|
||||||
|
AND a.era_id = #{param.eraId}
|
||||||
|
</if>
|
||||||
|
<if test="param.branch != null">
|
||||||
|
AND a.branch = #{param.branch}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxGrade">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxGrade">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
126
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxPayMapper.xml
Normal file
126
src/main/java/com/gxwebsoft/bszx/mapper/xml/BszxPayMapper.xml
Normal file
@@ -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="com.gxwebsoft.bszx.mapper.BszxPayMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.title as formName,u.phone as mobile,u.avatar,u.nickname
|
||||||
|
FROM bszx_pay a
|
||||||
|
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
||||||
|
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.age != null">
|
||||||
|
AND a.age = #{param.age}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sex != null">
|
||||||
|
AND a.sex = #{param.sex}
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.className != null">
|
||||||
|
AND a.class_name = #{param.className}
|
||||||
|
</if>
|
||||||
|
<if test="param.gradeName != null">
|
||||||
|
AND a.grade_name LIKE CONCAT('%', #{param.gradeName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.address != null">
|
||||||
|
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.workUnit != null">
|
||||||
|
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.position != null">
|
||||||
|
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.number != null">
|
||||||
|
AND a.number = #{param.number}
|
||||||
|
</if>
|
||||||
|
<if test="param.price != null">
|
||||||
|
AND a.price = #{param.price}
|
||||||
|
</if>
|
||||||
|
<if test="param.extra != null">
|
||||||
|
AND a.extra LIKE CONCAT('%', #{param.extra}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.orderNo != null">
|
||||||
|
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.dateTime != null">
|
||||||
|
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.certificate != null">
|
||||||
|
AND a.certificate LIKE CONCAT('%', #{param.certificate}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.formData != null">
|
||||||
|
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.formId != null">
|
||||||
|
AND a.form_id = #{param.formId}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.orderNos != null">
|
||||||
|
AND a.order_no IN
|
||||||
|
<foreach collection="param.orderNos" item="item" separator="," open="(" close=")">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR u.phone = #{param.keywords}
|
||||||
|
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
OR a.order_no = #{param.keywords}
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxPay">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxPay">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 统计金额总和 -->
|
||||||
|
<select id="selectSumMoney" resultType="java.math.BigDecimal">
|
||||||
|
SELECT COALESCE(SUM(price), 0) as total_money
|
||||||
|
FROM bszx_pay
|
||||||
|
<if test="ew != null">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.gxwebsoft.bszx.mapper.BszxPayRankingMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*,b.title as formName
|
||||||
|
FROM bszx_pay_ranking a
|
||||||
|
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.formId != null">
|
||||||
|
AND a.form_id = #{param.formId}
|
||||||
|
</if>
|
||||||
|
<if test="param.number != null">
|
||||||
|
AND a.number = #{param.number}
|
||||||
|
</if>
|
||||||
|
<if test="param.totalPrice != null">
|
||||||
|
AND a.total_price = #{param.totalPrice}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxPayRanking">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxPayRanking">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
114
src/main/java/com/gxwebsoft/bszx/param/BszxBmParam.java
Normal file
114
src/main/java/com/gxwebsoft/bszx/param/BszxBmParam.java
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-报名记录查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxBmParam对象", description = "百色中学-报名记录查询参数")
|
||||||
|
public class BszxBmParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自增ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0校友 1单位")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别 1男 2女")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer branchId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "居住地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作单位")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职务")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否能到场")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Boolean present;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "人数")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "额外信息")
|
||||||
|
private String extra;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "生成的邀请函存放路径")
|
||||||
|
private String certificate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预定日期")
|
||||||
|
private String dateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
@QueryField(type = QueryType.LIKE)
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/bszx/param/BszxBranchParam.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/param/BszxBranchParam.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-分部查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-17 17:18:22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxBranchParam对象", description = "百色中学-分部查询参数")
|
||||||
|
public class BszxBranchParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部名称 ")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
64
src/main/java/com/gxwebsoft/bszx/param/BszxClassParam.java
Normal file
64
src/main/java/com/gxwebsoft/bszx/param/BszxClassParam.java
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-班级查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxClassParam对象", description = "百色中学-班级查询参数")
|
||||||
|
public class BszxClassParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "时代ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer eraId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer gradeId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "累计捐款金额")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal totalMoney;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer branch;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/bszx/param/BszxEraParam.java
Normal file
37
src/main/java/com/gxwebsoft/bszx/param/BszxEraParam.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年代查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxEraParam对象", description = "百色中学-年代查询参数")
|
||||||
|
public class BszxEraParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年代")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
}
|
||||||
52
src/main/java/com/gxwebsoft/bszx/param/BszxGradeParam.java
Normal file
52
src/main/java/com/gxwebsoft/bszx/param/BszxGradeParam.java
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年级查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxGradeParam对象", description = "百色中学-年级查询参数")
|
||||||
|
public class BszxGradeParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年代")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer eraId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分部")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer branch;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
118
src/main/java/com/gxwebsoft/bszx/param/BszxPayParam.java
Normal file
118
src/main/java/com/gxwebsoft/bszx/param/BszxPayParam.java
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款记录查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxPayParam对象", description = "百色中学-捐款记录查询参数")
|
||||||
|
public class BszxPayParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年龄")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer age;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "性别 1男 2女")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "手机号码")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "班级")
|
||||||
|
private String className;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "年级")
|
||||||
|
private String gradeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "居住地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "工作单位")
|
||||||
|
private String workUnit;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "职务")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "付费金额")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "额外信息")
|
||||||
|
private String extra;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private String orderNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "订单编号")
|
||||||
|
@QueryField(type = QueryType.IN)
|
||||||
|
private Set<String> orderNos;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "预定日期")
|
||||||
|
private String dateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "捐赠证书")
|
||||||
|
private String certificate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "表单数据")
|
||||||
|
private String formData;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源表ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "登录用户")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private User loginUser;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
package com.gxwebsoft.bszx.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款排行查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-25 08:54:09
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "BszxPayRankingParam对象", description = "百色中学-捐款排行查询参数")
|
||||||
|
public class BszxPayRankingParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源表ID(项目名称)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer formId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "数量")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer number;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "获得捐款总金额")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
50
src/main/java/com/gxwebsoft/bszx/service/BszxBmService.java
Normal file
50
src/main/java/com/gxwebsoft/bszx/service/BszxBmService.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-报名记录Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxBmService extends IService<BszxBm> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxBm>
|
||||||
|
*/
|
||||||
|
PageResult<BszxBm> pageRel(BszxBmParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxBm>
|
||||||
|
*/
|
||||||
|
List<BszxBm> listRel(BszxBmParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id 自增ID
|
||||||
|
* @return BszxBm
|
||||||
|
*/
|
||||||
|
BszxBm getByIdRel(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成海报
|
||||||
|
*/
|
||||||
|
String generatePoster(BszxBm bm) throws Exception;
|
||||||
|
|
||||||
|
BszxBm getByUserId(Integer userId);
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-分部Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-17 17:18:22
|
||||||
|
*/
|
||||||
|
public interface BszxBranchService extends IService<BszxBranch> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxBranch>
|
||||||
|
*/
|
||||||
|
PageResult<BszxBranch> pageRel(BszxBranchParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxBranch>
|
||||||
|
*/
|
||||||
|
List<BszxBranch> listRel(BszxBranchParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return BszxBranch
|
||||||
|
*/
|
||||||
|
BszxBranch getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-班级Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxClassService extends IService<BszxClass> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxClass>
|
||||||
|
*/
|
||||||
|
PageResult<BszxClass> pageRel(BszxClassParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxClass>
|
||||||
|
*/
|
||||||
|
List<BszxClass> listRel(BszxClassParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return BszxClass
|
||||||
|
*/
|
||||||
|
BszxClass getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
42
src/main/java/com/gxwebsoft/bszx/service/BszxEraService.java
Normal file
42
src/main/java/com/gxwebsoft/bszx/service/BszxEraService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年代Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxEraService extends IService<BszxEra> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxEra>
|
||||||
|
*/
|
||||||
|
PageResult<BszxEra> pageRel(BszxEraParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxEra>
|
||||||
|
*/
|
||||||
|
List<BszxEra> listRel(BszxEraParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return BszxEra
|
||||||
|
*/
|
||||||
|
BszxEra getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年级Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxGradeService extends IService<BszxGrade> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxGrade>
|
||||||
|
*/
|
||||||
|
PageResult<BszxGrade> pageRel(BszxGradeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxGrade>
|
||||||
|
*/
|
||||||
|
List<BszxGrade> listRel(BszxGradeParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return BszxGrade
|
||||||
|
*/
|
||||||
|
BszxGrade getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款排行Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-25 08:54:09
|
||||||
|
*/
|
||||||
|
public interface BszxPayRankingService extends IService<BszxPayRanking> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxPayRanking>
|
||||||
|
*/
|
||||||
|
PageResult<BszxPayRanking> pageRel(BszxPayRankingParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxPayRanking>
|
||||||
|
*/
|
||||||
|
List<BszxPayRanking> listRel(BszxPayRankingParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return BszxPayRanking
|
||||||
|
*/
|
||||||
|
BszxPayRanking getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
51
src/main/java/com/gxwebsoft/bszx/service/BszxPayService.java
Normal file
51
src/main/java/com/gxwebsoft/bszx/service/BszxPayService.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package com.gxwebsoft.bszx.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||||
|
import com.gxwebsoft.project.entity.Project;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款记录Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
public interface BszxPayService extends IService<BszxPay> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<BszxPay>
|
||||||
|
*/
|
||||||
|
PageResult<BszxPay> pageRel(BszxPayParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<BszxPay>
|
||||||
|
*/
|
||||||
|
List<BszxPay> listRel(BszxPayParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id ID
|
||||||
|
* @return BszxPay
|
||||||
|
*/
|
||||||
|
BszxPay getByIdRel(Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成捐款证书
|
||||||
|
*/
|
||||||
|
String generatePayCert(Integer id) throws Exception;
|
||||||
|
|
||||||
|
BigDecimal sumMoney(LambdaQueryWrapper<BszxPay> between);
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.freewayso.image.combiner.ImageCombiner;
|
||||||
|
import com.freewayso.image.combiner.enums.OutputFormat;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxBmMapper;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBmParam;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||||
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
|
import com.gxwebsoft.common.core.utils.FileServerUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.ImageUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-报名记录Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxBmServiceImpl extends ServiceImpl<BszxBmMapper, BszxBm> implements BszxBmService {
|
||||||
|
@Value("${config.upload-path}")
|
||||||
|
private String uploadPath;
|
||||||
|
@Value("${config.file-server}")
|
||||||
|
private String fileServer;
|
||||||
|
@Resource
|
||||||
|
private ConfigProperties config;
|
||||||
|
@Resource
|
||||||
|
private CmsArticleService cmsArticleService;
|
||||||
|
@Resource
|
||||||
|
private BszxClassService bszxClassService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxBm> pageRel(BszxBmParam param) {
|
||||||
|
PageParam<BszxBm, BszxBmParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("id desc");
|
||||||
|
List<BszxBm> list = baseMapper.selectPageRel(page, param);
|
||||||
|
list.forEach(d -> {
|
||||||
|
if(d.getClassId().equals(0)){
|
||||||
|
final BszxClassParam classParam = new BszxClassParam();
|
||||||
|
classParam.setGradeName(d.getGradeName());
|
||||||
|
classParam.setName(d.getClassName());
|
||||||
|
final List<BszxClass> bszxClasses = bszxClassService.listRel(classParam);
|
||||||
|
if (!CollectionUtils.isEmpty(bszxClasses)) {
|
||||||
|
BszxClass bszxClass = bszxClasses.get(0);
|
||||||
|
System.out.println("bszxClass = " + bszxClass);
|
||||||
|
d.setClassId(bszxClass.getId());
|
||||||
|
d.setBranchId(bszxClass.getBranch());
|
||||||
|
updateById(d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxBm> listRel(BszxBmParam param) {
|
||||||
|
List<BszxBm> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxBm, BszxBmParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("id desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxBm getByIdRel(Integer id) {
|
||||||
|
BszxBmParam param = new BszxBmParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成捐款证书 <a href="https://portrait.gitee.com/sGodT/image-combiner">...</a>
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String generatePoster(BszxBm item) throws Exception {
|
||||||
|
final CmsArticle article = cmsArticleService.getById(7859);
|
||||||
|
if (ObjectUtil.isEmpty(article)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
|
// Font font = new Font("阿里巴巴普惠体", Font.PLAIN, 40);
|
||||||
|
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||||
|
ImageCombiner combiner = new ImageCombiner(article.getAddress(), OutputFormat.JPG);
|
||||||
|
//加文本元素:姓名
|
||||||
|
// if (item.getType().equals(0)) {
|
||||||
|
// combiner.addTextElement(item.getName().concat(" 校友"), 40, 220, 540);
|
||||||
|
// } else {
|
||||||
|
// combiner.addTextElement(item.getName(), 40, 220, 540);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// combiner.addTextElement(DateUtil.format(DateUtil.date(), "yyyy年MM月"), 28,650, 1566);
|
||||||
|
//加图片元素:盖章
|
||||||
|
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 600, 1420);
|
||||||
|
|
||||||
|
|
||||||
|
if (item.getType().equals(0)) {
|
||||||
|
combiner.addTextElement(item.getName().concat(" 校友"), 30, 160, 1008);
|
||||||
|
} else {
|
||||||
|
combiner.addTextElement(item.getName(), 30, 160, 1008);
|
||||||
|
}
|
||||||
|
|
||||||
|
// combiner.addTextElement(DateUtil.format(DateUtil.date(), "yyyy年MM月"), 28,650, 1566);
|
||||||
|
//加图片元素:盖章
|
||||||
|
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 600, 1420);
|
||||||
|
//执行图片合并
|
||||||
|
combiner.combine();
|
||||||
|
|
||||||
|
if (!FileUtil.exist(uploadPath + "file/poster/" + item.getTenantId() + "/bm")) {
|
||||||
|
FileUtil.mkdir(uploadPath + "file/poster/" + item.getTenantId() + "/bm");
|
||||||
|
}
|
||||||
|
String basePath = "/poster/" + item.getTenantId() + "/bm/big-" + item.getId() + ".jpg";
|
||||||
|
String smallPath = "/poster/" + item.getTenantId() + "/bm/" + item.getId() + ".jpg";
|
||||||
|
String filename = uploadPath + "file" + basePath;
|
||||||
|
String smallFileName = uploadPath + "file" + smallPath;
|
||||||
|
combiner.save(filename);
|
||||||
|
|
||||||
|
File input = new File(filename);
|
||||||
|
File output = new File(smallFileName);
|
||||||
|
ImageUtil.adjustQuality(input, output, 0.8f);
|
||||||
|
if(input.exists()){
|
||||||
|
input.delete();
|
||||||
|
}
|
||||||
|
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxBm getByUserId(Integer userId) {
|
||||||
|
return getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, userId).last("limit 1"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxBranchMapper;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBranchService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBranch;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-分部Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-17 17:18:22
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxBranchServiceImpl extends ServiceImpl<BszxBranchMapper, BszxBranch> implements BszxBranchService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxBranch> pageRel(BszxBranchParam param) {
|
||||||
|
PageParam<BszxBranch, BszxBranchParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<BszxBranch> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxBranch> listRel(BszxBranchParam param) {
|
||||||
|
List<BszxBranch> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxBranch, BszxBranchParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxBranch getByIdRel(Integer id) {
|
||||||
|
BszxBranchParam param = new BszxBranchParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxClassMapper;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxClassService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxClass;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxClassParam;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-班级Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxClassServiceImpl extends ServiceImpl<BszxClassMapper, BszxClass> implements BszxClassService {
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private BszxPayService bszxPayService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxClass> pageRel(BszxClassParam param) {
|
||||||
|
PageParam<BszxClass, BszxClassParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, id asc");
|
||||||
|
List<BszxClass> list = baseMapper.selectPageRel(page, param);
|
||||||
|
LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (param.getLimit() == null) {
|
||||||
|
list.forEach(item -> {
|
||||||
|
wrapper.clear();
|
||||||
|
// wrapper.eq(BszxPay::getBranchName,item.getBranchName());
|
||||||
|
wrapper.eq(BszxPay::getGradeName,item.getGradeName());
|
||||||
|
wrapper.eq(BszxPay::getClassName, item.getName());
|
||||||
|
item.setTotalMoney(bszxPayService.sumMoney(wrapper));
|
||||||
|
updateById(item);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxClass> listRel(BszxClassParam param) {
|
||||||
|
List<BszxClass> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxClass, BszxClassParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, id asc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxClass getByIdRel(Integer id) {
|
||||||
|
BszxClassParam param = new BszxClassParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxEraMapper;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxEraService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxEra;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxEraParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年代Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxEraServiceImpl extends ServiceImpl<BszxEraMapper, BszxEra> implements BszxEraService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxEra> pageRel(BszxEraParam param) {
|
||||||
|
PageParam<BszxEra, BszxEraParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<BszxEra> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxEra> listRel(BszxEraParam param) {
|
||||||
|
List<BszxEra> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxEra, BszxEraParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxEra getByIdRel(Integer id) {
|
||||||
|
BszxEraParam param = new BszxEraParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxGradeMapper;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxGradeService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxGrade;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-年级Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxGradeServiceImpl extends ServiceImpl<BszxGradeMapper, BszxGrade> implements BszxGradeService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxGrade> pageRel(BszxGradeParam param) {
|
||||||
|
PageParam<BszxGrade, BszxGradeParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, id asc");
|
||||||
|
List<BszxGrade> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxGrade> listRel(BszxGradeParam param) {
|
||||||
|
List<BszxGrade> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxGrade, BszxGradeParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, id asc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxGrade getByIdRel(Integer id) {
|
||||||
|
BszxGradeParam param = new BszxGradeParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxPayRankingMapper;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayRankingService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款排行Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-25 08:54:09
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxPayRankingServiceImpl extends ServiceImpl<BszxPayRankingMapper, BszxPayRanking> implements BszxPayRankingService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxPayRanking> pageRel(BszxPayRankingParam param) {
|
||||||
|
PageParam<BszxPayRanking, BszxPayRankingParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<BszxPayRanking> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxPayRanking> listRel(BszxPayRankingParam param) {
|
||||||
|
List<BszxPayRanking> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxPayRanking, BszxPayRankingParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxPayRanking getByIdRel(Integer id) {
|
||||||
|
BszxPayRankingParam param = new BszxPayRankingParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
package com.gxwebsoft.bszx.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.freewayso.image.combiner.ImageCombiner;
|
||||||
|
import com.freewayso.image.combiner.enums.OutputFormat;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxBm;
|
||||||
|
import com.gxwebsoft.bszx.mapper.BszxPayMapper;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxBmService;
|
||||||
|
import com.gxwebsoft.bszx.service.BszxPayService;
|
||||||
|
import com.gxwebsoft.bszx.entity.BszxPay;
|
||||||
|
import com.gxwebsoft.bszx.param.BszxPayParam;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleService;
|
||||||
|
import com.gxwebsoft.common.core.utils.ImageUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.io.File;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百色中学-捐款记录Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-03-06 22:50:25
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class BszxPayServiceImpl extends ServiceImpl<BszxPayMapper, BszxPay> implements BszxPayService {
|
||||||
|
@Value("${config.upload-path}")
|
||||||
|
private String uploadPath;
|
||||||
|
@Value("${config.file-server}")
|
||||||
|
private String fileServer;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private CmsArticleService cmsArticleService;
|
||||||
|
@Resource
|
||||||
|
public BszxBmService bszxBmService;
|
||||||
|
@Resource
|
||||||
|
private BszxPayService bszxPayService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<BszxPay> pageRel(BszxPayParam param) {
|
||||||
|
PageParam<BszxPay, BszxPayParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("price desc, create_time desc");
|
||||||
|
List<BszxPay> list = baseMapper.selectPageRel(page, param);
|
||||||
|
list.forEach(item -> {
|
||||||
|
if(item.getId().equals(2088)){
|
||||||
|
item.setFormName("捐款用于设立阙里校友奖学金");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<BszxPay> listRel(BszxPayParam param) {
|
||||||
|
List<BszxPay> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<BszxPay, BszxPayParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("id desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BszxPay getByIdRel(Integer id) {
|
||||||
|
BszxPayParam param = new BszxPayParam();
|
||||||
|
param.setId(id);
|
||||||
|
final BszxPay item = param.getOne(baseMapper.selectListRel(param));
|
||||||
|
final CmsArticle article = cmsArticleService.getById(item.getFormId());
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
item.setArticle(article);
|
||||||
|
}
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成捐款证书 <a href="https://portrait.gitee.com/sGodT/image-combiner">...</a>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String generatePayCert(Integer id) throws Exception {
|
||||||
|
final BszxPay payCert = getByIdRel(id);
|
||||||
|
final CmsArticle item = cmsArticleService.getById(payCert.getFormId());
|
||||||
|
final BszxBm bm = bszxBmService.getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, payCert.getUserId()).last("limit 1"));
|
||||||
|
final BigDecimal totalMoney = bszxPayService.sumMoney(new LambdaQueryWrapper<BszxPay>().eq(BszxPay::getUserId, payCert.getUserId()));
|
||||||
|
if (StrUtil.isBlank(item.getAddress())) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(payCert)) {
|
||||||
|
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
||||||
|
ImageCombiner combiner = new ImageCombiner("https://oss.wsdns.cn/20250420/811a380e8e124097aa0940a7c68a1f72.jpeg", OutputFormat.JPG);
|
||||||
|
//加图片元素:盖章
|
||||||
|
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 550, 926);
|
||||||
|
//加文本元素:姓名
|
||||||
|
String str;
|
||||||
|
if (bm.getType().equals(0)) {
|
||||||
|
str = bm.getName().concat(" 校友");
|
||||||
|
combiner.addTextElement(str, 32, 930, 450);
|
||||||
|
} else {
|
||||||
|
str = bm.getName();
|
||||||
|
combiner.addTextElement(str, 22, 880, 450);
|
||||||
|
}
|
||||||
|
// combiner.addTextElement(bm.getName(), 32,900, 450);
|
||||||
|
//加文本元素:捐款证书内容
|
||||||
|
// combiner.addTextElement(" 承您慷慨解囊,襄助百色市百色中学", 32,200, 650);
|
||||||
|
// combiner.addTextElement("百廿校庆“" + item.getTitle() + "”项目,捐赠人民币", 32,200, 700);
|
||||||
|
combiner.addTextElement(totalMoney + "", 32, 1330, 600);
|
||||||
|
// combiner.addTextElement(" 您对学校的支持,为我们共同教育理", 32,200, 800);
|
||||||
|
// combiner.addTextElement("想的实现增添了一份动力。", 32,200, 850);
|
||||||
|
// combiner.addTextElement(" 承蒙惠赠,隆情铭感,特颁此证,以资谢旌!", 32, 200, 900);
|
||||||
|
// combiner.addTextElement("百色市百色中学", 32,560, 1015);
|
||||||
|
// final Date createTime = payCert.getCreateTime();
|
||||||
|
// combiner.addTextElement(DateUtil.format(createTime, "yyyy年MM月"), 28,586, 1060);
|
||||||
|
// combiner.addTextElement("2025年4月15日", 28,580, 1060);
|
||||||
|
|
||||||
|
//执行图片合并
|
||||||
|
combiner.combine();
|
||||||
|
|
||||||
|
if (!FileUtil.exist(uploadPath + "file/poster/" + payCert.getTenantId() + "/pay")) {
|
||||||
|
FileUtil.mkdir(uploadPath + "file/poster/" + payCert.getTenantId() + "/pay");
|
||||||
|
}
|
||||||
|
String basePath = "/poster/" + payCert.getTenantId() + "/pay/big-" + id + ".jpg";
|
||||||
|
String smallPath = "/poster/" + payCert.getTenantId() + "/pay/" + id + ".jpg";
|
||||||
|
String filename = uploadPath + "file" + basePath;
|
||||||
|
String smallFileName = uploadPath + "file" + smallPath;
|
||||||
|
combiner.save(filename);
|
||||||
|
|
||||||
|
File input = new File(filename);
|
||||||
|
File output = new File(smallFileName);
|
||||||
|
ImageUtil.adjustQuality(input, output, 0.8f);
|
||||||
|
if (input.exists()) {
|
||||||
|
input.delete();
|
||||||
|
}
|
||||||
|
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BigDecimal sumMoney(LambdaQueryWrapper<BszxPay> wrapper) {
|
||||||
|
return baseMapper.selectSumMoney(wrapper);
|
||||||
|
}
|
||||||
|
}
|
||||||
112
src/main/java/com/gxwebsoft/cms/controller/CmsAdController.java
Normal file
112
src/main/java/com/gxwebsoft/cms/controller/CmsAdController.java
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsAdService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsAd;
|
||||||
|
import com.gxwebsoft.cms.param.CmsAdParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "广告位管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-ad")
|
||||||
|
public class CmsAdController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsAdService cmsAdService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询广告位")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsAd>> page(CmsAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsAdService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部广告位")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsAd>> list(CmsAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsAdService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询广告位")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsAd> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
final CmsAd ad = cmsAdService.getByIdRel(id);
|
||||||
|
return success(ad);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加广告位")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsAd cmsAd) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsAd.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsAdService.save(cmsAd)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改广告位")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsAd cmsAd) {
|
||||||
|
if (cmsAdService.updateById(cmsAd)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除广告位")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsAdService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加广告位")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsAd> list) {
|
||||||
|
if (cmsAdService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改广告位")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAd> batchParam) {
|
||||||
|
if (batchParam.update(cmsAdService, "ad_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除广告位")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsAdService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsAdRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsAdRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsAdRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "广告图片管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-ad-record")
|
||||||
|
public class CmsAdRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsAdRecordService cmsAdRecordService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询广告图片")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsAdRecord>> page(CmsAdRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsAdRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部广告图片")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsAdRecord>> list(CmsAdRecordParam param) {
|
||||||
|
PageParam<CmsAdRecord, CmsAdRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsAdRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsAdRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsAdRecord:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询广告图片")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsAdRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsAdRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsAdRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加广告图片")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsAdRecord cmsAdRecord) {
|
||||||
|
if (cmsAdRecordService.save(cmsAdRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改广告图片")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsAdRecord cmsAdRecord) {
|
||||||
|
if (cmsAdRecordService.updateById(cmsAdRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除广告图片")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsAdRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加广告图片")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsAdRecord> list) {
|
||||||
|
if (cmsAdRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改广告图片")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAdRecord> batchParam) {
|
||||||
|
if (batchParam.update(cmsAdRecordService, "ad_record_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除广告图片")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsAdRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleCategoryService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleCategory;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCategoryParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章分类表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-category")
|
||||||
|
public class CmsArticleCategoryController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleCategoryService cmsArticleCategoryService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章分类表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleCategory>> page(CmsArticleCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCategoryService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章分类表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleCategory>> list(CmsArticleCategoryParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCategoryService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文章分类表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleCategory> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCategoryService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加文章分类表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleCategory.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleCategoryService.save(cmsArticleCategory)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改文章分类表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
||||||
|
if (cmsArticleCategoryService.updateById(cmsArticleCategory)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除文章分类表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleCategoryService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加文章分类表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCategory> list) {
|
||||||
|
if (cmsArticleCategoryService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改文章分类表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCategory> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleCategoryService, "category_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除文章分类表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleCategoryService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleCommentService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleComment;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCommentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章评论表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-comment")
|
||||||
|
public class CmsArticleCommentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleCommentService cmsArticleCommentService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章评论表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleComment>> page(CmsArticleCommentParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCommentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章评论表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleComment>> list(CmsArticleCommentParam param) {
|
||||||
|
PageParam<CmsArticleComment, CmsArticleCommentParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsArticleCommentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCommentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleComment:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询文章评论表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleComment> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsArticleCommentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCommentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加文章评论表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleComment cmsArticleComment) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleComment.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleCommentService.save(cmsArticleComment)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改文章评论表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleComment cmsArticleComment) {
|
||||||
|
if (cmsArticleCommentService.updateById(cmsArticleComment)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除文章评论表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleCommentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加文章评论表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleComment> list) {
|
||||||
|
if (cmsArticleCommentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改文章评论表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleComment> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleCommentService, "comment_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除文章评论表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleCommentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleContentService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleContent;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleContentParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "文章记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-content")
|
||||||
|
public class CmsArticleContentController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleContentService cmsArticleContentService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleContent>> page(CmsArticleContentParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleContentService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleContent>> list(CmsArticleContentParam param) {
|
||||||
|
// PageParam<CmsArticleContent, CmsArticleContentParam> page = new PageParam<>(param);
|
||||||
|
// page.setDefaultOrder("create_time desc");
|
||||||
|
// return success(cmsArticleContentService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleContentService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleContent:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询文章记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleContent> get(@PathVariable("id") Integer id) {
|
||||||
|
// return success(cmsArticleContentService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleContentService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加文章记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleContent cmsArticleContent) {
|
||||||
|
if (cmsArticleContentService.save(cmsArticleContent)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改文章记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleContent cmsArticleContent) {
|
||||||
|
if (cmsArticleContentService.updateById(cmsArticleContent)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除文章记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleContentService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加文章记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleContent> list) {
|
||||||
|
if (cmsArticleContentService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改文章记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleContent> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleContentService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除文章记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleContentService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,360 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
||||||
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||||
|
import com.gxwebsoft.cms.entity.*;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleImportParam;
|
||||||
|
import com.gxwebsoft.cms.service.*;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.UserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.common.core.constants.ArticleConstants.CACHE_KEY_ARTICLE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Validated
|
||||||
|
@Api(tags = "文章管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article")
|
||||||
|
public class CmsArticleController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleService cmsArticleService;
|
||||||
|
@Resource
|
||||||
|
private CmsArticleContentService articleContentService;
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
@Resource
|
||||||
|
private CmsModelService cmsModelService;
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
private static final long CACHE_MINUTES = 30L;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticle>> page(CmsArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticle>> list(CmsArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticle> get(@PathVariable("id") @NotNull Integer id) {
|
||||||
|
final CmsArticle article = cmsArticleService.getByIdRel(id);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
return fail("文章ID不存在",null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||||
|
@ApiOperation("添加文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody @Valid CmsArticle article) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
article.setUserId(loginUser.getUserId());
|
||||||
|
article.setAuthor(loginUser.getNickname());
|
||||||
|
article.setMerchantId(loginUser.getMerchantId());
|
||||||
|
if (cmsArticleService.saveRel(article)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
||||||
|
@ApiOperation("修改文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticle article) {
|
||||||
|
if (cmsArticleService.updateByIdRel(article)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
||||||
|
@ApiOperation("删除文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleService.removeById(id)) {
|
||||||
|
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||||
|
@ApiOperation("批量添加文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticle> list) {
|
||||||
|
if (cmsArticleService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
||||||
|
@ApiOperation("批量修改文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticle> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleService, "article_id")) {
|
||||||
|
// 删除缓存
|
||||||
|
final List<Serializable> ids = batchParam.getIds();
|
||||||
|
ids.forEach(id -> {
|
||||||
|
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
||||||
|
});
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
||||||
|
@ApiOperation("批量删除文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleService.removeByIds(ids)) {
|
||||||
|
// 删除缓存
|
||||||
|
ids.forEach(id -> {
|
||||||
|
redisUtil.delete(CACHE_KEY_ARTICLE + id);
|
||||||
|
});
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("读取上一篇")
|
||||||
|
@GetMapping("/getPrevious/{id}")
|
||||||
|
public ApiResult<CmsArticle> getPrevious(@PathVariable("id") Integer id) {
|
||||||
|
final CmsArticle item = cmsArticleService.getById(id);
|
||||||
|
if (ObjectUtil.isEmpty(item)) {
|
||||||
|
return success("没有找到上一篇文章",null);
|
||||||
|
}
|
||||||
|
CmsArticle article;
|
||||||
|
// TODO 按排序号规则
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.lt(CmsArticle::getSortNumber, item.getSortNumber());
|
||||||
|
wrapper.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper.eq(CmsArticle::getType, 0);
|
||||||
|
wrapper.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper.orderByDesc(CmsArticle::getSortNumber);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
article = cmsArticleService.getOne(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
// TODO 按ID排序
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
wrapper2.lt(CmsArticle::getArticleId, item.getArticleId());
|
||||||
|
wrapper2.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper2.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper2.last("limit 1");
|
||||||
|
wrapper2.orderByDesc(CmsArticle::getArticleId);
|
||||||
|
article = cmsArticleService.getOne(wrapper2);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("读取下一篇")
|
||||||
|
@GetMapping("/getNext/{id}")
|
||||||
|
public ApiResult<CmsArticle> getNext(@PathVariable("id") Integer id) {
|
||||||
|
CmsArticle item = cmsArticleService.getById(id);
|
||||||
|
if (ObjectUtil.isEmpty(item)) {
|
||||||
|
return success("没有找到下一篇文章",null);
|
||||||
|
}
|
||||||
|
CmsArticle article;
|
||||||
|
// TODO 按排序号规则
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.gt(CmsArticle::getSortNumber, item.getSortNumber());
|
||||||
|
wrapper.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper.eq(CmsArticle::getType, 0);
|
||||||
|
wrapper.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper.orderByAsc(CmsArticle::getSortNumber);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
article = cmsArticleService.getOne(wrapper);
|
||||||
|
if (ObjectUtil.isNotEmpty(article)) {
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
// TODO 按ID排序
|
||||||
|
LambdaQueryWrapper<CmsArticle> wrapper2 = new LambdaQueryWrapper<>();
|
||||||
|
wrapper2.gt(CmsArticle::getArticleId, item.getArticleId());
|
||||||
|
wrapper2.eq(CmsArticle::getStatus, 0);
|
||||||
|
wrapper2.eq(CmsArticle::getCategoryId, item.getCategoryId());
|
||||||
|
wrapper2.last("limit 1");
|
||||||
|
wrapper2.orderByAsc(CmsArticle::getArticleId);
|
||||||
|
article = cmsArticleService.getOne(wrapper2);
|
||||||
|
return success(article);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("统计信息")
|
||||||
|
@GetMapping("/data")
|
||||||
|
public ApiResult<Map<String, Integer>> data(CmsArticleParam param) {
|
||||||
|
Map<String, Integer> data = new HashMap<>();
|
||||||
|
final LambdaQueryWrapper<CmsArticle> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if (param.getMerchantId() != null) {
|
||||||
|
wrapper.eq(CmsArticle::getMerchantId, param.getMerchantId());
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer totalNum = cmsArticleService.count(
|
||||||
|
wrapper.eq(CmsArticle::getDeleted, 0).eq(CmsArticle::getStatus, 0)
|
||||||
|
);
|
||||||
|
data.put("totalNum", totalNum);
|
||||||
|
|
||||||
|
Integer totalNum2 = cmsArticleService.count(
|
||||||
|
wrapper.eq(CmsArticle::getStatus, 1)
|
||||||
|
);
|
||||||
|
data.put("totalNum2", totalNum2);
|
||||||
|
|
||||||
|
Integer totalNum3 = cmsArticleService.count(
|
||||||
|
wrapper.gt(CmsArticle::getStatus, 1)
|
||||||
|
);
|
||||||
|
data.put("totalNum3", totalNum3);
|
||||||
|
|
||||||
|
return success(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("密码校验")
|
||||||
|
@GetMapping("/checkArticlePassword")
|
||||||
|
public ApiResult<?> checkArticlePassword(CmsArticle param) {
|
||||||
|
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
||||||
|
return fail("密码不正确");
|
||||||
|
}
|
||||||
|
return success("密码正确");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* excel批量导入文章
|
||||||
|
*/
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||||
|
@ApiOperation("批量导入文章")
|
||||||
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
|
@PostMapping("/import")
|
||||||
|
public ApiResult<List<String>> importBatch(MultipartFile file) {
|
||||||
|
ImportParams importParams = new ImportParams();
|
||||||
|
try {
|
||||||
|
List<CmsArticleImportParam> list = ExcelImportUtil.importExcel(file.getInputStream(), CmsArticleImportParam.class, importParams);
|
||||||
|
list.forEach(d -> {
|
||||||
|
CmsArticle item = JSONUtil.parseObject(JSONUtil.toJSONString(d), CmsArticle.class);
|
||||||
|
assert item != null;
|
||||||
|
if (ObjectUtil.isNotEmpty(item)) {
|
||||||
|
if (item.getStatus() == null) {
|
||||||
|
item.setStatus(1);
|
||||||
|
}
|
||||||
|
if (cmsArticleService.save(item)) {
|
||||||
|
CmsArticleContent content = new CmsArticleContent();
|
||||||
|
content.setArticleId(item.getArticleId());
|
||||||
|
content.setContent(item.getContent());
|
||||||
|
articleContentService.save(content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return success("成功导入" + list.size() + "条", null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return fail("导入失败", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("按标签分页查询")
|
||||||
|
@GetMapping("/findTags")
|
||||||
|
public ApiResult<List<CmsArticle>> findTags(CmsArticleParam param) {
|
||||||
|
final String tags = param.getTags();
|
||||||
|
if (StringUtils.isNotBlank(tags)) {
|
||||||
|
final String[] split = tags.split(",");
|
||||||
|
final List<String> list = Arrays.asList(split);
|
||||||
|
LambdaQueryWrapper<CmsArticle> queryWrapper = new LambdaQueryWrapper();
|
||||||
|
if (StrUtil.isNotBlank(tags)) {
|
||||||
|
for (String s : list) {
|
||||||
|
queryWrapper.or().like(CmsArticle::getTags, s);
|
||||||
|
// queryWrapper.or().apply("LOCATE(" + "'" + s + "'," + "tags" + ") > 0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (param.getCategoryId() != null) {
|
||||||
|
queryWrapper.eq(CmsArticle::getCategoryId, param.getCategoryId());
|
||||||
|
}
|
||||||
|
if (param.getDetail() != null) {
|
||||||
|
queryWrapper.eq(CmsArticle::getDetail, param.getDetail());
|
||||||
|
}
|
||||||
|
queryWrapper.last("limit 8");
|
||||||
|
List<CmsArticle> articles = cmsArticleService.list(queryWrapper);
|
||||||
|
return success(articles);
|
||||||
|
}
|
||||||
|
return success("", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("按标签分页查询")
|
||||||
|
@GetMapping("/pageTags")
|
||||||
|
public ApiResult<List<CmsArticle>> pageTags(CmsArticleParam param) {
|
||||||
|
final String tags = param.getTags();
|
||||||
|
if (StringUtils.isNotBlank(tags)) {
|
||||||
|
final String[] split = tags.split(",");
|
||||||
|
final List<String> list = Arrays.asList(split);
|
||||||
|
LambdaQueryWrapper<CmsArticle> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
for (String s : list) {
|
||||||
|
queryWrapper.or().like(CmsArticle::getTags, s);
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc(CmsArticle::getCreateTime);
|
||||||
|
queryWrapper.last("limit 100");
|
||||||
|
List<CmsArticle> articles = cmsArticleService.list(queryWrapper);
|
||||||
|
if (!articles.isEmpty()) {
|
||||||
|
List<CmsNavigation> navigationList = cmsNavigationService.listByIds(articles.stream().map(CmsArticle::getCategoryId).toList());
|
||||||
|
for (CmsArticle article : articles) {
|
||||||
|
for (CmsNavigation navigation : navigationList) {
|
||||||
|
if (article.getCategoryId().equals(navigation.getNavigationId())) {
|
||||||
|
article.setCategoryName(navigation.getTitle());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(articles);
|
||||||
|
}
|
||||||
|
return success("", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("按IDS查询")
|
||||||
|
@GetMapping("/getByIds")
|
||||||
|
public ApiResult<List<CmsArticle>> getByIds(CmsArticleParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>().in(CmsArticle::getArticleId, param.getArticleIds())));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleCountService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleCount;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleCountParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "点赞文章管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-count")
|
||||||
|
public class CmsArticleCountController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleCountService cmsArticleCountService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询点赞文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleCount>> page(CmsArticleCountParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleCountService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部点赞文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleCount>> list(CmsArticleCountParam param) {
|
||||||
|
PageParam<CmsArticleCount, CmsArticleCountParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsArticleCountService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCountService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleCount:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询点赞文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleCount> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsArticleCountService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleCountService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加点赞文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleCount cmsArticleCount) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleCount.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleCountService.save(cmsArticleCount)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改点赞文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleCount cmsArticleCount) {
|
||||||
|
if (cmsArticleCountService.updateById(cmsArticleCount)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除点赞文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleCountService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加点赞文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCount> list) {
|
||||||
|
if (cmsArticleCountService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改点赞文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCount> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleCountService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除点赞文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleCountService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsArticleLikeService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsArticleLike;
|
||||||
|
import com.gxwebsoft.cms.param.CmsArticleLikeParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "点赞文章管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-article-like")
|
||||||
|
public class CmsArticleLikeController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsArticleLikeService cmsArticleLikeService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询点赞文章")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsArticleLike>> page(CmsArticleLikeParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsArticleLikeService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部点赞文章")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsArticleLike>> list(CmsArticleLikeParam param) {
|
||||||
|
PageParam<CmsArticleLike, CmsArticleLikeParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsArticleLikeService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleLikeService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsArticleLike:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询点赞文章")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsArticleLike> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsArticleLikeService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsArticleLikeService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加点赞文章")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsArticleLike cmsArticleLike) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsArticleLike.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsArticleLikeService.save(cmsArticleLike)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改点赞文章")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsArticleLike cmsArticleLike) {
|
||||||
|
if (cmsArticleLikeService.updateById(cmsArticleLike)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除点赞文章")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsArticleLikeService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加点赞文章")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleLike> list) {
|
||||||
|
if (cmsArticleLikeService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改点赞文章")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleLike> batchParam) {
|
||||||
|
if (batchParam.update(cmsArticleLikeService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除点赞文章")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsArticleLikeService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsComponentsService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsComponents;
|
||||||
|
import com.gxwebsoft.cms.param.CmsComponentsParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "组件管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-components")
|
||||||
|
public class CmsComponentsController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsComponentsService cmsComponentsService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询组件")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsComponents>> page(CmsComponentsParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsComponentsService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部组件")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsComponents>> list(CmsComponentsParam param) {
|
||||||
|
PageParam<CmsComponents, CmsComponentsParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsComponentsService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsComponentsService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsComponents:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询组件")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsComponents> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsComponentsService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsComponentsService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加组件")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsComponents cmsComponents) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsComponents.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsComponentsService.save(cmsComponents)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改组件")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsComponents cmsComponents) {
|
||||||
|
if (cmsComponentsService.updateById(cmsComponents)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除组件")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsComponentsService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加组件")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsComponents> list) {
|
||||||
|
if (cmsComponentsService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改组件")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsComponents> batchParam) {
|
||||||
|
if (batchParam.update(cmsComponentsService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除组件")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsComponentsService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsNavigation;
|
||||||
|
import com.gxwebsoft.cms.service.CmsNavigationService;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDesignService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesign;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDesignParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "页面管理记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-design")
|
||||||
|
public class CmsDesignController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsDesignService cmsDesignService;
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询页面管理记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsDesign>> page(CmsDesignParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部页面管理记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsDesign>> list(CmsDesignParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询页面管理记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsDesign> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加页面管理记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsDesign cmsDesign) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsDesign.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsDesignService.save(cmsDesign)) {
|
||||||
|
try {
|
||||||
|
cmsNavigationService.update(new LambdaUpdateWrapper<CmsNavigation>().set(CmsNavigation::getBanner, cmsDesign.getPhoto()).eq(CmsNavigation::getNavigationId,cmsDesign.getCategoryId()));
|
||||||
|
// 同步翻译英文版
|
||||||
|
cmsDesignService.translate(cmsDesign);
|
||||||
|
return success("添加成功");
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改页面管理记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsDesign cmsDesign) {
|
||||||
|
if (cmsDesignService.updateById(cmsDesign)) {
|
||||||
|
// 同步翻译英文版
|
||||||
|
cmsDesignService.translate(cmsDesign);
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除页面管理记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsDesignService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加页面管理记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsDesign> list) {
|
||||||
|
if (cmsDesignService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改页面管理记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesign> batchParam) {
|
||||||
|
if (batchParam.update(cmsDesignService, "page_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除页面管理记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsDesignService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDesignRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesignRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDesignRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "页面组件表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-design-record")
|
||||||
|
public class CmsDesignRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsDesignRecordService cmsDesignRecordService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询页面组件表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsDesignRecord>> page(CmsDesignRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDesignRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部页面组件表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsDesignRecord>> list(CmsDesignRecordParam param) {
|
||||||
|
PageParam<CmsDesignRecord, CmsDesignRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsDesignRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDesignRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsDesignRecord:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询页面组件表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsDesignRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsDesignRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDesignRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加页面组件表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsDesignRecord.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsDesignRecordService.save(cmsDesignRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改页面组件表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
||||||
|
if (cmsDesignRecordService.updateById(cmsDesignRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除页面组件表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsDesignRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加页面组件表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsDesignRecord> list) {
|
||||||
|
if (cmsDesignRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改页面组件表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesignRecord> batchParam) {
|
||||||
|
if (batchParam.update(cmsDesignRecordService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除页面组件表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsDesignRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.mapper.CmsDomainMapper;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDomainService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDomain;
|
||||||
|
import com.gxwebsoft.cms.param.CmsDomainParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站域名记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站域名记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-domain")
|
||||||
|
public class CmsDomainController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsDomainService cmsDomainService;
|
||||||
|
@Resource
|
||||||
|
private CmsDomainMapper cmsDomainMapper;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站域名记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsDomain>> page(CmsDomainParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsDomainService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站域名记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsDomain>> list(CmsDomainParam param) {
|
||||||
|
PageParam<CmsDomain, CmsDomainParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsDomainService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDomainService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsDomain:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询网站域名记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsDomain> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsDomainService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsDomainService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加网站域名记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsDomain cmsDomain) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsDomain.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsDomainService.save(cmsDomain)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改网站域名记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsDomain cmsDomain) {
|
||||||
|
if (cmsDomainService.updateById(cmsDomain)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除网站域名记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsDomainService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加网站域名记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsDomain> list) {
|
||||||
|
if (cmsDomainService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改网站域名记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDomain> batchParam) {
|
||||||
|
if (batchParam.update(cmsDomainService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除网站域名记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsDomainService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询授权域名信息")
|
||||||
|
@GetMapping("/getTenantIdByDomain")
|
||||||
|
public ApiResult<?> getTenantIdByDomain(CmsDomainParam param) {
|
||||||
|
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>().eq(CmsDomain::getDomain, param.getDomain()).last("limit 1"));
|
||||||
|
return success(domain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("授权二级域名")
|
||||||
|
@PostMapping("/domain")
|
||||||
|
public ApiResult<?> domain(@RequestBody CmsDomain cmsDomain) {
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
String key = "Domain:" + cmsDomain.getDomain();
|
||||||
|
final Integer tenantId = loginUser.getTenantId();
|
||||||
|
final CmsDomain domain = cmsDomainService.getOne(new LambdaQueryWrapper<CmsDomain>()
|
||||||
|
.eq(CmsDomain::getWebsiteId, cmsDomain.getWebsiteId()).last("limit 1"));
|
||||||
|
if (ObjectUtil.isNotEmpty(domain)) {
|
||||||
|
// 重写缓存
|
||||||
|
redisUtil.set(key,tenantId);
|
||||||
|
domain.setDomain(cmsDomain.getDomain());
|
||||||
|
cmsDomainService.updateById(domain);
|
||||||
|
return success("授权成功");
|
||||||
|
}
|
||||||
|
if(ObjectUtil.isEmpty(domain)){
|
||||||
|
cmsDomain.setUserId(loginUser.getUserId());
|
||||||
|
cmsDomain.setSortNumber(100);
|
||||||
|
cmsDomain.setStatus(1);
|
||||||
|
cmsDomain.setHostName("@");
|
||||||
|
cmsDomain.setWebsiteId(cmsDomain.getWebsiteId());
|
||||||
|
cmsDomain.setTenantId(tenantId);
|
||||||
|
if(cmsDomainService.save(cmsDomain)){
|
||||||
|
// 重写缓存
|
||||||
|
redisUtil.set(key,tenantId);
|
||||||
|
return success("授权成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fail("授权失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsFormService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsForm;
|
||||||
|
import com.gxwebsoft.cms.param.CmsFormParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单设计表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "表单设计表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-form")
|
||||||
|
public class CmsFormController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsFormService cmsFormService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询表单设计表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsForm>> page(CmsFormParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsFormService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部表单设计表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsForm>> list(CmsFormParam param) {
|
||||||
|
PageParam<CmsForm, CmsFormParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsFormService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsForm:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询表单设计表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsForm> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsFormService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加表单设计表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsForm cmsForm) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsForm.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsFormService.save(cmsForm)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改表单设计表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsForm cmsForm) {
|
||||||
|
if (cmsFormService.updateById(cmsForm)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除表单设计表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsFormService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加表单设计表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsForm> list) {
|
||||||
|
if (cmsFormService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改表单设计表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsForm> batchParam) {
|
||||||
|
if (batchParam.update(cmsFormService, "form_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除表单设计表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsFormService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsFormRecordService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsFormRecord;
|
||||||
|
import com.gxwebsoft.cms.param.CmsFormRecordParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表单数据记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "表单数据记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-form-record")
|
||||||
|
public class CmsFormRecordController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsFormRecordService cmsFormRecordService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询表单数据记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsFormRecord>> page(CmsFormRecordParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsFormRecordService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部表单数据记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsFormRecord>> list(CmsFormRecordParam param) {
|
||||||
|
PageParam<CmsFormRecord, CmsFormRecordParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsFormRecordService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormRecordService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsFormRecord:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询表单数据记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsFormRecord> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsFormRecordService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsFormRecordService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加表单数据记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsFormRecord cmsFormRecord) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsFormRecord.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsFormRecordService.save(cmsFormRecord)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改表单数据记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsFormRecord cmsFormRecord) {
|
||||||
|
if (cmsFormRecordService.updateById(cmsFormRecord)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除表单数据记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsFormRecordService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加表单数据记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsFormRecord> list) {
|
||||||
|
if (cmsFormRecordService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改表单数据记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsFormRecord> batchParam) {
|
||||||
|
if (batchParam.update(cmsFormRecordService, "form_record_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除表单数据记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsFormRecordService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsLangService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLang;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
@Api(tags = "国际化管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-lang")
|
||||||
|
public class CmsLangController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsLangService cmsLangService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询国际化")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsLang>> page(CmsLangParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部国际化")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsLang>> list(CmsLangParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:list')")
|
||||||
|
@ApiOperation("根据id查询国际化")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsLang> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
||||||
|
@ApiOperation("添加国际化")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsLang cmsLang) {
|
||||||
|
if (cmsLangService.save(cmsLang)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
||||||
|
@ApiOperation("修改国际化")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsLang cmsLang) {
|
||||||
|
if (cmsLangService.updateById(cmsLang)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:remove')")
|
||||||
|
@ApiOperation("删除国际化")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsLangService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
||||||
|
@ApiOperation("批量添加国际化")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsLang> list) {
|
||||||
|
if (cmsLangService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
||||||
|
@ApiOperation("批量修改国际化")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLang> batchParam) {
|
||||||
|
if (batchParam.update(cmsLangService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLang:reomve')")
|
||||||
|
@ApiOperation("批量删除国际化")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsLangService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsLangLogService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLangLog;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLangLogParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 国际化记录启用控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-06 19:29:26
|
||||||
|
*/
|
||||||
|
@Api(tags = "国际化记录启用管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-lang-log")
|
||||||
|
public class CmsLangLogController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsLangLogService cmsLangLogService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询国际化记录启用")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsLangLog>> page(CmsLangLogParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangLogService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部国际化记录启用")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsLangLog>> list(CmsLangLogParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangLogService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:list')")
|
||||||
|
@ApiOperation("根据id查询国际化记录启用")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsLangLog> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLangLogService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
||||||
|
@ApiOperation("添加国际化记录启用")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsLangLog cmsLangLog) {
|
||||||
|
if (cmsLangLogService.save(cmsLangLog)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
||||||
|
@ApiOperation("修改国际化记录启用")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsLangLog cmsLangLog) {
|
||||||
|
if (cmsLangLogService.updateById(cmsLangLog)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
||||||
|
@ApiOperation("删除国际化记录启用")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsLangLogService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
||||||
|
@ApiOperation("批量添加国际化记录启用")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsLangLog> list) {
|
||||||
|
if (cmsLangLogService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
||||||
|
@ApiOperation("批量修改国际化记录启用")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLangLog> batchParam) {
|
||||||
|
if (batchParam.update(cmsLangLogService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
||||||
|
@ApiOperation("批量删除国际化记录启用")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsLangLogService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsLinkService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsLink;
|
||||||
|
import com.gxwebsoft.cms.param.CmsLinkParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用链接控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "常用链接管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-link")
|
||||||
|
public class CmsLinkController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsLinkService cmsLinkService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询常用链接")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsLink>> page(CmsLinkParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLinkService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部常用链接")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsLink>> list(CmsLinkParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLinkService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsLink:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询常用链接")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsLink> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsLinkService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加常用链接")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsLink cmsLink) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsLink.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsLinkService.save(cmsLink)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改常用链接")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsLink cmsLink) {
|
||||||
|
if (cmsLinkService.updateById(cmsLink)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除常用链接")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsLinkService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加常用链接")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsLink> list) {
|
||||||
|
if (cmsLinkService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改常用链接")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLink> batchParam) {
|
||||||
|
if (batchParam.update(cmsLinkService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除常用链接")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsLinkService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsModelService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsModel;
|
||||||
|
import com.gxwebsoft.cms.param.CmsModelParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 模型控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-11-26 15:44:53
|
||||||
|
*/
|
||||||
|
@Api(tags = "模型管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-model")
|
||||||
|
public class CmsModelController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsModelService cmsModelService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询模型")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsModel>> page(CmsModelParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsModelService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部模型")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsModel>> list(CmsModelParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsModelService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询模型")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsModel> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsModelService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
||||||
|
@ApiOperation("添加模型")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsModel cmsModel) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsModel.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsModelService.save(cmsModel)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
||||||
|
@ApiOperation("修改模型")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsModel cmsModel) {
|
||||||
|
if (cmsModelService.updateById(cmsModel)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:remove')")
|
||||||
|
@ApiOperation("删除模型")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsModelService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
||||||
|
@ApiOperation("批量添加模型")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsModel> list) {
|
||||||
|
if (cmsModelService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
||||||
|
@ApiOperation("批量修改模型")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsModel> batchParam) {
|
||||||
|
if (batchParam.update(cmsModelService, "model_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsModel:remvoe')")
|
||||||
|
@ApiOperation("批量删除模型")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsModelService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpAdService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpAd;
|
||||||
|
import com.gxwebsoft.cms.param.CmsMpAdParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序广告位控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序广告位管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-mp-ad")
|
||||||
|
public class CmsMpAdController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsMpAdService cmsMpAdService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序广告位")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsMpAd>> page(CmsMpAdParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpAdService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序广告位")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsMpAd>> list(CmsMpAdParam param) {
|
||||||
|
PageParam<CmsMpAd, CmsMpAdParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsMpAdService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsMpAdService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsMpAd:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询小程序广告位")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsMpAd> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsMpAdService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsMpAdService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序广告位")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsMpAd cmsMpAd) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsMpAd.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsMpAdService.save(cmsMpAd)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序广告位")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsMpAd cmsMpAd) {
|
||||||
|
if (cmsMpAdService.updateById(cmsMpAd)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序广告位")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsMpAdService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序广告位")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsMpAd> list) {
|
||||||
|
if (cmsMpAdService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序广告位")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsMpAd> batchParam) {
|
||||||
|
if (batchParam.update(cmsMpAdService, "ad_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序广告位")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsMpAdService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
283
src/main/java/com/gxwebsoft/cms/controller/CmsMpController.java
Normal file
283
src/main/java/com/gxwebsoft/cms/controller/CmsMpController.java
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateField;
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpField;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpMenu;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpPages;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpFieldService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpMenuService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpPagesService;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMp;
|
||||||
|
import com.gxwebsoft.cms.param.CmsMpParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序信息控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序信息管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-mp")
|
||||||
|
public class CmsMpController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsMpService cmsMpService;
|
||||||
|
@Resource
|
||||||
|
private CmsMpPagesService cmsMpPagesService;
|
||||||
|
@Resource
|
||||||
|
private CmsMpFieldService mpFieldService;
|
||||||
|
@Resource
|
||||||
|
private CmsMpMenuService cmsMpMenuService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序信息")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsMp>> page(CmsMpParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序信息")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsMp>> list(CmsMpParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsMp:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询小程序信息")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsMp> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序信息")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsMp cmsMp) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsMp.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsMpService.save(cmsMp)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序信息")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsMp cmsMp) {
|
||||||
|
if (cmsMpService.updateById(cmsMp)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序信息")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsMpService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序信息")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsMp> list) {
|
||||||
|
if (cmsMpService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序信息")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsMp> batchParam) {
|
||||||
|
if (batchParam.update(cmsMpService, "mp_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序信息")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsMpService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("小程序基本信息")
|
||||||
|
@GetMapping("/getMpInfo")
|
||||||
|
public ApiResult<?> getMpInfo() {
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
String key = "MpInfo:" + tenantId;
|
||||||
|
System.out.println("key = " + key);
|
||||||
|
final String mpInfo = redisUtil.get(key);
|
||||||
|
|
||||||
|
if (tenantId.equals(0)) {
|
||||||
|
return fail("租户ID不存在", null);
|
||||||
|
}
|
||||||
|
System.out.println("mpInfo = " + mpInfo);
|
||||||
|
// 从缓存读取信息
|
||||||
|
if (StrUtil.isNotBlank(mpInfo)) {
|
||||||
|
final Object object = JSONUtil.parseObject(mpInfo, Object.class);
|
||||||
|
System.out.println("object = " + object);
|
||||||
|
return success(object);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取小程序
|
||||||
|
if (cmsMpService.count(new LambdaUpdateWrapper<CmsMp>().eq(CmsMp::getDeleted, 0)) == 0) {
|
||||||
|
// 创建小程序
|
||||||
|
createMp();
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, Object> map = new HashMap<>();
|
||||||
|
|
||||||
|
// 获取小程序
|
||||||
|
final CmsMp mp = cmsMpService.getOne(new LambdaQueryWrapper<CmsMp>().eq(CmsMp::getTenantId, tenantId).last("limit 1"));
|
||||||
|
mp.setAppSecret(null);
|
||||||
|
map.put("mp", mp);
|
||||||
|
|
||||||
|
// 原生导航条
|
||||||
|
final List<CmsMpPages> tabBar = cmsMpPagesService.list(new LambdaQueryWrapper<CmsMpPages>().eq(CmsMpPages::getSubpackage, "MainPackage").last("limit 5"));
|
||||||
|
map.put("tabBar", tabBar);
|
||||||
|
|
||||||
|
// 配置信息
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
config.put("LICENSE_CODE", "");
|
||||||
|
config.put("MAP_KEY", "");
|
||||||
|
final List<CmsMpField> fields = mpFieldService.list();
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
map.put("config", config);
|
||||||
|
|
||||||
|
// 服务器时间
|
||||||
|
HashMap<String, Object> serverTime = new HashMap<>();
|
||||||
|
// 今天日期
|
||||||
|
DateTime date = DateUtil.date();
|
||||||
|
String today = DateUtil.today();
|
||||||
|
// 明天日期
|
||||||
|
final DateTime dateTime = DateUtil.tomorrow();
|
||||||
|
String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
|
||||||
|
// 后天日期
|
||||||
|
final DateTime dateTime2 = DateUtil.offsetDay(date, 2);
|
||||||
|
final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd");
|
||||||
|
// 今天星期几
|
||||||
|
final int week = DateUtil.thisDayOfWeek();
|
||||||
|
final DateTime nextWeek = DateUtil.nextWeek();
|
||||||
|
serverTime.put("now", DateUtil.now()); // 2024-07-18 22:06:36
|
||||||
|
serverTime.put("today", today); // 2024-07-18
|
||||||
|
serverTime.put("tomorrow", tomorrow); // 2024-07-19
|
||||||
|
serverTime.put("afterDay", afterDay); // 2024-07-20
|
||||||
|
serverTime.put("nextWeek", nextWeek); // 2024-07-25 22:06:36
|
||||||
|
serverTime.put("week", week); // 5
|
||||||
|
map.put("serverTime", serverTime);
|
||||||
|
redisUtil.set(key, map, 1L, TimeUnit.DAYS);
|
||||||
|
return success(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createMp() {
|
||||||
|
System.out.println("创建小程序 = ");
|
||||||
|
final User loginUser = getLoginUser();
|
||||||
|
final Integer tenantId = getTenantId();
|
||||||
|
// 创建网站记录
|
||||||
|
final CmsMp mp = new CmsMp();
|
||||||
|
mp.setTenantId(tenantId);
|
||||||
|
mp.setAppId("小程序ID");
|
||||||
|
mp.setMpName("小程序名称");
|
||||||
|
mp.setMainPath("/pages/index");
|
||||||
|
if (loginUser != null) {
|
||||||
|
mp.setUserId(getLoginUserId());
|
||||||
|
}
|
||||||
|
mp.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 1));
|
||||||
|
cmsMpService.save(mp);
|
||||||
|
|
||||||
|
// 创建底部导航栏
|
||||||
|
final CmsMpPages mpPages = new CmsMpPages();
|
||||||
|
mpPages.setHome(1);
|
||||||
|
mpPages.setTitle("首页");
|
||||||
|
mpPages.setPath("/pages/index");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("HomeOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
mpPages.setTenantId(tenantId);
|
||||||
|
cmsMpPagesService.save(mpPages);
|
||||||
|
mpPages.setHome(0);
|
||||||
|
mpPages.setTitle("分类");
|
||||||
|
mpPages.setPath("/pages/category");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("AppstoreOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
cmsMpPagesService.save(mpPages);
|
||||||
|
mpPages.setTitle("购物车");
|
||||||
|
mpPages.setPath("/pages/category");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("ShoppingCartOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
cmsMpPagesService.save(mpPages);
|
||||||
|
mpPages.setTitle("我的");
|
||||||
|
mpPages.setPath("/pages/user");
|
||||||
|
mpPages.setSubpackage("MainPackage");
|
||||||
|
mpPages.setIcon("UserOutlined");
|
||||||
|
mpPages.setSortNumber(0);
|
||||||
|
cmsMpPagesService.save(mpPages);
|
||||||
|
|
||||||
|
// 创建导航图标
|
||||||
|
final CmsMpMenu mpMenu = new CmsMpMenu();
|
||||||
|
mpMenu.setTenantId(tenantId);
|
||||||
|
mpMenu.setTitle("分类1");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
mpMenu.setTarget("uni.navigateTo");
|
||||||
|
cmsMpMenuService.save(mpMenu);
|
||||||
|
mpMenu.setTitle("分类2");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
cmsMpMenuService.save(mpMenu);
|
||||||
|
mpMenu.setTitle("分类3");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
cmsMpMenuService.save(mpMenu);
|
||||||
|
mpMenu.setTitle("分类4");
|
||||||
|
mpMenu.setIcon("PictureOutlined");
|
||||||
|
mpMenu.setPath("/package/order");
|
||||||
|
cmsMpMenuService.save(mpMenu);
|
||||||
|
|
||||||
|
// 小程序配置信息
|
||||||
|
CmsMpField field = new CmsMpField();
|
||||||
|
field.setName("mpLogo");
|
||||||
|
mpFieldService.save(field);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpFieldService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpField;
|
||||||
|
import com.gxwebsoft.cms.param.CmsMpFieldParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序配置控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序配置管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-mp-field")
|
||||||
|
public class CmsMpFieldController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsMpFieldService cmsMpFieldService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序配置")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsMpField>> page(CmsMpFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpFieldService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序配置")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsMpField>> list(CmsMpFieldParam param) {
|
||||||
|
PageParam<CmsMpField, CmsMpFieldParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsMpFieldService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsMpFieldService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsMpField:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询小程序配置")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsMpField> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsMpFieldService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsMpFieldService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序配置")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsMpField cmsMpField) {
|
||||||
|
if (cmsMpFieldService.save(cmsMpField)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序配置")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsMpField cmsMpField) {
|
||||||
|
if (cmsMpFieldService.updateById(cmsMpField)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序配置")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsMpFieldService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序配置")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsMpField> list) {
|
||||||
|
if (cmsMpFieldService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序配置")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsMpField> batchParam) {
|
||||||
|
if (batchParam.update(cmsMpFieldService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序配置")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsMpFieldService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpMenuService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpMenu;
|
||||||
|
import com.gxwebsoft.cms.param.CmsMpMenuParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序端菜单控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序端菜单管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-mp-menu")
|
||||||
|
public class CmsMpMenuController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsMpMenuService cmsMpMenuService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序端菜单")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsMpMenu>> page(CmsMpMenuParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpMenuService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序端菜单")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsMpMenu>> list(CmsMpMenuParam param) {
|
||||||
|
PageParam<CmsMpMenu, CmsMpMenuParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("create_time desc");
|
||||||
|
return success(cmsMpMenuService.list(page.getOrderWrapper()));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsMpMenuService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsMpMenu:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询小程序端菜单")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsMpMenu> get(@PathVariable("id") Integer id) {
|
||||||
|
return success(cmsMpMenuService.getById(id));
|
||||||
|
// 使用关联查询
|
||||||
|
//return success(cmsMpMenuService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序端菜单")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsMpMenu cmsMpMenu) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsMpMenu.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsMpMenuService.save(cmsMpMenu)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序端菜单")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsMpMenu cmsMpMenu) {
|
||||||
|
if (cmsMpMenuService.updateById(cmsMpMenu)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序端菜单")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsMpMenuService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序端菜单")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsMpMenu> list) {
|
||||||
|
if (cmsMpMenuService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序端菜单")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsMpMenu> batchParam) {
|
||||||
|
if (batchParam.update(cmsMpMenuService, "menu_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序端菜单")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsMpMenuService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsMpPagesService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsMpPages;
|
||||||
|
import com.gxwebsoft.cms.param.CmsMpPagesParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小程序页面控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "小程序页面管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-mp-pages")
|
||||||
|
public class CmsMpPagesController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsMpPagesService cmsMpPagesService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询小程序页面")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsMpPages>> page(CmsMpPagesParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpPagesService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部小程序页面")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsMpPages>> list(CmsMpPagesParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpPagesService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsMpPages:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询小程序页面")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsMpPages> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsMpPagesService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加小程序页面")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsMpPages cmsMpPages) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsMpPages.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsMpPagesService.save(cmsMpPages)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改小程序页面")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsMpPages cmsMpPages) {
|
||||||
|
if (cmsMpPagesService.updateById(cmsMpPages)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除小程序页面")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsMpPagesService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加小程序页面")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsMpPages> list) {
|
||||||
|
if (cmsMpPagesService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改小程序页面")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsMpPages> batchParam) {
|
||||||
|
if (batchParam.update(cmsMpPagesService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除小程序页面")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsMpPagesService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,190 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsDesign;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsModel;
|
||||||
|
import com.gxwebsoft.cms.service.CmsDesignService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsModelService;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsNavigationService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsNavigation;
|
||||||
|
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.common.system.service.UserService;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import springfox.documentation.spring.web.plugins.Docket;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站导航记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站导航记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-navigation")
|
||||||
|
public class CmsNavigationController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
@Resource
|
||||||
|
private CmsModelService cmsModelService;
|
||||||
|
@Resource
|
||||||
|
private CmsDesignService cmsDesignService;
|
||||||
|
@Resource
|
||||||
|
private UserService userService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
|
|
||||||
|
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站导航记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsNavigation>> page(CmsNavigationParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站导航记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsNavigation>> list(CmsNavigationParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站导航记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsNavigation> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsNavigationService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加网站导航记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsNavigation cmsNavigation) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsNavigation.setUserId(loginUser.getUserId());
|
||||||
|
cmsNavigation.setTenantId(loginUser.getTenantId());
|
||||||
|
}
|
||||||
|
// 去除前面空格
|
||||||
|
cmsNavigation.setTitle(StrUtil.trimStart(cmsNavigation.getTitle()));
|
||||||
|
if (cmsNavigationService.save(cmsNavigation)) {
|
||||||
|
// 添加成功事务处理
|
||||||
|
cmsNavigationService.saveAsync(cmsNavigation);
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改网站导航记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsNavigation cmsNavigation) {
|
||||||
|
if (cmsNavigationService.updateById(cmsNavigation)) {
|
||||||
|
// 修改成功事务处理
|
||||||
|
cmsNavigationService.saveAsync(cmsNavigation);
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除网站导航记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsNavigationService.removeById(id)) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加网站导航记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsNavigation> list) {
|
||||||
|
if (cmsNavigationService.saveBatch(list)) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改网站导航记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsNavigation> batchParam) {
|
||||||
|
if (batchParam.update(cmsNavigationService, "navigation_id")) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除网站导航记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsNavigationService.removeByIds(ids)) {
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取树形结构的网站导航数据")
|
||||||
|
@GetMapping("/tree")
|
||||||
|
public ApiResult<List<CmsNavigation>> tree(CmsNavigationParam param) {
|
||||||
|
param.setHide(0);
|
||||||
|
final List<CmsNavigation> navigations = cmsNavigationService.listRel(param);
|
||||||
|
return success(CommonUtil.toTreeData(navigations, 0, CmsNavigation::getParentId, CmsNavigation::getNavigationId, CmsNavigation::setChildren));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据path获取导航")
|
||||||
|
@GetMapping("/getNavigationByPath")
|
||||||
|
public ApiResult<CmsNavigation> getNavigationByPath(CmsNavigationParam param) {
|
||||||
|
final CmsNavigation navigation = cmsNavigationService.getOne(new LambdaUpdateWrapper<CmsNavigation>().eq(CmsNavigation::getModel, param.getModel()).last("limit 1"));
|
||||||
|
if (ObjectUtil.isNotEmpty(navigation)) {
|
||||||
|
// 页面元素
|
||||||
|
final CmsDesign design = cmsDesignService.getOne(new LambdaUpdateWrapper<CmsDesign>().eq(CmsDesign::getCategoryId, navigation.getNavigationId()).last("limit 1"));
|
||||||
|
// 模型信息
|
||||||
|
final CmsModel model = cmsModelService.getOne(new LambdaQueryWrapper<CmsModel>().eq(CmsModel::getModel, navigation.getModel()).last("limit 1"));
|
||||||
|
navigation.setBanner(model.getBanner());
|
||||||
|
// 上级导航
|
||||||
|
if (!navigation.getParentId().equals(0)) {
|
||||||
|
final CmsNavigation parent = cmsNavigationService.getById(navigation.getParentId());
|
||||||
|
navigation.setParentPath(parent.getPath());
|
||||||
|
navigation.setParentName(parent.getTitle());
|
||||||
|
}
|
||||||
|
// 页面信息
|
||||||
|
navigation.setDesign(design);
|
||||||
|
// 页面布局
|
||||||
|
if (ObjectUtil.isNotEmpty(design)) {
|
||||||
|
navigation.setLayout(design.getLayout());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return success(navigation);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("密码校验")
|
||||||
|
@GetMapping("/checkNavigationPassword")
|
||||||
|
public ApiResult<?> checkNavigationPassword(CmsNavigationParam param) {
|
||||||
|
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
||||||
|
return fail("密码不正确");
|
||||||
|
}
|
||||||
|
return success("密码正确");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,131 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsOrderService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsOrder;
|
||||||
|
import com.gxwebsoft.cms.param.CmsOrderParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 订单控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-11-25 12:14:05
|
||||||
|
*/
|
||||||
|
@Api(tags = "订单管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-order")
|
||||||
|
public class CmsOrderController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsOrderService cmsOrderService;
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:list')")
|
||||||
|
@ApiOperation("分页查询订单")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsOrder>> page(CmsOrderParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsOrderService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:list')")
|
||||||
|
@ApiOperation("查询全部订单")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsOrder>> list(CmsOrderParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsOrderService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:list')")
|
||||||
|
@ApiOperation("根据id查询订单")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsOrder> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsOrderService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加订单")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsOrder cmsOrder) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsOrder.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if(cmsOrder.getCode() == null){
|
||||||
|
return fail("验证码不正确",null);
|
||||||
|
}
|
||||||
|
if(cmsOrder.getOrderNo() == null){
|
||||||
|
cmsOrder.setOrderNo(CommonUtil.createOrderNo());
|
||||||
|
}
|
||||||
|
// 默认语言
|
||||||
|
if(cmsOrder.getLang() == null){
|
||||||
|
cmsOrder.setLang("zh_CN");
|
||||||
|
}
|
||||||
|
if (cmsOrderService.save(cmsOrder)) {
|
||||||
|
return success("提交成功");
|
||||||
|
}
|
||||||
|
return fail("提交失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:update')")
|
||||||
|
@ApiOperation("修改订单")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsOrder cmsOrder) {
|
||||||
|
if (cmsOrderService.updateById(cmsOrder)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:remove')")
|
||||||
|
@ApiOperation("删除订单")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsOrderService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:save')")
|
||||||
|
@ApiOperation("批量添加订单")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsOrder> list) {
|
||||||
|
if (cmsOrderService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:update')")
|
||||||
|
@ApiOperation("批量修改订单")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsOrder> batchParam) {
|
||||||
|
if (batchParam.update(cmsOrderService, "order_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsOrder:remove')")
|
||||||
|
@ApiOperation("批量删除订单")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsOrderService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,150 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.param.CmsProductSpecParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsProductService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsProduct;
|
||||||
|
import com.gxwebsoft.cms.param.CmsProductParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-27 16:03:44
|
||||||
|
*/
|
||||||
|
@Api(tags = "产品管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-product")
|
||||||
|
public class CmsProductController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsProductService cmsProductService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询产品")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsProduct>> page(CmsProductParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部产品")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsProduct>> list(CmsProductParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询产品")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsProduct> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProduct:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("添加产品")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsProduct cmsProduct) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsProduct.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsProductService.save(cmsProduct)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProduct:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("修改产品")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsProduct cmsProduct) {
|
||||||
|
if (cmsProductService.updateById(cmsProduct)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProduct:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("删除产品")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsProductService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProduct:save')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量添加产品")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsProduct> list) {
|
||||||
|
if (cmsProductService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProduct:update')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量修改产品")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProduct> batchParam) {
|
||||||
|
if (batchParam.update(cmsProductService, "product_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProduct:remove')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("批量删除产品")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsProductService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("统计信息")
|
||||||
|
@GetMapping("/data")
|
||||||
|
public ApiResult<Map<String, Integer>> data(CmsProductSpecParam param) {
|
||||||
|
Map<String, Integer> data = new HashMap<>();
|
||||||
|
final LambdaQueryWrapper<CmsProduct> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
if(param.getMerchantId() != null){
|
||||||
|
wrapper.eq(CmsProduct::getMerchantId,param.getMerchantId());
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer totalNum = cmsProductService.count(
|
||||||
|
wrapper.eq(CmsProduct::getDeleted,0).eq(CmsProduct::getStatus,0)
|
||||||
|
);
|
||||||
|
data.put("totalNum", totalNum);
|
||||||
|
|
||||||
|
Integer totalNum2 = cmsProductService.count(
|
||||||
|
wrapper.eq(CmsProduct::getStatus,1)
|
||||||
|
);
|
||||||
|
data.put("totalNum2", totalNum2);
|
||||||
|
|
||||||
|
Integer totalNum3 = cmsProductService.count(
|
||||||
|
wrapper.gt(CmsProduct::getStatus,1)
|
||||||
|
);
|
||||||
|
data.put("totalNum3", totalNum3);
|
||||||
|
|
||||||
|
return success(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsProductSpecService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsProductSpec;
|
||||||
|
import com.gxwebsoft.cms.param.CmsProductSpecParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-27 16:03:44
|
||||||
|
*/
|
||||||
|
@Api(tags = "规格管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-product-spec")
|
||||||
|
public class CmsProductSpecController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsProductSpecService cmsProductSpecService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询规格")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsProductSpec>> page(CmsProductSpecParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductSpecService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部规格")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsProductSpec>> list(CmsProductSpecParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductSpecService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProductSpec:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询规格")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsProductSpec> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductSpecService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加规格")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsProductSpec cmsProductSpec) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsProductSpec.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsProductSpecService.save(cmsProductSpec)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改规格")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsProductSpec cmsProductSpec) {
|
||||||
|
if (cmsProductSpecService.updateById(cmsProductSpec)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除规格")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsProductSpecService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加规格")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsProductSpec> list) {
|
||||||
|
if (cmsProductSpecService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改规格")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProductSpec> batchParam) {
|
||||||
|
if (batchParam.update(cmsProductSpecService, "spec_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除规格")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsProductSpecService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsProductSpecValueService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsProductSpecValue;
|
||||||
|
import com.gxwebsoft.cms.param.CmsProductSpecValueParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格值控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-27 16:03:44
|
||||||
|
*/
|
||||||
|
@Api(tags = "规格值管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-product-spec-value")
|
||||||
|
public class CmsProductSpecValueController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsProductSpecValueService cmsProductSpecValueService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询规格值")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsProductSpecValue>> page(CmsProductSpecValueParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductSpecValueService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部规格值")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsProductSpecValue>> list(CmsProductSpecValueParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductSpecValueService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProductSpecValue:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询规格值")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsProductSpecValue> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductSpecValueService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加规格值")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsProductSpecValue cmsProductSpecValue) {
|
||||||
|
if (cmsProductSpecValueService.save(cmsProductSpecValue)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改规格值")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsProductSpecValue cmsProductSpecValue) {
|
||||||
|
if (cmsProductSpecValueService.updateById(cmsProductSpecValue)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除规格值")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsProductSpecValueService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加规格值")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsProductSpecValue> list) {
|
||||||
|
if (cmsProductSpecValueService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改规格值")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProductSpecValue> batchParam) {
|
||||||
|
if (batchParam.update(cmsProductSpecValueService, "spec_value_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除规格值")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsProductSpecValueService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsProductUrlService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsProductUrl;
|
||||||
|
import com.gxwebsoft.cms.param.CmsProductUrlParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 域名控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-27 16:03:44
|
||||||
|
*/
|
||||||
|
@Api(tags = "域名管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-product-url")
|
||||||
|
public class CmsProductUrlController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsProductUrlService cmsProductUrlService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询域名")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsProductUrl>> page(CmsProductUrlParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductUrlService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部域名")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsProductUrl>> list(CmsProductUrlParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductUrlService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsProductUrl:list')")
|
||||||
|
@OperationLog
|
||||||
|
@ApiOperation("根据id查询域名")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsProductUrl> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsProductUrlService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加域名")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsProductUrl cmsProductUrl) {
|
||||||
|
if (cmsProductUrlService.save(cmsProductUrl)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改域名")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsProductUrl cmsProductUrl) {
|
||||||
|
if (cmsProductUrlService.updateById(cmsProductUrl)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除域名")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsProductUrlService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加域名")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsProductUrl> list) {
|
||||||
|
if (cmsProductUrlService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改域名")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsProductUrl> batchParam) {
|
||||||
|
if (batchParam.update(cmsProductUrlService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除域名")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsProductUrlService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsTemplateService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsTemplate;
|
||||||
|
import com.gxwebsoft.cms.param.CmsTemplateParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站模版控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-01-21 14:21:16
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站模版管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-template")
|
||||||
|
public class CmsTemplateController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsTemplateService cmsTemplateService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站模版")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsTemplate>> page(CmsTemplateParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsTemplateService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站模版")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsTemplate>> list(CmsTemplateParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsTemplateService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站模版")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsTemplate> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsTemplateService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
||||||
|
@ApiOperation("添加网站模版")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsTemplate cmsTemplate) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsTemplate.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (cmsTemplateService.save(cmsTemplate)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
||||||
|
@ApiOperation("修改网站模版")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsTemplate cmsTemplate) {
|
||||||
|
if (cmsTemplateService.updateById(cmsTemplate)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
||||||
|
@ApiOperation("删除网站模版")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsTemplateService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
||||||
|
@ApiOperation("批量添加网站模版")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsTemplate> list) {
|
||||||
|
if (cmsTemplateService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
||||||
|
@ApiOperation("批量修改网站模版")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsTemplate> batchParam) {
|
||||||
|
if (batchParam.update(cmsTemplateService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
||||||
|
@ApiOperation("批量删除网站模版")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsTemplateService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,339 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.*;
|
||||||
|
import com.gxwebsoft.cms.param.CmsNavigationParam;
|
||||||
|
import com.gxwebsoft.cms.service.CmsNavigationService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteFieldService;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteSettingService;
|
||||||
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteService;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.models.auth.In;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站信息记录表控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Api(tags = "网站信息记录表管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-website")
|
||||||
|
public class CmsWebsiteController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteService cmsWebsiteService;
|
||||||
|
@Resource
|
||||||
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
||||||
|
@Resource
|
||||||
|
private CmsNavigationService cmsNavigationService;
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteSettingService cmsWebsiteSettingService;
|
||||||
|
|
||||||
|
private static final String SITE_INFO_KEY_PREFIX = "SiteInfo:";
|
||||||
|
private static final String MP_INFO_KEY_PREFIX = "MpInfo:";
|
||||||
|
private static final String SELECT_PAYMENT_KEY_PREFIX = "SelectPayment:";
|
||||||
|
private static final String SYS_DOMAIN_SUFFIX = ".websoft.top";
|
||||||
|
private static final String DOMAIN_SUFFIX = ".wsdns.cn";
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站信息记录表")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsWebsite>> page(CmsWebsiteParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站信息记录表")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsWebsite>> list(CmsWebsiteParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站信息记录表")
|
||||||
|
@GetMapping("/pageAll")
|
||||||
|
public ApiResult<PageResult<CmsWebsite>> pageAll(CmsWebsiteParam param) {
|
||||||
|
return success(cmsWebsiteService.pageRelAll(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站信息记录表")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsWebsite> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站信息记录表")
|
||||||
|
@GetMapping("/getAll/{id}")
|
||||||
|
public ApiResult<CmsWebsite> getAll(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteService.getByIdRelAll(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||||
|
@ApiOperation("添加网站信息记录表")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsWebsite cmsWebsite) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
cmsWebsite.setLoginUser(loginUser);
|
||||||
|
return success("创建成功", cmsWebsiteService.create(cmsWebsite));
|
||||||
|
}
|
||||||
|
return fail("创建失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@ApiOperation("修改网站信息记录表")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsWebsite cmsWebsite) {
|
||||||
|
if (cmsWebsiteService.updateById(cmsWebsite)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@ApiOperation("修改网站信息记录表")
|
||||||
|
@PutMapping("/updateAll")
|
||||||
|
public ApiResult<?> updateAll(@RequestBody CmsWebsite cmsWebsite) {
|
||||||
|
if (cmsWebsiteService.updateByIdAll(cmsWebsite)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@ApiOperation("删除网站信息记录表")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@ApiOperation("删除网站信息记录表")
|
||||||
|
@DeleteMapping("/removeAll/{id}")
|
||||||
|
public ApiResult<?> removeAll(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteService.removeByIdAll(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||||
|
@ApiOperation("批量添加网站信息记录表")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsite> list) {
|
||||||
|
if (cmsWebsiteService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@ApiOperation("批量修改网站信息记录表")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsite> batchParam) {
|
||||||
|
if (batchParam.update(cmsWebsiteService, "website_id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||||
|
@ApiOperation("批量删除网站信息记录表")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsWebsiteService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("网站基本信息")
|
||||||
|
@GetMapping("/getSiteInfo")
|
||||||
|
public ApiResult<CmsWebsite> getSiteInfo() {
|
||||||
|
if (ObjectUtil.isEmpty(getTenantId())) {
|
||||||
|
return fail("参数不正确", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
String key = SITE_INFO_KEY_PREFIX + getTenantId();
|
||||||
|
final String siteInfo = redisUtil.get(key);
|
||||||
|
if (StrUtil.isNotBlank(siteInfo)) {
|
||||||
|
log.info("从缓存获取网站信息: = {}", key);
|
||||||
|
// return success(JSONUtil.parseObject(siteInfo, CmsWebsite.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取站点信息
|
||||||
|
CmsWebsite website = cmsWebsiteService.getOne(new LambdaQueryWrapper<CmsWebsite>().eq(CmsWebsite::getDeleted, 0).last("limit 1"));
|
||||||
|
|
||||||
|
// 创建默认站点
|
||||||
|
if (ObjectUtil.isEmpty(website)) {
|
||||||
|
return success("请先创建站点...", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 站点异常状态
|
||||||
|
setWebsiteStatus(website);
|
||||||
|
|
||||||
|
// 站点配置参数
|
||||||
|
HashMap<String, Object> config = buildWebsiteConfig(website);
|
||||||
|
website.setConfig(config);
|
||||||
|
|
||||||
|
// 网站导航
|
||||||
|
setWebsiteNavigation(website);
|
||||||
|
|
||||||
|
// 网站设置信息
|
||||||
|
setWebsiteSetting(website);
|
||||||
|
|
||||||
|
// 服务器时间
|
||||||
|
HashMap<String, Object> serverTime = buildServerTime();
|
||||||
|
website.setServerTime(serverTime);
|
||||||
|
|
||||||
|
// 即将过期(一周内过期的)
|
||||||
|
website.setSoon(DateUtil.offsetDay(website.getExpirationTime(), -30).compareTo(DateUtil.date()));
|
||||||
|
// 是否过期 -1已过期 大于0 未过期
|
||||||
|
website.setExpired(website.getExpirationTime().compareTo(DateUtil.date()));
|
||||||
|
// 剩余天数
|
||||||
|
website.setExpiredDays(DateUtil.betweenDay(website.getExpirationTime(), DateUtil.date(), false));
|
||||||
|
|
||||||
|
redisUtil.set(key, website, 1L, TimeUnit.DAYS);
|
||||||
|
return success(website);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWebsiteStatus(CmsWebsite website) {
|
||||||
|
if (!website.getRunning().equals(1)) {
|
||||||
|
// 未开通
|
||||||
|
if (website.getRunning().equals(0)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("该站点未开通");
|
||||||
|
}
|
||||||
|
// 维护中
|
||||||
|
if (website.getRunning().equals(2)) {
|
||||||
|
website.setStatusIcon("warning");
|
||||||
|
}
|
||||||
|
// 已关闭
|
||||||
|
if (website.getRunning().equals(3)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("已关闭");
|
||||||
|
}
|
||||||
|
// 已欠费停机
|
||||||
|
if (website.getRunning().equals(4)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("已欠费停机");
|
||||||
|
}
|
||||||
|
// 违规关停
|
||||||
|
if (website.getRunning().equals(5)) {
|
||||||
|
website.setStatusIcon("error");
|
||||||
|
website.setStatusText("违规关停");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> buildWebsiteConfig(CmsWebsite website) {
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
LambdaQueryWrapper<CmsWebsiteField> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(CmsWebsiteField::getDeleted, 0);
|
||||||
|
final List<CmsWebsiteField> fields = cmsWebsiteFieldService.list(wrapper);
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
config.put("SysDomain", getSysDomain(website));
|
||||||
|
config.put("Domain", getDomain(website));
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getSysDomain(CmsWebsite website) {
|
||||||
|
return StrUtil.isNotBlank(website.getWebsiteCode()) ? website.getWebsiteCode() + SYS_DOMAIN_SUFFIX : website.getTenantId() + SYS_DOMAIN_SUFFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getDomain(CmsWebsite website) {
|
||||||
|
return StrUtil.isNotBlank(website.getDomain()) ? website.getDomain() : website.getWebsiteCode() + DOMAIN_SUFFIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWebsiteNavigation(CmsWebsite website) {
|
||||||
|
final CmsNavigationParam navigationParam = new CmsNavigationParam();
|
||||||
|
navigationParam.setHide(0);
|
||||||
|
navigationParam.setTop(0);
|
||||||
|
navigationParam.setBottom(null);
|
||||||
|
final List<CmsNavigation> topNavs = cmsNavigationService.listRel(navigationParam);
|
||||||
|
// 顶部菜单
|
||||||
|
website.setTopNavs(CommonUtil.toTreeData(topNavs, 0, CmsNavigation::getParentId, CmsNavigation::getNavigationId, CmsNavigation::setChildren));
|
||||||
|
navigationParam.setTop(null);
|
||||||
|
navigationParam.setBottom(0);
|
||||||
|
final List<CmsNavigation> bottomNavs = cmsNavigationService.listRel(navigationParam);
|
||||||
|
// 底部菜单
|
||||||
|
website.setBottomNavs(CommonUtil.toTreeData(bottomNavs, 0, CmsNavigation::getParentId, CmsNavigation::getNavigationId, CmsNavigation::setChildren));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWebsiteSetting(CmsWebsite website) {
|
||||||
|
final CmsWebsiteSetting setting = cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, website.getWebsiteId()));
|
||||||
|
if (ObjectUtil.isNotEmpty(setting)) {
|
||||||
|
website.setSetting(setting);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private HashMap<String, Object> buildServerTime() {
|
||||||
|
HashMap<String, Object> serverTime = new HashMap<>();
|
||||||
|
// 今天日期
|
||||||
|
DateTime date = DateUtil.date();
|
||||||
|
String today = DateUtil.today();
|
||||||
|
// 明天日期
|
||||||
|
final DateTime dateTime = DateUtil.tomorrow();
|
||||||
|
String tomorrow = DateUtil.format(dateTime, "yyyy-MM-dd");
|
||||||
|
// 后天日期
|
||||||
|
final DateTime dateTime2 = DateUtil.offsetDay(date, 2);
|
||||||
|
final String afterDay = DateUtil.format(dateTime2, "yyyy-MM-dd");
|
||||||
|
// 今天星期几
|
||||||
|
final int week = DateUtil.thisDayOfWeek();
|
||||||
|
final DateTime nextWeek = DateUtil.nextWeek();
|
||||||
|
serverTime.put("now", DateUtil.now());
|
||||||
|
serverTime.put("today", today);
|
||||||
|
serverTime.put("tomorrow", tomorrow);
|
||||||
|
serverTime.put("afterDay", afterDay);
|
||||||
|
serverTime.put("week", week);
|
||||||
|
serverTime.put("nextWeek", nextWeek);
|
||||||
|
return serverTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("清除缓存")
|
||||||
|
@DeleteMapping("/clearSiteInfo/{key}")
|
||||||
|
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
|
||||||
|
// 清除指定key
|
||||||
|
redisUtil.delete(key);
|
||||||
|
// 清除缓存
|
||||||
|
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
// 清除小程序缓存
|
||||||
|
redisUtil.delete(MP_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
// 选择支付方式
|
||||||
|
redisUtil.delete(SELECT_PAYMENT_KEY_PREFIX.concat(getTenantId().toString()));
|
||||||
|
return success("清除成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteFieldService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsiteField;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteFieldParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用参数控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:36:14
|
||||||
|
*/
|
||||||
|
@Api(tags = "应用参数管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-website-field")
|
||||||
|
public class CmsWebsiteFieldController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询应用参数")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsWebsiteField>> page(CmsWebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部应用参数")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsWebsiteField>> list(CmsWebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询应用参数")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsWebsiteField> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteFieldService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加应用参数")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
||||||
|
if (cmsWebsiteFieldService.save(cmsWebsiteField)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改应用参数")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
||||||
|
if (cmsWebsiteFieldService.updateById(cmsWebsiteField)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除应用参数")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteFieldService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加应用参数")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteField> list) {
|
||||||
|
if (cmsWebsiteFieldService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改应用参数")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteField> batchParam) {
|
||||||
|
if (batchParam.update(cmsWebsiteFieldService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除应用参数")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsWebsiteFieldService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("获取网站配置参数-对象形式")
|
||||||
|
@GetMapping("/config")
|
||||||
|
public ApiResult<?> getConfig(CmsWebsiteFieldParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
final List<CmsWebsiteField> fields = cmsWebsiteFieldService.listRel(param);
|
||||||
|
|
||||||
|
HashMap<String, Object> config = new HashMap<>();
|
||||||
|
fields.forEach(d -> {
|
||||||
|
config.put(d.getName(), d.getValue());
|
||||||
|
});
|
||||||
|
return success(config);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.CmsWebsiteSettingService;
|
||||||
|
import com.gxwebsoft.cms.entity.CmsWebsiteSetting;
|
||||||
|
import com.gxwebsoft.cms.param.CmsWebsiteSettingParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 网站设置控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2025-02-19 01:35:44
|
||||||
|
*/
|
||||||
|
@Api(tags = "网站设置管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/cms-website-setting")
|
||||||
|
public class CmsWebsiteSettingController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private CmsWebsiteSettingService cmsWebsiteSettingService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询网站设置")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<CmsWebsiteSetting>> page(CmsWebsiteSettingParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteSettingService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部网站设置")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<CmsWebsiteSetting>> list(CmsWebsiteSettingParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(cmsWebsiteSettingService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询网站设置")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<CmsWebsiteSetting> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
final CmsWebsiteSetting cmsWebsiteSetting = cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, id));
|
||||||
|
if(ObjectUtil.isEmpty(cmsWebsiteSetting)){
|
||||||
|
final CmsWebsiteSetting setting = new CmsWebsiteSetting();
|
||||||
|
setting.setWebsiteId(id);
|
||||||
|
cmsWebsiteSettingService.save(setting);
|
||||||
|
return success(cmsWebsiteSettingService.getOne(new LambdaQueryWrapper<CmsWebsiteSetting>().eq(CmsWebsiteSetting::getWebsiteId, id)));
|
||||||
|
}
|
||||||
|
return success(cmsWebsiteSetting);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
||||||
|
@ApiOperation("添加网站设置")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
||||||
|
if (cmsWebsiteSettingService.save(cmsWebsiteSetting)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||||
|
@ApiOperation("修改网站设置")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
||||||
|
if (cmsWebsiteSettingService.updateById(cmsWebsiteSetting)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
||||||
|
@ApiOperation("删除网站设置")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (cmsWebsiteSettingService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
||||||
|
@ApiOperation("批量添加网站设置")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteSetting> list) {
|
||||||
|
if (cmsWebsiteSettingService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:update')")
|
||||||
|
@ApiOperation("批量修改网站设置")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteSetting> batchParam) {
|
||||||
|
if (batchParam.update(cmsWebsiteSettingService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
||||||
|
@ApiOperation("批量删除网站设置")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (cmsWebsiteSettingService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
package com.gxwebsoft.cms.dto;
|
||||||
|
|
||||||
|
public class CmsWebsiteConstants {
|
||||||
|
public static final String MP_APPID_KEY = "MpApp:";
|
||||||
|
}
|
||||||
102
src/main/java/com/gxwebsoft/cms/entity/CmsAd.java
Normal file
102
src/main/java/com/gxwebsoft/cms/entity/CmsAd.java
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.DesensitizedUtil;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告位
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsAd对象", description = "广告位")
|
||||||
|
public class CmsAd implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "ad_id", type = IdType.AUTO)
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "栏目名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告位名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "宽")
|
||||||
|
private String width;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "高")
|
||||||
|
private String height;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "边框")
|
||||||
|
private String border;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "CSS样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告图片")
|
||||||
|
private String images;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告图片")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private JSONArray imageList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
public JSONArray getImageList() {
|
||||||
|
return JSON.parseArray(this.images);
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/main/java/com/gxwebsoft/cms/entity/CmsAdRecord.java
Normal file
57
src/main/java/com/gxwebsoft/cms/entity/CmsAdRecord.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 广告图片
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsAdRecord对象", description = "广告图片")
|
||||||
|
public class CmsAdRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "ad_record_id", type = IdType.AUTO)
|
||||||
|
private Integer adRecordId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "链接地址")
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "广告位ID")
|
||||||
|
private Integer adId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
43
src/main/java/com/gxwebsoft/cms/entity/CmsAdVo.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/CmsAdVo.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "图片DTO", description = "图片DTO")
|
||||||
|
public class CmsAdVo implements Serializable {
|
||||||
|
|
||||||
|
@ApiModelProperty("ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer uid;
|
||||||
|
|
||||||
|
@ApiModelProperty("名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty("图片路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String url;
|
||||||
|
|
||||||
|
@ApiModelProperty("视频地址")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@ApiModelProperty("状态")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
@ApiModelProperty("图片宽")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer width;
|
||||||
|
|
||||||
|
@ApiModelProperty("图片高")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer height;
|
||||||
|
}
|
||||||
260
src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java
Normal file
260
src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java
Normal file
@@ -0,0 +1,260 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsArticle对象", description = "文章")
|
||||||
|
public class CmsArticle implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
@TableId(value = "article_id", type = IdType.AUTO)
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章类型 0常规 1视频")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章模型")
|
||||||
|
private String model;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "内容模板页面")
|
||||||
|
private String detail;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "banner")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String banner;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "访问路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "列表显示方式(10小图展示 20大图展示)")
|
||||||
|
private Integer showType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "话题")
|
||||||
|
private String topic;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标签")
|
||||||
|
private String tags;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章分类ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "当前分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String categoryName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级分类ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级分类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String parentName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "封面图")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "封面图宽度")
|
||||||
|
private Integer imageWidth;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "封面图高度")
|
||||||
|
private Integer imageHeight;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "价格")
|
||||||
|
private BigDecimal price;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "开始时间")
|
||||||
|
private Date startTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "到期时间")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "来源")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "产品概述")
|
||||||
|
private String overview;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "虚拟阅读量(仅用作展示)")
|
||||||
|
private Integer virtualViews;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "实际阅读量")
|
||||||
|
private Integer actualViews;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评分")
|
||||||
|
private BigDecimal rate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "可见类型 0所有人 1登录可见 2密码可见")
|
||||||
|
private Integer permission;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "访问密码")
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "验证密码(前端回传)")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String password2;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "发布来源客户端 (APP、H5、小程序等)")
|
||||||
|
private String platform;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章附件")
|
||||||
|
private String files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "视频地址")
|
||||||
|
private String video;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "接受的文件类型")
|
||||||
|
private String accept;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "经度")
|
||||||
|
private String longitude;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "纬度")
|
||||||
|
private String latitude;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在省份")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在城市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所在辖区")
|
||||||
|
private String region;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "街道地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "点赞数")
|
||||||
|
private Integer likes;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评论数")
|
||||||
|
private Integer commentNumbers;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "提醒谁看")
|
||||||
|
private String toUsers;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "作者")
|
||||||
|
private String author;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联默认语言的文章ID,用于同步翻译更新")
|
||||||
|
private Integer langArticleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否启用自动翻译")
|
||||||
|
private Boolean translation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "编辑器类型 1 富文本编辑器 2 Markdown编辑器")
|
||||||
|
private Integer editor;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "PDF地址")
|
||||||
|
private String pdfUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "版本号")
|
||||||
|
private Integer version;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户ID")
|
||||||
|
private Long merchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "项目ID")
|
||||||
|
private Long projectId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "商户名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String merchantAvatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "昵称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String nickname;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态文本")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String statusText;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否更新")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isUpdate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "已报名人数")
|
||||||
|
private Integer bmUsers;
|
||||||
|
|
||||||
|
public String getStatusText() {
|
||||||
|
if (this.status == 0) {
|
||||||
|
return "已发布";
|
||||||
|
}
|
||||||
|
if (this.status == 1) {
|
||||||
|
return "待审核";
|
||||||
|
}
|
||||||
|
if (this.status == 2) {
|
||||||
|
return "已驳回";
|
||||||
|
}
|
||||||
|
if (this.status == 3) {
|
||||||
|
return "违规内容";
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章分类表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsArticleCategory对象", description = "文章分类表")
|
||||||
|
public class CmsArticleCategory implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章分类ID")
|
||||||
|
@TableId(value = "category_id", type = IdType.AUTO)
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类标识")
|
||||||
|
private String categoryCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类名称")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型 0列表 1单页 2外链")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "分类图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级分类ID")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由/链接地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件路径")
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "绑定的页面")
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章数量")
|
||||||
|
private Integer count;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||||
|
private Integer hide;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否推荐")
|
||||||
|
private Integer recommend;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否显示在首页")
|
||||||
|
private Integer showIndex;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1禁用")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章评论表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsArticleComment对象", description = "文章评论表")
|
||||||
|
public class CmsArticleComment implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评价ID")
|
||||||
|
@TableId(value = "comment_id", type = IdType.AUTO)
|
||||||
|
private Integer commentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评分 (10好评 20中评 30差评)")
|
||||||
|
private Integer score;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评价内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否为图片评价")
|
||||||
|
private Integer isPicture;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "评论者ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "被评价者ID")
|
||||||
|
private Integer toUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复的评论ID")
|
||||||
|
private Integer replyCommentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "回复者ID")
|
||||||
|
private Integer replyUserId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0未读, 1已读")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文章记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsArticleContent对象", description = "文章记录表")
|
||||||
|
public class CmsArticleContent implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
42
src/main/java/com/gxwebsoft/cms/entity/CmsArticleCount.java
Normal file
42
src/main/java/com/gxwebsoft/cms/entity/CmsArticleCount.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsArticleCount对象", description = "点赞文章")
|
||||||
|
public class CmsArticleCount implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
42
src/main/java/com/gxwebsoft/cms/entity/CmsArticleLike.java
Normal file
42
src/main/java/com/gxwebsoft/cms/entity/CmsArticleLike.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点赞文章
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsArticleLike对象", description = "点赞文章")
|
||||||
|
public class CmsArticleLike implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "文章ID")
|
||||||
|
private Integer articleId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
69
src/main/java/com/gxwebsoft/cms/entity/CmsComponents.java
Normal file
69
src/main/java/com/gxwebsoft/cms/entity/CmsComponents.java
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组件
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsComponents对象", description = "组件")
|
||||||
|
public class CmsComponents implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联导航ID")
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件类型")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件路径")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件图标")
|
||||||
|
private String icon;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
115
src/main/java/com/gxwebsoft/cms/entity/CmsDesign.java
Normal file
115
src/main/java/com/gxwebsoft/cms/entity/CmsDesign.java
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面管理记录表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsDesign对象", description = "页面管理记录表")
|
||||||
|
public class CmsDesign implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "page_id", type = IdType.AUTO)
|
||||||
|
private Integer pageId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面标题")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属栏目ID")
|
||||||
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "路由地址")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件路径")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String component;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩列图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "购买链接")
|
||||||
|
private String buyUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面样式")
|
||||||
|
private String style;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面内容")
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否开启布局")
|
||||||
|
private Boolean showLayout;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面布局")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String layout;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否显示banner")
|
||||||
|
private Boolean showBanner;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否显示Button")
|
||||||
|
private Boolean showButton;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级id, 0是顶级")
|
||||||
|
private Integer parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "国际化语言")
|
||||||
|
private String lang;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用于同步翻译内容")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer langCategoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否启用自动翻译")
|
||||||
|
private Boolean translation;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设为首页")
|
||||||
|
private Integer home;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
75
src/main/java/com/gxwebsoft/cms/entity/CmsDesignRecord.java
Normal file
75
src/main/java/com/gxwebsoft/cms/entity/CmsDesignRecord.java
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面组件表
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-10 20:47:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "CmsDesignRecord对象", description = "页面组件表")
|
||||||
|
public class CmsDesignRecord implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "ID")
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "关联导航ID")
|
||||||
|
private Integer navigationId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件标识")
|
||||||
|
private String dictCode;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组件样式")
|
||||||
|
private String styles;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "卡片阴影显示时机")
|
||||||
|
private String shadow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面关键词")
|
||||||
|
private String keywords;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "页面路由地址")
|
||||||
|
private String path;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "缩列图")
|
||||||
|
private String photo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0正常, 1冻结")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user