Authored by qinchao

Merge branch 'gray' into test6.8.6.5

... ... @@ -53,7 +53,7 @@ public class MobileHelper {
// 11位国内手机号
if (mobile.matches("\\d{11}")) {
StringBuffer sb = new StringBuffer();
sb.append(mobile.substring(0, 3)).append("******").append(mobile.substring(9));
sb.append(mobile.substring(0, 3)).append("****").append(mobile.substring(7));
return sb.toString();
}
... ...
... ... @@ -167,11 +167,6 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
@Override
public void processAfterPay(OrderInfo orderInfo) {
if(BuyerOrderUtils.isOrderDone(orderInfo)) {
logger.info("order status is Done, orderCode: {}, uid: {}", orderInfo.getOrderCode(), orderInfo.getUid());
return;
}
Integer uid = orderInfo.getUid();
Integer sellerUid = orderInfo.getSellerUid();
long orderCode = orderInfo.getOrderCode();
... ... @@ -189,13 +184,15 @@ public class BuyerOrderPaymentService extends AbstractOrderPaymentService {
case ADVANCE_SALE:
processPreSaleOrder(orderInfo, sellerOrderGoods);
break;
case OFFLINE:
//门店ufo订单这里啥都不干
break;
default:
processInStockOrder(orderInfo, buyerOrderGoods, sellerOrderGoods);
break;
}
cacheCleaner.delete(Arrays.asList(CacheKeyBuilder.orderListKey(sellerUid, TabType.SELL.getValue()),
CacheKeyBuilder.orderListKey(uid, TabType.BUY.getValue()),
CacheKeyBuilder.sellerOrderDetailKey(sellerOrderGoods),
... ...
package com.yohoufo.order.service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.core.config.ConfigReader;
import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yoho.tools.common.beans.ApiResponse;
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.bo.OrderInfo;
import com.yohobuy.ufo.model.order.common.EntrySellerType;
... ... @@ -13,25 +29,26 @@ import com.yohobuy.ufo.model.order.common.OrderCodeType;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.resp.EntryThreshold;
import com.yohobuy.ufo.model.order.resp.PageResp;
import com.yohobuy.ufo.model.user.resp.AuthorizeResultRespVO;
import com.yohoufo.common.alarm.CommonAlarmEventPublisher;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.common.utils.TimeUtils;
import com.yohoufo.dal.order.*;
import com.yohoufo.dal.order.model.*;
import com.yohoufo.dal.user.IZhiMaCertDao;
import com.yohoufo.dal.order.EntrySellerRechargeOrderMapper;
import com.yohoufo.dal.order.OrdersPayMapper;
import com.yohoufo.dal.order.OrdersPayRefundMapper;
import com.yohoufo.dal.order.SellerWalletDetailMapper;
import com.yohoufo.dal.order.SellerWalletMapper;
import com.yohoufo.dal.order.model.EntrySellerRechargeOrder;
import com.yohoufo.dal.order.model.OrdersPay;
import com.yohoufo.dal.order.model.OrdersPayRefund;
import com.yohoufo.dal.order.model.SellerWallet;
import com.yohoufo.dal.order.model.SellerWalletDetail;
import com.yohoufo.dal.order.model.StoredSeller;
import com.yohoufo.order.common.Payment;
import com.yohoufo.order.model.request.PaymentRequest;
import com.yohoufo.order.model.response.PrepayResponse;
import com.yohoufo.order.service.impl.PaymentServiceImpl;
import com.yohoufo.order.service.impl.SellerService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
@Service
public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
... ... @@ -64,7 +81,7 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
IStoredSellerService storedSellerService;
@Autowired
IZhiMaCertDao zhiMaCertDao;
UfoServiceCaller ufoServiceCaller;
//@Value("${order.seller.tip.publishMoneyTip:保证金余额不足}")
private String publishMoneyTip = "保证金余额不足 ¥";
... ... @@ -695,8 +712,8 @@ public class MerchantOrderPaymentService extends AbstractOrderPaymentService {
sellerWalletDetailMapper.insert(swd);
// 删除芝麻认证信息
int result = zhiMaCertDao.deleteByUid(uid);
logger.info("商家退出,删除uid{} 芝麻认证信息结果为{}", uid, result);
ApiResponse<?> resp = ufoServiceCaller.call("ufo.user.clearZhiMaCertInfo", ApiResponse.class, uid);
logger.info("商家退出,删除uid{} 芝麻认证信息结果为{}", uid, resp);
return amount;
}
... ...
... ... @@ -93,12 +93,18 @@ public class BuyerCancelCompensateComputeHandler {
if (Objects.nonNull(penaltyRule.getPenaltyMinAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMinAmount()) < 0) {
penaltyAmount = penaltyRule.getPenaltyMinAmount();
}
if (Objects.nonNull(penaltyRule.getPenaltyMaxAmount()) && penaltyAmount.compareTo(penaltyRule.getPenaltyMaxAmount()) > 0) {
penaltyAmount = penaltyRule.getPenaltyMaxAmount();
}
BigDecimal leftAmount = orderActualAmount.subtract(penaltyAmount);
BuyerPenaltyCalResult bpcr = BuyerPenaltyCalResult.builder().uid(buyerUid).orderCode(orderCode)
BuyerPenaltyCalResult bpcr = BuyerPenaltyCalResult.builder()
.uid(buyerUid).orderCode(orderCode)
.orderActualAmount(orderActualAmount)
.goodsActualAmount(goodsActualAmount)
.penaltyRate(penaltyRate)
.penaltyAmount(penaltyAmount).leftAmount(leftAmount).build();
.penaltyAmount(penaltyAmount)
.leftAmount(leftAmount)
.build();
logger.info("calBuyerPenalty mfee {} BuyerPenaltyCalResult {}", penaltyRule, bpcr);
return bpcr;
}
... ...
... ... @@ -44,7 +44,9 @@ public class BuyerPenaltyRuleSelector {
throw new UfoServiceException(501, "buyer penalty order status is null");
}
Collection<BuyerPenalty.Fee> fees = getFeesByOrderAttributesAndStatus();
// 没有时间限制的规则
Supplier<BuyerPenalty.Fee> nonTimeRangeFeeSupplier = () -> fees.stream().filter(fee -> Objects.isNull(fee.getTimeRange())).findFirst().orElse(null);
// 是否时间限制范围内的规则
Predicate<BuyerPenalty.Fee> timeRangeFeePredicate = fee -> {
BuyerPenalty.Range timeRange = fee.getTimeRange();
BigDecimal min = timeRange.getMin();
... ... @@ -54,6 +56,7 @@ public class BuyerPenaltyRuleSelector {
boolean ltMax = Objects.isNull(max) || diffTime <= max.intValue();
return gtMin && ltMax;
};
// 选取合适的匹配规则
BuyerPenalty.Fee fixFee = fees.stream()
.filter(e -> Objects.nonNull(e.getTimeRange()))
// sort by index
... ...
... ... @@ -37,6 +37,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
... ... @@ -90,9 +91,6 @@ public class BuyerOrderCancelService {
private OrderStatusFlowService orderStatusFlowService;
public void cancel(BeforeSellerDeliverEvent bsdEvent){
int buyerUid = bsdEvent.getBuyerUid();
int sellerUid = bsdEvent.getSellerUid();
... ... @@ -114,6 +112,8 @@ public class BuyerOrderCancelService {
int currentTime = DateUtil.getCurrentTimeSecond();
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expected.getCode(), targetOrderStatus.getCode(), currentTime);
if (rows>0) {
boolean noResponsibility = Objects.isNull(bpcr.getPenaltyAmount())
|| BigDecimal.ZERO.compareTo(bpcr.getPenaltyAmount()) == 0;
//退还优惠券
refundCouponIfNeed(buyerUid, orderCode);
int skup = bsdEvent.getSkup();
... ... @@ -128,8 +128,12 @@ public class BuyerOrderCancelService {
soc.setUpdateTime(DateUtil.getCurrentTimeSecond());
sellerOrderMapper.updateBySkups(soc, Arrays.asList(skup));
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
inBoxFacade.buyerCancelBeforeSellerDeliver(buyerUid, orderCode,
bpcr.getPenaltyAmount().toPlainString(), psog);
if (noResponsibility){
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
}else {
inBoxFacade.buyerCancelBeforeSellerDeliver(buyerUid, orderCode,
bpcr.getPenaltyAmount().toPlainString(), psog);
}
//TODO 整个过程异步去执行(考虑退费依赖订单状态)
//(退费)退保证金给卖家
//(转账)瓜分指定赔偿款给卖家和平台
... ... @@ -217,10 +221,11 @@ public class BuyerOrderCancelService {
}
OrderStatus expected = bdrEvent.getExpected();
int currentTime = DateUtil.getCurrentTimeSecond();
int rows = buyerOrderMapper.updateStatusByOrderCode(orderCode, buyerUid, expected.getCode(), targetOrderStatus.getCode(), currentTime);
if (rows>0) {
boolean noResponsibility = Objects.isNull(bpcr.getPenaltyAmount())
|| BigDecimal.ZERO.compareTo(bpcr.getPenaltyAmount()) == 0;
//退还优惠券
refundCouponIfNeed(buyerUid, orderCode);
... ... @@ -236,8 +241,12 @@ public class BuyerOrderCancelService {
soc.setUpdateTime(DateUtil.getCurrentTimeSecond());
sellerOrderMapper.updateBySkups(soc, Arrays.asList(skup));
SellerOrderGoods psog = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
inBoxFacade.buyerCancelBeforeDepotReceive(buyerUid, orderCode,
bpcr.getPenaltyAmount().toPlainString(), psog);
if (noResponsibility){
inBoxFacade.noticeSellerWhenBuyerCancelNoResponsibility(psog, orderCode);
}else {
inBoxFacade.buyerCancelBeforeDepotReceive(buyerUid, orderCode,
bpcr.getPenaltyAmount().toPlainString(), psog);
}
//整个过程异步去执行(考虑退费依赖订单状态)
//(退费)退保证金给卖家
//(转账)瓜分指定赔偿款给卖家和平台
... ...
... ... @@ -981,6 +981,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
.penaltyRate(penaltyRate)
.penaltyAmount(penaltyAmount)
.refundAmount(refundAmount)
.showPrice(true)
.build();
return occr;
}
... ...
... ... @@ -9,6 +9,7 @@ import com.yohobuy.ufo.model.order.constants.OrderConstant;
import com.yohobuy.ufo.model.order.constants.SkupType;
import com.yohobuy.ufo.model.order.resp.ExpressInfoDetail;
import com.yohobuy.ufo.model.order.vo.AddressInfo;
import com.yohoufo.common.utils.BigDecimalHelper;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.dal.order.*;
import com.yohoufo.dal.order.model.*;
... ... @@ -18,6 +19,7 @@ import com.yohoufo.order.constants.MetaKey;
import com.yohoufo.order.constants.ViewType;
import com.yohoufo.order.convert.GoodsInfoConvertor;
import com.yohoufo.order.convert.SellerOrderConvertor;
import com.yohoufo.order.model.dto.BuyerPenaltyCalResult;
import com.yohoufo.order.model.dto.SellerOrderComputeResult;
import com.yohoufo.order.model.request.OrderRequest;
import com.yohoufo.order.model.response.OrderDetailInfo;
... ... @@ -25,6 +27,7 @@ import com.yohoufo.order.mq.DelayTime;
import com.yohoufo.order.service.AbsSellerOrderViewService;
import com.yohoufo.order.service.IOrderDetailService;
import com.yohoufo.order.service.cache.OrderCacheService;
import com.yohoufo.order.service.handler.BuyerCancelCompensateComputeHandler;
import com.yohoufo.order.service.impl.processor.SellerOrderPrepareProcessor;
import com.yohoufo.order.service.proxy.DeliveryMinutesService;
import com.yohoufo.order.service.proxy.ProductProxyService;
... ... @@ -87,10 +90,12 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
@Autowired
private SellerOrderPrepareProcessor sellerOrderPrepareProcessor;
@Autowired
private OrderOverTimeService orderOverTimeService;
@Autowired
private BuyerCancelCompensateComputeHandler buyerCancelCompensateComputeHandler;
private static List<SkupStatus> noNeedShowOrderCode = Arrays.asList(SkupStatus.CAN_NOT_SELL,SkupStatus.CAN_SELL,
SkupStatus.SELF_CANCEL_PAY, SkupStatus.TIMEOUT_CANCEL,
SkupStatus.SELLER_CANCEL_SELL, SkupStatus.YOHO_CANCEL_SELL);
... ... @@ -386,11 +391,9 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
OrderDetailInfo.StatusDetail statusDetail = OrderDetailInfo.StatusDetail.builder()
.status(orderStatus.getCode())
.statuStr(orderStatus.getStatusStr(tabType))
.detailDesc(orderStatus.getDetailDesc(tabType))
.build();
if(orderStatus.getCode() == OrderStatus.HAS_PAYED.getCode() || orderStatus.getCode() == OrderStatus.SEND_OUT_TIMEOUT.getCode()){
//TimeoutBo timeoutBo = ordersPayService.getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode());
//orderOverTimeService
OrderOverTime orderOverTime = Optional.ofNullable(buyerOrder.getOrderCode()).map(orderOverTimeService::selectByOrderCode).orElse(null);
... ... @@ -405,20 +408,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
}
}
OrderAttributes oa = OrderAttributes.getOrderAttributes(buyerOrder.getAttributes());
/*
if(orderStatus == OrderStatus.HAS_PAYED){
Integer deliverLeftTime = getDeliverLeftTime(buyerOrder.getUid(), buyerOrder.getOrderCode(), buyerOrder.getStatus(), oa);
if (deliverLeftTime != null){
statusDetail.setLeftTime(deliverLeftTime);
}
}
if(orderStatus == OrderStatus.WAITING_PAY){
Integer leftTime = getLeftTime(tabType,buyerOrder.getUid(), buyerOrder.getOrderCode(),
orderStatus.getCode(), buyerOrder.getCreateTime(), oa);
if (Objects.nonNull(leftTime)){
statusDetail.setLeftTime(leftTime);
}
}*/
Integer buyerUid = buyerOrder.getUid();
Long orderCode = buyerOrder.getOrderCode();
int orderStatusCode = orderStatus.getCode();
... ... @@ -430,9 +420,26 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
if(ActionStatusHold.getSellerShowExpressStatusList().contains(orderStatus.getCode())){
statusDetail.setExpressShow(true);
}
//.detailDesc(orderStatus.getDetailDesc(tabType))
String detailDesc = formatDetailDesc(buyerOrder, orderStatus, tabType);
statusDetail.setDetailDesc(detailDesc);
return statusDetail;
}
private String formatDetailDesc(BuyerOrder buyerOrder,OrderStatus orderStatus, TabType tabType){
String detailDesc = orderStatus.getDetailDesc(tabType);
if (Objects.nonNull(orderStatus)
&& (OrderStatus.BUYER_CANCEL_BEFORE_SELLER_DELIVER.equals(orderStatus)
|| OrderStatus.BUYER_CANCEL_BEFORE_DEPOT_RECEIVE.equals(orderStatus))){
BuyerPenaltyCalResult bpcr ;
final OrderStatus targetStatus = orderStatus;
bpcr = buyerCancelCompensateComputeHandler.calBuyerPenaltyCalResult(buyerOrder, targetStatus);
detailDesc = String.format(detailDesc, BigDecimalHelper.halfUp(bpcr.getPenaltyAmount()).doubleValue());
}
return detailDesc;
}
@Override
protected void resetDynamicProporties(OrderDetailInfo orderDetailInfo) {
Long orderCode = orderDetailInfo.getOrderCode();
... ...
... ... @@ -528,13 +528,16 @@ public class SkupListService {
productInfo.setStorageId(sellerOrderGoods.getStorageId());
Integer soga = sellerOrderGoods.getAttributes();
SkupType skupType = SkupType.getSkupType(soga);
boolean isAdvance = OrderAssist.skupIsAdvance(sellerOrderGoods.getAttributes());
//
GoodsInfo giwp = storageIdGoodInfoMap.get(sellerOrderGoods.getStorageId());
if (Objects.nonNull(giwp)){
productInfo.setMinPrice(giwp.getMinPrice());
productInfo.setMaxPrice(giwp.getMaxPrice());
productInfo.setSuggestMinPrice(giwp.getSuggestMinPrice());
productInfo.setSuggestMaxPrice(giwp.getSuggestMaxPrice());
if (!isAdvance) {
productInfo.setSuggestMinPrice(giwp.getSuggestMinPrice());
productInfo.setSuggestMaxPrice(giwp.getSuggestMaxPrice());
}
PrdPrice prdPrice;
if (Objects.nonNull(prdPrice=giwp.getPrdPrice())) {
BigDecimal leastPrice = prdPrice.getLeastPrice(skupType);
... ... @@ -544,7 +547,7 @@ public class SkupListService {
orderListInfo.setGoodsInfo(productInfo);
//tips
if (!OrderAssist.skupIsAdvance(sellerOrderGoods.getAttributes())){
if (!isAdvance){
orderListInfo.setTips(overPriceTipsMap.get(OrderAssist.overFlowPriceKey(sellerOrderGoods.getStorageId(), sellerOrderGoods.getGoodsPrice())));
}
orderListInfo.setIsAdvance(OrderAssist.getSkupIsAdvance(soga));
... ...
... ... @@ -188,6 +188,9 @@ public class InBoxFacade {
});
}
private String replaceSMSContent(InboxBusinessTypeEnum ibte, Object... params){
return getReplacedContent(ibte.getContent(), params);
}
private String getReplacedContent(String content ,Object... params) {
return MessageFormatter.arrayFormat(content, params).getMessage();
... ... @@ -1075,6 +1078,45 @@ public class InBoxFacade {
}
}
/**
* 买家在24小时内取消预售
* 站内:您的商品「商品名称」「尺码」,已被买家取消,您出售的商品已下架,保证金将于1个工作日内退回您的账户。
* 短信:买家已取消订单,订单编号{}。您的商品「商品名称」已下架,更多信息请查看Yoho!Buy有货APP [我的-球鞋交易-出售]。
*/
public void noticeSellerWhenBuyerCancelNoResponsibility(SellerOrderGoods sog, long orderCode){
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
String sizeName = sog.getSizeName();
try {
executorService.execute(()->{
InboxBusinessTypeEnum ibt = InboxBusinessTypeEnum.NOTICE_SELLER_WHEN_BUYER_CANCEL_NO_RESPONSIBILITY;
String params = buildParams(prdName, sizeName, orderCode);
InboxReqVO req = buildInboxReqVO(sellerUid, params, ibt);
InBoxResponse resp = inBoxSDK.addInbox(req);
logger.info("record noticeSellerWhenBuyerCancelNoResponsibility to seller inbox msg, sellerUid {}, orderCode {},prdName {} resp {}",
sellerUid, orderCode,prdName, resp);
//短信
String phone = userProxyService.getMobile(sellerUid);
if (StringUtils.isBlank(phone)){
logger.warn("in noticeSellerWhenBuyerCancelNoResponsibility sms fail, sellerUid {} orderCode {} prdName {}", sellerUid, orderCode,prdName);
return;
}
List<String> mobileList = Arrays.asList(phone);
String content = replaceSMSContent(InboxBusinessTypeEnum.SMS_NOTICE_SELLER_WHEN_BUYER_CANCEL_NO_RESPONSIBILITY, orderCode, prdName);
sendSmsService.smsSendByMobile(content,mobileList);
logger.info("record noticeSellerWhenBuyerCancelNoResponsibility inbox sms msg, sellerUid {}, orderCode {},prdName {}",
sellerUid, orderCode, prdName);
});
} catch (Exception e) {
logger.warn("InBoxFacade noticeSellerWhenBuyerCancelNoResponsibility error inbox msg, sellerUid {}, orderCode {} ,prdName {}",
sellerUid, orderCode, prdName, e);
}
}
public void buyerCancelBeforeSellerDeliver(int buyerUid, long orderCode,String compesant, SellerOrderGoods sog) {
Integer sellerUid = sog.getUid();
String prdName = sog.getProductName();
... ... @@ -1103,8 +1145,6 @@ public class InBoxFacade {
return;
}
List<String> mobileList = Arrays.asList(phone);
//SmsContentEnum smsIbt=SmsContentEnum.SMS_CLOSED_PLATFORM;
//String content=smsIbt.getReplacedContent(prdName);
String content= getReplacedContent(InboxBusinessTypeEnum.SMS_CANCELED_BY_BUYER_AFTER_PAID.getContent(),orderCode,prdName);
sendSmsService.smsSendByMobile(content,mobileList);
... ...
... ... @@ -599,7 +599,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
String headIcon = profileInfo.getHead_ico();
if(DEFAULT_HEAD_IMG.equals(headIcon) || StringUtils.isBlank(headIcon)){//有货的默认头像
//ufo 用户的默认头像
headIcon = configReader.getString("ufo.product.defaultUserHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}");
// headIcon = configReader.getString("ufo.product.defaultUserHeadIcon", "http://img12.static.yhbimg.com/article/2019/02/26/16/02456ade977d8dfdbc4ca548b196c1d62b.png?imageView2/{mode}/w/{width}/h/{height}");
headIcon = "http://img12.static.yhbimg.com/article/2019/02/26/16/02456ade977d8dfdbc4ca548b196c1d62b.png?imageView2/{mode}/w/{width}/h/{height}";
}
track.setHeadIcon(headIcon);
... ... @@ -631,7 +632,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
int authTime = identifyRecord.getAuthTime();
identifyTrack.setTime(authTime);
identifyTrack.setTimeStr(formatDate(authTime, "yyyy.MM.dd HH:mm:ss"));
identifyTrack.setContent(authGroup + "鉴定结果为\"真\"");
identifyTrack.setContent(authGroup.substring(0, 7) + "鉴定结果为\"真\"");
identifyTrack.setType(MESSAGE_TYPE_JUDGE_INFO);
//鉴定中心,默认的展示头像
String authIco = configReader.getString("ufo.product.defaultAuthHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/01384244a3ca86fa5345df87c59317b81f.png?imageView2/{mode}/w/{width}/h/{height}");
... ... @@ -660,7 +661,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
String headIcon = profileMap.get(toUid).getHead_ico();
if(DEFAULT_HEAD_IMG.equals(headIcon) || StringUtils.isBlank(headIcon)){//有货的默认头像
//ufo 用户的默认头像
headIcon = configReader.getString("ufo.product.defaultUserHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}");
// headIcon = configReader.getString("ufo.product.defaultUserHeadIcon", "http://img12.static.yhbimg.com/article/2019/02/26/16/02456ade977d8dfdbc4ca548b196c1d62b.png?imageView2/{mode}/w/{width}/h/{height}");
headIcon = "http://img12.static.yhbimg.com/article/2019/02/26/16/02456ade977d8dfdbc4ca548b196c1d62b.png?imageView2/{mode}/w/{width}/h/{height}";
}
item.setHeadIcon(headIcon);
item.setType(MESSAGE_TYPE_EX_OWNER);
... ... @@ -929,5 +931,5 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
}
return tmp;
}
}
... ...
... ... @@ -192,6 +192,9 @@ public class CacheService {
set(getZhiMaCertRedisKeyBuilder(zhiMaCert.getUid()),zhiMaCert,CacheKeyEnum.ZHI_MA_CERT_KEY.getDefaultExpireTime(),CacheKeyEnum.ZHI_MA_CERT_KEY.getTimeUnit());
}
public void delZhiMaCert(Integer uid){
yhRedisTemplate.delete(getZhiMaCertRedisKeyBuilder(uid));
}
/**************************************************************************
... ...
... ... @@ -99,6 +99,15 @@ public class RealNameAuthorizeController {
return new ApiResponse(isZhiMaCert);
}
@RequestMapping(params = "method=ufo.user.clearZhiMaCertInfo")
public ApiResponse clearZhiMaCertInfo(@RequestParam("uid") Integer uid) throws GatewayException {
logger.info("enter realNameAuthorize.clearZhiMaCertInfo param uid is {}", uid);
int deleteNum = realNameAuthorizeService.clearZhiMaCertInfo(uid);
ApiResponse apiResponse = new ApiResponse();
apiResponse.setData(deleteNum);
return apiResponse;
}
@RequestMapping(params = "method=ufo.user.zhiMaCertInfo")
public ApiResponse zhiMaCertInfo(@RequestParam("uid") Integer uid) throws GatewayException {
logger.info("enter realNameAuthorize.zhiMaCertInfo param uid is {}", uid);
... ...
... ... @@ -20,6 +20,8 @@ public interface IRealNameAuthorizeService {
boolean isValidZhiMaCert(int uid);
int clearZhiMaCertInfo(Integer uid);
ZhiMaCert getValidZhiMaCert(int uid);
AuthorizeResultRespVO zhiMaCertInit(RealNameAuthorizeReqVO reqVO);
... ...
... ... @@ -291,6 +291,22 @@ public class RealNameAuthorizeServiceImpl implements IRealNameAuthorizeService {
return false;
}
/**
* 清芝麻认证的缓存信息
*/
@Override
public int clearZhiMaCertInfo(Integer uid){
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo uid is {} ", uid);
int result = 0;
if (uid!=null && uid > 0 ){
result = zhiMaCertDao.deleteByUid(uid);
logger.info("RealNameAuthorizeServiceImpl clearCacheZhiMaCertInfo delete uid{} ,delete result is {}", uid, result);
cacheService.delZhiMaCert(uid);
}
return result;
}
@Override
public ZhiMaCert getValidZhiMaCert(int uid) {
logger.info("RealNameAuthorizeServiceImpl getZhiMaCert uid is {} ", uid);
... ...