72 lines
2.6 KiB
C#
72 lines
2.6 KiB
C#
|
|
using APT.BaseData.Domain.Entities;
|
|||
|
|
using APT.BaseData.Domain.IServices;
|
|||
|
|
using APT.BaseData.Domain.IServices.FM;
|
|||
|
|
using APT.BaseData.Services.DomainServices;
|
|||
|
|
using APT.BaseData.Services.Services.FM;
|
|||
|
|
using APT.Infrastructure.Core;
|
|||
|
|
using APT.MS.Domain.Entities.SC.PR;
|
|||
|
|
using APT.Utility;
|
|||
|
|
using Microsoft.AspNetCore.Mvc;
|
|||
|
|
using System;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace APT.SC.WebApi.Controllers.Api.PRController
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 选矿生产工艺表单配置表
|
|||
|
|
/// </summary>
|
|||
|
|
[Route("api/PR/PRProcessFormXk")]
|
|||
|
|
public partial class ProcessFormXkController : AuthorizeApiController<T_PR_PROCESS_FORM_XK>
|
|||
|
|
{
|
|||
|
|
IFMNotificationTaskService NotificationTaskService { get; set; }
|
|||
|
|
public ProcessFormXkController(IFMNotificationTaskService notificationTaskService)
|
|||
|
|
{
|
|||
|
|
NotificationTaskService = notificationTaskService;
|
|||
|
|
}
|
|||
|
|
/// <summary>
|
|||
|
|
/// 新增编辑
|
|||
|
|
/// </summary>
|
|||
|
|
/// <param name="entity"></param>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
[HttpPost, Route("FullUpdate")]
|
|||
|
|
public JsonActionResult<bool> FullUpdate([FromBody] T_PR_PROCESS_FORM_XK entity)
|
|||
|
|
{
|
|||
|
|
return SafeExecute<bool>(() =>
|
|||
|
|
{
|
|||
|
|
var details = entity.Nav_Details;
|
|||
|
|
entity.Nav_Details = null;
|
|||
|
|
if (details != null && details.Any())
|
|||
|
|
{
|
|||
|
|
details.ForEach(t =>
|
|||
|
|
{
|
|||
|
|
t.ORG_ID = entity.ORG_ID;
|
|||
|
|
t.POST_PROCESS_FORM_ID = entity.ID;
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
entity.STATUS = BaseData.Domain.Enums.PF.PFStandardStatus.Draft;
|
|||
|
|
T_FM_NOTIFICATION_TASK task = null;
|
|||
|
|
if (entity.PUBLISH != null && entity.PUBLISH.Equals("SaveAndNotify"))
|
|||
|
|
{
|
|||
|
|
entity.STATUS = BaseData.Domain.Enums.PF.PFStandardStatus.Archived;
|
|||
|
|
if (entity.TaskID != Guid.Empty)
|
|||
|
|
{
|
|||
|
|
task = NotificationTaskService.GetTaskFinishModel(entity.TaskID);
|
|||
|
|
task.SOURCE_FORMCODE = "PR072_SHOWPRINT";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
this.UnifiedCommit(() =>
|
|||
|
|
{
|
|||
|
|
if (entity != null)
|
|||
|
|
UpdateEntityNoCommit(entity); //保存主表
|
|||
|
|
if (details != null && details.Any())
|
|||
|
|
BantchSaveEntityNoCommit(details); //保存子表
|
|||
|
|
if (task != null)
|
|||
|
|
this.UpdateEntityNoCommit(task);
|
|||
|
|
});
|
|||
|
|
return true;
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|