Authored by caoyan

质检优化

package com.yoho.ufo.order.constant;
public enum OrderAbnormalTypeEnum {
ABNORMAL_TYPE_BUYER_CANCEL((byte)1, "买家取消"),
ABNORMAL_TYPE_CS_CANCLE((byte)2, "客服取消"),
ABNORMAL_TYPE_SELLER_LESS_DELIVERY((byte)3, "卖家少发货"),
ABNORAML_TYPE_SELLER_ERROR_DELIVERY((byte)4, "卖家发错货"),
;
private byte byteVal;
private String abnormalTypeStr;
public byte getByteVal() {
return byteVal;
}
public String getAbnormalTypeStr() {
return abnormalTypeStr;
}
OrderAbnormalTypeEnum(byte byteVal, String abnormalTypeStr) {
this.byteVal = byteVal;
this.abnormalTypeStr = abnormalTypeStr;
}
public static String convertAbnormalTypeStr(Byte abnormalType) {
if(abnormalType == null){
return "";
}
for(OrderAbnormalTypeEnum orderAbnormalType : OrderAbnormalTypeEnum.values()){
if(orderAbnormalType.getByteVal()==abnormalType.byteValue()){
return orderAbnormalType.getAbnormalTypeStr();
}
}
return "";
}
}
... ...
... ... @@ -2,6 +2,7 @@ package com.yoho.ufo.order.controller;
import static java.util.stream.Collectors.toList;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
... ... @@ -15,10 +16,13 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.yoho.order.model.BuyerOrderReq;
import com.yoho.order.model.ExpressCompany;
import com.yoho.order.model.QualityCheckResp;
import com.yoho.order.model.SignForPackageRsp;
import com.yoho.ufo.model.brand.Brand;
import com.yoho.ufo.order.constant.OrderAbnormalTypeEnum;
import com.yoho.ufo.order.service.IBuyerOrderService;
import com.yoho.ufo.service.model.ApiResponse;
import com.yoho.ufo.service.model.PageResponseBO;
... ... @@ -683,4 +687,18 @@ public class BuyerOrderController {
int result = buyerOrderService.updateAbnormalOrder(req);
return new ApiResponse.ApiResponseBuilder().code(200).message("操作成功").data(result).build();
}
@RequestMapping(value = "/queryOrderAbnormalType")
public ApiResponse queryOrderAbnormalType() {
LOGGER.info("queryOrderAbnormalType in");
List<JSONObject> result = new ArrayList<>();
for(OrderAbnormalTypeEnum orderAbnormalType : OrderAbnormalTypeEnum.values()){
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", orderAbnormalType.getByteVal());
jsonObject.put("text", orderAbnormalType.getAbnormalTypeStr());
result.add(jsonObject);
}
return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
}
}
... ...
... ... @@ -116,6 +116,7 @@ import com.yoho.ufo.exception.CommonException;
import com.yoho.ufo.model.brand.Brand;
import com.yoho.ufo.model.commoditybasicrole.category.ProductSort;
import com.yoho.ufo.order.constant.Constant;
import com.yoho.ufo.order.constant.OrderAbnormalTypeEnum;
import com.yoho.ufo.order.constant.OrderConfigConstant;
import com.yoho.ufo.order.request.OrderOperateTask;
import com.yoho.ufo.order.request.SaveQualityCheckInfoRequest;
... ... @@ -3998,18 +3999,9 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService, ApplicationCon
return;
}
resp.setAbnormalTypeStr(convertAbnormalType(order.getType()));
resp.setAbnormalTypeStr(OrderAbnormalTypeEnum.convertAbnormalTypeStr(order.getType().byteValue()));
}
private String convertAbnormalType(Integer type) {
switch(type) {
case 1: return "卖家多发货";
case 2: return "卖家少发货";
case 3: return "卖家发错货";
default: return "";
}
}
/**
* 根据订单号查询具体的物流公司
* @return
... ...