|
|
@@ -556,11 +556,11 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
public NfStatusResp updateNfAccount(NfUpdatePwdReq req) throws Exception {
|
|
|
Long accountId = req.getAccountId();
|
|
|
Long operateUserId = req.getOperateUserId();
|
|
|
- Account account = accountMapper.selectById(accountId);
|
|
|
- if (account == null || account.getGoodsId() != 18) {
|
|
|
+ Account dbAccount = accountMapper.selectById(accountId);
|
|
|
+ if (dbAccount == null || dbAccount.getGoodsId() != 1) {
|
|
|
throw BusinessRuntimeException.getInstance("非奈飞账号");
|
|
|
}
|
|
|
- NetflixAccountUpdatePwdTaskRecord existsProgressingTaskRecord = netflixAccountUpdatePwdTaskRecordMapper.selectOne(Wrappers.lambdaQuery(NetflixAccountUpdatePwdTaskRecord.class).eq(NetflixAccountUpdatePwdTaskRecord::getAccount, account).eq(NetflixAccountUpdatePwdTaskRecord::getStatus, 0).last("limit 1"));
|
|
|
+ NetflixAccountUpdatePwdTaskRecord existsProgressingTaskRecord = netflixAccountUpdatePwdTaskRecordMapper.selectOne(Wrappers.lambdaQuery(NetflixAccountUpdatePwdTaskRecord.class).eq(NetflixAccountUpdatePwdTaskRecord::getAccount, dbAccount.getAccount()).eq(NetflixAccountUpdatePwdTaskRecord::getStatus, 0).last("limit 1"));
|
|
|
if (existsProgressingTaskRecord != null) {
|
|
|
String transId = existsProgressingTaskRecord.getTransId();
|
|
|
NfStatusResp resp = groupsRelationNetflixService.getNfTaskStatus(transId);
|
|
|
@@ -574,6 +574,8 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
existsProgressingTaskRecord.setStatus(status);
|
|
|
if (status == 1) {
|
|
|
saveAccountUpdateShowRecord(existsProgressingTaskRecord);
|
|
|
+ dbAccount.setPassword(existsProgressingTaskRecord.getNewPwd());
|
|
|
+ accountMapper.updateById(dbAccount);
|
|
|
}
|
|
|
netflixAccountUpdatePwdTaskRecordMapper.updateById(existsProgressingTaskRecord);
|
|
|
}
|
|
|
@@ -581,7 +583,7 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
CmsUser cmsUser = cmsUserMapper.selectById(operateUserId);
|
|
|
|
|
|
String newPWd = req.getNewPwd();
|
|
|
- NfStatusResp resp = groupsRelationNetflixService.updateNfAccount(account.getAccount(), account.getPassword(), newPWd);
|
|
|
+ NfStatusResp resp = groupsRelationNetflixService.updateNfAccount(dbAccount.getAccount(), dbAccount.getPassword(), newPWd);
|
|
|
//任务id
|
|
|
String transId = resp.getTransId();
|
|
|
Integer status = resp.getStatus();
|
|
|
@@ -590,8 +592,8 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
taskRecord.setTransId(transId);
|
|
|
taskRecord.setStatus(status);
|
|
|
taskRecord.setAccountId(accountId);
|
|
|
- taskRecord.setAccount(account.getAccount());
|
|
|
- taskRecord.setOldPwd(account.getPassword());
|
|
|
+ taskRecord.setAccount(dbAccount.getAccount());
|
|
|
+ taskRecord.setOldPwd(dbAccount.getPassword());
|
|
|
taskRecord.setNewPwd(newPWd);
|
|
|
taskRecord.setOperator(cmsUser.getNickname());
|
|
|
taskRecord.setFailReason(resp.getErrorInfo());
|
|
|
@@ -609,6 +611,11 @@ public class CmsGroupServiceImpl extends ServiceImpl<GroupsMapper,GroupsTrips> i
|
|
|
taskRecord.setStatus(status);
|
|
|
if (status == 1) {
|
|
|
saveAccountUpdateShowRecord(taskRecord);
|
|
|
+ Account account = accountMapper.selectOne(Wrappers.lambdaQuery(Account.class).eq(Account::getId, taskRecord.getAccountId()).eq(Account::getAccount, taskRecord.getAccount()).last("limit 1"));
|
|
|
+ if (account != null) {
|
|
|
+ account.setPassword(taskRecord.getNewPwd());
|
|
|
+ accountMapper.updateById(account);
|
|
|
+ }
|
|
|
}
|
|
|
if (status == 2) {
|
|
|
taskRecord.setFailReason(resp.getErrorInfo());
|