From ab8c1dbb9bbdc90c6babb248d9648926a2981e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=A2=E6=B1=9F=E6=B5=B7?= <18360817963@163.com> Date: Wed, 12 Mar 2025 17:31:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=A2=E6=B1=9F=E6=B5=B7=E3=80=81=E5=87=BA?= =?UTF-8?q?=E8=B4=A7=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mobile/ReportFlowController.cs | 23 ++++++++++++++++++- .../Mobile/IService/IReportFlowService.cs | 2 +- DOAN.Service/Mobile/ReportFlowService.cs | 23 ++++++++++++++++--- 3 files changed, 43 insertions(+), 5 deletions(-) diff --git a/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs b/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs index 34e228c..0bb2a70 100644 --- a/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs +++ b/DOAN.Admin.WebApi/Controllers/Mobile/ReportFlowController.cs @@ -122,8 +122,29 @@ public class ReportFlowController : BaseController { throw new CustomException("workorder or process is null"); } + int ret = _reportFlowService.ShipmentProcessReportwork(workorder, processId, finish_num, bad_num, customer_order, process_operator); + string data = ""; + if (ret == 0) + { + data = "失败"; - return SUCCESS(_reportFlowService.ShipmentProcessReportwork(workorder, processId, finish_num, bad_num, customer_order, process_operator)); + } + if (ret==1) + { + data = "成功"; + + } + if (ret == 2) + { + data = "采购订单号和工单号不匹配"; + + } + if (ret == 3) + { + data = "出货数量超额"; + + } + return SUCCESS(data); } //TODO 获取工单下的报工列表 diff --git a/DOAN.Service/Mobile/IService/IReportFlowService.cs b/DOAN.Service/Mobile/IService/IReportFlowService.cs index b375065..25ff50a 100644 --- a/DOAN.Service/Mobile/IService/IReportFlowService.cs +++ b/DOAN.Service/Mobile/IService/IReportFlowService.cs @@ -18,7 +18,7 @@ public interface IReportFlowService: IBaseService bool ProcessReportWork(string workorder, int process, int finish_num,int bad_num,string Worker); - bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker); + int ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker); List GetWorkOrderReportWorkList(string workorder); PagedInfo GetReportInfoByName(ProReportWorkDto2 query); diff --git a/DOAN.Service/Mobile/ReportFlowService.cs b/DOAN.Service/Mobile/ReportFlowService.cs index fe44da3..491a678 100644 --- a/DOAN.Service/Mobile/ReportFlowService.cs +++ b/DOAN.Service/Mobile/ReportFlowService.cs @@ -12,6 +12,7 @@ using DOAN.Service.Public.IPublicService; using Infrastructure.Attribute; using Mapster; using Microsoft.AspNetCore.Mvc; +using NPOI.SS.Formula.Functions; using SqlSugar.DistributedSystem.Snowflake; using System.Diagnostics; @@ -140,9 +141,25 @@ public class ReportFlowService : BaseService, IReportFlowServic /// /// /// - public bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker) + public int ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker) { - int result = 0; + //采购订单号和工单号是否匹配 + bool isexistfree_order = Context.Queryable().Where(o=>o.FeedOrder==customer_order).Any(); + if (isexistfree_order) + { + OrderPurchase orderPurchase= Context.Queryable().Where(o => o.OrderNoMes == customer_order).First(); + if (orderPurchase.DeliveryQuantity + finish_num> orderPurchase.DemandQuantity) + { + return 3;//超额 + } + + } + else + { + return 2;//采购订单号和工单号不匹配 + } + + int result = 0; bool Exist = Context.Queryable().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any(); string NickName = Context.Queryable().Where(it => it.UserName == Worker).Select(it => it.NickName).First(); Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName; @@ -216,7 +233,7 @@ public class ReportFlowService : BaseService, IReportFlowServic } - return result > 0; + return result > 0?1:0; } public List GetWorkOrderReportWorkList(string workorder)