From 7a01f43d91c2e7e1d3ab099c7a6f0152c6abdecd Mon Sep 17 00:00:00 2001
From: pzy <2829717936@qq.com>
Date: 星期五, 04 十月 2024 08:48:14 +0800
Subject: [PATCH] 11

---
 WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckBillController.cs |  441 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 411 insertions(+), 30 deletions(-)

diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs"
index a637901..ff441d1 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_DotCheckBillController.cs"
@@ -1,4 +1,5 @@
 锘縰sing DBUtility;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -8,7 +9,9 @@
 using System.Net.Http;
 using System.Web.Http;
 using WebAPI.Models;
-
+using System.Web;
+using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
+using System.IO;
 
 namespace WebAPI.Controllers.鍩虹璧勬枡.鍩虹璧勬枡
 {
@@ -29,6 +32,7 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();
                 if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck", 1, false, user))
                 {
                     objJsonResult.code = "0";
@@ -37,23 +41,33 @@
                     objJsonResult.data = null;
                     return objJsonResult;
                 }
-                ds = oCN.RunProcReturn("select HItemID,HNumber,HName,HLevel, case when HEndFlag<>0 then 'Y'else ' 'end HEndFlag,case when HStopFlag <> 0 then 'Y'else ' 'end HStopFlag, HRemark, HUseFlag from Gy_DotCheck where 1=1 " + sWhere, "Gy_DotCheck");
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckList where 1=1 " + sWhere+ " order by HItemID", "h_v_Gy_DotCheckList");
+
+                //娣诲姞鍒楀悕
+                foreach (DataColumn col in ds.Tables[0].Columns)
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏃犱繚鍏婚」鐩暟鎹紒";
-                    objJsonResult.data = null;
-                    return objJsonResult;
+                    Type dataType = col.DataType;
+                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
-                else
-                {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "鏌ユ壘鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
-                }
+
+                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
+                //{
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                objJsonResult.list = columnNameList;
+                return objJsonResult;
+                //}
+                //else
+                //{
+                //objJsonResult.code = "0";
+                //objJsonResult.count = 0;
+                //objJsonResult.Message = "鏃犳暟鎹�";
+                //objJsonResult.data = null;
+                //return objJsonResult;
+                //}
             }
             catch (Exception e)
             {
@@ -120,7 +134,7 @@
         {
             try
             {
-                ds = oCN.RunProcReturn("select * from Gy_DotCheck where HItemID=" + HInterID, "Gy_DotCheck");
+                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheck_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheck_Edit");
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -158,7 +172,7 @@
                 msg2 = "[" + msg2.ToString() + "]";
                 List<Models.ClsGy_DotCheck> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Models.ClsGy_DotCheck>>(msg2);
 
-                long HItemID = int.Parse(msg3);
+                long HItemID = int.Parse(msg4);
                 string HNumber = list[0].HNumber;
                 string HName = list[0].HName;
                 string HShortNumber = list[0].HNumber;
@@ -166,9 +180,10 @@
                 string HRemark = list[0].HRemark;
                 bool HStopflag = list[0].HStopflag;
                 string HUseFlag = list[0].HUseFlag;
+                Int64 HDotCheckItemClassID = list[0].HDotCheckItemClassID;
 
                 //鍒ゆ柇鏉冮檺
-                if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg4))
+                if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
                 {
                     objJsonResult.code = "0";
                     objJsonResult.count = 0;
@@ -187,14 +202,14 @@
                     return objJsonResult;
                 }
 
-                if (oDept.HavSameNumber(HItemID, HNumber))
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "浠g爜閲嶅锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
+                //if (oDept.HavSameNumber(HItemID, HNumber))
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "浠g爜閲嶅锛�";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
 
 
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
@@ -206,6 +221,7 @@
                     ",HShortNumber='" + HShortNumber + "'" +
                     ",HHelpCode='" + HHelpCode + "'" +
                     ",HStopflag='" + HStopflag + "'" +
+                    ",HDotCheckItemClassID=" + HDotCheckItemClassID +                     
                     ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼瀛愰」鐩唬鐮�
                 //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
@@ -256,7 +272,7 @@
                 bool HStopflag = list[0].HStopflag;
                 string HUseFlag = list[0].HUseFlag;
                 bool HEndFlag = list[0].HEndFlag;
-
+                Int64 HDotCheckItemClassID = list[0].HDotCheckItemClassID;
                 //鍒ゆ柇鏉冮檺
                 if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
                 {
@@ -283,9 +299,9 @@
                 //涓昏〃
                 oCN.RunProc("Insert into Gy_DotCheck " +
                    " (HNumber,HName,HHelpCode,HShortNumber" +
-                   ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime) " +
+                   ",HLevel,HEndFlag,HStopflag,HRemark,HParentID,HDotCheckItemClassID ) " +
                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," +
-                    +HLevel + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',getdate())", ref DBUtility.ClsPub.sExeReturnInfo);
+                    +HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',0," + HDotCheckItemClassID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                 //淇敼涓婄骇涓洪潪鏈骇浠g爜
                 //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                 oCN.Commit();
@@ -306,5 +322,370 @@
             }
         }
         #endregion
