@@ -0,0 +1,194 @@ | |||
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 PaymentAccountController : MvcControllerBase | |||
{ | |||
private PaymentAccountIBLL paymentAccountIBLL = new PaymentAccountBLL(); | |||
#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 ReceiptForm() | |||
{ | |||
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 = paymentAccountIBLL.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 PaymentAccountData = paymentAccountIBLL.GetPaymentAccountEntity( keyValue ); | |||
var jsonData = new { | |||
PaymentAccount = PaymentAccountData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例主键</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetFormDataByProcessId(string processId) | |||
{ | |||
var PaymentAccountData = paymentAccountIBLL.GetEntityByProcessId( processId ); | |||
var jsonData = new { | |||
PaymentAccount = PaymentAccountData, | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult DeleteForm(string keyValue) | |||
{ | |||
paymentAccountIBLL.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(); | |||
PaymentAccountEntity entity = strEntity.ToObject<PaymentAccountEntity>(); | |||
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; | |||
} | |||
paymentAccountIBLL.SaveEntity(keyValue, entity, false); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="strEntity">实体</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveReceiptForm(string keyValue, string strEntity) | |||
{ | |||
var loginUserInfo = LoginUserInfo.Get(); | |||
PaymentAccountEntity entity = strEntity.ToObject<PaymentAccountEntity>(); | |||
entity.PayUserId = loginUserInfo.userId; | |||
entity.PayUserName = loginUserInfo.realName; | |||
entity.PayTime = DateTime.Now; | |||
paymentAccountIBLL.SaveEntity(keyValue, entity,true); | |||
return Success("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 提交实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult ChangeStatusById(string keyValue,string processId) | |||
{ | |||
var entity = paymentAccountIBLL.GetPaymentAccountEntity(keyValue); | |||
if (entity != null) | |||
{ | |||
entity.ProcessId = processId; | |||
entity.CheckStatus = "1"; | |||
paymentAccountIBLL.SaveEntity(keyValue, entity,false); | |||
} | |||
return Success("提交成功!"); | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,19 @@ | |||
@{ | |||
ViewBag.Title = "付款记账"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">对方单位<font face="宋体">*</font></div> | |||
<input id="UnitName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">合同名称<font face="宋体">*</font></div> | |||
<input id="ContractName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<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/PaymentAccount/Form.js") |
@@ -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/PaymentAccount/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/PaymentAccount/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 == 'PaymentAccount' && 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/PaymentAccount/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,53 @@ | |||
@{ | |||
/**/ | |||
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="UnitName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">合同名称</div> | |||
<input id="ContractName" 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> 新增</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | |||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> | |||
<a id="lr_receipt" class="btn btn-default"><i class="fa fa-plus"></i> 填汇款回单</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> 管理提醒对象</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/CustomFunction/Views/PaymentAccount/Index.js") |
@@ -0,0 +1,226 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-05-05 10:34 | |||
* 描 述:付款记账 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var processId = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#PayStatus').lrDataItemSelect({ code: 'PaymentAccountPayStatus' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 新增 | |||
$('#lr_add').on('click', function () { | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '新增', | |||
url: top.$.rootUrl + '/CustomFunction/PaymentAccount/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/PaymentAccount/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/PaymentAccount/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) { | |||
processId = learun.newGuid(); | |||
learun.postForm(top.$.rootUrl + '/CustomFunction/PaymentAccount/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) { | |||
refreshGirdData(res, {}); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 填汇款回单 | |||
$('#lr_receipt').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.layerForm({ | |||
id: 'receiptform', | |||
title: '上传汇款回单', | |||
url: top.$.rootUrl + '/CustomFunction/PaymentAccount/ReceiptForm?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_messageRemindPerson').on('click', function () { | |||
learun.layerForm({ | |||
id: 'formInMessageRemindPerson', | |||
title: '管理提醒对象', | |||
url: top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/Form?type=04', | |||
width: 600, | |||
height: 400, | |||
callBack: function (id) { | |||
return top[id].acceptClick(); | |||
} | |||
}); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGridLei({ | |||
url: top.$.rootUrl + '/CustomFunction/PaymentAccount/GetPageList', | |||
headData: [ | |||
{ label: "对方单位", name: "UnitName", width: 100, align: "left" }, | |||
{ label: "合同名称", name: "ContractName", 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: "Files", width: 100, align: "left" }, | |||
{ | |||
label: "付款状态", name: "PayStatus", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'PaymentAccountPayStatus', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sord: 'desc', | |||
sidx: 'CreateTime' | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function (res, postData) { | |||
if (res && res.code && res.code == 200) { | |||
// 发起流程 | |||
var postData = { | |||
schemeCode: 'PaymentAccount',// 填写流程对应模板编号 | |||
processId: processId, | |||
level: '1', | |||
}; | |||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||
learun.loading(false); | |||
}); | |||
} | |||
page.search(); | |||
}; | |||
page.init(); | |||
} |
@@ -0,0 +1,27 @@ | |||
@{ | |||
ViewBag.Title = "付款记账"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">对方单位<font face="宋体">*</font></div> | |||
<input id="UnitName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">合同名称<font face="宋体">*</font></div> | |||
<input id="ContractName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly="readonly"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">付款金额<font face="宋体">*</font></div> | |||
<input id="Money" type="text" class="form-control" isvalid="yes" checkexpession="Num" readonly="readonly"/> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">上传汇款回单</div> | |||
<div id="Files" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="PaymentAccount" > | |||
<div class="lr-form-item-title">付款状态<font face="宋体">*</font></div> | |||
<div id="PayStatus" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/CustomFunction/Views/PaymentAccount/ReceiptForm.js") |
@@ -0,0 +1,106 @@ | |||
/* * 版 本 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 () { | |||
$('#Files').lrUploader(); | |||
$('#PayStatus').lrDataItemSelect({ code: 'PaymentAccountPayStatus' }); | |||
}, | |||
initData: function () { | |||
if (!!keyValue) { | |||
$.lrSetForm(top.$.rootUrl + '/CustomFunction/PaymentAccount/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/PaymentAccount/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 == 'PaymentAccount' && 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/PaymentAccount/SaveReceiptForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -74,7 +74,6 @@ var bootstrap = function ($, learun) { | |||
var postData = { | |||
strEntity: JSON.stringify($('body').lrGetFormData()) | |||
}; | |||
console.log(postData); | |||
$.lrSaveForm(top.$.rootUrl + '/LR_Desktop/MessageRemindPerson/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
@@ -878,6 +878,7 @@ | |||
<Compile Include="Areas\PersonnelManagement\Controllers\DT_EvaluationDataController.cs" /> | |||
<Compile Include="Areas\PersonnelManagement\Controllers\DT_EvaluationDataMainController.cs" /> | |||
<Compile Include="Areas\LR_Desktop\Controllers\MessageRemindPersonController.cs" /> | |||
<Compile Include="Areas\CustomFunction\Controllers\PaymentAccountController.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Content Include="Areas\AdmissionsPlatform\Views\AP_OnlineUserInfo\DropOutIndex.js" /> | |||
@@ -1013,6 +1014,7 @@ | |||
<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\PaymentAccount\ReceiptForm.js" /> | |||
<Content Include="Areas\CustomFunction\Views\SecurityCheckManage\Form2.js" /> | |||
<Content Include="Areas\CustomFunction\Views\SecurityCheckManage\Index2.js" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleAccident\IndexTJ.js" /> | |||
@@ -6768,6 +6770,10 @@ | |||
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Index.js" /> | |||
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Form.cshtml" /> | |||
<Content Include="Areas\LR_Desktop\Views\MessageRemindPerson\Form.js" /> | |||
<Content Include="Areas\CustomFunction\Views\PaymentAccount\Index.cshtml" /> | |||
<Content Include="Areas\CustomFunction\Views\PaymentAccount\Index.js" /> | |||
<Content Include="Areas\CustomFunction\Views\PaymentAccount\Form.cshtml" /> | |||
<Content Include="Areas\CustomFunction\Views\PaymentAccount\Form.js" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Folder Include="Areas\LR_Desktop\Models\" /> | |||
@@ -7671,6 +7677,7 @@ | |||
<Content Include="Areas\PersonnelManagement\Views\DT_EvaluationDataMain\IndexXF.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\DT_EvaluationDataMain\FormXF.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\DT_EvaluationData\IndexXZDetail.cshtml" /> | |||
<Content Include="Areas\CustomFunction\Views\PaymentAccount\ReceiptForm.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\MeetingManagement\IndexOfMyJoin.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\MeetingSignInRecord\IndexAttendance.cshtml" /> | |||
@@ -31,6 +31,7 @@ | |||
<typeAlias alias="DispatchMethod" type="Learun.Application.WorkFlow.DispatchMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="DtStuLeaveMethod" type="Learun.Application.WorkFlow.DtStuLeaveMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="HonorMethod" type="Learun.Application.WorkFlow.HonorMethod,Learun.Application.WorkFlow" /> | |||
<typeAlias alias="PaymentAccountMethod" type="Learun.Application.WorkFlow.PaymentAccountMethod,Learun.Application.WorkFlow" /> | |||
<!--任务调度器--> | |||
<typeAlias alias="ITSMethod" type="Learun.Application.Extention.TaskScheduling.ITsMethod,Learun.Application.Extention" /> | |||
@@ -72,6 +73,7 @@ | |||
<type type="IWorkFlowMethod" mapTo="DispatchMethod" name="DispatchMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="DtStuLeaveMethod" name="DtStuLeaveMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="HonorMethod" name="HonorMethod"></type> | |||
<type type="IWorkFlowMethod" mapTo="PaymentAccountMethod" name="PaymentAccountMethod"></type> | |||
</container> | |||
@@ -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 PaymentAccountMap : EntityTypeConfiguration<PaymentAccountEntity> | |||
{ | |||
public PaymentAccountMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("PAYMENTACCOUNT"); | |||
//主键 | |||
this.HasKey(t => t.Id); | |||
#endregion | |||
#region 配置关系 | |||
#endregion | |||
} | |||
} | |||
} | |||
@@ -627,6 +627,7 @@ | |||
<Compile Include="PersonnelManagement\DT_EvaluationDataMap.cs" /> | |||
<Compile Include="PersonnelManagement\DT_EvaluationDataMainMap.cs" /> | |||
<Compile Include="LR_Desktop\MessageRemindPersonMap.cs" /> | |||
<Compile Include="CustomFunction\PaymentAccountMap.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -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 PaymentAccountBLL : PaymentAccountIBLL | |||
{ | |||
private PaymentAccountService paymentAccountService = new PaymentAccountService(); | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<PaymentAccountEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return paymentAccountService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取PaymentAccount表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public PaymentAccountEntity GetPaymentAccountEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return paymentAccountService.GetPaymentAccountEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
public PaymentAccountEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return paymentAccountService.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 | |||
{ | |||
paymentAccountService.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, PaymentAccountEntity entity, bool isMessageRemind) | |||
{ | |||
try | |||
{ | |||
paymentAccountService.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 | |||
{ | |||
paymentAccountService.ChangeStatusByProcessId(processId, status); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -0,0 +1,130 @@ | |||
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 PaymentAccountEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
/// Id | |||
/// </summary> | |||
[Column("ID")] | |||
public string Id { get; set; } | |||
/// <summary> | |||
/// 对方单位 | |||
/// </summary> | |||
[Column("UNITNAME")] | |||
public string UnitName { get; set; } | |||
/// <summary> | |||
/// 合同名称 | |||
/// </summary> | |||
[Column("CONTRACTNAME")] | |||
public string ContractName { 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("FILES")] | |||
public string Files { get; set; } | |||
/// <summary> | |||
/// 付款状态(已付款/部分付款/合同结清) | |||
/// </summary> | |||
[Column("PAYSTATUS")] | |||
public string PayStatus { 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; } | |||
/// <summary> | |||
/// ProcessId | |||
/// </summary> | |||
[Column("PROCESSID")] | |||
public string ProcessId { get; set; } | |||
/// <summary> | |||
/// 审批时间 | |||
/// </summary> | |||
[Column("CHECKTIME")] | |||
public DateTime? CheckTime { 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; } | |||
#endregion | |||
#region 扩展操作 | |||
/// <summary> | |||
/// 新增调用 | |||
/// </summary> | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
public void Modify(string keyValue) | |||
{ | |||
this.Id = keyValue; | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
#endregion | |||
} | |||
} | |||
@@ -0,0 +1,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 PaymentAccountIBLL | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<PaymentAccountEntity> GetPageList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取PaymentAccount表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
PaymentAccountEntity GetPaymentAccountEntity(string keyValue); | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
PaymentAccountEntity 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, PaymentAccountEntity entity, bool isMessageRemind); | |||
/// <summary> | |||
/// 保存实体数据(流程审批) | |||
/// </summary> | |||
/// <param name="processId">流程</param> | |||
/// <param name="status">审批状态</param> | |||
/// <returns></returns> | |||
void ChangeStatusByProcessId(string processId, string status); | |||
#endregion | |||
} | |||
} |
@@ -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 PaymentAccountService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<PaymentAccountEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT t.* "); | |||
strSql.Append(" FROM PaymentAccount t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["UnitName"].IsEmpty()) | |||
{ | |||
dp.Add("UnitName", "%" + queryParam["UnitName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.UnitName Like @UnitName "); | |||
} | |||
if (!queryParam["ContractName"].IsEmpty()) | |||
{ | |||
dp.Add("ContractName", "%" + queryParam["ContractName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.ContractName Like @ContractName "); | |||
} | |||
if (!queryParam["PayStatus"].IsEmpty()) | |||
{ | |||
dp.Add("PayStatus", queryParam["PayStatus"].ToString(), DbType.String); | |||
strSql.Append(" AND t.PayStatus = @PayStatus "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<PaymentAccountEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取PaymentAccount表实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public PaymentAccountEntity GetPaymentAccountEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<PaymentAccountEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取主表实体数据 | |||
/// </summary> | |||
/// <param name="processId">流程实例ID</param> | |||
/// <returns></returns> | |||
public PaymentAccountEntity GetEntityByProcessId(string processId) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<PaymentAccountEntity>(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<PaymentAccountEntity>(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, PaymentAccountEntity 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<PaymentAccountEntity>(x => x.Id == entity.Id); | |||
//提醒对象发消息提醒 | |||
var messageRemindPerson = this.BaseRepository().FindEntity<MessageRemindPersonEntity>(x => x.Type == "04"); | |||
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" ? "未付款" : entity.PayStatus == "1" ? "已付款" : entity.PayStatus == "2" ? "部分付款" : "合同结清"), | |||
ConnectionUrl = "/CustomFunction/PaymentAccount/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 PaymentAccount set CheckStatus='{status}',CheckTime='{DateTime.Now}' where ProcessId='{processId}' "); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
} |
@@ -1927,6 +1927,10 @@ | |||
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonService.cs" /> | |||
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonBLL.cs" /> | |||
<Compile Include="LR_Desktop\MessageRemindPerson\MessageRemindPersonIBLL.cs" /> | |||
<Compile Include="CustomFunction\PaymentAccount\PaymentAccountEntity.cs" /> | |||
<Compile Include="CustomFunction\PaymentAccount\PaymentAccountService.cs" /> | |||
<Compile Include="CustomFunction\PaymentAccount\PaymentAccountBLL.cs" /> | |||
<Compile Include="CustomFunction\PaymentAccount\PaymentAccountIBLL.cs" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<ProjectReference Include="..\..\..\Learun.Application.Organization\Learun.Application.Organization.csproj"> | |||
@@ -96,6 +96,7 @@ | |||
<Compile Include="NodeMethod\ArrangeLessonTermAttemperMethod.cs" /> | |||
<Compile Include="NodeMethod\ADR_AddApplyMethod.cs" /> | |||
<Compile Include="NodeMethod\Ass_AcceptanceMethod.cs" /> | |||
<Compile Include="NodeMethod\PaymentAccountMethod.cs" /> | |||
<Compile Include="NodeMethod\Ass_ReceiveMethod.cs" /> | |||
<Compile Include="NodeMethod\HonorMethod.cs" /> | |||
<Compile Include="NodeMethod\DtStuLeaveMethod.cs" /> | |||
@@ -0,0 +1,26 @@ | |||
using Learun.Application.TwoDevelopment.CustomFunction; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Linq; | |||
using System.Text; | |||
using System.Threading.Tasks; | |||
namespace Learun.Application.WorkFlow | |||
{ | |||
public class PaymentAccountMethod : IWorkFlowMethod | |||
{ | |||
PaymentAccountIBLL paymentAccountIBLL = new PaymentAccountBLL(); | |||
public void Execute(WfMethodParameter parameter) | |||
{ | |||
if (parameter.code == "agree") | |||
{ | |||
paymentAccountIBLL.ChangeStatusByProcessId(parameter.processId, "2"); | |||
} | |||
else | |||
{ | |||
paymentAccountIBLL.ChangeStatusByProcessId(parameter.processId, "3"); | |||
} | |||
} | |||
} | |||
} |