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..bc3aee194 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 @@ -5,10 +5,8 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import java.io.Serializable; -import java.util.List; /** * @Title:OrderContentRequest @@ -35,6 +33,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..79d3bd1d2 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; @@ -137,7 +139,7 @@ public class RechargeOrderController { @GetMapping("/promoterDraw-excel") @Operation(summary = "导出推广员抽佣统计") - @PreAuthorize("@ss.hasPermission('shop:recharge-order:export')") + @PreAuthorize("@ss.hasPermission('shop:recharge-order:export','shop:recharge-order-refund:export')") @OperateLog(type = EXPORT) @TenantIgnore public void getRechargeOrderExcel(@Valid PromoterDrawReqExcelVO excelVO, HttpServletResponse response) throws IOException { @@ -180,25 +182,33 @@ 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); //拒绝退款 } else if (request.getType() == 2) { RechargeOrderUpdateReqVO vo = new RechargeOrderUpdateReqVO(); vo.setId(request.getOrderId()); - vo.setRefundStatus(4); - vo.setAdminReason(request.getAdminReason()); + vo.setRefundStatus(0); 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..04b9856b6 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,12 @@ public class RechargeOrderExportReqVO { private Long promoterId; + /** + * 退款类型 + */ + private Integer refundType; + + private LocalDateTime startApplyTime; + private LocalDateTime endApplyTime; + } 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..8b3ee7bdc 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,17 @@ public class RechargeOrderPageReqVO extends PageParam { @Schema(description = "推广员id") private Long promoterId; + /** + * 退款类型 + */ + private Integer refundType; + + + /** + * 申请退款时间 + */ + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime startApplyTime; + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime endApplyTime; } 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..baa4207bb 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()); @@ -215,7 +226,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeOrderDO::getUid, loginUser.getId()) .eq(RechargeOrderDO::getPaid, 1) - .eq(RechargeOrderDO::getRefundStatus, 0) + .ne(RechargeOrderDO::getRefundStatus, 2) .orderByDesc(RechargeOrderDO::getCreateTime)); if (!CollectionUtils.isEmpty(orderDOS)) { List rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS); 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..4fb7d1f07 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 @@ -119,7 +119,13 @@ a.status, CONVERT(a.pay_price*e.member_commission/100, DECIMAL(15,2)) as commissionPrice, a.paid, - d.parent_organization_name + d.parent_organization_name, + a.refund_type, + a.refund_name, + a.member_reason, + a.admin_reason, + a.apply_time, + a.apply_succeed_time from cy_recharge_order a left join member_user b on a.promoter_id = b.id left join system_dept d on d.id = a.dept_id @@ -242,6 +248,9 @@ and a.paid =#{data.paid} + + and a.refund_type =#{data.refundType} + and a.tenant_id =#{data.tenantId} @@ -272,6 +281,12 @@ and a.status =#{data.status} + + and a.apply_time >=#{data.startApplyTime} + + + and a.apply_time <=#{data.endApplyTime} +