!1049 【功能修复】修复快递鸟顺丰查询问题、订单退款问题、订单日志查询优化等

Merge pull request !1049 from 卢越/master-jdk17
This commit is contained in:
芋道源码 2024-08-23 12:09:46 +00:00 committed by Gitee
commit 7e2498d417
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
7 changed files with 29 additions and 11 deletions

View File

@ -43,7 +43,8 @@ public interface AfterSaleConvert {
@Mapping(source = "afterSale.orderId", target = "merchantOrderId"), @Mapping(source = "afterSale.orderId", target = "merchantOrderId"),
@Mapping(source = "afterSale.id", target = "merchantRefundId"), @Mapping(source = "afterSale.id", target = "merchantRefundId"),
@Mapping(source = "afterSale.applyReason", target = "reason"), @Mapping(source = "afterSale.applyReason", target = "reason"),
@Mapping(source = "afterSale.refundPrice", target = "price") @Mapping(source = "afterSale.refundPrice", target = "price"),
@Mapping(source = "orderProperties.payAppKey", target = "appKey")
}) })
PayRefundCreateReqDTO convert(String userIp, AfterSaleDO afterSale, PayRefundCreateReqDTO convert(String userIp, AfterSaleDO afterSale,
TradeOrderProperties orderProperties); TradeOrderProperties orderProperties);

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.mysql.aftersale;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.AfterSaleLogDO; import cn.iocoder.yudao.module.trade.dal.dataobject.aftersale.AfterSaleLogDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -10,7 +11,10 @@ import java.util.List;
public interface AfterSaleLogMapper extends BaseMapperX<AfterSaleLogDO> { public interface AfterSaleLogMapper extends BaseMapperX<AfterSaleLogDO> {
default List<AfterSaleLogDO> selectListByAfterSaleId(Long afterSaleId) { default List<AfterSaleLogDO> selectListByAfterSaleId(Long afterSaleId) {
return selectList(AfterSaleLogDO::getAfterSaleId, afterSaleId); LambdaQueryWrapper<AfterSaleLogDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AfterSaleLogDO::getAfterSaleId, afterSaleId);
queryWrapper.orderByDesc(AfterSaleLogDO::getCreateTime);
return selectList(queryWrapper);
} }
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.mysql.order;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderLogDO; import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderLogDO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -10,7 +11,10 @@ import java.util.List;
public interface TradeOrderLogMapper extends BaseMapperX<TradeOrderLogDO> { public interface TradeOrderLogMapper extends BaseMapperX<TradeOrderLogDO> {
default List<TradeOrderLogDO> selectListByOrderId(Long orderId) { default List<TradeOrderLogDO> selectListByOrderId(Long orderId) {
return selectList(TradeOrderLogDO::getOrderId, orderId); LambdaQueryWrapper<TradeOrderLogDO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TradeOrderLogDO::getOrderId, orderId);
queryWrapper.orderByDesc(TradeOrderLogDO::getCreateTime);
return selectList(queryWrapper);
} }
} }

View File

@ -28,4 +28,9 @@ public class ExpressTrackQueryReqDTO {
*/ */
private String phone; private String phone;
/**
* 自定义名称顺丰专用
*/
private String customerName;
} }

View File

@ -29,4 +29,10 @@ public class KdNiaoExpressQueryReqDTO {
@JsonProperty("OrderCode") @JsonProperty("OrderCode")
private String orderNo; private String orderNo;
/**
* 自定义名称顺丰专用
*/
@JsonProperty("CustomerName")
private String customerName;
} }

View File

@ -219,7 +219,7 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
public List<ExpressTrackRespDTO> getExpressTrackList(String code, String logisticsNo, String receiverMobile) { public List<ExpressTrackRespDTO> getExpressTrackList(String code, String logisticsNo, String receiverMobile) {
return expressClientFactory.getDefaultExpressClient().getExpressTrackList( return expressClientFactory.getDefaultExpressClient().getExpressTrackList(
new ExpressTrackQueryReqDTO().setExpressCode(code).setLogisticsNo(logisticsNo) new ExpressTrackQueryReqDTO().setExpressCode(code).setLogisticsNo(logisticsNo)
.setPhone(receiverMobile)); .setPhone(receiverMobile).setCustomerName(StrUtil.subSuf(receiverMobile, receiverMobile.length() - 4)));
} }
// =================== Order Item =================== // =================== Order Item ===================

View File

@ -78,17 +78,15 @@ public class TradeMemberPointOrderHandler implements TradeOrderHandler {
@Override @Override
public void afterCancelOrderItem(TradeOrderDO order, TradeOrderItemDO orderItem) { public void afterCancelOrderItem(TradeOrderDO order, TradeOrderItemDO orderItem) {
// 扣减回滚积分订单赠送
reducePoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.ORDER_GIVE_CANCEL_ITEM,
orderItem.getId());
// 增加回滚积分订单抵扣 // 增加回滚积分订单抵扣
addPoint(order.getUserId(), orderItem.getUsePoint(), MemberPointBizTypeEnum.ORDER_USE_CANCEL_ITEM, addPoint(order.getUserId(), orderItem.getUsePoint(), MemberPointBizTypeEnum.ORDER_USE_CANCEL_ITEM, orderItem.getId());
orderItem.getId());
// 扣减回滚积分订单赠送
reducePoint(order.getUserId(), orderItem.getGivePoint(), MemberPointBizTypeEnum.ORDER_GIVE_CANCEL_ITEM, orderItem.getId());
// 扣减回滚用户经验 // 扣减回滚用户经验
AfterSaleDO afterSale = afterSaleService.getAfterSale(orderItem.getAfterSaleId()); AfterSaleDO afterSale = afterSaleService.getAfterSale(orderItem.getAfterSaleId());
memberLevelApi.reduceExperience(order.getUserId(), afterSale.getRefundPrice(), memberLevelApi.reduceExperience(order.getUserId(), afterSale.getRefundPrice(), MemberExperienceBizTypeEnum.ORDER_GIVE_CANCEL_ITEM.getType(), String.valueOf(orderItem.getId()));
MemberExperienceBizTypeEnum.ORDER_GIVE_CANCEL_ITEM.getType(), String.valueOf(orderItem.getId()));
} }
/** /**