Browse Source

【增加】核算管理:费用登记;

yanshi
dyy 2 years ago
parent
commit
f13eec7f26
13 changed files with 1283 additions and 0 deletions
  1. +212
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/CostRegistrateController.cs
  2. +15
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Form.cshtml
  3. +105
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Form.js
  4. +50
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Index.cshtml
  5. +233
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Index.js
  6. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  7. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/CustomFunction/CostRegistrateMap.cs
  8. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
  9. +173
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateBLL.cs
  10. +120
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateEntity.cs
  11. +63
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateIBLL.cs
  12. +273
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateService.cs
  13. +4
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj

+ 212
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/CostRegistrateController.cs View File

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

namespace Learun.Application.Web.Areas.CustomFunction.Controllers
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-05-05 10:34
/// 描 述:费用登记
/// </summary>
public class CostRegistrateController : MvcControllerBase
{
private CostRegistrateIBLL costRegistrateIBLL = new CostRegistrateBLL();

#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 = costRegistrateIBLL.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 CostRegistrateData = costRegistrateIBLL.GetCostRegistrateEntity( keyValue );
var jsonData = new {
CostRegistrate = CostRegistrateData,
};
return Success(jsonData);
}
/// <summary>
/// 获取表单数据
/// </summary>
/// <param name="processId">流程实例主键</param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormDataByProcessId(string processId)
{
var CostRegistrateData = costRegistrateIBLL.GetEntityByProcessId( processId );
var jsonData = new {
CostRegistrate = CostRegistrateData,
};
return Success(jsonData);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
costRegistrateIBLL.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)
{
var loginUserInfo = LoginUserInfo.Get();
CostRegistrateEntity entity = strEntity.ToObject<CostRegistrateEntity>();
entity.PayStatus = "0";
entity.CheckStatus = "0";
if (string.IsNullOrEmpty(keyValue))
{
entity.CreateUserId = loginUserInfo.userId;
entity.CreateUserName = loginUserInfo.realName;
entity.CreateTime = DateTime.Now;
}
else
{
entity.ModifyUserId= loginUserInfo.userId;
entity.ModifyUserName = loginUserInfo.realName;
entity.ModifyTime = DateTime.Now;
}
costRegistrateIBLL.SaveEntity(keyValue, entity, false);
return Success("保存成功!");
}
/// <summary>
/// 提交实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult ChangeStatusById(string keyValue,string processId)
{
var entity = costRegistrateIBLL.GetCostRegistrateEntity(keyValue);
if (entity != null)
{
entity.ProcessId = processId;
entity.CheckStatus = "1";

costRegistrateIBLL.SaveEntity(keyValue, entity,false);
}
return Success("提交成功!");
}

/// <summary>
/// 提交实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult UpdateStatus(string keyValue, string status)
{
var entity = costRegistrateIBLL.GetCostRegistrateEntity(keyValue);
if (entity != null)
{
entity.CheckStatus = status;
if (status == "2")
{
entity.CheckTime = DateTime.Now;
}

costRegistrateIBLL.SaveEntity(keyValue, entity, false);
}
return Success("提交成功!");
}

/// <summary>
/// 确认报销实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult UpdatePayStatus(string keyValue, string status)
{
var loginUserInfo = LoginUserInfo.Get();
var entity = costRegistrateIBLL.GetCostRegistrateEntity(keyValue);
if (entity != null)
{
entity.PayStatus = status;
entity.PayUserId = loginUserInfo.userId;
entity.PayUserName = loginUserInfo.realName;
entity.PayTime = DateTime.Now;

costRegistrateIBLL.SaveEntity(keyValue, entity, true);
}
return Success("提交成功!");
}
#endregion

}
}

+ 15
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Form.cshtml View File

@@ -0,0 +1,15 @@
@{
ViewBag.Title = "费用登记";
Layout = "~/Views/Shared/_Form.cshtml";
}
<div class="lr-form-wrap" id="form">
<div class="col-xs-12 lr-form-item" data-table="CostRegistrate">
<div class="lr-form-item-title">预算项目<font face="宋体">*</font></div>
<input id="BudgetName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-12 lr-form-item" data-table="CostRegistrate">
<div class="lr-form-item-title">实际费用<font face="宋体">*</font></div>
<input id="Money" type="text" class="form-control" isvalid="yes" checkexpession="Num" />
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/CostRegistrate/Form.js")

