Authored by chenchao

fix appraise address

... ... @@ -16,7 +16,10 @@ import java.util.stream.Collectors;
import javax.annotation.Resource;
import com.yohobuy.ufo.model.order.common.*;
import com.yohoufo.order.service.listener.BuyerOrderChangeEvent;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.utils.NamedThreadFactory;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
... ... @@ -33,15 +36,6 @@ import com.yoho.error.ServiceError;
import com.yoho.error.exception.ServiceException;
import com.yohobuy.ufo.model.order.bo.AppraiseExpressInfoBo;
import com.yohobuy.ufo.model.order.bo.MerchantOrderAttachInfo;
import com.yohobuy.ufo.model.order.common.EnumExpressDataOperateTransferCode;
import com.yohobuy.ufo.model.order.common.EnumExpressDataType;
import com.yohobuy.ufo.model.order.common.EnumExpressType;
import com.yohobuy.ufo.model.order.common.EnumQualityCheckStatus;
import com.yohobuy.ufo.model.order.common.EnumQualityCheckType;
import com.yohobuy.ufo.model.order.common.OperateTypeEnum;
import com.yohobuy.ufo.model.order.common.OrderStatus;
import com.yohobuy.ufo.model.order.common.SellerOrderStatus;
import com.yohobuy.ufo.model.order.common.TabType;
import com.yohobuy.ufo.model.order.constants.StorageDepositStatusEnum;
import com.yohobuy.ufo.model.promotion.request.CouponSendMqBean;
import com.yohobuy.ufo.model.promotion.request.CouponSendType;
... ... @@ -211,6 +205,9 @@ public class AppraiseService {
@Autowired
private DepositService depositService;
@Autowired
private OrderCodeGenerator orderCodeGenerator;
/**
* 触发物流
*/
... ... @@ -855,9 +852,15 @@ public class AppraiseService {
*/
public ApiResponse appraiseFailAndDelivery(AppraiseExpressInfoBo appraiseExpressInfoBo) {
LOGGER.info("appraiseFail enter , appraiseExpressInfoBo {} ,appraiseNotPassFlag {}", appraiseExpressInfoBo);
Long orderCode = appraiseExpressInfoBo.getOrderCode();
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
OrderStatus expectStatus = OrderStatus.PLATFORM_CHECKING;
OrderStatus targetStatus = OrderStatus.CHECKING_FAKE;
Long orderCode = appraiseExpressInfoBo.getOrderCode();
Integer expressCompanyId = appraiseExpressInfoBo.getExpressCompanyId();
String wayBillCode = appraiseExpressInfoBo.getWayBillCode();
Integer depotNum = appraiseExpressInfoBo.getDepotNum();
... ...
... ... @@ -59,6 +59,7 @@ import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static com.yohoufo.order.utils.ServiceExceptions.throwServiceException;
import static com.yohoufo.order.utils.ServiceExceptions.throwServiceExceptionIf;
/**
... ... @@ -132,7 +133,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
private AppraiseOrderService appraiseOrderService;
@Autowired
OrderCodeGenerator orderCodeGenerator;
private OrderCodeGenerator orderCodeGenerator;
private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data";
... ... @@ -148,6 +149,7 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
@Autowired
private ServiceOrderProcessor serviceOrderProcessor;
private int processBuyerOrder(BuyerOrder buyerOrder,
Integer expressCompanyId,
Integer expressType,
... ... @@ -1090,6 +1092,31 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
@Override
public AppraiseAddressResp queryAppraiseAddress(Integer uid, Long orderCode, Integer skup) {
CodeMeta codeMeta = orderCodeGenerator.expId(orderCode);
OrderCodeType orderCodeType = OrderCodeType.getOrderCodeType(codeMeta.getType());
AppraiseAddressResp resp = null;
if (OrderCodeType.GOODS_SERVICE.equals(orderCodeType)){
AppraiseOrderService.ExistenceNode existenceNode = appraiseOrderService.isAppraiseOrder(orderCode);
if (!existenceNode.isExisted()){
throwServiceException(400,"订单不存在");
}
OrderAttributes oa = OrderAttributes.getOrderAttributes(existenceNode.getAppraiseOrder().getAttributes());
DepotType depotType = null;
switch (oa){
case APPRAISE:
depotType = DepotType.BJ;
break;
case DEPOSITE:
depotType = DepotType.NJ;
break;
default:
throwServiceException(400, "订单类型错误");
}
resp = appraiseAddressService.findByDepotType(depotType.getCode());
return resp;
}
if (isHKLargeSettlementSuper(uid)) {
return appraiseAddressService.queryHKAppraiseAddress();
}
... ... @@ -1116,7 +1143,6 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
LOGGER.info("in queryAppraiseAddress get Address {} orderCode {}, skup {}", buyerAddress, orderCode, skup);
// 根据用户id查询默认地址的省份
AppraiseAddressResp resp = null;
if (null != buyerAddress) {
// 根据产品给的哪些用户的省份匹配到对应的鉴定中心地址
resp = appraiseAddressService.queryAddressByAreaCode(buyerAddress.getAreaCode());
... ...