...
|
...
|
@@ -26,8 +26,10 @@ import com.yohoufo.dal.order.model.QiniuLiveRecord; |
|
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
|
|
import com.yohoufo.dal.product.IdentifyRecordsMapper;
|
|
|
import com.yohoufo.dal.product.IdentifyRelationMapper;
|
|
|
import com.yohoufo.dal.product.ProductChainMapper;
|
|
|
import com.yohoufo.dal.product.model.IdentifyRecord;
|
|
|
import com.yohoufo.dal.product.model.IdentifyRelation;
|
|
|
import com.yohoufo.dal.product.model.ProductChain;
|
|
|
import com.yohoufo.product.response.IdentifyShareInfoResp;
|
|
|
import com.yohoufo.product.response.IdentifyTrackResp;
|
|
|
import com.yohoufo.product.response.ProductIdentifyResp;
|
...
|
...
|
@@ -66,6 +68,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
private IdentifyRelationMapper identifyRelationMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ProductChainMapper productChainMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private ServiceCaller serviceCaller;
|
|
|
|
|
|
@Autowired
|
...
|
...
|
@@ -127,6 +132,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
String vedioFileUrl = getLiveVideoUrlByOrderCode(orderCode);
|
|
|
result.setVedioFileUrl(vedioFileUrl);
|
|
|
|
|
|
//查询区块链id
|
|
|
ProductChain productChain = queryTransactionIdByTagId(tagId);
|
|
|
result.setTransactionId(productChain == null ? null : productChain.getTransactionId());
|
|
|
|
|
|
//组装查询结果
|
|
|
//鉴定者的信息、鉴定时间、鉴定中心等
|
|
|
int authTime = identifyRecord.getAuthTime();
|
...
|
...
|
@@ -145,8 +154,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
identifyTrack.setTime(authTime);
|
|
|
identifyTrack.setTimeStr(timeStr);
|
|
|
identifyTrack.setContent( authGroup + "鉴定结果为\"真\"");
|
|
|
//测试数据还得再改
|
|
|
String auth_inco = configReader.getString("ufo.product.authIcon", "http://img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png");
|
|
|
//鉴定中心,默认的展示头像
|
|
|
String auth_inco = configReader.getString("ufo.product.defaultAuthHeadIcon", "http://head.static.yhbimg.com/yhb-head/2018/12/24/10/01187dd372e153ea9c062cd0604cd169b2.jpg?imageView2/{mode}/w/{width}/h/{height}");
|
|
|
identifyTrack.setHeadIcon(auth_inco);
|
|
|
trackRespList.add(identifyTrack);
|
|
|
|
...
|
...
|
@@ -198,7 +207,25 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 查询区块链Id
|
|
|
* @param tagId
|
|
|
* @return
|
|
|
*/
|
|
|
private ProductChain queryTransactionIdByTagId(String tagId) {
|
|
|
RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:relateTransactionId:").appendVar(tagId);
|
|
|
ProductChain result = clientCache.get(kb, ProductChain.class);
|
|
|
if(result != null ){
|
|
|
logger.info("queryTransactionIdByTagId from cache success! tagId={},result={}", tagId,result);
|
|
|
return result;
|
|
|
}
|
|
|
result = productChainMapper.selectByTagId(tagId);
|
|
|
if(result != null){
|
|
|
clientCache.set(kb.getKey(), 10 * 60 , result );//10分钟
|
|
|
}
|
|
|
logger.info("queryTransactionIdByTagId from db success! tagId={},result={}", tagId,result);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|