Przeglądaj źródła

经费报销管理以及审批

master
zhangli 3 lat temu
rodzic
commit
46722ba404
26 zmienionych plików z 6222 dodań i 3774 usunięć
  1. +117
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ExpendedManageChildController.cs
  2. +144
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ExpendedManageMainController.cs
  3. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Form.cshtml
  4. +70
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Form.js
  5. +27
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Index.cshtml
  6. +101
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Index.js
  7. +40
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Form.cshtml
  8. +200
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Form.js
  9. +38
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Index.cshtml
  10. +168
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Index.js
  11. +36
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/IndexCheck.cshtml
  12. +125
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/IndexCheck.js
  13. +12
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  14. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/ExpendedManageChildMap.cs
  15. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/ExpendedManageMainMap.cs
  16. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  17. +144
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildBLL.cs
  18. +85
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildEntity.cs
  19. +49
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildIBLL.cs
  20. +167
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildService.cs
  21. +144
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainBLL.cs
  22. +97
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainEntity.cs
  23. +49
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainIBLL.cs
  24. +193
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainService.cs
  25. +4125
    -3774
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM
  26. +8
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 117
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ExpendedManageChildController.cs Wyświetl plik

@@ -0,0 +1,117 @@
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.CustomFunction;
using System.Web.Mvc;
using System.Collections.Generic;

namespace Learun.Application.Web.Areas.CustomFunction.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 14:19
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageChildController : MvcControllerBase
{
private ExpendedManageChildIBLL expendedManageChildIBLL = new ExpendedManageChildBLL();

#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 = expendedManageChildIBLL.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 ExpendedManageChildData = expendedManageChildIBLL.GetExpendedManageChildEntity( keyValue );
var jsonData = new {
ExpendedManageChild = ExpendedManageChildData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
expendedManageChildIBLL.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)
{
ExpendedManageChildEntity entity = strEntity.ToObject<ExpendedManageChildEntity>();
expendedManageChildIBLL.SaveEntity(keyValue,entity);
if (string.IsNullOrEmpty(keyValue))
{
}
return Success("保存成功!");
}
#endregion

}
}

+ 144
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/ExpendedManageMainController.cs Wyświetl plik

@@ -0,0 +1,144 @@
using Learun.Util;
using System.Data;
using Learun.Application.TwoDevelopment.CustomFunction;
using System.Web.Mvc;
using System.Collections.Generic;

