From 5b10fd870f7ce41c53ee6b356dc9cec5ad2ea11e Mon Sep 17 00:00:00 2001 From: zrg <z18737863051@163.com> Date: 星期二, 15 四月 2025 14:51:18 +0800 Subject: [PATCH] 增加设备工艺参数订单点检保存后自动审核 根据子表NG参数发送信息,优化PDA工序流转卡页面查询 --- WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs | 230 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 215 insertions(+), 15 deletions(-) diff --git a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs index 3b43c0c..c9f22a9 100644 --- a/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs +++ b/WebAPI/Controllers/CGGL/Kf_POStockInBillController.cs @@ -90,6 +90,64 @@ } } + + #region 閲囪喘鍏ュ簱鍗曞垎椤靛垪琛� + [Route("Kf_POStockInBill/page")] + [HttpGet] + public object Kf_POStockInBillPage(string sWhere, string user, int page, int size) + { + DataSet ds; + json res = new json(); + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏉冮檺 + //if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillList", 1, false, user)) + //{ + // objJsonResult.code = CodeConstant.FAIL; + // objJsonResult.count = CountConstant.FAIL; + // objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒"; + // objJsonResult.data = null; + // return objJsonResult; + //} + + sWhere = sWhere.Replace("'", "''"); + if (sWhere == null || sWhere.Equals("")) + { + ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBillList_New " + page + "," + size + ",''", "h_p_Kf_POStockInBillList_New"); + } + else + { + ds = oCN.RunProcReturn("exec h_p_Kf_POStockInBillList_New " + page + "," + size + ",'" + sWhere + "'", "h_p_Kf_POStockInBillList_New"); + } + + //娣诲姞鍒楀悕 + 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鍒楀璞$殑鍒楀悕 + } + + res.code = CodeConstant.SUCCEED; + res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString()); + res.Message = "Sucess锛�"; + res.list = columnNameList; + res.data = ds.Tables[0]; + return res; + } + catch (Exception e) + { + res.code = CodeConstant.FAIL; + res.count = CountConstant.FAIL; + res.Message = "Exception锛�" + e.ToString(); + res.data = null; + return res; + } + } + #endregion + + #region 閲囪喘鍏ュ簱鍗� 淇濆瓨/缂栬緫鍔熻兘 [Route("Kf_POStockInBill/POStockInBillEdit")] [HttpPost] @@ -194,7 +252,7 @@ return objJsonResult; } - ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Kf_POStockInBillList"); + ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID, "h_v_Kf_POStockInBillList"); if ((OperationType == 1 || OperationType == 2 || OperationType == 4) && ds.Tables[0].Rows.Count == 0)//鏂板 { @@ -224,7 +282,7 @@ ,HAddress,HSupID,HCurID,HWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HRemark ,HInnerBillNo,HSTOCKORGID,HOWNERID,HMaker,HMakeDate,HProjectID,HInvoiceBillNo) values(" + HInterID + "," + DateTime.Now.Year + "," + DateTime.Now.Month + ",'" + 1201 + "','" + - 1201 + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + + HBillSubType + "','" + HDate + "','" + HBillNo + "','" + HBillStatus + "','" + HAddress + "'," + HSupID + "," + HCurID + "," + HWHID + "," + HEmpID + "," + HManagerID + "," + HSecManagerID + ","+ HKeeperID +"," + HDeptID + ",'" + HExplanation + "','" + HRemark + "','" + HInnerBillNo + "'," + HSTOCKORGID + "," + HOWNERID + ",'" + HMaker + "',getdate(),"+ HProjectID + ",'"+ HInvoiceBillNo + "')"; @@ -235,7 +293,7 @@ { //淇敼 DataSet dss; - dss = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID + " and 鍗曟嵁鍙�='" + HBillNo + "'", "h_v_Kf_POStockInBillList"); + dss = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid=" + HInterID , "h_v_Kf_POStockInBillList"); //鍒ゆ柇鏄惁鍙紪杈� if (dss.Tables[0].Rows[0]["瀹℃牳浜�"].ToString() != "" && dss.Tables[0].Rows[0]["瀹℃牳浜�"] != null) { @@ -255,7 +313,7 @@ } String sql = $@"update Kf_ICStockBillMain set " + - "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + + "HRemark='" + HRemark + "', HUpDater='" + HMaker + "', HUpDateDate=getdate()" + ",HBillNo='" + HBillNo + "'" + ",HSupID=" + HSupID + ",HCurID=" + HCurID + ",HSecManagerID=" + HSecManagerID + ", HSTOCKORGID=" + HSTOCKORGID + ",HKeeperID=" + HKeeperID + ",HWHID = " + HWHID + ",HEmpID=" + HEmpID + ",HManagerID=" + HManagerID + ",HDeptID=" + HDeptID + ",HOWNERID=" + HOWNERID + ",HAddress='" + HAddress + "',HInnerBillNo='" + HInnerBillNo + "',HProjectID="+ HProjectID + ",HInvoiceBillNo='"+ HInvoiceBillNo + "' where HInterID=" + HInterID; @@ -355,14 +413,14 @@ { ClsKf_ICStockBillSub oSub = (ClsKf_ICStockBillSub)list[i1]; i++; - if (oSub.HQty <= 0 || oSub.HQty == null) - { - objJsonResult.code = "0"; - objJsonResult.count = 0; - objJsonResult.Message = "绗�" + i + "琛岋紝鏁伴噺涓嶈兘涓�0鎴栬�呭皬浜�0"; - objJsonResult.data = null; - return objJsonResult; - } + //if (oSub.HQty <= 0 || oSub.HQty == null) + //{ + // objJsonResult.code = "0"; + // objJsonResult.count = 0; + // objJsonResult.Message = "绗�" + i + "琛岋紝鏁伴噺涓嶈兘涓�0鎴栬�呭皬浜�0"; + // objJsonResult.data = null; + // return objJsonResult; + //} if (oSub.HMaterID == 0) { @@ -573,7 +631,7 @@ try { - ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillList where hmainid =" + HInterID, "h_v_Kf_POStockInBillList"); + ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillEdit where hmainid =" + HInterID, "h_v_Kf_POStockInBillList"); if (ds == null || ds.Tables[0].Rows.Count == 0) { objJsonResult.code = "0"; @@ -670,7 +728,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸插叧闂�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.Message = "鍗曟嵁宸插叧闂�!"; objJsonResult.data = null; return objJsonResult; } @@ -678,7 +736,7 @@ { objJsonResult.code = "0"; objJsonResult.count = 0; - objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!涓嶈兘鍐嶆瀹℃牳锛�"; + objJsonResult.Message = "鍗曟嵁宸蹭綔搴�!"; objJsonResult.data = null; return objJsonResult; } @@ -1330,6 +1388,43 @@ } #endregion + #region 閲囪喘鍏ュ簱鍗� 鏍规嵁涓诲唴鐮佷笌瀛愬唴鐮佽幏鍙栭噰璐叆搴撳崟鏁版嵁 + [Route("Kf_POStockInBill/loadKf_POStockInBillEdit_Push")] + [HttpGet] + public object loadKf_POStockInBillEdit_Push(long HInterID, long HSubID) + { + try + { + + ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillEdit where hmainid =" + HInterID + " and hsubid = " + HSubID, "h_v_Kf_POStockInBillEdit"); + if (ds == null || ds.Tables[0].Rows.Count == 0) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鏈煡璇㈠埌婧愬崟淇℃伅锛�"; + objJsonResult.data = null; + return objJsonResult; + } + else + { + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = "Sucess锛�"; + 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("Kf_POStockInBill/RejectCheckFlow_POOrderBill")] [HttpGet] @@ -1895,5 +1990,110 @@ } #endregion + + #region 閲囪喘鍏ュ簱鍗曟煡璇㈠垪琛� + [Route("Kf_POStockInBill/QueryList")] + [HttpGet] + public object QueryList(string sWhere, string user) + { + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + + if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillQuery", 1, false, user)) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "鏃犳潈闄愭煡鐪�!"; + objJsonResult.data = null; + return objJsonResult; + } + string sql = "select * from h_v_Kf_POStockInBillQuery where 1 = 1 "; + + if (sWhere == "" || sWhere == null) + { + ds = oCN.RunProcReturn("select * from h_v_Kf_POStockInBillQuery order by hmainid desc", "h_v_Kf_POStockInBillQuery"); + } + else + { + ds = oCN.RunProcReturn(sql + sWhere + " order by hmainid desc", "h_v_Kf_POStockInBillQuery"); + } + + + + 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 = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + + #region 閲囪喘鍏ュ簱鍗曟煡璇㈠瓙鍒楄〃 + [Route("Kf_POStockInBill/QuerySubList")] + [HttpGet] + public object QuerySubList(string hmainid, string user) + { + try + { + List<object> columnNameList = new List<object>(); + //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄� + + if (!DBUtility.ClsPub.Security_Log("Kf_POStockInBillQuery", 1, false, user)) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "鏃犳潈闄愭煡鐪�!"; + objJsonResult.data = null; + return objJsonResult; + } + string sql = "select * from h_v_Kf_POStockInBillQuerySub where hmainid = " + hmainid; + + ds = oCN.RunProcReturn(sql + " order by hsubid ASC", "h_v_Kf_POStockInBillQuerySub"); + + + 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 = CodeConstant.SUCCEED; + objJsonResult.count = CountConstant.SUCCEED; + objJsonResult.Message = "Sucess锛�"; + objJsonResult.data = ds.Tables[0]; + objJsonResult.list = columnNameList; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = CodeConstant.FAIL; + objJsonResult.count = CountConstant.FAIL; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } + #endregion + } } \ No newline at end of file -- Gitblit v1.9.1