店铺相关接口更新

This commit is contained in:
磷叶 2025-02-26 14:49:13 +08:00
parent cfd56deb7b
commit c868fec07d
62 changed files with 794 additions and 237 deletions

View File

@ -0,0 +1,13 @@
package com.ruoyi.common.domain.vo;
import java.time.LocalDateTime;
import lombok.Data;
@Data
public class LocalDateTimeIntegerVO {
private LocalDateTime key;
private Integer value;
}

View File

@ -0,0 +1,19 @@
package com.ruoyi.dashboard.device.domain.brief;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author wjh
* 2025/2/26
*/
@Data
public class DeviceBriefVO {
// 使用状态
@ApiModelProperty("正常数量")
private Integer normalCount;
@ApiModelProperty("使用中")
private Integer usingCount;
}

View File

@ -0,0 +1,27 @@
package com.ruoyi.dashboard.device.service;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ss.device.domain.DeviceQuery;
import com.ruoyi.ss.device.mapper.DeviceMapper;
@Service
public class DeviceDashboardService {
@Autowired
private DeviceMapper deviceMapper;
/**
* 查询设备数量并分组
*/
public List<Map<String, Object>> selectCountGroupBy(DeviceQuery query, List<String> groupBy) {
return deviceMapper.selectCountGroupBy(query, groupBy);
}
}

View File

@ -1,29 +0,0 @@
package com.ruoyi.dashboard.domain.dto;
import java.time.LocalDate;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StoreDailyIncomeQuery {
@ApiModelProperty("店铺ID")
@NotBlank(message = "店铺ID不能为空")
private Long storeId;
@ApiModelProperty("开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "开始时间不能为空")
private LocalDate startDate;
@ApiModelProperty("结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "结束时间不能为空")
private LocalDate endDate;
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.dto;
package com.ruoyi.dashboard.index.domain.dto;
import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.dto;
package com.ruoyi.dashboard.index.domain.dto;
import com.ruoyi.ss.refund.domain.RefundQuery;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.dto;
package com.ruoyi.dashboard.index.domain.dto;
import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.dto;
package com.ruoyi.dashboard.index.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -0,0 +1,65 @@
package com.ruoyi.dashboard.index.domain.dto;
import java.time.LocalDate;
import java.util.Arrays;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import org.springframework.format.annotation.DateTimeFormat;
import com.ruoyi.ss.payBill.domain.PayBillQuery;
import com.ruoyi.ss.payBill.domain.enums.PayBillStatus;
import com.ruoyi.ss.refund.domain.RefundQuery;
import com.ruoyi.ss.refund.domain.enums.RefundStatus;
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillStatus;
import com.ruoyi.ss.transactionBill.domain.enums.TransactionBillType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StoreDailyIncomeQuery {
@ApiModelProperty("店铺ID")
@NotBlank(message = "店铺ID不能为空")
private Long storeId;
@ApiModelProperty("开始时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "开始时间不能为空")
private LocalDate startDate;
@ApiModelProperty("结束时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@NotNull(message = "结束时间不能为空")
private LocalDate endDate;
public PayBillQuery toPayBillQuery() {
PayBillQuery billQuery = new PayBillQuery();
billQuery.setStoreId(storeId);
billQuery.setStatusList(PayBillStatus.payedList());
billQuery.setPayDateStart(startDate);
billQuery.setPayDateEnd(endDate);
return billQuery;
}
public RefundQuery toRefundQuery() {
RefundQuery refundQuery = new RefundQuery();
refundQuery.setStoreId(storeId);
refundQuery.setCreateDateStart(startDate);
refundQuery.setCreateDateEnd(endDate);
refundQuery.setStatusList(RefundStatus.successList());
return refundQuery;
}
public TransactionBillQuery toTransactionBillQuery() {
TransactionBillQuery billQuery = new TransactionBillQuery();
billQuery.setStoreId(storeId);
billQuery.setStatusList(TransactionBillStatus.payedOrder());
billQuery.setType(TransactionBillType.RECHARGE.getType());
billQuery.setCreateDateRange(Arrays.asList(startDate, endDate));
return billQuery;
}
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecordVo;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import java.math.BigDecimal;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import java.math.BigDecimal;
import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -20,4 +20,7 @@ public class StoreDailyIncomeVO {
@ApiModelProperty("实收金额")
private BigDecimal realAmount;
@ApiModelProperty("订单数")
private Integer orderCount;
}

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.domain.vo;
package com.ruoyi.dashboard.index.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,8 +1,8 @@
package com.ruoyi.dashboard.mapper;
package com.ruoyi.dashboard.index.mapper;
import com.ruoyi.dashboard.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.domain.vo.BusinessStatisticsVO;
import com.ruoyi.dashboard.domain.vo.DashboardBonusGroupByMchVO;
import com.ruoyi.dashboard.index.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.index.domain.vo.BusinessStatisticsVO;
import com.ruoyi.dashboard.index.domain.vo.DashboardBonusGroupByMchVO;
import com.ruoyi.ss.bonus.domain.BonusQuery;
import org.apache.ibatis.annotations.Param;

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.dashboard.mapper.DashboardMapper">
<mapper namespace="com.ruoyi.dashboard.index.mapper.DashboardMapper">
<resultMap id="BusinessStatisticsStoreVO" type="BusinessStatisticsVO" autoMapping="true">
<result property="deviceCount" column="device_count" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullIntegerTypeHandler"/>

View File

@ -1,4 +1,4 @@
package com.ruoyi.dashboard.service;
package com.ruoyi.dashboard.index.service;
import java.math.BigDecimal;
import java.time.LocalDate;
@ -14,25 +14,26 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.common.domain.vo.LocalDateTimeIntegerVO;
import com.ruoyi.common.domain.vo.LongDecimalVO;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MathUtils;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.domain.dto.DailyIncomeGroupByStoreQuery;
import com.ruoyi.dashboard.domain.dto.ServiceIncomeQuery;
import com.ruoyi.dashboard.domain.dto.StoreDailyIncomeQuery;
import com.ruoyi.dashboard.domain.vo.BonusTrendDetailVO;
import com.ruoyi.dashboard.domain.vo.BonusTrendVO;
import com.ruoyi.dashboard.domain.vo.BusinessStatisticsByStoreVO;
import com.ruoyi.dashboard.domain.vo.BusinessStatisticsVO;
import com.ruoyi.dashboard.domain.vo.DailyIncomeGroupByStoreVO;
import com.ruoyi.dashboard.domain.vo.DashboardBonusGroupByMchVO;
import com.ruoyi.dashboard.domain.vo.MchRevenueVO;
import com.ruoyi.dashboard.domain.vo.ServiceIncomeVO;
import com.ruoyi.dashboard.domain.vo.StoreDailyIncomeVO;
import com.ruoyi.dashboard.domain.vo.TodoListVO;
import com.ruoyi.dashboard.mapper.DashboardMapper;
import com.ruoyi.dashboard.index.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.index.domain.dto.DailyIncomeGroupByStoreQuery;
import com.ruoyi.dashboard.index.domain.dto.ServiceIncomeQuery;
import com.ruoyi.dashboard.index.domain.dto.StoreDailyIncomeQuery;
import com.ruoyi.dashboard.index.domain.vo.BonusTrendDetailVO;
import com.ruoyi.dashboard.index.domain.vo.BonusTrendVO;
import com.ruoyi.dashboard.index.domain.vo.BusinessStatisticsByStoreVO;
import com.ruoyi.dashboard.index.domain.vo.BusinessStatisticsVO;
import com.ruoyi.dashboard.index.domain.vo.DailyIncomeGroupByStoreVO;
import com.ruoyi.dashboard.index.domain.vo.DashboardBonusGroupByMchVO;
import com.ruoyi.dashboard.index.domain.vo.MchRevenueVO;
import com.ruoyi.dashboard.index.domain.vo.ServiceIncomeVO;
import com.ruoyi.dashboard.index.domain.vo.StoreDailyIncomeVO;
import com.ruoyi.dashboard.index.domain.vo.TodoListVO;
import com.ruoyi.dashboard.index.mapper.DashboardMapper;
import com.ruoyi.ss.abnormal.domain.AbnormalQuery;
import com.ruoyi.ss.abnormal.domain.enums.AbnormalStatus;
import com.ruoyi.ss.abnormal.service.AbnormalService;
@ -523,11 +524,11 @@ public class DashboardService {
withdrawQuery.setStatusList(TransactionBillStatus.validWithdrawList());
withdrawQuery.setChannelId(channelId);
result.setWithdrawAmount(transactionBillService.selectSumOfMoney(withdrawQuery));
// 提现服务费
result.setWithdrawServiceFee(transactionBillService.selectSumOfServiceCharge(withdrawQuery));
}
// 构建数据
// 总分成
result.setTotalBonus(MathUtils.addDecimal(result.getUserBonus(), result.getPlatformBonus()));
@ -554,6 +555,9 @@ public class DashboardService {
return result;
}
/**
* 查询每日店铺营收
*/
public List<DailyIncomeGroupByStoreVO> getDailyIncomeGroupByStore(DailyIncomeGroupByStoreQuery query) {
// 查询订单列表
TransactionBillQuery billQuery = new TransactionBillQuery();
@ -599,29 +603,35 @@ public class DashboardService {
return result;
}
/**
* 查询每日收入
*/
public List<StoreDailyIncomeVO> storeDailyIncome(StoreDailyIncomeQuery query) {
// 查询订单列表
PayBillQuery billQuery = new PayBillQuery();
billQuery.setStoreId(query.getStoreId());
billQuery.setStatusList(PayBillStatus.payedList());
billQuery.setPayDateStart(query.getStartDate());
billQuery.setPayDateEnd(query.getEndDate());
List<LocalDateDecimalVO> billList = payBillService.selectDailyAmount(billQuery);
List<LocalDateTimeIntegerVO> transactionBillList = transactionBillService.selectDailyCount(query.toTransactionBillQuery());
// 查询支付列表
List<LocalDateDecimalVO> billList = payBillService.selectDailyAmount(query.toPayBillQuery());
// 查询退款列表
RefundQuery refundQuery = new RefundQuery();
refundQuery.setStoreId(query.getStoreId());
refundQuery.setCreateDateStart(query.getStartDate());
refundQuery.setCreateDateEnd(query.getEndDate());
refundQuery.setStatusList(RefundStatus.successList());
List<LocalDateDecimalVO> refundList = refundService.selectDailyAmount(refundQuery);
List<LocalDateDecimalVO> refundList = refundService.selectDailyAmount(query.toRefundQuery());
// 构建返回结果
List<StoreDailyIncomeVO> result = new ArrayList<>();
List<StoreDailyIncomeVO> result = new ArrayList<>();
if (query.getStartDate() != null && query.getEndDate() != null) {
result = CollectionUtils.fillVoids(result, StoreDailyIncomeVO::getDate, (date) -> {
StoreDailyIncomeVO vo = new StoreDailyIncomeVO();
vo.setDate(date);
// 订单数量
LocalDateTimeIntegerVO dailyTransactionBill = transactionBillList.stream().filter(item -> item.getKey().toLocalDate().isEqual(date))
.findFirst().orElse(null);
if (dailyTransactionBill == null || dailyTransactionBill.getValue() == null) {
vo.setOrderCount(0);
} else {
vo.setOrderCount(dailyTransactionBill.getValue());
}
// 订单金额
LocalDateDecimalVO dailyBill = billList.stream().filter(item -> item.getKey().isEqual(date))
.findFirst().orElse(null);

View File

@ -1,5 +1,18 @@
package com.ruoyi.ss.account.service.impl;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.common.valid.bank.BankCardInfo;
@ -13,13 +26,8 @@ import com.ruoyi.ss.account.service.AccountAssembler;
import com.ruoyi.ss.account.service.AccountService;
import com.ruoyi.ss.channelWithdraw.domain.ChannelWithdrawVO;
import com.ruoyi.ss.channelWithdraw.service.ChannelWithdrawService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.ruoyi.ss.user.domain.SmUserVO;
import com.ruoyi.ss.user.service.UserService;
/**
* 用户账户Service业务层处理
@ -39,6 +47,9 @@ public class AccountServiceImpl implements AccountService {
@Autowired
private ChannelWithdrawService channelWithdrawService;
@Autowired
private UserService userService;
/**
* 查询用户账户
*
@ -75,6 +86,14 @@ public class AccountServiceImpl implements AccountService {
// 银行卡校验
if (AccountType.BANK_CARD.getType().equals(data.getAccountType())) {
ServiceUtil.assertion(StringUtils.isAnyBlank(data.getAccountNo(), data.getName(), data.getIdCard()), "银行卡号、姓名、身份证不允许为空");
// 查询用户实名信息
SmUserVO user = userService.selectSmUserByUserId(data.getUserId());
ServiceUtil.assertion(user == null, "ID为%s的用户不存在", data.getUserId());
boolean isReal = user.getIsReal() != null && user.getIsReal() && StringUtils.isNotBlank(user.getRealIdCard());
ServiceUtil.assertion(!isReal, "ID为%s的用户未实名", data.getUserId());
ServiceUtil.assertion(!Objects.equals(user.getRealIdCard(), data.getIdCard()), "ID为%s的用户实名信息不匹配", data.getUserId());
// 银行卡三要素校验并获取卡面信息
BankCardInfo bankCardInfo = BankValidUtils.valid3Bank(data.getAccountNo(), data.getName(), data.getIdCard());
data.setCardInfo(bankCardInfo);

View File

@ -1,7 +1,7 @@
package com.ruoyi.ss.balancePeriod.service;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.dashboard.domain.vo.BillCountVo;
import com.ruoyi.dashboard.index.domain.vo.BillCountVo;
import com.ruoyi.ss.balancePeriod.domain.SmBalancePeriod;
import com.ruoyi.ss.balancePeriod.domain.SmBalancePeriodQuery;
import com.ruoyi.ss.balancePeriod.mapper.SmBalancePeriodMapper;

View File

@ -3,7 +3,7 @@ package com.ruoyi.ss.businessRecord.service;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecord;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecordQuery;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecordVo;
import com.ruoyi.dashboard.domain.vo.BriefVo;
import com.ruoyi.dashboard.index.domain.vo.BriefVo;
import java.util.Date;
import java.util.List;

View File

@ -4,7 +4,7 @@ import com.ruoyi.common.constant.CacheConstants;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.UserType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.dashboard.domain.vo.BriefVo;
import com.ruoyi.dashboard.index.domain.vo.BriefVo;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecord;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecordQuery;
import com.ruoyi.ss.businessRecord.domain.SmBusinessRecordVo;

View File

@ -1,15 +1,17 @@
package com.ruoyi.ss.device.mapper;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.ruoyi.ss.device.domain.Device;
import com.ruoyi.ss.device.domain.DeviceCountVO;
import com.ruoyi.ss.device.domain.DeviceQuery;
import com.ruoyi.ss.device.domain.dto.DeviceBatchUpdateModelDTO;
import com.ruoyi.ss.device.domain.vo.DeviceMacSnVO;
import com.ruoyi.ss.device.domain.vo.DeviceVO;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* 设备Mapper接口
@ -232,4 +234,12 @@ public interface DeviceMapper
* 更新在线状态
*/
int updateOnlineStatusByMac(@Param("mac") String mac, @Param("status") String status);
/**
* 根据条件分组查询设备数量
* @param query 查询条件
* @param groupBy 分组字段列表
* @return 分组统计结果列表
*/
public List<Map<String, Object>> selectCountGroupBy(@Param("query") DeviceQuery query, @Param("groupBy") List<String> groupBy);
}

View File

@ -760,4 +760,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<!-- selectCountGroupBy -->
<select id="selectCountGroupBy">
select
<foreach collection="groupBy" item="item">
${item},
</foreach>
count(sd.device_id) as `count`
from sm_device sd
<where>
<include refid="searchCondition"/>
</where>
<if test="groupBy != null and groupBy.size() > 0">
group by
<foreach collection="groupBy" item="item" separator=",">
${item}
</foreach>
</if>
</select>
</mapper>

View File

@ -5,7 +5,7 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.domain.entity.SysDept;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.domain.vo.BillCountVo;
import com.ruoyi.dashboard.index.domain.vo.BillCountVo;
import com.ruoyi.ss.bonus.domain.Bonus;
import com.ruoyi.ss.bonus.service.BonusConverter;
import com.ruoyi.ss.device.domain.enums.DeviceServiceMode;

View File

@ -1,5 +1,15 @@
package com.ruoyi.ss.store.domain;
import java.math.BigDecimal;
import java.time.LocalTime;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.annotation.Excel;
@ -9,16 +19,9 @@ import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.utils.RegexpUtils;
import com.ruoyi.common.valid.EnumValid;
import com.ruoyi.ss.store.domain.enums.StoreType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.time.LocalTime;
/**
* 店铺对象 sm_device_group
@ -152,12 +155,12 @@ public class Store extends BaseEntity
@JsonView({JsonViewProfile.App.class, StoreView.ListCount.class})
private String status;
@ApiModelProperty("是否生效")
@JsonView(JsonViewProfile.App.class)
private Boolean enabled;
@Excel(name = "是否允许营业时间外使用")
@ApiModelProperty("是否允许营业时间外使用")
@JsonView(JsonViewProfile.App.class)
private Boolean useOutTime;
@ApiModelProperty("最后一次审核记录ID")
@JsonView(JsonViewProfile.App.class)
private Long applyId;
}

View File

@ -30,7 +30,6 @@ public class StoreBO extends Store {
bo.setContactMobile(getContactMobile());
bo.setBusinessTimeStart(getBusinessTimeStart());
bo.setBusinessTimeEnd(getBusinessTimeEnd());
bo.setShow(getShow());
return bo;
}
@ -52,17 +51,10 @@ public class StoreBO extends Store {
bo.setType(getType());
bo.setContactName(getContactName());
bo.setContactMobile(getContactMobile());
bo.setShow(getShow());
bo.setUseOutTime(getUseOutTime());
bo.setBusinessTimeStart(getBusinessTimeStart());
bo.setBusinessTimeEnd(getBusinessTimeEnd());
// 若不展示则默认为已生效
if (bo.getShow() == null || !bo.getShow()) {
bo.setStatus(StoreStatus.NORMAL.getStatus());
bo.setEnabled(true);
bo.setShow(false);
}
bo.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
return bo;
}
@ -86,8 +78,14 @@ public class StoreBO extends Store {
bo.setType(getType());
bo.setContactName(getContactName());
bo.setContactMobile(getContactMobile());
bo.setShow(getShow());
bo.setUseOutTime(getUseOutTime());
bo.setShow(getShow());
if (bo.getShow()) {
bo.setStatus(StoreStatus.PASS.getStatus());
} else {
bo.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
}
return bo;
}
@ -112,8 +110,11 @@ public class StoreBO extends Store {
bo.setContactName(getContactName());
bo.setContactMobile(getContactMobile());
bo.setShow(getShow());
bo.setStatus(StoreStatus.NORMAL.getStatus());
bo.setEnabled(true);
if (bo.getShow()) {
bo.setStatus(StoreStatus.PASS.getStatus());
} else {
bo.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
}
bo.setUseOutTime(getUseOutTime());
return bo;
}

View File

@ -1,17 +1,18 @@
package com.ruoyi.ss.store.domain;
import java.math.BigDecimal;
import java.util.List;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.valid.EnumValid;
import com.ruoyi.ss.store.domain.enums.StoreGroupBy;
import com.ruoyi.ss.storeStaff.domain.StoreStaffQuery;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.List;
/**
* 2024/4/27
*
@ -56,4 +57,7 @@ public class StoreQuery extends Store {
@ApiModelProperty("员工权限")
private String staffPermission;
@ApiModelProperty("店铺状态列表")
private List<String> statusList;
}

View File

@ -2,11 +2,14 @@ package com.ruoyi.ss.store.domain;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonView;
import com.ruoyi.common.core.domain.JsonViewProfile;
import com.ruoyi.ss.bonus.domain.Bonus;
import com.ruoyi.ss.device.domain.enums.DeviceStatus;
import com.ruoyi.ss.store.domain.vo.StoreOperatorVO;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeStaff.domain.StoreStaffVO;
import io.swagger.annotations.ApiModelProperty;
@ -31,9 +34,15 @@ public class StoreVo extends Store {
@ApiModelProperty("本日收入")
private BigDecimal todayIncome;
@ApiModelProperty("总收入")
private BigDecimal totalIncome;
@ApiModelProperty("本日订单数量")
private Integer todayOrderCount;
@ApiModelProperty("总订单数量")
private Integer totalOrderCount;
@ApiModelProperty("本月收入")
private BigDecimal monthIncome;
@ -61,4 +70,27 @@ public class StoreVo extends Store {
@ApiModelProperty("店铺员工")
private List<StoreStaffVO> staffList;
@ApiModelProperty("最后一次审核记录")
private StoreApplyVO apply;
@ApiModelProperty("空闲设备数量")
private Long normalDeviceCount;
@ApiModelProperty("使用中设备数量")
private Long usingDeviceCount;
public void setDeviceStatusMap(Map<String, Object> statusMap) {
if (statusMap == null) {
return;
}
this.normalDeviceCount = (Long) statusMap.get(DeviceStatus.NORMAL.getStatus());
if (normalDeviceCount == null) {
this.normalDeviceCount = 0L;
}
this.usingDeviceCount = (Long) statusMap.get(DeviceStatus.USING.getStatus());
if (usingDeviceCount == null) {
this.usingDeviceCount = 0L;
}
}
}

View File

@ -0,0 +1,17 @@
package com.ruoyi.ss.store.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class StoreVerifyDTO {
@ApiModelProperty("店铺ID")
private Long storeId;
@ApiModelProperty("是否通过")
private Boolean pass;
@ApiModelProperty("审核意见")
private String verifyRemark;
}

View File

@ -1,5 +1,9 @@
package com.ruoyi.ss.store.domain.enums;
import java.util.List;
import com.ruoyi.common.utils.collection.CollectionUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;
@ -12,10 +16,31 @@ import lombok.Getter;
@AllArgsConstructor
public enum StoreStatus {
NORMAL("1", "正常"),
APPROVING("2", "审核中");
WAIT_SUBMIT("3", "待审核"),
APPROVING("2", "审核中"),
PASS("1", "审核通过"),
REJECT("4", "审核不通过");
private final String status;
private final String name;
// 允许设置展示的店铺状态
public static List<String> canSetShow() {
return CollectionUtils.map(StoreStatus::getStatus, WAIT_SUBMIT, REJECT);
}
// 允许设置隐藏的店铺状态
public static List<String> canSetHide() {
return CollectionUtils.map(StoreStatus::getStatus, APPROVING, PASS, REJECT);
}
// 允许审核的店铺状态
public static List<String> canVerify() {
return CollectionUtils.map(StoreStatus::getStatus, APPROVING);
}
// 允许已读驳回的店铺状态
public static List<String> canReadReject() {
return CollectionUtils.map(StoreStatus::getStatus, REJECT);
}
}

View File

@ -32,8 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
ss.contact_mobile,
ss.show,
ss.status,
ss.enabled,
ss.use_out_time,
ss.apply_id,
if(su.is_real, su.real_name, su.user_name) as user_name,
su.vip_service_rate as mch_vip_service_rate
from sm_store ss
@ -52,8 +52,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.deleted == null "> and ss.deleted = false</if>
<if test="query.userName != null "> and if(su.is_real, su.real_name, su.user_name) like concat('%', #{query.userName}, '%')</if>
<if test="query.status != null "> and ss.status = #{query.status}</if>
<if test="query.enabled != null "> and ss.enabled = #{query.enabled}</if>
<if test="query.useOutTime != null "> and ss.use_out_time = #{query.useOutTime}</if>
<if test="query.applyId != null "> and ss.apply_id = #{query.applyId}</if>
<if test="query.statusList != null and query.statusList.size() > 0">
and ss.status in
<foreach collection="query.statusList" close=")" item="item" open="(" separator=",">
#{item}
</foreach>
</if>
<if test="query.keyword != null and query.keyword != ''">
and (
ss.name like concat('%', #{query.keyword}, '%')
@ -194,8 +200,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactMobile != null">`contact_mobile`,</if>
<if test="show != null">`show`,</if>
<if test="status != null">`status`,</if>
<if test="enabled != null">`enabled`,</if>
<if test="useOutTime != null">use_out_time,</if>
<if test="applyId != null">apply_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
@ -218,8 +224,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="contactMobile != null">#{contactMobile},</if>
<if test="show != null">#{show},</if>
<if test="status != null">#{status},</if>
<if test="enabled != null">#{enabled},</if>
<if test="useOutTime != null">#{useOutTime},</if>
<if test="applyId != null">#{applyId},</if>
</trim>
</insert>
@ -251,8 +257,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="data.contactMobile != null">`contact_mobile` = #{data.contactMobile},</if>
<if test="data.show != null">`show` = #{data.show},</if>
<if test="data.status != null">`status` = #{data.status},</if>
<if test="data.enabled != null">`enabled` = #{data.enabled},</if>
<if test="data.useOutTime != null">use_out_time = #{data.useOutTime},</if>
<if test="data.applyId != null">apply_id = #{data.applyId},</if>
</sql>
<update id="updateByQuery">

View File

@ -71,4 +71,9 @@ public interface StoreAssembler {
* 拼接店铺员工列表
*/
void assembleStaffList(List<StoreVo> list);
/**
* 拼接审核记录
*/
void assembleApply(List<StoreVo> list);
}

View File

@ -1,11 +1,16 @@
package com.ruoyi.ss.store.service;
import com.ruoyi.ss.store.domain.*;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import com.ruoyi.ss.store.domain.Store;
import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.store.domain.StoreNameVO;
import com.ruoyi.ss.store.domain.StoreQuery;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.domain.dto.StoreVerifyDTO;
/**
* 商户Service接口
*
@ -161,4 +166,19 @@ public interface StoreService
List<StoreNameVO> selectNameList(StoreQuery query);
List<StoreNameVO> selectNameListByIds(List<Long> storeIds);
/**
* 切换店铺展示
*/
int setShow(StoreVo store, Boolean show);
/**
* 审核店铺
*/
int verify(StoreVerifyDTO dto);
/**
* 已读店铺驳回转为未提交状态
*/
int readReject(StoreVo store);
}

View File

@ -2,6 +2,7 @@ package com.ruoyi.ss.store.service.impl;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -13,6 +14,7 @@ import org.springframework.stereotype.Service;
import com.ruoyi.common.domain.vo.LongDecimalVO;
import com.ruoyi.common.domain.vo.LongIntegerVO;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.device.service.DeviceDashboardService;
import com.ruoyi.ss.bonus.domain.Bonus;
import com.ruoyi.ss.bonus.service.BonusConverter;
import com.ruoyi.ss.device.domain.DeviceCountVO;
@ -32,6 +34,9 @@ import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.domain.vo.StoreOperatorVO;
import com.ruoyi.ss.store.service.StoreAssembler;
import com.ruoyi.ss.store.service.StoreValidator;
import com.ruoyi.ss.storeApply.domain.StoreApplyQuery;
import com.ruoyi.ss.storeApply.domain.StoreApplyVO;
import com.ruoyi.ss.storeApply.service.StoreApplyService;
import com.ruoyi.ss.storeStaff.domain.StoreStaffVO;
import com.ruoyi.ss.storeStaff.service.StoreStaffService;
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
@ -67,6 +72,12 @@ public class StoreAssemblerImpl implements StoreAssembler {
@Autowired
private PayBillService payBillService;
@Autowired
private StoreApplyService storeApplyService;
@Autowired
private DeviceDashboardService deviceDashboardService;
/**
* 拼接设备数量
*
@ -96,10 +107,14 @@ public class StoreAssemblerImpl implements StoreAssembler {
if (CollectionUtils.isEmptyElement(list)) {
return;
}
// 本日收入
// 本日订单金额
this.assembleTodayIncome(list);
// 总订单金额
this.assembleTotalIncome(list);
// 本日充值订单量
this.assembleTodayOrderCount(list);
// 总订单量
this.assembleTotalOrderCount(list);
// 本月收入
this.assembleMonthIncome(list);
// 上月收入
@ -108,8 +123,35 @@ public class StoreAssemblerImpl implements StoreAssembler {
this.assembleOnlineCount(list);
// 离线设备数量
this.assembleOfflineCount(list);
// 设备状态数量
this.assembleDeviceStatus(list);
}
/**
* 拼接设备状态数量
*
* @param list
*/
public void assembleDeviceStatus(List<StoreVo> list) {
if (CollectionUtils.isEmptyElement(list)) {
return;
}
// 查询设备状态数量并按店铺状态分组
DeviceQuery query = new DeviceQuery();
query.setStoreIds(CollectionUtils.map(list, StoreVo::getStoreId));
List<Map<String, Object>> countList = deviceDashboardService.selectCountGroupBy(query, Arrays.asList("sd.store_id", "sd.status"));
for (StoreVo store : list) {
Map<String, Object> countMap = countList.stream()
.filter(item -> Objects.equals(item.get("store_id"), store.getStoreId()))
.collect(Collectors.toMap(item -> item.get("status").toString(), item -> item.get("count")));
if (countMap != null) {
store.setDeviceStatusMap(countMap);
}
}
}
/**
* 拼接本日订单量
*
@ -136,6 +178,31 @@ public class StoreAssemblerImpl implements StoreAssembler {
}
}
/**
* 拼接总订单量
*
* @param list
*/
public void assembleTotalOrderCount(List<StoreVo> list) {
if (CollectionUtils.isEmptyElement(list)) {
return;
}
// 查询订单量
TransactionBillQuery rechargeQuery = new TransactionBillQuery();
rechargeQuery.setStoreIds(CollectionUtils.map(list, StoreVo::getStoreId));
rechargeQuery.setStatusList(TransactionBillStatus.payedOrder());
rechargeQuery.setType(TransactionBillType.RECHARGE.getType());
Map<Long, Integer> countMap = transactionBillService.selectCountGroupByStoreId(rechargeQuery)
.stream().collect(Collectors.toMap(LongIntegerVO::getKey, LongIntegerVO::getValue));
for (StoreVo store : list) {
Integer count = countMap.get(store.getStoreId());
store.setTotalOrderCount(count == null ? 0 : count);
}
}
/**
* 拼接本月收入
*
@ -224,6 +291,46 @@ public class StoreAssemblerImpl implements StoreAssembler {
}
}
/**
* 拼接总订单金额
*
* @param list
*/
public void assembleTotalIncome(List<StoreVo> list) {
if (CollectionUtils.isEmptyElement(list)) {
return;
}
// 查询支付信息
PayBillQuery query = new PayBillQuery();
query.setStoreIds(CollectionUtils.map(list, StoreVo::getStoreId));
query.setStatusList(PayBillStatus.payedList());
Map<Long, BigDecimal> billMap = payBillService.selectSumOfAmountGroupByStoreId(query)
.stream().collect(Collectors.toMap(LongDecimalVO::getKey, LongDecimalVO::getValue));
// 查询退款信息
RefundQuery refundQuery = new RefundQuery();
refundQuery.setStoreIds(CollectionUtils.map(list, StoreVo::getStoreId));
refundQuery.setPayBillBstType(PayBillBstType.RECHARGE_ORDER.getType());
refundQuery.setStatusList(RefundStatus.successList());
Map<Long, BigDecimal> refundMap = refundService.selectSumOfRefundAmountGroupByStoreId(refundQuery)
.stream().collect(Collectors.toMap(LongDecimalVO::getKey, LongDecimalVO::getValue));
for (StoreVo store : list) {
BigDecimal totalAmount = billMap.get(store.getStoreId());
BigDecimal refundAmount = refundMap.get(store.getStoreId());
// 订单金额
if (totalAmount == null) {
totalAmount = BigDecimal.ZERO;
}
// 退款金额
if (refundAmount == null) {
refundAmount = BigDecimal.ZERO;
}
store.setTotalIncome(totalAmount.subtract(refundAmount));
}
}
/**
* 拼接上月收入
*
@ -390,4 +497,23 @@ public class StoreAssemblerImpl implements StoreAssembler {
store.setStaffList(storeStaffList);
}
}
@Override
public void assembleApply(List<StoreVo> list) {
if (CollectionUtils.isEmptyElement(list)) {
return;
}
StoreApplyQuery query = new StoreApplyQuery();
query.setIds(CollectionUtils.map(list, StoreVo::getApplyId));
List<StoreApplyVO> applyList = storeApplyService.selectStoreApplyList(query);
for (StoreVo store : list) {
StoreApplyVO apply = applyList.stream()
.filter(item -> Objects.equals(item.getId(), store.getApplyId()))
.findFirst()
.orElse(null);
store.setApply(apply);
}
}
}

View File

@ -1,5 +1,6 @@
package com.ruoyi.ss.store.service.impl;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@ -25,12 +26,15 @@ import com.ruoyi.ss.store.domain.StoreCountVO;
import com.ruoyi.ss.store.domain.StoreNameVO;
import com.ruoyi.ss.store.domain.StoreQuery;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.domain.dto.StoreVerifyDTO;
import com.ruoyi.ss.store.domain.enums.StoreGroupBy;
import com.ruoyi.ss.store.domain.enums.StoreStatus;
import com.ruoyi.ss.store.mapper.StoreMapper;
import com.ruoyi.ss.store.service.StoreAssembler;
import com.ruoyi.ss.store.service.StoreService;
import com.ruoyi.ss.store.service.StoreValidator;
import com.ruoyi.ss.storeApply.domain.StoreApply;
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyStatus;
import com.ruoyi.ss.storeApply.domain.enums.StoreApplyType;
import com.ruoyi.ss.storeApply.service.StoreApplyConverter;
import com.ruoyi.ss.storeApply.service.StoreApplyService;
@ -368,7 +372,6 @@ public class StoreServiceImpl implements StoreService
@Override
public int insertAndApply(StoreBO store) {
store.setStatus(StoreStatus.APPROVING.getStatus());
store.setEnabled(false);
Integer result = transactionTemplate.execute(status -> {
int insert = this.insertSmStore(store);
@ -390,7 +393,6 @@ public class StoreServiceImpl implements StoreService
updateData.setStatus(StoreStatus.APPROVING.getStatus());
StoreQuery updateQuery = new StoreQuery();
updateQuery.setStoreId(data.getStoreId());
updateQuery.setStatus(StoreStatus.NORMAL.getStatus());
int update = this.updateByQuery(updateData, updateQuery);
ServiceUtil.assertion(update != 1, "店铺状态已发生变化,请刷新后重试");
@ -465,4 +467,88 @@ public class StoreServiceImpl implements StoreService
return list.stream().collect(Collectors.toMap(keyMapper, StoreCountVO::getCount));
}
@Override
public int setShow(StoreVo store, Boolean show) {
if (store == null) {
return 0;
}
ServiceUtil.assertion(store == null, "店铺不存在");
if (show != null && show) {
// 设置展示
ServiceUtil.assertion(!StoreStatus.canSetShow().contains(store.getStatus()), "ID为%s的店铺当前状态不允许设置展示", store.getStoreId());
Store data = new Store();
data.setShow(true);
data.setStatus(StoreStatus.APPROVING.getStatus());
StoreQuery query = new StoreQuery();
query.setStoreId(store.getStoreId());
query.setStatusList(StoreStatus.canSetShow());
return storeMapper.updateByQuery(data, query);
} else {
// 设置隐藏
ServiceUtil.assertion(!StoreStatus.canSetHide().contains(store.getStatus()), "ID为%s的店铺当前状态不允许设置隐藏", store.getStoreId());
Store data = new Store();
data.setShow(false);
data.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
StoreQuery query = new StoreQuery();
query.setStoreId(store.getStoreId());
query.setStatusList(StoreStatus.canSetHide());
return storeMapper.updateByQuery(data, query);
}
}
@Override
public int verify(StoreVerifyDTO dto) {
if (dto == null) {
return 0;
}
StoreVo store = this.selectSmStoreById(dto.getStoreId());
ServiceUtil.assertion(store == null, "ID为%s的店铺不存在", dto.getStoreId());
ServiceUtil.assertion(!StoreStatus.canVerify().contains(store.getStatus()), "ID为%s的店铺当前状态不允许审核");
Integer result = transactionTemplate.execute(status -> {
// 创建审核记录
StoreApply apply = new StoreApply();
apply.setStoreId(dto.getStoreId());
apply.setStatus(dto.getPass() != null && dto.getPass() ? StoreApplyStatus.PASS.getStatus() : StoreApplyStatus.REJECT.getStatus());
apply.setApplyType(StoreApplyType.UPDATE.getType());
apply.setVerifyId(SecurityUtils.getUserId());
apply.setVerifyTime(LocalDateTime.now());
apply.setVerifyRemark(dto.getVerifyRemark());
int applyRows = storeApplyService.insertStoreApply(apply);
ServiceUtil.assertion(applyRows != 1, "创建审核记录失败");
// 更新店铺状态
Store updateData = new Store();
updateData.setStatus(dto.getPass() != null && dto.getPass() ? StoreStatus.PASS.getStatus() : StoreStatus.REJECT.getStatus());
updateData.setApplyId(apply.getId());
StoreQuery updateQuery = new StoreQuery();
updateQuery.setStoreId(dto.getStoreId());
updateQuery.setStatusList(StoreStatus.canVerify());
int rows = storeMapper.updateByQuery(updateData, updateQuery);
ServiceUtil.assertion(rows != 1, "店铺状态已发生变化,请刷新后重试");
return rows;
});
return result == null ? 0 : result;
}
@Override
public int readReject(StoreVo store) {
if (store == null) {
return 0;
}
ServiceUtil.assertion(!StoreStatus.canReadReject().contains(store.getStatus()), "ID为%s的店铺当前状态不允许已读驳回", store.getStoreId());
Store data = new Store();
data.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
StoreQuery query = new StoreQuery();
query.setStoreId(store.getStoreId());
query.setStatusList(StoreStatus.canReadReject());
return storeMapper.updateByQuery(data, query);
}
}

View File

@ -1,5 +1,8 @@
package com.ruoyi.ss.storeApply.domain;
import java.util.List;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
@ -8,4 +11,7 @@ import lombok.Data;
*/
@Data
public class StoreApplyQuery extends StoreApplyVO {
@ApiModelProperty("审核记录ID列表")
private List<Long> ids;
}

View File

@ -46,6 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="query.storeName != null and query.storeName != ''"> and ss.name like concat('%', #{query.storeName}, '%')</if>
<if test="query.userName != null and query.userName != ''"> and su.user_name like concat('%', #{query.userName}, '%')</if>
<if test="query.verifyName != null and query.verifyName != ''"> and sys_u.user_name like concat('%', #{query.verifyName}, '%')</if>
<if test="query.ids != null and query.ids.size() > 0"> and ssa.id in
<foreach item="item" collection="query.ids" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</sql>
<select id="selectStoreApplyList" parameterType="StoreApplyQuery" resultMap="StoreApplyResult">

View File

@ -141,14 +141,14 @@ public class StoreApplyServiceImpl implements StoreApplyService
ServiceUtil.assertion(update != 1, "当前申请数据发生变化,请刷新后重试");
if (dto.getPass()) {
// 通过应用到设备
// 通过应用到店铺
int applyCount = this.applyToStore(apply);
ServiceUtil.assertion(applyCount != 1, "应用到店铺失败,请刷新后重试");
} else {
// 驳回店铺修改状态为正常
// 驳回店铺修改状态为驳回
Store store = new Store();
store.setStoreId(apply.getStoreId());
store.setStatus(StoreStatus.NORMAL.getStatus());
store.setStatus(StoreStatus.REJECT.getStatus());
int storeUpdate = storeService.updateSmStore(store);
ServiceUtil.assertion(storeUpdate != 1, "店铺状态修改失败,请刷新后重试");
}
@ -163,14 +163,13 @@ public class StoreApplyServiceImpl implements StoreApplyService
* 应用到设备中
*/
private int applyToStore(StoreApply apply) {
Store newData = apply.getNewData();
if (newData == null) {
if (apply == null) {
return 0;
}
newData.setStoreId(apply.getStoreId());
newData.setStatus(StoreStatus.NORMAL.getStatus());
newData.setEnabled(true);
return storeService.updateSmStore(newData);
Store data = new Store();
data.setStoreId(apply.getStoreId());
data.setStatus(StoreStatus.PASS.getStatus());
return storeService.updateSmStore(data);
}
@Override
@ -203,7 +202,7 @@ public class StoreApplyServiceImpl implements StoreApplyService
// 修改店铺状态
Store storeData = new Store();
storeData.setStatus(StoreStatus.NORMAL.getStatus());
storeData.setStatus(StoreStatus.WAIT_SUBMIT.getStatus());
StoreQuery storeQuery = new StoreQuery();
storeQuery.setStoreId(apply.getStoreId());
int storeUpdate = storeService.updateByQuery(storeData, storeQuery);

View File

@ -9,9 +9,10 @@ import org.apache.ibatis.annotations.Param;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.common.domain.vo.LocalDateTimeIntegerVO;
import com.ruoyi.common.domain.vo.LongDecimalVO;
import com.ruoyi.common.domain.vo.LongIntegerVO;
import com.ruoyi.dashboard.domain.vo.BillCountVo;
import com.ruoyi.dashboard.index.domain.vo.BillCountVo;
import com.ruoyi.ss.transactionBill.domain.TransactionBill;
import com.ruoyi.ss.transactionBill.domain.TransactionBillQuery;
import com.ruoyi.ss.transactionBill.domain.vo.TransactionAmountVO;
@ -75,21 +76,21 @@ public interface TransactionBillMapper {
/**
* 获取账单统计数据
*
*
* @param dto 查询条件
*/
List<BillCountVo> selectCount(@Param("query") TransactionBillQuery dto);
/**
* 充值成功
*
*
* @param billId 订单id
*/
int rechargeSuccess(@Param("billId") Long billId, @Param("payTime") Date payTime);
/**
* 通过订单编号查询订单
*
*
* @param billNo 订单编号
* @return
*/
@ -97,7 +98,7 @@ public interface TransactionBillMapper {
/**
* 订单取消
*
*
* @param billNo 订单编号
* @param status 订单取消后的状态
* @return 影响的行数
@ -106,7 +107,7 @@ public interface TransactionBillMapper {
/**
* 审核通过
*
*
* @param billId id
* @param remark 审核意见
*/
@ -114,7 +115,7 @@ public interface TransactionBillMapper {
/**
* 拒绝提现
*
*
* @param billId id
* @param remark 审核意见
*/
@ -122,28 +123,28 @@ public interface TransactionBillMapper {
/**
* 发起提现打款打款中...
*
*
* @param billId 提现订单id
*/
int doPayWithdraw(Long billId);
/**
* 提现成功
*
*
* @param billId id
*/
int withdrawSuccess(@Param("billId") Long billId, @Param("payTime") LocalDateTime payTime);
/**
* 提现失败
*
*
* @param billId id
*/
int withdrawFailed(Long billId);
/**
* 更新状态为支付中
*
*
* @param billId
* @return
*/
@ -154,7 +155,7 @@ public interface TransactionBillMapper {
/**
* 修改设备充值状态
*
*
* @param billIds 需要修改的ID
* @param status 修改后的设备充值状态
*/
@ -172,7 +173,7 @@ public interface TransactionBillMapper {
/**
* 添加退款金额
*
*
* @param billId 订单ID
* @param refundAmount 退款金额
*/
@ -201,7 +202,7 @@ public interface TransactionBillMapper {
/**
* 查询订单总金额
*
*
* @param query
* @return
*/
@ -257,4 +258,9 @@ public interface TransactionBillMapper {
* 查询每日订单金额
*/
List<LocalDateDecimalVO> selectDailyMoney(@Param("query") TransactionBillQuery query);
/**
* 查询每日订单量
*/
List<LocalDateTimeIntegerVO> selectDailyCount(@Param("query") TransactionBillQuery query);
}

View File

@ -358,7 +358,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where stb.bill_id = #{billId}
</select>
<resultMap id="BillCountVo" type="com.ruoyi.dashboard.domain.vo.BillCountVo" autoMapping="true">
<resultMap id="BillCountVo" type="com.ruoyi.dashboard.index.domain.vo.BillCountVo" autoMapping="true">
<result property="createDate" column="create_date"/>
<result property="createHour" column="create_hour"/>
<result property="createYear" column="create_year"/>
@ -977,4 +977,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
group by `key`
</select>
<!-- selectDailyCount -->
<resultMap id="LocalDateTimeIntegerVOMap" type="LocalDateTimeIntegerVO">
<result property="value" column="value" typeHandler="com.ruoyi.system.mapper.typehandler.NonNullIntegerTypeHandler"/>
</resultMap>
<select id="selectDailyCount" resultMap="LocalDateTimeIntegerVOMap">
select
date(create_time) as `key`,
count(stb.bill_id) as `value`
from sm_transaction_bill stb
<where>
<include refid="searchCondition"/>
</where>
group by `key`
</select>
</mapper>

View File

@ -9,9 +9,10 @@ import java.util.function.Function;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.common.domain.vo.LocalDateTimeIntegerVO;
import com.ruoyi.common.domain.vo.LongDecimalVO;
import com.ruoyi.common.domain.vo.LongIntegerVO;
import com.ruoyi.dashboard.domain.vo.BillCountVo;
import com.ruoyi.dashboard.index.domain.vo.BillCountVo;
import com.ruoyi.ss.device.domain.vo.DeviceVO;
import com.ruoyi.ss.payBill.domain.vo.DoPayVO;
import com.ruoyi.ss.transactionBill.domain.TransactionBill;
@ -86,7 +87,7 @@ public interface TransactionBillService {
/**
* 获取账单统计
*
*
* @param dto
* @return
*/
@ -102,7 +103,7 @@ public interface TransactionBillService {
/**
* 取消充值订单
*
*
* @param billNo 订单编号
* @param status 取消后的状态
*/
@ -117,7 +118,7 @@ public interface TransactionBillService {
/**
* 获取未支付的充值订单
*
*
* @return 订单列表
*/
List<TransactionBillVO> selectNoPayedRecharge();
@ -143,7 +144,7 @@ public interface TransactionBillService {
/**
* 查询商户统计信息
*
*
* @param dto 查询条件
* @return 统计信息
*/
@ -151,7 +152,7 @@ public interface TransactionBillService {
/**
* 刷新订单支付结果
*
*
* @param billId
*/
int refreshPayResult(Long billId);
@ -165,7 +166,7 @@ public interface TransactionBillService {
/**
* 查询设备充值失败列表
*
*
* @param userId
* @return
*/
@ -182,7 +183,7 @@ public interface TransactionBillService {
/**
* 查询数量并映射
*
*
* @param query 查询条件
* @param keyMapper 映射方法
*/
@ -191,7 +192,7 @@ public interface TransactionBillService {
/**
* 蓝牙充值成功
*
*
* @param billNo
* @return
*/
@ -204,7 +205,7 @@ public interface TransactionBillService {
/**
* 根据条件更新
*
*
* @param data
* @param query
*/
@ -287,7 +288,7 @@ public interface TransactionBillService {
/**
* 查询订单总金额
*
*
* @param query
* @return
*/
@ -317,7 +318,7 @@ public interface TransactionBillService {
/**
* 收取商户查看用户手机号的价格
*
*
* @param bill
* @return
*/
@ -380,4 +381,9 @@ public interface TransactionBillService {
*/
List<LocalDateDecimalVO> selectDailyMoney(TransactionBillQuery query);
/**
* 查询每日订单量
*/
List<LocalDateTimeIntegerVO> selectDailyCount(TransactionBillQuery query);
}

View File

@ -29,6 +29,7 @@ import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.redis.RedisLock;
import com.ruoyi.common.core.redis.enums.RedisLockKey;
import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.common.domain.vo.LocalDateTimeIntegerVO;
import com.ruoyi.common.domain.vo.LongDecimalVO;
import com.ruoyi.common.domain.vo.LongIntegerVO;
import com.ruoyi.common.enums.ServiceCode;
@ -39,7 +40,7 @@ import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.common.utils.SnowFlakeUtil;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.domain.vo.BillCountVo;
import com.ruoyi.dashboard.index.domain.vo.BillCountVo;
import com.ruoyi.iot.domain.response.CommandResponse;
import com.ruoyi.iot.service.IotService;
import com.ruoyi.ss.account.domain.AccountVO;
@ -278,7 +279,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
/**
* 查询账单统计
*
*
* @param dto
* @return
*/
@ -1279,7 +1280,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
/**
* 记录下操作后的余额
*
*
* @param billId 订单id
* @param balance 余额
*/
@ -1292,7 +1293,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
/**
* 取消充值订单
*
*
* @param billNo 订单编号
* @param status 取消后的状态
*/
@ -1508,7 +1509,7 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
/**
* 更新分成的退款金额
*
*
* @param bonusList 分成列表
* @param refundAmount 本次退款金额
* @param billAmount 订单总金额
@ -1876,4 +1877,9 @@ public class TransactionBillServiceImpl implements TransactionBillService, After
public List<LocalDateDecimalVO> selectDailyMoney(TransactionBillQuery query) {
return transactionBillMapper.selectDailyMoney(query);
}
@Override
public List<LocalDateTimeIntegerVO> selectDailyCount(TransactionBillQuery query) {
return transactionBillMapper.selectDailyCount(query);
}
}

View File

@ -218,6 +218,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="useVip">
update ss_vip sv
set sv.round_count = sv.round_count + 1,
sv.total_count = sv.total_count + 1,
sv.surplus_count = sv.surplus_count - 1
where sv.id = #{id}
and sv.deleted = false
@ -229,6 +230,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="unUseVip">
update ss_vip sv
set sv.round_count = if(sv.round_count > 0, sv.round_count - 1, 0),
sv.total_count = if(sv.total_count > 0, sv.total_count - 1, 0),
sv.surplus_count = sv.surplus_count + 1
where sv.id = #{id}
and sv.deleted = false

View File

@ -59,7 +59,17 @@ public class VipValidatorImpl implements VipValidator {
@Override
public boolean canView(VipVO vo, Long userId) {
return vo != null && userId != null && Objects.equals(vo.getStoreMchId(), userId);
return isUser(vo, userId) || isMch(vo, userId);
}
// 是否是会员的商户
private boolean isMch(VipVO vo, Long userId) {
return vo != null && userId != null && Objects.equals(vo.getVipMchId(), userId);
}
// 是否是会员的用户
private boolean isUser(VipVO vo, Long userId) {
return vo != null && userId != null && Objects.equals(vo.getUserId(), userId);
}
@Override
@ -74,7 +84,7 @@ public class VipValidatorImpl implements VipValidator {
* 是否允许操作VIP
*/
private boolean canOperate(VipVO vo, Long userId) {
return vo != null && userId != null && Objects.equals(vo.getVipMchId(), userId);
return this.isMch(vo, userId);
}
/**

View File

@ -25,11 +25,6 @@ public class VipLevelValidatorImpl implements VipLevelValidator {
ServiceUtil.assertion(vo.getLimitCount() == null, "限制次数不能为空");
ServiceUtil.assertion(vo.getLimitCount() <= 0, "限制次数不能小于等于0");
}
// 判断店铺是否生效的店铺
StoreVo store = storeService.selectSmStoreById(vo.getStoreId());
ServiceUtil.assertion(store == null, "ID为%s的店铺不存在", vo.getStoreId());
ServiceUtil.assertion(store.getEnabled() == null || !store.getEnabled(), "店铺【%s】暂未生效请等待审核通过后重试", store.getName());
}
}

View File

@ -8,7 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.service.DashboardService;
import com.ruoyi.dashboard.index.service.DashboardService;
import com.ruoyi.ss.channel.domain.vo.ChannelNameVO;
import com.ruoyi.ss.channel.service.ChannelService;
import com.ruoyi.ss.channelWithdraw.domain.vo.ChannelWithdrawNameVO;
@ -50,7 +50,7 @@ public class ReconciliationDateTask {
log.error("渠道列表为空");
return;
}
while (now.isAfter(startDay)) {
// 支付渠道

View File

@ -14,7 +14,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.service.DashboardService;
import com.ruoyi.dashboard.index.service.DashboardService;
import com.ruoyi.ss.bonus.domain.BonusQuery;
import com.ruoyi.ss.bonus.domain.enums.BonusArrivalType;
import com.ruoyi.ss.bonus.domain.enums.BonusStatus;

View File

@ -29,6 +29,7 @@ import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.store.domain.StoreQuery;
import com.ruoyi.ss.store.domain.StoreView;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.domain.enums.StoreStatus;
import com.ruoyi.ss.store.service.StoreAssembler;
import com.ruoyi.ss.store.service.StoreService;
import com.ruoyi.ss.store.service.StoreValidator;
@ -71,6 +72,8 @@ public class AppStoreController extends BaseController {
storeAssembler.assembleDeviceCount(list);
// 拼接营收数据
storeAssembler.assembleRevenue(list);
// 拼接审核记录
storeAssembler.assembleApply(list);
return getDataTable(list);
}
@ -88,16 +91,7 @@ public class AppStoreController extends BaseController {
}
data = data.filterUpdateByApp();
ServiceUtil.assertion(storeValidator.preUpdateByApp(data));
// 若店铺在地图上显示则需要审核
Boolean finalShow = data.getShow() == null ? store.getShow() : data.getShow();
if (finalShow != null && finalShow) {
return toAjax(storeService.updateApply(data));
}
// 若店铺不在地图上显示则直接修改
else {
return toAjax(storeService.updateSmStore(data));
}
return toAjax(storeService.updateSmStore(data));
}
@ApiOperation("修改店铺配置")
@ -135,12 +129,7 @@ public class AppStoreController extends BaseController {
store = store.filterCreateByApp();
store.setUserId(getUserId());
ServiceUtil.assertion(storeValidator.preCreateByApp(store));
// 若不需要展示则直接新增
if (store.getShow() == null || !store.getShow()) {
return toAjax(storeService.insertSmStore(store));
} else {
return toAjax(storeService.insertAndApply(store));
}
return toAjax(storeService.insertSmStore(store));
}
@ApiOperation("调整店铺排序")
@ -168,7 +157,7 @@ public class AppStoreController extends BaseController {
@Anonymous
public AjaxResult listNearBy(@Validated(ValidGroup.Query.class) StoreQuery query) {
query.setShow(true);
query.setEnabled(true);
query.setStatus(StoreStatus.PASS.getStatus());
List<StoreVo> list = storeService.listNearBy(query);
storeAssembler.assembleDeviceCount(list);
return success(list);
@ -195,6 +184,7 @@ public class AppStoreController extends BaseController {
storeAssembler.assembleDeviceCount(storeList); // 总设备数量
storeAssembler.assembleRevenue(storeList); // 经营信息
storeAssembler.assembleOperator(storeList, getUserId());
storeAssembler.assembleApply(storeList); // 审核记录
return success(store);
}
@ -209,4 +199,24 @@ public class AppStoreController extends BaseController {
return success(storeService.setDefault(userId, storeId));
}
@ApiOperation("切换店铺展示")
@PutMapping("/setShow")
public AjaxResult setShow(Long storeId, Boolean show) {
StoreVo store = storeService.selectSmStoreById(storeId);
if (!storeValidator.canOperaStore(store, getUserId())) {
return error("您无权操作ID为" + storeId + "的店铺");
}
return toAjax(storeService.setShow(store, show));
}
@ApiOperation("已读店铺驳回")
@PutMapping("/readReject")
public AjaxResult readReject(Long storeId) {
StoreVo store = storeService.selectSmStoreById(storeId);
if (!storeValidator.canOperaStore(store, getUserId())) {
return error("您无权操作ID为" + storeId + "的店铺");
}
return toAjax(storeService.readReject(store));
}
}

View File

@ -32,7 +32,7 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.enums.OperatorType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.dashboard.domain.vo.BillCountVo;
import com.ruoyi.dashboard.index.domain.vo.BillCountVo;
import com.ruoyi.ss.device.service.DeviceService;
import com.ruoyi.ss.device.service.DeviceValidator;
import com.ruoyi.ss.suit.domain.enums.SuitFeeType;

View File

@ -8,9 +8,9 @@ import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dashboard.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.domain.dto.StoreDailyIncomeQuery;
import com.ruoyi.dashboard.service.DashboardService;
import com.ruoyi.dashboard.index.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.index.domain.dto.StoreDailyIncomeQuery;
import com.ruoyi.dashboard.index.service.DashboardService;
import com.ruoyi.ss.store.service.StoreValidator;
import io.swagger.annotations.ApiOperation;

View File

@ -37,7 +37,7 @@ public class MchVipController extends BaseController {
@GetMapping("/list")
public TableDataInfo list(VipQuery query) {
startPage();
query.setStoreMchId(getUserId());
query.setVipMchId(getUserId());
return getDataTable(vipService.selectVipList(query));
}
@ -46,7 +46,7 @@ public class MchVipController extends BaseController {
public AjaxResult getById(@PathVariable Long id) {
VipVO vo = vipService.selectVipById(id);
if (!vipValidator.canView(vo, getUserId())) {
return error("您无权查看信息");
return error("您无权查看ID为" + id + "的会员信息");
}
return success(vo);
}

View File

@ -18,12 +18,12 @@ import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.domain.vo.LocalDateDecimalVO;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.collection.CollectionUtils;
import com.ruoyi.dashboard.domain.dto.BillDailyAmountQuery;
import com.ruoyi.dashboard.domain.dto.DailyIncomeGroupByStoreQuery;
import com.ruoyi.dashboard.domain.dto.ServiceIncomeQuery;
import com.ruoyi.dashboard.domain.vo.BriefVo;
import com.ruoyi.dashboard.domain.vo.DashboardBonusGroupByMchVO;
import com.ruoyi.dashboard.service.DashboardService;
import com.ruoyi.dashboard.index.domain.dto.BillDailyAmountQuery;
import com.ruoyi.dashboard.index.domain.dto.DailyIncomeGroupByStoreQuery;
import com.ruoyi.dashboard.index.domain.dto.ServiceIncomeQuery;
import com.ruoyi.dashboard.index.domain.vo.BriefVo;
import com.ruoyi.dashboard.index.domain.vo.DashboardBonusGroupByMchVO;
import com.ruoyi.dashboard.index.service.DashboardService;
import com.ruoyi.ss.balancePeriod.domain.SmBalancePeriodQuery;
import com.ruoyi.ss.balancePeriod.service.ISmBalancePeriodService;
import com.ruoyi.ss.bonus.domain.BonusQuery;
@ -46,7 +46,7 @@ import io.swagger.annotations.ApiOperation;
/**
* 报表Controller
*
*
* @author
* 2024/3/6
*/
@ -94,7 +94,7 @@ public class SmDashboardController extends BaseController {
/**
* 获取账单分时统计数据
*
*
* @param dto 查询条件
* @return 统计数据
*/

View File

@ -3,33 +3,36 @@ package com.ruoyi.web.controller.ss;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.store.domain.StoreQuery;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.service.StoreAssembler;
import com.ruoyi.ss.store.service.StoreValidator;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.ss.store.service.StoreService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.domain.ValidGroup;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.ServiceUtil;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.ss.store.domain.StoreBO;
import com.ruoyi.ss.store.domain.StoreQuery;
import com.ruoyi.ss.store.domain.StoreVo;
import com.ruoyi.ss.store.domain.dto.StoreVerifyDTO;
import com.ruoyi.ss.store.service.StoreAssembler;
import com.ruoyi.ss.store.service.StoreService;
import com.ruoyi.ss.store.service.StoreValidator;
/**
* 商户Controller
@ -140,4 +143,15 @@ public class StoreController extends BaseController
ServiceUtil.assertion(storeValidator.preLogicDel(ids));
return toAjax(storeService.logicDel(ids));
}
/**
* 审核店铺
*/
@PreAuthorize("@ss.hasPermi('ss.store:verify')")
@Log(title = "店铺审核", businessType = BusinessType.UPDATE)
@PutMapping("/verify")
public AjaxResult verify(@RequestBody StoreVerifyDTO dto)
{
return toAjax(storeService.verify(dto));
}
}

View File

@ -2,8 +2,8 @@ package com.ruoyi.web.controller.staff;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.dashboard.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.service.DashboardService;
import com.ruoyi.dashboard.index.domain.dto.BusinessStatisticsQuery;
import com.ruoyi.dashboard.index.service.DashboardService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;