ソースを参照

评价、退款优化

liude 8 ヶ月 前
コミット
0efabb5411

+ 2 - 1
vehicle-client/src/main/java/com/chelvc/cloud/vehicle/client/CurrencyRecordClient.java

@@ -1,5 +1,6 @@
 package com.chelvc.cloud.vehicle.client;
 
+import java.time.LocalDate;
 import java.util.List;
 
 import com.chelvc.cloud.vehicle.client.dto.CurrencyRecordDTO;
@@ -22,7 +23,7 @@ public interface CurrencyRecordClient {
      * @return 收益流水记录列表
      */
     @GetMapping("/currencyRecord/listCurrencyRecord")
-    List<CurrencyRecordDTO> listCurrencyRecord(@RequestParam("type") Integer type);
+    List<CurrencyRecordDTO> listCurrencyRecord(@RequestParam("type") Integer type, LocalDate date);
 
     /**
      * 获取用户得总收益、本周收益、本月收益、可提现金额

+ 3 - 2
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/controller/CurrencyRecordController.java

@@ -1,5 +1,6 @@
 package com.chelvc.cloud.vehicle.server.controller;
 
+import java.time.LocalDate;
 import java.util.List;
 
 import com.chelvc.cloud.vehicle.client.dto.CurrencyRecordDTO;
@@ -29,8 +30,8 @@ public class CurrencyRecordController {
      * @return 收益流水记录列表
      */
     @GetMapping("/currencyRecord/listCurrencyRecord")
-    public List<CurrencyRecordDTO> listCurrencyRecord(@RequestParam("type") Integer type) {
-        return currencyRecordService.listCurrencyRecord(type);
+    public List<CurrencyRecordDTO> listCurrencyRecord(@RequestParam("type") Integer type, LocalDate date) {
+        return currencyRecordService.listCurrencyRecord(type,date);
     }
 
     /**

+ 2 - 1
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/CurrencyRecordService.java

@@ -6,6 +6,7 @@ import com.chelvc.cloud.vehicle.client.dto.EarningsDTO;
 import com.chelvc.cloud.vehicle.server.entity.CurrencyRecord;
 
 import java.math.BigDecimal;
+import java.time.LocalDate;
 import java.util.List;
 
 /**
@@ -35,7 +36,7 @@ public interface CurrencyRecordService extends IService<CurrencyRecord> {
      * 收益流水记录
      * @return 收益流水记录列表
      */
-    List<CurrencyRecordDTO> listCurrencyRecord(Integer type);
+    List<CurrencyRecordDTO> listCurrencyRecord(Integer type, LocalDate date);
 
     /**
      * 获取用户得总收益、本周收益、本月收益、可提现金额

+ 11 - 2
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/CurrencyRecordServiceImpl.java

@@ -10,13 +10,18 @@ import com.chelvc.cloud.vehicle.server.entity.CurrencyRecord;
 import com.chelvc.cloud.vehicle.server.service.AssetService;
 import com.chelvc.cloud.vehicle.server.service.CurrencyRecordService;
 import com.chelvc.framework.base.context.SessionContextHolder;
+import com.chelvc.framework.common.util.DateUtils;
+import com.chelvc.framework.common.util.StringUtils;
 import lombok.RequiredArgsConstructor;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.text.Format;
+import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 收益流水记录表操作接口
@@ -31,13 +36,17 @@ public class CurrencyRecordServiceImpl extends ServiceImpl<CurrencyRecordMapper,
     private final AssetService assetService;
 
      @Override
-     public List<CurrencyRecordDTO> listCurrencyRecord(Integer type){
+     public List<CurrencyRecordDTO> listCurrencyRecord(Integer type, LocalDate date){
       Long userId = SessionContextHolder.getId();
          List<CurrencyRecord> currencyRecords = this.lambdaQuery()
                  .eq(CurrencyRecord::getUserId,userId)
                  .eq(CurrencyRecord::getType, type)
                  .list();
-      return CurrencyRecordCopier.INSTANCE.copying(currencyRecords);
+         List<CurrencyRecordDTO> list = CurrencyRecordCopier.INSTANCE.copying(currencyRecords);
+         List<CurrencyRecordDTO> filteredPeople = list.stream()
+                 .filter(item -> !DateUtils.format(item.getCreateTime()).equals(DateUtils.format(date)))
+                 .collect(Collectors.toList());
+         return filteredPeople;
      }
     @Override
     public EarningsDTO getCurrencyRecord(Integer type){