Authored by TANLING

寄回地址设置

... ... @@ -29,7 +29,9 @@ import com.yohoufo.order.service.handler.SellerDecrPriceTaskHandler;
import com.yohoufo.order.service.handler.SellerDownShelfTaskHandler;
import com.yohoufo.order.service.handler.SellerIncrPriceTaskHandler;
import com.yohoufo.order.service.handler.SellerOrderSubmitHandler;
import com.yohoufo.order.service.proxy.FastDeliveryProxyService;
import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.seller.ImportPublishExcutor;
import com.yohoufo.order.service.seller.SellerAuthCheckService;
import com.yohoufo.order.service.seller.processor.AdjustPricePrepareProcessor;
... ... @@ -39,6 +41,7 @@ import com.yohoufo.order.service.seller.processor.SellerTaskProcessor;
import com.yohoufo.order.service.seller.setting.SellerFuncService;
import com.yohoufo.order.service.seller.setting.SellerService;
import com.yohoufo.order.service.seller.setting.SellerWrapper;
import com.yohoufo.order.utils.AddressHelper;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
... ... @@ -100,8 +103,6 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
@Autowired
private BuyerOrderGoodsMapper buyerOrderGoodsMapper;
@Autowired
private OrdersPayTransferMapper ordersPayTransferMapper;
@Autowired
SellerOrderGoodsMapper sellerOrderGoodsMapper;
... ... @@ -112,9 +113,9 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
@Autowired
private TradeBillsMapper tradeBillsMapper;
private static final String ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerburger仓储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"阿津\",\"isUpdate\":\"N\",\"mobile\":\"18121153590\",\"phone\":\"\",\"zipCode\":\"\"}";
// private static final String ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerburger仓储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"阿津\",\"isUpdate\":\"N\",\"mobile\":\"18121153590\",\"phone\":\"\",\"zipCode\":\"\"}";
private static final String HIDDEN_ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerbur****储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"*津\",\"isUpdate\":\"N\",\"mobile\":\"181****3590\",\"phone\":\"\",\"zipCode\":\"\"}";
// private static final String HIDDEN_ADDRESS_STR = "{\"address\":\"松金公路2758号sneakerbur****储中心\",\"address_id\":17560803,\"area\":\"上海 金山区 张堰镇\",\"areaCode\":\"310116103\",\"consignee\":\"*津\",\"isUpdate\":\"N\",\"mobile\":\"181****3590\",\"phone\":\"\",\"zipCode\":\"\"}";
/**
* 货款收入
... ... @@ -498,6 +499,12 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
}
@Autowired
FastDeliveryProxyService fastDeliveryProxyService;
@Autowired
private UserProxyService userProxyService;
@Override
public List<FastDeliveryBatchOnShelfResp> batchOnShelf(FastDeliveryBatchOnShelfReq req) {
... ... @@ -518,9 +525,17 @@ public class ErpFastDeliveryServiceImpl implements IErpFastDeliveryService {
// 上架
List<ProductImportTranItemBo> responseList = Lists.newArrayList();
FastDeliverySellerAccessInfo sellerAccessInfo = fastDeliveryProxyService.getConfigBySellerUid(req.getUid());
if (sellerAccessInfo == null || sellerAccessInfo.getSendBackAddressId() == null){
throw new UfoServiceException(400,"请检查寄回地址配置!");
}
AddressInfo noHiddenBackAddress = JSONObject.parseObject(ADDRESS_STR, AddressInfo.class);
AddressInfo hiddenBackAddress = JSONObject.parseObject(HIDDEN_ADDRESS_STR, AddressInfo.class);
// 获取其寄回地址
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(req.getUid(), sellerAccessInfo.getSendBackAddressId());
if(AddressHelper.isNeedUpdate(noHiddenBackAddress)){
throw new UfoServiceException(400,"您的收货地址缺少所在地的街道信息,请更新收货地址");
}
AddressInfo hiddenBackAddress = UserProxyService.getHiddenAddressFromNotHidden(noHiddenBackAddress);
// 上架的代码(和之前同)
List<FastDeliveryBatchOnShelfResp> shelfResps = Lists.newArrayList();
... ...