-
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/IndexIn.js")
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookOut/Index.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexIn.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Index.js
similarity index 52%
rename from Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexIn.js
rename to Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Index.js
index be51f319e..515e23674 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexIn.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Index.js
@@ -1,70 +1,114 @@
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn)
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
* 创建人:超级管理员
- * 日 期:2022-03-02 10:37
- * 描 述:教材库存表
+ * 日 期:2022-03-05 11:17
+ * 描 述:TextBookOut
*/
var refreshGirdData;
var bootstrap = function ($, learun) {
"use strict";
+ var startTime;
+ var endTime;
var page = {
init: function () {
page.initGird();
page.bind();
},
bind: function () {
- // 查询
- $('#btn_Search').on('click', function () {
- var keyword = $('#txt_Keyword').val();
- page.search({ keyword: keyword });
+ // 时间搜索框
+ $('#datesearch').lrdate({
+ dfdata: [
+ { name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
+ { name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
+ { name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
+ { name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }
+ ],
+ // 月
+ mShow: false,
+ premShow: false,
+ // 季度
+ jShow: false,
+ prejShow: false,
+ // 年
+ ysShow: false,
+ yxShow: false,
+ preyShow: false,
+ yShow: false,
+ // 默认
+ dfvalue: '1',
+ selectfn: function (begin, end) {
+ startTime = begin;
+ endTime = end;
+ page.search();
+ }
});
- $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
+ $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
+ page.search(queryJson);
+ }, 100, 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' });
+ $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo',value: 'lessonno',text: 'lessonname' });
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
});
- // 新增
- $('#lr_add').on('click', function () {
- learun.layerForm({
- id: 'form',
- title: '新增',
- url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form',
- width: 700,
- height: 500,
- callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
- }
- });
- });
- // 编辑
+ // 出库
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('ID');
if (learun.checkrow(keyValue)) {
learun.layerForm({
id: 'form',
- title: '编辑',
- url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/Form?keyValue=' + keyValue,
- width: 700,
- height: 500,
+ title: '出库',
+ url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/Form?keyValue=' + keyValue,
+ width: 1000,
+ height: 800,
callBack: function (id) {
- return top[id].acceptClick(refreshGirdData);
+ var res = false;
+ // 验证数据
+ res = top[id].validForm();
+ // 保存数据
+ if (res) {
+ res = top[id].save('', function () {
+ page.search();
+ });
+ }
+ return res;
}
});
}
});
+
+ // 查看
+ $('#lr_view').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('ID');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'formview',
+ title: '查看',
+ url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormView?keyValue=' + keyValue,
+ width: 1000,
+ height: 700,
+ btn: null,
+ });
+ }
+ });
// 删除
$('#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/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () {
- });
- }
+ learun.layerForm({
+ id: 'formdelete',
+ title: '删除明细',
+ url: top.$.rootUrl + '/EducationalAdministration/TextBookOut/FormDelete?keyValue=' + keyValue,
+ width: 1000,
+ height: 700,
+ btn: null,
});
}
});
},
+ // 初始化列表
initGird: function () {
$('#gridtable').lrAuthorizeJfGrid({
url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList',
@@ -88,7 +132,6 @@ var bootstrap = function ($, learun) {
{ 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" },
@@ -98,7 +141,6 @@ var bootstrap = function ($, learun) {
{ 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,
@@ -108,6 +150,7 @@ var bootstrap = function ($, learun) {
},
search: function (param) {
param = param || {};
+ param.SqlParameter = ' and IsSubmit =1 ';
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
}
};
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 4cd870a24..6713a49cf 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
@@ -843,6 +843,7 @@
+
@@ -1183,6 +1184,9 @@
+
+
+
@@ -6676,6 +6680,10 @@
+
+
+
+
@@ -7617,6 +7625,9 @@
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextBookOutMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextBookOutMap.cs
new file mode 100644
index 000000000..d6cab035f
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/TextBookOutMap.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-03-05 11:17
+ /// 描 述:TextBookOut
+ ///
+ public class TextBookOutMap : EntityTypeConfiguration
+ {
+ public TextBookOutMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("TEXTBOOKOUT");
+ //主键
+ 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 3fa4c19f8..d61d39bcf 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
@@ -597,6 +597,7 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInIBLL.cs
index 75f63c668..1566bd591 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInIBLL.cs
@@ -54,8 +54,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
///
- ///
- void SaveEntity(string keyValue, TextbookInOutEntity entity, List textBookIndentDatail);
+ ///
+ void SaveEntity(string keyValue, TextbookInOutEntity entity, List textBookIn);
#endregion
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs
index 314c0eaf3..5be7cff4e 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIn/TextBookInService.cs
@@ -225,7 +225,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
textbookInList[i].Impression = entity.Impression;
variate += textbookInList[i].variate;
}
- entity.Create();
this.BaseRepository("CollegeMIS").Insert(textbookInList);
if (variate != 0 && variate > 0)
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs
new file mode 100644
index 000000000..c94c8eeaa
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutBLL.cs
@@ -0,0 +1,150 @@
+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-03-05 11:17
+ /// 描 述:TextBookOut
+ ///
+ public class TextBookOutBLL : TextBookOutIBLL
+ {
+ private TextBookOutService textBookOutService = new TextBookOutService();
+
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 分页参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return textBookOutService.GetPageList(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取TextBookOut表实体数据
+ ///
+ /// 主键
+ ///
+ public TextBookOutEntity GetTextBookOutEntity(string keyValue)
+ {
+ try
+ {
+ return textBookOutService.GetTextBookOutEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ try
+ {
+ textBookOutService.DeleteEntity(keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, TextBookOutEntity entity)
+ {
+ try
+ {
+ textBookOutService.SaveEntity(keyValue, entity);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ ///
+ public void SaveEntity(string keyValue, TextbookInOutEntity entity, List textBookOutList)
+ {
+ try
+ {
+ textBookOutService.SaveEntity(keyValue, entity, textBookOutList);
+ }
+ 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/TextBookOut/TextBookOutEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutEntity.cs
new file mode 100644
index 000000000..f9010bfe0
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutEntity.cs
@@ -0,0 +1,160 @@
+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-03-05 11:17
+ /// 描 述:TextBookOut
+ ///
+ public class TextBookOutEntity
+ {
+ #region 实体成员
+ ///
+ /// ID
+ ///
+ [Column("ID")]
+ public string ID { get; set; }
+ ///
+ /// InOutCode
+ ///
+ [Column("INOUTCODE")]
+ public string InOutCode { get; set; }
+ ///
+ /// BookCode
+ ///
+ [Column("BOOKCODE")]
+ public string BookCode { get; set; }
+ ///
+ /// AcademicYearNo
+ ///
+ [Column("ACADEMICYEARNO")]
+ public string AcademicYearNo { get; set; }
+ ///
+ /// Semester
+ ///
+ [Column("SEMESTER")]
+ public string Semester { 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; }
+ ///
+ /// 课程
+ ///
+ [Column("LESSONNO")]
+ public string LessonNo { get; set; }
+ ///
+ /// PublishNo
+ ///
+ [Column("PUBLISHNO")]
+ public string PublishNo { get; set; }
+ ///
+ /// 教材号
+ ///
+ [Column("TEXTBOOKNO")]
+ public string TextBookNo { get; set; }
+ ///
+ /// 教材名称
+ ///
+ [Column("TEXTBOOKNAME")]
+ public string TextBookName { get; set; }
+ ///
+ /// 第一作者
+ ///
+ [Column("FIRSTAUTHOR")]
+ public string FirstAuthor { get; set; }
+ ///
+ /// 其他作者
+ ///
+ [Column("OTHERAUTHOR")]
+ public string OtherAuthor { get; set; }
+ ///
+ /// 出版社
+ ///
+ [Column("PUBLISHER")]
+ public string Publisher { get; set; }
+ ///
+ /// 版次
+ ///
+ [Column("EDITION")]
+ public string Edition { get; set; }
+ ///
+ /// 印次
+ ///
+ [Column("IMPRESSION")]
+ public string Impression { get; set; }
+ ///
+ /// 创建人
+ ///
+ [Column("CREATETIME")]
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 创建版次
+ ///
+ [Column("CRATEUSERID")]
+ public string CrateUserID { get; set; }
+ ///
+ /// UpTime
+ ///
+ [Column("UPTIME")]
+ public DateTime? UpTime { get; set; }
+ ///
+ /// UpUserID
+ ///
+ [Column("UPUSERID")]
+ public string UpUserID { get; set; }
+ ///
+ /// Variate
+ ///
+ [Column("VARIATE")]
+ public decimal? Variate { get; set; }
+ ///
+ /// Recipient
+ ///
+ [Column("RECIPIENT")]
+ public string Recipient { get; set; }
+
+ ///
+ /// 备注
+ ///
+ [Column("REMARK")]
+ public string Remark { get; set; }
+ #endregion
+
+ #region 扩展操作
+ ///
+ /// 新增调用
+ ///
+ public void Create()
+ {
+ }
+ ///
+ /// 编辑调用
+ ///
+ ///
+ public void Modify(string keyValue)
+ {
+ this.ID = keyValue;
+ }
+ #endregion
+ #region 扩展字段
+ #endregion
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.cs
new file mode 100644
index 000000000..7caddad02
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutIBLL.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-03-05 11:17
+ /// 描 述:TextBookOut
+ ///
+ public interface TextBookOutIBLL
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageList(Pagination pagination, string queryJson);
+ ///
+ /// 获取TextBookOut表实体数据
+ ///
+ /// 主键
+ ///
+ TextBookOutEntity GetTextBookOutEntity(string keyValue);
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ void DeleteEntity(string keyValue);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ void SaveEntity(string keyValue, TextBookOutEntity entity);
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ ///
+ ///
+ ///
+ void SaveEntity(string keyValue, TextbookInOutEntity entity, List textBookOut);
+
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs
new file mode 100644
index 000000000..f6a484c1c
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookOut/TextBookOutService.cs
@@ -0,0 +1,285 @@
+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-03-05 11:17
+ /// 描 述:TextBookOut
+ ///
+ public class TextBookOutService : RepositoryFactory
+ {
+ #region 获取数据
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ /// 查询参数
+ ///
+ public IEnumerable GetPageList(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var strSql = new StringBuilder();
+ strSql.Append("SELECT ");
+ strSql.Append(@"
+ t.Id,
+ t.AcademicYearNo,
+ t.Semester,
+ t.DeptNo,
+ t.MajorNo,
+ t.ClassNo,
+ t.LessonNo,
+ t.Variate,
+ t.Recipient,
+ t.CreateTime,
+ t.CrateUserID
+ ");
+ strSql.Append(" FROM TextBookOut t ");
+ strSql.Append(" WHERE 1=1 ");
+ var queryParam = queryJson.ToJObject();
+ // 虚拟参数
+ var dp = new DynamicParameters(new { });
+ if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty())
+ {
+ dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime);
+ dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime);
+ strSql.Append(" AND ( t.CreateTime >= @startTime AND t.CreateTime <= @endTime ) ");
+ }
+ if (!queryParam["AcademicYearNo"].IsEmpty())
+ {
+ dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo ");
+ }
+ if (!queryParam["Semester"].IsEmpty())
+ {
+ dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String);
+ strSql.Append(" AND t.Semester = @Semester ");
+ }
+ if (!queryParam["DeptNo"].IsEmpty())
+ {
+ dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.DeptNo = @DeptNo ");
+ }
+ if (!queryParam["MajorNo"].IsEmpty())
+ {
+ dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.MajorNo = @MajorNo ");
+ }
+ if (!queryParam["ClassNo"].IsEmpty())
+ {
+ dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.ClassNo = @ClassNo ");
+ }
+ if (!queryParam["LessonNo"].IsEmpty())
+ {
+ dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.LessonNo = @LessonNo ");
+ }
+ if (!queryParam["Recipient"].IsEmpty())
+ {
+ dp.Add("Recipient", "%" + queryParam["Recipient"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.Recipient Like @Recipient ");
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 获取TextBookOut表实体数据
+ ///
+ /// 主键
+ ///
+ public TextBookOutEntity GetTextBookOutEntity(string keyValue)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindEntity(x => x.InOutCode == keyValue);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ #endregion
+
+ #region 提交数据
+
+ ///
+ /// 删除实体数据
+ ///
+ /// 主键
+ public void DeleteEntity(string keyValue)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ decimal? Num = 0;
+ var keyValueArr = keyValue.Split(',');
+ foreach (var item in keyValueArr)
+ {
+ var entity = BaseRepository("CollegeMIS").FindEntity(x => x.ID == item);
+ if (entity != null)
+ {
+ Num += entity.Variate;
+ var InOutEntity = db.FindEntity(x => x.BookCode == entity.InOutCode);
+ if (InOutEntity != null)
+ {
+ InOutEntity.FinallyNum += Num;
+ db.Delete(entity);
+ db.Update(InOutEntity);
+ }
+ else
+ {
+ db.Rollback();
+ }
+ }
+ }
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
+ ///
+ /// 保存实体数据(新增、修改)
+ ///
+ /// 主键
+ /// 实体
+ public void SaveEntity(string keyValue, TextBookOutEntity entity)
+ {
+ try
+ {
+ if (keyValue != null)
+ {
+ 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);
+ }
+ }
+ }
+
+ ///
+ /// 保存
+ ///
+ ///
+ /// 库存
+ ///
+ public void SaveEntity(string keyValue, TextbookInOutEntity entity, List textbookOutList)
+ {
+ var db = this.BaseRepository("CollegeMIS").BeginTrans();
+ try
+ {
+ decimal? variate = 0;
+ if (textbookOutList.Count > 0)
+ {
+ for (int i = 0; i < textbookOutList.Count; i++)
+ {
+ textbookOutList[i].InOutCode = entity.BookCode;
+ textbookOutList[i].LessonNo = entity.LessonNo;
+ textbookOutList[i].PublishNo = entity.PublishNo;
+ textbookOutList[i].TextBookNo = entity.TextBookNo;
+ textbookOutList[i].TextBookName = entity.TextBookName;
+ textbookOutList[i].FirstAuthor = entity.FirstAuthor;
+ textbookOutList[i].OtherAuthor = entity.OtherAuthor;
+ textbookOutList[i].Publisher = entity.Publisher;
+ textbookOutList[i].Edition = entity.Edition;
+ textbookOutList[i].Impression = entity.Impression;
+ textbookOutList[i].Impression = entity.Impression;
+ variate += textbookOutList[i].Variate;
+ }
+ this.BaseRepository("CollegeMIS").Insert(textbookOutList);
+
+ if (variate != 0 && variate > 0)
+ {
+ var newtextInOutEntity = db.FindEntity(x => x.BookCode == entity.BookCode);
+ if (newtextInOutEntity != null)
+ {
+ newtextInOutEntity.FinallyNum -= variate;
+ if (newtextInOutEntity.FinallyNum > 0 || newtextInOutEntity.FinallyNum == 0)
+ {
+ db.Update(newtextInOutEntity);
+ }
+ else
+ {
+ db.Rollback();
+ }
+ }
+ else
+ {
+ db.Rollback();
+ }
+ }
+ }
+ db.Commit();
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ #endregion
+
+ }
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs
index df66cd941..82c4f37a2 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
@@ -66,6 +66,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
strSql.Append(" FROM TextbookInOut t where 1=1 ");
var queryParam = queryJson.ToJObject();
var dp = new DynamicParameters(new { });
+ if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty())
+ {
+ dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime);
+ dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime);
+ strSql.Append(" AND ( t.CreateTime >= @startTime AND t.CreateTime <= @endTime ) ");
+ }
if (!queryParam["SqlParameter"].IsEmpty())
{
string SqlParameter = queryParam["SqlParameter"].ToString();
@@ -78,7 +84,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
if (!queryParam["TextBookName"].IsEmpty())
{
- strSql.Append(" and TextBookName like @TextBookName )");
+ strSql.Append(" and TextBookName like @TextBookName ");
dp.Add("TextBookName", "%" + queryParam["TextBookName"].ToString() + "%", DbType.String);
}
return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
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 ea8266c36..c4b993e41 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
@@ -1818,6 +1818,10 @@
+
+
+
+