From b5d4274d975a419e7885e3b90664c0941a05bb69 Mon Sep 17 00:00:00 2001 From: xm <1350250847@qq.com> Date: Tue, 19 May 2026 10:32:17 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E3=80=81=E6=9C=AC=E5=9C=B0=E7=8E=AF=E5=A2=83=E8=AF=81=E4=B9=A6?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E8=B7=AF=E5=BE=84=E4=B8=9A=E5=8A=A1=202?= =?UTF-8?q?=E3=80=81=E4=BC=98=E5=8C=96=E9=85=8D=E9=80=81=E7=BB=93=E7=AE=97?= =?UTF-8?q?=E4=B8=9A=E5=8A=A1=EF=BC=8C=E9=85=8D=E9=80=81=E5=AE=8C=E6=88=90?= =?UTF-8?q?=E5=8D=B3=E8=AE=A1=E7=AE=97=203=E3=80=81=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=97=A8=E5=BA=97=E3=80=81=E6=9C=8D=E5=8A=A1=E5=95=86=E7=BB=93?= =?UTF-8?q?=E7=AE=97=E4=BB=BB=E5=8A=A1=204=E3=80=81=E7=A7=92=E6=9D=80?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E5=A2=9E=E5=8A=A0=E5=BC=B9=E7=AA=97=E4=B8=9A?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/config/CertificateProperties.java | 2 +- .../controller/DatabaseFixController.java | 2 +- .../controller/DevEnvironmentController.java | 2 +- .../EnvironmentAwarePaymentService.java | 4 +- .../core/utils/WechatCertAutoConfig.java | 2 +- .../utils/WechatPayCertificateDiagnostic.java | 4 +- .../core/utils/WechatPayCertificateFixer.java | 4 +- .../core/utils/WechatPayConfigValidator.java | 4 +- .../core/utils/WechatPayDiagnostic.java | 2 +- .../service/impl/SettingServiceImpl.java | 2 +- .../GltTicketTemplateController.java | 1 + .../impl/GltTicketOrderServiceImpl.java | 27 +++++++++++++- .../GltTicketOrderAutoConfirm10584Task.java | 2 +- .../payment/constants/PaymentConstants.java | 2 +- .../payment/service/WxPayConfigService.java | 8 ++-- .../shop/constants/WxPayConstants.java | 2 +- .../ShopFlashSaleActivityController.java | 8 ++-- .../shop/controller/ShopOrderController.java | 19 +++++++++- .../shop/entity/ShopFlashSaleActivity.java | 3 ++ .../com/gxwebsoft/shop/entity/ShopGoods.java | 26 +++++++++---- .../shop/mapper/xml/ShopGoodsMapper.xml | 3 ++ .../param/ShopFlashSaleActivityParam.java | 3 ++ .../gxwebsoft/shop/param/ShopGoodsParam.java | 37 +++++++++++++++++-- .../service/ShopFlashSaleActivityService.java | 9 ++++- .../impl/ShopDealerUserServiceImpl.java | 1 - .../ShopFlashSaleActivityServiceImpl.java | 23 +++++++++++- .../service/impl/ShopOrderServiceImpl.java | 18 ++------- .../gxwebsoft/shop/task/CouponExpireTask.java | 2 +- .../shop/task/OrderAutoCancelTask.java | 2 +- .../shop/task/OrderSettlementTask.java | 2 + .../shop/vo/ShopFlashSaleActivityVO.java | 3 ++ src/main/resources/application.yml | 6 +++ .../core/utils/EncryptedQrCodeUtilTest.java | 2 +- .../controller/WxLoginControllerTest.java | 2 +- .../system/service/UserIgnoreTenantTest.java | 2 +- .../system/service/WeixinConfigTest.java | 2 +- .../gxwebsoft/config/MqttPropertiesTest.java | 2 +- .../gxwebsoft/config/ServerUrlConfigTest.java | 2 +- 38 files changed, 183 insertions(+), 64 deletions(-) diff --git a/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java b/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java index a13c9d3..e669ee9 100644 --- a/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java +++ b/src/main/java/com/gxwebsoft/common/core/config/CertificateProperties.java @@ -32,7 +32,7 @@ public class CertificateProperties { /** * 开发环境证书路径前缀 */ - private String devCertPath = "dev"; + private String devCertPath = "local"; /** * 微信支付证书配置 diff --git a/src/main/java/com/gxwebsoft/common/core/controller/DatabaseFixController.java b/src/main/java/com/gxwebsoft/common/core/controller/DatabaseFixController.java index 166e9cd..fdd0ec1 100644 --- a/src/main/java/com/gxwebsoft/common/core/controller/DatabaseFixController.java +++ b/src/main/java/com/gxwebsoft/common/core/controller/DatabaseFixController.java @@ -30,7 +30,7 @@ import java.util.Map; @Tag(name = "数据库修复工具") @RestController @RequestMapping("/api/database-fix") -// @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev") +// @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "local") public class DatabaseFixController extends BaseController { @Autowired diff --git a/src/main/java/com/gxwebsoft/common/core/controller/DevEnvironmentController.java b/src/main/java/com/gxwebsoft/common/core/controller/DevEnvironmentController.java index 8e30a34..c2f5894 100644 --- a/src/main/java/com/gxwebsoft/common/core/controller/DevEnvironmentController.java +++ b/src/main/java/com/gxwebsoft/common/core/controller/DevEnvironmentController.java @@ -28,7 +28,7 @@ import java.util.Map; @Tag(name = "开发环境管理") @RestController @RequestMapping("/api/dev") -// @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "dev") +// @ConditionalOnProperty(name = "spring.profiles.active", havingValue = "local") public class DevEnvironmentController extends BaseController { @Autowired diff --git a/src/main/java/com/gxwebsoft/common/core/service/EnvironmentAwarePaymentService.java b/src/main/java/com/gxwebsoft/common/core/service/EnvironmentAwarePaymentService.java index c8bdf53..25829f5 100644 --- a/src/main/java/com/gxwebsoft/common/core/service/EnvironmentAwarePaymentService.java +++ b/src/main/java/com/gxwebsoft/common/core/service/EnvironmentAwarePaymentService.java @@ -70,7 +70,7 @@ public class EnvironmentAwarePaymentService { * 根据当前环境获取回调地址 */ private String getEnvironmentNotifyUrl() { - if ("dev".equals(activeProfile) || "test".equals(activeProfile)) { + if ("local".equals(activeProfile) || "test".equals(activeProfile)) { // 开发/测试环境使用本地回调地址 return devNotifyUrl; } else if ("prod".equals(activeProfile)) { @@ -135,7 +135,7 @@ public class EnvironmentAwarePaymentService { * 是否为开发环境 */ public boolean isDevelopmentEnvironment() { - return "dev".equals(activeProfile) || "test".equals(activeProfile); + return "local".equals(activeProfile) || "test".equals(activeProfile); } /** diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java index 75b0a22..3f0f432 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatCertAutoConfig.java @@ -84,7 +84,7 @@ public class WechatCertAutoConfig { String apiV3Key = "0kF5OlPr482EZwtn9zGufUcqa7ovgxRL"; // 根据环境选择证书路径 - if ("dev".equals(activeProfile)) { + if ("local".equals(activeProfile)) { // 开发环境:使用配置文件upload-path拼接证书路径 String uploadPath = configProperties.getUploadPath(); // 配置文件路径 String tenantId = "10550"; // 租户ID diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java index ebe8189..81e2e9e 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateDiagnostic.java @@ -105,7 +105,7 @@ public class WechatPayCertificateDiagnostic { * 检查证书文件 */ 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 privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); @@ -152,7 +152,7 @@ public class WechatPayCertificateDiagnostic { */ private void validateCertificateContent(Payment payment, Integer tenantId, String environment, DiagnosticResult result) { try { - if ("dev".equals(environment)) { + if ("local".equals(environment)) { String tenantCertPath = "dev/wechat/" + tenantId; String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile(); diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateFixer.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateFixer.java index af6e357..b29918e 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateFixer.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayCertificateFixer.java @@ -103,7 +103,7 @@ public class WechatPayCertificateFixer { * 修复证书文件问题 */ private void fixCertificateFiles(Payment payment, Integer tenantId, String environment, FixResult result) { - if ("dev".equals(environment)) { + if ("local".equals(environment)) { fixDevCertificateFiles(tenantId, result); } else { fixProdCertificateFiles(payment, result); @@ -169,7 +169,7 @@ public class WechatPayCertificateFixer { } // 在开发环境中,尝试从证书文件中提取序列号进行验证 - if ("dev".equals(environment)) { + if ("local".equals(environment)) { try { String tenantCertPath = "dev/wechat/" + tenantId; String apiclientCertPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getApiclientCertFile(); diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java index 23326d2..eb26d62 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayConfigValidator.java @@ -115,7 +115,7 @@ public class WechatPayConfigValidator { * 验证证书文件 */ private void validateCertificateFiles(Integer tenantId, ValidationResult result) { - if ("dev".equals(activeProfile)) { + if ("local".equals(activeProfile)) { // 开发环境证书验证 String tenantCertPath = "dev/wechat/" + tenantId; String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); @@ -195,7 +195,7 @@ public class WechatPayConfigValidator { // 证书文件检查 report.append("当前环境: ").append(activeProfile).append("\n"); - if ("dev".equals(activeProfile)) { + if ("local".equals(activeProfile)) { String tenantCertPath = "dev/wechat/" + tenantId; String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); boolean certExists = certificateLoader.certificateExists(privateKeyPath); diff --git a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java index 620d506..a623586 100644 --- a/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java +++ b/src/main/java/com/gxwebsoft/common/core/utils/WechatPayDiagnostic.java @@ -78,7 +78,7 @@ public class WechatPayDiagnostic { } // 生产环境检查证书文件 - if (!"dev".equals(environment)) { + if (!"local".equals(environment)) { if (payment.getApiclientCert() != null) { log.info("商户证书文件配置: {}", payment.getApiclientCert()); } diff --git a/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java b/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java index f72ab1d..e48d7d8 100644 --- a/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java +++ b/src/main/java/com/gxwebsoft/common/system/service/impl/SettingServiceImpl.java @@ -143,7 +143,7 @@ public class SettingServiceImpl extends ServiceImpl impl final String apiV3key = jsonObject.getString("wechatApiKey"); if(config == null){ // 根据环境选择不同的证书路径配置 - if ("dev".equals(activeProfile)) { + if ("local".equals(activeProfile)) { // 开发环境:使用配置文件的upload-path拼接证书路径 - 租户ID 10550 System.out.println("=== 开发环境:使用配置文件upload-path拼接证书路径 ==="); String uploadPath = pathConfig.getUploadPath(); // 获取配置的upload-path diff --git a/src/main/java/com/gxwebsoft/glt/controller/GltTicketTemplateController.java b/src/main/java/com/gxwebsoft/glt/controller/GltTicketTemplateController.java index fb07151..488e7b9 100644 --- a/src/main/java/com/gxwebsoft/glt/controller/GltTicketTemplateController.java +++ b/src/main/java/com/gxwebsoft/glt/controller/GltTicketTemplateController.java @@ -79,6 +79,7 @@ public class GltTicketTemplateController extends BaseController { User loginUser = getLoginUser(); if (loginUser != null) { gltTicketTemplate.setUserId(loginUser.getUserId()); + gltTicketTemplate.setTenantId(loginUser.getTenantId()); } if (gltTicketTemplateService.save(gltTicketTemplate)) { return success("添加成功"); diff --git a/src/main/java/com/gxwebsoft/glt/service/impl/GltTicketOrderServiceImpl.java b/src/main/java/com/gxwebsoft/glt/service/impl/GltTicketOrderServiceImpl.java index c22951d..9c509a5 100644 --- a/src/main/java/com/gxwebsoft/glt/service/impl/GltTicketOrderServiceImpl.java +++ b/src/main/java/com/gxwebsoft/glt/service/impl/GltTicketOrderServiceImpl.java @@ -680,6 +680,12 @@ public class GltTicketOrderServiceImpl extends ServiceImpl 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 orderLambdaQueryWrapper; if(shopOrderId != null){ diff --git a/src/main/java/com/gxwebsoft/glt/task/GltTicketOrderAutoConfirm10584Task.java b/src/main/java/com/gxwebsoft/glt/task/GltTicketOrderAutoConfirm10584Task.java index 4866fce..ae4d0ee 100644 --- a/src/main/java/com/gxwebsoft/glt/task/GltTicketOrderAutoConfirm10584Task.java +++ b/src/main/java/com/gxwebsoft/glt/task/GltTicketOrderAutoConfirm10584Task.java @@ -34,7 +34,7 @@ public class GltTicketOrderAutoConfirm10584Task { 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 精确过滤") public void run() { if (!running.compareAndSet(false, true)) { diff --git a/src/main/java/com/gxwebsoft/payment/constants/PaymentConstants.java b/src/main/java/com/gxwebsoft/payment/constants/PaymentConstants.java index 80f0354..ffd8c2c 100644 --- a/src/main/java/com/gxwebsoft/payment/constants/PaymentConstants.java +++ b/src/main/java/com/gxwebsoft/payment/constants/PaymentConstants.java @@ -230,7 +230,7 @@ public class PaymentConstants { */ public static class Environment { /** 开发环境 */ - public static final String DEV = "dev"; + public static final String DEV = "local"; /** 测试环境 */ public static final String TEST = "test"; /** 生产环境 */ diff --git a/src/main/java/com/gxwebsoft/payment/service/WxPayConfigService.java b/src/main/java/com/gxwebsoft/payment/service/WxPayConfigService.java index db72082..b61fdb5 100644 --- a/src/main/java/com/gxwebsoft/payment/service/WxPayConfigService.java +++ b/src/main/java/com/gxwebsoft/payment/service/WxPayConfigService.java @@ -148,7 +148,7 @@ public class WxPayConfigService { log.info("从数据库获取支付配置成功,租户ID: {},将缓存配置", tenantId); // 开发环境下,如果apiclientKey为空,设置默认值 - if ("dev".equals(activeProfile) && + if ("local".equals(activeProfile) && (payment.getApiclientKey() == null || payment.getApiclientKey().trim().isEmpty())) { log.warn("开发环境:数据库配置中apiclientKey为空,使用默认值,租户ID: {}", tenantId); 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); } @@ -237,7 +237,7 @@ public class WxPayConfigService { */ private Config createWxPayConfig(Payment payment, String certificatePath) throws PaymentException { try { - if ("dev".equals(activeProfile) && payment == null) { + if ("local".equals(activeProfile) && payment == null) { // 开发环境测试配置 return createDevTestConfig(certificatePath); } else if (payment != null) { @@ -343,7 +343,7 @@ public class WxPayConfigService { // 开发环境下,如果apiclientKey为空,给一个警告但不抛异常 // 生产环境必须有apiclientKey if (payment.getApiclientKey() == null || payment.getApiclientKey().trim().isEmpty()) { - if ("dev".equals(activeProfile)) { + if ("local".equals(activeProfile)) { log.warn("开发环境:证书文件名(apiclientKey)未配置,将使用默认值"); } else { throw PaymentException.systemError("证书文件名(apiclientKey)未配置", null); diff --git a/src/main/java/com/gxwebsoft/shop/constants/WxPayConstants.java b/src/main/java/com/gxwebsoft/shop/constants/WxPayConstants.java index 1618dd8..8d6eb84 100644 --- a/src/main/java/com/gxwebsoft/shop/constants/WxPayConstants.java +++ b/src/main/java/com/gxwebsoft/shop/constants/WxPayConstants.java @@ -78,7 +78,7 @@ public class WxPayConstants { 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"; } diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopFlashSaleActivityController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopFlashSaleActivityController.java index dc2e0c9..9ddac55 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopFlashSaleActivityController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopFlashSaleActivityController.java @@ -43,9 +43,9 @@ public class ShopFlashSaleActivityController extends BaseController { @Operation(summary = "个人获取秒杀活动数据") @GetMapping("/getMyActive") - public ApiResult> getMyActive(@RequestParam("tenantId") Integer tenantId) { + public ApiResult> getMyActive(@RequestParam("tenantId") Integer tenantId, Integer popFlag) { // 使用关联查询 - return success(shopFlashSaleActivityService.getMyActive(tenantId)); + return success(shopFlashSaleActivityService.getMyActive(tenantId, popFlag)); } // @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')") @@ -59,9 +59,9 @@ public class ShopFlashSaleActivityController extends BaseController { // @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')") @Operation(summary = "根据id查询秒杀活动") @GetMapping("/{id}") - public ApiResult get(@PathVariable("id") Integer id) { + public ApiResult get(@PathVariable("id") Integer id) { // 使用关联查询 - return success(shopFlashSaleActivityService.getByIdRel(id)); + return success(shopFlashSaleActivityService.getInfoById(id)); } // @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:save')") diff --git a/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java b/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java index 4a375be..15c4298 100644 --- a/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java +++ b/src/main/java/com/gxwebsoft/shop/controller/ShopOrderController.java @@ -20,6 +20,7 @@ import com.gxwebsoft.common.system.entity.User; import com.gxwebsoft.common.system.redis.OrderNoUtils; import com.gxwebsoft.glt.service.GltTicketIssueService; import com.gxwebsoft.glt.service.GltTicketRevokeService; +import com.gxwebsoft.glt.task.DealerOrderSettlement10584Task; import com.gxwebsoft.payment.dto.PaymentResponse; import com.gxwebsoft.payment.enums.PaymentType; import com.gxwebsoft.payment.service.PaymentService; @@ -114,6 +115,8 @@ public class ShopOrderController extends BaseController { private GltTicketIssueService gltTicketIssueService; @Resource private OrderNoUtils orderNoUtils; + @Resource + private DealerOrderSettlement10584Task dealerOrderSettlement; @Operation(summary = "分页查询订单") @GetMapping("/page") @@ -805,7 +808,7 @@ public class ShopOrderController extends BaseController { if (config == null) { try { NotificationConfig newConfig; - if (active.equals("dev")) { + if (active.equals("local")) { // 开发环境 - 构建包含租户号的私钥路径 String tenantCertPath = "dev/wechat/" + tenantId; String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile(); @@ -975,6 +978,20 @@ public class ShopOrderController extends BaseController { return success(Boolean.TRUE); } + @Operation(summary = "支付成功发送水票", description = "支付成功发送水票") + @PutMapping("/suerTicketRelease") + public ApiResult suerTicketRelease(@RequestBody PaySuccessTaskDto taskDto){ + gltTicketIssueService.suerTicketRelease(taskDto.getOrderNo(), taskDto.getTenantId()); + return success(Boolean.TRUE); + } + + @Operation(summary = "支付成功结算", description = "支付成功结算") + @PutMapping("/orderSettlement") + public ApiResult orderSettlement(@RequestBody PaySuccessTaskDto taskDto){ + dealerOrderSettlement.orderSettlement(taskDto.getOrderNo()); + return success(Boolean.TRUE); + } + @Operation(summary = "更新订单支付状态", description = "用户支付成功后主动同步订单状态") @PutMapping("/payment-status") public ApiResult updateOrderPaymentStatus(@RequestBody UpdatePaymentStatusRequest request) { diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopFlashSaleActivity.java b/src/main/java/com/gxwebsoft/shop/entity/ShopFlashSaleActivity.java index 7420d0f..41d06b2 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopFlashSaleActivity.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopFlashSaleActivity.java @@ -78,6 +78,9 @@ public class ShopFlashSaleActivity implements Serializable { @Schema(description = "排序") private Integer sortNumber; + @Schema(description = "是否弹窗 0-否 1-是") + private Integer popFlag; + @Schema(description = "租户id") private Integer tenantId; diff --git a/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java b/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java index 0b942d7..4b67efb 100644 --- a/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java +++ b/src/main/java/com/gxwebsoft/shop/entity/ShopGoods.java @@ -1,12 +1,11 @@ package com.gxwebsoft.shop.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.*; + import java.time.LocalDateTime; -import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonAlias; import com.fasterxml.jackson.annotation.JsonFormat; import java.io.Serializable; @@ -174,9 +173,6 @@ public class ShopGoods implements Serializable { @Schema(description = "用户ID") private Integer userId; - @Schema(description = "租户id") - private Integer tenantId; - @Schema(description = "配送方式:1-自配送 2-自提 4-发快递 多属性用','隔开") private String deliveryType; @@ -186,12 +182,28 @@ public class ShopGoods implements Serializable { @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; + @Schema(description = "是否删除 0-未删 1-已删") + @TableLogic + private Integer deleted; + } diff --git a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGoodsMapper.xml b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGoodsMapper.xml index 0f57c75..3a74a14 100644 --- a/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGoodsMapper.xml +++ b/src/main/java/com/gxwebsoft/shop/mapper/xml/ShopGoodsMapper.xml @@ -110,6 +110,9 @@ AND a.deleted = #{param.deleted} + + AND a.water_ticket_flag = #{param.waterTicketFlag} + AND a.deleted = 0 diff --git a/src/main/java/com/gxwebsoft/shop/param/ShopFlashSaleActivityParam.java b/src/main/java/com/gxwebsoft/shop/param/ShopFlashSaleActivityParam.java index 02cf4a1..fba65fd 100644 --- a/src/main/java/com/gxwebsoft/shop/param/ShopFlashSaleActivityParam.java +++ b/src/main/java/com/gxwebsoft/shop/param/ShopFlashSaleActivityParam.java @@ -69,6 +69,9 @@ public class ShopFlashSaleActivityParam extends BaseParam { @QueryField(type = QueryType.EQ) private Integer sortNumber; + @Schema(description = "是否弹窗 0-否 1-是") + private Integer popFlag; + @Schema(description = "创建者") private String creator; diff --git a/src/main/java/com/gxwebsoft/shop/param/ShopGoodsParam.java b/src/main/java/com/gxwebsoft/shop/param/ShopGoodsParam.java index a1f1880..fd38ccc 100644 --- a/src/main/java/com/gxwebsoft/shop/param/ShopGoodsParam.java +++ b/src/main/java/com/gxwebsoft/shop/param/ShopGoodsParam.java @@ -1,15 +1,17 @@ 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.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; +import java.math.BigDecimal; +import java.time.LocalDateTime; + /** * 商品查询参数 * @@ -158,4 +160,33 @@ public class ShopGoodsParam extends BaseParam { @QueryField(type = QueryType.EQ) 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; + } diff --git a/src/main/java/com/gxwebsoft/shop/service/ShopFlashSaleActivityService.java b/src/main/java/com/gxwebsoft/shop/service/ShopFlashSaleActivityService.java index eee7133..5cad0a0 100644 --- a/src/main/java/com/gxwebsoft/shop/service/ShopFlashSaleActivityService.java +++ b/src/main/java/com/gxwebsoft/shop/service/ShopFlashSaleActivityService.java @@ -24,6 +24,13 @@ public interface ShopFlashSaleActivityService extends IService pageRel(ShopFlashSaleActivityParam param); + /** + * 查询详情 + * @param id + * @return + */ + ShopFlashSaleActivityVO getInfoById(Integer id); + /** * 关联查询全部 * @@ -45,7 +52,7 @@ public interface ShopFlashSaleActivityService extends IService getMyActive(Integer tenantId); + List getMyActive(Integer tenantId, Integer popFlag); /** * 修改秒杀活动状态 diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerUserServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerUserServiceImpl.java index a11d677..85417b8 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerUserServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopDealerUserServiceImpl.java @@ -167,7 +167,6 @@ public class ShopDealerUserServiceImpl extends ServiceImpl(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 public List listRel(ShopFlashSaleActivityParam param) { List list = baseMapper.selectListRel(param); @@ -81,14 +98,13 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl getMyActive(Integer tenantId) { + public List getMyActive(Integer tenantId, Integer popFlag) { List resultVOList = new ArrayList<>(); User loginUser = LoginUserUtil.getLoginUser(); if(loginUser == null){ throw new BusinessException(GlobalErrorCodeConstants.UNAUTHORIZED.getMsg()); } - Boolean newUser = true; //判断是否为新用户【只要未成功下单都判定为新用户】 LambdaQueryWrapper shopOrderLambdaQueryWrapper = new LambdaQueryWrapper().eq(ShopOrder::getUserId, loginUser.getUserId()).eq(ShopOrder::getPayStatus, 1) @@ -101,6 +117,9 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl activityWrapper = lambdaQuery().eq(ShopFlashSaleActivity::getStatus, 0).gt(ShopFlashSaleActivity::getStock, 0).eq(ShopFlashSaleActivity::getTenantId, tenantId) .apply("NOW() BETWEEN start_time AND end_time"); + if(popFlag != null){ + activityWrapper.eq(ShopFlashSaleActivity::getPopFlag, popFlag); + } Map activityMap = new HashMap<>(); if(!newUser){ diff --git a/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java b/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java index f5bf420..031d161 100644 --- a/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java +++ b/src/main/java/com/gxwebsoft/shop/service/impl/ShopOrderServiceImpl.java @@ -276,7 +276,7 @@ public class ShopOrderServiceImpl extends ServiceImpl