Merge branch 'feature/mall_product'
# Conflicts: # yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/task/ReplenishmentTask.javapull/17/head
commit
82d5f5408e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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<Boolean> adminRemark(@Valid @RequestBody RemarkRequest request) {
|
||||
return CommonResult.success(rechargeOrderService.updateRemark(request));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,4 +130,12 @@ public class RechargeOrderExportReqVO {
|
|||
|
||||
private Long promoterId;
|
||||
|
||||
/**
|
||||
* 退款类型
|
||||
*/
|
||||
private Integer refundType;
|
||||
|
||||
private LocalDateTime startApplyTime;
|
||||
private LocalDateTime endApplyTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -206,4 +206,14 @@ public class RechargeOrderDO extends TenantBaseDO {
|
|||
* 管理员理由
|
||||
*/
|
||||
private String adminReason;
|
||||
|
||||
/**
|
||||
* 申请退款时间
|
||||
*/
|
||||
private LocalDateTime applyTime;
|
||||
|
||||
/**
|
||||
* 申请退款时间
|
||||
*/
|
||||
private LocalDateTime applySucceedTime;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
|
@ -215,7 +226,7 @@ public class RechargeOrderServiceImpl implements RechargeOrderService {
|
|||
List<RechargeOrderDO> orderDOS = rechargeOrderMapper.selectList(Wrappers.<RechargeOrderDO>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<RechargeOrderRespVO> rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS);
|
||||
|
|
|
@ -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 @@
|
|||
<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 =#{data.refundType}
|
||||
</if>
|
||||
<if test="data.tenantId !=null and data.tenantId!=1">
|
||||
and a.tenant_id =#{data.tenantId}
|
||||
</if>
|
||||
|
@ -272,6 +281,12 @@
|
|||
<if test="data.status !=null ">
|
||||
and a.status =#{data.status}
|
||||
</if>
|
||||
<if test="data.startApplyTime !=null ">
|
||||
and a.apply_time >=#{data.startApplyTime}
|
||||
</if>
|
||||
<if test="data.endApplyTime !=null ">
|
||||
and a.apply_time <=#{data.endApplyTime}
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue