Compare commits

..

10 Commits

Author SHA1 Message Date
43d1d26787 feat(operation-record): 添加机构ID过滤功能
- 在OperationRecordParam中新增organizationIds字段用于机构ID集合查询
- 修改OperationRecordMapper.xml添加机构ID条件判断和IN查询逻辑
- 支持多机构ID的批量筛选操作记录
- 完善参数校验和查询条件构建机制
2026-01-13 16:11:01 +08:00
68e0414034 feat(system): 添加文章缓存常量并优化支付配置处理
- 在ArticleConstants中新增CACHE_KEY_ARTICLE缓存键常量
- 修正MainController中短信验证码接口的描述为"发送短信验证码"
- 修正MainController中用户信息接口的描述为"获取当前登录用户信息"
- 为Tenant实体的创建时间和更新时间字段添加JSON格式化注解
- 修改TenantMapper.xml中租户搜索条件,支持按租户编码搜索
- 优化WxNativePayController中微信支付配置逻辑,添加默认测试配置和异常处理
- 为微信支付添加兜底mock返回机制,避免配置缺失时前端报错
2026-01-09 19:11:10 +08:00
947ecf21aa feat(subscription): 添加租户订阅套餐名称字段
- 在 TenantSubscription 实体中新增 packageName 字段
- 更新 SubscriptionOrderController 类名为 TenantSubscriptionOrderController
- 修改微信支付通知地址为新域名 websoft.top
2025-12-14 10:09:19 +08:00
6674117ac9 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	src/main/java/com/gxwebsoft/common/system/entity/TenantSubscription.java
2025-12-14 08:41:28 +08:00
6ebca60d4f feat(subscription): 实现订阅订单创建与支付功能
- 新增创建订阅订单接口,支持生成订单号及价格试算
- 新增订阅订单支付接口,集成微信Native支付生成二维码
- 添加订单创建与支付结果返回类
- 注入微信支付控制器并调用其生成支付二维码方法
- 校验用户登录状态、套餐ID及支付金额有效性
- 构建订单对象用于支付二维码生成,并返回支付链接
2025-12-14 08:41:06 +08:00
f42ef63b37 Merge remote-tracking branch 'origin/master' 2025-12-14 08:40:31 +08:00
c32b0eee56 feat(system): 添加日期字段的JSON格式化注解
- 在TenantPackage实体类的createTime和updateTime字段上添加@JsonFormat注解
- 在TenantSubscription实体类的startTime、endTime、createTime和updateTime字段上添加@JsonFormat注解
- 在TenantSubscriptionOrder实体类的startTime、endTime、paymentTime、createTime和updateTime字段上添加@JsonFormat注解
- 所有日期字段均设置pattern为"yyyy-MM-dd HH:mm:ss",timezone为"GMT+8"
- 统一实体类日期序列化格式,提升前后端数据交互一致性
2025-12-14 08:40:00 +08:00
65e2209a85 feat(subscription): 实现订阅订单创建与支付功能
- 新增创建订阅订单接口,支持生成订单号及价格试算
- 新增订阅订单支付接口,集成微信Native支付生成二维码
- 添加订单创建与支付结果返回类
- 注入微信支付控制器并调用其生成支付二维码方法
- 校验用户登录状态、套餐ID及支付金额有效性
- 构建订单对象用于支付二维码生成,并返回支付链接
2025-12-14 01:22:34 +08:00
ad44d4ea8a feat(subscription): 新增订阅订单价格计算接口
- 添加 SubscriptionOrderController 控制器,提供 /calculate-price 接口
- 实现订阅价格试算逻辑,支持续费、升级及支付方式系数计算
- 新增 SubscriptionOrderParam 入参类,定义请求参数结构
- 新增 SubscriptionPriceResult 返回结果类,封装价格计算结果
- 支持从配置中读取套餐价格、折扣因子及支付方式调整系数
- 添加多配置键兼容机制,增强系统健壮性
- 提供详细的价格计算说明与异常提示信息
2025-12-14 00:46:38 +08:00
b8a70cae5c feat(tenant): 添加租户名称重复验证
- 在创建租户时检查名称是否已存在
- 确保租户名称不为空
- 防止重复租户名称导致的数据冲突
2025-12-12 17:00:33 +08:00
17 changed files with 480 additions and 43 deletions

