From 20e6f29016199909dde41fd4ec5957dea8033df3 Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期一, 08 四月 2024 17:24:22 +0800 Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API --- WebAPI/Controllers/SCGL/Sc_CurrentTicketController.cs | 75 ++++++++++++++++++ WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs | 30 ++++++- WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs | 51 ++++++++++++ WebAPI/WebAPI.csproj | 1 WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs | 51 ++++++++++++ 5 files changed, 203 insertions(+), 5 deletions(-) diff --git a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs index 5545e83..3160d31 100644 --- a/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs +++ b/WebAPI/Controllers/SBGL/Sb_EquipDotCheckBillController.cs @@ -15,7 +15,8 @@ public DBUtility.ClsPub.Enum_BillStatus BillStatus;//鍗曟嵁鐘舵�侊紙鏂板锛屼慨鏀癸紝娴忚锛屾洿鏂板崟浠凤紝鍙樻洿锛� SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); public DAL.ClsSb_EquipDotCheckBill BillNew = new DAL.ClsSb_EquipDotCheckBill(); //瀵瑰簲鍗曟嵁绫� - public DAL.ClsSb_EquipDotCheckBill BillOld = new DAL.ClsSb_EquipDotCheckBill(); //瀵瑰簲鍗曟嵁绫� + public DAL.ClsSb_EquipDotCheckBill BillOld = new DAL.ClsSb_EquipDotCheckBill(); //瀵瑰簲鍗曟嵁绫� + Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); //鑾峰彇绯荤粺鍙傛暟 #region 璁惧鐐规璁板綍琛� @@ -38,15 +39,34 @@ objJsonResult.data = null; return objJsonResult; } - if (sWhere == null || sWhere.Equals("")) + + string sReturn = ""; + string HViewName = "h_v_Sb_EquipDotCheckBillList";//瑙嗗浘鍛藉悕 + if (oSystemParameter.ShowBill(ref sReturn) == true) { - ds = oCN.RunProcReturn("select * from h_v_Sb_EquipDotCheckBillList " + sWhere + " order by hmainid desc", "h_v_Sb_EquipDotCheckBillList"); + if (oSystemParameter.omodel.WMS_CampanyName == "涔濊彵") + { + HViewName = "h_v_Sb_EquipDotCheckBillMainList"; + } } else { - string sql1 = "select * from h_v_Sb_EquipDotCheckBillList where 1 = 1"; + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁璇诲彇澶辫触锛�"; + objJsonResult.data = null; + return objJsonResult; + } + + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from " + HViewName + " " + sWhere + " order by hmainid desc", HViewName); + } + else + { + string sql1 = "select * from " + HViewName + " " + " where 1 = 1"; string sql = sql1 + sWhere + " order by hmainid desc"; - ds = oCN.RunProcReturn(sql, "h_v_Sb_EquipDotCheckBillList"); + ds = oCN.RunProcReturn(sql, HViewName); } //娣诲姞鍒楀悕 foreach (DataColumn col in ds.Tables[0].Columns) diff --git a/WebAPI/Controllers/SCGL/Sc_CurrentTicketController.cs b/WebAPI/Controllers/SCGL/Sc_CurrentTicketController.cs new file mode 100644 index 0000000..7b027c3 --- /dev/null +++ b/WebAPI/Controllers/SCGL/Sc_CurrentTicketController.cs @@ -0,0 +1,75 @@ +锘縰sing 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.SCGL +{ + public class Sc_CurrentTicketController : ApiController + { + private json objJsonResult = new json(); + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + DataSet ds; + + + #region 鎶ュ伐鍙板綋鍓嶅伐鍗曚俊鎭� + /// <summary> + /// 杩斿洖鎴戠殑宸ュ崟鍒楄〃 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Sc_CurrentTicket/list")] + [HttpGet] + public object list(Int64 HSourceID, Int64 HICMOInterID, Int64 HICMOEntryID, Int64 HSourceInterID, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + ds = oCN.RunProcReturn("exec h_p_JIT_GetCurrentTicketInfo " + HSourceID + "," + HICMOInterID + "," + HICMOEntryID + "," + HSourceInterID, "h_p_JIT_GetCurrentTicketInfo"); + + if (ds.Tables[0].Rows.Count != 0 || ds != null) + { + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds; + objJsonResult.list = columnNameList; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏃犳暟鎹�"; + objJsonResult.data = null; + return objJsonResult; + } + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + } +} diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" index 53ed01b..b960379 100644 --- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" +++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\345\267\245\345\272\217\346\243\200\351\252\214\345\215\225/QC_ProcessCheckBillController.cs" @@ -126,6 +126,57 @@ } #endregion + #region 宸ュ簭妫�楠屽崟鍒楄〃2 鍙幏鍙栬〃澶存暟鎹紝涓嶅彇鏄庣粏琛屼俊鎭� + [Route("QC_ProcessCheckMainBill/QC_ProcessCheckMainBillList")] + [HttpGet] + public object QC_ProcessCheckMainBillList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql1 = "select * from h_v_QC_ProcessCheckBillMainList where 1 = 1 "; + string sql = sql1 + sWhere + " order by hmainid desc"; + ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillMainList"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 宸ュ簭妫�楠屽崟 瀹℃牳 鍙嶅鏍� 鍏抽棴 鍙嶅叧闂� 浣滃簾 鍙嶄綔搴� /// <summary> diff --git "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" index 897351f..e39b759 100644 --- "a/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" +++ "b/WebAPI/Controllers/\345\223\201\350\264\250\347\256\241\347\220\206/\351\246\226\344\273\266\346\243\200\351\252\214\345\215\225/QC_FirstPieceCheckBillController.cs" @@ -75,6 +75,57 @@ } #endregion + #region 棣栦欢妫�楠屽崟鍒楄〃2 鍙幏鍙栬〃澶存暟鎹紝涓嶅彇鏄庣粏琛屼俊鎭� + [Route("QC_FirstPieceCheckBillMain/QC_FirstPieceCheckBillMainList")] + [HttpGet] + public object QC_FirstPieceCheckBillMainList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + + string sql1 = "select * from h_v_QC_FirstPieceCheckBillMainList where 1 = 1 "; + string sql = sql1 + sWhere + " order by hmainid desc"; + ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillMainList"); + + //娣诲姞鍒楀悕 + foreach (DataColumn col in ds.Tables[0].Columns) + { + Type dataType = col.DataType; + string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; + columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕 + } + + if (ds.Tables[0].Rows.Count > 0) + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁鏌ヨ鍒版暟鎹�"; + objJsonResult.list = columnNameList; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + #region 棣栦欢妫�楠屽崟淇濆瓨 [Route("QC_FirstPieceCheckBill/set_SaveBill")] [HttpPost] diff --git a/WebAPI/WebAPI.csproj b/WebAPI/WebAPI.csproj index a015743..5d0f245 100644 --- a/WebAPI/WebAPI.csproj +++ b/WebAPI/WebAPI.csproj @@ -429,6 +429,7 @@ <Compile Include="Controllers\SBGL\Sb_EquipStockInCheckBillSController.cs" /> <Compile Include="Controllers\SCGL\Gy_SourceWorkStationSetController.cs" /> <Compile Include="Controllers\SCGL\Sc_ComplementGoodBill_ZXBZController.cs" /> + <Compile Include="Controllers\SCGL\Sc_CurrentTicketController.cs" /> <Compile Include="Controllers\SCGL\Sc_ICMOBillWorkQtyStatus_TmpController.cs" /> <Compile Include="Controllers\SCGL\Sc_ICMOChangeBillController.cs" /> <Compile Include="Controllers\SCGL\Sc_MyTicketController.cs" /> -- Gitblit v1.9.1