Authored by caoyan

Merge branch 'test6.8.4' of http://git.yoho.cn/ufo/ufo-platform into test6.8.4

@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 where order_code in 31 where order_code in
32 <foreach collection="orderCodes" open="(" close=")" separator="," item="orderCode"> 32 <foreach collection="orderCodes" open="(" close=")" separator="," item="orderCode">
33 #{orderCode,jdbcType=BIGINT} 33 #{orderCode,jdbcType=BIGINT}
34 - </foreach> 34 + </foreach> and show_flag = 1
35 </select> 35 </select>
36 36
37 <insert id="insert" parameterType="com.yoho.order.model.QiniuLiveRecord" useGeneratedKeys="true" keyProperty="id"> 37 <insert id="insert" parameterType="com.yoho.order.model.QiniuLiveRecord" useGeneratedKeys="true" keyProperty="id">
1 package com.yoho.ufo.order.service.impl; 1 package com.yoho.ufo.order.service.impl;
2 2
3 import java.math.BigDecimal; 3 import java.math.BigDecimal;
4 -import java.util.ArrayList;  
5 -import java.util.Collections;  
6 -import java.util.List;  
7 -import java.util.Map; 4 +import java.util.*;
8 import java.util.concurrent.TimeUnit; 5 import java.util.concurrent.TimeUnit;
9 import java.util.stream.Collectors; 6 import java.util.stream.Collectors;
10 7
  8 +import com.yoho.order.dal.*;
  9 +import com.yoho.order.model.*;
11 import org.apache.commons.collections.CollectionUtils; 10 import org.apache.commons.collections.CollectionUtils;
12 import org.apache.commons.lang3.StringUtils; 11 import org.apache.commons.lang3.StringUtils;
13 import org.elasticsearch.common.collect.Lists; 12 import org.elasticsearch.common.collect.Lists;
@@ -23,32 +22,6 @@ import com.alibaba.fastjson.JSONObject; @@ -23,32 +22,6 @@ import com.alibaba.fastjson.JSONObject;
23 import com.yoho.core.common.utils.DateUtil; 22 import com.yoho.core.common.utils.DateUtil;
24 import com.yoho.core.rest.client.ServiceCaller; 23 import com.yoho.core.rest.client.ServiceCaller;
25 import com.yoho.error.exception.ServiceException; 24 import com.yoho.error.exception.ServiceException;
26 -import com.yoho.order.dal.AppraiseAddressMapper;  
27 -import com.yoho.order.dal.AreaMapper;  
28 -import com.yoho.order.dal.BuyerOrderGoodsMapper;  
29 -import com.yoho.order.dal.BuyerOrderMapper;  
30 -import com.yoho.order.dal.BuyerOrderMetaMapper;  
31 -import com.yoho.order.dal.ExpressCompanyMapper;  
32 -import com.yoho.order.dal.ExpressInfoMapper;  
33 -import com.yoho.order.dal.ExpressRecordMapper;  
34 -import com.yoho.order.dal.OrderOperateRecordMapper;  
35 -import com.yoho.order.dal.OrdersPayMapper;  
36 -import com.yoho.order.dal.SellerOrderGoodsMapper;  
37 -import com.yoho.order.dal.SellerOrderMapper;  
38 -import com.yoho.order.dal.SellerOrderMetaMapper;  
39 -import com.yoho.order.model.Area;  
40 -import com.yoho.order.model.BuyerOrder;  
41 -import com.yoho.order.model.BuyerOrderGoods;  
42 -import com.yoho.order.model.BuyerOrderMeta;  
43 -import com.yoho.order.model.BuyerOrderReq;  
44 -import com.yoho.order.model.ExpressCompany;  
45 -import com.yoho.order.model.ExpressInfo;  
46 -import com.yoho.order.model.ExpressRecord;  
47 -import com.yoho.order.model.OrderOperateRecord;  
48 -import com.yoho.order.model.OrdersPay;  
49 -import com.yoho.order.model.SellerOrder;  
50 -import com.yoho.order.model.SellerOrderGoods;  
51 -import com.yoho.order.model.SellerOrderMeta;  
52 import com.yoho.service.model.order.request.OrderRequest; 25 import com.yoho.service.model.order.request.OrderRequest;
53 import com.yoho.ufo.dal.ProductMapper; 26 import com.yoho.ufo.dal.ProductMapper;
54 import com.yoho.ufo.dal.model.Product; 27 import com.yoho.ufo.dal.model.Product;
@@ -119,6 +92,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -119,6 +92,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
119 @Autowired 92 @Autowired
120 private ServiceCaller serviceCaller; 93 private ServiceCaller serviceCaller;
121 94
  95 + @Autowired
  96 + private QiniuLiveRecordMapper qiniuLiveRecordMapper;
  97 +
