2022-10-20 17:12:54 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using WaterCloud.Code;
|
|
|
|
|
|
using WaterCloud.Domain.ProcessManage;
|
|
|
|
|
|
using WaterCloud.Service;
|
|
|
|
|
|
using WaterCloud.Service.ProcessManage;
|
|
|
|
|
|
|
|
|
|
|
|
namespace WaterCloud.Web.Areas.ProcessManage.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 创 建:超级管理员
|
|
|
|
|
|
/// 日 期:2020-12-07 12:14
|
|
|
|
|
|
/// 描 述:工单管理控制器类
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Area("ProcessManage")]
|
2022-10-28 11:28:07 +08:00
|
|
|
|
public class WorkOrderController : BaseController
|
2022-10-20 17:12:54 +08:00
|
|
|
|
{
|
|
|
|
|
|
public WorkOrderService _service {get;set;}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
public virtual ActionResult SplitForm()
|
|
|
|
|
|
{
|
|
|
|
|
|
return View();
|
|
|
|
|
|
}
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[ServiceFilter(typeof(HandlerAuthorizeAttribute))]
|
|
|
|
|
|
public virtual ActionResult Flow()
|
|
|
|
|
|
{
|
|
|
|
|
|
return View();
|
|
|
|
|
|
}
|
|
|
|
|
|
#region 获取数据
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
[IgnoreAntiforgeryToken]
|
|
|
|
|
|
public async Task<ActionResult> GetGridJson(SoulPage<WorkOrderExtend> pagination, string keyword)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (string.IsNullOrEmpty(pagination.field))
|
|
|
|
|
|
{
|
|
|
|
|
|
pagination.field = "F_WorkOrderState,F_PlanStartTime,F_CreatorTime";
|
|
|
|
|
|
pagination.order = "";
|
|
|
|
|
|
}
|
|
|
|
|
|
var data = await _service.GetLookList(pagination,keyword);
|
|
|
|
|
|
return Content(pagination.setData(data).ToJson());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
public async Task<ActionResult> GetListJson(string keyword)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _service.GetList(keyword);
|
|
|
|
|
|
return Content(data.ToJson());
|
|
|
|
|
|
}
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
public async Task<ActionResult> GetSplitListJson(string keyValue,float num,int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _service.GetSplitListJson(keyValue, num, type);
|
|
|
|
|
|
return Content(data.ToJson());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
public async Task<ActionResult> GetFormJson(string keyValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _service.GetLookForm(keyValue);
|
|
|
|
|
|
return Content(data.ToJson());
|
|
|
|
|
|
}
|
|
|
|
|
|
[HttpGet]
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
public async Task<ActionResult> GetFlow(string keyValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
var data = await _service.GetFlow(keyValue);
|
|
|
|
|
|
return Content(data.ToJson());
|
|
|
|
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 提交数据
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
public async Task<ActionResult> SubmitForm(WorkOrderExtend entity, string keyValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
await _service.SubmitForm(entity, keyValue);
|
|
|
|
|
|
return await Success("操作成功。", "", keyValue);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await Error(ex.Message, "", keyValue);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
[HandlerAjaxOnly]
|
|
|
|
|
|
[ServiceFilter(typeof(HandlerAuthorizeAttribute))]
|
|
|
|
|
|
public async Task<ActionResult> DeleteForm(string keyValue)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
await _service.DeleteForm(keyValue);
|
|
|
|
|
|
return await Success("操作成功。", "", keyValue, DbLogType.Delete);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await Error(ex.Message, "", keyValue, DbLogType.Delete);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|