diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs index 344b63923..90774f5c9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs @@ -27,7 +27,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -36,7 +36,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -72,8 +72,9 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var FD_IncomeManageData = fD_IncomeManageIBLL.GetFD_IncomeManageEntity( keyValue ); - var jsonData = new { + var FD_IncomeManageData = fD_IncomeManageIBLL.GetFD_IncomeManageEntity(keyValue); + var jsonData = new + { FD_IncomeManage = FD_IncomeManageData, }; return Success(jsonData); @@ -110,7 +111,11 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { FD_IncomeManageEntity entity = strEntity.ToObject(); - fD_IncomeManageIBLL.SaveEntity(keyValue,entity); + if (entity.IAmount <= 0) + return Fail("金额必须大于0!"); + entity.IUseAmount = 0; + entity.ISurplusAmount = entity.IAmount; + fD_IncomeManageIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs index f0fb9a53a..d2ffb3940 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs @@ -112,7 +112,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { list.Add(new { - text = item.IName, + text = item.IName + "(剩余金额:" + item.ISurplusAmount + ")", value = item.IId, }); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js index d625ee48a..a27e10c07 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js @@ -85,7 +85,7 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList', headData: [ { label: "项目编号", name: "IEnCode", width: 100, align: "left" }, @@ -119,6 +119,8 @@ var bootstrap = function ($, learun) { { label: "年度预计收入", name: "IQuota", width: 150, align: "left" }, { label: "年度实际收入", name: "IActual", width: 100, align: "left" }, { label: "金额/批复金额", name: "IAmount", width: 150, align: "left" }, + { label: "使用金额", name: "IUseAmount", width: 150, align: "left" }, + { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" }, { label: "备注", name: "IRemarks", width: 100, align: "left" }, ], mainId: 'IId', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js index 7edd190d8..ce831159d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js @@ -92,6 +92,7 @@ var bootstrap = function ($, learun) { return; } var pTopSource = $('#gridtable').jfGridValue('PTopSource'); + var type = ''; if (pTopSource == '1' || pTopSource == '2') { type = '1'; @@ -103,7 +104,7 @@ var bootstrap = function ($, learun) { if (res) { processId = learun.newGuid(); learun.postForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/ChangeStatusById', { keyValue: keyValue, processId: processId }, function (res) { - refreshGirdData(res, {}); + refreshGirdData(res, {}, type); }); } }); @@ -223,6 +224,7 @@ var bootstrap = function ($, learun) { schemeCode = 'publicFunds'; else schemeCode = 'specialUseFunds'; + if (schemeCode) { var postData = { schemeCode: schemeCode,// 填写流程对应模板编号 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config index 338d47c83..c5c4572c7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/ioc.config @@ -28,6 +28,7 @@ + @@ -66,6 +67,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_IncomeManage/FD_IncomeManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_IncomeManage/FD_IncomeManageService.cs index 5e3aec5db..900206960 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_IncomeManage/FD_IncomeManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_IncomeManage/FD_IncomeManageService.cs @@ -41,7 +41,9 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement t.IQuota, t.IAmount, t.IActual, - t.IRemarks + t.IRemarks, +isnull(t.IUseAmount,0) as IUseAmount, +isnull(t.ISurplusAmount,0) as ISurplusAmount "); strSql.Append(" FROM FD_IncomeManage t "); strSql.Append(" WHERE 1=1 and IIsDelete<>1 "); @@ -101,7 +103,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement { try { - var sql = "select IId,ITopType,ISecondType,IName,IEnCode from [dbo].[FD_IncomeManage] WHERE IIsDelete=0 "; + var sql = "select IId,ITopType,ISurplusAmount,ISecondType,IName,IEnCode from [dbo].[FD_IncomeManage] WHERE IIsDelete=0 "; if (!string.IsNullOrEmpty(budgetType)) sql += $" and ITopType='{budgetType}' "; if (!string.IsNullOrEmpty(financeBudgetType)) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageBLL.cs index 3aaa8e174..ed97f98fa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageBLL.cs @@ -167,6 +167,26 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } } + + + public void ChangeStatusByProcessId(string processId, int status) + { + try + { + fD_PayManageService.ChangeStatusByProcessId(processId, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageIBLL.cs index bba090909..66ad3c0c1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageIBLL.cs @@ -52,6 +52,12 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement /// void ChangeStatusById(string keyValue, int status, string processId); + /// + /// 流程--审核 + /// + /// + /// + void ChangeStatusByProcessId(string processId, int status); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageService.cs index 5abcaa7e7..8ac9a542d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FD_PayManage/FD_PayManageService.cs @@ -50,7 +50,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement t.PStatus "); strSql.Append(" FROM FD_PayManage t "); - strSql.Append(" WHERE 1=1 "); + strSql.Append(" WHERE 1=1 and PIsDelete<>1"); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); @@ -232,6 +232,48 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } + + /// + /// 修改审批状态 + /// + /// + /// + public void ChangeStatusByProcessId(string processId, int status) + { + var db = BaseRepository("CollegeMIS").BeginTrans(); + try + { + var entity = db.FindEntity(x => x.PProcessId == processId); + //审批通过操作 + if (status == 2) + { + var incomeEntity = db.FindEntity(x => x.IId == entity.PIncomeId); + if (incomeEntity != null) + { + //使用金额 + if ((incomeEntity.IUseAmount + entity.PAmount) <= incomeEntity.IAmount) + { + incomeEntity.IUseAmount += entity.PAmount; + incomeEntity.ISurplusAmount = incomeEntity.IAmount - incomeEntity.IUseAmount; + db.Update(incomeEntity); + } + else + { + status = 0; + } + } + } + + entity.PStatus = status; + db.Update(entity); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + throw ExceptionEx.ThrowServiceException(ex); + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj index 4de400084..328580d7e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/Learun.Application.WorkFlow.csproj @@ -96,6 +96,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/FD_PayManageMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/FD_PayManageMethod.cs new file mode 100644 index 000000000..0799996c7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/FD_PayManageMethod.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement; + +namespace Learun.Application.WorkFlow +{ + public class FD_PayManageMethod : IWorkFlowMethod + { + FD_PayManageIBLL fD_PayManage = new FD_PayManageBLL(); + + + public void Execute(WfMethodParameter parameter) + { + if (parameter.code == "agree") + { + fD_PayManage.ChangeStatusByProcessId(parameter.processId, 2); + } + else + { + fD_PayManage.ChangeStatusByProcessId(parameter.processId, 0); + } + } + } +}