Authored by caoyan

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

... ... @@ -31,7 +31,7 @@
where order_code in
<foreach collection="orderCodes" open="(" close=")" separator="," item="orderCode">
#{orderCode,jdbcType=BIGINT}
</foreach>
</foreach> and show_flag = 1
</select>
<insert id="insert" parameterType="com.yoho.order.model.QiniuLiveRecord" useGeneratedKeys="true" keyProperty="id">
... ...
package com.yoho.ufo.order.service.impl;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import com.yoho.order.dal.*;
import com.yoho.order.model.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.common.collect.Lists;
... ... @@ -23,32 +22,6 @@ import com.alibaba.fastjson.JSONObject;
import com.yoho.core.common.utils.DateUtil;
import com.yoho.core.rest.client.ServiceCaller;
import com.yoho.error.exception.ServiceException;
import com.yoho.order.dal.AppraiseAddressMapper;
import com.yoho.order.dal.AreaMapper;
import com.yoho.order.dal.BuyerOrderGoodsMapper;
import com.yoho.order.dal.BuyerOrderMapper;
import com.yoho.order.dal.BuyerOrderMetaMapper;
import com.yoho.order.dal.ExpressCompanyMapper;
import com.yoho.order.dal.ExpressInfoMapper;
import com.yoho.order.dal.ExpressRecordMapper;
import com.yoho.order.dal.OrderOperateRecordMapper;
import com.yoho.order.dal.OrdersPayMapper;
import com.yoho.order.dal.SellerOrderGoodsMapper;
import com.yoho.order.dal.SellerOrderMapper;
import com.yoho.order.dal.SellerOrderMetaMapper;
import com.yoho.order.model.Area;
import com.yoho.order.model.BuyerOrder;
import com.yoho.order.model.BuyerOrderGoods;
import com.yoho.order.model.BuyerOrderMeta;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.ExpressCompany;
import com.yoho.order.model.ExpressInfo;
import com.yoho.order.model.ExpressRecord;
import com.yoho.order.model.OrderOperateRecord;
import com.yoho.order.model.OrdersPay;
import com.yoho.order.model.SellerOrder;
import com.yoho.order.model.SellerOrderGoods;
import com.yoho.order.model.SellerOrderMeta;
import com.yoho.service.model.order.request.OrderRequest;
import com.yoho.ufo.dal.ProductMapper;
import com.yoho.ufo.dal.model.Product;
... ... @@ -118,6 +91,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
@Autowired
private ServiceCaller serviceCaller;
@Autowired
private QiniuLiveRecordMapper qiniuLiveRecordMapper;
private static final String BUYER_ORDER_META_KEY_DELIVERY_ADDRESS = "delivery_address";
... ... @@ -238,7 +214,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
companyMap = companyList.stream().collect(Collectors.toMap(ExpressCompany::getId, ExpressCompany::getCompanyName));
}
List<BuyerOrderResp> respList = convertToResp(orderList, buyerGoodsMap, sellerOrderMap, sellerGoodsMap,expressRecordMap, platformExpressRecordMap, companyMap,skupProductCodeMap);
completeMp4VedioUrl(respList); // 查询是否有视频连接
PageResponseBO<BuyerOrderResp> result=new PageResponseBO<>();
result.setList(respList);
result.setPage(req.getPage());
... ... @@ -247,8 +225,24 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return result;
}
public PageResponseBO<BuyerOrderResp> queryByOrderCodeOrWaybillCode(String queryStr) {
private void completeMp4VedioUrl(List<BuyerOrderResp> respList) {
if (CollectionUtils.isEmpty(respList)) {
return;
}
List<Long> orderCodeList = new ArrayList<>();
respList.stream().forEach(item ->
orderCodeList.add(Long.valueOf(item.getOrderCode()))
);
List<QiniuLiveRecord> qiniuLiveRecords = qiniuLiveRecordMapper.selectByOrderCodes(orderCodeList);
Set<String> containOrderCodeSet = new HashSet<>();
qiniuLiveRecords.stream().forEach(item -> containOrderCodeSet.add(String.valueOf(item.getOrderCode())));
respList.forEach(item -> item.setContainMp4Flag(containOrderCodeSet.contains(item.getOrderCode())));
}
public PageResponseBO<BuyerOrderResp> queryByOrderCodeOrWaybillCode(String queryStr) {
if(StringUtils.isEmpty(queryStr)) {
return null;
}
... ...
... ... @@ -5,6 +5,7 @@ import com.yoho.core.dal.datasource.annotation.Database;
import com.yoho.order.dal.QiniuLiveRecordMapper;
import com.yoho.order.model.QiniuLiveRecord;
import com.yoho.ufo.exception.PlatformException;
import com.yoho.ufo.order.service.event.QiniuLiveRecordEvent;
import com.yoho.ufo.service.impl.QNliveUtil;
import com.yoho.ufo.service.impl.UserHelper;
import com.yoho.ufo.util.DateUtil;
... ... @@ -77,7 +78,7 @@ public class UfoLiveService implements ApplicationContextAware {
record.setNotInId(record.getId());
context.publishEvent(record); // 异步补充记录的卖家订单号,商品信息 // 并将之前的skup相关的视频置为不可见
context.publishEvent(new QiniuLiveRecordEvent(record)); // 异步补充记录的卖家订单号,商品信息 // 并将之前的skup相关的视频置为不可见
}
public String queryMp4Vedio(QNliveReq req) throws PlatformException {
... ...
... ... @@ -292,10 +292,13 @@ function getToBeJudgedList(){
if (rowData.status == 2) {
return "<a role='confirm' dataId='"+ rowData.id +"' style='margin-left:10px;background-color: #5cb85c !important;'>确认收货</a>";
} else if (rowData.status == 3) {
return "<a role='pass' dataId='"+ rowData.id + "'" + " orderCode='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定通过</a>"+
"<a role='reject' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important;'>鉴定不通过</a>"+
"<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>"+
var operateButton = "<a role='pass' dataId='"+ rowData.id + "'" + " orderCode='"+rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>鉴定通过</a>"+
"<a role='reject' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #d9534f !important;'>鉴定不通过</a>"+
"<a role='record' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>录制视频</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='query' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>";
}
return operateButton;
} else if (rowData.status == 17) {
if(rowData.platformWaybillCode){
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(){
width: 40,
align: "center",
formatter: function (value, rowData, rowIndex) {
var operateButton = '';
if (rowData.status == 4) {//鉴定通过
return "<a role='buyerReceiveInfo' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>买家收货地址</a>" +
operateButton += "<a role='buyerReceiveInfo' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>买家收货地址</a>" +
"<a role='viewExpress' dataId='"+ rowData.orderCode +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='queryForSuccess' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>";
}
} else if (rowData.status == 13) {//鉴定不通过
return "<a role='rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"+
operateButton += "<a role='rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"+
"<a role='viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>";
if (rowData.containMp4Flag) {
operateButton += "<a role='queryForSuccess' dataId='"+ rowData.id + "' order_code='" + rowData.orderCode + "' skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>查看视频</a>";
}
}
return operateButton;
}
}]],
cache: false,
... ... @@ -522,6 +533,16 @@ function getAlreadyJudgedList(){
viewExpressPage(buyerOrderCode);
}
});
// 查看视频
$(this).datagrid("getPanel").find("a[role='queryForSuccess']").linkbutton({
onClick: function () {
var skup = $(this).attr("skup");
var order_code = $(this).attr("order_code");
$("#skup").val(skup);
addQueryPage(skup, order_code, $(this).attr("dataId"));
}
});
}
});
}
... ...
... ... @@ -376,25 +376,25 @@
message = "确认要关闭销售类目吗?";
msg = "关闭销售类目成功!";
}
window.top.$.messager.confirm("确认", message, function (flag) {
$.messager.confirm("确认", message, function (flag) {
if (flag) {
window.top.$.messager.progress({
$.messager.progress({
title: "正在执行",
msg: "正在执行,请稍后...",
interval: 500,
text: ""
});
$.post(contextPath + "/saleCategory/updateStatus",{"id":id, "status":status, "parentId": parentId}, function (data) {
window.top.$.messager.progress("close");
$.messager.progress("close");
if (data.code == 200) {
$("#saleCategoryTable").treegrid("reload");
window.top.$.messager.show({
$.messager.show({
title: "提示",
msg: msg,
height: 120
});
} else {
window.top.$.messager.alert("失败", data.message, "error");
$.messager.alert("失败", data.message, "error");
}
}, "json");
}
... ...