122 private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address"; 98 private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address";
123 99
124 private static final String SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS = "back_delivery_address"; 100 private static final String SELLER_ORDER_META_KEY_BACK_DELIVERY_ADDRESS = "back_delivery_address";
@@ -239,6 +215,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -239,6 +215,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
239 } 215 }
240 List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap); 216 List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap);
241 217
  218 + completeMp4VedioUrl(respList); // 查询是否有视频连接
  219 +
242 PageResponseBO<BuyerOrderResp> result=new PageResponseBO<>(); 220 PageResponseBO<BuyerOrderResp> result=new PageResponseBO<>();
243 result.setList(respList); 221 result.setList(respList);
244 result.setPage(req.getPage()); 222 result.setPage(req.getPage());
@@ -248,6 +226,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService { @@ -248,6 +226,22 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
248 return result; 226 return result;
249 } 227 }
250 228
  229 + private void completeMp4VedioUrl(List<BuyerOrderResp> respList) {
  230 + if (CollectionUtils.isEmpty(respList)) {
  231 + return;
  232 + }
  233 + List<Long> orderCodeList = new ArrayList<>();
  234 + respList.stream().forEach(item ->
  235 + orderCodeList.add(Long.valueOf(item.getOrderCode()))
  236 + );
  237 + List<QiniuLiveRecord> qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCodes(orderCodeList);
  238 +
  239 + Set<String> containOrderCodeSet = new HashSet<>();
  240 + qiniuLiveRecords.stream().forEach(item -> containOrderCodeSet.add(String.valueOf(item.getOrderCode())));
  241 +
  242 + respList.forEach(item -> item.setContainMp4Flag(containOrderCodeSet.contains(item.getOrderCode())));
  243 + }
  244 +
