Authored by sailing-PC\sailing

fix

1  mask address
2 address update tips
3 menu order
... ... @@ -126,8 +126,8 @@ public enum OrderStatus {
SEND_OUT_TIMEOUT(12, "超时未发货取消", new Node[]{
new Node(
"交易失败",
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
OrderDetailDesc.SELL_TIMETOUT_CANCEL
),
buildFail4Seller(OrderDetailDesc.Seller.DELIVER_GOODS_TIMEOUT)
... ... @@ -137,8 +137,8 @@ public enum OrderStatus {
CHECKING_FAKE(13, "鉴定不通过取消", new Node[]{
new Node(
"交易失败",
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
OrderDetailDesc.CHECK_FAKE
),
buildFail4Seller(OrderDetailDesc.Seller.CHECK_FAIL)
... ... @@ -147,8 +147,8 @@ public enum OrderStatus {
BUYER_CANCEL_BEFORE_PAY(14, "支付前取消", new Node[]{
new Node(
"交易失败",
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
OrderDetailDesc.BUY_CANCEL
),
buildFail4Seller(OrderDetailDesc.Seller.BUYER_CANCEL)
... ... @@ -157,8 +157,8 @@ public enum OrderStatus {
BUYER_CANCEL_TIMEOUT(15, "超时未支付取消", new Node[]{
new Node(
"交易失败",
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.BUY_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.BUY_AGAIN.getBo()),
OrderDetailDesc.BUY_TIMEOUT_CANCEL
),
buildFail4Seller(OrderDetailDesc.Seller.BUYER_CANCEL_OF_TIMEOUT)
... ... @@ -181,7 +181,7 @@ public enum OrderStatus {
static Node buildFail4Seller(String detailDesc){
return new Node(
"交易失败",
Arrays.asList(ButtonShow.SHOW_DETAIL.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SHOW_DETAIL.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo()),
detailDesc
);
... ...
... ... @@ -41,7 +41,7 @@ public enum SkupStatus {
*/
SELF_CANCEL_PAY(20, "上架关闭",
new Node(
Arrays.asList(ButtonShow.SOLD_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
OrderDetailDesc.Seller.SELF_CANCEL_BEFORE_PAY
)
... ... @@ -51,7 +51,7 @@ public enum SkupStatus {
*/
TIMEOUT_CANCEL(21, "上架关闭",
new Node(
Arrays.asList(ButtonShow.SOLD_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
OrderDetailDesc.Seller.TIME_OUT_CANCEL
)
... ... @@ -61,7 +61,7 @@ public enum SkupStatus {
*/
SELLER_CANCEL_SELL(22, "上架关闭",
new Node(
Arrays.asList(ButtonShow.SOLD_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
OrderDetailDesc.Seller.SELF_CANCEL_BEFORE_EXIST_BUY,
OrderDetailDesc.PaymentTips.FINISH_RETURN_SELLER
... ... @@ -72,8 +72,8 @@ public enum SkupStatus {
*/
YOHO_CANCEL_SELL(23, "上架关闭",
new Node(
Arrays.asList(ButtonShow.SOLD_AGAIN.getBo(), ButtonShow.DEL_ORDER.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SOLD_AGAIN.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo(), ButtonShow.SHOW_DETAIL.getBo()),
Arrays.asList(ButtonShow.DEL_ORDER.getBo()),
OrderDetailDesc.Seller.YOHO_CANCEL_BEFORE_EXIST_BUY,
OrderDetailDesc.PaymentTips.FINISH_RETURN_SELLER
)
... ...
... ... @@ -48,6 +48,7 @@ public class AddressInfoConvertor {
addressInfo.setPhone(resp.getString("phone"));
addressInfo.setMobile(resp.getString("mobile"));
addressInfo.setZipCode(resp.getString("zip_code"));
addressInfo.setIsUpdate(resp.getString("is_update"));
return addressInfo;
}
}
... ...
... ... @@ -96,7 +96,7 @@ public class SellerOrderDetailService extends AbsOrderDetailService implements I
SellerOrderGoods sellerOrderGoods = sellerOrderGoodsMapper.selectByPrimaryKey(skup);
Integer skupStatusCode = sellerOrderGoods.getStatus();
SkupStatus skupStatus = SkupStatus.getSkupStatus(skupStatusCode);
AddressInfo addressInfo = sellerAddressService.getAddressInfo(uid, skup);
AddressInfo addressInfo = sellerAddressService.getHiddenAddressInfo(uid, skup);
return buildOrderDetail(sellerOrder, skupStatus, sellerOrderGoods, addressInfo);
}
OrderDetailInfo orderDetailInfo = super.getOrderDetail(orderRequest);
... ...
... ... @@ -44,6 +44,7 @@ import com.yohoufo.order.service.proxy.ProductProxyService;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.service.support.codegenerator.bean.CodeMeta;
import com.yohoufo.order.utils.AddressHelper;
import com.yohoufo.product.model.GoodsSize;
import com.yohoufo.product.model.ProductInfo;
import com.yohoufo.product.response.StorageDataResp;
... ... @@ -313,10 +314,12 @@ public class SellerOrderService implements IOrderListService, IOrderDetailServi
//the address of send back 2 seller
//
AddressInfo hiddenBackAddress = userProxyService.getHiddenAddressInfo(uid, addressId);
AddressInfo noHiddenBackAddress = userProxyService.getAddressInfoNotHidden(uid, addressId);
if(AddressHelper.isNeedUpdate(noHiddenBackAddress)){
log.warn("seller submit addressId need update, uid is {}, storageId is {}, addressId is {}",
uid, storageId, addressId);
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
}
//
SellerOrderContext context = new SellerOrderContext();
context.setUid(uid);
... ...
... ... @@ -25,6 +25,7 @@ import com.yohoufo.order.service.proxy.InBoxFacade;
import com.yohoufo.order.service.proxy.UserProxyService;
import com.yohoufo.order.service.support.ShoppingSupport;
import com.yohoufo.order.service.support.codegenerator.OrderCodeGenerator;
import com.yohoufo.order.utils.AddressHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
... ... @@ -141,10 +142,15 @@ public class ShoppingServiceImpl implements IShoppingService {
// 检查skup是否可售
SellerOrderGoods skup = checkSkupSellOrNot(shoppingRequest.getSkup());
AddressInfo addressInfo = userProxyService.getAddressInfoNotHidden(shoppingRequest.getUid(), addressId);
if(AddressHelper.isNeedUpdate(addressInfo)){
logger.warn("submit addressId need update, uid is {}, skup is {}, addressId is {}", shoppingRequest.getUid(),
shoppingRequest.getSkup(), shoppingRequest.getAddressId());
throw new ServiceException(ServiceError.ORDER_ADDRESS_NEED_UPDATE);
}
// 生成订单号
long orderCode = orderCodeGenerator.generate(OrderCodeType.BUYER_TYPE);
AddressInfo addressInfo = userProxyService.getAddressInfoNotHidden(shoppingRequest.getUid(), addressId);
AddressInfo hiddenAddress = userProxyService.getAddressInfoNotHidden(shoppingRequest.getUid(), addressId);
// 减库存,skup更新成不可售,入库
... ...
package com.yohoufo.order.utils;
import com.yohoufo.order.model.AddressInfo;
import org.apache.commons.lang3.StringUtils;
/**
* Created by chenchao on 2018/10/20.
*/
public class AddressHelper {
/**
* is_update = N 四级地址
is_update = Y 三级地址
* @return
*/
public static boolean isNeedUpdate(AddressInfo addressInfo){
String isUpdate;
if (StringUtils.isNotBlank(isUpdate = addressInfo.getIsUpdate()) && "Y".equals(isUpdate)){
return true;
}
return false;
}
}
... ...