Authored by chenchao

support query shipfee by user address

... ... @@ -4,6 +4,8 @@ import com.alibaba.fastjson.annotation.JSONField;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
/**
* Created by li.ma on 2018/9/27.
*/
... ... @@ -21,6 +23,9 @@ public class AppraiseAddressResp {
@JSONField(name="id")
private Integer type;
@Getter@Setter
private BigDecimal shipFee;
/**
* 是否变更
*/
... ...
... ... @@ -81,19 +81,11 @@ public interface IExpressInfoService {
AppraiseAddressResp noticeAppraiseAddressChanged(Integer uid, Long orderCode);
/**
* 根据订单号获取快递类型
* 1:卖家到鉴定中心
* 2:鉴定中心到买家
* 3:鉴定中心退回到卖家
*
* @param orderCode
* @return
*/
//Integer getExpressType(Long orderCode);
AppraiseAddressResp queryByUserAddress(int uid,String addressId);
//ExpressInfoRespBo queryLastExpressDetailInfo(Long orderCode,int type);
ExpressInfoDetail getLastExpressInfoDetail(TabType actor,int status, Long orderCode);
... ...
... ... @@ -20,6 +20,7 @@ import com.yohoufo.common.alarm.EventBusPublisher;
import com.yohoufo.common.caller.UfoServiceCaller;
import com.yohoufo.common.constant.ExpressInfoConstant;
import com.yohoufo.common.exception.UfoServiceException;
import com.yohoufo.common.utils.AddressUtil;
import com.yohoufo.common.utils.DateUtil;
import com.yohoufo.common.utils.UserInfoHiddenHelper;
import com.yohoufo.dal.order.*;
... ... @@ -37,6 +38,7 @@ import com.yohoufo.order.service.cache.CacheKeyBuilder;
import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.OrderStatusFlowService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.seller.setting.SellerService;
import com.yohoufo.order.service.seller.setting.SellerWrapper;
import org.apache.commons.collections.CollectionUtils;
... ... @@ -111,6 +113,9 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
@Autowired
private IBuyerOrderMetaService buyerOrderMetaService;
@Autowired
private UserProxyService userProxyService;
private static String EXPRESS_MQ_SEND = "third.logistics.logistics_data";
//物流文案设置
... ... @@ -1120,5 +1125,33 @@ public class ExpressInfoServiceImpl implements IExpressInfoService {
return resp;
}
@Override
public AppraiseAddressResp queryByUserAddress(int uid, String addressIdStr) {
int addressId = AddressUtil.getDecryptStr(addressIdStr);
if (addressId < 0){
LOGGER.warn("queryByUserAddess addressId invalidate, uid {}, addressId is {}",
uid, addressIdStr);
throw new ServiceException(ServiceError.ORDER_ADDRESSID_INVALIDATE);
}
//query the address
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
// 根据用户id查询默认地址的省份
AppraiseAddressResp resp = null;
if (null != hiddenBackAddress ) {
// 根据产品给的哪些用户的省份匹配到对应的鉴定中心地址
AppraiseAddress address = appraiseAddressService.queryAppraiseAddressByAreaCode(hiddenBackAddress.getAreaCode());
resp = new AppraiseAddressResp.builder().setAreaCode(address.getAreaCode()).build();
resp.setShipFee(address.getShipFee());
LOGGER.info("In queryByUserAddess hiddenBackAddress success, uid {} addressIdStr {}, AppraiseAddressResp",
uid, addressIdStr, resp);
}else {
LOGGER.warn("In queryByUserAddess hiddenBackAddress is null, uid {} addressIdStr {}", uid, addressIdStr);
}
return resp;
}
}
... ...