|
|
package com.yohoufo.product.service.impl;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Collections;
|
|
|
import java.util.Comparator;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Map.Entry;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import org.apache.commons.lang.ArrayUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.elasticsearch.common.collect.Lists;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.qiniu.util.Json;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.yoho.core.config.ConfigReader;
|
|
|
import com.yoho.core.rabbitmq.YhProducer;
|
|
|
import com.yoho.core.redis.cluster.operations.serializer.RedisKeyBuilder;
|
|
|
import com.yoho.core.rest.client.ServiceCaller;
|
|
|
import com.yoho.core.rest.client.hystrix.AsyncFuture;
|
...
|
...
|
@@ -11,37 +33,40 @@ import com.yoho.service.model.social.request.UicUserReqBO; |
|
|
import com.yoho.service.model.social.response.UserInfoRspBO;
|
|
|
import com.yoho.service.model.uic.UicResponse;
|
|
|
import com.yoho.service.model.uic.request.UserInfoBO;
|
|
|
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
|
|
|
import com.yohobuy.ufo.model.order.constants.QNliveConstants;
|
|
|
import com.yohoufo.common.cache.CacheClient;
|
|
|
import com.yohoufo.common.exception.GatewayException;
|
|
|
import com.yohoufo.common.helper.ImageUrlAssist;
|
|
|
import com.yohoufo.common.utils.DateUtil;
|
|
|
import com.yohoufo.common.utils.MobileHelper;
|
|
|
|
|
|
import com.yohoufo.dal.order.*;
|
|
|
import com.yohoufo.dal.order.BuyerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.BuyerOrderMapper;
|
|
|
import com.yohoufo.dal.order.OrderOperateRecordMapper;
|
|
|
import com.yohoufo.dal.order.OrdersPayMapper;
|
|
|
import com.yohoufo.dal.order.QiniuLiveRecordMapper;
|
|
|
import com.yohoufo.dal.order.SellerOrderGoodsMapper;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrder;
|
|
|
import com.yohoufo.dal.order.model.BuyerOrderGoods;
|
|
|
import com.yohoufo.dal.order.model.OrderOperateRecord;
|
|
|
import com.yohoufo.dal.order.model.OrdersPay;
|
|
|
import com.yohoufo.dal.order.model.QiniuLiveRecord;
|
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.dal.order.model.OrdersPay;
|
|
|
import com.yohoufo.dal.product.IdentifyRecordsMapper;
|
|
|
import com.yohoufo.dal.product.IdentifyRelationMapper;
|
|
|
import com.yohoufo.dal.product.ProductChainMapper;
|
|
|
import com.yohoufo.dal.product.TransferRecordsHistoryMapper;
|
|
|
import com.yohoufo.dal.product.TransferRecordsMapper;
|
|
|
import com.yohoufo.dal.product.model.IdentifyRecord;
|
|
|
import com.yohoufo.dal.product.model.IdentifyRelation;
|
|
|
import com.yohoufo.dal.product.model.ProductChain;
|
|
|
import com.yohoufo.dal.product.model.TransferRecords;
|
|
|
import com.yohoufo.dal.product.model.TransferRecordsHistory;
|
|
|
import com.yohoufo.product.mq.TopicConstants;
|
|
|
import com.yohoufo.product.response.IdentifyShareInfoResp;
|
|
|
import com.yohoufo.product.response.IdentifyTrackResp;
|
|
|
import com.yohoufo.product.response.ProductIdentifyResp;
|
|
|
import com.yohoufo.product.service.ProductIdentifyService;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
@Service
|
...
|
...
|
@@ -81,12 +106,34 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
@Autowired
|
|
|
private TransferRecordsMapper transferRecordsMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private OrderOperateRecordMapper orderOperateRecordMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private TransferRecordsHistoryMapper transferRecordsHistoryMapper;
|
|
|
|
|
|
@Resource(name = "yhProducer")
|
|
|
private YhProducer yhProducer;
|
|
|
|
|
|
@Value("${uic.url:http://uic.yohoops.org/uic}")
|
|
|
private String uicUrl;
|
|
|
|
|
|
public static final String DEFAULT_HEAD_IMG = "http://img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png?imageView/{mode}/w/{width}/h/{height}";
|
|
|
|
|
|
public static final Integer OPERATE_TYPE_APPLYING = 0;//申请中
|
|
|
|
|
|
public static final Integer OPERATE_TYPE_PASS = 1;//同意
|
|
|
|
|
|
public static final Integer OPERATE_TYPE_REJECT = 2;//拒绝
|
|
|
|
|
|
public static final Integer OPERATE_TYPE_TIMEOUT = 3;//确认超时
|
|
|
|
|
|
public static final Integer OPERATE_TYPE_NO_APPLY = 4; //未申请
|
|
|
|
|
|
/**
|
|
|
* 鉴定结果查询接口
|
|
|
* @param tagId
|
...
|
...
|
@@ -219,6 +266,288 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
logger.info("queryIdentifyInfo success!, tagId = {}, nfcUid={}, result ={}", tagId, nfcUid, result );
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
private boolean queryIsOwner(String tagId, String nfcUid, Integer uid) {
|
|
|
IdentifyRecord record = identifyRecordsMapper.selectByTagAndNfcId(tagId, nfcUid);
|
|
|
if(null != record && record.getOwner() == uid.intValue()) {
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public ProductIdentifyResp queryNewIdentifyInfo(String tagId, String nfcUid, Integer uid) throws GatewayException {
|
|
|
logger.info("enter queryNewIdentifyInfo, tagId = {}, nfcUid={}, uid={}", tagId, nfcUid, uid);
|
|
|
//返回结果可能在缓存中
|
|
|
ProductIdentifyResp result = getIdentifyFromCache(tagId, nfcUid);
|
|
|
if(result != null ){
|
|
|
rebuildResult(result, tagId, nfcUid, uid);
|
|
|
logger.info("queryNewIdentifyInfo get result from cache success! tagId = {}, nfcUid={},uid={}, result={} ", tagId, nfcUid, uid, result );
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
//1)鉴定 记录--先从缓存去取
|
|
|
IdentifyRecord identifyRecord = queryIdentifyRecord(tagId, nfcUid);
|
|
|
if(identifyRecord == null){
|
|
|
throw new GatewayException(402, "鉴定信息不存在");
|
|
|
}
|
|
|
|
|
|
//根据鉴定记录 获取订单号
|
|
|
Long orderCode = identifyRecord.getOrderCode();
|
|
|
//2)订单号 获取订单详细信息
|
|
|
BuyerOrder buyerOrder = buyerOrderMapper.selectOnlyByOrderCode(orderCode);
|
|
|
if(buyerOrder == null){
|
|
|
throw new GatewayException(403, "订单不存在");
|
|
|
}
|
|
|
|
|
|
//3)商品详细信息
|
|
|
result = getOrderDetail(buyerOrder, identifyRecord, tagId);
|
|
|
|
|
|
//4)物权转移轨迹
|
|
|
List<IdentifyTrackResp> trackList = getTrackList(identifyRecord, result.getIdentifyPlat());
|
|
|
result.setTrackList(trackList);
|
|
|
|
|
|
//5)设置当前物权所有人
|
|
|
result.setCurrentOwner(trackList.get(trackList.size()-1).getContent());
|
|
|
|
|
|
//设置缓存--可能会有延时,不影响的
|
|
|
setIdentifyCache(tagId, nfcUid, result);
|
|
|
|
|
|
//添加申请物权转移人信息
|
|
|
rebuildResult(result, tagId, nfcUid, uid);
|
|
|
logger.info("queryIdentifyInfo success!, tagId = {}, nfcUid={}, result ={}", tagId, nfcUid, result );
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int applyToBeOwner(String tagId, String nfcUid, Integer uid) throws GatewayException {
|
|
|
IdentifyRecord identifyRecord = queryIdentifyRecord(tagId, nfcUid);
|
|
|
if(identifyRecord == null){
|
|
|
throw new GatewayException(402, "鉴定信息不存在");
|
|
|
}
|
|
|
|
|
|
if(identifyRecord.getOwner() == uid.intValue()) {
|
|
|
throw new GatewayException(402, "已经是物权所有人");
|
|
|
}
|
|
|
|
|
|
TransferRecordsHistory history = transferRecordsHistoryMapper.selectByToUid(tagId, nfcUid, uid);
|
|
|
if(null != history && (history.getStatus().equals(OPERATE_TYPE_APPLYING)
|
|
|
|| history.getStatus().equals(OPERATE_TYPE_PASS) || history.getStatus().equals(OPERATE_TYPE_REJECT))) {
|
|
|
throw new GatewayException(402, "当前不可再申请");
|
|
|
}
|
|
|
|
|
|
//将申请记录插入数据库
|
|
|
TransferRecordsHistory insertItem = new TransferRecordsHistory();
|
|
|
insertItem.setTagId(tagId);
|
|
|
insertItem.setNfcUid(nfcUid);
|
|
|
insertItem.setFromUid(String.valueOf(identifyRecord.getOwner()));
|
|
|
insertItem.setToUid(String.valueOf(uid));
|
|
|
insertItem.setOperateTime(DateUtil.getCurrentTimeSecond());
|
|
|
insertItem.setStatus(OPERATE_TYPE_APPLYING);
|
|
|
int result = transferRecordsHistoryMapper.insert(insertItem);
|
|
|
|
|
|
//向物权所有人发送站内信
|
|
|
|
|
|
//发送定时mq
|
|
|
yhProducer.send(TopicConstants.MQ_TOPIC_CONFIRM_OWNER_DELAY, insertItem, null, 3*24*60);//3天
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public int confirmOwner(String tagId, String nfcUid, Integer fromUid, Integer toUid, Integer status) throws GatewayException {
|
|
|
if(null == status || !(status.equals(OPERATE_TYPE_PASS) || status.equals(OPERATE_TYPE_REJECT))){
|
|
|
throw new GatewayException(402, "参数status错误");
|
|
|
}
|
|
|
IdentifyRecord identifyRecord = queryIdentifyRecord(tagId, nfcUid);
|
|
|
if(identifyRecord == null){
|
|
|
throw new GatewayException(402, "鉴定信息不存在");
|
|
|
}
|
|
|
|
|
|
if(identifyRecord.getOwner() != fromUid.intValue()) {
|
|
|
throw new GatewayException(402, "不是当前物权所有人,无法操作");
|
|
|
}
|
|
|
|
|
|
TransferRecordsHistory history = transferRecordsHistoryMapper.selectByToUid(tagId, nfcUid, toUid);
|
|
|
if(null == history || !history.getStatus().equals(OPERATE_TYPE_APPLYING)) {
|
|
|
throw new GatewayException(402, "不是申请中状态");
|
|
|
}
|
|
|
|
|
|
//将记录插入历史表transfer_recors_history
|
|
|
TransferRecordsHistory histroy = new TransferRecordsHistory();
|
|
|
histroy.setTagId(tagId);
|
|
|
histroy.setNfcUid(nfcUid);
|
|
|
histroy.setFromUid(String.valueOf(identifyRecord.getOwner()));
|
|
|
histroy.setToUid(String.valueOf(toUid));
|
|
|
histroy.setOperateTime(DateUtil.getCurrentTimeSecond());
|
|
|
histroy.setStatus(status);
|
|
|
int result = transferRecordsHistoryMapper.insert(histroy);
|
|
|
|
|
|
if(status.equals(OPERATE_TYPE_REJECT)) {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
//增加记录到transfer_records
|
|
|
TransferRecords transferRecords = new TransferRecords();
|
|
|
transferRecords.setTagId(tagId);
|
|
|
transferRecords.setNfcUid(nfcUid);
|
|
|
transferRecords.setFromUid(histroy.getFromUid());
|
|
|
transferRecords.setToUid(history.getToUid());
|
|
|
transferRecords.setCreateTime(DateUtil.getCurrentTimeSecond());
|
|
|
transferRecordsMapper.insert(transferRecords);
|
|
|
|
|
|
//更新identify_record
|
|
|
return identifyRecordsMapper.updateOwner(tagId, nfcUid, toUid);
|
|
|
}
|
|
|
|
|
|
private void rebuildResult(ProductIdentifyResp result, String tagId, String nfcUid, Integer uid) {
|
|
|
boolean isOwner = queryIsOwner(tagId, nfcUid, uid);
|
|
|
result.setIfOwner(isOwner);
|
|
|
if(isOwner) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
//申请人申请状态
|
|
|
TransferRecordsHistory history = transferRecordsHistoryMapper.selectByToUid(tagId, nfcUid, uid);
|
|
|
if(null == history) {
|
|
|
result.setApplyStatus(OPERATE_TYPE_NO_APPLY);//未申请
|
|
|
}else {
|
|
|
result.setApplyStatus(history.getStatus());
|
|
|
}
|
|
|
|
|
|
ProfileInfoRsp[] profileInfoArray = getUserProfilesByUids(Lists.newArrayList(String.valueOf(uid)));
|
|
|
if(ArrayUtils.isEmpty(profileInfoArray)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
ProfileInfoRsp profileInfo = profileInfoArray[0];
|
|
|
IdentifyTrackResp track = new IdentifyTrackResp();
|
|
|
track.setUid(uid);
|
|
|
String mobileMask = MobileHelper.coverMobile2(profileInfo.getMobile());//隐位的手机号码--隐藏中间6位
|
|
|
track.setContent(StringUtils.isEmpty(profileInfo.getNickname()) ? mobileMask : profileInfo.getNickname());
|
|
|
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}");
|
|
|
}
|
|
|
track.setHeadIcon(headIcon);
|
|
|
result.getTrackList().add(track);
|
|
|
}
|
|
|
|
|
|
//交易轨迹
|
|
|
private List<IdentifyTrackResp> getTrackList(IdentifyRecord identifyRecord, String authGroup) {
|
|
|
List<IdentifyTrackResp> trackRespList = new ArrayList<>();
|
|
|
//1)第一部分:一条记录,商品鉴定结果
|
|
|
IdentifyTrackResp identifyTrack = new IdentifyTrackResp();
|
|
|
int authTime = identifyRecord.getAuthTime();
|
|
|
identifyTrack.setTime(authTime);
|
|
|
identifyTrack.setTimeStr(formatDate(authTime, "yyyy.MM.dd HH:mm:ss"));
|
|
|
identifyTrack.setContent(authGroup + "鉴定结果为\"真\"");
|
|
|
//鉴定中心,默认的展示头像
|
|
|
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}");
|
|
|
identifyTrack.setHeadIcon(authIco);
|
|
|
trackRespList.add(identifyTrack);
|
|
|
|
|
|
//2)第二部分:历史物权所有人,按时间顺序排列
|
|
|
List<TransferRecords> transferList = transferRecordsMapper.selectByTagIdAndNfcUid(identifyRecord.getTagId(), identifyRecord.getNfcUid());
|
|
|
List<String> ownerUidList = transferList.stream().map(TransferRecords::getToUid).collect(Collectors.toList());
|
|
|
List<String> allUidList = Lists.newArrayList();
|
|
|
allUidList.addAll(ownerUidList);
|
|
|
|
|
|
//查询头像和手机号
|
|
|
Map<Integer, ProfileInfoRsp> profileMap = queryIcoAndMobile(allUidList);
|
|
|
List<IdentifyTrackResp> historyTrackList = buildTransferTrackList(profileMap, transferList);
|
|
|
trackRespList.addAll(historyTrackList);
|
|
|
|
|
|
return trackRespList;
|
|
|
}
|
|
|
|
|
|
private List<IdentifyTrackResp> buildTransferTrackList(Map<Integer, ProfileInfoRsp> profileMap, List<TransferRecords> transferList) {
|
|
|
List<IdentifyTrackResp> trackList = Lists.newArrayList();
|
|
|
Map<String, TransferRecords> transferMap = transferList.stream().collect(Collectors.toMap(TransferRecords::getToUid, t->t));
|
|
|
for(Entry<Integer, ProfileInfoRsp> entry : profileMap.entrySet()) {
|
|
|
IdentifyTrackResp item = new IdentifyTrackResp();
|
|
|
item.setUid(entry.getKey());
|
|
|
String mobileMask = MobileHelper.coverMobile2(entry.getValue().getMobile());//隐位的手机号码--隐藏中间6位
|
|
|
item.setContent(StringUtils.isEmpty(entry.getValue().getNickname()) ? mobileMask : entry.getValue().getNickname());
|
|
|
String headIcon = entry.getValue().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}");
|
|
|
}
|
|
|
item.setHeadIcon(headIcon);
|
|
|
if(null != transferMap.get(String.valueOf(entry.getKey()))) {
|
|
|
Integer createTime = transferMap.get(String.valueOf(entry.getKey())).getCreateTime();
|
|
|
item.setTime(createTime);
|
|
|
item.setTimeStr(formatDate(createTime, "yyyy.MM.dd HH:mm:ss"));
|
|
|
}
|
|
|
trackList.add(item);
|
|
|
}
|
|
|
|
|
|
Collections.sort(trackList, new Comparator<IdentifyTrackResp>(){//时间顺序排列
|
|
|
@Override
|
|
|
public int compare(IdentifyTrackResp o1, IdentifyTrackResp o2) {
|
|
|
Integer time1 = o1.getTime();
|
|
|
Integer time2 = o2.getTime();
|
|
|
return time1 -time2;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
return trackList;
|
|
|
}
|
|
|
|
|
|
private Map<Integer,ProfileInfoRsp> queryIcoAndMobile(List<String> uidList) {
|
|
|
Map<Integer,ProfileInfoRsp> profileMap = Maps.newHashMap();
|
|
|
ProfileInfoRsp[] profileInfoArray = getUserProfilesByUids(uidList);
|
|
|
if(ArrayUtils.isEmpty(profileInfoArray)) {
|
|
|
return profileMap;
|
|
|
}
|
|
|
|
|
|
for(int i=0; i< profileInfoArray.length; i++) {
|
|
|
ProfileInfoRsp item = profileInfoArray[i];
|
|
|
profileMap.put(item.getUid(), item);
|
|
|
}
|
|
|
|
|
|
return profileMap;
|
|
|
}
|
|
|
|
|
|
//获取订单详情
|
|
|
private ProductIdentifyResp getOrderDetail(BuyerOrder buyerOrder, IdentifyRecord identifyRecord, String tagId) {
|
|
|
ProductIdentifyResp result = new ProductIdentifyResp();
|
|
|
|
|
|
//3)订单号获取 skup
|
|
|
BuyerOrderGoods buyerOrderGoods = buyerOrderGoodsMapper.selectOnlyByOrderCode(buyerOrder.getOrderCode());
|
|
|
Integer skup = buyerOrderGoods.getSkup();
|
|
|
//3)skup获取 productInfo
|
|
|
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
|
|
|
result.setProductImageUrl(ImageUrlAssist.getAllProductPicUrl(sellerOrderGoods.getImageUrl(), "goodsimg", "center", "d2hpdGU="));
|
|
|
result.setNfcUid(identifyRecord.getNfcUid());
|
|
|
result.setProductId(sellerOrderGoods.getProductId());
|
|
|
result.setProductName(sellerOrderGoods.getProductName());
|
|
|
result.setProductSize(sellerOrderGoods.getSizeName());
|
|
|
|
|
|
//4)vedioFileUrl视频链接
|
|
|
String vedioFileUrl = getLiveVideoUrlByOrderCode(buyerOrder.getOrderCode());
|
|
|
result.setVedioFileUrl(vedioFileUrl);
|
|
|
|
|
|
//查询区块链id
|
|
|
ProductChain productChain = queryTransactionIdByTagId(tagId);
|
|
|
result.setTransactionId(productChain == null ? null : productChain.getTransactionId());
|
|
|
|
|
|
//组装查询结果
|
|
|
//鉴定者的信息、鉴定中心等
|
|
|
IdentifyRelation authGroupInfo = queryAuthGroupInfo(identifyRecord.getAuthUid());
|
|
|
String authGroup = authGroupInfo == null ? "UFO鉴定中心" : authGroupInfo.getGroupName();
|
|
|
result.setIdentifyPlat(authGroup);
|
|
|
// result.setIdentifyTime(timeStr);
|
|
|
|
|
|
//查询鉴定师名字
|
|
|
OrderOperateRecord orderOperateRecord = orderOperateRecordMapper.selectByTypeAndOrderCode(OperateTypeEnum.OPERATE_TYPE_JUDGE_PASS.getCode(), buyerOrder.getOrderCode());
|
|
|
result.setIdentifyUserName(null == orderOperateRecord ? "" : orderOperateRecord.getUserName());
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询区块链Id
|
...
|
...
|
@@ -332,6 +661,22 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
ProductIdentifyResp identifyResp = clientCache.get(kb, ProductIdentifyResp.class);
|
|
|
return identifyResp;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量查询用户基本信息--头像信息+手机号
|
|
|
* @return
|
|
|
*/
|
|
|
private ProfileInfoRsp[] getUserProfilesByUids(List<String> uidList) {
|
|
|
try{
|
|
|
String uids = String.join(",", uidList);
|
|
|
String url = uicUrl + "/profile/getUserProfilesByUids";
|
|
|
logger.info("getUserProfilesByUids start call uic.getUserProfilesByUids uidList={}, url={} ", uidList, url);
|
|
|
return serviceCaller.post("uic.getUserProfilesByUids", url, uids, ProfileInfoRsp[].class,null).get();
|
|
|
}catch(Exception e){
|
|
|
logger.warn("getUserProfilesByUids call uic.getUserProfilesByUids error! uidList={}, e {}", uidList, e);
|
|
|
return null;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询用户基本信息--头像信息(不要取此接口的手机号)
|
...
|
...
|
@@ -348,7 +693,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
logger.warn("getUserBaseInfo call uic.getUserInfoByYohoUid error! uid={}, e {}", uid, e);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -367,7 +711,6 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
logger.warn("getUserProfileInfo call uic.getProfileActionPost error! uid={}, e {}", uid, e);
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
private String formatDate(Integer time, String pattern) {
|
...
|
...
|
|