|
|
@@ -115,11 +115,13 @@ public class CmsAccountController {
|
|
|
|
|
|
private final ChatGptAccountService chatGptAccountService;
|
|
|
|
|
|
+ private final MidjourneyAccountMapper midjourneyAccountMapper;
|
|
|
+
|
|
|
private static final GlobalThreadPoolTaskExecutor TASK_EXECUTOR = GlobalThreadPoolTaskExecutor.getInstance();
|
|
|
|
|
|
@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) {
|
|
|
+ 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, Boolean isMjMirror) {
|
|
|
MapBuilder mapBuilder = MapUtils.flatBuilder(request.getParameterMap());
|
|
|
if (StrUtil.isNotEmpty(expiryStartTime) || StrUtil.isNotEmpty(expiryEndTime)) {
|
|
|
mapBuilder.field(AccountView::getExpiryTime, expiryStartTime, expiryEndTime)
|
|
|
@@ -165,6 +167,12 @@ public class CmsAccountController {
|
|
|
extra_sql += String.format(" (select min(expiry_time) from (select gt.id from groups_trips where account_id = a.id) gt inner join groups_relation gr on gr.groups_id = gt.id) > '%s'", endOfDay);
|
|
|
}
|
|
|
}
|
|
|
+ if (isMjMirror != null) {
|
|
|
+ if (StrUtil.isNotEmpty(extra_sql)) {
|
|
|
+ extra_sql += " and";
|
|
|
+ }
|
|
|
+ extra_sql += String.format(" %s (select 1 from midjourney_account ma where ma.account_id = a.id limit 1)", isMjMirror ? "EXISTS" : "NOT EXISTS");
|
|
|
+ }
|
|
|
if (StrUtil.isNotEmpty(extra_sql)) {
|
|
|
mapBuilder.put("extra_sql", extra_sql);
|
|
|
}
|
|
|
@@ -200,6 +208,11 @@ public class CmsAccountController {
|
|
|
.last("limit 1")))
|
|
|
.ifPresent(email -> accountView.setEmailPassword(email.getPassword()));
|
|
|
}
|
|
|
+ if (accountView.getGoodsId() == 26) {
|
|
|
+ Integer count = midjourneyAccountMapper.selectCount(Wrappers.lambdaQuery(MidjourneyAccount.class)
|
|
|
+ .eq(MidjourneyAccount::getAccountId, accountView.getId()));
|
|
|
+ accountView.setIsMjMirror(count > 0 ? true : false);
|
|
|
+ }
|
|
|
});
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(search);
|
|
|
}
|