From 637c7beffe8e33250d74e2c2f71552a02c0ada46 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 7 Mar 2022 16:17:43 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91?= =?UTF-8?q?=E4=BA=91=E7=9B=98=E6=96=87=E4=BB=B6=E7=BB=9F=E8=AE=A1=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ResourceFileController.cs | 45 +++++++++++ .../Views/ResourceFile/FileStatistic.cshtml | 37 +++++++++ .../Views/ResourceFile/FileStatistic.js | 79 +++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../File/FileInfo/FileInfoBLL.cs | 4 + .../File/FileInfo/FileInfoIBLL.cs | 1 + .../File/FileInfo/FileInfoService.cs | 21 ++++- 7 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs index 1fc7ea82c..41d34382f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Controllers/ResourceFileController.cs @@ -83,6 +83,15 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers { return View(); } + /// + /// 云盘文件统计 + /// + /// + [HttpGet] + public ActionResult FileStatistic() + { + return View(); + } #endregion #region 获取数据 @@ -204,6 +213,42 @@ namespace Learun.Application.Web.Areas.LR_OAModule.Controllers var data = fileInfoBLL.GetEntity(keyValue); return JsonResult(data); } + /// + /// 获取云盘文件统计数据 + /// + /// + /// + public ActionResult GetFileStatisitcData(string queryJson) + { + var data = fileInfoBLL.GetListByJson(queryJson); + var dataGroup = data.Where(x => x.F_CreateDate.HasValue).GroupBy(x => x.F_CreateDate.Value.Month).Select(x => new TempClass() + { + month=x.Key, + count = x.Select(y=>y.F_FileId).Count() + }); + + var xAxis = new List(); + var seriesData = new List(); + for (int i = 0; i < 12; i++) + { + xAxis.Add(string.Format("{0}月", i + 1)); + var aa = dataGroup.FirstOrDefault(x => x.month == (i + 1)); + seriesData.Add(aa == null ? 0 : aa.count); + } + + var jsonData = new + { + seriesData = seriesData, + xAxis = xAxis + }; + + return Success(jsonData); + } + public class TempClass { + public int month { get; set; } + public int count { get; set; } + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.cshtml new file mode 100644 index 000000000..05248285b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.cshtml @@ -0,0 +1,37 @@ + +@{ + ViewBag.Title = "流程使用报表"; + Layout = "~/Views/Shared/_ReportTemplate.cshtml"; +} + +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+  刷新 +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +@Html.AppendJsFile("/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js new file mode 100644 index 000000000..8e2380daa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OAModule/Views/ResourceFile/FileStatistic.js @@ -0,0 +1,79 @@ +var bootstrap = function ($, learun) { + "use strict"; + var year = ""; + var page = { + init: function () { + page.bind(); + page.initChart(); + }, + bind: function () { + //当前年 + var now = learun.formatDate(new Date(), 'yyyy'); + $('#year').val(now); + year = now; + // 刷新 + $('#lr-replace').on('click', function () { + location.reload(); + }); + //查询 + $('#btn_Search').on('click', function () { + year = $('#year').val(); + page.search(); + }); + }, + initChart: function () { + var myChart1 = echarts.init(document.getElementById('main')); + var queryJson = { year: year }; + learun.httpAsyncPost(top.$.rootUrl + "/LR_OAModule/ResourceFile/GetFileStatisitcData", { queryJson: JSON.stringify(queryJson) }, function (res) { + if (res.code == 200) { + var option1 = { + title: { + text: year + '年云盘文件统计图', + x: 'center' + }, + legend: { + orient: 'vertical', + left: 'left', + data: ['数量'] + }, + tooltip: { + trigger: 'axis' + }, + grid: { + left: '5%', + right: '3%', + bottom: '3%', + containLabel: true + }, + xAxis: { + type: 'category', + data: res.data.xAxis + }, + yAxis: { + type: 'value', + name: '文件数/个' + + }, + series: [ + { + name: '数量', + type: 'bar', + data: res.data.seriesData + } + ] + }; + myChart1.setOption(option1); + } + }); + + }, + search: function (param) { + param = param || {}; + param.year = year; + page.initChart(); + } + }; + 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 6713a49cf..2b9b31c33 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 @@ -1490,6 +1490,7 @@ + @@ -7628,6 +7629,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs index fa1010940..1f199ff9b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoBLL.cs @@ -33,6 +33,10 @@ namespace Learun.Application.OA.File.FileInfo { return service.GetList(); } + public IEnumerable GetListByJson(string queryJson) + { + return service.GetListByJson(queryJson); + } /// /// 文档列表 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs index a717529c8..df2d8f347 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoIBLL.cs @@ -22,6 +22,7 @@ namespace Learun.Application.OA.File.FileInfo IEnumerable GetList(string userId); IEnumerable GetList(); + IEnumerable GetListByJson(string queryJson); /// /// 文档列表 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs index 27aad6bf0..f038d9021 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.OA/File/FileInfo/FileInfoService.cs @@ -1,4 +1,5 @@ using Learun.DataBase.Repository; +using Learun.Util; using System; using System.Collections.Generic; using System.Data.Common; @@ -24,7 +25,25 @@ namespace Learun.Application.OA.File.FileInfo public IEnumerable GetList() { string sql = "select * from LR_OA_FileInfo where F_DeleteMark = 0"; - return this.BaseRepository().FindList(); + return this.BaseRepository().FindList(sql); + } + public IEnumerable GetListByJson(string queryJson) + { + var dp = new object(); + var queryParam = queryJson.ToJObject(); + var strSql = new StringBuilder(); + strSql.Append("select * from LR_OA_FileInfo where F_DeleteMark = 0 "); + if (!queryParam["year"].IsEmpty()) + { + dp = new { year = queryParam["year"].ToInt() }; + strSql.Append(" and DATEPART(yyyy,F_CreateDate) = @year "); + } + else + { + dp = new { year = DateTime.Now.Year }; + strSql.Append(" and DATEPART(yyyy,F_CreateDate) = @year "); + } + return this.BaseRepository().FindList(strSql.ToString(),dp); } /// From 8201103c191c096d7cf91c19548bec60eb411d3d Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 7 Mar 2022 17:43:33 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=95=99=E6=9D=90=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextBookOutController.cs | 2 +- .../Controllers/TextbookInOutController.cs | 37 +++++++ .../Views/TextBookIn/FormDelete.js | 1 - .../Views/TextBookOut/Form.js | 1 + .../Views/TextbookInOut/FormUse.cshtml | 51 ++++++++++ .../Views/TextbookInOut/FormUse.js | 97 +++++++++++++++++++ .../Views/TextbookInOut/IndexInOut.cshtml | 30 ++++++ .../Views/TextbookInOut/IndexInOut.js | 92 ++++++++++++++++++ .../Learun.Application.Web.csproj | 4 + .../TextbookInOut/TextbookInOutBLL.cs | 24 ++++- .../TextbookInOut/TextbookInOutEntity.cs | 7 +- .../TextbookInOut/TextbookInOutIBLL.cs | 6 ++ .../TextbookInOut/TextbookInOutService.cs | 55 ++++++++++- 13 files changed, 402 insertions(+), 5 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs index def172da9..b97f9e4b9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs @@ -46,7 +46,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormOut() { - ViewBag.BookCode = "RK" + DateTime.Now.ToString("yyyyMMddHHmmss"); + ViewBag.BookCode = "CK" + DateTime.Now.ToString("yyyyMMddHHmmss"); return View(); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs index 4909ea45e..06aa8120d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs @@ -38,6 +38,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers ViewBag.BookCode = "KC" + DateTime.Now.ToString("yyyyMMddHHmmss"); return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormUse() + { + return View(); + } + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult IndexInOut() + { + return View(); + } #endregion #region 获取数据 @@ -91,6 +109,25 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormUseData(string keyValue) + { + var TextBookInOutData = textbookInOutIBLL.GetEntity(keyValue); + var TextBookInOutDetailData = textbookInOutIBLL.GetInOrOutEntity(TextBookInOutData.BookCode); + var jsonData = new + { + TextBookInOut = TextBookInOutData, + TextBookInOrOut = TextBookInOutDetailData, + }; + return Success(jsonData); + } #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js index 68bb22f01..d6a277dca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js @@ -51,7 +51,6 @@ var bootstrap = function ($, learun) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/DeleteForm', { keyValue: NewkeyValue }, function () { refreshGirdData(); - learun.layerClose(window.name); }); } }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js index af6dc2ae5..786bf7c40 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js @@ -50,6 +50,7 @@ var bootstrap = function ($, learun) { } }); $('#TextBookOut').jfGridSet('refreshdata', tempdatra); + learun.layerClose(window.name); top.layer.close(index); } }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml new file mode 100644 index 000000000..556f5ccbe --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
库存单
+ +
+
+
课程
+
+
+
+
所选书籍
+ +
+
+
出版号
+ +
+
+
作者
+ +
+
+
其他作者
+ +
+
+
出版社
+ +
+
+
版次
+ +
+
+
当前库存
+ +
+
+
备注
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/FormUse.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js new file mode 100644 index 000000000..f9d146cb1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js @@ -0,0 +1,97 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-03-02 10:37 + * 描 述:教材库存表 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var selectedRow; +var refreshGirdData; +var tempdatra = new Array(); + +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#TextBookInOrOut').jfGrid({ + headData: [ + { label: '出/入库', name: 'CKORRK', width: 180, align: 'left' }, + { label: '库存单', name: 'InorOut', width: 180, align: 'left' }, + { label: '出库单', name: 'BookCode', width: 180, align: 'left' }, + { label: '出/入库数量', name: 'variate', width: 100, align: 'left' }, + { label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, + { label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, + { label: '备注', name: 'Remark', width: 100, align: 'left' }, + ], + height: 400, + mainId: 'CreateTime desc', + reloadSelected: false, + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetFormUseData?keyValue=' + keyValue, function (data) { + console.log(data,123123) + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + tempdatra = data[id]; + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + refreshGirdData = function (temprow) { + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].ID === temprow.ID) { + tempdatra[key] = temprow; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + + $('#TextBookInOrOut').jfGridSet('refreshdata', tempdatra); + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'TextBookInOrOut' && data[id]) { + keyValue = data[id].ID; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml new file mode 100644 index 000000000..319b8018f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml @@ -0,0 +1,30 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/IndexInOut.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js new file mode 100644 index 000000000..5675d2c7d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js @@ -0,0 +1,92 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-03-02 10:37 + * 描 述:教材库存表 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/FormUse?keyValue=' + keyValue, + width: 1000, + height: 700, + btn: null, + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', + headData: [ + { label: '库存单号', name: 'BookCode', width: 200, align: "left" }, + { + label: "课程", name: "LessonNo", width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + key: value, + keyId: 'lessonno', + callback: function (_data) { + callback(_data['lessonname']); + } + }); + } + }, + { label: '教材名称', name: 'TextBookName', width: 200, align: "left" }, + { label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, + { label: '出版号', name: 'PublishNo', width: 200, align: "left" }, + { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, + { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, + //{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" }, + { label: '出版社', name: 'Publisher', width: 200, align: "left" }, + { label: '版次', name: 'Edition', width: 200, align: "left" }, + { label: '印次', name: 'Impression', width: 200, align: "left" }, + { label: '创建人', name: 'CreateTime', width: 200, align: "left" }, + { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, + { label: '修改人', name: 'UpTime', width: 200, align: "left" }, + { label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, + { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, + { label: '备注', name: 'Remark', width: 200, align: "left" }, + + ], + mainId: 'ID', + isPage: true, + sidx: 'CreateTime desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.SqlParameter = 'and IsDel = 0 '; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + 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 6713a49cf..0a4e53fd2 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 @@ -1179,6 +1179,8 @@ + + @@ -7628,6 +7630,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs index 6549fa0d3..1569dea65 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs @@ -114,7 +114,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 获取KC实体数据 + /// + /// 主键 + /// + public IEnumerable GetInOrOutEntity(string keyValue) + { + try + { + return textbookInOutService.GetInOrOutEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs index 8374b2990..645228264 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs @@ -146,7 +146,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("ISSUBMIT")] public int? IsSubmit { get; set; } - + + /// + /// 出库货入库 + /// + [NotMapped] + public string CKORRK { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs index 270cb4693..41509ec3b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs @@ -40,6 +40,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// TextbookInOutEntity GetKCEntity(string keyValue); + /// + /// 使用明细 + /// + /// + /// + IEnumerable GetInOrOutEntity(string keyValue); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs index 82c4f37a2..320211875 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -125,7 +126,59 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 获取实体数据 + /// + /// 主键 + /// + public IEnumerable GetInOrOutEntity(string keyValue) + { + try + { + List returnList = new List(); + TextbookInOutEntity InOutList = new TextbookInOutEntity(); + List InEntity = this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == keyValue).ToList(); + List OutEntity = this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == keyValue).ToList(); + if (InEntity.Count() > 0 || OutEntity.Count() > 0) + { + for (int i = 0; i < InEntity.Count(); i++) + { + InOutList.CKORRK = "入库"; + InOutList.InorOut = InEntity[i].InOutCode; + InOutList.BookCode = InEntity[i].BookCode; + InOutList.variate = InEntity[i].variate; + InOutList.CreateTime = InEntity[i].CreateTime; + InOutList.CrateUserID = InEntity[i].CrateUserID; + InOutList.Remark = InEntity[i].Remark; + returnList.Add(InOutList); + } + for (int j = 0; j < OutEntity.Count(); j++) + { + InOutList.CKORRK = "出库"; + InOutList.InorOut = OutEntity[j].InOutCode; + InOutList.BookCode = OutEntity[j].BookCode; + InOutList.variate = OutEntity[j].Variate; + InOutList.CreateTime = InEntity[j].CreateTime; + InOutList.CrateUserID = InEntity[j].CrateUserID; + InOutList.Remark = OutEntity[j].Remark; + returnList.Add(InOutList); + } + returnList.OrderBy(x => x.CreateTime); + } + return returnList; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 From ef21f9e6933609f77adf44bcd7566afd66711050 Mon Sep 17 00:00:00 2001 From: ndbs Date: Mon, 7 Mar 2022 19:03:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=95=99=E6=9D=90=E5=87=BA=E5=BA=93=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=9C=AA=E5=85=B3=E9=97=AD=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=20=E6=95=99=E6=9D=90=E5=85=A5=E5=BA=93=20=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=9C=AA=E5=85=B3=E9=97=AD=E7=AA=97=E5=8F=A3=20=E6=95=99?= =?UTF-8?q?=E6=9D=90=E4=BD=BF=E7=94=A8=E6=98=8E=E7=BB=86=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextbookInOutController.cs | 4 ++-- .../Views/TextBookIn/FormDelete.js | 4 +++- .../Views/TextBookOut/FormDelete.js | 7 ++++--- .../TextbookInOut/TextbookInOutService.cs | 5 +++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs index 06aa8120d..6508f556d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs @@ -2,6 +2,7 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; using Learun.Util; using System.Data; +using System.Linq; using System.Web.Mvc; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers @@ -120,7 +121,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetFormUseData(string keyValue) { var TextBookInOutData = textbookInOutIBLL.GetEntity(keyValue); - var TextBookInOutDetailData = textbookInOutIBLL.GetInOrOutEntity(TextBookInOutData.BookCode); + var TextBookInOutDetailData = textbookInOutIBLL.GetInOrOutEntity(TextBookInOutData.BookCode).OrderBy(x => x.CreateTime); var jsonData = new { TextBookInOut = TextBookInOutData, @@ -161,7 +162,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { entity.IsDel = 0; entity.IsSubmit = 0; - entity.FinallyNum = 0; entity.CreateTime = DateTime.Now; entity.CrateUserID = loginUserInfo.userId; } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js index d6a277dca..d76f03857 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js @@ -50,7 +50,9 @@ var bootstrap = function ($, learun) { learun.layerConfirm('是否确认删除该项!', function (res, index) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/DeleteForm', { keyValue: NewkeyValue }, function () { - refreshGirdData(); + var index = top.layer.getFrameIndex(window.name); + console.log('index', index); + top.layer.close(index); }); } }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/FormDelete.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/FormDelete.js index 3da830d6a..00b88cb23 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/FormDelete.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/FormDelete.js @@ -101,8 +101,9 @@ var bootstrap = function ($, learun) { learun.layerConfirm('是否确认删除该项!', function (res, index) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/DeleteForm', { keyValue: NewkeyValue }, function () { - refreshGirdData(); - learun.layerClose(window.name); + var index = top.layer.getFrameIndex(window.name); + console.log('index', index); + top.layer.close(index); }); } }); @@ -112,7 +113,7 @@ var bootstrap = function ($, learun) { initData: function () { if (!!keyValue) { $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?keyValue=' + keyValue, function (data) { - for(var id in data) { + for (var id in data) { if (!!data[id].length && data[id].length > 0) { $('#' + id).jfGridSet('refreshdata', data[id]); } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs index 320211875..5be074838 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs @@ -136,13 +136,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration try { List returnList = new List(); - TextbookInOutEntity InOutList = new TextbookInOutEntity(); + //TextbookInOutEntity InOutList = new TextbookInOutEntity(); List InEntity = this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == keyValue).ToList(); List OutEntity = this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == keyValue).ToList(); if (InEntity.Count() > 0 || OutEntity.Count() > 0) { for (int i = 0; i < InEntity.Count(); i++) { + TextbookInOutEntity InOutList = new TextbookInOutEntity(); InOutList.CKORRK = "入库"; InOutList.InorOut = InEntity[i].InOutCode; InOutList.BookCode = InEntity[i].BookCode; @@ -154,6 +155,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } for (int j = 0; j < OutEntity.Count(); j++) { + TextbookInOutEntity InOutList = new TextbookInOutEntity(); InOutList.CKORRK = "出库"; InOutList.InorOut = OutEntity[j].InOutCode; InOutList.BookCode = OutEntity[j].BookCode; @@ -163,7 +165,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration InOutList.Remark = OutEntity[j].Remark; returnList.Add(InOutList); } - returnList.OrderBy(x => x.CreateTime); } return returnList; }