diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BonusTrendDetailVO.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BonusTrendDetailVO.java new file mode 100644 index 00000000..d1695c2b --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BonusTrendDetailVO.java @@ -0,0 +1,25 @@ +package com.ruoyi.dashboard.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDate; + +/** + * @author wjh + * 2025/1/13 + */ +@Data +public class BonusTrendDetailVO { + + @ApiModelProperty("日期") + private LocalDate date; + + @ApiModelProperty("收入金额") + private BigDecimal incomeAmount; + + @ApiModelProperty("订单数量") + private Integer orderCount; + +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BonusTrendVO.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BonusTrendVO.java new file mode 100644 index 00000000..b13aa439 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BonusTrendVO.java @@ -0,0 +1,25 @@ +package com.ruoyi.dashboard.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author wjh + * 2025/1/13 + */ +@Data +public class BonusTrendVO { + + @ApiModelProperty("明细列表") + private List detailList; + + @ApiModelProperty("总收入") + private BigDecimal totalIncome; + + @ApiModelProperty("总订单数") + private Integer totalOrder; + +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BusinessStatisticsByStoreVO.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BusinessStatisticsByStoreVO.java new file mode 100644 index 00000000..0696017e --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/BusinessStatisticsByStoreVO.java @@ -0,0 +1,24 @@ +package com.ruoyi.dashboard.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.List; + +/** + * @author wjh + * 2025/1/13 + */ +@Data +public class BusinessStatisticsByStoreVO { + + @ApiModelProperty("订单总数") + private Integer totalOrder; + + @ApiModelProperty("订单总金额") + private BigDecimal totalOrderAmount; + + @ApiModelProperty("明细列表") + List list; +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/MchRevenueVO.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/MchRevenueVO.java new file mode 100644 index 00000000..769647c9 --- /dev/null +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/domain/vo/MchRevenueVO.java @@ -0,0 +1,35 @@ +package com.ruoyi.dashboard.domain.vo; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * @author wjh + * 2025/1/13 + */ +@Data +public class MchRevenueVO { + + @ApiModelProperty("今日收入") + private BigDecimal todayIncome; + + @ApiModelProperty("昨日收入") + private BigDecimal yesterdayIncome; + + @ApiModelProperty("今日订单") + private Integer todayOrder; + + @ApiModelProperty("昨日订单") + private Integer yesterdayOrder; + + @ApiModelProperty("设备总数") + private Integer deviceCount; + + @ApiModelProperty("空闲设备数") + private Integer freeDeviceCount; + + @ApiModelProperty("使用中设备数") + private Integer usingDeviceCount; +} diff --git a/smart-switch-service/src/main/java/com/ruoyi/dashboard/service/DashboardService.java b/smart-switch-service/src/main/java/com/ruoyi/dashboard/service/DashboardService.java index 0e8c3dfe..fc518622 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/dashboard/service/DashboardService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/dashboard/service/DashboardService.java @@ -3,21 +3,22 @@ package com.ruoyi.dashboard.service; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.collection.CollectionUtils; import com.ruoyi.dashboard.domain.dto.BusinessStatisticsQuery; -import com.ruoyi.dashboard.domain.vo.BusinessStatisticsVO; -import com.ruoyi.dashboard.domain.vo.TodoListVO; +import com.ruoyi.dashboard.domain.dto.ServiceIncomeQuery; +import com.ruoyi.dashboard.domain.vo.*; import com.ruoyi.dashboard.mapper.DashboardMapper; 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.bonus.domain.BonusQuery; +import com.ruoyi.ss.bonus.domain.BonusVO; import com.ruoyi.ss.bonus.domain.enums.BonusArrivalType; +import com.ruoyi.ss.bonus.domain.enums.BonusStatus; import com.ruoyi.ss.bonus.domain.vo.BonusDailyAmountVO; import com.ruoyi.ss.bonus.service.BonusService; import com.ruoyi.ss.complaint.domain.SmComplaintQuery; import com.ruoyi.ss.complaint.service.ISmComplaintService; -import com.ruoyi.dashboard.domain.dto.ServiceIncomeQuery; -import com.ruoyi.dashboard.domain.vo.ServiceIncomeVO; import com.ruoyi.ss.device.domain.DeviceQuery; +import com.ruoyi.ss.device.domain.enums.DeviceStatus; import com.ruoyi.ss.device.service.DeviceService; import com.ruoyi.ss.mchApply.domain.MchApplyQuery; import com.ruoyi.ss.mchApply.domain.enums.MchApplyStatus; @@ -43,9 +44,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.time.LocalDate; import java.util.ArrayList; import java.util.Date; +import java.util.HashSet; import java.util.List; +import java.util.stream.Collectors; /** * @author wjh @@ -222,10 +226,20 @@ public class DashboardService { return result; } - public List businessStatisticsByStore(BusinessStatisticsQuery query) { + public BusinessStatisticsByStoreVO businessStatisticsByStore(BusinessStatisticsQuery query) { + BusinessStatisticsByStoreVO vo = new BusinessStatisticsByStoreVO(); + + // 查询列表 query.setBillType(TransactionBillType.RECHARGE.getType()); query.setBillStatusList(TransactionBillStatus.payedOrder()); - return dashboardMapper.selectBusinessStatisticsByStore(query); + List list = dashboardMapper.selectBusinessStatisticsByStore(query); + vo.setList(list); + + // 统计数量、金额 + vo.setTotalOrder(list.stream().mapToInt(BusinessStatisticsVO::getOrderCount).sum()); + vo.setTotalOrderAmount(CollectionUtils.sumDecimal(list, BusinessStatisticsVO::getArrivalAmount)); + + return vo; } @@ -234,4 +248,104 @@ public class DashboardService { query.setBillStatusList(TransactionBillStatus.payedOrder()); return dashboardMapper.selectBusinessStatisticsByDevice(query); } + + /** + * 查询商户中心营收统计 + */ + public MchRevenueVO mchRevenue(Long mchId) { + MchRevenueVO vo = new MchRevenueVO(); + LocalDate today = LocalDate.now(); + LocalDate yesterday = today.plusDays(-1); + + // 营业额统计 + BonusQuery bonusQuery = new BonusQuery(); + bonusQuery.setArrivalId(mchId); + bonusQuery.setArrivalTypes(BonusArrivalType.userList()); + bonusQuery.setStatus(BonusStatus.DIVIDEND.getStatus()); + // 今日营业额 + bonusQuery.setPayDate(today); + BigDecimal todayIncome = bonusService.selectSumOfPayedAmount(bonusQuery); + if (todayIncome == null) { + todayIncome = BigDecimal.ZERO; + } + vo.setTodayIncome(todayIncome); + // 昨日营业额 + bonusQuery.setPayDate(yesterday); + BigDecimal yesterdayIncome = bonusService.selectSumOfPayedAmount(bonusQuery); + if (yesterdayIncome == null) { + yesterdayIncome = BigDecimal.ZERO; + } + vo.setYesterdayIncome(yesterdayIncome); + + + // 订单数统计 + TransactionBillQuery billQuery = new TransactionBillQuery(); + billQuery.setType(TransactionBillType.RECHARGE.getType()); + billQuery.setStatusList(TransactionBillStatus.payedOrder()); + billQuery.setMchId(mchId); + // 今日订单数 + billQuery.setCreateDate(today); + int todayOrder = transactionBillService.selectSimpleCount(billQuery); + vo.setTodayOrder(todayOrder); + // 昨日订单数 + billQuery.setCreateDate(yesterday); + int yesterdayOrder = transactionBillService.selectSimpleCount(billQuery); + vo.setYesterdayOrder(yesterdayOrder); + + + // 设备统计 + DeviceQuery deviceQuery = new DeviceQuery(); + deviceQuery.setUserId(mchId); + // 设备总数 + int deviceCount = deviceService.selectCount(deviceQuery); + vo.setDeviceCount(deviceCount); + // 空闲设备数量 + deviceQuery.setStatus(DeviceStatus.NORMAL.getStatus()); + int freeDeviceCount = deviceService.selectCount(deviceQuery); + vo.setFreeDeviceCount(freeDeviceCount); + // 使用中设备数量 + deviceQuery.setStatus(DeviceStatus.USING.getStatus()); + int usingDeviceCount = deviceService.selectCount(deviceQuery); + vo.setUsingDeviceCount(usingDeviceCount); + + return vo; + } + + public BonusTrendVO selectBonusTrend(BonusQuery query) { + BonusTrendVO vo = new BonusTrendVO(); + + // 查询分成列表 + List bonusList = bonusService.selectBonusList(query); + // 若是日期不为空,则构建明细列表 + List detailList = new ArrayList<>(); + if (query.getPayDateStart() != null && query.getPayDateEnd() != null) { + detailList = CollectionUtils.fillVoids(detailList, BonusTrendDetailVO::getDate, (date) -> { + // 当天的分成列表 + List dateBonusList = bonusList.stream() + .filter(item -> item.getPayTime() != null && item.getPayTime().toLocalDate().isEqual(date)) + .collect(Collectors.toList()); + + // 构造明细数据 + BonusTrendDetailVO detail = new BonusTrendDetailVO(); + detail.setDate(date); + detail.setIncomeAmount(CollectionUtils.sumDecimal(dateBonusList, BonusVO::getPayedAmount)); + detail.setOrderCount(new HashSet<>(CollectionUtils.map(dateBonusList, BonusVO::getBillId)).size()); + return detail; + }, query.getPayDateStart(), query.getPayDateEnd()); + } + vo.setDetailList(detailList); + + // 收入 + BigDecimal totalIncome = CollectionUtils.sumDecimal(bonusList, BonusVO::getPayedAmount); + if (totalIncome == null) { + totalIncome = BigDecimal.ZERO; + } + vo.setTotalIncome(totalIncome); + + // 订单数 + int totalOrder = new HashSet<>(CollectionUtils.map(bonusList, BonusVO::getBillId)).size(); + vo.setTotalOrder(totalOrder); + + return vo; + } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/balancePeriod/service/SmBalancePeriodServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/balancePeriod/service/SmBalancePeriodServiceImpl.java index 14df7360..d46642a4 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/balancePeriod/service/SmBalancePeriodServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/balancePeriod/service/SmBalancePeriodServiceImpl.java @@ -1,10 +1,10 @@ package com.ruoyi.ss.balancePeriod.service; import com.ruoyi.common.utils.DateUtils; +import com.ruoyi.dashboard.domain.vo.BillCountVo; import com.ruoyi.ss.balancePeriod.domain.SmBalancePeriod; import com.ruoyi.ss.balancePeriod.domain.SmBalancePeriodQuery; import com.ruoyi.ss.balancePeriod.mapper.SmBalancePeriodMapper; -import com.ruoyi.dashboard.domain.vo.BillCountVo; import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery; import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillGroupBy; import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillStatus; @@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.math.BigDecimal; +import java.time.LocalDate; import java.util.Date; import java.util.List; @@ -128,7 +129,7 @@ public class SmBalancePeriodServiceImpl implements ISmBalancePeriodService // 充值 TransactionBillQuery dto = new TransactionBillQuery(); - dto.setCreateDate(now); + dto.setCreateDate(LocalDate.now()); dto.setHour(now.getHours()); dto.setGroupBy(TransactionBillGroupBy.create_hour.name()); dto.setStatusList(TransactionBillStatus.payedOrder()); diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/domain/BonusQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/domain/BonusQuery.java index 60c9a46d..51bf5034 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/domain/BonusQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/domain/BonusQuery.java @@ -35,6 +35,9 @@ public class BonusQuery extends BonusVO { @DateTimeFormat(pattern = "yyyy-MM-dd") private LocalDate payDateEnd; + @ApiModelProperty("支付日期") + private LocalDate payDate; + @ApiModelProperty("实际支付时间(起始)") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime payTimeStart; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/mapper/BonusMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/mapper/BonusMapper.xml index e2522a29..1ae252b0 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/mapper/BonusMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/bonus/mapper/BonusMapper.xml @@ -51,6 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and sb.pre_pay_time >= #{query.prePayTimeStart} and sb.pre_pay_time <= #{query.prePayTimeEnd} and sb.to_balance = #{query.toBalance} + and date(sb.pay_time) = #{query.payDate} and sb.bill_id in diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java index 839b854e..842ab31e 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/businessRecord/service/SmBusinessRecordServiceImpl.java @@ -153,7 +153,7 @@ public class SmBusinessRecordServiceImpl implements ISmBusinessRecordService BriefVo brief = redisCache.getCacheObject(CacheConstants.BRIEF); if (brief == null ) { brief = new BriefVo(); - Date now = DateUtils.getNowDate(); + LocalDate now = LocalDate.now(); // 总订单数 TransactionBillQuery rechargeQuery = new TransactionBillQuery(); @@ -224,7 +224,7 @@ public class SmBusinessRecordServiceImpl implements ISmBusinessRecordService brief.setTotalMonthAmount(receiveBillService.selectSumOfAmount(monthQuery)); // 今日月费 - monthQuery.setBillDate(LocalDate.now()); + monthQuery.setBillDate(now); BigDecimal todayMonthAmount = receiveBillService.selectSumOfAmount(monthQuery); brief.setTodayMonthAmount(todayMonthAmount == null ? BigDecimal.ZERO : todayMonthAmount); diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/domain/CustomerService.java b/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/domain/CustomerService.java index e5c3431a..17cfc87a 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/domain/CustomerService.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/domain/CustomerService.java @@ -1,19 +1,19 @@ package com.ruoyi.ss.customerService.domain; +import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.constants.DictTypeConstants; +import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.ValidGroup; import com.ruoyi.common.utils.RegexpUtils; import com.ruoyi.system.valid.DictValid; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.ruoyi.common.annotation.Excel; -import com.ruoyi.common.core.domain.BaseEntity; +import org.springframework.format.annotation.DateTimeFormat; import javax.validation.constraints.NotBlank; import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; +import java.time.LocalTime; /** * 客服对象 ss_customer_service @@ -46,12 +46,21 @@ public class CustomerService extends BaseEntity @NotBlank(message = "类型不能为空", groups = {ValidGroup.Create.class}) private String type; - @Excel(name = "微信号") - @ApiModelProperty("微信号") - @Size(max = 64, message = "微信号长度不能超过64个字符") + @Excel(name = "微信图片") + @ApiModelProperty("微信图片") private String wx; @Excel(name = "排序") @ApiModelProperty("排序") private Integer sort; + + @DateTimeFormat(pattern = "HH:mm:ss") + @Excel(name = "上班时间(起始)") + @ApiModelProperty("上班时间") + private LocalTime workTimeStart; + + @DateTimeFormat(pattern = "HH:mm:ss") + @Excel(name = "上班时间(结束)") + @ApiModelProperty("上班时间") + private LocalTime workTimeEnd; } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/mapper/CustomerServiceMapper.xml b/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/mapper/CustomerServiceMapper.xml index 17d558ab..eef9f6eb 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/mapper/CustomerServiceMapper.xml +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/customerService/mapper/CustomerServiceMapper.xml @@ -14,7 +14,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" scs.type, scs.wx, scs.create_time, - scs.sort + scs.sort, + scs.work_time_start, + scs.work_time_end from ss_customer_service scs @@ -47,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" wx, create_time, sort, + work_time_start, + work_time_end, #{name}, @@ -55,6 +59,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{wx}, #{createTime}, #{sort}, + #{workTimeStart}, + #{workTimeEnd}, @@ -73,6 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" wx = #{data.wx}, create_time = #{data.createTime}, sort = #{data.sort}, + work_time_start = #{data.workTimeStart}, + work_time_end = #{data.workTimeEnd}, diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceStatus.java b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceStatus.java index b4dbf20f..899951df 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceStatus.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/device/domain/enums/DeviceStatus.java @@ -14,7 +14,7 @@ import java.util.Objects; @Getter public enum DeviceStatus { - NORMAL("1", "正常"), + NORMAL("1", "正常(空闲)"), USING("2", "使用中"), FIXING("3", "维修中"); diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/store/domain/StoreVo.java b/smart-switch-service/src/main/java/com/ruoyi/ss/store/domain/StoreVo.java index 1413fdb1..71e3a5a3 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/store/domain/StoreVo.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/store/domain/StoreVo.java @@ -27,6 +27,9 @@ public class StoreVo extends Store { @ApiModelProperty("本日收入") private BigDecimal todayIncome; + @ApiModelProperty("本日订单数量") + private Integer todayOrderCount; + @ApiModelProperty("本月收入") private BigDecimal monthIncome; diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/store/service/impl/StoreAssemblerImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/store/service/impl/StoreAssemblerImpl.java index 5b266178..68907a93 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/store/service/impl/StoreAssemblerImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/store/service/impl/StoreAssemblerImpl.java @@ -1,6 +1,5 @@ package com.ruoyi.ss.store.service.impl; -import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.collection.CollectionUtils; import com.ruoyi.dashboard.domain.vo.BillCountVo; import com.ruoyi.ss.device.domain.DeviceCountVO; @@ -72,7 +71,7 @@ public class StoreAssemblerImpl implements StoreAssembler { if (CollectionUtils.isEmptyElement(list)) { return; } - // 本日收入 + // 本日收入、本日订单量 this.assembleTodayIncome(list); // 本月收入 this.assembleMonthIncome(list); @@ -116,7 +115,7 @@ public class StoreAssemblerImpl implements StoreAssembler { } /** - * 拼接本日收入 + * 拼接本日收入、订单量 * * @param list */ @@ -131,15 +130,17 @@ public class StoreAssemblerImpl implements StoreAssembler { query.setStoreIds(list.stream().map(StoreVo::getStoreId).filter(Objects::nonNull).distinct().collect(Collectors.toList())); query.setStatusList(TransactionBillStatus.payedOrder()); query.setType(TransactionBillType.RECHARGE.getType()); - query.setCreateDate(DateUtils.getNowDate()); + query.setCreateDate(LocalDate.now()); Map map = transactionBillService.selectCountMap(query, BillCountVo::getStoreId); for (StoreVo store : list) { BillCountVo count = map.get(store.getStoreId()); if (count != null) { store.setTodayIncome(count.getRecharge()); + store.setTodayOrderCount(count.getCount()); } else { store.setTodayIncome(BigDecimal.ZERO); + store.setTodayOrderCount(0); } } } diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/TransactionBillQuery.java b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/TransactionBillQuery.java index 7435a0ff..90ccd576 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/TransactionBillQuery.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/transactionBill/domain/TransactionBillQuery.java @@ -11,7 +11,6 @@ import org.springframework.format.annotation.DateTimeFormat; import java.math.BigDecimal; import java.time.LocalDate; import java.time.LocalDateTime; -import java.util.Date; import java.util.List; /** @@ -41,7 +40,7 @@ public class TransactionBillQuery extends TransactionBill { @ApiModelProperty("创建日期") @DateTimeFormat(pattern = "yyyy-MM-dd") - private Date createDate; + private LocalDate createDate; @ApiModelProperty("分组字段") @EnumValid( 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 8e17fb05..ef6052cb 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 @@ -569,7 +569,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After TransactionBillQuery query = new TransactionBillQuery(); query.setType(TransactionBillType.WITHDRAW.getType()); query.setStatusList(TransactionBillStatus.countOfLimit()); - query.setCreateDate(DateUtils.getNowDate()); + query.setCreateDate(LocalDate.now()); query.setUserId(user.getUserId()); // 每日限额 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 index 5a0c47bf..a2ea6ca9 100644 --- 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 @@ -7,7 +7,7 @@ import com.ruoyi.common.utils.collection.CollectionUtils; import com.ruoyi.dashboard.service.DashboardService; import com.ruoyi.ss.bonus.domain.BonusQuery; import com.ruoyi.ss.bonus.domain.enums.BonusArrivalType; -import com.ruoyi.ss.bonus.domain.vo.BonusDailyAmountVO; +import com.ruoyi.ss.bonus.domain.enums.BonusStatus; import com.ruoyi.ss.bonus.service.BonusService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -31,6 +31,9 @@ public class AppDashboardController extends BaseController { @Autowired private BonusService bonusService; + @Autowired + private DashboardService dashboardService; + @ApiOperation("按日查询本人分成列表") @GetMapping("/bonusDailyAmount") public AjaxResult bonusDailyAmount(BonusQuery query) { @@ -56,4 +59,19 @@ public class AppDashboardController extends BaseController { return ajax; } + @ApiOperation("查询商户中心营收统计") + @GetMapping("/mchRevenue") + public AjaxResult mchRevenue() { + return success(dashboardService.mchRevenue(getUserId())); + } + + @ApiOperation("查询商户中心收入趋势统计") + @GetMapping("/bonusTrend") + public AjaxResult bonusTrend(BonusQuery query) { + query.setArrivalId(getUserId()); + query.setArrivalTypes(BonusArrivalType.userList()); + query.setStatus(BonusStatus.DIVIDEND.getStatus()); + return success(dashboardService.selectBonusTrend(query)); + } + }