+ 105
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Form.js View File

@@ -0,0 +1,105 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-05-05 10:34
* 描 述:费用登记
*/
var acceptClick;
var keyValue = request('keyValue');
// 设置权限
var setAuthorize;
// 设置表单数据
var setFormData;
// 验证数据是否填写完整
var validForm;
// 保存数据
var save;
var bootstrap = function ($, learun) {
"use strict";
// 设置权限
setAuthorize = function (data) {
if(!!data)
{
for (var field in data) {
if (data[field].isLook != 1) {// 如果没有查看权限就直接移除
$('#' + data[field].fieldId).parent().remove();
}
else {
if (data[field].isEdit != 1) {
$('#' + data[field].fieldId).attr('disabled', 'disabled');
if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) {
$('#' + data[field].fieldId).css({ 'padding-right': '58px' });
$('#' + data[field].fieldId).find('.btn-success').remove();
}
}
}
}
}
};
var page = {
init: function () {
$('.lr-form-wrap').lrscroll();
page.bind();
page.initData();
},
bind: function () {
},
initData: function () {
if (!!keyValue) {
$.lrSetForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/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]);
}
}
});
}
}
};
// 设置表单数据
setFormData = function (processId,param,callback) {
if (!!processId) {
$.lrSetForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/GetFormDataByProcessId?processId=' + processId, function (data) {
for (var id in data) {
if (!!data[id] && data[id].length > 0) {
$('#' + id ).jfGridSet('refreshdata', data[id]);
}
else {
if (id == 'CostRegistrate' && data[id] ){
keyValue = data[id].Id;
}
$('[data-table="' + id + '"]').lrSetFormData(data[id]);
}
}
});
}
callback && callback(); }
// 验证数据是否填写完整
validForm = function () {
if (!$('body').lrValidform()) {
return false;
}
return true;
};
// 保存数据
save = function (processId, callBack, i) {
var formData = $('body').lrGetFormData();
if(!!processId){
formData.ProcessId =processId;
}
var postData = {
strEntity: JSON.stringify(formData)
};
$.lrSaveForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/SaveForm?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack(res, i);
}
});
};
page.init();
}

+ 50
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Index.cshtml View File

@@ -0,0 +1,50 @@
@{
/**/

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="BudgetName" type="text" class="form-control" />
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">付款状态</div>
<div id="PayStatus"></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>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;提交</a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;审批</a>
<a id="lr_checkPay" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;确认报销</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_messageRemindPerson" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;管理提醒对象</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/CustomFunction/Views/CostRegistrate/Index.js")

+ 233
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/CostRegistrate/Index.js View File

@@ -0,0 +1,233 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
* 日 期:2022-05-05 10:34
* 描 述:费用登记
*/
var refreshGirdData;
var keyValueInMessageRemind = request('keyValue');//消息提醒-查看-id
var bootstrap = function ($, learun) {
"use strict";
var processId = '';
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
//消息提醒-查看:按钮隐藏
if (keyValueInMessageRemind != "" && keyValueInMessageRemind != undefined && keyValueInMessageRemind != null) {
$('.lr-layout-tool > div').hide();
} else {
$('.lr-layout-tool > div').show();
}
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
page.search(queryJson);
}, 220, 400);
$('#PayStatus').lrselect({ data: [{ id: '0', text: '未报销' }, { id: '1', text: '已报销' }] });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
// 新增
$('#lr_add').on('click', function () {
learun.layerForm({
id: 'form',
title: '新增',
url: top.$.rootUrl + '/CustomFunction/CostRegistrate/Form',
width: 600,
height: 400,
callBack: function (id) {
var res = false;
// 验证数据
res = top[id].validForm();
// 保存数据
if (res) {
//processId = learun.newGuid();
//res = top[id].save(processId, refreshGirdData);
res = top[id].save('', function () {
page.search();
});
}
return res;
}
});
});
// 编辑
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
if (CheckStatus != 0) {
learun.alert.warning("当前项目已提交,无法编辑!");
return;
}
learun.layerForm({
id: 'form',
title: '编辑',
url: top.$.rootUrl + '/CustomFunction/CostRegistrate/Form?keyValue=' + keyValue,
width: 600,
height: 400,
callBack: function (id) {
var res = false;
// 验证数据
res = top[id].validForm();
// 保存数据
if (res) {
res = top[id].save('', function () {
page.search();
});
}
return res;
}
});
}
});
// 删除
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
if (CheckStatus != 0) {
learun.alert.warning("当前项目已提交,无法删除!");
return;
}
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/DeleteForm', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});
//  提交
$('#lr_submit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
if (CheckStatus != 0) {
learun.alert.warning("当前项目已提交,请耐心等待审批!");
return;
}
learun.layerConfirm('是否确认提交该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/UpdateStatus', { keyValue: keyValue, status: 1 }, function (res) {
refreshGirdData();
});
}
});
}
});
//审批
$('#lr_check').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
if (CheckStatus == 2) {
learun.alert.warning("当前项目已审批通过!");
return;
}
if (CheckStatus != 1) {
learun.alert.warning("当前项目未提交!");
return;
}
learun.layerConfirm('是否确认审批该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/UpdateStatus', { keyValue: keyValue, status: 2 }, function (res) {
refreshGirdData();
});
}
});
}
});
//确认报销
$('#lr_checkPay').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('Id');
if (learun.checkrow(keyValue)) {
var CheckStatus = $('#gridtable').jfGridValue('CheckStatus');
if (CheckStatus != 2) {
learun.alert.warning("当前项目未审批通过!");
return;
}
learun.layerConfirm('是否确认报销该项!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/CustomFunction/CostRegistrate/UpdatePayStatus', { keyValue: keyValue, status: 1 }, function (res) {
refreshGirdData();
});
}
});
}
});

// 管理提醒对象
$('#lr_messageRemindPerson').on('click', function () {
learun.layerForm({
id: 'formInMessageRemindPerson',
title: '管理提醒对象',
url: top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/Form?type=05',
width: 600,
height: 400,
callBack: function (id) {
return top[id].acceptClick();
}
});
});
},
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/CustomFunction/CostRegistrate/GetPageList',
headData: [
{ label: "预算项目", name: "BudgetName", width: 100, align: "left" },
{ label: "实际费用", name: "Money", width: 100, align: "left" },
{
label: "审批状态", name: "CheckStatus", width: 100, align: "left", formatter: function (value) {
if (value == 0) {
return '<span class="label label-default">草稿</span>';
} else if (value == 1) {
return '<span class="label label-warning">审批中</span>';
} else if (value == 2) {
return '<span class="label label-success">审批通过</span>';
} else if (value == 3) {
return '<span class="label label-danger">审批不通过</span>';
} else {
return '<span class="label label-default">草稿</span>';
}
}
},
{
label: "付款状态", name: "PayStatus", width: 100, align: "left", formatter: function (value) {
return value == "0" ? '<span class="label label-default">未报销</span>' : '<span class="label label-success">已报销</span>';
}
},
],
mainId: 'Id',
isPage: true,
sord: 'desc',
sidx: 'CreateTime'
});
page.search();
},
search: function (param) {
param = param || {};
param.keyValueInMessageRemind = keyValueInMessageRemind;
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
refreshGirdData = function (res, postData) {
if (res && res.code && res.code == 200) {
// 发起流程
var postData = {
schemeCode: '',// 填写流程对应模板编号
processId: processId,
level: '1',
};
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) {
learun.loading(false);
});
}
page.search();
};
page.init();
}

+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj View File

@@ -315,6 +315,7 @@
<Compile Include="Areas\AssetManagementSystem\Controllers\Ass_SupplierController.cs" />
<Compile Include="Areas\AssetManagementSystem\Controllers\Ass_UserChangeInfoController.cs" />
<Compile Include="Areas\AssetManagementSystem\Controllers\Ass_WarningController.cs" />
<Compile Include="Areas\CustomFunction\Controllers\CostRegistrateController.cs" />
<Compile Include="Areas\CustomFunction\CustomFunctionAreaRegistration.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonSyncController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperController.cs" />
@@ -1016,6 +1017,8 @@
<Content Include="Areas\CustomFunction\Views\OfficialSealUse\Index.js" />
<Content Include="Areas\CustomFunction\Views\OfficialSeal\Form.js" />
<Content Include="Areas\CustomFunction\Views\OfficialSeal\Index.js" />
<Content Include="Areas\CustomFunction\Views\CostRegistrate\Form.js" />
<Content Include="Areas\CustomFunction\Views\CostRegistrate\Index.js" />
<Content Include="Areas\CustomFunction\Views\PaymentAccount\ReceiptForm.js" />
<Content Include="Areas\CustomFunction\Views\SecurityCheckManage\Form2.js" />
<Content Include="Areas\CustomFunction\Views\SecurityCheckManage\Index2.js" />
@@ -7689,6 +7692,8 @@
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_BudgetBasics\AdjustIndex.cshtml" />
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_BudgetBasics\AdjustForm.cshtml" />
<Content Include="Areas\CustomFunction\Views\BudgetApply\PayForm.cshtml" />
<Content Include="Areas\CustomFunction\Views\CostRegistrate\Form.cshtml" />
<Content Include="Areas\CustomFunction\Views\CostRegistrate\Index.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/CostRegistrateMap.cs View File

@@ -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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-05-05 10:34
/// 描 述:费用登记
/// </summary>
public class CostRegistrateMap : EntityTypeConfiguration<CostRegistrateEntity>
{
public CostRegistrateMap()
{
#region 表、主键
//表
this.ToTable("COSTREGISTRATE");
//主键
this.HasKey(t => t.Id);
#endregion

#region 配置关系
#endregion
}
}
}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj View File

@@ -67,6 +67,7 @@
<Compile Include="AssetManagementSystem\Ass_PurchaseItemApplyMap.cs" />
<Compile Include="AssetManagementSystem\Ass_ScrapItemMap.cs" />
<Compile Include="AssetManagementSystem\Ass_ScrapMap.cs" />
<Compile Include="CustomFunction\CostRegistrateMap.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSyncMap.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonTermAttemperMap.cs" />
<Compile Include="EducationalAdministration\Book_borrowinfoMap.cs" />


+ 173
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateBLL.cs View File

@@ -0,0 +1,173 @@
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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-05-05 10:34
/// 描 述:费用登记
/// </summary>
public class CostRegistrateBLL : CostRegistrateIBLL
{
private CostRegistrateService costRegistrateService = new CostRegistrateService();

#region 获取数据

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

/// <summary>
/// 获取CostRegistrate表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public CostRegistrateEntity GetCostRegistrateEntity(string keyValue)
{
try
{
return costRegistrateService.GetCostRegistrateEntity(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
public CostRegistrateEntity GetEntityByProcessId(string processId)
{
try
{
return costRegistrateService.GetEntityByProcessId(processId);
}
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
{
costRegistrateService.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>
public void SaveEntity(string keyValue, CostRegistrateEntity entity, bool isMessageRemind)
{
try
{
costRegistrateService.SaveEntity(keyValue, entity,isMessageRemind);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

/// <summary>
/// 保存实体数据(流程审批)
/// </summary>
/// <param name="processId">流程</param>
/// <param name="status">审批状态</param>
/// <returns></returns>
public void ChangeStatusByProcessId(string processId, string status)
{
try
{
costRegistrateService.ChangeStatusByProcessId(processId, status);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}

#endregion

}
}

+ 120
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateEntity.cs View File

@@ -0,0 +1,120 @@
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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-05-05 10:34
/// 描 述:费用登记
/// </summary>
public class CostRegistrateEntity
{
#region 实体成员
/// <summary>
/// Id
/// </summary>
[Column("ID")]
public string Id { get; set; }
/// <summary>
/// 预算项目
/// </summary>
[Column("BUDGETNAME")]
public string BudgetName { get; set; }
/// <summary>
/// 实际费用
/// </summary>
[Column("MONEY")]
public Decimal? Money { get; set; }
/// <summary>
/// 审批状态(0草稿,1审批中,2审批通过,3审批不通过)
/// </summary>
[Column("CHECKSTATUS")]
public string CheckStatus { get; set; }
/// <summary>
/// 审批时间
/// </summary>
[Column("CHECKTIME")]
public DateTime? CheckTime { get; set; }
/// <summary>
/// 付款状态(0未报销,1已报销)
/// </summary>
[Column("PAYSTATUS")]
public string PayStatus { get; set; }
/// <summary>
/// PayUserName
/// </summary>
[Column("PAYUSERNAME")]
public string PayUserName { get; set; }
/// <summary>
/// PayUserId
/// </summary>
[Column("PAYUSERID")]
public string PayUserId { get; set; }
/// <summary>
/// PayTime
/// </summary>
[Column("PAYTIME")]
public DateTime? PayTime { get; set; }
/// <summary>
/// ProcessId
/// </summary>
[Column("PROCESSID")]
public string ProcessId { get; set; }
/// <summary>
/// CreateUserName
/// </summary>
[Column("CREATEUSERNAME")]
public string CreateUserName { get; set; }
/// <summary>
/// CreateUserId
/// </summary>
[Column("CREATEUSERID")]
public string CreateUserId { get; set; }
/// <summary>
/// CreateTime
/// </summary>
[Column("CREATETIME")]
public DateTime? CreateTime { get; set; }
/// <summary>
/// ModifyUserName
/// </summary>
[Column("MODIFYUSERNAME")]
public string ModifyUserName { get; set; }
/// <summary>
/// ModifyUserId
/// </summary>
[Column("MODIFYUSERID")]
public string ModifyUserId { get; set; }
/// <summary>
/// ModifyTime
/// </summary>
[Column("MODIFYTIME")]
public DateTime? ModifyTime { 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
}
}


+ 63
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateIBLL.cs View File

@@ -0,0 +1,63 @@
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 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-05-05 10:34
/// 描 述:费用登记
/// </summary>
public interface CostRegistrateIBLL
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<CostRegistrateEntity> GetPageList(Pagination pagination, string queryJson);
/// <summary>
/// 获取CostRegistrate表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
CostRegistrateEntity GetCostRegistrateEntity(string keyValue);
/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
CostRegistrateEntity GetEntityByProcessId(string processId);
#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, CostRegistrateEntity entity, bool isMessageRemind);

/// <summary>
/// 保存实体数据(流程审批)
/// </summary>
/// <param name="processId">流程</param>
/// <param name="status">审批状态</param>
/// <returns></returns>
void ChangeStatusByProcessId(string processId, string status);
#endregion

}
}

+ 273
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/CostRegistrate/CostRegistrateService.cs View File

@@ -0,0 +1,273 @@
using Dapper;
using Learun.Application.Base.AuthorizeModule;
using Learun.Application.Organization;
using Learun.Application.TwoDevelopment.LR_Desktop;
using Learun.DataBase.Repository;
using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Learun.Application.TwoDevelopment.CustomFunction
{
/// <summary>
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
/// 创 建:超级管理员
/// 日 期:2022-05-05 10:34
/// 描 述:费用登记
/// </summary>
public class CostRegistrateService : RepositoryFactory
{
#region 获取数据

/// <summary>
/// 获取页面显示列表数据
/// </summary>
/// <param name="pagination">分页参数</param>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<CostRegistrateEntity> GetPageList(Pagination pagination, string queryJson)
{
try
{
var strSql = new StringBuilder();
strSql.Append("SELECT t.* ");
strSql.Append(" FROM CostRegistrate t ");
strSql.Append(" WHERE 1=1 ");
var queryParam = queryJson.ToJObject();
// 虚拟参数
var dp = new DynamicParameters(new { });
if (!queryParam["BudgetName"].IsEmpty())
{
dp.Add("BudgetName", "%" + queryParam["BudgetName"].ToString() + "%", DbType.String);
strSql.Append(" AND t.BudgetName Like @BudgetName ");
}
if (!queryParam["PayStatus"].IsEmpty())
{
dp.Add("PayStatus", queryParam["PayStatus"].ToString(), DbType.String);
strSql.Append(" AND t.PayStatus = @PayStatus ");
}
if (!queryParam["keyValueInMessageRemind"].IsEmpty())
{
dp.Add("keyValueInMessageRemind", queryParam["keyValueInMessageRemind"].ToString(), DbType.String);
strSql.Append(" AND t.Id = @keyValueInMessageRemind ");
}
return this.BaseRepository("CollegeMIS").FindList<CostRegistrateEntity>(strSql.ToString(), dp, pagination);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取CostRegistrate表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public CostRegistrateEntity GetCostRegistrateEntity(string keyValue)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<CostRegistrateEntity>(keyValue);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 获取主表实体数据
/// </summary>
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
public CostRegistrateEntity GetEntityByProcessId(string processId)
{
try
{
return this.BaseRepository("CollegeMIS").FindEntity<CostRegistrateEntity>(t => t.ProcessId == processId);
}
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<CostRegistrateEntity>(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>
/// <param name="isMessageRemind">是否发送消息提醒</param>
/// <returns></returns>
public void SaveEntity(string keyValue, CostRegistrateEntity entity, bool isMessageRemind)
{
try
{
if (!string.IsNullOrEmpty(keyValue))
{
entity.Modify(keyValue);
this.BaseRepository("CollegeMIS").Update(entity);
}
else
{
entity.Create();
this.BaseRepository("CollegeMIS").Insert(entity);
}
if (isMessageRemind)
{
//获取实体
entity = this.BaseRepository("CollegeMIS").FindEntity<CostRegistrateEntity>(x => x.Id == entity.Id);
//提醒对象发消息提醒
var messageRemindPerson = this.BaseRepository().FindEntity<MessageRemindPersonEntity>(x => x.Type == "05");
if (messageRemindPerson != null)
{
//提醒对象包含的人员列表
var personList = new List<string>();
//角色
if (!string.IsNullOrEmpty(messageRemindPerson.RoleIds))
{
var pp = this.BaseRepository().FindList<UserRelationEntity>(x => messageRemindPerson.RoleIds.Contains(x.F_ObjectId));
if (pp.Any())
{
personList.AddRange(pp.Select(x => x.F_UserId));
}
}
//部门
if (!string.IsNullOrEmpty(messageRemindPerson.DeptIds))
{
var dd = messageRemindPerson.DeptIds.Split(',');
foreach (var item in dd)
{
var pp = this.BaseRepository().FindList<UserEntity>(x => x.F_DepartmentId.Contains(item));
if (pp.Any())
{
personList.AddRange(pp.Select(x => x.F_UserId));
}
}
}
//人员
if (!string.IsNullOrEmpty(messageRemindPerson.UserIds))
{
personList.AddRange(messageRemindPerson.UserIds.Split(','));
}
personList = personList.Distinct().ToList();
//消息提醒表增加数据
var mrList = new List<MessageRemindEntity>();
foreach (var item in personList)
{
MessageRemindEntity messageRemindEntity = new MessageRemindEntity()
{
ReceiptId = item,
ReceiptName = this.BaseRepository().FindEntity<UserEntity>(x => x.F_UserId == item)?.F_RealName,
SenderId = LoginUserInfo.Get().userId,
SenderName = LoginUserInfo.Get().realName,
TheTitle = "费用登记",
TheContent = "费用审批状态:" + (entity.CheckStatus == "0" ? "草稿" : entity.CheckStatus == "1" ? "审批中" : entity.CheckStatus == "2" ? "审批通过" : "审批不通过") + ",报销情况:" + (entity.PayStatus == "0" ? "未报销" : "已报销"),
ConnectionUrl = "/CustomFunction/CostRegistrate/Index?keyValue=",
InstanceId = entity.Id,
SendTime = DateTime.Now,
ReadSigns = false
};
messageRemindEntity.Create();
mrList.Add(messageRemindEntity);
}
this.BaseRepository().Insert(mrList);
}

}
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

/// <summary>
/// 保存实体数据(流程审批)
/// </summary>
/// <param name="processId">流程</param>
/// <param name="status">审批状态</param>
/// <returns></returns>
public void ChangeStatusByProcessId(string processId, string status)
{
try
{
this.BaseRepository("CollegeMIS").ExecuteBySql($"update CostRegistrate set CheckStatus='{status}',CheckTime='{DateTime.Now}' where ProcessId='{processId}' ");
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}

#endregion

}
}

+ 4
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj View File

@@ -91,6 +91,10 @@
<Compile Include="AssetManagementSystem\Ass_ScrapItem\Ass_ScrapItemEntity.cs" />
<Compile Include="AssetManagementSystem\Ass_ScrapItem\Ass_ScrapItemIBLL.cs" />
<Compile Include="AssetManagementSystem\Ass_ScrapItem\Ass_ScrapItemService.cs" />
<Compile Include="CustomFunction\CostRegistrate\CostRegistrateBLL.cs" />
<Compile Include="CustomFunction\CostRegistrate\CostRegistrateEntity.cs" />
<Compile Include="CustomFunction\CostRegistrate\CostRegistrateIBLL.cs" />
<Compile Include="CustomFunction\CostRegistrate\CostRegistrateService.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncBLL.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncEntity.cs" />
<Compile Include="EducationalAdministration\ArrangeLessonSync\ArrangeLessonSyncIBLL.cs" />


Loading…
Cancel
Save