分账小改动,订单列表优化速度

This commit is contained in:
2025-02-21 17:09:14 +08:00
parent b51b3260c7
commit 1c6e3e3cd3
6 changed files with 39 additions and 8 deletions

View File

@ -236,7 +236,7 @@ public class OrderBiz {
}
});
orderRepository.clearOrderCache(orderId); // 更新完了,清理下
profitSharingBiz.revokeProfitSharing(order.getScenicId(), orderId);
profitSharingBiz.revokeProfitSharing(order.getScenicId(), orderId, "订单被取消");
}
public void refundOrder(Long orderId) {
@ -258,6 +258,6 @@ public class OrderBiz {
}
});
orderRepository.clearOrderCache(orderId); // 更新完了,清理下
profitSharingBiz.revokeProfitSharing(order.getScenicId(), orderId);
profitSharingBiz.revokeProfitSharing(order.getScenicId(), orderId, "订单已退款");
}
}

View File

@ -143,7 +143,7 @@ public class ProfitSharingBiz {
BigDecimal manualAmount;
if (user.getRateMode() == 0) { // 剩余比例
userAmount = mode0RemainAmount.divide(BigDecimal.valueOf(mode0User.size()), 2, RoundingMode.HALF_DOWN);
wxAmount = mode0RemainAmount.divide(BigDecimal.valueOf(mode0User.size()), 2, RoundingMode.HALF_DOWN);
wxAmount = BigDecimal.ZERO;
manualAmount = userAmount.subtract(wxAmount);
} else {
return;
@ -207,7 +207,7 @@ public class ProfitSharingBiz {
recordMapper.batchInsert(records);
}
public void revokeProfitSharing(Long scenicId, Long orderId) {
recordMapper.deleteByScenicIdAndOrderId(scenicId, orderId);
public void revokeProfitSharing(Long scenicId, Long orderId, String revokeReason) {
recordMapper.deleteByScenicIdAndOrderId(scenicId, orderId, revokeReason);
}
}

View File

@ -18,4 +18,5 @@ public class ProfitSharingRecordReqQuery extends BaseQueryParameterReq {
private Date startTime;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
private boolean withDeleted = false;
}

View File

@ -15,6 +15,5 @@ public interface ProfitSharingRecordMapper {
void batchInsert(List<ProfitSharingRecord> records);
@Delete("DELETE FROM profit_sharing_record WHERE scenic_id = #{scenicId} AND order_id = #{orderId}")
void deleteByScenicIdAndOrderId(Long scenicId, Long orderId);
void deleteByScenicIdAndOrderId(Long scenicId, Long orderId, String reason);
}