提交代码

dev-discount
胡锐 2 years ago
parent 6f07f5b2cb
commit b90d56ed1e
  1. 12
      hai-order/src/main/java/com/web/controller/OrderRefundController.java
  2. 6
      hai-service/src/main/java/com/hai/order/service/OrderRefundService.java
  3. 7
      hai-service/src/main/java/com/hai/order/service/OrderService.java
  4. 5
      hai-service/src/main/java/com/hai/order/service/impl/OrderRefundServiceImpl.java
  5. 8
      hai-service/src/main/java/com/hai/order/service/impl/OrderServiceImpl.java
  6. 8
      hai-service/src/main/java/com/hai/order/type/OrderRefundOpUserType.java

@ -12,19 +12,13 @@ import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.entity.HighOrderRefund;
import com.hai.enum_type.OrderStatusEnum;
import com.hai.model.HighUserModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.order.model.CreateOrderChildModel;
import com.hai.order.model.CreateOrderModel;
import com.hai.order.model.ExportGasOrderModel;
import com.hai.order.model.ExportOrderRefundModel;
import com.hai.order.service.OrderPaySuccessService;
import com.hai.order.service.OrderRefundService;
import com.hai.order.service.OrderService;
import com.hai.order.type.*;
import com.hai.order.utils.OrderUtil;
import com.web.config.SysConst;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -38,12 +32,10 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.io.File;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Controller
@RequestMapping(value = "")
@ -87,7 +79,7 @@ public class OrderRefundController {
}
orderService.refundOrder(order,
body.getString("remarks"),
OrderRefundOrderOpUserType.TYPE2,
OrderRefundOpUserType.TYPE2,
userInfoModel.getSecUser().getId(),
userInfoModel.getSecUser().getUserName()
);
@ -132,7 +124,7 @@ public class OrderRefundController {
order, body.getString("childOrderNo"),
body.getInteger("refundGoodsNum"),
body.getString("remarks"),
OrderRefundOrderOpUserType.TYPE2,
OrderRefundOpUserType.TYPE2,
userInfoModel.getSecUser().getId(),
userInfoModel.getSecUser().getUserName()
);

@ -5,7 +5,7 @@ import com.hai.entity.HighOrder;
import com.hai.entity.HighOrderRefund;
import com.hai.order.model.RefundPriceModel;
import com.hai.order.type.OrderPayType;
import com.hai.order.type.OrderRefundOrderOpUserType;
import com.hai.order.type.OrderRefundOpUserType;
import java.math.BigDecimal;
import java.util.List;
@ -30,7 +30,7 @@ public interface OrderRefundService {
* @param order 交易订单
* @param remarks 退款备注
*/
HighOrder createOrderRefund(String refundOrderNo, HighOrder order, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
HighOrder createOrderRefund(String refundOrderNo, HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
/**
* 子订单退款
@ -39,7 +39,7 @@ public interface OrderRefundService {
* @param refundGoodsCount 退款商品数量
* @param remarks 退款备注
*/
HighOrderRefund createOrderChildRefund(HighChildOrder orderChild, String refundOrderNo, Integer refundGoodsCount, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
HighOrderRefund createOrderChildRefund(HighChildOrder orderChild, String refundOrderNo, Integer refundGoodsCount, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
/**
* 交易退钱

@ -1,10 +1,9 @@
package com.hai.order.service;
import com.alicp.jetcache.anno.CacheUpdate;
import com.hai.entity.HighChildOrder;
import com.hai.entity.HighOrder;
import com.hai.order.model.CreateOrderModel;
import com.hai.order.type.OrderRefundOrderOpUserType;
import com.hai.order.type.OrderRefundOpUserType;
import java.util.List;
import java.util.Map;
@ -51,7 +50,7 @@ public interface OrderService {
* @param remarks
* @return
*/
HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
/**
* 子订单退款
@ -61,7 +60,7 @@ public interface OrderService {
* @param remarks
* @return
*/
HighOrder refundChildOrder(HighOrder order,String childOrderNo,Integer refundGoodsNum,String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
HighOrder refundChildOrder(HighOrder order, String childOrderNo, Integer refundGoodsNum, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception;
/**
* 根据订单号查询交易订单号详情

@ -31,7 +31,6 @@ import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @className: OrderRefundServiceImpl
@ -62,7 +61,7 @@ public class OrderRefundServiceImpl implements OrderRefundService {
}
@Override
public HighOrder createOrderRefund(String refundOrderNo, HighOrder order, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
public HighOrder createOrderRefund(String refundOrderNo, HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
for (HighChildOrder orderChild : order.getHighChildOrderList()) {
// 创建退款记录
HighOrderRefund orderRefund = createOrderChildRefund(orderChild, refundOrderNo, orderChild.getSaleCount(), remarks, opUserType,opUserId,opUserName);
@ -77,7 +76,7 @@ public class OrderRefundServiceImpl implements OrderRefundService {
}
@Override
public HighOrderRefund createOrderChildRefund(HighChildOrder orderChild,String refundOrderNo,Integer refundGoodsCount, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
public HighOrderRefund createOrderChildRefund(HighChildOrder orderChild, String refundOrderNo, Integer refundGoodsCount, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
if (!orderChild.getChildOrderStatus().equals(OrderChildStatus.STATUS2.getNumber())
&& !orderChild.getChildOrderStatus().equals(OrderChildStatus.STATUS3.getNumber())){
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "子订单状态错误");

@ -8,12 +8,10 @@ import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.security.AESEncodeUtil;
import com.hai.common.utils.DateUtil;
import com.hai.dao.HighChildOrderMapper;
import com.hai.dao.HighOrderMapper;
import com.hai.entity.*;
import com.hai.enum_type.DiscountUseScope;
import com.hai.enum_type.OrderStatusEnum;
import com.hai.order.model.CreateOrderChildModel;
import com.hai.order.model.CreateOrderModel;
import com.hai.order.model.RefundPriceModel;
@ -24,8 +22,6 @@ import com.hai.order.utils.OrderUtil;
import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.integration.support.MessageBuilder;
import org.springframework.messaging.Message;
@ -506,7 +502,7 @@ public class OrderServiceImpl implements OrderService {
timeout = 10,
rollbackFor = Exception.class)
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order")
public HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
public HighOrder refundOrder(HighOrder order, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
if (!order.getOrderStatus().equals(OrderStatus.STATUS2.getNumber())
&& !order.getOrderStatus().equals(OrderStatus.STATUS3.getNumber())) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "订单状态错误");
@ -569,7 +565,7 @@ public class OrderServiceImpl implements OrderService {
timeout = 10,
rollbackFor = Exception.class)
@CacheUpdate(name = "order:", key = "#order.orderNo", value = "#order")
public HighOrder refundChildOrder(HighOrder order,String childOrderNo,Integer refundGoodsNum, String remarks, OrderRefundOrderOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
public HighOrder refundChildOrder(HighOrder order, String childOrderNo, Integer refundGoodsNum, String remarks, OrderRefundOpUserType opUserType, Long opUserId, String opUserName) throws Exception {
List<HighChildOrder> collect = order.getHighChildOrderList().stream().filter(o -> o.getChildOrderNo().equals(childOrderNo)).collect(Collectors.toList());
if (collect == null || collect.size() == 0) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到订单");

@ -7,7 +7,7 @@ import java.util.Objects;
* @author: HuRui
* @date: 2022/11/2
**/
public enum OrderRefundOrderOpUserType {
public enum OrderRefundOpUserType {
TYPE1(1, "系统"),
TYPE2(2, "管理员"),
TYPE3(3, "用户"),
@ -17,7 +17,7 @@ public enum OrderRefundOrderOpUserType {
private String name;
OrderRefundOrderOpUserType(int number, String name) {
OrderRefundOpUserType(int number, String name) {
this.number = number;
this.name = name;
}
@ -27,8 +27,8 @@ public enum OrderRefundOrderOpUserType {
* @param type
* @return
*/
public static OrderRefundOrderOpUserType getDataByType(Integer type) {
for (OrderRefundOrderOpUserType ele : values()) {
public static OrderRefundOpUserType getDataByType(Integer type) {
for (OrderRefundOpUserType ele : values()) {
if(Objects.equals(type,ele.getNumber())) return ele;
}
return null;
Loading…
Cancel
Save