From 8560519c52cede92c33b89184f39844934c71de4 Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期一, 08 八月 2022 15:06:09 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/WebAPIController.cs |  170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 168 insertions(+), 2 deletions(-)

diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 8cdcc7a..d9c6515 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -79,6 +79,116 @@
                 return objjson;
             }
         }
+
+        [Route("Web/GetMAXNumPDA")]
+        [HttpGet]
+        public object GetMAXNumPDA(string HBillType)
+        {
+            try
+            {
+                string HBillNo = "";
+                string sErrMsg = "";
+                Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                HInterID = DBUtility.ClsPub.CreateBillID_Prod(HBillType, ref sErrMsg);
+                HBillNo = DBUtility.ClsPub.CreateBillCode_Prod(HBillType, ref sErrMsg, true);
+
+                DataSet ds;
+                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+                ds = oCN.RunProcReturn("exec h_p_IF_CheckBillIDExists_WMS  " + HInterID + ",'" + HBillNo + "'", "h_p_IF_CheckBillIDExists_WMS");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    sErrMsg = "瀛樺湪閲嶅鍗曟嵁鍐呯爜鎴栧崟鎹彿鐨勫崟鎹紝涓嶅厑璁告柊澧烇紝璇烽��鍑哄悗閲嶆柊鐧诲綍锛�";
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = sErrMsg;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0][0]) == "1")
+                {
+                    sErrMsg = "瀛樺湪閲嶅鍗曟嵁鍐呯爜鎴栧崟鎹彿鐨勫崟鎹紝涓嶅厑璁告柊澧烇紝璇烽��鍑哄悗閲嶆柊鐧诲綍锛�";
+                    objjson.code = "0";
+                    objjson.count = 0;
+                    objjson.Message = sErrMsg;
+                    objjson.data = null;
+                    return objjson;
+                }
+                else
+                {
+                    //----------鍒涘缓铏氳〃------------------------
+                    DataTable dt_Main = new DataTable("Json");
+                    dt_Main.Columns.Add("HBillNo", typeof(string));
+                    dt_Main.Columns.Add("HInterID", typeof(int));
+                    //---------鍒涘缓鏂拌------------------------
+                    DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 
+                    dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑
+                    dr_main["HBillNo"] = DBUtility.ClsPub.isStrNull(HBillNo);
+                    dr_main["HInterID"] = DBUtility.ClsPub.isLong(HInterID);
+                    //杩斿洖鏁版嵁
+                    objjson.code = "0";
+                    objjson.count = 1;
+                    objjson.Message = "鑾峰彇鎴愬姛";
+                    objjson.data = dt_Main;
+                    return objjson;
+                }
+            }
+            catch (Exception e)
+            {
+                objjson.code = "0";
+                objjson.count = 0;
+                objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+                objjson.data = null;
+                return objjson;
+            }
+        }
+
+
+        //[Route("Web/Get_MaxBillNoAndID")]
+        //[HttpGet]
+        //public object Get_MaxBillNoAndID(string HBillType)
+        //{
+        //    try
+        //    {
+        //        string HBillNo = "";
+        //        Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+        //        HInterID = DBUtility.ClsPub.CreateBillID(HBillType, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        HBillNo = DBUtility.ClsPub.CreateBillCode(HBillType, ref DBUtility.ClsPub.sExeReturnInfo, true);
+        //        //----------鍒涘缓铏氳〃------------------------
+        //        DataTable dt_Main = new DataTable("Json");
+        //        dt_Main.Columns.Add("HBillNo", typeof(string));
+        //        dt_Main.Columns.Add("HInterID", typeof(int));
+        //        //---------鍒涘缓鏂拌------------------------
+        //        DataRow dr_main = dt_Main.NewRow();//鍒涘缓鏂拌 
+        //        dt_Main.Rows.Add(dr_main);//灏嗘柊琛屽姞鍏ュ埌琛ㄤ腑
+        //        dr_main["HBillNo"] = DBUtility.ClsPub.isStrNull(HBillNo);
+        //        dr_main["HInterID"] = DBUtility.ClsPub.isLong(HInterID);
+
+        //        if (HBillNo == null || HInterID == 0)
+        //        {
+        //            objjson.code = "0";
+        //            objjson.count = 0;
+        //            objjson.Message = "鑾峰彇澶辫触";
+        //            objjson.data = null;
+        //            return objjson;
+        //        }
+        //        else
+        //        {
+        //            objjson.code = "0";
+        //            objjson.count = 1;
+        //            objjson.Message = "鑾峰彇鎴愬姛";
+        //            objjson.data = dt_Main;
+        //            return objjson;
+        //        }
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        objjson.code = "0";
+        //        objjson.count = 0;
+        //        objjson.Message = "鑾峰彇澶辫触" + e.ToString();
+        //        objjson.data = null;
+        //        return objjson;
+        //    }
+        //}
         /// <summary>
         /// 鐧诲綍
         /// </summary>
@@ -913,7 +1023,8 @@
             }
             try
             {
-                ds = webserver.GetEmployeeList(sWhere, ref DBUtility.ClsPub.sErrInfo);
+                string sql = $"Select * from h_v_IF_Emp {sWhere} Order by HNumber";
+                ds = oCN.RunProcReturn(sql, "h_v_IF_Emp");
                 if (ds == null || ds.Tables[0].Rows.Count <= 0)
                 {
                     objjson.code = "0";
@@ -3031,7 +3142,7 @@
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                 string sql = string.Format(@"select b.HDotCheckItemID HDotCheckItemID,c.HNumber HDotCheckCode,b.HDotCheckItem,b.HDotCheckPart,b.HClaim,
-                                    b.HManagerID,e.HNumber HManagerCode,e.HName HManagerName,b.HRemark from Sb_EquipDotCheckRuleBillMain  a 
+                                    b.HManagerID,e.HNumber HManagerCode,e.HName HManagerName,b.HRemark,a.HInterID,a.HBillNo from Sb_EquipDotCheckRuleBillMain  a 
 									left join Sb_EquipDotCheckRuleBillSub b on a.HInterID=b.HInterID 
                                     left join Gy_QCCheckItem c on c.HItemID=b.HDotCheckItemID
                                      left join Gy_Employee e on e.HItemID=b.HManagerID
@@ -3371,7 +3482,62 @@
         }
 
 
+        #region PDA鍏朵粬鍏ュ簱鍒楄〃妯″潡
+        /// <summary>
+        /// 鍏朵粬鍏ュ簱缂撳瓨鍒楄〃鍒锋柊淇℃伅
+        /// </summary>
+        /// <param name="HBillType"></param>
+        /// <param name="sHMaker"></param>
+        /// <param name="HOrgID"></param>
+        /// <returns></returns>
+        [Route("Web/GetOtherInBillMain_TempList_New")]
+        [HttpGet]
+        public object GetOtherInBillMain_TempList_New (string HBillType, string sHMaker, Int64 HOrgID)
+        {
+            WebS.WebService1 oWebs = new WebS.WebService1();
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                
+                DataSet ds = oCN.RunProcReturn("exec h_p_KF_GetPonderationBillMain_TempList_New1 '" + HBillType + "','" + sHMaker + "'," + HOrgID.ToString(), "h_p_KF_GetPonderationBillMain_TempList_New1");
+                
+                //娣诲姞鍒楀悕
+                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 == null || ds.Tables[0].Rows.Count <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+                    objJsonResult.data = 0;
+                    return objJsonResult;
+                    //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    objJsonResult.list = columnNameList;
+                    return objJsonResult;
+                }
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 
 }

--
Gitblit v1.9.1