fix: 订单列表根据商户名称和退款状态查询
parent
676b7c73a1
commit
c6240b23b5
|
@ -29,5 +29,12 @@ public class RefundRequest implements Serializable {
|
|||
@Schema(description = "退款类型1:同意退款,2:拒绝退款、3:发起退款")
|
||||
@NotNull(message = "退款类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "退款类型")
|
||||
private Integer refundType;
|
||||
@Schema(description = "退款类型名称")
|
||||
private String refundName;
|
||||
@Schema(description = "会员退款理由")
|
||||
private String memberReason;
|
||||
@Schema(description = "管理员理由")
|
||||
private String adminReason;
|
||||
}
|
||||
|
|
|
@ -35,4 +35,6 @@ public class StatementAllRequest implements Serializable {
|
|||
@Schema(description = "1、当日2、上周3、上月4、累计")
|
||||
private String type;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
|
|
|
@ -27,4 +27,6 @@ public class StatementPageRequest extends PageParam {
|
|||
@Schema(description = "结束执行时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime endTime;
|
||||
|
||||
private Long tenantId;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,9 @@ import cn.iocoder.yudao.module.shop.service.recharge.RechargeOrderInfoService;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -28,11 +30,13 @@ import java.io.IOException;
|
|||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
||||
|
||||
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*;
|
||||
|
@ -112,7 +116,7 @@ public class RechargeOrderController {
|
|||
@PreAuthorize("@ss.hasPermission('shop:recharge-order:query')")
|
||||
@TenantIgnore
|
||||
public CommonResult<PageResult<RechargeOrderRespVO>> getRechargeOrderPage(@Valid RechargeOrderPageReqVO pageVO) {
|
||||
if(!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())){
|
||||
if (!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())) {
|
||||
pageVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
|
||||
}
|
||||
PageResult<RechargeOrderRespVO> pageResult = rechargeOrderService.getRechargeOrderPage(pageVO);
|
||||
|
@ -124,7 +128,7 @@ public class RechargeOrderController {
|
|||
@PreAuthorize("@ss.hasPermission('shop:recharge-order:query')")
|
||||
@TenantIgnore
|
||||
public CommonResult<PageResult<PromoterDrawVO>> getRechargeOrderPage(@RequestBody PromoterDrawReqVO pageVO) {
|
||||
if(!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())){
|
||||
if (!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())) {
|
||||
pageVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
|
||||
}
|
||||
PageResult<PromoterDrawVO> pageResult = rechargeOrderService.findPromoterDrawPage(pageVO);
|
||||
|
@ -137,7 +141,7 @@ public class RechargeOrderController {
|
|||
@OperateLog(type = EXPORT)
|
||||
@TenantIgnore
|
||||
public void getRechargeOrderExcel(@Valid PromoterDrawReqExcelVO excelVO, HttpServletResponse response) throws IOException {
|
||||
if(!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())){
|
||||
if (!TenantContextHolder.ID_SYSTEM.equals(SecurityFrameworkUtils.getLoginUser().getTenantId())) {
|
||||
excelVO.setTenantId(SecurityFrameworkUtils.getLoginUser().getTenantId());
|
||||
}
|
||||
List<PromoterDrawExcelVO> list = rechargeOrderService.findPromoterDrawExcel(excelVO);
|
||||
|
@ -162,6 +166,7 @@ public class RechargeOrderController {
|
|||
|
||||
Excel.orderExport(response, list, infoList);
|
||||
}
|
||||
|
||||
@TenantIgnore
|
||||
@PreAuthenticated
|
||||
@Operation(summary = "退款")
|
||||
|
@ -169,25 +174,28 @@ public class RechargeOrderController {
|
|||
@PreAuthorize("@ss.hasPermission('shop:recharge-order:refund')")
|
||||
public CommonResult<Object> memberRefund(@Valid @RequestBody RefundRequest request, HttpServletRequest servletRequest) throws Exception {
|
||||
log.info("memberRefund会员退款===>{}", request);
|
||||
Object obj=null;
|
||||
Object obj = null;
|
||||
//直接退款
|
||||
if(request.getType()==3){
|
||||
if (request.getType() == 3) {
|
||||
RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO();
|
||||
vo.setId(request.getOrderId());
|
||||
vo.setRefundStatus(3);
|
||||
vo.setAdminReason(request.getAdminReason());
|
||||
rechargeOrderService.updateRechargeOrderStatus(vo);
|
||||
obj = storeOrderService.memberRefund(request, servletRequest);
|
||||
//拒绝退款
|
||||
}else if(request.getType()==2){
|
||||
} else if (request.getType() == 2) {
|
||||
RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO();
|
||||
vo.setId(request.getOrderId());
|
||||
vo.setRefundStatus(4);
|
||||
vo.setAdminReason(request.getAdminReason());
|
||||
rechargeOrderService.updateRechargeOrderStatus(vo);
|
||||
//同意
|
||||
}else if(request.getType()==1){
|
||||
} else if (request.getType() == 1) {
|
||||
RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO();
|
||||
vo.setId(request.getOrderId());
|
||||
vo.setRefundStatus(3);
|
||||
vo.setAdminReason(request.getAdminReason());
|
||||
rechargeOrderService.updateRechargeOrderStatus(vo);
|
||||
obj = storeOrderService.memberRefund(request, servletRequest);
|
||||
}
|
||||
|
|
|
@ -14,5 +14,8 @@ public class RechargeOrderUpdateReqVO extends RechargeOrderBaseVO {
|
|||
@Schema(description = "订单ID", required = true, example = "17164")
|
||||
@NotNull(message = "订单ID不能为空")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 管理员理由
|
||||
*/
|
||||
private String adminReason;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Title:TenantListVo
|
||||
* @Description: TODO
|
||||
* @author: tangqian
|
||||
* @date: 2023/6/19 10:29
|
||||
* @version: V1.0.0
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class TenantListVo implements Serializable {
|
||||
private static final long serialVersionUID = 8280705984308676562L;
|
||||
private Long id;
|
||||
private String name;
|
||||
}
|
|
@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
|||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatementAllReqVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatisticsExcelVO;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatisticsPageVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.TenantListVo;
|
||||
import cn.iocoder.yudao.module.shop.request.order.StatementAllRequest;
|
||||
import cn.iocoder.yudao.module.shop.request.order.StatementPageRequest;
|
||||
import cn.iocoder.yudao.module.shop.service.order.StoreOrderService;
|
||||
|
@ -74,7 +75,7 @@ public class StatementController {
|
|||
if (!CollectionUtils.isEmpty(statistics.getList())) {
|
||||
statistics.getList().forEach(e -> {
|
||||
StatisticsExcelVO vo = new StatisticsExcelVO();
|
||||
BeanUtils.copyProperties(e,vo);
|
||||
BeanUtils.copyProperties(e, vo);
|
||||
list.add(vo);
|
||||
});
|
||||
}
|
||||
|
@ -82,4 +83,10 @@ public class StatementController {
|
|||
ExcelUtils.write(response, "导出数据统计(根据租户统计).xls", "数据", StatisticsExcelVO.class, list);
|
||||
}
|
||||
|
||||
@Operation(summary = "获取租户")
|
||||
@RequestMapping(value = "/getTenantList", method = RequestMethod.GET)
|
||||
@TenantIgnore
|
||||
public CommonResult<List<TenantListVo>> getTenantList() {
|
||||
return CommonResult.success(storeOrderService.getTenantList());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package cn.iocoder.yudao.module.shop.dal.dataobject.recharge;
|
||||
|
||||
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
@ -180,4 +181,29 @@ public class RechargeOrderDO extends TenantBaseDO {
|
|||
*/
|
||||
private Long deptId;
|
||||
|
||||
// 用于微信支付成功回调失败-补单逻辑
|
||||
/**
|
||||
* 补单标记
|
||||
*/
|
||||
private Integer isReplenishment;
|
||||
/**
|
||||
* 补单标记说明
|
||||
*/
|
||||
private String replenishmentName;
|
||||
/**
|
||||
* 退款类型
|
||||
*/
|
||||
private Integer refundType;
|
||||
/**
|
||||
* 退款类型名称
|
||||
*/
|
||||
private String refundName;
|
||||
/**
|
||||
* 会员退款理由
|
||||
*/
|
||||
private String memberReason;
|
||||
/**
|
||||
* 管理员理由
|
||||
*/
|
||||
private String adminReason;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ public interface StoreOrderMapper extends BaseMapperX<StoreOrder> {
|
|||
|
||||
/**
|
||||
* 核销详情 月数据
|
||||
*
|
||||
* @param request 分页和日期
|
||||
* @return 月数据
|
||||
*/
|
||||
|
@ -55,6 +56,7 @@ public interface StoreOrderMapper extends BaseMapperX<StoreOrder> {
|
|||
|
||||
/**
|
||||
* 订单统计详情 price
|
||||
*
|
||||
* @param pram 时间区间参数
|
||||
* @return 月数据
|
||||
*/
|
||||
|
@ -62,6 +64,7 @@ public interface StoreOrderMapper extends BaseMapperX<StoreOrder> {
|
|||
|
||||
/**
|
||||
* 订单统计详情 订单量
|
||||
*
|
||||
* @param pram 时间区间参数
|
||||
* @return 月数据
|
||||
*/
|
||||
|
@ -69,12 +72,13 @@ public interface StoreOrderMapper extends BaseMapperX<StoreOrder> {
|
|||
|
||||
/**
|
||||
* 获取佣金相关数据
|
||||
*
|
||||
* @param uid 用户uid
|
||||
* @param spreadId 推广人uid
|
||||
*/
|
||||
OrderBrokerageData getBrokerageData(@Param("uid") Long uid, @Param("spreadId") Integer spreadId);
|
||||
|
||||
BigDecimal shoppingOrderCount(@Param("startDate") LocalDateTime startDate, @Param("endDate")LocalDateTime endDate,@Param("promoterId") Long promoterId);
|
||||
BigDecimal shoppingOrderCount(@Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate, @Param("promoterId") Long promoterId);
|
||||
|
||||
List<StatementAllReqDataVo> statisticsAll(@Param("startTime")LocalDateTime startTime, @Param("endTime")LocalDateTime endTime);
|
||||
List<StatementAllReqDataVo> statisticsAll(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("tenantId") Long tenantId);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.shop.service.order;
|
|||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatementAllReqVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatisticsPageVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.TenantListVo;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO;
|
||||
import cn.iocoder.yudao.module.shop.request.member.OrderContentRequest;
|
||||
import cn.iocoder.yudao.module.shop.request.member.OrderPayRequest;
|
||||
import cn.iocoder.yudao.module.shop.request.member.RefundRequest;
|
||||
|
@ -408,4 +410,8 @@ public interface StoreOrderService extends IService<StoreOrder> {
|
|||
StatementAllReqVo statisticsAll(StatementAllRequest request);
|
||||
|
||||
PageInfo<StatisticsPageVo> statistics(StatementPageRequest request);
|
||||
|
||||
List<TenantListVo> getTenantList();
|
||||
|
||||
void addPhone(RechargeOrderDO orderDO, String outTradeNo);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO;
|
|||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatementAllReqDataVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatementAllReqVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.StatisticsPageVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.TenantListVo;
|
||||
import cn.iocoder.yudao.module.shop.controller.app.recharge.vo.PhoneRecordAdd;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.express.ExpressDO;
|
||||
import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder;
|
||||
|
@ -97,6 +98,8 @@ import java.util.*;
|
|||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_TENANT_ID;
|
||||
|
||||
/**
|
||||
* StoreOrderServiceImpl 接口实现
|
||||
* +----------------------------------------------------------------------
|
||||
|
@ -167,6 +170,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
|||
private StoreOrderMapper storeOrderMapper;
|
||||
@Autowired
|
||||
private TenantApi tenantApi;
|
||||
|
||||
/**
|
||||
* 列表(PC)
|
||||
*
|
||||
|
@ -1194,7 +1198,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object aliNotify(HttpServletRequest request, HttpServletResponse response) throws IOException, AlipayApiException {
|
||||
public Object aliNotify(HttpServletRequest request, HttpServletResponse response) throws AlipayApiException {
|
||||
Map<String, String> params = new HashMap<String, String>();
|
||||
Map requestParams = request.getParameterMap();
|
||||
for (Iterator iter = requestParams.keySet().iterator(); iter.hasNext(); ) {
|
||||
|
@ -1427,6 +1431,9 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
|||
public Boolean memberApplyRefund(RefundRequest request) {
|
||||
RechargeOrderDO orderDO = rechargeOrderMapper.selectById(request.getOrderId());
|
||||
orderDO.setRefundStatus(1);
|
||||
orderDO.setRefundType(request.getRefundType());
|
||||
orderDO.setRefundName(request.getRefundName());
|
||||
orderDO.setMemberReason(request.getMemberReason());
|
||||
return rechargeOrderMapper.updateById(orderDO) > 0;
|
||||
}
|
||||
|
||||
|
@ -1463,7 +1470,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
|||
request.setEndTime(LocalDateTimeUtil.endOfDay(lastDay));
|
||||
}
|
||||
}
|
||||
List<StatementAllReqDataVo> dataVos = mapper.statisticsAll(request.getStartTime(), request.getEndTime());
|
||||
List<StatementAllReqDataVo> dataVos = mapper.statisticsAll(request.getStartTime(), request.getEndTime(), request.getTenantId());
|
||||
if (!CollectionUtils.isEmpty(dataVos)) {
|
||||
reqVo.setTotalMoney(BigDecimal.valueOf(dataVos.stream().filter(x -> x.getRefundStatus() != 2).mapToDouble(StatementAllReqDataVo::getPrice).sum()));
|
||||
reqVo.setTotalNum(dataVos.size());
|
||||
|
@ -1482,13 +1489,14 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
|||
pageDTO.setName(request.getName());
|
||||
pageDTO.setPageNo(request.getPageNo());
|
||||
pageDTO.setPageSize(request.getPageSize());
|
||||
pageDTO.setTenantId(request.getTenantId());
|
||||
PageResult<TenantDTO> tenantPage = tenantApi.getTenantPage(pageDTO);
|
||||
if (!CollectionUtils.isEmpty(tenantPage.getList())) {
|
||||
page.setTotal(tenantPage.getTotal());
|
||||
List<StatementAllReqDataVo> dataVos = mapper.statisticsAll(request.getStartTime(), request.getEndTime());
|
||||
List<StatementAllReqDataVo> dataVos = mapper.statisticsAll(request.getStartTime(), request.getEndTime(), null);
|
||||
Map<Long, List<StatementAllReqDataVo>> collect = dataVos.stream().collect(Collectors.groupingBy(StatementAllReqDataVo::getTenantId));
|
||||
List<StatisticsPageVo> vos = new ArrayList<>();
|
||||
tenantPage.getList().forEach(e->{
|
||||
tenantPage.getList().forEach(e -> {
|
||||
List<StatementAllReqDataVo> dataVos1 = collect.get(e.getId());
|
||||
StatisticsPageVo vo = new StatisticsPageVo();
|
||||
if (!CollectionUtils.isEmpty(dataVos1)) {
|
||||
|
@ -1508,6 +1516,26 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
|
|||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TenantListVo> getTenantList() {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
List<TenantDTO> tenantList = tenantApi.getTenantList(tenantId.equals(1L) ? null : tenantId);
|
||||
List<TenantListVo> list = new ArrayList<>();
|
||||
if (!CollectionUtils.isEmpty(tenantList)) {
|
||||
tenantList.forEach(e -> {
|
||||
TenantListVo vo = new TenantListVo();
|
||||
BeanUtils.copyProperties(e, vo);
|
||||
list.add(vo);
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addPhone(RechargeOrderDO orderDO, String outTradeNo) {
|
||||
addPhoneRecord(orderDO, outTradeNo);
|
||||
}
|
||||
|
||||
|
||||
private RechargeOrderDO initializeOrder(OrderContentRequest request, String code, MemberUserRespDTO user, PromoterDTO promoterDTO) {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
|
|
|
@ -125,7 +125,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
|||
public PageResult<RechargeOrderRespVO> getRechargeOrderPage(RechargeOrderPageReqVO pageReqVO) {
|
||||
Page<RechargeOrderRespVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
pageReqVO.setTenantId(tenantId);
|
||||
pageReqVO.setTenantId(null != pageReqVO.getTenantId() ? pageReqVO.getTenantId() : tenantId);
|
||||
|
||||
rechargeOrderMapper.findListPage(page, pageReqVO);
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
|
@ -204,7 +204,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
|||
@Override
|
||||
public List<RechargeOrderExcelVO> findListExcel(RechargeOrderExportReqVO data) {
|
||||
Long tenantId = TenantContextHolder.getTenantId();
|
||||
data.setTenantId(tenantId);
|
||||
data.setTenantId(null != data.getTenantId() ? data.getTenantId() : tenantId);
|
||||
return rechargeOrderMapper.findListExcel(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,15 +3,25 @@
|
|||
<mapper namespace="cn.iocoder.yudao.module.shop.dal.mysql.order.StoreOrderMapper">
|
||||
|
||||
<select id="getTotalPrice" resultType="java.math.BigDecimal">
|
||||
select sum(pay_price) from eb_store_order where ${where} and refund_status = 0
|
||||
select sum(pay_price)
|
||||
from eb_store_order
|
||||
where ${where}
|
||||
and refund_status = 0
|
||||
</select>
|
||||
<select id="getRefundPrice" resultType="java.math.BigDecimal">
|
||||
select sum(refund_price) from eb_store_order where ${where} and refund_status = 2
|
||||
select sum(refund_price)
|
||||
from eb_store_order
|
||||
where ${where}
|
||||
and refund_status = 2
|
||||
</select>
|
||||
<select id="getRefundTotal" resultType="java.lang.Integer">
|
||||
select count(id) from eb_store_order where ${where} and refund_status = 2
|
||||
select count(id)
|
||||
from eb_store_order
|
||||
where ${where}
|
||||
and refund_status = 2
|
||||
</select>
|
||||
<select id="getOrderVerificationDetail" parameterType="cn.iocoder.yudao.module.shop.request.order.StoreOrderStaticsticsRequest"
|
||||
<select id="getOrderVerificationDetail"
|
||||
parameterType="cn.iocoder.yudao.module.shop.request.order.StoreOrderStaticsticsRequest"
|
||||
resultType="cn.iocoder.yudao.module.shop.vo.order.StoreStaffDetail">
|
||||
select sum(o.`pay_price`) as price, count(o.`id`) as count, DATE_FORMAT(o.`create_time`, '%Y-%m-%d') as time
|
||||
from `eb_store_order` o
|
||||
|
@ -24,23 +34,31 @@
|
|||
</if>
|
||||
GROUP by DATE_FORMAT(o.`create_time`, '%Y-%m-%d') order by o.`create_time` desc limit #{ pageNo },#{pageSize};
|
||||
</select>
|
||||
<select id="getOrderStatisticsPriceDetail" parameterType="cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram"
|
||||
<select id="getOrderStatisticsPriceDetail"
|
||||
parameterType="cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram"
|
||||
resultType="cn.iocoder.yudao.module.shop.response.order.StoreOrderStatisticsChartItemResponse">
|
||||
select sum(o.pay_price) as num,date_format(o.create_time, '%Y-%m-%d') as time
|
||||
select sum(o.pay_price) as num, date_format(o.create_time, '%Y-%m-%d') as time
|
||||
from eb_store_order o
|
||||
where o.is_del >= 0 and o.paid >= 1 and o.refund_status >= 0
|
||||
where o.is_del >= 0
|
||||
and o.paid >= 1
|
||||
and o.refund_status >= 0
|
||||
and o.create_time >= #{ startTime }
|
||||
and o.create_time < #{ endTime }
|
||||
and o.create_time
|
||||
< #{ endTime }
|
||||
group by date_format(o.create_time, '%Y-%m-%d')
|
||||
order by o.create_time desc;
|
||||
</select>
|
||||
<select id="getOrderStatisticsOrderCountDetail" parameterType="cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram"
|
||||
<select id="getOrderStatisticsOrderCountDetail"
|
||||
parameterType="cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram"
|
||||
resultType="cn.iocoder.yudao.module.shop.response.order.StoreOrderStatisticsChartItemResponse">
|
||||
select count(id) as num, date_format(o.create_time, '%Y-%m-%d') as time
|
||||
from eb_store_order o
|
||||
where o.is_del >= 0 and o.paid >= 1 and o.refund_status >= 0
|
||||
where o.is_del >= 0
|
||||
and o.paid >= 1
|
||||
and o.refund_status >= 0
|
||||
and o.create_time >= #{ startTime }
|
||||
and o.create_time < #{ endTime }
|
||||
and o.create_time
|
||||
< #{ endTime }
|
||||
group by date_format(o.create_time, '%Y-%m-%d')
|
||||
order by o.create_time asc;
|
||||
</select>
|
||||
|
@ -48,8 +66,10 @@
|
|||
<select id="getBrokerageData" resultType="cn.iocoder.yudao.module.shop.response.order.OrderBrokerageData">
|
||||
select count(*) as num, sum(o.pay_price) as price
|
||||
from eb_store_order as o
|
||||
right join eb_user_brokerage_record as br on br.link_id = o.order_id and br.status = 3 and br.uid = #{spreadId}
|
||||
where o.uid = #{uid} and o.status > 1;
|
||||
right join eb_user_brokerage_record as br
|
||||
on br.link_id = o.order_id and br.status = 3 and br.uid = #{spreadId}
|
||||
where o.uid = #{uid}
|
||||
and o.status > 1;
|
||||
</select>
|
||||
|
||||
<select id="shoppingOrderCount" resultType="java.math.BigDecimal">
|
||||
|
@ -84,5 +104,8 @@
|
|||
<if test="null != endTime">
|
||||
and info.create_time < #{endTime}
|
||||
</if>
|
||||
<if test="tenantId !=null and tenantId!=1">
|
||||
and info.tenant_id =#{tenantId}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -236,6 +236,9 @@
|
|||
<if test="data.orderId !=null and data.orderId!=''">
|
||||
and a.order_id like CONCAT('%',#{data.orderId},'%')
|
||||
</if>
|
||||
<if test="data.refundStatus !=null and data.refundStatus!=''">
|
||||
and a.refund_status =#{data.refundStatus}
|
||||
</if>
|
||||
<if test="data.paid !=null and data.paid!=''">
|
||||
and a.paid =#{data.paid}
|
||||
</if>
|
||||
|
|
|
@ -151,6 +151,7 @@ public class PromoterController {
|
|||
@Operation(summary = "导出所有推广员 Excel")
|
||||
@OperateLog(type = EXPORT)
|
||||
@TenantIgnore
|
||||
@PreAuthorize("@ss.hasPermission('member:promoter:allExcel')")
|
||||
public void allExportExcel(@Valid PromoterPageReqVO pageVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
PageResult<PromoterRespVO> pageResult = promoterService.getPromoterPage(pageVO);
|
||||
|
@ -168,6 +169,7 @@ public class PromoterController {
|
|||
|
||||
@PutMapping("/tenantIgnoreUpdate")
|
||||
@Operation(summary = "排除祖父更新推广员")
|
||||
@PreAuthorize("@ss.hasPermission('member:promoter:allUpdate')")
|
||||
@TenantIgnore
|
||||
public CommonResult<Boolean> updateByPromoter(@Valid @RequestBody PromoterUpdateReqVO updateReqVO) {
|
||||
promoterService.updatePromoter(updateReqVO);
|
||||
|
|
|
@ -30,4 +30,6 @@ public interface TenantApi {
|
|||
TenantDTO getTenant(Long id);
|
||||
|
||||
PageResult<TenantDTO> getTenantPage(TenantPageDTO pageDTO);
|
||||
|
||||
List<TenantDTO> getTenantList(Long aLong);
|
||||
}
|
||||
|
|
|
@ -16,4 +16,5 @@ public class TenantPageDTO {
|
|||
private String name;
|
||||
private Integer pageNo = PAGE_NO;
|
||||
private Integer pageSize = PAGE_SIZE;
|
||||
private Long tenantId;
|
||||
}
|
||||
|
|
|
@ -62,4 +62,11 @@ public class TenantApiImpl implements TenantApi {
|
|||
}
|
||||
return pageResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TenantDTO> getTenantList(Long tenantId)
|
||||
{
|
||||
|
||||
return tenantService.findByTenantId(tenantId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,4 +48,6 @@ public class TenantPageReqVO extends PageParam {
|
|||
@Schema(description = "创建时间")
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
private Long tenantId;
|
||||
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ public interface TenantMapper extends BaseMapperX<TenantDO> {
|
|||
|
||||
default PageResult<TenantDO> selectPage(TenantPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TenantDO>()
|
||||
.eqIfPresent(TenantDO::getId,reqVO.getTenantId())
|
||||
.likeIfPresent(TenantDO::getName, reqVO.getName())
|
||||
.likeIfPresent(TenantDO::getContactName, reqVO.getContactName())
|
||||
.likeIfPresent(TenantDO::getContactMobile, reqVO.getContactMobile())
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.service.tenant;
|
|||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.tenant.vo.tenant.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
|
||||
import cn.iocoder.yudao.module.system.service.tenant.handler.TenantInfoHandler;
|
||||
|
@ -135,4 +136,6 @@ public interface TenantService {
|
|||
* @param id 租户编号
|
||||
*/
|
||||
void validTenant(Long id);
|
||||
|
||||
List<TenantDTO> findByTenantId(Long tenantId);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import cn.iocoder.yudao.framework.common.util.date.DateUtils;
|
|||
import cn.iocoder.yudao.framework.tenant.config.TenantProperties;
|
||||
import cn.iocoder.yudao.framework.tenant.core.context.TenantContextHolder;
|
||||
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
|
||||
import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptCreateReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.DeptUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleCreateReqVO;
|
||||
|
@ -30,7 +31,10 @@ import cn.iocoder.yudao.module.system.service.permission.RoleService;
|
|||
import cn.iocoder.yudao.module.system.service.tenant.handler.TenantInfoHandler;
|
||||
import cn.iocoder.yudao.module.system.service.tenant.handler.TenantMenuHandler;
|
||||
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -38,6 +42,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
@ -97,6 +102,22 @@ public class TenantServiceImpl implements TenantService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TenantDTO> findByTenantId(Long tenantId) {
|
||||
List<TenantDTO> list = new ArrayList<>();
|
||||
LambdaQueryWrapper<TenantDO> lw = new LambdaQueryWrapper<>();
|
||||
lw.eq(null != tenantId, TenantDO::getId,tenantId);
|
||||
List<TenantDO> tenantDOS = tenantMapper.selectList(lw);
|
||||
if (!org.springframework.util.CollectionUtils.isEmpty(tenantDOS)) {
|
||||
tenantDOS.forEach(e->{
|
||||
TenantDTO tenantDTO = new TenantDTO();
|
||||
BeanUtils.copyProperties(e,tenantDTO);
|
||||
list.add(tenantDTO);
|
||||
});
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createTenant(TenantCreateReqVO createReqVO) {
|
||||
|
|
Loading…
Reference in New Issue