11
This commit is contained in:
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,104 @@
|
||||
package com.gxwebsoft.auto.controller;
|
||||
|
||||
import com.gxwebsoft.auto.dto.QrLoginConfirmRequest;
|
||||
import com.gxwebsoft.auto.dto.QrLoginGenerateResponse;
|
||||
import com.gxwebsoft.auto.dto.QrLoginStatusResponse;
|
||||
import com.gxwebsoft.auto.service.QrLoginService;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.common.core.web.ApiResult;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 认证模块
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "认证模块")
|
||||
@RestController
|
||||
@RequestMapping("/api/qr-login")
|
||||
public class QrLoginController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private QrLoginService qrLoginService;
|
||||
|
||||
/**
|
||||
* 生成扫码登录token
|
||||
*/
|
||||
@Operation(summary = "生成扫码登录token")
|
||||
@PostMapping("/generate")
|
||||
public ApiResult<?> generateQrLoginToken() {
|
||||
try {
|
||||
QrLoginGenerateResponse response = qrLoginService.generateQrLoginToken();
|
||||
return success("生成成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查扫码登录状态
|
||||
*/
|
||||
@Operation(summary = "检查扫码登录状态")
|
||||
@GetMapping("/status/{token}")
|
||||
public ApiResult<?> checkQrLoginStatus(
|
||||
@Parameter(description = "扫码登录token") @PathVariable String token) {
|
||||
try {
|
||||
QrLoginStatusResponse response = qrLoginService.checkQrLoginStatus(token);
|
||||
return success("查询成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 确认扫码登录
|
||||
*/
|
||||
@Operation(summary = "确认扫码登录")
|
||||
@PostMapping("/confirm")
|
||||
public ApiResult<?> confirmQrLogin(@Valid @RequestBody QrLoginConfirmRequest request) {
|
||||
try {
|
||||
QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request);
|
||||
return success("确认成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 扫码操作(可选接口,用于移动端扫码后更新状态)
|
||||
*/
|
||||
@Operation(summary = "扫码操作")
|
||||
@PostMapping("/scan/{token}")
|
||||
public ApiResult<?> scanQrCode(@Parameter(description = "扫码登录token") @PathVariable String token) {
|
||||
try {
|
||||
boolean result = qrLoginService.scanQrCode(token);
|
||||
return success("操作成功", result);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信小程序扫码登录确认(便捷接口)
|
||||
*/
|
||||
@Operation(summary = "微信小程序扫码登录确认")
|
||||
@PostMapping("/wechat-confirm")
|
||||
public ApiResult<?> wechatMiniProgramConfirm(@Valid @RequestBody QrLoginConfirmRequest request) {
|
||||
try {
|
||||
// 设置平台为微信小程序
|
||||
request.setPlatform("miniprogram");
|
||||
QrLoginStatusResponse response = qrLoginService.confirmQrLogin(request);
|
||||
return success("微信小程序登录确认成功", response);
|
||||
} catch (Exception e) {
|
||||
return fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 扫码登录确认请求
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "扫码登录确认请求")
|
||||
public class QrLoginConfirmRequest {
|
||||
|
||||
@Schema(description = "扫码登录token")
|
||||
@NotBlank(message = "token不能为空")
|
||||
private String token;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "登录平台: web-网页端, app-移动应用, miniprogram-微信小程序")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "微信小程序相关信息")
|
||||
private WechatMiniProgramInfo wechatInfo;
|
||||
|
||||
/**
|
||||
* 微信小程序信息
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "微信小程序信息")
|
||||
public static class WechatMiniProgramInfo {
|
||||
@Schema(description = "微信openid")
|
||||
private String openid;
|
||||
|
||||
@Schema(description = "微信unionid")
|
||||
private String unionid;
|
||||
|
||||
@Schema(description = "微信昵称")
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "微信头像")
|
||||
private String avatar;
|
||||
}
|
||||
|
||||
}
|
||||
55
src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java
Normal file
55
src/main/java/com/gxwebsoft/auto/dto/QrLoginData.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 扫码登录数据模型
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class QrLoginData {
|
||||
|
||||
/**
|
||||
* 扫码登录token
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* 状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, expired-已过期
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 用户ID(扫码确认后设置)
|
||||
*/
|
||||
private Integer userId;
|
||||
|
||||
/**
|
||||
* 用户名(扫码确认后设置)
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 过期时间
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
/**
|
||||
* JWT访问令牌(确认后生成)
|
||||
*/
|
||||
private String accessToken;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 扫码登录生成响应
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "扫码登录生成响应")
|
||||
public class QrLoginGenerateResponse {
|
||||
|
||||
@Schema(description = "扫码登录token")
|
||||
private String token;
|
||||
|
||||
@Schema(description = "二维码内容")
|
||||
private String qrCode;
|
||||
|
||||
@Schema(description = "过期时间(秒)")
|
||||
private Long expiresIn;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.gxwebsoft.auto.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 扫码登录状态响应
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "扫码登录状态响应")
|
||||
public class QrLoginStatusResponse {
|
||||
|
||||
@Schema(description = "状态: pending-等待扫码, scanned-已扫码, confirmed-已确认, expired-已过期")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "JWT访问令牌(仅在confirmed状态时返回)")
|
||||
private String accessToken;
|
||||
|
||||
@Schema(description = "用户信息(仅在confirmed状态时返回)")
|
||||
private Object userInfo;
|
||||
|
||||
@Schema(description = "剩余过期时间(秒)")
|
||||
private Long expiresIn;
|
||||
|
||||
}
|
||||
46
src/main/java/com/gxwebsoft/auto/service/QrLoginService.java
Normal file
46
src/main/java/com/gxwebsoft/auto/service/QrLoginService.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.gxwebsoft.auto.service;
|
||||
|
||||
import com.gxwebsoft.auto.dto.QrLoginConfirmRequest;
|
||||
import com.gxwebsoft.auto.dto.QrLoginGenerateResponse;
|
||||
import com.gxwebsoft.auto.dto.QrLoginStatusResponse;
|
||||
|
||||
/**
|
||||
* 扫码登录服务接口
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
public interface QrLoginService {
|
||||
|
||||
/**
|
||||
* 生成扫码登录token
|
||||
*
|
||||
* @return QrLoginGenerateResponse
|
||||
*/
|
||||
QrLoginGenerateResponse generateQrLoginToken();
|
||||
|
||||
/**
|
||||
* 检查扫码登录状态
|
||||
*
|
||||
* @param token 扫码登录token
|
||||
* @return QrLoginStatusResponse
|
||||
*/
|
||||
QrLoginStatusResponse checkQrLoginStatus(String token);
|
||||
|
||||
/**
|
||||
* 确认扫码登录
|
||||
*
|
||||
* @param request 确认请求
|
||||
* @return QrLoginStatusResponse
|
||||
*/
|
||||
QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request);
|
||||
|
||||
/**
|
||||
* 扫码操作(更新状态为已扫码)
|
||||
*
|
||||
* @param token 扫码登录token
|
||||
* @return boolean
|
||||
*/
|
||||
boolean scanQrCode(String token);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
package com.gxwebsoft.auto.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.UUID;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.gxwebsoft.auto.dto.*;
|
||||
import com.gxwebsoft.auto.service.QrLoginService;
|
||||
import com.gxwebsoft.common.core.security.JwtSubject;
|
||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||
import com.gxwebsoft.common.system.entity.User;
|
||||
import com.gxwebsoft.common.system.service.UserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static com.gxwebsoft.common.core.constants.RedisConstants.*;
|
||||
|
||||
/**
|
||||
* 扫码登录服务实现
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-08-31
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class QrLoginServiceImpl implements QrLoginService {
|
||||
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Value("${config.jwt.secret:websoft-jwt-secret-key-2025}")
|
||||
private String jwtSecret;
|
||||
|
||||
@Value("${config.jwt.expire:86400}")
|
||||
private Long jwtExpire;
|
||||
|
||||
@Override
|
||||
public QrLoginGenerateResponse generateQrLoginToken() {
|
||||
// 生成唯一的扫码登录token
|
||||
String token = UUID.randomUUID().toString(true);
|
||||
|
||||
// 创建扫码登录数据
|
||||
QrLoginData qrLoginData = new QrLoginData();
|
||||
qrLoginData.setToken(token);
|
||||
qrLoginData.setStatus(QR_LOGIN_STATUS_PENDING);
|
||||
qrLoginData.setCreateTime(LocalDateTime.now());
|
||||
qrLoginData.setExpireTime(LocalDateTime.now().plusSeconds(QR_LOGIN_TOKEN_TTL));
|
||||
|
||||
// 存储到Redis,设置过期时间
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
redisUtil.set(redisKey, qrLoginData, QR_LOGIN_TOKEN_TTL, TimeUnit.SECONDS);
|
||||
|
||||
log.info("生成扫码登录token: {}", token);
|
||||
|
||||
// 构造二维码内容(这里可以是前端登录页面的URL + token参数)
|
||||
String qrCodeContent = "qr-login:" + token;
|
||||
|
||||
return new QrLoginGenerateResponse(token, qrCodeContent, QR_LOGIN_TOKEN_TTL);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QrLoginStatusResponse checkQrLoginStatus(String token) {
|
||||
if (StrUtil.isBlank(token)) {
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||
}
|
||||
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||
|
||||
if (qrLoginData == null) {
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||
// 删除过期的token
|
||||
redisUtil.delete(redisKey);
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_EXPIRED, null, null, 0L);
|
||||
}
|
||||
|
||||
// 计算剩余过期时间
|
||||
long expiresIn = ChronoUnit.SECONDS.between(LocalDateTime.now(), qrLoginData.getExpireTime());
|
||||
|
||||
QrLoginStatusResponse response = new QrLoginStatusResponse();
|
||||
response.setStatus(qrLoginData.getStatus());
|
||||
response.setExpiresIn(expiresIn);
|
||||
|
||||
// 如果已确认,返回token和用户信息
|
||||
if (QR_LOGIN_STATUS_CONFIRMED.equals(qrLoginData.getStatus())) {
|
||||
response.setAccessToken(qrLoginData.getAccessToken());
|
||||
|
||||
// 获取用户信息
|
||||
if (qrLoginData.getUserId() != null) {
|
||||
User user = userService.getByIdRel(qrLoginData.getUserId());
|
||||
if (user != null) {
|
||||
// 清除敏感信息
|
||||
user.setPassword(null);
|
||||
response.setUserInfo(user);
|
||||
}
|
||||
}
|
||||
|
||||
// 确认后删除token,防止重复使用
|
||||
redisUtil.delete(redisKey);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QrLoginStatusResponse confirmQrLogin(QrLoginConfirmRequest request) {
|
||||
String token = request.getToken();
|
||||
Integer userId = request.getUserId();
|
||||
String platform = request.getPlatform();
|
||||
|
||||
if (StrUtil.isBlank(token) || userId == null) {
|
||||
throw new RuntimeException("参数不能为空");
|
||||
}
|
||||
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||
|
||||
if (qrLoginData == null) {
|
||||
throw new RuntimeException("扫码登录token不存在或已过期");
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||
redisUtil.delete(redisKey);
|
||||
throw new RuntimeException("扫码登录token已过期");
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
User user = userService.getByIdRel(userId);
|
||||
if (user == null) {
|
||||
throw new RuntimeException("用户不存在");
|
||||
}
|
||||
|
||||
// 检查用户状态
|
||||
if (user.getStatus() != null && user.getStatus() != 0) {
|
||||
throw new RuntimeException("用户已被冻结");
|
||||
}
|
||||
|
||||
// 如果是微信小程序登录,处理微信相关信息
|
||||
if ("miniprogram".equals(platform) && request.getWechatInfo() != null) {
|
||||
handleWechatMiniProgramLogin(user, request.getWechatInfo());
|
||||
}
|
||||
|
||||
// 生成JWT token
|
||||
JwtSubject jwtSubject = new JwtSubject(user.getUsername(), user.getTenantId());
|
||||
String accessToken = JwtUtil.buildToken(jwtSubject, jwtExpire, jwtSecret);
|
||||
|
||||
// 更新扫码登录数据
|
||||
qrLoginData.setStatus(QR_LOGIN_STATUS_CONFIRMED);
|
||||
qrLoginData.setUserId(userId);
|
||||
qrLoginData.setUsername(user.getUsername());
|
||||
qrLoginData.setAccessToken(accessToken);
|
||||
|
||||
// 更新Redis中的数据
|
||||
redisUtil.set(redisKey, qrLoginData, 60L, TimeUnit.SECONDS); // 给前端60秒时间获取token
|
||||
|
||||
log.info("用户 {} 通过 {} 平台确认扫码登录,token: {}", user.getUsername(),
|
||||
platform != null ? platform : "unknown", token);
|
||||
|
||||
// 清除敏感信息
|
||||
user.setPassword(null);
|
||||
|
||||
return new QrLoginStatusResponse(QR_LOGIN_STATUS_CONFIRMED, accessToken, user, 60L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理微信小程序登录相关逻辑
|
||||
*/
|
||||
private void handleWechatMiniProgramLogin(User user, QrLoginConfirmRequest.WechatMiniProgramInfo wechatInfo) {
|
||||
// 更新用户的微信信息
|
||||
if (StrUtil.isNotBlank(wechatInfo.getOpenid())) {
|
||||
user.setOpenid(wechatInfo.getOpenid());
|
||||
}
|
||||
if (StrUtil.isNotBlank(wechatInfo.getUnionid())) {
|
||||
user.setUnionid(wechatInfo.getUnionid());
|
||||
}
|
||||
if (StrUtil.isNotBlank(wechatInfo.getNickname()) && StrUtil.isBlank(user.getNickname())) {
|
||||
user.setNickname(wechatInfo.getNickname());
|
||||
}
|
||||
if (StrUtil.isNotBlank(wechatInfo.getAvatar()) && StrUtil.isBlank(user.getAvatar())) {
|
||||
user.setAvatar(wechatInfo.getAvatar());
|
||||
}
|
||||
|
||||
// 更新用户信息到数据库
|
||||
try {
|
||||
userService.updateById(user);
|
||||
log.info("更新用户 {} 的微信小程序信息成功", user.getUsername());
|
||||
} catch (Exception e) {
|
||||
log.warn("更新用户 {} 的微信小程序信息失败: {}", user.getUsername(), e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean scanQrCode(String token) {
|
||||
if (StrUtil.isBlank(token)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String redisKey = QR_LOGIN_TOKEN_KEY + token;
|
||||
QrLoginData qrLoginData = redisUtil.get(redisKey, QrLoginData.class);
|
||||
|
||||
if (qrLoginData == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 检查是否过期
|
||||
if (LocalDateTime.now().isAfter(qrLoginData.getExpireTime())) {
|
||||
redisUtil.delete(redisKey);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 只有pending状态才能更新为scanned
|
||||
if (QR_LOGIN_STATUS_PENDING.equals(qrLoginData.getStatus())) {
|
||||
qrLoginData.setStatus(QR_LOGIN_STATUS_SCANNED);
|
||||
|
||||
// 计算剩余过期时间
|
||||
long remainingSeconds = ChronoUnit.SECONDS.between(LocalDateTime.now(), qrLoginData.getExpireTime());
|
||||
redisUtil.set(redisKey, qrLoginData, remainingSeconds, TimeUnit.SECONDS);
|
||||
|
||||
log.info("扫码登录token {} 状态更新为已扫码", token);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-报名记录管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-bm")
|
||||
public class BszxBmController extends BaseController {
|
||||
@Resource
|
||||
private BszxBmService bszxBmService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CmsArticleService cmsArticleService;
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||
@Operation(summary = "分页查询百色中学-报名记录")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxBm>> page(BszxBmParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBmService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||
@Operation(summary = "查询全部百色中学-报名记录")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxBm>> list(BszxBmParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBmService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
||||
@Operation(summary = "根据id查询百色中学-报名记录")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxBm> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxBmService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@OperationLog
|
||||
@Operation(summary = "申请报名生成邀请函")
|
||||
@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
|
||||
@Operation(summary = "修改报名信息")
|
||||
@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
|
||||
@Operation(summary = "删除报名记录")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxBmService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-报名记录")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxBm> list) {
|
||||
if (bszxBmService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-报名记录")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBm> batchParam) {
|
||||
if (batchParam.update(bszxBmService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-报名记录")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxBmService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询我的报名记录")
|
||||
@GetMapping("/myPage")
|
||||
public ApiResult<PageResult<BszxBm>> myPage(BszxBmParam param) {
|
||||
// 使用关联查询
|
||||
if (getLoginUser() != null) {
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(bszxBmService.pageRel(param));
|
||||
}
|
||||
return fail("请先登录",null);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取海报地址")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-分部管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-branch")
|
||||
public class BszxBranchController extends BaseController {
|
||||
@Resource
|
||||
private BszxBranchService bszxBranchService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-分部")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxBranch>> page(BszxBranchParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBranchService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-分部")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxBranch>> list(BszxBranchParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxBranchService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-分部")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxBranch> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxBranchService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-分部")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxBranch bszxBranch) {
|
||||
if (bszxBranchService.save(bszxBranch)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-分部")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxBranch bszxBranch) {
|
||||
if (bszxBranchService.updateById(bszxBranch)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-分部")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxBranchService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-分部")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxBranch> list) {
|
||||
if (bszxBranchService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-分部")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBranch> batchParam) {
|
||||
if (batchParam.update(bszxBranchService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-分部")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-班级管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-class")
|
||||
public class BszxClassController extends BaseController {
|
||||
@Resource
|
||||
private BszxClassService bszxClassService;
|
||||
@Resource
|
||||
private BszxGradeService bszxGradeService;
|
||||
@Resource
|
||||
private BszxBranchService bszxBranchService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-班级")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxClass>> page(BszxClassParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxClassService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-班级")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxClass>> list(BszxClassParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxClassService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-班级")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxClass> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxClassService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "百色中学-年级班级数据")
|
||||
@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
|
||||
@Operation(summary = "添加百色中学-班级")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxClass bszxClass) {
|
||||
if (bszxClassService.save(bszxClass)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-班级")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxClass bszxClass) {
|
||||
if (bszxClassService.updateById(bszxClass)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-班级")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxClassService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-班级")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxClass> list) {
|
||||
if (bszxClassService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-班级")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxClass> batchParam) {
|
||||
if (batchParam.update(bszxClassService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-班级")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-年代管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-era")
|
||||
public class BszxEraController extends BaseController {
|
||||
@Resource
|
||||
private BszxEraService bszxEraService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-年代")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxEra>> page(BszxEraParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxEraService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-年代")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxEra>> list(BszxEraParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxEraService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-年代")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxEra> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxEraService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-年代")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxEra bszxEra) {
|
||||
if (bszxEraService.save(bszxEra)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-年代")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxEra bszxEra) {
|
||||
if (bszxEraService.updateById(bszxEra)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-年代")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxEraService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-年代")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxEra> list) {
|
||||
if (bszxEraService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-年代")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxEra> batchParam) {
|
||||
if (batchParam.update(bszxEraService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-年代")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-年级管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-grade")
|
||||
public class BszxGradeController extends BaseController {
|
||||
@Resource
|
||||
private BszxGradeService bszxGradeService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-年级")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxGrade>> page(BszxGradeParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxGradeService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-年级")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxGrade>> list(BszxGradeParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxGradeService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询百色中学-年级")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxGrade> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxGradeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-年级")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxGrade bszxGrade) {
|
||||
if (bszxGradeService.save(bszxGrade)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-年级")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxGrade bszxGrade) {
|
||||
if (bszxGradeService.updateById(bszxGrade)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-年级")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxGradeService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-年级")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxGrade> list) {
|
||||
if (bszxGradeService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-年级")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxGrade> batchParam) {
|
||||
if (batchParam.update(bszxGradeService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-年级")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxGradeService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-订单管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/bszx/bszx-order")
|
||||
public class BszxOrderController extends BaseController {
|
||||
@Resource
|
||||
private BszxPayService bszxPayService;
|
||||
@Resource
|
||||
private BszxBmService bszxBmService;
|
||||
@Resource
|
||||
private ShopOrderService shopOrderService;
|
||||
|
||||
@Operation(summary = "分页查询百色中学-订单列表")
|
||||
@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);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "统计订单总金额")
|
||||
@GetMapping("/total")
|
||||
public ApiResult<BigDecimal> total() {
|
||||
try {
|
||||
BigDecimal totalAmount = bszxPayService.total();
|
||||
return success(totalAmount);
|
||||
} catch (Exception e) {
|
||||
// 异常时返回0,保持接口稳定性
|
||||
return success(BigDecimal.ZERO);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
package com.gxwebsoft.bszx.controller;
|
||||
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Tag(name = "百色中学-捐款记录管理")
|
||||
@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')")
|
||||
@Operation(summary = "分页查询百色中学-捐款记录")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxPay>> page(BszxPayParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||
@Operation(summary = "查询全部百色中学-捐款记录")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxPay>> list(BszxPayParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
||||
@Operation(summary = "根据id查询百色中学-捐款记录")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxPay> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@OperationLog
|
||||
@Operation(summary = "活动捐款")
|
||||
@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
|
||||
@Operation(summary = "修改百色中学-捐款记录")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxPay bszxPay) {
|
||||
if (bszxPayService.updateById(bszxPay)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-捐款记录")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxPayService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-捐款记录")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxPay> list) {
|
||||
if (bszxPayService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-捐款记录")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPay> batchParam) {
|
||||
if (batchParam.update(bszxPayService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-捐款记录")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxPayService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询我的报名记录")
|
||||
@GetMapping("/myPage")
|
||||
public ApiResult<PageResult<BszxPay>> myPage(BszxPayParam param) {
|
||||
// 使用关联查询
|
||||
if (getLoginUser() != null) {
|
||||
param.setUserId(getLoginUserId());
|
||||
return success(bszxPayService.pageRel(param));
|
||||
}
|
||||
return fail("请先登录", null);
|
||||
}
|
||||
|
||||
@Operation(summary = "统计捐款总金额与人次")
|
||||
@GetMapping("/getCount")
|
||||
public ApiResult<?> getCount() {
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
final BigDecimal bigDecimal = bszxPayService.sumMoney(wrapper);
|
||||
Long count = (long) bszxPayService.count(new LambdaQueryWrapper<BszxPay>());
|
||||
map.put("numbers", count);
|
||||
map.put("totalMoney", bigDecimal);
|
||||
return success(map);
|
||||
}
|
||||
|
||||
@Schema(description = "异步通知")
|
||||
@PostMapping("/notify/{tenantId}")
|
||||
public String wxNotify(@RequestHeader Map<String, String> header, @RequestBody String body,HttpServletRequest request, @PathVariable("tenantId") Integer tenantId) {
|
||||
// 获取支付配置信息用于解密 - 优先使用 Payment:1* 格式
|
||||
String key = "Payment:11"; // 微信支付类型为1,使用 Payment:11 格式
|
||||
Payment payment = redisUtil.get(key, Payment.class);
|
||||
|
||||
// 如果 Payment:1* 格式不存在,尝试原有格式
|
||||
if (payment == null) {
|
||||
String fallbackKey = "Payment:1:".concat(tenantId.toString());
|
||||
payment = redisUtil.get(fallbackKey, 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();
|
||||
// 生产环境使用容器证书路径 /www/wwwroot/file.ws
|
||||
privateKey = "/www/wwwroot/file.ws" + payment.getApiclientKey();
|
||||
apiclientCert = "/www/wwwroot/file.ws" + payment.getApiclientCert();
|
||||
pubKey = "/www/wwwroot/file.ws" + 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(LocalDateTime.now());
|
||||
order.setPayStatus(true);
|
||||
order.setTransactionId(transactionId);
|
||||
order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", total * 0.01)));
|
||||
order.setExpirationTime(LocalDateTime.now().plusYears(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')")
|
||||
@Operation(summary = "修复订单")
|
||||
@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("修复失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取捐款证书")
|
||||
@GetMapping("/generatePayCert/{id}")
|
||||
public ApiResult<?> generatePayCert(@PathVariable("id") Integer id) throws Exception {
|
||||
return success("获取捐款证书", bszxPayService.generatePayCert(id));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "百色中学-捐款排行管理")
|
||||
@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')")
|
||||
@Operation(summary = "分页查询百色中学-捐款排行")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<BszxPayRanking>> page(BszxPayRankingParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayRankingService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
||||
@Operation(summary = "查询全部百色中学-捐款排行")
|
||||
@GetMapping()
|
||||
public ApiResult<List<BszxPayRanking>> list(BszxPayRankingParam param) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayRankingService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部百色中学-捐款排行榜")
|
||||
@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((long) bszxPayService.count(wrapper));
|
||||
ranking.setTotalPrice(bszxPayService.sumMoney(wrapper));
|
||||
rankings.add(ranking);
|
||||
});
|
||||
// totalPrice按大到小排序
|
||||
rankings.sort((o1, o2) -> o2.getTotalPrice().compareTo(o1.getTotalPrice()));
|
||||
return success(rankings);
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询全部百色中学-千班万元")
|
||||
@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 -> {
|
||||
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')")
|
||||
@Operation(summary = "根据id查询百色中学-捐款排行")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<BszxPayRanking> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(bszxPayRankingService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加百色中学-捐款排行")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody BszxPayRanking bszxPayRanking) {
|
||||
if (bszxPayRankingService.save(bszxPayRanking)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改百色中学-捐款排行")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody BszxPayRanking bszxPayRanking) {
|
||||
if (bszxPayRankingService.updateById(bszxPayRanking)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除百色中学-捐款排行")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (bszxPayRankingService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加百色中学-捐款排行")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<BszxPayRanking> list) {
|
||||
if (bszxPayRankingService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改百色中学-捐款排行")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPayRanking> batchParam) {
|
||||
if (batchParam.update(bszxPayRankingService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除百色中学-捐款排行")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (bszxPayRankingService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
151
src/main/java/com/gxwebsoft/bszx/entity/BszxBm.java
Normal file
151
src/main/java/com/gxwebsoft/bszx/entity/BszxBm.java
Normal file
@@ -0,0 +1,151 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxBm对象", description = "百色中学-报名记录")
|
||||
public class BszxBm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型 0校友 1单位 2爱心人士")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
private String sex;
|
||||
|
||||
@Schema(description = "性别名称")
|
||||
@TableField(exist = false)
|
||||
private String sexName;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "班级ID")
|
||||
private Integer classId;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "分部ID")
|
||||
private Integer branchId;
|
||||
|
||||
@Schema(description = "分部名称")
|
||||
@TableField(exist = false)
|
||||
private String branchName;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "是否能到场")
|
||||
private String present;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "人数")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "生成的邀请函存放路径")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private LocalDate dateTime;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "活动名称")
|
||||
@TableField(exist = false)
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "文章对象")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-分部
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxBranch对象", description = "百色中学-分部")
|
||||
public class BszxBranch implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "分部名称 ")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-班级
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxClass对象", description = "百色中学-班级")
|
||||
public class BszxClass implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "时代ID")
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "时代名称")
|
||||
@TableField(exist = false)
|
||||
private String eraName;
|
||||
|
||||
@Schema(description = "年级ID")
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "年级名称")
|
||||
@TableField(exist = false)
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "累计捐款金额")
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "分部")
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "分部名称")
|
||||
@TableField(exist = false)
|
||||
private String branchName;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年代
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxEra对象", description = "百色中学-年代")
|
||||
public class BszxEra implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年代")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@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.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年级
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxGrade对象", description = "百色中学-年级")
|
||||
public class BszxGrade implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "年代")
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "分部")
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "子分类")
|
||||
@TableField(exist = false)
|
||||
private List<BszxClass> children;
|
||||
|
||||
}
|
||||
143
src/main/java/com/gxwebsoft/bszx/entity/BszxPay.java
Normal file
143
src/main/java/com/gxwebsoft/bszx/entity/BszxPay.java
Normal file
@@ -0,0 +1,143 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxPay对象", description = "百色中学-捐款记录")
|
||||
public class BszxPay implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
private String sex;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
@TableField(exist = false)
|
||||
private String mobile;
|
||||
|
||||
@Schema(description = "分部")
|
||||
private String branchName;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "付费金额")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private LocalDate dateTime;
|
||||
|
||||
@Schema(description = "捐赠证书")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "来源表ID")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "活动名称")
|
||||
@TableField(exist = false)
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "文章")
|
||||
@TableField(exist = false)
|
||||
private CmsArticle article;
|
||||
|
||||
@Schema(description = "订单")
|
||||
@TableField(exist = false)
|
||||
private ShopOrder shopOrder;
|
||||
|
||||
public String getSexName() {
|
||||
return this.sex.equals("1") ? "男" : "女";
|
||||
}
|
||||
|
||||
}
|
||||
67
src/main/java/com/gxwebsoft/bszx/entity/BszxPayRanking.java
Normal file
67
src/main/java/com/gxwebsoft/bszx/entity/BszxPayRanking.java
Normal file
@@ -0,0 +1,67 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "BszxPayRanking对象", description = "百色中学-捐款排行")
|
||||
public class BszxPayRanking implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "来源表ID(文章ID)")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "项目名称")
|
||||
@TableField(exist = false)
|
||||
private String formName;
|
||||
|
||||
@Schema(description = "数量")
|
||||
private Long number;
|
||||
|
||||
@Schema(description = "获得捐款总金额")
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime 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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-报名记录查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxBmParam对象", description = "百色中学-报名记录查询参数")
|
||||
public class BszxBmParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "类型 0校友 1单位")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "分部ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer branchId;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "是否能到场")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Boolean present;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "人数")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "生成的邀请函存放路径")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private String dateTime;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-分部查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-17 17:18:22
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxBranchParam对象", description = "百色中学-分部查询参数")
|
||||
public class BszxBranchParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "分部名称 ")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-班级查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxClassParam对象", description = "百色中学-班级查询参数")
|
||||
public class BszxClassParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "时代ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "年级ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer gradeId;
|
||||
|
||||
@Schema(description = "年级")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "累计捐款金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal totalMoney;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "分部")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年代查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxEraParam对象", description = "百色中学-年代查询参数")
|
||||
public class BszxEraParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年代")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-年级查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxGradeParam对象", description = "百色中学-年级查询参数")
|
||||
public class BszxGradeParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "年代")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer eraId;
|
||||
|
||||
@Schema(description = "分部")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer branch;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款记录查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-06 22:50:25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxPayParam对象", description = "百色中学-捐款记录查询参数")
|
||||
public class BszxPayParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "年龄")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer age;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "性别 1男 2女")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sex;
|
||||
|
||||
@Schema(description = "手机号码")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "班级")
|
||||
private String className;
|
||||
|
||||
@Schema(description = "年级")
|
||||
private String gradeName;
|
||||
|
||||
@Schema(description = "居住地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@Schema(description = "职务")
|
||||
private String position;
|
||||
|
||||
@Schema(description = "数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "付费金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "额外信息")
|
||||
private String extra;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private String orderNo;
|
||||
|
||||
@Schema(description = "订单编号")
|
||||
@QueryField(type = QueryType.IN)
|
||||
private Set<String> orderNos;
|
||||
|
||||
@Schema(description = "预定日期")
|
||||
private String dateTime;
|
||||
|
||||
@Schema(description = "捐赠证书")
|
||||
private String certificate;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "来源表ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "登录用户")
|
||||
@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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 百色中学-捐款排行查询参数
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-03-25 08:54:09
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
@Schema(name = "BszxPayRankingParam对象", description = "百色中学-捐款排行查询参数")
|
||||
public class BszxPayRankingParam extends BaseParam {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "来源表ID(项目名称)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "数量")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer number;
|
||||
|
||||
@Schema(description = "获得捐款总金额")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private BigDecimal totalPrice;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
@QueryField(type = QueryType.EQ)
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 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);
|
||||
|
||||
}
|
||||
57
src/main/java/com/gxwebsoft/bszx/service/BszxPayService.java
Normal file
57
src/main/java/com/gxwebsoft/bszx/service/BszxPayService.java
Normal file
@@ -0,0 +1,57 @@
|
||||
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 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);
|
||||
|
||||
/**
|
||||
* 统计捐款总金额
|
||||
*
|
||||
* @return 捐款总金额
|
||||
*/
|
||||
BigDecimal total();
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
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.context.annotation.Lazy;
|
||||
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.time.LocalDateTime;
|
||||
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
|
||||
@Lazy
|
||||
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);
|
||||
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,169 @@
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BigDecimal total() {
|
||||
try {
|
||||
// 使用数据库聚合查询统计捐款总金额,性能更高
|
||||
LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
||||
BigDecimal total = baseMapper.selectSumMoney(wrapper);
|
||||
|
||||
if (total == null) {
|
||||
total = BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
return total;
|
||||
|
||||
} catch (Exception e) {
|
||||
// 异常时返回0,确保接口稳定性
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
}
|
||||
}
|
||||
119
src/main/java/com/gxwebsoft/cms/controller/CmsAdController.java
Normal file
119
src/main/java/com/gxwebsoft/cms/controller/CmsAdController.java
Normal file
@@ -0,0 +1,119 @@
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 广告位控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Tag(name = "广告位管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-ad")
|
||||
public class CmsAdController extends BaseController {
|
||||
@Resource
|
||||
private CmsAdService cmsAdService;
|
||||
|
||||
@Operation(summary = "分页查询广告位")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsAd>> page(CmsAdParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsAdService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部广告位")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsAd>> list(CmsAdParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsAdService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询广告位")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsAd> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
final CmsAd ad = cmsAdService.getByIdRel(id);
|
||||
return success(ad);
|
||||
}
|
||||
|
||||
@Operation(summary = "根据code查询广告位")
|
||||
@GetMapping("/getByCode/{code}")
|
||||
public ApiResult<CmsAd> getByCode(@PathVariable("code") String code) {
|
||||
final CmsAd ad = cmsAdService.getByIdCode(code);
|
||||
return success(ad);
|
||||
}
|
||||
|
||||
@Operation(summary = "添加广告位")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改广告位")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsAd cmsAd) {
|
||||
if (cmsAdService.updateById(cmsAd)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除广告位")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsAdService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加广告位")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsAd> list) {
|
||||
if (cmsAdService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改广告位")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAd> batchParam) {
|
||||
if (batchParam.update(cmsAdService, "ad_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除广告位")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "广告图片管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-ad-record")
|
||||
public class CmsAdRecordController extends BaseController {
|
||||
@Resource
|
||||
private CmsAdRecordService cmsAdRecordService;
|
||||
|
||||
@Operation(summary = "分页查询广告图片")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsAdRecord>> page(CmsAdRecordParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsAdRecordService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部广告图片")
|
||||
@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
|
||||
@Operation(summary = "根据id查询广告图片")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsAdRecord> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsAdRecordService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsAdRecordService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加广告图片")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsAdRecord cmsAdRecord) {
|
||||
if (cmsAdRecordService.save(cmsAdRecord)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改广告图片")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsAdRecord cmsAdRecord) {
|
||||
if (cmsAdRecordService.updateById(cmsAdRecord)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除广告图片")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsAdRecordService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加广告图片")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsAdRecord> list) {
|
||||
if (cmsAdRecordService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改广告图片")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsAdRecord> batchParam) {
|
||||
if (batchParam.update(cmsAdRecordService, "ad_record_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除广告图片")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 文章分类表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Tag(name = "文章分类表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-article-category")
|
||||
public class CmsArticleCategoryController extends BaseController {
|
||||
@Resource
|
||||
private CmsArticleCategoryService cmsArticleCategoryService;
|
||||
|
||||
@Operation(summary = "分页查询文章分类表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsArticleCategory>> page(CmsArticleCategoryParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleCategoryService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部文章分类表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsArticleCategory>> list(CmsArticleCategoryParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleCategoryService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询文章分类表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsArticleCategory> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleCategoryService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加文章分类表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改文章分类表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsArticleCategory cmsArticleCategory) {
|
||||
if (cmsArticleCategoryService.updateById(cmsArticleCategory)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除文章分类表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsArticleCategoryService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加文章分类表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCategory> list) {
|
||||
if (cmsArticleCategoryService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改文章分类表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCategory> batchParam) {
|
||||
if (batchParam.update(cmsArticleCategoryService, "category_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除文章分类表")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "文章评论表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-article-comment")
|
||||
public class CmsArticleCommentController extends BaseController {
|
||||
@Resource
|
||||
private CmsArticleCommentService cmsArticleCommentService;
|
||||
|
||||
@Operation(summary = "分页查询文章评论表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsArticleComment>> page(CmsArticleCommentParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleCommentService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部文章评论表")
|
||||
@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
|
||||
@Operation(summary = "根据id查询文章评论表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsArticleComment> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsArticleCommentService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsArticleCommentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加文章评论表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改文章评论表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsArticleComment cmsArticleComment) {
|
||||
if (cmsArticleCommentService.updateById(cmsArticleComment)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除文章评论表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsArticleCommentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加文章评论表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleComment> list) {
|
||||
if (cmsArticleCommentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改文章评论表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleComment> batchParam) {
|
||||
if (batchParam.update(cmsArticleCommentService, "comment_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除文章评论表")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "文章记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-article-content")
|
||||
public class CmsArticleContentController extends BaseController {
|
||||
@Resource
|
||||
private CmsArticleContentService cmsArticleContentService;
|
||||
|
||||
@Operation(summary = "分页查询文章记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsArticleContent>> page(CmsArticleContentParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleContentService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部文章记录表")
|
||||
@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
|
||||
@Operation(summary = "根据id查询文章记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsArticleContent> get(@PathVariable("id") Integer id) {
|
||||
// return success(cmsArticleContentService.getById(id));
|
||||
// 使用关联查询
|
||||
return success(cmsArticleContentService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加文章记录表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsArticleContent cmsArticleContent) {
|
||||
if (cmsArticleContentService.save(cmsArticleContent)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改文章记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsArticleContent cmsArticleContent) {
|
||||
if (cmsArticleContentService.updateById(cmsArticleContent)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除文章记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsArticleContentService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加文章记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleContent> list) {
|
||||
if (cmsArticleContentService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改文章记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleContent> batchParam) {
|
||||
if (batchParam.update(cmsArticleContentService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除文章记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsArticleContentService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,362 @@
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
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
|
||||
@Tag(name = "文章管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-article")
|
||||
public class CmsArticleController extends BaseController {
|
||||
@Resource
|
||||
private CmsArticleService cmsArticleService;
|
||||
@Resource
|
||||
private CmsArticleContentService articleContentService;
|
||||
@Resource
|
||||
@Lazy
|
||||
private CmsNavigationService cmsNavigationService;
|
||||
@Resource
|
||||
private CmsModelService cmsModelService;
|
||||
@Resource
|
||||
private UserService userService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
private static final long CACHE_MINUTES = 30L;
|
||||
|
||||
@Operation(summary = "分页查询文章")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsArticle>> page(CmsArticleParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部文章")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsArticle>> list(CmsArticleParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据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')")
|
||||
@Operation(summary = "添加文章")
|
||||
@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')")
|
||||
@Operation(summary = "修改文章")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsArticle article) {
|
||||
if (cmsArticleService.updateByIdRel(article)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsArticle:remove')")
|
||||
@Operation(summary = "删除文章")
|
||||
@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')")
|
||||
@Operation(summary = "批量添加文章")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticle> list) {
|
||||
if (cmsArticleService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsArticle:update')")
|
||||
@Operation(summary = "批量修改文章")
|
||||
@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')")
|
||||
@Operation(summary = "批量删除文章")
|
||||
@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("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "读取上一篇")
|
||||
@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);
|
||||
}
|
||||
|
||||
@Operation(summary = "读取下一篇")
|
||||
@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);
|
||||
}
|
||||
|
||||
@Operation(summary = "统计信息")
|
||||
@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());
|
||||
}
|
||||
|
||||
long totalNum = cmsArticleService.count(
|
||||
wrapper.eq(CmsArticle::getDeleted, 0).eq(CmsArticle::getStatus, 0)
|
||||
);
|
||||
data.put("totalNum", Math.toIntExact(totalNum));
|
||||
|
||||
long totalNum2 = cmsArticleService.count(
|
||||
wrapper.eq(CmsArticle::getStatus, 1)
|
||||
);
|
||||
data.put("totalNum2", Math.toIntExact(totalNum2));
|
||||
|
||||
long totalNum3 = cmsArticleService.count(
|
||||
wrapper.gt(CmsArticle::getStatus, 1)
|
||||
);
|
||||
data.put("totalNum3", Math.toIntExact(totalNum3));
|
||||
|
||||
return success(data);
|
||||
}
|
||||
|
||||
@Operation(summary = "密码校验")
|
||||
@GetMapping("/checkArticlePassword")
|
||||
public ApiResult<?> checkArticlePassword(CmsArticle param) {
|
||||
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
||||
return fail("密码不正确");
|
||||
}
|
||||
return success("密码正确");
|
||||
}
|
||||
|
||||
/**
|
||||
* excel批量导入文章
|
||||
*/
|
||||
@PreAuthorize("hasAuthority('cms:cmsArticle:save')")
|
||||
@Operation(summary = "批量导入文章")
|
||||
@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);
|
||||
}
|
||||
|
||||
@Operation(summary = "按标签分页查询")
|
||||
@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);
|
||||
}
|
||||
|
||||
@Operation(summary = "按标签分页查询")
|
||||
@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);
|
||||
}
|
||||
|
||||
@Operation(summary = "按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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "点赞文章管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-article-count")
|
||||
public class CmsArticleCountController extends BaseController {
|
||||
@Resource
|
||||
private CmsArticleCountService cmsArticleCountService;
|
||||
|
||||
@Operation(summary = "分页查询点赞文章")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsArticleCount>> page(CmsArticleCountParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleCountService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部点赞文章")
|
||||
@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
|
||||
@Operation(summary = "根据id查询点赞文章")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsArticleCount> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsArticleCountService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsArticleCountService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加点赞文章")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改点赞文章")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsArticleCount cmsArticleCount) {
|
||||
if (cmsArticleCountService.updateById(cmsArticleCount)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除点赞文章")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsArticleCountService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加点赞文章")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleCount> list) {
|
||||
if (cmsArticleCountService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改点赞文章")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleCount> batchParam) {
|
||||
if (batchParam.update(cmsArticleCountService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除点赞文章")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "点赞文章管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-article-like")
|
||||
public class CmsArticleLikeController extends BaseController {
|
||||
@Resource
|
||||
private CmsArticleLikeService cmsArticleLikeService;
|
||||
|
||||
@Operation(summary = "分页查询点赞文章")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsArticleLike>> page(CmsArticleLikeParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsArticleLikeService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部点赞文章")
|
||||
@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
|
||||
@Operation(summary = "根据id查询点赞文章")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsArticleLike> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsArticleLikeService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsArticleLikeService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加点赞文章")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改点赞文章")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsArticleLike cmsArticleLike) {
|
||||
if (cmsArticleLikeService.updateById(cmsArticleLike)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除点赞文章")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsArticleLikeService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加点赞文章")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsArticleLike> list) {
|
||||
if (cmsArticleLikeService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改点赞文章")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsArticleLike> batchParam) {
|
||||
if (batchParam.update(cmsArticleLikeService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除点赞文章")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsArticleLikeService.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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "页面管理记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-design")
|
||||
public class CmsDesignController extends BaseController {
|
||||
@Resource
|
||||
private CmsDesignService cmsDesignService;
|
||||
@Resource
|
||||
private CmsNavigationService cmsNavigationService;
|
||||
|
||||
@Operation(summary = "分页查询页面管理记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsDesign>> page(CmsDesignParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsDesignService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部页面管理记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsDesign>> list(CmsDesignParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsDesignService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询页面管理记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsDesign> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsDesignService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加页面管理记录表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改页面管理记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsDesign cmsDesign) {
|
||||
if (cmsDesignService.updateById(cmsDesign)) {
|
||||
// 同步翻译英文版
|
||||
cmsDesignService.translate(cmsDesign);
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除页面管理记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsDesignService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加页面管理记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsDesign> list) {
|
||||
if (cmsDesignService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改页面管理记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesign> batchParam) {
|
||||
if (batchParam.update(cmsDesignService, "page_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除页面管理记录表")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "页面组件表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-design-record")
|
||||
public class CmsDesignRecordController extends BaseController {
|
||||
@Resource
|
||||
private CmsDesignRecordService cmsDesignRecordService;
|
||||
|
||||
@Operation(summary = "分页查询页面组件表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsDesignRecord>> page(CmsDesignRecordParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsDesignRecordService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部页面组件表")
|
||||
@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
|
||||
@Operation(summary = "根据id查询页面组件表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsDesignRecord> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsDesignRecordService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsDesignRecordService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加页面组件表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改页面组件表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsDesignRecord cmsDesignRecord) {
|
||||
if (cmsDesignRecordService.updateById(cmsDesignRecord)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除页面组件表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsDesignRecordService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加页面组件表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsDesignRecord> list) {
|
||||
if (cmsDesignRecordService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改页面组件表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDesignRecord> batchParam) {
|
||||
if (batchParam.update(cmsDesignRecordService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除页面组件表")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "网站域名记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-domain")
|
||||
public class CmsDomainController extends BaseController {
|
||||
@Resource
|
||||
private CmsDomainService cmsDomainService;
|
||||
@Resource
|
||||
private CmsDomainMapper cmsDomainMapper;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Operation(summary = "分页查询网站域名记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsDomain>> page(CmsDomainParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsDomainService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部网站域名记录表")
|
||||
@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
|
||||
@Operation(summary = "根据id查询网站域名记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsDomain> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsDomainService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsDomainService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加网站域名记录表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改网站域名记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsDomain cmsDomain) {
|
||||
if (cmsDomainService.updateById(cmsDomain)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除网站域名记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsDomainService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加网站域名记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsDomain> list) {
|
||||
if (cmsDomainService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改网站域名记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsDomain> batchParam) {
|
||||
if (batchParam.update(cmsDomainService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除网站域名记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsDomainService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "查询授权域名信息")
|
||||
@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);
|
||||
}
|
||||
|
||||
@Operation(summary = "授权二级域名")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "表单设计表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-form")
|
||||
public class CmsFormController extends BaseController {
|
||||
@Resource
|
||||
private CmsFormService cmsFormService;
|
||||
|
||||
@Operation(summary = "分页查询表单设计表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsForm>> page(CmsFormParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsFormService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部表单设计表")
|
||||
@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
|
||||
@Operation(summary = "根据id查询表单设计表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsForm> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsFormService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsFormService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加表单设计表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改表单设计表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsForm cmsForm) {
|
||||
if (cmsFormService.updateById(cmsForm)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除表单设计表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsFormService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加表单设计表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsForm> list) {
|
||||
if (cmsFormService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改表单设计表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsForm> batchParam) {
|
||||
if (batchParam.update(cmsFormService, "form_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除表单设计表")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "表单数据记录表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-form-record")
|
||||
public class CmsFormRecordController extends BaseController {
|
||||
@Resource
|
||||
private CmsFormRecordService cmsFormRecordService;
|
||||
|
||||
@Operation(summary = "分页查询表单数据记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsFormRecord>> page(CmsFormRecordParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsFormRecordService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部表单数据记录表")
|
||||
@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
|
||||
@Operation(summary = "根据id查询表单数据记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsFormRecord> get(@PathVariable("id") Integer id) {
|
||||
return success(cmsFormRecordService.getById(id));
|
||||
// 使用关联查询
|
||||
//return success(cmsFormRecordService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加表单数据记录表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改表单数据记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsFormRecord cmsFormRecord) {
|
||||
if (cmsFormRecordService.updateById(cmsFormRecord)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除表单数据记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsFormRecordService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加表单数据记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsFormRecord> list) {
|
||||
if (cmsFormRecordService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改表单数据记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsFormRecord> batchParam) {
|
||||
if (batchParam.update(cmsFormRecordService, "form_record_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除表单数据记录表")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "国际化管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-lang")
|
||||
public class CmsLangController extends BaseController {
|
||||
@Resource
|
||||
private CmsLangService cmsLangService;
|
||||
|
||||
@Operation(summary = "分页查询国际化")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsLang>> page(CmsLangParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsLangService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部国际化")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsLang>> list(CmsLangParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsLangService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:list')")
|
||||
@Operation(summary = "根据id查询国际化")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsLang> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsLangService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
||||
@Operation(summary = "添加国际化")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsLang cmsLang) {
|
||||
if (cmsLangService.save(cmsLang)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
||||
@Operation(summary = "修改国际化")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsLang cmsLang) {
|
||||
if (cmsLangService.updateById(cmsLang)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:remove')")
|
||||
@Operation(summary = "删除国际化")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsLangService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:save')")
|
||||
@Operation(summary = "批量添加国际化")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsLang> list) {
|
||||
if (cmsLangService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:update')")
|
||||
@Operation(summary = "批量修改国际化")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLang> batchParam) {
|
||||
if (batchParam.update(cmsLangService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLang:reomve')")
|
||||
@Operation(summary = "批量删除国际化")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "国际化记录启用管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-lang-log")
|
||||
public class CmsLangLogController extends BaseController {
|
||||
@Resource
|
||||
private CmsLangLogService cmsLangLogService;
|
||||
|
||||
@Operation(summary = "分页查询国际化记录启用")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsLangLog>> page(CmsLangLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsLangLogService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部国际化记录启用")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsLangLog>> list(CmsLangLogParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsLangLogService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:list')")
|
||||
@Operation(summary = "根据id查询国际化记录启用")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsLangLog> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsLangLogService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
||||
@Operation(summary = "添加国际化记录启用")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsLangLog cmsLangLog) {
|
||||
if (cmsLangLogService.save(cmsLangLog)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
||||
@Operation(summary = "修改国际化记录启用")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsLangLog cmsLangLog) {
|
||||
if (cmsLangLogService.updateById(cmsLangLog)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
||||
@Operation(summary = "删除国际化记录启用")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsLangLogService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:save')")
|
||||
@Operation(summary = "批量添加国际化记录启用")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsLangLog> list) {
|
||||
if (cmsLangLogService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:update')")
|
||||
@Operation(summary = "批量修改国际化记录启用")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLangLog> batchParam) {
|
||||
if (batchParam.update(cmsLangLogService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLangLog:remove')")
|
||||
@Operation(summary = "批量删除国际化记录启用")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "常用链接管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-link")
|
||||
public class CmsLinkController extends BaseController {
|
||||
@Resource
|
||||
private CmsLinkService cmsLinkService;
|
||||
|
||||
@Operation(summary = "分页查询常用链接")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsLink>> page(CmsLinkParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsLinkService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部常用链接")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsLink>> list(CmsLinkParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsLinkService.listRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsLink:list')")
|
||||
@OperationLog
|
||||
@Operation(summary = "根据id查询常用链接")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsLink> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsLinkService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加常用链接")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改常用链接")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsLink cmsLink) {
|
||||
if (cmsLinkService.updateById(cmsLink)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除常用链接")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsLinkService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加常用链接")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsLink> list) {
|
||||
if (cmsLinkService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改常用链接")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsLink> batchParam) {
|
||||
if (batchParam.update(cmsLinkService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除常用链接")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsLinkService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.gxwebsoft.cms.controller;
|
||||
|
||||
import com.gxwebsoft.cms.service.CmsWebsiteService;
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 网站应用主入口
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:36:14
|
||||
*/
|
||||
@Slf4j
|
||||
@Tag(name = "网站应用")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms")
|
||||
public class CmsMainController extends BaseController {
|
||||
@Resource
|
||||
private CmsWebsiteService cmsWebsiteService;
|
||||
|
||||
}
|
||||
@@ -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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "模型管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-model")
|
||||
public class CmsModelController extends BaseController {
|
||||
@Resource
|
||||
private CmsModelService cmsModelService;
|
||||
|
||||
@Operation(summary = "分页查询模型")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsModel>> page(CmsModelParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsModelService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部模型")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsModel>> list(CmsModelParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsModelService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询模型")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsModel> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsModelService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
||||
@Operation(summary = "添加模型")
|
||||
@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')")
|
||||
@Operation(summary = "修改模型")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsModel cmsModel) {
|
||||
if (cmsModelService.updateById(cmsModel)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsModel:remove')")
|
||||
@Operation(summary = "删除模型")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsModelService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsModel:save')")
|
||||
@Operation(summary = "批量添加模型")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsModel> list) {
|
||||
if (cmsModelService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsModel:update')")
|
||||
@Operation(summary = "批量修改模型")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsModel> batchParam) {
|
||||
if (batchParam.update(cmsModelService, "model_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsModel:remvoe')")
|
||||
@Operation(summary = "批量删除模型")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsModelService.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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 网站导航记录表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Tag(name = "网站导航记录表管理")
|
||||
@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:";
|
||||
|
||||
@Operation(summary = "分页查询网站导航记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsNavigation>> page(CmsNavigationParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsNavigationService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部网站导航记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsNavigation>> list(CmsNavigationParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsNavigationService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询网站导航记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsNavigation> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsNavigationService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加网站导航记录表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改网站导航记录表")
|
||||
@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("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除网站导航记录表")
|
||||
@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("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加网站导航记录表")
|
||||
@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("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改网站导航记录表")
|
||||
@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("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除网站导航记录表")
|
||||
@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("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取树形结构的网站导航数据")
|
||||
@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));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据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);
|
||||
}
|
||||
|
||||
@Operation(summary = "密码校验")
|
||||
@GetMapping("/checkNavigationPassword")
|
||||
public ApiResult<?> checkNavigationPassword(CmsNavigationParam param) {
|
||||
if (!userService.comparePassword(param.getPassword(), param.getPassword2())) {
|
||||
return fail("密码不正确");
|
||||
}
|
||||
return success("密码正确");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.gxwebsoft.cms.controller;
|
||||
|
||||
import com.gxwebsoft.common.core.web.BaseController;
|
||||
import com.gxwebsoft.cms.service.CmsStatisticsService;
|
||||
import com.gxwebsoft.cms.entity.CmsStatistics;
|
||||
import com.gxwebsoft.cms.param.CmsStatisticsParam;
|
||||
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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 站点统计信息表控制器
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-07-25 12:32:06
|
||||
*/
|
||||
@Tag(name = "站点统计信息表管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-statistics")
|
||||
public class CmsStatisticsController extends BaseController {
|
||||
@Resource
|
||||
private CmsStatisticsService cmsStatisticsService;
|
||||
|
||||
@Operation(summary = "分页查询站点统计信息表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsStatistics>> page(CmsStatisticsParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsStatisticsService.pageRel(param));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:list')")
|
||||
@Operation(summary = "查询全部站点统计信息表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsStatistics>> list(CmsStatisticsParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsStatisticsService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询站点统计信息表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsStatistics> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsStatisticsService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "添加站点统计信息表")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsStatistics cmsStatistics) {
|
||||
// 记录当前登录用户id
|
||||
User loginUser = getLoginUser();
|
||||
if (loginUser != null) {
|
||||
cmsStatistics.setUserId(loginUser.getUserId());
|
||||
}
|
||||
if (cmsStatisticsService.save(cmsStatistics)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "修改站点统计信息表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsStatistics cmsStatistics) {
|
||||
if (cmsStatisticsService.updateById(cmsStatistics)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "删除站点统计信息表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsStatisticsService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:save')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量添加站点统计信息表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsStatistics> list) {
|
||||
if (cmsStatisticsService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:update')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量修改站点统计信息表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsStatistics> batchParam) {
|
||||
if (batchParam.update(cmsStatisticsService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsStatistics:remove')")
|
||||
@OperationLog
|
||||
@Operation(summary = "批量删除站点统计信息表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsStatisticsService.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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "网站模版管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-template")
|
||||
public class CmsTemplateController extends BaseController {
|
||||
@Resource
|
||||
private CmsTemplateService cmsTemplateService;
|
||||
|
||||
@Operation(summary = "分页查询网站模版")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsTemplate>> page(CmsTemplateParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsTemplateService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部网站模版")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsTemplate>> list(CmsTemplateParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsTemplateService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询网站模版")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsTemplate> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsTemplateService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
||||
@Operation(summary = "添加网站模版")
|
||||
@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')")
|
||||
@Operation(summary = "修改网站模版")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsTemplate cmsTemplate) {
|
||||
if (cmsTemplateService.updateById(cmsTemplate)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
||||
@Operation(summary = "删除网站模版")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsTemplateService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:save')")
|
||||
@Operation(summary = "批量添加网站模版")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsTemplate> list) {
|
||||
if (cmsTemplateService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:update')")
|
||||
@Operation(summary = "批量修改网站模版")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsTemplate> batchParam) {
|
||||
if (batchParam.update(cmsTemplateService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsTemplate:remove')")
|
||||
@Operation(summary = "批量删除网站模版")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsTemplateService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,526 @@
|
||||
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.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.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
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
|
||||
@Tag(name = "网站信息记录表管理")
|
||||
@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";
|
||||
|
||||
@Operation(summary = "分页查询网站信息记录表")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsWebsite>> page(CmsWebsiteParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部网站信息记录表")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsWebsite>> list(CmsWebsiteParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "分页查询网站信息记录表")
|
||||
@GetMapping("/pageAll")
|
||||
public ApiResult<PageResult<CmsWebsite>> pageAll(CmsWebsiteParam param) {
|
||||
return success(cmsWebsiteService.pageRelAll(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询网站信息记录表")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsWebsite> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询网站信息记录表")
|
||||
@GetMapping("/getAll/{id}")
|
||||
public ApiResult<CmsWebsite> getAll(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteService.getByIdRelAll(id));
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||
@Operation(summary = "添加网站信息记录表")
|
||||
@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')")
|
||||
@Operation(summary = "修改网站信息记录表")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsWebsite cmsWebsite) {
|
||||
if (cmsWebsiteService.updateById(cmsWebsite)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||
@Operation(summary = "修改网站信息记录表")
|
||||
@PutMapping("/updateAll")
|
||||
public ApiResult<?> updateAll(@RequestBody CmsWebsite cmsWebsite) {
|
||||
if (cmsWebsiteService.updateByIdAll(cmsWebsite)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||
@Operation(summary = "删除网站信息记录表")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsWebsiteService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||
@Operation(summary = "删除网站信息记录表")
|
||||
@DeleteMapping("/removeAll/{id}")
|
||||
public ApiResult<?> removeAll(@PathVariable("id") Integer id) {
|
||||
if (cmsWebsiteService.removeByIdAll(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:save')")
|
||||
@Operation(summary = "批量添加网站信息记录表")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsite> list) {
|
||||
if (cmsWebsiteService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||
@Operation(summary = "批量修改网站信息记录表")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsite> batchParam) {
|
||||
if (batchParam.update(cmsWebsiteService, "website_id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:remove')")
|
||||
@Operation(summary = "批量删除网站信息记录表")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsWebsiteService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "网站基本信息")
|
||||
@GetMapping("/getSiteInfo")
|
||||
public ApiResult<CmsWebsite> getSiteInfo() {
|
||||
try {
|
||||
Integer tenantId = getTenantId();
|
||||
if (ObjectUtil.isEmpty(tenantId)) {
|
||||
return fail("租户ID不能为空", null);
|
||||
}
|
||||
|
||||
String key = SITE_INFO_KEY_PREFIX + tenantId;
|
||||
|
||||
// 尝试从缓存获取
|
||||
try {
|
||||
final String siteInfo = redisUtil.get(key);
|
||||
if (StrUtil.isNotBlank(siteInfo)) {
|
||||
log.info("从缓存获取网站信息: = {}", key);
|
||||
// 可以启用缓存返回,但先注释掉确保数据最新
|
||||
// return success(JSONUtil.parseObject(siteInfo, CmsWebsite.class));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取缓存失败: {}", e.getMessage());
|
||||
}
|
||||
|
||||
// 获取站点信息
|
||||
CmsWebsite website = null;
|
||||
try {
|
||||
website = cmsWebsiteService.getOne(new LambdaQueryWrapper<CmsWebsite>()
|
||||
.eq(CmsWebsite::getTenantId, tenantId)
|
||||
.eq(CmsWebsite::getDeleted, 0)
|
||||
.last("limit 1"));
|
||||
} catch (Exception e) {
|
||||
log.error("查询站点信息失败: {}", e.getMessage(), e);
|
||||
return fail("查询站点信息失败", null);
|
||||
}
|
||||
|
||||
// 创建默认站点
|
||||
if (ObjectUtil.isEmpty(website)) {
|
||||
return success("请先创建站点...", null);
|
||||
}
|
||||
|
||||
// 安全地构建网站信息
|
||||
try {
|
||||
buildSafeWebsiteInfo(website);
|
||||
} catch (Exception e) {
|
||||
log.error("构建网站信息失败: {}", e.getMessage(), e);
|
||||
return fail("构建网站信息失败", null);
|
||||
}
|
||||
|
||||
// 缓存结果
|
||||
try {
|
||||
redisUtil.set(key, website, 1L, TimeUnit.DAYS);
|
||||
} catch (Exception e) {
|
||||
log.warn("缓存网站信息失败: {}", e.getMessage());
|
||||
}
|
||||
|
||||
return success(website);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("获取网站信息异常: {}", e.getMessage(), e);
|
||||
return fail("获取网站信息失败: " + e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 安全地构建网站信息
|
||||
*/
|
||||
private void buildSafeWebsiteInfo(CmsWebsite website) {
|
||||
if (website == null) {
|
||||
throw new IllegalArgumentException("网站对象不能为空");
|
||||
}
|
||||
|
||||
// 1. 设置网站状态
|
||||
try {
|
||||
setWebsiteStatus(website);
|
||||
} catch (Exception e) {
|
||||
log.warn("设置网站状态失败: {}", e.getMessage());
|
||||
website.setStatus(0); // 默认状态
|
||||
website.setStatusText("状态未知");
|
||||
}
|
||||
|
||||
// 2. 构建配置信息
|
||||
try {
|
||||
HashMap<String, Object> config = buildSafeWebsiteConfig(website);
|
||||
website.setConfig(config);
|
||||
} catch (Exception e) {
|
||||
log.warn("构建网站配置失败: {}", e.getMessage());
|
||||
website.setConfig(new HashMap<>());
|
||||
}
|
||||
|
||||
// 3. 设置导航信息
|
||||
try {
|
||||
setSafeWebsiteNavigation(website);
|
||||
} catch (Exception e) {
|
||||
log.warn("设置网站导航失败: {}", e.getMessage());
|
||||
website.setTopNavs(new ArrayList<>());
|
||||
website.setBottomNavs(new ArrayList<>());
|
||||
}
|
||||
|
||||
// 4. 设置网站设置信息
|
||||
try {
|
||||
setWebsiteSetting(website);
|
||||
} catch (Exception e) {
|
||||
log.warn("设置网站设置失败: {}", e.getMessage());
|
||||
// 设置为null,让前端知道没有设置信息
|
||||
}
|
||||
|
||||
// 5. 构建服务器时间(使用LocalDateTime)
|
||||
try {
|
||||
HashMap<String, Object> serverTime = buildSafeServerTime();
|
||||
website.setServerTime(serverTime);
|
||||
} catch (Exception e) {
|
||||
log.warn("构建服务器时间失败: {}", e.getMessage());
|
||||
HashMap<String, Object> defaultTime = new HashMap<>();
|
||||
defaultTime.put("now", java.time.LocalDateTime.now().toString());
|
||||
website.setServerTime(defaultTime);
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
return buildSafeWebsiteConfig(website);
|
||||
}
|
||||
|
||||
private HashMap<String, Object> buildSafeWebsiteConfig(CmsWebsite website) {
|
||||
HashMap<String, Object> config = new HashMap<>();
|
||||
|
||||
try {
|
||||
// 获取网站字段配置
|
||||
LambdaQueryWrapper<CmsWebsiteField> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CmsWebsiteField::getDeleted, 0);
|
||||
final List<CmsWebsiteField> fields = cmsWebsiteFieldService.list(wrapper);
|
||||
|
||||
if (fields != null && !fields.isEmpty()) {
|
||||
fields.forEach(field -> {
|
||||
if (field != null && StrUtil.isNotBlank(field.getName())) {
|
||||
config.put(field.getName(), field.getValue() != null ? field.getValue() : "");
|
||||
}
|
||||
});
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取网站字段配置失败: {}", e.getMessage());
|
||||
}
|
||||
|
||||
// 安全地设置域名信息
|
||||
try {
|
||||
config.put("SysDomain", getSafeSysDomain(website));
|
||||
config.put("Domain", getSafeDomain(website));
|
||||
} catch (Exception e) {
|
||||
log.warn("设置域名信息失败: {}", e.getMessage());
|
||||
config.put("SysDomain", website.getTenantId() + ".websoft.top");
|
||||
config.put("Domain", website.getTenantId() + ".wsdns.cn");
|
||||
}
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
private String getSysDomain(CmsWebsite website) {
|
||||
return getSafeSysDomain(website);
|
||||
}
|
||||
|
||||
private String getDomain(CmsWebsite website) {
|
||||
return getSafeDomain(website);
|
||||
}
|
||||
|
||||
private String getSafeSysDomain(CmsWebsite website) {
|
||||
if (website == null || website.getTenantId() == null) {
|
||||
return "unknown.websoft.top";
|
||||
}
|
||||
return StrUtil.isNotBlank(website.getWebsiteCode()) ?
|
||||
website.getWebsiteCode() + SYS_DOMAIN_SUFFIX :
|
||||
website.getTenantId() + SYS_DOMAIN_SUFFIX;
|
||||
}
|
||||
|
||||
private String getSafeDomain(CmsWebsite website) {
|
||||
if (website == null || website.getTenantId() == null) {
|
||||
return "unknown.wsdns.cn";
|
||||
}
|
||||
|
||||
if (StrUtil.isNotBlank(website.getDomain())) {
|
||||
return website.getDomain();
|
||||
}
|
||||
if (StrUtil.isNotBlank(website.getWebsiteCode())) {
|
||||
return website.getWebsiteCode() + DOMAIN_SUFFIX;
|
||||
}
|
||||
return website.getTenantId() + DOMAIN_SUFFIX;
|
||||
}
|
||||
|
||||
private void setWebsiteNavigation(CmsWebsite website) {
|
||||
setSafeWebsiteNavigation(website);
|
||||
}
|
||||
|
||||
private void setSafeWebsiteNavigation(CmsWebsite website) {
|
||||
if (website == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 设置顶部导航
|
||||
try {
|
||||
final CmsNavigationParam topParam = new CmsNavigationParam();
|
||||
topParam.setHide(0);
|
||||
topParam.setTop(0);
|
||||
topParam.setBottom(null);
|
||||
final List<CmsNavigation> topNavs = cmsNavigationService.listRel(topParam);
|
||||
|
||||
if (topNavs != null && !topNavs.isEmpty()) {
|
||||
try {
|
||||
website.setTopNavs(CommonUtil.toTreeData(topNavs, 0,
|
||||
CmsNavigation::getParentId,
|
||||
CmsNavigation::getNavigationId,
|
||||
CmsNavigation::setChildren));
|
||||
} catch (Exception e) {
|
||||
log.warn("构建顶部导航树失败: {}", e.getMessage());
|
||||
website.setTopNavs(new ArrayList<>(topNavs));
|
||||
}
|
||||
} else {
|
||||
website.setTopNavs(new ArrayList<>());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取顶部导航失败: {}", e.getMessage());
|
||||
website.setTopNavs(new ArrayList<>());
|
||||
}
|
||||
|
||||
// 设置底部导航
|
||||
try {
|
||||
final CmsNavigationParam bottomParam = new CmsNavigationParam();
|
||||
bottomParam.setHide(0);
|
||||
bottomParam.setTop(null);
|
||||
bottomParam.setBottom(0);
|
||||
final List<CmsNavigation> bottomNavs = cmsNavigationService.listRel(bottomParam);
|
||||
|
||||
if (bottomNavs != null && !bottomNavs.isEmpty()) {
|
||||
try {
|
||||
website.setBottomNavs(CommonUtil.toTreeData(bottomNavs, 0,
|
||||
CmsNavigation::getParentId,
|
||||
CmsNavigation::getNavigationId,
|
||||
CmsNavigation::setChildren));
|
||||
} catch (Exception e) {
|
||||
log.warn("构建底部导航树失败: {}", e.getMessage());
|
||||
website.setBottomNavs(new ArrayList<>(bottomNavs));
|
||||
}
|
||||
} else {
|
||||
website.setBottomNavs(new ArrayList<>());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("获取底部导航失败: {}", e.getMessage());
|
||||
website.setBottomNavs(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
|
||||
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() {
|
||||
return buildSafeServerTime();
|
||||
}
|
||||
|
||||
private HashMap<String, Object> buildSafeServerTime() {
|
||||
HashMap<String, Object> serverTime = new HashMap<>();
|
||||
|
||||
try {
|
||||
// 使用 LocalDateTime 替代 DateTime
|
||||
java.time.LocalDateTime now = java.time.LocalDateTime.now();
|
||||
java.time.LocalDate today = java.time.LocalDate.now();
|
||||
|
||||
// 当前时间
|
||||
serverTime.put("now", now.toString());
|
||||
|
||||
// 今天日期
|
||||
serverTime.put("today", today.toString());
|
||||
|
||||
// 明天日期
|
||||
java.time.LocalDate tomorrow = today.plusDays(1);
|
||||
serverTime.put("tomorrow", tomorrow.toString());
|
||||
|
||||
// 后天日期
|
||||
java.time.LocalDate afterDay = today.plusDays(2);
|
||||
serverTime.put("afterDay", afterDay.toString());
|
||||
|
||||
// 今天星期几 (1=Monday, 7=Sunday)
|
||||
int week = today.getDayOfWeek().getValue();
|
||||
serverTime.put("week", week);
|
||||
|
||||
// 下周同一天
|
||||
java.time.LocalDate nextWeek = today.plusWeeks(1);
|
||||
serverTime.put("nextWeek", nextWeek.toString());
|
||||
|
||||
// 时间戳
|
||||
serverTime.put("timestamp", System.currentTimeMillis());
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("构建服务器时间失败: {}", e.getMessage(), e);
|
||||
// 提供最基本的时间信息
|
||||
serverTime.put("now", java.time.LocalDateTime.now().toString());
|
||||
serverTime.put("today", java.time.LocalDate.now().toString());
|
||||
serverTime.put("timestamp", System.currentTimeMillis());
|
||||
}
|
||||
|
||||
return serverTime;
|
||||
}
|
||||
|
||||
@Operation(summary = "清除缓存")
|
||||
@DeleteMapping("/clearSiteInfo/{key}")
|
||||
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
|
||||
log.info("清除缓存开始,key: {}", key);
|
||||
// 清除指定key
|
||||
redisUtil.delete(key);
|
||||
// 清除缓存
|
||||
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
|
||||
log.info("清除缓存结束,key: {}", 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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "应用参数管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-website-field")
|
||||
public class CmsWebsiteFieldController extends BaseController {
|
||||
@Resource
|
||||
private CmsWebsiteFieldService cmsWebsiteFieldService;
|
||||
|
||||
@Operation(summary = "分页查询应用参数")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsWebsiteField>> page(CmsWebsiteFieldParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteFieldService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部应用参数")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsWebsiteField>> list(CmsWebsiteFieldParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteFieldService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据id查询应用参数")
|
||||
@GetMapping("/{id}")
|
||||
public ApiResult<CmsWebsiteField> get(@PathVariable("id") Integer id) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteFieldService.getByIdRel(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "添加应用参数")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
||||
if (cmsWebsiteFieldService.save(cmsWebsiteField)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "修改应用参数")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsWebsiteField cmsWebsiteField) {
|
||||
if (cmsWebsiteFieldService.updateById(cmsWebsiteField)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "删除应用参数")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsWebsiteFieldService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量添加应用参数")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteField> list) {
|
||||
if (cmsWebsiteFieldService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量修改应用参数")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteField> batchParam) {
|
||||
if (batchParam.update(cmsWebsiteFieldService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "批量删除应用参数")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsWebsiteFieldService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@Operation(summary = "获取网站配置参数-对象形式")
|
||||
@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.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
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
|
||||
*/
|
||||
@Tag(name = "网站设置管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/cms/cms-website-setting")
|
||||
public class CmsWebsiteSettingController extends BaseController {
|
||||
@Resource
|
||||
private CmsWebsiteSettingService cmsWebsiteSettingService;
|
||||
|
||||
@Operation(summary = "分页查询网站设置")
|
||||
@GetMapping("/page")
|
||||
public ApiResult<PageResult<CmsWebsiteSetting>> page(CmsWebsiteSettingParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteSettingService.pageRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询全部网站设置")
|
||||
@GetMapping()
|
||||
public ApiResult<List<CmsWebsiteSetting>> list(CmsWebsiteSettingParam param) {
|
||||
// 使用关联查询
|
||||
return success(cmsWebsiteSettingService.listRel(param));
|
||||
}
|
||||
|
||||
@Operation(summary = "根据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')")
|
||||
@Operation(summary = "添加网站设置")
|
||||
@PostMapping()
|
||||
public ApiResult<?> save(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
||||
if (cmsWebsiteSettingService.save(cmsWebsiteSetting)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:website:update')")
|
||||
@Operation(summary = "修改网站设置")
|
||||
@PutMapping()
|
||||
public ApiResult<?> update(@RequestBody CmsWebsiteSetting cmsWebsiteSetting) {
|
||||
if (cmsWebsiteSettingService.updateById(cmsWebsiteSetting)) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
||||
@Operation(summary = "删除网站设置")
|
||||
@DeleteMapping("/{id}")
|
||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||
if (cmsWebsiteSettingService.removeById(id)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:save')")
|
||||
@Operation(summary = "批量添加网站设置")
|
||||
@PostMapping("/batch")
|
||||
public ApiResult<?> saveBatch(@RequestBody List<CmsWebsiteSetting> list) {
|
||||
if (cmsWebsiteSettingService.saveBatch(list)) {
|
||||
return success("添加成功");
|
||||
}
|
||||
return fail("添加失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:update')")
|
||||
@Operation(summary = "批量修改网站设置")
|
||||
@PutMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<CmsWebsiteSetting> batchParam) {
|
||||
if (batchParam.update(cmsWebsiteSettingService, "id")) {
|
||||
return success("修改成功");
|
||||
}
|
||||
return fail("修改失败");
|
||||
}
|
||||
|
||||
@PreAuthorize("hasAuthority('cms:cmsWebsiteSetting:remove')")
|
||||
@Operation(summary = "批量删除网站设置")
|
||||
@DeleteMapping("/batch")
|
||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||
if (cmsWebsiteSettingService.removeByIds(ids)) {
|
||||
return success("删除成功");
|
||||
}
|
||||
return fail("删除失败");
|
||||
}
|
||||
|
||||
}
|
||||
106
src/main/java/com/gxwebsoft/cms/entity/CmsAd.java
Normal file
106
src/main/java/com/gxwebsoft/cms/entity/CmsAd.java
Normal file
@@ -0,0 +1,106 @@
|
||||
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.time.LocalDateTime;
|
||||
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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 广告位
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsAd对象", description = "广告位")
|
||||
public class CmsAd implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "ad_id", type = IdType.AUTO)
|
||||
private Integer adId;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "唯一标识")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "栏目ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@Schema(description = "栏目名称")
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "广告位名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "宽")
|
||||
private String width;
|
||||
|
||||
@Schema(description = "高")
|
||||
private String height;
|
||||
|
||||
@Schema(description = "边框")
|
||||
private String border;
|
||||
|
||||
@Schema(description = "CSS样式")
|
||||
private String style;
|
||||
|
||||
@Schema(description = "广告图片")
|
||||
private String images;
|
||||
|
||||
@Schema(description = "广告图片")
|
||||
@TableField(exist = false)
|
||||
private JSONArray imageList;
|
||||
|
||||
@Schema(description = "路由/链接地址")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "国际化语言")
|
||||
private String lang;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
public JSONArray getImageList() {
|
||||
return JSON.parseArray(this.images);
|
||||
}
|
||||
}
|
||||
58
src/main/java/com/gxwebsoft/cms/entity/CmsAdRecord.java
Normal file
58
src/main/java/com/gxwebsoft/cms/entity/CmsAdRecord.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 广告图片
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsAdRecord对象", description = "广告图片")
|
||||
public class CmsAdRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "ad_record_id", type = IdType.AUTO)
|
||||
private Integer adRecordId;
|
||||
|
||||
@Schema(description = "广告标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "图片地址")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "链接地址")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "广告位ID")
|
||||
private Integer adId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime 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.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "图片DTO", description = "图片DTO")
|
||||
public class CmsAdVo implements Serializable {
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableField(exist = false)
|
||||
private Integer uid;
|
||||
|
||||
@Schema(description = "名称")
|
||||
@TableField(exist = false)
|
||||
private String title;
|
||||
|
||||
@Schema(description = "图片路径")
|
||||
@TableField(exist = false)
|
||||
private String url;
|
||||
|
||||
@Schema(description = "视频地址")
|
||||
@TableField(exist = false)
|
||||
private String video;
|
||||
|
||||
@Schema(description = "状态")
|
||||
@TableField(exist = false)
|
||||
private String status;
|
||||
|
||||
@Schema(description = "图片宽")
|
||||
@TableField(exist = false)
|
||||
private Integer width;
|
||||
|
||||
@Schema(description = "图片高")
|
||||
@TableField(exist = false)
|
||||
private Integer height;
|
||||
}
|
||||
264
src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java
Normal file
264
src/main/java/com/gxwebsoft/cms/entity/CmsArticle.java
Normal file
@@ -0,0 +1,264 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文章
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsArticle对象", description = "文章")
|
||||
public class CmsArticle implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文章ID")
|
||||
@TableId(value = "article_id", type = IdType.AUTO)
|
||||
private Integer articleId;
|
||||
|
||||
@Schema(description = "文章标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "文章类型 0常规 1视频")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "文章模型")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "内容模板页面")
|
||||
private String detail;
|
||||
|
||||
@Schema(description = "banner")
|
||||
@TableField(exist = false)
|
||||
private String banner;
|
||||
|
||||
@Schema(description = "访问路径")
|
||||
@TableField(exist = false)
|
||||
private String path;
|
||||
|
||||
@Schema(description = "列表显示方式(10小图展示 20大图展示)")
|
||||
private Integer showType;
|
||||
|
||||
@Schema(description = "话题")
|
||||
private String topic;
|
||||
|
||||
@Schema(description = "标签")
|
||||
private String tags;
|
||||
|
||||
@Schema(description = "文章分类ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@Schema(description = "当前分类")
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "父级分类ID")
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "父级分类")
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
|
||||
@Schema(description = "封面图")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "封面图宽度")
|
||||
private Integer imageWidth;
|
||||
|
||||
@Schema(description = "封面图高度")
|
||||
private Integer imageHeight;
|
||||
|
||||
@Schema(description = "价格")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Schema(description = "到期时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Schema(description = "来源")
|
||||
private String source;
|
||||
|
||||
@Schema(description = "产品概述")
|
||||
private String overview;
|
||||
|
||||
@Schema(description = "虚拟阅读量(仅用作展示)")
|
||||
private Integer virtualViews;
|
||||
|
||||
@Schema(description = "实际阅读量")
|
||||
private Integer actualViews;
|
||||
|
||||
@Schema(description = "评分")
|
||||
private BigDecimal rate;
|
||||
|
||||
@Schema(description = "可见类型 0所有人 1登录可见 2密码可见")
|
||||
private Integer permission;
|
||||
|
||||
@Schema(description = "访问密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "验证密码(前端回传)")
|
||||
@TableField(exist = false)
|
||||
private String password2;
|
||||
|
||||
@Schema(description = "发布来源客户端 (APP、H5、小程序等)")
|
||||
private String platform;
|
||||
|
||||
@Schema(description = "文章附件")
|
||||
private String files;
|
||||
|
||||
@Schema(description = "视频地址")
|
||||
private String video;
|
||||
|
||||
@Schema(description = "接受的文件类型")
|
||||
private String accept;
|
||||
|
||||
@Schema(description = "经度")
|
||||
private String longitude;
|
||||
|
||||
@Schema(description = "纬度")
|
||||
private String latitude;
|
||||
|
||||
@Schema(description = "所在省份")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "所在城市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "所在辖区")
|
||||
private String region;
|
||||
|
||||
@Schema(description = "街道地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "点赞数")
|
||||
private Integer likes;
|
||||
|
||||
@Schema(description = "评论数")
|
||||
private Integer commentNumbers;
|
||||
|
||||
@Schema(description = "提醒谁看")
|
||||
private String toUsers;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "作者")
|
||||
private String author;
|
||||
|
||||
@Schema(description = "国际化语言")
|
||||
private String lang;
|
||||
|
||||
@Schema(description = "关联默认语言的文章ID,用于同步翻译更新")
|
||||
private Integer langArticleId;
|
||||
|
||||
@Schema(description = "是否启用自动翻译")
|
||||
private Boolean translation;
|
||||
|
||||
@Schema(description = "编辑器类型 1 富文本编辑器 2 Markdown编辑器")
|
||||
private Integer editor;
|
||||
|
||||
@Schema(description = "PDF地址")
|
||||
private String pdfUrl;
|
||||
|
||||
@Schema(description = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "商户ID")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "项目ID")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantName;
|
||||
|
||||
@Schema(description = "商户名称")
|
||||
@TableField(exist = false)
|
||||
private String merchantAvatar;
|
||||
|
||||
@Schema(description = "昵称")
|
||||
@TableField(exist = false)
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "头像")
|
||||
@TableField(exist = false)
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "状态文本")
|
||||
@TableField(exist = false)
|
||||
private String statusText;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "是否更新")
|
||||
@TableField(exist = false)
|
||||
private Boolean isUpdate;
|
||||
|
||||
@Schema(description = "文章内容")
|
||||
@TableField(exist = false)
|
||||
private String content;
|
||||
|
||||
@Schema(description = "已报名人数")
|
||||
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,94 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文章分类表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsArticleCategory对象", description = "文章分类表")
|
||||
public class CmsArticleCategory implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文章分类ID")
|
||||
@TableId(value = "category_id", type = IdType.AUTO)
|
||||
private Integer categoryId;
|
||||
|
||||
@Schema(description = "分类标识")
|
||||
private String categoryCode;
|
||||
|
||||
@Schema(description = "分类名称")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "类型 0列表 1单页 2外链")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "分类图片")
|
||||
private String image;
|
||||
|
||||
@Schema(description = "上级分类ID")
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "路由/链接地址")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "组件路径")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "绑定的页面")
|
||||
private Integer pageId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "文章数量")
|
||||
private Integer count;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "是否隐藏, 0否, 1是(仅注册路由不显示在左侧菜单)")
|
||||
private Integer hide;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "是否显示在首页")
|
||||
private Integer showIndex;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1禁用")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文章评论表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsArticleComment对象", description = "文章评论表")
|
||||
public class CmsArticleComment implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "评价ID")
|
||||
@TableId(value = "comment_id", type = IdType.AUTO)
|
||||
private Integer commentId;
|
||||
|
||||
@Schema(description = "文章ID")
|
||||
private Integer articleId;
|
||||
|
||||
@Schema(description = "评分 (10好评 20中评 30差评)")
|
||||
private Integer score;
|
||||
|
||||
@Schema(description = "评价内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "是否为图片评价")
|
||||
private Integer isPicture;
|
||||
|
||||
@Schema(description = "评论者ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "被评价者ID")
|
||||
private Integer toUserId;
|
||||
|
||||
@Schema(description = "回复的评论ID")
|
||||
private Integer replyCommentId;
|
||||
|
||||
@Schema(description = "回复者ID")
|
||||
private Integer replyUserId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0未读, 1已读")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 文章记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsArticleContent对象", description = "文章记录表")
|
||||
public class CmsArticleContent implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "文章ID")
|
||||
private Integer articleId;
|
||||
|
||||
@Schema(description = "文章内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleCount.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleCount.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 点赞文章
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsArticleCount对象", description = "点赞文章")
|
||||
public class CmsArticleCount implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "文章ID")
|
||||
private Integer articleId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleLike.java
Normal file
43
src/main/java/com/gxwebsoft/cms/entity/CmsArticleLike.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 点赞文章
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsArticleLike对象", description = "点赞文章")
|
||||
public class CmsArticleLike implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "主键ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "文章ID")
|
||||
private Integer articleId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
123
src/main/java/com/gxwebsoft/cms/entity/CmsDesign.java
Normal file
123
src/main/java/com/gxwebsoft/cms/entity/CmsDesign.java
Normal file
@@ -0,0 +1,123 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 页面管理记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsDesign对象", description = "页面管理记录表")
|
||||
public class CmsDesign implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "page_id", type = IdType.AUTO)
|
||||
private Integer pageId;
|
||||
|
||||
@Schema(description = "页面")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "所属栏目ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@Schema(description = "所属栏目")
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
@Schema(description = "页面模型")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "页面关键词")
|
||||
private String keywords;
|
||||
|
||||
@Schema(description = "页面描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "路由地址")
|
||||
@TableField(exist = false)
|
||||
private String path;
|
||||
|
||||
@Schema(description = "组件路径")
|
||||
@TableField(exist = false)
|
||||
private String component;
|
||||
|
||||
@Schema(description = "缩列图")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "购买链接")
|
||||
private String buyUrl;
|
||||
|
||||
@Schema(description = "页面样式")
|
||||
private String style;
|
||||
|
||||
@Schema(description = "页面内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "是否开启布局")
|
||||
private Boolean showLayout;
|
||||
|
||||
@Schema(description = "页面布局")
|
||||
@TableField(exist = false)
|
||||
private String layout;
|
||||
|
||||
@Schema(description = "是否显示banner")
|
||||
private Boolean showBanner;
|
||||
|
||||
@Schema(description = "是否显示Button")
|
||||
private Boolean showButton;
|
||||
|
||||
@Schema(description = "上级id, 0是顶级")
|
||||
private Integer parentId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "国际化语言")
|
||||
private String lang;
|
||||
|
||||
@Schema(description = "用于同步翻译内容")
|
||||
@TableField(exist = false)
|
||||
private Integer langCategoryId;
|
||||
|
||||
@Schema(description = "是否启用自动翻译")
|
||||
private Boolean translation;
|
||||
|
||||
@Schema(description = "设为首页")
|
||||
private Integer home;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
76
src/main/java/com/gxwebsoft/cms/entity/CmsDesignRecord.java
Normal file
76
src/main/java/com/gxwebsoft/cms/entity/CmsDesignRecord.java
Normal file
@@ -0,0 +1,76 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 页面组件表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsDesignRecord对象", description = "页面组件表")
|
||||
public class CmsDesignRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "关联导航ID")
|
||||
private Integer navigationId;
|
||||
|
||||
@Schema(description = "组件")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "组件标识")
|
||||
private String dictCode;
|
||||
|
||||
@Schema(description = "组件样式")
|
||||
private String styles;
|
||||
|
||||
@Schema(description = "卡片阴影显示时机")
|
||||
private String shadow;
|
||||
|
||||
@Schema(description = "页面关键词")
|
||||
private String keywords;
|
||||
|
||||
@Schema(description = "页面描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "页面路由地址")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "缩列图")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
73
src/main/java/com/gxwebsoft/cms/entity/CmsDomain.java
Normal file
73
src/main/java/com/gxwebsoft/cms/entity/CmsDomain.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 网站域名记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:36:14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsDomain对象", description = "网站域名记录表")
|
||||
public class CmsDomain implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "类型 0赠送域名 1绑定域名 ")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "域名")
|
||||
private String domain;
|
||||
|
||||
@Schema(description = "主机记录")
|
||||
private String hostName;
|
||||
|
||||
@Schema(description = "记录值")
|
||||
private String hostValue;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "排序号")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "网站ID")
|
||||
private Integer websiteId;
|
||||
|
||||
@Schema(description = "租户ID")
|
||||
private Integer appId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
91
src/main/java/com/gxwebsoft/cms/entity/CmsForm.java
Normal file
91
src/main/java/com/gxwebsoft/cms/entity/CmsForm.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 表单设计表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsForm对象", description = "表单设计表")
|
||||
public class CmsForm implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "form_id", type = IdType.AUTO)
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "表单标题")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "顶部图片")
|
||||
private String photo;
|
||||
|
||||
@Schema(description = "背景图片")
|
||||
private String background;
|
||||
|
||||
@Schema(description = "视频文件")
|
||||
private String video;
|
||||
|
||||
@Schema(description = "提交次数")
|
||||
private Integer submitNumber;
|
||||
|
||||
@Schema(description = "页面布局")
|
||||
private String layout;
|
||||
|
||||
@Schema(description = "是否隐藏顶部图片")
|
||||
private Integer hidePhoto;
|
||||
|
||||
@Schema(description = "是否隐藏背景图片")
|
||||
private Integer hideBackground;
|
||||
|
||||
@Schema(description = "是否隐藏视频")
|
||||
private Integer hideVideo;
|
||||
|
||||
@Schema(description = "背景图片透明度")
|
||||
private BigDecimal opacity;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "国际化语言")
|
||||
private String lang;
|
||||
|
||||
@Schema(description = "商户ID")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
69
src/main/java/com/gxwebsoft/cms/entity/CmsFormRecord.java
Normal file
69
src/main/java/com/gxwebsoft/cms/entity/CmsFormRecord.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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 表单数据记录表
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsFormRecord对象", description = "表单数据记录表")
|
||||
public class CmsFormRecord implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "form_record_id", type = IdType.AUTO)
|
||||
private Integer formRecordId;
|
||||
|
||||
@Schema(description = "手机号")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "表单ID")
|
||||
private Integer formId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "商户ID")
|
||||
private Long merchantId;
|
||||
|
||||
@Schema(description = "姓名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1冻结")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
61
src/main/java/com/gxwebsoft/cms/entity/CmsLang.java
Normal file
61
src/main/java/com/gxwebsoft/cms/entity/CmsLang.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 国际化
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-06 19:29:26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsLang对象", description = "国际化")
|
||||
public class CmsLang implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
46
src/main/java/com/gxwebsoft/cms/entity/CmsLangLog.java
Normal file
46
src/main/java/com/gxwebsoft/cms/entity/CmsLangLog.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.gxwebsoft.cms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 国际化记录启用
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2025-01-06 19:29:26
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsLangLog对象", description = "国际化记录启用")
|
||||
public class CmsLangLog implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String lang;
|
||||
|
||||
@Schema(description = "关联ID")
|
||||
private Integer langId;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
80
src/main/java/com/gxwebsoft/cms/entity/CmsLink.java
Normal file
80
src/main/java/com/gxwebsoft/cms/entity/CmsLink.java
Normal file
@@ -0,0 +1,80 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 常用链接
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-09-10 20:47:57
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsLink对象", description = "常用链接")
|
||||
public class CmsLink implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "自增ID")
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
@Schema(description = "链接名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "链接地址")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "栏目ID")
|
||||
private Integer categoryId;
|
||||
|
||||
@Schema(description = "应用ID")
|
||||
private Integer appId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "国际化语言")
|
||||
private String lang;
|
||||
|
||||
@Schema(description = "是否推荐")
|
||||
private Integer recommend;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "状态, 0正常, 1待确认")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "栏目名称")
|
||||
@TableField(exist = false)
|
||||
private String categoryName;
|
||||
|
||||
}
|
||||
97
src/main/java/com/gxwebsoft/cms/entity/CmsModel.java
Normal file
97
src/main/java/com/gxwebsoft/cms/entity/CmsModel.java
Normal file
@@ -0,0 +1,97 @@
|
||||
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.time.LocalDateTime;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 模型
|
||||
*
|
||||
* @author 科技小王子
|
||||
* @since 2024-11-26 15:44:53
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@Schema(name = "CmsModel对象", description = "模型")
|
||||
public class CmsModel implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "ID")
|
||||
@TableId(value = "model_id", type = IdType.AUTO)
|
||||
private Integer modelId;
|
||||
|
||||
@Schema(description = "模型名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "唯一标识")
|
||||
private String model;
|
||||
|
||||
@Schema(description = "列表页路径")
|
||||
private String component;
|
||||
|
||||
@Schema(description = "详情页路径")
|
||||
private String componentDetail;
|
||||
|
||||
@Schema(description = "模型banner图片")
|
||||
private String banner;
|
||||
|
||||
@Schema(description = "文章后缀")
|
||||
private String suffix;
|
||||
|
||||
@Schema(description = "拇指图片")
|
||||
private String thumb;
|
||||
|
||||
@Schema(description = "封面图宽")
|
||||
private String imageWidth;
|
||||
|
||||
@Schema(description = "封面图高")
|
||||
private String imageHeight;
|
||||
|
||||
@Schema(description = "css样式")
|
||||
private String style;
|
||||
|
||||
@Schema(description = "Banner上的标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "列表显示方式(10小图展示 20大图展示)")
|
||||
private Integer showType;
|
||||
|
||||
@Schema(description = "是否禁用")
|
||||
private Boolean disabled;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private Integer userId;
|
||||
|
||||
@Schema(description = "排序(数字越小越靠前)")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String comments;
|
||||
|
||||
@Schema(description = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "是否删除, 0否, 1是")
|
||||
@TableLogic
|
||||
private Integer deleted;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user