99 lines
3.5 KiB
C#
99 lines
3.5 KiB
C#
using APT.Infrastructure.Core;
|
|
using APT.MS.Domain.Entities.SK;
|
|
using APT.Utility;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Linq;
|
|
|
|
namespace APT.SK.WebApi.Controllers.Api
|
|
{
|
|
/// <summary>
|
|
/// 制定任务
|
|
/// </summary>
|
|
[Route("api/SK/SKPlanSet")]
|
|
public partial class PlanSetController : AuthorizeApiController<T_SK_PLAN_SET>
|
|
{
|
|
/// <summary>
|
|
/// 更新或新增数据
|
|
/// </summary>
|
|
/// <param name="entity">对象实体</param>
|
|
/// <returns></returns>
|
|
[HttpPost, Route("FullUpdate")]
|
|
public JsonActionResult<bool> FullUpdate([FromBody] T_SK_PLAN_SET entity)
|
|
{
|
|
return SafeExecute<bool>(() =>
|
|
{
|
|
var details = entity.Nav_ListDepOut;
|
|
entity.Nav_ListDepOut = null;
|
|
var objects = entity.Nav_ListSetDepObject;
|
|
entity.Nav_ListSetDepObject = null;
|
|
var areas = entity.Nav_ListArea;
|
|
entity.Nav_ListArea = null;
|
|
if (details != null && details.Any())
|
|
{
|
|
foreach (var item in details)
|
|
{
|
|
item.ORG_ID = entity.ORG_ID;
|
|
item.PLANSET_ID = entity.ID;
|
|
item.Nav_Department = null;
|
|
}
|
|
}
|
|
if (objects != null && objects.Any())
|
|
{
|
|
foreach (var item in objects)
|
|
{
|
|
item.ORG_ID = entity.ORG_ID;
|
|
item.PLANSET_ID = entity.ID;
|
|
item.Nav_Department = null;
|
|
}
|
|
}
|
|
if (areas != null && areas.Any())
|
|
{
|
|
foreach (var item in areas)
|
|
{
|
|
item.ORG_ID = entity.ORG_ID;
|
|
item.PLANSET_ID = entity.ID;
|
|
item.Nav_Area = null;
|
|
}
|
|
}
|
|
this.UnifiedCommit(() =>
|
|
{
|
|
if (entity != null)
|
|
UpdateEntityNoCommit(entity);
|
|
if (details != null && details.Any())
|
|
BantchSaveEntityNoCommit(details);
|
|
if (objects != null && objects.Any())
|
|
BantchSaveEntityNoCommit(objects);
|
|
if (areas != null && areas.Any())
|
|
BantchSaveEntityNoCommit(areas);
|
|
});
|
|
return true;
|
|
});
|
|
}
|
|
/// <summary>
|
|
/// 排序分页查询数据
|
|
/// </summary>
|
|
/// <param name="pageFilter">分页过滤实体</param>
|
|
/// <returns></returns>
|
|
[HttpPost, Route("SKOrderPaged")]
|
|
public PagedActionResult<T_SK_PLAN_SET> SKOrderPaged([FromBody] KeywordPageFilter pageFilter)
|
|
{
|
|
var result = this.GetOrderPageEntities<T_SK_PLAN_SET>(null, pageFilter);
|
|
if (result != null && result.Data != null && result.Data.Any())
|
|
{
|
|
result.Data.ForEach(t =>
|
|
{
|
|
if (t.MONTH == null || t.MONTH == 0)
|
|
{
|
|
t.MONTHStr = "--";
|
|
}
|
|
if (t.DATA == null || t.DATA == 0)
|
|
{
|
|
t.DATAStr = "--";
|
|
}
|
|
});
|
|
}
|
|
return result;
|
|
}
|
|
}
|
|
}
|