|
@@ -26,8 +26,10 @@ import com.yohoufo.dal.order.model.QiniuLiveRecord; |
|
@@ -26,8 +26,10 @@ import com.yohoufo.dal.order.model.QiniuLiveRecord; |
26
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
26
|
import com.yohoufo.dal.order.model.SellerOrderGoods;
|
27
|
import com.yohoufo.dal.product.IdentifyRecordsMapper;
|
27
|
import com.yohoufo.dal.product.IdentifyRecordsMapper;
|
28
|
import com.yohoufo.dal.product.IdentifyRelationMapper;
|
28
|
import com.yohoufo.dal.product.IdentifyRelationMapper;
|
|
|
29
|
+import com.yohoufo.dal.product.ProductChainMapper;
|
29
|
import com.yohoufo.dal.product.model.IdentifyRecord;
|
30
|
import com.yohoufo.dal.product.model.IdentifyRecord;
|
30
|
import com.yohoufo.dal.product.model.IdentifyRelation;
|
31
|
import com.yohoufo.dal.product.model.IdentifyRelation;
|
|
|
32
|
+import com.yohoufo.dal.product.model.ProductChain;
|
31
|
import com.yohoufo.product.response.IdentifyShareInfoResp;
|
33
|
import com.yohoufo.product.response.IdentifyShareInfoResp;
|
32
|
import com.yohoufo.product.response.IdentifyTrackResp;
|
34
|
import com.yohoufo.product.response.IdentifyTrackResp;
|
33
|
import com.yohoufo.product.response.ProductIdentifyResp;
|
35
|
import com.yohoufo.product.response.ProductIdentifyResp;
|
|
@@ -66,6 +68,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
@@ -66,6 +68,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
66
|
private IdentifyRelationMapper identifyRelationMapper;
|
68
|
private IdentifyRelationMapper identifyRelationMapper;
|
67
|
|
69
|
|
68
|
@Autowired
|
70
|
@Autowired
|
|
|
71
|
+ private ProductChainMapper productChainMapper;
|
|
|
72
|
+
|
|
|
73
|
+ @Autowired
|
69
|
private ServiceCaller serviceCaller;
|
74
|
private ServiceCaller serviceCaller;
|
70
|
|
75
|
|
71
|
@Autowired
|
76
|
@Autowired
|
|
@@ -127,6 +132,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
@@ -127,6 +132,10 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
127
|
String vedioFileUrl = getLiveVideoUrlByOrderCode(orderCode);
|
132
|
String vedioFileUrl = getLiveVideoUrlByOrderCode(orderCode);
|
128
|
result.setVedioFileUrl(vedioFileUrl);
|
133
|
result.setVedioFileUrl(vedioFileUrl);
|
129
|
|
134
|
|
|
|
135
|
+ //查询区块链id
|
|
|
136
|
+ ProductChain productChain = queryTransactionIdByTagId(tagId);
|
|
|
137
|
+ result.setTransactionId(productChain == null ? null : productChain.getTransactionId());
|
|
|
138
|
+
|
130
|
//组装查询结果
|
139
|
//组装查询结果
|
131
|
//鉴定者的信息、鉴定时间、鉴定中心等
|
140
|
//鉴定者的信息、鉴定时间、鉴定中心等
|
132
|
int authTime = identifyRecord.getAuthTime();
|
141
|
int authTime = identifyRecord.getAuthTime();
|
|
@@ -145,8 +154,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
@@ -145,8 +154,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
145
|
identifyTrack.setTime(authTime);
|
154
|
identifyTrack.setTime(authTime);
|
146
|
identifyTrack.setTimeStr(timeStr);
|
155
|
identifyTrack.setTimeStr(timeStr);
|
147
|
identifyTrack.setContent( authGroup + "鉴定结果为\"真\"");
|
156
|
identifyTrack.setContent( authGroup + "鉴定结果为\"真\"");
|
148
|
- //测试数据还得再改
|
|
|
149
|
- String auth_inco = configReader.getString("ufo.product.authIcon", "http://img11.static.yhbimg.com/yhb-img01/2016/07/05/13/017ec560b82c132ab2fdb22f7cf6f42b83.png");
|
157
|
+ //鉴定中心,默认的展示头像
|
|
|
158
|
+ 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}");
|
150
|
identifyTrack.setHeadIcon(auth_inco);
|
159
|
identifyTrack.setHeadIcon(auth_inco);
|
151
|
trackRespList.add(identifyTrack);
|
160
|
trackRespList.add(identifyTrack);
|
152
|
|
161
|
|
|
@@ -198,7 +207,25 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
|
@@ -198,7 +207,25 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{ |
198
|
return result;
|
207
|
return result;
|
199
|
}
|
208
|
}
|
200
|
|
209
|
|
201
|
-
|
210
|
+ /**
|
|
|
211
|
+ * 查询区块链Id
|
|
|
212
|
+ * @param tagId
|
|
|
213
|
+ * @return
|
|
|
214
|
+ */
|
|
|
215
|
+ private ProductChain queryTransactionIdByTagId(String tagId) {
|
|
|
216
|
+ RedisKeyBuilder kb = new RedisKeyBuilder().appendFixed("ufo:product:relateTransactionId:").appendVar(tagId);
|
|
|
217
|
+ ProductChain result = clientCache.get(kb, ProductChain.class);
|
|
|
218
|
+ if(result != null ){
|
|
|
219
|
+ logger.info("queryTransactionIdByTagId from cache success! tagId={},result={}", tagId,result);
|
|
|
220
|
+ return result;
|
|
|
221
|
+ }
|
|
|
222
|
+ result = productChainMapper.selectByTagId(tagId);
|
|
|
223
|
+ if(result != null){
|
|
|
224
|
+ clientCache.set(kb.getKey(), 10 * 60 , result );//10分钟
|
|
|
225
|
+ }
|
|
|
226
|
+ logger.info("queryTransactionIdByTagId from db success! tagId={},result={}", tagId,result);
|
|
|
227
|
+ return result;
|
|
|
228
|
+ }
|
202
|
|
229
|
|
203
|
|
230
|
|
204
|
/**
|
231
|
/**
|