|
|
@@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.excel.EasyExcel;
|
|
|
@@ -247,9 +248,25 @@ public class CmsOrderController {
|
|
|
/**
|
|
|
* 镜像规格使用详情
|
|
|
*/
|
|
|
- @GetMapping("/get/order/mj/mirror/detail/{relationId}")
|
|
|
- public Result<MidjourneyUserDetailView> getMjMirrorOrderDetail(@PathVariable Long relationId) {
|
|
|
- MidjourneyUserDetailView midjourneyUserDetailView = midjourneyUserConversationMapper.getMjMirrorOrderDetail(relationId);
|
|
|
+ @GetMapping("/get/order/mj/mirror/detail/{orderId}")
|
|
|
+ public Result<MidjourneyUserDetailView> getMjMirrorOrderDetail(@PathVariable Long orderId) {
|
|
|
+ OrderDon orderDon = orderDonMapper.selectById(orderId);
|
|
|
+ //续费订单
|
|
|
+ Date startTime = null;
|
|
|
+ Date expiryTime = null;
|
|
|
+ if (orderDon.getOrderType() == 2) {
|
|
|
+ GoodsDonSku sku = skuMapper.selectById(orderDon.getSkuId());
|
|
|
+ GroupsRelation relation = relationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class)
|
|
|
+ .eq(GroupsRelation::getId, orderDon.getRelationId())
|
|
|
+ .eq(GroupsRelation::getUserId, orderDon.getUserId()).last("limit 1"));
|
|
|
+ if (relation == null) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ startTime = relation.getStartTime();
|
|
|
+ startTime = DateUtil.offsetMonth(startTime, sku.getMonths());
|
|
|
+ expiryTime = relation.getExpiryTime();
|
|
|
+ }
|
|
|
+ MidjourneyUserDetailView midjourneyUserDetailView = midjourneyUserConversationMapper.getMjMirrorOrderDetail(orderDon.getRelationId(), startTime, expiryTime);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(midjourneyUserDetailView);
|
|
|
}
|
|
|
|