public (DataTable failDt, int snum, int fnum) ExecuteImportExcel(DataTable dt,string fileGuid)
public (DataTable failDt, int snum, int fnum) ExecuteImportExcel(DataTable dt,string fileGuid)
{
int snum = 0;
int fnum = 0;
@@ -1944,7 +1944,9 @@ where ID='{ParentID}'
}
failDt.Columns.Add("导入错误", typeof(string));
dt.Columns.Add("导入错误", typeof(string));
var dic = new Dictionary<string, string>();
//寝室Id
var dormitoryIds = new List<string>();
var user = LoginUserInfo.Get();
foreach (DataRow dr in dt.Rows)
{
@@ -2093,6 +2095,8 @@ where ID='{ParentID}'
dormitoryBuildList.Add(dormitory);
}
dormitoryIds.Add(dormitory.ID);
//床位
var bedName = dr["床位"].ToString().Trim();
var bedCode = bedName.Replace("床", "").Replace("号", "");
@@ -2138,7 +2142,16 @@ where ID='{ParentID}'
}
}
db.Commit();
//更新寝室入住人数字段
var ids = string.Join("','", dormitoryIds);
var sql = $@" update a set a.CheckInStu=b.num
from Acc_DormitoryBuild a join (select parentid,count(1) as num from Acc_DormitoryBuild where buildtype='5' and studentid is not null and len(studentid)>0 and parentid in ('{ids}') group by parentid) b