消费退款记录修改

This commit is contained in:
gaowdong 2025-05-07 09:39:40 +08:00
parent cff5de17f3
commit 046f6250a5
4 changed files with 31 additions and 3 deletions

View File

@ -1,5 +1,7 @@
package com.bonus.canteen.core.account.constants; package com.bonus.canteen.core.account.constants;
import com.bonus.canteen.core.pay.constants.PayTypeEnum;
public enum AccTradeTypeEnum { public enum AccTradeTypeEnum {
RECHARGE(10, "充值"), RECHARGE(10, "充值"),
SUBSIDY(20, "补贴"), SUBSIDY(20, "补贴"),
@ -23,4 +25,13 @@ public enum AccTradeTypeEnum {
public String getDesc() { public String getDesc() {
return this.desc; return this.desc;
} }
public static String getDescByKey(Integer targetKey) {
for (AccTradeTypeEnum tradeType : AccTradeTypeEnum.values()) {
if (tradeType.getKey().equals(targetKey)) {
return tradeType.getDesc();
}
}
return "";
}
} }

View File

@ -14,11 +14,13 @@ public class OrderRefundHistoryVO implements Serializable {
private Long orderId; private Long orderId;
private BigDecimal realAmount; private BigDecimal realAmount;
private LocalDateTime payTime; private LocalDateTime payTime;
private String payType; private Integer payType;
private String payTypeName;
@JsonIgnore @JsonIgnore
private Long tradeId; private Long tradeId;
private BigDecimal actualAmount; private BigDecimal actualAmount;
private String tradeType; private Integer tradeType;
private String tradeTypeName;
private LocalDateTime tradeTime; private LocalDateTime tradeTime;
private String updateBy; private String updateBy;
} }

View File

@ -245,7 +245,14 @@ public class OrderInfoServiceImpl implements IOrderInfoService
@Override @Override
public List<OrderRefundHistoryVO> orderRefundHistory(OrderRefundHistoryParam param) { public List<OrderRefundHistoryVO> orderRefundHistory(OrderRefundHistoryParam param) {
return orderInfoMapper.orderRefundHistory(param); List<OrderRefundHistoryVO> list = orderInfoMapper.orderRefundHistory(param);
if(CollUtil.isNotEmpty(list)) {
list.forEach(orderRefundHistoryVO -> {
orderRefundHistoryVO.setPayTypeName(PayTypeEnum.getDescByKey(orderRefundHistoryVO.getPayType()));
orderRefundHistoryVO.setTradeTypeName(AccTradeTypeEnum.getDescByKey(orderRefundHistoryVO.getTradeType()));
});
}
return list;
} }
@Override @Override

View File

@ -119,5 +119,13 @@ public enum PayTypeEnum {
return this.desc; return this.desc;
} }
public static String getDescByKey(Integer targetKey) {
for (PayTypeEnum payType : PayTypeEnum.values()) {
if (payType.getKey().equals(targetKey)) {
return payType.getDesc();
}
}
return "";
}
} }