feat:
1.新增售后订单模块
This commit is contained in:
60
doc/sql/pending/20260604.sql
Normal file
60
doc/sql/pending/20260604.sql
Normal file
@@ -0,0 +1,60 @@
|
||||
-- after_sales_request
|
||||
DROP TABLE IF EXISTS after_sales_request;
|
||||
create table after_sales_request
|
||||
(
|
||||
id int8 not null primary key,
|
||||
order_id int8 not null default -1,
|
||||
order_type VARCHAR(100) not null default '',
|
||||
product_name VARCHAR(500) not null default '',
|
||||
image_url VARCHAR(512) NULL,
|
||||
user_id int8 not null default -1,
|
||||
user_account VARCHAR(100) not null default '',
|
||||
type int4 not null default -1, -- 1=退货退款, 2=换货
|
||||
contact_info VARCHAR(100) NOT NULL,
|
||||
message VARCHAR(500),
|
||||
remark text,
|
||||
create_user int8,
|
||||
create_dept int8,
|
||||
create_time timestamp(6),
|
||||
update_user int8,
|
||||
update_time timestamp(6),
|
||||
status int4 default 0, -- 0=待处理, 1=已处理
|
||||
is_deleted int4 default 0
|
||||
);
|
||||
|
||||
CREATE INDEX idx_after_sales_request_order_id ON after_sales_request (order_id);
|
||||
CREATE INDEX idx_after_sales_request_user_account ON after_sales_request (user_account);
|
||||
CREATE INDEX idx_after_sales_request_order_type ON after_sales_request (order_type);
|
||||
CREATE INDEX idx_after_sales_request_status ON after_sales_request (status);
|
||||
|
||||
COMMENT ON TABLE after_sales_request IS '用户售后申请表';
|
||||
COMMENT ON COLUMN after_sales_request.id IS '主键ID';
|
||||
COMMENT ON COLUMN after_sales_request.order_id IS '关联的原始订单ID';
|
||||
COMMENT ON COLUMN after_sales_request.order_type IS '订单类型';
|
||||
COMMENT ON COLUMN after_sales_request.product_name IS '商品名称';
|
||||
COMMENT ON COLUMN after_sales_request.image_url IS '缩略图';
|
||||
COMMENT ON COLUMN after_sales_request.user_id IS '用户ID';
|
||||
COMMENT ON COLUMN after_sales_request.user_account IS '用户账号';
|
||||
COMMENT ON COLUMN after_sales_request.type IS '售后类型:1=退货退款,2=换货';
|
||||
COMMENT ON COLUMN after_sales_request.contact_info IS '用户联系方式(如手机号、微信号等)';
|
||||
COMMENT ON COLUMN after_sales_request.message IS '用户留言/问题描述';
|
||||
comment on column after_sales_request.create_user is '创建人';
|
||||
comment on column after_sales_request.create_dept is '创建部门';
|
||||
comment on column after_sales_request.create_time is '创建时间';
|
||||
comment on column after_sales_request.update_user is '修改人';
|
||||
comment on column after_sales_request.update_time is '修改时间';
|
||||
COMMENT ON COLUMN after_sales_request.status IS '处理状态:0=待处理,1=已处理';
|
||||
comment on column after_sales_request.is_deleted is '是否已删除';
|
||||
|
||||
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2062430469260800001', '1123598815738675201', 'afterSalesRequest', '用户售后申请表', 'menu', '/mall/afterSalesRequest', NULL, 1, 1, 0, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2062430469260800002', '2062430469260800001', 'afterSalesRequest_add', '新增', 'add', '/mall/afterSalesRequest/add', 'plus', 1, 2, 1, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2062430469260800003', '2062430469260800001', 'afterSalesRequest_edit', '修改', 'edit', '/mall/afterSalesRequest/edit', 'form', 2, 2, 2, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2062430469260800004', '2062430469260800001', 'afterSalesRequest_delete', '删除', 'delete', '/api/mall/after-sales/afterSalesRequest/remove', 'delete', 3, 2, 3, 1, NULL, 0);
|
||||
INSERT INTO blade_menu(id, parent_id, code, name, alias, path, source, sort, category, action, is_open, remark, is_deleted)
|
||||
VALUES ('2062430469260800005', '2062430469260800001', 'afterSalesRequest_view', '查看', 'view', '/mall/afterSalesRequest/view', 'file-text', 4, 2, 2, 1, NULL, 0);
|
||||
|
||||
@@ -277,4 +277,17 @@ public class APPUserController {
|
||||
return R.status(userService.changeNickname(AuthUtil.getUserId(), request.getNickname()));
|
||||
}
|
||||
|
||||
@PostMapping("/apply-after-sales")
|
||||
@ApiOperationSupport(order = 27)
|
||||
@Operation(summary = "申请售后")
|
||||
public R applyAfterSales(@Valid @RequestBody AfterSalesRequest request) {
|
||||
return R.status(orderService.applyAfterSales(AuthUtil.getUserId(), request.getType(), request.getOrderId(), request.getMessage(), request.getContactInfo()));
|
||||
}
|
||||
|
||||
@GetMapping("/after-sales-list")
|
||||
@ApiOperationSupport(order = 28)
|
||||
@Operation(summary = "售后列表")
|
||||
public R<List<AfterSalesApiVO>> afterSalesPage() {
|
||||
return R.data(orderService.afterSalesList(AuthUtil.getUserId()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.springblade.modules.api.request;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
public class AfterSalesRequest implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "订单号不能为空")
|
||||
private Long orderId;
|
||||
|
||||
@NotEmpty(message = "申请事由不能为空")
|
||||
private String message;
|
||||
|
||||
@NotEmpty(message = "联系方式不能为空")
|
||||
private String contactInfo;
|
||||
|
||||
@NotNull(message = "申请类型不能为空")
|
||||
private Integer type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package org.springblade.modules.api.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class AfterSalesApiVO implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String imageUrl;
|
||||
|
||||
private Integer type;
|
||||
|
||||
private String contactInfo;
|
||||
|
||||
private String message;
|
||||
|
||||
private Integer status;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AfterSalesStatus {
|
||||
|
||||
PENDING(0, "待处理"),
|
||||
HANDLED(1, "已处理");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
AfterSalesStatus(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static AfterSalesStatus fromCode(int code) {
|
||||
for (AfterSalesStatus status : values()) {
|
||||
if (status.getCode() == code) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid AfterSalesStatus code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package org.springblade.modules.common.eums;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
public enum AfterSalesType {
|
||||
RETURN_REFUND(1, "退货退款"),
|
||||
EXCHANGE(2, "换货");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
AfterSalesType(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public static AfterSalesType fromCode(int code) {
|
||||
for (AfterSalesType type : values()) {
|
||||
if (type.getCode() == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("Invalid AfterSalesType code: " + code);
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,8 @@ import org.springblade.core.mp.base.BaseService;
|
||||
import org.springblade.modules.api.request.ConfirmOrderRequest;
|
||||
import org.springblade.modules.api.request.CreateMallOrderRequest;
|
||||
import org.springblade.modules.api.request.CreateTravelOrderRequest;
|
||||
import org.springblade.modules.api.request.PaymentRequest;
|
||||
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||
import org.springblade.modules.api.response.PaymentResponse;
|
||||
import org.springblade.modules.api.vo.AfterSalesApiVO;
|
||||
import org.springblade.modules.api.vo.CommonTravelOrderDetailApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderDetailApiVO;
|
||||
@@ -41,7 +40,6 @@ import org.springblade.modules.common.pojo.entity.CommonUserOrderEntity;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserOrderVO;
|
||||
import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserTourOrderVO;
|
||||
import org.springblade.modules.market.pojo.dto.UserOrderSummaryDTO;
|
||||
|
||||
@@ -68,9 +66,12 @@ public interface ICommonUserOrderService extends BaseService<CommonUserOrderEnti
|
||||
|
||||
IPage<CommonUserTourOrderVO> selectTourOrderPage(IPage<CommonUserTourOrderVO> page, CommonUserTourOrderVO order);
|
||||
|
||||
List<CommonUserOrderVO> exportUserMallOrderToExcel(Integer orderStatus , String account ,Date startDate , Date endDate);
|
||||
List<CommonUserOrderVO> exportUserMallOrderToExcel(Integer orderStatus, String account, Date startDate, Date endDate);
|
||||
|
||||
List<CommonUserOrderVO> exportUserEcoOrderToExcel(Integer orderStatus, String account, Date startDate, Date endDate);
|
||||
|
||||
List<CommonUserOrderVO> exportUserTourOrderToExcel(Integer orderStatus, String account, Date startDate, Date endDate);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
@@ -109,4 +110,8 @@ public interface ICommonUserOrderService extends BaseService<CommonUserOrderEnti
|
||||
boolean closeOrderById(Long id);
|
||||
|
||||
List<UserOrderSummaryDTO> selectCurrentOrderByDate(Date date);
|
||||
|
||||
boolean applyAfterSales(Long userId, Integer type, Long orderId, String message, String contactInfo);
|
||||
|
||||
List<AfterSalesApiVO> afterSalesList(Long userId);
|
||||
}
|
||||
|
||||
@@ -39,14 +39,12 @@ import org.springblade.modules.api.request.ConfirmOrderRequest;
|
||||
import org.springblade.modules.api.request.CreateMallOrderRequest;
|
||||
import org.springblade.modules.api.request.CreateTravelOrderRequest;
|
||||
import org.springblade.modules.api.response.CreateOrderResponse;
|
||||
import org.springblade.modules.api.vo.AfterSalesApiVO;
|
||||
import org.springblade.modules.api.vo.CommonTravelOrderDetailApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderApiVO;
|
||||
import org.springblade.modules.api.vo.CommonUserOrderDetailApiVO;
|
||||
import org.springblade.modules.common.convert.AppCommonConvert;
|
||||
import org.springblade.modules.common.eums.BusinessModule;
|
||||
import org.springblade.modules.common.eums.OrderStatus;
|
||||
import org.springblade.modules.common.eums.PaymentStatus;
|
||||
import org.springblade.modules.common.eums.PaymentType;
|
||||
import org.springblade.modules.common.eums.*;
|
||||
import org.springblade.modules.common.event.FillExpressEvent;
|
||||
import org.springblade.modules.common.event.PaymentSuccessEvent;
|
||||
import org.springblade.modules.common.pojo.entity.*;
|
||||
@@ -55,12 +53,15 @@ import org.springblade.modules.common.excel.CommonUserOrderExcel;
|
||||
import org.springblade.modules.common.mapper.CommonUserOrderMapper;
|
||||
import org.springblade.modules.common.pojo.vo.CommonUserTourOrderVO;
|
||||
import org.springblade.modules.common.service.*;
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import org.springblade.modules.mall.pojo.entity.MallProductEntity;
|
||||
import org.springblade.modules.mall.service.IAfterSalesRequestService;
|
||||
import org.springblade.modules.mall.service.IMallProductService;
|
||||
import org.springblade.modules.market.pojo.dto.UserOrderSummaryDTO;
|
||||
import org.springblade.modules.market.pojo.entity.MarketInfoEntity;
|
||||
import org.springblade.modules.market.service.IMarketInfoService;
|
||||
import org.springblade.modules.market.service.IMarketUserCommissionService;
|
||||
import org.springblade.modules.system.service.IUserService;
|
||||
import org.springblade.modules.tour.pojo.entity.TourOrderDetailEntity;
|
||||
import org.springblade.modules.tour.pojo.entity.TourProductEntity;
|
||||
import org.springblade.modules.tour.service.ITourOrderDetailService;
|
||||
@@ -69,7 +70,6 @@ import org.springframework.context.ApplicationEventPublisher;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@@ -97,7 +97,8 @@ public class CommonUserOrderServiceImpl extends BaseServiceImpl<CommonUserOrderM
|
||||
private final IMarketUserCommissionService commissionService;
|
||||
private final IMarketInfoService marketInfoService;
|
||||
private final ICommonOrderConfirmLogService orderConfirmLogService;
|
||||
|
||||
private final IAfterSalesRequestService afterSalesRequestService;
|
||||
private final IUserService userService;
|
||||
|
||||
@Override
|
||||
public IPage<CommonUserOrderVO> selectOrderPage(IPage<CommonUserOrderVO> page, CommonUserOrderVO order) {
|
||||
@@ -404,7 +405,7 @@ public class CommonUserOrderServiceImpl extends BaseServiceImpl<CommonUserOrderM
|
||||
if (order == null) {
|
||||
throw new IllegalStateException("无效订单" + id);
|
||||
}
|
||||
if(order.getOrderStatus().equals(OrderStatus.PENDING_PAYMENT.getCode()) && order.getPaymentType().equals(PaymentType.OFFLINE.getCode()) && order.getPaymentStatus().equals(PaymentStatus.UNPAID.getCode())){
|
||||
if (order.getOrderStatus().equals(OrderStatus.PENDING_PAYMENT.getCode()) && order.getPaymentType().equals(PaymentType.OFFLINE.getCode()) && order.getPaymentStatus().equals(PaymentStatus.UNPAID.getCode())) {
|
||||
order.setOrderStatus(OrderStatus.PAID.getCode());
|
||||
order.setPaymentStatus(PaymentStatus.PAID.getCode());
|
||||
order.setPaymentTime(new Date());
|
||||
@@ -614,6 +615,43 @@ public class CommonUserOrderServiceImpl extends BaseServiceImpl<CommonUserOrderM
|
||||
return baseMapper.selectCurrentOrderBeforeDate(OrderStatus.COMPLETED.getCode(), date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applyAfterSales(Long userId, Integer type, Long orderId, String message, String contactInfo) {
|
||||
if (userId == null || type == null || orderId == null || StringUtils.isBlank(message) || StringUtils.isBlank(contactInfo)) {
|
||||
throw new ServiceException("无效参数");
|
||||
}
|
||||
|
||||
AfterSalesType afterSalesType = AfterSalesType.fromCode(type);
|
||||
|
||||
CommonUserOrderEntity userOrder = getById(orderId);
|
||||
if (userOrder == null || !Objects.equals(userOrder.getUserId(), userId)) {
|
||||
throw new ServiceException("无效订单");
|
||||
}
|
||||
|
||||
boolean exists = afterSalesRequestService.exists(Wrappers.lambdaQuery(AfterSalesRequestEntity.class).eq(AfterSalesRequestEntity::getUserId, userId).eq(AfterSalesRequestEntity::getOrderId, orderId).eq(AfterSalesRequestEntity::getStatus, AfterSalesStatus.PENDING.getCode()));
|
||||
if (exists) {
|
||||
throw new ServiceException("当前订单的售后还在处理中,请耐心等候");
|
||||
}
|
||||
|
||||
AfterSalesRequestEntity entity = new AfterSalesRequestEntity();
|
||||
entity.setOrderId(orderId);
|
||||
entity.setOrderType(userOrder.getOrderType());
|
||||
entity.setProductName(userOrder.getItemName());
|
||||
entity.setImageUrl(userOrder.getImageUrl());
|
||||
entity.setUserId(userId);
|
||||
entity.setUserAccount(AuthUtil.getUserAccount());
|
||||
entity.setType(afterSalesType.getCode());
|
||||
entity.setContactInfo(contactInfo);
|
||||
entity.setMessage(message);
|
||||
|
||||
return afterSalesRequestService.save(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AfterSalesApiVO> afterSalesList(Long userId) {
|
||||
return afterSalesRequestService.afterSalesListByUserId(userId);
|
||||
}
|
||||
|
||||
private void validateCertificates(CommonTourInfoEntity traveler, TourProductEntity product) {
|
||||
String name = Optional.ofNullable(traveler.getUserName()).orElse("未知用户");
|
||||
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.controller;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import lombok.AllArgsConstructor;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springblade.core.secure.BladeUser;
|
||||
import org.springblade.core.secure.annotation.IsAdmin;
|
||||
import org.springblade.core.mp.support.Condition;
|
||||
import org.springblade.core.mp.support.Query;
|
||||
import org.springblade.core.tool.api.R;
|
||||
import org.springblade.core.tool.utils.Func;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import org.springblade.modules.mall.pojo.vo.AfterSalesRequestVO;
|
||||
import org.springblade.modules.mall.excel.AfterSalesRequestExcel;
|
||||
import org.springblade.modules.mall.wrapper.AfterSalesRequestWrapper;
|
||||
import org.springblade.modules.mall.service.IAfterSalesRequestService;
|
||||
import org.springblade.core.boot.ctrl.BladeController;
|
||||
import org.springblade.core.tool.utils.DateUtil;
|
||||
import org.springblade.core.excel.util.ExcelUtil;
|
||||
import org.springblade.core.tool.constant.BladeConstant;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 控制器
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@RequestMapping("/mall/after-sales")
|
||||
@Tag(name = "用户售后申请表", description = "用户售后申请表接口")
|
||||
public class AfterSalesRequestController extends BladeController {
|
||||
|
||||
private final IAfterSalesRequestService afterSalesRequestService;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 详情
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
@ApiOperationSupport(order = 1)
|
||||
@Operation(summary = "详情", description = "传入afterSalesRequest")
|
||||
public R<AfterSalesRequestVO> detail(AfterSalesRequestEntity afterSalesRequest) {
|
||||
AfterSalesRequestEntity detail = afterSalesRequestService.getOne(Condition.getQueryWrapper(afterSalesRequest));
|
||||
return R.data(AfterSalesRequestWrapper.build().entityVO(detail));
|
||||
}
|
||||
/**
|
||||
* 用户售后申请表 分页
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@ApiOperationSupport(order = 2)
|
||||
@Operation(summary = "分页", description = "传入afterSalesRequest")
|
||||
public R<IPage<AfterSalesRequestVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> afterSalesRequest, Query query) {
|
||||
IPage<AfterSalesRequestEntity> pages = afterSalesRequestService.page(Condition.getPage(query), Condition.getQueryWrapper(afterSalesRequest, AfterSalesRequestEntity.class));
|
||||
return R.data(AfterSalesRequestWrapper.build().pageVO(pages));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户售后申请表 自定义分页
|
||||
*/
|
||||
@GetMapping("/page")
|
||||
@ApiOperationSupport(order = 3)
|
||||
@Operation(summary = "分页", description = "传入afterSalesRequest")
|
||||
public R<IPage<AfterSalesRequestVO>> page(AfterSalesRequestVO afterSalesRequest, Query query) {
|
||||
IPage<AfterSalesRequestVO> pages = afterSalesRequestService.selectAfterSalesRequestPage(Condition.getPage(query), afterSalesRequest);
|
||||
return R.data(pages);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户售后申请表 新增
|
||||
*/
|
||||
@PostMapping("/save")
|
||||
@ApiOperationSupport(order = 4)
|
||||
@Operation(summary = "新增", description = "传入afterSalesRequest")
|
||||
public R save(@Valid @RequestBody AfterSalesRequestEntity afterSalesRequest) {
|
||||
return R.status(afterSalesRequestService.save(afterSalesRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户售后申请表 修改
|
||||
*/
|
||||
@PostMapping("/update")
|
||||
@ApiOperationSupport(order = 5)
|
||||
@Operation(summary = "修改", description = "传入afterSalesRequest")
|
||||
public R update(@Valid @RequestBody AfterSalesRequestEntity afterSalesRequest) {
|
||||
return R.status(afterSalesRequestService.updateById(afterSalesRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户售后申请表 新增或修改
|
||||
*/
|
||||
@PostMapping("/submit")
|
||||
@ApiOperationSupport(order = 6)
|
||||
@Operation(summary = "新增或修改", description = "传入afterSalesRequest")
|
||||
public R submit(@Valid @RequestBody AfterSalesRequestEntity afterSalesRequest) {
|
||||
return R.status(afterSalesRequestService.saveOrUpdate(afterSalesRequest));
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户售后申请表 删除
|
||||
*/
|
||||
@PostMapping("/remove")
|
||||
@ApiOperationSupport(order = 7)
|
||||
@Operation(summary = "逻辑删除", description = "传入ids")
|
||||
public R remove(@Parameter(description = "主键集合", required = true) @RequestParam String ids) {
|
||||
return R.status(afterSalesRequestService.deleteLogic(Func.toLongList(ids)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*/
|
||||
@IsAdmin
|
||||
@GetMapping("/export-afterSalesRequest")
|
||||
@ApiOperationSupport(order = 9)
|
||||
@Operation(summary = "导出数据", description = "传入afterSalesRequest")
|
||||
public void exportAfterSalesRequest(@Parameter(hidden = true) @RequestParam Map<String, Object> afterSalesRequest, BladeUser bladeUser, HttpServletResponse response) {
|
||||
QueryWrapper<AfterSalesRequestEntity> queryWrapper = Condition.getQueryWrapper(afterSalesRequest, AfterSalesRequestEntity.class);
|
||||
//if (!AuthUtil.isAdministrator()) {
|
||||
// queryWrapper.lambda().eq(AfterSalesRequest::getTenantId, bladeUser.getTenantId());
|
||||
//}
|
||||
//queryWrapper.lambda().eq(AfterSalesRequestEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
||||
List<AfterSalesRequestExcel> list = afterSalesRequestService.exportAfterSalesRequest(queryWrapper);
|
||||
ExcelUtil.export(response, "用户售后申请表数据" + DateUtil.time(), "用户售后申请表数据表", list, AfterSalesRequestExcel.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.excel;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import cn.idev.excel.annotation.write.style.ColumnWidth;
|
||||
import cn.idev.excel.annotation.write.style.ContentRowHeight;
|
||||
import cn.idev.excel.annotation.write.style.HeadRowHeight;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serial;
|
||||
|
||||
|
||||
/**
|
||||
* 用户售后申请表 Excel实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
@Data
|
||||
@ColumnWidth(25)
|
||||
@HeadRowHeight(20)
|
||||
@ContentRowHeight(18)
|
||||
public class AfterSalesRequestExcel implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("主键ID")
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的原始订单ID
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("关联的原始订单ID")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("订单类型")
|
||||
private String orderType;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("商品名称")
|
||||
private String productName;
|
||||
/**
|
||||
* 缩略图
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("缩略图")
|
||||
private String imageUrl;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户账号")
|
||||
private String userAccount;
|
||||
/**
|
||||
* 售后类型:1=退货退款,2=换货
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("售后类型:1=退货退款,2=换货")
|
||||
private Integer type;
|
||||
/**
|
||||
* 用户联系方式(如手机号、微信号等)
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户联系方式(如手机号、微信号等)")
|
||||
private String contactInfo;
|
||||
/**
|
||||
* 用户留言/问题描述
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("用户留言/问题描述")
|
||||
private String message;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("")
|
||||
private String remark;
|
||||
/**
|
||||
* 是否已删除
|
||||
*/
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty("是否已删除")
|
||||
private Integer isDeleted;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.mapper;
|
||||
|
||||
import org.springblade.modules.api.vo.AfterSalesApiVO;
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import org.springblade.modules.mall.pojo.vo.AfterSalesRequestVO;
|
||||
import org.springblade.modules.mall.excel.AfterSalesRequestExcel;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 Mapper 接口
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
public interface AfterSalesRequestMapper extends BaseMapper<AfterSalesRequestEntity> {
|
||||
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param afterSalesRequest 查询参数
|
||||
* @return List<AfterSalesRequestVO>
|
||||
*/
|
||||
List<AfterSalesRequestVO> selectAfterSalesRequestPage(IPage page, AfterSalesRequestVO afterSalesRequest);
|
||||
|
||||
|
||||
/**
|
||||
* 获取导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<AfterSalesRequestExcel>
|
||||
*/
|
||||
List<AfterSalesRequestExcel> exportAfterSalesRequest(@Param("ew") Wrapper<AfterSalesRequestEntity> queryWrapper);
|
||||
|
||||
|
||||
List<AfterSalesApiVO> selectAfterSalesRequestByUserId(Long userId);
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.springblade.modules.mall.mapper.AfterSalesRequestMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="afterSalesRequestResultMap" type="org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity">
|
||||
<result column="id" property="id"/>
|
||||
<result column="order_id" property="orderId"/>
|
||||
<result column="order_type" property="orderType"/>
|
||||
<result column="product_name" property="productName"/>
|
||||
<result column="image_url" property="imageUrl"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="user_account" property="userAccount"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="contact_info" property="contactInfo"/>
|
||||
<result column="message" property="message"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="create_user" property="createUser"/>
|
||||
<result column="create_dept" property="createDept"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_user" property="updateUser"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="is_deleted" property="isDeleted"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectAfterSalesRequestPage" resultMap="afterSalesRequestResultMap">
|
||||
select * from after_sales_request where is_deleted = 0
|
||||
</select>
|
||||
|
||||
|
||||
<select id="exportAfterSalesRequest" resultType="org.springblade.modules.mall.excel.AfterSalesRequestExcel">
|
||||
SELECT * FROM after_sales_request ${ew.customSqlSegment}
|
||||
</select>
|
||||
<select id="selectAfterSalesRequestByUserId" resultType="org.springblade.modules.api.vo.AfterSalesApiVO">
|
||||
select * from after_sales_request where is_deleted = 0 and user_id = #{userId}
|
||||
order by status , create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.pojo.dto;
|
||||
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 数据传输对象实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AfterSalesRequestDTO extends AfterSalesRequestEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.pojo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springblade.core.mp.base.BaseEntity;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
@Data
|
||||
@TableName("after_sales_request")
|
||||
@Schema(description = "AfterSalesRequest对象")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AfterSalesRequestEntity extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 关联的原始订单ID
|
||||
*/
|
||||
@Schema(description = "关联的原始订单ID")
|
||||
private Long orderId;
|
||||
/**
|
||||
* 订单类型
|
||||
*/
|
||||
@Schema(description = "订单类型")
|
||||
private String orderType;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
@Schema(description = "商品名称")
|
||||
private String productName;
|
||||
/**
|
||||
* 缩略图
|
||||
*/
|
||||
@Schema(description = "缩略图")
|
||||
private String imageUrl;
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@Schema(description = "用户ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
@Schema(description = "用户账号")
|
||||
private String userAccount;
|
||||
/**
|
||||
* 售后类型:1=退货退款,2=换货
|
||||
*/
|
||||
@Schema(description = "售后类型:1=退货退款,2=换货")
|
||||
private Integer type;
|
||||
/**
|
||||
* 用户联系方式(如手机号、微信号等)
|
||||
*/
|
||||
@Schema(description = "用户联系方式(如手机号、微信号等)")
|
||||
private String contactInfo;
|
||||
/**
|
||||
* 用户留言/问题描述
|
||||
*/
|
||||
@Schema(description = "用户留言/问题描述")
|
||||
private String message;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.pojo.vo;
|
||||
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 视图实体类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AfterSalesRequestVO extends AfterSalesRequestEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import org.springblade.modules.api.vo.AfterSalesApiVO;
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import org.springblade.modules.mall.pojo.vo.AfterSalesRequestVO;
|
||||
import org.springblade.modules.mall.excel.AfterSalesRequestExcel;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 服务类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
public interface IAfterSalesRequestService extends BaseService<AfterSalesRequestEntity> {
|
||||
/**
|
||||
* 自定义分页
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param afterSalesRequest 查询参数
|
||||
* @return IPage<AfterSalesRequestVO>
|
||||
*/
|
||||
IPage<AfterSalesRequestVO> selectAfterSalesRequestPage(IPage<AfterSalesRequestVO> page, AfterSalesRequestVO afterSalesRequest);
|
||||
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
*
|
||||
* @param queryWrapper 查询条件
|
||||
* @return List<AfterSalesRequestExcel>
|
||||
*/
|
||||
List<AfterSalesRequestExcel> exportAfterSalesRequest(Wrapper<AfterSalesRequestEntity> queryWrapper);
|
||||
|
||||
List<AfterSalesApiVO> afterSalesListByUserId(Long userId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.service.impl;
|
||||
|
||||
import org.springblade.core.log.exception.ServiceException;
|
||||
import org.springblade.modules.api.vo.AfterSalesApiVO;
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import org.springblade.modules.mall.pojo.vo.AfterSalesRequestVO;
|
||||
import org.springblade.modules.mall.excel.AfterSalesRequestExcel;
|
||||
import org.springblade.modules.mall.mapper.AfterSalesRequestMapper;
|
||||
import org.springblade.modules.mall.service.IAfterSalesRequestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.springblade.core.mp.base.BaseServiceImpl;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 服务实现类
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
@Service
|
||||
public class AfterSalesRequestServiceImpl extends BaseServiceImpl<AfterSalesRequestMapper, AfterSalesRequestEntity> implements IAfterSalesRequestService {
|
||||
|
||||
@Override
|
||||
public IPage<AfterSalesRequestVO> selectAfterSalesRequestPage(IPage<AfterSalesRequestVO> page, AfterSalesRequestVO afterSalesRequest) {
|
||||
return page.setRecords(baseMapper.selectAfterSalesRequestPage(page, afterSalesRequest));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<AfterSalesRequestExcel> exportAfterSalesRequest(Wrapper<AfterSalesRequestEntity> queryWrapper) {
|
||||
List<AfterSalesRequestExcel> afterSalesRequestList = baseMapper.exportAfterSalesRequest(queryWrapper);
|
||||
//afterSalesRequestList.forEach(afterSalesRequest -> {
|
||||
// afterSalesRequest.setTypeName(DictCache.getValue(DictEnum.YES_NO, AfterSalesRequest.getType()));
|
||||
//});
|
||||
return afterSalesRequestList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AfterSalesApiVO> afterSalesListByUserId(Long userId) {
|
||||
if (userId == null) {
|
||||
throw new ServiceException("无效参数");
|
||||
}
|
||||
return baseMapper.selectAfterSalesRequestByUserId(userId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* BladeX Commercial License Agreement
|
||||
* Copyright (c) 2018-2099, https://bladex.cn. All rights reserved.
|
||||
* <p>
|
||||
* Use of this software is governed by the Commercial License Agreement
|
||||
* obtained after purchasing a license from BladeX.
|
||||
* <p>
|
||||
* 1. This software is for development use only under a valid license
|
||||
* from BladeX.
|
||||
* <p>
|
||||
* 2. Redistribution of this software's source code to any third party
|
||||
* without a commercial license is strictly prohibited.
|
||||
* <p>
|
||||
* 3. Licensees may copyright their own code but cannot use segments
|
||||
* from this software for such purposes. Copyright of this software
|
||||
* remains with BladeX.
|
||||
* <p>
|
||||
* Using this software signifies agreement to this License, and the software
|
||||
* must not be used for illegal purposes.
|
||||
* <p>
|
||||
* THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY. The author is
|
||||
* not liable for any claims arising from secondary or illegal development.
|
||||
* <p>
|
||||
* Author: Chill Zhuang (bladejava@qq.com)
|
||||
*/
|
||||
package org.springblade.modules.mall.wrapper;
|
||||
|
||||
import org.springblade.core.mp.support.BaseEntityWrapper;
|
||||
import org.springblade.core.tool.utils.BeanUtil;
|
||||
import org.springblade.modules.mall.pojo.entity.AfterSalesRequestEntity;
|
||||
import org.springblade.modules.mall.pojo.vo.AfterSalesRequestVO;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 用户售后申请表 包装类,返回视图层所需的字段
|
||||
*
|
||||
* @author BladeX
|
||||
* @since 2026-06-04
|
||||
*/
|
||||
public class AfterSalesRequestWrapper extends BaseEntityWrapper<AfterSalesRequestEntity, AfterSalesRequestVO> {
|
||||
|
||||
public static AfterSalesRequestWrapper build() {
|
||||
return new AfterSalesRequestWrapper();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AfterSalesRequestVO entityVO(AfterSalesRequestEntity afterSalesRequest) {
|
||||
AfterSalesRequestVO afterSalesRequestVO = Objects.requireNonNull(BeanUtil.copyProperties(afterSalesRequest, AfterSalesRequestVO.class));
|
||||
|
||||
//User createUser = UserCache.getUser(afterSalesRequest.getCreateUser());
|
||||
//User updateUser = UserCache.getUser(afterSalesRequest.getUpdateUser());
|
||||
//afterSalesRequestVO.setCreateUserName(createUser.getName());
|
||||
//afterSalesRequestVO.setUpdateUserName(updateUser.getName());
|
||||
|
||||
return afterSalesRequestVO;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user