|
@@ -227,7 +227,7 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
Account insert = new Account();
|
|
Account insert = new Account();
|
|
|
insert.setAccount(account);
|
|
insert.setAccount(account);
|
|
|
insert.setPassword(password);
|
|
insert.setPassword(password);
|
|
|
- if (part.length > 2) {
|
|
|
|
|
|
|
+ if (part.length > 2 && part.length < 9) {
|
|
|
//google36、辅助邮箱
|
|
//google36、辅助邮箱
|
|
|
//46 Google Bard
|
|
//46 Google Bard
|
|
|
if (special_email_goods_ids.contains(goodsId)) {
|
|
if (special_email_goods_ids.contains(goodsId)) {
|
|
@@ -240,15 +240,57 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
}
|
|
}
|
|
|
insert.setGoodsId(goodsId);
|
|
insert.setGoodsId(goodsId);
|
|
|
if (goodsId.equals(31l)) {
|
|
if (goodsId.equals(31l)) {
|
|
|
- insert.setSecret(Constant.AMERICA_APPID_SECRET);
|
|
|
|
|
|
|
+ if (part.length > 9) {
|
|
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
|
|
+ String country = part[part.length - 1];
|
|
|
|
|
+ if (country.contains("国")) {
|
|
|
|
|
+ sb.append(part[part.length - 1]);
|
|
|
|
|
+ sb.append(Constant.ONE_EMPTY);
|
|
|
|
|
+ sb.append(part[part.length - 2]);
|
|
|
|
|
+ sb.append(Constant.ONE_EMPTY);
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int i = 2; i < part.length; i++) {
|
|
|
|
|
+ if (part[i].contains("朋友")) {
|
|
|
|
|
+ sb.append("朋友");
|
|
|
|
|
+ sb.append(Constant.ONE_EMPTY);
|
|
|
|
|
+ sb.append(part[i + 1]);
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (part[i].contains("工作")) {
|
|
|
|
|
+ sb.append("工作");
|
|
|
|
|
+ sb.append(Constant.ONE_EMPTY);
|
|
|
|
|
+ sb.append(part[i + 1]);
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (part[i].contains("父母")) {
|
|
|
|
|
+ sb.append("父母");
|
|
|
|
|
+ sb.append(Constant.ONE_EMPTY);
|
|
|
|
|
+ sb.append(part[i + 1]);
|
|
|
|
|
+ i++;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ insert.setSecret(sb.toString());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ insert.setSecret(Constant.AMERICA_APPID_SECRET);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
this.save(insert);
|
|
this.save(insert);
|
|
|
-
|
|
|
|
|
- //自动配置车队
|
|
|
|
|
- GroupsTrips groupsTrips = new GroupsTrips();
|
|
|
|
|
- groupsTrips.setSkuId(skuId);
|
|
|
|
|
- groupsTrips.setAccountId(insert.getId());
|
|
|
|
|
- cmsGroupService.issuance(groupsTrips, null);
|
|
|
|
|
|
|
+ //是否存在未发车的车队
|
|
|
|
|
+ GroupsTrips waiting = cmsGroupService.getOne(Wrappers.lambdaQuery(GroupsTrips.class)
|
|
|
|
|
+ .eq(GroupsTrips::getSkuId, skuId)
|
|
|
|
|
+ .eq(GroupsTrips::getStatus, GroupsTrips.Status.waiting).last("limit 1"));
|
|
|
|
|
+ if (waiting != null) {
|
|
|
|
|
+ waiting.setAccountId(insert.getId());
|
|
|
|
|
+ try {
|
|
|
|
|
+ cmsGroupService.setAccount(waiting);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ //自动配置车队
|
|
|
|
|
+ setGroupsTrips(skuId, insert.getId());
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //自动配置车队
|
|
|
|
|
+ setGroupsTrips(skuId, insert.getId());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
@@ -256,4 +298,12 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
}
|
|
}
|
|
|
redisService.del(cache);
|
|
redisService.del(cache);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ public void setGroupsTrips(Long skuId, Long accountId) {
|
|
|
|
|
+ //自动配置车队
|
|
|
|
|
+ GroupsTrips groupsTrips = new GroupsTrips();
|
|
|
|
|
+ groupsTrips.setSkuId(skuId);
|
|
|
|
|
+ groupsTrips.setAccountId(accountId);
|
|
|
|
|
+ cmsGroupService.issuance(groupsTrips, null);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|