diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs index b2b6952e4..f613d8304 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs @@ -93,9 +93,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetFormData(string keyValue) { var TextBookIndentData = textBookIndentIBLL.GetTextBookIndentEntity(keyValue); + var TextBookIndentDetailData = textBookIndentIBLL.TextBookIndentDetailList(TextBookIndentData.ID); + var jsonData = new { TextBookIndent = TextBookIndentData, + TextBookIndentDetail = TextBookIndentDetailData, }; return Success(jsonData); } @@ -139,16 +142,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// [HttpPost] [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity,string strTextBookIndentDetailList) { TextBookIndentEntity entity = strEntity.ToObject(); - textBookIndentIBLL.SaveEntity(keyValue, entity); - if (string.IsNullOrEmpty(keyValue)) - { - } + List textBookIndentDetail = strTextBookIndentDetailList.ToObject>(); + textBookIndentIBLL.SaveEntity(keyValue, entity, textBookIndentDetail); + return Success("保存成功!"); } + #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentDetailController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentDetailController.cs new file mode 100644 index 000000000..82fb916cb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentDetailController.cs @@ -0,0 +1,120 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using System.Data; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-02-27 09:35 + /// 描 述:TextBookIndentDetail + /// + public class TextBookIndentDetailController : MvcControllerBase + { + private TextBookIndentDetailIBLL textBookIndentDetailIBLL = new TextBookIndentDetailBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormDetail() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList( string queryJson ) + { + var data = textBookIndentDetailIBLL.GetList(queryJson); + return Success(data); + } + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = textBookIndentDetailIBLL.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 data = textBookIndentDetailIBLL.GetEntity(keyValue); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + textBookIndentDetailIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue,TextBookIndentDetailEntity entity) + { + textBookIndentDetailIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml index f71eec145..87e893354 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml @@ -2,7 +2,9 @@ ViewBag.Title = "教材订单管理"; Layout = "~/Views/Shared/_Form.cshtml"; } -
+@Html.AppendCssFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.css") +@Html.AppendJsFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.js") +
专业部*
@@ -39,15 +41,6 @@
其他作者
- @*
-
明细操作
- - - -
-
-
-
*@
备注
@@ -64,5 +57,14 @@
状态
+
+
明细操作
+ + + +
+
+
+
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js index 76854845e..51171d966 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js @@ -14,77 +14,66 @@ var setFormData; var validForm; // 保存数据 var save; +var selectedRow; +var refreshGirdData; +var tempdatra = new Array(); +var pricecount = 0; + var bootstrap = function ($, learun) { "use strict"; // 设置权限 setAuthorize = function (data) { - if (!!data) { - for (var field in data) { - if (data[field].isLook != 1) {// 如果没有查看权限就直接移除 - $('#' + data[field].fieldId).parent().remove(); - } - else { - if (data[field].isEdit != 1) { - $('#' + data[field].fieldId).attr('disabled', 'disabled'); - if ($('#' + data[field].fieldId).hasClass('lrUploader-wrap')) { - $('#' + data[field].fieldId).css({ 'padding-right': '58px' }); - $('#' + data[field].fieldId).find('.btn-success').remove(); - } - } - } - } - } }; var page = { init: function () { $('.lr-form-wrap').lrscroll(); - //$("#detailadd").on('click', function () { - // selectedRow = null; - // learun.layerForm({ - // id: 'formitem', - // title: '新增明细', - // url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC', - // width: 860, - // height: 600, - // callBack: function (id) { - // return top[id].acceptClick(refreshGirdData); - // } - // }); - //}); - //$("#detailedit").on('click', function () { - // var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); - // selectedRow = $('#TextBookIndentDetail').jfGridGet('rowdata'); - // if (learun.checkrow(keyValue)) { - // learun.layerForm({ - // id: 'formitem', - // title: '编辑明细', - // url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC?keyValue=' + keyValue, - // width: 860, - // height: 600, - // callBack: function (id) { - // return top[id].acceptClick(refreshGirdData); - // } - // }); - // } - //}); - //$("#detaildel").on('click', function () { - // var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); - // if (learun.checkrow(keyValue)) { - // learun.layerConfirm('是否确认删除该项!', function (res, index) { - // if (res) { - // $.each(tempdatra, function (key, val) { - // if (tempdatra[key].AAIId === keyValue) { - // pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock; - // tempdatra.splice(key, 1); - // } - // }); - // $("#AAPrice").val(pricecount); - // $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); - // top.layer.close(index); - // } - // }); - // } - //}); + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formTextBookIndentDetail', + title: '新增明细', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail', + width: 600, + height: 350, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detailedit").on('click', function () { + var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); + selectedRow = $('#TextBookIndentDetail').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formTextBookIndentDetail', + title: '编辑明细', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail?keyValue=' + keyValue, + width: 600, + height: 350, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + $("#detaildel").on('click', function () { + var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + $.each(tempdatra, function (key, val) { + if (tempdatra[key].ID === keyValue) { + pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock; + tempdatra.splice(key, 1); + } + }); + $("#AAPrice").val(pricecount); + $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + top.layer.close(index); + } + }); + } + }); page.bind(); page.initData(); }, @@ -107,6 +96,29 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + $('#TextBookIndentDetail').jfGrid({ + headData: [ + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: '教师人数', name: 'TeachSum', width: 80, align: 'left' }, + { label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, + { label: '备注', name: 'Remark', width: 100, align: 'left' }, + ], + height: 400, + mainId: 'ID,IndentID', + reloadSelected: false, + }); $('#TextBookName').lrGirdSelect({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', param: { strWhere: " IsDel = '0' and IsValid ='true' " }, @@ -151,7 +163,6 @@ var bootstrap = function ($, learun) { { label: "印次", name: "impression", width: 100, align: "left" }, ], select: function (item) { - console.log(item, 123123); ////赋值 $("#PublishNo").val(item.publishno); $("#FirstAuthor").val(item.firstauthor); @@ -170,15 +181,41 @@ var bootstrap = function ($, learun) { 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]); + if (data[id].AAPrice) { + pricecount = data[id].AAPrice; + } } } }); + } + } + }; + 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); } + //总价计算 + pricecount = 0; + //for (var i = 0; i < tempdatra.length; i++) { + // pricecount += tempdatra[i].AAIPrice * tempdatra[i].AAIStock; + //} + //$("#AAPrice").val(pricecount); + $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); }; + function sortNumber(a, b) { + return a.AAIOrder - b.AAIOrder; + } // 设置表单数据 setFormData = function (processId, param, callback) { if (!!processId) { @@ -196,28 +233,32 @@ var bootstrap = function ($, learun) { } }); } - callback && callback(); } // 验证数据是否填写完整 validForm = function () { - if (!$('body').lrValidform()) { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + var datas = $('#TextBookIndentDetail').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("申请未包含明细!请先新增明细!"); return false; } return true; }; // 保存数据 save = function (processId, callBack, i) { - var formData = $('body').lrGetFormData(); + var postData = {}; + var formData = $('[data-table="TextBookIndent"]').lrGetFormData(); if (!!processId) { formData.processId = processId; } - var postData = { - strEntity: JSON.stringify(formData) - }; + postData.strEntity = JSON.stringify(formData); + postData.strTextBookIndentDetailList = JSON.stringify($('#TextBookIndentDetail').jfGridGet('rowdatas')); $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { - callBack(res, i); + callBack(res, formData, i); } }); }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.cshtml new file mode 100644 index 000000000..38680c397 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.cshtml @@ -0,0 +1,23 @@ +@{ + ViewBag.Title = "TextBookIndentDetail"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
班级*
+
+
+
+
教师人数*
+ +
+
+
学生人数*
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.js new file mode 100644 index 000000000..2894efe82 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormDetail.js @@ -0,0 +1,105 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-02-27 09:35 + * 描 述:TextBookIndentDetail + */ +var acceptClick; +var keyValue = request('keyValue'); +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + selectedRow = top["layer_formTextBookIndent"].selectedRow; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); + //$("#ID").lrlayerselect({ + // dataUrl: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetList', + // dataTreeId: 'ID', + // dataValueId: 'ID', + // dataTextId: 'ID', + // grid: [ + // { + // label: "班级", name: "ClassNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + // key: value, + // keyId: 'classno', + // callback: function (_data) { + // callback(_data['classname']); + // } + // }); + // } + // }, + // { label: '教师人数', name: 'TeachSum', width: 80, align: 'left' }, + // { label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, + // { label: '备注', name: 'Remark', width: 100, align: 'left' }, + // ], + // select: function (values, texts) { + // if (values && values.length > 0) { + // //绑定 + // //$("#AAITId").attr("readonly", "readonly"); + // //$("#AAICode").attr("readonly", "readonly"); + // //$("#AAIName").attr("readonly", "readonly"); + // //$("#AAIUnit").attr("readonly", "readonly"); + // //$("#AAIHasDetail").attr("readonly", "readonly"); + // $.lrSetForm(top.$.rootUrl + '/TextBookIndentDetail/TextBookIndent/GetFormData?keyValue=' + values[0], function (data) { + // console.log("data" + data.extBookIndentDetailList); + // data = data.extBookIndentDetailList; + // console.log("data" + data) + // $('#ID').lrselectSet(data.IndentId); + // $('#ClassNo').val(data.ClassNo); + // $('#TeachSum').val(data.TeachSum); + // $('#StuSum').lrselectSet(data.StuSum); + // //$('#AAIHasDetail').lrselectSet(data.HasDetail); + // //$('#AAIEName').val(data.AEName); + // //$('#AAIModel').val(data.AModel); + // //$('#AAIManufacturer').val(data.AManufacturer); + // //$('#AAISpecification').val(data.ASpecification); + // }); + // } + // }, + // unknowselect: function () { + // $('#ID').lrselectSet(""); + // $('#ClassNo').val(""); + // $('#TeachSum').val(""); + // $('#StuSum').lrselectSet(""); + // }, + // isMultiple: false + //}); + }, + initData: function () { + if (!!keyValue) { + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + //$("#ID").find('span').text(selectedRow.IndentId); + } + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = $('body').lrGetFormData(); + if (!!keyValue) { + if (!!selectedRow) { + postData.ID = selectedRow.ID; + } + } else { + postData.ID = learun.newGuid(); + } + if (!!callBack) { + callBack(postData); + return true; + } + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.cshtml index 23a306893..2a967a2d4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.cshtml @@ -26,7 +26,7 @@
所选书籍*
- @*
*@ + @*
*@
书籍
@@ -40,15 +40,9 @@
其他作者
- @*
-
明细操作
- - - -
-
-
-
*@ +
+
+
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.js index 5106d7a54..d9908c5e5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormView.js @@ -38,53 +38,6 @@ var bootstrap = function ($, learun) { var page = { init: function () { $('.lr-form-wrap').lrscroll(); - //$("#detailadd").on('click', function () { - // selectedRow = null; - // learun.layerForm({ - // id: 'formitem', - // title: '新增明细', - // url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC', - // width: 860, - // height: 600, - // callBack: function (id) { - // return top[id].acceptClick(refreshGirdData); - // } - // }); - //}); - //$("#detailedit").on('click', function () { - // var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); - // selectedRow = $('#TextBookIndentDetail').jfGridGet('rowdata'); - // if (learun.checkrow(keyValue)) { - // learun.layerForm({ - // id: 'formitem', - // title: '编辑明细', - // url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItemApply/FormJYHC?keyValue=' + keyValue, - // width: 860, - // height: 600, - // callBack: function (id) { - // return top[id].acceptClick(refreshGirdData); - // } - // }); - // } - //}); - //$("#detaildel").on('click', function () { - // var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); - // if (learun.checkrow(keyValue)) { - // learun.layerConfirm('是否确认删除该项!', function (res, index) { - // if (res) { - // $.each(tempdatra, function (key, val) { - // if (tempdatra[key].AAIId === keyValue) { - // pricecount -= tempdatra[key].AAIPrice * tempdatra[key].AAIStock; - // tempdatra.splice(key, 1); - // } - // }); - // $("#AAPrice").val(pricecount); - // $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); - // top.layer.close(index); - // } - // }); - // } - //}); page.bind(); page.initData(); }, @@ -107,10 +60,29 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - $('#Status').val(0); - $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); - $('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; - $('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); + $('#TextBookIndentDetail').jfGrid({ + headData: [ + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: '教师人数', name: 'TeachSum', width: 80, align: 'left' }, + { label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, + { label: '备注', name: 'Remark', width: 100, align: 'left' }, + ], + height: 400, + mainId: 'ID,IndentID', + reloadSelected: false, + }); }, initData: function () { if (!!keyValue) { @@ -155,19 +127,14 @@ var bootstrap = function ($, learun) { }; // 保存数据 save = function (processId, callBack, i) { - var formData = $('body').lrGetFormData(); + var formData = {}; + var res = {}; + res.code = 200; if (!!processId) { - formData.processId = processId; + formData.AAProcessId = processId; } - var postData = { - strEntity: JSON.stringify(formData) - }; - $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/SaveForm?keyValue=' + keyValue, postData, function (res) { - // 保存成功后才回调 - if (!!callBack) { - callBack(res, i); - } - }); + callBack(res, i); }; + page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js index c7929d9d2..e88998eed 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js @@ -49,6 +49,7 @@ var bootstrap = function ($, learun) { $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, @@ -71,19 +72,22 @@ var bootstrap = function ($, learun) { // 新增 $('#lr_add').on('click', function () { learun.layerForm({ - id: 'form', + id: 'formTextBookIndent', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/Form', width: 800, - height: 800, + height: 600, callBack: function (id) { var res = false; // 验证数据 res = top[id].validForm(); // 保存数据 if (res) { - processId = learun.newGuid(); - res = top[id].save(processId, refreshGirdData); + //processId = learun.newGuid(); + //res = top[id].save(processId, refreshGirdData); + res = top[id].save('', function () { + page.search(); + }); } return res; } @@ -99,11 +103,11 @@ var bootstrap = function ($, learun) { return; } learun.layerForm({ - id: 'form', + id: 'formTextBookIndent', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/Form?keyValue=' + keyValue, width: 800, - height: 800, + height: 600, callBack: function (id) { var res = false; // 验证数据 @@ -173,6 +177,7 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetPageList', headData: [ + { label: "主键", name: "ID", width: 200, align: "left" }, { label: "专业部", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -257,17 +262,6 @@ var bootstrap = function ($, learun) { } }; refreshGirdData = function () { - //if (!!res) { - // if (res.code == 200) { - //// 发起流程 - //var postData = { - // schemeCode: 'TextBookIndent',// 填写流程对应模板编号 - // 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/EducationalAdministration/Views/TextBookIndentDetail/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.cshtml new file mode 100644 index 000000000..2092c53b4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.cshtml @@ -0,0 +1,39 @@ +@{ + ViewBag.Title = "TextBookIndentDetail"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
树形目录
+
+
+
+
+
+
标题
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.js new file mode 100644 index 000000000..29366d7d8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndentDetail/Index.js @@ -0,0 +1,105 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-02-27 09:35 + * 描 述:TextBookIndentDetail + */ +var selectedRow; +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 }); + }); + $('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/Form', + width: 700, + height: 400, + 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)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/Form?keyValue=' + keyValue, + width: 700, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/DeleteForm', { keyValue: keyValue}, function () { + }); + } + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndentDetail/GetPageList', + headData: [ + { label: 'ID', name: 'ID', width: 200, align: "left" }, + { label: 'IndentId', name: 'IndentId', width: 200, align: "left" }, + { label: 'DeptNo', name: 'DeptNo', width: 200, align: "left" }, + { label: 'MajorNo', name: 'MajorNo', width: 200, align: "left" }, + { label: 'ClassNo', name: 'ClassNo', width: 200, align: "left" }, + { label: 'TeachSum', name: 'TeachSum', width: 200, align: "left" }, + { label: 'StuSum', name: 'StuSum', width: 200, align: "left" }, + { label: 'Price', name: 'Price', width: 200, align: "left" }, + { label: 'BookNo', name: 'BookNo', width: 200, align: "left" }, + { label: 'BooName', name: 'BooName', width: 200, align: "left" }, + { label: '出版号', name: 'PublishNo', width: 200, align: "left" }, + { label: 'Remark', name: 'Remark', width: 200, align: "left" }, + { label: 'CreateTime', name: 'CreateTime', width: 200, align: "left" }, + { label: 'CreateUserID', name: 'CreateUserID', width: 200, align: "left" }, + { label: 'LessonNo', name: 'LessonNo', width: 200, align: "left" }, + ], + mainId:'ID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#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 1acab8b68..37fb8cf71 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 @@ -838,6 +838,7 @@ + @@ -1170,6 +1171,7 @@ + @@ -6648,6 +6650,8 @@ + + @@ -7565,7 +7569,6 @@ - @@ -7584,6 +7587,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextBookIndentDetailMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextBookIndentDetailMap.cs new file mode 100644 index 000000000..d98ad9279 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextBookIndentDetailMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-02-27 09:35 + /// 描 述:TextBookIndentDetail + /// + public class TextBookIndentDetailMap : EntityTypeConfiguration + { + public TextBookIndentDetailMap() + { + #region 表、主键 + //表 + this.ToTable("TEXTBOOKINDENTDETAIL"); + //主键 + this.HasKey(t => t.ID); + #endregion + + #region 配置关系 + #endregion + } + } +} + 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 755146733..7b7db9753 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 @@ -592,6 +592,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentBLL.cs index 2bd3a9a6a..95798b354 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentBLL.cs @@ -91,6 +91,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取Ass_AssetsInfoItemApply表数据 + /// + /// + public IEnumerable TextBookIndentDetailList(string keyValue) + { + try + { + return textBookIndentService.TextBookIndentDetailList(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 @@ -123,11 +146,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// 主键 /// 实体 - public void SaveEntity(string keyValue, TextBookIndentEntity entity) + public void SaveEntity(string keyValue, TextBookIndentEntity entity,List textbookIndentDateil) { try { - textBookIndentService.SaveEntity(keyValue, entity); + textBookIndentService.SaveEntity(keyValue, entity, textbookIndentDateil); } catch (Exception ex) { @@ -141,7 +164,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - /// /// 修改审核状态 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentIBLL.cs index d2bb78acd..8fdcd2733 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentIBLL.cs @@ -34,6 +34,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 流程实例ID /// TextBookIndentEntity GetEntityByProcessId(string processId); + + IEnumerable TextBookIndentDetailList(string keyValue); + #endregion #region 提交数据 @@ -48,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// 主键 /// 实体 - void SaveEntity(string keyValue, TextBookIndentEntity entity); + void SaveEntity(string keyValue, TextBookIndentEntity entity, List textBookIndentDatail); /// /// 提交审核 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs index 0bc1ff80a..dbc6e4b1c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs @@ -5,6 +5,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Text; +using Learun.Application.TwoDevelopment.AssetManagementSystem; namespace Learun.Application.TwoDevelopment.EducationalAdministration { @@ -136,6 +137,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取Ass_AssetsInfoApply表实体数据 + /// 主键 + /// + /// + public IEnumerable TextBookIndentDetailList(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(t=>t.IndentId==keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 @@ -146,12 +170,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + db.Delete(t => t.IndentId == keyValue); + db.Delete(t => t.ID == keyValue); + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; @@ -161,6 +189,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration throw ExceptionEx.ThrowServiceException(ex); } } + } /// @@ -169,23 +198,39 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// 实体 /// - public void SaveEntity(string keyValue, TextBookIndentEntity entity) + public void SaveEntity(string keyValue, TextBookIndentEntity entity, List textbookIndentDateil) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { if (!string.IsNullOrEmpty(keyValue)) { entity.Modify(keyValue); - this.BaseRepository("CollegeMIS").Update(entity); + db.Update(entity); + db.Delete(t => t.IndentId == keyValue); + foreach (TextBookIndentDetailEntity item in textbookIndentDateil) + { + item.Create(); + item.IndentId = keyValue; + db.Insert(item); + } } else { entity.Create(); - this.BaseRepository("CollegeMIS").Insert(entity); + db.Insert(entity); + foreach (TextBookIndentDetailEntity item in textbookIndentDateil) + { + item.Create(); + item.IndentId = entity.ID; + db.Insert(item); + } } + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailBLL.cs new file mode 100644 index 000000000..25c9b564b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailBLL.cs @@ -0,0 +1,149 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-02-27 09:35 + /// 描 述:TextBookIndentDetail + /// + public class TextBookIndentDetailBLL : TextBookIndentDetailIBLL + { + private TextBookIndentDetailService textBookIndentDetailService = new TextBookIndentDetailService(); + private TextBookIndentService textBookIndentService = new TextBookIndentService(); + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + public IEnumerable GetList( string queryJson ) + { + try + { + return textBookIndentDetailService.GetList(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return textBookIndentDetailService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public TextBookIndentDetailEntity GetEntity(string keyValue) + { + try + { + return textBookIndentDetailService.GetEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + textBookIndentDetailService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, TextBookIndentDetailEntity entity) + { + try + { + textBookIndentDetailService.SaveEntity(keyValue, entity); + } + 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/TextBookIndentDetail/TextBookIndentDetailEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailEntity.cs new file mode 100644 index 000000000..b0b9226e9 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailEntity.cs @@ -0,0 +1,128 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; +namespace Learun.Application.TwoDevelopment.EducationalAdministration + +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-02-27 09:35 + /// 描 述:TextBookIndentDetail + /// + public class TextBookIndentDetailEntity + { + #region 实体成员 + /// + /// ID + /// + /// + [Column("ID")] + public string ID { get; set; } + /// + /// IndentId + /// + /// + [Column("INDENTID")] + public string IndentId { get; set; } + /// + /// DeptNo + /// + /// + [Column("DEPTNO")] + public string DeptNo { get; set; } + /// + /// MajorNo + /// + /// + [Column("MAJORNO")] + public string MajorNo { get; set; } + /// + /// ClassNo + /// + /// + [Column("CLASSNO")] + public string ClassNo { get; set; } + /// + /// TeachSum + /// + /// + [Column("TEACHSUM")] + public string TeachSum { get; set; } + /// + /// StuSum + /// + /// + [Column("STUSUM")] + public string StuSum { get; set; } + /// + /// Price + /// + /// + [Column("PRICE")] + public string Price { get; set; } + /// + /// BookNo + /// + /// + [Column("BOOKNO")] + public string BookNo { get; set; } + /// + /// BooName + /// + /// + [Column("BOONAME")] + public string BooName { get; set; } + /// + /// 出版号 + /// + /// + [Column("PUBLISHNO")] + public string PublishNo { get; set; } + /// + /// Remark + /// + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// CreateTime + /// + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// CreateUserID + /// + /// + [Column("CREATEUSERID")] + public string CreateUserID { get; set; } + /// + /// LessonNo + /// + /// + [Column("LESSONNO")] + public string LessonNo { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + 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/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailIBLL.cs new file mode 100644 index 000000000..93dbea96c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailIBLL.cs @@ -0,0 +1,56 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-02-27 09:35 + /// 描 述:TextBookIndentDetail + /// + public interface TextBookIndentDetailIBLL + { + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 查询参数 + /// + IEnumerable GetList( string queryJson ); + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取实体数据 + /// + /// 主键 + /// + TextBookIndentDetailEntity GetEntity(string keyValue); + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, TextBookIndentDetailEntity entity); + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailService.cs new file mode 100644 index 000000000..9512a32ce --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndentDetail/TextBookIndentDetailService.cs @@ -0,0 +1,199 @@ +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.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-02-27 09:35 + /// 描 述:TextBookIndentDetail + /// + public class TextBookIndentDetailService : RepositoryFactory + { + #region 构造函数和属性 + + private string fieldSql; + /// + /// 构造方法 + /// + public TextBookIndentDetailService() + { + fieldSql = @" + t.ID, + t.IndentId, + t.DeptNo, + t.MajorNo, + t.ClassNo, + t.TeachSum, + t.StuSum, + t.Price, + t.BookNo, + t.BooName, + t.PublishNo, + t.Remark, + t.CreateTime, + t.CreateUserID, + t.LessonNo + "; + } + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// 条件参数 + /// + public IEnumerable GetList(string queryJson) + { + try + { + //参考写法 + //var queryParam = queryJson.ToJObject(); + // 虚拟参数 + //var dp = new DynamicParameters(new { }); + //dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM TextBookIndentDetail t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取列表分页数据 + /// + /// 分页参数 + /// 条件参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(fieldSql); + strSql.Append(" FROM TextBookIndentDetail t "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取实体数据 + /// + /// 主键 + /// + public TextBookIndentDetailEntity GetEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, TextBookIndentDetailEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + 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/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index 20302eb1c..a5aca2d89 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 @@ -1798,6 +1798,10 @@ + + + +