From cee4e362c81af4c93c87f40e77649e9af5a591c6 Mon Sep 17 00:00:00 2001
From: zyf <1071160500@qq.com>
Date: 星期一, 02 六月 2025 20:05:54 +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