Skip to content

Commit

Permalink
fix:交易投诉,交易售后,兼容设置中描述的内容:设置为0则表示不限制
Browse files Browse the repository at this point in the history
  • Loading branch information
chopper711 committed May 10, 2023
1 parent a502420 commit c0a370a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ private void memberEvaluation(OrderSetting orderSetting) {
* @param orderSetting 订单设置
*/
private void closeAfterSale(OrderSetting orderSetting) {
//为0则不限制
if (orderSetting.getCloseAfterSale() == null || orderSetting.getCloseAfterSale() == 0) {
return;
}
//订单关闭售后申请时间 = 当前时间 - 自动关闭售后申请天数
DateTime receiveTime = DateUtil.offsetDay(DateUtil.date(), -orderSetting.getCloseAfterSale());

Expand Down Expand Up @@ -223,6 +227,10 @@ private void closeAfterSale(OrderSetting orderSetting) {
*/
private void closeComplaint(OrderSetting orderSetting) {

//为0则不限制
if (orderSetting.getCloseComplaint() == null || orderSetting.getCloseComplaint() == 0) {
return;
}
//订单关闭交易投诉申请时间 = 当前时间 - 自动关闭交易投诉申请天数
DateTime receiveTime = DateUtil.offsetDay(DateUtil.date(), -orderSetting.getCloseComplaint());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class PromotionPriceUtil {
* @param discountPrice 需要分发的优惠金额
* @param promotionTypeEnum 促销类型
*/
public static void recountPrice(TradeDTO tradeDTO, Map<String, Double> skuPromotionDetail, Double discountPrice, PromotionTypeEnum promotionTypeEnum, String activityId) {
public static void recountPrice(TradeDTO tradeDTO, Map<String, Double> skuPromotionDetail, Double discountPrice,
PromotionTypeEnum promotionTypeEnum, String activityId) {

// sku 促销信息非空判定
if (skuPromotionDetail == null || skuPromotionDetail.size() == 0) {
Expand Down Expand Up @@ -116,7 +117,8 @@ public static void recountPrice(TradeDTO tradeDTO, Map<String, Double> skuPromot
* @param promotionTypeEnum 优惠类型
* @param activityId 优惠活动id
*/
private static void calculateCartSkuPromotionsPrice(CartSkuVO cartSkuVO, Double skuDiscountPrice, PromotionTypeEnum promotionTypeEnum, String activityId) {
private static void calculateCartSkuPromotionsPrice(CartSkuVO cartSkuVO, Double skuDiscountPrice, PromotionTypeEnum promotionTypeEnum,
String activityId) {
//优惠券金额,则计入优惠券 ,其他则计入总的discount price
if (promotionTypeEnum == PromotionTypeEnum.COUPON) {

Expand Down Expand Up @@ -179,14 +181,16 @@ private static void calculateCartSkuPromotionsPrice(CartSkuVO cartSkuVO, Double
* @param promotionTypeEnum 优惠类型
* @param activityId 优惠活动id
*/
private static void calculateNotEnoughPromotionsPrice(List<CartSkuVO> skuVOList, Map<String, Double> skuPromotionDetail, Double discountPrice, Double totalPrice, PromotionTypeEnum promotionTypeEnum, String activityId) {
private static void calculateNotEnoughPromotionsPrice(List<CartSkuVO> skuVOList, Map<String, Double> skuPromotionDetail, Double discountPrice,
Double totalPrice, PromotionTypeEnum promotionTypeEnum, String activityId) {
// 特殊情况处理,如参与多个促销活动,部分商品在其他促销计算后的金额不足以满足与当前参与的促销活动的优惠金额
// 但当前购物车内存在当前当前促销活动的其他商品且剩余金额也满足分摊不足商品的不足金额,则分摊到其他商品上
// 满足当前促销的总优惠金额
if (skuPromotionDetail == null || skuPromotionDetail.isEmpty()) {
return;
}
long matchPromotionsZeroCount = skuVOList.stream().filter(l -> l.getPriceDetailDTO().getFlowPrice() == 0 && skuPromotionDetail.containsKey(l.getGoodsSku().getId())).count();
long matchPromotionsZeroCount =
skuVOList.stream().filter(l -> l.getPriceDetailDTO().getFlowPrice() == 0 && skuPromotionDetail.containsKey(l.getGoodsSku().getId())).count();
long matchPromotionsCount = skuVOList.stream().filter(l -> skuPromotionDetail.containsKey(l.getGoodsSku().getId())).count();
if (matchPromotionsZeroCount == matchPromotionsCount) {
return;
Expand Down

0 comments on commit c0a370a

Please sign in to comment.