Browse Source

消费分异动修正退款退回消费分的数额

Yangzw 6 months ago
parent
commit
2a244a4eb6

+ 10 - 0
feifan-module-distri/feifan-module-distri-biz/src/main/java/cn/newfeifan/mall/module/distri/service/consumptionerrorlog/ConsumptionErrorLogServiceImpl.java

@@ -187,7 +187,17 @@ public class ConsumptionErrorLogServiceImpl implements ConsumptionErrorLogServic
                                 Long::sum // 累加函数
                         )
                 ));
+        // 扣除退款退回的
+        Map<Long, Long> refundMap = consumptionChangeLogService.selectListByStatus(ConsumptionEnum.REFUND_ORDER.getType()).stream()
+                .collect(Collectors.groupingBy(
+                        ConsumptionChangeLogDO::getUserId, // 按userid分组
+                        Collectors.reducing(0L, // 初始化累加器
+                                ConsumptionChangeLogDO::getConsumptionPoints, // 获取每个对象的consumptionPoints
+                                Long::sum // 累加函数
+                        )
+                ));
         uesdMap.forEach((k, v) -> uesdMap.put(k, v * -1));
+        refundMap.forEach((k, v) -> uesdMap.put(k,  uesdMap.get(k) - v));
 
         // 用户转让的消费分(出账)
         Map<Long, Long> transferLogMap = consumptionTransferLogService.selectList().stream()

+ 7 - 1
feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/service/auth/AdminAuthServiceImpl.java

@@ -116,7 +116,13 @@ public class AdminAuthServiceImpl implements AdminAuthService {
             throw exception(AUTH_MOBILE_NOT_EXISTS);
         }
         // 发送验证码
-        smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO).setCreateIp(getClientIP()));
+        String clientIP;
+        if(reqVO.getScene().equals(SmsSceneEnum.CONSUMPTION_POINTS_ERROR_WARNING.getScene())){
+            clientIP = "192.168.0.110";
+        }else{
+            clientIP = getClientIP();
+        }
+        smsCodeApi.sendSmsCode(AuthConvert.INSTANCE.convert(reqVO).setCreateIp(clientIP));
     }
 
     @Override