From b0c660e2b4054a450ac1b7d07edf07cfd40f9099 Mon Sep 17 00:00:00 2001 From: wyb <1qaz@123> Date: 星期四, 20 五月 2021 16:40:13 +0800 Subject: [PATCH] 来料检验、首件检验、巡检新增删除逻辑编写实现 --- WebAPI/ListModels.cs | 73 ++++ WebAPI/Controllers/QC_ManagementController.cs | 780 +++++++++++++++++++++++++++++++++++++++++++++++- WebAPI/Properties/PublishProfiles/API.pubxml.user | 8 WebAPI/Service/LuBaoSevice.cs | 62 +++ 4 files changed, 903 insertions(+), 20 deletions(-) diff --git a/WebAPI/Controllers/QC_ManagementController.cs b/WebAPI/Controllers/QC_ManagementController.cs index a3e6fd1..2a8adee 100644 --- a/WebAPI/Controllers/QC_ManagementController.cs +++ b/WebAPI/Controllers/QC_ManagementController.cs @@ -147,7 +147,7 @@ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); if (sqlWhere == null || sqlWhere.Equals("")) { - ds = oCN.RunProcReturn("select top 500 * from h_v_QC_POStockInCheckBillList ", "h_v_QC_POStockInCheckBillList"); + ds = oCN.RunProcReturn("select top 500 * from h_v_QC_POStockInCheckBillList where 鍏抽棴浜�='' ", "h_v_QC_POStockInCheckBillList"); } else { @@ -237,6 +237,57 @@ return GetObjectJson(ds); } + + /// <summary> + /// 妫�楠屾柟妗堣幏鍙栦俊鎭� + /// </summary> + /// <returns></returns> + [Route("GetQCCheckProjectDetail")] + [HttpGet] + public ApiResult<DataSet> GetQCCheckProjectDetail(string HID) + { + var model = LuBaoSevice.GetCheckProjectDetail(HID); + return model; + } + + /// <summary> + /// 鏉ユ枡妫�楠屽崟鑾峰彇淇℃伅 + /// </summary> + /// <returns></returns> + [Route("GetPOStockInCheckDetail")] + [HttpGet] + public ApiResult<DataSet> GetPOStockInCheckDetail(string HID) + { + var model = LuBaoSevice.GetPOStockInCheckBillDetail(HID); + return model; + } + + /// <summary> + /// 棣栦欢妫�楠屽崟鑾峰彇淇℃伅 + /// </summary> + /// <returns></returns> + [Route("GetQC_FirstPieceCheckDetail")] + [HttpGet] + public ApiResult<DataSet> GetQC_FirstPieceCheckDetail(string HID) + { + var model = LuBaoSevice.GetQC_FirstPieceCheckBillDetail(HID); + return model; + } + + + /// <summary> + /// 宸℃鍗曡幏鍙栦俊鎭� + /// </summary> + /// <returns></returns> + [Route("GetQC_PatrolProcCheckDetail")] + [HttpGet] + public ApiResult<DataSet> GetQC_PatrolProcCheckDetail(string HID) + { + var model = LuBaoSevice.GetQC_PatrolProcCheckBillDetail(HID); + return model; + } + + /// <summary> /// 杩斿洖妫�楠屾柟妗堝崟瀛愯〃璇︽儏 /// </summary> @@ -271,6 +322,114 @@ } return GetObjectJson(ds); } + + + /// <summary> + /// 杩斿洖鏉ユ枡妫�楠屽崟瀛愯〃璇︽儏 + /// </summary> + /// <param name="sWhere"></param> + /// <returns></returns> + [Route("MES_QC_POStockInCheckDetail_Json")] + [HttpGet] + public object MES_QC_POStockInCheckDetail_Json(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_QC_Edit_POStockInCheckBillList", "h_v_QC_Edit_POStockInCheckBillList"); + } + else + { + string sql1 = "select * from h_v_QC_Edit_POStockInCheckBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_QC_Edit_POStockInCheckBillList"); + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + return GetObjectJson(ds); + } + + /// <summary> + /// 杩斿洖棣栦欢妫�楠屽崟瀛愯〃璇︽儏 + /// </summary> + /// <param name="sWhere"></param> + /// <returns></returns> + [Route("MES_QC_FirstPieceCheckDetail_Json")] + [HttpGet] + public object MES_QC_FirstPieceCheckDetail_Json(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_QC_Edit_FirstPieceCheckBillList", "h_v_QC_Edit_FirstPieceCheckBillList"); + } + else + { + string sql1 = "select * from h_v_QC_Edit_FirstPieceCheckBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_QC_Edit_FirstPieceCheckBillList"); + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + return GetObjectJson(ds); + } + + + /// <summary> + /// 杩斿洖宸℃鍗曞瓙琛ㄨ鎯� + /// </summary> + /// <param name="sWhere"></param> + /// <returns></returns> + [Route("MES_QC_PatrolProcCheckDetail_Json")] + [HttpGet] + public object MES_QC_PatrolProcCheckDetail_Json(string sqlWhere) + { + DataSet ds; + try + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (sqlWhere == null || sqlWhere.Equals("")) + { + ds = oCN.RunProcReturn("select * from h_v_QC_Edit_PatrolProcCheckBillList", "h_v_QC_Edit_PatrolProcCheckBillList"); + } + else + { + string sql1 = "select * from h_v_QC_Edit_PatrolProcCheckBillList where 1 = 1 "; + string sql = sql1 + sqlWhere; + ds = oCN.RunProcReturn(sql, "h_v_QC_Edit_PatrolProcCheckBillList"); + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + return GetObjectJson(ds); + } + #endregion @@ -351,7 +510,7 @@ oItemSub.HSourceEntryID =0; oItemSub.HSourceInterID =0; oItemSub.HEntryID = i; - oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HEntryCloseDate = Convert.ToDateTime(""); oItemSub.HCloseType = false; oItemSub.HSourceBillNo = ""; oItemSub.HSourceBillType = ""; @@ -401,20 +560,6 @@ return objJsonResult; } } - - - /// <summary> - /// 妫�楠屾柟妗堣幏鍙栦俊鎭� - /// </summary> - /// <returns></returns> - [Route("GetQCCheckProjectDetail")] - [HttpGet] - public ApiResult<DataSet> GetQCCheckProjectDetail(string HID) - { - var model = LuBaoSevice.GetCheckProjectDetail(HID); - return model; - } - /// <summary> /// 妫�楠屾柟妗堥�昏緫鍒犻櫎鍔熻兘 @@ -491,6 +636,609 @@ } + /// <summary> + /// 淇濆瓨鏉ユ枡妫�楠屽崟 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveQC_POStockInCheckList")] + [HttpPost] + public object SaveQC_POStockInCheckList([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + + + string UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsQC_POStockInCheckBill oBill = new DAL.ClsQC_POStockInCheckBill(); + List<Model.ClsQC_POStockInCheckBillMain> lsmain = new List<Model.ClsQC_POStockInCheckBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_QC_POStockInCheckBillMain(msg2); + foreach (Model.ClsQC_POStockInCheckBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HBillType = "7503"; + oItem.HBillSubType = "7503"; + oItem.HBillStatus = 0; + oItem.HPeriod = 0; + oItem.HMaker = ""; + oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Model.ClsQC_POStockInCheckBillSub> ls = new List<Model.ClsQC_POStockInCheckBillSub>(); + ls = oListModels.getObjectByJson_QC_POStockInCheckBillSub(msg3); + int i = 0; + foreach (Model.ClsQC_POStockInCheckBillSub oItemSub in ls) + { + oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級 + i++; + if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItemSub.HSourceEntryID = 0; + oItemSub.HSourceInterID = 0; + oItemSub.HEntryID = i; + // DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HEntryCloseDate = Convert.ToDateTime(""); + oItemSub.HCloseType = false; + oItemSub.HSourceBillNo = ""; + oItemSub.HSourceBillType = ""; + oItemSub.HRelationQty = 0; + oItemSub.HRelationMoney = 0; + oItemSub.HCloseMan = ""; + oItemSub.HRemark = ""; + oItemSub.HProcCheckEmp = oBill.omodel.HFirstCheckEmp;//妫�娴嬪憳 + oBill.DetailColl.Add(oItemSub); + + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.omodel.HInterID == 0) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 鏉ユ枡妫�楠岄�昏緫鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetQC_POStockInCheck")] + [HttpGet] + public object DeltetQC_POStockInCheck(string HInterID) + { + DataSet ds; + //string ModRightNameCheck = "Sc_ProcessReport_check"; + try + { + //鍒犻櫎鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain"); + DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub"); + if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + var HCloseMan = Convert.ToString(ds.Tables[0].Rows[0]["HCloseMan"]); + var HCloseMan2 = Convert.ToString(ds2.Tables[0].Rows[0]["HCloseMan"]); + if (!string.IsNullOrWhiteSpace(HCloseMan) || !string.IsNullOrWhiteSpace(HCloseMan2) ) + { + oCN.RollBack();//鍥炴粴浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE() where HInterID=" + HInterID); + oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE() where HInterID=" + HInterID); + oCN.Commit();//鎻愪氦浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "* 鍗曟嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 淇濆瓨棣栦欢妫�楠屽崟 + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveQC_FirstPieceCheckList")] + [HttpPost] + public object SaveQC_FirstPieceCheckList([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + + + string UserName = ""; + ListModels oListModels = new ListModels(); + try + { + + DAL.ClsQC_FirstPieceCheckBill oBill = new DAL.ClsQC_FirstPieceCheckBill(); + List<Model.ClsQC_FirstPieceCheckBillMain> lsmain = new List<Model.ClsQC_FirstPieceCheckBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_QC_FirstPieceCheckBillMain(msg2); + foreach (Model.ClsQC_FirstPieceCheckBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HBillType = "7505"; + oItem.HBillSubType = "7505"; + oItem.HBillStatus = 0; + oItem.HPeriod = 0; + oItem.HMaker = ""; + oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Model.ClsQC_FirstPieceCheckBillSub> ls = new List<Model.ClsQC_FirstPieceCheckBillSub>(); + ls = oListModels.getObjectByJson_QC_FirstPieceCheckBillSub(msg3); + int i = 0; + foreach (Model.ClsQC_FirstPieceCheckBillSub oItemSub in ls) + { + oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級 + i++; + if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItemSub.HSourceEntryID = 0; + oItemSub.HSourceInterID = 0; + oItemSub.HEntryID = i; + // DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HEntryCloseDate = Convert.ToDateTime(""); + oItemSub.HCloseType = false; + oItemSub.HSourceBillNo = ""; + oItemSub.HSourceBillType = ""; + oItemSub.HRelationQty = 0; + oItemSub.HRelationMoney = 0; + oItemSub.HCloseMan = ""; + oItemSub.HRemark = ""; + oBill.DetailColl.Add(oItemSub); + + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.omodel.HInterID == 0) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 棣栦欢妫�楠岄�昏緫鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetQC_FirstPieceCheck")] + [HttpGet] + public object DeltetQC_FirstPieceCheck(string HInterID) + { + DataSet ds; + //string ModRightNameCheck = "Sc_ProcessReport_check"; + try + { + //鍒犻櫎鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain"); + DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub"); + if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + var HCloseMan = Convert.ToString(ds.Tables[0].Rows[0]["HCloseMan"]); + var HCloseMan2 = Convert.ToString(ds2.Tables[0].Rows[0]["HCloseMan"]); + if (!string.IsNullOrWhiteSpace(HCloseMan) || !string.IsNullOrWhiteSpace(HCloseMan2)) + { + oCN.RollBack();//鍥炴粴浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE() where HInterID=" + HInterID); + oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE() where HInterID=" + HInterID); + oCN.Commit();//鎻愪氦浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "* 鍗曟嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + /// <summary> + /// 淇濆瓨宸℃鍗� + /// </summary> + /// <param name="msg"></param> + /// <returns></returns> + [Route("SaveQC_PatrolProcCheckList")] + [HttpPost] + public object SaveQC_PatrolProcCheckList([FromBody] JObject msg) + { + var _value = msg["msg"].ToString(); + string msg1 = _value.ToString(); + string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); + string msg2 = sArray[0].ToString(); + string msg3 = sArray[1].ToString(); + + + string UserName = ""; + ListModels oListModels = new ListModels(); + try + { + DAL.ClsQC_PatrolProcCheckBill oBill = new DAL.ClsQC_PatrolProcCheckBill(); + List<Model.ClsQC_PatrolProcCheckBillMain> lsmain = new List<Model.ClsQC_PatrolProcCheckBillMain>(); + msg2 = msg2.Replace("\\", ""); + msg2 = msg2.Replace("\n", ""); //\n + lsmain = oListModels.getObjectByJson_QC_PatrolProcCheckBillMain(msg2); + foreach (Model.ClsQC_PatrolProcCheckBillMain oItem in lsmain) + { + //oItem.HMaker = ""; + UserName = oItem.HMaker; + oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year); + oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd")); + oItem.HBillType = "7503"; + oItem.HBillSubType = "7503"; + oItem.HBillStatus = 0; + oItem.HPeriod = 0; + oItem.HMaker = ""; + oItem.HMainSourceInterID = oItem.HInterID; + + //oItem.HInterID = DBUtility.ClsPub.CreateBillID_SRMProd("1103", ref DBUtility.ClsPub.sExeReturnInfo); + if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "") + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病鏈夊崟鎹棩鏈燂紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oBill.omodel = oItem; + } + //琛ㄤ綋鏁版嵁 + //鎸� },{鏉ユ媶鍒嗘暟缁� //鍘绘帀銆愬拰銆� + msg3 = msg3.Substring(1, msg3.Length - 2); + msg3 = msg3.Replace("\\", ""); + msg3 = msg3.Replace("\n", ""); //\n + //msg2 = msg2.Replace("'", "鈥�"); + List<Model.ClsQC_PatrolProcCheckBillSub> ls = new List<Model.ClsQC_PatrolProcCheckBillSub>(); + ls = oListModels.getObjectByJson_QC_PatrolProcCheckBillSub(msg3); + int i = 0; + foreach (Model.ClsQC_PatrolProcCheckBillSub oItemSub in ls) + { + oItemSub.HBillNo_bak = oBill.omodel.HBillNo;//鍗曟嵁鍙凤紙澶囦唤锛屼互鍏嶅唴鐮佷涪澶憋紝鎵句笉鍒板搴斾富琛級 + i++; + if (string.IsNullOrWhiteSpace(oItemSub.HBillNo_bak)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛佹病澶囦唤鍗曟嵁鍙凤紝鏃犳硶淇濆瓨锛�"; + objJsonResult.data = 1; + return objJsonResult; + } + oItemSub.HSourceEntryID = 0; + oItemSub.HSourceInterID = 0; + oItemSub.HEntryID = i; + // DBUtility.ClsPub.isDate(DateTime.Now); + oItemSub.HEntryCloseDate = Convert.ToDateTime(""); + oItemSub.HCloseType = false; + oItemSub.HSourceBillNo = ""; + oItemSub.HSourceBillType = ""; + oItemSub.HRelationQty = 0; + oItemSub.HRelationMoney = 0; + oItemSub.HCloseMan = ""; + oItemSub.HRemark = ""; + oBill.DetailColl.Add(oItemSub); + + } + //淇濆瓨 + //淇濆瓨瀹屾瘯鍚庡鐞� + bool bResult; + if (oBill.omodel.HInterID == 0) + { + // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo); + } + else + { + bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo); + } + if (bResult) + { + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "淇濆瓨鎴愬姛锛�"; + //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�"); + objJsonResult.data = 1; + return objJsonResult; + } + else + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.sExeReturnInfo; + objJsonResult.data = 1; + return objJsonResult; + } + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "淇濆瓨澶辫触锛�" + e.ToString(); + objJsonResult.data = 1; + return objJsonResult; + } + } + + /// <summary> + /// 宸℃閫昏緫鍒犻櫎鍔熻兘 + /// </summary> + /// <returns></returns> + [Route("DeltetQC_PatrolProcCheck")] + [HttpGet] + public object DeltetQC_PatrolProcCheck(string HInterID) + { + DataSet ds; + //string ModRightNameCheck = "Sc_ProcessReport_check"; + try + { + //鍒犻櫎鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, true, CurUserName)) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "瀹℃牳澶辫触锛佹棤鏉冮檺锛�"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (string.IsNullOrWhiteSpace(HInterID)) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "HInterID涓虹┖锛�"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.BeginTran();//寮�濮嬩簨鍔� + ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain"); + DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub"); + if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "娌℃湁杩欎釜鍗曟嵁锛屾棤娉曞垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; ; + } + var HCloseMan = Convert.ToString(ds.Tables[0].Rows[0]["HCloseMan"]); + var HCloseMan2 = Convert.ToString(ds2.Tables[0].Rows[0]["HCloseMan"]); + if (!string.IsNullOrWhiteSpace(HCloseMan) || !string.IsNullOrWhiteSpace(HCloseMan2)) + { + oCN.RollBack();//鍥炴粴浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒"; + objJsonResult.data = null; + return objJsonResult; + } + + oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE() where HInterID=" + HInterID); + oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE() where HInterID=" + HInterID); + oCN.Commit();//鎻愪氦浜嬪姟 + objJsonResult.code = "0"; + objJsonResult.count = 1; + objJsonResult.Message = "* 鍗曟嵁鍒犻櫎鎴愬姛锛�"; + objJsonResult.data = null; + return objJsonResult; ; + + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + + #endregion diff --git a/WebAPI/ListModels.cs b/WebAPI/ListModels.cs index a47d873..fa32185 100644 --- a/WebAPI/ListModels.cs +++ b/WebAPI/ListModels.cs @@ -358,6 +358,79 @@ return list; } + /// <summary> + /// 澶勭悊鏂板鏉ユ枡妫�楠屼富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsQC_POStockInCheckBillMain> getObjectByJson_QC_POStockInCheckBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsQC_POStockInCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_POStockInCheckBillMain>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板鏉ユ枡妫�楠屽瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsQC_POStockInCheckBillSub> getObjectByJson_QC_POStockInCheckBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsQC_POStockInCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_POStockInCheckBillSub>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板棣栦欢妫�楠屼富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsQC_FirstPieceCheckBillMain> getObjectByJson_QC_FirstPieceCheckBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsQC_FirstPieceCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillMain>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板棣栦欢妫�楠屽瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsQC_FirstPieceCheckBillSub> getObjectByJson_QC_FirstPieceCheckBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsQC_FirstPieceCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(jsonString); + return list; + } + + + /// <summary> + /// 澶勭悊鏂板宸℃鍗曚富琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsQC_PatrolProcCheckBillMain> getObjectByJson_QC_PatrolProcCheckBillMain(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsQC_PatrolProcCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckBillMain>>(jsonString); + return list; + } + + /// <summary> + /// 澶勭悊鏂板宸℃鍗曞瓙琛ㄧ殑json + /// </summary> + /// <param name="jsonString"></param> + /// <returns></returns> + public List<Model.ClsQC_PatrolProcCheckBillSub> getObjectByJson_QC_PatrolProcCheckBillSub(string jsonString) + { + jsonString = "[" + jsonString.ToString() + "]"; + List<Model.ClsQC_PatrolProcCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckBillSub>>(jsonString); + return list; + } + } } \ No newline at end of file diff --git a/WebAPI/Properties/PublishProfiles/API.pubxml.user b/WebAPI/Properties/PublishProfiles/API.pubxml.user index 0e96f1a..4d15785 100644 --- a/WebAPI/Properties/PublishProfiles/API.pubxml.user +++ b/WebAPI/Properties/PublishProfiles/API.pubxml.user @@ -7,7 +7,7 @@ <PropertyGroup> <TimeStampOfAssociatedLegacyPublishXmlFile /> <_PublishTargetUrl>D:\缃戠珯鍙戝竷\鏅轰簯MESWMS\API</_PublishTargetUrl> - <History>True|2021-05-19T08:15:22.7730518Z;True|2021-05-19T16:13:03.2756422+08:00;True|2021-05-19T16:11:16.3163692+08:00;True|2021-05-19T15:31:19.7575868+08:00;True|2021-05-19T14:49:47.6104541+08:00;True|2021-05-19T10:46:17.6515193+08:00;True|2021-05-19T10:45:23.6466498+08:00;True|2021-05-18T17:19:36.9591198+08:00;True|2021-05-18T17:16:38.1513255+08:00;True|2021-05-18T10:31:35.2246444+08:00;True|2021-05-17T16:36:00.1226059+08:00;True|2021-05-17T16:31:05.1414358+08:00;True|2021-05-17T16:22:57.4215158+08:00;True|2021-05-17T16:22:52.6941933+08:00;True|2021-05-17T16:22:49.0033372+08:00;True|2021-05-17T16:18:03.8629751+08:00;True|2021-05-17T15:50:27.6196340+08:00;True|2021-05-17T13:22:15.7308548+08:00;True|2021-05-12T09:19:36.0666124+08:00;True|2021-05-12T09:17:40.0887602+08:00;True|2021-05-12T09:06:24.5508601+08:00;True|2021-05-12T08:39:56.6657894+08:00;True|2021-05-11T17:42:28.6508833+08:00;True|2021-05-11T15:22:03.4937062+08:00;True|2021-05-10T16:45:56.1282466+08:00;True|2021-05-08T19:04:07.1084339+08:00;True|2021-05-08T18:04:40.2166839+08:00;True|2021-05-08T18:04:32.5635574+08:00;True|2021-05-08T18:01:24.5206432+08:00;True|2021-05-08T17:38:05.5582200+08:00;True|2021-05-08T15:26:55.2861241+08:00;True|2021-05-08T14:52:13.1682476+08:00;True|2021-05-08T14:50:30.5356438+08:00;True|2021-05-08T14:38:40.3445313+08:00;True|2021-05-08T14:38:37.9504757+08:00;True|2021-05-08T14:30:31.9762236+08:00;True|2021-05-08T14:21:37.4496495+08:00;True|2021-05-07T20:47:46.1401919+08:00;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History> + <History>True|2021-05-20T07:58:09.0123323Z;True|2021-05-20T15:54:54.6251445+08:00;True|2021-05-20T15:32:04.9783034+08:00;True|2021-05-20T15:31:58.9418248+08:00;True|2021-05-20T15:31:53.2904235+08:00;True|2021-05-20T15:31:48.5385850+08:00;True|2021-05-20T13:31:35.5777988+08:00;True|2021-05-20T10:46:01.6559203+08:00;True|2021-05-20T10:40:53.2131788+08:00;True|2021-05-20T08:58:49.3511837+08:00;True|2021-05-19T16:15:22.7730518+08:00;True|2021-05-19T16:13:03.2756422+08:00;True|2021-05-19T16:11:16.3163692+08:00;True|2021-05-19T15:31:19.7575868+08:00;True|2021-05-19T14:49:47.6104541+08:00;True|2021-05-19T10:46:17.6515193+08:00;True|2021-05-19T10:45:23.6466498+08:00;True|2021-05-18T17:19:36.9591198+08:00;True|2021-05-18T17:16:38.1513255+08:00;True|2021-05-18T10:31:35.2246444+08:00;True|2021-05-17T16:36:00.1226059+08:00;True|2021-05-17T16:31:05.1414358+08:00;True|2021-05-17T16:22:57.4215158+08:00;True|2021-05-17T16:22:52.6941933+08:00;True|2021-05-17T16:22:49.0033372+08:00;True|2021-05-17T16:18:03.8629751+08:00;True|2021-05-17T15:50:27.6196340+08:00;True|2021-05-17T13:22:15.7308548+08:00;True|2021-05-12T09:19:36.0666124+08:00;True|2021-05-12T09:17:40.0887602+08:00;True|2021-05-12T09:06:24.5508601+08:00;True|2021-05-12T08:39:56.6657894+08:00;True|2021-05-11T17:42:28.6508833+08:00;True|2021-05-11T15:22:03.4937062+08:00;True|2021-05-10T16:45:56.1282466+08:00;True|2021-05-08T19:04:07.1084339+08:00;True|2021-05-08T18:04:40.2166839+08:00;True|2021-05-08T18:04:32.5635574+08:00;True|2021-05-08T18:01:24.5206432+08:00;True|2021-05-08T17:38:05.5582200+08:00;True|2021-05-08T15:26:55.2861241+08:00;True|2021-05-08T14:52:13.1682476+08:00;True|2021-05-08T14:50:30.5356438+08:00;True|2021-05-08T14:38:40.3445313+08:00;True|2021-05-08T14:38:37.9504757+08:00;True|2021-05-08T14:30:31.9762236+08:00;True|2021-05-08T14:21:37.4496495+08:00;True|2021-05-07T20:47:46.1401919+08:00;True|2021-05-07T20:31:45.7777162+08:00;True|2021-05-07T20:31:35.2882424+08:00;True|2021-05-07T20:31:21.5616729+08:00;False|2021-05-07T20:29:33.8855457+08:00;False|2021-05-07T20:28:43.1845420+08:00;False|2021-05-07T20:28:13.1335411+08:00;True|2021-05-07T20:10:01.7346568+08:00;True|2021-05-07T20:03:17.0005596+08:00;True|2021-05-07T09:05:04.3102029+08:00;True|2021-05-06T18:11:36.9078607+08:00;True|2021-05-06T18:08:40.5403791+08:00;True|2021-05-06T18:07:04.1929681+08:00;True|2021-05-06T18:06:54.5987264+08:00;True|2021-05-06T18:05:46.1791578+08:00;True|2021-05-06T17:18:58.8131464+08:00;True|2021-05-06T17:18:37.9969968+08:00;True|2021-05-06T14:47:33.5704679+08:00;True|2021-05-06T10:03:28.7226576+08:00;True|2021-04-28T10:18:54.1336497+08:00;True|2021-04-27T16:34:19.0789205+08:00;True|2021-04-27T14:48:28.8138232+08:00;True|2021-04-27T10:34:03.6370089+08:00;True|2021-04-26T16:18:32.0260755+08:00;True|2021-04-26T15:00:58.6773071+08:00;True|2021-04-26T13:23:50.3968646+08:00;True|2021-04-16T08:50:41.5499248+08:00;True|2021-04-16T08:32:59.1701708+08:00;True|2021-04-16T08:27:36.9176335+08:00;True|2021-04-15T15:56:26.8485667+08:00;True|2021-04-15T15:21:23.2875671+08:00;True|2021-04-15T14:41:16.9980034+08:00;True|2021-04-15T14:36:34.8570017+08:00;True|2021-04-13T16:15:00.7668503+08:00;</History> </PropertyGroup> <ItemGroup> <File Include="apiapp.json"> @@ -171,10 +171,10 @@ <publishTime>11/24/2014 11:18:48</publishTime> </File> <File Include="bin/WebAPI.dll"> - <publishTime>05/19/2021 16:12:58</publishTime> + <publishTime>05/20/2021 15:58:01</publishTime> </File> <File Include="bin/WebAPI.pdb"> - <publishTime>05/19/2021 16:12:58</publishTime> + <publishTime>05/20/2021 15:58:01</publishTime> </File> <File Include="bin/WebAPI.XmlSerializers.dll"> <publishTime>02/04/2021 21:35:21</publishTime> @@ -351,7 +351,7 @@ <publishTime>05/17/2021 18:30:17</publishTime> </File> <File Include="Web.config"> - <publishTime>05/19/2021 16:13:02</publishTime> + <publishTime>05/20/2021 15:58:08</publishTime> </File> </ItemGroup> </Project> \ No newline at end of file diff --git a/WebAPI/Service/LuBaoSevice.cs b/WebAPI/Service/LuBaoSevice.cs index 2ad6f07..2be8d64 100644 --- a/WebAPI/Service/LuBaoSevice.cs +++ b/WebAPI/Service/LuBaoSevice.cs @@ -113,5 +113,67 @@ return dataSet; } + + /// <summary> + /// 鏉ユ枡妫�楠屾牴鎹甶d鑾峰彇淇℃伅 + /// </summary> + public static ApiResult<DataSet> GetPOStockInCheckBillDetail(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + var dataSet = GetPOStockInDb(HID); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄦ潵鏂欐楠屽崟鍙�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + + public static DataSet GetPOStockInDb(string HID) + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_Edit_POStockInCheckBillList where hmainid= " + HID + " ", "h_v_QC_Edit_POStockInCheckBillList"); + return dataSet; + } + + + /// <summary> + /// 棣栨枡妫�楠屾牴鎹甶d鑾峰彇淇℃伅 + /// </summary> + public static ApiResult<DataSet> GetQC_FirstPieceCheckBillDetail(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + var dataSet = GetFirstPieceCheckDb(HID); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄩ鏂欐楠屽崟鍙�" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + + public static DataSet GetFirstPieceCheckDb(string HID) + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_Edit_FirstPieceCheckBillList where hmainid= " + HID + " ", "h_v_QC_Edit_FirstPieceCheckBillList"); + return dataSet; + } + + /// <summary> + /// 宸℃鍗曟牴鎹甶d鑾峰彇淇℃伅 + /// </summary> + public static ApiResult<DataSet> GetQC_PatrolProcCheckBillDetail(string HID) + { + if (string.IsNullOrEmpty(HID)) + return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" }; + var dataSet = GetPatrolProcCheckDb(HID); + if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) + return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄥ贰妫�鍗曞彿" }; + return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet }; + } + + public static DataSet GetPatrolProcCheckDb(string HID) + { + SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + var dataSet = oCN.RunProcReturn("select top 1 * from h_v_QC_Edit_PatrolProcCheckBillList where hmainid= " + HID + " ", "h_v_QC_Edit_PatrolProcCheckBillList"); + return dataSet; + } + } } \ No newline at end of file -- Gitblit v1.9.1