浏览代码

移动端部门周计划API

长阳分支中职
王晓寒 1 个月前
父节点
当前提交
051ffc2c5b
共有 5 个文件被更改,包括 161 次插入5 次删除
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj
  2. +149
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/DepartmentWeekApi.cs
  3. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml
  4. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/ioc.config
  5. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DepartmentWeek/DepartmentWeekService.cs

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Learun.Application.WebApi.csproj 查看文件

@@ -22,8 +22,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<UseGlobalApplicationHostFile />
<Use64BitIISExpress>
</Use64BitIISExpress>
<Use64BitIISExpress>false</Use64BitIISExpress>
<SccProjectName>
</SccProjectName>
<SccLocalPath>
@@ -191,6 +190,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="Bootstraper.cs" />
<Compile Include="Modules\DepartmentWeekApi.cs" />
<Compile Include="Modules\Echarts\EchartsApi.cs" />
<Compile Include="Modules\Echarts\StudentEchartsApi.cs" />
<Compile Include="Modules\EducationalAdministration\ArrangeExamTermApi.cs" />


+ 149
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/DepartmentWeekApi.cs 查看文件

@@ -0,0 +1,149 @@
using System;
using Learun.Application.TwoDevelopment.EducationalAdministration;
using Learun.Application.WorkFlow;
using Learun.Util;
using Nancy;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Web.Mvc;

namespace Learun.Application.WebApi.Modules
{
public class DepartmentWeekApi : BaseApi
{
private DepartmentWeekIBLL departmentWeekIBLL = new DepartmentWeekBLL();
private NWFProcessIBLL nWFProcessIBLL = new NWFProcessBLL();

/// <summary>
/// 注册接口
/// </summary>
public DepartmentWeekApi()
: base("/learun/departmentWeek")
{
Get["/pageList"] = GetPageList;// 获取列表
Get["/getFormData"] = GetFormData;// 根据id获取详情
Get["/getFormDataByProcessId"] = GetFormDataByProcessId;// 根据流程id获取详情
Post["/saveForm"] = SaveForm;// 添加/编辑
Post["/pushForm"] = PushForm;// 发布
Post["/changeStatusById"] = ChangeStatusById;// 提交
Post["/deleteForm"] = DeleteForm;// 删除
}
/// <summary>
/// 推送发布
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
public Response PushForm(dynamic _)
{
departmentWeekIBLL.PushEntity();
return Success("推送成功!");
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="_"></param>
/// <returns></returns>
public Response GetPageList(dynamic _)
{
ReqPageParam parameter = this.GetReqData<ReqPageParam>();
var data = departmentWeekIBLL.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>
/// <returns></returns>
public Response ChangeStatusById(dynamic _)
{
var processId = Guid.NewGuid().ToString();
var keyValue = this.GetReqData();
departmentWeekIBLL.ChangeStatusById(keyValue,1, processId);
nWFProcessIBLL.CreateFlow("DepartmentWeek", processId, "", 1, "", userInfo);
return Success("提交成功!");
}
/// <summary>
/// 删除
/// </summary>
/// <returns></returns>
public Response DeleteForm(dynamic _)
{
var keyValue = this.GetReqData();
departmentWeekIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 根据id获取表单数据
/// </summary>
/// <returns></returns>
public Response GetFormData(dynamic _)
{
var keyValue = this.GetReqData();
var DepartmentWeekData = departmentWeekIBLL.GetDepartmentWeekEntity(keyValue);
var Firset = departmentWeekIBLL.GetDetail(DepartmentWeekData.ID, "1");
var Second = departmentWeekIBLL.GetDetail(DepartmentWeekData.ID, "2");
var jsonData = new
{
DepartmentWeek = DepartmentWeekData,
Firset = Firset,
Second = Second,
};
return Success(jsonData);
}
/// <summary>
/// 根据流程实例主键获取表单数据
/// </summary>
/// <returns></returns>
public Response GetFormDataByProcessId(dynamic _)
{
var processId = this.GetReqData();
var DepartmentWeekData = departmentWeekIBLL.GetEntityByProcessId(processId);
var Firset = departmentWeekIBLL.GetDetail(DepartmentWeekData.ID, "1");
var Second = departmentWeekIBLL.GetDetail(DepartmentWeekData.ID, "2");
var jsonData = new
{
DepartmentWeek = DepartmentWeekData,
Firset = Firset,
Second = Second,
};
return Success(jsonData);
}
/// <summary>
/// 保存实体数据(新增、修改)
/// </summary>
/// <returns></returns>
public Response SaveForm(dynamic _)
{
var parameter = this.GetReqData<AddDepartmentWeekModel>();
DepartmentWeekEntity entity = parameter.strEntity.ToObject<DepartmentWeekEntity>();

List<DepartmentWeekDetailEntity> FirsetDetail = parameter.Firset.ToObject<List<DepartmentWeekDetailEntity>>();
List<DepartmentWeekDetailEntity> SecondDetail = parameter.Second.ToObject<List<DepartmentWeekDetailEntity>>();

departmentWeekIBLL.SaveEntity(parameter.keyValue, entity, FirsetDetail, SecondDetail);
return SuccessString(entity.ID);
}
}

public class SmubitModel
{
public string keyValue { get; set; }
public int status { get; set; }
public string processId { get; set; }
}

public class AddDepartmentWeekModel
{
public string keyValue { get; set; }
public string strEntity { get; set; }
public string Firset { get; set; }
public string Second { get; set; }
}
}

+ 3
- 3
Learun.Framework.Ultimate V7/Learun.Application.WebApi/Properties/PublishProfiles/FolderProfile1.pubxml 查看文件

@@ -10,9 +10,9 @@
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<publishUrl>bin\Release\Publish</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
<DeleteExistingFiles>true</DeleteExistingFiles>
</PropertyGroup>
</Project>

+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Application.WebApi/XmlConfig/ioc.config 查看文件

@@ -36,6 +36,7 @@
<typeAlias alias="StuDisciplineManagementMethod" type="Learun.Application.WorkFlow.StuDisciplineManagementMethod,Learun.Application.WorkFlow" />
<typeAlias alias="StudentCertificateMethod" type="Learun.Application.WorkFlow.StudentCertificateMethod,Learun.Application.WorkFlow" />
<typeAlias alias="FundsApplyMethod" type="Learun.Application.WorkFlow.FundsApplyMethod,Learun.Application.WorkFlow" />
<typeAlias alias="DepartmentWeekMethod" type="Learun.Application.WorkFlow.DepartmentWeekMethod,Learun.Application.WorkFlow" />

<!--任务调度器-->
<typeAlias alias="ITSMethod" type="Learun.Application.Extention.TaskScheduling.ITsMethod,Learun.Application.Extention" />
@@ -79,6 +80,7 @@
<type type="IWorkFlowMethod" mapTo="StuDisciplineManagementMethod" name="StuDisciplineManagementMethod"></type>
<type type="IWorkFlowMethod" mapTo="StudentCertificateMethod" name="StudentCertificateMethod"></type>
<type type="IWorkFlowMethod" mapTo="FundsApplyMethod" name="FundsApplyMethod"></type>
<type type="IWorkFlowMethod" mapTo="DepartmentWeekMethod" name="DepartmentWeekMethod"></type>
</container>
<container name="TsIOCcontainer">
<!--<type type="ITSMethod" mapTo="TestTask" name="taskioc"></type>-->


+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/DepartmentWeek/DepartmentWeekService.cs 查看文件

@@ -47,6 +47,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
dp.Add("Department", queryParam["Department"].ToString(), DbType.String);
strSql.Append(" AND t.Department = @Department ");
}
if (!queryParam["Status"].IsEmpty())
{
dp.Add("Status", queryParam["Status"].ToString(), DbType.String);
strSql.Append(" AND t.Status = @Status ");
}
if (!queryParam["Week"].IsEmpty())
{
dp.Add("Week", queryParam["Week"].ToString(), DbType.String);


正在加载...
取消
保存