@@ -0,0 +1,130 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using Learun.Application.TwoDevelopment.LogisticsManagement; | |||
using System.Web.Mvc; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 17:36 | |||
/// 描 述:项目阶段管理 | |||
/// </summary> | |||
public class ProjectPhaseManageController : MvcControllerBase | |||
{ | |||
private ProjectPhaseManageIBLL projectPhaseManageIBLL = new ProjectPhaseManageBLL(); | |||
#region 视图功能 | |||
/// <summary> | |||
/// 主页面 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = projectPhaseManageIBLL.GetPageList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var ProjectPhaseManageData = projectPhaseManageIBLL.GetProjectPhaseManageEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
ProjectPhaseManage = ProjectPhaseManageData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取左侧树形数据 | |||
/// </summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetTree() | |||
{ | |||
var data = projectPhaseManageIBLL.GetList("{\"IsEnabled\":\"true\"}").OrderBy(x => x.Sort); | |||
return Success(projectPhaseManageIBLL.GetTree(data)); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
projectPhaseManageIBLL.DeleteEntity(keyValue); | |||
return Success("删除成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
ProjectPhaseManageEntity entity = strEntity.ToObject<ProjectPhaseManageEntity>(); | |||
projectPhaseManageIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
return Success("保存成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
ViewBag.Title = "项目阶段管理"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="ProjectPhaseManage" > | |||
<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" data-table="ProjectPhaseManage" > | |||
<div class="lr-form-item-title">项目阶段编号<font face="宋体">*</font></div> | |||
<input id="Code" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ProjectPhaseManage" > | |||
<div class="lr-form-item-title">排序号</div> | |||
<input id="Sort" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ProjectPhaseManage" > | |||
<div class="lr-form-item-title">是否启用<font face="宋体">*</font></div> | |||
<div id="IsEnabled" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="ProjectPhaseManage" > | |||
<div class="lr-form-item-title">备注</div> | |||
<textarea id="Remark" class="form-control" style="height:100px;" ></textarea> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ProjectPhaseManage/Form.js") |
@@ -0,0 +1,51 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-18 17:36 | |||
* 描 述:项目阶段管理 | |||
*/ | |||
var acceptClick; | |||
var keyValue = request('keyValue'); | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
$('.lr-form-wrap').lrscroll(); | |||
page.bind(); | |||
page.initData(); | |||
}, | |||
bind: function () { | |||
$('#IsEnabled').lrDataItemSelect({ code: 'YesOrNoBit' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/GetFormData?keyValue=' + keyValue, function (data) { | |||
for (var id in data) { | |||
if (!!data[id].length && data[id].length > 0) { | |||
$('#' + id ).jfGridSet('refreshdata', data[id]); | |||
} | |||
else { | |||
$('[data-table="' + id + '"]').lrSetFormData(data[id]); | |||
} | |||
} | |||
}); | |||
} | |||
} | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
if (!$('body').lrValidform()) { | |||
return false; | |||
} | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,40 @@ | |||
@{ | |||
ViewBag.Title = "项目阶段管理"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">阶段名称</div> | |||
<input id="Name" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">阶段编号</div> | |||
<input id="Code" type="text" class="form-control" /> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/LogisticsManagement/Views/ProjectPhaseManage/Index.js") |
@@ -0,0 +1,97 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-06-18 17:36 | |||
* 描 述:项目阶段管理 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/Form', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
}); | |||
// 编辑 | |||
$('#lr_edit').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
url: top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/Form?keyValue=' + keyValue, | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
} | |||
}); | |||
} | |||
}); | |||
// 删除 | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('Id'); | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/DeleteForm', { keyValue: keyValue }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
url: top.$.rootUrl + '/LogisticsManagement/ProjectPhaseManage/GetPageList', | |||
headData: [ | |||
{ label: "项目阶段名称", name: "Name", width: 200, align: "left" }, | |||
{ label: "项目阶段编号", name: "Code", width: 200, align: "left" }, | |||
{ label: "排序号", name: "Sort", width: 100, align: "left" }, | |||
{ | |||
label: "是否启用", name: "IsEnabled", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
{ label: "备注", name: "Remark", width: 100, align: "left" }, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sidx:'Sort' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -357,6 +357,7 @@ | |||
<Compile Include="Areas\EducationalAdministration\EducationalAdministrationAreaRegistration.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\APAppointmentPsychologistController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\CompanyNewsController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\Controllers\ProjectPhaseManageController.cs" /> | |||
<Compile Include="Areas\LogisticsManagement\LogisticsManagementAreaRegistration.cs" /> | |||
<Compile Include="Areas\LR_AuthorizeModule\Controllers\AuthorizeController.cs" /> | |||
<Compile Include="Areas\LR_AuthorizeModule\Controllers\FilterIPController.cs" /> | |||
@@ -1197,6 +1198,8 @@ | |||
<Content Include="Areas\LogisticsManagement\Views\APAppointmentPsychologist\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\CompanyNews\Form.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\CompanyNews\Index.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectPhaseManage\Form.js" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectPhaseManage\Index.js" /> | |||
<Content Include="Areas\LR_AuthorizeModule\Views\Authorize\AppForm.js" /> | |||
<Content Include="Areas\LR_AuthorizeModule\Views\Authorize\Form.css" /> | |||
<Content Include="Areas\LR_AuthorizeModule\Views\Authorize\Form.js" /> | |||
@@ -7308,6 +7311,8 @@ | |||
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_PayManage\FormPublic.cshtml" /> | |||
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_IncomeManage\Form2.cshtml" /> | |||
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_IncomeManage\Form3.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectPhaseManage\Form.cshtml" /> | |||
<Content Include="Areas\LogisticsManagement\Views\ProjectPhaseManage\Index.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile1.pubxml" /> | |||
@@ -98,6 +98,7 @@ | |||
<Compile Include="EvaluationTeach\Eval_QuestionItemsMap.cs" /> | |||
<Compile Include="EvaluationTeach\Eval_QuestionMap.cs" /> | |||
<Compile Include="EvaluationTeach\Eval_QuestionResultMap.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectPhaseManageMap.cs" /> | |||
<Compile Include="LR_App\DTImgMap.cs" /> | |||
<Compile Include="LR_App\FunctionMap.cs" /> | |||
<Compile Include="LR_App\FunctionSchemeMap.cs" /> | |||
@@ -0,0 +1,29 @@ | |||
using Learun.Application.TwoDevelopment.LogisticsManagement; | |||
using System.Data.Entity.ModelConfiguration; | |||
namespace Learun.Application.Mapping | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 17:36 | |||
/// 描 述:项目阶段管理 | |||
/// </summary> | |||
public class ProjectPhaseManageMap : EntityTypeConfiguration<ProjectPhaseManageEntity> | |||
{ | |||
public ProjectPhaseManageMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("PROJECTPHASEMANAGE"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -248,6 +248,10 @@ | |||
<Compile Include="Feixing\UserModel.cs" /> | |||
<Compile Include="LogisticsManagement\APAppointmentPsychologist\APAppointmentPsychologistEntity.cs" /> | |||
<Compile Include="LogisticsManagement\CompanyNews\CompanyNewsEntity.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectPhaseManage\ProjectPhaseManageBLL.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectPhaseManage\ProjectPhaseManageEntity.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectPhaseManage\ProjectPhaseManageIBLL.cs" /> | |||
<Compile Include="LogisticsManagement\ProjectPhaseManage\ProjectPhaseManageService.cs" /> | |||
<Compile Include="LR_CodeDemo\GantProject\GantProjectBLL.cs" /> | |||
<Compile Include="LR_CodeDemo\GantProject\GantProjectIBLL.cs" /> | |||
<Compile Include="LR_CodeDemo\GantProject\GantProjectService.cs" /> | |||
@@ -0,0 +1,186 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 17:36 | |||
/// 描 述:项目阶段管理 | |||
/// </summary> | |||
public class ProjectPhaseManageBLL : ProjectPhaseManageIBLL | |||
{ | |||
private ProjectPhaseManageService projectPhaseManageService = new ProjectPhaseManageService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ProjectPhaseManageEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return projectPhaseManageService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ProjectPhaseManageEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
return projectPhaseManageService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取ProjectPhaseManage表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public ProjectPhaseManageEntity GetProjectPhaseManageEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return projectPhaseManageService.GetProjectPhaseManageEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取树形数据 | |||
/// </summary> | |||
/// <param name="companylist">公司数据列表</param> | |||
/// <returns></returns> | |||
public IEnumerable<TreeModel> GetTree(IEnumerable<ProjectPhaseManageEntity> typelist) | |||
{ | |||
try | |||
{ | |||
List<TreeModel> treeList = new List<TreeModel>(); | |||
foreach (var typeitem in typelist) | |||
{ | |||
TreeModel node = new TreeModel | |||
{ | |||
id = typeitem.Id, | |||
text = typeitem.Name, | |||
value = typeitem.Code, | |||
showcheck = false, | |||
checkstate = 0, | |||
isexpand = true, | |||
parentId = "" | |||
}; | |||
treeList.Add(node); | |||
} | |||
return treeList.ToTree(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
projectPhaseManageService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, ProjectPhaseManageEntity entity) | |||
{ | |||
try | |||
{ | |||
projectPhaseManageService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,70 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 17:36 | |||
/// 描 述:项目阶段管理 | |||
/// </summary> | |||
public class ProjectPhaseManageEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// 主键 | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 项目类型名称 | |||
/// </summary> | |||
[Column("NAME")] | |||
public string Name { get; set; } | |||
/// <summary> | |||
/// 项目类型编号 | |||
/// </summary> | |||
[Column("CODE")] | |||
public string Code { get; set; } | |||
/// <summary> | |||
/// 排序号 | |||
/// </summary> | |||
[Column("SORT")] | |||
public int? Sort { get; set; } | |||
/// <summary> | |||
/// 是否启用 | |||
/// </summary> | |||
[Column("ISENABLED")] | |||
public bool? IsEnabled { get; set; } | |||
/// <summary> | |||
/// 备注 | |||
/// </summary> | |||
[Column("REMARK")] | |||
public string Remark { 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 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,60 @@ | |||
using Learun.Util; | |||
using System.Data; | |||
using System.Collections.Generic; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 17:36 | |||
/// 描 述:项目阶段管理 | |||
/// </summary> | |||
public interface ProjectPhaseManageIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<ProjectPhaseManageEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<ProjectPhaseManageEntity> GetList(string queryJson); | |||
/// <summary> | |||
/// 获取ProjectPhaseManage表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
ProjectPhaseManageEntity GetProjectPhaseManageEntity(string keyValue); | |||
/// <summary> | |||
/// 获取树形数据 | |||
/// </summary> | |||
/// <param name="companylist">公司数据列表</param> | |||
/// <returns></returns> | |||
IEnumerable<TreeModel> GetTree(IEnumerable<ProjectPhaseManageEntity> typelist); | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
void DeleteEntity(string keyValue); | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, ProjectPhaseManageEntity entity); | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,187 @@ | |||
using Dapper; | |||
using Learun.DataBase.Repository; | |||
using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.LogisticsManagement | |||
{ | |||
/// <summary> | |||
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 | |||
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
/// 创 建:超级管理员 | |||
/// 日 期:2021-06-18 17:36 | |||
/// 描 述:项目阶段管理 | |||
/// </summary> | |||
public class ProjectPhaseManageService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ProjectPhaseManageEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM ProjectPhaseManage t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["Name"].IsEmpty()) | |||
{ | |||
dp.Add("Name", "%" + queryParam["Name"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Name Like @Name "); | |||
} | |||
if (!queryParam["Code"].IsEmpty()) | |||
{ | |||
dp.Add("Code", "%" + queryParam["Code"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.Code Like @Code "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ProjectPhaseManageEntity>(strSql.ToString(),dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<ProjectPhaseManageEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT * "); | |||
strSql.Append(" FROM ProjectPhaseManage t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["IsEnabled"].IsEmpty()) | |||
{ | |||
dp.Add("IsEnabled", queryParam["IsEnabled"].ToBool(), DbType.Boolean); | |||
strSql.Append(" AND t.IsEnabled = @IsEnabled "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ProjectPhaseManageEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取ProjectPhaseManage表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public ProjectPhaseManageEntity GetProjectPhaseManageEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<ProjectPhaseManageEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public void DeleteEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
this.BaseRepository("CollegeMIS").Delete<ProjectPhaseManageEntity>(t=>t.Id == keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, ProjectPhaseManageEntity entity) | |||
{ | |||
try | |||
{ | |||
if (!string.IsNullOrEmpty(keyValue)) | |||
{ | |||
entity.Modify(keyValue); | |||
this.BaseRepository("CollegeMIS").Update(entity); | |||
} | |||
else | |||
{ | |||
entity.Create(); | |||
this.BaseRepository("CollegeMIS").Insert(entity); | |||
} | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |