|
|
@@ -1241,7 +1241,7 @@ public class CmsOrderController {
|
|
|
* 用户退款详情
|
|
|
*/
|
|
|
@GetMapping("/get/user/refund/detail")
|
|
|
- public Result<OrderDonUserRefundDetailView> getUserRefundDetail(Long userId) {
|
|
|
+ public Result<OrderDonUserRefundDetailView> getUserRefundDetail(Long userId, Long orderId) {
|
|
|
if (userId == null || userId == 0) {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
@@ -1249,6 +1249,7 @@ public class CmsOrderController {
|
|
|
try {
|
|
|
userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
} catch (Exception e) {
|
|
|
+ userIdList = List.of(userId);
|
|
|
}
|
|
|
String userIds = null;
|
|
|
if (CollUtil.isNotEmpty(userIdList)) {
|
|
|
@@ -1261,6 +1262,15 @@ public class CmsOrderController {
|
|
|
builder.put("uid", String.format(" and user_id = %s", userId));
|
|
|
}
|
|
|
OrderDonUserRefundDetailView orderDonUserRefundDetailView = beanSearcher.searchFirst(OrderDonUserRefundDetailView.class, builder.build());
|
|
|
+ OrderDon orderDon = orderDonMapper.selectById(orderId);
|
|
|
+ if (orderDon != null && orderDon.getRelationId() != null && orderDon.getRelationId() > 0) {
|
|
|
+ GroupsRelation relation = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).eq(GroupsRelation::getId, orderDon.getRelationId()).in(GroupsRelation::getUserId, userIdList));
|
|
|
+ if (relation != null && relation.getExpiryTime() != null && relation.getExpiryTime().after(DateTime.now())) {
|
|
|
+ Long remainDays = DateUtil.betweenDay(DateTime.now(), relation.getExpiryTime(), false);
|
|
|
+ orderDonUserRefundDetailView.setRemainsDays(remainDays.intValue());
|
|
|
+ orderDonUserRefundDetailView.setCompensationDays(relation.getCompensationDays());
|
|
|
+ }
|
|
|
+ }
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(orderDonUserRefundDetailView);
|
|
|
}
|
|
|
|