Commit cf9763ad authored by 黄奎's avatar 黄奎

页面修改

parent 1d335f0a
......@@ -92,7 +92,15 @@ INNER JOIN rb_student_hk s on a.Id =s.StudId and a.AccountType =2
/// <returns></returns>
public List<rb_account_hk_Extend> GetStuAccountList(int type,string Account)
{
string sql = $" select * from rb_account_hk where AccountType ={type} and Account IN({Account})";
string sql = $" select * from rb_account_hk where 1=1 ";
if (type > 0)
{
sql += $" AND AccountType ={type} ";
}
if (!string.IsNullOrEmpty(Account))
{
sql += $" AND Account IN({ Account}) ";
}
return Get<rb_account_hk_Extend>(sql).ToList();
}
......
......@@ -95,7 +95,8 @@ namespace EduSpider.WebApi.Controllers
var empModel = AccountService.GetEmployeeList(new EmployeeInfo() { EmployeeName = model.AccountName, EmployeeTel = model.Account })?.FirstOrDefault();
if (empModel != null )
{
if (empModel.School_Id == 2 || empModel.School_Id == 3)
//HK 2023-01-03 去掉条件 || empModel.School_Id == 3
if (empModel.School_Id == 2 )
{
return ApiResult.Failed(message: $"此账号【{ account }】未开通小程序功能!", new { Error = 2 });
}
......
......@@ -80,18 +80,26 @@ namespace EduSpider.Spiders.ClassInRule
bool flag = teacherRepository.BatchSetTeache(list.OrderBy(x => x.TeacherId).ToList());
if (flag)
{
string accountIds = "";
foreach (var item in list)
{
if (!string.IsNullOrEmpty(item.TeacherAccount))
{
accountIds += string.Format(",'{0}'", item.TeacherAccount);
}
}
//更新账户
IAccountRepository accountRepository = new AccountRepository();
//获取账户表 最大的TeacherId
int MaxTeacherId = accountRepository.GetMaxStuTeaId(type: 1);
if (list.Any(x => x.TeacherId > MaxTeacherId))
if (list.Any())
{
var teacherAccountList = accountRepository.GetStuAccountList(1, accountIds.TrimStart(','));
List<rb_account_hk> accountList = new();
foreach (var item in list.Where(x => x.TeacherId > MaxTeacherId))
foreach (var item in list)
{
var tempAccount = teacherAccountList?.FirstOrDefault(qitem => qitem.Id == item.TeacherId && qitem.Account == item.TeacherAccount && qitem.AccountId == item.TeacherUid);
accountList.Add(new rb_account_hk()
{
UniqueId = 0,
UniqueId = tempAccount?.UniqueId ?? 0,
Id = item.TeacherId,
Account = item.TeacherAccount,
AccountId = item.TeacherUid,
......
......@@ -13,9 +13,9 @@
},
//默认Token
"DefaultToken": "",
//(老账户 18140082327 ls123456) (新账号 18140082527 a123456 切换账号需要清楚Redis 3号库 ClassInCookie
"ClassInAccount": "18140082327",
"ClassInPwd": "ls123456",
//(老账户 18140082327 ls123456) (新账号 18140082527 a123456 (深圳 18948170494 a123456 切换账号需要清楚Redis 3号库 ClassInCookie
"ClassInAccount": "18948170494",
"ClassInPwd": "a123456",
//1-老账户,2-新账号
"ClassInType": "1"
"ClassInType": "3"
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment