From b2be3b6939b4382f9165c78857a072f1aa7b01d0 Mon Sep 17 00:00:00 2001 From: zyf <1071160500@qq.com> Date: 星期六, 12 四月 2025 12:34:02 +0800 Subject: [PATCH] 更新平板功能,首检页面生成巡检单 --- MESApplication/Controllers/Base/MessageCenterController.cs | 104 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 99 insertions(+), 5 deletions(-) diff --git a/MESApplication/Controllers/Base/MessageCenterController.cs b/MESApplication/Controllers/Base/MessageCenterController.cs index a079762..3b2e28a 100644 --- a/MESApplication/Controllers/Base/MessageCenterController.cs +++ b/MESApplication/Controllers/Base/MessageCenterController.cs @@ -3,6 +3,7 @@ using MES.Service.service; using MES.Service.util; using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json.Linq; namespace MESApplication.Controllers.Base; @@ -10,6 +11,7 @@ [Route("api/[controller]")] public class MessageCenterController : ControllerBase { + private readonly GetErpParametersServer ErpParametersServer = new(); private readonly MessageCenterManager m = new(); @@ -34,13 +36,60 @@ } } - [HttpPost("GetByPid")] - public ResponseResult ResetUpdate(int pid) + //Resend + [HttpPost("Resend")] + public ResponseResult Resend(MessageCenter data) { try { dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.GetList(it => it.Pid == pid); + resultInfos.tbBillList = ErpParametersServer.Resend(data); + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + //saveError + [HttpPost("SetError")] + public ResponseResult SetError([FromBody] MessageCenter data) + { + try + { + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = m.SetError(data); + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + [HttpPost("GetByPid")] + public ResponseResult ResetUpdate([FromBody] JObject data) + { + var pid = Convert.ToDecimal(data["pid"].ToString()); + try + { + dynamic resultInfos = new ExpandoObject(); + + var messageCenter = m.GetById(pid); + var messageCenters = m.GetList(it => it.Pid == pid); + messageCenters.Add(messageCenter); + resultInfos.tbBillList = messageCenters; return new ResponseResult { status = 0, @@ -60,7 +109,51 @@ try { dynamic resultInfos = new ExpandoObject(); - resultInfos.tbBillList = m.getPushFailedPage(query); + var (item, totalCount) = m.GetPushFailedPage(query); + resultInfos.tbBillList = item; + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos, + TotalCount = totalCount + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + //IsShow + [HttpPost("IsShow")] + public ResponseResult IsShow(MessageCenter query) + { + try + { + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = m.IsShow(query); + return new ResponseResult + { + status = 0, + message = "OK", + data = resultInfos + }; + } + catch (Exception ex) + { + return ResponseResult.ResponseError(ex); + } + } + + //UpdateRead + [HttpPost("UpdateRead")] + public ResponseResult UpdateRead(MessageCenter query) + { + try + { + dynamic resultInfos = new ExpandoObject(); + resultInfos.tbBillList = m.UpdateRead(query); return new ResponseResult { status = 0, @@ -106,8 +199,9 @@ /// </summary> /// <returns></returns> [HttpPost("GetById")] - public ResponseResult GetById(int id) + public ResponseResult GetById([FromBody] JObject data) { + var id = Convert.ToDecimal(data["id"].ToString()); try { dynamic resultInfos = new ExpandoObject(); -- Gitblit v1.9.3