Commit abe8d618 by zhiheng.zhang

Merge branch 'feature/20210513-申请退款按钮关闭-张志恒' into develop

parents 9bb14d25 5f178141
...@@ -64,6 +64,7 @@ import com.freemud.application.sdk.api.ordercenter.request.OrderConditionsReq; ...@@ -64,6 +64,7 @@ import com.freemud.application.sdk.api.ordercenter.request.OrderConditionsReq;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto; import com.freemud.application.sdk.api.ordercenter.request.OrderExtInfoDto;
import com.freemud.application.sdk.api.ordercenter.request.OrderExtendedReq; import com.freemud.application.sdk.api.ordercenter.request.OrderExtendedReq;
import com.freemud.application.sdk.api.ordercenter.response.BaseDownLoadResponse; import com.freemud.application.sdk.api.ordercenter.response.BaseDownLoadResponse;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.AfterSalesOrderResp;
import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoReqs; import com.freemud.application.sdk.api.ordercenter.response.orderInfo.OrderInfoReqs;
import com.freemud.application.sdk.api.promotioncenter.dto.promotion.GoodsStockDTO; import com.freemud.application.sdk.api.promotioncenter.dto.promotion.GoodsStockDTO;
import com.freemud.application.sdk.api.promotioncenter.request.promotion.ActivityUpdateStockRequest; import com.freemud.application.sdk.api.promotioncenter.request.promotion.ActivityUpdateStockRequest;
...@@ -88,6 +89,7 @@ import org.apache.commons.collections4.CollectionUtils; ...@@ -88,6 +89,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.time.FastDateFormat; import org.apache.commons.lang.time.FastDateFormat;
import org.junit.After;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
...@@ -1490,7 +1492,8 @@ public class OrderAdapter { ...@@ -1490,7 +1492,8 @@ public class OrderAdapter {
responseVo.setRefundMode(afterOrderExtInfoDto.getRefundMode()); responseVo.setRefundMode(afterOrderExtInfoDto.getRefundMode());
} }
} }
responseVo.setRefundButtonDisable(AfterSalesStatus.CANCEL.getIndex() == ordersBean.getAfterSalesOrderResp().getAfterSalesStatus() ? false : true); //是否展示申请退款按钮 true 展示 false 不展示
responseVo.setRefundButtonDisable(getRefundButtonDisable(ordersBean));
} }
responseVo.setExpressChannelCode(ordersBean.getExpressChannelCode()); responseVo.setExpressChannelCode(ordersBean.getExpressChannelCode());
responseVo.setExpressChannelName(ordersBean.getExpressChannelName()); responseVo.setExpressChannelName(ordersBean.getExpressChannelName());
...@@ -4384,4 +4387,23 @@ public class OrderAdapter { ...@@ -4384,4 +4387,23 @@ public class OrderAdapter {
} }
return refundStatusDesc; return refundStatusDesc;
} }
private boolean getRefundButtonDisable(QueryOrdersResponse.DataBean.OrderBean orderBean){
boolean refundButtonDisable = true;
//订单状态为 2:已支付 3:已接单 4:已发货 5:已收货/已完成(C端展示的订单状态),这些状态订单展示申请退款按钮(未有售后单或者售后单已经取消)
// 正常订单,未发生售后单的订单,以发货的时间节点为基准,30天后,关闭C端申请退款入口(未有售后单或者售后单已经取消)
//以最新的发起售后单的时间节点为基准(售后单最后申请的时间,同意申请不会更新申请的时间),30天后,关闭订单状态为已完成,退款状态为未处理的退款单,B端不展示退款处理按钮
//未发货订单,申请退款商家未处理,以售后单发起时间+30天后,自动退款。
//校验有没有售后单,一笔订单只会存在一笔售后单,售后单展示为取消展示申请退款按钮
AfterSalesOrderResp afterSalesOrderResp = orderBean.getAfterSalesOrderResp();
List<Integer> orderStatusList = Arrays.asList(OrderStatus.WAIT_PAY.getCode(),OrderStatus.RECEIPT.getCode(),OrderStatus.DISTRIBUTION.getCode(),OrderStatus.COMPLETE.getCode());
if(orderStatusList.contains(orderBean.getStatus()) && (null == afterSalesOrderResp || (null !=afterSalesOrderResp && AfterSalesStatus.CANCEL.getIndex() == afterSalesOrderResp.getAfterSalesStatus()))){
refundButtonDisable = true;
}
if(null == orderBean.getAfterSalesOrderResp() && (DateUtil.addDays(new Date(orderBean.getGmtDelivery()),30)).compareTo(new Date()) ==-1){
refundButtonDisable = false;
}
return refundButtonDisable;
}
} }
...@@ -72,15 +72,15 @@ public class CalculationSharingCartService { ...@@ -72,15 +72,15 @@ public class CalculationSharingCartService {
, Integer flag , Integer flag
, String userId , String userId
, String storeId) { , String storeId) {
if (BusinessTypeEnum.SAAS_MALL.getCode().equals(menuType) && null != shoppingCartInfoRequestVo && OrderChannelType.SAASMALL.getCode().equalsIgnoreCase(shoppingCartInfoRequestVo.getChannelType())) {
deliverySharingService.mallDeliveryResponse(shoppingCartGoodsResponseVo, deliveryAmount,discountResult);
}
/** /**
* 用促销价格初始化购物车行记录成交价 * 用促销价格初始化购物车行记录成交价
*/ */
calculationCommonService.initShoppingCart(discountResult, cartGoodsList, shoppingCartGoodsResponseVo, couponPromotionVO != null ? couponPromotionVO.getCouponCode() : null); calculationCommonService.initShoppingCart(discountResult, cartGoodsList, shoppingCartGoodsResponseVo, couponPromotionVO != null ? couponPromotionVO.getCouponCode() : null);
if (BusinessTypeEnum.SAAS_MALL.getCode().equals(menuType) && null != shoppingCartInfoRequestVo && OrderChannelType.SAASMALL.getCode().equalsIgnoreCase(shoppingCartInfoRequestVo.getChannelType())) {
deliverySharingService.mallDeliveryResponse(shoppingCartGoodsResponseVo, deliveryAmount,discountResult);
}
/** /**
* 可用券及券折扣 * 可用券及券折扣
*/ */
......
...@@ -78,10 +78,10 @@ public class CalculationSharingEquallyService { ...@@ -78,10 +78,10 @@ public class CalculationSharingEquallyService {
, ShoppingCartGoodsDto shoppingCartGoodsDto , ShoppingCartGoodsDto shoppingCartGoodsDto
, CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity) { , CreateOrderVo.PremiumExchangeActivity premiumExchangeActivity) {
calculationCommonService.initShoppingCart(discountResult, cartGoodsList, shoppingCartGoodsResponseVo, couponPromotionVO != null ? couponPromotionVO.getCouponCode() : null);
if (BusinessTypeEnum.SAAS_MALL.getCode().equals(menuType) && null != shoppingCartInfoRequestVo && OrderChannelType.SAASMALL.getCode().equalsIgnoreCase(shoppingCartInfoRequestVo.getChannelType())) { if (BusinessTypeEnum.SAAS_MALL.getCode().equals(menuType) && null != shoppingCartInfoRequestVo && OrderChannelType.SAASMALL.getCode().equalsIgnoreCase(shoppingCartInfoRequestVo.getChannelType())) {
deliverySharingService.mallDeliveryResponse(shoppingCartGoodsResponseVo, deliveryAmount,discountResult); deliverySharingService.mallDeliveryResponse(shoppingCartGoodsResponseVo, deliveryAmount,discountResult);
} }
calculationCommonService.initShoppingCart(discountResult, cartGoodsList, shoppingCartGoodsResponseVo, couponPromotionVO != null ? couponPromotionVO.getCouponCode() : null);
/** /**
* 商品券\换购券 * 商品券\换购券
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment