From c8b217f5730a49a2da2a9c3d264cec8ba51dc395 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Thu, 18 Mar 2021 18:20:04 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E7=BD=91?= =?UTF-8?q?=E4=B8=8A=E5=8A=9E=E4=BA=8B=E5=A4=A7=E5=8E=85=E6=8B=96=E6=8B=BD?= =?UTF-8?q?=E7=89=88=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=8A=9E=E4=BA=8B=E5=A4=A7?= =?UTF-8?q?=E5=8E=85=E6=A8=A1=E5=BC=8F=E9=A1=B5=E9=9D=A2=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Content/js/DragSSO/indexData.js | 9 +- .../Content/js/DragSSO/sortable.js | 5 +- .../Controllers/SSOSystemController.cs | 24 + .../Learun.Application.Web.csproj | 2 + .../Views/SSOSystem/DragModelOne.cshtml | 1669 +++++++++++++++++ .../Views/SSOSystem/_LayoutSSODrag.cshtml | 145 ++ .../SSO_Drag_DesktopManageBLL.cs | 49 +- .../SSO_Drag_DesktopManageEntity.cs | 11 +- .../SSO_Drag_DesktopManageIBLL.cs | 16 +- .../SSO_Drag_DesktopManageService.cs | 112 +- 10 files changed, 2026 insertions(+), 16 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/_LayoutSSODrag.cshtml diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js index 3aacb0b50..4aa2eae79 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/indexData.js @@ -46,12 +46,13 @@ function serializes() { var gg = $(".inSec3Row.active").sortable("serialize", { key: "sort" }); - console.log(gg);//sort=1&sort=2&sort=3&sort=4&sort=5&sort=6&sort=7&sort=8&sort=9&sort=10&sort=11&sort=12&sort=13 + //console.log(gg);//sort=1&sort=2&sort=3&sort=4&sort=5&sort=6&sort=7&sort=8&sort=9&sort=10&sort=11&sort=12&sort=13 var gg2 = $(".inSec3Row.active").sortable("toArray"); - console.log(gg2);//["id_1", "id_2", "id_3", "id_4", "id_5", "id_6", "id_7", "id_8", "id_9", "id_10", "id_11", "id_12", "id_13"] - console.log(gg2.toString());//id_1,id_2,id_3,id_4,id_5,id_6,id_7,id_8,id_9,id_10,id_11,id_12,id_13 - console.log(gg2.toString().replace(new RegExp("id_","g"),""));//1,2,3,4,5,6,7,8,9,10,11,12,13 + //console.log(gg2);//["id_1", "id_2", "id_3", "id_4", "id_5", "id_6", "id_7", "id_8", "id_9", "id_10", "id_11", "id_12", "id_13"] + //console.log(gg2.toString());//id_1,id_2,id_3,id_4,id_5,id_6,id_7,id_8,id_9,id_10,id_11,id_12,id_13 + //console.log(gg2.toString().replace(new RegExp("id_","g"),""));//1,2,3,4,5,6,7,8,9,10,11,12,13 + //console.log(gg2.toString().replace(/id_/g, ""));//1,2,3,4,5,6,7,8,9,10,11,12,13 } //初始化可用卡片 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js index 0e5f715e7..ea1893ac4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/js/DragSSO/sortable.js @@ -3,7 +3,7 @@ $(document).ready(function(){ $('.inSec1Drag').on('click', '.fa-minus', function() { //删除 $(this).removeClass('fa-minus').addClass('fa-plus'); - var id = '#id_' + $(this).parent().attr('id'); + var id = '#' + $('.inSec3Row.active').attr('ind') + '_' + $(this).parent().attr('id'); // console.log($('.inSec3Row').find(id)) $('.inSec3Row.active').find(id).remove(); layer.msg('删除成功!'); @@ -18,7 +18,8 @@ $(document).ready(function(){ } //添加 $(this).removeClass('fa-plus').addClass('fa-minus'); - var id = 'id_' + $(this).parent().attr('id'); + //点击卡片,增加相同的卡片块 + var id = 'id_' + $(this).parent().attr('id'); var html = '
' + '
' + '
' + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs index 6b331e6a1..b7d10f7cd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Controllers/SSOSystemController.cs @@ -16,6 +16,7 @@ using System.Web.Mvc; using Learun.Cache.Base; using Learun.Cache.Factory; using Newtonsoft.Json; +using Learun.Application.TwoDevelopment.LR_Desktop; namespace Learun.Application.Web.Controllers { @@ -37,6 +38,7 @@ namespace Learun.Application.Web.Controllers private Sys_ReceiveFileIBLL sys_ReceiveFileIBLL = new Sys_ReceiveFileBLL(); private Perm_FunctionVisitIBLL functionVisitIbll = new Perm_FunctionVisitBLL(); private ICache redisCache = CacheFactory.CaChe(); + private SSO_Drag_DesktopManageIBLL sSO_Drag_DesktopManageIBLL = new SSO_Drag_DesktopManageBLL(); #region 统一身份认证2.0 /// @@ -854,6 +856,28 @@ namespace Learun.Application.Web.Controllers /// public ActionResult DragModelOne() { + //判断登录状态码 + string account = ""; + if (!Request.Headers["account"].IsEmpty()) + { + account = Request.Headers["account"].ToString(); + } + OperatorHelper helper = new OperatorHelper(); + var result = helper.IsOnLine(account); + if (result.stateCode != 1) + { + return Redirect("DragNoLogin"); + } + //桌面管理表、卡片块排序管理表增加默认数据 + var userInfo = LoginUserInfo.Get(); + sSO_Drag_DesktopManageIBLL.AddDefaultData(userInfo.userId, "one"); + //获取桌面、卡片块排序列表 + ViewBag.DesktopList = sSO_Drag_DesktopManageIBLL.GetListByModelCode(userInfo.userId, "one").OrderBy(x => x.Sort); + ViewBag.DesktopListStr = JsonConvert.SerializeObject(ViewBag.DesktopList); + + + + return View(); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index b28cba3eb..d1ec68e8e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -7161,6 +7161,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml new file mode 100644 index 000000000..3b3a03915 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/DragModelOne.cshtml @@ -0,0 +1,1669 @@ +@using Learun.Application.OA +@using Learun.Application.Base.SystemModule +@using Learun.Application.TwoDevelopment.EducationalAdministration +@using Learun.Application.TwoDevelopment.Permission +@using Learun.Application.WorkFlow +@using Learun.Util + +@{ + ViewBag.Title = "网上办事大厅拖拽版"; + Layout = "~/Views/SSOSystem/_LayoutSSODrag.cshtml"; +} + + + + +
+ + + + +
+
+
+
+ + +
+
我的收藏
+
+
+
+ + +
+
可用应用
+
+
+
+ + +
+
可用卡片
+
+
+
+
+ +
+
+
+ + 我的收藏 +
+
+ + 可用应用 +
+
+ + 可用卡片 +
+
+
+ +
+
+ + +
+
+
+
+ + +
+
待办任务
+
+
+
+ + +
+
我发起的
+
+
+
+ + +
+
周期服务
+
+
+
+ + +
+
未读消息
+
+
+
+
+ +
+
+
+ + 任务 +
+
+ + 消息 +
+
+
+
+
+
+
    +
  • + 3 + 待办任务 +
  • +
  • + 3 + 我发起的 +
  • +
  • + 3 + 周期服务 +
  • +
  • + 3 + 已办任务 +
  • +
+
+
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
请处理
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
请处理
+
+
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
已完成
+
+
+
+
+
+
暂时没有数据
+
+
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
已完成
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+
教师桌面
+
+
+
+
OA办公桌面
+
+
+
+
+ +
+
+
+ +
+
+
+
+
+
+
+ 数据看板 + +
+
+
+
+
+ +
+ 校园一卡通余额 +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 红湖付款码余额 +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 图书馆借阅(未还) +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 已完成办公事项 +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 智慧教育在线学习时长 +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 办公业务往来人员 +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 来往邮件数量 +
+
+ ¥ 98.6 +
+
+
+
+
+ +
+ 累计在线时长 +
+
+ ¥ 98.6 +
+
+
+
+
+
+
+
+ 办公事项 + +
+
+
+
    +
  • +
    + +
    + 待办任务 + 10 +
  • +
  • +
    + +
    + 已办任务 +
  • +
  • +
    + +
    + 我发起的 +
  • +
+
+
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
请处理
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
请处理
+
+
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
请处理
+
+
+
+
+
刘艳的出差申请审批
+
2020-09-01 10:25:36
+
请处理
+
+
+
+
+
+
+ +
+
+
+ 专业总览 + +
+
+
+
+
班级总数
+
12
+
+
+
专业学生
+
252
+
+
+
专业教室
+
97
+
+
+
+
+
+
+
+ 常用链接 + +
+
+
+
    +
  • +
    + +
    + 系统直通 + 3 +
  • +
  • +
    + +
    + 系统链接 +
  • +
  • +
    + +
    + 网站链接 +
  • +
+
+ +
+
+
+
+
+
+ 常用服务 + +
+
+
+
    +
  • +
    + +
    + 校级服务 + 3 +
  • +
  • +
    + +
    + 人事微服务 + 3 +
  • +
  • +
    + +
    + 教育微服务 + 3 +
  • +
  • +
    + 公共微服务 + 3 +
  • +
  • +
    + 研究生微服务 + 3 +
  • +
  • +
    + 科研微服务 + 3 +
  • +
  • +
    + 教科研微服务 + 3 +
  • +
+
+
+ + + +
+
+
+
暂时没有数据
+
+
+
+
+
+
暂时没有数据
+
+
+
+
+
+
暂时没有数据
+
+
+
+
+
+
暂时没有数据
+
+
+
+
+
+
+
+
+
+ 校园总览 + +
+
+
+
+ + 专业总数 +
+
+ 27 +
+
+
+
+ + 班级总数 +
+
+ 27 +
+
+
+
+ + 在校学生 +
+
+ 27 +
+
+
+
+ + 在校教师 +
+
+ 27 +
+
+
+
+ + 在用教室 +
+
+ 27 +
+
+
+
+ + 在用实验室 +
+
+ 27 +
+
+
+
+
+ + + +
+
+
+ 智慧教育 + +
+ +
+
+ + @{ + if (1 == 1) + { + + } + } + + + +
+
+
+ 办公业务流量 + +
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
从左侧选择需要的应用卡片
+
+
+
+
+
+
+
+
+
+ + +
+
+
+ +
桌面设置
+
0/3 个自建桌面
+
+
+ +
+
教师桌面(默认桌面)
+
+ + 8/8 +
+
+ +
+ 确认恢复默认设置? +
+ +
+
+ +
+
+
+
+ +
+
OA桌面(默认桌面)
+
+ + 8/8 +
+
+ +
+ 确认恢复默认设置? +
+ +
+
+ +
+
+
+
+
+ +
+
新建桌面
+
+ + 8/8 +
+
+
+ 保存该桌面? +
+ +
+
+ +
+
+
+
完成
+
+
+ + +
+
+
+ +
+
+ +
+ + + + + +@**@ + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/_LayoutSSODrag.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/_LayoutSSODrag.cshtml new file mode 100644 index 000000000..5ee1f16e4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Views/SSOSystem/_LayoutSSODrag.cshtml @@ -0,0 +1,145 @@ +@using Learun.Util + + + + + + + + + + 网上办事大厅拖拽版 + + + + + + + + + + + + + + + + + + + + + + + + + + @{ + var logininfo = LoginUserInfo.Get(); + if (logininfo == null) + { + logininfo = new UserInfo(); + } + } +
+ +
    +
  • +
+
数字化智慧校园
+
+ +
+
+
历史
+
+
关闭搜索
+
+
+ + +
+
+
@logininfo.realName
+
+
+
工号 @logininfo.account
+
@logininfo.departmentName @logininfo.roleName
+
+ +
+
+ +
+
皮肤
+
+
+
+ +
+
选用皮肤
+
+ + 使用中 +
+
+
+
+
+ +
+
选用皮肤
+
+ + 使用中 +
+
+
+
+
+ +
绿
+
选用皮肤
+
+ + 使用中 +
+
+
+
+
+
+
+
+ + 飞星下载 +
+
+
+ @RenderBody() + @Html.AppendJsFile( + "/Views/LR_Content/script/lr-base.js", + "/Views/LR_Content/script/lr-clientdata.js", + "/Views/LR_Content/script/lr-ajax.js" + ) + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageBLL.cs index 4bd217abe..2338f8a96 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageBLL.cs @@ -90,7 +90,29 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } } - + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + public IEnumerable GetListByModelCode(string userId, string modelCode) + { + try + { + return sSO_Drag_DesktopManageService.GetListByModelCode(userId, modelCode); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 @@ -142,6 +164,31 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + /// + /// 桌面管理表、卡片块排序管理表增加默认数据 + /// 用户ID + /// 模式编号 + /// + public void AddDefaultData(string userId, string modelCode) + { + try + { + sSO_Drag_DesktopManageService.AddDefaultData(userId, modelCode); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageEntity.cs index 0890b22e6..1bd7f7af6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageEntity.cs @@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 日 期:2021-03-18 09:47 /// 描 述:网上办事大厅拖拽版-桌面管理 ///
- public class SSO_Drag_DesktopManageEntity + public class SSO_Drag_DesktopManageEntity { #region 实体成员 /// @@ -27,7 +27,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop [Column("USERID")] public string UserId { get; set; } /// - /// 模式编号:0办事大厅模式,1效率优先模式,2管理驾驶舱模式 + /// 模式编号:one办事大厅模式,two效率优先模式,three管理驾驶舱模式 /// /// [Column("MODELCODE")] @@ -69,6 +69,13 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop this.Id = keyValue; } #endregion + #region 扩展数据 + /// + /// 卡片块排序 + /// + [NotMapped] + public string CardSort { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageIBLL.cs index 41f2594e8..5621e801f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageIBLL.cs @@ -20,7 +20,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// /// 查询参数 /// - IEnumerable GetList( string queryJson ); + IEnumerable GetList(string queryJson); /// /// 获取列表分页数据 /// @@ -34,6 +34,12 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 主键 /// SSO_Drag_DesktopManageEntity GetEntity(string keyValue); + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + IEnumerable GetListByModelCode(string userId, string modelCode); #endregion #region 提交数据 @@ -49,6 +55,14 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 主键 /// 实体 void SaveEntity(string keyValue, SSO_Drag_DesktopManageEntity entity); + + + /// + /// 桌面管理表、卡片块排序管理表增加默认数据 + /// 用户ID + /// 模式编号 + /// + void AddDefaultData(string userId, string modelCode); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageService.cs index 0e03af697..4612da61a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/SSO_Drag_DesktopManage/SSO_Drag_DesktopManageService.cs @@ -25,7 +25,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop ///
public SSO_Drag_DesktopManageService() { - fieldSql=@" + fieldSql = @" t.Id, t.UserId, t.ModelCode, @@ -43,7 +43,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// /// 条件参数 /// - public IEnumerable GetList( string queryJson ) + public IEnumerable GetList(string queryJson) { try { @@ -53,9 +53,8 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop //var dp = new DynamicParameters(new { }); //dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(fieldSql); - strSql.Append(" FROM SSO_Drag_DesktopManage t "); + strSql.Append("SELECT t.*,c.CardSort "); + strSql.Append(" FROM SSO_Drag_DesktopManage t left join SSO_Drag_CardSortManage c on t.Id=c.DesktopId "); return this.BaseRepository().FindList(strSql.ToString()); } catch (Exception ex) @@ -123,6 +122,33 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } } + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + public IEnumerable GetListByModelCode(string userId, string modelCode) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT t.*,c.CardSort "); + strSql.Append(" FROM SSO_Drag_DesktopManage t left join SSO_Drag_CardSortManage c on t.Id=c.DesktopId "); + strSql.Append(" where t.UserId='" + userId + "' and t.ModelCode='" + modelCode + "' "); + return this.BaseRepository().FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion @@ -136,7 +162,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { try { - this.BaseRepository().Delete(t=>t.Id == keyValue); + this.BaseRepository().Delete(t => t.Id == keyValue); } catch (Exception ex) { @@ -184,6 +210,80 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + /// + /// 桌面管理表、卡片块排序管理表增加默认数据 + /// 用户ID + /// 模式编号 + /// + public void AddDefaultData(string userId, string modelCode) + { + var db = this.BaseRepository().BeginTrans(); + try + { + //判断用户是否存在默认数据:不存在则增加; + var desktopEntity = db.FindEntity(x => x.UserId == userId && x.ModelCode == modelCode && x.DesktopCode == "teacherDesktop"); + if (desktopEntity == null) + { + //默认数据为:教师桌面(卡片块排序为:card1,card2,card3,card4,card5,card6,card7,card8,card9,card10,card11,card12,card13)、OA办公桌面()、 + var desktopModel1 = new SSO_Drag_DesktopManageEntity() + { + UserId = userId, + ModelCode = modelCode, + DesktopName = "教师桌面", + DesktopCode = "teacherDesktop", + Sort = "0" + }; + desktopModel1.Create(); + db.Insert(desktopModel1); + var desktopModel2 = new SSO_Drag_DesktopManageEntity() + { + UserId = userId, + ModelCode = modelCode, + DesktopName = "OA办公桌面", + DesktopCode = "workDesktop", + Sort = "1" + }; + desktopModel2.Create(); + db.Insert(desktopModel2); + var cardSortModel1 = new SSO_Drag_CardSortManageEntity() + { + UserId = userId, + ModelCode = modelCode, + DesktopId = desktopModel1.Id, + CardSort = "card1,card2,card3,card4,card5,card6,card7,card8,card9,card10,card11,card12,card13" + }; + cardSortModel1.Create(); + db.Insert(cardSortModel1); + var cardSortModel2 = new SSO_Drag_CardSortManageEntity() + { + UserId = userId, + ModelCode = modelCode, + DesktopId = desktopModel2.Id, + CardSort = "" + }; + cardSortModel2.Create(); + db.Insert(cardSortModel2); + + } + + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion }