From a21d88c413ad25762acc496f6ed62e3d6c914ddc Mon Sep 17 00:00:00 2001 From: fzp <645608524@qq.com> Date: Wed, 23 Aug 2023 18:08:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E7=BA=BF=E4=B8=8B=E7=BC=B4?= =?UTF-8?q?=E8=B4=B9=E6=95=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TeachSwitchController.cs | 6 + .../Views/TeachSwitch/FinaCharge.cshtml | 24 +++ .../Views/TeachSwitch/FinaCharge.js | 80 ++++++++++ .../Controllers/FinaChargeRefundController.cs | 6 + .../FinaChargeStuYearController.cs | 33 +++- .../Views/FinaChargeRefund/FormView.cshtml | 35 +++++ .../Views/FinaChargeRefund/FormView.js | 37 +++++ .../Views/FinaChargeStuBalance/Index.js | 10 +- .../FinaChargeStuYear/IndexForStudent.js | 7 +- .../FinaChargeStuYear/IndexForTeacher.js | 25 +++- .../Views/FinaChargeStuYearItem/Index.js | 5 +- .../IndexForRefund.cshtml | 1 + .../FinaChargeStuYearItem/IndexForRefund.js | 28 +++- .../FinaChargeStuYearItem/IndexForTeacher.js | 5 +- .../Content/excel/线下缴费记录.xls | Bin 23552 -> 23552 bytes .../Learun.Application.Web.csproj | 4 + .../FinaChargeStuYearApi.cs | 14 +- .../ClassInfo/ClassInfoBLL.cs | 55 +++++++ .../ClassInfo/ClassInfoIBLL.cs | 3 + .../ClassInfo/ClassInfoService.cs | 56 +++++++ .../TeachSwitch/TeachSwitchService.cs | 4 + .../FinaChargeRefundService.cs | 8 +- .../FinaChargeStuOrderService.cs | 141 ++++++++++-------- .../FinaChargeStuYearItemService.cs | 5 - 24 files changed, 480 insertions(+), 112 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachSwitchController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachSwitchController.cs index fb61ddcca..473befdba 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachSwitchController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachSwitchController.cs @@ -28,6 +28,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + [HttpGet] + public ActionResult FinaCharge() + { + return View(); + } /// /// 表单页 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.cshtml new file mode 100644 index 000000000..718122f8e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.cshtml @@ -0,0 +1,24 @@ +@{ + ViewBag.Title = "教师注册功能开关控制"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+ +
+
+  修改 +
+
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.js new file mode 100644 index 000000000..13a678d06 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachSwitch/FinaCharge.js @@ -0,0 +1,80 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-07-08 17:19 + * 描 述:教师注册功能开关控制 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TeachSwitch/GetPageList', + headData: [ + { + label: "缴费开关", name: "type", width: 300, align: "left", + formatter: function (val) { + if (val == 'jf') { + return '缴费开关'; + } + } + }, + { + label: "是否开启", name: "status", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'YesOrNoInt', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + ], + mainId: 'ID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.JF = 1; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeRefundController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeRefundController.cs index 03e2b9a9a..b4be119fb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeRefundController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeRefundController.cs @@ -39,6 +39,12 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { return View(); } + + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearController.cs index 4fd3c6c8d..5b5921a16 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearController.cs @@ -28,7 +28,8 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { private FinaChargeStuYearIBLL finaChargeStuYearIBLL = new FinaChargeStuYearBLL(); private FinaChargeStuOrderIBLL finaChargeStuOrderIbll = new FinaChargeStuOrderBLL(); - private EADateArrangeIBLL eaDateArrangeIbll = new EADateArrangeBLL(); + private TeachSwitchIBLL teachSwitchIbll = new TeachSwitchBLL(); + private ClassInfoIBLL classInfoIbll = new ClassInfoBLL(); #region 视图功能 @@ -88,12 +89,8 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [AjaxOnly] public ActionResult IfCanPay() { - var nowyearsemester = Common.GetSemesterAndYear(); - var eastatus = eaDateArrangeIbll.GetEADateArrangeEntity("17"); - if (eastatus != null && eastatus.CheckMark == "1" && - eastatus.AcademicYearNo == nowyearsemester.AcademicYearShort - && eastatus.Semester == nowyearsemester.Semester && eastatus.MakeDate < DateTime.Now && - eastatus.EndDate > DateTime.Now) + var eastatus = teachSwitchIbll.GetFirst("jf"); + if (eastatus != null && eastatus.status == "1") { return Success(new { success = "1" }); } @@ -108,6 +105,28 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers var data = finaChargeStuYearIBLL.GetTree(); return Success(data); } + + [HttpGet] + [AjaxOnly] + public ActionResult GetClassByEmpNo() + { + var data = classInfoIbll.GetClassByEmpNo(LoginUserInfo.Get().account); + return Success(data); + } + [HttpGet] + [AjaxOnly] + public ActionResult GetDeptByEmpNo() + { + var data = classInfoIbll.GetDeptByEmpNo(LoginUserInfo.Get().account); + return Success(data); + } + [HttpGet] + [AjaxOnly] + public ActionResult GetMajorByEmpNo() + { + var data = classInfoIbll.GetMajorByEmpNo(LoginUserInfo.Get().account); + return Success(data); + } /// /// 获取页面显示列表数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.cshtml new file mode 100644 index 000000000..0dc74b5b8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "FinaChargeRefund"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
缴费项目编号
+ +
+
+
缴费项目名称
+ +
+
+
退费方式
+
+
+
+
退费金额
+ +
+
+
操作时间
+ +
+
+
操作人
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.js new file mode 100644 index 000000000..7a5ada0ee --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeRefund/FormView.js @@ -0,0 +1,37 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-08-18 18:07 + * 描 述:FinaChargeRefund + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#RType').lrDataItemSelect({ code: 'RType' }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeRefund/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]); + } + } + }); + } + } + }; + + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuBalance/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuBalance/Index.js index 5a719781a..df60c5809 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuBalance/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuBalance/Index.js @@ -62,12 +62,12 @@ var bootstrap = function ($, learun) { { label: "收费项目编号", name: "ChargeItemCode", width: 100, align: "left" }, { label: "收费项目名称", name: "ChargeItemName", width: 100, align: "left" }, { label: "收费标准", name: "Standard", width: 100, align: "left" }, - { label: "本次待缴金额", name: "DJAmount", width: 100, align: "left" }, - { label: "变动金额", name: "PaymentAmount", width: 100, align: "left" }, - { label: "剩余待缴金额", name: "QJAmount", width: 100, align: "left" }, - { label: "当前余额", name: "OldBalance", width: 100, align: "left" }, + { label: "本次应缴余额", name: "DJAmount", width: 100, align: "left" }, + { label: "缴费金额", name: "PaymentAmount", width: 100, align: "left" }, + { label: "剩余应缴余额", name: "QJAmount", width: 100, align: "left" }, + { label: "当前超出应收额", name: "OldBalance", width: 100, align: "left" }, { label: "本次变动金额", name: "ChangeAmount", width: 100, align: "left" }, - { label: "本次余额", name: "NowBalance", width: 100, align: "left" }, + { label: "超出应收额", name: "NowBalance", width: 100, align: "left" }, { label: "变动时间", name: "ChangeDate", width: 150, align: "left" }, { label: "变动原因", name: "ChangeType", width: 100, align: "left", formatter: function (cellvalue, row) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForStudent.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForStudent.js index 4e52b0255..0b386ea48 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForStudent.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForStudent.js @@ -143,9 +143,10 @@ var bootstrap = function ($, learun) { }, { label: "年级", name: "Grade", width: 100, align: "left" }, { label: "缴费年度", name: "FSYear", width: 100, align: "left" }, - { label: "应缴金额", name: "YJAmount", width: 100, align: "left" }, - { label: "实缴金额", name: "SJAmount", width: 100, align: "left" }, - { label: "缴费年度余额", name: "FSBlance", width: 100, align: "left" }, + { label: "收费标准", name: "YJAmount", width: 80, align: "left" }, + { label: "缴费金额", name: "SJAmount", width: 80, align: "left" }, + { label: "应缴余额", name: "NeedToPay", width: 80, align: "left" }, + { label: "超出应收额", name: "FSBlance", width: 80, align: "left" }, { label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", formatter: function (cellvalue, row) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForTeacher.js index 72f1498eb..6a7a2b132 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYear/IndexForTeacher.js @@ -25,9 +25,21 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 250, 400); - $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); - $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); - $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + $('#DeptNo').lrselect({ + url: "/ReceiveSendFeeManagement/FinaChargeStuYear/GetDeptByEmpNo", + value: "DeptNo", + text: "DeptName" + }); + $('#MajorNo').lrselect({ + url: "/ReceiveSendFeeManagement/FinaChargeStuYear/GetMajorByEmpNo", + value: "MajorNo", + text: "MajorName" + }); + $('#ClassNo').lrselect({ + url:"/ReceiveSendFeeManagement/FinaChargeStuYear/GetClassByEmpNo", + value: "ClassNo", + text: "ClassName" + }); $('#PayFeeStatus').lrDataItemSelect({ code: 'PayStatus' }); // 刷新 $('#lr_refresh').on('click', function () { @@ -106,9 +118,10 @@ var bootstrap = function ($, learun) { }, { label: "年级", name: "Grade", width: 80, align: "left" }, { label: "缴费年度", name: "FSYear", width: 100, align: "left" }, - { label: "应缴金额", name: "YJAmount", width: 100, align: "left" }, - { label: "实缴金额", name: "SJAmount", width: 100, align: "left" }, - { label: "缴费年度余额(负数代表欠缴)", name: "FSBlance", width: 180, align: "left" }, + { label: "收费标准", name: "YJAmount", width: 80, align: "left" }, + { label: "缴费金额", name: "SJAmount", width: 80, align: "left" }, + { label: "应缴余额", name: "NeedToPay", width: 80, align: "left" }, + { label: "超出应收额", name: "FSBlance", width: 80, align: "left" }, { label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", formatter: function (cellvalue, row) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js index b23bec82d..738c36e48 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js @@ -143,8 +143,9 @@ var bootstrap = function ($, learun) { } }, { label: "收费标准", name: "Standard", width: 100, align: "left" }, - { label: "实缴金额", name: "SJAmount", width: 100, align: "left" }, - { label: "缴费余额", name: "FSBlance", width: 100, align: "left" }, + { label: "缴费金额", name: "SJAmount", width: 100, align: "left" }, + { label: "应缴余额", name: "NeedToPay", width: 100, align: "left" }, + { label: "超出应收额", name: "FSBlance", width: 100, align: "left" }, { label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.cshtml index 2be774001..d26428af6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.cshtml @@ -56,6 +56,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.js index 1b3db4124..07ff701be 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForRefund.js @@ -58,6 +58,29 @@ var bootstrap = function ($, learun) { }); } }); + //查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('FSYIId'); + var RefundStatus = $('#gridtable').jfGridValue('RefundStatus'); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.error("查看操作只支持单条记录"); + return; + } + if (RefundStatus==false) { + learun.alert.error("未进行退费操作,请核对。"); + return; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeRefund/FormView?keyValue=' + keyValue, + width: 600, + height: 400, + btn:null + }); + } + }); }, // 初始化列表 initGird: function () { @@ -108,8 +131,9 @@ var bootstrap = function ($, learun) { } }, { label: "收费标准", name: "Standard", width: 100, align: "left" }, - { label: "实缴金额", name: "SJAmount", width: 100, align: "left" }, - { label: "缴费余额", name: "FSBlance", width: 100, align: "left" }, + { label: "缴费金额", name: "SJAmount", width: 100, align: "left" }, + { label: "应缴余额", name: "NeedToPay", width: 100, align: "left" }, + { label: "超出应收额", name: "FSBlance", width: 100, align: "left" }, { label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForTeacher.js index ca0a72d71..f66fb1a33 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/IndexForTeacher.js @@ -88,8 +88,9 @@ var bootstrap = function ($, learun) { } }, { label: "收费标准", name: "Standard", width: 100, align: "left" }, - { label: "实缴金额", name: "SJAmount", width: 100, align: "left" }, - { label: "缴费余额", name: "FSBlance", width: 100, align: "left" }, + { label: "缴费金额", name: "SJAmount", width: 100, align: "left" }, + { label: "应缴余额", name: "NeedToPay", width: 100, align: "left" }, + { label: "超出应收额", name: "FSBlance", width: 100, align: "left" }, { label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/线下缴费记录.xls b/Learun.Framework.Ultimate V7/Learun.Application.Web/Content/excel/线下缴费记录.xls index d8cec16f6f93bed6eb25251c0f65f944cbe90811..17e033b229d760a9422304e8317986bfb899dd4d 100644 GIT binary patch delta 778 zcmZqJ!Pu~aaf2dry%G~+cXY77A%h6R9R>yl4u%PgK#HM_0`VjD29_VlEE)~Qo&Ik-4Ob3B1Fu@_tiB+75K^$y; zJ!VjIVYQe6XaRPI+F%uDWU$9-F$04gvii-ktl3(s8v39hW@8A>NKGvKKMkcyl4u%PgK#HM_0`VjD29_VlEE)~Qo&Ik-4Ob3B1Fu@_tiB+75K^$y; zJ!VjIVYQe6XaRPI+F%uDWU$9-F$04gvii-ktl3(sruv{DW@8A>NKGvA@t}~DYQ3niqSal5<7+!Aero!GagxPOR + @@ -1632,6 +1633,7 @@ + @@ -7995,6 +7997,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs index d3a064874..708a0a401 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/ReceiveSendFeeManagement/FinaChargeStuYearApi.cs @@ -31,7 +31,7 @@ namespace Learun.Application.WebApi.Modules { private FinaChargeStuYearIBLL finaChargeStuYearIBLL = new FinaChargeStuYearBLL(); private FinaChargeStuOrderIBLL finaChargeStuOrderIbll = new FinaChargeStuOrderBLL(); - private EADateArrangeIBLL eaDateArrangeIbll = new EADateArrangeBLL(); + private TeachSwitchIBLL teachSwitchIbll = new TeachSwitchBLL(); public FinaChargeStuYearApi() : base("/ReceiveSendFeeManagement/FinaChargeStuYearApi") @@ -51,12 +51,8 @@ namespace Learun.Application.WebApi.Modules public Response GetPayfeeList(dynamic _) { - var nowyearsemester = Common.GetSemesterAndYear(); - var eastatus = eaDateArrangeIbll.GetEADateArrangeEntity("17"); - if (eastatus != null && eastatus.CheckMark == "1" && - eastatus.AcademicYearNo == nowyearsemester.AcademicYearShort - && eastatus.Semester == nowyearsemester.Semester && eastatus.MakeDate < DateTime.Now && - eastatus.EndDate > DateTime.Now) + var eastatus = teachSwitchIbll.GetFirst("jf"); + if (eastatus != null && eastatus.status == "1") { ReqPageParam parameter = this.GetReqData(); var data = finaChargeStuYearIBLL.GetPageList(parameter.pagination, parameter.queryJson); @@ -73,7 +69,7 @@ namespace Learun.Application.WebApi.Modules { return Fail("当前不在缴费时间范围"); } - + } public Response GetPayfeeInfo(dynamic _) @@ -206,7 +202,7 @@ namespace Learun.Application.WebApi.Modules bt = qrCodeEncoder.Encode(enCodeString, Encoding.UTF8); //二维码图片的名称 string filename = orderId; - if (!DirFileHelper.IsExistFile(QRCodeFile+"/Content/images/QRCode/")) + if (!DirFileHelper.IsExistFile(QRCodeFile + "/Content/images/QRCode/")) { Directory.CreateDirectory(QRCodeFile + "/Content/images/QRCode/"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs index d23fd75a4..dffc5c2b1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs @@ -256,6 +256,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetClassByEmpNo(string EmpNo) + { + try + { + return classInfoService.GetClassByEmpNo(EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable GetDeptByEmpNo(string EmpNo) + { + try + { + return classInfoService.GetDeptByEmpNo(EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable GetMajorByEmpNo(string EmpNo) + { + try + { + return classInfoService.GetMajorByEmpNo(EmpNo); + } + 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/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs index d6972f2bf..41c5d33f7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs @@ -62,5 +62,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetAllClass(); IEnumerable GetClassByMajorNo(string majorNo); + IEnumerable GetClassByEmpNo(string EmpNo); + IEnumerable GetDeptByEmpNo(string EmpNo); + IEnumerable GetMajorByEmpNo(string EmpNo); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs index 22f3f3772..b5d8b2ad3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs @@ -348,5 +348,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public IEnumerable GetClassByEmpNo(string EmpNo) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(m => m.CheckMark == true && m.ClassDiredctorNo == EmpNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public IEnumerable GetDeptByEmpNo(string EmpNo) + { + try + { + return this.BaseRepository("CollegeMIS").FindList("select b.* from ClassInfo a left join cddept b on a.deptno=b.deptno where a.ClassDiredctorNo='"+EmpNo+ "' and a.CheckMark=1"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetMajorByEmpNo(string EmpNo) + { + try + { + return this.BaseRepository("CollegeMIS").FindList("select b.* from ClassInfo a left join cdmajor b on a.majorno=b.majorno where a.ClassDiredctorNo='" + EmpNo + "' and a.checkmark=1 and b.checkmark=1"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs index 97e966393..0238cb421 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachSwitch/TeachSwitchService.cs @@ -84,6 +84,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); + if (!queryParam["JF"].IsEmpty()) + { + strSql.Append(" AND t.type ='jf' "); + } return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeRefund/FinaChargeRefundService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeRefund/FinaChargeRefundService.cs index caabd62ae..514e83ec4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeRefund/FinaChargeRefundService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeRefund/FinaChargeRefundService.cs @@ -155,11 +155,9 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement //退费状态修改,余额归零 finaChargeStuYearItemEntity.RefundStatus = true; finaChargeStuYearItemEntity.FSBlance = 0; - //退费后实缴值也要更新 - finaChargeStuYearItemEntity.SJAmount = finaChargeStuYearItemEntity.SJAmount- finaChargeRefundEntity.Amount; db.Update(finaChargeStuYearItemEntity); //FinaChargeStuYear年度余额计算 - db.ExecuteBySql("update FinaChargeStuYear set SJAmount=SJAmount-"+ finaChargeRefundEntity.Amount + ",FSBlance=FSBlance-" + finaChargeRefundEntity.Amount + " where FSYId='" + finaChargeStuYearItemEntity.FSYId + "'"); + db.ExecuteBySql("update FinaChargeStuYear set FSBlance=FSBlance-" + finaChargeRefundEntity.Amount + " where FSYId='" + finaChargeStuYearItemEntity.FSYId + "'"); //学生余额扣减 db.ExecuteBySql("update FinaChargeStudent set FSBlance=FSBlance-" + finaChargeRefundEntity.Amount + " where StuNo='" + finaChargeStuYearItemEntity.StuNo + "'"); //交易流水记录 @@ -172,10 +170,10 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement finaChargeStuBalance.ChargeItemName = finaChargeRefundEntity.ChargeItemName; finaChargeStuBalance.Standard = finaChargeStuYearItemEntity.Standard; finaChargeStuBalance.DJAmount = 0; - finaChargeStuBalance.PaymentAmount = -finaChargeRefundEntity.Amount; + finaChargeStuBalance.PaymentAmount =0; finaChargeStuBalance.QJAmount = 0; finaChargeStuBalance.OldBalance = finaChargeRefundEntity.Amount; - finaChargeStuBalance.ChangeAmount = finaChargeStuBalance.PaymentAmount; + finaChargeStuBalance.ChangeAmount = finaChargeRefundEntity.Amount; finaChargeStuBalance.NowBalance = 0; finaChargeStuBalance.ChangeDate = DateTime.Now; finaChargeStuBalance.ChangeType = 4; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs index e9743f94a..9c0a3c6bb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuOrder/FinaChargeStuOrderService.cs @@ -269,6 +269,8 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement { failDt.Columns.Add(dc.ColumnName, dc.DataType); } + //导入订单 + var oldOrderList = BaseRepository("CollegeMIS").FindList("select * from FinaChargeStuOrder where OrderType='2' "); //缴费方式字典 var dataitemlist = datarItemService.GetDetailList("PayTypeOffLine"); //获取已有年度学生缴费记录 @@ -285,7 +287,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement FinaChargeStuYearEntity finaChargeStuYearEntity = null; int ChangeType = 0; //检测是否有空值 - if (dr[0].ToString() == "" || dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "" || dr[4].ToString() == "" || dr[5].ToString() == "" || dr[6].ToString() == "") + if (dr[0].ToString() == "" || dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "" || dr[4].ToString() == "" || dr[5].ToString() == "") { throw new Exception("行内数据有空值,不能为空!"); } @@ -311,7 +313,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement //筛选不在收费学生表内的数据 finaChargeStuYearEntity = oldFinaChargeStuYearList.FirstOrDefault(m => m.StuNo == dr[0].ToString() && m.FSYear == payyearresult); finaChargeStuYearItemList = oldFinaChargeStuYearItemList.Where(m => m.StuNo == dr[0].ToString() && m.StuName == dr[1].ToString() && m.FSYear == payyearresult); - if (finaChargeStuYearEntity == null || finaChargeStuYearItemList.Count()==0) + if (finaChargeStuYearEntity == null || finaChargeStuYearItemList.Count() == 0) { throw new Exception("【年度收费学生】不存在,请核对!"); } @@ -324,52 +326,39 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } //缴费方式判断 - var itemcodeentity = dataitemlist.FirstOrDefault(m=>m.F_ItemName==dr[6].ToString()); - if (itemcodeentity==null) + var itemcodeentity = dataitemlist.FirstOrDefault(m => m.F_ItemName == dr[4].ToString()); + if (itemcodeentity == null) { throw new Exception("【缴费方式】只能为现金或贷款,请核对!"); } int itemcodeint = 0; - if (!int.TryParse(itemcodeentity.F_ItemCode,out itemcodeint)) + if (!int.TryParse(itemcodeentity.F_ItemCode, out itemcodeint)) { throw new Exception("【线下缴费方式字典(PayTypeOffLine)】值code只能为整数,请核对!"); } - //缴费明细判断 - finaChargeStuYearItemEntity =finaChargeStuYearItemList.FirstOrDefault(m=>m.ChargeItemCode==dr[3].ToString()); - if (finaChargeStuYearItemEntity==null) + //线下订单去重 + if (oldOrderList.Count(m => m.BankOrder == dr[5].ToString()) > 0) { - throw new Exception("【年度学生收费明细】不存在,请核对!"); - } - else - { - //筛选已缴费的学生 - if (finaChargeStuYearItemEntity.PayFeeStatus == 1) - { - throw new Exception("【年度学生收费明细】已缴费,请核对!"); - } + throw new Exception("【线下缴费编号】已存在,请核对!"); } + //开始导入 //生成订单 - FinaChargeStuOrderEntity orderEntity=new FinaChargeStuOrderEntity(); + FinaChargeStuOrderEntity orderEntity = new FinaChargeStuOrderEntity(); orderEntity.Create(); - orderEntity.FSYId = finaChargeStuYearItemEntity.FSYId; - orderEntity.YearNo = finaChargeStuYearItemEntity.FSYear; - orderEntity.StuNo = finaChargeStuYearItemEntity.StuNo; + orderEntity.FSYId = finaChargeStuYearEntity.FSYId; + orderEntity.YearNo = finaChargeStuYearEntity.FSYear; + orderEntity.StuNo = finaChargeStuYearEntity.StuNo; Random ran = new Random(); orderEntity.orderid = DateTime.Now.ToString("yyyyMMddhhmmss") + ran.Next(0, 100000); - orderEntity.YJAmount = finaChargeStuYearItemEntity.Standard; - orderEntity.SJAmount = dresult; - orderEntity.DJAmount = orderEntity.YJAmount-orderEntity.SJAmount; - if (orderEntity.DJAmount < 0)//有结余 - { - orderEntity.NowBlance = Math.Abs(orderEntity.DJAmount.Value); - orderEntity.DJAmount = 0; - } orderEntity.PlaceOrderTime = DateTime.Now; orderEntity.Status = 1; orderEntity.OrderType = 2; - db.Insert(orderEntity); - //订单明细 + orderEntity.BankOrder = dr[5].ToString(); + //历史固定项目未缴费和部分缴费的数据 + var oldnotpaylist = oldFinaChargeStuYearItemList.Where(m => m.PayFeeStatus != 1).OrderBy(m => m.priority).ToList(); + finaChargeStuYearItemEntity = oldnotpaylist.FirstOrDefault(); + //订单明细 写入优先级最高的一条为暂存位置 FinaChargeStuOrderDetailEntity detail = new FinaChargeStuOrderDetailEntity(); detail.Create(); detail.FCSOId = orderEntity.Id; @@ -383,21 +372,27 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement detail.NowBlance = Math.Abs(detail.DJAmount.Value); detail.DJAmount = 0; } + //主表金额根据子表计算 + orderEntity.YJAmount = detail.YJAmount; + orderEntity.SJAmount = dresult; + orderEntity.DJAmount = detail.DJAmount; + orderEntity.NowBlance = detail.NowBlance; + db.Insert(orderEntity); db.Insert(detail); //判断实缴金额是否缴清费用 decimal sjcount = Convert.ToDecimal(db.FindObject("select isnull(sum(SJAmount),0) from FinaChargeStuOrder where StuNo='" + orderEntity.StuNo + "' and Status=1 and YearNo='" + orderEntity.YearNo + "' ")); //增加本次缴费金额 sjcount = sjcount + orderEntity.SJAmount.Value; - decimal yjcount = orderEntity.YJAmount.Value; + decimal yjcount = finaChargeStuYearEntity.YJAmount.Value; if (sjcount >= yjcount) { //更新缴费状态 - db.ExecuteBySql("update FinaChargeStuYear set PayFeeStatus='1' where FSYId='" + finaChargeStuYearItemEntity.FSYId + "'"); + db.ExecuteBySql("update FinaChargeStuYear set PayFeeStatus='1' where FSYId='" + finaChargeStuYearEntity.FSYId + "'"); } else//更新部分缴费状态 { //更新缴费状态 - db.ExecuteBySql("update FinaChargeStuYear set PayFeeStatus='4' where FSYId='" + finaChargeStuYearItemEntity.FSYId + "'"); + db.ExecuteBySql("update FinaChargeStuYear set PayFeeStatus='4' where FSYId='" + finaChargeStuYearEntity.FSYId + "'"); } //费用变更明细 FinaChargeStuBalanceEntity finaChargeStuBalanceEntity = new FinaChargeStuBalanceEntity(); @@ -408,24 +403,40 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement finaChargeStuBalanceEntity.ChargeItemCode = detail.ChargeItemCode; finaChargeStuBalanceEntity.ChargeItemName = detail.ChargeItemName; finaChargeStuBalanceEntity.Standard = finaChargeStuYearItemEntity.Standard; - finaChargeStuBalanceEntity.DJAmount = finaChargeStuYearItemEntity.FSBlance < 0 ? Math.Abs(finaChargeStuYearItemEntity.FSBlance.Value) : 0; + finaChargeStuBalanceEntity.DJAmount = finaChargeStuYearItemEntity.NeedToPay; finaChargeStuBalanceEntity.PaymentAmount = dresult; - finaChargeStuBalanceEntity.QJAmount = finaChargeStuYearItemEntity.Standard - dresult>0?finaChargeStuYearItemEntity.Standard - dresult:0; - finaChargeStuBalanceEntity.OldBalance = finaChargeStuYearItemEntity.FSBlance <= 0? 0: finaChargeStuYearItemEntity.FSBlance; - finaChargeStuBalanceEntity.ChangeAmount = dresult; - finaChargeStuBalanceEntity.NowBalance = finaChargeStuYearItemEntity.FSBlance + dresult > 0? finaChargeStuYearItemEntity.FSBlance + dresult: 0; + finaChargeStuBalanceEntity.QJAmount = finaChargeStuYearItemEntity.NeedToPay - dresult > 0 ? finaChargeStuYearItemEntity.NeedToPay - dresult : 0; + finaChargeStuBalanceEntity.OldBalance = finaChargeStuYearItemEntity.FSBlance; + if (detail.NowBlance > 0) + { + finaChargeStuBalanceEntity.ChangeAmount = dresult - finaChargeStuBalanceEntity.DJAmount; + finaChargeStuBalanceEntity.NowBalance = finaChargeStuBalanceEntity.ChangeAmount; + } + else + { + finaChargeStuBalanceEntity.ChangeAmount = 0; + finaChargeStuBalanceEntity.NowBalance = 0; + } finaChargeStuBalanceEntity.ChangeDate = DateTime.Now; finaChargeStuBalanceEntity.ChangeType = itemcodeint; db.Insert(finaChargeStuBalanceEntity); //FinaChargeStuYearItem表 - finaChargeStuYearItemEntity.SJAmount = finaChargeStuYearItemEntity.SJAmount+ dresult; - finaChargeStuYearItemEntity.FSBlance = finaChargeStuYearItemEntity.FSBlance+ dresult; - finaChargeStuYearItemEntity.PayFeeStatus = finaChargeStuYearItemEntity.FSBlance>0?1:4; + finaChargeStuYearItemEntity.SJAmount = finaChargeStuYearItemEntity.SJAmount + dresult; + if (detail.NowBlance > 0) + { + finaChargeStuYearItemEntity.FSBlance = detail.NowBlance; + finaChargeStuYearItemEntity.NeedToPay = 0; + } + else + { + finaChargeStuYearItemEntity.NeedToPay = finaChargeStuYearItemEntity.Standard - dresult; + } + finaChargeStuYearItemEntity.PayFeeStatus = finaChargeStuYearItemEntity.FSBlance > 0 ? 1 : 4; db.Update(finaChargeStuYearItemEntity); //FinaChargeStuYear表 - db.ExecuteBySql("update FinaChargeStuYear set SJAmount=SJAmount+"+ dresult + ",FSBlance=FSBlance+"+dresult+ ",PayFeeStatus=(case when(FSBlance+"+ dresult + ">=0) then 1 else 4 end) where FSYId='" + finaChargeStuYearItemEntity.FSYId + "'"); + db.ExecuteBySql("update FinaChargeStuYear set SJAmount=SJAmount+" + dresult + ",NeedToPay=(case when(NeedToPay-"+ dresult + ")>0 then (NeedToPay-" + dresult + ") else 0 end),FSBlance=(case when(NeedToPay-" + dresult + ")>=0 then 0 else abs(NeedToPay-" + dresult + ") end),PayFeeStatus=(case when(NeedToPay-" + dresult + ">=0) then 1 else 4 end) where FSYId='" + finaChargeStuYearItemEntity.FSYId + "'"); //FinaChargeStudent表 - db.ExecuteBySql("update FinaChargeStudent set FSBlance=FSBlance+"+ dresult + " where StuNo='" + finaChargeStuYearItemEntity.StuNo+ "'"); + db.ExecuteBySql("update FinaChargeStudent set NeedToPay=(case when(NeedToPay-"+ dresult + ")>0 then (NeedToPay-" + dresult + ") else 0 end),FSBlance=(case when(NeedToPay-" + dresult + ")>=0 then 0 else abs(NeedToPay-" + dresult + ") end) where StuNo='" + finaChargeStuYearItemEntity.StuNo + "'"); db.Commit(); } catch (Exception ex) @@ -459,12 +470,12 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } } - + /// /// 自动分配固定项目缴费多余金额 /// /// - public void AutoCharge(int YearNo=0) + public void AutoCharge(int YearNo = 0) { try { @@ -472,20 +483,18 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement //获取有缴费余额的固定项目,按照优先级倒排,即优先级低的,先拿出多出余额去分配给高的项目 var FinaChargeStuYearItemHasBalance = BaseRepository("CollegeMIS").FindList("select a.*,b.StuNo from FinaChargeStuYearItem a left join FinaChargeStuYear b on a.FSYId=b.FSYId where ChargeItemType=1 and F_DeleteMark=0 and a.FSBlance>0 order by priority desc "); //获取欠费的固定项目,按照优先级排序,优先级高的首先会分配到多出的余额 - var FinaChargeStuYearItemHasDJ = BaseRepository("CollegeMIS").FindList("select a.*,b.StuNo from FinaChargeStuYearItem a left join FinaChargeStuYear b on a.FSYId=b.FSYId where ChargeItemType=1 and F_DeleteMark=0 and a.FSBlance<0 order by priority "); + var FinaChargeStuYearItemHasDJ = BaseRepository("CollegeMIS").FindList("select a.*,b.StuNo from FinaChargeStuYearItem a left join FinaChargeStuYear b on a.FSYId=b.FSYId where ChargeItemType=1 and F_DeleteMark=0 and a.NeedToPay>0 order by priority "); foreach (var hasBalanceItem in FinaChargeStuYearItemHasBalance) { if (hasBalanceItem.FSBlance > 0) { - //可分配余额 - decimal balance = hasBalanceItem.FSBlance.Value; foreach (var QJItem in FinaChargeStuYearItemHasDJ) { var db = BaseRepository("CollegeMIS").BeginTrans(); - if (QJItem.FSBlance<0 && hasBalanceItem.FSBlance>0) + if (QJItem.NeedToPay >0 && hasBalanceItem.FSBlance > 0) { //费用变更表 - //含余额表扣减 + //超出应收额表余额扣减 FinaChargeStuBalanceEntity finaChargeStuBalanceMinus = new FinaChargeStuBalanceEntity(); finaChargeStuBalanceMinus.Create(); finaChargeStuBalanceMinus.StuNo = hasBalanceItem.StuNo; @@ -496,6 +505,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement finaChargeStuBalanceMinus.Standard = hasBalanceItem.Standard; finaChargeStuBalanceMinus.DJAmount = 0; finaChargeStuBalanceMinus.QJAmount = 0; + finaChargeStuBalanceMinus.PaymentAmount = 0; finaChargeStuBalanceMinus.OldBalance = hasBalanceItem.FSBlance; finaChargeStuBalanceMinus.ChangeDate = DateTime.Now; finaChargeStuBalanceMinus.ChangeType = 5; @@ -508,26 +518,26 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement finaChargeStuBalanceAdd.ChargeItemCode = QJItem.ChargeItemCode; finaChargeStuBalanceAdd.ChargeItemName = QJItem.ChargeItemName; finaChargeStuBalanceAdd.Standard = QJItem.Standard; - finaChargeStuBalanceAdd.DJAmount = Math.Abs(QJItem.FSBlance.Value); - finaChargeStuBalanceMinus.ChangeDate = DateTime.Now; - finaChargeStuBalanceMinus.ChangeType = 6; + finaChargeStuBalanceAdd.DJAmount =QJItem.NeedToPay; + finaChargeStuBalanceAdd.ChangeDate = DateTime.Now; + finaChargeStuBalanceAdd.ChangeType = 6; //余额分配还有剩余 - if (balance + QJItem.FSBlance >= 0) + if (hasBalanceItem.FSBlance - QJItem.NeedToPay >= 0) { QJItem.SJAmount = QJItem.Standard; QJItem.FSBlance = 0; QJItem.PayFeeStatus = 1; - hasBalanceItem.FSBlance = hasBalanceItem.FSBlance + QJItem.FSBlance; - finaChargeStuBalanceMinus.PaymentAmount = QJItem.FSBlance; - finaChargeStuBalanceMinus.ChangeAmount = QJItem.FSBlance; + hasBalanceItem.FSBlance = hasBalanceItem.FSBlance - QJItem.NeedToPay; + finaChargeStuBalanceMinus.ChangeAmount = -QJItem.NeedToPay; finaChargeStuBalanceMinus.NowBalance = hasBalanceItem.FSBlance; db.Insert(finaChargeStuBalanceMinus); - //欠费变更 - finaChargeStuBalanceAdd.PaymentAmount = Math.Abs(QJItem.FSBlance.Value); + //欠费变更记录 + finaChargeStuBalanceAdd.PaymentAmount = QJItem.NeedToPay; finaChargeStuBalanceAdd.QJAmount = 0; finaChargeStuBalanceAdd.OldBalance = 0; - finaChargeStuBalanceAdd.ChangeAmount = Math.Abs(QJItem.FSBlance.Value); + finaChargeStuBalanceAdd.ChangeAmount = 0; finaChargeStuBalanceAdd.NowBalance = 0; + QJItem.NeedToPay = 0; db.Insert(finaChargeStuBalanceAdd); db.Update(hasBalanceItem); db.Update(QJItem); @@ -537,19 +547,18 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement else { QJItem.SJAmount = QJItem.SJAmount + hasBalanceItem.FSBlance; - QJItem.FSBlance = QJItem.FSBlance + hasBalanceItem.FSBlance; QJItem.PayFeeStatus = 4; - hasBalanceItem.FSBlance = 0; - finaChargeStuBalanceMinus.PaymentAmount = -hasBalanceItem.FSBlance; finaChargeStuBalanceMinus.ChangeAmount = -hasBalanceItem.FSBlance; finaChargeStuBalanceMinus.NowBalance = 0; db.Insert(finaChargeStuBalanceMinus); //欠费变更 finaChargeStuBalanceAdd.PaymentAmount = hasBalanceItem.FSBlance; - finaChargeStuBalanceAdd.QJAmount = QJItem.FSBlance+ hasBalanceItem.FSBlance; + finaChargeStuBalanceAdd.QJAmount = QJItem.NeedToPay - hasBalanceItem.FSBlance; finaChargeStuBalanceAdd.OldBalance = 0; - finaChargeStuBalanceAdd.ChangeAmount = hasBalanceItem.FSBlance; + finaChargeStuBalanceAdd.ChangeAmount = 0; finaChargeStuBalanceAdd.NowBalance = 0; + QJItem.NeedToPay = QJItem.NeedToPay - hasBalanceItem.FSBlance; + hasBalanceItem.FSBlance = 0; db.Insert(finaChargeStuBalanceAdd); db.Update(hasBalanceItem); db.Update(QJItem); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs index 275f8dcf6..0c6ef7075 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs @@ -370,11 +370,6 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement //更新主表 oldFinaChargeStuYearEntity.YJAmount+= finaChargeStuYearItem.Standard; oldFinaChargeStuYearEntity.NeedToPay += finaChargeStuYearItem.Standard; - //if (oldFinaChargeStuYearEntity.FSBlance>0) - //{ - - //} - //oldFinaChargeStuYearEntity.FSBlance -= finaChargeStuYearItem.Standard; db.Update(oldFinaChargeStuYearEntity); } else