mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2025-01-31 09:30:05 +08:00
!1052 【代码优化】对customerName内部屏蔽
Merge pull request !1052 from 卢越/master-jdk17
This commit is contained in:
commit
456b54d4cb
@ -1,5 +1,6 @@
|
|||||||
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto;
|
package cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
|
import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryExpressDO;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@ -13,7 +14,7 @@ public class ExpressTrackQueryReqDTO {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 快递公司编码
|
* 快递公司编码
|
||||||
*
|
* <p>
|
||||||
* 对应 {@link DeliveryExpressDO#getCode()}
|
* 对应 {@link DeliveryExpressDO#getCode()}
|
||||||
*/
|
*/
|
||||||
private String expressCode;
|
private String expressCode;
|
||||||
@ -33,4 +34,21 @@ public class ExpressTrackQueryReqDTO {
|
|||||||
*/
|
*/
|
||||||
private String customerName;
|
private String customerName;
|
||||||
|
|
||||||
|
public ExpressTrackQueryReqDTO setExpressCode(String expressCode) {
|
||||||
|
this.expressCode = expressCode;
|
||||||
|
updateCustomerName();
|
||||||
|
return this; // 返回实体对象
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExpressTrackQueryReqDTO setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
updateCustomerName();
|
||||||
|
return this; // 返回实体对象
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCustomerName() {
|
||||||
|
if ("SF".equals(expressCode) && phone != null && phone.length() >= 4) {
|
||||||
|
this.customerName = phone.substring(phone.length() - 4);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -206,7 +206,7 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询物流轨迹
|
* 查询物流轨迹
|
||||||
*
|
* <p>
|
||||||
* 缓存的目的:考虑及时性要求不高,但是每次调用需要钱
|
* 缓存的目的:考虑及时性要求不高,但是每次调用需要钱
|
||||||
*
|
*
|
||||||
* @param code 快递公司编码
|
* @param code 快递公司编码
|
||||||
@ -217,10 +217,13 @@ public class TradeOrderQueryServiceImpl implements TradeOrderQueryService {
|
|||||||
@Cacheable(cacheNames = RedisKeyConstants.EXPRESS_TRACK, key = "#code + '-' + #logisticsNo + '-' + #receiverMobile",
|
@Cacheable(cacheNames = RedisKeyConstants.EXPRESS_TRACK, key = "#code + '-' + #logisticsNo + '-' + #receiverMobile",
|
||||||
condition = "#result != null && #result.length() > 0")
|
condition = "#result != null && #result.length() > 0")
|
||||||
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()
|
||||||
new ExpressTrackQueryReqDTO().setExpressCode(code).setLogisticsNo(logisticsNo)
|
.getExpressTrackList(
|
||||||
// TODO @卢越:1)为什么 customerName 使用 mobile 哈?2)如果使用 mobile,其实可以考虑通过 phone 计算下
|
new ExpressTrackQueryReqDTO()
|
||||||
.setPhone(receiverMobile).setCustomerName(StrUtil.subSuf(receiverMobile, receiverMobile.length() - 4)));
|
.setExpressCode(code)
|
||||||
|
.setLogisticsNo(logisticsNo)
|
||||||
|
.setPhone(receiverMobile)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =================== Order Item ===================
|
// =================== Order Item ===================
|
||||||
|
Loading…
Reference in New Issue
Block a user