yangle
2023-01-04 3b7ffe6750724acb77274a4ee98d971ae0681f63
设备入库检验验收单
设备投产检验验收单
4个文件已修改
8个文件已添加
1222 ■■■■■ 已修改文件
DAL/DAL.csproj 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipStockInCheckBill.cs 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/生产管理/设备管理/ClsSb_EquipWorkBeforeCheckBill.cs 132 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipStockInCheckBillMain.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipStockInCheckBillSub.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipWorkBeforeCheckBillMain.cs 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/生产管理/设备管理/ClsSb_EquipWorkBeforeCheckBillSub.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipStockInCheckBillController.cs 421 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SBGL/Sb_EquipWorkBeforeCheckBillController.cs 421 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -603,6 +603,8 @@
    <Compile Include="生产管理\模具管理\ClsSc_MouldRepairInBill.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldRepairOutBill.cs" />
    <Compile Include="生产管理\模具管理\ClsSc_MouldStatusChangeBill.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipWorkBeforeCheckBill.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipStockInCheckBill.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipSparepartsBill.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipSparepartsChangeBill.cs" />
    <Compile Include="质检管理\ClsQC_FirstPieceCheckBill.cs" />
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipStockInCheckBill.cs
New file
@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public  class ClsSb_EquipStockInCheckBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsSb_EquipStockInCheckBillMain omodel = new Model.ClsSb_EquipStockInCheckBillMain();
        public List<Model.ClsSb_EquipStockInCheckBillSub> DetailColl = new List<Model.ClsSb_EquipStockInCheckBillSub>();
        public ClsSb_EquipStockInCheckBill()
        {
            base.MvarItemKeySub = "Sb_EquipStockInCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey= "Sb_EquipStockInCheckBillMain";
            base.MvarReportTitle= "设备入库检验验收单";
            base.BillType = "3914";
            base.HBillSubType = "3914";
        }
        #region å›ºå®šä»£ç 
        ~ClsSb_EquipStockInCheckBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Sb_EquipStockInCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                //",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HCheckerResult='" + omodel.HCheckerResult + "'" +
                ",HUpDater='" + omodel.HMaker + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HEquipID=" + omodel.HEquipID.ToString() +
                ",HSupID=" + omodel.HSupID.ToString() +
                ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsSb_EquipStockInCheckBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sb_EquipStockInCheckBillSub " +
                      " (HInterID,HEntryID,HCloseMan, HEntryCloseDate, HCloseType" +
                      ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" +
                      ", HRelationQty, HRelationMoney,HQCCheckClassID, HQCCheckItemID, HQCStd" +
                      ", HQCRelValue, HResult, HProcCheckEmp, HProcCheckTime, HBillNo_bak) values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) +
                      ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType +
                     "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ",'" + oSub.HQCCheckClassID + "','" + oSub.HQCCheckItemID + "','" + oSub.HQCStd +
                     "','" + oSub.HQCRelValue + "','" + oSub.HResult.ToString() + "','" + oSub.HProcCheckEmp + "','" + oSub.HProcCheckTime + "','') ");
                }
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sb_EquipStockInCheckBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo , HDate, HMaker, HMakeDate" +
                ", HYear, HPeriod , HRemark, HEquipID, HSupID, HFirstCheckEmp, HCheckerResult" +
                ", HBackRemark, HMainSourceBillType, HMainSourceInterID, HMainSourceEntryID, HMainSourceBillNo) " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                ",'" + omodel.HSupID + "','" + omodel.HFirstCheckEmp + "','" + omodel.HCheckerResult + "'" +
                ",'','',0,0,'') ");
                //插入子表
                foreach (Model.ClsSb_EquipStockInCheckBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sb_EquipStockInCheckBillSub " +
                      " (HInterID,HEntryID,HCloseMan, HEntryCloseDate, HCloseType" +
                      ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" +
                      ", HRelationQty, HRelationMoney,HQCCheckClassID, HQCCheckItemID, HQCStd" +
                      ", HQCRelValue, HResult, HProcCheckEmp, HProcCheckTime, HBillNo_bak) values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) +
                      ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType +
                     "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ",'" + oSub.HQCCheckClassID + "','" + oSub.HQCCheckItemID + "','" + oSub.HQCStd +
                     "','" + oSub.HQCRelValue + "','" + oSub.HResult.ToString() + "','" + oSub.HProcCheckEmp + "','" + oSub.HProcCheckTime + "','') ");
                }
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
    }
}
DAL/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipWorkBeforeCheckBill.cs
New file
@@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public  class ClsSb_EquipWorkBeforeCheckBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsSb_EquipWorkBeforeCheckBillMain omodel = new Model.ClsSb_EquipWorkBeforeCheckBillMain();
        public List<Model.ClsSb_EquipWorkBeforeCheckBillSub> DetailColl = new List<Model.ClsSb_EquipWorkBeforeCheckBillSub>();
        public ClsSb_EquipWorkBeforeCheckBill()
        {
            base.MvarItemKeySub = "Sb_EquipWorkBeforeCheckBillSub";
            base.MvarItemKeySub2 = "";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey= "Sb_EquipWorkBeforeCheckBillMain";
            base.MvarReportTitle= "设备投产检验验收单";
            base.BillType = "3915";
            base.HBillSubType = "3915";
        }
        #region å›ºå®šä»£ç 
        ~ClsSb_EquipWorkBeforeCheckBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Sb_EquipWorkBeforeCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                //",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HCheckerResult='" + omodel.HCheckerResult + "'" +
                ",HUpDater='" + omodel.HMaker + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HEquipID=" + omodel.HEquipID.ToString() +
                ",HSupID=" + omodel.HSupID.ToString() +
                ",HFirstCheckEmp=" + omodel.HFirstCheckEmp.ToString() +
                " where HInterID=" + lngBillKey.ToString());
                //删除关联
                DeleteRelation(ref sReturn, lngBillKey);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                foreach (Model.ClsSb_EquipWorkBeforeCheckBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sb_EquipWorkBeforeCheckBillSub " +
                      " (HInterID,HEntryID,HCloseMan, HEntryCloseDate, HCloseType" +
                      ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" +
                      ", HRelationQty, HRelationMoney,HQCCheckClassID, HQCCheckItemID, HQCStd" +
                      ", HQCRelValue, HResult, HProcCheckEmp, HProcCheckTime, HBillNo_bak) values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) +
                      ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType +
                     "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ",'" + oSub.HQCCheckClassID + "','" + oSub.HQCCheckItemID + "','" + oSub.HQCStd +
                     "','" + oSub.HQCRelValue + "','" + oSub.HResult.ToString() + "','" + oSub.HProcCheckEmp + "','" + oSub.HProcCheckTime + "','') ");
                }
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增单据
        public override bool AddBill(ref string sReturn)
        {
            try
            {
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //主表
                oCn.RunProc("Insert Into Sb_EquipWorkBeforeCheckBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo , HDate, HMaker, HMakeDate" +
                ", HYear, HPeriod , HRemark, HEquipID, HSupID, HFirstCheckEmp, HCheckerResult" +
                ", HBackRemark, HMainSourceBillType, HMainSourceInterID, HMainSourceEntryID, HMainSourceBillNo) " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'," + omodel.HEquipID.ToString() +
                ",'" + omodel.HSupID + "','" + omodel.HFirstCheckEmp + "','" + omodel.HCheckerResult + "'" +
                ",'','',0,0,'') ");
                //插入子表
                foreach (Model.ClsSb_EquipWorkBeforeCheckBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into Sb_EquipWorkBeforeCheckBillSub " +
                      " (HInterID,HEntryID,HCloseMan, HEntryCloseDate, HCloseType" +
                      ", HRemark, HSourceInterID, HSourceEntryID, HSourceBillNo, HSourceBillType" +
                      ", HRelationQty, HRelationMoney,HQCCheckClassID, HQCCheckItemID, HQCStd" +
                      ", HQCRelValue, HResult, HProcCheckEmp, HProcCheckTime, HBillNo_bak) values("
                      + omodel.HInterID.ToString() + "," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "','" + oSub.HEntryCloseDate + "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) +
                      ",'" + oSub.HRemark + "'" + "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType +
                     "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() + ",'" + oSub.HQCCheckClassID + "','" + oSub.HQCCheckItemID + "','" + oSub.HQCStd +
                     "','" + oSub.HQCRelValue + "','" + oSub.HResult.ToString() + "','" + oSub.HProcCheckEmp + "','" + oSub.HProcCheckTime + "','') ");
                }
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
    }
}
Model/Model.csproj
@@ -579,6 +579,10 @@
    <Compile Include="生产管理\模具管理\ClsSc_MouldStockBillSub.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipConkBookBillMain.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipConkBookBillSub.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipWorkBeforeCheckBillMain.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipWorkBeforeCheckBillSub.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipStockInCheckBillSub.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipStockInCheckBillMain.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipDotCheckBillMain.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipDotCheckBillSub.cs" />
    <Compile Include="生产管理\设备管理\ClsSb_EquipDotCheckPlanBillMain.cs" />
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipStockInCheckBillMain.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsSb_EquipStockInCheckBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HSupID;
        public Int64 HEquipID;
        public Int64 HFirstCheckEmp;
        public string HCheckerResult;
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipStockInCheckBillSub.cs
New file
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsSb_EquipStockInCheckBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HQCCheckClassID;
        public Int64 HQCCheckItemID;
        public Int64 HProcCheckEmp;
        public string HQCStd;
        public string HQCRelValue;
        public string HResult;
        public DateTime HProcCheckTime;
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipWorkBeforeCheckBillMain.cs
New file
@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsSb_EquipWorkBeforeCheckBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HSupID;
        public Int64 HEquipID;
        public Int64 HFirstCheckEmp;
        public string HCheckerResult;
    }
}
Model/Éú²ú¹ÜÀí/É豸¹ÜÀí/ClsSb_EquipWorkBeforeCheckBillSub.cs
New file
@@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsSb_EquipWorkBeforeCheckBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HQCCheckClassID;
        public Int64 HQCCheckItemID;
        public Int64 HProcCheckEmp;
        public string HQCStd;
        public string HQCRelValue;
        public string HResult;
        public DateTime HProcCheckTime;
    }
}
WebAPI/Controllers/SBGL/Sb_EquipStockInCheckBillController.cs
New file
@@ -0,0 +1,421 @@
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.SBGL
{
    public class Sb_EquipStockInCheckBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        #region è®¾å¤‡å…¥åº“检验验收单 åˆ—表
        /// <summary>
        /// è®¾å¤‡å…¥åº“检验验收单列表
        /// </summary>
        /// <returns></returns>
        [Route("Sb_EquipStockInCheckBill/Sb_EquipStockInCheckBillList")]
        [HttpGet]
        public object Sb_EquipStockInCheckBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipStockInCheckBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Sb_EquipStockInCheckBillList where 1=1 "+ sWhere, "h_v_Sb_EquipStockInCheckBillList");
                //添加列名
                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 = "返回记录成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è®¾å¤‡å…¥åº“检验验收单 ä¿å­˜/编辑
        /// <summary>
        /// è®¾å¤‡å…¥åº“检验验收单 ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("Sb_EquipStockInCheckBill/SaveEquipStockInCheckBill")]
        [HttpPost]
        public object SaveEquipStockInCheckBill([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipStockInCheckBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsSb_EquipStockInCheckBill oBill = new DAL.ClsSb_EquipStockInCheckBill();
                List<Model.ClsSb_EquipStockInCheckBillMain> lsmain = new List<Model.ClsSb_EquipStockInCheckBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_ClsSb_EquipStockInCheckBillMain(msg2);
                foreach (Model.ClsSb_EquipStockInCheckBillMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "3914";
                    oItem.HBillSubType = "3914";
                    oItem.HBillStatus = 1;
                    DBUtility.ClsPub.CurUserName = UserName;
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsSb_EquipStockInCheckBillSub> ls = new List<Model.ClsSb_EquipStockInCheckBillSub>();
                ls = oListModels.getObjectByJson_ClsSb_EquipStockInCheckBillSub(msg3);
                int i = 0;
                foreach (Model.ClsSb_EquipStockInCheckBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    //oItemSub.HCloseMan = "";       //行关闭
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    oItemSub.HSourceInterID = 0;     // æºå•主内码
                    oItemSub.HSourceEntryID = 0;   //源单子内码
                    //oItemSub.HSourceBillNo = "";  //源单单号
                    //oItemSub.HSourceBillType = ""; //源单类型
                    oItemSub.HRelationQty = 0;     //关联数量
                                                   //oItemSub.HRelationMoney = 0;   //关联金额
                                                   //HMaterID = "";//配件代码
                                                   //HUnitID = "";//单位代码
                                                   //HQty = "";//实际用量
                                                   //HQtyMust = "";//单位用量
                                                   //HRemark = "";//备注
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    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 è®¾å¤‡å…¥åº“检验验收单 åˆ é™¤
        /// <summary>
        /// è®¾å¤‡å…¥åº“检验验收单删除
        /// </summary>
        /// <returns></returns>
        [Route("Sb_EquipStockInCheckBill/DelEquipStockInCheckBill")]
        [HttpGet]
        public object DelEquipStockInCheckBill(string HInterID, string user)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log("Sb_EquipStockInCheckBill_Drop", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无删除权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DAL.ClsSb_EquipStockInCheckBill oBill = new DAL.ClsSb_EquipStockInCheckBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                ds = oCN.RunProcReturn("select * from Sb_EquipStockInCheckBillMain where HInterID="+ lngBillKey, "Sb_EquipStockInCheckBillMain");
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) >1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                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("Sb_EquipStockInCheckBill/AuditEquipStockInCheckBill")]
        [HttpGet]
        public object AuditEquipStockInCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "Sb_EquipStockInCheckBill_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                DAL.ClsSb_EquipStockInCheckBill oBill = new DAL.ClsSb_EquipStockInCheckBill();
                ds = oCN.RunProcReturn("select * from Sb_EquipStockInCheckBillMain where HInterID=" + lngBillKey, "Sb_EquipStockInCheckBillMain");
                //查看是否已审核,关闭,作废
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"].ToString().Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"].ToString().Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/Controllers/SBGL/Sb_EquipWorkBeforeCheckBillController.cs
New file
@@ -0,0 +1,421 @@
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.SBGL
{
    public class Sb_EquipWorkBeforeCheckBillController : ApiController
    {
        private json objJsonResult = new json();
        public DataSet ds = new DataSet();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        #region è®¾å¤‡æŠ•产检验验收单 åˆ—表
        /// <summary>
        /// è®¾å¤‡æŠ•产检验验收单列表
        /// </summary>
        /// <returns></returns>
        [Route("Sb_EquipWorkBeforeCheckBill/Sb_EquipWorkBeforeCheckBillList")]
        [HttpGet]
        public object Sb_EquipWorkBeforeCheckBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipWorkBeforeCheckBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无查看权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ds = oCN.RunProcReturn("select * from h_v_Sb_EquipWorkBeforeCheckBillList where 1=1 "+ sWhere, "h_v_Sb_EquipWorkBeforeCheckBillList");
                //添加列名
                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 = "返回记录成功!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception ex)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region è®¾å¤‡æŠ•产检验验收单 ä¿å­˜/编辑
        /// <summary>
        /// è®¾å¤‡æŠ•产检验验收单 ä¿å­˜
        /// </summary>
        /// <param name="msg"></param>
        /// <returns></returns>
        [Route("Sb_EquipWorkBeforeCheckBill/SaveEquipWorkBeforeCheckBill")]
        [HttpPost]
        public object SaveEquipWorkBeforeCheckBill([FromBody] JObject msg)
        {
            var _value = msg["msg"].ToString();
            string msg1 = _value.ToString();
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string msg4 = sArray[2].ToString();
            string UserName = "";
            ListModels oListModels = new ListModels();
            try
            {
                if (!DBUtility.ClsPub.Security_Log("Sb_EquipWorkBeforeCheckBill_Edit", 1, false, msg4))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsSb_EquipWorkBeforeCheckBill oBill = new DAL.ClsSb_EquipWorkBeforeCheckBill();
                List<Model.ClsSb_EquipWorkBeforeCheckBillMain> lsmain = new List<Model.ClsSb_EquipWorkBeforeCheckBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
                lsmain = oListModels.getObjectByJson_ClsSb_EquipWorkBeforeCheckBillMain(msg2);
                foreach (Model.ClsSb_EquipWorkBeforeCheckBillMain oItem in lsmain)
                {
                    //oItem.HMaker = "";
                    UserName = oItem.HMaker;  //制单人
                    oItem.HBillType = "3915";
                    oItem.HBillSubType = "3915";
                    oItem.HBillStatus = 1;
                    DBUtility.ClsPub.CurUserName = UserName;
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!没有单据日期,无法保存!";
                        objJsonResult.data = 1;
                        return objJsonResult;
                    }
                    oBill.omodel = oItem;
                }
                //表体数据
                //按 },{来拆分数组 //去掉【和】
                msg3 = msg3.Substring(1, msg3.Length - 2);
                msg3 = msg3.Replace("\\", "");
                msg3 = msg3.Replace("\n", "");  //\n
                //msg2 = msg2.Replace("'", "’");
                List<Model.ClsSb_EquipWorkBeforeCheckBillSub> ls = new List<Model.ClsSb_EquipWorkBeforeCheckBillSub>();
                ls = oListModels.getObjectByJson_ClsSb_EquipWorkBeforeCheckBillSub(msg3);
                int i = 0;
                foreach (Model.ClsSb_EquipWorkBeforeCheckBillSub oItemSub in ls)
                {
                    i++;
                    oItemSub.HEntryID = i;
                    //oItemSub.HCloseMan = "";       //行关闭
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;   //关闭类型
                    //oItemSub.HRemark = "";         //备注
                    oItemSub.HSourceInterID = 0;     // æºå•主内码
                    oItemSub.HSourceEntryID = 0;   //源单子内码
                    //oItemSub.HSourceBillNo = "";  //源单单号
                    //oItemSub.HSourceBillType = ""; //源单类型
                    oItemSub.HRelationQty = 0;     //关联数量
                                                   //oItemSub.HRelationMoney = 0;   //关联金额
                                                   //HMaterID = "";//配件代码
                                                   //HUnitID = "";//单位代码
                                                   //HQty = "";//实际用量
                                                   //HQtyMust = "";//单位用量
                                                   //HRemark = "";//备注
                    oBill.DetailColl.Add(oItemSub);
                }
                //保存
                //保存完毕后处理
                bool bResult;
                if (oBill.omodel.HInterID == 0)
                {
                    // bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = oBill.ModifyBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                if (bResult)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存成功!";
                    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 è®¾å¤‡æŠ•产检验验收单 åˆ é™¤
        /// <summary>
        /// è®¾å¤‡æŠ•产检验验收单删除
        /// </summary>
        /// <returns></returns>
        [Route("Sb_EquipWorkBeforeCheckBill/DelEquipWorkBeforeCheckBill")]
        [HttpGet]
        public object DelEquipWorkBeforeCheckBill(string HInterID, string user)
        {
            //编辑权限
            if (!DBUtility.ClsPub.Security_Log("Sb_EquipWorkBeforeCheckBill_Drop", 1, false, user))
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "无删除权限!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            Int64 lngBillKey = 0;
            lngBillKey = DBUtility.ClsPub.isLong(HInterID);
            if (lngBillKey == 0)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据ID为空!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            DAL.ClsSb_EquipWorkBeforeCheckBill oBill = new DAL.ClsSb_EquipWorkBeforeCheckBill();
            if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
            {
                ds = oCN.RunProcReturn("select * from Sb_EquipWorkBeforeCheckBillMain where HInterID="+ lngBillKey, "Sb_EquipWorkBeforeCheckBillMain");
                if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) >1)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据当前处于不能删除状态,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据已经审核,不能删除!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            else
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "单据未找到";
                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("Sb_EquipWorkBeforeCheckBill/AuditEquipWorkBeforeCheckBill")]
        [HttpGet]
        public object AuditEquipWorkBeforeCheckBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "Sb_EquipWorkBeforeCheckBill_Check";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //审核权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "审核失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (HInterID <= 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "HInterID小于0!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                DAL.ClsSb_EquipWorkBeforeCheckBill oBill = new DAL.ClsSb_EquipWorkBeforeCheckBill();
                ds = oCN.RunProcReturn("select * from Sb_EquipWorkBeforeCheckBillMain where HInterID=" + lngBillKey, "Sb_EquipWorkBeforeCheckBillMain");
                //查看是否已审核,关闭,作废
                if (ds.Tables[0].Rows.Count > 0)
                {
                    if (ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"].ToString().Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反审核判断
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"].ToString().Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (IsAudit == 1) //反审核提交
                {
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/ListModels.cs
@@ -1471,6 +1471,45 @@
            return list;
        }
        ///设备入库检验验收单 å­è¡¨
        ///ClsSb_EquipStockInCheckBillSub
        public List<Model.ClsSb_EquipStockInCheckBillSub> getObjectByJson_ClsSb_EquipStockInCheckBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSb_EquipStockInCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipStockInCheckBillSub>>(jsonString);
            return list;
        }
        ///设备入库检验验收单 ä¸»è¡¨
        ///ClsSb_EquipStockInCheckBillMain
        public List<Model.ClsSb_EquipStockInCheckBillMain> getObjectByJson_ClsSb_EquipStockInCheckBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSb_EquipStockInCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipStockInCheckBillMain>>(jsonString);
            return list;
        }
        ///设备投产检验验收单 å­è¡¨
        ///ClsSb_EquipWorkBeforeCheckBillSub
        public List<Model.ClsSb_EquipWorkBeforeCheckBillSub> getObjectByJson_ClsSb_EquipWorkBeforeCheckBillSub(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSb_EquipWorkBeforeCheckBillSub> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipWorkBeforeCheckBillSub>>(jsonString);
            return list;
        }
        ///设备投产检验验收单 ä¸»è¡¨
        ///ClsSb_EquipWorkBeforeCheckBillMain
        public List<Model.ClsSb_EquipWorkBeforeCheckBillMain> getObjectByJson_ClsSb_EquipWorkBeforeCheckBillMain(string jsonString)
        {
            jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsSb_EquipWorkBeforeCheckBillMain> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsSb_EquipWorkBeforeCheckBillMain>>(jsonString);
            return list;
        }
        /// <summary>
        /// è®¾å¤‡ä¿å…»è®¡åˆ’ ä¸»è¡¨
        /// </summary>
WebAPI/WebAPI.csproj
@@ -400,6 +400,8 @@
    <Compile Include="Controllers\SBGL\Sb_EquipSparepartsBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipSparepartsChangeBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipStatusChangeBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipWorkBeforeCheckBillController.cs" />
    <Compile Include="Controllers\SBGL\Sb_EquipStockInCheckBillController.cs" />
    <Compile Include="Controllers\SCGL\Sc_ComplementGoodBill_ZXBZController.cs" />
    <Compile Include="Controllers\SCGL\日计划管理\DataHelper.cs" />
    <Compile Include="Controllers\SCGL\日计划管理\JIT_Cg_PODemandPlanBillController.cs" />
@@ -952,6 +954,7 @@
    <Folder Include="Views\Sb_EquipSparepartsBill\" />
    <Folder Include="Views\Sb_EquipSparepartsChangeBill\" />
    <Folder Include="Views\Sb_EquipStatusChangeBill\" />
    <Folder Include="Views\Sb_EquipStockInCheckBill\" />
    <Folder Include="Views\Sc_CallGoodsBackRequestBill\" />
    <Folder Include="Views\Sc_ComplementGoodBill\" />
    <Folder Include="Views\Sc_ComplementGoodBill_ZXBZ\" />