瀏覽代碼

党政办管理 目录管理功能

怀来职教中心中职
ndbs 1 年之前
父節點
當前提交
47f93bd7b5
共有 15 個文件被更改,包括 125 次插入197 次删除
  1. +0
    -13
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyCateController.cs
  2. +12
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyManageController.cs
  3. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.cshtml
  4. +3
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.js
  5. +7
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Index.js
  6. +2
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.cshtml
  7. +10
    -10
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.js
  8. +0
    -39
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateBLL.cs
  9. +0
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateIBLL.cs
  10. +11
    -23
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateService.cs
  11. +0
    -75
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyCateEntity.cs
  12. +39
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageBLL.cs
  13. +3
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageEntity.cs
  14. +3
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageIBLL.cs
  15. +32
    -21
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageService.cs

+ 0
- 13
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyCateController.cs 查看文件

@@ -85,19 +85,6 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
var data = partyCateIBLL.GetEntity(keyValue);
return Success(data);
}

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetTree(string CType)
{
var data = partyCateIBLL.GetTree(CType);
return Success(data);
}

/// <summary>
/// 获取字典分类列表(树结构)
/// </summary>


+ 12
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/PartyManageController.cs 查看文件

@@ -79,6 +79,18 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers
};
return Success(jsonData);
}

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetTree(string CType)
{
var data = partyManageIBLL.GetTree(CType);
return Success(data);
}
#endregion

#region 提交数据


+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.cshtml 查看文件

@@ -3,15 +3,15 @@
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item">
<div class="col-xs-12 lr-form-item" data-table="PartyCate">
<div class="lr-form-item-title">上级</div>
<div id="CParentId"></div>
</div>
<div class="col-xs-12 lr-form-item">
<div class="col-xs-12 lr-form-item" data-table="PartyCate">
<div class="lr-form-item-title">名称<font face="宋体">*</font></div>
<input id="Name" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item">
<div class="col-xs-12 lr-form-item" data-table="PartyCate">
<div class="lr-form-item-title">排序<font face="宋体">*</font></div>
<input id="COrder" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>


+ 3
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Form.js 查看文件

