Просмотр исходного кода

chore: auto bump version and changelog [skip ci]

iwt 1 месяц назад
Родитель
Сommit
f15079405f

+ 13 - 0
cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

@@ -10496,5 +10496,18 @@ public class DatabaseInitializer implements CommandLineRunner {
         } catch (Exception e) {
         } catch (Exception e) {
             log.warn("迁移299: 插入新人引导任务模板失败或已存在: {}", e.getMessage());
             log.warn("迁移299: 插入新人引导任务模板失败或已存在: {}", e.getMessage());
         }
         }
+
+        // 迁移301: platform_balance_log 加 (user_id, ref_type, ref_id) 唯一索引(earn 幂等 DB 兜底,防止并发重复发放)
+        try {
+            jdbcTemplate.execute("DELETE l1 FROM platform_balance_log l1 " +
+                    "INNER JOIN platform_balance_log l2 ON l1.user_id = l2.user_id " +
+                    "AND l1.ref_type = l2.ref_type AND l1.ref_id = l2.ref_id AND l1.id > l2.id " +
+                    "WHERE l1.ref_id IS NOT NULL AND l1.ref_type IS NOT NULL");
+            log.info("迁移301: platform_balance_log 历史重复流水已清理");
+            jdbcTemplate.execute("ALTER TABLE platform_balance_log ADD UNIQUE KEY uk_user_ref (user_id, ref_type, ref_id)");
+            log.info("迁移301: platform_balance_log 已添加 uk_user_ref 唯一索引");
+        } catch (Exception e) {
+            log.warn("迁移301: platform_balance_log 唯一索引处理失败: {}", e.getMessage());
+        }
     }
     }
 }
 }

+ 3 - 3
cfc-backend/src/main/java/com/etotem/cfc/controller/CfTransferController.java

