yusijie
2024-05-07 e92210a6fe4b72f098eaea62df2d8e5af16d0ffa
点检项目分类;点检方法;三个检验单加字段,点检项目加字段
14个文件已修改
6个文件已添加
1045 ■■■■■ 已修改文件
DAL/DAL.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_DotCheckItemClass_Ctl.cs 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/基础资料/公用基础资料/ClsGy_DotCheckItemMethod_Ctl.cs 98 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_FirstPieceCheckBill.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_ProcessCheckBill.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_DotCheckItemClass_Model.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/基础资料/基础资料/ClsGy_DotCheckItemMethod_Model.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_FirstPieceCheckBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_PatrolProcCheckBillMain.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_ProcessCheckBillMain.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckBillController.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckItemClassController.cs 379 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_DotCheckItemMethodController.cs 379 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsQC_PatrolProcCheckBill.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Models/ClsGy_DotCheck.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -108,8 +108,10 @@
    <Compile Include="基础资料\公用基础资料\ClsGy_CardStatus_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_CardAddress_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_CustLocation_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_DotCheckItemMethod_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_EquipStatus_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_CardType_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_DotCheckItemClass_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_MouldStatus_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_Operator_Ctl.cs" />
    <Compile Include="基础资料\公用基础资料\ClsGy_RateType_Ctl.cs" />
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_DotCheckItemClass_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_DotCheckItemClass_Ctl:DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_DotCheckItemClass_Model oModel = new Model.ClsGy_DotCheckItemClass_Model();
        //新增
        public override bool AddNew()
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into Gy_DotCheckItemClass (" +
                    "HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark" +
                    ",HMakeTime,HMakeEmp,HCREATEORGID,HUSEORGID) " +
                    " 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 + "',getdate()" + ",'" + oModel.HMakeEmp + "'," + oModel.HCREATEORGID + "," + oModel.HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HParentID=" + oModel.HParentID.ToString() +
                    ",HLevel=" + oModel.HLevel.ToString() +
                    ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                     " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_DotCheckItemClass_Ctl()
        {
            MvarItemKey = "Gy_DotCheckItemClass";
            MvarReportTitle = "点检项目分类";
            oModel = new Model.ClsGy_DotCheckItemClass_Model();
        }
    }
}
DAL/»ù´¡×ÊÁÏ/¹«Óûù´¡×ÊÁÏ/ClsGy_DotCheckItemMethod_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_DotCheckItemMethod_Ctl:DBUtility.ClsGy_Base_Ctl
    {
        SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
        //原代码 ç”¨äºŽ æ›¿æ¢å­é¡¹ç›®
        public string HOldNumber;
        public Model.ClsGy_DotCheckItemMethod_Model oModel = new Model.ClsGy_DotCheckItemMethod_Model();
        //新增
        public override bool AddNew()
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Insert into Gy_DotCheckItemMethod (" +
                    "HNumber,HName,HHelpCode,HShortNumber,HParentID" +
                    ",HLevel,HEndFlag,HStopflag,HRemark" +
                    ",HMakeTime,HMakeEmp,HCREATEORGID,HUSEORGID) " +
                    " 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.HMakeTime + "','" + oModel.HMakeEmp + "'," + oModel.HCREATEORGID + "," + oModel.HUSEORGID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //修改
        public override bool ModifyByID(Int64 sItemID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("Update " + MvarItemKey + " set " +
                    " HNumber='" + oModel.HNumber + "'" +
                    ",HName='" + oModel.HName + "'" +
                    ",HShortNumber='" + oModel.HShortNumber + "'" +
                    ",HParentID=" + oModel.HParentID.ToString() +
                    ",HLevel=" + oModel.HLevel.ToString() +
                    ",HEndflag=" + Convert.ToString(oModel.HEndFlag ? 1 : 0) +
                    ",HStopflag=" + Convert.ToString(oModel.HStopflag ? 1 : 0) +
                    ",HRemark= '" + oModel.HRemark + "'" +
                    ",HHelpCode='" + oModel.HHelpCode + "'" +
                    " Where HItemID=" + sItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                oCn.RunProc("exec h_p_Gy_UpdateNumber '" + MvarItemKey + "','" + oModel.HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                //将上级 ä¸ºéžæœ«çº§
                oCn.RunProc("Update " + MvarItemKey + " set HEndflag=0 where HItemID=" + oModel.HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                //
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                oCn.RollBack();
                throw (e);
            }
        }
        //根据代码判断信息
        public override bool HavParentCode(string sCode, Int64 sItemID)
        {
            DataSet DS;
            try
            {
                DS = oCn.RunProcReturn("Select * from " + MvarItemKey + " Where HStopflag=0 and HNumber='" + sCode + "' and HItemID<>" + sItemID, MvarItemKey, ref Pub_Class.ClsPub.sExeReturnInfo);
                if (DS.Tables[0].Rows.Count == 0)
                    return false;
                else
                {
                    oModel.HItemID = Convert.ToInt64(DS.Tables[0].Rows[0]["HItemID"]);
                    return true;
                }
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
        //构造函数
        public ClsGy_DotCheckItemMethod_Ctl()
        {
            MvarItemKey = "Gy_DotCheckItemMethod";
            MvarReportTitle = "点检方法";
            oModel = new Model.ClsGy_DotCheckItemMethod_Model();
        }
    }
}
DAL/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBill.cs
@@ -92,6 +92,8 @@
                ",HMaterID=" + omodel.HMaterID.ToString() +
                ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
                ",HLastResult=" + DBUtility.ClsPub.BoolToString(omodel.HLastResult) +
                ",HShiftsID=" + omodel.HShiftsID.ToString() +
                ",HErrTreatment='" + omodel.HErrTreatment + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -204,13 +206,13 @@
                ",HYear,HPeriod,HRemark" +
                ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HShiftsID,HErrTreatment" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
                "," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() +
                ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + ", " + DBUtility.ClsPub.BoolToString(omodel.HLastResult) +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType  + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType  + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsQC_FirstPieceCheckBillSub oSub in DetailColl)
DAL/Öʼì¹ÜÀí/ClsQC_ProcessCheckBill.cs
@@ -106,6 +106,8 @@
                ",HRoutingInterID=" + omodel.HRoutingInterID.ToString() +
                ",HDrawingDireID='" + omodel.HDrawingDireID + "'" +
                ",HPackTypeID=" + omodel.HPackTypeID.ToString() +
                ",HShiftsID=" + omodel.HShiftsID.ToString() +
                ",HErrTreatment='" + omodel.HErrTreatment + "'" +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
@@ -206,7 +208,7 @@
                ",HBarCode,HLBatchNo,HCusID,HSortBillNo,HContrctBatchNo" +
                ",HProdAreaID,HProdTypeID,HProdStoveNo,HRecipeID,HDiameter1" +
                ",HDiameter2,HRoutingInterID,HDrawingDireID,HPackTypeID" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty,HProcExchQty" +
                ",HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType,HICMOEntryID,HQCSchemeID,HICMOQty,HProcExchQty,HShiftsID,HErrTreatment" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
@@ -216,7 +218,7 @@
                ",'" + omodel.HBarCode + "','" + omodel.HLBatchNo + "'," + omodel.HCusID.ToString() + ",'" + omodel.HSortBillNo + "','" + omodel.HContrctBatchNo + "'" +
                "," + omodel.HProdAreaID.ToString() + "," + omodel.HProdTypeID.ToString() + ",'" + omodel.HProdStoveNo + "'," + omodel.HRecipeID.ToString() + "," + omodel.HDiameter1.ToString() +
                "," + omodel.HDiameter2.ToString() + "," + omodel.HRoutingInterID.ToString() + ",'" + omodel.HDrawingDireID + "'," + omodel.HPackTypeID.ToString() +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HICMOQty + "," + omodel.HProcExchQty +
                "," + omodel.HMainSourceInterID + "," + omodel.HMainSourceEntryID + ",'" + omodel.HMainSourceBillNo + "','" + omodel.HMainSourceBillType + "'," + omodel.HICMOEntryID + "," + omodel.HQCSchemeID + "," + omodel.HICMOQty + "," + omodel.HProcExchQty + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsQC_ProcessCheckBillSub oSub in DetailColl)
Model/Model.csproj
@@ -361,6 +361,8 @@
    <Compile Include="基础资料\基础资料\ClsGy_CardStatus_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_CardAddress_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_CardType_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_DotCheckItemMethod_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_DotCheckItemClass_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_ErrMsgBackType_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_TaskClass_Model.cs" />
    <Compile Include="基础资料\基础资料\ClsGy_ProjectClass_Model.cs" />
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_DotCheckItemClass_Model.cs
New file
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsGy_DotCheckItemClass_Model : DBUtility.ClsGy_Base_Model
    {
       //
    }
}
Model/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/ClsGy_DotCheckItemMethod_Model.cs
New file
@@ -0,0 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsGy_DotCheckItemMethod_Model : DBUtility.ClsGy_Base_Model
    {
       //
    }
}
Model/Öʼì¹ÜÀí/ClsQC_FirstPieceCheckBillMain.cs
@@ -24,5 +24,7 @@
        public Int64 HUnitID;
        public Int64 HProcID;
        public Int64 HShiftsID;
        public string HErrTreatment;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_PatrolProcCheckBillMain.cs
