记得上下班打卡 | git大法好,push需谨慎

Commit aaf952c2 authored by jiangxiulong's avatar jiangxiulong

删除refund redis

parent dbeaf70a
......@@ -37,6 +37,7 @@ import org.springframework.util.MultiValueMap;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.stream.Collectors;
......@@ -309,6 +310,15 @@ public class KylinRefundsStatusServiceImpl {
);
}
List<String> orderRefundIds = refundList.stream().map(
KylinOrderRefunds -> KylinOrderRefunds.getOrderRefundsId()).collect(Collectors.toList()
);
List<String> orderIds = refundList.stream().map(
KylinOrderRefunds -> KylinOrderRefunds.getOrderTicketsId()).collect(Collectors.toList()
);
dataUtils.delOrderRefundVo(orderRefundIds);
dataUtils.delOrderRefundVoByOrderId(orderIds);
return true;
}
......@@ -351,6 +361,9 @@ public class KylinRefundsStatusServiceImpl {
List<String> orderRefundIds = refundList.stream().map(
KylinOrderRefunds -> KylinOrderRefunds.getOrderRefundsId()).collect(Collectors.toList()
);
List<String> orderIds = refundList.stream().map(
KylinOrderRefunds -> KylinOrderRefunds.getOrderTicketsId()).collect(Collectors.toList()
);
kylinOrderRefundsMapper.update(
kylinOrderRefunds,
new UpdateWrapper<KylinOrderRefunds>().in("order_refunds_id", orderRefundIds)
......@@ -363,6 +376,8 @@ public class KylinRefundsStatusServiceImpl {
Query.query(Criteria.where("orderRefundsId").in(orderRefundIds)).getQueryObject(),
object
);
dataUtils.delOrderRefundVo(orderRefundIds);
dataUtils.delOrderRefundVoByOrderId(orderIds);
return true;
}
......@@ -416,6 +431,15 @@ public class KylinRefundsStatusServiceImpl {
);
}
List<String> orderRefundIds = refundList.stream().map(
KylinOrderRefunds -> KylinOrderRefunds.getOrderRefundsId()).collect(Collectors.toList()
);
List<String> orderIds = refundList.stream().map(
KylinOrderRefunds -> KylinOrderRefunds.getOrderTicketsId()).collect(Collectors.toList()
);
dataUtils.delOrderRefundVo(orderRefundIds);
dataUtils.delOrderRefundVoByOrderId(orderIds);
return true;
}
......@@ -549,6 +573,13 @@ public class KylinRefundsStatusServiceImpl {
object
);
List<String> orderRefundIds = new ArrayList<>();
orderRefundIds.add(refundInfo.getOrderRefundsId());
List<String> orderIds = new ArrayList<>();
orderIds.add(orderTicketsId);
dataUtils.delOrderRefundVo(orderRefundIds);
dataUtils.delOrderRefundVoByOrderId(orderIds);
if (refundInfo.getType() == KylinTableStatusConst.ORDER_REFUND_TYPE_APPLY) {
// 退还库存
for (String entitiesId : orderTicketEntitiesIdsArr) {
......
......@@ -278,4 +278,18 @@ public class DataUtils {
String redisKey = KylinRedisConst.ORDER_EXPRESS_INFO.concat(orderId);
redisUtil.del(redisKey);
}
/**
* 退款redis
*/
public void delOrderRefundVo(List<String> orderRefundIds){
for (String id : orderRefundIds) {
redisUtil.del(KylinRedisConst.ORDER_REFUND.concat(id));
}
}
public void delOrderRefundVoByOrderId(List<String> orderIds){
for (String id : orderIds) {
redisUtil.del(KylinRedisConst.ORDER_REFUND_BY_ORDER_ID.concat(id));
}
}
}
......@@ -203,6 +203,8 @@ public class KylinRefundsStatusServiceImpl {
Query.query(Criteria.where("orderRefundsId").is(refundInfo.getOrderRefundsId())).getQueryObject(),
object
);
dataUtils.delOrderRefundVo(refundInfo.getOrderRefundsId());
dataUtils.delOrderRefundVoByOrderId(refundInfo.getOrderTicketsId());
if (refundInfo.getType() == KylinTableStatusConst.ORDER_REFUND_TYPE_APPLY) {
// 退还库存
......
package com.liquidnet.service.platform.service.refund;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dto.param.RefundCallbackParam;
import com.liquidnet.service.kylin.dto.vo.returns.KylinOrderRefundsVo;
import com.liquidnet.service.kylin.entity.KylinOrderRefunds;
import com.liquidnet.service.kylin.mapper.*;
import com.liquidnet.service.kylin.service.IKylinOrderRefundsService;
import com.liquidnet.service.platform.utils.DataUtils;
import com.mongodb.BasicDBObject;
import com.mongodb.client.result.UpdateResult;
import lombok.extern.slf4j.Slf4j;
......@@ -22,6 +21,8 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
* <p>
......@@ -46,6 +47,9 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
@Autowired
private MongoConverter mongoConverter;
@Autowired
private DataUtils dataUtils;
public String refundCallback(RefundCallbackParam refundCallbackParam) {
KylinOrderRefunds refundInfo = kylinOrderRefundsMapper.selectOne(
new UpdateWrapper<KylinOrderRefunds>()
......@@ -94,6 +98,8 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
Query.query(Criteria.where("orderRefundsId").is(refundInfo.getOrderRefundsId())).getQueryObject(),
object
);
dataUtils.delOrderRefundVo(refundInfo.getOrderRefundsId());
dataUtils.delOrderRefundVoByOrderId(refundInfo.getOrderTicketsId());
}
return "success";
}
......
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