namespace Learun.Application.Web.Areas.CustomFunction.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 10:37
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageMainController : MvcControllerBase
{
private ExpendedManageMainIBLL expendedManageMainIBLL = new ExpendedManageMainBLL();
private ExpendedManageChildIBLL expendedManageChildIBLL = new ExpendedManageChildBLL();

#region 视图功能

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
return View();
}
/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Form()
{
return View();
}
/// <summary>
/// 报销审批
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult IndexCheck()
{
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 = expendedManageMainIBLL.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 ExpendedManageMainData = expendedManageMainIBLL.GetExpendedManageMainEntity(keyValue);
var ExpendedManageChildData = expendedManageChildIBLL.GetListByMainId(keyValue);
var jsonData = new
{
ExpendedManageMain = ExpendedManageMainData,
ExpendedManageChild = ExpendedManageChildData
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
expendedManageMainIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}

/// <summary>
/// 更改审核状态
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult UpdateStatus(string keyValue, int Status)
{
expendedManageMainIBLL.UpdateStatus(keyValue, Status);
return Success("操作成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="strEntity">实体</param>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, string strEntity, string ExpendedManageChildList)
{
ExpendedManageMainEntity entity = strEntity.ToObject<ExpendedManageMainEntity>();
entity.Status = 0;
List<ExpendedManageChildEntity> expendedManageChildList = ExpendedManageChildList.ToObject<List<ExpendedManageChildEntity>>();
expendedManageMainIBLL.SaveEntity(keyValue, entity, expendedManageChildList);

return Success("保存成功!");
}
#endregion

}
}

+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Form.cshtml Wyświetl plik

@@ -0,0 +1,23 @@
@{
ViewBag.Title = "经费报销管理";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="ExpendedManageChild" >
<div class="lr-form-item-title">经费类型<font face="宋体">*</font></div>
<div id="Type" isvalid="yes" checkexpession="NotNull" ></div>
</div>
<div class="col-xs-12 lr-form-item" data-table="ExpendedManageChild" >
<div class="lr-form-item-title">费用摘要</div>
<input id="Remark" type="text" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item" data-table="ExpendedManageChild" >
<div class="lr-form-item-title">预算金额<font face="宋体">*</font></div>
<input id="FundsAmount" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="ExpendedManageChild" >
<div class="lr-form-item-title">报销金额<font face="宋体">*</font></div>
<input id="ExpendedAmount" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/ExpendedManageChild/Form.js")

+ 70
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Form.js Wyświetl plik

@@ -0,0 +1,70 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-09-29 14:19
* 描 述:经费报销管理
*/
var acceptClick;
var keyValue = request('keyValue');
var selectedRow;
var bootstrap = function ($, learun) {
"use strict";
selectedRow = top["layer_formExpendedManageMain"].selectedRow;
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
$('#Type').lrDataSourceSelect({ code: 'FundsTypeManage',value: 'id',text: 'name' });
},
initData: function () {
//if (!!keyValue) {
// $.lrSetForm(top.$.rootUrl + '/CustomFunction/ExpendedManageChild/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]);
// }
// }
// });
//}
if (!!keyValue) {
if (!!selectedRow) {
$('#form').lrSetFormData(selectedRow);
}
}
}
};
// 保存数据
acceptClick = function (callBack) {
if (!$('body').lrValidform()) {
return false;
}
var postData = $('body').lrGetFormData();
if (!!keyValue) {
if (!!selectedRow) {
postData.ID = selectedRow.ID;
}
} else {
postData.ID = learun.newGuid();
}
if (!!callBack) {
callBack(postData);
return true;
}
//var postData = {
// strEntity: JSON.stringify($('body').lrGetFormData())
//};
//$.lrSaveForm(top.$.rootUrl + '/CustomFunction/ExpendedManageChild/SaveForm?keyValue=' + keyValue, postData, function (res) {
// // 保存成功后才回调
// if (!!callBack) {
// callBack();
// }
//});
};
page.init();
}

+ 27
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Index.cshtml Wyświetl plik

@@ -0,0 +1,27 @@
@{
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>
<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>&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_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/ExpendedManageChild/Index.js")

+ 101
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageChild/Index.js Wyświetl plik

@@ -0,0 +1,101 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-09-29 14:19
* 描 述:经费报销管理
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/CustomFunction/ExpendedManageChild/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 + '/CustomFunction/ExpendedManageChild/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 + '/CustomFunction/ExpendedManageChild/DeleteForm', { keyValue: keyValue}, function () {
refreshGirdData();
});
}
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/CustomFunction/ExpendedManageChild/GetPageList',
headData: [
{ label: "经费类型", name: "Type", width: 100, align: "left",
formatterAsync: function (callback, value, row, op,$cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FundsTypeManage',
key: value,
keyId: 'id',
callback: function (_data) {
callback(_data['name']);
}
});
}},
{ label: "费用摘要", name: "Remark", width: 100, align: "left"},
{ label: "预算金额", name: "FundsAmount", width: 100, align: "left"},
{ label: "报销金额", name: "ExpendedAmount", width: 100, align: "left"},
],
mainId:'ID',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 40
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Form.cshtml Wyświetl plik

@@ -0,0 +1,40 @@
@{
ViewBag.Title = "经费报销管理";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="ExpendedManageMain">
<div class="lr-form-item-title">项目编号 <font face="宋体">*</font></div>
<div id="SRProjectBasicId" isvalid="yes" checkexpession="NotNull"></div>
</div>
<div class="col-xs-6 lr-form-item" data-table="ExpendedManageMain">
<div class="lr-form-item-title">预算总金额</div>
<input id="FundsSum" type="text" class="form-control" readonly="readonly" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ExpendedManageMain">
<div class="lr-form-item-title">报销总金额</div>
<input id="ExpendedSum" type="text" class="form-control" readonly="readonly" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ExpendedManageMain">
<div class="lr-form-item-title">申请人</div>
<input id="CreateUserId" type="text" readonly class="form-control currentInfo lr-currentInfo-user" />
</div>
<div class="col-xs-6 lr-form-item" data-table="ExpendedManageMain">
<div class="lr-form-item-title">申请时间</div>
<input id="CreateTime" type="text" readonly class="form-control currentInfo lr-currentInfo-user" />
</div>
<div class="col-xs-12 lr-form-item" data-table="ExpendedManageMain">
<div class="lr-form-item-title">备注</div>
<textarea id="Remark" class="form-control" style="height:100px;"></textarea>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">明细操作</div>
<input id="detailadd" type="button" class="btn btn-success" value="新增明细" />
<input id="detailedit" type="button" class="btn btn-warning" value="编辑明细" />
<input id="detaildel" type="button" class="btn btn-danger" value="移除明细" />
</div>
<div class="col-xs-12 lr-form-item lr-form-item-grid">
<div id="ExpendedManageChild"></div>
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/ExpendedManageMain/Form.js")

+ 200
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Form.js Wyświetl plik

@@ -0,0 +1,200 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-09-29 10:37
* 描 述:经费报销管理
*/
var acceptClick;
var keyValue = request('keyValue');
// 设置表单数据
var setFormData;
// 验证数据是否填写完整
var validForm;
// 保存数据
var save;
var refreshGirdData;
var selectedRow;
var numm = 1;
var calcTotalPrice;
var tempdatra = new Array();
var bootstrap = function ($, learun) {
"use strict";
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
$("#detailadd").on('click', function () {
selectedRow = null;
learun.layerForm({
id: 'formExpendedManageChild',
title: '新增明细',
url: top.$.rootUrl + '/CustomFunction/ExpendedManageChild/Form',
width: 540,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
});
$("#detailedit").on('click', function () {
var keyValue = $('#ExpendedManageChild').jfGridValue('ID');
selectedRow = $('#ExpendedManageChild').jfGridGet('rowdata');
console.log('selectedRow:', selectedRow);
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'formFundsManageChild',
title: '编辑明细',
url: top.$.rootUrl + '/CustomFunction/ExpendedManageChild/Form?keyValue=' + keyValue,
width: 540,
height: 400,
callBack: function (id) {
return top[id].acceptClick(refreshGirdData);
}
});
}
});
$("#detaildel").on('click', function () {
var keyValue = $('#ExpendedManageChild').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认删除该项!', function (res, index) {
if (res) {
$.each(tempdatra, function (key, val) {
if (tempdatra[key].ID === keyValue) {
tempdatra.splice(key, 1);
}
});
$('#ExpendedManageChild').jfGridSet('refreshdata', tempdatra);
calcTotalPrice();
top.layer.close(index);
}

});
}
});
page.bind();
page.initData();
},
bind: function () {
$('#SRProjectBasicId').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList',
value: "ID",
text: "EnCode"
});
$('#CreateUserId')[0].lrvalue = learun.clientdata.get(['userinfo']).userId;
$('#CreateUserId').val(learun.clientdata.get(['userinfo']).realName);
$('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss'));

$('#ExpendedManageChild').jfGrid({
headData: [
{
label: '费用类型', name: 'Type', width: 100, align: 'left',
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FundsTypeManage',
key: value,
keyId: 'id',
callback: function (_data) {
callback(_data['name']);
}
});
}
},
{
label: '费用摘要', name: 'Remark', width: 100, align: 'left'
},
{
label: '预算金额', name: 'FundsAmount', width: 100, align: 'left'
},
{
label: '报销金额', name: 'ExpendedAmount', width: 100, align: 'left'
},
],
height: 270,
mainId: 'ID'
});
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/CustomFunction/ExpendedManageMain/GetFormData?keyValue=' + keyValue, function (data) {
for (var id in data) {
if (!!data[id].length && data[id].length > 0) {
$('#' + id).jfGridSet('refreshdata', data[id]);
tempdatra = data[id];
}
else {
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
}
});
}
}
};
refreshGirdData = function (temprow) {
var ifnewrow = true;
$.each(tempdatra, function (key, val) {
if (tempdatra[key].ID === temprow.ID) {
tempdatra[key] = temprow;
ifnewrow = false;
}
});
if (ifnewrow) {
tempdatra.push(temprow);
}

$('#ExpendedManageChild').jfGridSet('refreshdata', tempdatra);
calcTotalPrice();
};
//计算总金额(=单价*数量)
calcTotalPrice = function () {
var FundsSum = 0;
var ExpendedSum = 0;
$.each(tempdatra, function (i, item) {
FundsSum += Number(item.FundsAmount);
ExpendedSum += Number(item.ExpendedAmount);
});
$('#FundsSum').val(FundsSum.toFixed(2));
$('#ExpendedSum').val(ExpendedSum.toFixed(2));
};
// 验证数据是否填写完整
validForm = function () {
if (!$('.lr-form-wrap').lrValidform()) {
return false;
}
var datas = $('#ExpendedManageChild').jfGridGet('rowdatas');
if (datas == null || datas.length == 0) {
learun.alert.warning("申请未包含明细!请先新增明细!");
return false;
}
return true;
};
// 保存数据
save = function (callBack, i) {
var postData = {};
var formData = $('[data-table="ExpendedManageMain"]').lrGetFormData();

postData.strEntity = JSON.stringify(formData);
postData.ExpendedManageChildList = JSON.stringify($('#ExpendedManageChild').jfGridGet('rowdatas'));
$.lrSaveForm(top.$.rootUrl + '/CustomFunction/ExpendedManageMain/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack(formData, i);
}
});
};
//// 保存数据
//acceptClick = function (callBack) {
// if (!$('body').lrValidform()) {
// return false;
// }
// var postData = {
// strEntity: JSON.stringify($('body').lrGetFormData())
// };
// $.lrSaveForm(top.$.rootUrl + '/CustomFunction/ExpendedManageMain/SaveForm?keyValue=' + keyValue, postData, function (res) {
// // 保存成功后才回调
// if (!!callBack) {
// callBack();
// }
// });
//};
page.init();
}

+ 38
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Index.cshtml Wyświetl plik

@@ -0,0 +1,38 @@
@{
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>
<div id="SRProjectBasicId"></div>
</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>&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_submit" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;提交</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/ExpendedManageMain/Index.js")

+ 168
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/Index.js Wyświetl plik

@@ -0,0 +1,168 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-09-29 10:37
* 描 述:经费报销管理
*/
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);
$('#SRProjectBasicId').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList',
value: "ID",
text: "EnCode"
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'formExpendedManageMain',
title: '新增',
url: top.$.rootUrl + '/CustomFunction/ExpendedManageMain/Form',
width: 950,
height: 650,
callBack: function (id) {
var res = false;
// 验证数据
res = top[id].validForm();
// 保存数据
if (res) {
res = top[id].save(function () {
page.search();
});
}
return res;
//return top[id].acceptClick(refreshGirdData);
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'formExpendedManageMain',
title: '编辑',
url: top.$.rootUrl + '/CustomFunction/ExpendedManageMain/Form?keyValue=' + keyValue,
width: 950,
height: 650,
callBack: function (id) {
var res = false;
// 验证数据
res = top[id].validForm();
// 保存数据
if (res) {
res = top[id].save(function () {
page.search();
});
}
return res;
//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 + '/CustomFunction/ExpendedManageMain/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});

// 提交
$('#lr_submit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
var Status = $('#gridtable').jfGridValue('Status');
if (Status != 0) {
return learun.alert.warning('该项已提交!');
}
learun.layerConfirm('是否确认提交该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/CustomFunction/ExpendedManageMain/UpdateStatus', { keyValue: keyValue, Status: 1 }, function () {
refreshGirdData();
});
}
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/CustomFunction/ExpendedManageMain/GetPageList',
headData: [
{
label: "项目编号 ", name: "SRProjectBasicCode", width: 100, align: "left"
},
{ label: "预算总金额", name: "FundsSum", width: 100, align: "left" },
{ label: "报销总金额", name: "ExpendedSum", width: 100, align: "left" },
{
label: "申请人", name: "CreateUserId", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('user', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
}
},
{
label: "申请时间", name: "CreateTime", width: 150, align: "left"
},
{ label: "备注", name: "Remark", width: 100, align: "left" },
{
label: "状态", name: "Status", width: 100, align: "left",
formatter: function (cellvalue, row) {
if (cellvalue == 0) {
return "<span class=\"label label-default\">草稿</span>";
} else if (cellvalue == 1) {
return "<span class=\"label label-warning\">已提交</span>";
} else if (cellvalue == 2) {
return "<span class=\"label label-success\">审核通过</span>";
} else if (cellvalue == 3) {
return "<span class=\"label label-danger\">审核未通过</span>";
}
}
},
],
mainId: 'ID',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 36
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/IndexCheck.cshtml Wyświetl plik

@@ -0,0 +1,36 @@
@{
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>
<div id="SRProjectBasicId"></div>
</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_success" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;审核通过</a>
<a id="lr_fail" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;未通过</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/ExpendedManageMain/IndexCheck.js")

+ 125
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/ExpendedManageMain/IndexCheck.js Wyświetl plik

@@ -0,0 +1,125 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2021-09-29 10:37
* 描 述:经费报销管理
*/
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);
$('#SRProjectBasicId').lrselect({
allowSearch: true,
url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList',
value: "ID",
text: "EnCode"
});
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});

//审核通过
$('#lr_success').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
var Status = $('#gridtable').jfGridValue('Status');
if (Status == 0) {
return learun.alert.warning('该项未提交!');
}
learun.layerConfirm('是否确认通过该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/CustomFunction/ExpendedManageMain/UpdateStatus', { keyValue: keyValue, Status: 2 }, function () {
refreshGirdData();
});
}
});
}
});
//未通过
$('#lr_fail').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerConfirm('是否确认未通过该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/CustomFunction/ExpendedManageMain/UpdateStatus', { keyValue: keyValue, Status: 3 }, function () {
refreshGirdData();
});
}
});
}
});
// 打印
$('#lr_print').on('click', function () {
$('#gridtable').jqprintTable();
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/CustomFunction/ExpendedManageMain/GetPageList',
headData: [
{
label: "项目编号 ", name: "SRProjectBasicCode", width: 100, align: "left"
},
{ label: "预算总金额", name: "FundsSum", width: 100, align: "left" },
{ label: "报销总金额", name: "ExpendedSum", width: 100, align: "left" },
{
label: "是否超出预算", name: "FundsSum", width: 100, align: "left",
formatter: function (value, row) {
return row.ExpendedSum > value ? '是' : '否';
}
},
{
label: "申请人", name: "CreateUserId", width: 100, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('user', {
key: value,
callback: function (_data) {
callback(_data.name);
}
});
}
},
{
label: "申请时间", name: "CreateTime", width: 150, align: "left"
},
{
label: "状态", name: "Status", width: 100, align: "left",
formatter: function (cellvalue, row) {
if (cellvalue == 0) {
return "<span class=\"label label-default\">草稿</span>";
} else if (cellvalue == 1) {
return "<span class=\"label label-warning\">已提交</span>";
} else if (cellvalue == 2) {
return "<span class=\"label label-success\">审核通过</span>";
} else if (cellvalue == 3) {
return "<span class=\"label label-danger\">审核未通过</span>";
}
}
},
],
mainId: 'ID',
isPage: true
});
page.search();
},
search: function (param) {
param = param || {};
param.SqlParameter = ' and Status<>0 ';
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function () {
$('#gridtable').jfGridSet('reload');
};
page.init();
}

+ 12
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Wyświetl plik

@@ -833,6 +833,8 @@
<Compile Include="Areas\CustomFunction\Controllers\FundsTypeManageController.cs" />
<Compile Include="Areas\CustomFunction\Controllers\FundsManageMainController.cs" />
<Compile Include="Areas\CustomFunction\Controllers\FundsManageChildController.cs" />
<Compile Include="Areas\CustomFunction\Controllers\ExpendedManageMainController.cs" />
<Compile Include="Areas\CustomFunction\Controllers\ExpendedManageChildController.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" />
@@ -942,6 +944,7 @@
<Content Include="Areas\AssetManagementSystem\Views\Ass_UserChangeInfo\Index.js" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Form.js" />
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageMain\IndexCheck.js" />
<Content Include="Areas\CustomFunction\Views\FundsManageMain\IndexCheck.js" />
<Content Include="Areas\CustomFunction\Views\PaperManage\IndexReport.js" />
<Content Include="Areas\CustomFunction\Views\SRProjectAchievement\IndexYJ.js" />
@@ -6509,6 +6512,14 @@
<Content Include="Areas\CustomFunction\Views\FundsManageChild\Index.js" />
<Content Include="Areas\CustomFunction\Views\FundsManageChild\Form.cshtml" />
<Content Include="Areas\CustomFunction\Views\FundsManageChild\Form.js" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageMain\Index.cshtml" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageMain\Index.js" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageMain\Form.cshtml" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageMain\Form.js" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageChild\Index.cshtml" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageChild\Index.js" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageChild\Form.cshtml" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageChild\Form.js" />
</ItemGroup>
<ItemGroup>
<Folder Include="Areas\LR_Desktop\Models\" />
@@ -7378,6 +7389,7 @@
<Content Include="Areas\CustomFunction\Views\SRProjectBasic\FormNoCompleted.cshtml" />
<Content Include="Areas\CustomFunction\Views\PaperManage\IndexReport.cshtml" />
<Content Include="Areas\CustomFunction\Views\FundsManageMain\IndexCheck.cshtml" />
<Content Include="Areas\CustomFunction\Views\ExpendedManageMain\IndexCheck.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<Content Include="Areas\PersonnelManagement\Views\MeetingManagement\IndexOfMyJoin.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\MeetingSignInRecord\IndexAttendance.cshtml" />


+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/ExpendedManageChildMap.cs Wyświetl plik

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.CustomFunction;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 14:19
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageChildMap : EntityTypeConfiguration<ExpendedManageChildEntity>
{
public ExpendedManageChildMap()
{
#region 表、主键
//表
this.ToTable("EXPENDEDMANAGECHILD");
//主键
this.HasKey(t => t.ID);
#endregion

#region 配置关系
#endregion
}
}
}


+ 29
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/ExpendedManageMainMap.cs Wyświetl plik

@@ -0,0 +1,29 @@
using Learun.Application.TwoDevelopment.CustomFunction;
using System.Data.Entity.ModelConfiguration;

namespace Learun.Application.Mapping
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 10:37
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageMainMap : EntityTypeConfiguration<ExpendedManageMainEntity>
{
public ExpendedManageMainMap()
{
#region 表、主键
//表
this.ToTable("EXPENDEDMANAGEMAIN");
//主键
this.HasKey(t => t.ID);
#endregion

#region 配置关系
#endregion
}
}
}


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj Wyświetl plik

@@ -589,6 +589,8 @@
<Compile Include="CustomFunction\FundsTypeManageMap.cs" />
<Compile Include="CustomFunction\FundsManageMainMap.cs" />
<Compile Include="CustomFunction\FundsManageChildMap.cs" />
<Compile Include="CustomFunction\ExpendedManageMainMap.cs" />
<Compile Include="CustomFunction\ExpendedManageChildMap.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


+ 144
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildBLL.cs Wyświetl plik

