1.销售订单子表,生产订单子表,工序流转卡 主表增加订单等级基础选择框
2.盘点方案,客户分类,供应商分类,地区,销售方式,采购方式编辑 及 列表 模块
3. 用户关联仓库列表,用户关联物料列表 的模块(按钮: 新增,编辑,删除(单行),列设置,按钮设置,退出)
4.器具保养统计表,器具维修统计表,器具故障统计表
7个文件已添加
19个文件已修改
4491 ■■■■■ 已修改文件
DAL/车间管理/ClsSc_ProcessExchangeBill.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/销售管理/ClsXs_SeOrderBill.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_AreaSet_Model.cs 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_CusType_Model.cs 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_PoStockStyle_Model.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_SellStyle_Model.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_StockCheckItem_Model.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_SupType_Model.cs 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/ClsSc_ICMOBillSub.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/车间管理/ClsSc_ProcessExchangeBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BLL/Xt_UserController.cs 273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs 1454 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs 155 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/WebAPIController.cs 1707 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/生产任务单/Sc_ICMOBillController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_AreaSet_Ctl.cs 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_CusType_Ctl.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_PoStockStyle_Ctl.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_SellStyle_Ctl.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_StockCheckItem_Ctl.cs 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsGy_SupType_Ctl.cs 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Service/LuBaoSevice.cs 152 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/³µ¼ä¹ÜÀí/ClsSc_ProcessExchangeBill.cs
@@ -369,7 +369,7 @@
               ", HRoutingBillID,HMaterModel,HWidth,HWeight,HAuxQty,HAuxUnit,HSplitNo" +
               ",HHeight,HInches,HAl1Long,HDensity,HTela,HUnderTela,HSizing,HSellDate" +
               ",HRemark2,HRemark3,HEmpID,HCusID,HColorRemark,HSplitSumQty,HSplitColorQty,HMachineLine" +
               ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo) " +
               ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HOrderLevID) " +
                " values('" + this.BillType + "','" + omodel.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()," + "" + (omodel.HPrevMainSourceInterID == 0 ? omodel.HInterID : omodel.HPrevMainSourceInterID) +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + omodel.HBatchNo + "'," + omodel.HMainMaterID.ToString() + "," + omodel.HKeyMaterID.ToString() + "," + omodel.HNo.ToString() + ",'" + omodel.HOrderProcNO + "'" +
                "," + omodel.HWWOrderInterID.ToString() + "," + omodel.HWWOrderEntryID.ToString() + ",'" + omodel.HWWOrderBillNo + "'," + omodel.HICMOInterID.ToString() + "," + omodel.HEquipMentID.ToString() +
@@ -384,7 +384,7 @@
                "','"+ omodel.HRoutingBillID + "','"+ omodel.HMaterModel + "',"+ omodel.HWidth + ","+ omodel.HWeight + ","+ omodel.HAuxQty + ","+ omodel.HAuxUnit +","+ omodel.HSplitNo +"" +
                ",'" + omodel.HHeight + "','" + omodel.HInches + "','" + omodel.HAl1Long + "','" + omodel.HDensity + "','" + omodel.HTela + "','" + omodel.HUnderTela + "','" + omodel.HSizing + "','" + omodel.HSellDate + "'" +
                ",'"+ omodel.HRemark2 + "','"+ omodel.HRemark3 + "',"+ omodel.HEmpID + "," + omodel.HCusID + ",'"+ omodel.HColorRemark + "',"+ omodel.HSplitSumQty + ","+ omodel.HSplitColorQty + ",'"+ omodel.HMachineLine + "'" +
                ","+ omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "')");
                ","+ omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HOrderLevID + "')");
                sErr = sErr + "1;";
                //插入子表
                foreach (Model.ClsSc_ProcessExchangeBillSub oSub in DetailColl)
DAL/ÏúÊÛ¹ÜÀí/ClsXs_SeOrderBill.cs
@@ -141,7 +141,7 @@
                        "'," + oSub.HOutStockQty +
                        "," + oSub.HInvoiceQty + 
                        ",'" + oSub.HRemark +
                        ",'" + oSub.HOrderLevID +
                        "','" + oSub.HOrderLevID +
                        "')";
                    oCn.RunProc(subSql);
                }