@@ -21,5 +21,7 @@
        public Int64 HMainProcID;
        public Int64 HLastResult;
        public Int64 HShiftsID;
        public string HErrTreatment;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_ProcessCheckBillMain.cs
@@ -43,5 +43,8 @@
        public Int64 HICMOQty;
        public Int64 HProcExchQty;
        public Int64 HShiftsID;
        public string HErrTreatment;
    }
}
WebAPI/Controllers/Æ·ÖʹÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBillController.cs
@@ -778,6 +778,8 @@
                BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID);
                BillNew.omodel.HBillStatus = 1;
                BillNew.omodel.HProcID = ClsPub.isLong(mainList[0].HProcID);
                BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID);
                BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment);
                List<Model.ClsQC_ProcessCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_ProcessCheckBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_ProcessCheckBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -200,6 +200,8 @@
                BillNew.omodel.HMainSourceBillType = ClsPub.isStrNull(mainList[0].HMainSourceBillType);
                BillNew.omodel.HQCSchemeID = ClsPub.isLong(mainList[0].HQCSchemeID);                
                BillNew.omodel.HBillStatus = 1;
                BillNew.omodel.HShiftsID = ClsPub.isLong(mainList[0].HShiftsID);
                BillNew.omodel.HErrTreatment = ClsPub.isStrNull(mainList[0].HErrTreatment);
                List<Model.ClsQC_FirstPieceCheckBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_FirstPieceCheckBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_DotCheckBillController.cs
