diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java index 51f60389a..15905979c 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RefundRequest.java @@ -35,6 +35,6 @@ public class RefundRequest implements Serializable { private String refundName; @Schema(description = "会员退款理由") private String memberReason; - @Schema(description = "管理员理由") - private String adminReason; +// @Schema(description = "管理员理由") +// private String adminReason; } diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RemarkRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RemarkRequest.java new file mode 100644 index 000000000..1d6608128 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/member/RemarkRequest.java @@ -0,0 +1,30 @@ +package cn.iocoder.yudao.module.shop.request.member; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Title:RemarkRequest + * @Description: TODO + * @author: tangqian + * @date: 2023/6/20 12:03 + * @version: V1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@Schema(description="管理员备注") +public class RemarkRequest implements Serializable { + + private static final long serialVersionUID = -9107261692696656534L; + @Schema(description = "数据id") + @NotNull(message = "订单id不能为空") + private Long orderId; + @Schema(description = "管理员理由") + private String adminReason; +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java index 377bd9094..43d1fa607 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/RechargeOrderController.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.shop.controller.admin.recharge.method.Excel; import cn.iocoder.yudao.module.shop.convert.recharge.RechargeOrderInfoConvert; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; import cn.iocoder.yudao.module.shop.request.member.RefundRequest; +import cn.iocoder.yudao.module.shop.request.member.RemarkRequest; import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; import cn.iocoder.yudao.module.shop.service.recharge.RechargeOrderInfoService; import lombok.extern.slf4j.Slf4j; @@ -25,6 +26,7 @@ import io.swagger.v3.oas.annotations.Operation; import javax.validation.constraints.*; import javax.validation.*; import javax.servlet.http.*; +import java.time.LocalDateTime; import java.util.*; import java.io.IOException; @@ -180,7 +182,7 @@ public class RechargeOrderController { RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO(); vo.setId(request.getOrderId()); vo.setRefundStatus(3); - vo.setAdminReason(request.getAdminReason()); + vo.setApplySucceedTime(LocalDateTime.now()); rechargeOrderService.updateRechargeOrderStatus(vo); obj = storeOrderService.memberRefund(request, servletRequest); //拒绝退款 @@ -188,17 +190,25 @@ public class RechargeOrderController { RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO(); vo.setId(request.getOrderId()); vo.setRefundStatus(4); - vo.setAdminReason(request.getAdminReason()); rechargeOrderService.updateRechargeOrderStatus(vo); //同意 } else if (request.getType() == 1) { RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO(); vo.setId(request.getOrderId()); vo.setRefundStatus(3); - vo.setAdminReason(request.getAdminReason()); + vo.setApplySucceedTime(LocalDateTime.now()); rechargeOrderService.updateRechargeOrderStatus(vo); obj = storeOrderService.memberRefund(request, servletRequest); } return CommonResult.success(obj); } + + @TenantIgnore +// @PreAuthenticated + @Operation(summary = "管理员填写备注") + @RequestMapping(value = "/adminRemark", method = RequestMethod.POST) +// @PreAuthorize("@ss.hasPermission('shop:recharge-order:remark')") + public CommonResult adminRemark(@Valid @RequestBody RemarkRequest request) { + return CommonResult.success(rechargeOrderService.updateRemark(request)); + } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java index 9183a2fde..27f820a70 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java @@ -130,4 +130,9 @@ public class RechargeOrderExportReqVO { private Long promoterId; + /** + * 退款类型 + */ + private Integer refundType; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java index 3afa4ca82..c451a6a1b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java @@ -133,4 +133,9 @@ public class RechargeOrderPageReqVO extends PageParam { @Schema(description = "推广员id") private Long promoterId; + /** + * 退款类型 + */ + private Integer refundType; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java index 17e14d775..018cc7830 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderRespVO.java @@ -36,4 +36,33 @@ public class RechargeOrderRespVO extends RechargeOrderBaseVO { private String nickname; @Schema(description = "提成金额", required = true, example = "3114") private BigDecimal commissionPrice; + + + /** + * 退款类型 + */ + private Integer refundType; + /** + * 退款类型名称 + */ + private String refundName; + /** + * 会员退款理由 + */ + private String memberReason; + /** + * 管理员理由 + */ + private String adminReason; + + /** + * 申请退款时间 + */ + private LocalDateTime applyTime; + + /** + * 申请退款时间 + */ + private LocalDateTime applySucceedTime; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderUpdateReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderUpdateReqVO.java index def8575ca..abca57dc6 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderUpdateReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderUpdateReqVO.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.shop.controller.admin.recharge.vo; import io.swagger.v3.oas.annotations.media.Schema; import lombok.*; + +import java.time.LocalDateTime; import java.util.*; import javax.validation.constraints.*; @@ -18,4 +20,9 @@ public class RechargeOrderUpdateReqVO extends RechargeOrderBaseVO { * 管理员理由 */ private String adminReason; + + /** + * 申请退款时间 + */ + private LocalDateTime applySucceedTime; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java index e21109e97..2769d8d46 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java @@ -206,4 +206,14 @@ public class RechargeOrderDO extends TenantBaseDO { * 管理员理由 */ private String adminReason; + + /** + * 申请退款时间 + */ + private LocalDateTime applyTime; + + /** + * 申请退款时间 + */ + private LocalDateTime applySucceedTime; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index e28daade5..f17c9574e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -1434,6 +1434,7 @@ public class StoreOrderServiceImpl extends ServiceImpl 0; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java index a672ec54b..965b34d1c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java @@ -8,6 +8,7 @@ import cn.iocoder.yudao.module.shop.controller.app.member.vo.ShoppingMemberOrder import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest; +import cn.iocoder.yudao.module.shop.request.member.RemarkRequest; import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse; import org.apache.ibatis.annotations.Param; @@ -93,4 +94,6 @@ public interface RechargeOrderService { List findPromoterDrawExcel(PromoterDrawReqExcelVO excelVO); Boolean updateByIds(BatchOrderUpdateReqVO updateReqVO); + + Boolean updateRemark(RemarkRequest request); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java index 3d8b37614..f529a8140 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java @@ -19,6 +19,7 @@ import cn.iocoder.yudao.module.shop.dal.mysql.order.StoreOrderMapper; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper; import cn.iocoder.yudao.module.shop.request.member.MemberChangeTieRequest; +import cn.iocoder.yudao.module.shop.request.member.RemarkRequest; import cn.iocoder.yudao.module.shop.response.member.MemberHeadResponse; import cn.iocoder.yudao.module.system.api.tenant.TenantApi; import cn.iocoder.yudao.module.system.api.tenant.dto.TenantDTO; @@ -148,6 +149,16 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { return Boolean.TRUE; } + @Override + public Boolean updateRemark(RemarkRequest request) { + RechargeOrderDO orderDO = rechargeOrderMapper.selectById(request.getOrderId()); + if (null != orderDO) { + orderDO.setAdminReason(request.getAdminReason()); + rechargeOrderMapper.updateById(orderDO); + } + return Boolean.TRUE; + } + @Override public PageResult findPromoterDrawPage(PromoterDrawReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml index dc4763715..14b9a2e7c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml @@ -242,6 +242,9 @@ and a.paid =#{data.paid} + + and a.refund_type =#{refundType} + and a.tenant_id =#{data.tenantId}