fix: 订单管理备注和订单查询

feature/mall_product
tangqian 2023-06-20 12:10:12 +08:00
parent 4aff4b3d03
commit fe0e7ae3b9
12 changed files with 119 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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<Boolean> adminRemark(@Valid @RequestBody RemarkRequest request) {
return CommonResult.success(rechargeOrderService.updateRemark(request));
}
}

View File

@ -130,4 +130,9 @@ public class RechargeOrderExportReqVO {
private Long promoterId;
/**
* 退
*/
private Integer refundType;
}

View File

@ -133,4 +133,9 @@ public class RechargeOrderPageReqVO extends PageParam {
@Schema(description = "推广员id")
private Long promoterId;
/**
* 退
*/
private Integer refundType;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -206,4 +206,14 @@ public class RechargeOrderDO extends TenantBaseDO {
*
*/
private String adminReason;
/**
* 退
*/
private LocalDateTime applyTime;
/**
* 退
*/
private LocalDateTime applySucceedTime;
}

View File

@ -1434,6 +1434,7 @@ public class StoreOrderServiceImpl extends ServiceImpl<StoreOrderMapper, StoreOr
orderDO.setRefundType(request.getRefundType());
orderDO.setRefundName(request.getRefundName());
orderDO.setMemberReason(request.getMemberReason());
orderDO.setApplyTime(LocalDateTime.now());
return rechargeOrderMapper.updateById(orderDO) > 0;
}

View File

@ -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<PromoterDrawExcelVO> findPromoterDrawExcel(PromoterDrawReqExcelVO excelVO);
Boolean updateByIds(BatchOrderUpdateReqVO updateReqVO);
Boolean updateRemark(RemarkRequest request);
}

View File

@ -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<PromoterDrawVO> findPromoterDrawPage(PromoterDrawReqVO pageReqVO) {
Page<PromoterDrawVO> page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize());

View File

@ -242,6 +242,9 @@
<if test="data.paid !=null and data.paid!=''">
and a.paid =#{data.paid}
</if>
<if test="data.refundType !=null and data.refundType!=''">
and a.refund_type =#{refundType}
</if>
<if test="data.tenantId !=null and data.tenantId!=1">
and a.tenant_id =#{data.tenantId}
</if>