diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_ServiceController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_ServiceController.cs new file mode 100644 index 000000000..19153f5d4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_ServiceController.cs @@ -0,0 +1,187 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_ServiceController : MvcControllerBase + { + private Purchase_ServiceIBLL Purchase_ServiceIBLL = new Purchase_ServiceBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单查看页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + #endregion + + #region 获取数据 + /// + /// 获取数据字典明显根据分类编号 + /// + /// 分类编号 + /// 查询条件 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetDetailList(string keyword) + { + var data = Purchase_ServiceIBLL.GetDataList( keyword); + return JsonResult(data); + } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = Purchase_ServiceIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Purchase_ServiceData = Purchase_ServiceIBLL.GetPurchase_ServiceEntity( keyValue ); + var Purchase_Service_DetailsData = Purchase_ServiceIBLL.GetPurchase_Service_DetailsList( Purchase_ServiceData.Id ); + var jsonData = new { + Purchase_Service = Purchase_ServiceData, + Purchase_Service_Details = Purchase_Service_DetailsData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDetailData(string keyValue) + { + var Purchase_Service_DetailsData = Purchase_ServiceIBLL.GetPurchase_Service_DetailsList(keyValue); + + return Success(Purchase_Service_DetailsData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var ArrangeLessonTermAttemperData = Purchase_ServiceIBLL.GetEntityByProcessId(processId); + var Purchase_Service_DetailsData = Purchase_ServiceIBLL.GetPurchase_Service_DetailsList(ArrangeLessonTermAttemperData.Id); + var jsonData = new + { + Purchase_Service = ArrangeLessonTermAttemperData, + Purchase_Service_Details = Purchase_Service_DetailsData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + Purchase_ServiceIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity, string strPurchase_Service_DetailsList) + { + Purchase_ServiceEntity entity = strEntity.ToObject(); + List Purchase_Service_DetailsList = strPurchase_Service_DetailsList.ToObject>(); + Purchase_ServiceIBLL.SaveEntity(keyValue,entity,Purchase_Service_DetailsList); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动主键 + /// 审核状态 + /// 流程Id + /// + public ActionResult ModifyStatus(string keyValue, int status, string processId) + { + Purchase_ServiceIBLL.ModifyStatus(keyValue, status, processId); + return Success("提交成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_Service_ApplyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_Service_ApplyController.cs new file mode 100644 index 000000000..4350ee2f9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_Service_ApplyController.cs @@ -0,0 +1,172 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplyController : MvcControllerBase + { + private Purchase_Service_ApplyIBLL Purchase_Service_ApplyIBLL = new Purchase_Service_ApplyBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 查看页面 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + /// + /// 查找带回页面 + /// + /// + [HttpGet] + public ActionResult FindBack() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = Purchase_Service_ApplyIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Purchase_Service_applyData = Purchase_Service_ApplyIBLL.GetPurchase_Service_ApplyEntity( keyValue ); + var Purchase_Service_applydetailsData = Purchase_Service_ApplyIBLL.GetPurchase_Service_ApplydetailsList( Purchase_Service_applyData.Id ); + //var Purchase_ServiceData = Purchase_Service_ApplyIBLL.GetPurchase_ServiceEntity( Purchase_Service_applydetailsData.purchaseid ); + var jsonData = new { + Purchase_Service_apply = Purchase_Service_applyData, + Purchase_Service_applydetails = Purchase_Service_applydetailsData, + //Purchase_Service = Purchase_ServiceData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var Data = Purchase_Service_ApplyIBLL.GetEntityByProcessId(processId); + var Purchase_Service_DetailsData = Purchase_Service_ApplyIBLL.GetPurchase_Service_ApplydetailsList(Data.Id); + var jsonData = new + { + Purchase_Service_apply = Data, + Purchase_Service_applydetails = Purchase_Service_DetailsData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + Purchase_Service_ApplyIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity, string strPurchase_Service_applydetailsList, string strPurchase_ServiceEntity) + { + Purchase_Service_ApplyEntity entity = strEntity.ToObject(); + List Purchase_Service_applydetailsList = strPurchase_Service_applydetailsList.ToObject>(); + Purchase_Service_ApplyIBLL.SaveEntity(keyValue,entity,Purchase_Service_applydetailsList); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动主键 + /// 审核状态 + /// 流程Id + /// + public ActionResult ModifyStatus(string keyValue, int status, string processId) + { + Purchase_Service_ApplyIBLL.ModifyStatus(keyValue, status, processId); + return Success("提交成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_TravelController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_TravelController.cs new file mode 100644 index 000000000..a926eff42 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_TravelController.cs @@ -0,0 +1,174 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_TravelController : MvcControllerBase + { + private Purchase_TravelIBLL Purchase_TravelIBLL = new Purchase_TravelBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单查看页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + #endregion + + #region 获取数据 + /// + /// 获取数据字典明显根据分类编号 + /// + /// 分类编号 + /// 查询条件 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetDetailList(string keyword) + { + var data = Purchase_TravelIBLL.GetDataList( keyword); + return JsonResult(data); + } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = Purchase_TravelIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Purchase_TravelData = Purchase_TravelIBLL.GetPurchase_TravelEntity( keyValue ); + //var Purchase_Travel_DetailsData = Purchase_TravelIBLL.GetPurchase_Travel_DetailsList( Purchase_TravelData.Id ); + var jsonData = new { + Purchase_Travel = Purchase_TravelData, + //Purchase_Travel_Details = Purchase_Travel_DetailsData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var ArrangeLessonTermAttemperData = Purchase_TravelIBLL.GetEntityByProcessId(processId); + //var Purchase_Travel_DetailsData = Purchase_TravelIBLL.GetPurchase_Travel_DetailsList(ArrangeLessonTermAttemperData.Id); + var jsonData = new + { + Purchase_Travel = ArrangeLessonTermAttemperData, + //Purchase_Travel_Details = Purchase_Travel_DetailsData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + Purchase_TravelIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity, string strPurchase_Travel_DetailsList) + { + Purchase_TravelEntity entity = strEntity.ToObject(); + // List Purchase_Travel_DetailsList = strPurchase_Travel_DetailsList.ToObject>(); + Purchase_TravelIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动主键 + /// 审核状态 + /// 流程Id + /// + public ActionResult ModifyStatus(string keyValue, int status, string processId) + { + Purchase_TravelIBLL.ModifyStatus(keyValue, status, processId); + return Success("提交成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_Travel_ApplyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_Travel_ApplyController.cs new file mode 100644 index 000000000..0dac34175 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Purchase_Travel_ApplyController.cs @@ -0,0 +1,172 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplyController : MvcControllerBase + { + private Purchase_Travel_ApplyIBLL Purchase_Travel_ApplyIBLL = new Purchase_Travel_ApplyBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 查看页面 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + /// + /// 查找带回页面 + /// + /// + [HttpGet] + public ActionResult FindBack() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = Purchase_Travel_ApplyIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Purchase_Travel_applyData = Purchase_Travel_ApplyIBLL.GetPurchase_Travel_ApplyEntity( keyValue ); + var Purchase_Travel_applydetailsData = Purchase_Travel_ApplyIBLL.GetPurchase_Travel_ApplydetailsList( Purchase_Travel_applyData.Id ); + //var Purchase_TravelData = Purchase_Travel_ApplyIBLL.GetPurchase_TravelEntity( Purchase_Travel_applydetailsData.purchaseid ); + var jsonData = new { + Purchase_Travel_apply = Purchase_Travel_applyData, + Purchase_Travel_applydetails = Purchase_Travel_applydetailsData, + //Purchase_Travel = Purchase_TravelData, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormDataByProcessId(string processId) + { + var Data = Purchase_Travel_ApplyIBLL.GetEntityByProcessId(processId); + var Purchase_Travel_DetailsData = Purchase_Travel_ApplyIBLL.GetPurchase_Travel_ApplydetailsList(Data.Id); + var jsonData = new + { + Purchase_Travel_apply = Data, + Purchase_Travel_applydetails = Purchase_Travel_DetailsData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + Purchase_Travel_ApplyIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity, string strPurchase_Travel_applydetailsList, string strPurchase_TravelEntity) + { + Purchase_Travel_ApplyEntity entity = strEntity.ToObject(); + List Purchase_Travel_applydetailsList = strPurchase_Travel_applydetailsList.ToObject>(); + Purchase_Travel_ApplyIBLL.SaveEntity(keyValue,entity,Purchase_Travel_applydetailsList); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动主键 + /// 审核状态 + /// 流程Id + /// + public ActionResult ModifyStatus(string keyValue, int status, string processId) + { + Purchase_Travel_ApplyIBLL.ModifyStatus(keyValue, status, processId); + return Success("提交成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Form.cshtml new file mode 100644 index 000000000..ff2afa9aa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Form.cshtml @@ -0,0 +1,32 @@ +@{ + ViewBag.Title = "申请类"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
部门*
+ + +
+
+
申请人*
+ + +
+
+
总价格*
+ +
+
+
备注
+ +
+
+
附件上传
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Form.js new file mode 100644 index 000000000..296954025 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Form.js @@ -0,0 +1,141 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-25 18:33 + * 描 述:申请类 + */ +var acceptClick; +var computeamount; +var userinfo; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + userinfo = learun.clientdata.get(['userinfo']);//用户数据 + console.log(userinfo) + page.bind(); + page.initData(); + }, + bind: function () { + //加载部门、用户 + $('#DepartmentId')[0].lrvalue = userinfo.departmentId; + learun.clientdata.getAsync('department', { + key: userinfo.departmentId, + callback: function (_data) { + $('#DepartmentId').val(_data.name); + $('#DepartmentName')[0].lrvalue = _data.name; + } + }); + //加载用户 + $('#CreatorId')[0].lrvalue = userinfo.userId; + $('#CreatorName')[0].lrvalue = userinfo.realName; + $('#CreatorId').val(userinfo.realName); + + + $('#FilePath').lrUploader(); + $('#Purchase_Service_Details').jfGrid({ + headData: [ + { + label: '劳务维修内容', name: 'ServiceContent', width: 150, align: 'left', + edit: { + type:'input' + } + }, + { + label: '估值', name: 'Price', width:100, align: 'left', + edit: { + type: 'input', + init: function (data, $edit) {// 在点击单元格的时候触发,可以用来初始化输入控件,行数据和控件对象 + + }, + change: function (data, num) {// 行数据和行号 + if (!isNaN(data.Price)) { + computeamount(); + } else { + learun.alert.warning("只能是数字"); + data.Price=0 + } + } + } + }, + { + label: '人数', name: 'Peoplecount', width: 100, align: 'left', + edit: { + type: 'input', + } + }, + { + label: '天数', name: 'Days', width: 100, align: 'left', + edit: { + type:'input' + } + }, + { + label: '标准', name: 'Standar', width: 100, align: 'left', + edit: { + type:'input' + } + }, + { + label: 'Id', name: 'Id', width: 100, align: 'left', ishide: true + }, + ], + isEdit: true, + height: 400, + onMinusRow: function (row, rows) {//行数据和所有行数据 + computeamount(); + }, + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + }, + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Service"]').lrGetFormData()); + postData.strPurchase_Service_DetailsList = JSON.stringify($('#Purchase_Service_Details').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + computeamount= function () { + var rowdatas = $('#Purchase_Service_Details').jfGridGet('rowdatas'); + var totalamount = 0; + for (var i = 0; i < rowdatas.length; i++) { + if (rowdatas[i].Price) { + totalamount += parseFloat( rowdatas[i].Price); + } + } + $('#TotalAmount').val(totalamount); + if ($("#TotalAmount").val() != '') { + if (parseFloat($("#TotalAmount").val()) > 0) { + if ($('#TotalAmount').parent().find('.lr-field-error-info').length > 0) { + $('#TotalAmount').parent().find('.lr-field-error-info')[0].remove(); + $('#TotalAmount').removeClass('lr-field-error'); + } + } + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/FormView.cshtml new file mode 100644 index 000000000..99a09c799 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/FormView.cshtml @@ -0,0 +1,56 @@ +@{ + ViewBag.Title = "教学调度"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+ +
+
部门*
+ + +
+
+
申请人*
+ + +
+
+
总价格*
+ +
+
+
备注
+ +
+
+
附件上传
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/FormView.js new file mode 100644 index 000000000..27f6c30ec --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/FormView.js @@ -0,0 +1,131 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-09-26 10:47 + * 描 述:办公采购申请 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +//绑定原课程安排 +var bindData; +//绑定新课程安排 +var bindDataNew; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + ////加载部门、用户 + //$('#DepartmentId')[0].lrvalue = userinfo.departmentId; + //learun.clientdata.getAsync('department', { + // key: userinfo.departmentId, + // callback: function (_data) { + // $('#DepartmentId').val(_data.name); + // $('#DepartmentName')[0].lrvalue = _data.name; + // } + //}); + ////加载用户 + //$('#CreatorId')[0].lrvalue = userinfo.userId; + //$('#CreatorName')[0].lrvalue = userinfo.realName; + //$('#CreatorId').val(userinfo.realName); + + + $('#FilePath').lrUploader({ isUpload: false }); + $('#Purchase_Service_Details').jfGrid({ + headData: [ + { label: '劳务维修内容', name: 'ServiceContent', width: 100, align: 'left' }, + { label: '估值', name: 'Price', width: 100, align: 'left' }, + { label: '人数', name: 'Peoplecount', width: 100, align: 'left' }, + { label: '天数', name: 'Days', width: 100, align: 'left' }, + { label: '标准', name: 'Standar', width: 100, align: 'left' }, + { label: 'Id', name: 'Id', width: 100, align: 'left', ishide: true }, + ], + isEdit: false, + height: 400, + onMinusRow: function (row, rows) {//行数据和所有行数据 + computeamount(); + }, + }); + }, + initData: function () { + console.log(keyValue) + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service/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 + '/LogisticsManagement/Purchase_Service/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 == 'ArrangeLessonTermAttemper') { + keyValue = data[id].Id; + //} + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + + if (!!processId) { + formData.ProcessId = processId; + } + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Service"]').lrGetFormData()); + postData.strPurchase_Service_DetailsList = JSON.stringify($('#Purchase_Service_Details').jfGridGet('rowdatas')); + //var postData = { + // strEntity: JSON.stringify(formData) + //}; + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Index.cshtml new file mode 100644 index 000000000..fe7bd14a5 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Index.cshtml @@ -0,0 +1,49 @@ +@{ + ViewBag.Title = "申请类"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
备注关键字
+ +
+
+
审核状态
+
+
+
+
报账状态
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Index.js new file mode 100644 index 000000000..3436eb2af --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service/Index.js @@ -0,0 +1,264 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-25 18:33 + * 描 述:申请类 + */ +var refreshGirdData; +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + var logbegin = ''; + var logend = ''; + var processId = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + selectfn: function (begin, end) { + logbegin = begin; + logend = end; + + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#checkstatus').lrselect({ + data: [{ text: '待审核', value: '0' }, { text: '审核中', value: '1' }, { text: '已审核', value: '2' }], + text: 'text', + value: 'value', + }); + $('#ApplyStatus').lrselect({ + data: [{ text: '待报账', value: '0' }, { text: '报账中', value: '1' }, { text: '已报账', value: '2' }], + text: 'text', + value: 'value', + }); + // 刷新 + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/Form', + width: 1000, + height: 800, + callBack: function (id) { + //res = top[id].save('', function () { + // page.search(); + //}); + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status == 1) {//提交 + learun.alert.warning("当前课程异动记录已提交!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/Form?keyValue=' + keyValue, + width: 1000, + height: 800, + callBack: function (id) { + var res = false; + // 验证数据 + //res = top[id].validForm(); + // 保存数据 + //if (res) { + //res = top[id].save('', function () { + // page.search(); + //}); + return top[id].acceptClick(refreshGirdData); + //} + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status !== 0) { + learun.alert.warning("当前课程异动记录已提交,无法删除!"); + return false; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service/DeleteForm', { keyValue: keyValue}, function () { + //refreshGirdData(); + page.search(); + }); + } + }); + } + }); + // 提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status !== 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service/ModifyStatus', { keyValue: keyValue, status: 1, processId: processId }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + // 查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/GetPageList', + headData: [ + { label: "部门", name: "DepartmentId", width: 150, align: "left", + formatter: function (cellvalue, row) { + return row.DepartmentName; + } + }, + { + label: "申请人", name: "CreatorId", width: 100, align: "left", + formatter: function (cellvalue, row) { + return row.CreatorName; + } + }, + { label: "总价格", name: "TotalAmount", width: 100, align: "left"}, + { label: "备注", name: "Remark", width: 100, align: "left"}, + + { label: "提交时间", name: "SubmitTime", width: 130, align: "left" }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '未提交'; + } + } + }, + //{ + // label: "审核用户", name: "CheckUserId", width: 100, align: "left", + // formatter: function (cellvalue, row) { + // return row.CheckUserName; + // } + //}, + { label: "审核时间", name: "CheckTime", width: 130, align: "left" }, + { + label: "审核状态", name: "CheckStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '审核中'; + } else if (cellvalue == 2) { + return '审核通过'; + } else { + return '草稿'; + } + } + }, + { + label: "报账状态", name: "ApplyStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + console.log(cellvalue) + if (cellvalue == 0) { + return '待报账'; + } else if (cellvalue == 1) { + return '报账中'; + } else if (cellvalue == 2) { + return '已报账'; + } + } + }, + ], + mainId:'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = logbegin; + param.EndTime = logend; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + if (res && res.code && res.code == 200) { + // 发起流程 + var postData = { + schemeCode: '1-14',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + } + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.cshtml new file mode 100644 index 000000000..6fe02938b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.cshtml @@ -0,0 +1,33 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+ @*
+
+
+
+
填报部门
+
+
+
+
收款人
+ +
+
+
+
*@ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.js new file mode 100644 index 000000000..f1878c259 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FindBack.js @@ -0,0 +1,158 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-07-14 12:15 + * 描 述:教务报账申请 + */ +var acceptClick; +var refreshGirdData; +var list=[]; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DepartmentId').lrDepartmentSelect(); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/GetPageList', + headData: [ + { + label: "部门", name: "DepartmentId", width: 150, align: "left", + formatter: function (cellvalue, row) { + return row.DepartmentName; + } + }, + { + label: "申请人", name: "CreatorId", width: 100, align: "left", + formatter: function (cellvalue, row) { + return row.CreatorName; + } + }, + { label: "总价格", name: "TotalAmount", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true, + isMultiselect: true, + onSelectRow: function (rowdata, type) { + if (type) { + list.push(rowdata) + //let temp = {} + //list = list.reduce((prev, curv) => { + // if (temp[curv.StuNo]) { } + // else { + // temp[curv.StuNo] = true + // prev.push(curv) + // } + // return prev + //}, []) + } else { + list = $.grep(list, function (item, index) { + return item.Id!=rowdata.Id + }) + + } + console.log(list) + }, + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/GetFormDetailData?keyValue=' + rowItem.Id, + headData: [ + { label: "采购物品名称", name: "Name", width: 100, align: "left" }, + { label: "价格", name: "Price", width: 130, align: "left" }, + { label: "采购数量", name: "Quantity", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 150, align: "left" }, + { label: "用途", name: "UseTo", width: 150, align: "left" }, + ], + mainId: 'LessonNo', + isPage: false, + sidx: 'ReviewTime desc' + }); + var param; + param = param || {}; + param.StuNo = rowItem.StuNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + param.ApplyStatus = 0; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + // 保存数据 + acceptClick = function (callBack) { + //console.log(list) + if (list.length > 0) { + if (!!callBack) { + callBack(list); + return true; + } + } else { + + } + //if (!$('body').lrValidform()) { + // return false; + //} + //var postData = {}; + //postData.strEntity = JSON.stringify($('[data-table="Purchase_Service_apply"]').lrGetFormData()); + //postData.strPurchase_Service_applydetailsList = JSON.stringify($('#Purchase_Service_applydetails').jfGridGet('rowdatas')); + //postData.strPurchase_ServiceEntity = JSON.stringify($('[data-table="Purchase_Service"]').lrGetFormData()); + //$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + //}); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.cshtml new file mode 100644 index 000000000..fc2e53e6b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.cshtml @@ -0,0 +1,47 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
填报部门
+ +
+
+
填报人
+ +
+
+
填报时间
+ +
+
+
收款人*
+ +
+
+
附件张数
+ +
+
+
申请报账金额*
+ +
+
+
附件上传
+
+
+
+
核准金额
+ +
+
+
明细操作
+ + +
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.js new file mode 100644 index 000000000..e2c773562 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Form.js @@ -0,0 +1,163 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-07-14 12:15 + * 描 述:教务报账申请 + */ +var acceptClick; +var userinfo; +var selectedRow; +var refreshGirdData; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + userinfo = learun.clientdata.get(['userinfo']);//用户数据 + + $("#detailadd").on('click', function () { + selectedRow = null; + ///LogisticsManagement/Purchase_Service/GetDetailList + learun.layerForm({ + id: 'findback', + title: '新增明细', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/FindBack', + width: 860, + height: 580, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Purchase_Service_applydetails').jfGridValue('purchaseid'); + selectedRow = $('#Purchase_Service_applydetails').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $('#Purchase_Service_applydetails').jfGridSet('removeRow', selectedRow.purchaseid); + + let totalamount = parseFloat($('#Totalamount').val()); + + totalamount -= selectedRow.TotalAmount; + $('#Totalamount').val(totalamount); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + $('#DepartmentId')[0].lrvalue = userinfo.departmentId; + learun.clientdata.getAsync('department', { + key: userinfo.departmentId, + callback: function (_data) { + $('#DepartmentId').val(_data.name); + } + }); + + $('#Creator')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#Creator').val(learun.clientdata.get(['userinfo']).realName); + $('#Createtime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#FilePath').lrUploader(); + $('#Purchase_Service_applydetails').jfGrid({ + headData: [ + { + label: '采购单备注', name: 'Remark', width: 120, align: 'left' + }, + { + label: '金额', name: 'TotalAmount', width: 120, align: 'left' + }, + { + label: '时间', name: 'CreateTime', width: 120, align: 'left' + }, + { + label: '时间', name: 'purchaseid', width: 120, align: 'left', ishide:true + } + ], + //isEdit:true, + isSubGrid: true, + mainId:'purchaseid', + height: 400, + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/GetFormDetailData?keyValue=' + rowItem.purchaseid, + headData: [ + { label: "采购物品名称", name: "Name", width: 100, align: "left" }, + { label: "价格", name: "Price", width: 130, align: "left" }, + { label: "采购数量", name: "Quantity", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 150, align: "left" }, + { label: "用途", name: "UseTo", width: 150, align: "left", }, + ], + mainId: 'LessonNo', + isPage: false, + sidx: 'ReviewTime desc' + }); + var param; + param = param || {}; + param.StuNo = rowItem.StuNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/GetFormData?keyValue=' + keyValue, function (data) { + console.log(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]); + } + } + }); + } + } + }; + refreshGirdData = function (e) { + //console.log(e) + //计算总金额 + let totalamount = 0; + //清楚所有 + var datas = $('#Purchase_Service_applydetails').jfGridGet('rowdatas').length + for (var i = 0; i < datas; i++) { + $('#Purchase_Service_applydetails').jfGridSet('removeRow', $('#Purchase_Service_applydetails').jfGridGet('rowdatas')[0].purchaseid); + } + + for (var i = 0; i < e.length; i++) { + var itemdata = { + 'Id': '', + 'Remark': e[i].Remark, + 'TotalAmount': e[i].TotalAmount, + 'CreateTime': e[i].CreateTime, + 'purchaseid': e[i].Id + }; + $('#Purchase_Service_applydetails').jfGridSet('addRow', itemdata); + totalamount += e[i].TotalAmount; + } + $('#Totalamount').val(totalamount); + + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Service_apply"]').lrGetFormData()); + postData.strPurchase_Service_applydetailsList = JSON.stringify($('#Purchase_Service_applydetails').jfGridGet('rowdatas')); + //postData.strPurchase_ServiceEntity = JSON.stringify($('[data-table="Purchase_Service"]').lrGetFormData()); + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.cshtml new file mode 100644 index 000000000..6b69801d1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.cshtml @@ -0,0 +1,47 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
填报部门
+ +
+
+
填报人
+ +
+
+
填报时间
+ +
+
+
收款人*
+ +
+
+
附件张数
+ +
+
+
申请报账金额*
+ +
+
+
附件上传
+
+
+
+
核准金额
+ +
+
+
明细操作
+ @* + *@ +
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.js new file mode 100644 index 000000000..c16033cff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/FormView.js @@ -0,0 +1,141 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-09-26 10:47 + * 描 述:办公采购申请 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +//绑定原课程安排 +var bindData; +//绑定新课程安排 +var bindDataNew; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#FilePath').lrUploader({ isUpload: false }); + $('#Purchase_Service_applydetails').jfGrid({ + headData: [ + { + label: '采购单备注', name: 'Remark', width: 120, align: 'left' + }, + { + label: '金额', name: 'TotalAmount', width: 120, align: 'left' + }, + { + label: '时间', name: 'CreateTime', width: 120, align: 'left' + }, + { + label: '时间', name: 'purchaseid', width: 120, align: 'left', ishide: true + } + ], + //isEdit:true, + isSubGrid: true, + mainId: 'purchaseid', + height: 400, + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service/GetFormDetailData?keyValue=' + rowItem.purchaseid, + headData: [ + { label: "采购物品名称", name: "Name", width: 100, align: "left" }, + { label: "价格", name: "Price", width: 130, align: "left" }, + { label: "采购数量", name: "Quantity", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 150, align: "left" }, + { label: "用途", name: "UseTo", width: 150, align: "left", }, + ], + mainId: 'LessonNo', + isPage: false, + sidx: 'ReviewTime desc' + }); + var param; + param = param || {}; + param.StuNo = rowItem.StuNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }); + }, + initData: function () { + console.log(keyValue) + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/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 + '/LogisticsManagement/Purchase_Service_Apply/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 == 'ArrangeLessonTermAttemper') { + keyValue = data[id].Id; + //} + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + + if (!!processId) { + formData.ProcessId = processId; + } + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Service_Apply"]').lrGetFormData()); + postData.strPurchase_Service_applydetailsList = JSON.stringify($('#Purchase_Service_applydetails').jfGridGet('rowdatas')); + //var postData = { + // strEntity: JSON.stringify(formData) + //}; + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.cshtml new file mode 100644 index 000000000..5e6775a5e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
填报部门
+
+
+
+
审核状态
+
+
+
+
收款人
+ +
+
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.js new file mode 100644 index 000000000..2c9d43df2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Service_Apply/Index.js @@ -0,0 +1,245 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-07-14 12:15 + * 描 述:教务报账申请 + */ +var refreshGirdData; +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var processId = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DepartmentId').lrDepartmentSelect(); + $('#checkstatus').lrselect({ + data: [{ text: '待审核', value: '0' }, { text: '审核中', value: '1' }, { text: '已审核', value: '2' }], + text: 'text', + value: 'value', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/Form', + //url: top.$.rootUrl + '/lr_codedemo/griddemo/editindex', + width: 1000, + height: 800, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status != 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/Form?keyValue=' + keyValue, + width: 1000, + height: 800, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status != 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/DeleteForm', { keyValue: keyValue}, function () { + //refreshGirdData(); + page.search(); + }); + } + }); + } + }); + //  提交 + $('#lr-sub').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + console.log(keyValue) + if (learun.checkrow(keyValue)) { + if (selectedRow.Status != 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/ModifyStatus', { keyValue: keyValue, status: 1, processId: processId }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + //  查看 + $('#lr-view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/FormView?keyValue=' + keyValue, + width: 1000, + height: 800, + btn: null + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Service_Apply/GetPageList', + headData: [ + { label: "填报部门", name: "DepartmentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('department', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + }}, + { label: "填报人", name: "Creator", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + }}, + { label: "填报时间", name: "Createtime", width: 100, align: "left"}, + { label: "收款人", name: "Payee", width: 100, align: "left"}, + { label: "附件张数", name: "Attachcount", width: 100, align: "left"}, + { label: "申请报账金额", name: "Totalamount", width: 100, align: "left"}, + //{ label: "附件上传", name: "FilePath", width: 100, align: "left"}, + { label: "核准金额", name: "Approvalamount", width: 100, align: "left" }, + { label: "提交时间", name: "SubmitTime", width: 130, align: "left" }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '未提交'; + } + } + }, + //{ + // label: "审核用户", name: "CheckUserId", width: 100, align: "left", + // formatter: function (cellvalue, row) { + // return row.CheckUserName; + // } + //}, + { label: "审核时间", name: "CheckTime", width: 130, align: "left" }, + { + label: "审核状态", name: "CheckStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '审核中'; + } else if (cellvalue == 2) { + return '审核通过'; + } else { + return '草稿'; + } + } + }, + ], + mainId:'Id', + isPage: true + }); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + //$('#gridtable').jfGridSet('reload'); + + if (res && res.code && res.code == 200) { + // 发起流程 + + var postData = { + schemeCode: '1-13',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + + } + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Form.cshtml new file mode 100644 index 000000000..273bfd193 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Form.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "申请类"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+ @*
+
部门*
+ + +
*@ +
+
申请人*
+ + +
+
+
随行人员*
+ +
+
+
出差原因
+ +
+
+
开始时间
+ @**@ + +
+
+
结束时间
+ @**@ + +
+
+
附件上传
+
+
+ @*
+
+
*@ +
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Form.js new file mode 100644 index 000000000..62157f3ae --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Form.js @@ -0,0 +1,71 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-25 18:33 + * 描 述:申请类 + */ +var acceptClick; +var computeamount; +var userinfo; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + userinfo = learun.clientdata.get(['userinfo']);//用户数据 + console.log(userinfo) + page.bind(); + page.initData(); + }, + bind: function () { + //加载部门、用户 + //$('#DepartmentId')[0].lrvalue = userinfo.departmentId; + //learun.clientdata.getAsync('department', { + // key: userinfo.departmentId, + // callback: function (_data) { + // $('#DepartmentId').val(_data.name); + // $('#DepartmentName')[0].lrvalue = _data.name; + // } + //}); + //加载用户 + $('#CreatorId')[0].lrvalue = userinfo.userId; + $('#CreatorName')[0].lrvalue = userinfo.realName; + $('#CreatorId').val(userinfo.realName); + + + $('#FilePath').lrUploader(); + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id ).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + }, + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Travel"]').lrGetFormData()); + //postData.strPurchase_Travel_DetailsList = JSON.stringify($('#Purchase_Travel_Details').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.cshtml new file mode 100644 index 000000000..477c86856 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.cshtml @@ -0,0 +1,56 @@ +@{ + ViewBag.Title = "教学调度"; + Layout = "~/Views/Shared/_Form.cshtml"; +} + +
+ +
+
部门*
+ + +
+
+
申请人*
+ + +
+
+
总价格*
+ +
+
+
备注
+ +
+
+
附件上传
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.js new file mode 100644 index 000000000..56d55d02e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/FormView.js @@ -0,0 +1,131 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-09-26 10:47 + * 描 述:办公采购申请 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +//绑定原课程安排 +var bindData; +//绑定新课程安排 +var bindDataNew; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + ////加载部门、用户 + //$('#DepartmentId')[0].lrvalue = userinfo.departmentId; + //learun.clientdata.getAsync('department', { + // key: userinfo.departmentId, + // callback: function (_data) { + // $('#DepartmentId').val(_data.name); + // $('#DepartmentName')[0].lrvalue = _data.name; + // } + //}); + ////加载用户 + //$('#CreatorId')[0].lrvalue = userinfo.userId; + //$('#CreatorName')[0].lrvalue = userinfo.realName; + //$('#CreatorId').val(userinfo.realName); + + + $('#FilePath').lrUploader({ isUpload: false }); + $('#Purchase_Travel_Details').jfGrid({ + headData: [ + { label: '采购物品名称', name: 'Name', width: 100, align: 'left' }, + { label: '价格', name: 'Price', width: 100, align: 'left' }, + { label: '采购数量', name: 'Quantity', width: 100, align: 'left' }, + { label: '单位', name: 'Unit', width: 100, align: 'left' }, + { label: '用途', name: 'UseTo', width: 100, align: 'left' }, + { label: 'Id', name: 'Id', width: 100, align: 'left', ishide: true }, + ], + isEdit: false, + height: 400, + onMinusRow: function (row, rows) {//行数据和所有行数据 + computeamount(); + }, + }); + }, + initData: function () { + console.log(keyValue) + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/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 + '/LogisticsManagement/Purchase_Travel/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 == 'ArrangeLessonTermAttemper') { + keyValue = data[id].Id; + //} + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + + if (!!processId) { + formData.ProcessId = processId; + } + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Travel"]').lrGetFormData()); + postData.strPurchase_Travel_DetailsList = JSON.stringify($('#Purchase_Travel_Details').jfGridGet('rowdatas')); + //var postData = { + // strEntity: JSON.stringify(formData) + //}; + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Index.cshtml new file mode 100644 index 000000000..3b413e5f2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Index.cshtml @@ -0,0 +1,49 @@ +@{ + ViewBag.Title = "申请类"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
备注关键字
+ +
+
+
审核状态
+
+
+
+
报账状态
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Index.js new file mode 100644 index 000000000..b373a93c1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel/Index.js @@ -0,0 +1,264 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-06-25 18:33 + * 描 述:申请类 + */ +var refreshGirdData; +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + var logbegin = ''; + var logend = ''; + var processId = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + selectfn: function (begin, end) { + logbegin = begin; + logend = end; + + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#checkstatus').lrselect({ + data: [{ text: '待审核', value: '0' }, { text: '审核中', value: '1' }, { text: '已审核', value: '2' }], + text: 'text', + value: 'value', + }); + $('#ApplyStatus').lrselect({ + data: [{ text: '待报账', value: '0' }, { text: '报账中', value: '1' }, { text: '已报账', value: '2' }], + text: 'text', + value: 'value', + }); + // 刷新 + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/Form', + width: 1000, + height: 800, + callBack: function (id) { + //res = top[id].save('', function () { + // page.search(); + //}); + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status == 1) {//提交 + learun.alert.warning("当前课程异动记录已提交!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/Form?keyValue=' + keyValue, + width: 1000, + height: 800, + callBack: function (id) { + var res = false; + // 验证数据 + //res = top[id].validForm(); + // 保存数据 + //if (res) { + //res = top[id].save('', function () { + // page.search(); + //}); + return top[id].acceptClick(refreshGirdData); + //} + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status !== 0) { + learun.alert.warning("当前课程异动记录已提交,无法删除!"); + return false; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/DeleteForm', { keyValue: keyValue}, function () { + //refreshGirdData(); + page.search(); + }); + } + }); + } + }); + // 提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status !== 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/ModifyStatus', { keyValue: keyValue, status: 1, processId: processId }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + // 查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/GetPageList', + headData: [ + { label: "部门", name: "DepartmentId", width: 150, align: "left", + formatter: function (cellvalue, row) { + return row.DepartmentName; + } + }, + { + label: "申请人", name: "CreatorId", width: 100, align: "left", + formatter: function (cellvalue, row) { + return row.CreatorName; + } + }, + { label: "总价格", name: "TotalAmount", width: 100, align: "left"}, + { label: "备注", name: "Remark", width: 100, align: "left"}, + + { label: "提交时间", name: "SubmitTime", width: 130, align: "left" }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '未提交'; + } + } + }, + //{ + // label: "审核用户", name: "CheckUserId", width: 100, align: "left", + // formatter: function (cellvalue, row) { + // return row.CheckUserName; + // } + //}, + { label: "审核时间", name: "CheckTime", width: 130, align: "left" }, + { + label: "审核状态", name: "CheckStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '审核中'; + } else if (cellvalue == 2) { + return '审核通过'; + } else { + return '草稿'; + } + } + }, + { + label: "报账状态", name: "ApplyStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + console.log(cellvalue) + if (cellvalue == 0) { + return '待报账'; + } else if (cellvalue == 1) { + return '报账中'; + } else if (cellvalue == 2) { + return '已报账'; + } + } + }, + ], + mainId:'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.StartTime = logbegin; + param.EndTime = logend; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + if (res && res.code && res.code == 200) { + // 发起流程 + var postData = { + schemeCode: '0.1',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + } + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.cshtml new file mode 100644 index 000000000..35c66461b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.cshtml @@ -0,0 +1,33 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+ @*
+
+
+
+
填报部门
+
+
+
+
收款人
+ +
+
+
+
*@ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.js new file mode 100644 index 000000000..a4b7e4137 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FindBack.js @@ -0,0 +1,158 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-07-14 12:15 + * 描 述:教务报账申请 + */ +var acceptClick; +var refreshGirdData; +var list=[]; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DepartmentId').lrDepartmentSelect(); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/GetPageList', + headData: [ + { + label: "部门", name: "DepartmentId", width: 150, align: "left", + formatter: function (cellvalue, row) { + return row.DepartmentName; + } + }, + { + label: "申请人", name: "CreatorId", width: 100, align: "left", + formatter: function (cellvalue, row) { + return row.CreatorName; + } + }, + { label: "总价格", name: "TotalAmount", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true, + isMultiselect: true, + onSelectRow: function (rowdata, type) { + if (type) { + list.push(rowdata) + //let temp = {} + //list = list.reduce((prev, curv) => { + // if (temp[curv.StuNo]) { } + // else { + // temp[curv.StuNo] = true + // prev.push(curv) + // } + // return prev + //}, []) + } else { + list = $.grep(list, function (item, index) { + return item.Id!=rowdata.Id + }) + + } + console.log(list) + }, + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/GetFormDetailData?keyValue=' + rowItem.Id, + headData: [ + { label: "采购物品名称", name: "Name", width: 100, align: "left" }, + { label: "价格", name: "Price", width: 130, align: "left" }, + { label: "采购数量", name: "Quantity", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 150, align: "left" }, + { label: "用途", name: "UseTo", width: 150, align: "left" }, + ], + mainId: 'LessonNo', + isPage: false, + sidx: 'ReviewTime desc' + }); + var param; + param = param || {}; + param.StuNo = rowItem.StuNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + param.ApplyStatus = 0; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + // 保存数据 + acceptClick = function (callBack) { + //console.log(list) + if (list.length > 0) { + if (!!callBack) { + callBack(list); + return true; + } + } else { + + } + //if (!$('body').lrValidform()) { + // return false; + //} + //var postData = {}; + //postData.strEntity = JSON.stringify($('[data-table="Purchase_Travel_apply"]').lrGetFormData()); + //postData.strPurchase_Travel_applydetailsList = JSON.stringify($('#Purchase_Travel_applydetails').jfGridGet('rowdatas')); + //postData.strPurchase_TravelEntity = JSON.stringify($('[data-table="Purchase_Travel"]').lrGetFormData()); + //$.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + //}); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.cshtml new file mode 100644 index 000000000..a7e7c1e8d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.cshtml @@ -0,0 +1,47 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
填报部门
+ +
+
+
填报人
+ +
+
+
填报时间
+ +
+
+
收款人*
+ +
+
+
附件张数
+ +
+
+
申请报账金额*
+ +
+
+
附件上传
+
+
+
+
核准金额
+ +
+
+
明细操作
+ + +
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.js new file mode 100644 index 000000000..1039dc9d2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Form.js @@ -0,0 +1,163 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-07-14 12:15 + * 描 述:教务报账申请 + */ +var acceptClick; +var userinfo; +var selectedRow; +var refreshGirdData; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + userinfo = learun.clientdata.get(['userinfo']);//用户数据 + + $("#detailadd").on('click', function () { + selectedRow = null; + ///LogisticsManagement/Purchase_Travel/GetDetailList + learun.layerForm({ + id: 'findback', + title: '新增明细', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/FindBack', + width: 860, + height: 580, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detaildel").on('click', function () { + var keyValue = $('#Purchase_Travel_applydetails').jfGridValue('purchaseid'); + selectedRow = $('#Purchase_Travel_applydetails').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $('#Purchase_Travel_applydetails').jfGridSet('removeRow', selectedRow.purchaseid); + + let totalamount = parseFloat($('#Totalamount').val()); + + totalamount -= selectedRow.TotalAmount; + $('#Totalamount').val(totalamount); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + $('#DepartmentId')[0].lrvalue = userinfo.departmentId; + learun.clientdata.getAsync('department', { + key: userinfo.departmentId, + callback: function (_data) { + $('#DepartmentId').val(_data.name); + } + }); + + $('#Creator')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#Creator').val(learun.clientdata.get(['userinfo']).realName); + $('#Createtime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#FilePath').lrUploader(); + $('#Purchase_Travel_applydetails').jfGrid({ + headData: [ + { + label: '采购单备注', name: 'Remark', width: 120, align: 'left' + }, + { + label: '金额', name: 'TotalAmount', width: 120, align: 'left' + }, + { + label: '时间', name: 'CreateTime', width: 120, align: 'left' + }, + { + label: '时间', name: 'purchaseid', width: 120, align: 'left', ishide:true + } + ], + //isEdit:true, + isSubGrid: true, + mainId:'purchaseid', + height: 400, + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/GetFormDetailData?keyValue=' + rowItem.purchaseid, + headData: [ + { label: "采购物品名称", name: "Name", width: 100, align: "left" }, + { label: "价格", name: "Price", width: 130, align: "left" }, + { label: "采购数量", name: "Quantity", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 150, align: "left" }, + { label: "用途", name: "UseTo", width: 150, align: "left", }, + ], + mainId: 'LessonNo', + isPage: false, + sidx: 'ReviewTime desc' + }); + var param; + param = param || {}; + param.StuNo = rowItem.StuNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/GetFormData?keyValue=' + keyValue, function (data) { + console.log(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]); + } + } + }); + } + } + }; + refreshGirdData = function (e) { + //console.log(e) + //计算总金额 + let totalamount = 0; + //清楚所有 + var datas = $('#Purchase_Travel_applydetails').jfGridGet('rowdatas').length + for (var i = 0; i < datas; i++) { + $('#Purchase_Travel_applydetails').jfGridSet('removeRow', $('#Purchase_Travel_applydetails').jfGridGet('rowdatas')[0].purchaseid); + } + + for (var i = 0; i < e.length; i++) { + var itemdata = { + 'Id': '', + 'Remark': e[i].Remark, + 'TotalAmount': e[i].TotalAmount, + 'CreateTime': e[i].CreateTime, + 'purchaseid': e[i].Id + }; + $('#Purchase_Travel_applydetails').jfGridSet('addRow', itemdata); + totalamount += e[i].TotalAmount; + } + $('#Totalamount').val(totalamount); + + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Travel_apply"]').lrGetFormData()); + postData.strPurchase_Travel_applydetailsList = JSON.stringify($('#Purchase_Travel_applydetails').jfGridGet('rowdatas')); + //postData.strPurchase_TravelEntity = JSON.stringify($('[data-table="Purchase_Travel"]').lrGetFormData()); + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.cshtml new file mode 100644 index 000000000..99feef5ff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.cshtml @@ -0,0 +1,47 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
填报部门
+ +
+
+
填报人
+ +
+
+
填报时间
+ +
+
+
收款人*
+ +
+
+
附件张数
+ +
+
+
申请报账金额*
+ +
+
+
附件上传
+
+
+
+
核准金额
+ +
+
+
明细操作
+ @* + *@ +
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.js new file mode 100644 index 000000000..971fe96c3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/FormView.js @@ -0,0 +1,141 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-09-26 10:47 + * 描 述:办公采购申请 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +//绑定原课程安排 +var bindData; +//绑定新课程安排 +var bindDataNew; +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#FilePath').lrUploader({ isUpload: false }); + $('#Purchase_Travel_applydetails').jfGrid({ + headData: [ + { + label: '采购单备注', name: 'Remark', width: 120, align: 'left' + }, + { + label: '金额', name: 'TotalAmount', width: 120, align: 'left' + }, + { + label: '时间', name: 'CreateTime', width: 120, align: 'left' + }, + { + label: '时间', name: 'purchaseid', width: 120, align: 'left', ishide: true + } + ], + //isEdit:true, + isSubGrid: true, + mainId: 'purchaseid', + height: 400, + isSubGrid: true, + subGridExpanded: function (subContentId, rowItem) { + $('#' + subContentId).jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel/GetFormDetailData?keyValue=' + rowItem.purchaseid, + headData: [ + { label: "采购物品名称", name: "Name", width: 100, align: "left" }, + { label: "价格", name: "Price", width: 130, align: "left" }, + { label: "采购数量", name: "Quantity", width: 100, align: "left" }, + { label: "单位", name: "Unit", width: 150, align: "left" }, + { label: "用途", name: "UseTo", width: 150, align: "left", }, + ], + mainId: 'LessonNo', + isPage: false, + sidx: 'ReviewTime desc' + }); + var param; + param = param || {}; + param.StuNo = rowItem.StuNo; + $('#' + subContentId).jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }); + }, + initData: function () { + console.log(keyValue) + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/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 + '/LogisticsManagement/Purchase_Travel_Apply/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 == 'ArrangeLessonTermAttemper') { + keyValue = data[id].Id; + //} + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('#form').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var formData = $('body').lrGetFormData(); + + if (!!processId) { + formData.ProcessId = processId; + } + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + postData.strEntity = JSON.stringify($('[data-table="Purchase_Travel_Apply"]').lrGetFormData()); + postData.strPurchase_Travel_applydetailsList = JSON.stringify($('#Purchase_Travel_applydetails').jfGridGet('rowdatas')); + //var postData = { + // strEntity: JSON.stringify(formData) + //}; + $.lrSaveForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.cshtml new file mode 100644 index 000000000..3dc1e733f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "教务报账申请"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
+
+
+
填报部门
+
+
+
+
审核状态
+
+
+
+
收款人
+ +
+
+
+
+
+
+
+ +
+ + +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.js new file mode 100644 index 000000000..650224162 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Purchase_Travel_Apply/Index.js @@ -0,0 +1,245 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-07-14 12:15 + * 描 述:教务报账申请 + */ +var refreshGirdData; +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + var startTime; + var endTime; + var processId = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 时间搜索框 + $('#datesearch').lrdate({ + dfdata: [ + { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, + { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } + ], + // 月 + mShow: false, + premShow: false, + // 季度 + jShow: false, + prejShow: false, + // 年 + ysShow: false, + yxShow: false, + preyShow: false, + yShow: false, + // 默认 + dfvalue: '1', + selectfn: function (begin, end) { + startTime = begin; + endTime = end; + page.search(); + } + }); + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#DepartmentId').lrDepartmentSelect(); + $('#checkstatus').lrselect({ + data: [{ text: '待审核', value: '0' }, { text: '审核中', value: '1' }, { text: '已审核', value: '2' }], + text: 'text', + value: 'value', + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/Form', + //url: top.$.rootUrl + '/lr_codedemo/griddemo/editindex', + width: 1000, + height: 800, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status != 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/Form?keyValue=' + keyValue, + width: 1000, + height: 800, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status != 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/DeleteForm', { keyValue: keyValue}, function () { + //refreshGirdData(); + page.search(); + }); + } + }); + } + }); + //  提交 + $('#lr-sub').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + console.log(keyValue) + if (learun.checkrow(keyValue)) { + if (selectedRow.Status != 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/ModifyStatus', { keyValue: keyValue, status: 1, processId: processId }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + //  查看 + $('#lr-view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow.Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/FormView?keyValue=' + keyValue, + width: 1000, + height: 800, + btn: null + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LogisticsManagement/Purchase_Travel_Apply/GetPageList', + headData: [ + { label: "填报部门", name: "DepartmentId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('department', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + }}, + { label: "填报人", name: "Creator", width: 100, align: "left", + formatterAsync: function (callback, value, row, op,$cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + }}, + { label: "填报时间", name: "Createtime", width: 100, align: "left"}, + { label: "收款人", name: "Payee", width: 100, align: "left"}, + { label: "附件张数", name: "Attachcount", width: 100, align: "left"}, + { label: "申请报账金额", name: "Totalamount", width: 100, align: "left"}, + //{ label: "附件上传", name: "FilePath", width: 100, align: "left"}, + { label: "核准金额", name: "Approvalamount", width: 100, align: "left" }, + { label: "提交时间", name: "SubmitTime", width: 130, align: "left" }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '未提交'; + } + } + }, + //{ + // label: "审核用户", name: "CheckUserId", width: 100, align: "left", + // formatter: function (cellvalue, row) { + // return row.CheckUserName; + // } + //}, + { label: "审核时间", name: "CheckTime", width: 130, align: "left" }, + { + label: "审核状态", name: "CheckStatus", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '审核中'; + } else if (cellvalue == 2) { + return '审核通过'; + } else { + return '草稿'; + } + } + }, + ], + mainId:'Id', + isPage: true + }); + }, + search: function (param) { + param = param || {}; + param.StartTime = startTime; + param.EndTime = endTime; + $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function (res, postData) { + //$('#gridtable').jfGridSet('reload'); + + if (res && res.code && res.code == 200) { + // 发起流程 + + var postData = { + schemeCode: '1-5',// 填写流程对应模板编号 + processId: processId, + level: '1', + }; + learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { + learun.loading(false); + }); + + } + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 438dc7087..668b4ca10 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -410,7 +410,11 @@ + + + + @@ -1431,6 +1435,13 @@ + + + + + + + @@ -1438,6 +1449,13 @@ + + + + + + + @@ -7929,6 +7947,20 @@ + + + + + + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index 0948d58d0..3c459e9c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -145,10 +145,17 @@ + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_ServiceMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_ServiceMap.cs new file mode 100644 index 000000000..dbc5b9a27 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_ServiceMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_ServiceMap : EntityTypeConfiguration + { + public Purchase_ServiceMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_SERVICE"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_ApplyMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_ApplyMap.cs new file mode 100644 index 000000000..f55ba281e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_ApplyMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplyMap : EntityTypeConfiguration + { + public Purchase_Service_ApplyMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_SERVICE_APPLY"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_ApplydetailsMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_ApplydetailsMap.cs new file mode 100644 index 000000000..a3f7c8ae3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_ApplydetailsMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplydetailsMap : EntityTypeConfiguration + { + public Purchase_Service_ApplydetailsMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_SERVICE_APPLYDETAILS"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_DetailsMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_DetailsMap.cs new file mode 100644 index 000000000..7b1592f02 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Service_DetailsMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_Service_DetailsMap : EntityTypeConfiguration + { + public Purchase_Service_DetailsMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_SERVICE_DETAILS"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_TravelMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_TravelMap.cs new file mode 100644 index 000000000..98eb28464 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_TravelMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_TravelMap : EntityTypeConfiguration + { + public Purchase_TravelMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_TRAVEL"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Travel_ApplyMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Travel_ApplyMap.cs new file mode 100644 index 000000000..48c3c9007 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Travel_ApplyMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplyMap : EntityTypeConfiguration + { + public Purchase_Travel_ApplyMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_TRAVEL_APPLY"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Travel_ApplydetailsMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Travel_ApplydetailsMap.cs new file mode 100644 index 000000000..c61d18fde --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/LogisticsManagement/Purchase_Travel_ApplydetailsMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplydetailsMap : EntityTypeConfiguration + { + public Purchase_Travel_ApplydetailsMap() + { + #region 表、主键 + //表 + this.ToTable("PURCHASE_TRAVEL_APPLYDETAILS"); + //主键 + this.HasKey(t => t.Id); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index ffcab1128..b8c720f00 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -427,6 +427,16 @@ + + + + + + + + + + @@ -437,6 +447,15 @@ + + + + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceBLL.cs new file mode 100644 index 000000000..0c1ff08a9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceBLL.cs @@ -0,0 +1,272 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_ServiceBLL : Purchase_ServiceIBLL + { + private Purchase_ServiceService Purchase_ServiceService = new Purchase_ServiceService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return Purchase_ServiceService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetDataList(string queryJson) + { + try + { + return Purchase_ServiceService.GetDataList( queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Details表数据 + /// + /// 主键 + /// + public IEnumerable GetPurchase_Service_DetailsList(string keyValue) + { + try + { + return Purchase_ServiceService.GetPurchase_Service_DetailsList(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Service表实体数据 + /// + /// 主键 + /// + public Purchase_ServiceEntity GetPurchase_ServiceEntity(string keyValue) + { + try + { + return Purchase_ServiceService.GetPurchase_ServiceEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Details表实体数据 + /// + /// 主键 + /// + public Purchase_Service_DetailsEntity GetPurchase_Service_DetailsEntity(string keyValue) + { + try + { + return Purchase_ServiceService.GetPurchase_Service_DetailsEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_ServiceEntity GetEntityByProcessId(string processId) + { + try + { + return Purchase_ServiceService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + Purchase_ServiceService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Purchase_ServiceEntity entity,List Purchase_Service_DetailsList) + { + try + { + Purchase_ServiceService.SaveEntity(keyValue, entity,Purchase_Service_DetailsList); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + Purchase_ServiceService.ModifyStatus(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 修改课程异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + try + { + Purchase_ServiceService.ModifyStatusByProcessId(status, processId); + } + 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/LogisticsManagement/Purchase_Service/Purchase_ServiceEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceEntity.cs new file mode 100644 index 000000000..e9ae10a30 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceEntity.cs @@ -0,0 +1,129 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_ServiceEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 申请部门name + /// + [Column("DEPARTMENTNAME")] + public string DepartmentName { get; set; } + /// + /// 申请部门 + /// + [Column("DEPARTMENTID")] + public string DepartmentId { get; set; } + /// + /// 申请人 + /// + [Column("CREATORID")] + public string CreatorId { get; set; } + /// + /// 申请人 + /// + [Column("CREATORNAME")] + public string CreatorName { get; set; } + /// + /// 申请时间 + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// 采购总价 + /// + [Column("TOTALAMOUNT")] + public decimal? TotalAmount { get; set; } + /// + /// 备注 + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// 附件 + /// + [Column("FILEPATH")] + public string FilePath { get; set; } + /// + /// 是否草稿箱 + /// + [Column("STATUS")] + public int Status { get; set; } + /// + /// 提交时间 + /// + [Column("SUBMITTIME")] + public DateTime? SubmitTime { get; set; } + /// + /// 审核时间 + /// + [Column("CheckTime")] + public DateTime? CheckTime { get; set; } + /// + /// 审核人id + /// + [Column("CHECKUSERID")] + public string CheckUserId { get; set; } + /// + /// 审核人 + /// + [Column("CHECKUSERNAME")] + public string CheckUserName { get; set; } + /// + /// 审核状态 + /// + [Column("CHECKSTATUS")] + public int CheckStatus { get; set; } + /// + /// 工作流Id + /// + [Column("ProcessId")] + public string ProcessId { get; set; } + /// + /// 报账状态 + /// + [Column("APPLYSTATUS")] + public int ApplyStatus { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + this.CreateTime = DateTime.Now; + this.Status = 0; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + + + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceIBLL.cs new file mode 100644 index 000000000..1646fa410 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceIBLL.cs @@ -0,0 +1,89 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public interface Purchase_ServiceIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetDataList(string queryJson); + /// + /// 获取Purchase_Service_Details表数据 + /// + /// + IEnumerable GetPurchase_Service_DetailsList(string keyValue); + /// + /// 获取Purchase_Service表实体数据 + /// + /// 主键 + /// + Purchase_ServiceEntity GetPurchase_ServiceEntity(string keyValue); + /// + /// 获取Purchase_Service_Details表实体数据 + /// + /// 主键 + /// + Purchase_Service_DetailsEntity GetPurchase_Service_DetailsEntity(string keyValue); + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + Purchase_ServiceEntity GetEntityByProcessId(string processId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Purchase_ServiceEntity entity,List purchase_Work_DetailsList); + #endregion + + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + void ModifyStatus(string keyValue, int status, string processId); + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + void ModifyStatusByProcessId(int status, string processId); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceService.cs new file mode 100644 index 000000000..606e3d7e3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_ServiceService.cs @@ -0,0 +1,405 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_ServiceService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.DepartmentId, + t.DepartmentName, + t.CreatorId, + t.CreatorName, + t.TotalAmount, + t.Remark, + t.FilePath,t.Status,t.SubmitTime,t.CheckTime,t.CheckUserId,t.CheckStatus,t.ProcessId,t.CreateTime,t.Applystatus + "); + strSql.Append(" FROM Purchase_Service t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.CreateTime >= @startTime AND t.CreateTime <= @endTime ) "); + } + if (!queryParam["keyword"].IsEmpty()) + { + dp.Add("@remark", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + strSql.Append(" AND (t.remark Like @remark) "); + } + if (!queryParam["ApplyStatus"].IsEmpty()) + { + //报账状态 + //采购审批通过且报账状态为0的数据 + dp.Add("@ApplyStatus", queryParam["ApplyStatus"].ToString(), DbType.String); + strSql.Append(" AND (t.ApplyStatus=@ApplyStatus)"); + } + if (!queryParam["checkstatus"].IsEmpty()) + { + //审核状态 + //采购审批通过且报账状态为0的数据 + dp.Add("@CheckStatus", queryParam["checkstatus"].ToString(), DbType.String); + strSql.Append(" AND (t.CheckStatus=@CheckStatus)"); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetDataList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.DepartmentId, + t.DepartmentName, + t.CreatorId, + t.CreatorName, + t.TotalAmount, + t.Remark, + t.FilePath,t.Status,t.SubmitTime,t.CheckTime,t.CheckUserId,t.CheckStatus,t.ProcessId,t.CreateTime,t.ApplyStatus + "); + strSql.Append(" FROM Purchase_Service t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Crreator"].IsEmpty()) + { + dp.Add("CreatorId", queryParam["Crreator"].ToDate(), DbType.DateTime); + strSql.Append(" AND t.CreatorId = @CreatorId "); + } + if (!queryParam["keyword"].IsEmpty()) + { + dp.Add("@remark", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + strSql.Append(" AND (t.remark Like @remark) "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Details表数据 + /// + /// 主键 + /// + public IEnumerable GetPurchase_Service_DetailsList(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(t=>t.Fid == keyValue ); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Service表实体数据 + /// + /// 主键 + /// + public Purchase_ServiceEntity GetPurchase_ServiceEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Details表实体数据 + /// + /// 主键 + /// + public Purchase_Service_DetailsEntity GetPurchase_Service_DetailsEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t=>t.Fid == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_ServiceEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var Purchase_ServiceEntity = GetPurchase_ServiceEntity(keyValue); + db.Delete(t=>t.Id == keyValue); + db.Delete(t=>t.Fid == Purchase_ServiceEntity.Id); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Purchase_ServiceEntity entity,List Purchase_Service_DetailsList) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var Purchase_ServiceEntityTmp = GetPurchase_ServiceEntity(keyValue); + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t=>t.Fid == Purchase_ServiceEntityTmp.Id); + foreach (Purchase_Service_DetailsEntity item in Purchase_Service_DetailsList) + { + item.Create(); + item.Fid = Purchase_ServiceEntityTmp.Id; + db.Insert(item); + } + } + else + { + entity.Create(); + db.Insert(entity); + foreach (Purchase_Service_DetailsEntity item in Purchase_Service_DetailsList) + { + item.Create(); + item.Fid = entity.Id; + db.Insert(item); + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 提交异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + var now = DateTime.Now; + + var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue); + if (entity != null) + { + entity.Status = status; + entity.ProcessId = processId; + entity.SubmitTime = now; + entity.CheckStatus = 1; + this.BaseRepository("CollegeMIS").Update(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + try + { + var entity = db.FindEntity(x => x.ProcessId == processId); + if (entity != null) + { + //审核通过 + if (status == 2) + { + + } + else + { + entity.Status = status; + } + //更新课程异动表的审核状态 + entity.CheckStatus = status; + entity.CheckUserId = loginUserInfo.userId; + entity.CheckUserName = loginUserInfo.realName; + entity.CheckTime = now; + db.Update(entity); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_Service_DetailsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_Service_DetailsEntity.cs new file mode 100644 index 000000000..0819c761b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service/Purchase_Service_DetailsEntity.cs @@ -0,0 +1,79 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_Service_DetailsEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 所属主表ID + /// + [Column("FID")] + public string Fid { get; set; } + /// + /// 人数 + /// + [Column("PEOPLECOUNT")] + public string Peoplecount { get; set; } + /// + /// 估价 + /// + [Column("PRICE")] + public decimal? Price { get; set; } + /// + /// 天数 + /// + [Column("DAYS")] + public string Days { get; set; } + /// + /// 标准 + /// + [Column("STANDAR")] + public string Standar { get; set; } + /// + /// 维修内容 + /// + [Column("SERVICECONTENT")] + public string ServiceContent { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + this.CreateTime = DateTime.Now; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyBLL.cs new file mode 100644 index 000000000..74dcc30fe --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyBLL.cs @@ -0,0 +1,249 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplyBLL : Purchase_Service_ApplyIBLL + { + private Purchase_Service_ApplyService Purchase_Service_ApplyService = new Purchase_Service_ApplyService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return Purchase_Service_ApplyService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Applydetails表数据 + /// + /// 主键 + /// + public IEnumerable GetPurchase_Service_ApplydetailsList(string keyValue) + { + try + { + return Purchase_Service_ApplyService.GetPurchase_Service_ApplydetailsList(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Apply表实体数据 + /// + /// 主键 + /// + public Purchase_Service_ApplyEntity GetPurchase_Service_ApplyEntity(string keyValue) + { + try + { + return Purchase_Service_ApplyService.GetPurchase_Service_ApplyEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Applydetails表实体数据 + /// + /// 主键 + /// + public Purchase_Service_ApplydetailsEntity GetPurchase_Service_ApplydetailsEntity(string keyValue) + { + try + { + return Purchase_Service_ApplyService.GetPurchase_Service_ApplydetailsEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_Service_ApplyEntity GetEntityByProcessId(string processId) + { + try + { + return Purchase_Service_ApplyService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + Purchase_Service_ApplyService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Purchase_Service_ApplyEntity entity,List Purchase_Service_applydetailsList) + { + try + { + Purchase_Service_ApplyService.SaveEntity(keyValue, entity,Purchase_Service_applydetailsList); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + + #region 扩展数据 + + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + Purchase_Service_ApplyService.ModifyStatus(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 修改课程异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + try + { + Purchase_Service_ApplyService.ModifyStatusByProcessId(status, processId); + } + 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/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyEntity.cs new file mode 100644 index 000000000..6ea638a3b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyEntity.cs @@ -0,0 +1,129 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplyEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// DepartmentId + /// + [Column("DEPARTMENTID")] + public string DepartmentId { get; set; } + /// + /// Creator + /// + [Column("CREATOR")] + public string Creator { get; set; } + /// + /// Createtime + /// + [Column("CREATETIME")] + public DateTime? Createtime { get; set; } + /// + /// Payee + /// + [Column("PAYEE")] + public string Payee { get; set; } + /// + /// Attachcount + /// + [Column("ATTACHCOUNT")] + public string Attachcount { get; set; } + /// + /// Totalamount + /// + [Column("TOTALAMOUNT")] + public decimal? Totalamount { get; set; } + /// + /// FilePath + /// + [Column("FILEPATH")] + public string FilePath { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// Approvalamount + /// + [Column("APPROVALAMOUNT")] + public decimal? Approvalamount { get; set; } + /// + /// Status + /// + [Column("STATUS")] + public int Status { get; set; } + /// + /// SubmitTime + /// + [Column("SUBMITTIME")] + public DateTime? SubmitTime { get; set; } + /// + /// CheckTime + /// + [Column("CHECKTIME")] + public DateTime? CheckTime { get; set; } + /// + /// CheckUserId + /// + [Column("CHECKUSERID")] + public string CheckUserId { get; set; } + /// + /// CheckUserName + /// + [Column("CHECKUSERNAME")] + public string CheckUserName { get; set; } + /// + /// CheckStatus + /// + [Column("CHECKSTATUS")] + public int CheckStatus { get; set; } + /// + /// ProcessId + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + [NotMapped] + public string deptname { set; get; } + [NotMapped] + public string creatorname { set; get; } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyIBLL.cs new file mode 100644 index 000000000..567488731 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyIBLL.cs @@ -0,0 +1,82 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public interface Purchase_Service_ApplyIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Purchase_Service_applydetails表数据 + /// + /// + IEnumerable GetPurchase_Service_ApplydetailsList(string keyValue); + /// + /// 获取Purchase_Service_apply表实体数据 + /// + /// 主键 + /// + Purchase_Service_ApplyEntity GetPurchase_Service_ApplyEntity(string keyValue); + /// + /// 获取Purchase_Service_applydetails表实体数据 + /// + /// 主键 + /// + Purchase_Service_ApplydetailsEntity GetPurchase_Service_ApplydetailsEntity(string keyValue); + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + Purchase_Service_ApplyEntity GetEntityByProcessId(string processId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Purchase_Service_ApplyEntity entity,List Purchase_Service_applydetailsList); + #endregion + + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + void ModifyStatus(string keyValue, int status, string processId); + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + void ModifyStatusByProcessId(int status, string processId); + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyService.cs new file mode 100644 index 000000000..d458b8022 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplyService.cs @@ -0,0 +1,401 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplyService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var database = this.BaseRepository().getDbConnection().Database; + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.DepartmentId, + c.f_fullname as deptname, + t.Creator, + b.f_realname as creatorname, + t.Createtime, + t.Payee, + t.Attachcount, + t.Totalamount, + t.FilePath, + t.Approvalamount, + t.Status, + t.submittime, + t.checktime, + t.checkstatus + "); + strSql.Append(" FROM Purchase_Service_Apply t "); + strSql.Append(" left join " + database + ".dbo.LR_Base_User b on b.F_UserId=t.creator "); + strSql.Append(" left join " + database + ".dbo.LR_Base_Department c on c.F_DepartmentId=t.departmentId"); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.Createtime >= @startTime AND t.Createtime <= @endTime ) "); + } + if (!queryParam["DepartmentId"].IsEmpty()) + { + dp.Add("DepartmentId",queryParam["DepartmentId"].ToString(), DbType.String); + strSql.Append(" AND t.DepartmentId = @DepartmentId "); + } + if (!queryParam["checkstatus"].IsEmpty()) + { + dp.Add("checkstatus", queryParam["checkstatus"].ToString(), DbType.String); + strSql.Append(" AND t.checkstatus = @checkstatus "); + } + if (!queryParam["Payee"].IsEmpty()) + { + dp.Add("Payee", "%" + queryParam["Payee"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Payee Like @Payee "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Applydetails表数据 + /// + /// 主键 + /// + public IEnumerable GetPurchase_Service_ApplydetailsList(string keyValue) + { + try + { + string sql = "select a.*,b.Remark,b.Createtime,b.totalamount from Purchase_Service_Applydetails a left join Purchase_Service b on b.id=a.purchaseid where applyid='"+keyValue+"'"; + var data = this.BaseRepository("CollegeMIS").FindList(sql);// as List; + //this.BaseRepository("CollegeMIS").FindList(t => t.applyid == keyValue); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Apply表实体数据 + /// + /// 主键 + /// + public Purchase_Service_ApplyEntity GetPurchase_Service_ApplyEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Service_Applydetails表实体数据 + /// + /// 主键 + /// + public Purchase_Service_ApplydetailsEntity GetPurchase_Service_ApplydetailsEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t=>t.applyid == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_Service_ApplyEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var Purchase_Service_ApplyEntity = GetPurchase_Service_ApplyEntity(keyValue); + var Purchase_Service_ApplydetailsEntity = GetPurchase_Service_ApplydetailsEntity(Purchase_Service_ApplyEntity.Id); + db.Delete(t=>t.Id == keyValue); + db.Delete(t=>t.applyid == Purchase_Service_ApplyEntity.Id); + + //同时要更新对应账单的报账状态 + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Purchase_Service_ApplyEntity entity,List Purchase_Service_ApplydetailsList) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var Purchase_Service_ApplyEntityTmp = GetPurchase_Service_ApplyEntity(keyValue); + var Purchase_Service_ApplydetailsEntityTmp = GetPurchase_Service_ApplydetailsEntity(Purchase_Service_ApplyEntityTmp.Id); + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t=>t.applyid == Purchase_Service_ApplyEntityTmp.Id); + foreach (Purchase_Service_ApplydetailsEntity item in Purchase_Service_ApplydetailsList) + { + item.Create(); + item.applyid = Purchase_Service_ApplyEntityTmp.Id; + db.Insert(item); + } + + } + else + { + entity.Create(); + db.Insert(entity); + foreach (Purchase_Service_ApplydetailsEntity item in Purchase_Service_ApplydetailsList) + { + item.Create(); + item.applyid = entity.Id; + db.Insert(item); + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + + + #region 扩展数据 + + /// + /// 提交异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + var now = DateTime.Now; + var db = this.BaseRepository("CollegeMIS"); + db.BeginTrans(); + var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue); + if (entity != null) + { + entity.Status = status; + entity.ProcessId = processId; + entity.SubmitTime = now; + entity.CheckStatus = 1; + db.Update(entity); + + //所有子表数据状态更新为报账中 + var details= this.BaseRepository("CollegeMIS").FindList(x => x.applyid == keyValue); + foreach (var item in details) + { + var purchasemodel = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == item.purchaseid); + purchasemodel.ApplyStatus = 1; + db.Update(purchasemodel); + } + } + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + try + { + var entity = db.FindEntity(x => x.ProcessId == processId); + if (entity != null) + { + //获取所有的账单数据 + var details = this.BaseRepository("CollegeMIS").FindList(x => x.applyid == entity.Id); + //审核通过 + if (status == 2) + { + foreach (var item in details) + { + var purchasemodel = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == item.purchaseid); + purchasemodel.ApplyStatus = 2; + db.Update(purchasemodel); + } + } + else + { + //这里是回滚订单到草稿箱 + entity.Status = status; + //把对应的账单数据报账状态回滚到待报账 + + foreach (var item in details) + { + var purchasemodel = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == item.purchaseid); + purchasemodel.ApplyStatus = 0; + db.Update(purchasemodel); + } + } + + //更新课程异动表的审核状态 + entity.CheckStatus = status; + entity.CheckUserId = loginUserInfo.userId; + entity.CheckUserName = loginUserInfo.realName; + entity.CheckTime = now; + db.Update(entity); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplydetailsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplydetailsEntity.cs new file mode 100644 index 000000000..16e75c548 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Service_Apply/Purchase_Service_ApplydetailsEntity.cs @@ -0,0 +1,60 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Service_ApplydetailsEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// applyid + /// + [Column("APPLYID")] + public string applyid { get; set; } + /// + /// purchaseid + /// + [Column("PURCHASEID")] + public string purchaseid { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + + [NotMapped] + public string Remark { set; get; } + [NotMapped] + public double TotalAmount { set; get; } + [NotMapped] + public string CreateTime { set; get; } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelBLL.cs new file mode 100644 index 000000000..97e854171 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelBLL.cs @@ -0,0 +1,226 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_TravelBLL : Purchase_TravelIBLL + { + private Purchase_TravelService Purchase_TravelService = new Purchase_TravelService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return Purchase_TravelService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetDataList(string queryJson) + { + try + { + return Purchase_TravelService.GetDataList( queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取Purchase_Travel表实体数据 + /// + /// 主键 + /// + public Purchase_TravelEntity GetPurchase_TravelEntity(string keyValue) + { + try + { + return Purchase_TravelService.GetPurchase_TravelEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_TravelEntity GetEntityByProcessId(string processId) + { + try + { + return Purchase_TravelService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + Purchase_TravelService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Purchase_TravelEntity entity) + { + try + { + Purchase_TravelService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + Purchase_TravelService.ModifyStatus(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 修改课程异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + try + { + Purchase_TravelService.ModifyStatusByProcessId(status, processId); + } + 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/LogisticsManagement/Purchase_Travel/Purchase_TravelEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelEntity.cs new file mode 100644 index 000000000..9a4c35437 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelEntity.cs @@ -0,0 +1,133 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_TravelEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// 申请人 + /// + [Column("CREATORID")] + public string CreatorId { get; set; } + /// + /// 申请人 + /// + [Column("CREATORNAME")] + public string CreatorName { get; set; } + /// + /// 申请时间 + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + + + /// + /// 随行人员 + /// + [Column("FOLLOWS")] + public string Follows { get; set; } + /// + /// 原因 + /// + [Column("REASON")] + public string Reason { get; set; } + /// + /// 开始时间 + /// + [Column("STARTTIME")] + public DateTime? Starttime { get; set; } + /// + /// 结束时间 + /// + [Column("ENDTIME")] + public DateTime? Endtime { get; set; } + + + /// + /// 附件 + /// + [Column("FILEPATH")] + public string FilePath { get; set; } + /// + /// 是否草稿箱 + /// + [Column("STATUS")] + public int Status { get; set; } + /// + /// 提交时间 + /// + [Column("SUBMITTIME")] + public DateTime? SubmitTime { get; set; } + /// + /// 审核时间 + /// + [Column("CheckTime")] + public DateTime? CheckTime { get; set; } + /// + /// 审核人id + /// + [Column("CHECKUSERID")] + public string CheckUserId { get; set; } + /// + /// 审核人 + /// + [Column("CHECKUSERNAME")] + public string CheckUserName { get; set; } + /// + /// 审核状态 + /// + [Column("CHECKSTATUS")] + public int CheckStatus { get; set; } + /// + /// 工作流Id + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + /// + /// 报账状态 + /// + [Column("APPLYSTATUS")] + public int ApplyStatus { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + this.CreateTime = DateTime.Now; + this.Status = 0; + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + + + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelIBLL.cs new file mode 100644 index 000000000..5dce4a9b7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelIBLL.cs @@ -0,0 +1,78 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public interface Purchase_TravelIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetDataList(string queryJson); + /// + /// 获取Purchase_Travel表实体数据 + /// + /// 主键 + /// + Purchase_TravelEntity GetPurchase_TravelEntity(string keyValue); + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + Purchase_TravelEntity GetEntityByProcessId(string processId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Purchase_TravelEntity entity); + #endregion + + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + void ModifyStatus(string keyValue, int status, string processId); + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + void ModifyStatusByProcessId(int status, string processId); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelService.cs new file mode 100644 index 000000000..df3633d37 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel/Purchase_TravelService.cs @@ -0,0 +1,347 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-06-25 18:33 + /// 描 述:申请类 + /// + public class Purchase_TravelService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.CreatorId, + t.CreatorName, + t.Follows, + t.Reason, + t.Starttime, + t.Endtime, + t.FilePath,t.Status,t.SubmitTime,t.CheckTime,t.CheckUserId,t.CheckStatus,t.ProcessId,t.CreateTime,t.Applystatus + "); + strSql.Append(" FROM Purchase_Travel t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.CreateTime >= @startTime AND t.CreateTime <= @endTime ) "); + } + if (!queryParam["keyword"].IsEmpty()) + { + dp.Add("@Reason", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + strSql.Append(" AND (t.Reason Like @Reason) "); + } + if (!queryParam["ApplyStatus"].IsEmpty()) + { + //报账状态 + //采购审批通过且报账状态为0的数据 + dp.Add("@ApplyStatus", queryParam["ApplyStatus"].ToString(), DbType.String); + strSql.Append(" AND (t.ApplyStatus=@ApplyStatus)"); + } + if (!queryParam["checkstatus"].IsEmpty()) + { + //审核状态 + //采购审批通过且报账状态为0的数据 + dp.Add("@CheckStatus", queryParam["checkstatus"].ToString(), DbType.String); + strSql.Append(" AND (t.CheckStatus=@CheckStatus)"); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetDataList(string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.DepartmentId, + t.DepartmentName, + t.CreatorId, + t.CreatorName, + t.TotalAmount, + t.Remark, + t.FilePath,t.Status,t.SubmitTime,t.CheckTime,t.CheckUserId,t.CheckStatus,t.ProcessId,t.CreateTime,t.ApplyStatus + "); + strSql.Append(" FROM Purchase_Travel t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Crreator"].IsEmpty()) + { + dp.Add("CreatorId", queryParam["Crreator"].ToDate(), DbType.DateTime); + strSql.Append(" AND t.CreatorId = @CreatorId "); + } + if (!queryParam["keyword"].IsEmpty()) + { + dp.Add("@remark", "%" + queryParam["keyword"].ToString() + "%", DbType.String); + strSql.Append(" AND (t.remark Like @remark) "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 获取Purchase_Travel表实体数据 + /// + /// 主键 + /// + public Purchase_TravelEntity GetPurchase_TravelEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_TravelEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var Purchase_TravelEntity = GetPurchase_TravelEntity(keyValue); + db.Delete(t=>t.Id == keyValue); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Purchase_TravelEntity entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var Purchase_TravelEntityTmp = GetPurchase_TravelEntity(keyValue); + entity.Modify(keyValue); + db.Update(entity); + + } + else + { + entity.Create(); + db.Insert(entity); + + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 扩展数据 + + /// + /// 提交异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + var now = DateTime.Now; + + var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue); + if (entity != null) + { + entity.Status = status; + entity.ProcessId = processId; + entity.SubmitTime = now; + entity.CheckStatus = 1; + this.BaseRepository("CollegeMIS").Update(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + try + { + var entity = db.FindEntity(x => x.ProcessId == processId); + if (entity != null) + { + //审核通过 + if (status == 2) + { + + } + else + { + entity.Status = status; + } + //更新课程异动表的审核状态 + entity.CheckStatus = status; + entity.CheckUserId = loginUserInfo.userId; + entity.CheckUserName = loginUserInfo.realName; + entity.CheckTime = now; + db.Update(entity); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyBLL.cs new file mode 100644 index 000000000..428df20e1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyBLL.cs @@ -0,0 +1,249 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplyBLL : Purchase_Travel_ApplyIBLL + { + private Purchase_Travel_ApplyService Purchase_Travel_ApplyService = new Purchase_Travel_ApplyService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return Purchase_Travel_ApplyService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Travel_Applydetails表数据 + /// + /// 主键 + /// + public IEnumerable GetPurchase_Travel_ApplydetailsList(string keyValue) + { + try + { + return Purchase_Travel_ApplyService.GetPurchase_Travel_ApplydetailsList(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Travel_Apply表实体数据 + /// + /// 主键 + /// + public Purchase_Travel_ApplyEntity GetPurchase_Travel_ApplyEntity(string keyValue) + { + try + { + return Purchase_Travel_ApplyService.GetPurchase_Travel_ApplyEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取Purchase_Travel_Applydetails表实体数据 + /// + /// 主键 + /// + public Purchase_Travel_ApplydetailsEntity GetPurchase_Travel_ApplydetailsEntity(string keyValue) + { + try + { + return Purchase_Travel_ApplyService.GetPurchase_Travel_ApplydetailsEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_Travel_ApplyEntity GetEntityByProcessId(string processId) + { + try + { + return Purchase_Travel_ApplyService.GetEntityByProcessId(processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + Purchase_Travel_ApplyService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, Purchase_Travel_ApplyEntity entity,List Purchase_Travel_applydetailsList) + { + try + { + Purchase_Travel_ApplyService.SaveEntity(keyValue, entity,Purchase_Travel_applydetailsList); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + + #region 扩展数据 + + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + Purchase_Travel_ApplyService.ModifyStatus(keyValue, status, processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 修改课程异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + try + { + Purchase_Travel_ApplyService.ModifyStatusByProcessId(status, processId); + } + 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/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyEntity.cs new file mode 100644 index 000000000..843533573 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyEntity.cs @@ -0,0 +1,129 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplyEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// DepartmentId + /// + [Column("DEPARTMENTID")] + public string DepartmentId { get; set; } + /// + /// Creator + /// + [Column("CREATOR")] + public string Creator { get; set; } + /// + /// Createtime + /// + [Column("CREATETIME")] + public DateTime? Createtime { get; set; } + /// + /// Payee + /// + [Column("PAYEE")] + public string Payee { get; set; } + /// + /// Attachcount + /// + [Column("ATTACHCOUNT")] + public string Attachcount { get; set; } + /// + /// Totalamount + /// + [Column("TOTALAMOUNT")] + public decimal? Totalamount { get; set; } + /// + /// FilePath + /// + [Column("FILEPATH")] + public string FilePath { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// Approvalamount + /// + [Column("APPROVALAMOUNT")] + public decimal? Approvalamount { get; set; } + /// + /// Status + /// + [Column("STATUS")] + public int Status { get; set; } + /// + /// SubmitTime + /// + [Column("SUBMITTIME")] + public DateTime? SubmitTime { get; set; } + /// + /// CheckTime + /// + [Column("CHECKTIME")] + public DateTime? CheckTime { get; set; } + /// + /// CheckUserId + /// + [Column("CHECKUSERID")] + public string CheckUserId { get; set; } + /// + /// CheckUserName + /// + [Column("CHECKUSERNAME")] + public string CheckUserName { get; set; } + /// + /// CheckStatus + /// + [Column("CHECKSTATUS")] + public int CheckStatus { get; set; } + /// + /// ProcessId + /// + [Column("PROCESSID")] + public string ProcessId { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + #region 扩展字段 + [NotMapped] + public string deptname { set; get; } + [NotMapped] + public string creatorname { set; get; } + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyIBLL.cs new file mode 100644 index 000000000..92abcdd33 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyIBLL.cs @@ -0,0 +1,82 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public interface Purchase_Travel_ApplyIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取Purchase_Travel_applydetails表数据 + /// + /// + IEnumerable GetPurchase_Travel_ApplydetailsList(string keyValue); + /// + /// 获取Purchase_Travel_apply表实体数据 + /// + /// 主键 + /// + Purchase_Travel_ApplyEntity GetPurchase_Travel_ApplyEntity(string keyValue); + /// + /// 获取Purchase_Travel_applydetails表实体数据 + /// + /// 主键 + /// + Purchase_Travel_ApplydetailsEntity GetPurchase_Travel_ApplydetailsEntity(string keyValue); + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + Purchase_Travel_ApplyEntity GetEntityByProcessId(string processId); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, Purchase_Travel_ApplyEntity entity,List Purchase_Travel_applydetailsList); + #endregion + + + #region 扩展数据 + /// + /// 提交课程异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + void ModifyStatus(string keyValue, int status, string processId); + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + void ModifyStatusByProcessId(int status, string processId); + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyService.cs new file mode 100644 index 000000000..f5d8448c4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplyService.cs @@ -0,0 +1,401 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplyService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var database = this.BaseRepository().getDbConnection().Database; + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.Id, + t.DepartmentId, + c.f_fullname as deptname, + t.Creator, + b.f_realname as creatorname, + t.Createtime, + t.Payee, + t.Attachcount, + t.Totalamount, + t.FilePath, + t.Approvalamount, + t.Status, + t.submittime, + t.checktime, + t.checkstatus + "); + strSql.Append(" FROM Purchase_Travel_Apply t "); + strSql.Append(" left join " + database + ".dbo.LR_Base_User b on b.F_UserId=t.creator "); + strSql.Append(" left join " + database + ".dbo.LR_Base_Department c on c.F_DepartmentId=t.departmentId"); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) + { + dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); + strSql.Append(" AND ( t.Createtime >= @startTime AND t.Createtime <= @endTime ) "); + } + if (!queryParam["DepartmentId"].IsEmpty()) + { + dp.Add("DepartmentId",queryParam["DepartmentId"].ToString(), DbType.String); + strSql.Append(" AND t.DepartmentId = @DepartmentId "); + } + if (!queryParam["checkstatus"].IsEmpty()) + { + dp.Add("checkstatus", queryParam["checkstatus"].ToString(), DbType.String); + strSql.Append(" AND t.checkstatus = @checkstatus "); + } + if (!queryParam["Payee"].IsEmpty()) + { + dp.Add("Payee", "%" + queryParam["Payee"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Payee Like @Payee "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Travel_Applydetails表数据 + /// + /// 主键 + /// + public IEnumerable GetPurchase_Travel_ApplydetailsList(string keyValue) + { + try + { + string sql = "select a.*,b.Remark,b.Createtime,b.totalamount from Purchase_Travel_Applydetails a left join Purchase_Travel b on b.id=a.purchaseid where applyid='"+keyValue+"'"; + var data = this.BaseRepository("CollegeMIS").FindList(sql);// as List; + //this.BaseRepository("CollegeMIS").FindList(t => t.applyid == keyValue); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Travel_Apply表实体数据 + /// + /// 主键 + /// + public Purchase_Travel_ApplyEntity GetPurchase_Travel_ApplyEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取Purchase_Travel_Applydetails表实体数据 + /// + /// 主键 + /// + public Purchase_Travel_ApplydetailsEntity GetPurchase_Travel_ApplydetailsEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t=>t.applyid == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取主表实体数据 + /// 流程实例ID + /// + /// + public Purchase_Travel_ApplyEntity GetEntityByProcessId(string processId) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(t => t.ProcessId == processId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var Purchase_Travel_ApplyEntity = GetPurchase_Travel_ApplyEntity(keyValue); + var Purchase_Travel_ApplydetailsEntity = GetPurchase_Travel_ApplydetailsEntity(Purchase_Travel_ApplyEntity.Id); + db.Delete(t=>t.Id == keyValue); + db.Delete(t=>t.applyid == Purchase_Travel_ApplyEntity.Id); + + //同时要更新对应账单的报账状态 + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, Purchase_Travel_ApplyEntity entity,List Purchase_Travel_ApplydetailsList) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + var Purchase_Travel_ApplyEntityTmp = GetPurchase_Travel_ApplyEntity(keyValue); + var Purchase_Travel_ApplydetailsEntityTmp = GetPurchase_Travel_ApplydetailsEntity(Purchase_Travel_ApplyEntityTmp.Id); + entity.Modify(keyValue); + db.Update(entity); + db.Delete(t=>t.applyid == Purchase_Travel_ApplyEntityTmp.Id); + foreach (Purchase_Travel_ApplydetailsEntity item in Purchase_Travel_ApplydetailsList) + { + item.Create(); + item.applyid = Purchase_Travel_ApplyEntityTmp.Id; + db.Insert(item); + } + + } + else + { + entity.Create(); + db.Insert(entity); + foreach (Purchase_Travel_ApplydetailsEntity item in Purchase_Travel_ApplydetailsList) + { + item.Create(); + item.applyid = entity.Id; + db.Insert(item); + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + + + #region 扩展数据 + + /// + /// 提交异动记录 + /// + /// 课程异动表主键 + /// 审核状态 + /// 流程Id + public void ModifyStatus(string keyValue, int status, string processId) + { + try + { + var now = DateTime.Now; + var db = this.BaseRepository("CollegeMIS"); + db.BeginTrans(); + var entity = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == keyValue); + if (entity != null) + { + entity.Status = status; + entity.ProcessId = processId; + entity.SubmitTime = now; + entity.CheckStatus = 1; + db.Update(entity); + + //所有子表数据状态更新为报账中 + var details= this.BaseRepository("CollegeMIS").FindList(x => x.applyid == keyValue); + foreach (var item in details) + { + var purchasemodel = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == item.purchaseid); + purchasemodel.ApplyStatus = 1; + db.Update(purchasemodel); + } + } + db.Commit(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 修改异动表的审核状态 + /// + /// 审核状态 + /// 流程Id + public void ModifyStatusByProcessId(int status, string processId) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + var now = DateTime.Now; + var loginUserInfo = LoginUserInfo.Get(); + try + { + var entity = db.FindEntity(x => x.ProcessId == processId); + if (entity != null) + { + //获取所有的账单数据 + var details = this.BaseRepository("CollegeMIS").FindList(x => x.applyid == entity.Id); + //审核通过 + if (status == 2) + { + foreach (var item in details) + { + var purchasemodel = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == item.purchaseid); + purchasemodel.ApplyStatus = 2; + db.Update(purchasemodel); + } + } + else + { + //这里是回滚订单到草稿箱 + entity.Status = status; + //把对应的账单数据报账状态回滚到待报账 + + foreach (var item in details) + { + var purchasemodel = this.BaseRepository("CollegeMIS").FindEntity(x => x.Id == item.purchaseid); + purchasemodel.ApplyStatus = 0; + db.Update(purchasemodel); + } + } + + //更新课程异动表的审核状态 + entity.CheckStatus = status; + entity.CheckUserId = loginUserInfo.userId; + entity.CheckUserName = loginUserInfo.realName; + entity.CheckTime = now; + db.Update(entity); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplydetailsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplydetailsEntity.cs new file mode 100644 index 000000000..d0a4e3beb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Purchase_Travel_Apply/Purchase_Travel_ApplydetailsEntity.cs @@ -0,0 +1,60 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.LogisticsManagement +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2023-07-14 12:15 + /// 描 述:教务报账申请 + /// + public class Purchase_Travel_ApplydetailsEntity + { + #region 实体成员 + /// + /// Id + /// + [Column("ID")] + public string Id { get; set; } + /// + /// applyid + /// + [Column("APPLYID")] + public string applyid { get; set; } + /// + /// purchaseid + /// + [Column("PURCHASEID")] + public string purchaseid { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.Id = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.Id = keyValue; + } + #endregion + + [NotMapped] + public string Remark { set; get; } + [NotMapped] + public double TotalAmount { set; get; } + [NotMapped] + public string CreateTime { set; get; } + } +} + 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 ccc53ed60..28db00bf8 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 @@ -97,7 +97,11 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseServiceApplyMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseServiceApplyMethod.cs new file mode 100644 index 000000000..d371746e4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseServiceApplyMethod.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Learun.Application.WorkFlow +{ + public class PurchaseServiceApplyMethod : IWorkFlowMethod + { + Purchase_Service_ApplyIBLL purchase_ServiceapplyIBLL = new Purchase_Service_ApplyBLL(); + + public void Execute(WfMethodParameter parameter) + { + + if (parameter.code == "agree") + { + purchase_ServiceapplyIBLL.ModifyStatusByProcessId(2, parameter.processId); + } + else + { + purchase_ServiceapplyIBLL.ModifyStatusByProcessId(0, parameter.processId); + } + } + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseServiceMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseServiceMethod.cs new file mode 100644 index 000000000..718672f98 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseServiceMethod.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Learun.Application.WorkFlow +{ + public class PurchaseServiceMethod : IWorkFlowMethod + { + Purchase_ServiceIBLL purchase_ServiceIBLL = new Purchase_ServiceBLL(); + + public void Execute(WfMethodParameter parameter) + { + + if (parameter.code == "agree") + { + purchase_ServiceIBLL.ModifyStatusByProcessId(2, parameter.processId); + } + else + { + purchase_ServiceIBLL.ModifyStatusByProcessId(0, parameter.processId); + } + } + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseTravelApplyMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseTravelApplyMethod.cs new file mode 100644 index 000000000..c95fac6a3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseTravelApplyMethod.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Learun.Application.WorkFlow +{ + public class PurchaseTravelApplyMethod : IWorkFlowMethod + { + Purchase_Travel_ApplyIBLL purchase_TravelapplyIBLL = new Purchase_Travel_ApplyBLL(); + + public void Execute(WfMethodParameter parameter) + { + + if (parameter.code == "agree") + { + purchase_TravelapplyIBLL.ModifyStatusByProcessId(2, parameter.processId); + } + else + { + purchase_TravelapplyIBLL.ModifyStatusByProcessId(0, parameter.processId); + } + } + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseTravelMethod.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseTravelMethod.cs new file mode 100644 index 000000000..adb9455c6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.WorkFlow/NodeMethod/PurchaseTravelMethod.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Application.TwoDevelopment.LogisticsManagement; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Learun.Application.WorkFlow +{ + public class PurchaseTravelMethod : IWorkFlowMethod + { + Purchase_TravelIBLL purchase_TravelIBLL = new Purchase_TravelBLL(); + + public void Execute(WfMethodParameter parameter) + { + + if (parameter.code == "agree") + { + purchase_TravelIBLL.ModifyStatusByProcessId(2, parameter.processId); + } + else + { + purchase_TravelIBLL.ModifyStatusByProcessId(0, parameter.processId); + } + } + + } +}