@@ -170,8 +170,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
entity.UpTime = DateTime.Now; | entity.UpTime = DateTime.Now; | ||||
entity.UpUserID = loginUserInfo.userId; | entity.UpUserID = loginUserInfo.userId; | ||||
} | } | ||||
textbookInOutIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
int RepetitionList = textbookInOutIBLL.GetRepetitions(entity.ID,entity.LessonNo, entity.TextBookNo, entity.TextBookName, entity.PublishNo, entity.Publisher, entity.Edition, entity.Impression); | |||||
if (RepetitionList > 0) | |||||
{ | |||||
return Fail("已存在相同库存单,请使用教材入库功能!"); | |||||
} | |||||
else | |||||
{ | |||||
textbookInOutIBLL.SaveEntity(keyValue, entity); | |||||
return Success("保存成功!"); | |||||
} | |||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -23,7 +23,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
/// <param name="queryJson">查询参数</param> | /// <param name="queryJson">查询参数</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public IEnumerable<TextbookInOutEntity> GetList( string queryJson ) | |||||
public IEnumerable<TextbookInOutEntity> GetList(string queryJson) | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
@@ -66,7 +66,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 获取实体数据 | /// 获取实体数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -210,6 +210,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public int GetRepetitions(string keyValue, string LessonNo, string TextBookNo, string TextBookName, string PublishNo, string Publisher, string Edition, string Impression) | |||||
{ | |||||
try | |||||
{ | |||||
return textbookInOutService.GetRepetitions(keyValue, LessonNo, TextBookNo, TextBookName, PublishNo, Publisher, Edition, Impression); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -20,7 +20,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
/// <param name="queryJson">查询参数</param> | /// <param name="queryJson">查询参数</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
IEnumerable<TextbookInOutEntity> GetList( string queryJson ); | |||||
IEnumerable<TextbookInOutEntity> GetList(string queryJson); | |||||
/// <summary> | /// <summary> | ||||
/// 获取列表分页数据 | /// 获取列表分页数据 | ||||
/// </summary> | /// </summary> | ||||
@@ -66,7 +66,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue"></param> | /// <param name="keyValue"></param> | ||||
void SubmitEntity(string keyValue); | void SubmitEntity(string keyValue); | ||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="LessonNo"></param> | |||||
/// <param name="TextBookNo"></param> | |||||
/// <param name="TextBookName"></param> | |||||
/// <param name="PublishNo"></param> | |||||
/// <param name="Publisher"></param> | |||||
/// <param name="Edition"></param> | |||||
/// <param name="Impression"></param> | |||||
/// <returns></returns> | |||||
int GetRepetitions(string keyValue, string LessonNo, string TextBookNo, string TextBookName, string PublishNo, string Publisher, string Edition, string Impression); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -309,5 +309,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
#endregion | #endregion | ||||
/// <summary> | |||||
/// 去重 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <param name="TextBookNo"></param> | |||||
/// <param name="TextBookName"></param> | |||||
/// <param name="PublishNo"></param> | |||||
/// <param name="Publisher"></param> | |||||
/// <param name="Edition"></param> | |||||
/// <param name="Impression"></param> | |||||
/// <returns></returns> | |||||
public int GetRepetitions(string keyValue, string LessonNo, string TextBookNo, string TextBookName, string PublishNo, string Publisher, string Edition, string Impression) | |||||
{ | |||||
try | |||||
{ | |||||
var HistoryList = new List<TextbookInOutEntity>(); | |||||
if (!string.IsNullOrEmpty(keyValue)) | |||||
{ | |||||
HistoryList = BaseRepository("CollegeMIS").FindList<TextbookInOutEntity>( | |||||
x => x.ID == keyValue && x.LessonNo == LessonNo && x.TextBookNo == TextBookNo && x.TextBookName == TextBookName && x.PublishNo == PublishNo && | |||||
x.Publisher == Publisher && x.Edition == Edition && x.Impression == Impression && x.IsDel == 0).ToList(); | |||||
} | |||||
else | |||||
{ | |||||
HistoryList = BaseRepository("CollegeMIS").FindList<TextbookInOutEntity>( | |||||
x => x.LessonNo == LessonNo && x.TextBookNo == TextBookNo && x.TextBookName == TextBookName && x.PublishNo == PublishNo && | |||||
x.Publisher == Publisher && x.Edition == Edition && x.Impression == Impression && x.IsDel == 0).ToList(); | |||||
} | |||||
return HistoryList.Count; | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |