106 lines
3.1 KiB
C#
106 lines
3.1 KiB
C#
using Learun.Util;
|
||
using Learun.Util.SqlSugar;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
|
||
namespace Learun.Application.WorkFlow
|
||
{
|
||
/// <summary>
|
||
/// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
|
||
/// Copyright (c) 2013-2018 Hexagon PPM
|
||
/// 创建人:研发部
|
||
/// 日 期:2018.12.10
|
||
/// 描 述:会签记录操作
|
||
/// </summary>
|
||
public class NWFConfluenceService
|
||
{
|
||
#region 仓储
|
||
Repository<NWFConfluenceEntity> _NWFConfluenceRepository => new Repository<NWFConfluenceEntity>();
|
||
#endregion
|
||
#region 获取数据
|
||
/// <summary>
|
||
/// 获取会签记录
|
||
/// </summary>
|
||
/// <param name="processId">流程实例主键</param>
|
||
/// <param name="nodeId">节点主键</param>
|
||
/// <returns></returns>
|
||
public IEnumerable<NWFConfluenceEntity> GetList(string processId, string nodeId)
|
||
{
|
||
try
|
||
{
|
||
return _NWFConfluenceRepository.GetList(t => t.F_ProcessId == processId && t.F_NodeId == nodeId);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
if (ex is ExceptionEx)
|
||
{
|
||
throw;
|
||
}
|
||
else
|
||
{
|
||
throw ExceptionEx.ThrowServiceException(ex);
|
||
}
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 提交数据
|
||
/// <summary>
|
||
/// 保存成功的会前记录
|
||
/// </summary>
|
||
/// <param name="entity">实体</param>
|
||
public void SaveEntity(NWFConfluenceEntity entity)
|
||
{
|
||
try
|
||
{
|
||
string processId = entity.F_ProcessId;
|
||
string nodeId = entity.F_NodeId;
|
||
string formNodeId = entity.F_FormNodeId;
|
||
NWFConfluenceEntity oldEntity = _NWFConfluenceRepository.GetFirst(t => t.F_ProcessId == processId && t.F_NodeId == nodeId && t.F_FormNodeId == formNodeId);
|
||
if (oldEntity == null)
|
||
{
|
||
entity.Create();
|
||
_NWFConfluenceRepository.Insert(entity);
|
||
}
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
if (ex is ExceptionEx)
|
||
{
|
||
throw;
|
||
}
|
||
else
|
||
{
|
||
throw ExceptionEx.ThrowServiceException(ex);
|
||
}
|
||
}
|
||
}
|
||
/// <summary>
|
||
/// 删除会签节点数据
|
||
/// </summary>
|
||
/// <param name="processId">实例主键</param>
|
||
/// <param name="nodeId">节点主键</param>
|
||
public void DeleteEntity(string processId, string nodeId)
|
||
{
|
||
try
|
||
{
|
||
_NWFConfluenceRepository.Delete(t => t.F_ProcessId == processId && t.F_NodeId == nodeId);
|
||
}
|
||
catch (Exception ex)
|
||
{
|
||
if (ex is ExceptionEx)
|
||
{
|
||
throw;
|
||
}
|
||
else
|
||
{
|
||
throw ExceptionEx.ThrowServiceException(ex);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
#endregion
|
||
}
|
||
}
|