@@ -132,7 +132,7 @@
        {
            try
            {
                ds = oCN.RunProcReturn("select * from Gy_DotCheck where HItemID=" + HInterID, "Gy_DotCheck");
                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheck_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheck_Edit");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -178,6 +178,7 @@
                string HRemark = list[0].HRemark;
                bool HStopflag = list[0].HStopflag;
                string HUseFlag = list[0].HUseFlag;
                Int64 HDotCheckItemClassID = list[0].HDotCheckItemClassID;
                //判断权限
                if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
@@ -218,6 +219,7 @@
                    ",HShortNumber='" + HShortNumber + "'" +
                    ",HHelpCode='" + HHelpCode + "'" +
                    ",HStopflag='" + HStopflag + "'" +
                    ",HDotCheckItemClassID=" + HDotCheckItemClassID +
                    ",HRemark= '" + HRemark + "' Where HItemID=" + HItemID, ref DBUtility.ClsPub.sExeReturnInfo);
                //修改子项目代码
                //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
@@ -268,7 +270,7 @@
                bool HStopflag = list[0].HStopflag;
                string HUseFlag = list[0].HUseFlag;
                bool HEndFlag = list[0].HEndFlag;
                Int64 HDotCheckItemClassID = list[0].HDotCheckItemClassID;
                //判断权限
                if (!ClsPub.Security_Log("Gy_DotCheck_Edit", 1, false, msg3))
                {
@@ -295,9 +297,9 @@
                //主表
                oCN.RunProc("Insert into Gy_DotCheck " +
                   " (HNumber,HName,HHelpCode,HShortNumber" +
                   ",HLevel,HEndFlag,HStopflag,HRemark,HParentID) " +
                   ",HLevel,HEndFlag,HStopflag,HRemark,HParentID,HDotCheckItemClassID ) " +
                   " Values('" + HNumber + "','" + HName + "','" + HHelpCode + "','" + HShortNumber + "'," +
                    +HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',0)", ref DBUtility.ClsPub.sExeReturnInfo);
                    +HLevel + ",1," + Convert.ToString(HStopflag ? 1 : 0) + ",'" + HRemark + "',0," + HDotCheckItemClassID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                //oCN.RunProc("Update Gy_MouldType set HEndflag=0 where HItemID=" + HParentID, ref DBUtility.ClsPub.sExeReturnInfo);
                oCN.Commit();
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_DotCheckItemClassController.cs
New file
@@ -0,0 +1,379 @@
using DBUtility;
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_DotCheckItemClassController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        public DAL.ClsGy_DotCheckItemClass_Ctl BillOld = new DAL.ClsGy_DotCheckItemClass_Ctl();
        #region ç‚¹æ£€é¡¹ç›®åˆ†ç±»åˆ—表数据
        [Route("Gy_DotCheckItemClass/GetDotCheckItemClassList")]
        [HttpGet]
        public object GetDotCheckItemClassList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemClass_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查看权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemClassList where 1=1 " + sWhere + " order by HItemID", "h_v_Gy_DotCheckItemClassList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä¿®æ”¹ç‚¹æ£€é¡¹ç›®åˆ†ç±»èŽ·å–ç»‘å®šæ•°æ®
        [Route("Gy_DotCheckItemClass/EditDotCheckItemClass")]
        [HttpGet]
        public object EditDotCheck(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemClass_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheckItemClass_Edit");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç‚¹æ£€é¡¹ç›®åˆ†ç±»ä¿å­˜æ–¹æ³•
        [Route("Gy_DotCheckItemClass/SaveGy_DotCheckItemClassList")]
        [HttpPost]
        public object SaveGy_DotCheckItemClassList([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 msg_HUserName = sArray[1].ToString();
            string msg_HCreateORGID = sArray[2].ToString();
            string msg_OperationType = sArray[3].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemClass_Edit", 1, false, msg_HUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_DotCheckItemClass ", "Gy_DotCheckItemClass");
            if ((Maxds != null || Maxds.Tables[0].Rows.Count > 0) && ( Maxds.Tables[0].Rows[0]["HItemID"] != null && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "" && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "undefined") )
            {
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            else
            {
                HItemID = 1;
            }
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_DotCheckItemClass_Ctl oBill = new DAL.ClsGy_DotCheckItemClass_Ctl();
                List<Model.ClsGy_DotCheckItemClass_Model> lsmain = new List<Model.ClsGy_DotCheckItemClass_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_DotCheckItemClass(msg1);
                foreach (Model.ClsGy_DotCheckItemClass_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_DotCheckItemClass where HStopflag = 0 and HNumber = '" + oItem.HNumber.Trim() + "'", "Gy_DotCheckItemClass");
                    //得到短代码
                    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_HCreateORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg_HUserName; //制单人
                    oItem.HCREATEORGID = Convert.ToInt32(msg_HCreateORGID); //创建组织
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (msg_OperationType == 1.ToString() || msg_OperationType == 2.ToString())
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = "";
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = "";
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = "";
                return objJsonResult;
            }
        }
        #endregion
        #region ç‚¹æ£€é¡¹ç›®åˆ†ç±»åˆ é™¤
        [Route("Gy_DotCheckItemClass/DeleteDotCheckItemClass")]
        [HttpGet]
        public object DeleteDotCheckItemClass(long HItemID, string User)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemClass_Delete", 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有删除权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("Select * from Gy_DotCheckItemClass Where HItemID='" + HItemID + "'", "Gy_DotCheckItemClass", ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    ds = oCN.RunProcReturn("Delete from Gy_DotCheckItemClass Where HItemID='" + HItemID + "'", "Gy_DotCheckItemClass", ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç‚¹æ£€é¡¹ç›®åˆ†ç±»å®¡æ ¸ã€åå®¡æ ¸
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_DotCheckItemClass/AuditGy_DotCheckItemClass")]
        [HttpGet]
        public object AuditGy_DotCheckItemClass(string HInterID, int Type, string user)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemClass_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (string.IsNullOrWhiteSpace(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    //判断单据是否已经审核
                    DataSet ds;
                    string sql = "select * from  Gy_DotCheckItemClass where HItemID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //审核单据
                    if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    //判断单据是否已经反审核
                    DataSet ds;
                    string sql = "select * from  Gy_DotCheckItemClass where HItemID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反审核单据
                        if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                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_DotCheckItemMethodController.cs
New file
@@ -0,0 +1,379 @@
using DBUtility;
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_DotCheckItemMethodController : ApiController
    {
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        DataSet ds;
        public DAL.ClsGy_DotCheckItemMethod_Ctl BillOld = new DAL.ClsGy_DotCheckItemMethod_Ctl();
        #region ç‚¹æ£€æ–¹æ³•列表数据
        [Route("Gy_DotCheckItemMethod/GetDotCheckItemMethodList")]
        [HttpGet]
        public object GetDotCheckItemMethodList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemMethod_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查看权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemMethodList where 1=1 " + sWhere + " order by HItemID", "h_v_Gy_DotCheckItemMethodList");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä¿®æ”¹ç‚¹æ£€æ–¹æ³•获取绑定数据
        [Route("Gy_DotCheckItemMethod/EditDotCheckItemMethod")]
        [HttpGet]
        public object EditDotCheckItemMethod(long HInterID)
        {
            try
            {
                ds = oCN.RunProcReturn("select * from h_v_Gy_DotCheckItemMethod_Edit where HItemID=" + HInterID, "h_v_Gy_DotCheckItemMethod_Edit");
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç‚¹æ£€æ–¹æ³•保存方法
        [Route("Gy_DotCheckItemMethod/SaveGy_DotCheckItemMethodList")]
        [HttpPost]
        public object SaveGy_DotCheckItemMethodList([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 msg_HUserName = sArray[1].ToString();
            string msg_HCreateORGID = sArray[2].ToString();
            string msg_OperationType = sArray[3].ToString();
            Int64 HItemID = 0;
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemMethod_Edit", 1, false, msg_HUserName))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无保存权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            //获取最大ID值赋值
            DataSet Maxds = oCN.RunProcReturn("select MAX(HItemID) HItemID from Gy_DotCheckItemMethod ", "Gy_DotCheckItemMethod");
            if ((Maxds != null || Maxds.Tables[0].Rows.Count > 0) && (Maxds.Tables[0].Rows[0]["HItemID"] != null && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "" && Maxds.Tables[0].Rows[0]["HItemID"].ToString() != "undefined"))
            {
                var maxid = Convert.ToInt32(Maxds.Tables[0].Rows[0]["HItemID"]);
                maxid += 1;
                HItemID = maxid;
            }
            else
            {
                HItemID = 1;
            }
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsGy_DotCheckItemMethod_Ctl oBill = new DAL.ClsGy_DotCheckItemMethod_Ctl();
                List<Model.ClsGy_DotCheckItemMethod_Model> lsmain = new List<Model.ClsGy_DotCheckItemMethod_Model>();
                msg1 = msg1.Replace("\\", "");
                msg1 = msg1.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_Gy_DotCheckItemMethod(msg1);
                foreach (Model.ClsGy_DotCheckItemMethod_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_DotCheckItemMethod where HStopflag  =0 and HNumber = '" + oItem.HNumber.Trim() + "'", "Gy_DotCheckItemMethod");
                    //得到短代码
                    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_HCreateORGID); //组织id
                    oItem.HShortNumber = sShortNumber;//短代码
                    oItem.HEndFlag = true;//末级标志
                    oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //等级
                    oItem.HMakeEmp = msg_HUserName; //制单人
                    oItem.HCREATEORGID = Convert.ToInt32(msg_HCreateORGID); //创建组织
                    oBill.oModel = oItem;
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (msg_OperationType == 1.ToString() || msg_OperationType == 2.ToString())
                {
                    bResult = oBill.AddNew();
                }
                else
                {
                    bResult = oBill.ModifyByID(oBill.oModel.HItemID);
                }
                if (bResult)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    objJsonResult.data = "";
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = "";
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "保存失败!" + e.ToString();
                objJsonResult.data = "";
                return objJsonResult;
            }
        }
        #endregion
        #region ç‚¹æ£€æ–¹æ³•删除
        [Route("Gy_DotCheckItemMethod/DeleteDotCheckItemMethod")]
        [HttpGet]
        public object DeleteDotCheckItemMethod(long HItemID, string User)
        {
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Gy_DotCheckItemMethod_Delete", 1, false, User))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有删除权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("Select * from Gy_DotCheckItemMethod Where HItemID='" + HItemID + "'", "Gy_DotCheckItemMethod", ref DBUtility.ClsPub.sExeReturnInfo);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    ds = oCN.RunProcReturn("Delete from Gy_DotCheckItemMethod Where HItemID='" + HItemID + "'", "Gy_DotCheckItemMethod", ref DBUtility.ClsPub.sExeReturnInfo);
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç‚¹æ£€æ–¹æ³•审核、反审核
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        [Route("Gy_DotCheckItemMethod/AuditGy_DotCheckItemMethod")]
        [HttpGet]
        public object AuditGy_DotCheckItemMethod(string HInterID, int Type, string user)
        {
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log_second("Gy_DotCheckItemMethod_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (string.IsNullOrWhiteSpace(HInterID))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID为空!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    //判断单据是否已经审核
                    DataSet ds;
                    string sql = "select * from  Gy_DotCheckItemMethod where HItemID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0].Rows[0]["HCheckEmp"] != null && ds.Tables[0].Rows[0]["HCheckEmp"].ToString() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //审核单据
                    if (!BillOld.AuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                else
                {
                    //判断单据是否已经反审核
                    DataSet ds;
                    string sql = "select * from  Gy_DotCheckItemMethod where HItemID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HCheckEmp"] == null || ds.Tables[0].Rows[0]["HCheckEmp"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反审核单据
                        if (!BillOld.DeAuditByID2(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ClsPub.sExeReturnInfo;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                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/DLL/ClsQC_PatrolProcCheckBill.cs
@@ -94,6 +94,8 @@
                //",HMaterID=" + omodel.HMaterID.ToString() +
                ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
                ",HMainProcID=" + omodel.HMainProcID.ToString() +
                ",HShiftsID=" + omodel.HShiftsID.ToString() +
                ",HErrTreatment='" + omodel.HErrTreatment + "'" +
                " where HInterID=" + lngBillKey.ToString();
                //更新主表
                oCn.RunProc(sqlerro);
@@ -223,12 +225,12 @@
                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                ",HYear,HPeriod,HRemark" +
                ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HMainProcID,HLastResult" +
                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HMainProcID,HLastResult,HShiftsID,HErrTreatment" +
                ") " +
                " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "'," + omodel.HBillStatus.ToString() + ",'" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'" +
                "," + omodel.HSourceID.ToString() + "," + omodel.HICMOInterID.ToString() + ",'" + omodel.HICMOBillNo + "'," + omodel.HICMOQty.ToString() + "," + omodel.HProcExchInterID.ToString() + "," + omodel.HProcExchEntryID.ToString() +
                ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + "," + omodel.HMainProcID +" ,"+ omodel.HLastResult +
                ",'" + omodel.HProcExchBillNo + "'," + omodel.HProcExchQty.ToString() + "," + omodel.HMaterID.ToString() + "," + omodel.HFirstCheckEmp.ToString() + "," + omodel.HMainProcID +" ,"+ omodel.HLastResult + "," + omodel.HShiftsID + ",'" + omodel.HErrTreatment + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsQC_PatrolProcCheckBillSub oSub in DetailColl)
WebAPI/ListModels.cs
@@ -1796,6 +1796,30 @@
        }
        /// <summary>
        /// å¤„理新增点检项目分类表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_DotCheckItemClass_Model> getObjectByJson_Gy_DotCheckItemClass(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_DotCheckItemClass_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_DotCheckItemClass_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增点检方法表的json
        /// </summary>
        /// <param name="jsonString"></param>
        /// <returns></returns>
        public List<Model.ClsGy_DotCheckItemMethod_Model> getObjectByJson_Gy_DotCheckItemMethod(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsGy_DotCheckItemMethod_Model> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsGy_DotCheckItemMethod_Model>>(jsonString);
            return list;
        }
        /// <summary>
        /// å¤„理新增条码拆码的json
        /// </summary>
        /// <param name="jsonString"></param>
WebAPI/Models/ClsGy_DotCheck.cs
@@ -19,5 +19,6 @@
        public string HRemark;         //备注
        public string HUseFlag = "未使用";
        public Int64 HDotCheckItemClassID; //点检项目分类
    }
}
WebAPI/WebAPI.csproj
@@ -524,6 +524,8 @@
    <Compile Include="Controllers\基础资料\基础资料\Gy_CardTypeController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_COMMONCONTACTBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_CustLocationController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_DotCheckItemMethodController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_DotCheckItemClassController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_DutyBillController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_EquipStatusController.cs" />
    <Compile Include="Controllers\基础资料\基础资料\Gy_MatePriceSupController.cs" />