From 1471318df6795d4c0e78d66ed239899882a6947c Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期三, 28 九月 2022 17:01:27 +0800
Subject: [PATCH] 车间工序全程跟踪报表 、工序在制品报表纵向、不良明细良率报表、车间生产汇报统计表
---
WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
WebAPI/WebAPI.csproj | 2
2 files changed, 172 insertions(+), 0 deletions(-)
diff --git a/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs
new file mode 100644
index 0000000..00411ab
--- /dev/null
+++ b/WebAPI/Controllers/CJGL/Mes_OrderProcFlowAllReportController.cs
@@ -0,0 +1,170 @@
+锘縰sing DBUtility;
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Web.Http;
+using WebAPI.Models;
+
+namespace WebAPI.Controllers.CJGL
+{
+ public class Mes_OrderProcFlowAllReportController : ApiController
+ {
+ public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+ private json objJsonResult = new json();
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ DataSet ds;
+
+ #region 杞﹂棿宸ュ簭鍏ㄧ▼璺熻釜鎶ヨ〃 鏌ヨ
+ [Route("Mes_OrderProcFlowAllReport/OrderProcFlowAllReportList")]
+ [HttpGet]
+ public object OrderProcFlowAllReportList(string sWhere)
+ {
+ try
+ {
+ //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+ ds = oCN.RunProcReturn($"exec h_p_Mes_OrderProcFlowAllReport " +sWhere+"", "h_p_Mes_OrderProcFlowAllReport");
+
+ List<object> listCol = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ listCol.Add(JsonConvert.DeserializeObject(str));
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = listCol;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 宸ュ簭鍦ㄥ埗鍝佹姤琛�(绾靛悜) 鏌ヨ
+ [Route("Mes_OrderProcFlowAllReport/WIPProcReportList")]
+ [HttpGet]
+ public object WIPProcReportList(string sWhere)
+ {
+ try
+ {
+ //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+ ds = oCN.RunProcReturn($"exec h_p_MES_WIPProcReport_New " + sWhere + "", "h_p_MES_WIPProcReport_New");
+
+ List<object> listCol = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ listCol.Add(JsonConvert.DeserializeObject(str));
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = listCol;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 涓嶈壇鏄庣粏鑹巼鎶ヨ〃 鏌ヨ
+ [Route("Mes_OrderProcFlowAllReport/DefectiveDetailedYieldReportList")]
+ [HttpGet]
+ public object DefectiveDetailedYieldReportList(string sWhere)
+ {
+ try
+ {
+ //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+ ds = oCN.RunProcReturn("select * from h_v_DefectiveDetailedYieldReport where 1=1 "+sWhere+" order by HProcID", "h_v_DefectiveDetailedYieldReport");
+
+ List<object> listCol = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ listCol.Add(JsonConvert.DeserializeObject(str));
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = listCol;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 涓嶈壇鏄庣粏鑹巼鎶ヨ〃 鏌ヨ
+ [Route("Mes_OrderProcFlowAllReport/StationOutSumReportList")]
+ [HttpGet]
+ public object StationOutSumReportList(string sWhere)
+ {
+ try
+ {
+ //鍙嶅簭鍒楀寲浼犻�掔殑鍊�
+
+ ds = oCN.RunProcReturn("exec h_p_Sc_StationOutSumReport_New " + sWhere + "", "h_p_Sc_StationOutSumReport_New");
+
+ List<object> listCol = new List<object>();
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string str = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ listCol.Add(JsonConvert.DeserializeObject(str));
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = listCol;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj
index 95a7100..9ff0179 100644
--- a/WebAPI/WebAPI.csproj
+++ b/WebAPI/WebAPI.csproj
@@ -376,6 +376,7 @@
<Compile Include="Controllers\CJGL\Cj_ComplementGoodsBillController.cs" />
<Compile Include="Controllers\CJGL\Cj_NoPassProcController.cs" />
<Compile Include="Controllers\CJGL\Cj_SendGoodsBillController.cs" />
+ <Compile Include="Controllers\CJGL\Mes_OrderProcFlowAllReportController.cs" />
<Compile Include="Controllers\CJGL\ProductionPlanReportController.cs" />
<Compile Include="Controllers\CJGL\Sc_ProcessExchangeBillController.cs" />
<Compile Include="Controllers\CJGL\Cj_StationOutBillController.cs" />
@@ -860,6 +861,7 @@
<Folder Include="Views\KF_PonderationBill\" />
<Folder Include="Views\kf_StepFoldinBill\" />
<Folder Include="Views\Kf_StepFoldOutBill\" />
+ <Folder Include="Views\Mes_OrderProcFlowAllReport\" />
<Folder Include="Views\MoveStockBill\" />
<Folder Include="Views\ProductionPlanReport\" />
<Folder Include="Views\ProductionReturnBill\" />
--
Gitblit v1.9.1