From d74938ad92c1c7d4c615fee0cfefc0bc85b197f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Thu, 28 Nov 2024 13:45:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/enums/TransactionBillStatus.java | 6 +++++ .../com/ruoyi/task/bill/BillLowPowerTask.java | 5 +++- .../app/AppDashboardController.java | 26 +++++++++++++++++++ .../app/AppTransactionBillController.java | 2 +- 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDashboardController.java diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/enums/TransactionBillStatus.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/enums/TransactionBillStatus.java index d248ae79..a681d876 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/enums/TransactionBillStatus.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/enums/TransactionBillStatus.java @@ -87,4 +87,10 @@ public enum TransactionBillStatus { return asList(SUCCESS, REFUNDED, REFUNDING, WITHDRAW_SUCCESS); } + /** + * 产生收入的状态 + */ + public static List income() { + return asList(SUCCESS, REFUNDING, REFUNDED); + } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/task/bill/BillLowPowerTask.java b/smart-switch-service/src/main/java/com/ruoyi/task/bill/BillLowPowerTask.java index 5b2a24f3..97d28ad9 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/task/bill/BillLowPowerTask.java +++ b/smart-switch-service/src/main/java/com/ruoyi/task/bill/BillLowPowerTask.java @@ -4,6 +4,8 @@ import com.ruoyi.common.utils.collection.CollectionUtils; import com.ruoyi.iot.domain.IotDeviceInfo; import com.ruoyi.iot.service.IotService; import com.ruoyi.ss.device.domain.enums.DeviceOnlineStatus; +import com.ruoyi.ss.suit.domain.enums.SuitFeeMode; +import com.ruoyi.ss.suit.domain.enums.SuitFeeType; import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery; import com.ruoyi.ss.transactionBill.domain.bo.EndUseBO; import com.ruoyi.ss.transactionBill.domain.dto.EndUseDTO; @@ -46,13 +48,14 @@ public class BillLowPowerTask { int cd = sysConfigService.getInt(ConfigKey.ORDER_AUTO_CLOSE_CD); LocalDateTime createTimeEnd = LocalDateTime.now().minusMinutes(cd); // 获取冷却时间之前的时间 - // 获取开启了低功率关闭,且未结束的订单 + // 获取开启了低功率关闭,且未结束的电量订单 TransactionBillQuery query = new TransactionBillQuery(); query.setSuitEnableLowPowerClose(true); query.setType(TransactionBillType.RECHARGE.getType()); query.setStatusList(TransactionBillStatus.canClose()); query.setCreateTimeEnd(createTimeEnd); query.setIsFinished(false); + query.setSuitFeeTypes(SuitFeeType.rechargeCountList()); List list = transactionBillService.selectSmTransactionBillList(query); // 从OneNet获取设备信息 diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDashboardController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDashboardController.java new file mode 100644 index 00000000..946d417e --- /dev/null +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppDashboardController.java @@ -0,0 +1,26 @@ +package com.ruoyi.web.controller.app; + +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.dashboard.service.DashboardService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author wjh + * 2024/11/28 + */ +@RestController +@RequestMapping("/app/dashboard") +public class AppDashboardController extends BaseController { + + @Autowired + private DashboardService dashboardService; + +// @ApiOperation("按日查询分成列表") +// @GetMapping("/bonusSumOfDaily") +// public AjaxResult bonusDaily() { +// return success(dashboardService.selectBonusDaily()); +// } + +} diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java index 4fedf854..ee12ac45 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/app/AppTransactionBillController.java @@ -175,7 +175,7 @@ public class AppTransactionBillController extends BaseController // FIXME 需要统计退款的订单,并且需要过滤掉退款的金额 dto.setMchId(getUserId()); - dto.setStatus(TransactionBillStatus.SUCCESS.getStatus()); + dto.setStatusList(TransactionBillStatus.income()); AjaxResult ajax = AjaxResult.success(transactionBillService.selectLandlordCount(dto)); // 总收入