@@ -0,0 +1,144 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 14:19
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageChildBLL : ExpendedManageChildIBLL
{
private ExpendedManageChildService expendedManageChildService = new ExpendedManageChildService();

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<ExpendedManageChildEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return expendedManageChildService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public IEnumerable<ExpendedManageChildEntity> GetListByMainId(string mainid)
{
try
{
return expendedManageChildService.GetListByMainId(mainid);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取ExpendedManageChild表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public ExpendedManageChildEntity GetExpendedManageChildEntity(string keyValue)
{
try
{
return expendedManageChildService.GetExpendedManageChildEntity(keyValue);
}
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
{
expendedManageChildService.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, ExpendedManageChildEntity entity)
{
try
{
expendedManageChildService.SaveEntity(keyValue, entity);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}
}

+ 85
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildEntity.cs Wyświetl plik

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

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 14:19
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageChildEntity
{
#region 实体成员
/// <summary>
/// 主键
/// </summary>
[Column("ID")]
public string ID { get; set; }
/// <summary>
/// 主表id
/// </summary>
[Column("MAINID")]
public string MainId { get; set; }
/// <summary>
/// 费用类型
/// </summary>
[Column("TYPE")]
public string Type { get; set; }
/// <summary>
/// 费用摘要
/// </summary>
[Column("REMARK")]
public string Remark { get; set; }
/// <summary>
/// 预算金额
/// </summary>
[Column("FUNDSAMOUNT")]
public decimal? FundsAmount { get; set; }
/// <summary>
/// 报销金额
/// </summary>
[Column("EXPENDEDAMOUNT")]
public decimal? ExpendedAmount { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Column("CREATEUSERID")]
public string CreateUserId { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Column("CREATEUSERNAME")]
public string CreateUserName { get; set; }
/// <summary>
/// 申请时间
/// </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 扩展字段
#endregion
}
}


+ 49
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildIBLL.cs Wyświetl plik

@@ -0,0 +1,49 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 14:19
/// 描 述:经费报销管理
/// </summary>
public interface ExpendedManageChildIBLL
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<ExpendedManageChildEntity> GetPageList(Pagination pagination, string queryJson);
IEnumerable<ExpendedManageChildEntity> GetListByMainId(string mainid);
/// <summary>
/// 获取ExpendedManageChild表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
ExpendedManageChildEntity GetExpendedManageChildEntity(string keyValue);
#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, ExpendedManageChildEntity entity);
#endregion

}
}

+ 167
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageChild/ExpendedManageChildService.cs Wyświetl plik

@@ -0,0 +1,167 @@
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.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 14:19
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageChildService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<ExpendedManageChildEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.ID,
t.Type,
t.Remark,
t.FundsAmount,
t.ExpendedAmount
");
strSql.Append(" FROM ExpendedManageChild t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
return this.BaseRepository("CollegeMIS").FindList<ExpendedManageChildEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public IEnumerable<ExpendedManageChildEntity> GetListByMainId(string mainid)
{
try
{
return this.BaseRepository("CollegeMIS").FindList<ExpendedManageChildEntity>(x => x.MainId == mainid);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取ExpendedManageChild表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public ExpendedManageChildEntity GetExpendedManageChildEntity(string keyValue)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<ExpendedManageChildEntity>(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<ExpendedManageChildEntity>(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, ExpendedManageChildEntity 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

}
}

+ 144
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainBLL.cs Wyświetl plik

@@ -0,0 +1,144 @@
using Learun.Util;
using System;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 10:37
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageMainBLL : ExpendedManageMainIBLL
{
private ExpendedManageMainService expendedManageMainService = new ExpendedManageMainService();

#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<ExpendedManageMainEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
return expendedManageMainService.GetPageList(pagination, queryJson);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取ExpendedManageMain表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public ExpendedManageMainEntity GetExpendedManageMainEntity(string keyValue)
{
try
{
return expendedManageMainService.GetExpendedManageMainEntity(keyValue);
}
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
{
expendedManageMainService.DeleteEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

public void UpdateStatus(string keyValue, int Status)
{
try
{
expendedManageMainService.UpdateStatus(keyValue, Status);
}
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, ExpendedManageMainEntity entity, List<ExpendedManageChildEntity> expendedManageChildList)
{
try
{
expendedManageMainService.SaveEntity(keyValue, entity, expendedManageChildList);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}
}

+ 97
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainEntity.cs Wyświetl plik

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

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 10:37
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageMainEntity
{
#region 实体成员
/// <summary>
/// 主键
/// </summary>
[Column("ID")]
public string ID { get; set; }
/// <summary>
/// 项目ID
/// </summary>
[Column("SRPROJECTBASICID")]
public string SRProjectBasicId { get; set; }
/// <summary>
/// 预算总金额
/// </summary>
[Column("FUNDSSUM")]
public decimal? FundsSum { get; set; }
/// <summary>
/// 报销总金额
/// </summary>
[Column("EXPENDEDSUM")]
public decimal? ExpendedSum { get; set; }
/// <summary>
/// 备注
/// </summary>
[Column("REMARK")]
public string Remark { get; set; }
/// <summary>
/// 状态
/// </summary>
[Column("STATUS")]
public int? Status { get; set; }
/// <summary>
/// 审核人
/// </summary>
[Column("STATUSUSERID")]
public string StatusUserId { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Column("CREATEUSERID")]
public string CreateUserId { get; set; }
/// <summary>
/// 创建人
/// </summary>
[Column("CREATEUSERNAME")]
public string CreateUserName { get; set; }
/// <summary>
/// 申请时间
/// </summary>
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
#endregion

#region 扩展操作
/// <summary>
/// 新增调用
/// </summary>
public void Create()
{
this.ID = Guid.NewGuid().ToString();
//this.CreateTime = DateTime.Now;
//var userinfo = LoginUserInfo.Get();
//this.CreateUserId = userinfo.userId;
//this.CreateUserName = userinfo.realName;
}
/// <summary>
/// 编辑调用
/// </summary>
/// <param name="keyValue"></param>
public void Modify(string keyValue)
{
this.ID = keyValue;
}
#endregion
#region 扩展字段
[NotMapped]
public string SRProjectBasicCode { get; set; }

#endregion
}
}


+ 49
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainIBLL.cs Wyświetl plik

@@ -0,0 +1,49 @@
using Learun.Util;
using System.Data;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 10:37
/// 描 述:经费报销管理
/// </summary>
public interface ExpendedManageMainIBLL
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<ExpendedManageMainEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取ExpendedManageMain表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
ExpendedManageMainEntity GetExpendedManageMainEntity(string keyValue);
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
void DeleteEntity(string keyValue);
void UpdateStatus(string keyValue, int Status);
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, ExpendedManageMainEntity entity, List<ExpendedManageChildEntity> expendedManageChildList);
#endregion

}
}

+ 193
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/ExpendedManageMain/ExpendedManageMainService.cs Wyświetl plik

@@ -0,0 +1,193 @@
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.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2021-09-29 10:37
/// 描 述:经费报销管理
/// </summary>
public class ExpendedManageMainService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">查询参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<ExpendedManageMainEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT ");
strSql.Append(@"
t.ID,
t.SRProjectBasicId,
t.FundsSum,
t.ExpendedSum,
t.CreateUserId,
t.CreateTime,
t.Remark,t.Status,
s.EnCode as SRProjectBasicCode
");
strSql.Append(" FROM ExpendedManageMain t ");
strSql.Append(" join SRProjectBasic s on t.SRProjectBasicId=s.Id ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["SRProjectBasicId"].IsEmpty())
{
dp.Add("SRProjectBasicId", queryParam["SRProjectBasicId"].ToString(), DbType.String);
strSql.Append(" AND t.SRProjectBasicId = @SRProjectBasicId ");
}
if (!queryParam["SqlParameter"].IsEmpty())
{
strSql.Append(queryParam["SqlParameter"].ToString());
}

return this.BaseRepository("CollegeMIS").FindList<ExpendedManageMainEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取ExpendedManageMain表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public ExpendedManageMainEntity GetExpendedManageMainEntity(string keyValue)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<ExpendedManageMainEntity>(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<ExpendedManageMainEntity>(t => t.ID == keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

public void UpdateStatus(string keyValue, int Status)
{
try
{
string sql = $"update ExpendedManageMain set Status={Status} where Id='{keyValue}'";
this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
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, ExpendedManageMainEntity entity, List<ExpendedManageChildEntity> expendedManageChildList)
{
var db = this.BaseRepository("CollegeMIS").BeginTrans();
try
{
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
db.Update(entity);
}
else
{
entity.Create();
db.Insert(entity);
}
db.Delete<ExpendedManageChildEntity>(t => t.MainId == keyValue);
foreach (ExpendedManageChildEntity item in expendedManageChildList)
{
item.Create();
item.MainId = keyValue;
db.Insert(item);
}
db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}
}

+ 4125
- 3774
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/DBModel/资产系统.PDM
Plik diff jest za duży
Wyświetl plik


+ 8
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj Wyświetl plik

@@ -1770,6 +1770,14 @@
<Compile Include="CustomFunction\FundsManageChild\FundsManageChildService.cs" />
<Compile Include="CustomFunction\FundsManageChild\FundsManageChildBLL.cs" />
<Compile Include="CustomFunction\FundsManageChild\FundsManageChildIBLL.cs" />
<Compile Include="CustomFunction\ExpendedManageMain\ExpendedManageMainEntity.cs" />
<Compile Include="CustomFunction\ExpendedManageMain\ExpendedManageMainService.cs" />
<Compile Include="CustomFunction\ExpendedManageMain\ExpendedManageMainBLL.cs" />
<Compile Include="CustomFunction\ExpendedManageMain\ExpendedManageMainIBLL.cs" />
<Compile Include="CustomFunction\ExpendedManageChild\ExpendedManageChildEntity.cs" />
<Compile Include="CustomFunction\ExpendedManageChild\ExpendedManageChildService.cs" />
<Compile Include="CustomFunction\ExpendedManageChild\ExpendedManageChildBLL.cs" />
<Compile Include="CustomFunction\ExpendedManageChild\ExpendedManageChildIBLL.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj">


Ładowanie…
Anuluj
Zapisz