Authored by LUOXC

添加卖家无法发货

... ... @@ -415,14 +415,14 @@ public class BuyerOrderController {
* @return
*/
@RequestMapping(value = "/cancelBuyerOrder")
public ApiResponse cancelBuyerOrder(String orderCode) {
buyerOrderService.cancelBuyerOrder(orderCode, false);
public ApiResponse cancelBuyerOrder(String orderCode,@RequestParam(value = "cancelType",required = false) Integer cancelType) {
buyerOrderService.cancelBuyerOrder(orderCode, cancelType);
return new ApiResponse.ApiResponseBuilder().code(200).build();
}
@RequestMapping(value = "/cancelBuyerOrderClickFarm")
public ApiResponse cancelBuyerOrderClickFarm(String orderCode) {
buyerOrderService.cancelBuyerOrder(orderCode, true);
buyerOrderService.cancelBuyerOrder(orderCode, 1);
return new ApiResponse.ApiResponseBuilder().code(200).build();
}
... ...
... ... @@ -29,7 +29,7 @@ public interface IBuyerOrderService {
* 客服取消订单
* @param orderCode
*/
void cancelBuyerOrder(String orderCode, boolean isClickFarm);
void cancelBuyerOrder(String orderCode, Integer cancelType);
/**
* 商品无法鉴定
... ...
... ... @@ -1539,26 +1539,36 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
}
@Override
public void cancelBuyerOrder(String orderCode, boolean isClickFarm) {
public void cancelBuyerOrder(String orderCode, Integer cancelType) {
BuyerOrder buyerOrder = buyerOrderMapper.selectByOrderCode(orderCode);
if (null == buyerOrder) {
throw new ServiceException(400, "订单不存在");
}
if(isClickFarm) {
OperateTypeEnum operateType;
// 买家刷单
if (Objects.equals(Integer.valueOf(1), cancelType)) {
operateType = OperateTypeEnum.CS_CANCEL_CLICK_FARM;
if (Constant.BUYER_ORDER_STATUS_BUYER_PAYED.getByteVal() != buyerOrder.getStatus().byteValue()
&& Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal() != buyerOrder.getStatus().byteValue()
&& Constant.BUYER_ORDER_STATUS_PLATFORM_RECEIVE.getByteVal() != buyerOrder.getStatus().byteValue()
&& Constant.BUYER_ORDER_STATUS_MINI_FAULT_WAITING.getByteVal() != buyerOrder.getStatus().byteValue()) {
throw new ServiceException(400, "错误:订单状态变化,不允许取消订单,请重新刷新列表");
}
}
// 卖家无法发货
else if (Objects.equals(Integer.valueOf(2), cancelType)) {
operateType = OperateTypeEnum.CS_CANCEL_SELLER_CAN_NOT_SEND_OUT;
if (Constant.BUYER_ORDER_STATUS_BUYER_PAYED.getByteVal() != buyerOrder.getStatus().byteValue()) {
throw new ServiceException(400, "错误:订单状态变化,不允许取消订单,请重新刷新列表");
}
} else {
operateType = OperateTypeEnum.CS_CANCEL_BEFORE_DEPOT_RECEIVE;
if (Constant.BUYER_ORDER_STATUS_ALLOCATING.getByteVal() != buyerOrder.getStatus().byteValue()) {
throw new ServiceException(400, "错误:订单状态变化,不允许取消订单,请重新刷新列表");
}
}
int operateType = isClickFarm ? OperateTypeEnum.CS_CANCEL_CLICK_FARM.getCode() : OperateTypeEnum.CS_CANCEL_BEFORE_DEPOT_RECEIVE.getCode();
UserHelper userHelper = new UserHelper();
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType, "");
saveOrderOperateRecord(buyerOrder.getOrderCode(), userHelper, operateType.getCode(), "");
LOGGER.info("cancelBuyerOrder saveOrderOperateRecord operateType={} ,order code ={} ,userHelper = {}", operateType, buyerOrder.getOrderCode(), userHelper);
String args = "ufo-gateway.cancelBuyerOrderByCS";
... ... @@ -1566,9 +1576,7 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
BuyerOrderCancelReq request = new BuyerOrderCancelReq();
request.setUid(buyerOrder.getUid());
request.setOrderCode(Long.valueOf(orderCode));
if(isClickFarm) {
request.setCancelType(1);
}
request.setCancelType(cancelType);
JSONObject result = serviceCaller.asyncCall(args, request, JSONObject.class).get(5);
LOGGER.info("call ufo-gateway orderCode is {}, interface is {},result is {}", orderCode, args, result);
}
... ...
... ... @@ -7,7 +7,7 @@
<style>
.selected{background: #5bc0de; color:#fff; }
</style>
<style type="text/css">
.nav li {float:left; list-style:none;}
.nav li a{float:left;text-decoration:none;padding:0.2em 1.6em;border-right:1px solid white;color:black; font-size:14px;}
... ... @@ -51,7 +51,7 @@
<label>卖家快递单号:</label>
<input id="sellerWaybillCode" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单状态:</label>
<select id="status" class="easyui-combobox" style="width:250px;" >
<option value="">全部</option>
... ... @@ -86,16 +86,16 @@
</select>
<br><br>
<label>商品编码:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</label>
<input id="productId" type="text" class="easyui-textbox" style="width:150px"/>
<label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SKU:</label>
<input id="sku" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SKU-P:</label>
<input id="skup" type="text" class="easyui-textbox" style="width:150px"/>
<label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;订单渠道:</label>
<select id="channel" class="easyui-combobox" style="width:250px;">
<option value="">全部</option>
... ... @@ -103,9 +103,9 @@
<option value="2">门店自提</option>
<option value="3">闲鱼</option>
</select>
<br><br>
<label>买家手机号:&nbsp;&nbsp;&nbsp;</label>
<input id="buyerMobile" type="text" class="easyui-textbox" style="width:150px"/>
... ... @@ -151,7 +151,7 @@
<input id="buyerEndTime" type="text">
<a id="searchBtn" class="btn-info">查询</a>
<a id="allBtn" class="btn-success">全部</a>
</div>
</div>
</div>
</div>
</div>
... ... @@ -190,7 +190,7 @@ $(function() {
//tab状态对应的数量
getCountByNavStatus();
$("#searchBtn").linkbutton({
iconCls : "icon-search",
onClick : function() {
... ... @@ -216,7 +216,7 @@ $(function() {
});
}
});
//全部按钮
$("#allBtn").linkbutton({
iconCls: "icon-import",
... ... @@ -237,7 +237,7 @@ $(function() {
});
}
});
getOrderList();
});
... ... @@ -382,6 +382,9 @@ function getOrderList(){
if(rowData.attributes == 1 && rowData.region== 0 && (rowData.status == 1 || rowData.status == 2 ||rowData.status == 31 ||rowData.status == 32)){
buttons += "<a role='cancelBuyerOrderClickFarm' dataId='"+ rowData.orderCode +"' style='margin-left:10px;color:white;background-color:#fadb14 !important;'>取消刷单</a>";
}
if(rowData.status == 1){
buttons += "<a role='cancelOrder' dataId='"+ rowData.orderCode +"' cancelType='2' style='margin-left:10px;color:white;background-color: #D31225 !important;'>卖家无法发货</a>";
}
return buttons;
}
}]],
... ... @@ -452,11 +455,16 @@ function getOrderList(){
me.datagrid("getPanel").find("a[role='cancelOrder']").linkbutton({
onClick: function () {
var orderCode = $(this).attr("dataId");
var cancelType = $(this).attr("cancelType");
var request = {
orderCode : orderCode
};
if(cancelType){
request.cancelType = cancelType;
}
$.messager.confirm('取消订单确认','确认取消该订单?',function(r){
if (r){
$.post(contextPath + "/buyerOrder/cancelBuyerOrder", {
orderCode : orderCode
}, function(data) {
$.post(contextPath + "/buyerOrder/cancelBuyerOrder", request, function(data) {
if (data.code == 200) {
window.self.$.messager.show({
title : "提示",
... ... @@ -556,7 +564,7 @@ function getCountByNavStatus(){
$.messager.alert("失败", result.message, "error");
}
}
});
});
}
$("#settleFailBtn").linkbutton({
... ...