Model/Model.csproj
@@ -331,6 +331,7 @@
      <SubType>Code</SubType>
    </Compile>
    <Compile Include="基础资料\基础资料\ClsGy_BadResult_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_StockCheckItem_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_InspectInstruMent_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_InspectBasis_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_PostSkill_Model.cs" />
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_AreaSet_Model.cs
@@ -6,7 +6,10 @@
{
    public class ClsGy_AreaSet_Model : DBUtility.ClsGy_Base_Model
    {
        //
        public DateTime HMakeTime;
        public int HUSEORGID;
        public string HMakeEmp;
        public DateTime HModifyTime;
        public string HEnglishName;//    varchar(50) è‹±æ–‡åç§°
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_CusType_Model.cs
@@ -6,6 +6,11 @@
{
    public class ClsGy_CusType_Model : DBUtility.ClsGy_Base_Model
    {
       //
        public DateTime HMakeTime;
        public int HUSEORGID;
        public string HMakeEmp;
        public DateTime HModifyTime;
        public int HERPItemID;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_PoStockStyle_Model.cs
@@ -6,7 +6,11 @@
{
    public class ClsGy_PoStockStyle_Model : DBUtility.ClsGy_Base_Model
    {
        //
        public DateTime HMakeTime;
        public int HUSEORGID;
        public string HMakeEmp;
        public DateTime HModifyTime;
        public int HERPItemID;
        public string HBarCode;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_SellStyle_Model.cs
@@ -6,7 +6,11 @@
{
    public class ClsGy_SellStyle_Model : DBUtility.ClsGy_Base_Model
    {
        //
        public DateTime HMakeTime;
        public int HUSEORGID;
        public string HMakeEmp;
        public DateTime HModifyTime;
        public int HERPItemID;
        public string HBarCode;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_StockCheckItem_Model.cs
New file
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsGy_StockCheckItem_Model : DBUtility.ClsGy_Base_Model
    {
        public DateTime HMakeTime;
        public int HUSEORGID;
        public string HMakeEmp;
        public DateTime HModifyTime;
        public int HERPItemID;
        public DateTime HEndDate;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_SupType_Model.cs
@@ -6,6 +6,10 @@
{
    public class ClsGy_SupType_Model : DBUtility.ClsGy_Base_Model
    {
       //
        public DateTime HMakeTime;
        public int HUSEORGID;
        public string HMakeEmp;
        public DateTime HModifyTime;
        public int HERPItemID;
    }
}
Model/Éú²ú¹ÜÀí/ClsSc_ICMOBillSub.cs
@@ -45,5 +45,7 @@
        public string HCusModel; //客户规格型号 
        public object HOrderPickRemark { get; set; }
        public Int64 HOrderLevID { get; set; }
    }
}
Model/³µ¼ä¹ÜÀí/ClsSc_ProcessExchangeBillMain.cs
@@ -97,5 +97,7 @@
       
        public string HRemark2;//备注2
        public string HRemark3;//底部备注
        public Int64 HOrderLevID;//订单ID
    }
}
WebAPI/Controllers/BLL/Xt_UserController.cs
@@ -765,6 +765,110 @@
        }
        #endregion
        #region  ç”¨æˆ·å…³è”仓库列表查询
        [Route("Xt_User/Gy_UserStockRelationList")]
        [HttpGet]
        public object Gy_UserStockRelationList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserStockRelation_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_Gy_UserStockRelation where 1 = 1";
                string sql = sql1 + sWhere + " order by ç”¨æˆ·ä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_UserStockRelation");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”¨æˆ·å…³è”仓库列表 åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("Xt_User/Gy_UserStockRelationDrop")]
        [HttpGet]
        public object Gy_UserStockRelationDrop(string HItemID, string user)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserStockRelation_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HItemID == null || HItemID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HItemID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                string sql = "delete from Gy_UserStockRelation where HItemID = " + HItemID;
                oCN.RunProc(sql);
                oCN.Commit();
                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 ç”¨æˆ·å…³è”仓库保存
        [Route("Xt_User/SaveUserStock")]
        [HttpPost]
@@ -1565,6 +1669,109 @@
                    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("Xt_User/Gy_UserMaterList")]
        [HttpGet]
        public object Gy_UserMaterList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserMaterList_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_Gy_UserMater where 1 = 1";
                string sql = sql1 + sWhere + " order by ç”¨æˆ·ä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_UserMater");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç”¨æˆ·å…³è”物料列表 åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("Xt_User/Gy_UserMaterRelationDrop")]
        [HttpGet]
        public object Gy_UserMaterRelationDrop(string HItemID, string user)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserMaterList_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HItemID == null || HItemID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HItemID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                string sql = "delete from Gy_UserMaterRelation where HItemID = " + HItemID;
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
@@ -2874,7 +3081,16 @@
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserProcessList_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_Gy_UserProcess where 1 = 1";
                string sql = sql1 + sWhere + " order by ç”¨æˆ·ä»£ç  ";
@@ -2905,5 +3121,60 @@
            }
        }
        #endregion
        #region ç”¨æˆ·å…³è”工序列表 åˆ é™¤
        /// <summary>
        ///参数:string HInterID。
        ///返回值:object。
        /// </summary>
        [Route("Xt_User/Gy_UserProcessDrop")]
        [HttpGet]
        public object Gy_UserProcessDrop(string HItemID, string user)
        {
            try
            {
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_UserProcessList_Drop", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无删除权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HItemID == null || HItemID.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID不能为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                string sql = "delete from Gy_UserByProcess where HItemID = " + HItemID;
                oCN.RunProc(sql);
                oCN.Commit();
                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
    }
}
WebAPI/Controllers/BaseSet/Gy_BadReasonController.cs
@@ -3182,6 +3182,1460 @@
        }
        #endregion
        #region  åœ°åŒº  æŸ¥è¯¢,审核,反审核,禁用,反禁用
        /// <summary>
        /// åœ°åŒº  æŸ¥è¯¢
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_AreaSetList")]
        [HttpGet]
        public object Gy_AreaSetList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_AreaSet_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from  h_v_Gy_AreaSet where 1 = 1";
                string sql = sql1 + sWhere + " order by åœ°åŒºä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_AreaSet");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// åœ°åŒº å®¡æ ¸ã€åå®¡æ ¸
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_AreaSet")]
        [HttpGet]
        public object AuditGy_AreaSet(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_AreaSet_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_AreaSet where HItemID=" + HInterID, "Gy_AreaSet");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    oCN.RunProc("update Gy_AreaSet set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    oCN.RunProc("update Gy_AreaSet set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// åœ°åŒº ç¦ç”¨ã€åç¦ç”¨
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_AreaSet")]
        [HttpGet]
        public object StopGy_AreaSet(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_AreaSet_Close", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "禁用失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_AreaSet where HItemID=" + HInterID, "Gy_AreaSet");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已禁用!不能再次禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未禁用!不需要反禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_AreaSet set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "禁用成功";
                    objJsonResult.data = null;
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_AreaSet set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反禁用成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "禁用失败或者反禁用失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  é”€å”®æ–¹å¼  æŸ¥è¯¢,审核,反审核,禁用,反禁用
        /// <summary>
        /// é”€å”®æ–¹å¼  æŸ¥è¯¢
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_SellStyleList")]
        [HttpGet]
        public object Gy_SellStyleList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SellStyle_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from  h_v_Gy_SellStyle where 1 = 1";
                string sql = sql1 + sWhere + " order by é”€å”®æ–¹å¼ä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_SellStyle");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é”€å”®æ–¹å¼ å®¡æ ¸ã€åå®¡æ ¸
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_SellStyle")]
        [HttpGet]
        public object AuditGy_SellStyle(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_SellStyle_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_SellStyle where HItemID=" + HInterID, "Gy_SellStyle");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    oCN.RunProc("update Gy_SellStyle set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    oCN.RunProc("update Gy_SellStyle set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é”€å”®æ–¹å¼ ç¦ç”¨ã€åç¦ç”¨
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_SellStyle")]
        [HttpGet]
        public object StopGy_SellStyle(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_SellStyle_Close", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "禁用失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_SellStyle where HItemID=" + HInterID, "Gy_SellStyle");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已禁用!不能再次禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未禁用!不需要反禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_SellStyle set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "禁用成功";
                    objJsonResult.data = null;
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_SellStyle set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反禁用成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "禁用失败或者反禁用失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  é‡‡è´­æ–¹å¼  æŸ¥è¯¢,审核,反审核,禁用,反禁用
        /// <summary>
        /// é‡‡è´­æ–¹å¼  æŸ¥è¯¢
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_PoStockStyleList")]
        [HttpGet]
        public object Gy_PoStockStyleList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_PoStockStyle_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from  h_v_Gy_PoStockStyle where 1 = 1";
                string sql = sql1 + sWhere + " order by é‡‡è´­æ–¹å¼ä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_PoStockStyle");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é‡‡è´­æ–¹å¼ å®¡æ ¸ã€åå®¡æ ¸
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_PoStockStyle")]
        [HttpGet]
        public object AuditGy_PoStockStyle(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_PoStockStyle_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_PoStockStyle where HItemID=" + HInterID, "Gy_PoStockStyle");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    oCN.RunProc("update Gy_PoStockStyle set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    oCN.RunProc("update Gy_PoStockStyle set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é‡‡è´­æ–¹å¼ ç¦ç”¨ã€åç¦ç”¨
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_PoStockStyle")]
        [HttpGet]
        public object StopGy_PoStockStyle(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_PoStockStyle_Close", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "禁用失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_PoStockStyle where HItemID=" + HInterID, "Gy_PoStockStyle");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已禁用!不能再次禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未禁用!不需要反禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_PoStockStyle set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "禁用成功";
                    objJsonResult.data = null;
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_PoStockStyle set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反禁用成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "禁用失败或者反禁用失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  ä¾›åº”商分类  æŸ¥è¯¢,审核,反审核,禁用,反禁用
        /// <summary>
        /// ä¾›åº”商分类  æŸ¥è¯¢
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_SupTypeList")]
        [HttpGet]
        public object Gy_SupTypeList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SupType_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from  h_v_Gy_SupType where 1 = 1";
                string sql = sql1 + sWhere + " order by ä¾›åº”商分类代码 ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_SupType");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ä¾›åº”商分类 å®¡æ ¸ã€åå®¡æ ¸
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_SupType")]
        [HttpGet]
        public object AuditGy_SupType(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_SupType_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_SupType where HItemID=" + HInterID, "Gy_SupType");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    oCN.RunProc("update Gy_SupType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    oCN.RunProc("update Gy_SupType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ä¾›åº”商分类 ç¦ç”¨ã€åç¦ç”¨
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_SupType")]
        [HttpGet]
        public object StopGy_SupType(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_SupType_Close", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "禁用失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_SupType where HItemID=" + HInterID, "Gy_SupType");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已禁用!不能再次禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未禁用!不需要反禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_SupType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "禁用成功";
                    objJsonResult.data = null;
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_SupType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反禁用成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "禁用失败或者反禁用失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  å®¢æˆ·åˆ†ç±»  æŸ¥è¯¢,审核,反审核,禁用,反禁用
        /// <summary>
        /// å®¢æˆ·åˆ†ç±»  æŸ¥è¯¢
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_CusTypeList")]
        [HttpGet]
        public object Gy_CusTypeList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_CusType_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from  h_v_Gy_CusType where 1 = 1";
                string sql = sql1 + sWhere + " order by å®¢æˆ·åˆ†ç±»ä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_CusType");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// å®¢æˆ·åˆ†ç±» å®¡æ ¸ã€åå®¡æ ¸
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_CusType")]
        [HttpGet]
        public object AuditGy_CusType(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_CusType_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_CusType where HItemID=" + HInterID, "Gy_CusType");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    oCN.RunProc("update Gy_CusType set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    oCN.RunProc("update Gy_CusType set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// å®¢æˆ·åˆ†ç±» ç¦ç”¨ã€åç¦ç”¨
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_CusType")]
        [HttpGet]
        public object StopGy_CusType(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_CusType_Close", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "禁用失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_CusType where HItemID=" + HInterID, "Gy_CusType");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已禁用!不能再次禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未禁用!不需要反禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_CusType set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "禁用成功";
                    objJsonResult.data = null;
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_CusType set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反禁用成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "禁用失败或者反禁用失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  ç›˜ç‚¹æ–¹æ¡ˆ  æŸ¥è¯¢,审核,反审核,禁用,反禁用
        /// <summary>
        /// ç›˜ç‚¹æ–¹æ¡ˆ  æŸ¥è¯¢
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("Gy_BadReason/Gy_StockCheckItemList")]
        [HttpGet]
        public object Gy_StockCheckItemList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Gy_StockCheckItem_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from  h_v_Gy_StockCheckItem where 1 = 1";
                string sql = sql1 + sWhere + " order by ç›˜ç‚¹æ–¹æ¡ˆä»£ç  ";
                ds = oCN.RunProcReturn(sql, "h_v_Gy_StockCheckItem");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ç›˜ç‚¹æ–¹æ¡ˆ å®¡æ ¸ã€åå®¡æ ¸
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/AuditGy_StockCheckItem")]
        [HttpGet]
        public object AuditGy_StockCheckItem(int HInterID, int IsAudit, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_StockCheckItem_Check", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_StockCheckItem where HItemID=" + HInterID, "Gy_StockCheckItem");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsAudit == 0)  //审核判断
                {
                    oCN.RunProc("update Gy_StockCheckItem set HCheckEmp='" + CurUserName + "',HCheckTime=getdate() where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核成功";
                    objJsonResult.data = null;
                }
                if (IsAudit == 1) //反审核判断
                {
                    oCN.RunProc("update Gy_StockCheckItem set HCheckEmp='',HCheckTime=null where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ç›˜ç‚¹æ–¹æ¡ˆ ç¦ç”¨ã€åç¦ç”¨
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsStop">禁用(0),反禁用(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_BadReason/StopGy_StockCheckItem")]
        [HttpGet]
        public object StopGy_StockCheckItem(int HInterID, int IsStop, string CurUserName)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_StockCheckItem_Close", 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "禁用失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                var ds = oCN.RunProcReturn("select * from Gy_StockCheckItem where HItemID=" + HInterID, "Gy_StockCheckItem");
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (IsStop == 0)  //禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已禁用!不能再次禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsStop == 1) //反禁用判断
                    {
                        if (ds.Tables[0].Rows[0]["HStopEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未禁用!不需要反禁用!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.BeginTran();
                if (IsStop == 0)  //禁用判断
                {
                    oCN.RunProc("update Gy_StockCheckItem set HStopEmp='" + CurUserName + "',HStopTime=getdate(),HStopflag=1 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "禁用成功";
                    objJsonResult.data = null;
                }
                if (IsStop == 1) //反禁用判断
                {
                    oCN.RunProc("update Gy_StockCheckItem set HStopEmp='',HStopTime=null,HStopflag=0 where HItemID=" + HInterID);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反禁用成功";
                    objJsonResult.data = null;
                }
                oCN.Commit();
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "禁用失败或者反禁用失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常类型  æŸ¥è¯¢
        [Route("Gy_BadReason/Gy_ErrTypeList")]
        [HttpGet]
WebAPI/Controllers/Sb_CheckEqpRepairWorkBillController.cs
@@ -129,6 +129,8 @@
        }
        #endregion
        #region è®¾å¤‡ç»´ä¿®å·¥å•列表sql语句
        public static DataSet Sb_EquipRepairWorkBill_s(string sWhere)
        {
WebAPI/Controllers/Sc_MouldRepairInBillListController.cs
@@ -520,6 +520,58 @@
            }
        }
        #region å™¨å…·æ•…障记录统计分析
        /// <summary>
        /// å™¨å…·ç»´ä¿®è®°å½•统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_MouldRepairWorkBill/Sc_MouldConkBookBillMain")]
        [HttpGet]
        public object Sc_MouldConkBookBillMain(string DateYear, string HType, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (DateYear == null || DateYear.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MouldConkBookBillMain'" + DateYear + "','" + HType + "'", "h_p_Sc_MouldConkBookBillMain");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region sql语句
@@ -2895,6 +2947,58 @@
        }
        #endregion
        #region å™¨å…·ç»´ä¿®è®°å½•统计分析
        /// <summary>
        /// å™¨å…·ç»´ä¿®è®°å½•统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_MouldRepairWorkBill/Sb_MouldRepairWorkBill")]
        [HttpGet]
        public object Sb_MouldRepairWorkBill(string DateYear, string HType, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (DateYear == null || DateYear.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sb_MouldRepairWorkBill'" + DateYear + "','" + HType + "'", "h_p_Sb_MouldRepairWorkBill");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ¨¡å…·ç»´ä¿®éªŒæ”¶å•保存/编辑
@@ -3783,6 +3887,57 @@
        }
        #endregion
        #region å™¨å…·ä¿å…»è®°å½•统计分析
        /// <summary>
        /// å™¨å…·ç»´ä¿®è®°å½•统计分析 åˆ—表
        ///参数:string sql。
        ///返回值:object。
        /// </summary>
        [Route("Sb_MouldRepairWorkBill/Sc_MouldMaintainBillMain")]
        [HttpGet]
        public object Sc_MouldMaintainBillMain(string DateYear, string HType, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (DateYear == null || DateYear.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "请选择有效年份";
                    return objJsonResult;
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MouldMaintainBillMain'" + DateYear + "','" + HType + "'", "h_p_Sc_MouldMaintainBillMain");
                }
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region æ¨¡å…·ä¿å…»è®°å½•表
WebAPI/Controllers/WebAPIController.cs
@@ -6179,6 +6179,1687 @@
        }
        #endregion
        #region  åœ°åŒº  è®¾ç½®åˆ—表/保存/编辑/删除方法
        /// <summary>
        ///  åœ°åŒº ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveGy_AreaSetList")]
        [HttpPost]
        public object SaveGy_AreaSetList([FromBody] JObject msg)
        {
            DataSet ds;
            var _value = msg["msg"].ToString();
            string msg3 = _value.ToString();
            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg2 = sArray[1].ToString();
            //查看权限
            if (!DBUtility.ClsPub.Security_Log("Gy_AreaSet_Edit", 1, false, msg2))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_AreaSet ", "Gy_AreaSet");
            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
            {
                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsGy_AreaSet_Ctl oBill = new WebAPI.DLL.ClsGy_AreaSet_Ctl();
                List<Model.ClsGy_AreaSet_Model> lsmain = new List<Model.ClsGy_AreaSet_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_Gy_AreaSet(msg1);
                foreach (Model.ClsGy_AreaSet_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_AreaSet where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_AreaSet");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    else//编辑时判断
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// åœ°åŒºèŽ·å–ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_AreaSetDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_AreaSetDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_AreaSetDetail(HID);
            return model;
        }
        /// <summary>
        /// åœ°åŒºåˆ é™¤åŠŸèƒ½
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_AreaSet")]
        [HttpGet]
        public object DeltetGy_AreaSet(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_AreaSet_Drop", 1, false, user))
                {
                    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_AreaSet where HItemID=" + HItemID, "Gy_AreaSet");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_AreaSet 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;
            }
        }
        #endregion
        #region  é”€å”®æ–¹å¼  è®¾ç½®åˆ—表/保存/编辑/删除方法
        /// <summary>
        /// é”€å”®æ–¹å¼ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveGy_SellStyleList")]
        [HttpPost]
        public object SaveGy_SellStyleList([FromBody] JObject msg)
        {
            DataSet ds;
            var _value = msg["msg"].ToString();
            string msg3 = _value.ToString();
            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg2 = sArray[1].ToString();
            //查看权限
            if (!DBUtility.ClsPub.Security_Log("Gy_SellStyle_Edit", 1, false, msg2))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_SellStyle ", "Gy_SellStyle");
            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
            {
                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsGy_SellStyle_Ctl oBill = new WebAPI.DLL.ClsGy_SellStyle_Ctl();
                List<Model.ClsGy_SellStyle_Model> lsmain = new List<Model.ClsGy_SellStyle_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_Gy_SellStyle(msg1);
                foreach (Model.ClsGy_SellStyle_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_SellStyle where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_SellStyle");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    else//编辑时判断
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é”€å”®æ–¹å¼èŽ·å–ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_SellStyleDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_SellStyleDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_SellStyleDetail(HID);
            return model;
        }
        /// <summary>
        /// é”€å”®æ–¹å¼åˆ é™¤åŠŸèƒ½
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_SellStyle")]
        [HttpGet]
        public object DeltetGy_SellStyle(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SellStyle_Drop", 1, false, user))
                {
                    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_SellStyle where HItemID=" + HItemID, "Gy_SellStyle");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_SellStyle 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;
            }
        }
        #endregion
        #region  é‡‡è´­æ–¹å¼  è®¾ç½®åˆ—表/保存/编辑/删除方法
        /// <summary>
        ///  é‡‡è´­æ–¹å¼ ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveGy_PoStockStyleList")]
        [HttpPost]
        public object SaveGy_PoStockStyleList([FromBody] JObject msg)
        {
            DataSet ds;
            var _value = msg["msg"].ToString();
            string msg3 = _value.ToString();
            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg2 = sArray[1].ToString();
            //查看权限
            if (!DBUtility.ClsPub.Security_Log("Gy_PoStockStyle_Edit", 1, false, msg2))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_PoStockStyle ", "Gy_PoStockStyle");
            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
            {
                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsGy_PoStockStyle_Ctl oBill = new WebAPI.DLL.ClsGy_PoStockStyle_Ctl();
                List<Model.ClsGy_PoStockStyle_Model> lsmain = new List<Model.ClsGy_PoStockStyle_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_Gy_PoStockStyle(msg1);
                foreach (Model.ClsGy_PoStockStyle_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_PoStockStyle where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_PoStockStyle");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    else//编辑时判断
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// é‡‡è´­æ–¹å¼èŽ·å–ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_PoStockStyleDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_PoStockStyleDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_PoStockStyleDetail(HID);
            return model;
        }
        /// <summary>
        /// é‡‡è´­æ–¹å¼åˆ é™¤åŠŸèƒ½
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_PoStockStyle")]
        [HttpGet]
        public object DeltetGy_PoStockStyle(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_PoStockStyle_Drop", 1, false, user))
                {
                    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_PoStockStyle where HItemID=" + HItemID, "Gy_PoStockStyle");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_PoStockStyle 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;
            }
        }
        #endregion
        #region  ä¾›åº”商分类  è®¾ç½®åˆ—表/保存/编辑/删除方法
        /// <summary>
        ///  ä¾›åº”商分类 ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveGy_SupTypeList")]
        [HttpPost]
        public object SaveGy_SupTypeList([FromBody] JObject msg)
        {
            DataSet ds;
            var _value = msg["msg"].ToString();
            string msg3 = _value.ToString();
            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg2 = sArray[1].ToString();
            //查看权限
            if (!DBUtility.ClsPub.Security_Log("Gy_SupType_Edit", 1, false, msg2))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_SupType ", "Gy_SupType");
            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
            {
                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsGy_SupType_Ctl oBill = new WebAPI.DLL.ClsGy_SupType_Ctl();
                List<Model.ClsGy_SupType_Model> lsmain = new List<Model.ClsGy_SupType_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_Gy_SupType(msg1);
                foreach (Model.ClsGy_SupType_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_SupType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_SupType");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    else//编辑时判断
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ä¾›åº”商分类获取信息
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_SupTypeDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_SupTypeDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_SupTypeDetail(HID);
            return model;
        }
        /// <summary>
        /// ä¾›åº”商分类删除功能
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_SupType")]
        [HttpGet]
        public object DeltetGy_SupType(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_SupType_Drop", 1, false, user))
                {
                    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_SupType where HItemID=" + HItemID, "Gy_SupType");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_SupType 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;
            }
        }
        #endregion
        #region  å®¢æˆ·åˆ†ç±»  è®¾ç½®åˆ—表/保存/编辑/删除方法
        /// <summary>
        ///  å®¢æˆ·åˆ†ç±» ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveGy_CusTypeList")]
        [HttpPost]
        public object SaveGy_CusTypeList([FromBody] JObject msg)
        {
            DataSet ds;
            var _value = msg["msg"].ToString();
            string msg3 = _value.ToString();
            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg2 = sArray[1].ToString();
            //查看权限
            if (!DBUtility.ClsPub.Security_Log("Gy_CusType_Edit", 1, false, msg2))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_CusType ", "Gy_CusType");
            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
            {
                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsGy_CusType_Ctl oBill = new WebAPI.DLL.ClsGy_CusType_Ctl();
                List<Model.ClsGy_CusType_Model> lsmain = new List<Model.ClsGy_CusType_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_Gy_CusType(msg1);
                foreach (Model.ClsGy_CusType_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_CusType where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_CusType");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    else//编辑时判断
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// å®¢æˆ·åˆ†ç±»èŽ·å–ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_CusTypeDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_CusTypeDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_CusTypeDetail(HID);
            return model;
        }
        /// <summary>
        /// å®¢æˆ·åˆ†ç±»åˆ é™¤åŠŸèƒ½
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_CusType")]
        [HttpGet]
        public object DeltetGy_CusType(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_CusType_Drop", 1, false, user))
                {
                    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_CusType where HItemID=" + HItemID, "Gy_CusType");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_CusType 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;
            }
        }
        #endregion
        #region  ç›˜ç‚¹æ–¹æ¡ˆ  è®¾ç½®åˆ—表/保存/编辑/删除方法
        /// <summary>
        ///  ç›˜ç‚¹æ–¹æ¡ˆ ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("SaveGy_StockCheckItemList")]
        [HttpPost]
        public object SaveGy_StockCheckItemList([FromBody] JObject msg)
        {
            DataSet ds;
            var _value = msg["msg"].ToString();
            string msg3 = _value.ToString();
            string[] sArray = msg3.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg1 = sArray[0].ToString();
            string msg2 = sArray[1].ToString();
            //查看权限
            if (!DBUtility.ClsPub.Security_Log("Gy_StockCheckItem_Edit", 1, false, msg2))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select isNull(MAX(HItemID),0) HItemID from Gy_StockCheckItem ", "Gy_StockCheckItem");
            if (Maxds != null || Maxds.Tables[0].Rows.Count > 0)
            {
                //HItemID= Maxds.Tables[0].Rows[0]["HItemID"]
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            ListModels oListModels = new ListModels();
            try
            {
                WebAPI.DLL.ClsGy_StockCheckItem_Ctl oBill = new WebAPI.DLL.ClsGy_StockCheckItem_Ctl();
                List<Model.ClsGy_StockCheckItem_Model> lsmain = new List<Model.ClsGy_StockCheckItem_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");
                lsmain = oListModels.getObjectByJson_Gy_StockCheckItems(msg1);
                foreach (Model.ClsGy_StockCheckItem_Model oItem in lsmain)
                {
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (oItem.HName.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!名称不能为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码中不能出现连续‘.’并且首位末位不能为‘.’!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_StockCheckItem where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_StockCheckItem");
                    if (oItem.HNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    //新增时判断
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count == 0)
                        {
                        }
                        else
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = 1;
                            return objJsonResult;
                        }
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    else//编辑时判断
                    {
                        //检查父级是否存在
                        string sParent;
                        sParent = DBUtility.ClsPub.GetParentCode(oItem.HNumber.Trim());
                        if (sParent.Trim() == "")
                        {
                            oBill.oModel.HParentID = 0;
                        }
                        else
                        {
                            if (oBill.HavParentCode(sParent.Trim(), oItem.HItemID))
                            {
                                oBill.oModel.HParentID = oBill.oModel.HItemID;
                            }
                            else
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!上级代码不存在或被禁用!";
                                objJsonResult.data = 1;
                                return objJsonResult;
                            }
                        }
                    }
                    //得到短代码
                    string sShortNumber;
                    sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
                    if (sShortNumber.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!短代码为空!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg2; //创建人
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    //WebAPIController.Add_Log("送货单下推", UserName, "生成送货单");
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        /// <summary>
        /// ç›˜ç‚¹æ–¹æ¡ˆèŽ·å–ä¿¡æ¯
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_StockCheckItemDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_StockCheckItemDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_StockCheckItemDetail(HID);
            return model;
        }
        /// <summary>
        /// ç›˜ç‚¹æ–¹æ¡ˆåˆ é™¤åŠŸèƒ½
        /// </summary>
        /// <returns></returns>
        [Route("DeltetGy_StockCheckItem")]
        [HttpGet]
        public object DeltetGy_StockCheckItem(string HItemID, string user)
        {
            DataSet ds;
            //string ModRightNameCheck = "Sc_ProcessReport_check";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log("Gy_StockCheckItem_Drop", 1, false, user))
                {
                    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_StockCheckItem where HItemID=" + HItemID, "Gy_StockCheckItem");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                oCN.RunProc("delete Gy_StockCheckItem 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;
            }
        }
        #endregion
        /// <summary>
        /// ç”¨å…³è”工序获取信息
        /// </summary>
@@ -6191,6 +7872,32 @@
            return model;
        }
        /// <summary>
        /// ç”¨å…³è”物料获取信息
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_UserMaterDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_UserMaterDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_UserMaterDetail(HID);
            return model;
        }
        /// <summary>
        /// ç”¨å…³è”仓库获取信息
        /// </summary>
        /// <returns></returns>
        [Route("GetGy_UserStockRelationDetail")]
        [HttpGet]
        public ApiResult<DataSet> GetGy_UserStockRelationDetail(string HID)
        {
            var model = LuBaoSevice.GetGy_UserStockRelationDetail(HID);
            return model;
        }
        /// <summary>
        /// æŠ¥åºŸåŽŸå› 
        /// </summary>
WebAPI/Controllers/Éú²ú¹ÜÀí/Éú²úÈÎÎñµ¥/Sc_ICMOBillController.cs
@@ -245,12 +245,12 @@
                ,HMaterID,HUnitID,HRemark,HSourceID,HDeptID,HSTATUS
                ,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney
                ,HINSTOCKTYPE,HCHECKPRODUCT,HQAIP,HISBACKFLUSH,HREQSRC,HSTOCKINQUASELAUXQTY,HSeOrderEntrySEQ,HPROJECTNO,HPRODUCTTYPE,HCOSTRATE,HBASEUNITID
                ,HSTOCKINORGID)
                ,HSTOCKINORGID,HOrderLevID )
                 values({HInterID},{i},{(oSub.HQty == null ? 0 : oSub.HQty)}
                ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}'
                ,'{(oSub.HPlanBeginDate == null ? DateTime.Now.ToString("yyyy-MM-dd") : oSub.HPlanBeginDate.ToString())}','{(oSub.HPlanEndDate == null ? DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") : oSub.HPlanEndDate.ToString())}'
                ,{oSub.HMaterID},{oSub.HUnitID},'{oSub.HRemark}',{oSub.HSourceID},{oSub.HDeptID},{oSub.HSTATUS}
                        ,0,0,'','',0,0,{HINSTOCKTYPE},{HCHECKPRODUCT},{HQAIP},{HISBACKFLUSH},{HREQSRC},{HSTOCKINQUASELAUXQTY},{HSeOrderEntrySEQ},{HPROJECTNO},{HPRODUCTTYPE},{HCOSTRATE},{HBASEUNITID},{oSub.HSTOCKINORGID})");
                        ,0,0,'','',0,0,{HINSTOCKTYPE},{HCHECKPRODUCT},{HQAIP},{HISBACKFLUSH},{HREQSRC},{HSTOCKINQUASELAUXQTY},{HSeOrderEntrySEQ},{HPROJECTNO},{HPRODUCTTYPE},{HCOSTRATE},{HBASEUNITID},{oSub.HSTOCKINORGID},{oSub.HOrderLevID})");
            }
            objJsonResult.code = "1";
WebAPI/DLL/ClsGy_AreaSet_Ctl.cs
New file
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsGy_AreaSet_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_AreaSet_Model oModel = new Model.ClsGy_AreaSet_Model();
        //新增
        public override bool AddNew()
        {
            //
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID,HEnglishName) " +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "','" + oModel.HEnglishName+ "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    ",HModifyTime='" + DateTime.Now + "'" +
                    ",HUSEORGID='" + oModel.HUSEORGID + "'" +
                    ",HEnglishName='" + oModel.HEnglishName+ "'" +
                    ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
                    ",HUseFlag='" + oModel.HUseFlag + "'" +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_AreaSet_Ctl()
        {
            MvarItemKey = "Gy_AreaSet";
            MvarReportTitle = "地区设置";
            oModel = new Model.ClsGy_AreaSet_Model();
        }
    }
}
WebAPI/DLL/ClsGy_CusType_Ctl.cs
New file
@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsGy_CusType_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_CusType_Model oModel = new Model.ClsGy_CusType_Model();
        //新增
        public override bool AddNew()
        {
            //
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    ",HModifyTime='" + DateTime.Now + "'" +
                    ",HUSEORGID='" + oModel.HUSEORGID + "'" +
                    ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
                    ",HUseFlag='" + oModel.HUseFlag + "'" +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_CusType_Ctl()
        {
            MvarItemKey = "Gy_CusType";
            MvarReportTitle = "客户分类设置";
            oModel = new Model.ClsGy_CusType_Model();
        }
    }
}
WebAPI/DLL/ClsGy_PoStockStyle_Ctl.cs
New file
@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsGy_PoStockStyle_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_PoStockStyle_Model oModel = new Model.ClsGy_PoStockStyle_Model();
        //新增
        public override bool AddNew()
        {
            //
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    ",HModifyTime='" + DateTime.Now + "'" +
                    ",HUSEORGID='" + oModel.HUSEORGID + "'" +
                    ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
                    ",HUseFlag='" + oModel.HUseFlag + "'" +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_PoStockStyle_Ctl()
        {
            MvarItemKey = "Gy_PoStockStyle";
            MvarReportTitle = "采购方式设置";
            oModel = new Model.ClsGy_PoStockStyle_Model();
        }
    }
}
WebAPI/DLL/ClsGy_SellStyle_Ctl.cs
New file
@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsGy_SellStyle_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_SellStyle_Model oModel = new Model.ClsGy_SellStyle_Model();
        //新增
        public override bool AddNew()
        {
            //
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    ",HModifyTime='" + DateTime.Now + "'" +
                    ",HUSEORGID='" + oModel.HUSEORGID + "'" +
                    ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
                    ",HUseFlag='" + oModel.HUseFlag + "'" +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_SellStyle_Ctl()
        {
            MvarItemKey = "Gy_SellStyle";
            MvarReportTitle = "销售方式设置";
            oModel = new Model.ClsGy_SellStyle_Model();
        }
    }
}
WebAPI/DLL/ClsGy_StockCheckItem_Ctl.cs
New file
@@ -0,0 +1,102 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsGy_StockCheckItem_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_StockCheckItem_Model oModel = new Model.ClsGy_StockCheckItem_Model();
        //新增
        public override bool AddNew()
        {
            //
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID,HEndDate) " +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "','" + oModel.HEndDate + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    ",HModifyTime='" + DateTime.Now + "'" +
                    ",HUSEORGID='" + oModel.HUSEORGID + "'" +
                    ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
                    ",HEndDate  ='" + oModel.HEndDate + "'" +
                    ",HUseFlag='" + oModel.HUseFlag + "'" +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_StockCheckItem_Ctl()
        {
            MvarItemKey = "Gy_StockCheckItem";
            MvarReportTitle = "盘点方案设置";
            oModel = new Model.ClsGy_StockCheckItem_Model();
        }
    }
}
WebAPI/DLL/ClsGy_SupType_Ctl.cs
New file
@@ -0,0 +1,101 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace WebAPI.DLL
{
    public class ClsGy_SupType_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_SupType_Model oModel = new Model.ClsGy_SupType_Model();
        //新增
        public override bool AddNew()
        {
            //
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HMakeTime,HUSEORGID,HUseFlag,HMakeEmp,HCREATEORGID) " +
                    " Values('" + oModel.HNumber + "','" + oModel.HName + "','" + oModel.HHelpCode + "','" + oModel.HShortNumber + "'," + oModel.HParentID.ToString() +
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "','" +DateTime.Now+ "','" + oModel.HUSEORGID + "','" + oModel.HUseFlag + "','" + oModel.HMakeEmp+ "','" + oModel.HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    ",HModifyTime='" + DateTime.Now + "'" +
                    ",HUSEORGID='" + oModel.HUSEORGID + "'" +
                    ",HModifyEmp ='" + oModel.HMakeEmp + "'" +
                    ",HUseFlag='" + oModel.HUseFlag + "'" +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_SupType_Ctl()
        {
            MvarItemKey = "Gy_SupType";
            MvarReportTitle = "供应商分类设置";
            oModel = new Model.ClsGy_SupType_Model();
        }
    }
}
WebAPI/ListModels.cs
@@ -862,6 +862,78 @@
            return list;
        }
        /// <summary>
        /// å¤„理新增地区表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_AreaSet_Model> getObjectByJson_Gy_AreaSet(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_AreaSet_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_AreaSet_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增销售方式表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_SellStyle_Model> getObjectByJson_Gy_SellStyle(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_SellStyle_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SellStyle_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增采购方式表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_PoStockStyle_Model> getObjectByJson_Gy_PoStockStyle(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_PoStockStyle_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_PoStockStyle_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增盘点方案表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>s
        public List<Model.ClsGy_StockCheckItem_Model> getObjectByJson_Gy_StockCheckItems(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_StockCheckItem_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_StockCheckItem_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增客户分类表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_CusType_Model> getObjectByJson_Gy_CusType(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_CusType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_CusType_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增供应商分类表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_SupType_Model> getObjectByJson_Gy_SupType(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_SupType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SupType_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增异常类型表的json
        /// </summary>
WebAPI/Service/LuBaoSevice.cs
@@ -331,6 +331,44 @@
        }
        /// <summary>
        /// ç”¨æˆ·å…³è”仓库根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_UserStockRelationDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_UserStockRelationDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在用户关联仓库数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_UserStockRelationDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select  * from h_v_Gy_UserStockRelation  where ç”¨æˆ·ä»£ç = '" + HID + "' ", "h_v_Gy_UserStockRelation");
            return dataSet;
        }
        /// <summary>
        /// ç”¨æˆ·å…³è”物料根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_UserMaterDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_UserMaterDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在用户关联物料数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_UserMaterDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select  * from h_v_Gy_UserMater  where ç”¨æˆ·ä»£ç = '" + HID + "' ", "h_v_Gy_UserMater");
            return dataSet;
        }
        /// <summary>
        /// å²—位技能根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_PostSkillDetail(string HID)
@@ -427,6 +465,120 @@
        }
        /// <summary>
        ///地区据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_AreaSetDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_AreaSetDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在地区数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_AreaSetDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_AreaSet  where HItemID= " + HID + " ", "h_v_Gy_AreaSet");
            return dataSet;
        }
        /// <summary>
        ///销售方式根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_SellStyleDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_SellStyleDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在销售方式数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_SellStyleDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_SellStyle  where HItemID= " + HID + " ", "h_v_Gy_SellStyle");
            return dataSet;
        }
        /// <summary>
        ///采购方式根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_PoStockStyleDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_PoStockStyleDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在采购方式数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_PoStockStyleDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_PoStockStyle  where HItemID= " + HID + " ", "h_v_Gy_PoStockStyle");
            return dataSet;
        }
        /// <summary>
        /// ä¾›åº”商分类根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_SupTypeDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_SupTypeDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在采购方式数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_SupTypeDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_SupType  where HItemID= " + HID + " ", "h_v_Gy_SupType");
            return dataSet;
        }
        /// <summary>
        ///客户分类根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_CusTypeDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_CusTypeDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在客户分类数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_CusTypeDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_CusType  where HItemID= " + HID + " ", "h_v_Gy_CusType");
            return dataSet;
        }
        /// <summary>
        ///盘点方案根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_StockCheckItemDetail(string HID)
        {
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            var dataSet = GetGy_StockCheckItemDb(HID);
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在盘点方案数据" };
            return new ApiResult<DataSet> { code = 1, msg = "查询成功", data = dataSet };
        }
        public static DataSet GetGy_StockCheckItemDb(string HID)
        {
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Gy_StockCheckItem  where HItemID= " + HID + " ", "h_v_Gy_StockCheckItem");
            return dataSet;
        }
        /// <summary>
        /// è®¡é‡å•位根据id获取信息
        /// </summary>
        public static ApiResult<DataSet> GetGy_UnitBillDetail(string HID)
WebAPI/WebAPI.csproj
@@ -619,6 +619,12 @@
    <Compile Include="DbUntil\DataFormatUntil.cs" />
    <Compile Include="DLL\ClsGy_InspectInstruMent_Ctl.cs" />
    <Compile Include="DLL\ClsGy_InspectBasis_Ctl.cs" />
    <Compile Include="DLL\ClsGy_PoStockStyle_Ctl.cs" />
    <Compile Include="DLL\ClsGy_AreaSet_Ctl.cs" />
    <Compile Include="DLL\ClsGy_CusType_Ctl.cs" />
    <Compile Include="DLL\ClsGy_StockCheckItem_Ctl.cs" />
    <Compile Include="DLL\ClsGy_SupType_Ctl.cs" />
    <Compile Include="DLL\ClsGy_SellStyle_Ctl.cs" />
    <Compile Include="DLL\ClsGy_PostSkill_Ctl.cs" />
    <Compile Include="DLL\ClsGy_StockOutStyle_Ctl.cs" />
    <Compile Include="DLL\ClsGy_StockInStyle_Ctl.cs" />