1、修改测试、本地环境证书加载路径业务
2、优化配送结算业务,配送完成即计算 3、优化门店、服务商结算任务 4、秒杀活动增加弹窗业务
This commit is contained in:
@@ -32,7 +32,7 @@ public class CertificateProperties {
|
||||
/**
|
||||
* 开发环境证书路径前缀
|
||||
*/
|
||||
private String devCertPath = "dev";
|
||||
private String devCertPath = "local";
|
||||
|
||||
/**
|
||||
* 微信支付证书配置
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class WechatPayDiagnostic {
|
||||
}
|
||||
|
||||
// 生产环境检查证书文件
|
||||
if (!"dev".equals(environment)) {
|
||||
if (!"local".equals(environment)) {
|
||||
if (payment.getApiclientCert() != null) {
|
||||
log.info("商户证书文件配置: {}", payment.getApiclientCert());
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class SettingServiceImpl extends ServiceImpl<SettingMapper, Setting> 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
|
||||
|
||||
@@ -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("添加成功");
|
||||
|
||||
@@ -680,6 +680,12 @@ public class GltTicketOrderServiceImpl extends ServiceImpl<GltTicketOrderMapper,
|
||||
return confirmed;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新送水订单为已完成状态
|
||||
* @param ticketOrderId
|
||||
* @param tenantId
|
||||
* @param now
|
||||
*/
|
||||
private void updateShopOrderOrderStatusAfterTicketFinished(Integer ticketOrderId, Integer tenantId, LocalDateTime now) {
|
||||
if (ticketOrderId == null || tenantId == null) {
|
||||
return;
|
||||
@@ -690,7 +696,8 @@ public class GltTicketOrderServiceImpl extends ServiceImpl<GltTicketOrderMapper,
|
||||
|
||||
// 找到关联水票的商城订单(glt_user_ticket.orderId / orderNo)
|
||||
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::getTenantId, tenantId)
|
||||
.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;
|
||||
if(shopOrderId != null){
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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";
|
||||
/** 生产环境 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ public class ShopFlashSaleActivityController extends BaseController {
|
||||
|
||||
@Operation(summary = "个人获取秒杀活动数据")
|
||||
@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')")
|
||||
@@ -59,9 +59,9 @@ public class ShopFlashSaleActivityController extends BaseController {
|
||||
// @PreAuthorize("hasAuthority('shop:shopFlashSaleActivity:list')")
|
||||
@Operation(summary = "根据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')")
|
||||
|
||||
@@ -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<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 = "用户支付成功后主动同步订单状态")
|
||||
@PutMapping("/payment-status")
|
||||
public ApiResult<?> updateOrderPaymentStatus(@RequestBody UpdatePaymentStatusRequest request) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -110,6 +110,9 @@
|
||||
<if test="param.deleted != null">
|
||||
AND a.deleted = #{param.deleted}
|
||||
</if>
|
||||
<if test="param.waterTicketFlag != null">
|
||||
AND a.water_ticket_flag = #{param.waterTicketFlag}
|
||||
</if>
|
||||
<if test="param.deleted == null">
|
||||
AND a.deleted = 0
|
||||
</if>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -24,6 +24,13 @@ public interface ShopFlashSaleActivityService extends IService<ShopFlashSaleActi
|
||||
*/
|
||||
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
|
||||
* @return
|
||||
*/
|
||||
List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId);
|
||||
List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId, Integer popFlag);
|
||||
|
||||
/**
|
||||
* 修改秒杀活动状态
|
||||
|
||||
@@ -167,7 +167,6 @@ public class ShopDealerUserServiceImpl extends ServiceImpl<ShopDealerUserMapper,
|
||||
dealerUser.setTotalMoney(dealerUser.getTotalMoney().add(price));
|
||||
baseMapper.updateById(dealerUser);
|
||||
|
||||
|
||||
//4.2 生成流水
|
||||
ShopDealerCapital dealerCapital = new ShopDealerCapital();
|
||||
dealerCapital.setNo(no);
|
||||
|
||||
@@ -64,6 +64,23 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl<ShopFlashSaleA
|
||||
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
|
||||
public List<ShopFlashSaleActivity> listRel(ShopFlashSaleActivityParam param) {
|
||||
List<ShopFlashSaleActivity> list = baseMapper.selectListRel(param);
|
||||
@@ -81,14 +98,13 @@ public class ShopFlashSaleActivityServiceImpl extends ServiceImpl<ShopFlashSaleA
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId) {
|
||||
public List<ShopFlashSaleActivityVO> getMyActive(Integer tenantId, Integer popFlag) {
|
||||
List<ShopFlashSaleActivityVO> resultVOList = new ArrayList<>();
|
||||
User loginUser = LoginUserUtil.getLoginUser();
|
||||
if(loginUser == null){
|
||||
throw new BusinessException(GlobalErrorCodeConstants.UNAUTHORIZED.getMsg());
|
||||
}
|
||||
|
||||
|
||||
Boolean newUser = true;
|
||||
//判断是否为新用户【只要未成功下单都判定为新用户】
|
||||
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)
|
||||
.apply("NOW() BETWEEN start_time AND end_time");
|
||||
if(popFlag != null){
|
||||
activityWrapper.eq(ShopFlashSaleActivity::getPopFlag, popFlag);
|
||||
}
|
||||
|
||||
Map<Integer, Integer> activityMap = new HashMap<>();
|
||||
if(!newUser){
|
||||
|
||||
@@ -276,7 +276,7 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
|
||||
urls.add(legacySystem);
|
||||
}
|
||||
|
||||
if ("dev".equals(active)) {
|
||||
if ("local".equals(active)) {
|
||||
String devNotify = devShopOrderNotifyUrl(order.getTenantId());
|
||||
if (StrUtil.isNotBlank(devNotify)) {
|
||||
urls.add(devNotify);
|
||||
@@ -651,11 +651,6 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
|
||||
throw new RuntimeException("订单金额为null");
|
||||
}
|
||||
|
||||
// 测试环境使用1分钱
|
||||
if ("dev".equals(active)) {
|
||||
money = 1;
|
||||
}
|
||||
|
||||
// 构建Native支付请求
|
||||
com.wechat.pay.java.service.payments.nativepay.model.PrepayRequest request =
|
||||
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;
|
||||
String notifyUrlUsed = null;
|
||||
@@ -1236,7 +1224,7 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
|
||||
|
||||
// 构建微信支付配置
|
||||
Config config = null;
|
||||
if (active.equals("dev")) {
|
||||
if (active.equals("local")) {
|
||||
// 开发环境使用自动证书配置
|
||||
// 首先初始化私钥路径
|
||||
tenantCertPath = "dev/wechat/" + order.getTenantId();
|
||||
@@ -1590,7 +1578,7 @@ public class ShopOrderServiceImpl extends ServiceImpl<ShopOrderMapper, ShopOrder
|
||||
String pubKey = null;
|
||||
|
||||
// 初始化证书路径
|
||||
if (active.equals("dev")) {
|
||||
if (active.equals("local")) {
|
||||
// 开发环境 - 构建包含租户号的证书路径
|
||||
String tenantCertPath = "dev/wechat/" + order.getTenantId();
|
||||
String privateKeyPath = tenantCertPath + "/" + certConfig.getWechatPay().getDev().getPrivateKeyFile();
|
||||
|
||||
@@ -44,7 +44,7 @@ public class CouponExpireTask {
|
||||
log.info("过期优惠券处理任务完成,更新数量: {},耗时: {}ms", updatedCount, duration);
|
||||
|
||||
// 如果是开发环境,输出更详细的日志
|
||||
if ("dev".equals(activeProfile)) {
|
||||
if ("local".equals(activeProfile)) {
|
||||
log.debug("开发环境 - 过期优惠券处理详情: 更新{}张优惠券", updatedCount);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class OrderAutoCancelTask {
|
||||
totalCancelledCount, defaultCancelledCount, tenantCancelledCount, duration);
|
||||
|
||||
// 开发环境输出更详细的日志
|
||||
if ("dev".equals(activeProfile)) {
|
||||
if ("local".equals(activeProfile)) {
|
||||
log.debug("开发环境 - 订单自动取消详情: 总共取消{}个订单", totalCancelledCount);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gxwebsoft.shop.task;
|
||||
|
||||
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.ShopDealerTypeEnum;
|
||||
import com.gxwebsoft.common.system.redis.OrderNoUtils;
|
||||
@@ -54,6 +55,7 @@ public class OrderSettlementTask {
|
||||
* 门店、服务商结算任务:每天一点,每10分钟执行一次结算任务
|
||||
*/
|
||||
@Scheduled(cron = "0 0/10 1 * * ?")
|
||||
@IgnoreTenant("定时门店、服务商结算任务")
|
||||
@Transactional
|
||||
public void teamSettlement(){
|
||||
//1.查询待结算订单信息
|
||||
|
||||
@@ -74,6 +74,9 @@ public class ShopFlashSaleActivityVO implements Serializable {
|
||||
@Schema(description = "排序")
|
||||
private Integer sortNumber;
|
||||
|
||||
@Schema(description = "是否弹窗 0-否 1-是")
|
||||
private Integer popFlag;
|
||||
|
||||
@Schema(description = "租户id")
|
||||
private Integer tenantId;
|
||||
|
||||
|
||||
@@ -254,6 +254,12 @@ coupon:
|
||||
# 支付配置
|
||||
payment:
|
||||
# 开发环境配置
|
||||
local:
|
||||
# 开发环境回调地址(本地调试用)
|
||||
notify-url: "https://glt-dev-api.websoft.top/api/shop/shop-order/notify"
|
||||
# 开发环境是否启用环境感知
|
||||
environment-aware: true
|
||||
|
||||
dev:
|
||||
# 开发环境回调地址(本地调试用)
|
||||
notify-url: "https://glt-dev-api.websoft.top/api/shop/shop-order/notify"
|
||||
|
||||
@@ -16,7 +16,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
* @since 2025-08-18
|
||||
*/
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("local")
|
||||
public class EncryptedQrCodeUtilTest {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -17,7 +17,7 @@ import javax.annotation.Resource;
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("local")
|
||||
public class WxLoginControllerTest {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -16,7 +16,7 @@ import javax.annotation.Resource;
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("local")
|
||||
public class UserIgnoreTenantTest {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -20,7 +20,7 @@ import java.util.List;
|
||||
*/
|
||||
@Slf4j
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("local")
|
||||
public class WeixinConfigTest {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -14,7 +14,7 @@ import javax.annotation.Resource;
|
||||
* @since 2025-07-02
|
||||
*/
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("local")
|
||||
public class MqttPropertiesTest {
|
||||
|
||||
@Resource
|
||||
|
||||
@@ -13,7 +13,7 @@ import static org.junit.jupiter.api.Assertions.*;
|
||||
* 验证server-url配置是否正确从配置文件读取
|
||||
*/
|
||||
@SpringBootTest
|
||||
@ActiveProfiles("dev")
|
||||
@ActiveProfiles("local")
|
||||
public class ServerUrlConfigTest {
|
||||
|
||||
@Autowired
|
||||
|
||||
Reference in New Issue
Block a user