1.网页 增加 巡检单2 编辑模块 和 单据列表 模块;
2.生产计划排产 界面 , 增加 页签 缺料分析; 当 点击 日期的列名时, 页签 缺料分析 获取这一天的 缺料情况 复制一个 一模一样的 生产计划排产 界面出来, 命名为 半成品计划排产 。 菜单里 也增加出来。
5个文件已修改
5个文件已添加
1655 ■■■■■ 已修改文件
DAL/DAL.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_PatrolProcCheckOtherBill.cs 420 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/Model.csproj 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_PatrolProcCheckOtherBillMain.cs 57 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_PatrolProcCheckOtherBillSub.cs 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Model/质检管理/ClsQC_PatrolProcCheckOtherBillSub_ValueGrid.cs 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/日计划管理/JIT_DayPlanPlatFormBillController.cs 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/巡检单/QC_PatrolProcCheckOtherBillController.cs 1041 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/ListModels.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/DAL.csproj
@@ -651,6 +651,7 @@
    <Compile Include="系统公用\ClsXt_SystemParameter_Ctl.cs" />
    <Compile Include="系统公用\ClsXt_BillSubType_Ctl.cs" />
    <Compile Include="计划管理\ClsGy_MaterialTechParamBillMain.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBill.cs" />
    <Compile Include="质检管理\ClsQC_WorkSelfCheckBill.cs" />
    <Compile Include="质检管理\ClsQC_StockCheckBill.cs" />
    <Compile Include="质检管理\ClsQC_NoPassProdConclusionBill.cs" />