@@ -54,9 +54,9 @@ public class CfTransferController {
         if (from.getFamilyId() == null || !from.getFamilyId().equals(to.getFamilyId())) {
         if (from.getFamilyId() == null || !from.getFamilyId().equals(to.getFamilyId())) {
             return Result.error("仅限同一家庭成员间转让");
             return Result.error("仅限同一家庭成员间转让");
         }
         }
-        // 每次转让使用唯一 refId(避免 earn 幂等键 (ref_type, ref_id) 碰撞)
-        Long transferRefId = UUID.randomUUID().getMostSignificantBits();
-        if (transferRefId == null || transferRefId == 0) transferRefId = System.currentTimeMillis();
+        // 每次转让使用唯一 refId(避免 earn 幂等键 (ref_type, ref_id) 碰撞),并保证非负
+        Long transferRefId = UUID.randomUUID().getMostSignificantBits() & Long.MAX_VALUE;
+        if (transferRefId == 0) transferRefId = System.currentTimeMillis();
         // 转出扣减 + 转入增加(同一事务)
         // 转出扣减 + 转入增加(同一事务)
         platformPointsService.spend(fromUserId, amount, "cf_transfer_out", transferRefId,
         platformPointsService.spend(fromUserId, amount, "cf_transfer_out", transferRefId,
                 "转给成员: " + (to.getNickname() == null ? toUserId : to.getNickname()));
                 "转给成员: " + (to.getNickname() == null ? toUserId : to.getNickname()));

+ 3 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/CommissionDistService.java

@@ -25,7 +25,10 @@ import com.etotem.cfc.util.SortUtil;
  * 
  * 
  * 分润公式:
  * 分润公式:
  *   推荐人分得P点 = sourcePpoint × profitSharePercent / 100
  *   推荐人分得P点 = sourcePpoint × profitSharePercent / 100
+ *
+ * @deprecated 已由 CfCommissionService 统一 CF 值分佣替代,本服务不再被业务订单调用,保留历史数据读取。
  */
  */
+@Deprecated
 @Service
 @Service
 public class CommissionDistService {
 public class CommissionDistService {
 
 

+ 0 - 8
cfc-backend/src/main/java/com/etotem/cfc/service/MemberSubscriptionService.java

@@ -6,11 +6,9 @@ import com.etotem.cfc.entity.Family;
 import com.etotem.cfc.entity.MemberSubscription;
 import com.etotem.cfc.entity.MemberSubscription;
 import com.etotem.cfc.entity.MemberSubscriptionOrder;
 import com.etotem.cfc.entity.MemberSubscriptionOrder;
 import com.etotem.cfc.entity.SubscriptionBenefitLog;
 import com.etotem.cfc.entity.SubscriptionBenefitLog;
-import com.etotem.cfc.entity.User;
 import com.etotem.cfc.mapper.FamilyMapper;
 import com.etotem.cfc.mapper.FamilyMapper;
 import com.etotem.cfc.mapper.MemberSubscriptionMapper;
 import com.etotem.cfc.mapper.MemberSubscriptionMapper;
 import com.etotem.cfc.mapper.MemberSubscriptionOrderMapper;
 import com.etotem.cfc.mapper.MemberSubscriptionOrderMapper;
-import com.etotem.cfc.mapper.UserMapper;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
@@ -34,12 +32,6 @@ public class MemberSubscriptionService {
     @Resource
     @Resource
     private CfCommissionService cfCommissionService;
     private CfCommissionService cfCommissionService;
 
 
-    @Resource
-    private PromotionTierService promotionTierService;
-
-    @Resource
-    private UserMapper userMapper;
-
     @Resource
     @Resource
     private ButlerService butlerService;
     private ButlerService butlerService;
 
 

+ 1 - 1
cfc-backend/src/main/java/com/etotem/cfc/service/ProductOrderService.java

@@ -800,7 +800,7 @@ public class ProductOrderService {
             for (ProductOrderGift gift : pendingGifts) {
             for (ProductOrderGift gift : pendingGifts) {
                 if ("cf".equals(gift.getGiftType()) && gift.getCfValue() != null && gift.getCfValue() > 0) {
                 if ("cf".equals(gift.getGiftType()) && gift.getCfValue() != null && gift.getCfValue() > 0) {
                     platformPointsService.earn(order.getBuyerId(), gift.getCfValue(),
                     platformPointsService.earn(order.getBuyerId(), gift.getCfValue(),
-                            "product_gift", order.getId(),
+                            "product_gift", gift.getId(),
                             "购买商品赠品: " + (gift.getGiftProductName() != null ? gift.getGiftProductName() : "CF值"));
                             "购买商品赠品: " + (gift.getGiftProductName() != null ? gift.getGiftProductName() : "CF值"));
                 } else if ("product".equals(gift.getGiftType()) && gift.getGiftProductId() != null) {
                 } else if ("product".equals(gift.getGiftType()) && gift.getGiftProductId() != null) {
                     int qty = gift.getQuantity() != null ? gift.getQuantity() : 1;
                     int qty = gift.getQuantity() != null ? gift.getQuantity() : 1;

+ 2 - 1
cfc-backend/src/main/resources/schema.sql

@@ -4769,7 +4769,8 @@ CREATE TABLE IF NOT EXISTS platform_balance_log (
     ref_id        BIGINT       COMMENT '关联业务ID',
     ref_id        BIGINT       COMMENT '关联业务ID',
     remark        VARCHAR(255) COMMENT '备注',
     remark        VARCHAR(255) COMMENT '备注',
     created_at    DATETIME,
     created_at    DATETIME,
-    INDEX idx_user_time (user_id, created_at)
+    INDEX idx_user_time (user_id, created_at),
+    UNIQUE KEY uk_user_ref (user_id, ref_type, ref_id)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='CF值流水';
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='CF值流水';
 
 
 
 

+ 1 - 1
cfc-web/.last_build_commit

@@ -1 +1 @@
-6b17e8719d191a41a671fee907668b39e7d3a39a
+3ba6fb9b3a40251bf760dc41707647869cc24f71

+ 2 - 2
cfc-web/package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "cfc-web",
   "name": "cfc-web",
-  "version": "1.0.1314",
+  "version": "1.0.1315",
   "lockfileVersion": 3,
   "lockfileVersion": 3,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "cfc-web",
       "name": "cfc-web",
-      "version": "1.0.1314",
+      "version": "1.0.1315",
       "dependencies": {
       "dependencies": {
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor": "^5.1.23",
         "@wangeditor/editor-for-vue": "^1.0.2",
         "@wangeditor/editor-for-vue": "^1.0.2",

+ 1 - 1
cfc-web/package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "cfc-web",
   "name": "cfc-web",
-  "version": "1.0.1315",
+  "version": "1.0.1316",
   "private": true,
   "private": true,
   "scripts": {
   "scripts": {
     "dev": "vue-cli-service serve",
     "dev": "vue-cli-service serve",

+ 6 - 0
cfc-web/public/CHANGELOG-v1.0.md

@@ -4,6 +4,12 @@
 
 
 ---
 ---
 
 
+## v1.0.1316 (2026-09-06)
+
+### 新功能
+- 首页 Next Best Action 引导条 - 解决首屏'不知道该干啥'
+
+
 ## v1.0.1315 (2026-09-06)
 ## v1.0.1315 (2026-09-06)
 
 
 ### 文档
 ### 文档

+ 7 - 1
cfc-web/public/CHANGELOG.md

@@ -1,6 +1,6 @@
 # 更新日志
 # 更新日志
 
 
-> 当前版本: v1.0.1315
+> 当前版本: v1.0.1316
 
 
 ## 历史版本
 ## 历史版本
 
 
@@ -8,6 +8,12 @@
 
 
 ---
 ---
 
 
+## v1.0.1316 (2026-09-06)
+
+### 新功能
+- 首页 Next Best Action 引导条 - 解决首屏'不知道该干啥'
+
+
 ## v1.0.1315 (2026-09-06)
 ## v1.0.1315 (2026-09-06)
 
 
 ### 文档
 ### 文档