Authored by qinchao

Merge branch 'dev_fix_returnback' into test6.8.2

... ... @@ -125,6 +125,8 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
private static final Integer EXPRESS_TYPE_JUDGE_TO_BUYER = 2;
private static final Integer EXPRESS_TYPE_JUDGE_TO_SELLER = 3;
private static final Integer EXPRESS_TYPE_RETURN_BACK_TO_SELLER = 4;
private static final Integer OPERATE_TYPE_UPDATE_SELLERWAYBILLCODE = 1;//修改卖家物流单号
... ... @@ -207,7 +209,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
List<Integer> sellerExpressCompanyIdList = expressRecordList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
//查询平台快递单号
List<ExpressRecord> platformExpressList = expressRecordMapper.selectByOrderCodeListAndType(buyerOrderCodeList, Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER));
List<ExpressRecord> platformExpressList = expressRecordMapper.selectByOrderCodeListAndType(buyerOrderCodeList, Lists.newArrayList(EXPRESS_TYPE_JUDGE_TO_BUYER, EXPRESS_TYPE_JUDGE_TO_SELLER,EXPRESS_TYPE_RETURN_BACK_TO_SELLER));
Map<String, ExpressRecord> platformExpressRecordMap = platformExpressList.stream().collect(Collectors.toMap(ExpressRecord::getOrderCode, e->e));
List<Integer> platformExpressCompanyIdList = platformExpressList.stream().map(ExpressRecord::getLogisticsType).collect(Collectors.toList());
... ... @@ -278,6 +280,13 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
throw new ServiceException(400,"错误:订单状态不合法,不允许寄回商品");
}
//查看是否存在寄回的物流信息,如果存在,则不允许再次寄回
ExpressRecord sellerExpressRecord = expressRecordMapper.selectByOrderCodeAndType(buyerOrder.getOrderCode(),
buyerOrder.getSellerUid(), EXPRESS_TYPE_RETURN_BACK_TO_SELLER);
if(null != sellerExpressRecord) {
throw new ServiceException(400,"错误:订单已存在寄回物流单["+sellerExpressRecord.getWaybillCode()+"]不允许再次寄回");
}
//调用前台接口
String args = "orderAppraise.returnBack";
JSONObject jsonObject = asyncCallAppraise(args, buyerOrder.getOrderCode(), req);
... ... @@ -343,7 +352,19 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
if(StringUtils.isEmpty(req.getOrderCode())) {
return result;
}
ExpressRecord record = expressRecordMapper.selectByOrderCodeAndType(req.getOrderCode(), null, EXPRESS_TYPE_JUDGE_TO_SELLER);
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(req.getOrderCode());
if(buyerOrder==null){
return result;
}
Integer expressType=EXPRESS_TYPE_JUDGE_TO_SELLER;
//已取消的订单,状态不会再变了
if(buyerOrder.getStatus().byteValue()==Constant.BUYER_ORDER_STATUS_BUYER_CANCEL_AFTER_SELLER_DELIVERY.getByteVal()){
expressType =EXPRESS_TYPE_RETURN_BACK_TO_SELLER;
}
ExpressRecord record = expressRecordMapper.selectByOrderCodeAndType(req.getOrderCode(), null, expressType);
if(null == record) {
return result;
}
... ...
... ... @@ -279,7 +279,14 @@ function getToBeJudgedList(){
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>";
} else if (rowData.status == 17) {
return "<a role='reback' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>寄回</a>";
if(rowData.platformWaybillCode){
return "<a role='send_back_rebackAddress' dataId='"+ rowData.orderCode +"' skup='"+ rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>商品寄回地址</a>"
+"<a role='send_back_viewExpress' dataId='"+ rowData.orderCode + "' style='margin-left:10px;background-color: #5cb85c !important;'>查看物流</a>"
//+"<br/><span style='color:darkred;'>已寄回 ["+rowData.platformWaybillCode+"]</span>";
;
}else{
return "<a role='reback' dataId='"+ rowData.id + "'" + " skup='"+rowData.skup +"' style='margin-left:10px;background-color: #5cb85c !important;'>寄回</a>";
}
}
}
}]],
... ... @@ -335,6 +342,25 @@ function getToBeJudgedList(){
addRebackPage($(this).attr("dataId"));
}
});
$(this).datagrid("getPanel").find("a[role='send_back_rebackAddress']").linkbutton({
onClick: function () {
var buyerOrderCode = $(this).attr("dataId");
$("#buyerOrderCode").val(buyerOrderCode);
var skup = $(this).attr("skup");
$("#skup").val(skup);
rebackAddressPage();
}
});
$(this).datagrid("getPanel").find("a[role='send_back_viewExpress']").linkbutton({
onClick: function () {
var buyerOrderCode = $(this).attr("dataId");
$("#buyerOrderCode").val(buyerOrderCode);
viewExpressPage(buyerOrderCode);
}
});
}
});
... ...
... ... @@ -21,7 +21,7 @@
function getExpressInfo(){
var form = new FormData();
form.append("orderCode", document.getElementById("buyerOrderCode").value);
form.append("expressTypeStr", "2,3");
form.append("expressTypeStr", "2,3,4");
//发送请求
$.ajax({
type: "POST",
... ...