Procházet zdrojové kódy

经费开始单号生成优化,及保存判断

新疆警官学校中职
ndbs před 1 rokem
rodič
revize
31bd4ca781
5 změnil soubory, kde provedl 75 přidání a 5 odebrání
  1. +4
    -3
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/FundsApplyController.cs
  2. +5
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FundsApplyApi.cs
  3. +23
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyBLL.cs
  4. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyIBLL.cs
  5. +36
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyService.cs

+ 4
- 3
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/FundsApplyController.cs Zobrazit soubor

@@ -37,7 +37,7 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
[HttpGet]
public ActionResult Form()
{
ViewBag.EnCode = "JFKZ_" + CommonHelper.CreateNo();
ViewBag.EnCode = fundsApplyIBLL.GetCode();
return View();
}

@@ -136,10 +136,11 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
{
FundsApplyEntity entity = strEntity.ToObject<FundsApplyEntity>();
List<FundsApplyDetailEntity> detailList = fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>();
fundsApplyIBLL.SaveEntity(keyValue, entity, detailList);
if (string.IsNullOrEmpty(keyValue))
if (entity.EnCode.Length > 15)
{
return Fail("保存失败,经费开支单号今日数量已超上限,请明日提交!");
}
fundsApplyIBLL.SaveEntity(keyValue, entity, detailList);
return Success("保存成功!");
}



+ 5
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FundsApplyApi.cs Zobrazit soubor

@@ -82,7 +82,7 @@ namespace Learun.Application.WebApi
{
var jsonData = new
{
EnCode = "JFKZ_" + CommonHelper.CreateNo()
EnCode = fundsApplyIBLL.GetCode()
};
return Success(jsonData);
}
@@ -129,7 +129,10 @@ namespace Learun.Application.WebApi
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>();
FundsApplyEntity entity = parameter.strEntity.ToObject<FundsApplyEntity>();
List<FundsApplyDetailEntity> detailList = parameter.fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>();

if (entity.EnCode.Length > 15)
{
return Fail("保存失败,经费开支单号今日数量已超上限,请明日提交!");
}
fundsApplyIBLL.SaveEntity(parameter.keyValue, entity, detailList);
return Success("保存成功!");
}


+ 23
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyBLL.cs Zobrazit soubor

@@ -91,6 +91,29 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
}
}

/// <summary>
/// 获取FundsApply表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public string GetCode()
{
try
{
return fundsApplyService.GetCode();
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

#region 提交数据


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyIBLL.cs Zobrazit soubor

@@ -34,6 +34,13 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
/// <param name="processId">流程实例ID</param>
/// <returns></returns>
FundsApplyEntity GetEntityByProcessId(string processId);
/// <summary>
/// 经费单号
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
string GetCode();

#endregion

#region 提交数据


+ 36
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyService.cs Zobrazit soubor

@@ -124,6 +124,42 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
}
}

/// <summary>
/// 获取FundsApply表实体数据
/// </summary>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public string GetCode()
{
try
{
var strSql = new StringBuilder();
strSql.Append(@"select * from FundsApply where 1= 1 and ApplyTime >= '" + DateTime.Now.Date + "' ");
var data = this.BaseRepository("CollegeMIS").FindList<FundsApplyEntity>(strSql.ToString()).OrderByDescending(x => x.EnCode).FirstOrDefault();
var Code = "JFKZ_" + CommonHelper.StringTime();
if (data != null && !string.IsNullOrEmpty(data.EnCode))
{
var NCode = data.EnCode.Substring(data.EnCode.Length - 2, 2);
Code = Code + (Convert.ToInt32(NCode) + 1).ToString().PadLeft(2, '0');
}
else
{
Code = Code + "01";
}
return Code;
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

#region 提交数据


Načítá se…
Zrušit
Uložit