Authored by mali

Merge branch 'dev'

package com.yohoufo.order.common;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
* Created by chenchao on 2018/9/18.
*/
public enum SellerOrderListType {
in_sale(1, "出售中",
Arrays.asList(OrderStatus.WAITING_PAY.getCode()),
Collections.<Integer>emptyList()),
WAITING_PAY(2, "待付款",
Collections.<Integer>emptyList(),Collections.<Integer>emptyList()),
WAITING_SEND(3, "待发货",
Arrays.asList(OrderStatus.SELLER_SEND_OUT.getCode(),
OrderStatus.HAS_PAYED.getCode(),
OrderStatus.PLATFORM_CHECKING.getCode()),
Collections.<Integer>emptyList()),
WAITING_DELIVERY(4, "待收货",
Arrays.asList(OrderStatus.WAITING_RECEIVE.getCode()),
Collections.<Integer>emptyList()),
ORDER_SUCCESS(5, "交易成功",
Arrays.asList(OrderStatus.DONE.getCode()),
Collections.<Integer>emptyList()),
ORDER_FAILED(6, "交易失败", Arrays.asList(OrderStatus.SELLER_CANCEL_BEFORE_PAY.getCode(),
OrderStatus.SELLER_CANCEL_AFTER_PAY.getCode(),
OrderStatus.SEND_OUT_TIMEOUT.getCode(),
OrderStatus.CHECKING_FAKE.getCode(),
OrderStatus.BUYER_CANCEL_BEFORE_PAY.getCode(),
OrderStatus.BUYER_CANCEL_TIMEOUT.getCode(),
OrderStatus.CUSTOMER_SERVICE.getCode()),
Collections.<Integer>emptyList());
int type;
String desc;
List<Integer> sellerStatus;
List<Integer> buyerStatus;
SellerOrderListType(int type, String desc, List<Integer> buyerStatus, List<Integer> sellerStatus) {
this.type = type;
this.desc = desc;
this.buyerStatus = buyerStatus;
this.sellerStatus = sellerStatus;
}
/**
* 检查是否存在该中查询类型
* @param code
* @return
*/
public static SellerOrderListType getOrderListType(int code){
for(SellerOrderListType v : values()){
if(v.type == code){
return v;
}
}
return null;
}
public int getType() {
return type;
}
public List<Integer> getBuyerStatus() {
return buyerStatus;
}
}
... ...
... ... @@ -74,17 +74,17 @@ public class SellerOrderController {
return new ApiResponse.ApiResponseBuilder().data(orderCode).code(200).message("发布成功").build();
}
@RequestMapping(params = "method=ufo.sellerOrder.publishPrd")
@RequestMapping(params = "method=ufo.sellerOrder.getOrderList")
@ResponseBody
public ApiResponse getOrderList(@RequestParam(name = "uid", required = true)int uid,
@RequestParam(name = "status", required = true)int status,
@RequestParam(name = "type", required = true)int type,
@RequestParam(name = "page", required = true)int page,
@RequestParam(name = "limit", required = true)int limit) throws GatewayException {
SellerOrderListReq req = SellerOrderListReq.builder()
.uid(uid).status(status)
.uid(uid).type(type)
.page(page).limit(limit)
.build();
logger.info("in ufo.sellerOrder.publishPrd, req {}", req);
logger.info("in ufo.sellerOrder.getOrderList, req {}", req);
OrderInfoListRsp resp = sellerOrderService.getOrderList(req);
return new ApiResponse.ApiResponseBuilder().data(resp).code(200).message("查询列表成功").build();
}
... ...