DAL/Öʼì¹ÜÀí/ClsQC_PatrolProcCheckOtherBill.cs
New file
@@ -0,0 +1,420 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
namespace DAL
{
    public  class ClsQC_PatrolProcCheckOtherBill : DBUtility.ClsXt_BaseBill
    {
        public Model.ClsQC_PatrolProcCheckOtherBillMain omodel = new Model.ClsQC_PatrolProcCheckOtherBillMain();
        public List<Model.ClsQC_PatrolProcCheckOtherBillSub> DetailColl = new List<Model.ClsQC_PatrolProcCheckOtherBillSub>();
        public List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid> DetailColl_Value = new List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid>();
        public ClsQC_PatrolProcCheckOtherBill()
        {
            base.MvarItemKeySub = "QC_PatrolProcCheckOtherBillSub";
            base.MvarItemKeySub2 = "QC_PatrolProcCheckOtherBillSub_ValueGrid";
            base.MvarItemKeySub3 = "";
            base.MvarItemKeySub4 = "";
            base.MvarItemKey="QC_PatrolProcCheckOtherBillMain";
            base.MvarReportTitle="库存检验单";
            base.BillType= "7520";
            base.HBillSubType = "7520";
        }
        #region å›ºå®šä»£ç 
        ~ClsQC_PatrolProcCheckOtherBill()
        {
            DetailColl = null;
        }
        #endregion   è‡ªå®šä¹‰æ–¹æ³•
        //修改单据
        public override bool ModifyBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate QC_PatrolProcCheckOtherBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
                ",HDate='" + omodel.HDate + "'" +
                ",HYear='" + omodel.HYear.ToString() + "'" +
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                ",HBillStatus='" + omodel.HBillStatus + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                ",HSourceID=" + omodel.HSourceID.ToString() +
                ",HICMOInterID=" + omodel.HICMOInterID.ToString() +
                ",HICMOBillNo='" + omodel.HICMOBillNo + "'" +
                ",HICMOQty=" + omodel.HICMOQty.ToString() +
                ",HProcExchInterID=" + omodel.HProcExchInterID.ToString() +
                ",HProcExchEntryID=" + omodel.HProcExchEntryID.ToString() +
                ",HProcExchBillNo='" + omodel.HProcExchBillNo + "'" +
                ",HProcExchQty=" + omodel.HProcExchQty.ToString() +
                ",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);
                //删除子表
                DeleteBillSub(lngBillKey);
                //插入子表
                omodel.HInterID = lngBillKey;
                //插入子表
                foreach (Model.ClsQC_PatrolProcCheckOtherBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into QC_PatrolProcCheckOtherBillSub " +
                      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
                      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
                      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
                      ",HMax,HMin,HAvg,HSampleSchemeID,HSampleQty,HSampleDamageQty,HAcceptQty" +
                      ",HRejectQty,HSampleUnRightQty,HStatus,HUnitID,HInspectValB,HInspectVal,HTargetValB,HTargetVal" +
                      ",HUpLimit,HDownLimit,HUpOffSet,HDownOffSet,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" +
                      ") values("
                      + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
                      ",getdate()," + 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.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HUnit + "','" + oSub.HQCNote + "','" + oSub.HResult + "'" +
                      ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "'" + "," + oSub.HSampleSchemeID + "," + oSub.HSampleQty +
                      "," + oSub.HSampleDamageQty + "," + oSub.HAcceptQty + "," + oSub.HRejectQty + "," + oSub.HSampleUnRightQty + ",'" + oSub.HStatus +
                      "'," + oSub.HUnitID + ",'" + oSub.HInspectValB + "','" + oSub.HInspectVal + "','" + oSub.HTargetValB + "','" + oSub.HTargetVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit +
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
                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 QC_PatrolProcCheckOtherBillMain " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
                ",HYear,HPeriod,HRemark" +
                ",HSourceID,HICMOInterID,HICMOBillNo,HICMOQty,HProcExchInterID,HProcExchEntryID" +
                ",HProcExchBillNo,HProcExchQty,HMaterID,HFirstCheckEmp,HLastResult" +
                ",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.HShiftsID + ",'" + omodel.HErrTreatment + "'" +
                ") ");
                //插入子表
                foreach (Model.ClsQC_PatrolProcCheckOtherBillSub oSub in DetailColl)
                {
                    oCn.RunProc("Insert into QC_PatrolProcCheckOtherBillSub " +
                      " (HInterID,HBillNo_bak,HEntryID,HCloseMan" +
                      ",HEntryCloseDate,HCloseType,HRemark,HSourceInterID" +
                      ",HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" +
                      ",HQCCheckItemID,HQCStd,HUnit,HQCNote,HResult" +
                      ",HMax,HMin,HAvg,HSampleSchemeID,HSampleQty,HSampleDamageQty,HAcceptQty" +
                      ",HRejectQty,HSampleUnRightQty,HStatus,HUnitID,HInspectValB,HInspectVal,HTargetValB,HTargetVal" +
                      ",HUpLimit,HDownLimit,HUpOffSet,HDownOffSet,HKeyInspect,HAnalysisMethod,HInspectInstruMentID,HInspectResult" +
                      ") values("
                      + omodel.HInterID.ToString() + ",'" + oSub.HBillNo_bak + "'," + oSub.HEntryID.ToString() + ",'" + oSub.HCloseMan + "'" +
                      ",getdate()," + 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.HQCCheckItemID.ToString() + ",'" + oSub.HQCStd + "','" + oSub.HUnit + "','" + oSub.HQCNote + "','" + oSub.HResult + "'" +
                      ",'" + oSub.HMax + "','" + oSub.HMin + "','" + oSub.HAvg + "'" + "," + oSub.HSampleSchemeID + "," + oSub.HSampleQty +
                      "," + oSub.HSampleDamageQty + "," + oSub.HAcceptQty + "," + oSub.HRejectQty + "," + oSub.HSampleUnRightQty + ",'" + oSub.HStatus +
                      "'," + oSub.HUnitID + ",'" + oSub.HInspectValB + "','" + oSub.HInspectVal + "','" + oSub.HTargetValB + "','" + oSub.HTargetVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit +
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //新增检验值
        public virtual bool AddValue(ref string sReturn,ref long HInterID, ref long HEntryID)
        {
            try
            {
                oCn.BeginTran();
                oCn.RunProc("delete from QC_PatrolProcCheckOtherBillSub_ValueGrid where HInterID = " + HInterID + " and HEntryID = " + HEntryID);
                //插入子表
                foreach (Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid value in DetailColl_Value)
                {
                    oCn.RunProc("Insert into QC_PatrolProcCheckOtherBillSub_ValueGrid " +
                      " (HInterID,HEntryID,HSEQ,HInSpectResult" +
                      ",HInSpectValue,HInSpectValueB,HInSpectValueT" +
                      ") values("
                      + HInterID + "," + HEntryID + "," + value.HSEQ + ",'" + value.HInSpectResult + "'," +
                      value.HInSpectValue + "," + value.HInSpectValueB + ",'" + value.HInSpectValueT + "'" +
                      ") ");
                }
                sReturn = "新增检验值成功!";
                oCn.Commit();
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                oCn.RollBack();
                throw (e);
            }
        }
        //显示单据
        public override bool ShowBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds ;
                Ds = oCn.RunProcReturn("Select * from QC_PatrolProcCheckOtherBillMain Where HInterID=" + lngBillKey.ToString(), "QC_PatrolProcCheckOtherBillMain");
                if(Ds.Tables[0].Rows.Count==0)
                {
                    sReturn = "单据未找到!";
                    return false;
                }
                //固定赋值===========================================
                omodel.HInterID =DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HInterID"]);
                omodel.HBillNo = Ds.Tables[0].Rows[0]["HBillNo"].ToString().Trim();
                omodel.HDate =DBUtility.ClsPub.isDate(Ds.Tables[0].Rows[0]["HDate"]);
                omodel.HYear = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HYear"]);
                omodel.HPeriod = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HPeriod"]);
                omodel.HCheckItemNowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNowID"]);
                omodel.HCheckItemNextID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckItemNextID"]);
                omodel.HCheckFlowID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCheckFlowID"]);
                omodel.HRemark = Ds.Tables[0].Rows[0]["HRemark"].ToString().Trim();
                omodel.HBillStatus = DBUtility.ClsPub.isInt(Ds.Tables[0].Rows[0]["HBillStatus"]);
                omodel.HBillType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillType"]);
                omodel.HBillSubType = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBillSubType"]);
                omodel.HMaker = Ds.Tables[0].Rows[0]["HMaker"].ToString().Trim();
                omodel.HMakeDate = Ds.Tables[0].Rows[0]["HMakeDate"].ToString().Trim();
                omodel.HUpDateDate = Ds.Tables[0].Rows[0]["HUpDateDate"].ToString().Trim();
                omodel.HUpDater = Ds.Tables[0].Rows[0]["HUpDater"].ToString().Trim();
                omodel.HBackDate = Ds.Tables[0].Rows[0]["HBackDate"].ToString().Trim();
                omodel.HBacker = Ds.Tables[0].Rows[0]["HBacker"].ToString().Trim();
                omodel.HCheckDate = Ds.Tables[0].Rows[0]["HCheckDate"].ToString().Trim();
                omodel.HChecker = Ds.Tables[0].Rows[0]["HChecker"].ToString().Trim();
                omodel.HCloseDate = Ds.Tables[0].Rows[0]["HCloseDate"].ToString().Trim();
                omodel.HCloseMan = Ds.Tables[0].Rows[0]["HCloseMan"].ToString().Trim();
                omodel.HDeleteDate = Ds.Tables[0].Rows[0]["HDeleteDate"].ToString().Trim();
                omodel.HDeleteMan = Ds.Tables[0].Rows[0]["HDeleteMan"].ToString().Trim();
                //========================================================
                ////==
                //omodel.HWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HWHID"]);
                //omodel.HSCWHID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSCWHID"]);
                //omodel.HSupID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSupID"]);
                //omodel.HEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HEmpID"]);
                //omodel.HMangerID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMangerID"]);
                omodel.HSourceID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HSourceID"]);
                omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]);
                omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]);
                omodel.HICMOQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOQty"]);;
                omodel.HProcExchInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchInterID"]);
                omodel.HProcExchEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchEntryID"]);
                omodel.HProcExchBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcExchBillNo"]);
                omodel.HProcExchQty = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchQty"]);
                omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]);
                omodel.HFirstCheckEmp = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HFirstCheckEmp"]);
                omodel.HLastResult = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HLastResult"]);
                //omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]);
                //
                //循环
                DataSet DsSub ;
                DsSub = oCn.RunProcReturn("Select * from QC_PatrolProcCheckOtherBillSub Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "QC_PatrolProcCheckOtherBillSub");
                DetailColl.Clear();//清空
                for (int i = 0; i < DsSub.Tables[0].Rows.Count; i++)
                {
                    Model.ClsQC_PatrolProcCheckOtherBillSub oSub = new Model.ClsQC_PatrolProcCheckOtherBillSub();
                    // å›ºå®šèµ‹å€¼===============================================
                    oSub.HInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HInterID"]);
                    oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBillNo_bak"]);
                    oSub.HEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HEntryID"]);
                    oSub.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HCloseMan"]);
                    oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub.Tables[0].Rows[i]["HEntryCloseDate"]);
                    oSub.HCloseType = DBUtility.ClsPub.isBool(DsSub.Tables[0].Rows[i]["HCloseType"]);
                    oSub.HRemark = DsSub.Tables[0].Rows[i]["HRemark"].ToString().Trim();
                    oSub.HSourceInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceInterID"]);
                    oSub.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceEntryID"]);
                    oSub.HSourceBillType = DsSub.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
                    oSub.HSourceBillNo = DsSub.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
                    oSub.HRelationQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationQty"]);
                    oSub.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HRelationMoney"]);
                    //===================================================
                    oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQCCheckItemID"]);
                    oSub.HQCStd = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCStd"]);
                    oSub.HUnit = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUnit"]);
                    oSub.HQCNote = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HQCNote"]);
                    oSub.HResult = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HResult"]);
                    oSub.HMax = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMax"]);
                    oSub.HMin = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HMin"]);
                    oSub.HAvg = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HAvg"]);
                    //oSub.HDotCheckItemID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HDotCheckItemID"]);
                    //oSub.HDotCheckItem = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDotCheckItem"]);
                    //oSub.HDotCheckPart = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDotCheckPart"]);
                    //oSub.HClaim = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HClaim"]);
                    //oSub.HManagerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HManagerID"]);
                    //oSub.HWorkerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkerID"]);
                    //oSub.HWorkerNumber = DsSub.Tables[0].Rows[i]["HWorkerNumber"].ToString().Trim();
                    //oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
                    //oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
                    //oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]);
                    //oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
                    //oSub.HSecUnitRate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
                    //oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
                    //oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
                    //oSub.HQtyMust = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQtyMust"]);
                    //oSub.HQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQty"]);
                    //oSub.HPrice = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPrice"]);
                    //oSub.HMoney = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMoney"]);
                    //oSub.HDesignLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDesignLife"]);
                    //oSub.HLeaveLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLeaveLife"]);
                    //oSub.HUseLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUseLife"]);
                    //oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
                    //oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
                    //oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]);
                    //oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]);
                    //oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]);
                    //oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
                    //oSub.HBadCount = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HBadCount"]);
                    //oSub.HWasterQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HWasterQty"]);
                    //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
                    //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
                    //oSub.HSeOrderBillNo = DsSub.Tables[0].Rows[i]["HSeOrderBillNo"].ToString().Trim();
                    DetailColl.Add(oSub);
                }
                //DataSet DsSub2;
                //DsSub2 = oCn.RunProcReturn("Select * from QC_PatrolProcCheckOtherBillSub_Item Where HInterID=" + lngBillKey.ToString() + " order by HEntryID ", "QC_PatrolProcCheckOtherBillSub_Item");
                //DetailColl1.Clear();//清空
                //for (int i = 0; i < DsSub2.Tables[0].Rows.Count; i++)
                //{
                //    Model.ClsQC_PatrolProcCheckOtherBillSub_Item oSub2 = new Model.ClsQC_PatrolProcCheckOtherBillSub_Item();
                //    // å›ºå®šèµ‹å€¼===============================================
                //    oSub2.HInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HInterID"]);
                //    oSub2.HEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HEntryID"]);
                //    oSub2.HBillNo_bak = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HBillNo_bak"]);
                //    oSub2.HCloseMan = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HCloseMan"]);
                //    oSub2.HEntryCloseDate = DBUtility.ClsPub.isDate(DsSub2.Tables[0].Rows[i]["HEntryCloseDate"]);
                //    oSub2.HCloseType = DBUtility.ClsPub.isBool(DsSub2.Tables[0].Rows[i]["HCloseType"]);
                //    oSub2.HRemark = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HRemark"]);
                //    oSub2.HSourceInterID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HSourceInterID"]);
                //    oSub2.HSourceEntryID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HSourceEntryID"]);
                //    oSub2.HSourceBillType = DsSub2.Tables[0].Rows[i]["HSourceBillType"].ToString().Trim();
                //    oSub2.HSourceBillNo = DsSub2.Tables[0].Rows[i]["HSourceBillNo"].ToString().Trim();
                //    oSub2.HRelationQty = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[i]["HRelationQty"]);
                //    oSub2.HRelationMoney = DBUtility.ClsPub.isDoule(DsSub2.Tables[0].Rows[i]["HRelationMoney"]);
                //    //===================================================
                //    //oSub.HWorkerID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWorkerID"]);
                //    //oSub.HWorkerNumber = DsSub.Tables[0].Rows[i]["HWorkerNumber"].ToString().Trim();
                //    //oSub.HSourceID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSourceID"]);
                //    //oSub.HMaterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMaterID"]);
                //    //oSub.HPropertyID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPropertyID"]);
                //    //oSub.HSecUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSecUnitID"]);
                //    //oSub.HSecUnitRate = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSecUnitRate"]);
                //    //oSub.HUnitID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HUnitID"]);
                //    //oSub.HBatchNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HBatchNo"]);
                //    //oSub.HQtyMust = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQtyMust"]);
                //    //oSub.HQty = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HQty"]);
                //    //oSub.HPrice = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HPrice"]);
                //    //oSub.HMoney = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HMoney"]);
                //    //oSub.HDesignLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HDesignLife"]);
                //    //oSub.HLeaveLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HLeaveLife"]);
                //    //oSub.HUseLife = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HUseLife"]);
                //    //oSub.HWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HWHID"]);
                //    //oSub.HSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPID"]);
                //    //oSub.HSCWHID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCWHID"]);
                //    //oSub.HSCSPID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSCSPID"]);
                //    //oSub.HSPGroupID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSPGroupID"]);
                //    oSub2.HMaintainItemID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HMaintainItemID"]);
                //    oSub2.HMaintainItem = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HMaintainItem"]);
                //    oSub2.HMaintainPart = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HMaintainPart"]);
                //    oSub2.HClaim = DBUtility.ClsPub.isStrNull(DsSub2.Tables[0].Rows[i]["HClaim"]);
                //    oSub2.HManagerID = DBUtility.ClsPub.isLong(DsSub2.Tables[0].Rows[i]["HManagerID"]);
                //    //oSub.HQtyMust = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HQtyMust"]);
                //    //oSub.HBadCount = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HBadCount"]);
                //    //oSub.HWasterQty = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[i]["HWasterQty"]);
                //    //oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]);
                //    //oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]);
                //    //oSub.HSeOrderBillNo = DsSub.Tables[0].Rows[i]["HSeOrderBillNo"].ToString().Trim();
                //    DetailColl1.Add(oSub2);
                //}
                sReturn = "显示单据成功!";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        //审核
        public bool CheckBill(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                string HChecker = DBUtility.ClsPub.CurUserName;
                string HCheckDate = DBUtility.ClsPub.GetServerDate(-1);
                oCn.RunProc(" Update " + MvarItemKey + " set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                //生成调拨单
                //得到调拨单 mainid å•据号
                //long NewInterID = DBUtility.ClsPub.CreateBillID("1207", ref DBUtility.ClsPub.sExeReturnInfo);
                //string NewBillNo = DBUtility.ClsPub.CreateBillCode("1207", ref DBUtility.ClsPub.sExeReturnInfo, true);//得到新单号
                //oCn.RunProc("exec h_p_Kf_MoveStockBill_Add " + lngBillKey.ToString() + "," + NewInterID.ToString() + ",'" + NewBillNo + "','" + HChecker + "'");
                //
                sReturn = "";
                return true;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
    }
}
Model/Model.csproj
@@ -653,6 +653,9 @@
    <Compile Include="系统公用\ClsXt_SystemParameter_Model.cs" />
    <Compile Include="计划管理\ClsGy_MaterialTechParamBillSub.cs" />
    <Compile Include="计划管理\ClsGy_MaterialTechParamBillMain.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBillMain.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBillSub.cs" />
    <Compile Include="质检管理\ClsQC_PatrolProcCheckOtherBillSub_ValueGrid.cs" />
    <Compile Include="质检管理\ClsQC_WorkSelfCheckBillMain.cs" />
    <Compile Include="质检管理\ClsQC_StockCheckBillMain.cs" />
    <Compile Include="质检管理\ClsQC_WorkSelfCheckBillSub.cs" />
Model/Öʼì¹ÜÀí/ClsQC_PatrolProcCheckOtherBillMain.cs
New file
@@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_PatrolProcCheckOtherBillMain : DBUtility.ClsXt_BaseBillMain
    {
        public Int64 HSourceID;
        public Int64 HICMOInterID;
        public Int64 HICMOEntryID;
        public string HICMOBillNo;
        public Int64 HICMOQty;
        public Int64 HProcExchInterID;
        public Int64 HProcExchEntryID;
        public string HProcExchBillNo;
        public Int64 HProcExchQty;
        public Int64 HMaterID;
        public Int64 HFirstCheckEmp;
        public bool HLastResult;
        public Int64 HCusID;
        public string HMaterPicNo;
        public Int64 HProcID;
        public Int64 HGroupID;
        public Int64 HShiftsID;
        public string HErrTreatment;
        public Int64 HCheckQty;
        public Int64 HSourceOrgID;
        public Int64 HInspectOrgID;
        public Int64 HDeptID;
        public Int64 HQCSchemeID;
        public Int64 HUnitID;
        public Int64 HInSpectQty;
        public Int64 HRightQty;
        public Int64 HUnRightQty;
        public Int64 HSampleDamageQty;
        public Int64 HSampleUnRightQty;
        public string HQCStatus;
        public string HBatchNo;
        public Int64 HSampleQty;
        public Int64 HSampleSchemeID;
        public Int64 HAcceptQty;
        public Int64 HRejectQty;
        public Int64 HInspectTimes;
        public string HAttachMent;
        //子表 QC_StockCheckBillSub(检验项目)
        public Int64 HInspectValB;
        public Int64 HTargetValB;
        public string HInspectVal;
        public string HTargetVal;
        public string HUpLimit;
        public string HDownLimit;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_PatrolProcCheckOtherBillSub.cs
New file
@@ -0,0 +1,71 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_PatrolProcCheckOtherBillSub : DBUtility.ClsXt_BaseBillSub
    {
        public String HBillNo_bak;
        public Int64 HQCCheckItemID;
        public string HInspectResult;
        public string HAnalysisMethod;
        public Int64 HQualityStdID;
        public Int64 HInspectMethodID;
        public Int64 HInspectInstruMentID;
        public Int64 HInspectBasisID;
        public Int64 HUnitID;
        public Int64 HInspectValQ;
        public Int64 HInspectValB;
        public string HInSpectValT;
        public string HDefectLevel;
        public bool HDestructInspect;
        public double HKeyInspect;
        public string HStatus;
        public Int64 HSampleQty;
        public Int64 HSampleSchemeID;
        public Int64 HAcceptQty;
        public Int64 HRejectQty;
        public double HSampleDamageQty;
        public double HSampleUnRightQty;
        public string HInspectVal;
        public string HTargetVal;
        public string HUpLimit;
        public string HDownLimit;
        public string HUpOffSet;
        public string HDownOffSet;
        public string HInspectValKey;
        public string HTargetValKey;
        public string HUpLimitKey;
        public string HDownLimitKey;
        public string HUpOffSetKey;
        public string HDownOffSetKey;
        public Int64 HInspectValQ2;
        public Int64 HTargetValQ;
        public Int64 HUpLimitQ;
        public Int64 HDownLimitQ;
        public Int64 HUpOffSetQ;
        public Int64 HDownOffSetQ;
        public Int64 HInspectValB2;
        public Int64 HTargetValB;
        public Int64 HUpLimitB;
        public Int64 HDownLimitB;
        public Int64 HUpOffSetB;
        public Int64 HDownOffSetB;
        public string HInspectValTxt;
        public string HTargetValTxt;
        public string HUpLimitTxt;
        public string HDownLimitTxt;
        public string HUpOffSetTxt;
        public string HDownOffSetTxt;
        public string HQCStd;
        public string HUnit;
        public string HQCTool;
        public string HQCNote;
        public string HResult;
        public string HMax;
        public string HMin;
        public string HAvg;
    }
}
Model/Öʼì¹ÜÀí/ClsQC_PatrolProcCheckOtherBillSub_ValueGrid.cs
New file
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Model
{
    public class ClsQC_PatrolProcCheckOtherBillSub_ValueGrid : DBUtility.ClsXt_BaseBillSub
    {
        public Int64 HItemID;
        public Int64 HSEQ;
        public String HInSpectResult;
        public double HInSpectValue;
        public Int64 HInSpectValueB;
        public String HInSpectValueT;
    }
}
WebAPI/Controllers/SCGL/Èռƻ®¹ÜÀí/JIT_DayPlanPlatFormBillController.cs
@@ -98,6 +98,40 @@
                return objJsonResult;
            }
        }
        /// <summary>
        /// æ ¹æ®ç‚¹å‡»è¡Œæ ‡é¢˜æ—¶é—´æŸ¥è¯¢ç¼ºæ–™åˆ†æž
        /// </summary>
        /// <param name="sWhere"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        [Route("JIT_DayPlanPlatFormBill/JIT_DayPlanPlatFormBillHDateTimeList")]
        [HttpGet]
        public object JIT_DayPlanPlatFormBillHDateTimeList(string sWhere)
        {
            try
            {
                MaterialShorAnalysis Report = JsonConvert.DeserializeObject<MaterialShorAnalysis>(sWhere);
                ds = oCN.RunProcReturn($"exec h_p_JIT_MaterialShorAnalysisReportList {Report.HORGID},'{Report.HBEGINDATE}','{Report.HENDDATE}' ", "h_p_JIT_PODemandPlanBill_ReportList");
                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 ç”Ÿäº§æ—¥è®¡åˆ’平台 ä¿å­˜
WebAPI/Controllers/Æ·ÖʹÜÀí/Ѳ¼ìµ¥/QC_PatrolProcCheckOtherBillController.cs
New file
@@ -0,0 +1,1041 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
namespace WebAPI.Controllers
{
    //巡检单Controller
    //数据库主表QC_PatrolProcCheckOtherBillMain
    //数据库子表QC_PatrolProcCheckOtherBillSub
    public class QC_PatrolProcCheckOtherBillController : ApiController
    {
        public DBUtility.ClsPub.Enum_BillStatus BillStatus;
        private json objJsonResult = new json();
        SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
        public DAL.ClsQC_PatrolProcCheckOtherBill BillOld = new DAL.ClsQC_PatrolProcCheckOtherBill();
        DataSet ds;
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region å·¡æ£€å•列表  ä¸Ž  ç¼–辑回显
        [Route("QC_PatrolProcCheckOtherBill/QC_PatrolProcCheckOtherBillList")]
        [HttpGet]
        public object QC_FirstPieceCheckBillList(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sql1 = "select * from h_v_QC_PatrolProcCheckOtherBill where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckOtherBill");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•保存
        [Route("QC_PatrolProcCheckOtherBill/set_SaveBill")]
        [HttpPost]
        public object set_SaveBill([FromBody] JObject sMainSub)
        {
            var _value = sMainSub["sMainSub"].ToString();
            string msg1 = _value.ToString();
            //保存单据
            return objJsonResult = AddBillMain(msg1);
        }
        public json AddBillMain(string msg1)
        {
            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
            string msg2 = sArray[0].ToString();
            string msg3 = sArray[1].ToString();
            string OperationType = sArray[2].ToString().Trim();
            string user = sArray[3].ToString();
            string Value = sArray[4].ToString();
            bool bResult;
            try
            {
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckOtherBill_Edit", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无保存权限";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                msg2 = "[" + msg2.ToString() + "]";
                List<Model.ClsQC_PatrolProcCheckOtherBillMain> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckOtherBillMain>>(msg2);
                DAL.ClsQC_PatrolProcCheckOtherBill BillNew = new DAL.ClsQC_PatrolProcCheckOtherBill();
                //判断会计期是否合理
                string s = "";
                int sYear = 0;
                int sPeriod = 0;
                DateTime HDate = mainList[0].HDate;//日期
                if (DBUtility.Xt_BaseBillFun.Fun_AllowYearPeriod(HDate, ref sYear, ref sPeriod, ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = s;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                BillNew.omodel.HYear = sYear;
                BillNew.omodel.HPeriod = sPeriod;
                //固定赋值=================================
                BillNew.omodel.HInterID = mainList[0].HInterID;//递入type得到的单据ID
                BillNew.omodel.HBillNo = mainList[0].HBillNo;//递入type得到的单据号
                BillNew.omodel.HDate = HDate;
                BillNew.omodel.HRemark = mainList[0].HRemark;//备注
                BillNew.omodel.HMaker = mainList[0].HMaker;
                BillNew.omodel.HSourceID = ClsPub.isLong(mainList[0].HSourceID);
                BillNew.omodel.HICMOInterID = ClsPub.isLong(mainList[0].HICMOInterID);
                BillNew.omodel.HICMOBillNo = ClsPub.isStrNull(mainList[0].HICMOBillNo);
                BillNew.omodel.HICMOEntryID = ClsPub.isLong(mainList[0].HICMOEntryID);
                BillNew.omodel.HICMOQty = ClsPub.isLong(mainList[0].HICMOQty);
                BillNew.omodel.HProcExchInterID = ClsPub.isLong(mainList[0].HProcExchInterID);
                BillNew.omodel.HProcExchEntryID = ClsPub.isLong(mainList[0].HProcExchEntryID);
                BillNew.omodel.HProcExchBillNo = ClsPub.isStrNull(mainList[0].HProcExchBillNo);
                BillNew.omodel.HProcExchQty = ClsPub.isLong(mainList[0].HProcExchQty);
                BillNew.omodel.HMaterID = ClsPub.isLong(mainList[0].HMaterID);
                BillNew.omodel.HFirstCheckEmp = ClsPub.isLong(mainList[0].HFirstCheckEmp);
                BillNew.omodel.HLastResult = ClsPub.isBool(mainList[0].HLastResult);
                BillNew.omodel.HMainSourceInterID = ClsPub.isLong(mainList[0].HMainSourceInterID);
                BillNew.omodel.HMainSourceEntryID = ClsPub.isLong(mainList[0].HMainSourceEntryID);
                BillNew.omodel.HMainSourceBillNo = ClsPub.isStrNull(mainList[0].HMainSourceBillNo);
                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_PatrolProcCheckOtherBillSub> subList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckOtherBillSub>>(msg3);
                BillNew.DetailColl = new List<Model.ClsQC_PatrolProcCheckOtherBillSub>();
                for (int i = 0; i < subList.ToArray().Length; i++)
                {
                    if (i >= 0)//HQty
                    {
                        Model.ClsQC_PatrolProcCheckOtherBillSub oSub = new Model.ClsQC_PatrolProcCheckOtherBillSub();
                        oSub.HEntryID = i+1;
                        oSub.HRemark = ClsPub.isStrNull(subList[i].HRemark);
                        oSub.HSourceInterID = ClsPub.isLong(subList[i].HSourceInterID);
                        oSub.HSourceEntryID = ClsPub.isLong(subList[i].HSourceEntryID);
                        oSub.HSourceBillType = ClsPub.isStrNull(subList[i].HSourceBillType);
                        oSub.HSourceBillNo = ClsPub.isStrNull(subList[i].HSourceBillNo);
                        oSub.HRelationQty = DBUtility.ClsPub.isDoule(subList[i].HRelationQty);
                        oSub.HRelationMoney = DBUtility.ClsPub.isDoule(subList[i].HRelationMoney);
                        oSub.HCloseMan = DBUtility.ClsPub.isStrNull(subList[i].HCloseMan);
                        oSub.HEntryCloseDate = DBUtility.ClsPub.isDate(subList[i].HEntryCloseDate);
                        oSub.HCloseType = DBUtility.ClsPub.isBool(subList[i].HCloseType);
                        oSub.HQCCheckItemID = DBUtility.ClsPub.isLong(subList[i].HQCCheckItemID);
                        oSub.HQCStd = DBUtility.ClsPub.isStrNull(subList[i].HQCStd);
                        oSub.HUnit = DBUtility.ClsPub.isStrNull(subList[i].HUnit);
                        oSub.HQCNote = DBUtility.ClsPub.isStrNull(subList[i].HQCNote);
                        oSub.HResult = DBUtility.ClsPub.isStrNull(subList[i].HResult);
                        oSub.HMax = DBUtility.ClsPub.isStrNull(subList[i].HMax);
                        oSub.HMin = DBUtility.ClsPub.isStrNull(subList[i].HMin);
                        oSub.HAvg = DBUtility.ClsPub.isStrNull(subList[i].HAvg);
                        oSub.HBillNo_bak = DBUtility.ClsPub.isStrNull(mainList[0].HBillNo);
                        oSub.HSampleSchemeID= DBUtility.ClsPub.isLong(subList[i].HSampleSchemeID);
                        oSub.HSampleQty= DBUtility.ClsPub.isLong(subList[i].HSampleQty);
                        oSub.HSampleDamageQty= DBUtility.ClsPub.isDoule(subList[i].HSampleDamageQty);
                        oSub.HAcceptQty= DBUtility.ClsPub.isLong(subList[i].HAcceptQty);
                        oSub.HRejectQty= DBUtility.ClsPub.isLong(subList[i].HRejectQty);
                        oSub.HSampleUnRightQty= DBUtility.ClsPub.isDoule(subList[i].HSampleUnRightQty);
                        oSub.HStatus= DBUtility.ClsPub.isStrNull(subList[i].HStatus);
                        //*保存的时候 å†…容在表头
                        oSub.HUnitID= DBUtility.ClsPub.isLong(mainList[0].HUnitID == null ? 0 : mainList[0].HUnitID);
                        oSub.HInspectValB = DBUtility.ClsPub.isLong(mainList[0].HInspectValB == null ? 0 : mainList[0].HInspectValB);
                        oSub.HTargetValB = DBUtility.ClsPub.isLong(mainList[0].HTargetValB == null ? 0 : mainList[0].HTargetValB);
                        oSub.HInspectVal= DBUtility.ClsPub.isStrNull(mainList[0].HInspectVal);
                        oSub.HTargetVal= DBUtility.ClsPub.isStrNull(mainList[0].HTargetVal);
                        oSub.HUpLimit= DBUtility.ClsPub.isStrNull(mainList[0].HUpLimit);
                        oSub.HDownLimit= DBUtility.ClsPub.isStrNull(mainList[0].HDownLimit);
                        //*
                        oSub.HUpOffSet= DBUtility.ClsPub.isStrNull(subList[i].HUpOffSet);
                        oSub.HDownOffSet= DBUtility.ClsPub.isStrNull(subList[i].HDownOffSet);
                        oSub.HAnalysisMethod = DBUtility.ClsPub.isStrNull(subList[i].HAnalysisMethod);
                        oSub.HKeyInspect = DBUtility.ClsPub.isLong(subList[i].HKeyInspect);
                        oSub.HInspectInstruMentID = DBUtility.ClsPub.isLong(subList[i].HInspectInstruMentID);
                        oSub.HInspectResult = DBUtility.ClsPub.isStrNull(subList[i].HResult);
                        BillNew.DetailColl.Add(oSub);
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "无明细行信息!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                //保存完毕后处理
                if (OperationType.Equals("1") || OperationType.Equals("2"))
                {
                    bResult = BillNew.AddBill(ref ClsPub.sExeReturnInfo);
                }
                else
                {
                    bResult = BillNew.ModifyBill(BillNew.omodel.HInterID, ref ClsPub.sExeReturnInfo);
                }
                //提示
                if (bResult == true)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = ClsPub.sExeReturnInfo+"单据号:" + mainList[0].HBillNo.Trim();
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!原因:" + ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå€¼ä¿å­˜
        [Route("QC_PatrolProcCheckOtherBill/set_SaveValue")]
        [HttpPost]
        public object set_SaveValue([FromBody] JObject msg)
        {
            ListModels oListModels = new ListModels();
            try
            {
                var _value = msg["msg"].ToString();
                string msg1 = _value.ToString();
                string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
                string Value = sArray[0].ToString(); //检验值表格
                Int64 HInterID = Convert.ToInt64(sArray[1]); //主ID
                Int64 HEntryID = Convert.ToInt64(sArray[2]); //子ID
                bool bResult;
                List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid> valueList = new List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid>();
                valueList = oListModels.getObjectByJson_ClsQC_PatrolProcCheckOtherBillSub_ValueGrid(Value);
                DAL.ClsQC_PatrolProcCheckOtherBill BillNew = new DAL.ClsQC_PatrolProcCheckOtherBill();
                for (int i = 0; i < valueList.ToArray().Length; i++)
                {
                    if (i >= 0)//HQty
                    {
                        Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid oSub_Value = new Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid();
                        oSub_Value.HInterID = HInterID;
                        oSub_Value.HEntryID = HEntryID;
                        oSub_Value.HSEQ = i + 1;
                        oSub_Value.HInSpectResult = ClsPub.isStrNull(valueList[i].HInSpectResult);
                        oSub_Value.HInSpectValue = ClsPub.isDoule(valueList[i].HInSpectValue);
                        oSub_Value.HInSpectValueB = ClsPub.isLong(valueList[i].HInSpectValueB);
                        oSub_Value.HInSpectValueT = ClsPub.isStrNull(valueList[i].HInSpectValueT);
                        BillNew.DetailColl_Value.Add(oSub_Value);
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "无明细行信息!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                bResult = BillNew.AddValue(ref ClsPub.sExeReturnInfo, ref HInterID, ref HEntryID);
                if (bResult == true)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "保存检验值成功";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "保存失败!原因:" + ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å­è¡¨æ£€æµ‹å€¼å›žæ˜¾
        [Route("QC_PatrolProcCheckOtherBill/getValueList")]
        [HttpGet]
        public object getValueList(Int64 HInterID, Int64 HEntryID, string user)
        {
            DataSet ds;
            try
            {
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                List<object> columnNameList = new List<object>();
                ds = oCN.RunProcReturn("select * from QC_PatrolProcCheckOtherBillSub_ValueGrid  where  HInterID=" + HInterID + " and HEntryID="+ HEntryID, "QC_PatrolProcCheckOtherBillSub_ValueGrid");
                //添加列名
                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列对象的列名
                }
                if (ds.Tables[0].Rows.Count > 0)
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "Sucess!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无检测值数据!";
                    objJsonResult.data = ds.Tables[0];
                    return objJsonResult;
                }
            }
            catch (Exception e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "没有返回任何记录!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•单 å®¡æ ¸/反审核
        [Route("QC_PatrolProcCheckOtherBill/AuditQC_PatrolProcCheckOtherBill")]
        [HttpGet]
        public object AuditQC_PatrolProcCheckOtherBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有审核权限
                if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckOtherBill_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;
                BillOld.MvarItemKey = "QC_PatrolProcCheckOtherBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    //判断单据是否已经审核
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能再次审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //审核单据
                        if (!BillOld.CheckBill(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 " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能进行反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不需要反审核!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反审核单据
                        if (!BillOld.AbandonCheck(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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•单 å…³é—­/反关闭功能
        [Route("QC_PatrolProcCheckOtherBill/CloseQC_PatrolProcCheckOtherBill")]
        [HttpGet]
        public object CloseQC_PatrolProcCheckOtherBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckOtherBill_Close", 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;
                BillOld.MvarItemKey = "QC_PatrolProcCheckOtherBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                {
                    //判断单据是否已经关闭
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不能进行关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //关闭单据
                        if (!BillOld.CloseBill(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 " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未审核!不能进行关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HCloseMan"] == null || ds.Tables[0].Rows[0]["HCloseMan"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未关闭!不需要再反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反关闭单据
                        if (!BillOld.CancelClose(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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•单 ä½œåºŸ/反作废功能
        [Route("QC_PatrolProcCheckOtherBill/DropQC_PatrolProcCheckOtherBill")]
        [HttpGet]
        public object DropQC_PatrolProcCheckOtherBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有作废权限
                if (!DBUtility.ClsPub.Security_Log("QC_PatrolProcCheckOtherBill_Drop", 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;
                BillOld.MvarItemKey = "QC_PatrolProcCheckOtherBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 ä½œåºŸ  2  åä½œåºŸ
                if (Type == 1)
                {
                    //判断单据是否已经作废
                    DataSet ds;
                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds == null || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能进行作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HDeleteMan"] != null && ds.Tables[0].Rows[0]["HDeleteMan"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不需要再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //作废单据
                        if (!BillOld.Cancelltion(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 " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已审核!不能进行作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HDeleteMan"] == null || ds.Tables[0].Rows[0]["HDeleteMan"].ToString() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据未作废!不需要再反作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        //反作废单据
                        if (!BillOld.AbandonCancelltion(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)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•删除功能
        [Route("QC_PatrolProcCheckOtherBill/DeltetQC_PatrolProcCheckOtherBill")]
        [HttpGet]
        public object DeltetQC_PatrolProcCheckOtherBill(string HInterID, string user)
        {
            string ModRightNameCheck = "QC_PatrolProcCheckOtherBill_Delete";
            try
            {
                //删除权限
                if (!DBUtility.ClsPub.Security_Log(ModRightNameCheck, 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;
                }
                //开始事物
                oCN.BeginTran();
                oCN.RunProc("Delete From QC_PatrolProcCheckOtherBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_PatrolProcCheckOtherBillSub where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_PatrolProcCheckOtherBillSub_ValueGrid where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_PatrolProcCheckOtherBillSub_Result where HInterID = " + HInterID);
                //提交事务
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = null;
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack(); //回滚事物
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "删除失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•根据源单类型获取信息-源单为工序进站单
        [Route("QC_PatrolProcCheckOtherBill/get_StationInBill")]
        [HttpGet]
        public object get_StationInBill(string HInterID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sReturn = "";
                string sql = "";
                if (oSystemParameter.ShowBill(ref sReturn))
                {
                    switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource)
                    {
                        case "工序":
                            sql = "exec h_p_QC_FirstPiece_GetStationInBillList " + "'工序','" + HInterID + "'";
                            break;
                        case "物料":
                            sql = "exec h_p_QC_FirstPiece_GetStationInBillList " + "'物料','" + HInterID + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetStationInBillList " + "'工艺路线','" + HInterID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetStationInBillList");
                //添加列名
                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 = "查询数据异常,请与管理员联系!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region åº“å­˜/工序 æ£€éªŒå•根据源单类型获取信息-源单为工序流转卡
        [Route("QC_PatrolProcCheckOtherBill/get_ProcessExchangeBill")]
        [HttpGet]
        public object get_ProcessExchangeBill(string HInterID, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                string sReturn = "";
                string sql = "";
                if (oSystemParameter.ShowBill(ref sReturn))
                {
                    switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource)
                    {
                        case "工序":
                            sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'工序','" + HInterID + "'";
                            break;
                        case "物料":
                            sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'物料','" + HInterID + "'";
                            break;
                        case "工艺路线":
                            sql = "exec h_p_QC_FirstPiece_GetProcessExchangeBillList " + "'工艺路线','" + HInterID + "'";
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_FirstPiece_GetProcessExchangeBillList");
                //添加列名
                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 = "查询数据异常,请与管理员联系!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å·¡æ£€å•根据源单类型获取信息-源单为生产状态临时表(3722)
        [Route("QC_PatrolProcCheckOtherBill/get_ICMOBillStatus_Tmp")]
        [HttpGet]
        public object get_ICMOBillStatus_Tmp(int HInterID, int HEntryID, string HBillType)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                if (HInterID == 0 || HBillType.Equals(""))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "参数不全,获取源单信息失败!HInterID:" + HInterID + ";HEntryID:" + HEntryID + ";HBillType:" + HBillType + ";";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sReturn = "";
                string sql = "";
                if (oSystemParameter.ShowBill(ref sReturn))
                {
                    switch (oSystemParameter.omodel.QC_FirstPieceCheckBill_QCSchemeSource)
                    {
                        case "物料":
                            sql = "exec h_p_QC_GetInfoByICMOStatusBill " + "'物料'" + "," + HInterID + "," + HEntryID + "," + HBillType;
                            break;
                    }
                }
                ds = oCN.RunProcReturn(sql, "h_p_QC_GetInfoByICMOStatusBill");
                if (ds == null || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没查询到数据!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                else
                {
                    //添加列名
                    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 e)
            {
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
    }
}
WebAPI/ListModels.cs
@@ -4148,7 +4148,7 @@
            List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_FirstPieceCheckBillSub_ValueGrid>>(jsonString);
            return list;
        }
        ///库存检验单 å­™è¡¨
        ///ClsQC_StockCheckBillSub_ValueGrid
        public List<Model.ClsQC_StockCheckBillSub_ValueGrid> getObjectByJson_ClsQC_StockCheckBillSub_ValueGrid(string jsonString)
@@ -4158,6 +4158,15 @@
            return list;
        }
        ///巡检单2 å­™è¡¨
        ///ClsQC_PatrolProcCheckOtherBillSub_ValueGrid
        public List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid> getObjectByJson_ClsQC_PatrolProcCheckOtherBillSub_ValueGrid(string jsonString)
        {
            //jsonString = "[" + jsonString.ToString() + "]";
            List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid> list = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Model.ClsQC_PatrolProcCheckOtherBillSub_ValueGrid>>(jsonString);
            return list;
        }
        ///车间自检单 å­™è¡¨
        ///ClsQC_WorkSelfCheckBillSub_ValueGrid
        public List<Model.ClsQC_WorkSelfCheckBillSub_ValueGrid> getObjectByJson_ClsQC_WorkSelfCheckBillSub_ValueGrid(string jsonString)
WebAPI/WebAPI.csproj
@@ -523,6 +523,7 @@
    <Compile Include="Controllers\品质管理\产线返修平台\Sc_SourceLineRepairBillController.cs" />
    <Compile Include="Controllers\品质管理\客诉处理单\Crm_CustomerAppealBillController.cs" />
    <Compile Include="Controllers\品质管理\巡检单\QC_PatrolProcCheckBillController.cs" />
    <Compile Include="Controllers\品质管理\巡检单\QC_PatrolProcCheckOtherBillController.cs" />
    <Compile Include="Controllers\品质管理\工序检验单\MES_ProcessCheckBill_PDAController.cs" />
    <Compile Include="Controllers\品质管理\库存检验单\QC_StockCheckBillController.cs" />
    <Compile Include="Controllers\品质管理\质量报表\QC_QualityReportsController.cs" />