|
|
@@ -17,6 +17,7 @@ import com.fs.company.service.impl.call.node.AiAddWxTaskNode;
|
|
|
import com.fs.company.service.impl.call.node.AiAddWxTaskNewNode;
|
|
|
import com.fs.enums.ExecutionStatusEnum;
|
|
|
import com.fs.enums.NodeTypeEnum;
|
|
|
+import com.fs.wxcid.domain.CidIpadServer;
|
|
|
import com.fs.wxcid.domain.CidIpadServerUser;
|
|
|
import com.fs.wxcid.domain.WxContact;
|
|
|
import com.fs.wxcid.dto.friend.ContactItem;
|
|
|
@@ -277,22 +278,20 @@ public class CompanyWxServiceImpl extends ServiceImpl<CompanyWxAccountMapper, Co
|
|
|
if ( cidServerId==null ){
|
|
|
return R.error("请先绑定cid服务");
|
|
|
}
|
|
|
- CompanyAiWorkflowServer cidServer = companyAiWorkflowServerMapper.selectCompanyAiWorkflowServerById(companyUser.getCidServerId());
|
|
|
-
|
|
|
- Long serverId = cidIpadServerService.selectQwIpadServerByAddressId(addressId,cidServer.getGroupNo());
|
|
|
- if (serverId==null){
|
|
|
- return R.error(501,"该地区服务器剩余数量不足");
|
|
|
+ CidIpadServer count = cidIpadServerService.getOne(new QueryWrapper<CidIpadServer>().gt("count", 0).last(" limit 1"));
|
|
|
+ if (count==null){
|
|
|
+ return R.error(501,"回调服务器不足,请联系管理员");
|
|
|
}
|
|
|
- account.setServerId(serverId);
|
|
|
+ account.setServerId(count.getId());
|
|
|
account.setServerStatus(1);
|
|
|
updateById(account);
|
|
|
|
|
|
-// cidIpadServerService.subtractServer(serverId);
|
|
|
+ cidIpadServerService.subtractServer(count.getId());
|
|
|
CidIpadServerUser qwIpadServerUser = new CidIpadServerUser();
|
|
|
qwIpadServerUser.setCompanyUserId(companyUser.getUserId());
|
|
|
qwIpadServerUser.setCompanyId(companyUser.getCompanyId());
|
|
|
qwIpadServerUser.setCreateTime(new Date());
|
|
|
- qwIpadServerUser.setServerId(serverId);
|
|
|
+ qwIpadServerUser.setServerId(count.getId());
|
|
|
qwIpadServerUser.setQwUserId(account.getId());
|
|
|
cidIpadServerUserService.save(qwIpadServerUser);
|
|
|
return null;
|