|
|
@@ -11,9 +11,11 @@ import com.alibaba.excel.EasyExcel;
|
|
|
import com.alibaba.excel.context.AnalysisContext;
|
|
|
import com.alibaba.excel.event.AnalysisEventListener;
|
|
|
import com.alibaba.excel.support.ExcelTypeEnum;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Assert;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.annotation.Log;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
|
+import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.dto.RedisKey;
|
|
|
import com.cyksj.dto.Result;
|
|
|
@@ -55,10 +57,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Optional;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -103,6 +102,8 @@ public class CmsAccountController {
|
|
|
|
|
|
private final RedisService redisService;
|
|
|
|
|
|
+ private final GoodsDonSkuMapper goodsDonSkuMapper;
|
|
|
+
|
|
|
@GetMapping("/get")
|
|
|
@SaCheckPermission("account:view")
|
|
|
public Result<SearchResult<AccountView>> get(Long userId, String showId, String nickName, String submitAccount, String expiryStartTime, String expiryEndTime, Boolean expiredAll, Boolean existsExpired, Boolean existsExpiredToday, Integer noChangeMonths) {
|
|
|
@@ -857,4 +858,45 @@ public class CmsAccountController {
|
|
|
List<DoubleVerifyClickRefreshRecord> search = beanSearcher.searchAll(DoubleVerifyClickRefreshRecord.class, MapUtils.flatBuilder(request.getParameterMap()).build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * MidJourney、ChatGPT年付 ChatGpt独立月付未续费列表
|
|
|
+ */
|
|
|
+ @GetMapping("/get/specific/account")
|
|
|
+ public Result<SearchResult<AccountSpecificView>> getSpecificAccount() {
|
|
|
+ //获取MidJourney、ChatGPT年付 ChatGpt独立月付 规格id
|
|
|
+ Long chatGptPlusGid = Constant.AI_goodsIds.get(0);
|
|
|
+ //年付
|
|
|
+ List<Long> yearSkuIds = goodsDonSkuMapper.getSpecificSkuIdsByGoodsIds(Constant.AI_goodsIds, 12);
|
|
|
+ //ChatGpt Plus 独立月付
|
|
|
+ List<Long> monthSkuIds = goodsDonSkuMapper.getSpecificSkuIdsByGoodsId(chatGptPlusGid, 1, 1);
|
|
|
+ Collection<Long> skuIds = CollUtil.addAll(yearSkuIds, monthSkuIds);
|
|
|
+ if (skuIds.isEmpty()) {
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+ SearchResult<AccountSpecificView> search = beanSearcher.search(AccountSpecificView.class, MapUtils.flatBuilder(request.getParameterMap())
|
|
|
+ .put("condition", String.format("and (select count(*) from groups_relation gr where gr.groups_id = gt.id and gr.user_id != 0 and gr.status in ('validity','outside')) > 0"))
|
|
|
+ .field(AccountSpecificView::getExpiryTime, DateTime.now()).op(Operator.LessThan)
|
|
|
+ .field(AccountSpecificView::getSkuId, skuIds).op(Operator.InList).build());
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 编辑 未续费的账号
|
|
|
+ */
|
|
|
+ @PutMapping("/update/renew/account")
|
|
|
+ public Result<String> updateRenewAccount(@RequestBody Account account) {
|
|
|
+ Long id = account.getId();
|
|
|
+ Date startTime = account.getStartTime();
|
|
|
+ Date expiryTime = account.getExpiryTime();
|
|
|
+ String remark = account.getRemark();
|
|
|
+ Account byId = accountService.getById(id);
|
|
|
+ Assert.notNull(byId, "账号不存在");
|
|
|
+ byId.setStartTime(startTime);
|
|
|
+ byId.setExpiryTime(expiryTime);
|
|
|
+ byId.setRemark(remark);
|
|
|
+ accountService.updateById(byId);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
+ }
|
|
|
+
|
|
|
}
|