|
@@ -11,7 +11,7 @@ namespace Learun.Application.WebApi.Modules |
|
|
/// 日 期:2018.01.03 |
|
|
/// 日 期:2018.01.03 |
|
|
/// 描 述:自定义表单处理接口 |
|
|
/// 描 述:自定义表单处理接口 |
|
|
/// </summary> |
|
|
/// </summary> |
|
|
public class FormApi: BaseApi |
|
|
|
|
|
|
|
|
public class FormApi : BaseApi |
|
|
{ |
|
|
{ |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 注册接口 |
|
|
/// 注册接口 |
|
@@ -21,6 +21,7 @@ namespace Learun.Application.WebApi.Modules |
|
|
{ |
|
|
{ |
|
|
Get["/scheme"] = GetScheme; |
|
|
Get["/scheme"] = GetScheme; |
|
|
Get["/data"] = GetData; |
|
|
Get["/data"] = GetData; |
|
|
|
|
|
Get["/folderkey"] = GetFolderkey; |
|
|
|
|
|
|
|
|
Post["/save"] = Save; |
|
|
Post["/save"] = Save; |
|
|
Post["/delete"] = DeleteForm; |
|
|
Post["/delete"] = DeleteForm; |
|
@@ -35,12 +36,15 @@ namespace Learun.Application.WebApi.Modules |
|
|
private Response GetScheme(dynamic _) |
|
|
private Response GetScheme(dynamic _) |
|
|
{ |
|
|
{ |
|
|
List<SchemeReq> req = this.GetReqData<List<SchemeReq>>();// 获取模板请求数据 |
|
|
List<SchemeReq> req = this.GetReqData<List<SchemeReq>>();// 获取模板请求数据 |
|
|
Dictionary<string,FormSchemeEntity> schemeList = new Dictionary<string,FormSchemeEntity>(); |
|
|
|
|
|
foreach (var item in req) { |
|
|
|
|
|
|
|
|
Dictionary<string, FormSchemeEntity> schemeList = new Dictionary<string, FormSchemeEntity>(); |
|
|
|
|
|
foreach (var item in req) |
|
|
|
|
|
{ |
|
|
FormSchemeInfoEntity schemeInfoEntity = formSchemeIBLL.GetSchemeInfoEntity(item.id); |
|
|
FormSchemeInfoEntity schemeInfoEntity = formSchemeIBLL.GetSchemeInfoEntity(item.id); |
|
|
if (schemeInfoEntity != null) { |
|
|
|
|
|
|
|
|
if (schemeInfoEntity != null) |
|
|
|
|
|
{ |
|
|
FormSchemeEntity schemeEntity = formSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId); |
|
|
FormSchemeEntity schemeEntity = formSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId); |
|
|
if (schemeEntity != null) { |
|
|
|
|
|
|
|
|
if (schemeEntity != null) |
|
|
|
|
|
{ |
|
|
if (schemeInfoEntity.F_SchemeId != item.ver) |
|
|
if (schemeInfoEntity.F_SchemeId != item.ver) |
|
|
{ |
|
|
{ |
|
|
schemeList.Add(item.id, schemeEntity); |
|
|
schemeList.Add(item.id, schemeEntity); |
|
@@ -75,7 +79,25 @@ namespace Learun.Application.WebApi.Modules |
|
|
return Success(dic); |
|
|
return Success(dic); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 上传文件夹ID |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
private Response GetFolderkey(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
List<FolderKeyReq> req = this.GetReqData<List<FolderKeyReq>>();// 获取模板请求数据 |
|
|
|
|
|
Dictionary<string, string> dic = new Dictionary<string, string>(); |
|
|
|
|
|
foreach (var item in req) |
|
|
|
|
|
{ |
|
|
|
|
|
if (!string.IsNullOrEmpty(item.processIdName)) |
|
|
|
|
|
{ |
|
|
|
|
|
var data = formSchemeIBLL.GetFolderKey(item.schemeInfoId, item.processIdName, item.keyValue);// |
|
|
|
|
|
dic = data; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return Success(dic); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 保存表单数据 |
|
|
/// 保存表单数据 |
|
@@ -104,7 +126,36 @@ namespace Learun.Application.WebApi.Modules |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#region 请求参数 |
|
|
#region 请求参数 |
|
|
private class SchemeReq { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private class FolderKeyReq |
|
|
|
|
|
{ |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 表单请求Id |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public string id { get; set; } |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 当前自定义表单版本号 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public string ver { get; set; } |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 流程模板id |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public string schemeInfoId { get; set; } |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 关联字段名称 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public string processIdName { get; set; } |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 数据主键值 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public string keyValue { get; set; } |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 表单数据 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public string formData { get; set; } |
|
|
|
|
|
} |
|
|
|
|
|
private class SchemeReq |
|
|
|
|
|
{ |
|
|
/// <summary> |
|
|
/// <summary> |
|
|
/// 表单请求Id |
|
|
/// 表单请求Id |
|
|
/// </summary> |
|
|
/// </summary> |
|
@@ -141,8 +192,8 @@ namespace Learun.Application.WebApi.Modules |
|
|
#endregion |
|
|
#endregion |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |