This commit is contained in:
zel
2025-03-09 03:46:28 +08:00
parent fb8c34f604
commit 7c4b851b43
8 changed files with 463 additions and 11 deletions

View File

@@ -0,0 +1,78 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WaterCloud.Code;
using WaterCloud.Domain.Entity.CustomerOrder;
using WaterCloud.Service.CustomerOrder;
namespace WaterCloud.Web.Areas.CustomerOrder.Controllers;
[Area("CustomerOrder")]
public class CustomerOrderController : BaseController
{
public CustomerOrderService CustomerOrderService { get; set; }
[HttpGet]
[HandlerAjaxOnly]
public async Task<ActionResult> GetPageList(Pagination pagination, string keyword)
{
if (string.IsNullOrEmpty(pagination.field))
{
pagination.order = "desc";
pagination.field = "F_CreatorTime";
}
var data = await CustomerOrderService.GetPageList(pagination, keyword);
return Success(pagination.records, data);
}
[HttpGet]
[HandlerAjaxOnly]
public async Task<ActionResult> GetListJson(string keyword)
{
var data = await CustomerOrderService.GetList(keyword);
return Content(data.ToJson());
}
[HttpGet]
[HandlerAjaxOnly]
public async Task<ActionResult> GetFormJson(string keyValue)
{
var data = await CustomerOrderService.GetForm(keyValue);
return Content(data.ToJson());
}
#region
[HttpPost]
[HandlerAjaxOnly]
public async Task<ActionResult> SubmitForm(CustomerOrderEntity entity, string keyValue)
{
try
{
await CustomerOrderService.SubmitForm(entity, keyValue);
return await Success("操作成功。", "", keyValue);
}
catch (Exception ex)
{
return await Error(ex.Message, "", keyValue);
}
}
[HttpPost]
[HandlerAjaxOnly]
[HandlerAuthorize]
public async Task<ActionResult> DeleteForm(string keyValue)
{
try
{
await CustomerOrderService.DeleteForm(keyValue);
return await Success("操作成功。", "", keyValue, DbLogType.Delete);
}
catch (Exception ex)
{
return await Error(ex.Message, "", keyValue, DbLogType.Delete);
}
}
#endregion
}