|
@@ -0,0 +1,147 @@ |
|
|
|
|
|
using System; |
|
|
|
|
|
using Nancy; |
|
|
|
|
|
using Learun.Util; |
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
|
|
using Learun.Application.TwoDevelopment.LogisticsManagement; |
|
|
|
|
|
using Learun.Application.TwoDevelopment.AssetManagementSystem; |
|
|
|
|
|
using Learun.Application.WorkFlow; |
|
|
|
|
|
|
|
|
|
|
|
namespace Learun.Application.WebApi |
|
|
|
|
|
{ |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 |
|
|
|
|
|
/// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 |
|
|
|
|
|
/// 创 建:超级管理员 |
|
|
|
|
|
/// 日 期:2022-11-21 10:09 |
|
|
|
|
|
/// 描 述:考勤记录 |
|
|
|
|
|
/// </summary> |
|
|
|
|
|
public class FundsApplyApi : BaseApi |
|
|
|
|
|
{ |
|
|
|
|
|
private FundsApplyIBLL fundsApplyIBLL = new FundsApplyBLL(); |
|
|
|
|
|
private FundsApplyDetailIBLL fundsApplyDetailIBLL = new FundsApplyDetailBLL(); |
|
|
|
|
|
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL(); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 注册接口 |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
public FundsApplyApi() |
|
|
|
|
|
: base("/learun/adms/FundsApply") |
|
|
|
|
|
{ |
|
|
|
|
|
Get["/pagelist"] = GetPageList; |
|
|
|
|
|
Get["/form"] = GetForm; |
|
|
|
|
|
Get["/getEnCode"] = GetEnCode; |
|
|
|
|
|
Post["/delete"] = DeleteForm; |
|
|
|
|
|
Post["/save"] = SaveForm; |
|
|
|
|
|
Post["/submit"] = Submit; |
|
|
|
|
|
} |
|
|
|
|
|
#region 获取数据 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 获取页面显示列表分页数据 |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public Response GetPageList(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
ReqPageParam parameter = this.GetReqData<ReqPageParam>(); |
|
|
|
|
|
var data = fundsApplyIBLL.GetPageList(parameter.pagination, parameter.queryJson); |
|
|
|
|
|
var jsonData = new |
|
|
|
|
|
{ |
|
|
|
|
|
rows = data, |
|
|
|
|
|
total = parameter.pagination.total, |
|
|
|
|
|
page = parameter.pagination.page, |
|
|
|
|
|
records = parameter.pagination.records |
|
|
|
|
|
}; |
|
|
|
|
|
return Success(jsonData); |
|
|
|
|
|
} |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 获取表单数据 |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public Response GetForm(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
string keyValue = this.GetReqData(); |
|
|
|
|
|
var FundsApplyData = fundsApplyIBLL.GetFundsApplyEntity(keyValue); |
|
|
|
|
|
var FundsApplyDetailData = fundsApplyDetailIBLL.GetListByApplyId(keyValue); |
|
|
|
|
|
var jsonData = new |
|
|
|
|
|
{ |
|
|
|
|
|
FundsApply = FundsApplyData, |
|
|
|
|
|
FundsApplyDetail = FundsApplyDetailData, |
|
|
|
|
|
}; |
|
|
|
|
|
return Success(jsonData); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 获取申请单号 |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public Response GetEnCode(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
var jsonData = new |
|
|
|
|
|
{ |
|
|
|
|
|
EnCode = "JFKZ_" + CommonHelper.CreateNo() |
|
|
|
|
|
}; |
|
|
|
|
|
return Success(jsonData); |
|
|
|
|
|
} |
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 提交数据 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 删除实体数据 |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public Response DeleteForm(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
string keyValue = this.GetReqData(); |
|
|
|
|
|
fundsApplyIBLL.DeleteEntity(keyValue); |
|
|
|
|
|
return Success("删除成功!"); |
|
|
|
|
|
} |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 保存实体数据(新增、修改) |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public Response SaveForm(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
ReqFormEntity parameter = this.GetReqData<ReqFormEntity>(); |
|
|
|
|
|
FundsApplyEntity entity = parameter.strEntity.ToObject<FundsApplyEntity>(); |
|
|
|
|
|
List<FundsApplyDetailEntity> detailList = parameter.fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>(); |
|
|
|
|
|
|
|
|
|
|
|
fundsApplyIBLL.SaveEntity(parameter.keyValue, entity, detailList); |
|
|
|
|
|
return Success("保存成功!"); |
|
|
|
|
|
} |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 提交 |
|
|
|
|
|
/// <param name="_"></param> |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
public Response Submit(dynamic _) |
|
|
|
|
|
{ |
|
|
|
|
|
string keyValue = this.GetReqData(); |
|
|
|
|
|
var processId = Guid.NewGuid().ToString(); |
|
|
|
|
|
fundsApplyIBLL.ChangeStatusById(keyValue, 1, processId); |
|
|
|
|
|
UserInfo userInfo = LoginUserInfo.Get(); |
|
|
|
|
|
nWFProcessIBLL.CreateFlow("LC_FundsApply", processId, "", 1, "", userInfo); |
|
|
|
|
|
return Success("提交成功!"); |
|
|
|
|
|
} |
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
#region 私有类 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
/// 表单实体类 |
|
|
|
|
|
/// <summary> |
|
|
|
|
|
private class ReqFormEntity |
|
|
|
|
|
{ |
|
|
|
|
|
public string keyValue { get; set; } |
|
|
|
|
|
public string strEntity { get; set; } |
|
|
|
|
|
public string fundsApplyDetailList { get; set; } |
|
|
|
|
|
} |
|
|
|
|
|
#endregion |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
} |