Przeglądaj źródła

教材库存管理判断重复数据

临城职教中职
ndbs 2 lat temu
rodzic
commit
f80c11c8b2
4 zmienionych plików z 92 dodań i 6 usunięć
  1. +11
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs
  2. +21
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs
  3. +16
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs
  4. +44
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs

+ 11
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs Wyświetl plik

@@ -170,8 +170,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
entity.UpTime = DateTime.Now;
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>


+ 21
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs Wyświetl plik

@@ -23,7 +23,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
public IEnumerable<TextbookInOutEntity> GetList( string queryJson )
public IEnumerable<TextbookInOutEntity> GetList(string queryJson)
{
try
{
@@ -66,7 +66,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
/// <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

}


+ 16
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs Wyświetl plik

@@ -20,7 +20,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <param name="queryJson">查询参数</param>
/// <returns></returns>
IEnumerable<TextbookInOutEntity> GetList( string queryJson );
IEnumerable<TextbookInOutEntity> GetList(string queryJson);
/// <summary>
/// 获取列表分页数据
/// </summary>
@@ -66,7 +66,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <param name="keyValue"></param>
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

}


+ 44
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs Wyświetl plik

@@ -309,5 +309,49 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
#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);
}
}
}
}
}

Ładowanie…
Anuluj
Zapisz