From 24873c2f9871a578635b8ca492f8af86e657e4a8 Mon Sep 17 00:00:00 2001
From: ch <37327@LLOOCCY>
Date: 星期一, 01 十一月 2021 10:23:01 +0800
Subject: [PATCH] nothing

---
 LMES/bin/x86/Debug.zip                                   |    0 
 WebAPI/Models/Gy_OrderBackInfo.cs                        |   27 
 WebAPI/WebAPI.csproj.user                                |    2 
 DAL/计划管理/ClsGy_RoutingBill.cs                            |   11 
 WebAPI/Controllers/BaseSet/Gy_WorkPayTypeController.cs   |  366 ++++++++++++
 WebAPI/Controllers/BaseSet/Gy_OrderLevController.cs      |  427 ++++++++++++++
 WarM/条码打印/Gy_BarCodeBill.cs                              |   33 +
 WebAPI/Models/Gy_OrderLevList.cs                         |   28 
 WebAPI/Models/Gy_WorkType.cs                             |   28 
 WebAPI/Controllers/BaseSet/Gy_OrderBackInfoController.cs |  368 ++++++++++++
 WarM/条码打印/Gy_BarCodeBill.designer.cs                     |   70 +
 WarM/条码打印/Gy_BarCodeBill.resx                            |   10 
 WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs     |   22 
 WebAPI/Models/Gy_WorkPayType.cs                          |   26 
 WebAPI/Controllers/BaseSet/Gy_WorkTypeController.cs      |  371 ++++++++++++
 15 files changed, 1,749 insertions(+), 40 deletions(-)

diff --git "a/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs" "b/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs"
index cdf3d91..112b96d 100644
--- "a/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs"
+++ "b/DAL/\350\256\241\345\210\222\347\256\241\347\220\206/ClsGy_RoutingBill.cs"
@@ -38,8 +38,8 @@
                 oCn.BeginTran();
                 //鏇存柊涓昏〃
                 oCn.RunProc("UpDate Gy_RoutingBillMain set  " +
-                ",HPRDORGID=" + omodel.HPRDORGID.ToString() +
-                " HName='" + omodel.HName + "'" +
+                " HPRDORGID=" + omodel.HPRDORGID.ToString() +
+                ",HName='" + omodel.HName + "'" +
                 ",HBillNo='" + omodel.HBillNo + "'" +
                 ",HMaterTypeID=" + omodel.HMaterTypeID.ToString() +
                 ",HMaterID=" + omodel.HMaterID.ToString() +
@@ -143,6 +143,7 @@
         {
             try
             {
+                string orgid = DBUtility.ClsPub.HOrgID.ToString();
                 //寰楀埌mainid
                 omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                 //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
@@ -201,14 +202,14 @@
                 ",HRoutingGroupID,HUnitID,HMaterNumber,HUnitNumber,HStandard" +
                 ",HMainGroupID,HMainProcID,HMainCenterID,HMainTimeUnit,HMainUnitTime,HMainWorkQty" +
                 ",HMainPrice,HStdSourceQty,HAddSourceRate,HDelSourceRate" +
-                ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HPRDORGID,HVerNum,HOrgID" +
+                ",HPicNumVer,HPicNumAssemble,HMaterTexture,HProductNum,HPRDORGID,HVerNum" +
                 ") " +
                 " values('" + this.BillType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" +
                 "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()," + omodel.HMaterID.ToString() + ",'" + omodel.HName + "'," + omodel.HMaterTypeID.ToString() +
                 ",'" + omodel.HRoutingGroupID.ToString() + "'," + omodel.HUnitID.ToString() + ",'" + omodel.HMaterNumber + "','" + omodel.HUnitNumber + "'," + DBUtility.ClsPub.BoolToString(omodel.HStandard) +
                 "," + omodel.HMainGroupID.ToString() + "," + omodel.HMainProcID.ToString() + "," + omodel.HMainCenterID.ToString() + ",'" + omodel.HMainTimeUnit + "'," + omodel.HMainUnitTime.ToString() + "," + omodel.HMainWorkQty.ToString() +
                 "," + omodel.HMainPrice.ToString() + "," + omodel.HStdSourceQty.ToString() + "," + omodel.HAddSourceRate + "," + omodel.HDelSourceRate.ToString() +
-                ",'" + omodel.HPicNumVer.ToString() + "','" + omodel.HPicNumAssemble.ToString() + "','" + omodel.HMaterTexture.ToString() + "','" + omodel.HProductNum.ToString() + "','" + omodel.HPRDORGID.ToString() + "','" + omodel.HVerNum.ToString() + "'," + DBUtility.ClsPub.HOrgID +
+                ",'" + omodel.HPicNumVer.ToString() + "','" + omodel.HPicNumAssemble.ToString() + "','" + omodel.HMaterTexture.ToString() + "','" + omodel.HProductNum.ToString() + "','" + DBUtility.ClsPub.HOrgID + "','" + omodel.HVerNum.ToString() + "'" +
                 ") ");
                 //鎻掑叆瀛愯〃
                 foreach (Model.ClsGy_RoutingBillSub oSub in DetailColl)
@@ -332,7 +333,7 @@
                 omodel.HMaterTexture = Ds.Tables[0].Rows[0]["HMaterTexture"].ToString().Trim();
                 omodel.HProductNum = Ds.Tables[0].Rows[0]["HProductNum"].ToString().Trim();
                 omodel.HVerNum = Ds.Tables[0].Rows[0]["HVerNum"].ToString().Trim();
-
+                omodel.HPRDORGID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HOrgID"].ToString());
                 //寰幆
                 DataSet DsSub ;
                 DsSub = oCn.RunProcReturn("Select * from Gy_RoutingBillSub Where HInterID=" + lngBillKey.ToString() + " Order by HEntryID ", "Gy_RoutingBillSub");
diff --git a/LMES/bin/x86/Debug.zip b/LMES/bin/x86/Debug.zip
new file mode 100644
index 0000000..ccbd9b3
--- /dev/null
+++ b/LMES/bin/x86/Debug.zip
Binary files differ
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
index 580f92b..0b42066 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.cs"
@@ -2471,6 +2471,39 @@
             }
         }
 
+        //鎵规鎸夐挳
+        private void BatchNo_Click(object sender, EventArgs e)
+        {
+            bool b = false;
+            for (int i = 0; i < grdMain.RowCount; i++)
+            {
+                long HMaterID = DBUtility.ClsPub.isLong(grdMain.Rows[i].Cells[HMaterIDCol].Value);          // 鐗╂枡鍐呯爜
+                string HBatchNo = DBUtility.ClsPub.isStrNull(grdMain.Rows[i].Cells[HBatchNoCol].Value);     // 鎵瑰彿
+
+                if (HMaterID != 0)
+                {
+                    DataSet oDs = oCn.RunProcReturn("exec h_p_Gy_BarCodeBill_GetBatchNo " + HMaterID.ToString() + ",'" + HBatchNo + "','" + dtpHDate.Value.ToShortDateString()+ "','" + CampanyName+"'", "h_p_Gy_BarCodeBill_GetBatchNo");
+                    //
+                    if (oDs == null && oDs.Tables[0].Rows.Count == 0)
+                    {
+                        MessageBox.Show("鐢熸垚鎵规澶辫触锛�");
+                        return;
+                    }
+                    else if (DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0][0]) == "1")
+                    {
+                        grdMain.Rows[i].Cells[HBatchNoCol].Value = DBUtility.ClsPub.isStrNull(oDs.Tables[0].Rows[0]["HBatchNo"]);
+                        b = true;
+                    }
+                }
+            }
+            //鏄庣粏琛ㄦ槸鍚︿负闆惰
+            if (b == false)
+            {
+                MessageBox.Show("娌℃湁闇�瑕佺敓鎴愭壒娆$殑鏄庣粏琛岋紒", "鎻愮ず");
+                return;
+            }
+        }
+
 
 
 
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs"
index 6df46ff..9e37bdf 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.designer.cs"
@@ -28,7 +28,6 @@
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Gy_BarCodeBill));
             this.Tool = new System.Windows.Forms.ToolStrip();
             this.dy = new System.Windows.Forms.ToolStripButton();
@@ -49,6 +48,8 @@
             this.bclk = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
             this.tb = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+            this.gl = new System.Windows.Forms.ToolStripButton();
             this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
             this.tc = new System.Windows.Forms.ToolStripButton();
             this.lblCaption = new System.Windows.Forms.Label();
@@ -90,7 +91,7 @@
             this.label11 = new System.Windows.Forms.Label();
             this.txtHMaker = new System.Windows.Forms.Label();
             this.label8 = new System.Windows.Forms.Label();
-            this.timer1 = new System.Windows.Forms.Timer(this.components);
+            this.timer1 = new System.Windows.Forms.Timer();
             this.panel1 = new System.Windows.Forms.Panel();
             this.panel3 = new System.Windows.Forms.Panel();
             this.grdMain = new System.Windows.Forms.DataGridView();
@@ -100,10 +101,10 @@
             this.tabPage1 = new System.Windows.Forms.TabPage();
             this.tabPage2 = new System.Windows.Forms.TabPage();
             this.grdSub = new System.Windows.Forms.DataGridView();
-            this.gl = new System.Windows.Forms.ToolStripButton();
-            this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
             this.tabPage3 = new System.Windows.Forms.TabPage();
             this.grdList = new System.Windows.Forms.DataGridView();
+            this.BatchNo = new System.Windows.Forms.ToolStripButton();
+            this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
             this.Tool.SuspendLayout();
             this.P1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pic1)).BeginInit();
@@ -147,6 +148,8 @@
             this.tb,
             this.toolStripSeparator6,
             this.gl,
+            this.toolStripSeparator7,
+            this.BatchNo,
             this.toolStripSeparator3,
             this.tc});
             this.Tool.Location = new System.Drawing.Point(0, 0);
@@ -350,6 +353,25 @@
             this.tb.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
             this.tb.ToolTipText = "鍚屾鍩虹璧勬枡";
             this.tb.Click += new System.EventHandler(this.tb_Click);
+            // 
+            // toolStripSeparator6
+            // 
+            this.toolStripSeparator6.Name = "toolStripSeparator6";
+            this.toolStripSeparator6.Size = new System.Drawing.Size(6, 50);
+            // 
+            // gl
+            // 
+            this.gl.AutoSize = false;
+            this.gl.Image = ((System.Drawing.Image)(resources.GetObject("gl.Image")));
+            this.gl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.gl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.gl.ImageTransparentColor = System.Drawing.Color.White;
+            this.gl.Name = "gl";
+            this.gl.Size = new System.Drawing.Size(35, 47);
+            this.gl.Text = "鍏宠仈";
+            this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.gl.Click += new System.EventHandler(this.gl_Click);
             // 
             // toolStripSeparator3
             // 
@@ -915,25 +937,6 @@
             this.grdSub.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellContentClick);
             this.grdSub.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.grdSub_CellEndEdit);
             // 
-            // gl
-            // 
-            this.gl.AutoSize = false;
-            this.gl.Image = ((System.Drawing.Image)(resources.GetObject("gl.Image")));
-            this.gl.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
-            this.gl.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
-            this.gl.ImageTransparentColor = System.Drawing.Color.White;
-            this.gl.Name = "gl";
-            this.gl.Size = new System.Drawing.Size(35, 47);
-            this.gl.Text = "鍏宠仈";
-            this.gl.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
-            this.gl.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
-            this.gl.Click += new System.EventHandler(this.gl_Click);
-            // 
-            // toolStripSeparator6
-            // 
-            this.toolStripSeparator6.Name = "toolStripSeparator6";
-            this.toolStripSeparator6.Size = new System.Drawing.Size(6, 50);
-            // 
             // tabPage3
             // 
             this.tabPage3.Controls.Add(this.grdList);
@@ -960,6 +963,25 @@
             this.grdList.RowTemplate.Height = 23;
             this.grdList.Size = new System.Drawing.Size(929, 288);
             this.grdList.TabIndex = 46;
+            // 
+            // BatchNo
+            // 
+            this.BatchNo.AutoSize = false;
+            this.BatchNo.Image = ((System.Drawing.Image)(resources.GetObject("BatchNo.Image")));
+            this.BatchNo.ImageAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.BatchNo.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None;
+            this.BatchNo.ImageTransparentColor = System.Drawing.Color.White;
+            this.BatchNo.Name = "BatchNo";
+            this.BatchNo.Size = new System.Drawing.Size(35, 47);
+            this.BatchNo.Text = "鎵规";
+            this.BatchNo.TextAlign = System.Drawing.ContentAlignment.BottomCenter;
+            this.BatchNo.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText;
+            this.BatchNo.Click += new System.EventHandler(this.BatchNo_Click);
+            // 
+            // toolStripSeparator7
+            // 
+            this.toolStripSeparator7.Name = "toolStripSeparator7";
+            this.toolStripSeparator7.Size = new System.Drawing.Size(6, 50);
             // 
             // Gy_BarCodeBill
             // 
@@ -1082,5 +1104,7 @@
         private System.Windows.Forms.ToolStripButton gl;
         private System.Windows.Forms.TabPage tabPage3;
         private System.Windows.Forms.DataGridView grdList;
+        private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+        private System.Windows.Forms.ToolStripButton BatchNo;
     }
 }
\ No newline at end of file
diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx"
index 2368149..c42cb23 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Gy_BarCodeBill.resx"
@@ -506,6 +506,16 @@
         TkSuQmCC
 </value>
   </data>
+  <data name="BatchNo.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAD3SURBVDhPnZC9FYIwFEaZiQFkAB1ADzULZACGoJLKSio7
+        BqCzorNiABgABnjme+GFBPlR3znfSUJy7yMJdorG0S2KY1r6/lE0PBMcdA8z3NZEd9VtSmiolU7iSjwY
+        CcNyUUL0UhzMIcK4An8IPFjGr2F0s3CTmrFOLbgN67vK79LQsOCqQhaIxIE9AfXVxT4Wwzp1NsGYQ4b9
+        tjhSe4smiVKma19NL+4KBEQA85hH1OQH+T6T6MgagaArThys0V3g8ZwpgbryzBuIXAfB3iosZSUP3VEH
+        cx82d1+EpURiHmu8817neYkEHQH+BEtZSfYHLCWSdTgI3vBtcjUXOHiVAAAAAElFTkSuQmCC
+</value>
+  </data>
   <data name="tc.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
diff --git a/WebAPI/Controllers/BaseSet/Gy_OrderBackInfoController.cs b/WebAPI/Controllers/BaseSet/Gy_OrderBackInfoController.cs
new file mode 100644
index 0000000..4e46692
--- /dev/null
+++ b/WebAPI/Controllers/BaseSet/Gy_OrderBackInfoController.cs
@@ -0,0 +1,368 @@
+锘縰sing DBUtility;
+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.BaseSet
+{
+    public class Gy_OrderBackInfoController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+        #region 璁㈠崟鍙嶉鐘舵�佸垪琛ㄦ暟鎹�
+        /// <summary>
+        /// 杩斿洖璁㈠崟鍙嶉鐘舵�佸垪琛�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderBackInfo/list")]
+        [HttpGet]
+        public object list(string sWhere)
+        {
+            try
+            {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_OrderBackInfoList " + sWhere, "h_v_Gy_OrderBackInfoList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Gy_OrderBackInfoList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_OrderBackInfoList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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 璁㈠崟鍙嶉鐘舵�佹牴鎹爲鍨婭D鏌ヨ鎵�鏈夊眰绾у垪琛ㄦ暟鎹�
+        /// <summary>
+        /// 鏍规嵁鏍戝瀷ID 鏌ユ壘璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderBackInfo/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
+
+                //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList");
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_Gy_OrderBackInfoList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_Gy_OrderBackInfoList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_Gy_OrderBackInfoList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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 鍒犻櫎璁㈠崟鍙嶉鐘舵��
+        /// <summary>
+        /// 璁㈠崟鍙嶉鐘舵�佸垪琛ㄥ垹闄ゆ寜閽�
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderBackInfo/Delete_Json")]
+        [HttpGet]
+        public object Delete_Json(long HItemID, string User, string ModRightNameDelete)
+        {
+
+            try
+            {
+                ds = oCN.RunProcReturn("delete from Gy_OrderBackInfo where HItemID =  " + HItemID, "Gy_OrderBackInfo");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                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
+
+        #region 璁㈠崟鍙嶉鐘舵�佹柊澧炰繚瀛�
+        /// <summary>
+        /// 璁㈠崟鍙嶉鐘舵��-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderBackInfo/AddBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject oMain)
+        {
+            try
+            {
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                //鍙嶅簭鍒楀寲
+                msg1 = "[" + msg1.ToString() + "]";
+
+                List<Gy_OrderBackInfo> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderBackInfo>>(msg1);
+
+                long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID;
+                string HHelpCode = list[0].HHelpCode;
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+                bool HUseFlag = list[0].HUseFlag;
+
+                if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                oCN.RunProc("Insert Into Gy_OrderBackInfo " +
+                "(HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag) " +
+                " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" +
+                ",'1',0,'" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','鏈娇鐢�')");
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                if (list[0].HItemID.ToString() != "")
+                {
+                    oCN.RunProc("Update Gy_OrderBackInfo set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 璁㈠崟鍙嶉鐘舵�佷慨鏀逛繚瀛�
+        /// <summary>
+        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderBackInfo/EditBill")]
+        [HttpPost]
+        public object EditBill([FromBody] JObject oMain)
+        {
+
+            try
+            {
+
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                string msg3 = sArray[1].ToString();
+                string msg4 = sArray[2].ToString();
+                string msg5 = sArray[3].ToString();
+
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_OrderBackInfo> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderBackInfo>>(msg2);
+
+                long HItemID = int.Parse(msg3);
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID;
+                string HHelpCode = list[0].HHelpCode;
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+                bool HUseFlag = list[0].HUseFlag;
+
+
+                //鍒ゆ柇鏉冮檺
+                if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                if (!DBUtility.ClsPub.AllowNumber(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閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                oCN.RunProc("Update Gy_OrderBackInfo set " +
+                    " HNumber='" + HNumber + "'" +
+                    ",HName='" + HName + "'" +
+                    ",HShortNumber='" + HShortNumber + "'" +
+                    ",HHelpCode='" + HHelpCode + "'" +
+                    ",HParentID=" + HParentID +
+                    ",HStopflag='" + Convert.ToString(HStopflag ? 1 : 0) + "'" +
+                    ",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);
+                //灏嗕笂绾� 涓洪潪鏈骇
+                oCN.RunProc("Update Gy_OrderBackInfo set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                //
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 璁㈠崟鍙嶉鐘舵�佷慨鏀硅幏鍙栫粦瀹氭暟鎹�
+        /// <summary>
+        /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderBackInfo/xg")]
+        [HttpGet]
+        public object xg(long HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from Gy_OrderBackInfo where HItemID=" + HInterID, "Gy_OrderBackInfo");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                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("Gy_OrderBackInfo/LoadTree")]
+        [HttpGet]
+        public object LoadTree_Json(string sWhere)
+        {
+            SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
+            //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList");
+
+            ds = oCN.RunProcReturn("select * from h_v_Gy_OrderBackInfoLoadTree", "h_v_Gy_OrderBackInfoLoadTree");
+
+            objJsonResult.code = "1";
+            objJsonResult.count = 1;
+            objJsonResult.Message = "Sucess锛�";
+            objJsonResult.data = ds.Tables[0];
+            return objJsonResult;
+        }
+        #endregion
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/BaseSet/Gy_OrderLevController.cs b/WebAPI/Controllers/BaseSet/Gy_OrderLevController.cs
new file mode 100644
index 0000000..d68528f
--- /dev/null
+++ b/WebAPI/Controllers/BaseSet/Gy_OrderLevController.cs
@@ -0,0 +1,427 @@
+锘縰sing DBUtility;
+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.BaseSet
+{
+    public class Gy_OrderLevController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+        #region 璁㈠崟绛夌骇鍒楄〃鏁版嵁
+        /// <summary>
+        /// 杩斿洖璁㈠崟绛夌骇鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderLev/list")]
+        [HttpGet]
+        public object list(string sWhere)
+        {
+            try
+            {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_OrderLevList " + sWhere, "h_v_Gy_OrderLevList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Gy_OrderLevList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_OrderLevList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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 璁㈠崟绛夌骇鏍规嵁鏍戝瀷ID鏌ヨ鎵�鏈夊眰绾у垪琛ㄦ暟鎹�
+        /// <summary>
+        /// 鏍规嵁鏍戝瀷ID 鏌ユ壘璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderLev/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
+
+                //ds = oCN.RunProcReturn("select * from h_v_IF_RepairCheckList where HitemID=" + HInterID, "h_v_IF_RepairCheckList");
+                ds = oCN.RunProcReturn(string.Format(@"WITH a AS (SELECT * FROM dbo.h_v_Gy_OrderLevList WHERE HitemID=" + HInterID + " UNION ALL SELECT s.* FROM dbo.h_v_Gy_OrderLevList AS s,a WHERE s.parentid=a.HitemID) SELECT * FROM a"), "h_v_Gy_OrderLevList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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 鍒犻櫎璁㈠崟绛夌骇
+        /// <summary>
+        /// 璁㈠崟绛夌骇鍒楄〃鍒犻櫎鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderLev/Delete_Json")]
+        [HttpGet]
+        public object Delete_Json(long HItemID, string User, string ModRightNameDelete)
+        {
+            DAL.ClsGy_OrderLev_Ctl oDept = new DAL.ClsGy_OrderLev_Ctl();
+            DAL.ClsGy_OrderLev_View oDeptHlp = new DAL.ClsGy_OrderLev_View();
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log(ModRightNameDelete, 1, true, User))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鍒犻櫎鏉冮檺";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (oDeptHlp.GetInfoByID(HItemID))
+                {
+                    if (oDept.HavChildCodes(HItemID))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰,涓嶈兘鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //鍒犻櫎鍓嶅垽鏂槸鍚� 宸蹭娇鐢� 20141020
+                    if (oDeptHlp.omodel.HUseFlag != "鏈娇鐢�")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "姝ら」鐩凡浣跨敤鎴栬�呮湭妫�娴嬶紝涓嶈兘鍒犻櫎锛佽閲嶆柊妫�娴嬪啀鍒犻櫎锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    //
+                    if (oDept.DeleteByID(HItemID))
+                    {
+                        //鍐欏叆鏃ュ織
+                        ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oDeptHlp.omodel.HNumber + ",鍚嶇О锛�" + oDeptHlp.omodel.HName, ClsPub.CurUserName);
+                        //鏇存柊涓婄骇涓� 鏈骇
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍒犻櫎鎴愬姛";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍒犻櫎澶辫触";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+                //ds = oCN.RunProcReturn("delete from Gy_Department where HItemID =  " + HItemID, "Gy_Department");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                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
+
+        #region 璁㈠崟绛夌骇鏂板淇濆瓨
+        /// <summary>
+        /// 璁㈠崟绛夌骇-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderLev/AddBill")]
+        [HttpPost]
+        public object AddBill([FromBody] JObject oMain)
+        {
+            try
+            {
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                //鍙嶅簭鍒楀寲
+                msg1 = "[" + msg1.ToString() + "]";
+
+                DAL.ClsGy_OrderLev_Ctl oDept = new DAL.ClsGy_OrderLev_Ctl();
+                DAL.ClsGy_OrderLev_View oDeptHlp = new DAL.ClsGy_OrderLev_View();
+
+
+
+                List<Gy_OrderLevList> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderLevList>>(msg1);
+
+                long HItemID = list[0].HItemID.ToString() == "" ? 0 : list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID;
+                string HHelpCode = list[0].HHelpCode;
+                string HRemark = list[0].HRemark;
+                string HYX = list[0].HYX;
+                bool HStopflag = list[0].HStopflag;
+                bool HUseFlag = list[0].HUseFlag;
+
+                if (!DBUtility.ClsPub.AllowNumber(HNumber))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                oCN.RunProc("Insert Into Gy_OrderLev " +
+                "(HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HYX) " +
+                " values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "','" + HItemID + "'" +
+                ",'1',0,'" + Convert.ToString(HStopflag ? 1 : 0) + "','" + HRemark + "','鏈娇鐢�','" + HYX + "')");
+                //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                if (list[0].HItemID.ToString() != "")
+                {
+                    oCN.RunProc("Update Gy_OrderLev set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                }
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鏂板鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 璁㈠崟绛夌骇淇敼淇濆瓨
+        /// <summary>
+        /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderLev/EditBill")]
+        [HttpPost]
+        public object EditBill([FromBody] JObject oMain)
+        {
+
+            try
+            {
+                DAL.ClsGy_OrderLev_Ctl oDept = new DAL.ClsGy_OrderLev_Ctl();
+                DAL.ClsGy_OrderLev_View oDeptHlp = new DAL.ClsGy_OrderLev_View();
+
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                string msg3 = sArray[1].ToString();
+                string msg4 = sArray[2].ToString();
+                string msg5 = sArray[3].ToString();
+
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_OrderLevList> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_OrderLevList>>(msg2);
+
+                long HItemID = int.Parse(msg3);
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HShortNumber = list[0].HNumber;
+                long HParentID = list[0].HParentID.ToString() == "" ? 0 : list[0].HParentID;
+                string HHelpCode = list[0].HHelpCode;
+                string HYX = list[0].HYX;
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+                bool HUseFlag = list[0].HUseFlag;
+
+
+                //鍒ゆ柇鏉冮檺
+                if (!ClsPub.Security_Log(msg5, 1, true, msg4))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鎵惧埌璇ュ姛鑳芥ā鍧楋紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+
+                if (!DBUtility.ClsPub.AllowNumber(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閲嶅鍒欓噸鏂拌幏鍙�
+                oCN.BeginTran();
+                //涓昏〃
+                oCN.RunProc("Update Gy_OrderLev set " +
+                    " HNumber='" + HNumber + "'" +
+                    ",HName='" + HName + "'" +
+                    ",HShortNumber='" + HShortNumber + "'" +
+                    ",HHelpCode='" + HHelpCode + "'" +
+                    ",HYX='" + HYX + "'" +
+                    ",HParentID=" + HParentID +
+                    ",HStopflag='" + Convert.ToString(HStopflag ? 1 : 0) + "'" +
+                    ",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);
+                //灏嗕笂绾� 涓洪潪鏈骇
+                oCN.RunProc("Update Gy_OrderLev set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                //
+                oCN.Commit();
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
+                //objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 璁㈠崟绛夌骇淇敼鑾峰彇缁戝畾鏁版嵁
+        /// <summary>
+        /// 缁翠慨鍒楄〃淇敼鎸夐挳鏂规硶
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_OrderLev/xg")]
+        [HttpGet]
+        public object xg(long HInterID)
+        {
+            try
+            {
+                ds = oCN.RunProcReturn("select * from Gy_OrderLev where HItemID=" + HInterID, "Gy_OrderLev");
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                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("Gy_OrderLev/LoadTree")]
+        [HttpGet]
+        public object LoadTree_Json(string sWhere)
+        {
+            SQLHelper.ClsCN SubCn = new SQLHelper.ClsCN();
+            //ds = oCN.RunProcReturn("select * from h_v_IF_GroupList " + sWhere, "h_v_IF_GroupList");
+
+            ds = oCN.RunProcReturn("select * from h_v_Gy_OrderLevLoadTree", "h_v_Gy_OrderLevLoadTree");
+
+            objJsonResult.code = "1";
+            objJsonResult.count = 1;
+            objJsonResult.Message = "Sucess锛�";
+            objJsonResult.data = ds.Tables[0];
+            return objJsonResult;
+        }
+        #endregion
+    }
+}
diff --git a/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs b/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs
index 6b49370..f43c15d 100644
--- a/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs
@@ -39,22 +39,22 @@
                     string sql = sql1 + sWhere + "order by HItemID desc";
                     ds = oCN.RunProcReturn(sql, "h_v_IF_WareHouseList");
                 }
-                if (ds == null || ds.Tables[0].Rows.Count == 0)
-                {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "false锛�";
-                    objJsonResult.data = null;
-                    return objJsonResult;
-                }
-                else
-                {
+                //if (ds == null || ds.Tables[0].Rows.Count == 0)
+                //{
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "false锛�";
+                //    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)
             {
diff --git a/WebAPI/Controllers/BaseSet/Gy_WorkPayTypeController.cs b/WebAPI/Controllers/BaseSet/Gy_WorkPayTypeController.cs
new file mode 100644
index 0000000..ab78ee7
--- /dev/null
+++ b/WebAPI/Controllers/BaseSet/Gy_WorkPayTypeController.cs
@@ -0,0 +1,366 @@
+锘縰sing Model;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+namespace WebAPI.Controllers
+{
+    public class Gy_WorkPayTypeController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+
+        /// <summary>
+        /// 杩斿洖宸ヤ綔涓績鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_WorkPayType/list")]
+        [HttpGet]
+        public object list(string sWhere)
+        {
+            try
+            {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_WorkPayTypeList " + sWhere, "h_v_Gy_WorkPayTypeList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Gy_WorkPayTypeList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_WorkPayTypeList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_WorkPayType/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select * from h_v_Gy_WorkPayTypeList where HitemID=" + HInterID, "h_v_Gy_WorkPayTypeList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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;
+            }
+        }
+
+
+        ///// <summary>
+        ///// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+        /////鍙傛暟锛歴tring sql銆�
+        /////杩斿洖鍊硷細object銆�
+        ///// </summary>
+        //[Route("Gy_WorkType/AddBill")]
+        //[HttpPost]
+        //public object AddBill([FromBody] JObject oMain)
+        //{
+        //    try
+        //    {
+        //        var _value = oMain["oMain"].ToString();
+        //        string msg1 = _value.ToString();
+        //        //鍙嶅簭鍒楀寲
+        //        msg1 = "[" + msg1.ToString() + "]";
+        //        DAL.ClsGy_WorkType_Ctl oDept = new DAL.ClsGy_WorkType_Ctl();
+        //        DAL.ClsGy_WorkType_View oDeptHlp = new DAL.ClsGy_WorkType_View();
+        //        List<Gy_WorkType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkType>>(msg1);
+        //        long HItemID = list[0].HItemID ;
+        //        string HNumber = list[0].HNumber;
+        //        string HName = list[0].HName;   
+        //        string HShortNumber = list[0].HShortNumber;
+        //        long HParentID = list[0].HParentID;
+        //        string HHelpCode = list[0].HHelpCode;
+        //        string HRemark = list[0].HRemark;
+        //        bool HStopflag = list[0].HStopflag;
+        //        string HForEmp = list[0].HForEmp;
+        //        //string HUseFlag = list[0].HUseFlag;
+        //        var HPayMoney = list[0].HPayMoney;
+        //        var HDayMoney = list[0].HDayMoney; 
+        //        var HEndFlag = 0;
+        //        var HLevel = "";
+        //        if (!DBUtility.ClsPub.AllowNumber(HNumber))
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+        //        oCN.BeginTran();
+        //        //涓昏〃
+        //        string sql = "Insert into Gy_WorkType " +
+        //            " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HForEmp" +
+        //            ",HLevel,HEndFlag,HStopflag,HRemark,HPayMoney,HDayMoney) " +
+        //            " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + ",'" + HForEmp + "'" +
+        //            "," + HLevel.ToString() + "," + HEndFlag + "," + HStopflag + ",'" + HRemark + "'," + HPayMoney.ToString() + "," + HDayMoney.ToString() + ")";
+        //            oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //淇敼涓婄骇涓洪潪鏈骇浠g爜
+        //        if (list[0].HItemID.ToString() != "")
+        //        {
+        //            oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        }
+        //        oCN.Commit();
+        //        objJsonResult.code = "1";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = "鏂板鎴愬姛锛�";
+        //        //objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        oCN.RollBack();
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "Exception锛�" + e.Message;
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+        /// <summary>
+        /// 淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_WorkPayType/ModifyByID")]
+        [HttpPost]
+        public object ModifyByID([FromBody] JObject oMain)
+        {
+            try
+            {
+                DAL.ClsGy_WorkPayType_Ctl oDept = new DAL.ClsGy_WorkPayType_Ctl();
+                DAL.ClsGy_WorkPayType_View oDeptHlp = new DAL.ClsGy_WorkPayType_View();
+
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_WorkPayType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkPayType>>(msg2);
+
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HHelpCode = list[0].HHelpCode;
+                string HShortNumber = "0";
+                long HParentID = list[0].HParentID;
+                var HLevel = list[0].HLevel;
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+                bool HEndFlag = list[0].HEndFlag;
+                string HUseFlag = list[0].HUseFlag;
+              
+
+
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into Gy_WorkPayType " +
+                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
+                    ",HLevel,HEndFlag,HStopflag,HRemark) " +
+                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() +
+                    "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update  Gy_WorkPayType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Gy_WorkPayType set " +
+                    " HNumber='" + HNumber + "'" +
+                    ",HName='" + HName + "'" +
+                    ",HShortNumber='" + HShortNumber + "'" +
+                    ",HHelpCode='" + HHelpCode + "'" +
+                    ",HLevel=" + HLevel.ToString() +
+                    ",HParentID=" + HParentID.ToString() +
+                    ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) +
+                    ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) +
+                    ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼瀛愰」鐩唬鐮�
+                    //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //灏嗕笂绾� 涓洪潪鏈骇
+                    oCN.RunProc("Update Gy_WorkPayType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+     
+        /// <summary>
+        /// 鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetGy_WorkPayType")]
+        [HttpGet]
+        public object DeltetGy_WorkPayType(string HItemID)
+        {
+            DataSet ds;
+            DataSet ds1;
+            //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(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Gy_WorkPayType where HItemID=" + HItemID, "Gy_WorkPayType");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+                //if (HStopflag)
+                //{
+                //    oCN.RollBack();//鍥炴粴浜嬪姟
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                ds1 = oCN.RunProcReturn("Select HItemID from  Gy_WorkPayType  Where HParentID='" + HItemID + "'", " Gy_WorkPayType");
+                if (ds1.Tables[0].Rows.Count != 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰锛屼笉鑳藉垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
+                if (HUseFlag == "宸蹭娇鐢�")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ら」鐩凡浣跨敤锛屼笉鑳藉垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("delete from Gy_WorkPayType  where HItemID=" + HItemID);
+                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;
+            }
+        }
+       
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Controllers/BaseSet/Gy_WorkTypeController.cs b/WebAPI/Controllers/BaseSet/Gy_WorkTypeController.cs
new file mode 100644
index 0000000..45cc718
--- /dev/null
+++ b/WebAPI/Controllers/BaseSet/Gy_WorkTypeController.cs
@@ -0,0 +1,371 @@
+锘縰sing Model;
+using Newtonsoft.Json.Linq;
+using Pub_Class;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Data;
+using System.Data.SqlClient;
+using System.Web.Http;
+using WebAPI.Models;
+namespace WebAPI.Controllers
+{
+    public class Gy_WorkTypeController : ApiController
+    {
+        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
+
+        private json objJsonResult = new json();
+        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+        DataSet ds;
+
+
+        /// <summary>
+        /// 杩斿洖宸ヤ綔涓績鍒楄〃
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_WorkType/list")]
+        [HttpGet]
+        public object list(string sWhere)
+        {
+            try
+            {
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("select * from h_v_Gy_WorkTypeList " + sWhere, "h_v_Gy_WorkTypeList");
+                }
+                else
+                {
+                    string sql1 = "select * from h_v_Gy_WorkTypeList where 1 = 1 ";
+                    string sql = sql1 + sWhere;
+                    ds = oCN.RunProcReturn(sql, "h_v_Gy_WorkTypeList");
+                }
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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;
+            }
+        }
+
+        /// <summary>
+        /// 鏍规嵁鍩虹璧勬枡ID 鏌ユ壘璁板綍
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_WorkType/cx")]
+        [HttpGet]
+        public object cx(long HInterID)
+        {
+            try
+            {
+
+                ds = oCN.RunProcReturn("select * from h_v_Gy_WorkTypeList where HitemID=" + HInterID, "h_v_Gy_WorkTypeList");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "false锛�";
+                    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;
+            }
+        }
+
+
+        ///// <summary>
+        ///// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
+        /////鍙傛暟锛歴tring sql銆�
+        /////杩斿洖鍊硷細object銆�
+        ///// </summary>
+        //[Route("Gy_WorkType/AddBill")]
+        //[HttpPost]
+        //public object AddBill([FromBody] JObject oMain)
+        //{
+        //    try
+        //    {
+        //        var _value = oMain["oMain"].ToString();
+        //        string msg1 = _value.ToString();
+        //        //鍙嶅簭鍒楀寲
+        //        msg1 = "[" + msg1.ToString() + "]";
+        //        DAL.ClsGy_WorkType_Ctl oDept = new DAL.ClsGy_WorkType_Ctl();
+        //        DAL.ClsGy_WorkType_View oDeptHlp = new DAL.ClsGy_WorkType_View();
+        //        List<Gy_WorkType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkType>>(msg1);
+        //        long HItemID = list[0].HItemID ;
+        //        string HNumber = list[0].HNumber;
+        //        string HName = list[0].HName;   
+        //        string HShortNumber = list[0].HShortNumber;
+        //        long HParentID = list[0].HParentID;
+        //        string HHelpCode = list[0].HHelpCode;
+        //        string HRemark = list[0].HRemark;
+        //        bool HStopflag = list[0].HStopflag;
+        //        string HForEmp = list[0].HForEmp;
+        //        //string HUseFlag = list[0].HUseFlag;
+        //        var HPayMoney = list[0].HPayMoney;
+        //        var HDayMoney = list[0].HDayMoney; 
+        //        var HEndFlag = 0;
+        //        var HLevel = "";
+        //        if (!DBUtility.ClsPub.AllowNumber(HNumber))
+        //        {
+        //            objJsonResult.code = "0";
+        //            objJsonResult.count = 0;
+        //            objJsonResult.Message = "浠g爜涓笉鑳藉嚭鐜拌繛缁��.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+        //            objJsonResult.data = null;
+        //            return objJsonResult;
+        //        }
+        //        //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+        //        oCN.BeginTran();
+        //        //涓昏〃
+        //        string sql = "Insert into Gy_WorkType " +
+        //            " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HForEmp" +
+        //            ",HLevel,HEndFlag,HStopflag,HRemark,HPayMoney,HDayMoney) " +
+        //            " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + ",'" + HForEmp + "'" +
+        //            "," + HLevel.ToString() + "," + HEndFlag + "," + HStopflag + ",'" + HRemark + "'," + HPayMoney.ToString() + "," + HDayMoney.ToString() + ")";
+        //            oCN.RunProc(sql, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        //淇敼涓婄骇涓洪潪鏈骇浠g爜
+        //        if (list[0].HItemID.ToString() != "")
+        //        {
+        //            oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+        //        }
+        //        oCN.Commit();
+        //        objJsonResult.code = "1";
+        //        objJsonResult.count = 1;
+        //        objJsonResult.Message = "鏂板鎴愬姛锛�";
+        //        //objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //    catch (Exception e)
+        //    {
+        //        oCN.RollBack();
+        //        objJsonResult.code = "0";
+        //        objJsonResult.count = 0;
+        //        objJsonResult.Message = "Exception锛�" + e.Message;
+        //        objJsonResult.data = null;
+        //        return objJsonResult;
+        //    }
+        //}
+        /// <summary>
+        /// 淇濆瓨鎸夐挳
+        ///鍙傛暟锛歴tring sql銆�
+        ///杩斿洖鍊硷細object銆�
+        /// </summary>
+        [Route("Gy_WorkType/ModifyByID")]
+        [HttpPost]
+        public object ModifyByID([FromBody] JObject oMain)
+        {
+            try
+            {
+                DAL.ClsGy_WorkType_Ctl oDept = new DAL.ClsGy_WorkType_Ctl();
+                DAL.ClsGy_WorkType_View oDeptHlp = new DAL.ClsGy_WorkType_View();
+
+                var _value = oMain["oMain"].ToString();
+                string msg1 = _value.ToString();
+                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+                string msg2 = sArray[0].ToString();
+                //string msg3 = sArray[1].ToString();
+                //string msg4 = sArray[2].ToString();
+                //string msg5 = sArray[3].ToString();
+                //鍙嶅簭鍒楀寲
+                msg2 = "[" + msg2.ToString() + "]";
+                List<Gy_WorkType> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_WorkType>>(msg2);
+
+                long HItemID = list[0].HItemID;
+                string HNumber = list[0].HNumber;
+                string HName = list[0].HName;
+                string HHelpCode = list[0].HHelpCode;
+                string HShortNumber = "0";
+                long HParentID = list[0].HParentID;
+                var HLevel = list[0].HLevel;
+                string HRemark = list[0].HRemark;
+                bool HStopflag = list[0].HStopflag;
+                bool HEndFlag = list[0].HEndFlag;
+                string HUseFlag = list[0].HUseFlag;
+                var HDayMoney = list[0].HDayMoney;
+                var HPayMoney = list[0].HPayMoney;
+                string HForEmp = list[0].HForEmp;
+
+
+                //淇濆瓨
+                //淇濆瓨瀹屾瘯鍚庡鐞�
+                if (HItemID == 0)
+                {
+                    oCN.BeginTran();
+                    oCN.RunProc("Insert into Gy_WorkType " +
+                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID,HForEmp" +
+                    ",HLevel,HEndFlag,HStopflag,HRemark,HPayMoney,HDayMoney) " +
+                    " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," + HParentID.ToString() + ",'" + HForEmp + "'" +
+                    "," + HLevel.ToString() + "," + Convert.ToString(HEndFlag ? 1 : 0) + "," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "'," + HPayMoney.ToString() + "," + HDayMoney.ToString() + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼涓婄骇涓洪潪鏈骇浠g爜
+                    oCN.RunProc("Update  Gy_WorkType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    oCN.Commit();
+                }
+                else
+                {
+                    //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
+                    oCN.BeginTran();
+                    oCN.RunProc("Update Gy_WorkType set " +
+                    " HNumber='" + HNumber + "'" +
+                    ",HName='" + HName + "'" +
+                    ",HShortNumber='" + HShortNumber + "'" +
+                    ",HForEmp='" + HForEmp + "'" +
+                    ",HHelpCode='" + HHelpCode + "'" +
+                    ",HLevel=" + HLevel.ToString() +
+                    ",HParentID=" + HParentID.ToString() +
+                    ",HEndflag=" + Convert.ToString(HEndFlag ? 1 : 0) +
+                    ",HStopflag=" + Convert.ToString(HStopflag ? 1 : 0) +
+                    ",HPayMoney=" + HPayMoney.ToString() +
+                    ",HDayMoney=" + HDayMoney.ToString() +
+                    ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
+                    //淇敼瀛愰」鐩唬鐮�
+                    //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_WorkCenter,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
+                    //灏嗕笂绾� 涓洪潪鏈骇
+                    oCN.RunProc("Update Gy_WorkType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
+
+                    oCN.Commit();
+                }
+                objJsonResult.code = "0";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
+                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+                objJsonResult.data = 1;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.Message;
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+     
+        /// <summary>
+        /// 鍒犻櫎鍔熻兘
+        /// </summary>
+        /// <returns></returns>
+        [Route("DeltetGy_WorkType")]
+        [HttpGet]
+        public object DeltetGy_WorkType(string HItemID)
+        {
+            DataSet ds;
+            DataSet ds1;
+            //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(HItemID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HItemID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                ds = oCN.RunProcReturn("select * from Gy_WorkType where HItemID=" + HItemID, "Gy_WorkType");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+                //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
+                //if (HStopflag)
+                //{
+                //    oCN.RollBack();//鍥炴粴浜嬪姟
+                //    objJsonResult.code = "0";
+                //    objJsonResult.count = 0;
+                //    objJsonResult.Message = "鏁版嵁宸插垹闄ゆ棤娉曞啀娆″垹闄わ紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                ds1 = oCN.RunProcReturn("Select HItemID from  Gy_WorkType  Where HParentID='" + HItemID + "'", " Gy_WorkType");
+                if (ds1.Tables[0].Rows.Count != 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ら」鐩瓨鍦ㄥ瓙椤圭洰锛屼笉鑳藉垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                string HUseFlag = Convert.ToString(ds.Tables[0].Rows[0]["HUseFlag"]);
+                if (HUseFlag == "宸蹭娇鐢�")
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "姝ら」鐩凡浣跨敤锛屼笉鑳藉垹闄わ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                oCN.RunProc("delete from Gy_WorkType  where HItemID=" + HItemID);
+                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;
+            }
+        }
+       
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/Gy_OrderBackInfo.cs b/WebAPI/Models/Gy_OrderBackInfo.cs
new file mode 100644
index 0000000..9c6b05c
--- /dev/null
+++ b/WebAPI/Models/Gy_OrderBackInfo.cs
@@ -0,0 +1,27 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class Gy_OrderBackInfo
+    {
+        public long HItemID { get; set; }     //ID
+        public string HNumber { get; set; }   //浠g爜
+        public string HName { get; set; }     //鍚嶇О
+        public string HShortNumber { get; set; }  //鐭唬鐮�
+        public long HParentID { get; set; }      //鐖剁骇ID
+        public long HLevel { get; set; }      //灞傜骇
+        public long HEndFlag { get; set; }      //
+
+        public string HHelpCode { get; set; }   // 鍔╄鐮�
+
+        public string HRemark { get; set; }    //澶囨敞
+
+        public bool HStopflag { get; set; }  //绂佺敤鏍囧織
+
+        public bool HUseFlag { get; set; }   //浣跨敤鐘舵��
+
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/Gy_OrderLevList.cs b/WebAPI/Models/Gy_OrderLevList.cs
new file mode 100644
index 0000000..e5f326b
--- /dev/null
+++ b/WebAPI/Models/Gy_OrderLevList.cs
@@ -0,0 +1,28 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class Gy_OrderLevList
+    {
+        public long HItemID { get; set; }     //ID
+        public string HNumber { get; set; }   //浠g爜
+        public string HName { get; set; }     //鍚嶇О
+        public string HShortNumber { get; set; }  //鐭唬鐮�
+        public long HParentID { get; set; }      //鐖剁骇ID
+        public long HLevel { get; set; }      //灞傜骇
+        public long HEndFlag { get; set; }      //
+
+        public string HHelpCode { get; set; }   // 鍔╄鐮�
+
+        public string HRemark { get; set; }    //澶囨敞
+
+        public bool HStopflag { get; set; }  //绂佺敤鏍囧織
+
+        public bool HUseFlag { get; set; }   //浣跨敤鐘舵��
+
+        public string HYX { get; set; }//浼樺厛绾�
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/Gy_WorkPayType.cs b/WebAPI/Models/Gy_WorkPayType.cs
new file mode 100644
index 0000000..b8d7204
--- /dev/null
+++ b/WebAPI/Models/Gy_WorkPayType.cs
@@ -0,0 +1,26 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class Gy_WorkPayType
+    {
+        public long HItemID { get; set; }
+        public string HNumber { get; set; }       // 浠g爜
+        public string HName { get; set; }         //  
+        public string HHelpCode { get; set; }      //鍔╄鐮�
+        public string HShortNumber { get; set; }   //鐭唬鐮�
+        public long HParentID { get; set; }      //鐖剁骇ID
+        public long HLevel { get; set; }
+        public bool HEndFlag { get; set; }      //鏈骇鏍囧織
+        public bool HStopflag { get; set; }     //绂佺敤鏍囧織
+      
+        public string HRemark { get; set; }       //澶囨敞
+        public string HUseFlag { get; set; }      //浣跨敤鏍囧織
+       
+
+       
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/Models/Gy_WorkType.cs b/WebAPI/Models/Gy_WorkType.cs
new file mode 100644
index 0000000..77d0eb1
--- /dev/null
+++ b/WebAPI/Models/Gy_WorkType.cs
@@ -0,0 +1,28 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+
+namespace WebAPI.Models
+{
+    public class Gy_WorkType
+    {
+        public long HItemID { get; set; }
+        public string HNumber { get; set; }       // 浠g爜
+        public string HName { get; set; }         //  
+        public string HHelpCode { get; set; }      //鍔╄鐮�
+        public string HShortNumber { get; set; }   //鐭唬鐮�
+        public long HParentID { get; set; }      //鐖剁骇ID
+        public long HLevel { get; set; }
+        public bool HEndFlag { get; set; }      //鏈骇鏍囧織
+        public bool HStopflag { get; set; }     //绂佺敤鏍囧織
+        public long HPayMoney { get; set; }
+        public long HDayMoney { get; set; }
+        public string HForEmp { get; set; }   //鐭唬鐮�
+        public string HRemark { get; set; }       //澶囨敞
+        public string HUseFlag { get; set; }      //浣跨敤鏍囧織
+       
+
+       
+    }
+}
\ No newline at end of file
diff --git a/WebAPI/WebAPI.csproj.user b/WebAPI/WebAPI.csproj.user
index 16d95e2..038673c 100644
--- a/WebAPI/WebAPI.csproj.user
+++ b/WebAPI/WebAPI.csproj.user
@@ -9,7 +9,7 @@
     <WebStackScaffolding_IsAsyncSelected>False</WebStackScaffolding_IsAsyncSelected>
     <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
     <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
-    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
+    <NameOfLastUsedPublishProfile>D:\Git\houduan\WebAPI\Properties\PublishProfiles\FolderProfile.pubxml</NameOfLastUsedPublishProfile>
     <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
     <UseIISExpress>false</UseIISExpress>
     <Use64BitIISExpress />

--
Gitblit v1.9.1