|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.cyksj.common.constant.Constant;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.util.Jsons;
|
|
|
import com.cyksj.common.util.StringUtil;
|
|
|
@@ -91,6 +92,7 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
record.setType(type);
|
|
|
accountUpdatePasswordRecordMapper.insert(record);
|
|
|
}
|
|
|
+
|
|
|
@Override
|
|
|
public void recordAutoUpdatePwd(Long accountId, String account, String oldPwd, String newPwd, String operateIp) {
|
|
|
AutoUpdateAccountPwdLog log = new AutoUpdateAccountPwdLog();
|
|
|
@@ -129,7 +131,7 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
int accountSize = accountViews.size();
|
|
|
|
|
|
if (accountSize < customerSize) {
|
|
|
- accountViews.forEach(account->{
|
|
|
+ accountViews.forEach(account -> {
|
|
|
int randomIndex = RandomUtil.randomInt(customerSize);
|
|
|
CmsUserVO customer = customers.get(randomIndex);
|
|
|
accountMapper.update(null, Wrappers.lambdaUpdate(Account.class)
|
|
|
@@ -173,16 +175,30 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Throwable.class)
|
|
|
public void analysisChatGPTAccount(Long goodsId, Long skuId, List<Object> accountList) {
|
|
|
+ insertAccount(goodsId, skuId, accountList);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void analysisAmericaAppidAccount(Long goodsId, Long skuId, List<Object> accountList) {
|
|
|
+ insertAccount(goodsId, skuId, accountList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param goodsId
|
|
|
+ * @param skuId
|
|
|
+ * @param accountList
|
|
|
+ */
|
|
|
+ public void insertAccount(Long goodsId, Long skuId, List<Object> accountList) {
|
|
|
if (CollUtil.isEmpty(accountList)) {
|
|
|
throw BusinessRuntimeException.getInstance("文件数据为空");
|
|
|
}
|
|
|
accountList.forEach(accountData -> {
|
|
|
Map<String, Object> map = Jsons.toMap(accountData);
|
|
|
String[] part = map.get("0").toString().split("----");
|
|
|
- if (part.length > 2) {
|
|
|
+ if (part.length >= 2) {
|
|
|
String account = part[0];
|
|
|
String password = part[1];
|
|
|
- String apiKey = part[2];
|
|
|
int count = this.count(Wrappers.lambdaQuery(Account.class)
|
|
|
.eq(Account::getAccount, account)
|
|
|
.eq(Account::getGoodsId, goodsId));
|
|
|
@@ -192,8 +208,14 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
|
|
|
Account insert = new Account();
|
|
|
insert.setAccount(account);
|
|
|
insert.setPassword(password);
|
|
|
- insert.setApiKey(apiKey);
|
|
|
+ if (part.length > 2) {
|
|
|
+ String apiKey = part[2];
|
|
|
+ insert.setApiKey(apiKey);
|
|
|
+ }
|
|
|
insert.setGoodsId(goodsId);
|
|
|
+ if (goodsId.equals(31l)) {
|
|
|
+ insert.setSecret(Constant.AMERICA_APPID_SECRET);
|
|
|
+ }
|
|
|
this.save(insert);
|
|
|
|
|
|
//自动配置车队
|