yangle
2022-12-15 ccfc7f25cbb5e78d335b44648a9964426a38a17f
Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
18个文件已修改
17个文件已添加
3548 ■■■■■ 已修改文件
BaseSet/公用资料/其他基础资料/Gy_MatePriceSup.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_Operator_Ctl.cs 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_Property_Ctl.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_Staff_Ctl.cs 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_Work_Ctl.cs 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/其他基础资料/ClsGy_MatePriceSup_Ctl.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/其他基础资料/ClsGy_MatePriceSup_Model.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_Employee_Model.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_Operator_Model.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_Property_Model.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_Staff_Model.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_TaxMIXMain_Model.cs 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_TaxMIXSub_Model.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_Unit_Model.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_Work_Model.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/系统公用/ClsXt_BillType_Model.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BLL/Xt_BillTypeController.cs 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs 84 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_PropertyController.cs 324 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_UnitController.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_CustLocationController.cs 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_MatePriceSupController.cs 332 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_OperatorController.cs 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_SettleStyleController.cs 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_StaffController.cs 395 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_TaxMIXController.cs 416 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_WorkController.cs 392 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 96 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/基础资料/Gy_StockPlace.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/基础资料/Warehouse.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
BaseSet/¹«ÓÃ×ÊÁÏ/ÆäËû»ù´¡×ÊÁÏ/Gy_MatePriceSup.cs
@@ -553,7 +553,7 @@
                    oSub.HPrice = ClsPub.isDoule(grdMain.Rows[i].Cells[HPriceCol].Value);
                    oSub.HBeginDate = ClsPub.isDate(grdMain.Rows[i].Cells[HBeginDateCol].Value);
                    oSub.HEndDate = ClsPub.isDate(grdMain.Rows[i].Cells[HEndDateCol].Value);
                    oSub.HUsed = true;
                    oSub.HUsed = 1;
                    oSub.HMaker = ClsPub.CurUserName;
                    oSub.HMakeDate = DBUtility.ClsPub.isDate(ClsPub.GetServerDate(-1));
                    BillNew.DetailColl.Add(oSub);
DAL/DAL.csproj
@@ -85,7 +85,9 @@
    <Compile Include="仓库管理\条码管理\ClsGy_BarCodeBill_ChaiMa.cs" />
    <Compile Include="基础资料\InterFace基础资料\ClsIF_ORGANIZATIONS_View.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_CustLocation_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_Operator_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_RateType_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_Staff_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_TaxRate_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_RecCondition_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_FactoryDayOff_Ctl.cs" />
@@ -94,6 +96,7 @@
    <Compile Include="基础资料\公用基础资料\ClsGy_PaymentCondition_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_SupplierContact_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_StockStatus_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_Work_Ctl.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_MateMould_Ctl.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_QCCheckProject_View.cs" />
    <Compile Include="基础资料\其他基础资料\ClsGy_StdWorkTimes_Ctl.cs" />
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_Operator_Ctl.cs
New file
@@ -0,0 +1,97 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsGy_Operator_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_Operator_Model oModel = new Model.ClsGy_Operator_Model();
        //新增
        public override bool AddNew()
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HUSEORGID" +
                    ",HOperatorId,HOperatorType,HSEQ,HStaffId,HIsUse) " +
                    " 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 +  "','" + oModel.HUseFlag + "'," + oModel.HUSEORGID + "," + oModel.HOperatorId +
                    ",'" + oModel.HOperatorType + "'," + oModel.HSEQ + "," + oModel.HStaffId + "," + oModel.HIsUse + ")", 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 + "'" +
                    ",HLevel=" + oModel.HLevel.ToString() +
                    ",HParentID=" + oModel.HParentID.ToString() +
                    ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "' Where HItemID=" + sItemID, 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_Operator_Ctl()
        {
            MvarItemKey = "Gy_Operator";
            MvarReportTitle = "业务员设置";
            oModel = new Model.ClsGy_Operator_Model();
        }
    }
}
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_Property_Ctl.cs
@@ -20,9 +20,9 @@
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HPropertyTypeID) " +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HPropertyTypeID,HUSEORGID,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 + "'," + oModel.HPropertyTypeID.ToString() + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                    "," + oModel.HLevel.ToString() + "," + Convert.ToString(oModel.HEndFlag ? 1 : 0) + "," + Convert.ToString(oModel.HStopflag ? 1 : 0) + ",'" + oModel.HRemark + "'," + oModel.HPropertyTypeID.ToString() + "," + oModel.HUSEORGID + "," + oModel.HCREATEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_Staff_Ctl.cs
New file
@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsGy_Staff_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_Staff_Model oModel = new Model.ClsGy_Staff_Model();
        //新增
        public override bool AddNew()
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HUSEORGID" +
                    ",HCREATEORGID,HPERSONID,HPOSTID,HFIRSTCARDID,HDEPTID,HSTAFFNUMBER) " +
                    " 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 + "','" + oModel.HUseFlag + "'," + oModel.HUSEORGID + "," + oModel.HCREATEORGID +
                    "," + oModel.HPERSONID + "," + oModel.HPOSTID + "," + oModel.HFIRSTCARDID + "," + oModel.HDEPTID +
                    ",'" + oModel.HSTAFFNUMBER + "')", 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 + "'" +
                    ",HLevel=" + oModel.HLevel.ToString() +
                    ",HParentID=" + oModel.HParentID.ToString() +
                    ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "'" +
                    ",HDEPTID=" + oModel.HDEPTID + " Where HItemID=" + sItemID, 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_Staff_Ctl()
        {
            MvarItemKey = "Gy_Staff";
            MvarReportTitle = "员工设置";
            oModel = new Model.ClsGy_Staff_Model();
        }
    }
}
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_Work_Ctl.cs
New file
@@ -0,0 +1,98 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public class ClsGy_Work_Ctl : DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_Work_Model oModel = new Model.ClsGy_Work_Model();
        //新增
        public override bool AddNew()
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HUSEORGID" +
                    ",HCREATEORGID,HWORKCENTERID) " +
                    " 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 + "','" + oModel.HUseFlag + "'," + oModel.HUSEORGID + "," + oModel.HCREATEORGID +
                    "," + oModel.HWORKCENTERID + ")", 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 + "'" +
                    ",HLevel=" + oModel.HLevel.ToString() +
                    ",HParentID=" + oModel.HParentID.ToString() +
                    ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "'" +
                    ",HWORKCENTERID=" + oModel.HWORKCENTERID + " Where HItemID=" + sItemID, 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_Work_Ctl()
        {
            MvarItemKey = "Gy_Work";
            MvarReportTitle = "作业设置";
            oModel = new Model.ClsGy_Work_Model();
        }
    }
}
DAL/»ù´¡×ÊÁÏ/ÆäËû»ù´¡×ÊÁÏ/ClsGy_MatePriceSup_Ctl.cs
@@ -11,6 +11,7 @@
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public List<Model.ClsGy_MatePriceSup_Model> DetailColl = new List<Model.ClsGy_MatePriceSup_Model>();
        public Model.ClsGy_MatePriceSup_Model oModel = new Model.ClsGy_MatePriceSup_Model();