+
+        #region 鐐规椤圭洰鍒楄〃 鏍戠姸鍥� 鐐瑰嚮鍒嗙被鏌ヨ
+        public class TreeModel
+        {
+            public string id { get; set; }
+            public string title { get; set; }
+            public List<TreeModel> children = new List<TreeModel>();
+        }
+        [Route("Gy_DotCheckBill/TreeGetList")]
+        [HttpGet]
+        public object TreeGetList(string sWhere, string user)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select HItemID,HNumber,HName from gy_DotCheckItemClass", "gy_DotCheckItemClass");
+
+                List<TreeModel> treeModels = new List<TreeModel>();
+                TreeModel first = new TreeModel();
+                first.id = "0";
+                first.title = "鐐规椤圭洰鍒嗙被璁剧疆";
+                treeModels.Add(first);
+
+                foreach (DataRow row in ds.Tables[0].Rows)
+                {
+                    var strLen = row["hitemid"].ToString().Split('.');
+                    if (strLen.Length == 1)
+                    {
+                        TreeModel tree = new TreeModel();
+                        tree.id = row["HItemID"].ToString();
+                        tree.title = row["HName"].ToString();
+                        treeModels[0].children.Add(tree);
+                    }
+                }
+                digui(ds.Tables[0], treeModels[0].children, 2);
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = Newtonsoft.Json.JsonConvert.SerializeObject(treeModels);
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        /// <summary>
+        /// 閫掑綊鍑芥暟
+        /// </summary>
+        public void digui(DataTable dt, List<TreeModel> tree, int num)
+        {
+            for (int m = 0; m < tree.Count; m++)
+            {
+                tree[m].children = new List<TreeModel>();
+                for (int i = 0; i < dt.Rows.Count; i++)//绗竴娆″惊鐜紝寰楀埌鎵�鏈夋牴鑺傜偣鐨勫瓙闆�
+                {
+                    var strLen = dt.Rows[i]["HNumber"].ToString().Split('.');
+                    if (strLen.Length == num && dt.Rows[i]["HNumber"].ToString().Contains(tree[m].id + "."))
+                    {
+                        TreeModel tbjson = new TreeModel();
+                        tbjson.id = dt.Rows[i]["HItemID"].ToString();
+                        tbjson.title = dt.Rows[i]["HName"].ToString();
+                        tree[m].children.Add(tbjson);
+                    }
+                }
+                var strLens = tree[m].id.Split('.');
+                for (int i = 0; i < tree[m].children.Count; i++)
+                {
+                    digui(dt, tree[m].children, strLens.Length + 2);//鍐嶆鐢ㄥ瓙闆嗗幓寰幆锛屾嬁鍑哄瓙闆嗙殑瀛愰泦
+                }
+            }
+
+        }
+        #endregion
+
+        #region 鐐规椤圭洰鏂囦欢涓婁紶
+        [Route("Gy_DotCheck/Gy_DotCheck_Excel")]
+        [HttpPost]
+        public object Gy_DotCheck_Excel()
+        {
+            try
+            {
+                //鑾峰彇鏂囦欢鍚嶇О
+                var file = HttpContext.Current.Request.Files[0];
+                //鑾峰彇鏂囦欢鐗╃悊璺緞
+                string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+                //淇濆瓨鏂囦欢
+                file.SaveAs(ExcelPath);
+
+                NpoiHelper np = new NpoiHelper();
+                DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+
+                //鍒犻櫎鏂囦欢
+                File.Delete(ExcelPath);
+
+                //鍒涘缓涓存椂琛�
+                DataTable tb2 = new DataTable("dt2");
+
+                //娣诲姞鍒楀悕
+                for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
+                {
+                    tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString());
+                }
+
+                //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
+                tb2.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
+                tb2.Columns.Add("HDotCheckItemClassID", typeof(Int32));//鐐规椤圭洰鍒嗙被ID
+
+                //娣诲姞鏁版嵁
+                for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
+                {
+                    DataRow row = tb2.NewRow();
+                    for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++)
+                    {
+                        row[j] = ExcelDs.Tables[0].Rows[i][j].ToString();
+                    }
+                    tb2.Rows.Add(row);
+                }
+
+
+                var error = "";
+
+                //鏌ヨ宸ヤ綔涓績娌℃湁鐨勫垪
+                if (!tb2.Columns.Contains("缁勭粐浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愮粍缁囦唬鐮併�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("缁勭粐鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愮粍缁囧悕绉般�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鐐规椤圭洰浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰浠g爜銆戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鐐规椤圭洰鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍚嶇О銆戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鐐规椤圭洰鍒嗙被浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍒嗙被浠g爜銆戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鐐规椤圭洰鍒嗙被鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愮偣妫�椤圭洰鍒嗙被鍚嶇О銆戠殑鏍囬,";
+
+
+                if (error.Length > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = $"Excel妯℃澘瀛樺湪閿欒,{error}\r\n";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                for (int i = 0; i <= tb2.Rows.Count - 1; i++)
+                {
+
+                    string HORGNumber = "";
+                    string HORGName = "";
+                    string HDotCheckNum = "";
+                    string HDotCheckName = "";
+                    string HDotCheckItemClassNum = "";
+                    string HDotCheckItemClassName = "";
+
+                    HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐浠g爜"].ToString());
+                    HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐鍚嶇О"].ToString());
+                    HDotCheckNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰浠g爜"].ToString());
+                    HDotCheckName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍚嶇О"].ToString());
+                    HDotCheckItemClassNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍒嗙被浠g爜"].ToString());
+                    HDotCheckItemClassName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐐规椤圭洰鍒嗙被鍚嶇О"].ToString());
+
+                    //妫�鏌ョ粍缁�
+                    int index = i + 1;
+
+                    if (HORGNumber != "")
+                    {
+
+
+                        //鏌ヨ缁勭粐
+                        ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where  HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,缁勭粐涓嶅瓨鍦紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                        }
+                        string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
+
+
+                        //鏌ヨ鐐规椤圭洰鍒嗙被
+                        ds = oCN.RunProcReturn("select * from Gy_DotCheckItemClass where  HNumber='" + HDotCheckItemClassNum + "'  and HUSEORGID=" + HORGid + "", "Gy_Department");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鐐规椤圭洰鍒嗙被:" + HDotCheckItemClassName + ",涓嶅瓨鍦紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            tb2.Rows[i]["HDotCheckItemClassID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                        }
+
+                        //鐐规椤圭洰鍚嶇О
+                        if (HDotCheckName == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,鐐规椤圭洰鍚嶇О涓嶈兘涓虹┖锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        //鐐规椤圭洰浠g爜
+                        if (HDotCheckNum == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,鐐规椤圭洰浠g爜涓嶈兘涓虹┖锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    else
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "绗�" + index + "琛�,缁勭粐浠g爜涓虹┖";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = error;
+                objJsonResult.data = tb2;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐐规椤圭洰 瀵煎叆(淇濆瓨)
+        [Route("Gy_DotCheck/Gy_DotCheck_btnSave")]
+        [HttpPost]
+        public object Gy_DotCheck_btnSave([FromBody] JObject sMainSub)
+        {
+            var _value = sMainSub["sMainSub"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { "&鍜�" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string user = sArray[1].ToString();
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2);
+                List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
+
+                foreach (JObject item in Excel)
+                {
+                    Dictionary<string, string> dic = new Dictionary<string, string>();
+                    foreach (var itm in item.Properties())
+                    {
+                        dic.Add(itm.Name, itm.Value.ToString());
+                    }
+                    list.Add(dic);
+                }
+
+                oCN.BeginTran();
+                int i = 1;
+                foreach (Dictionary<string, string> item in list)
+                {
+                    string HOrgID = item["HOrgID"].ToString();//缁勭粐ID
+                    string HDotCheckItemClassID = item["HDotCheckItemClassID"].ToString();//鐐规椤圭洰鍒嗙被ID
+                    string HDotCheckItemClassName = item["鐐规椤圭洰鍒嗙被浠g爜"].ToString();
+                    string HDotCheckItemClassNum = item["鐐规椤圭洰鍒嗙被鍚嶇О"].ToString();
+                    string HDotCheckName = item["鐐规椤圭洰鍚嶇О"].ToString();
+                    string HDotCheckNum = item["鐐规椤圭洰浠g爜"].ToString();
+                    string sShortNumber;
+                    sShortNumber = DBUtility.ClsPub.GetShortNumber(HDotCheckNum);//鐭唬鐮�
+                    if (sShortNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    int HEndFlag = 1;//鏈骇鏍囧織
+                    int HLevel = DBUtility.ClsPub.GetLevel(HDotCheckNum); //绛夌骇
+
+
+                    if (!DBUtility.ClsPub.AllowNumber(HDotCheckNum.Trim()))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
+                    ds = oCN.RunProcReturn("select * from Gy_DotCheck where HNumber='" + HDotCheckNum + "'", "Gy_DotCheck");
+
+                    if (ds.Tables[0].Rows.Count == 0)
+                    {
+
+                        string sql = "insert into Gy_DotCheck(HName,HNumber,HDotCheckItemClassID,HUSEORGID,HCREATEORGID,HShortNumber,HEndFlag,HLevel,HParentID,HStopflag,HRemark,HHelpCode)" +
+                            $"values('{HDotCheckName}', '{HDotCheckNum}',{HDotCheckItemClassID}, {HOrgID},{HOrgID}, '{sShortNumber}', {HEndFlag},{HLevel},0,0,'','')";
+                        oCN.RunProc(sql);
+                    }
+                    else
+                    {
+                        oCN.RunProc("	update  Gy_DotCheck set HDotCheckItemClassID=" + HDotCheckItemClassID + "  where HNumber='" + HDotCheckNum + "'");
+                    }
+
+                    i++;
+                }
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "瀵煎叆鎴愬姛!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                LogService.Write(e);
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }

--
Gitblit v1.9.1