1、修改测试、本地环境证书加载路径业务

2、优化配送结算业务,配送完成即计算
3、优化门店、服务商结算任务
4、秒杀活动增加弹窗业务
This commit is contained in:
2026-05-19 10:32:17 +08:00
parent 2fbcf16a48
commit b5d4274d97
38 changed files with 183 additions and 64 deletions

View File

@@ -32,7 +32,7 @@ public class CertificateProperties {
/** /**
* 开发环境证书路径前缀 * 开发环境证书路径前缀
*/ */
private String devCertPath = "dev"; private String devCertPath = "local";
/** /**
* 微信支付证书配置 * 微信支付证书配置

View File

@@ -30,7 +30,7 @@ import java.util.Map;
@Tag(name = "数据库修复工具") @Tag(name = "数据库修复工具")
@RestController @RestController
@RequestMapping("/api/database-fix") @RequestMapping("/api/database-fix")
// @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev") // @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "local")
public class DatabaseFixController extends BaseController { public class DatabaseFixController extends BaseController {
@Autowired @Autowired

View File

@@ -28,7 +28,7 @@ import java.util.Map;
@Tag(name = "开发环境管理") @Tag(name = "开发环境管理")
@RestController @RestController
@RequestMapping("/api/dev") @RequestMapping("/api/dev")
// @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev") // @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "local")
public class DevEnvironmentController extends BaseController { public class DevEnvironmentController extends BaseController {
@Autowired @Autowired

View File

@@ -70,7 +70,7 @@ public class EnvironmentAwarePaymentService {
* 根据当前环境获取回调地址 * 根据当前环境获取回调地址
*/ */
private String getEnvironmentNotifyUrl() { private String getEnvironmentNotifyUrl() {
if ("dev".equals(activeProfile) || "test".equals(activeProfile)) { if ("local".equals(activeProfile) || "test".equals(activeProfile)) {
// 开发/测试环境使用本地回调地址 // 开发/测试环境使用本地回调地址
return devNotifyUrl; return devNotifyUrl;
} else if ("prod".equals(activeProfile)) { } else if ("prod".equals(activeProfile)) {
@@ -135,7 +135,7 @@ public class EnvironmentAwarePaymentService {
* 是否为开发环境 * 是否为开发环境
*/ */
public boolean isDevelopmentEnvironment() { public boolean isDevelopmentEnvironment() {
return "dev".equals(activeProfile) || "test".equals(activeProfile); return "local".equals(activeProfile) || "test".equals(activeProfile);
} }
/** /**

View File

@@ -84,7 +84,7 @@ public class WechatCertAutoConfig {
String apiV3Key = "0kF5OlPr482EZwtn9zGufUcqa7ovgxRL"; String apiV3Key = "0kF5OlPr482EZwtn9zGufUcqa7ovgxRL";
// 根据环境选择证书路径 // 根据环境选择证书路径
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
// 开发环境使用配置文件upload-path拼接证书路径 // 开发环境使用配置文件upload-path拼接证书路径
String uploadPath = configProperties.getUploadPath(); // 配置文件路径 String uploadPath = configProperties.getUploadPath(); // 配置文件路径
String tenantId = "10550"; // 租户ID String tenantId = "10550"; // 租户ID

View File

@@ -105,7 +105,7 @@ public class WechatPayCertificateDiagnostic {
* 检查证书文件 * 检查证书文件
*/ */
private void checkCertificateFiles(Payment payment, Integer tenantId, String environment, DiagnosticResult result) { private void checkCertificateFiles(Payment payment, Integer tenantId, String environment, DiagnosticResult result) {
if ("dev".equals(environment)) { if ("local".equals(environment)) {
// 开发环境证书检查 // 开发环境证书检查
String tenantCertPath = "dev/wechat/" + tenantId; String tenantCertPath = "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
@@ -152,7 +152,7 @@ public class WechatPayCertificateDiagnostic {
*/ */
private void validateCertificateContent(Payment payment, Integer tenantId, String environment, DiagnosticResult result) { private void validateCertificateContent(Payment payment, Integer tenantId, String environment, DiagnosticResult result) {
try { try {
if ("dev".equals(environment)) { if ("local".equals(environment)) {
String tenantCertPath = "dev/wechat/" + tenantId; String tenantCertPath = "dev/wechat/" + tenantId;
String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile(); String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile();

View File

@@ -103,7 +103,7 @@ public class WechatPayCertificateFixer {
* 修复证书文件问题 * 修复证书文件问题
*/ */
private void fixCertificateFiles(Payment payment, Integer tenantId, String environment, FixResult result) { private void fixCertificateFiles(Payment payment, Integer tenantId, String environment, FixResult result) {
if ("dev".equals(environment)) { if ("local".equals(environment)) {
fixDevCertificateFiles(tenantId, result); fixDevCertificateFiles(tenantId, result);
} else { } else {
fixProdCertificateFiles(payment, result); fixProdCertificateFiles(payment, result);
@@ -169,7 +169,7 @@ public class WechatPayCertificateFixer {
} }
// 在开发环境中,尝试从证书文件中提取序列号进行验证 // 在开发环境中,尝试从证书文件中提取序列号进行验证
if ("dev".equals(environment)) { if ("local".equals(environment)) {
try { try {
String tenantCertPath = "dev/wechat/" + tenantId; String tenantCertPath = "dev/wechat/" + tenantId;
String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile(); String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile();

View File

@@ -115,7 +115,7 @@ public class WechatPayConfigValidator {
* 验证证书文件 * 验证证书文件
*/ */
private void validateCertificateFiles(Integer tenantId, ValidationResult result) { private void validateCertificateFiles(Integer tenantId, ValidationResult result) {
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
// 开发环境证书验证 // 开发环境证书验证
String tenantCertPath = "dev/wechat/" + tenantId; String tenantCertPath = "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
@@ -195,7 +195,7 @@ public class WechatPayConfigValidator {
// 证书文件检查 // 证书文件检查
report.append("当前环境: ").append(activeProfile).append("\n"); report.append("当前环境: ").append(activeProfile).append("\n");
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
String tenantCertPath = "dev/wechat/" + tenantId; String tenantCertPath = "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
boolean certExists = certificateLoader.certificateExists(privateKeyPath); boolean certExists = certificateLoader.certificateExists(privateKeyPath);

View File

@@ -78,7 +78,7 @@ public class WechatPayDiagnostic {
} }
// 生产环境检查证书文件 // 生产环境检查证书文件
if (!"dev".equals(environment)) { if (!"local".equals(environment)) {
if (payment.getApiclientCert() != null) { if (payment.getApiclientCert() != null) {
log.info("商户证书文件配置: {}", payment.getApiclientCert()); log.info("商户证书文件配置: {}", payment.getApiclientCert());
} }

View File

@@ -143,7 +143,7 @@ public class SettingServiceImpl extends ServiceImpl<SettingMapper, Setting> impl
final String apiV3key = jsonObject.getString("wechatApiKey"); final String apiV3key = jsonObject.getString("wechatApiKey");
if(config == null){ if(config == null){
// 根据环境选择不同的证书路径配置 // 根据环境选择不同的证书路径配置
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
// 开发环境使用配置文件的upload-path拼接证书路径 - 租户ID 10550 // 开发环境使用配置文件的upload-path拼接证书路径 - 租户ID 10550
System.out.println("=== 开发环境使用配置文件upload-path拼接证书路径 ==="); System.out.println("=== 开发环境使用配置文件upload-path拼接证书路径 ===");
String uploadPath = pathConfig.getUploadPath(); // 获取配置的upload-path String uploadPath = pathConfig.getUploadPath(); // 获取配置的upload-path

View File

@@ -79,6 +79,7 @@ public class GltTicketTemplateController extends BaseController {
User loginUser = getLoginUser(); User loginUser = getLoginUser();
if (loginUser != null) { if (loginUser != null) {
gltTicketTemplate.setUserId(loginUser.getUserId()); gltTicketTemplate.setUserId(loginUser.getUserId());
gltTicketTemplate.setTenantId(loginUser.getTenantId());
} }
if (gltTicketTemplateService.save(gltTicketTemplate)) { if (gltTicketTemplateService.save(gltTicketTemplate)) {
return success("添加成功"); return success("添加成功");

View File

@@ -680,6 +680,12 @@ public class GltTicketOrderServiceImpl extends ServiceImpl<GltTicketOrderMapper,
return confirmed; return confirmed;
} }
/**
* 更新送水订单为已完成状态
* @param ticketOrderId
* @param tenantId
* @param now
*/
private void updateShopOrderOrderStatusAfterTicketFinished(Integer ticketOrderId, Integer tenantId, LocalDateTime now) { private void updateShopOrderOrderStatusAfterTicketFinished(Integer ticketOrderId, Integer tenantId, LocalDateTime now) {
if (ticketOrderId == null || tenantId == null) { if (ticketOrderId == null || tenantId == null) {
return; return;
@@ -690,7 +696,8 @@ public class GltTicketOrderServiceImpl extends ServiceImpl<GltTicketOrderMapper,
// 找到关联水票的商城订单glt_user_ticket.orderId / orderNo // 找到关联水票的商城订单glt_user_ticket.orderId / orderNo
GltTicketOrder ticketOrder = this.lambdaQuery() GltTicketOrder ticketOrder = this.lambdaQuery()
.select(GltTicketOrder::getId, GltTicketOrder::getUserTicketId) .select(GltTicketOrder::getId, GltTicketOrder::getUserTicketId, GltTicketOrder::getTotalNum, GltTicketOrder::getRiderId,
GltTicketOrder::getUserId, GltTicketOrder::getNo)
.eq(GltTicketOrder::getId, ticketOrderId) .eq(GltTicketOrder::getId, ticketOrderId)
.eq(GltTicketOrder::getTenantId, tenantId) .eq(GltTicketOrder::getTenantId, tenantId)
.eq(GltTicketOrder::getDeleted, 0) .eq(GltTicketOrder::getDeleted, 0)
@@ -766,6 +773,24 @@ public class GltTicketOrderServiceImpl extends ServiceImpl<GltTicketOrderMapper,
} }
} }
//生成配送师傅可提现账户分佣金额数据
int qty = ticketOrder.getTotalNum() == null ? 0 : ticketOrder.getTotalNum();
if (qty > 0) {
BigDecimal money = RIDER_UNIT_COMMISSION
.multiply(BigDecimal.valueOf(qty))
.setScale(RIDER_COMMISSION_SCALE, RoundingMode.HALF_UP);
if (money.signum() > 0) {
ShopDealerUserReduceDto reduceDto = new ShopDealerUserReduceDto();
reduceDto.setTypeEnum(ShopDealerTypeEnum.WITHDRAW_ACCOUNT);
reduceDto.setUserId(ticketOrder.getRiderId());
reduceDto.setOrderUserId(ticketOrder.getUserId());
reduceDto.setOrderNo(ticketOrder.getNo());
reduceDto.setPrice(money);
reduceDto.setUpdateEnum(ShopDealerCapitalUpdateEnum.DELIVERY_INCOME);
shopDealerUserService.reduceBalance(reduceDto);
}
}
//查询未完成订单,完成资金解冻 //查询未完成订单,完成资金解冻
LambdaQueryWrapper<ShopOrder> orderLambdaQueryWrapper; LambdaQueryWrapper<ShopOrder> orderLambdaQueryWrapper;
if(shopOrderId != null){ if(shopOrderId != null){

View File

@@ -34,7 +34,7 @@ public class GltTicketOrderAutoConfirm10584Task {
private final AtomicBoolean running = new AtomicBoolean(false); private final AtomicBoolean running = new AtomicBoolean(false);
@Scheduled(cron = "${glt.ticket-order.auto-confirm10584.cron:0/33 * * * * ?}") // @Scheduled(cron = "${glt.ticket-order.auto-confirm10584.cron:0/33 * * * * ?}")
@IgnoreTenant("定时任务无登录态,需忽略租户隔离;内部使用 tenantId=10584 精确过滤") @IgnoreTenant("定时任务无登录态,需忽略租户隔离;内部使用 tenantId=10584 精确过滤")
public void run() { public void run() {
if (!running.compareAndSet(false, true)) { if (!running.compareAndSet(false, true)) {

View File

@@ -230,7 +230,7 @@ public class PaymentConstants {
*/ */
public static class Environment { public static class Environment {
/** 开发环境 */ /** 开发环境 */
public static final String DEV = "dev"; public static final String DEV = "local";
/** 测试环境 */ /** 测试环境 */
public static final String TEST = "test"; public static final String TEST = "test";
/** 生产环境 */ /** 生产环境 */

View File

@@ -148,7 +148,7 @@ public class WxPayConfigService {
log.info("从数据库获取支付配置成功租户ID: {},将缓存配置", tenantId); log.info("从数据库获取支付配置成功租户ID: {},将缓存配置", tenantId);
// 开发环境下如果apiclientKey为空设置默认值 // 开发环境下如果apiclientKey为空设置默认值
if ("dev".equals(activeProfile) && if ("local".equals(activeProfile) &&
(payment.getApiclientKey() == null || payment.getApiclientKey().trim().isEmpty())) { (payment.getApiclientKey() == null || payment.getApiclientKey().trim().isEmpty())) {
log.warn("开发环境数据库配置中apiclientKey为空使用默认值租户ID: {}", tenantId); log.warn("开发环境数据库配置中apiclientKey为空使用默认值租户ID: {}", tenantId);
payment.setApiclientKey("apiclient_key.pem"); payment.setApiclientKey("apiclient_key.pem");
@@ -167,7 +167,7 @@ public class WxPayConfigService {
} }
// 数据库也没有配置 // 数据库也没有配置
if (!"dev".equals(activeProfile)) { if (!"local".equals(activeProfile)) {
throw PaymentException.systemError("微信支付配置未找到租户ID: " + tenantId + ",请检查数据库配置", null); throw PaymentException.systemError("微信支付配置未找到租户ID: " + tenantId + ",请检查数据库配置", null);
} }
@@ -237,7 +237,7 @@ public class WxPayConfigService {
*/ */
private Config createWxPayConfig(Payment payment, String certificatePath) throws PaymentException { private Config createWxPayConfig(Payment payment, String certificatePath) throws PaymentException {
try { try {
if ("dev".equals(activeProfile) && payment == null) { if ("local".equals(activeProfile) && payment == null) {
// 开发环境测试配置 // 开发环境测试配置
return createDevTestConfig(certificatePath); return createDevTestConfig(certificatePath);
} else if (payment != null) { } else if (payment != null) {
@@ -343,7 +343,7 @@ public class WxPayConfigService {
// 开发环境下如果apiclientKey为空给一个警告但不抛异常 // 开发环境下如果apiclientKey为空给一个警告但不抛异常
// 生产环境必须有apiclientKey // 生产环境必须有apiclientKey
if (payment.getApiclientKey() == null || payment.getApiclientKey().trim().isEmpty()) { if (payment.getApiclientKey() == null || payment.getApiclientKey().trim().isEmpty()) {
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
log.warn("开发环境:证书文件名(apiclientKey)未配置,将使用默认值"); log.warn("开发环境:证书文件名(apiclientKey)未配置,将使用默认值");
} else { } else {
throw PaymentException.systemError("证书文件名(apiclientKey)未配置", null); throw PaymentException.systemError("证书文件名(apiclientKey)未配置", null);

View File

@@ -78,7 +78,7 @@ public class WxPayConstants {
public static final int AMOUNT_MULTIPLIER = 100; public static final int AMOUNT_MULTIPLIER = 100;
/** 开发环境标识 */ /** 开发环境标识 */
public static final String PROFILE_DEV = "dev"; public static final String PROFILE_DEV = "local";
/** 生产环境标识 */ /** 生产环境标识 */
public static final String PROFILE_PROD = "prod"; public static final String PROFILE_PROD = "prod";
} }

View File

@@ -43,9 +43,9 @@ public class ShopFlashSaleActivityController extends BaseController {
@Operation(summary = "个人获取秒杀活动数据") @Operation(summary = "个人获取秒杀活动数据")
@GetMapping("/getMyActive") @GetMapping("/getMyActive")
public ApiResult<List<ShopFlashSaleActivityVO>> getMyActive(@RequestParam("tenantId") Integer tenantId) { public ApiResult<List<ShopFlashSaleActivityVO>> getMyActive(@RequestParam("tenantId") Integer tenantId, Integer popFlag) {
// 使用关联查询 // 使用关联查询
return success(shopFlashSaleActivityService.getMyActive(tenantId)); return success(shopFlashSaleActivityService.getMyActive(tenantId, popFlag));
} }
// @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')") // @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')")
@@ -59,9 +59,9 @@ public class ShopFlashSaleActivityController extends BaseController {
// @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')") // @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')")
@Operation(summary = "根据id查询秒杀活动") @Operation(summary = "根据id查询秒杀活动")
@GetMapping("/{id}") @GetMapping("/{id}")
public ApiResult<ShopFlashSaleActivity> get(@PathVariable("id") Integer id) { public ApiResult<ShopFlashSaleActivityVO> get(@PathVariable("id") Integer id) {
// 使用关联查询 // 使用关联查询
return success(shopFlashSaleActivityService.getByIdRel(id)); return success(shopFlashSaleActivityService.getInfoById(id));
} }
// @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:save')") // @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:save')")

View File

@@ -20,6 +20,7 @@ import com.gxwebsoft.common.system.entity.User;
import com.gxwebsoft.common.system.redis.OrderNoUtils; import com.gxwebsoft.common.system.redis.OrderNoUtils;
import com.gxwebsoft.glt.service.GltTicketIssueService; import com.gxwebsoft.glt.service.GltTicketIssueService;
import com.gxwebsoft.glt.service.GltTicketRevokeService; import com.gxwebsoft.glt.service.GltTicketRevokeService;
import com.gxwebsoft.glt.task.DealerOrderSettlement10584Task;
import com.gxwebsoft.payment.dto.PaymentResponse; import com.gxwebsoft.payment.dto.PaymentResponse;
import com.gxwebsoft.payment.enums.PaymentType; import com.gxwebsoft.payment.enums.PaymentType;
import com.gxwebsoft.payment.service.PaymentService; import com.gxwebsoft.payment.service.PaymentService;
@@ -114,6 +115,8 @@ public class ShopOrderController extends BaseController {
private GltTicketIssueService gltTicketIssueService; private GltTicketIssueService gltTicketIssueService;
@Resource @Resource
private OrderNoUtils orderNoUtils; private OrderNoUtils orderNoUtils;
@Resource
private DealerOrderSettlement10584Task dealerOrderSettlement;
@Operation(summary = "分页查询订单") @Operation(summary = "分页查询订单")
@GetMapping("/page") @GetMapping("/page")
@@ -805,7 +808,7 @@ public class ShopOrderController extends BaseController {
if (config == null) { if (config == null) {
try { try {
NotificationConfig newConfig; NotificationConfig newConfig;
if (active.equals("dev")) { if (active.equals("local")) {
// 开发环境 - 构建包含租户号的私钥路径 // 开发环境 - 构建包含租户号的私钥路径
String tenantCertPath = "dev/wechat/" + tenantId; String tenantCertPath = "dev/wechat/" + tenantId;
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
@@ -975,6 +978,20 @@ public class ShopOrderController extends BaseController {
return success(Boolean.TRUE); return success(Boolean.TRUE);
} }
@Operation(summary = "支付成功发送水票", description = "支付成功发送水票")
@PutMapping("/suerTicketRelease")
public ApiResult<Boolean> suerTicketRelease(@RequestBody PaySuccessTaskDto taskDto){
gltTicketIssueService.suerTicketRelease(taskDto.getOrderNo(), taskDto.getTenantId());
return success(Boolean.TRUE);
}
@Operation(summary = "支付成功结算", description = "支付成功结算")
@PutMapping("/orderSettlement")
public ApiResult<Boolean> orderSettlement(@RequestBody PaySuccessTaskDto taskDto){
dealerOrderSettlement.orderSettlement(taskDto.getOrderNo());
return success(Boolean.TRUE);
}
@Operation(summary = "更新订单支付状态", description = "用户支付成功后主动同步订单状态") @Operation(summary = "更新订单支付状态", description = "用户支付成功后主动同步订单状态")
@PutMapping("/payment-status") @PutMapping("/payment-status")
public ApiResult<?> updateOrderPaymentStatus(@RequestBody UpdatePaymentStatusRequest request) { public ApiResult<?> updateOrderPaymentStatus(@RequestBody UpdatePaymentStatusRequest request) {

View File

@@ -78,6 +78,9 @@ public class ShopFlashSaleActivity implements Serializable {
@Schema(description = "排序") @Schema(description = "排序")
private Integer sortNumber; private Integer sortNumber;
@Schema(description = "是否弹窗 0-否 1-是")
private Integer popFlag;
@Schema(description = "租户id") @Schema(description = "租户id")
private Integer tenantId; private Integer tenantId;

View File

@@ -1,12 +1,11 @@
package com.gxwebsoft.shop.entity; package com.gxwebsoft.shop.entity;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serializable; import java.io.Serializable;
@@ -174,9 +173,6 @@ public class ShopGoods implements Serializable {
@Schema(description = "用户ID") @Schema(description = "用户ID")
private Integer userId; private Integer userId;
@Schema(description = "租户id")
private Integer tenantId;
@Schema(description = "配送方式:1-自配送 2-自提 4-发快递 多属性用','隔开") @Schema(description = "配送方式:1-自配送 2-自提 4-发快递 多属性用','隔开")
private String deliveryType; private String deliveryType;
@@ -186,12 +182,28 @@ public class ShopGoods implements Serializable {
@Schema(description = "水票ID") @Schema(description = "水票ID")
private Integer waterTickerId; private Integer waterTickerId;
@Schema(description = "商品大类 1-水 2-茶叶 3-酒 4-香水")
private Integer categoryType;
@Schema(description = "租户id")
private Integer tenantId;
@Schema(description = "创建人")
private Integer creator;
@Schema(description = "创建时间") @Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime; private LocalDateTime createTime;
@Schema(description = "修改人")
private Integer updater;
@Schema(description = "修改时间") @Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime; private LocalDateTime updateTime;
@Schema(description = "是否删除 0-未删 1-已删")
@TableLogic
private Integer deleted;
} }

View File

@@ -110,6 +110,9 @@
<if test="param.deleted != null"> <if test="param.deleted != null">
AND a.deleted = #{param.deleted} AND a.deleted = #{param.deleted}
</if> </if>
<if test="param.waterTicketFlag != null">
AND a.water_ticket_flag = #{param.waterTicketFlag}
</if>
<if test="param.deleted == null"> <if test="param.deleted == null">
AND a.deleted = 0 AND a.deleted = 0
</if> </if>

View File

@@ -69,6 +69,9 @@ public class ShopFlashSaleActivityParam extends BaseParam {
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer sortNumber; private Integer sortNumber;
@Schema(description = "是否弹窗 0-否 1-是")
private Integer popFlag;
@Schema(description = "创建者") @Schema(description = "创建者")
private String creator; private String creator;

View File

@@ -1,15 +1,17 @@
package com.gxwebsoft.shop.param; package com.gxwebsoft.shop.param;
import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.gxwebsoft.common.core.annotation.QueryField; import com.gxwebsoft.common.core.annotation.QueryField;
import com.gxwebsoft.common.core.annotation.QueryType; import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam; 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 io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/** /**
* 商品查询参数 * 商品查询参数
* *
@@ -158,4 +160,33 @@ public class ShopGoodsParam extends BaseParam {
@QueryField(type = QueryType.EQ) @QueryField(type = QueryType.EQ)
private Integer deliveryMode; private Integer deliveryMode;
@Schema(description = "配送方式:1-自配送 2-自提 4-发快递 多属性用','隔开")
private String deliveryType;
@Schema(description = "水票标识 0-否 1-是")
private Integer waterTicketFlag;
@Schema(description = "水票ID")
private Integer waterTickerId;
@Schema(description = "商品大类 1-水 2-茶叶 3-酒 4-香水")
private Integer categoryType;
@Schema(description = "租户id")
private Integer tenantId;
@Schema(description = "创建人")
private Integer creator;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
@Schema(description = "修改人")
private Integer updater;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
} }

View File

@@ -24,6 +24,13 @@ public interface ShopFlashSaleActivityService extends IService<ShopFlashSaleActi
*/ */
PageResult<ShopFlashSaleActivityVO> pageRel(ShopFlashSaleActivityParam param); PageResult<ShopFlashSaleActivityVO> pageRel(ShopFlashSaleActivityParam param);
/**
* 查询详情
* @param id
* @return
*/
ShopFlashSaleActivityVO getInfoById(Integer id);
/** /**
* 关联查询全部 * 关联查询全部
* *
@@ -45,7 +52,7 @@ public interface ShopFlashSaleActivityService extends IService<ShopFlashSaleActi
* @param tenantId 租户ID * @param tenantId 租户ID
* @return * @return
*/ */
List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId); List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId, Integer popFlag);
/** /**
* 修改秒杀活动状态 * 修改秒杀活动状态

View File

@@ -167,7 +167,6 @@ public class ShopDealerUserServiceImpl extends ServiceImpl<ShopDealerUserMapper,
dealerUser.setTotalMoney(dealerUser.getTotalMoney().add(price)); dealerUser.setTotalMoney(dealerUser.getTotalMoney().add(price));
baseMapper.updateById(dealerUser); baseMapper.updateById(dealerUser);
//4.2 生成流水 //4.2 生成流水
ShopDealerCapital dealerCapital = new ShopDealerCapital(); ShopDealerCapital dealerCapital = new ShopDealerCapital();
dealerCapital.setNo(no); dealerCapital.setNo(no);

View File

@@ -64,6 +64,23 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl<ShopFlashSaleA
return new PageResult<>(list, page.getTotal()); return new PageResult<>(list, page.getTotal());
} }
@Override
public ShopFlashSaleActivityVO getInfoById(Integer id) {
ShopFlashSaleActivity saleActivity = baseMapper.selectById(id);
ShopFlashSaleActivityVO result = BeanUtil.toBean(saleActivity, ShopFlashSaleActivityVO.class);
if(result.getGoodsId() != null){
ShopGoods shopGood = shopGoodsMapper.selectById(result.getGoodsId());
if(shopGood != null){
result.setGoodsPrice(shopGood.getPrice());
result.setGoodsTotalPrice(shopGood.getPrice().multiply(new BigDecimal(result.getNum())));
result.setGoodsName(shopGood.getName());
result.setImage(shopGood.getImage());
result.setUnitName(shopGood.getUnitName());
}
}
return result;
}
@Override @Override
public List<ShopFlashSaleActivity> listRel(ShopFlashSaleActivityParam param) { public List<ShopFlashSaleActivity> listRel(ShopFlashSaleActivityParam param) {
List<ShopFlashSaleActivity> list = baseMapper.selectListRel(param); List<ShopFlashSaleActivity> list = baseMapper.selectListRel(param);
@@ -81,14 +98,13 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl<ShopFlashSaleA
} }
@Override @Override
public List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId) { public List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId, Integer popFlag) {
List<ShopFlashSaleActivityVO> resultVOList = new ArrayList<>(); List<ShopFlashSaleActivityVO> resultVOList = new ArrayList<>();
User loginUser = LoginUserUtil.getLoginUser(); User loginUser = LoginUserUtil.getLoginUser();
if(loginUser == null){ if(loginUser == null){
throw new BusinessException(GlobalErrorCodeConstants.UNAUTHORIZED.getMsg()); throw new BusinessException(GlobalErrorCodeConstants.UNAUTHORIZED.getMsg());
} }
Boolean newUser = true; Boolean newUser = true;
//判断是否为新用户【只要未成功下单都判定为新用户】 //判断是否为新用户【只要未成功下单都判定为新用户】
LambdaQueryWrapper<ShopOrder> shopOrderLambdaQueryWrapper = new LambdaQueryWrapper<ShopOrder>().eq(ShopOrder::getUserId, loginUser.getUserId()).eq(ShopOrder::getPayStatus, 1) LambdaQueryWrapper<ShopOrder> shopOrderLambdaQueryWrapper = new LambdaQueryWrapper<ShopOrder>().eq(ShopOrder::getUserId, loginUser.getUserId()).eq(ShopOrder::getPayStatus, 1)
@@ -101,6 +117,9 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl<ShopFlashSaleA
//查询满足条件的活动数据 //查询满足条件的活动数据
LambdaQueryChainWrapper<ShopFlashSaleActivity> activityWrapper = lambdaQuery().eq(ShopFlashSaleActivity::getStatus, 0).gt(ShopFlashSaleActivity::getStock, 0).eq(ShopFlashSaleActivity::getTenantId, tenantId) LambdaQueryChainWrapper<ShopFlashSaleActivity> activityWrapper = lambdaQuery().eq(ShopFlashSaleActivity::getStatus, 0).gt(ShopFlashSaleActivity::getStock, 0).eq(ShopFlashSaleActivity::getTenantId, tenantId)
.apply("NOW() BETWEEN start_time AND end_time"); .apply("NOW() BETWEEN start_time AND end_time");
if(popFlag != null){
activityWrapper.eq(ShopFlashSaleActivity::getPopFlag, popFlag);
}
Map<Integer, Integer> activityMap = new HashMap<>(); Map<Integer, Integer> activityMap = new HashMap<>();
if(!newUser){ if(!newUser){

View File

@@ -276,7 +276,7 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
urls.add(legacySystem); urls.add(legacySystem);
} }
if ("dev".equals(active)) { if ("local".equals(active)) {
String devNotify = devShopOrderNotifyUrl(order.getTenantId()); String devNotify = devShopOrderNotifyUrl(order.getTenantId());
if (StrUtil.isNotBlank(devNotify)) { if (StrUtil.isNotBlank(devNotify)) {
urls.add(devNotify); urls.add(devNotify);
@@ -651,11 +651,6 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
throw new RuntimeException("订单金额为null"); throw new RuntimeException("订单金额为null");
} }
// 测试环境使用1分钱
if ("dev".equals(active)) {
money = 1;
}
// 构建Native支付请求 // 构建Native支付请求
com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest request = com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest request =
new com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest(); new com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest();
@@ -710,13 +705,6 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
} }
} }
// 开发环境固定使用1分钱与历史行为保持一致
if ("dev".equals(active)) {
amount.setTotal(1);
request.setAmount(amount);
snapshot.setTotal(1);
}
// 回调地址:优先用快照;若重入提示参数不一致,则尝试历史回调地址 // 回调地址:优先用快照;若重入提示参数不一致,则尝试历史回调地址
Exception last = null; Exception last = null;
String notifyUrlUsed = null; String notifyUrlUsed = null;
@@ -1236,7 +1224,7 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
// 构建微信支付配置 // 构建微信支付配置
Config config = null; Config config = null;
if (active.equals("dev")) { if (active.equals("local")) {
// 开发环境使用自动证书配置 // 开发环境使用自动证书配置
// 首先初始化私钥路径 // 首先初始化私钥路径
tenantCertPath = "dev/wechat/" + order.getTenantId(); tenantCertPath = "dev/wechat/" + order.getTenantId();
@@ -1590,7 +1578,7 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
String pubKey = null; String pubKey = null;
// 初始化证书路径 // 初始化证书路径
if (active.equals("dev")) { if (active.equals("local")) {
// 开发环境 - 构建包含租户号的证书路径 // 开发环境 - 构建包含租户号的证书路径
String tenantCertPath = "dev/wechat/" + order.getTenantId(); String tenantCertPath = "dev/wechat/" + order.getTenantId();
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();

View File

@@ -44,7 +44,7 @@ public class CouponExpireTask {
log.info("过期优惠券处理任务完成,更新数量: {},耗时: {}ms", updatedCount, duration); log.info("过期优惠券处理任务完成,更新数量: {},耗时: {}ms", updatedCount, duration);
// 如果是开发环境,输出更详细的日志 // 如果是开发环境,输出更详细的日志
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
log.debug("开发环境 - 过期优惠券处理详情: 更新{}张优惠券", updatedCount); log.debug("开发环境 - 过期优惠券处理详情: 更新{}张优惠券", updatedCount);
} }

View File

@@ -67,7 +67,7 @@ public class OrderAutoCancelTask {
totalCancelledCount, defaultCancelledCount, tenantCancelledCount, duration); totalCancelledCount, defaultCancelledCount, tenantCancelledCount, duration);
// 开发环境输出更详细的日志 // 开发环境输出更详细的日志
if ("dev".equals(activeProfile)) { if ("local".equals(activeProfile)) {
log.debug("开发环境 - 订单自动取消详情: 总共取消{}个订单", totalCancelledCount); log.debug("开发环境 - 订单自动取消详情: 总共取消{}个订单", totalCancelledCount);
} }

View File

@@ -1,6 +1,7 @@
package com.gxwebsoft.shop.task; package com.gxwebsoft.shop.task;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.gxwebsoft.common.core.annotation.IgnoreTenant;
import com.gxwebsoft.common.core.enums.ShopDealerCapitalUpdateEnum; import com.gxwebsoft.common.core.enums.ShopDealerCapitalUpdateEnum;
import com.gxwebsoft.common.core.enums.ShopDealerTypeEnum; import com.gxwebsoft.common.core.enums.ShopDealerTypeEnum;
import com.gxwebsoft.common.system.redis.OrderNoUtils; import com.gxwebsoft.common.system.redis.OrderNoUtils;
@@ -54,6 +55,7 @@ public class OrderSettlementTask {
* 门店、服务商结算任务每天一点每10分钟执行一次结算任务 * 门店、服务商结算任务每天一点每10分钟执行一次结算任务
*/ */
@Scheduled(cron = "0 0/10 1 * * ?") @Scheduled(cron = "0 0/10 1 * * ?")
@IgnoreTenant("定时门店、服务商结算任务")
@Transactional @Transactional
public void teamSettlement(){ public void teamSettlement(){
//1.查询待结算订单信息 //1.查询待结算订单信息

View File

@@ -74,6 +74,9 @@ public class ShopFlashSaleActivityVO implements Serializable {
@Schema(description = "排序") @Schema(description = "排序")
private Integer sortNumber; private Integer sortNumber;
@Schema(description = "是否弹窗 0-否 1-是")
private Integer popFlag;
@Schema(description = "租户id") @Schema(description = "租户id")
private Integer tenantId; private Integer tenantId;

View File

@@ -254,6 +254,12 @@ coupon:
# 支付配置 # 支付配置
payment: payment:
# 开发环境配置 # 开发环境配置
local:
# 开发环境回调地址(本地调试用)
notify-url: "https://glt-dev-api.websoft.top/api/shop/shop-order/notify"
# 开发环境是否启用环境感知
environment-aware: true
dev: dev:
# 开发环境回调地址(本地调试用) # 开发环境回调地址(本地调试用)
notify-url: "https://glt-dev-api.websoft.top/api/shop/shop-order/notify" notify-url: "https://glt-dev-api.websoft.top/api/shop/shop-order/notify"

View File

@@ -16,7 +16,7 @@ import static org.junit.jupiter.api.Assertions.*;
* @since 2025-08-18 * @since 2025-08-18
*/ */
@SpringBootTest @SpringBootTest
@ActiveProfiles("dev") @ActiveProfiles("local")
public class EncryptedQrCodeUtilTest { public class EncryptedQrCodeUtilTest {
@Resource @Resource

View File

@@ -17,7 +17,7 @@ import javax.annotation.Resource;
*/ */
@Slf4j @Slf4j
@SpringBootTest @SpringBootTest
@ActiveProfiles("dev") @ActiveProfiles("local")
public class WxLoginControllerTest { public class WxLoginControllerTest {
@Resource @Resource

View File

@@ -16,7 +16,7 @@ import javax.annotation.Resource;
*/ */
@Slf4j @Slf4j
@SpringBootTest @SpringBootTest
@ActiveProfiles("dev") @ActiveProfiles("local")
public class UserIgnoreTenantTest { public class UserIgnoreTenantTest {
@Resource @Resource

View File

@@ -20,7 +20,7 @@ import java.util.List;
*/ */
@Slf4j @Slf4j
@SpringBootTest @SpringBootTest
@ActiveProfiles("dev") @ActiveProfiles("local")
public class WeixinConfigTest { public class WeixinConfigTest {
@Resource @Resource

View File

@@ -14,7 +14,7 @@ import javax.annotation.Resource;
* @since 2025-07-02 * @since 2025-07-02
*/ */
@SpringBootTest @SpringBootTest
@ActiveProfiles("dev") @ActiveProfiles("local")
public class MqttPropertiesTest { public class MqttPropertiesTest {
@Resource @Resource

View File

@@ -13,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.*;
* 验证server-url配置是否正确从配置文件读取 * 验证server-url配置是否正确从配置文件读取
*/ */
@SpringBootTest @SpringBootTest
@ActiveProfiles("dev") @ActiveProfiles("local")
public class ServerUrlConfigTest { public class ServerUrlConfigTest {
@Autowired @Autowired