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

Commit e060c1ae authored by jiangxiulong's avatar jiangxiulong

refund type1 不用等回掉回滚库存

parent a7ce332a
...@@ -8,12 +8,10 @@ import com.liquidnet.service.kylin.constant.KylinTableStatusConst; ...@@ -8,12 +8,10 @@ import com.liquidnet.service.kylin.constant.KylinTableStatusConst;
import com.liquidnet.service.kylin.dao.KylinOrderTicketEntitiesDao; import com.liquidnet.service.kylin.dao.KylinOrderTicketEntitiesDao;
import com.liquidnet.service.kylin.dto.param.RefundApplyParam; import com.liquidnet.service.kylin.dto.param.RefundApplyParam;
import com.liquidnet.service.kylin.dto.param.RefundCallbackParam; import com.liquidnet.service.kylin.dto.param.RefundCallbackParam;
import com.liquidnet.service.kylin.entity.KylinOrderRefunds; import com.liquidnet.service.kylin.entity.*;
import com.liquidnet.service.kylin.entity.KylinOrderTicketEntities;
import com.liquidnet.service.kylin.entity.KylinOrderTicketStatus;
import com.liquidnet.service.kylin.entity.KylinOrderTickets;
import com.liquidnet.service.kylin.mapper.*; import com.liquidnet.service.kylin.mapper.*;
import com.liquidnet.service.kylin.service.IKylinOrderRefundsService; import com.liquidnet.service.kylin.service.IKylinOrderRefundsService;
import com.liquidnet.service.kylin.utils.DataUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
...@@ -51,9 +49,15 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun ...@@ -51,9 +49,15 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
@Autowired @Autowired
private KylinOrderTicketEntitiesMapper kylinOrderTicketEntitiesMapper; private KylinOrderTicketEntitiesMapper kylinOrderTicketEntitiesMapper;
@Autowired
private KylinOrderTicketRelationsMapper kylinOrderTicketRelationsMapper;
@Autowired @Autowired
MongoTemplate mongoTemplate; MongoTemplate mongoTemplate;
@Autowired
private DataUtils dataUtils;
public String refundCallback(RefundCallbackParam refundCallbackParam) { public String refundCallback(RefundCallbackParam refundCallbackParam) {
KylinOrderRefunds refundInfo = kylinOrderRefundsMapper.selectOne( KylinOrderRefunds refundInfo = kylinOrderRefundsMapper.selectOne(
new UpdateWrapper<KylinOrderRefunds>() new UpdateWrapper<KylinOrderRefunds>()
...@@ -103,6 +107,9 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun ...@@ -103,6 +107,9 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne( KylinOrderTickets orderInfo = kylinOrderTicketsMapper.selectOne(
new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId) new QueryWrapper<KylinOrderTickets>().eq("order_tickets_id", orderTicketsId)
); );
KylinOrderTicketRelations orderRelations = kylinOrderTicketRelationsMapper.selectOne(
new QueryWrapper<KylinOrderTicketRelations>().eq("order_id", orderTicketsId)
);
// 传的快递费不能大于实际的快递费=(支付的快递费-已退的快递费) // 传的快递费不能大于实际的快递费=(支付的快递费-已退的快递费)
Double refundPriceExpressSum = kylinOrderRefundsMapper.RefundPriceExpressSum(// 已退快递费 Double refundPriceExpressSum = kylinOrderRefundsMapper.RefundPriceExpressSum(// 已退快递费
orderTicketsId, orderTicketsId,
...@@ -155,6 +162,14 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun ...@@ -155,6 +162,14 @@ public class OrderRefundsCallbackServiceImpl extends ServiceImpl<KylinOrderRefun
ticketEntityIds, entitiesPrice ticketEntityIds, entitiesPrice
); );
if (res) { if (res) {
// 超时直接退还库存
for (String entitiesId : ticketEntityIds) {
dataUtils.changeSurplusGeneral(entitiesId, 1);
KylinOrderTicketEntities entitiesInfo = kylinOrderTicketEntitiesMapper.selectOne(
new QueryWrapper<KylinOrderTicketEntities>().eq("order_ticket_entities_id", entitiesId)
);
dataUtils.changeBuyInfo(orderInfo.getUserId(), "", orderRelations.getPerformanceId(), entitiesInfo.getTicketId(), -1);
}
return true; return true;
} else { } else {
return false; return false;
......
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