@@ -58,17 +59,26 @@
            try
            {
                oCn.BeginTran();
                //插入子表
                foreach (Model.ClsGy_MatePriceSup_Model oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Gy_MatePriceSup " +
                        " (HInterID,HEntryID,HMaterID,HRelationID" +
                //插入表
                //foreach (Model.ClsGy_MatePriceSup_Model oSub in DetailColl)
                //{
                //    oCn.RunProc("Insert into Gy_MatePriceSup " +
                //        " (HInterID,HEntryID,HMaterID,HRelationID" +
                //        ",HUnitID,HBeginQty,HEndQty,HCurID,HType" +
                //        ",HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)" +
                //        " values(" + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() +
                //        "," + oSub.HUnitID.ToString() + "," + oSub.HBeginQty.ToString() + "," + oSub.HEndQty.ToString() + "," + oSub.HCurID.ToString() + ",'" + oSub.HType + "'" +
                //        "," + oSub.HPrice.ToString() + ",'" + "GETDATE()" + "','" + "GETDATE()" + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
                //}
                oCn.RunProc("Insert into " + MvarItemKey + " " +
                    " (HInterID,HEntryID,HMaterID,HRelationID" +
                        ",HUnitID,HBeginQty,HEndQty,HCurID,HType" +
                        ",HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)" +
                        " values(" + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() +
                        "," + oSub.HUnitID.ToString() + "," + oSub.HBeginQty.ToString() + "," + oSub.HEndQty.ToString() + "," + oSub.HCurID.ToString() + ",'" + oSub.HType + "'" +
                        "," + oSub.HPrice.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
                }
                        ",HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate) " +
                        " values(" + oModel.HInterID.ToString() + "," + oModel.HEntryID.ToString() + "," + oModel.HMaterID.ToString() + "," + oModel.HRelationID.ToString() +
                        "," + oModel.HUnitID.ToString() + "," + oModel.HBeginQty.ToString() + "," + oModel.HEndQty.ToString() + "," + oModel.HCurID.ToString() + ",'" + oModel.HType + "'" +
                        "," + oModel.HPrice.ToString() + ",'" + oModel.HBeginDate + "','" + oModel.HEndDate + "'," + oModel.HUsed + ",'" + oModel.HRemark + "','" + oModel.HMaker + "','" + oModel.HMakeDate + "') ");
                //修改上级为非末级代码
                //oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
@@ -85,18 +95,25 @@
            try
            {
                oCn.BeginTran();
                DeleteByID(sItemID);        //删除记录
                //插入表
                foreach (Model.ClsGy_MatePriceSup_Model oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Gy_MatePriceSup " +
                        " (HInterID,HEntryID,HMaterID,HRelationID" +
                        ",HUnitID,HBeginQty,HEndQty,HCurID,HType" +
                        ",HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)" +
                        " values(" + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() +
                        "," + oSub.HUnitID.ToString() + "," + oSub.HBeginQty.ToString() + "," + oSub.HEndQty.ToString() + "," + oSub.HCurID.ToString() + ",'" + oSub.HType + "'" +
                        "," + oSub.HPrice.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
                }
                oCn.RunProc("Update " + MvarItemKey + " set " +
                   " HPrice='" + oModel.HPrice + "'" +
                   ",HRemark='" + oModel.HRemark + "'" +
                   ",HMaterID=" + oModel.HMaterID.ToString() +
                   ",HUnitID=" + oModel.HUnitID.ToString() +
                   ",HCurID=" + oModel.HCurID.ToString() +
                 " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //DeleteByID(sItemID);        //删除记录
                ////插入表
                //foreach (Model.ClsGy_MatePriceSup_Model oSub in DetailColl)
                //{
                //    oCn.RunProc("Insert into Gy_MatePriceSup " +
                //        " (HInterID,HEntryID,HMaterID,HRelationID" +
                //        ",HUnitID,HBeginQty,HEndQty,HCurID,HType" +
                //        ",HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)" +
                //        " values(" + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + "," + oSub.HRelationID.ToString() +
                //        "," + oSub.HUnitID.ToString() + "," + oSub.HBeginQty.ToString() + "," + oSub.HEndQty.ToString() + "," + oSub.HCurID.ToString() + ",'" + oSub.HType + "'" +
                //        "," + oSub.HPrice.ToString() + ",'" + oSub.HBeginDate + "','" + oSub.HEndDate + "'," + Convert.ToString(oSub.HUsed ? 1 : 0) + ",'" + oSub.HRemark + "','" + oSub.HMaker + "','" + oSub.HMakeDate + "') ");
                //}
                oCn.Commit();
                return true;
            }
@@ -190,6 +207,7 @@
        {
            MvarItemKey = "Gy_MatePriceSup";
            MvarReportTitle = "采购价格资料设置";
            oModel = new Model.ClsGy_MatePriceSup_Model();
        }
    }
}
Model/Model.csproj
@@ -325,7 +325,11 @@
    <Compile Include="基础资料\基础资料\ClsGy_CareFor_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_CheckToolsType_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_CustLocation_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_Operator_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_RateType_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_Staff_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_TaxMIXMain_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_TaxMIXSub_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_TaxRate_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_PaymentCondition_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_Company_Model.cs" />
@@ -399,6 +403,7 @@
    <Compile Include="基础资料\基础资料\ClsGy_BarCodeCheckType_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_Item30JiTai_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_User_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_Work_Model.cs" />
    <Compile Include="工位看板\ClsGy_SOPBillMain.cs" />
    <Compile Include="工位看板\ClsGy_SOPBillSub.cs" />
    <Compile Include="工资管理\ClsHR_EmpDimissionBillMain.cs" />
@@ -584,6 +589,7 @@
    <Compile Include="系统公用\ClsOA_EmpMessageBillModSub.cs" />
    <Compile Include="系统公用\ClsOA_FieldToChangeMain.cs" />
    <Compile Include="系统公用\ClsOA_FieldToChangeSub.cs" />
    <Compile Include="系统公用\ClsXt_BillType_Model.cs" />
    <Compile Include="系统公用\ClsXt_ModuleParameterMain.cs" />
    <Compile Include="系统公用\ClsXt_ModuleParameterSub.cs" />
    <Compile Include="行政管理\ClsOF_DormCheckBookBillMain.cs" />
Model/»ù´¡×ÊÁÏ/ÆäËû»ù´¡×ÊÁÏ/ClsGy_MatePriceSup_Model.cs
@@ -16,7 +16,7 @@
        public DateTime HMakeDate;//    datetime
        public string HChecker;//    varchar(50)            --审核人(列表可批量审核)
        public DateTime HCheckDate;//    datetime
        public bool HUsed;//        bit                //使用标记
        public long HUsed;//        bit                //使用标记
        //--------------------------------------------
        public long HMaterID;//    int            --物料内码
        public long HRelationID;//    int            --关联内码(供应商,客户,供应商大类,客户大类,等等)
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Employee_Model.cs
@@ -99,5 +99,7 @@
        public string HAddress ;            //家庭地址 varchar(300)
        public Int64 HProcID;              //int      æ‰€ä½œå·¥åº(关联出生产资源)
        public string HBarCode;
        public long HUSEORGID;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Operator_Model.cs
