Bladeren bron

1.控制台钱包金额统计总收入调整

wuhp 1 jaar geleden
bovenliggende
commit
13058237d8

+ 3 - 1
src/main/java/com/ydtech/modules/admin/controller/CompanyDataReportConroller.java

@@ -7,6 +7,7 @@ import com.ydtech.modules.admin.model.vo.OrdersDataVo;
 import com.ydtech.modules.admin.model.vo.TaskStatisticsVo;
 import com.ydtech.modules.admin.service.CompanyDataReportService;
 import com.ydtech.modules.admin.utils.KztGetDeptUtils;
+import com.ydtech.modules.base.controller.BaseController;
 import com.ydtech.modules.order.entity.BasePageResult;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -125,6 +126,7 @@ public class CompanyDataReportConroller {
     @PostMapping("/largeOrdersExcel")
     @ApiOperation(value = "大订单导出")
     public HttpResult largeOrdersExcel(@RequestBody OrdersDataVo ordersDataVo) {
-        return this.companyDataReportService.largeOrdersExcel(ordersDataVo);
+        String userId = BaseController.getUserId();
+        return this.companyDataReportService.largeOrdersExcel(ordersDataVo,userId);
     }
 }

+ 1 - 1
src/main/java/com/ydtech/modules/admin/model/po/SysUserAccountHistory.java

@@ -51,7 +51,7 @@ public class SysUserAccountHistory implements Serializable {
     private Integer documentary;
 
     /**
-     * 金钱属性 1 手续费 2 非跟单 3 推广  4 手续费+非跟单    4 为 退款
+     * 金钱属性 1 手续费 2 非跟单 3 推广  4 手续费+非跟单    5 为 退款
      */
     @TableField(value = "property")
     private Integer property;

+ 1 - 1
src/main/java/com/ydtech/modules/admin/service/CompanyDataReportService.java

@@ -49,7 +49,7 @@ public interface CompanyDataReportService {
      * @author: whp
      * @date: 2024/9/13
      **/
-    HttpResult largeOrdersExcel(OrdersDataVo ordersDataVo);
+    HttpResult largeOrdersExcel(OrdersDataVo ordersDataVo,String userId);
 
     /**
      * @description:   控制台-小定单报价明细

+ 2 - 2
src/main/java/com/ydtech/modules/admin/service/impl/CompanyDataReportServiceImpl.java

@@ -239,7 +239,7 @@ public class CompanyDataReportServiceImpl implements CompanyDataReportService {
      **/
     @Override
     @Async
-    public HttpResult largeOrdersExcel(OrdersDataVo ordersDataVo) {
+    public HttpResult largeOrdersExcel(OrdersDataVo ordersDataVo,String userId) {
 
         //判断开始时间和结束时间是否为空,如果为空的走时间类型逻辑
         HashMap<String, String> dateMapByType = getDateMapByType(ordersDataVo.getDateType(), ordersDataVo.getBeginDate(), ordersDataVo.getEndDate());
@@ -264,7 +264,7 @@ public class CompanyDataReportServiceImpl implements CompanyDataReportService {
 //                    record.setNamesimple(dto.getNamesimple());
 //                }
 //            }
-        dateMapByType.put("userId", BaseController.getUserId());
+        dateMapByType.put("userId", userId);
 
         this.insExcelTaskAsyncService.importasync(resultSubOrder,dateMapByType);
 //        String uploadPath = this.uploadPath + "/excel/";

+ 15 - 12
src/main/java/com/ydtech/modules/admin/service/impl/DeptBalanceServiceImpl.java

@@ -407,14 +407,18 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     params.put("userId",record.getUserId());
                     params.put("phoneNumber",deptBalanceVo.getPhoneNumber());
                     HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(params);
+                    //总的 =  已提现金额+  可提现金额 +  提现中
+                    sumAmount = wtxAmount.add(sxAmount).add(ytxAmount);
 
-                    if(incomeIndication!=null){
-                        record.setTotalIncome(incomeIndication.get("totalAmount"));
+                    if (StringUtils.isNotEmpty(deptBalanceVo.getBeginDate()) || StringUtils.isNotEmpty(deptBalanceVo.getEndDate())) {
+                        if(incomeIndication!=null){
+                            record.setTotalIncome(incomeIndication.get("totalAmount"));
+                        }else {
+                            record.setTotalIncome(BigDecimal.ZERO);
+                        }
                     }else {
-                        record.setTotalIncome(BigDecimal.ZERO);
+                        record.setTotalIncome(sumAmount);
                     }
-                    //总的 =  已提现金额+  可提现金额 +  提现中
-                    sumAmount = wtxAmount.add(sxAmount).add(ytxAmount);
                     record.setWithdrawn(ytxAmount);
                     record.setNotWithdrawn(wtxAmount);
 //                    record.setTotalIncome(sumAmount);
@@ -453,15 +457,14 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                 HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(params);
                 record.setWithdrawn(ysTXAmount);
                 record.setNotWithdrawn(ssKTAmount);
-                if(incomeIndication!=null){
+                if (StringUtils.isNotEmpty(deptBalanceVo.getBeginDate()) || StringUtils.isNotEmpty(deptBalanceVo.getEndDate())) {
+                    if(incomeIndication!=null){
                         record.setTotalIncome(incomeIndication.get("totalAmount"));
-//                    if(deptBalanceVo.getManagementSource().equals("2")){
-//                        record.setTotalIncome(incomeIndication.get("totalAmount"));
-//                    }else {
-//                        record.setTotalIncome(BigDecimalUtils.nullToZero(incomeIndication.get("totalAmount")).divide(new BigDecimal(10)));
-//                    }
+                    }else {
+                        record.setTotalIncome(BigDecimal.ZERO);
+                    }
                 }else {
-                    record.setTotalIncome(BigDecimal.ZERO);
+                    record.setTotalIncome(sumAmount);
                 }
                 record.setWithdrawingAmount(txzTXAmount);
             }