diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java index 1856cac9..e55c1a9d 100644 --- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java +++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/constant/CacheConstants.java @@ -45,4 +45,14 @@ public class CacheConstants public static final String ACCESS_KEY_PREFIX = "access:"; public static final String USER_PREFIX = "user:"; + + /** + * 仪表盘 + */ + public static final String DASHBOARD_PREFIX = "dashboard:"; + + /** + * 舆情分析 + */ + public static final String BRIEF = DASHBOARD_PREFIX + "brief"; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/DashboardService.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/DashboardService.java new file mode 100644 index 00000000..91d65ed0 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/DashboardService.java @@ -0,0 +1,83 @@ +package com.ruoyi.dashboard; + +import com.ruoyi.dashboard.vo.TodoListVO; +import com.ruoyi.ss.abnormal.domain.AbnormalQuery; +import com.ruoyi.ss.abnormal.domain.enums.AbnormalStatus; +import com.ruoyi.ss.abnormal.service.AbnormalService; +import com.ruoyi.ss.complaint.domain.SmComplaintQuery; +import com.ruoyi.ss.complaint.service.ISmComplaintService; +import com.ruoyi.ss.device.domain.DeviceQuery; +import com.ruoyi.ss.device.service.DeviceService; +import com.ruoyi.ss.mchApply.domain.MchApplyQuery; +import com.ruoyi.ss.mchApply.domain.enums.MchApplyStatus; +import com.ruoyi.ss.mchApply.service.IMchApplyService; +import com.ruoyi.ss.storeApply.domain.StoreApplyQuery; +import com.ruoyi.ss.storeApply.domain.enums.StoreApplyStatus; +import com.ruoyi.ss.storeApply.service.StoreApplyService; +import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery; +import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillStatus; +import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillType; +import com.ruoyi.ss.transactionBill.service.TransactionBillService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author wjh + * 2024/8/6 + */ +@Service +public class DashboardService { + + @Autowired + private TransactionBillService transactionBillService; + + @Autowired + private IMchApplyService mchApplyService; + + @Autowired + private AbnormalService abnormalService; + + @Autowired + private ISmComplaintService complaintService; + + @Autowired + private DeviceService deviceService; + + @Autowired + private StoreApplyService storeApplyService; + + public TodoListVO getTodoList() { + TodoListVO vo = new TodoListVO(); + + // 提现申请数量 + TransactionBillQuery withdrawQuery = new TransactionBillQuery(); + withdrawQuery.setType(TransactionBillType.WITHDRAW.getType()); + withdrawQuery.setStatus(TransactionBillStatus.WITHDRAW_APPROVING.getStatus()); + vo.setWithdrawCount(transactionBillService.selectSimpleCount(withdrawQuery)); + + // 商户合作申请 + MchApplyQuery mchApplyQuery = new MchApplyQuery(); + mchApplyQuery.setStatus(MchApplyStatus.APPROVING.getStatus()); + vo.setMchApplyCount(mchApplyService.selectCount(mchApplyQuery)); + + // 店铺申请 + StoreApplyQuery storeApplyQuery = new StoreApplyQuery(); + storeApplyQuery.setStatus(StoreApplyStatus.WAIT_AUDIT.getStatus()); + vo.setStoreApplyCount(storeApplyService.selectCount(storeApplyQuery)); + + // 设备故障 + AbnormalQuery abnormalQuery = new AbnormalQuery(); + abnormalQuery.setStatus(AbnormalStatus.UNREAD.getStatus()); + vo.setAbnormalCount(abnormalService.selectCount(abnormalQuery)); + + // 投诉意见 + vo.setComplaintCount(complaintService.selectCount(new SmComplaintQuery())); + + // 过期设备 + DeviceQuery deviceQuery = new DeviceQuery(); + deviceQuery.setIsArrears(true); + vo.setArrearsDeviceCount(deviceService.selectCount(deviceQuery)); + + return vo; + } +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/vo/TodoListVO.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/vo/TodoListVO.java new file mode 100644 index 00000000..25cff094 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/vo/TodoListVO.java @@ -0,0 +1,32 @@ +package com.ruoyi.dashboard.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 待办事项VO + * @author wjh + * 2024/8/6 + */ +@Data +public class TodoListVO { + + @ApiModelProperty("提现申请数量") + private Integer withdrawCount; + + @ApiModelProperty("商家合作申请数量") + private Integer mchApplyCount; + + @ApiModelProperty("店铺审核数量") + private Integer storeApplyCount; + + @ApiModelProperty("设备故障数量") + private Integer abnormalCount; + + @ApiModelProperty("投诉意见数量") + private Integer complaintCount; + + @ApiModelProperty("欠费设备数量") + private Integer arrearsDeviceCount; + +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/domain/SmBusinessRecord.java b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/domain/SmBusinessRecord.java index 14e6057e..c8062b5c 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/domain/SmBusinessRecord.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/domain/SmBusinessRecord.java @@ -44,4 +44,13 @@ public class SmBusinessRecord extends BaseEntity @Excel(name = "充值总金额") @ApiModelProperty("充值总金额") private BigDecimal totalRecharge; + + @ApiModelProperty("订单总数量") + private Integer rechargeCount; + + @ApiModelProperty("月费总收入") + private BigDecimal totalMonth; + + @ApiModelProperty("用户总余额") + private BigDecimal userBalance; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/mapper/SmBusinessRecordMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/mapper/SmBusinessRecordMapper.xml index 37d4f300..426f87ca 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/mapper/SmBusinessRecordMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/mapper/SmBusinessRecordMapper.xml @@ -4,27 +4,38 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - + + + + + + + + + - select id, total_device, total_model, total_online, total_user, create_time, total_recharge from sm_business_record + select + sbr.id, + sbr.total_device, + sbr.total_model, + sbr.total_online, + sbr.total_user, + sbr.create_time, + sbr.total_recharge, + sbr.recharge_count, + sbr.total_month, + sbr.user_balance + from sm_business_record sbr - and total_device = #{totalDevice} - and total_model = #{totalModel} - and total_online = #{totalOnline} - and total_user = #{totalUser} - and date(create_time) = date(#{createDate}) + and sbr.total_device = #{totalDevice} + and sbr.total_model = #{totalModel} + and sbr.total_online = #{totalOnline} + and sbr.total_user = #{totalUser} + and sbr.date(create_time) = date(#{createDate}) - and sc.user_id = #{userId} - and sc.content = #{content} - and su.user_name like concat('%', #{userName}, '%') - and sc.type = #{type} + order by sc.create_time desc @@ -45,6 +53,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where sc.id = #{id} + + insert into sm_complaint diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/ISmComplaintService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/ISmComplaintService.java index 3f191cab..dd0e5679 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/ISmComplaintService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/ISmComplaintService.java @@ -61,4 +61,9 @@ public interface ISmComplaintService * @return 结果 */ public int deleteSmComplaintById(Long id); + + /** + * 查询数量 + */ + int selectCount(SmComplaintQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/SmComplaintServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/SmComplaintServiceImpl.java index c71f00d8..60ddb658 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/SmComplaintServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/complaint/service/SmComplaintServiceImpl.java @@ -94,4 +94,9 @@ public class SmComplaintServiceImpl implements ISmComplaintService { return smComplaintMapper.deleteSmComplaintById(id); } + + @Override + public int selectCount(SmComplaintQuery query) { + return smComplaintMapper.selectCount(query); + } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/dashboard/BriefVo.java b/smart-switch-service/src/main/java/com/ruoyi/ss/dashboard/BriefVo.java index 4c49584b..9bb329ec 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/dashboard/BriefVo.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/dashboard/BriefVo.java @@ -14,11 +14,21 @@ import java.util.List; @Data public class BriefVo { private Integer deviceCount; // 设备数量 - private Integer modelCount; // 型号数量 private Integer onlineCount; // 在线数量 + private Integer userCount; // 商户用户数量 private Integer tenantCount; // 租户用户数量 - private BigDecimal rechargeAmount; // 充值金额 + + private Integer rechargeCount; // 充值订单数量 + private Integer todayRechargeCount; // 今日充值订单数量 + + private BigDecimal rechargeAmount; // 充值金额 + private BigDecimal todayRechargeAmount; // 今日充值金额 + + private BigDecimal totalMonthAmount; // 总月费收入 + private BigDecimal todayMonthAmount; // 今日月费收入 + + private BigDecimal totalUserBalance; // 用户总余额 private List history; // 历史数据 } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/DeviceQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/DeviceQuery.java index 70cceb57..bce08324 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/DeviceQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/DeviceQuery.java @@ -6,6 +6,7 @@ import com.ruoyi.ss.device.domain.enums.DeviceGroupByTable; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.time.LocalDateTime; import java.util.List; /** @@ -60,4 +61,13 @@ public class DeviceQuery extends Device { @ApiModelProperty("用户id列表") private List userIds; + + @ApiModelProperty("租期(起始)") + private LocalDateTime startRentTime; + + @ApiModelProperty("租期(结束)") + private LocalDateTime endRentTime; + + @ApiModelProperty("是否过期") + private Boolean isArrears; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/DeviceMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/DeviceMapper.xml index a4fa6fcc..3279c315 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/DeviceMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/mapper/DeviceMapper.xml @@ -23,7 +23,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sd.user_id = #{userId} and sd.store_id = #{storeId} and sd.device_id = #{deviceId} + and sd.rent_time >= #{startRentTime} + and sd.device_id <= #{endRentTime} and sd.device_no like concat('%', #{deviceNo}, '%') + + + and sd.rent_time is null or sd.rent_time <= now() + + + and sd.rent_time is not null and sd.rent_time > now() + + and sd.device_id in diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/domain/ReceiveBillQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/domain/ReceiveBillQuery.java index 1c904e2d..e5d0d00e 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/domain/ReceiveBillQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/domain/ReceiveBillQuery.java @@ -3,6 +3,8 @@ package com.ruoyi.ss.receiveBill.domain; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.time.LocalDate; + /** * @author wjh * 2024/7/22 @@ -10,12 +12,15 @@ import lombok.Data; @Data public class ReceiveBillQuery extends ReceiveBill{ - @ApiModelProperty("年份") + @ApiModelProperty("账单年份") private Integer billYear; - @ApiModelProperty("月份") + @ApiModelProperty("账单月份") private Integer billMonth; + @ApiModelProperty("账单日期") + private LocalDate billDate; + @ApiModelProperty("用户名称") private String userName; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.java index 16cc5938..62a7346f 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.java @@ -1,5 +1,6 @@ package com.ruoyi.ss.receiveBill.mapper; +import java.math.BigDecimal; import java.util.List; import com.ruoyi.ss.receiveBill.domain.ReceiveBill; import com.ruoyi.ss.receiveBill.domain.ReceiveBillVO; @@ -66,4 +67,9 @@ public interface ReceiveBillMapper * 查询数量 */ int selectCount(@Param("query") ReceiveBillQuery query); + + /** + * 查询账单金额总额 + */ + BigDecimal selectSumOfAmount(@Param("query") ReceiveBillQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.xml index 7cc21995..d294b373 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/mapper/ReceiveBillMapper.xml @@ -36,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and srb.device_id = #{query.deviceId} and year(srb.bill_time) = #{query.billYear} and month(srb.bill_time) = #{query.billMonth} + and date(srb.bill_time) = #{query.billDate} and srb.type = #{query.type} and srb.status = #{query.status} and su.user_name like concat('%', #{query.userName}, '%') @@ -64,6 +65,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + SELECT LAST_INSERT_ID() diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/ReceiveBillService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/ReceiveBillService.java index c5a6cced..d5419091 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/ReceiveBillService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/ReceiveBillService.java @@ -76,4 +76,9 @@ public interface ReceiveBillService * 查询数量 */ int selectCount(ReceiveBillQuery query); + + /** + * 查询账单金额总额 + */ + BigDecimal selectSumOfAmount(ReceiveBillQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/impl/ReceiveBillServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/impl/ReceiveBillServiceImpl.java index e2bb636c..bee47ade 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/impl/ReceiveBillServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/receiveBill/service/impl/ReceiveBillServiceImpl.java @@ -182,4 +182,9 @@ public class ReceiveBillServiceImpl implements ReceiveBillService return receiveBillMapper.selectCount(query); } + @Override + public BigDecimal selectSumOfAmount(ReceiveBillQuery query) { + return receiveBillMapper.selectSumOfAmount(query); + } + } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.java index 81f58bf4..3f20cb48 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.java @@ -71,4 +71,9 @@ public interface StoreApplyMapper * 查询一个 */ StoreApplyVO selectOne(@Param("query") StoreApplyQuery query); + + /** + * 查询数量 + */ + int selectCount(@Param("query") StoreApplyQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.xml index c71f4ea9..25e23563 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/mapper/StoreApplyMapper.xml @@ -25,7 +25,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ss.name as store_name, su.user_name as user_name, sys_u.user_name as verify_name - from ss_store_apply ssa + from + + + + ss_store_apply ssa left join sm_store ss on ss.store_id = ssa.store_id left join sm_user su on su.user_id = ssa.user_id left join sys_user sys_u on sys_u.user_id = ssa.verify_id @@ -64,6 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" limit 1 + + insert into ss_store_apply diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/StoreApplyService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/StoreApplyService.java index 6a6ac71d..a66ce4d4 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/StoreApplyService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/StoreApplyService.java @@ -83,4 +83,9 @@ public interface StoreApplyService * 取消申请 */ int cancel(Long id); + + /** + * 查询数量 + */ + int selectCount(StoreApplyQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/impl/StoreApplyServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/impl/StoreApplyServiceImpl.java index 987eff0f..292db88b 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/impl/StoreApplyServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/storeApply/service/impl/StoreApplyServiceImpl.java @@ -218,4 +218,9 @@ public class StoreApplyServiceImpl implements StoreApplyService return result == null ? 0 : result; } + @Override + public int selectCount(StoreApplyQuery query) { + return storeApplyMapper.selectCount(query); + } + } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.java index 2c042d53..e3473735 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.java @@ -179,4 +179,9 @@ public interface TransactionBillMapper * 查询提现详情 */ TransactionBillVO selectWithdrawById(Long billId); + + /** + * 简单查询数量 + */ + int selectSimpleCount(@Param("query") TransactionBillQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.xml index 746e9a58..789faf67 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/mapper/TransactionBillMapper.xml @@ -59,7 +59,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" su1.phonenumber as mch_mobile, sd.device_no as device_no, su.phonenumber as user_mobile - from sm_transaction_bill stb + from + + + + sm_transaction_bill stb left join sm_user su on su.user_id = stb.user_id left join sm_user su1 on su1.user_id = stb.mch_id left join sm_device sd on sd.device_id = stb.device_id @@ -250,6 +254,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where stb.bill_id = #{billId} + + insert into sm_transaction_bill diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/TransactionBillService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/TransactionBillService.java index 58451eac..2f7cef9c 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/TransactionBillService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/TransactionBillService.java @@ -263,4 +263,9 @@ public interface TransactionBillService * 查询提现详情 */ TransactionBillVO selectWithdrawById(Long billId); + + /** + * 简单查询数量 + */ + int selectSimpleCount(TransactionBillQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java index 8dacd235..78d27f04 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/service/impl/TransactionBillServiceImpl.java @@ -1114,4 +1114,9 @@ public class TransactionBillServiceImpl implements TransactionBillService { public TransactionBillVO selectWithdrawById(Long billId) { return transactionBillMapper.selectWithdrawById(billId); } + + @Override + public int selectSimpleCount(TransactionBillQuery query) { + return transactionBillMapper.selectSimpleCount(query); + } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.java index 99f603c4..5194d8ce 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.java @@ -104,4 +104,9 @@ public interface SmUserMapper * 更新用户服务费 */ int updateServiceRate(SmUser user); + + /** + * 查询用户余额 + */ + BigDecimal selectSumOfBalance(SmUserQuery query); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.xml index f3678ec6..eb8cf203 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/mapper/SmUserMapper.xml @@ -269,4 +269,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sm_device_tenant sdt on su.user_id = sdt.tenant_id where sdt.device_id = #{deviceId} and su.del_flag = '0' + + diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java index a65e1565..373a371a 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/ISmUserService.java @@ -198,4 +198,9 @@ public interface ISmUserService * 重置用户服务费 */ int resetService(Long userId); + + /** + * 查询用户总余额 + */ + BigDecimal selectSumOfBalance(SmUserQuery smUserQuery); } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java index b95ebd80..747e967f 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/SmUserServiceImpl.java @@ -270,6 +270,11 @@ public class SmUserServiceImpl implements ISmUserService return this.updateServiceRate(data); } + @Override + public BigDecimal selectSumOfBalance(SmUserQuery query) { + return smUserMapper.selectSumOfBalance(query); + } + /** * 逻辑删除前校验 * @param userIds diff --git a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmDashboardController.java b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmDashboardController.java index 43a08b70..1e403bfd 100644 --- a/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmDashboardController.java +++ b/smart-switch-web/src/main/java/com/ruoyi/web/controller/ss/SmDashboardController.java @@ -1,9 +1,11 @@ package com.ruoyi.web.controller.ss; +import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.dashboard.DashboardService; import com.ruoyi.ss.balancePeriod.domain.SmBalancePeriodQuery; import com.ruoyi.ss.balancePeriod.service.ISmBalancePeriodService; import com.ruoyi.ss.businessRecord.service.ISmBusinessRecordService; @@ -30,8 +32,7 @@ import java.util.List; */ @RestController @RequestMapping("/system/dashboard") -public class SmDashboardController { - +public class SmDashboardController extends BaseController { @Autowired private TransactionBillService transactionBillService; @@ -41,9 +42,8 @@ public class SmDashboardController { @Autowired private ISmBusinessRecordService businessRecordService; - @Autowired - private RedisCache redisCache; + private DashboardService dashboardService; /** * 舆情分析数据 @@ -82,4 +82,12 @@ public class SmDashboardController { public AjaxResult balancePeriod(SmBalancePeriodQuery dto) { return AjaxResult.success(balancePeriodService.selectSmBalancePeriodList(dto)); } + + /** + * 获取待办事项 + */ + @GetMapping("/todoList") + public AjaxResult getTodoList() { + return success(dashboardService.getTodoList()); + } }