New file
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsGy_Operator_Model : DBUtility.ClsGy_Base_Model
    {
        public string HHelpCode;//助记码
        public string HUseFlag;    //使用状态(未检测,未使用,已使用)
        public Int64 HUSEORGID;//业务组织
        public Int64 HOperatorId;//业务员内码
        public string HOperatorType;//业务员类型
        public Int64 HSEQ;//序号
        public Int64 HStaffId;//职员
        public Int64 HIsUse;//启用
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Property_Model.cs
@@ -9,5 +9,10 @@
       //
        public Int64 HPropertyTypeID;//   int  æ‰€å±žç±»åˆ«
        public string HBarCode;
        public Int64 HERPItemID;
        public string HMakeTime;
        public Int64 HUSEORGID;//使用组织
        public Int64 HCREATEORGID;//创建组织
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Staff_Model.cs
New file
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsGy_Staff_Model : DBUtility.ClsGy_Base_Model
    {
        public Int64 HUSEORGID;       //使用组织(Xt_ORGANIZATIONS)
        public Int64 HCREATEORGID;        //创建组织(Xt_ORGANIZATIONS)
        public Int64 HPERSONID;       //人员内码
        public Int64 HPOSTID;        //岗位内码
        public Int64 HFIRSTCARDID;        //主证件内码
        public Int64 HDEPTID;        //部门内码
        public string HSTAFFNUMBER;    //员工编号
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_TaxMIXMain_Model.cs
New file
@@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsGy_TaxMIXMain_Model : DBUtility.ClsGy_Base_Model
    {
        public DateTime HMakeTime { get; set; }
        public DateTime HCheckTime { get; set; }
        public DateTime HModifyTime { get; set; }
        public DateTime HStopTime { get; set; }
        public string HMakeEmp { get; set; }
        public string HCheckEmp { get; set; }
        public string HModifyEmp { get; set; }
        public string HStopEmp { get; set; }
        public int HUSEORGID { get; set; }
        public int HCREATEORGID { get; set; }
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_TaxMIXSub_Model.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsGy_TaxMIXSub_Model : DBUtility.ClsGy_Base_Model
    {
        public Int64 HItemID;                   //主键 int
        public string HTAXBENCHMARK;
        public Int64 FTAXRATEID;
        public double FTAXBENCHMARKCORRVALUE;
        public Int64 HTAXMIXID;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Unit_Model.cs
@@ -11,5 +11,6 @@
        public bool HStandard;//          '默认
        public string HBarCode;
        public int HUSEORGID;
        public int HCREATEORGID;
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_Work_Model.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsGy_Work_Model : DBUtility.ClsGy_Base_Model
    {
        public Int64 HUSEORGID;  //使用组织(Xt_ORGANIZATIONS)
        public Int64 HCREATEORGID;//创建组织(Xt_ORGANIZATIONS)
        public Int64 HWORKCENTERID;//工作中心
    }
}
Model/ϵͳ¹«ÓÃ/ClsXt_BillType_Model.cs
New file
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Model
{
    public class ClsXt_BillType_Model : DBUtility.ClsGy_Base_Model
    {
        public string HTemplate;  //模块名
        public string HHeadTable; //数据库主表
        public string HEntryTable; //数据库子表
        public string HViewName;
        public string HRightName;
        public string HBilltypeID;
    }
}
WebAPI/Controllers/BLL/Xt_BillTypeController.cs
@@ -268,7 +268,49 @@
            }
        }
        #region å•据类型 é‡‘蝶同步
        [Route("Xt_BillType/SaveXt_BillTypeListApi")]
        [HttpPost]
        public object SaveXt_BillTypeListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsXt_BillType_Model> lsmain = new List<Model.ClsXt_BillType_Model>();
                lsmain = oListModels.getObjectByJson_Xt_BillType(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Xt_BillType where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                //sql = "set identity_insert Xt_BillType on";
                //oCN.RunProc(sql);
        //
                oCN.RunProc($@"insert into Xt_BillType(HBilltypeID,HNumber,HName,HTemplate,HHeadTable,HEntryTable,HViewName,HRightName)
                  values('{lsmain[0].HBilltypeID}','{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HTemplate}','{lsmain[0].HHeadTable}','{lsmain[0].HEntryTable}','{lsmain[0].HViewName}','{lsmain[0].HRightName}' )", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Xt_BillType off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/BaseSet/Gy_EmployeeController.cs
@@ -891,7 +891,65 @@
            }
        }
        #region èŒå‘˜ é‡‘蝶同步
        [Route("Gy_Employee/SaveGy_EmployeeListApi")]
        [HttpPost]
        public object SaveGy_EmployeeListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_Employee_Model> lsmain = new List<Model.ClsGy_Employee_Model>();
                lsmain = oListModels.getObjectByJson_Gy_Employee(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_Employee where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_Employee on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_Employee(HItemID,HNumber, HName, HShortNumber, HEmpRate, HExamRate
                      ,HLevel,HParentID,HEndflag,HHighestPay,HOverPayRate
                      ,HStopflag,HRemark,HHelpCode,HInsuranceSubsidy
                      ,HBirthday,HGradDate,HInsuranceDate,HContractBDate,HContractEDate
                      ,HJobCardEDate,HCheckCardEDate,HStayCardEDate,HHealthCardEDate
                      ,HAge,HSalaryLev,HContractYear,HInsuranceStatus,HSignStatus
                      ,HSex,HMarr,HBlighty,HNation,HBlightyType
                      ,HGovStatus,HBloodType,HStature,HAvoird,HKnowLev
                      ,HProTitleID,HGradSchool,HEngLev,HCompLev,HSpec
                      ,HEmail,HNowAdd,HHomeAdd,HIDCard,HLinkPhone,HMobilePhone,HFax
                      ,HOldCompany,HInsuranceNo,HJobCardNo,HArchivesNo,HWorkType,HDimissionReason
                      ,HDimissionDate,HInComDate,HSignDate,HRelDate
                      ,HPostID,HDormID,HDutyID,HLeftMoneyRate
                      ,HEmpType,HPayType,HOverType,HNoBrushFlag,HShiftFlag,HStopwagesFlag
                      ,HPostalCode,HBank,HBasePay,HExamLevPostMoney,HBSTDeptID
                      ,HOtherDeduct3,HInsurance,HMedicare,HDrydock
                      ,HBankAccount,HGroupID,HDeptID,HWorkTypeID,HCTPrjID,HUSEORGID,HAddress)
                  values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HShortNumber}',{lsmain[0].HEmpRate},{lsmain[0].HExamRate},{lsmain[0].HLevel},{lsmain[0].HParentID},{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{lsmain[0].HHighestPay},{lsmain[0].HOverPayRate},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}','{lsmain[0].HHelpCode}',{lsmain[0].HInsuranceSubsidy},'{lsmain[0].HBirthDay}','{lsmain[0].HGradDate}','{lsmain[0].HInsuranceDate}','{lsmain[0].HContractBDate}','{lsmain[0].HContractEDate}','{lsmain[0].HJobCardEDate}','{lsmain[0].HCheckCardEDate}','{lsmain[0].HStayCardEDate}','{lsmain[0].HHealthCardEDate}',{lsmain[0].HAge},'{lsmain[0].HSalaryLev}',{lsmain[0].HContractYear},{lsmain[0].HInsuranceStatus},{lsmain[0].HSignStatus},'{lsmain[0].HSex}','{lsmain[0].HMarr}','{lsmain[0].HBlighty}','{lsmain[0].HNation}','{lsmain[0].HBlightyType}','{lsmain[0].HGovStatus}','{lsmain[0].HBloodType}','{lsmain[0].HStature}','{lsmain[0].HAvoird}','{lsmain[0].HKnowLev}','{lsmain[0].HProTitleID}','{lsmain[0].HGradSchool}','{lsmain[0].HEngLev}','{lsmain[0].HCompLev}','{lsmain[0].HSpec}','{lsmain[0].HEmail}','{lsmain[0].HNowAdd}','{lsmain[0].HHomeAdd}','{lsmain[0].HIDCard}','{lsmain[0].HLinkPhone}','{lsmain[0].HMobilePhone}','{lsmain[0].HFax}','{lsmain[0].HOldCompany}','{lsmain[0].HInsuranceNo}','{lsmain[0].HJobCardNo}','{lsmain[0].HArchivesNo}','{lsmain[0].HWorkType}','{lsmain[0].HDimissionReason}','{lsmain[0].HDimissionDate}','{lsmain[0].HInComDate}','{lsmain[0].HSignDate}','{lsmain[0].HRelDate}',{lsmain[0].HPostID},{lsmain[0].HDormID},{lsmain[0].HDutyID},{lsmain[0].HLeftMoneyRate},'{lsmain[0].HEmpType}','{lsmain[0].HPayType}','{lsmain[0].HOverType}',{lsmain[0].HNoBrushFlag},{lsmain[0].HShiftFlag},{lsmain[0].HStopwagesFlag},'{lsmain[0].HPostalCode}','{lsmain[0].HBank}',{lsmain[0].HBasePay},{lsmain[0].HExamLevPostMoney},{lsmain[0].HBSTDeptID},{lsmain[0].HOtherDeduct3},{lsmain[0].HInsurance},{lsmain[0].HMedicare},{lsmain[0].HDrydock},'{lsmain[0].HBankAccount}',{lsmain[0].HGroupID},{lsmain[0].HDeptID},{lsmain[0].HWorkTypeID},{lsmain[0].HCTPrjID},{lsmain[0].HUSEORGID},'{lsmain[0].HAddress}')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_Employee off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/BaseSet/Gy_ICBomBillController.cs
