Authored by LUOXC

钱包文案

package com.yohoufo.order.config;
package com.yohoufo.common.config;
import com.yoho.core.config.ConfigReader;
import lombok.extern.slf4j.Slf4j;
... ...
package com.yohoufo.common.helper;
import com.yohoufo.common.config.UfoOrderPayConfigReader;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class NoticeMessageFormatter {
@Autowired
private UfoOrderPayConfigReader ufoOrderPayConfigReader;
public String filterWallet(String message) {
if (!ufoOrderPayConfigReader.transferWithWalletSwitch()) {
message = StringUtils.remove(message, ",请至UFO余额查看[我的-我的钱包-UFO余额]");
message = StringUtils.remove(message, ",请至UFO余额查看");
}
return message;
}
}
... ...
... ... @@ -3,7 +3,7 @@ package com.yohoufo.order.service.handler.transfer;
import com.alibaba.fastjson.JSONObject;
import com.yohoufo.dal.order.model.OrdersPayTransfer;
import com.yohoufo.dal.order.model.TradeBills;
import com.yohoufo.order.config.UfoOrderPayConfigReader;
import com.yohoufo.common.config.UfoOrderPayConfigReader;
import com.yohoufo.order.service.proxy.WalletTransferService;
import com.yohoufo.order.service.transfer.TransferResult;
import lombok.extern.slf4j.Slf4j;
... ...
... ... @@ -12,7 +12,7 @@ import com.yohoufo.dal.order.model.AppraiseOrder;
import com.yohoufo.dal.order.model.AppraiseOrderGoods;
import com.yohoufo.dal.order.model.SellerWalletDetail;
import com.yohoufo.order.common.TransferCase;
import com.yohoufo.order.config.UfoOrderPayConfigReader;
import com.yohoufo.common.config.UfoOrderPayConfigReader;
import com.yohoufo.order.constants.AlarmConfig;
import com.yohoufo.order.model.request.TranseferCellNode;
import com.yohoufo.order.model.request.TransferMoneyRequest;
... ...
... ... @@ -6,6 +6,7 @@ import com.yohobuy.ufo.model.enums.InboxBusinessTypeEnum;
import com.yohobuy.ufo.model.order.common.OrderAttributes;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohoufo.common.helper.NoticeMessageFormatter;
import com.yohoufo.dal.order.model.BuyerOrder;
import com.yohoufo.dal.order.model.SellerOrderGoods;
import com.yohoufo.inboxclient.model.InBoxResponse;
... ... @@ -45,6 +46,9 @@ public class BaseNoticeFacade {
@Autowired
private UserProxyService userProxyService;
@Autowired
private NoticeMessageFormatter noticeMessageFormatter;
public Notice newNotice(int uid) {
return new Notice(uid);
}
... ... @@ -199,6 +203,7 @@ public class BaseNoticeFacade {
log.warn("{}, send sms fail, get content fail", logPrefix, e);
return null;
});
if (Objects.nonNull(smsContent)) {
try {
String phone = userProxyService.getMobile(uid);
... ... @@ -264,7 +269,7 @@ public class BaseNoticeFacade {
}
protected String getReplacedContent(String content, Object... params) {
return MessageFormatter.arrayFormat(content, params).getMessage();
return noticeMessageFormatter.filterWallet(MessageFormatter.arrayFormat(content, params).getMessage());
}
protected String buildSmsContent(InboxBusinessTypeEnum ibte, Object... params) {
... ...
... ... @@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yohoufo.common.helper.NoticeMessageFormatter;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -54,6 +55,9 @@ public class InBoxServiceImpl implements IInBoxService {
@Autowired
private IInBoxAttrDao inBoxAttrDao;
@Autowired
private NoticeMessageFormatter noticeMessageFormatter;
@Override
public JSONArray listInboxTypeInfo(ListInboxTypeInfoReqVO reqBO) {
log.info("listInboxTypeInfo begin.param is {}",reqBO);
... ... @@ -392,6 +396,7 @@ public class InBoxServiceImpl implements IInBoxService {
}
private String createContent(String template, String params){
noticeMessageFormatter.filterWallet(template);
if(StringUtils.isBlank(params)){
return template;
}
... ...