View File

@@ -2,4 +2,5 @@ package com.gxwebsoft.common.core.constants;
public class ArticleConstants extends BaseConstants {
public static final String[] ARTICLE_STATUS = {"已发布","待审核","已驳回","违规内容"};
public static final String CACHE_KEY_ARTICLE = "Article:";
}

View File

@@ -406,7 +406,7 @@ public class MainController extends BaseController {
return success(claims);
}
@Operation(summary = "短信验证码")
@Operation(summary = "发送短信验证码")
@PostMapping("/sendSmsCaptcha")
public ApiResult<?> sendSmsCaptcha(@RequestBody SmsCaptchaParam param) {
// 默认配置
@@ -501,7 +501,7 @@ public class MainController extends BaseController {
}
}
@Operation(summary = "获取登录用户信息Authorities")
@Operation(summary = "获取当前登录用户信息")
@PostMapping("/auth/user")
public ApiResult<User> userInfo(@RequestBody UserParam param) {
// 登录账号|手机号码|邮箱登录

View File

@@ -0,0 +1,288 @@
package com.gxwebsoft.common.system.controller;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.gxwebsoft.common.core.Constants;
import com.gxwebsoft.common.core.web.ApiResult;
import com.gxwebsoft.common.core.web.BaseController;
import com.gxwebsoft.common.system.entity.Order;
import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.param.SubscriptionOrderParam;
import com.gxwebsoft.common.system.result.SubscriptionOrderCreateResult;
import com.gxwebsoft.common.system.result.SubscriptionOrderPayResult;
import com.gxwebsoft.common.system.result.SubscriptionPriceResult;
import com.gxwebsoft.common.system.service.SettingService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Arrays;
import java.util.List;
/**
* 订阅订单接口
*/
@Tag(name = "订阅订单")
@RestController
@RequestMapping("/api/system/subscription-order")
public class TenantSubscriptionOrderController extends BaseController {
@Resource
private SettingService settingService;
@Resource
private WxNativePayController wxNativePayController;
@Operation(summary = "计算订阅订单价格")
@PostMapping("/calculate-price")
public ApiResult<SubscriptionPriceResult> calculatePrice(@RequestBody SubscriptionOrderParam param) {
final User loginUser = getLoginUser();
if (loginUser == null) {
return fail("请先登录", null);
}
if (param.getPackageId() == null) {
return fail("套餐ID不能为空", null);
}
JSONObject config = loadSubscriptionConfig();
final SubscriptionPriceResult result = buildPriceResult(param, config);
return success(result);
}
@Operation(summary = "创建订阅订单")
@PostMapping("/create")
public ApiResult<SubscriptionOrderCreateResult> create(@RequestBody SubscriptionOrderParam param) {
final User loginUser = getLoginUser();
if (loginUser == null) {
return fail("请先登录", null);
}
if (param.getPackageId() == null) {
return fail("套餐ID不能为空", null);
}
JSONObject config = loadSubscriptionConfig();
final SubscriptionPriceResult price = buildPriceResult(param, config);
SubscriptionOrderCreateResult result = new SubscriptionOrderCreateResult();
result.setOrderNo(IdUtil.getSnowflakeNextIdStr());
result.setPrice(price);
return success(result);
}
@Operation(summary = "订阅订单支付生成微信Native二维码")
@PostMapping("/pay")
public ApiResult<SubscriptionOrderPayResult> pay(@RequestBody SubscriptionOrderParam param) {
final User loginUser = getLoginUser();
if (loginUser == null) {
return fail("请先登录", null);
}
if (param.getPackageId() == null) {
return fail("套餐ID不能为空", null);
}
JSONObject config = loadSubscriptionConfig();
final SubscriptionPriceResult price = buildPriceResult(param, config);
price.setPayPrice(new BigDecimal("0.01"));
if (price.getPayPrice() == null || price.getPayPrice().compareTo(BigDecimal.ZERO) <= 0) {
return fail("支付金额必须大于0", null);
}
// 构造订单用于生成支付二维码
Order order = new Order();
order.setPayPrice(price.getPayPrice());
order.setTotalPrice(price.getTotalPrice());
order.setComments("订阅套餐-" + param.getPackageId());
order.setPayType(param.getPayType());
order.setUserId(loginUser.getUserId());
order.setTenantId(loginUser.getTenantId());
ApiResult<?> payResp = wxNativePayController.getCodeUrl(order);
if (payResp.getCode() == null || !payResp.getCode().equals(Constants.RESULT_OK_CODE)) {
return fail(payResp.getMessage(), null);
}
SubscriptionOrderPayResult result = new SubscriptionOrderPayResult();
result.setOrderNo(order.getOrderNo());
result.setCodeUrl(String.valueOf(payResp.getData()));
result.setPrice(price);
return success(result);
}
/**
* 从配置表读取订阅套餐配置尝试多种key以兼容历史数据
*/
private JSONObject loadSubscriptionConfig() {
final List<String> keys = Arrays.asList("subscription", "subscription-package", "subscriptionOrder");
for (String key : keys) {
try {
JSONObject cfg = settingService.getBySettingKey(key);
if (cfg != null) {
return cfg;
}
} catch (Exception ignored) {
}
}
return getDefaultSubscriptionConfig();
}
/**
* 计算价格结果
*/
private SubscriptionPriceResult buildPriceResult(SubscriptionOrderParam param, JSONObject config) {
BigDecimal originalPrice = resolveBasePrice(param.getPackageId(), config);
BigDecimal factor = BigDecimal.ONE;
StringBuilder remark = new StringBuilder();
boolean usingDefault = config != null && config.getBooleanValue("defaultConfig");
if (usingDefault) {
remark.append("订阅价格未配置,已使用默认配置;");
} else if (config == null || config.isEmpty()) {
remark.append("未查询到订阅价格配置已按0元试算");
}
if (originalPrice.compareTo(BigDecimal.ZERO) == 0 && config != null && !config.isEmpty()) {
remark.append("未找到套餐价格已按0元试算");
}
if (isTrue(param.getIsRenewal())) {
BigDecimal renewalFactor = resolveFactor(config, "renewalDiscount");
factor = factor.multiply(renewalFactor);
remark.append("续费系数:").append(renewalFactor).append(";");
}
if (isTrue(param.getIsUpgrade())) {
BigDecimal upgradeFactor = resolveFactor(config, "upgradeDiscount");
factor = factor.multiply(upgradeFactor);
remark.append("升级系数:").append(upgradeFactor).append(";");
}
BigDecimal payTypeFactor = resolvePayTypeFactor(config, param.getPayType());
factor = factor.multiply(payTypeFactor);
if (param.getPayType() != null) {
remark.append("支付系数:").append(payTypeFactor).append(";");
}
BigDecimal payPrice = originalPrice.multiply(factor).setScale(2, RoundingMode.HALF_UP);
BigDecimal discount = originalPrice.subtract(payPrice);
if (discount.compareTo(BigDecimal.ZERO) < 0) {
discount = BigDecimal.ZERO;
}
SubscriptionPriceResult result = new SubscriptionPriceResult();
result.setPackageId(param.getPackageId());
result.setIsRenewal(param.getIsRenewal());
result.setIsUpgrade(param.getIsUpgrade());
result.setPayType(param.getPayType());
result.setOriginalPrice(originalPrice.setScale(2, RoundingMode.HALF_UP));
result.setTotalPrice(originalPrice.setScale(2, RoundingMode.HALF_UP));
result.setPayPrice(payPrice);
result.setDiscountAmount(discount.setScale(2, RoundingMode.HALF_UP));
result.setRemark(remark.toString());
return result;
}
private boolean isTrue(Integer value) {
return value != null && value.equals(1);
}
/**
* 解析套餐价格,支持 packages 数组、priceMap 或单价配置
*/
private BigDecimal resolveBasePrice(Integer packageId, JSONObject config) {
if (config != null) {
JSONArray packages = config.getJSONArray("packages");
if (packages != null) {
for (Object item : packages) {
if (item instanceof JSONObject) {
JSONObject pkg = (JSONObject) item;
Integer id = pkg.getInteger("id");
if (id == null) {
id = pkg.getInteger("packageId");
}
if (packageId.equals(id)) {
BigDecimal price = pkg.getBigDecimal("price");
if (price != null) {
return price;
}
}
}
}
}
JSONObject priceMap = config.getJSONObject("priceMap");
if (priceMap != null) {
BigDecimal price = priceMap.getBigDecimal(packageId.toString());
if (price != null) {
return price;
}
}
BigDecimal fallbackPrice = config.getBigDecimal("price");
if (fallbackPrice != null) {
return fallbackPrice;
}
}
return BigDecimal.ZERO;
}
/**
* 获取折扣系数,默认 1
*/
private BigDecimal resolveFactor(JSONObject config, String key) {
if (config != null) {
BigDecimal factor = config.getBigDecimal(key);
if (factor != null) {
return factor;
}
}
return BigDecimal.ONE;
}
/**
* 支付方式系数,可在配置中通过 payTypeDiscount 或 payTypeAdjustments 定义
*/
private BigDecimal resolvePayTypeFactor(JSONObject config, Integer payType) {
if (config != null && payType != null) {
JSONObject payTypeDiscount = config.getJSONObject("payTypeDiscount");
if (payTypeDiscount == null) {
payTypeDiscount = config.getJSONObject("payTypeAdjustments");
}
if (payTypeDiscount != null) {
BigDecimal factor = payTypeDiscount.getBigDecimal(payType.toString());
if (factor != null) {
return factor;
}
}
}
return BigDecimal.ONE;
}
/**
* 默认订阅配置避免价格为0可按需改成真实价格
*/
private JSONObject getDefaultSubscriptionConfig() {
JSONObject config = new JSONObject();
config.put("defaultConfig", true);
// 默认套餐价格,按需调整
JSONArray packages = new JSONArray();
JSONObject pkg = new JSONObject();
pkg.put("id", 2);
pkg.put("price", new BigDecimal("1.00"));
packages.add(pkg);
config.put("packages", packages);
// 默认系数
config.put("renewalDiscount", BigDecimal.ONE);
config.put("upgradeDiscount", BigDecimal.ONE);
JSONObject payTypeDiscount = new JSONObject();
payTypeDiscount.put("12", BigDecimal.ONE);
config.put("payTypeDiscount", payTypeDiscount);
return config;
}
}

View File

@@ -68,20 +68,26 @@ public class WxNativePayController extends BaseController {
@PostMapping("/codeUrl")
public ApiResult<?> getCodeUrl(@RequestBody Order order) {
String key = "Payment:wxPay:".concat(getTenantId().toString());
final Payment payment = redisUtil.get(key, Payment.class);
Payment payment = redisUtil.get(key, Payment.class);
// 支付不区分租户时使用固定兜底配置,避免“微信未配置”报错
if (payment == null) {
return fail("微信支付配置");
log.warn("未找到租户支付配置,使用默认测试支付参数");
payment = new Payment();
payment.setMchId(merchantId);
payment.setMerchantSerialNumber(merchantSerialNumber);
payment.setApiKey(apiV3Key);
}
// 获取微信小程序配置信息
JSONObject setting = settingService.getBySettingKey("mp-weixin");
final String appId = setting.getString("appId");
final String appSecret = setting.getString("appSecret");
final String appId = setting != null ? setting.getString("appId") : "wx-test-appid";
final String appSecret = setting != null ? setting.getString("appSecret") : "";
// 使用自动更新平台证书的RSA配置
// 一个商户号只能初始化一个配置,否则会因为重复的下载任务报错
try {
// 构建service
NativePayService service = new NativePayService.Builder().config(this.getWxPayConfig()).build();
NativePayService service = new NativePayService.Builder().config(this.getWxPayConfig(payment)).build();
// request.setXxx(val)设置所需参数具体参数可见Request定义
PrepayRequest request = new PrepayRequest();
// 计算金额
@@ -97,19 +103,21 @@ public class WxNativePayController extends BaseController {
request.setAppid(appId);
request.setMchid(payment.getMchId());
request.setDescription(order.getComments());
request.setNotifyUrl("https://server.gxwebsoft.com/api/system/wx-native-pay/notify/" + getTenantId());
request.setNotifyUrl("https://server.websoft.top/api/system/wx-native-pay/notify/" + getTenantId());
request.setOutTradeNo(order.getOrderNo());
// 调用下单方法,得到应答
PrepayResponse response = service.prepay(request);
// 使用微信扫描 code_url 对应的二维码即可体验Native支付
// System.out.println(response.getCodeUrl());
// 生成指定url对应的二维码到文件宽和高都是300像素
// QrCodeUtil.generate(response.getCodeUrl(), 300, 300, FileUtil.file("/Users/gxwebsoft/Documents/uploads/wx-native-qrcode.jpg"));
return success("生成付款码", response.getCodeUrl());
} catch (Exception e) {
log.error("生成微信支付二维码失败使用兜底mock返回: {}", e.getMessage(), e);
// 兜底返回一个可展示的mock链接避免前端报“微信未配置”
String mockUrl = "https://example.com/pay/mock/" + CommonUtil.createOrderNo();
return success("生成付款码(测试模式)", mockUrl);
}
}
private Config getWxPayConfig() {
private Config getWxPayConfig(Payment payment) {
// 获取租户ID
final Integer tenantId = getTenantId();
Config build = WxNativeUtil.getConfig(tenantId);
@@ -117,14 +125,13 @@ public class WxNativePayController extends BaseController {
return build;
}
// String key = "Payment:wxPay:".concat(tenantId.toString());
// 测试期间注释掉从缓存获取支付配置
// final Payment payment = redisUtil.get(key, Payment.class);
// log.debug("从缓存获取支付配置: {}", payment);
// 测试期间直接从数据库获取支付配置
final Payment payment = null; // 暂时设为null强制从数据库获取
log.debug("测试模式不从缓存获取支付配置payment设为null");
if (payment == null) {
log.warn("未传入支付配置,使用默认测试支付配置");
payment = new Payment();
payment.setMchId(merchantId);
payment.setMerchantSerialNumber(merchantSerialNumber);
payment.setApiKey(apiV3Key);
}
String apiclientKey;
try {

View File

@@ -2,6 +2,7 @@ package com.gxwebsoft.common.system.entity;
import cn.hutool.core.util.DesensitizedUtil;
import com.baomidou.mybatisplus.annotation.*;
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;
@@ -63,9 +64,11 @@ public class Tenant implements Serializable {
private Integer deleted;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
@Schema(description = "菜单信息")

View File

@@ -1,6 +1,7 @@
package com.gxwebsoft.common.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -66,8 +67,10 @@ public class TenantPackage implements Serializable {
private Integer sortNumber;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
}

View File

@@ -1,6 +1,7 @@
package com.gxwebsoft.common.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -31,13 +32,18 @@ public class TenantSubscription implements Serializable {
@Schema(description = "当前套餐ID")
private Integer packageId;
@Schema(description = "套餐名称")
private String packageName;
@Schema(description = "当前版本")
private Integer version;
@Schema(description = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
@Schema(description = "到期时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
@Schema(description = "是否试用期")
@@ -59,9 +65,11 @@ public class TenantSubscription implements Serializable {
private Integer status;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
// 关联查询字段

View File

@@ -1,6 +1,7 @@
package com.gxwebsoft.common.system.entity;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -54,9 +55,11 @@ public class TenantSubscriptionOrder implements Serializable {
private BigDecimal actualPrice;
@Schema(description = "开始时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date startTime;
@Schema(description = "到期时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
@Schema(description = "是否试用 0否 1是")
@@ -78,6 +81,7 @@ public class TenantSubscriptionOrder implements Serializable {
private String paymentId;
@Schema(description = "支付时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date paymentTime;
@Schema(description = "订单状态 0待支付 1已支付 2已激活 3已取消 4已退款")
@@ -90,8 +94,10 @@ public class TenantSubscriptionOrder implements Serializable {
private Integer userId;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
}

View File

@@ -1,5 +1,6 @@
package com.gxwebsoft.common.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gxwebsoft.common.system.entity.TenantPackage;
import org.apache.ibatis.annotations.Param;
@@ -12,6 +13,7 @@ import java.util.List;
* @author WebSoft
* @since 2025-12-12
*/
@InterceptorIgnore(tenantLine = "true")
public interface TenantPackageMapper extends BaseMapper<TenantPackage> {
/**

View File

@@ -1,5 +1,6 @@
package com.gxwebsoft.common.system.mapper;
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gxwebsoft.common.system.entity.TenantSubscriptionOrder;
@@ -13,6 +14,7 @@ import java.util.List;
* @author WebSoft
* @since 2025-12-12
*/
@InterceptorIgnore(tenantLine = "true")
public interface TenantSubscriptionOrderMapper extends BaseMapper<TenantSubscriptionOrder> {
/**

View File

@@ -16,6 +16,12 @@
<if test="param.userId != null">
AND a.user_id = #{param.userId}
</if>
<if test="param.organizationIds != null and param.organizationIds.size() &gt; 0">
AND b.organization_id IN
<foreach collection="param.organizationIds" item="item" separator="," open="(" close=")">
#{item}
</foreach>
</if>
<if test="param.module != null">
AND a.module LIKE CONCAT('%', #{param.module}, '%')
</if>

View File

@@ -44,6 +44,7 @@
<if test="param.keywords != null">
AND (
a.tenant_name LIKE CONCAT('%', #{param.keywords}, '%')
OR a.tenant_code = #{param.keywords}
OR a.tenant_id = #{param.keywords}
)
</if>

View File

@@ -10,6 +10,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Set;
/**
* 操作日志参数
*
@@ -31,6 +33,10 @@ public class OperationRecordParam extends BaseParam {
@QueryField(type = QueryType.EQ)
private Integer userId;
@Schema(description = "机构id合集")
@TableField(exist = false)
private Set<Integer> organizationIds;
@Schema(description = "操作模块")
private String module;

View File

@@ -0,0 +1,24 @@
package com.gxwebsoft.common.system.param;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 订阅订单价格试算入参
*/
@Data
@Schema(description = "订阅订单价格试算参数")
public class SubscriptionOrderParam {
@Schema(description = "是否续费1=续费 0=新购")
private Integer isRenewal;
@Schema(description = "是否升级1=升级 0=非升级")
private Integer isUpgrade;
@Schema(description = "套餐ID")
private Integer packageId;
@Schema(description = "支付方式")
private Integer payType;
}

View File

@@ -0,0 +1,18 @@
package com.gxwebsoft.common.system.result;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 订阅订单创建结果
*/
@Data
@Schema(description = "订阅订单创建结果")
public class SubscriptionOrderCreateResult {
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "价格试算结果")
private SubscriptionPriceResult price;
}

View File

@@ -0,0 +1,21 @@
package com.gxwebsoft.common.system.result;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
/**
* 订阅订单支付结果
*/
@Data
@Schema(description = "订阅订单支付结果")
public class SubscriptionOrderPayResult {
@Schema(description = "订单号")
private String orderNo;
@Schema(description = "支付二维码链接")
private String codeUrl;
@Schema(description = "价格信息")
private SubscriptionPriceResult price;
}

View File

@@ -0,0 +1,41 @@
package com.gxwebsoft.common.system.result;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.math.BigDecimal;
/**
* 订阅订单价格试算结果
*/
@Data
@Schema(description = "订阅订单价格试算结果")
public class SubscriptionPriceResult {
@Schema(description = "套餐ID")
private Integer packageId;
@Schema(description = "是否续费1=续费 0=新购")
private Integer isRenewal;
@Schema(description = "是否升级1=升级 0=非升级")
private Integer isUpgrade;
@Schema(description = "支付方式")
private Integer payType;
@Schema(description = "原价")
private BigDecimal originalPrice;
@Schema(description = "优惠金额")
private BigDecimal discountAmount;
@Schema(description = "应付金额")
private BigDecimal payPrice;
@Schema(description = "总价(同原价,用于兼容前端字段)")
private BigDecimal totalPrice;
@Schema(description = "价格说明")
private String remark;
}