New file
@@ -0,0 +1,84 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    public class Gy_ICBomBillController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        [Route("Gy_ICBomBill/Gy_ICBomBillaveApi")]
        [HttpPost]
        public object Gy_ICBomBillaveApi([FromBody] JObject oMain)
        {
            try
            {
                var model = oMain["model"].ToString();
                var subModel = oMain["model"]["HENTRY"].ToString();
                //反序列化
                model = "[" + model + "]";
                List<Model.ClsGy_ICBomBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ICBomBillMain>>(model);
                List<Model.ClsGy_ICBomBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_ICBomBillSub>>(subModel);
                string sql = string.Empty;
                oCN.BeginTran();
                sql = $"delete Gy_ICBomBillMain where HinterID = {mainList[0].HInterID}";
                oCN.RunProc(sql);
                sql = $"delete Gy_ICBomBillSub where HinterID = {mainList[0].HInterID}";
                oCN.RunProc(sql);
                oCN.RunProc("Insert Into Gy_ICBomBillMain   " +
                "(HBillType,HInterID,HBillNo,HDate" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate,HMaterTypeID,HStatus" +
                ",HMaterID,HParentID,HVersion,HPicNo,HPropertyID" +
                ",HUnitID,HQty,HProdRate,HJump" +
                ") " +
                " values('" + mainList[0].HBillType + "'," + mainList[0].HInterID.ToString() + ",'" + mainList[0].HBillNo + "','" + mainList[0].HDate + "'" +
                "," + mainList[0].HYear.ToString() + "," + mainList[0].HPeriod.ToString() + ",'" + mainList[0].HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate(),'" + mainList[0].HMaterTypeID.ToString() + "','" + mainList[0].HStatus +
                "','" + mainList[0].HMaterID.ToString() + "'," + mainList[0].HParentID.ToString() + ",'" + mainList[0].HVersion + "','" + mainList[0].HPicNo + "'," + mainList[0].HPropertyID.ToString() +
                "," + mainList[0].HUnitID.ToString() + "," + mainList[0].HQty.ToString() + "," + mainList[0].HProdRate.ToString() + ",'" + mainList[0].HJump + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsGy_ICBomBillSub oSub in subList)
                {
                    oCN.RunProc("Insert into Gy_ICBomBillSub " +
                      " (HInterID,HEntryID,HMaterID,HRemark2" +
                      ",HQty,HUnitID,HRemark3,HRelQty,HWasteRate" +
                      ",HProcID,HWhID,HRemark4,HChildType," +
                      "HCloseMan,HCloseType,HRemark," +
                      "HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ") values("
                      + oSub.HInterID.ToString() + "," + oSub.HEntryID.ToString() + "," + oSub.HMaterID.ToString() + ",'" + oSub.HRemark2 + "'" +
                      "," + oSub.HQty.ToString() + "," + oSub.HUnitID.ToString() + ",'" + oSub.HRemark3 + "'," + oSub.HRelQty.ToString() + "," + oSub.HWasteRate.ToString() +
                      "," + oSub.HProcID.ToString() + "," + oSub.HWhID.ToString() + ",'" + oSub.HRemark4 + "','" + oSub.HChildType.ToString() + "'" +
                      ",'" + oSub.HCloseMan + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + ",'" + oSub.HRemark + "'" +
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      ") ");
                }
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "新增单据成功!";
                //objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.Message;
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
    }
}
WebAPI/Controllers/BaseSet/Gy_PropertyController.cs
@@ -26,7 +26,7 @@
        /// </summary>
        [Route("Gy_Property/list")]
        [HttpGet]
        public object list(string sWhere,string user)
        public object list(string sWhere,string user, string Organization)
        {
            try
            {
@@ -87,8 +87,328 @@
            }
        }
        #region  è¾…助属性 ç¼–辑
        [Route("Gy_Property/PropertyEdit")]
        [HttpPost]
        public object PropertyEdit([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();
            //string msg_HUSEORGID = sArray[2].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无保存权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            //获取最大ID值赋值
            //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
            //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
            //    maxid += 1;
            //    HItemID = maxid;
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_Property_Ctl oBill = new DAL.ClsGy_Property_Ctl();
                List<Model.ClsGy_Property_Model> lsmain = new List<Model.ClsGy_Property_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_Property(msg1);
                foreach (Model.ClsGy_Property_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;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_Property where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Property");
                    if (oItem.HItemID == 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!代码重复!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                    }
        //
                    //新增时判断
                    #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
                    /*
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count > 0)
                        {
                            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;
                            }
                        }
                    }
                    */
                    #endregion
                    //得到短代码
                    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.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = 1; //等级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    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;
            }
        }
        #endregion
        #region  è¾…助属性 åˆ é™¤
        [Route("Gy_Property/Delete")]
        [HttpGet]
        public object Delete(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                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_Property where HItemID=" + HItemID, "Gy_Property");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
                if (HStopflag)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "数据已禁用无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("delete from Gy_Property 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 è¾…助属性 é‡‘蝶同步
        //[Route("Gy_Property/SaveGy_PropertyListApi")]
        //[HttpPost]
        //public object SaveGy_PropertyListApi([FromBody] JObject msg)
        //{
        //    try
        //    {
        //        var _value = msg["model"].ToString();
        //        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        //        ListModels oListModels = new ListModels();
        //        List<Model.ClsGy_Property_Model> lsmain = new List<Model.ClsGy_Property_Model>();
        //        lsmain = oListModels.getObjectByJson_Gy_Property(_value);
        //        string sql = string.Empty;
        //        //保存
        //        oCN.BeginTran();
        //        sql = $"delete Gy_Property where HItemID = {lsmain[0].HItemID}";
        //        oCN.RunProc(sql);
        //        sql = "set identity_insert Gy_Property on";
        //        oCN.RunProc(sql);
        //        oCN.RunProc($@"insert into Gy_Property(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID
        //            ,HLevel,HEndFlag,HStopflag,HRemark,HPropertyTypeID,HUseFlag,HERPItemID,HMakeTime)
        //          values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HHelpCode}','{lsmain[0].HShortNumber}',{lsmain[0].HParentID},{lsmain[0].HLevel}
        //   ,{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}',{lsmain[0].HPropertyTypeID},'{lsmain[0].HUseFlag}',{lsmain[0].HERPItemID},'{lsmain[0].HMakeTime}')", ref DBUtility.ClsPub.sExeReturnInfo);
        //        //修改上级为非末级代码
        //        sql = "set identity_insert Gy_Property off";
        //        oCN.RunProc(sql);
        //        oCN.Commit();
        //        objJsonResult.code = "1";
        //        objJsonResult.count = 1;
        //        objJsonResult.Message = "保存成功!";
        //        objJsonResult.data = 1;
        //        return objJsonResult;
        //    }
        //    catch (Exception e)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "保存失败!" + e.ToString();
        //        objJsonResult.data = 1;
        //        return objJsonResult;
        //    }
        //}
        //#endregion
    }
}
WebAPI/Controllers/BaseSet/Gy_UnitController.cs
@@ -335,10 +335,10 @@
                oCN.RunProc(sql);
                oCN.RunProc("Insert into Gy_Unit" +
                    " (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HRate,HStandard,HUSEORGID) " +
                    ",HLevel,HEndFlag,HStopflag,HRemark,HRate,HStandard,HUSEORGID,HCREATEORGID) " +
                    " Values('" + lsmain[0].HItemID + "','" + lsmain[0].HNumber + "','" + lsmain[0].HName + "','" + lsmain[0].HHelpCode + "','" + lsmain[0].HShortNumber + "'," + lsmain[0].HParentID.ToString() +
                    "," + lsmain[0].HLevel.ToString() + "," + Convert.ToString(lsmain[0].HEndFlag ? 1 : 0) + "," + Convert.ToString(lsmain[0].HStopflag ? 1 : 0) + ",'" + lsmain[0].HRemark +
                    "'," + lsmain[0].HRate.ToString() + "," + DBUtility.ClsPub.BoolToString(lsmain[0].HStandard) + "," + lsmain[0].HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                    "'," + lsmain[0].HRate.ToString() + "," + DBUtility.ClsPub.BoolToString(lsmain[0].HStandard) + "," + lsmain[0].HUSEORGID + "," + lsmain[0].HCREATEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_Unit off";
                oCN.RunProc(sql);
WebAPI/Controllers/BaseSet/Gy_WarehouseController.cs
@@ -407,11 +407,13 @@
        {
            try
            {
                var _value = msg["model"].ToString();
                var model = msg["model"].ToString();
                var stockplaceModel = msg["model"]["HStockplaceEntry"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //反序列化
                _value = "[" + _value.ToString() + "]";
                List<Warehouse> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Warehouse>>(_value);
                model = "[" + model.ToString() + "]";
                List<Warehouse> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Warehouse>>(model);//仓库
                List<Gy_StockPlace> stockplaceList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_StockPlace>>(stockplaceModel);//仓位
                string sql = string.Empty;
                //DataTable dt = DataHelper.ListToDataTable<Warehouse>(list);
                //oCN.SqlBulkCopyByDatatable("Gy_Warehouse", dt);
@@ -423,11 +425,25 @@
                oCN.RunProc(sql);
                oCN.RunProc("Insert into Gy_Warehouse  " +
                       " (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                       ",HLevel,HEndFlag,HStopflag,HRemark,HEmpID,HAddress,HPhone,HUSEORGID) " +
                       ",HLevel,HEndFlag,HStopflag,HRemark,HEmpID,HAddress,HPhone,HUSEORGID,HCREATEORGID) " +
                       " Values('" + list[0].HItemID + "','" + list[0].HNumber + "','" +list[0].HName + "','" + list[0].HHelpCode + "','" + list[0].HShortNumber + "'," + list[0].HParentID.ToString() +
                       "," + list[0].HLevel.ToString() + "," + Convert.ToString(list[0].HEndFlag ? 1 : 0) + "," + Convert.ToString(list[0].HStopFlag ? 1 : 0) + ",'" + list[0].HRemark + "'," + list[0].HEmpID.ToString() + ",'" + list[0].HAddress + "','" + list[0].HPhone + "','" + list[0].HUSEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                       "," + list[0].HLevel.ToString() + "," + Convert.ToString(list[0].HEndFlag ? 1 : 0) + "," + Convert.ToString(list[0].HStopFlag ? 1 : 0) + ",'" + list[0].HRemark + "'," + list[0].HEmpID.ToString() + ",'" + list[0].HAddress + "','" + list[0].HPhone + "','" + list[0].HUSEORGID + "','" + list[0].HCREATEORGID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_Warehouse off";
                oCN.RunProc(sql);
                sql = $"delete gy_stockplace where HSPGroupID in ({list[0].HItemID})";
                oCN.RunProc(sql);
                sql = "set identity_insert gy_stockplace on";
                oCN.RunProc(sql);
                foreach (var item in stockplaceList)
                {
                    oCN.RunProc("Insert into gy_stockplace  " +
                       " (HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                       ",HLevel,HEndFlag,HStopflag,HRemark,HUSEORGID,HCREATEORGID,HSPGroupID,HSPType,HSrcSPType,HDesSPType) " +
                       " Values('" + item.HItemID + "','" + item.HNumber + "','" + item.HName + "','" + item.HHelpCode + "','" + item.HShortNumber + "'," + item.HParentID.ToString() +
                       "," + item.HLevel.ToString() + "," + Convert.ToString(item.HEndFlag ? 1 : 0) + "," + Convert.ToString(item.HStopFlag ? 1 : 0) + ",'" + item.HRemark + "','" + item.HUSEORGID + "','" + item.HCREATEORGID + "','" + item.HSPGroupID + "','" + item.HSPType + "','" + item.HSrcSPType + "','" + item.HDesSPType + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                }
                sql = "set identity_insert gy_stockplace off";
                oCN.RunProc(sql);
                oCN.Commit();
@@ -439,6 +455,7 @@
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_CustLocationController.cs
@@ -342,55 +342,5 @@
            }
        }
        #endregion
        #region äº¤è´§åœ°ç‚¹ é‡‘蝶同步
        [Route("Gy_CustLocation/SaveGy_CustLocationListApi")]
        [HttpPost]
        public object SaveGy_CustLocationListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_CustLocation_Model> lsmain = new List<Model.ClsGy_CustLocation_Model>();
                lsmain = oListModels.getObjectByJson_Gy_CustLocation(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_CustLocation where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_CustLocation on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_CustLocation(HItemID,HNumber,HName ,HShortNumber,HParentID ,HLevel
                                ,HEndFla,HStopflag,HRemark ,HHelpCode ,HUseFlag
                                 ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp
                                 ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID)
                  values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HShortNumber}',{lsmain[0].HParentID},{lsmain[0].HLevel}
           ,{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}','{lsmain[0].HHelpCode}','{lsmain[0].HUseFlag}'
            ,'{lsmain[0].HMakeTime}','{lsmain[0].HMakeEmp}','{lsmain[0].HCheckEmp}','{lsmain[0].HCheckTime}','{lsmain[0].HModifyEmp}'
            ,'{lsmain[0].HModifyTime}','{lsmain[0].HStopEmp}',null,{lsmain[0].HUSEORGID},{lsmain[0].HCREATEORGID})", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_CustLocation off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_MatePriceSupController.cs
New file
@@ -0,0 +1,332 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_MatePriceSupController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region  é‡‡è´­ä»·æ ¼ åˆ—表
        [Route("Gy_MatePriceSup/MatePriceSupList")]
        [HttpGet]
        public object MatePriceSupList(string sWhere, string user, string Organization)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string sql1 = string.Format(@"select * from h_v_Gy_MatePriceSupList where 1 = 1 ");
                string sql = sql1 + sWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Gy_MatePriceSupList");
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  é‡‡è´­ä»·æ ¼ ç¼–辑
        [Route("Gy_MatePriceSup/MatePriceSupEdit")]
        [HttpPost]
        public object MatePriceSupEdit([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();
            //string msg_HUSEORGID = sArray[2].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无保存权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            //获取最大ID值赋值
            //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
            //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
            //    maxid += 1;
            //    HItemID = maxid;
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_MatePriceSup_Ctl oBill = new DAL.ClsGy_MatePriceSup_Ctl();
                List<Model.ClsGy_MatePriceSup_Model> lsmain = new List<Model.ClsGy_MatePriceSup_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_MatePriceSup(msg1);
                foreach (Model.ClsGy_MatePriceSup_Model oItem in lsmain)
                {
                    //新增时判断
                    #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
                    /*
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count > 0)
                        {
                            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;
                            }
                        }
                    }
                    */
                    #endregion
                    //oItem.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    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;
            }
        }
        #endregion
        #region  é‡‡è´­ä»·æ ¼ åˆ é™¤
        [Route("Gy_MatePriceSup/Delete")]
        [HttpGet]
        public object Delete(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                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_MatePriceSup where HItemID=" + HItemID, "Gy_MatePriceSup");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                //var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
                //if (HStopflag)
                //{
                //    oCN.RollBack();//回滚事务
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "数据已禁用无法删除!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                oCN.RunProc("delete from Gy_MatePriceSup 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 é‡‡è´­ä»·æ ¼ é‡‘蝶同步
        [Route("Gy_MatePriceSup/SaveGy_MatePriceSupListApi")]
        [HttpPost]
        public object SaveGy_MatePriceSupListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_MatePriceSup_Model> lsmain = new List<Model.ClsGy_MatePriceSup_Model>();
                lsmain = oListModels.getObjectByJson_Gy_MatePriceSup(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_MatePriceSup where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_MatePriceSup on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_MatePriceSup(HItemID,HInterID,HEntryID,HMaterID,HRelationID,HUnitID,HBeginQty,HEndQty,HCurID,HType
                        ,HPrice,HBeginDate,HEndDate,HUsed,HRemark,HMaker,HMakeDate)
                  values({lsmain[0].HItemID},{lsmain[0].HInterID},{lsmain[0].HEntryID},{lsmain[0].HMaterID},{lsmain[0].HRelationID},{lsmain[0].HUnitID},{lsmain[0].HBeginQty},{lsmain[0].HEndQty},{lsmain[0].HCurID},'{lsmain[0].HType}',{lsmain[0].HPrice},'{lsmain[0].HBeginDate}','{lsmain[0].HEndDate}','{lsmain[0].HUsed}','{lsmain[0].HRemark}','{lsmain[0].HMaker}','{lsmain[0].HMakeDate}')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_MatePriceSup off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_OperatorController.cs
New file
@@ -0,0 +1,393 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_OperatorController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region  ä¸šåŠ¡å‘˜ åˆ—表
        [Route("Gy_Operator/OperatorList")]
        [HttpGet]
        public object OperatorList(string sWhere, string user, string Organization)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string sql1 = string.Format(@"select * from h_v_Gy_OperatorList where 1 = 1 ");
                string sql = sql1 + sWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Gy_OperatorList");
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  ä¸šåŠ¡å‘˜ ç¼–辑
        [Route("Gy_Operator/OperatorEdit")]
        [HttpPost]
        public object OperatorEdit([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();
            //string msg_HUSEORGID = sArray[2].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无保存权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            //获取最大ID值赋值
            //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
            //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
            //    maxid += 1;
            //    HItemID = maxid;
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_Operator_Ctl oBill = new DAL.ClsGy_Operator_Ctl();
                List<Model.ClsGy_Operator_Model> lsmain = new List<Model.ClsGy_Operator_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_Operator(msg1);
                foreach (Model.ClsGy_Operator_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;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_Operator where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Operator");
                    if (oItem.HItemID == 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!代码重复!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                    }
                    //新增时判断
                    #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
                    /*
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count > 0)
                        {
                            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;
                            }
                        }
                    }
                    */
                    #endregion
                    //得到短代码
                    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.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = 1; //等级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    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;
            }
        }
        #endregion
        #region  ä¸šåŠ¡å‘˜ åˆ é™¤
        [Route("Gy_Operator/Delete")]
        [HttpGet]
        public object Delete(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                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_Operator where HItemID=" + HItemID, "Gy_Operator");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
                if (HStopflag)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "数据已禁用无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("delete from Gy_Operator 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 ä¸šåŠ¡å‘˜ é‡‘蝶同步
        [Route("Gy_Operator/SaveGy_OperatorListApi")]
        [HttpPost]
        public object SaveGy_OperatorListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_Operator_Model> lsmain = new List<Model.ClsGy_Operator_Model>();
                lsmain = oListModels.getObjectByJson_Gy_Operator(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_Operator where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_Operator on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_Operator(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID
                    ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HUSEORGID,HOperatorId,HOperatorType,HSEQ,HStaffId,HIsUse)
                  values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HHelpCode}','{lsmain[0].HShortNumber}',
                        {lsmain[0].HParentID},{lsmain[0].HLevel},{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },
                        '{lsmain[0].HRemark}','{lsmain[0].HUseFlag}',{lsmain[0].HUSEORGID},{lsmain[0].HOperatorId},'{lsmain[0].HOperatorType}',
                        {lsmain[0].HSEQ},{lsmain[0].HStaffId},{lsmain[0].HIsUse})", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_Operator off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_SettleStyleController.cs
New file
@@ -0,0 +1,393 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_SettleStyleController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region  ç»“算方式 åˆ—表
        [Route("Gy_SettleStyle/SettleStyleList")]
        [HttpGet]
        public object SettleStyleList(string sWhere, string user, string Organization)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string sql1 = string.Format(@"select * from h_v_Gy_SettleStyleList where 1 = 1 ");
                string sql = sql1 + sWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Gy_SettleStyleList");
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  ç»“算方式 ç¼–辑
        [Route("Gy_SettleStyle/SettleStyleEdit")]
        [HttpPost]
        public object SettleStyleEdit([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();
            //string msg_HUSEORGID = sArray[2].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无保存权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            //获取最大ID值赋值
            //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
            //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
            //    maxid += 1;
            //    HItemID = maxid;
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_SettleStyle_Ctl oBill = new DAL.ClsGy_SettleStyle_Ctl();
                List<Model.ClsGy_SettleStyle_Model> lsmain = new List<Model.ClsGy_SettleStyle_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_SettleStyle(msg1);
                foreach (Model.ClsGy_SettleStyle_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;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_SettleStyle where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_SettleStyle");
                    if (oItem.HItemID == 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!代码重复!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                    }
                    //新增时判断
                    #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
                    /*
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count > 0)
                        {
                            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;
                            }
                        }
                    }
                    */
                    #endregion
                    //得到短代码
                    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.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = 1; //等级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    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;
            }
        }
        #endregion
        #region  ç»“算方式 åˆ é™¤
        [Route("Gy_SettleStyle/Delete")]
        [HttpGet]
        public object Delete(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                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_SettleStyle where HItemID=" + HItemID, "Gy_SettleStyle");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
                if (HStopflag)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "数据已禁用无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("delete from Gy_SettleStyle 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 ç»“算方式 é‡‘蝶同步
        [Route("Gy_SettleStyle/SaveGy_SettleStyleListApi")]
        [HttpPost]
        public object SaveGy_SettleStyleListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_SettleStyle_Model> lsmain = new List<Model.ClsGy_SettleStyle_Model>();
                lsmain = oListModels.getObjectByJson_Gy_SettleStyle(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_SettleStyle where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_SettleStyle on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_SettleStyle(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID
                    ,HLevel,HEndFlag,HStopflag,HRemark)
                  values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HHelpCode}','{lsmain[0].HShortNumber}',{lsmain[0].HParentID},{lsmain[0].HLevel}
           ,{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },'{lsmain[0].HRemark}')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_SettleStyle off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_StaffController.cs
New file
@@ -0,0 +1,395 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_StaffController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region  å‘˜å·¥ åˆ—表
        [Route("Gy_Staff/StaffList")]
        [HttpGet]
        public object StaffList(string sWhere, string user, string Organization)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string sql1 = string.Format(@"select * from h_v_Gy_StaffList where 1 = 1 ");
                string sql = sql1 + sWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Gy_StaffList");
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  å‘˜å·¥ ç¼–辑
        [Route("Gy_Staff/StaffEdit")]
        [HttpPost]
        public object StaffEdit([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();
            //string msg_HUSEORGID = sArray[2].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无保存权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            //获取最大ID值赋值
            //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
            //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
            //    maxid += 1;
            //    HItemID = maxid;
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_Staff_Ctl oBill = new DAL.ClsGy_Staff_Ctl();
                List<Model.ClsGy_Staff_Model> lsmain = new List<Model.ClsGy_Staff_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_Staff(msg1);
                foreach (Model.ClsGy_Staff_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;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_Staff where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Staff");
                    if (oItem.HItemID == 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!代码重复!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                    }
                    //新增时判断
                    #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
                    /*
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count > 0)
                        {
                            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;
                            }
                        }
                    }
                    */
                    #endregion
                    //得到短代码
                    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.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = 1; //等级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    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;
            }
        }
        #endregion
        #region  å‘˜å·¥ åˆ é™¤
        [Route("Gy_Staff/Delete")]
        [HttpGet]
        public object Delete(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                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_Staff where HItemID=" + HItemID, "Gy_Staff");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
                if (HStopflag)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "数据已禁用无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("delete from Gy_Staff 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 å‘˜å·¥ é‡‘蝶同步
        [Route("Gy_Staff/SaveGy_StaffListApi")]
        [HttpPost]
        public object SaveGy_StaffListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_Staff_Model> lsmain = new List<Model.ClsGy_Staff_Model>();
                lsmain = oListModels.getObjectByJson_Gy_Staff(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_Staff where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_Staff on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_Staff(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID
                            ,HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HUSEORGID
                            ,HCREATEORGID,HPERSONID,HPOSTID,HFIRSTCARDID,HDEPTID,HSTAFFNUMBER)
                  values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HHelpCode}','{lsmain[0].HShortNumber}',
                        {lsmain[0].HParentID},{lsmain[0].HLevel},{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },
                        '{lsmain[0].HRemark}','{lsmain[0].HUseFlag}',{lsmain[0].HUSEORGID},{lsmain[0].HCREATEORGID},{lsmain[0].HPERSONID},
                        {lsmain[0].HPOSTID},{lsmain[0].HFIRSTCARDID},{lsmain[0].HDEPTID},'{lsmain[0].HSTAFFNUMBER}')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_Staff off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_TaxMIXController.cs
New file
@@ -0,0 +1,416 @@
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_TaxMIXController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        //#region  ç¨ŽçŽ‡ç»„åˆ åˆ—表
        //[Route("Gy_TaxMIX/TaxMIXList")]
        //[HttpGet]
        //public object TaxMIXList(string sWhere, string user, string Organization)
        //{
        //    try
        //    {
        //        List<object> columnNameList = new List<object>();
        //        //编辑权限
        //        //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user))
        //        //{
        //        //    objJsonResult.code = "0";
        //        //    objJsonResult.count = 0;
        //        //    objJsonResult.Message = "无查看权限!";
        //        //    objJsonResult.data = null;
        //        //    return objJsonResult;
        //        //}
        //        string sql1 = string.Format(@"select * from h_v_Gy_TaxMIXList where ä½¿ç”¨ç»„织='" + Organization + "'");
        //        string sql = sql1 + sWhere;
        //        ds = oCN.RunProcReturn(sql, "h_v_Gy_TaxMIXList");
        //        //添加列名
        //        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.list = columnNameList;
        //        objJsonResult.data = ds.Tables[0];
        //        return objJsonResult;
        //    }
        //    catch (Exception e)
        //    {
        //        objJsonResult.code = "0";
        //        objJsonResult.count = 0;
        //        objJsonResult.Message = "Exception!" + e.ToString();
        //        objJsonResult.data = null;
        //        return objJsonResult;
        //    }
        //}
        //#endregion
        //#region  ç¨ŽçŽ‡ç»„åˆ ç¼–辑
        //[Route("Gy_TaxMIX/TaxMIXEdit")]
        //[HttpPost]
        //public object TaxMIXEdit([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();
        //    //string msg_HUSEORGID = sArray[2].ToString();
        //    Int64 HItemID = 0;
        //    SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        //    //编辑权限
        //    //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
        //    //{
        //    //    objJsonResult.code = "0";
        //    //    objJsonResult.count = 0;
        //    //    objJsonResult.Message = "无保存权限!";
        //    //    objJsonResult.data = null;
        //    //    return objJsonResult;
        //    //}
        //    //获取最大ID值赋值
        //    //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
        //    //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
        //    //    maxid += 1;
        //    //    HItemID = maxid;
        //    //}
        //    ListModels oListModels = new ListModels();
        //    try
        //    {
        //        DAL.ClsGy_TaxMIX_Ctl oBill = new DAL.ClsGy_TaxMIX_Ctl();
        //        List<Model.ClsGy_TaxMIX_Model> lsmain = new List<Model.ClsGy_TaxMIX_Model>();
        //        msg1 = msg1.Replace("\\", "");
        //        msg1 = msg1.Replace("\n", "");  //\n
        //        lsmain = oListModels.getObjectByJson_Gy_TaxMIX(msg1);
        //        foreach (Model.ClsGy_TaxMIX_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;
        //            }
        //            //查询数据中是否存在重复代码
        //            ds = oCN.RunProcReturn("select * from  Gy_TaxMIX where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_TaxMIX");
        //            if (oItem.HItemID == 0)
        //            {
        //                if (ds.Tables[0].Rows.Count > 0)
        //                {
        //                    objJsonResult.code = "0";
        //                    objJsonResult.count = 0;
        //                    objJsonResult.Message = "保存失败!代码重复!";
        //                    objJsonResult.data = null;
        //                    return objJsonResult;
        //                }
        //            }
        //            else
        //            {
        //                if (ds.Tables[0].Rows.Count > 0)
        //                {
        //                    if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
        //                    {
        //                        objJsonResult.code = "0";
        //                        objJsonResult.count = 0;
        //                        objJsonResult.Message = "保存失败!代码重复!";
        //                        objJsonResult.data = null;
        //                        return objJsonResult;
        //                    }
        //                }
        //            }
        //            //新增时判断
        //            #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
        //            /*
        //            if (oItem.HItemID == 0)
        //            {
        //                if (ds == null || ds.Tables[0].Rows.Count > 0)
        //                {
        //                    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;
        //                    }
        //                }
        //            }
        //            */
        //            #endregion
        //            //得到短代码
        //            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.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
        //            oItem.HShortNumber = sShortNumber;//短代码
        //            oItem.HEndFlag = true;//末级标志
        //            oItem.HLevel = 1; //等级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
        //            oBill.oModel = oItem;
        //        }
        //        //保存
        //        //保存完毕后处理
        //        bool bResult;
        //        if (oBill.oModel.HItemID == 0)
        //        {
        //            bResult = oBill.AddNew();
        //        }
        //        else
        //        {
        //            bResult = oBill.ModifyByID(oBill.oModel.HItemID);
        //        }
        //        if (bResult)
        //        {
        //            objJsonResult.code = "1";
        //            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;
        //    }
        //}
        //#endregion
        //#region  ç¨ŽçŽ‡ç»„åˆ åˆ é™¤
        //[Route("Gy_TaxMIX/Delete")]
        //[HttpGet]
        //public object Delete(string HItemID, string user)
        //{
        //    DataSet ds;
        //    try
        //    {
        //        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        //        //删除权限
        //        //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
        //        //{
        //        //    objJsonResult.code = "0";
        //        //    objJsonResult.count = 0;
        //        //    objJsonResult.Message = "无删除权限";
        //        //    objJsonResult.data = null;
        //        //    return objJsonResult;
        //        //}
        //        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_TaxMIX where HItemID=" + HItemID, "Gy_TaxMIX");
        //        if (ds == null || ds.Tables[0].Rows.Count == 0)
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "没有数据,无法删除!";
        //            objJsonResult.data = null;
        //            return objJsonResult; ;
        //        }
        //        var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
        //        if (HStopflag)
        //        {
        //            oCN.RollBack();//回滚事务
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "数据已禁用无法删除!";
        //            objJsonResult.data = null;
        //            return objJsonResult;
        //        }
        //        oCN.RunProc("delete from Gy_TaxMIX 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 ç¨ŽçŽ‡ç»„åˆ é‡‘蝶同步
        [Route("Gy_TaxMIXMain/SaveGy_TaxMIXMainListApi")]
        [HttpPost]
        public object SaveGy_TaxMIXListApi([FromBody] JObject sMainSub)
        {
            try
            {
                var model = sMainSub["model"].ToString();
                var entry = sMainSub["model"]["HENTRY"].ToString();
                model = "[" + model.ToString() + "]";
                List<ClsGy_TaxMIXMain_Model> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_TaxMIXMain_Model>>(model);
                List<ClsGy_TaxMIXSub_Model> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_TaxMIXSub_Model>>(entry);
                string sql = string.Empty;
                oCN.BeginTran();
                sql = $"delete Gy_TaxMIXMain where HItemID = {mainList[0].HItemID}";
                oCN.RunProc(sql);
                sql = $"delete Gy_TaxMIXSub where HItemID = {mainList[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_TaxMIXMain on";
                oCN.RunProc(sql);
                //主表
                oCN.RunProc($@"insert into Gy_TaxMIXMain(HItemID,HNumber,HName ,HShortNumber,HParentID ,HLevel
                                ,HEndFlag,HStopflag,HRemark ,HHelpCode ,HUseFlag
                                 ,HMakeTime ,HMakeEmp ,HCheckEmp ,HCheckTime ,HModifyEmp
                                 ,HModifyTime ,HStopEmp ,HStopTime ,HUSEORGID,HCREATEORGID)
                  values({mainList[0].HItemID},'{mainList[0].HNumber}','{mainList[0].HName}','{mainList[0].HShortNumber}',{mainList[0].HParentID},{mainList[0].HLevel}
                   ,{Convert.ToString(mainList[0].HEndFlag ? 1 : 0)},{Convert.ToString(mainList[0].HStopflag ? 1 : 0) },'{mainList[0].HRemark}','{mainList[0].HHelpCode}','{mainList[0].HUseFlag}'
                    ,'{mainList[0].HMakeTime}','{mainList[0].HMakeEmp}','{mainList[0].HCheckEmp}','{mainList[0].HCheckTime}','{mainList[0].HModifyEmp}'
                    ,'{mainList[0].HModifyTime}','{mainList[0].HStopEmp}',null,{mainList[0].HUSEORGID},{mainList[0].HCREATEORGID})", ref DBUtility.ClsPub.sExeReturnInfo);
                sql = "set identity_insert Gy_TaxMIXMain off";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_TaxMIXSub on";
                oCN.RunProc(sql);
                //保存主表
                foreach (var oSub in subList)
                {
                    oCN.RunProc($@"Insert into Gy_TaxMIXSub
                (HItemID,HTAXMIXID,HTAXBENCHMARK,FTAXRATEID)
                 values({oSub.HItemID},{oSub.HTAXMIXID},'{oSub.HTAXBENCHMARK}'
                ,{oSub.FTAXRATEID})");
                }
                sql = "set identity_insert Gy_TaxMIXSub off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "单据保存成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_WorkController.cs
New file
@@ -0,0 +1,392 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers.基础资料.基础资料
{
    public class Gy_WorkController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        #region  ä½œä¸š åˆ—表
        [Route("Gy_Work/WorkList")]
        [HttpGet]
        public object WorkList(string sWhere, string user, string Organization)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //编辑权限
                //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Query", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无查看权限!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                string sql1 = string.Format(@"select * from h_v_Gy_WorkList where 1 = 1 ");
                string sql = sql1 + sWhere;
                ds = oCN.RunProcReturn(sql, "h_v_Gy_WorkList");
                //添加列名
                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.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region  ä½œä¸š ç¼–辑
        [Route("Gy_Work/WorkEdit")]
        [HttpPost]
        public object WorkEdit([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();
            //string msg_HUSEORGID = sArray[2].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            //if (!DBUtility.ClsPub.Security_Log_second("Gy_TaxRate_Edit", 1, false, msg2))
            //{
            //    objJsonResult.code = "0";
            //    objJsonResult.count = 0;
            //    objJsonResult.Message = "无保存权限!";
            //    objJsonResult.data = null;
            //    return objJsonResult;
            //}
            //获取最大ID值赋值
            //DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_TaxRate ", "Gy_TaxRate");
            //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"].ToString()==""?0: Maxds.Tables[0].Rows[0]["HItemID"]));
            //    maxid += 1;
            //    HItemID = maxid;
            //}
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_Work_Ctl oBill = new DAL.ClsGy_Work_Ctl();
                List<Model.ClsGy_Work_Model> lsmain = new List<Model.ClsGy_Work_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_Work(msg1);
                foreach (Model.ClsGy_Work_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;
                    }
                    //查询数据中是否存在重复代码
                    ds = oCN.RunProcReturn("select * from  Gy_Work where HStopflag=0 and HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Work");
                    if (oItem.HItemID == 0)
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "保存失败!代码重复!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    else
                    {
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            if (ds.Tables[0].Rows[0]["HItemID"].ToString() != oItem.HItemID.ToString())
                            {
                                objJsonResult.code = "0";
                                objJsonResult.count = 0;
                                objJsonResult.Message = "保存失败!代码重复!";
                                objJsonResult.data = null;
                                return objJsonResult;
                            }
                        }
                    }
                    //新增时判断
                    #region çˆ¶çº§æ ¡éªŒæ–¹æ³•(api调用先注释掉,)
                    /*
                    if (oItem.HItemID == 0)
                    {
                        if (ds == null || ds.Tables[0].Rows.Count > 0)
                        {
                            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;
                            }
                        }
                    }
                    */
                    #endregion
                    //得到短代码
                    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.HUSEORGID = Convert.ToInt32(msg_HUSEORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = 1; //等级 DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim())
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.oModel.HItemID == 0)
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    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;
            }
        }
        #endregion
        #region  ä½œä¸š åˆ é™¤
        [Route("Gy_Work/Delete")]
        [HttpGet]
        public object Delete(string HItemID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                //删除权限
                //if (!DBUtility.ClsPub.Security_Log("Gy_TaxRate_Drop", 1, false, user))
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "无删除权限";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                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_Work where HItemID=" + HItemID, "Gy_Work");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有数据,无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult; ;
                }
                var HStopflag = Convert.ToBoolean(ds.Tables[0].Rows[0]["HStopflag"]);
                if (HStopflag)
                {
                    oCN.RollBack();//回滚事务
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "数据已禁用无法删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.RunProc("delete from Gy_Work 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 ä½œä¸š é‡‘蝶同步
        [Route("Gy_Work/SaveGy_WorkListApi")]
        [HttpPost]
        public object SaveGy_WorkListApi([FromBody] JObject msg)
        {
            try
            {
                var _value = msg["model"].ToString();
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                ListModels oListModels = new ListModels();
                List<Model.ClsGy_Work_Model> lsmain = new List<Model.ClsGy_Work_Model>();
                lsmain = oListModels.getObjectByJson_Gy_Work(_value);
                string sql = string.Empty;
                //保存
                oCN.BeginTran();
                sql = $"delete Gy_Work where HItemID = {lsmain[0].HItemID}";
                oCN.RunProc(sql);
                sql = "set identity_insert Gy_Work on";
                oCN.RunProc(sql);
                oCN.RunProc($@"insert into Gy_Work(HItemID,HNumber,HName,HHelpCode,HShortNumber,HParentID,
                    HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HUSEORGID,HCREATEORGID,HWORKCENTERID)
                  values({lsmain[0].HItemID},'{lsmain[0].HNumber}','{lsmain[0].HName}','{lsmain[0].HHelpCode}','{lsmain[0].HShortNumber}',
                        {lsmain[0].HParentID},{lsmain[0].HLevel},{Convert.ToString(lsmain[0].HEndFlag ? 1 : 0)},{Convert.ToString(lsmain[0].HStopflag ? 1 : 0) },
                        '{lsmain[0].HRemark}','{lsmain[0].HUseFlag}',{lsmain[0].HUSEORGID},{lsmain[0].HCREATEORGID},{lsmain[0].HWORKCENTERID})", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                sql = "set identity_insert Gy_Work off";
                oCN.RunProc(sql);
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "保存成功!";
                objJsonResult.data = 1;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = 1;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/ListModels.cs
@@ -909,6 +909,102 @@
        }
        /// <summary>
        /// å¤„理结算方式表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_SettleStyle_Model> getObjectByJson_Gy_SettleStyle(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_SettleStyle_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_SettleStyle_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理辅助属性表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_Property_Model> getObjectByJson_Gy_Property(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_Property_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_Property_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理业务员表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_Operator_Model> getObjectByJson_Gy_Operator(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_Operator_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_Operator_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理作业表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_Work_Model> getObjectByJson_Gy_Work(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_Work_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_Work_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理员工表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_Staff_Model> getObjectByJson_Gy_Staff(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_Staff_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_Staff_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理税率组合表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_TaxMIXMain_Model> getObjectByJson_Gy_TaxMIXMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_TaxMIXMain_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_TaxMIXMain_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理采购价格表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_MatePriceSup_Model> getObjectByJson_Gy_MatePriceSup(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_MatePriceSup_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_MatePriceSup_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理单据类型表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsXt_BillType_Model> getObjectByJson_Xt_BillType(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsXt_BillType_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsXt_BillType_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理收款条件表的json
        /// </summary>
        /// <param name="jsonString"></param>
WebAPI/Models/»ù´¡×ÊÁÏ/Gy_StockPlace.cs
New file
@@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace WebAPI.Models
{
    public class Gy_StockPlace
    {
        public bool HEndFlag { get; set; }
        public string HHelpCode { get; set; }
        public long HItemID { get; set; }
        public long HLevel { get; set; }
        public string HName { get; set; }
        public string HNumber { get; set; }
        public long HParentID { get; set; }
        public string HRemark { get; set; }
        public string HShortNumber { get; set; }
        public bool HStopFlag { get; set; }
        public string HUseFlag { get; set; }
        public Int64 HEmpID { get; set; }
        public string HAddress { get; set; }
        public string HPhone { get; set; }
        public Int64 HSPGroupID { get; set; }
        public string HBarCode { get; set; }
        public Int64 HUSEORGID { get; set; }
        public Int64 HCREATEORGID { get; set; }
        public string HMaker { get; set; }
        public string HUpDater { get; set; }
        public string HSPType { get; set; }
        public string HSrcSPType { get; set; }
        public string HDesSPType { get; set; }
    }
}
WebAPI/Models/»ù´¡×ÊÁÏ/Warehouse.cs
@@ -24,6 +24,7 @@
        public Int64 HSPGroupID { get; set; }
        public string HBarCode { get; set; }
        public Int64 HUSEORGID { get; set; }
        public Int64 HCREATEORGID { get; set; }
        public string HMaker { get; set; }
        public string HUpDater { get; set; }
WebAPI/WebAPI.csproj
@@ -325,6 +325,7 @@
    <Compile Include="App_Start\WebApiConfig.cs" />
    <Compile Include="Controllers\BaseSet\Gy_BarCodeBillController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_ConkTypeController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_ICBomBillController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_WorkDayController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_PackTypeController.cs" />
    <Compile Include="Controllers\BaseSet\Gy_RoutingGroupController.cs" />
@@ -447,16 +448,22 @@
    <Compile Include="Controllers\基础资料\基础资料\Gy_COMMONCONTACTBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_CustLocationController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_DutyBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_MatePriceSupController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_OperatorController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_PaymentConditionListBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_RateTypeController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_RecConditionBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_SettleStyleController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_SOPBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_SOPBillEditController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_SOPBillListController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_StaffController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_StockCheckItemBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_StockStatusBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_SupplierContactBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_TaxMIXController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_TaxRateBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_WorkController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_WorkStationBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Xt_CheckFlowBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Xt_CheckItemBillController.cs" />
@@ -629,6 +636,7 @@
    <Compile Include="Models\基础资料\ConkType.cs" />
    <Compile Include="Models\基础资料\Gy_ClassTimePrj.cs" />
    <Compile Include="Models\基础资料\Gy_Duty.cs" />
    <Compile Include="Models\基础资料\Gy_StockPlace.cs" />
    <Compile Include="Models\基础资料\WorkDay.cs" />
    <Compile Include="Models\基础资料\PackType.cs" />
    <Compile Include="Models\基础资料\WorkStation.cs" />
@@ -892,16 +900,22 @@
    <Folder Include="Views\Gy_EquipType\" />
    <Folder Include="Views\Gy_ICBomBill\" />
    <Folder Include="Views\Gy_MateMould\" />
    <Folder Include="Views\Gy_MatePriceSup\" />
    <Folder Include="Views\Gy_Operator\" />
    <Folder Include="Views\Gy_PackType\" />
    <Folder Include="Views\Gy_PaymentConditionListBill\" />
    <Folder Include="Views\Gy_RateType\" />
    <Folder Include="Views\Gy_RecConditionBill\" />
    <Folder Include="Views\Gy_RoutingGroup\" />
    <Folder Include="Views\Gy_SettleStyle\" />
    <Folder Include="Views\Gy_SOPBill\" />
    <Folder Include="Views\Gy_Staff\" />
    <Folder Include="Views\Gy_StockStatusBill\" />
    <Folder Include="Views\Gy_SupplierContactBill\" />
    <Folder Include="Views\Gy_TaxMIXMain\" />
    <Folder Include="Views\Gy_TaxRateBill\" />
    <Folder Include="Views\Gy_WorkStation\" />
    <Folder Include="Views\Gy_Work\" />
    <Folder Include="Views\JIT_DayPlanPlatFormBill\" />
    <Folder Include="Views\JIT_DayPlanPlatFormImport\" />
    <Folder Include="Views\JIT_ICMOSortBillList\" />