You've already forked FrameTour-BE
分账小改动,订单列表优化速度
This commit is contained in:
@ -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, "订单已退款");
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
Reference in New Issue
Block a user