From 109d5bf79e051157d666a31b3c9b81daa0fb2d8c Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Fri, 16 Sep 2022 18:19:23 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91webapi?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=AE=BF=E8=88=8D=E7=89=A9=E5=93=81?= =?UTF-8?q?=E6=8D=9F=E5=9D=8F=E4=B8=8A=E6=8A=A5=E6=8E=A5=E5=8F=A3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Acc_GoodsDemageController.cs | 4 +- .../Learun.Application.WebApi.csproj | 1 + .../LogisticsManagement/Acc_GoodsDemageApi.cs | 109 ++++++++++++++++++ 3 files changed, 111 insertions(+), 3 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_GoodsDemageApi.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs index 770cd848a..5494939a2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Controllers/Acc_GoodsDemageController.cs @@ -104,9 +104,7 @@ namespace Learun.Application.Web.Areas.LogisticsManagement.Controllers { Acc_GoodsDemageEntity entity = strEntity.ToObject(); var loginUserInfo = LoginUserInfo.Get(); - entity.F_CreateAccount = loginUserInfo.account; - entity.F_CreateUserId = loginUserInfo.userId; - entity.F_CreateDate = DateTime.Now; + entity.F_CreateAccount = loginUserInfo.account;//上报学生学号 acc_GoodsDemageIBLL.SaveEntity(keyValue,entity); return Success("保存成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj index e2fc1214b..44223121a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj @@ -198,6 +198,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_GoodsDemageApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_GoodsDemageApi.cs new file mode 100644 index 000000000..f91e166c1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/LogisticsManagement/Acc_GoodsDemageApi.cs @@ -0,0 +1,109 @@ +using Nancy; +using Learun.Util; +using System.Collections.Generic; +using System; +using Learun.Application.TwoDevelopment.LogisticsManagement; + +namespace Learun.Application.WebApi +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-09-16 14:43 + /// 描 述:宿舍物品损坏上报 + /// + public class Acc_GoodsDemageApi : BaseApi + { + private Acc_GoodsDemageIBLL acc_GoodsDemageIBLL = new Acc_GoodsDemageBLL(); + + /// + /// 注册接口 + /// + public Acc_GoodsDemageApi() + : base("/Learun/adms/LogisticsManagement/Acc_GoodsDemage") + { + Get["/pagelist"] = GetPageList; + Get["/form"] = GetForm; + Post["/delete"] = DeleteForm; + Post["/save"] = SaveForm; + } + #region 获取数据 + + /// + /// 获取页面显示列表分页数据 + /// + /// + /// + public Response GetPageList(dynamic _) + { + ReqPageParam parameter = this.GetReqData(); + var data = acc_GoodsDemageIBLL.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); + } + /// + /// 获取表单数据 + /// + /// + /// + public Response GetForm(dynamic _) + { + string keyValue = this.GetReqData(); + var Acc_GoodsDemageData = acc_GoodsDemageIBLL.GetAcc_GoodsDemageEntity(keyValue); + var jsonData = new + { + Acc_GoodsDemage = Acc_GoodsDemageData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// + /// + public Response DeleteForm(dynamic _) + { + string keyValue = this.GetReqData(); + acc_GoodsDemageIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// + /// + public Response SaveForm(dynamic _) + { + ReqFormEntity parameter = this.GetReqData(); + Acc_GoodsDemageEntity entity = parameter.strEntity.ToObject(); + entity.F_CreateAccount = LoginUserInfo.Get().account; + acc_GoodsDemageIBLL.SaveEntity(parameter.keyValue, entity); + return Success("保存成功!"); + } + #endregion + + #region 私有类 + + /// + /// 表单实体类 + /// + private class ReqFormEntity + { + public string keyValue { get; set; } + public string strEntity { get; set; } + } + #endregion + + } +}