251 public PageResponseBO<BuyerOrderResp> queryByOrderCodeOrWaybillCode(String queryStr) { 245 public PageResponseBO<BuyerOrderResp> queryByOrderCodeOrWaybillCode(String queryStr) {
252 if(StringUtils.isEmpty(queryStr)) { 246 if(StringUtils.isEmpty(queryStr)) {
253 return null; 247 return null;
@@ -5,6 +5,7 @@ import com.yoho.core.dal.datasource.annotation.Database; @@ -5,6 +5,7 @@ import com.yoho.core.dal.datasource.annotation.Database;
5 import com.yoho.order.dal.QiniuLiveRecordMapper; 5 import com.yoho.order.dal.QiniuLiveRecordMapper;
6 import com.yoho.order.model.QiniuLiveRecord; 6 import com.yoho.order.model.QiniuLiveRecord;
7 import com.yoho.ufo.exception.PlatformException; 7 import com.yoho.ufo.exception.PlatformException;
  8 +import com.yoho.ufo.order.service.event.QiniuLiveRecordEvent;
8 import com.yoho.ufo.service.impl.QNliveUtil; 9 import com.yoho.ufo.service.impl.QNliveUtil;
9 import com.yoho.ufo.service.impl.UserHelper; 10 import com.yoho.ufo.service.impl.UserHelper;
10 import com.yoho.ufo.util.DateUtil; 11 import com.yoho.ufo.util.DateUtil;
@@ -77,7 +78,7 @@ public class UfoLiveService implements ApplicationContextAware { @@ -77,7 +78,7 @@ public class UfoLiveService implements ApplicationContextAware {
77 78
78 record.setNotInId(record.getId()); 79 record.setNotInId(record.getId());
79 80
80 - context.publishEvent(record); // 异步补充记录的卖家订单号,商品信息 // 并将之前的skup相关的视频置为不可见 81 + context.publishEvent(new QiniuLiveRecordEvent(record)); // 异步补充记录的卖家订单号,商品信息 // 并将之前的skup相关的视频置为不可见
81 } 82 }
82 83
83 public String queryMp4Vedio(QNliveReq req) throws PlatformException { 84 public String queryMp4Vedio(QNliveReq req) throws PlatformException {
@@ -292,10 +292,13 @@ function getToBeJudgedList(){ @@ -292,10 +292,13 @@ function getToBeJudgedList(){
292 if (rowData.status == 2) { 292 if (rowData.status == 2) {
293 return "<a role='confirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>"; 293 return "<a role='confirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>";
294 } else if (rowData.status == 3) { 294 } else if (rowData.status == 3) {
295 - return "<a role='pass' dataId='"+ rowData.id + "'" + " orderCode='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定通过</a>"+ 295 + var operateButton = "<a role='pass' dataId='"+ rowData.id + "'" + " orderCode='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定通过</a>"+
296 "<a role='reject' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important;'>鉴定不通过</a>"+ 296 "<a role='reject' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important;'>鉴定不通过</a>"+
297 - "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>"+  
298 "<a role='record' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>录制视频</a>"; 297 "<a role='record' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>录制视频</a>";
  298 + if (rowData.containMp4Flag) {
  299 + operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>";
  300 + }
  301 + return operateButton;
299 } else if (rowData.status == 17) { 302 } else if (rowData.status == 17) {
300 if(rowData.platformWaybillCode){ 303 if(rowData.platformWaybillCode){
301 return "<a role='send_back_rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>" 304 return "<a role='send_back_rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"
@@ -482,13 +485,21 @@ function getAlreadyJudgedList(){ @@ -482,13 +485,21 @@ function getAlreadyJudgedList(){
482 width: 40, 485 width: 40,
483 align: "center", 486 align: "center",
484 formatter: function (value, rowData, rowIndex) { 487 formatter: function (value, rowData, rowIndex) {
  488 + var operateButton = '';
485 if (rowData.status == 4) {//鉴定通过 489 if (rowData.status == 4) {//鉴定通过
486 - return "<a role='buyerReceiveInfo' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>买家收货地址</a>" + 490 + operateButton += "<a role='buyerReceiveInfo' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>买家收货地址</a>" +
487 "<a role='viewExpress' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>"; 491 "<a role='viewExpress' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>";
  492 + if (rowData.containMp4Flag) {
  493 + operateButton += "<a role='queryForSuccess' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>";
  494 + }
488 } else if (rowData.status == 13) {//鉴定不通过 495 } else if (rowData.status == 13) {//鉴定不通过
489 - return "<a role='rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"+ 496 + operateButton += "<a role='rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"+
490 "<a role='viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>"; 497 "<a role='viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>";
  498 + if (rowData.containMp4Flag) {
  499 + operateButton += "<a role='queryForSuccess' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>";
  500 + }
491 } 501 }
  502 + return operateButton;
492 } 503 }
493 }]], 504 }]],
494 cache: false, 505 cache: false,
@@ -522,6 +533,16 @@ function getAlreadyJudgedList(){ @@ -522,6 +533,16 @@ function getAlreadyJudgedList(){
522 viewExpressPage(buyerOrderCode); 533 viewExpressPage(buyerOrderCode);
523 } 534 }
524 }); 535 });
  536 +
  537 + // 查看视频
  538 + $(this).datagrid("getPanel").find("a[role='queryForSuccess']").linkbutton({
  539 + onClick: function () {
  540 + var skup = $(this).attr("skup");
  541 + var order_code = $(this).attr("order_code");
  542 + $("#skup").val(skup);
  543 + addQueryPage(skup, order_code, $(this).attr("dataId"));
  544 + }
  545 + });
525 } 546 }
526 }); 547 });
527 } 548 }
@@ -376,25 +376,25 @@ @@ -376,25 +376,25 @@
376 message = "确认要关闭销售类目吗?"; 376 message = "确认要关闭销售类目吗?";
377 msg = "关闭销售类目成功!"; 377 msg = "关闭销售类目成功!";
378 } 378 }
379 - window.top.$.messager.confirm("确认", message, function (flag) { 379 + $.messager.confirm("确认", message, function (flag) {
380 if (flag) { 380 if (flag) {
381 - window.top.$.messager.progress({ 381 + $.messager.progress({
382 title: "正在执行", 382 title: "正在执行",
383 msg: "正在执行,请稍后...", 383 msg: "正在执行,请稍后...",
384 interval: 500, 384 interval: 500,
385 text: "" 385 text: ""
386 }); 386 });
387 $.post(contextPath + "/saleCategory/updateStatus",{"id":id, "status":status, "parentId": parentId}, function (data) { 387 $.post(contextPath + "/saleCategory/updateStatus",{"id":id, "status":status, "parentId": parentId}, function (data) {
388 - window.top.$.messager.progress("close"); 388 + $.messager.progress("close");
389 if (data.code == 200) { 389 if (data.code == 200) {
390 $("#saleCategoryTable").treegrid("reload"); 390 $("#saleCategoryTable").treegrid("reload");
391 - window.top.$.messager.show({ 391 + $.messager.show({
392 title: "提示", 392 title: "提示",
393 msg: msg, 393 msg: msg,
394 height: 120 394 height: 120
395 }); 395 });
396 } else { 396 } else {
397 - window.top.$.messager.alert("失败", data.message, "error"); 397 + $.messager.alert("失败", data.message, "error");
398 } 398 }
399 }, "json"); 399 }, "json");
400 } 400 }