From 844e9f148880080e71dae9fea986305899bc3f6a Mon Sep 17 00:00:00 2001 From: Frane Date: Fri, 25 Mar 2022 10:12:47 +0800 Subject: [PATCH] =?UTF-8?q?20220325=20=E6=96=B0=E5=A2=9E=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SGGL/BLL/API/APIUserService.cs | 158 ++++++++++++++++++ SGGL/FineUIPro.Web/Login.aspx | 2 +- SGGL/Model/APIItem/UserItem.cs | 40 ++++- SGGL/Model/APIItem/UserListItem.cs | 19 +++ SGGL/Model/Model.csproj | 1 + SGGL/WebAPI/Controllers/UserController.cs | 24 +++ .../PublishProfiles/FolderProfile.pubxml | 2 +- ...系统部署说明(新)20220322.docx | Bin 0 -> 2218339 bytes 8 files changed, 240 insertions(+), 6 deletions(-) create mode 100644 SGGL/Model/APIItem/UserListItem.cs create mode 100644 需求说明/诺必达施工平台系统部署说明(新)20220322.docx diff --git a/SGGL/BLL/API/APIUserService.cs b/SGGL/BLL/API/APIUserService.cs index 476b7ffb..0f500921 100644 --- a/SGGL/BLL/API/APIUserService.cs +++ b/SGGL/BLL/API/APIUserService.cs @@ -323,5 +323,163 @@ namespace BLL } } } + + #region 保存Meeting + /// + /// 保存Meeting + /// + /// 会议信息 + /// + public static string SaveUserInfo(Model.UserListItem listItem) + { + using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString)) + { + List userInfo = listItem.list; + string returnInfos = string.Empty; + int i = 0; + int rowNum = 0; + foreach (var item in userInfo) + { + i++; + string info = string.Empty; + if (string.IsNullOrEmpty(item.UnitName)) + { + info += "单位名称为空。"; + } + if (string.IsNullOrEmpty(item.UserName)) + { + info += "用户名称为空。"; + } + if (string.IsNullOrEmpty(item.Account)) + { + info += "用户账号为空。"; + } + if (string.IsNullOrEmpty(info)) + { + Model.Sys_User newUser = new Model.Sys_User + { + UserId = item.UserId, + UserCode = item.UserCode, + UserName = item.UserName, + Account = item.Account, + Password = item.Password, + IdentityCard = item.IdentityCard, + Telephone = item.Telephone, + IsPost = item.IsPost == "1" ? true : false, + IsOffice = true, + }; + #region 用户单位 + newUser.UnitId = Const.UnitId_CD; + if (!string.IsNullOrEmpty(item.UnitName) || !string.IsNullOrEmpty(item.UnitCode)) + { + var getUnit = db.Base_Unit.FirstOrDefault(x => x.UnitName == item.UnitName || x.UnitName == item.UnitName); + if (getUnit != null) + { + newUser.UnitId = getUnit.UnitId; + } + else + { + Model.Base_Unit newUnit = new Model.Base_Unit + { + UnitId = SQLHelper.GetNewID(), + UnitName = item.UnitName, + UnitCode = item.UnitCode, + }; + db.Base_Unit.InsertOnSubmit(newUnit); + db.SubmitChanges(); + newUser.UnitId = newUnit.UnitId; + } + } + #endregion + #region 用户部门 + if (!string.IsNullOrEmpty(item.DepartName)) + { + var getDepart = db.Base_Depart.FirstOrDefault(x => x.DepartName == item.DepartName); + if (getDepart != null) + { + newUser.DepartId = getDepart.DepartId; + } + else + { + Model.Base_Depart newDepart = new Model.Base_Depart + { + DepartId = SQLHelper.GetNewID(), + DepartName = item.DepartName, + }; + db.Base_Depart.InsertOnSubmit(newDepart); + db.SubmitChanges(); + newUser.DepartId = newDepart.DepartId; + } + } + #endregion + #region 用户角色 + if (!string.IsNullOrEmpty(item.RoleName)) + { + var getRole = db.Sys_Role.FirstOrDefault(x => x.RoleName == item.RoleName); + if (getRole != null) + { + newUser.RoleId = getRole.RoleId; + } + else + { + Model.Sys_Role newRole = new Model.Sys_Role + { + RoleId = SQLHelper.GetNewID(), + RoleName = item.RoleName, + }; + db.Sys_Role.InsertOnSubmit(newRole); + db.SubmitChanges(); + newUser.RoleId = newRole.RoleId; + } + } + #endregion + if (!string.IsNullOrEmpty(item.Password)) + { + newUser.Password = item.Password; + } + else + { + newUser.Password = Funs.EncryptionPassword(Const.Password); + } + var geUser = db.Sys_User.FirstOrDefault(x => (x.Account == item.Account && item.Account != null) || (x.IdentityCard == item.IdentityCard && item.IdentityCard != null)); + if (geUser != null) + { + geUser.UserCode = newUser.UserCode; + geUser.UserName = newUser.UserName; + geUser.Account = newUser.Account; + geUser.Password = newUser.Password; + geUser.IdentityCard = newUser.IdentityCard; + geUser.Telephone = newUser.Telephone; + geUser.UnitId = newUser.UnitId; + geUser.DepartId = newUser.DepartId; + geUser.RoleId = newUser.RoleId; + geUser.IsPost = newUser.IsPost; + db.SubmitChanges(); + } + else + { + newUser.UserId = SQLHelper.GetNewID(); + db.Sys_User.InsertOnSubmit(newUser); + db.SubmitChanges(); + } + rowNum++; + } + else + { + returnInfos += "第" + i.ToString() + "行," + info; + } + } + if (!string.IsNullOrEmpty(returnInfos)) + { + returnInfos = "同步成功" + rowNum.ToString() + "条记录。" + returnInfos; + } + else + { + returnInfos = "同步成功" + rowNum.ToString() + "条记录。"; + } + return returnInfos; + } + } + #endregion } } diff --git a/SGGL/FineUIPro.Web/Login.aspx b/SGGL/FineUIPro.Web/Login.aspx index de706aef..989f2368 100644 --- a/SGGL/FineUIPro.Web/Login.aspx +++ b/SGGL/FineUIPro.Web/Login.aspx @@ -14,7 +14,7 @@ src="./images/login.png" style="height: 100%; left: 0px; top: 0px; bottom: 0px; position: absolute; display: none;" /> style="height: auto;width:400px; left: 100px; top: 65px; position: absolute;" />