Преглед изворни кода

fix(backend): 修复远程提交遗漏的编译错误(sourceType/log/log) [skip ci]

Xiaogang Liao пре 2 дана
родитељ
комит
e478889395

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

@@ -1661,7 +1661,7 @@ public class EnergyService {
         elog.setCreatedAt(new Date());
         energyLogMapper.insert(elog);
         // 发送能量扣除通知
-        try { sendEnergyDeductionNotification(memberId, sourceType != null ? sourceType : "manual", amount, reason); } catch (Exception e) { log.warn("energy deduction notification failed", e); }
+        try { sendEnergyDeductionNotification(memberId, "manual", amount, reason); } catch (Exception e) { log.warn("energy deduction notification failed", e); }
         return balance.getBalance();
     }
 

+ 2 - 0
cfc-backend/src/main/java/com/etotem/cfc/service/KeyPersonService.java

@@ -19,7 +19,9 @@ import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
+import lombok.extern.slf4j.Slf4j;
 
+@Slf4j
 @Service
 public class KeyPersonService {
 

+ 23 - 23
cfc-backend/src/main/java/com/etotem/cfc/service/PointsService.java

@@ -89,13 +89,13 @@ public class PointsService implements PointsServiceInterface {
         familyMemberMapper.updateById(child);
 
         // 记录流水
-        PointsLog log = new PointsLog();
-        log.setChildId(memberId);
-        log.setAmount(amount);
-        log.setType("adjust");
-        log.setDescription(reason);
-        log.setCreatedAt(new Date());
-        pointsLogMapper.insert(log);
+        PointsLog plog = new PointsLog();
+        plog.setChildId(memberId);
+        plog.setAmount(amount);
+        plog.setType("adjust");
+        plog.setDescription(reason);
+        plog.setCreatedAt(new Date());
+        pointsLogMapper.insert(plog);
         try { sendPointsNotification(memberId, "adjust", amount, reason); } catch (Exception e) { log.warn("points notification failed", e); }
 
         Map<String, Object> result = new HashMap<>();
@@ -121,14 +121,14 @@ public class PointsService implements PointsServiceInterface {
         child.setUpdatedAt(new Date());
         familyMemberMapper.updateById(child);
 
-        PointsLog log = new PointsLog();
-        log.setChildId(memberId);
-        log.setAmount(amount);
-        log.setType("earn");
-        log.setCategory("cf");
-        log.setDescription(reason);
-        log.setCreatedAt(new Date());
-        pointsLogMapper.insert(log);
+        PointsLog plog = new PointsLog();
+        plog.setChildId(memberId);
+        plog.setAmount(amount);
+        plog.setType("earn");
+        plog.setCategory("cf");
+        plog.setDescription(reason);
+        plog.setCreatedAt(new Date());
+        pointsLogMapper.insert(plog);
         try { sendPointsNotification(memberId, "cf_earn", amount, reason); } catch (Exception e) { log.warn("cf notification failed", e); }
 
         return newCfPoints;
@@ -179,14 +179,14 @@ public class PointsService implements PointsServiceInterface {
         child.setUpdatedAt(new Date());
         familyMemberMapper.updateById(child);
 
-        PointsLog log = new PointsLog();
-        log.setChildId(memberId);
-        log.setAmount(-amount);
-        log.setType("spend");
-        log.setCategory("cf");
-        log.setDescription(reason);
-        log.setCreatedAt(new Date());
-        pointsLogMapper.insert(log);
+        PointsLog plog = new PointsLog();
+        plog.setChildId(memberId);
+        plog.setAmount(-amount);
+        plog.setType("spend");
+        plog.setCategory("cf");
+        plog.setDescription(reason);
+        plog.setCreatedAt(new Date());
+        pointsLogMapper.insert(plog);
         try { sendPointsNotification(memberId, "cf_spend", -amount, reason); } catch (Exception e) { log.warn("cf deduction notification failed", e); }
 
         return newCfPoints;