Authored by wujiexiang

卖家站内信

... ... @@ -13,11 +13,10 @@ import com.yohoufo.dal.product.model.Product;
import com.yohoufo.inboxclient.model.InboxReqVO;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Supplier;
... ... @@ -271,11 +270,22 @@ public class SellerNoticeFacade extends BaseNoticeFacade {
String remark = BuyerOrderStatusFlow.formatRemarkWithPrefixAndSuffix(statusFlow);
Product product = productMapper.selectByPrimaryKey(sog.getProductId());
String productCode = product.getProductCode();
newNotice(sellerUid)
Notice notice = newNotice(sellerUid)
.withLogPrefix(logPrefix)
.withInBox(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_DETECTION_NOT_PASS, goodsTypeTag, prdName, sizeName, productCode, remark)
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_DETECTION_NOT_PASS, goodsTypeTag, prdName, sizeName, productCode, remark, orderCode)
.send();
.withSms(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_DETECTION_NOT_PASS, goodsTypeTag, prdName, sizeName, productCode, remark, orderCode);
if (StringUtils.isNotEmpty(remark)) {
//有原因
if (remark.contains(",")) {
//用中文的","替换英文的",",不然站内信会被截取掉
remark = remark.replaceAll(",", ",");
}
notice.withInBox(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_DETECTION_NOT_PASS, goodsTypeTag, prdName, sizeName, productCode, remark);
} else {
//没有原因
notice.withInBox(InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_DETECTION_NOT_PASS2, goodsTypeTag, prdName, sizeName, productCode);
}
//发送
notice.send();
} catch (Exception e) {
log.warn("{} fail, sellerUid {}, prdName {} ", logPrefix, sellerUid, prdName, e);
}
... ...
... ... @@ -11,6 +11,9 @@ public final class StringUtils {
* @return
*/
public static String substring(String text, int maxLength) {
if (text != null) {
text = text.trim();
}
if (text != null && text.length() > maxLength) {
return text.substring(0, maxLength);
} else {
... ...