@@ -4,16 +4,17 @@
* 日 期:2023-08-03 17:25
* 描 述:PartyCate
*/
var acceptClick;
var parentId = request('parentId');
var CType = request('CType');
var selectedRow = top.layer_ClassifyIndex.selectedRow;
var keyValue = request('keyValue');
var acceptClick;
var bootstrap = function ($, learun) {
"use strict";
var selectedRow = learun.frameTab.currentIframe().selectedRow;
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
@@ -47,8 +48,6 @@ var bootstrap = function ($, learun) {
learun.alert.error('上级不能是自己本身');
return false;
}
var postData = $('#form').lrGetFormData();
Console.log(postData,"postData")
$.lrSaveForm(top.$.rootUrl + '/PersonnelManagement/PartyCate/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {


+ 7
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyCate/Index.js 查看文件

@@ -4,8 +4,9 @@
* 日 期:2023-08-03 17:25
* 描 述:PartyCate
*/
var selectedRow;
var refreshGirdData;
var selectedRow;
var CType = request('CType');
var bootstrap = function ($, learun) {
"use strict";
var page = {
@@ -25,11 +26,12 @@ var bootstrap = function ($, learun) {
});
// 新增
$('#lr_add').on('click', function () {
var ID = $('#gridtable').jfGridValue('ID');
selectedRow = null;
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Form',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Form?parentId=' + ID + '&CType=' + CType,
width: 400,
height: 300,
callBack: function (id) {
@@ -39,13 +41,13 @@ var bootstrap = function ($, learun) {
});
// 编辑
$('#lr_edit').on('click', function () {
selectedRow = $('#gridtable').jfGridGet('rowdata');
var keyValue = $('#gridtable').jfGridValue('ID');
selectedRow = $('#gridtable').jfGridGet('rowdata');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Form?keyValue=' + keyValue,
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Form?keyValue=' + keyValue + '&CType=' + CType,
width: 400,
height: 300,
callBack: function (id) {
@@ -70,10 +72,9 @@ var bootstrap = function ($, learun) {
},
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/GetPageList',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/GetClassifyList?CType=' + CType,
headData: [
{ label: '名称', name: 'Name', width: 200, align: "left" },
{ label: '排序', name: 'COrder', width: 200, align: "left" },
],
mainId: 'ID',
sidx: 'COrder desc',


+ 2
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.cshtml 查看文件

@@ -28,8 +28,9 @@
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_category" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;目录管理</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
<a id="lr_category" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;目录管理</a>
<a id="lr_statistics" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;访问情况统计</a>
</div>
</div>
</div>


+ 10
- 10
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/PartyManage/Index.js 查看文件

@@ -22,10 +22,10 @@ var bootstrap = function ($, learun) {
}
// 初始化左侧树形数据
$('#dataTree').lrtree({
url: top.$.rootUrl + '/PersonnelManagement/PartyCateList/GetTree?CType=' + CType,
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/GetTree?CType=' + CType,
nodeClick: function (item) {
selectedId = item.value;
page.search({ CId: item.value });
page.search({ CateId: item.value });
}
});
// 时间搜索框
@@ -53,7 +53,7 @@ var bootstrap = function ($, learun) {
startTime = begin;
endTime = end;
if (selectedId) {
page.search({ CId: selectedId });
page.search({ CateId: selectedId });
}
}
});
@@ -63,7 +63,7 @@ var bootstrap = function ($, learun) {
});
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
if (selectedId) {
queryJson.CId = selectedId;
queryJson.CateId = selectedId;
page.search(queryJson);
}
}, 220, 400);
@@ -112,7 +112,7 @@ var bootstrap = function ($, learun) {
/*分类管理*/
$('#lr_category').on('click', function () {
learun.layerForm({
id: 'TypeIndex',
id: 'ClassifyIndex',
title: '分类管理',
url: top.$.rootUrl + '/PersonnelManagement/PartyCate/Index?CType=' + CType,
width: 800,
@@ -147,10 +147,10 @@ var bootstrap = function ($, learun) {
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/PersonnelManagement/PartyManage/GetPageList',
headData: [
{ label: "所属分类", name: "CateId", width: 100, align: "left",
{ label: "所属分类", name: "CateId", width: 200, align: "left",
formatterAsync: function (callback, value, row, op,$cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'partycate',
@@ -161,9 +161,9 @@ var bootstrap = function ($, learun) {
}
});
}},
{ label: "标题", name: "Title", width: 100, align: "left"},
{ label: "标题", name: "Title", width: 200, align: "left"},
{
label: "附件上传", name: "Filepath", width: 100, align: "left"
label: "附件上传", name: "Filepath", width: 200, align: "left"
, formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData',
{
@@ -194,7 +194,7 @@ var bootstrap = function ($, learun) {
};
refreshGirdData = function () {
if (selectedId) {
page.search({ CId: selectedId });
page.search({ CateId: selectedId });
}
//$('#gridtable').jfGridSet('reload');
};


+ 0
- 39
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateBLL.cs 查看文件

@@ -91,45 +91,6 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
public List<TreeModel> GetTree(string CType)
{
try
{
DataTable list = partyCateService.GetSqlTree(CType);
List<TreeModel> treeList = new List<TreeModel>();
foreach (DataRow item in list.Rows)
{
TreeModel node = new TreeModel
{
id = item["cid"].ToString(),
text = item["cname"].ToString(),
value = item["cid"].ToString(),
showcheck = false,
checkstate = 0,
isexpand = true,
parentId = item["cparentid"].ToString()
};
treeList.Add(node);
}
return treeList.ToTree();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 分类列表
/// </summary>


+ 0
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateIBLL.cs 查看文件

@@ -35,7 +35,6 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <returns></returns>
PartyCateEntity GetEntity(string keyValue);

List<TreeModel> GetTree(string CType);

List<TreeModel> GetClassifyTree(string CType);
List<PartyCateEntity> GetClassifyList(string keyword, string CType);


+ 11
- 23
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyCate/PartyCateService.cs 查看文件

@@ -34,7 +34,16 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
strSql.Append("SELECT ");
strSql.Append(" t.* ");
strSql.Append(" FROM PartyCate t ");
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(), pagination);
strSql.Append(" where 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["CateId"].IsEmpty())
{
dp.Add("CateId", queryParam["CateId"].ToString(), DbType.String);
strSql.Append(" AND t.CateId = @CateId ");
}
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
@@ -73,28 +82,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 获取树形数据
/// </summary>
/// <returns></returns>
public DataTable GetSqlTree(string CType)
{
try
{
return this.BaseRepository("CollegeMIS").FindTable($" SELECT * FROM dbo.PartyCate WHERE CType='{CType}' ");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}


public List<PartyCateEntity> GetList(string CType)
{


+ 0
- 75
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyCateEntity.cs 查看文件

@@ -1,75 +0,0 @@
using Learun.Util;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2023-07-31 16:59
/// 描 述:党政办管理
/// </summary>
public class PartyCateEntity
{
#region 实体成员
/// <summary>
/// ID
/// </summary>
[Column("ID")]
public string ID { get; set; }
/// <summary>
/// Name
/// </summary>
[Column("NAME")]
public string Name { get; set; }
/// <summary>
/// Creator
/// </summary>
[Column("CREATOR")]
public string Creator { get; set; }
/// <summary>
/// Createtime
/// </summary>
[Column("CREATETIME")]
public DateTime? Createtime { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.ID = Guid.NewGuid().ToString();
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.ID = keyValue;
}
#endregion
#region 扩展字段
/// <summary>
/// 所属分类
/// </summary>
[NotMapped]
public string CateId { get; set; }
/// <summary>
/// 标题
/// </summary>
[NotMapped]
public string Title { get; set; }
/// <summary>
/// 附件上传
/// </summary>
[NotMapped]
public string Filepath { get; set; }
#endregion
}
}


+ 39
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageBLL.cs 查看文件

@@ -91,6 +91,45 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 获取左侧树形数据
/// <summary>
/// <returns></returns>
public List<TreeModel> GetTree(string CType)
{
try
{
DataTable list = partyManageService.GetSqlTree(CType);
List<TreeModel> treeList = new List<TreeModel>();
foreach (DataRow item in list.Rows)
{
TreeModel node = new TreeModel
{
id = item["id"].ToString(),
text = item["name"].ToString(),
value = item["id"].ToString(),
showcheck = false,
checkstate = 0,
isexpand = true,
parentId = item["cparentid"].ToString()
};
treeList.Add(node);
}
return treeList.ToTree();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

#region 提交数据


+ 3
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageEntity.cs 查看文件

@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// 日 期:2023-07-31 16:59
/// 描 述:党政办管理
/// </summary>
public class PartyManageEntity
public class PartyManageEntity
{
#region 实体成员
/// <summary>
@@ -49,6 +49,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// </summary>
[Column("FILEPATH")]
public string Filepath { get; set; }
[Column("CTYPE")]
public string CType { get; set; }
#endregion

#region 扩展操作


+ 3
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageIBLL.cs 查看文件

@@ -33,6 +33,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// <param name="keyValue">主键</param>
/// <returns></returns>
PartyCateEntity GetPartyCateEntity(string keyValue);

List<TreeModel> GetTree(string CType);

#endregion

#region 提交数据


+ 32
- 21
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/PartyManage/PartyManageService.cs 查看文件

@@ -31,24 +31,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.ID,
t1.CateId,
t1.Title,
t1.Filepath
");
strSql.Append(" FROM PartyCate t ");
strSql.Append(" LEFT JOIN PartyManage t1 ON t1.CateId = t.ID ");
strSql.Append(@"t.* ");
strSql.Append(" FROM PartyManage t");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["CateId"].IsEmpty())
{
dp.Add("CateId",queryParam["CateId"].ToString(), DbType.String);
strSql.Append(" AND t.CateId = @CateId ");
}
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(),dp, pagination);
return this.BaseRepository("CollegeMIS").FindList<PartyCateEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
@@ -72,7 +61,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<PartyManageEntity>(t=>t.CateId == keyValue);
return this.BaseRepository("CollegeMIS").FindEntity<PartyManageEntity>(t => t.CateId == keyValue);
}
catch (Exception ex)
{
@@ -111,6 +100,28 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
}
}

/// <summary>
/// 获取树形数据
/// </summary>
/// <returns></returns>
public DataTable GetSqlTree(string CType)
{
try
{
return this.BaseRepository("CollegeMIS").FindTable($" SELECT * FROM dbo.PartyCate WHERE CType='{CType}' ");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 提交数据
@@ -124,9 +135,9 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
var partyCateEntity = GetPartyCateEntity(keyValue);
db.Delete<PartyManageEntity>(t=>t.CateId == partyCateEntity.ID);
db.Delete<PartyCateEntity>(t=>t.ID == keyValue);
var partyCateEntity = GetPartyCateEntity(keyValue);
db.Delete<PartyManageEntity>(t => t.CateId == partyCateEntity.ID);
db.Delete<PartyCateEntity>(t => t.ID == keyValue);
db.Commit();
}
catch (Exception ex)
@@ -148,17 +159,17 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
public void SaveEntity(string keyValue, PartyCateEntity entity,PartyManageEntity partyManageEntity)
public void SaveEntity(string keyValue, PartyCateEntity entity, PartyManageEntity partyManageEntity)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
if (!string.IsNullOrEmpty(keyValue))
{
var partyCateEntityTmp = GetPartyCateEntity(keyValue);
var partyCateEntityTmp = GetPartyCateEntity(keyValue);
entity.Modify(keyValue);
db.Update(entity);
db.Delete<PartyManageEntity>(t=>t.CateId == partyCateEntityTmp.ID);
db.Delete<PartyManageEntity>(t => t.CateId == partyCateEntityTmp.ID);
partyManageEntity.Create();
partyManageEntity.CateId = partyCateEntityTmp.ID;
db.Insert(partyManageEntity);


Loading…
取消
儲存