设备启动点检单、防错验证检查单、首件单、巡检单、工序转移检验单、库存检验单、车间自检单、环境检测单、不良品评审处理单、异常反馈单、异常反馈接收单、异常反馈签到单、异常反馈处理单、异常反馈验收单、检验取样单、检验还样单
数据库分页;
保存前控制,保存后控制; 审核前控制,反审核前控制, 审核后控制,反审核后控制,删除前控制,删除后控制;
关闭前控制,反关闭前控制;;关闭后控制,反关闭后控制;
1个文件已删除
41个文件已修改
8223 ■■■■ 已修改文件
DAL/MES/ClsSc_MESMaterToSourceBill .cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_BackSampleCheckBill.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_EnvironmentTestDotCheckBillMain.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_PatrolProcCheckOtherBill.cs 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_StockCheckBill.cs 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_TakeSampleCheckBill.cs 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/质检管理/ClsQC_WorkSelfCheckBill.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/车间管理/ClsQc_PreventErrMouldCheckBillMain.cs 62 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/车间管理/ClsSc_StationEntrustInBill.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/车间管理/ClsSc_StationEntrustOutBill.cs 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/车间管理/ClsSc_WorkBeginDotCheckBillMain.cs 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache 补丁 | 查看 | 原始文档 | blame | 历史
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs 356 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs 388 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs 68 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Qc_PreventErrMouldCheckBillController.cs 524 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs 517 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs 790 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/Sc_ProcessMangementController.cs 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/巡检单/QC_PatrolProcCheckOtherBillController.cs 462 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/工序检验单/QC_ProcessCheckBillController.cs 244 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/库存检验单/QC_StockCheckBillController.cs 460 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/检验取样还样单/QC_TakeSampleCheckBillController.cs 220 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/环境检测单/QC_EnvironmentTestDotCheckBillController.cs 493 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/车间自检单/QC_WorkSelfCheckBillController.cs 499 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/品质管理/首件检验单/QC_FirstPieceCheckBillController.cs 182 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/基础资料/基础资料/Gy_DisposeWayController.cs 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MESBeginStepWorkBillController.cs 386 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MESEndStepWorkBillController.cs 384 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MESProductReportStepBillController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MESStopStepWorkBillController.cs 382 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/报工台工序/Sc_MaterToSourceStepBillController.cs 459 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Controllers/生产管理/班次开班单/Sc_ShiftsBeginInfoBillController.cs 552 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/DLL/ClsOA_ErrMsgBackBill.cs 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/Properties/PublishProfiles/JFAPI.pubxml.user 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebAPI/WebAPI.csproj.user 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/bin/Debug/TopSdk.dll 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/obj/Debug/TopSdk.dll 补丁 | 查看 | 原始文档 | blame | 历史
sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb 补丁 | 查看 | 原始文档 | blame | 历史
DAL/MES/ClsSc_MESMaterToSourceBill .cs
@@ -38,6 +38,20 @@
            {
                //
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MaterToSourceBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MaterToSourceBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate Sc_MaterToSourceBillMain set  " +
                //固定赋值===============
@@ -89,6 +103,21 @@
                      ") ");
                }
                sReturn = omodel.HInterID.ToString();
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_MaterToSourceBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MaterToSourceBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                oCn.Commit();
                return true;
            }
@@ -104,10 +133,25 @@
        {
            try
            {
                DataSet ds;
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCn.RunProcReturn("Exec h_p_Sc_MaterToSourceBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MaterToSourceBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //主表
                oCn.RunProc("Insert Into Sc_MaterToSourceBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
@@ -139,8 +183,24 @@
                      ",'" + oSub.HBarCode + "','" + oSub.HBarCode_Pack + "','" + oSub.HBillNo_bak + "'" +
                      ") ");
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_MaterToSourceBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MaterToSourceBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                //再次验证 ä¿å­˜æ˜¯å¦ åˆç†
                DataSet ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_SaveCtrl @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_SaveCtrl");
                 ds = oCn.RunProcReturn("exec h_p_Sc_MaterToSourceBill_SaveCtrl @HInterId=" + omodel.HInterID + "", "h_p_Sc_MaterToSourceBill_SaveCtrl");
                if (ds == null || ds.Tables[0].Rows.Count <= 0)
                {
                    sReturn = "无验证数据!";
DAL/Öʼì¹ÜÀí/ClsQC_BackSampleCheckBill.cs
@@ -125,6 +125,8 @@
            try
            {
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_BackSampleCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_BackSampleCheckBill_BeforeSaveCtrl");
@@ -140,8 +142,7 @@
                }
                //=========================================================
                oCn.BeginTran();
                string sql = "";
                sql = "Insert Into QC_BackSampleCheckBillMain" +
DAL/Öʼì¹ÜÀí/ClsQC_EnvironmentTestDotCheckBillMain.cs
@@ -38,6 +38,21 @@
            {
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_EnvironmentTestDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_QC_EnvironmentTestDotCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate QC_EnvironmentTestDotCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  
@@ -88,6 +103,22 @@
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_EnvironmentTestDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_QC_EnvironmentTestDotCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -108,6 +139,21 @@
                DataSet ds;
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCn.RunProcReturn("Exec h_p_QC_EnvironmentTestDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_EnvironmentTestDotCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //检查主表内码是否重复,若重复则重新生成并继续检查,直到不再重复
                while (true)
@@ -174,6 +220,22 @@
                    oCn.RunProc(subSql);
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_EnvironmentTestDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_EnvironmentTestDotCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
DAL/Öʼì¹ÜÀí/ClsQC_PatrolProcCheckOtherBill.cs
@@ -38,6 +38,22 @@
            {
              
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_PatrolProcCheckOtherBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_QC_PatrolProcCheckOtherBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate QC_PatrolProcCheckOtherBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
@@ -94,6 +110,21 @@
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + Convert.ToString(oSub.HKeyInspect ? 1 : 0) + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_PatrolProcCheckOtherBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_QC_PatrolProcCheckOtherBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
@@ -115,6 +146,20 @@
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_WorkBeginDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_QualityReportBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                //主表
@@ -154,7 +199,23 @@
                      "'," + oSub.HUnitID + ",'" + oSub.HInspectValB + "','" + oSub.HInspectVal + "','" + oSub.HTargetValB + "','" + oSub.HTargetVal + "','" + oSub.HUpLimit + "','" + oSub.HDownLimit +
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + Convert.ToString(oSub.HKeyInspect ? 1 : 0)+ ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_WorkBeginDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_QualityReportBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
DAL/Öʼì¹ÜÀí/ClsQC_StockCheckBill.cs
@@ -38,6 +38,23 @@
            {
              
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_StockCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_QC_StockCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate QC_StockCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
@@ -92,6 +109,21 @@
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
                //========================= ä¿å­˜åŽæŽ§åˆ¶
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_StockCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_QC_StockCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
@@ -109,12 +141,23 @@
        {
            try
            {
                //得到mainid
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
              
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_StockCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_StockCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //主表
                oCn.RunProc("Insert Into QC_StockCheckBillMain " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -153,6 +196,22 @@
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "'," + oSub.HKeyInspect + ",'" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
              
                 //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_StockCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_StockCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;
DAL/Öʼì¹ÜÀí/ClsQC_TakeSampleCheckBill.cs
@@ -35,8 +35,25 @@
        {
            try
            {
                //
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_TakeSampleCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_QC_TakeSampleCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate QC_TakeSampleCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
@@ -81,8 +98,24 @@
                //删除子表
                //DeleteBillSub(lngBillKey);
                sReturn = "修改单据成功!";
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_TakeSampleCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_QC_TakeSampleCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                oCn.Commit();
                return true;
            }
@@ -102,6 +135,22 @@
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
               DataSet  ds = oCn.RunProcReturn("Exec h_p_QC_TakeSampleCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_TakeSampleCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //主表
                oCn.RunProc("Insert Into QC_TakeSampleCheckBillMain " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -117,6 +166,23 @@
                "','" + omodel.HCheckEmp.ToString() + "','" + omodel.HProcID.ToString() + "','" + omodel.HGroupID.ToString() + "','" + omodel.HShiftsID.ToString() + "','" + omodel.HQty.ToString() + "','" + omodel.HSourceOrgID.ToString() + "','" +omodel.HInspectOrgID.ToString()+
              "','" + omodel.HSampleDamageQty.ToString() + "','" + omodel.HBadNote + "','" + omodel.HProdWeight1.ToString() + "','" + omodel.HProdWeight2.ToString() + "','" + omodel.HProdWeight3.ToString() + "','" + omodel.TestType.ToString() + "') ");              
                sReturn = "新增单据成功!";
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_TakeSampleCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_TakeSampleCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                oCn.Commit();
                return true;
            }
DAL/Öʼì¹ÜÀí/ClsQC_WorkSelfCheckBill.cs
@@ -38,6 +38,23 @@
            {
              
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_QC_WorkSelfCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_QC_WorkSelfCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate QC_WorkSelfCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
@@ -93,6 +110,21 @@
                      "','" + oSub.HUpOffSet + "','" + oSub.HDownOffSet + "','" + oSub.HKeyInspect + "','" + oSub.HAnalysisMethod + "'," + oSub.HInspectInstruMentID + ",'" + oSub.HInspectResult + "'" + ") ");
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_WorkSelfCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_QC_WorkSelfCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
@@ -110,12 +142,24 @@
        {
            try
            {
                //得到mainid
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
                DataSet ds;
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCn.RunProcReturn("Exec h_p_QC_WorkSelfCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_QC_WorkSelfCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //主表
                oCn.RunProc("Insert Into QC_WorkSelfCheckBillMain " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -154,6 +198,24 @@
                }
              
                sReturn = "新增单据成功!";
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_QC_WorkSelfCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_QC_WorkSelfCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                oCn.Commit();
                return true;
            }
DAL/³µ¼ä¹ÜÀí/ClsQc_PreventErrMouldCheckBillMain.cs
@@ -38,6 +38,23 @@
            {
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Qc_PreventErrMouldCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2 ", "h_p_Qc_PreventErrMouldCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate Qc_PreventErrMouldCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  
@@ -80,6 +97,21 @@
                        "')";
                    oCn.RunProc(subSql);
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Qc_PreventErrMouldCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Qc_PreventErrMouldCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
@@ -102,6 +134,21 @@
                DataSet ds;
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCn.RunProcReturn("Exec h_p_Qc_PreventErrMouldCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Qc_PreventErrMouldCheckBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //检查主表内码是否重复,若重复则重新生成并继续检查,直到不再重复
                while (true)
@@ -165,6 +212,21 @@
                        "')";
                    oCn.RunProc(subSql);
                }
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_Qc_PreventErrMouldCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Qc_PreventErrMouldCheckBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
DAL/³µ¼ä¹ÜÀí/ClsSc_StationEntrustInBill.cs
@@ -812,11 +812,13 @@
            return true;
        }
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, ref string sReturn)
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, string HBillNo, string procName, string user, ref string sReturn)
        {
            try
            {
                oCn.BeginTran();
                //写入删除日志
                //oCn.RunProc("exec h_p_Sc_StationInBillMain_DropLog " + HInterID+",'"+DBUtility.ClsPub.CurUserName+"'");
@@ -836,6 +838,24 @@
                //回填流转卡进站时间
                //oCn.RunProc("update Sc_ProcessExchangeBillsub set HRelBeginDate=null where HInterID=" + HProcExchInterID + " and HEntryID=" + HProcExchEntryID);
                //删除后控制==================================================================================
                string sql2 = "exec " + procName + " " + HInterID + ",'" + HBillNo + "','" + user + "'";
                DataSet ds = oCn.RunProcReturn(sql2, procName);
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    oCn.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCn.RollBack();
                    return false;
                }
                //==============================================================================================
                oCn.Commit();
                return true;
            }
DAL/³µ¼ä¹ÜÀí/ClsSc_StationEntrustOutBill.cs
@@ -1042,7 +1042,7 @@
        }
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, ref string sReturn)
        public bool DeleteBill(long HInterID, long HProcExchInterID, long HProcExchEntryID, string HBillNo, string procName, string user, ref string sReturn)
        {
            try
            {
@@ -1050,7 +1050,6 @@
                //删除关联
                //////
                oCn.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID.ToString() + ",-1");
                oCn.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID.ToString() + ",-1");
                //
@@ -1058,8 +1057,26 @@
                //删除单据
                oCn.RunProc("delete Sc_StationOutBillMain   where HInterID=" + HInterID);
                oCn.RunProc("delete Sc_StationOutBillSub   where HInterID=" + HInterID);
               // oCn.RunProc("delete Sc_StationOutBillSub_Item   where HInterID=" + HInterID);
              //oCn.RunProc("update Sc_ProcessExchangeBillsub set HRelEndDate=null where HInterID=" + HProcExchInterID + " and HEntryID=" + HProcExchEntryID);
                // oCn.RunProc("delete Sc_StationOutBillSub_Item   where HInterID=" + HInterID);
                //oCn.RunProc("update Sc_ProcessExchangeBillsub set HRelEndDate=null where HInterID=" + HProcExchInterID + " and HEntryID=" + HProcExchEntryID);
                //删除后控制==================================================================================
                string sql2 = "exec " + procName + " " + HInterID + ",'" + HBillNo + "','" + user + "'";
                DataSet ds = oCn.RunProcReturn(sql2, procName);
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    oCn.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCn.RollBack();
                    return false;
                }
                //==============================================================================================
                oCn.Commit();
                return true;
DAL/³µ¼ä¹ÜÀí/ClsSc_WorkBeginDotCheckBillMain.cs
@@ -37,9 +37,11 @@
            try
            {
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_WorkBeginDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_QualityReportBill_BeforeSaveCtrl");
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_WorkBeginDotCheckBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_Sc_QualityReportBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
@@ -52,7 +54,7 @@
                }
                //=========================================================
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Sc_WorkBeginDotCheckBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  
@@ -107,7 +109,7 @@
                sReturn = "修改单据成功!";
                //=========================保存后控制  
                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_WorkBeginDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_QualityReportBill_AfterSaveCtrl");
                DataSet ds2 = oCn.RunProcReturn("h_p_Sc_WorkBeginDotCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_Sc_QualityReportBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
@@ -139,6 +141,7 @@
            {
                DataSet ds;
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
@@ -155,7 +158,7 @@
                }
                //=========================================================
                oCn.BeginTran();
                //检查主表内码是否重复,若重复则重新生成并继续检查,直到不再重复
                while (true)
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.AssemblyReference.cache
Binary files differ
SyntacticSugar/obj/Debug/SyntacticSugar.csproj.FileListAbsolute.txt
@@ -3,10 +3,9 @@
C:\Users\86130\Desktop\智云迈思\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.CoreCompileInputs.cache
C:\Users\86130\Desktop\智云迈思\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.dll
C:\Users\86130\Desktop\智云迈思\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.pdb
C:\Users\86130\Desktop\智云迈思\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.AssemblyReference.cache
D:\工作代码\智云迈思\MES\MES-WEB-API\SyntacticSugar\bin\Debug\SyntacticSugar.dll
D:\工作代码\智云迈思\MES\MES-WEB-API\SyntacticSugar\bin\Debug\SyntacticSugar.pdb
D:\工作代码\智云迈思\MES\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.CoreCompileInputs.cache
D:\工作代码\智云迈思\MES\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.dll
D:\工作代码\智云迈思\MES\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.pdb
D:\工作代码\智云迈思\MES\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.AssemblyReference.cache
C:\Users\86130\Desktop\智云迈思\MES-WEB-API\SyntacticSugar\obj\Debug\SyntacticSugar.csproj.AssemblyReference.cache
WebAPI/Controllers/CJGL/Cj_StationEntrustInBillController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -48,7 +49,7 @@
                else
                {
                    string sql1 = "select * from h_v_MES_StationEntrustInBillList where 1 = 1  ";
                    string sql = sql1 + sWhere+ " order by hmainid desc";
                    string sql = sql1 + sWhere + " order by hmainid desc";
                    ds = oCN.RunProcReturn(sql, "h_v_MES_StationEntrustInBillList");
                }
@@ -60,23 +61,13 @@
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception e)
            {
@@ -88,6 +79,63 @@
            }
        }
        #endregion
        #region å§”外发出单 åˆ†é¡µåˆ—表
        [Route("Cj_StationEntrustInBill/getStationEntrustInBillPage")]
        [HttpGet]
        public json getStationEntrustInBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustInBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_StationEntrustInBillList " + page + "," + size + ",''", "h_p_Sc_StationEntrustInBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_StationEntrustInBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_StationEntrustInBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region å§”外工序发出单流水号回车获取流转卡信息(委外工序接收、工序进站接收通用)
        [Route("Cj_StationEntrustInBill/txtHBarCode_KeyDown")]
@@ -2012,7 +2060,8 @@
                    return objJsonResult;
                }
                //若MAINDI重复则重新获取
                oCN.BeginTran();
                oCN.BeginTran();
                if ("Add".Equals(eventType))
                {
                    if (!AllowbillNo(HBillNo))
@@ -2024,6 +2073,28 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //保存前控制=========================================
                    string HBillNote = "";
                    ds = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_BeforeSaveCtrl  " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_StationInBill_WW_BeforeSaveCtrl ");
                    if (ds == null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=========================================================
                    //主表
                    oCN.RunProc("Insert Into Sc_StationInBillMain " +
                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -2042,9 +2113,54 @@
                    "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPieceQty +
                    ",'" + HProcNo + "','" + HOrderProcNO + "'" + ",'" + HWWWorkOrderBillNo + "'" + "," + HWWWorkOrderInterID + "" + "," + HWWWorkOrderEntryID + "," + HMainInterID + "," + HPRDOrgID +
                    ") ");
                    //=========================保存后控制  ============================
                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2 ", "h_p_Sc_StationInBill_WW_AfterSaveCtrl");
                    if (ds2 == null)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存后控制判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=======================================================
                }
                else if ("Modify".Equals(eventType))
                {
                    //保存前控制=========================================
                    string HBillNote = "";
                    ds = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_BeforeSaveCtrl  " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',2 ", "h_p_Sc_StationInBill_WW_BeforeSaveCtrl ");
                    if (ds == null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=========================================================
                    //删除关联
                    oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID + ",-1");
@@ -2069,6 +2185,30 @@
                    ",HProcNo=" + HProcNo +
                    ",HOrderProcNO='" + HOrderProcNO + "'" +
                    " where HInterID=" + HInterID);
                    //=========================保存后控制  ============================
                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2", "h_p_Sc_StationInBill_WW_AfterSaveCtrl");
                    if (ds2 == null)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存后控制判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=======================================================
                }
                else
                {
@@ -2109,6 +2249,9 @@
                }
                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_In " + HInterID.ToString() + ",1");
                oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_In " + HInterID.ToString() + ",1");
                oCN.Commit();
                string sReturn = "";
                if (oSystemParameter.ShowBill(ref sReturn) == true)
@@ -2237,24 +2380,7 @@
        {
            try
            {
                //ds = oCN.RunProcReturn("exec h_p_MES_StationInBill_DelCtrl  '" + HBillNo + "'", "h_p_MES_StationInBill_DelCtrl");
                //if (ds == null || ds.Tables[0].Rows.Count == 0)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = "判断关联失败!";
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //else if (ds.Tables[0].Rows.Count > 0 && Pub_Class.ClsPub.isInt(ds.Tables[0].Rows[0][0]) == 2)
                //{
                //    objJsonResult.code = "0";
                //    objJsonResult.count = 0;
                //    objJsonResult.Message = Pub_Class.ClsPub.isStrNull(ds.Tables[0].Rows[0][1]);
                //    objJsonResult.data = null;
                //    return objJsonResult;
                //}
                //判断权限
                if (!ClsPub.Security_Log_second("MES_StationEntrustInBill_Edit", 1, false, CurUserName))
                {
@@ -2359,8 +2485,31 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //审核前控制================================================================================
                string sql = "exec h_p_Sc_StationInBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_WW_BeforeCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //================================================================================
                //审核
                if (Cj_StationEntrustInBillCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                if (Cj_StationEntrustInBillCheckBill(HInterID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
@@ -2389,7 +2538,7 @@
        }
        //审核
        public bool Cj_StationEntrustInBillCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn)
        public bool Cj_StationEntrustInBillCheckBill(Int64 lngBillKey, string HBillNo, string CurUserName, ref string sReturn)
        {
            try
            {
@@ -2405,6 +2554,26 @@
                oCN.RunProc(" Update Sc_StationInBillMain set HChecker='" + HChecker + "',HCheckDate='" + HCheckDate + "' Where HInterID=" + lngBillKey.ToString());
                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",1");
                //审核后控制================================================================================
                string sql = "exec h_p_Sc_StationInBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_WW_AfterCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "审核过程中出错,请与网络管理人员联系";
                    oCN.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCN.RollBack();
                    return false;
                }
                //================================================================================
                sReturn = sReturn + " å®¡æ ¸åŠŸèƒ½ï¼";
                oCN.Commit();
                return true;
@@ -2464,8 +2633,31 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //反审核前控制=============================================================
                string sql = "exec h_p_Sc_StationInBill_WW_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_WW_BeforeUnCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //================================================================================
                //反审核
                if (Cj_StationEntrustInBillAbandonCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                if (Cj_StationEntrustInBillAbandonCheckBill(HInterID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
@@ -2493,7 +2685,7 @@
        }
        //反审核
        public bool Cj_StationEntrustInBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn)
        public bool Cj_StationEntrustInBillAbandonCheckBill(Int64 lngBillKey,string HBillNo, string CurUserName, ref string sReturn)
        {
            try
            {
@@ -2509,6 +2701,24 @@
                oCN.RunProc(" Update Sc_StationInBillMain set HChecker='',HCheckDate=null Where HInterID=" + lngBillKey.ToString());
                //oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Check_In " + lngBillKey.ToString() + ",-1");
                //反审核后控制=============================================================================
                string sql = "exec h_p_Sc_StationInBill_WW_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_WW_AfterUnCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "反审核过程中出错,请与网络管理人员联系";
                    oCN.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCN.RollBack();
                    return false;
                }
                //=============================================================================
                sReturn = sReturn + "反审核功能!";
                oCN.Commit();
                return true;
@@ -2571,8 +2781,31 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_StationInBill_WW_BeforeCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_WW_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭单据
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationInBill_WW_AfterCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -2598,8 +2831,32 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_StationInBill_WW_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_WW_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭单据
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationInBill_WW_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -2686,9 +2943,32 @@
                        return objJsonResult;
                    }
                    //删除前控制=========================================
                    string HBillNo = oBill.omodel.HBillNo;
                    string sql1 = "exec h_p_Sc_StationInBill_WW_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + HDeleteMan + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_WW_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //写入删除日志 
                    string WorkList = "删除委外发出单:" + oBill.omodel.HBillNo;
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, HBillNo, "h_p_Sc_StationInBill_WW_AfterDelCtrl", HDeleteMan, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
WebAPI/Controllers/CJGL/Cj_StationEntrustOutBillController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -59,25 +60,13 @@
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.list = columnNameList;
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
                return objJsonResult;
            }
            catch (Exception e)
            {
@@ -86,6 +75,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å§”外接收单 åˆ†é¡µåˆ—表
        [Route("Cj_StationEntrustOutBill/getStationEntrustOutBillPage")]
        [HttpGet]
        public json getStationEntrustInBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("MES_StationEntrustOutBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_StationEntrustOutBillList " + page + "," + size + ",''", "h_p_Sc_StationEntrustOutBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_StationEntrustOutBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_StationEntrustOutBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -260,6 +304,8 @@
                }
                //若MAINDI重复则重新获取
                oCN.BeginTran();
                if ("Add".Equals(eventType))
                {
                    //验证单据号是否重复
@@ -272,6 +318,29 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //保存前控制=========================================
                    string HBillNote = "";
                    ds = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_BeforeSaveCtrl  " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_StationInBill_WW_BeforeSaveCtrl ");
                    if (ds == null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=========================================================
                    //主表
                    oCN.RunProc("Insert Into Sc_StationOutBillMain " +
                    "(HBillType,HBillSubType,HInterID,HBillNo,HBillStatus,HDate,HMaker,HMakeDate" +
@@ -279,7 +348,8 @@
                    ",HICMOInterID,HICMOBillNo,HProcPlanInterID,HProcPlanEntryID,HProcPlanBillNo,HProcExchInterID,HProcExchEntryID" +
                    ",HProcExchBillNo,HMaterID,HProcID,HICMOQty,HPlanQty,HStationOutTime,HSourceID" +
                    ",HGroupID,HDeptID,HEmpID,HBarCode,HAddr,HBarCodeMaker,HBarCodeMakeDate" +
                    ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPrice_BHS,HMoney_BHS,HBadCount" +               ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID,HMainInterID,HPRDOrgID" +
                    ",HSupID,HTaxRate,HQty,HPrice,HMoney,HPrice_BHS,HMoney_BHS,HBadCount" +
                    ",HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HProcNo,HOrderProcNO,HLastSubProc,HWWWorkOrderBillNo,HWWWorkOrderInterID,HWWWorkOrderEntryID,HMainInterID,HPRDOrgID" +
                    ") " +
                    " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "'," + HBillStatus + ",getdate(),'" + HMaker + "',getdate()" +
                    "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HInnerBillNo + "','" + HSourceName + "'," + HPieceQty + "," + HWasterQty + "," + HPlanPieceQty + "," + HBadPNL +
@@ -289,9 +359,56 @@
                    "," + HSupID + "," + HTaxRate + "," + HQty + "," + HPrice + "," + HMoney + "," + HPrice_BHS + "," + HMoney_BHS + "," + HBadCount +
                    "," + HMainSourceInterID + ",'" + HMainSourceBillNo + "','" + HMainSourceBillType + "'," + HProcNo + ",'" + HOrderProcNO + "'," + Convert.ToString(HLastSubProc ? 1 : 0) + ",'" + HWWWorkOrderBillNo + "'," + HWWWorkOrderInterID + "," + HWWWorkOrderEntryID + "," + HMainInterID + "," + HPRDOrgID +
                    ") ");
                    //=========================保存后控制  ============================
                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Sc_StationInBill_WW_AfterSaveCtrl");
                    if (ds2 == null)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存后控制判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=======================================================
                }
                else if ("Modify".Equals(eventType))
                {
                    //保存前控制=========================================
                    string HBillNote = "";
                    ds = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_BeforeSaveCtrl  " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',2 ", "h_p_Sc_StationInBill_WW_BeforeSaveCtrl ");
                    if (ds == null)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存前判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=========================================================
                    oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID + ",-1");
                    oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID + ",-1");
                    //更新主表
@@ -318,6 +435,30 @@
                    ",HBadPNL=" + HBadPNL +
                    ",HWasterQty=" + HWasterQty +
                    " where HInterID=" + HInterID);
                    //=========================保存后控制  ============================
                    DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_WW_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',2 ", "h_p_Sc_StationInBill_WW_AfterSaveCtrl");
                    if (ds2 == null)
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存后控制判断失败!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //=======================================================
                }
                else
                {
@@ -358,6 +499,9 @@
                }
                oCN.RunProc("exec h_p_Mes_ProcessExchangeRelationQty_Out " + HInterID.ToString() + ",1");
                oCN.RunProc("exec h_p_WW_EntrustWorkOrderRelationQty_Out " + HInterID.ToString() + ",1");
                oCN.Commit();
                string sReturn = "";
                if (oSystemParameter.ShowBill(ref sReturn) == true)
@@ -491,10 +635,32 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //删除前控制=========================================
                    string HBillNo = oBill.omodel.HBillNo;
                    string sql1 = "exec h_p_StationEntrustOutBill_WW_BeforeDelCtrl " + HInterID + ",'" + HBillNo + "','" + HDeleteMan + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_StationEntrustOutBill_WW_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //写入删除日志 
                    string WorkList = "删除委外接收单:" + oBill.omodel.HBillNo;
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, ref DBUtility.ClsPub.sExeReturnInfo))
                    if (!oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HProcExchInterID, oBill.omodel.HProcExchEntryID, HBillNo, "h_p_StationEntrustOutBill_WW_AfterDelCtrl", HDeleteMan, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
@@ -661,8 +827,31 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //审核前控制================================================================================
                string sql = "exec h_p_StationEntrustOutBill_WW_BeforeCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //================================================================================
                //审核
                if (Cj_StationEntrustOutBillCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                if (Cj_StationEntrustOutBillCheckBill(HInterID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
@@ -691,7 +880,7 @@
        }
        //审核
        public bool Cj_StationEntrustOutBillCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn)
        public bool Cj_StationEntrustOutBillCheckBill(Int64 lngBillKey, string HBillNo, string CurUserName, ref string sReturn)
        {
            try
            {
@@ -718,6 +907,25 @@
                else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "是")
                {
                }
                //审核后控制================================================================================
                string sql = "exec h_p_StationEntrustOutBill_WW_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "审核过程中出错,请与网络管理人员联系";
                    oCN.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCN.RollBack();
                    return false;
                }
                //================================================================================
                sReturn = sReturn + " å®¡æ ¸åŠŸèƒ½ï¼";
                oCN.Commit();
                return true;
@@ -778,8 +986,30 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //反审核前控制=============================================================
                string sql = "exec h_p_StationEntrustOutBill_WW_BeforeUnCheckCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_BeforeUnCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //================================================================================
                //反审核
                if (Cj_StationEntrustOutBillAbandonCheckBill(HInterID, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                if (Cj_StationEntrustOutBillAbandonCheckBill(HInterID, oBill.omodel.HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    objJsonResult.code = "1";
                    objJsonResult.count = 1;
@@ -807,7 +1037,7 @@
        }
        //反审核
        public bool Cj_StationEntrustOutBillAbandonCheckBill(Int64 lngBillKey, string CurUserName, ref string sReturn)
        public bool Cj_StationEntrustOutBillAbandonCheckBill(Int64 lngBillKey, string HBillNo, string CurUserName, ref string sReturn)
        {
            if (Cj_StationEntrustOutBillisUse(lngBillKey, ref sReturn))
            {
@@ -840,6 +1070,24 @@
                else if (Pub_Class.ClsPub.isStrNull(ds1.Tables[0].Rows[0]["HFstProc"]) == "是")
                {
                }
                //反审核后控制=============================================================================
                string sql = "exec h_p_StationEntrustOutBill_WW_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_StationEntrustOutBill_WW_AfterUnCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    sReturn = "反审核过程中出错,请与网络管理人员联系";
                    oCN.RollBack();
                    return false;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    sReturn = ds.Tables[0].Rows[0]["HRemark"].ToString();
                    oCN.RollBack();
                    return false;
                }
                //=============================================================================
                sReturn = sReturn + "反审核功能!";
                oCN.Commit();
                return true;
@@ -851,7 +1099,31 @@
                return false; ;
            }
        }
        #endregion
        #region //是否被关联
        public bool Cj_StationEntrustOutBillisUse(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds;
                Ds = oCN.RunProcReturn("Select HinterID from Sc_StationOutBillSub  Where HInterID=" + lngBillKey.ToString() + " and isnull(HRelationQty,0)<>0 ", "Sc_StationOutBillSub");
                if (Ds.Tables[0].Rows.Count != 0)
                {
                    sReturn = "单据已被关联,不能操作!";
                    return true;
                }
                sReturn = "";
                return false;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        #endregion
        #region å·¥åºå§”外接收单关闭/反关闭功能
        [Route("Cj_StationEntrustOutBill/CloseCj_StationEntrustOutBill")]
@@ -901,8 +1173,31 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_StationEntrustOutBill_WW_BeforeCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_StationEntrustOutBill_WW_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭单据
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_StationEntrustOutBill_WW_AfterCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -928,8 +1223,32 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_StationEntrustOutBill_WW_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_StationEntrustOutBill_WW_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭单据
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_StationEntrustOutBill_WW_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -955,31 +1274,6 @@
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        //是否被关联
        public bool Cj_StationEntrustOutBillisUse(Int64 lngBillKey, ref string sReturn)
        {
            try
            {
                //查询主表
                DataSet Ds;
                Ds = oCN.RunProcReturn("Select HinterID from Sc_StationOutBillSub  Where HInterID=" + lngBillKey.ToString() + " and isnull(HRelationQty,0)<>0 ", "Sc_StationOutBillSub");
                if (Ds.Tables[0].Rows.Count != 0)
                {
                    sReturn = "单据已被关联,不能操作!";
                    return true;
                }
                sReturn = "";
                return false;
            }
            catch (Exception e)
            {
                sReturn = e.Message;
                throw (e);
            }
        }
        #endregion
WebAPI/Controllers/CJGL/Cj_StationInBillController.cs
@@ -389,7 +389,7 @@
                }
                //=========================保存后控制
                //=========================保存后控制  ============================
                DataSet ds2 = oCN.RunProcReturn("Exec h_p_Sc_StationInBill_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "',1 ", "h_p_Sc_StationInBill_AfterSaveCtrl");
                if (ds2 == null)
                {
@@ -410,7 +410,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //============================
                //=======================================================
                oCN.Commit();
               
@@ -990,8 +990,6 @@
        {
            try
            {
                string ModRightNameCheck = "";
                if (HBillSubType == "SUB")
                {
                    //审核权限
@@ -1046,7 +1044,7 @@
                    return objJsonResult;
                }
                //审核前控制
                //审核前控制==========================================================================
                string HBillNo = oBill.omodel.HBillNo;
                string sql = "exec h_p_Sc_StationInBill_BeforeCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeCheckCtrl");
@@ -1067,7 +1065,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //=============================================================================
                //审核
                if (Cj_StationInBillCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                {
@@ -1127,7 +1125,7 @@
                {
                }
                //审核后控制
                //审核后控制=======================================================
                string sql = "exec h_p_Sc_StationInBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -1142,7 +1140,7 @@
                    oCN.RollBack();
                    return false;
                }
                //====================================================================
                sReturn = sReturn + " å®¡æ ¸åŠŸèƒ½ï¼";
                oCN.Commit();
                return true;
@@ -1220,7 +1218,7 @@
                    return objJsonResult;
                }
                //反审核前控制
                //反审核前控制=============================================================================
                string HBillNo = oBill.omodel.HBillNo;
                string sql = "exec h_p_Sc_StationInBill_BeforeUnCheckCtrl " + HInterID + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_BeforeUnCheckCtrl");
@@ -1241,7 +1239,7 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //============================================================================================
                //反审核
                if (Cj_StationInBillAbandonCheckBill(HInterID, HBillNo, CurUserName, ref DBUtility.ClsPub.sExeReturnInfo))
                {
@@ -1305,7 +1303,7 @@
                {
                }
                //反审核后控制
                //反审核后控制========================================================================
                string sql = "exec h_p_Sc_StationInBill_AfterUnCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationInBill_AfterUnCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -1320,7 +1318,7 @@
                    oCN.RollBack();
                    return false;
                }
                //============================================================================================
                sReturn = sReturn + "反审核功能!";
                oCN.Commit();
                return true;
@@ -1420,8 +1418,32 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl " + HInterID + ",'" +HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭单据
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterCloseCtrl", user,ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -1447,8 +1469,32 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_StationInBill_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationInBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭单据
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationInBill_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -2754,7 +2754,7 @@
                int j = 0;
                for (int i = 0; i < HInterIDs.Length; i++)
                {
                    //审核前控制
                    //审核前控制================================================================================
                    string sql = "exec h_p_Sc_StationOutBill_BeforeCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -2774,7 +2774,7 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //================================================================================
                    //审核
                    if (Cj_StationOutBillCheckBill(long.Parse(HInterIDs[i]), HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
@@ -2850,7 +2850,7 @@
                    LogService.Write("出站单据审核更改流转卡数量,流转卡:" + HProcExchBillNo + ",出站单号:" + HBillNo + ",原流转卡数量:" + HProcExchQty + ",新流转卡数量:" + HQty);
                }
                //审核后控制
                //审核后控制================================================================================
                string sql = "exec h_p_Sc_StationOutBill_AfterCheckCtrl " + lngBillKey + ",'" + HBillNo + "','" + CurUserName + "'";
                ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_AfterCheckCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -2865,7 +2865,7 @@
                    oCN.RollBack();
                    return false;
                }
                //================================================================================
                sReturn = sReturn + " å®¡æ ¸åŠŸèƒ½ï¼";
                oCN.Commit();
@@ -2972,7 +2972,7 @@
                int j = 0;
                for (int i = 0; i < HInterIDs.Length; i++)
                {
                    //反审核前控制
                    //反审核前控制=============================================================
                    string sql = "exec h_p_Sc_StationOutBill_BeforeUnCheckCtrl " + HInterIDs[i] + ",'" + HBillNo[i] + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql, "h_p_Sc_StationOutBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
@@ -2992,7 +2992,7 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //================================================================================
                    //反审核
                    if (Cj_StationOutBillAbandonCheckBill(long.Parse(HInterIDs[i]),HBillNo[i], CurUserName, oBill.omodel.HLastSubProc, ref DBUtility.ClsPub.sExeReturnInfo))
                    {
@@ -3086,7 +3086,7 @@
                return false; ;
            }
        }
        #endregion
        #region å·¥åºå‡ºç«™å…³é—­/反关闭功能
        [Route("Cj_StationOutBill/CloseCj_StationOutBill")]
@@ -3151,8 +3151,32 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_StationOutBill_BeforeCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationOutBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭单据
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CloseBill(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationOutBill_AfterCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -3178,8 +3202,32 @@
                            return objJsonResult;
                        }
                    }
                    var HBillNo = ds.Tables[0].Rows[0]["HBillNo"].ToString();
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_StationOutBill_BeforeUnCloseCtrl " + HInterID + ",'" + HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_StationOutBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭单据
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
                    if (!BillOld.CancelClose(Int64.Parse(HInterID), HBillNo, "h_p_Sc_StationOutBill_AfterUnCloseCtrl", user, ref ClsPub.sExeReturnInfo))
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
@@ -3211,7 +3259,7 @@
        //是否被关联
        #region //是否被关联
        public bool Cj_StationInBillisUse(Int64 lngBillKey, ref string sReturn)
        {
            try
WebAPI/Controllers/CJGL/Qc_PreventErrMouldCheckBillController.cs
@@ -2,6 +2,7 @@
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SyntacticSugar.constant;
using System;
using System.Collections.Generic;
using System.Data;
@@ -79,6 +80,62 @@
            }
        }
        #endregion
        #region é˜²é”™éªŒè¯æ£€æŸ¥ åˆ†é¡µåˆ—表
        [Route("Qc_PreventErrMouldCheckBill/getQc_PreventErrMouldCheckBillListPage")]
        [HttpGet]
        public json getSc_WorkBeginDotCheckBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("Qc_PreventErrMouldCheckBillMain_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Qc_PreventErrMouldCheckBillList " + page + "," + size + ",''", "h_p_Qc_PreventErrMouldCheckBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Qc_PreventErrMouldCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Qc_PreventErrMouldCheckBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region é˜²é”™éªŒè¯æ£€æŸ¥åˆ—表 èŽ·å–ç¼–è¾‘åˆ—è¡¨æ•°æ®
        [Route("Qc_PreventErrMouldCheckBill/Qc_PreventErrMouldCheckBillMainEditList")]
@@ -313,9 +370,78 @@
                    return objJsonResult;
                }
                string s = "";
                DAL.ClsQc_PreventErrMouldCheckBillMain BillOld = new DAL.ClsQc_PreventErrMouldCheckBillMain();
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                oCN.BeginTran();
                //删除前控制=========================================
                string sql1 = "exec h_p_Qc_PreventErrMouldCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_Qc_PreventErrMouldCheckBill_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //==================================================================================
                oCN.RunProc("delete from Qc_PreventErrMouldCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Qc_PreventErrMouldCheckBillSub where HInterID = " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_Qc_PreventErrMouldCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_Qc_PreventErrMouldCheckBill_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==============================================================================================
                oCN.Commit();
@@ -362,44 +488,32 @@
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Qc_PreventErrMouldCheckBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                DAL.ClsQc_PreventErrMouldCheckBillMain oBill = new DAL.ClsQc_PreventErrMouldCheckBillMain();                   //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(long.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -407,42 +521,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -450,25 +532,117 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Qc_PreventErrMouldCheckBillMain";
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    oCN.BeginTran();
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Qc_PreventErrMouldCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Qc_PreventErrMouldCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Qc_PreventErrMouldCheckBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Qc_PreventErrMouldCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Qc_PreventErrMouldCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Qc_PreventErrMouldCheckBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -508,58 +682,48 @@
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Qc_PreventErrMouldCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQc_PreventErrMouldCheckBillMain oBill = new DAL.ClsQc_PreventErrMouldCheckBillMain();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -567,55 +731,101 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Qc_PreventErrMouldCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Qc_PreventErrMouldCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Qc_PreventErrMouldCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Qc_PreventErrMouldCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Qc_PreventErrMouldCheckBill_BeforeUnCloseCtrl    ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Qc_PreventErrMouldCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
WebAPI/Controllers/CJGL/Sc_WorkBeginDotCheckBillController.cs
@@ -86,6 +86,62 @@
        }
        #endregion
        #region å¯åŠ¨ç‚¹æ£€å• åˆ†é¡µåˆ—表
        [Route("Sc_WorkBeginDotCheckBill/getSc_WorkBeginDotCheckBillListPage")]
        [HttpGet]
        public json getSc_WorkBeginDotCheckBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_WorkBeginDotCheckBillList " + page + "," + size + ",''", "h_p_Sc_WorkBeginDotCheckBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_WorkBeginDotCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_WorkBeginDotCheckBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region å¯åŠ¨ç‚¹æ£€åˆ—è¡¨ èŽ·å–ç¼–è¾‘åˆ—è¡¨æ•°æ®
        [Route("Sc_WorkBeginDotCheckBill/Sc_WorkBeginDotCheckBillMainEditList")]
        [HttpGet]
@@ -318,11 +374,78 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string s = "";
                DAL.ClsSc_WorkBeginDotCheckBillMain BillOld = new DAL.ClsSc_WorkBeginDotCheckBillMain();
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                oCN.BeginTran();
                //删除前控制=========================================
                string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //==================================================================================
                oCN.RunProc("delete from Sc_WorkBeginDotCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Sc_WorkBeginDotCheckBillSub where HInterID = " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_Sc_WorkBeginDotCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_Sc_WorkBeginDotCheckBill_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==============================================================================================
                oCN.Commit();
@@ -368,45 +491,32 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Sc_WorkBeginDotCheckBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                DAL.ClsSc_WorkBeginDotCheckBillMain oBill = new DAL.ClsSc_WorkBeginDotCheckBillMain();                   //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(long.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -414,42 +524,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -457,25 +535,113 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    oCN.BeginTran();
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -514,59 +680,48 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Sc_WorkBeginDotCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsSc_WorkBeginDotCheckBillMain oBill = new DAL.ClsSc_WorkBeginDotCheckBillMain();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -574,55 +729,101 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -14,6 +14,7 @@
using System.Web.Http;
using WebAPI.Models;
using System.Threading;
using SyntacticSugar.constant;
namespace WebAPI.Controllers.SCGL
{
@@ -249,14 +250,7 @@
        }
        #endregion
        #region [报工台异常反馈单审核、反审核]
        /// <summary>
        ///
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">审核(0),反审核(1)</param>
        /// <param name="CurUserName">审核人</param>
        /// <returns></returns>
        #region [报工台异常反馈单审核、反审核]
        [Route("Sc_MESTransFerWorkBill/AuditTransFerReportList")]
        [HttpGet]
        public object AuditTransFerReportList(int HInterID, int IsAudit, string CurUserName)
@@ -337,8 +331,31 @@
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CheckBill(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -357,8 +374,30 @@
                }
                if (IsAudit == 1) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.AbandonCheck(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -382,6 +421,188 @@
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常反馈单 å…³é—­/反关闭功能
        [Route("Sc_MESTransFerWorkBill/CloseOA_ErrMsgBackBill")]
        [HttpGet]
        public object CloseOA_ErrMsgBackBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_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;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                DLL.ClsOA_ErrMsgBackBill oBill = new DLL.ClsOA_ErrMsgBackBill();          //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.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 (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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;
            }
@@ -447,8 +668,7 @@
        public static DataSet Get_TransFerBillList(string sWhere)
        {
            //var sql = "select A.HInterID,b.HEntryID,A.HBillNo,A.HContext,A.HDeptID,D.HName HDeptName, A.HSendMan, B.HReceiveMan,A.HLevel,A.HDescription,case when B.HReadFlag=0 then '未阅' when B.HReadFlag=1 then '已阅' end HReadFlag, A.HMaker,A.HMakeDate,A.HUpDater,A.HUpDateDate" +
            //   " from OA_InformBillMain A inner join  OA_InformBillSub B on A.HInterID=B.HInterID left join Gy_Department D on A.HDeptID=D.HItemID where 1=1 " + sWhere;
            var sql = string.Format(@"select A.HInterID,b.HEntryID,A.HBillStatus,A.HBillNo,A.HDate,A.HContext,A.HDescription,A.HRemark,A.HQty,case when A.HSendType=0 then '公共' when B.HReadFlag=1 then '个人' end HSendType,
                                      A.HDeptID,D.HName HDeptName, A.HSendMan, 
                                      A.HReceiveMan,B.HReceiveMan HCopyMan,A.HHasten, case when A.HLevel=0 then '普通' when B.HReadFlag=1 then '紧急' end HLevel,A.HMaterName,A.HMaterModel,
@@ -460,6 +680,61 @@
            return new SQLHelper.ClsCN().RunProcReturn(sql, "OA_ErrMsgBackBillMain");
        }
        #endregion
        #region å¼‚常反馈单 åˆ†é¡µåˆ—表
        [Route("Sc_MESTransFerWorkBill/Get_TransFerBillListPage")]
        [HttpGet]
        public json Get_TransFerBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("Sc_WorkBeginDotCheckBillMain_Check", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackBillList " + page + "," + size + ",''", "h_p_OA_ErrMsgBackBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_OA_ErrMsgBackBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region å¼‚常反馈列表PDA
@@ -527,26 +802,7 @@
            if (string.IsNullOrEmpty(HID))
                return new ApiResult<DataSet> { code = -1, msg = "ID不能为空" };
            SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
            string sql =string.Format(@"select A.HInterID,b.HEntryID,A.HBillStatus,A.HBillNo,A.HDate,A.HContext,A.HDescription,A.HRemark,
                                      A.HQty,A.HSendType,a.HForm,a.HChangeNote,a.HNote,a.HBadProcMan,f1.HName HBadProcManName,
                                        a.HQEMan,f2.HName HQEManName,a.HSourceID,s.HName HSourceName,a.HShiftsID,s1.HName HShiftsName,
                                        A.HDeptID,D.HName HDeptName, A.HSendMan,a.HCenterID HCenterID,wo.HName HCenterName,
                                        A.HReceiveMan,A.HCopyMan,A.HHasten,
                                        A.HLevel,A.HMaterNumber,A.HMaterName,A.HMaterModel,
                                        B.HReadFlag, A.HMaker,A.HMakeDate,A.HUpDater,A.HUpDateDate,A.HChecker,A.HCheckDate,A.HCloseMan,A.HCloseDate,A.HDeleteMan,A.HDeleteDate,
                                        A.HSourceInterID,A.HSourceEntryID,A.HSourceBillNo,A.HSourceBillType,
                                        A.HHandleEmpID,f.HName HHandleEmpName,A.HErrMsgBackTypeID,g.HName HErrMsgBackTypeName
                                        from OA_ErrMsgBackBillMain A
                                        inner join  OA_ErrMsgBackBillSub2 B on A.HInterID=B.HInterID
                                        left join Gy_Department D on A.HDeptID=D.HItemID
                                        left join Gy_Employee f on A.HHandleEmpID=f.HItemID
                                        left join Gy_ErrMsgBackType g on A.HErrMsgBackTypeID=g.HItemID
                                        left join Gy_Employee f1 on a.HBadProcMan=f1.HItemID
                                        left join Gy_Employee f2 on a.HQEMan=f2.HItemID
                                        left join Gy_Source s on a.HSourceID=s.HItemID
                                        left join Gy_Shifts s1 on a.HShiftsID=s1.HItemID
                                        left join Gy_WorkCenter wo on a.HCenterID=wo.HItemID
                                        where A.HInterID='" + HID + "' and b.HEntryID='" + HEntryID + "'");
            string sql =string.Format(@"select * from h_v_OA_ErrMsgBackBillEdit  where HInterID='" + HID + "' and HEntryID='" + HEntryID + "'");
            var dataSet = oCN.RunProcReturn(sql, "OA_ErrMsgBackBillMain");
            if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
                return new ApiResult<DataSet> { code = -1, msg = "不存在单号" };
@@ -571,11 +827,8 @@
        }
        #endregion
        #region [模具改制申请单删除功能]
        /// <summary>
        /// æ¨¡å…·æ”¹åˆ¶ç”³è¯·å•删除功能
        /// </summary>
        /// <returns></returns>
        #region [异常反馈单删除功能]
        [Route("Sc_MESTransFerWorkBill/Get_DeleteTransFerBill")]
        [HttpGet]
        public object Get_DeleteTransFerBill(string HInterID,string HEntryID, string user)
@@ -629,7 +882,30 @@
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    bool IsDete = oBill.DeleteBill(lngBillKey, HEntryID, ref DBUtility.ClsPub.sExeReturnInfo);
                    //删除前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackBill_BeforeDelCtrl  " + BillOld1.omodel.HInterID + ",'" + BillOld1.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackBill_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    bool IsDete = oBill.DeleteBill(lngBillKey, HEntryID, "h_p_OA_ErrMsgBackBill_AfterDelCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo);
                    if (IsDete)
                    {
                        objJsonResult.code = "1";
@@ -1082,8 +1358,8 @@
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainList where hmainid='"+HID+"'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainList");
                string sql = "select * from h_v_OA_ErrMsgBackReceiveBillMainEdit where hmainid='" + HID+"'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackReceiveBillMainEdit");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -1165,6 +1441,61 @@
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常反馈接收单列表 åˆ†é¡µåˆ—表
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackReceiveBillListPage")]
        [HttpGet]
        public json Get_OA_ErrMsgBackReceiveBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackReceiveBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackReceiveBillList " + page + "," + size + ",''", "h_p_OA_ErrMsgBackReceiveBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackReceiveBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_OA_ErrMsgBackReceiveBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -1648,8 +1979,30 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackReceiveBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackReceiveBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackReceiveBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -1668,8 +2021,31 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackReceiveBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackReceiveBill_BeforeUnCloseCtrl    ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackReceiveBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -2077,8 +2453,8 @@
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_OA_ErrMsgBackSignBillMainList where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillMainList");
                string sql = "select * from h_v_OA_ErrMsgBackSignBillMainEdit where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackSignBillMainEdit");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -2160,6 +2536,61 @@
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常反馈签到单列表 åˆ†é¡µåˆ—表
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackSignBillListPage")]
        [HttpGet]
        public json Get_OA_ErrMsgBackSignBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackSignBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSignBillList " + page + "," + size + ",''", "h_p_OA_ErrMsgBackSignBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackSignBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_OA_ErrMsgBackSignBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -2643,8 +3074,31 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackSignBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackSignBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackSignBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -2663,8 +3117,32 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackSignBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackSignBill_BeforeUnCloseCtrl    ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackSignBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -2994,8 +3472,8 @@
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainList where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainList");
                string sql = "select * from h_v_OA_ErrMsgBackHandleBillMainEdit where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackHandleBillMainEdit");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -3080,6 +3558,63 @@
            }
        }
        #endregion
        #region å¼‚常反馈处理单 åˆ†é¡µåˆ—表
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackHandleBillListPage")]
        [HttpGet]
        public json Get_OA_ErrMsgBackHandleBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackHandleBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackHandleBillList " + page + "," + size + ",''", "h_p_OA_ErrMsgBackHandleBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackHandleBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_OA_ErrMsgBackHandleBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region å¼‚常反馈处理单列表PDA
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackHandleBillList_PDA")]
@@ -3557,8 +4092,31 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackHandleBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackHandleBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -3577,8 +4135,31 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackHandleBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackHandleBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackHandleBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -3908,8 +4489,8 @@
            {
                List<object> columnNameList = new List<object>();
                string sql = "select * from h_v_OA_ErrMsgBackCheckBillMainList where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainList");
                string sql = "select * from h_v_OA_ErrMsgBackCheckBillMainEdit where hmainid='" + HID + "'";
                ds = oCN.RunProcReturn(sql, "h_v_OA_ErrMsgBackCheckBillMainEdit");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -3991,6 +4572,61 @@
                objJsonResult.Message = "查询数据异常,请与管理员联系!" + ex.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼‚常反馈验收单 åˆ†é¡µåˆ—表
        [Route("Sc_MESTransFerWorkBill/Get_OA_ErrMsgBackCheckBillListPage")]
        [HttpGet]
        public json Get_OA_ErrMsgBackCheckBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackCheckBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackCheckBillList " + page + "," + size + ",''", "h_p_OA_ErrMsgBackCheckBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_OA_ErrMsgBackCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_OA_ErrMsgBackCheckBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -4471,8 +5107,30 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackCheckBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -4491,8 +5149,32 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_OA_ErrMsgBackCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_OA_ErrMsgBackCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_OA_ErrMsgBackCheckBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
WebAPI/Controllers/Sc_ProcessMangementController.cs
@@ -12,6 +12,7 @@
using WebAPI.Models;
using WebAPI.Service;
using Kingdee.BOS.WebApi.Client;
using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
@@ -6121,6 +6122,61 @@
        }
        #endregion
        #region ä¸è‰¯å“è¯„审处理单 åˆ†é¡µåˆ—表
        [Route("Sc_ProcessMangement/getGet_QC_NoPassProdDisposeBillListPage")]
        [HttpGet]
        public json Get_QC_NoPassProdDisposeBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_NoPassProdDisposeBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_NoPassProdDisposeBillList " + page + "," + size + ",''", "h_p_QC_NoPassProdDisposeBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_NoPassProdDisposeBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_NoPassProdDisposeBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region ä¸è‰¯å“è¯„审处理单 åˆ é™¤
        [Route("Sc_ProcessMangement/DeleteQC_NoPassProdDisposeBill")]
@@ -6539,8 +6595,30 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -6559,8 +6637,31 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_WorkBeginDotCheckBill_BeforeUnCloseCtrl    ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_WorkBeginDotCheckBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
WebAPI/Controllers/Æ·ÖʹÜÀí/Ѳ¼ìµ¥/QC_PatrolProcCheckOtherBillController.cs
@@ -504,42 +504,33 @@
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_PatrolProcCheckOtherBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                ClsPub.CurUserName = user;
                DAL.ClsQC_PatrolProcCheckOtherBill oBill = new DAL.ClsQC_PatrolProcCheckOtherBill();                   //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(long.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -547,42 +538,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -590,25 +549,114 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    oCN.BeginTran();
                    //审核前控制=========================================
                    string sql1 = "exec h_p_QC_PatrolProcCheckOtherBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_PatrolProcCheckOtherBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_PatrolProcCheckOtherBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_QC_PatrolProcCheckOtherBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_PatrolProcCheckOtherBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_PatrolProcCheckOtherBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -647,59 +695,49 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_PatrolProcCheckOtherBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQC_PatrolProcCheckOtherBill oBill = new DAL.ClsQC_PatrolProcCheckOtherBill();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -707,55 +745,101 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_PatrolProcCheckOtherBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_PatrolProcCheckOtherBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_PatrolProcCheckOtherBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_PatrolProcCheckOtherBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_PatrolProcCheckOtherBill_BeforeUnCloseCtrl    ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_PatrolProcCheckOtherBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -929,15 +1013,79 @@
                    return objJsonResult;
                }
                string s = "";
                DAL.ClsQC_PatrolProcCheckOtherBill BillOld = new DAL.ClsQC_PatrolProcCheckOtherBill();
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //开始事物
                oCN.BeginTran();
                oCN.BeginTran();
                //删除前控制=========================================
                string sql1 = "exec h_p_QC_PatrolProcCheckOtherBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_QC_PatrolProcCheckOtherBill_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //==================================================================================
                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);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_QC_PatrolProcCheckOtherBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_QC_PatrolProcCheckOtherBill_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==============================================================================================
                //提交事务
                oCN.Commit();
                objJsonResult.code = "1";
WebAPI/Controllers/Æ·ÖʹÜÀí/¹¤Ðò¼ìÑéµ¥/QC_ProcessCheckBillController.cs
@@ -22,58 +22,7 @@
        public DAL.ClsQC_ProcessCheckBill BillOld = new DAL.ClsQC_ProcessCheckBill();
        DataSet ds;
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        //#region å·¥åºæ£€éªŒå•列表
        //[Route("QC_ProcessCheckBill/QC_ProcessCheckBillList")]
        //[HttpGet]
        //public object QC_ProcessCheckBillList(string sWhere, string user)
        //{
        //    try
        //    {
        //        List<object> columnNameList = new List<object>();
        //        string sql1 = "select * from h_v_QC_ProcessCheckBill where 1 = 1  ";
        //        string sql = sql1 + sWhere + " order by hmainid desc";
        //        ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBill");
        //        //添加列名
        //        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.list = columnNameList;
        //            objJsonResult.data = ds.Tables[0];
        //            return objJsonResult;
        //        }
        //        else
        //        {
        //            objJsonResult.code = "0";
        //            objJsonResult.count = 0;
        //            objJsonResult.Message = "没有查询到数据";
        //            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
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region å·¥åºæ£€éªŒå•列表
        [Route("QC_ProcessCheckBill/QC_ProcessCheckBillList")]
@@ -508,52 +457,49 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_ProcessCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQC_ProcessCheckBill oBill = new DAL.ClsQC_ProcessCheckBill();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -561,49 +507,101 @@
                }
                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]["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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_ProcessCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_ProcessCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_ProcessCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_ProcessCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_ProcessCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_ProcessCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
@@ -784,22 +782,12 @@
                    ds = oCN.RunProcReturn(sql, "h_v_QC_ProcessCheckBillListDetail");
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                return objJsonResult;
                //}
                //else
                //{
                //objJsonResult.code = "0";
                //objJsonResult.count = 0;
                //objJsonResult.Message = "无数据";
                //objJsonResult.data = null;
                //return objJsonResult;
                //}
            }
            catch (Exception e)
            {
WebAPI/Controllers/Æ·ÖʹÜÀí/¿â´æ¼ìÑéµ¥/QC_StockCheckBillController.cs
@@ -507,42 +507,30 @@
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_StockCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQC_StockCheckBill oBill = new DAL.ClsQC_StockCheckBill();                   //实例化单据操作类,用于进行相关操作
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(long.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -550,42 +538,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -593,25 +549,113 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    oCN.BeginTran();
                    //审核前控制=========================================
                    string sql1 = "exec h_p_QC_StockCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_StockCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_StockCheckBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_QC_StockCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_StockCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_StockCheckBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -651,58 +695,49 @@
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_StockCheckBillMain";
                oCN.BeginTran();//开始事务
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                DAL.ClsQC_StockCheckBill oBill = new DAL.ClsQC_StockCheckBill();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -710,55 +745,101 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_StockCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_StockCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_StockCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_StockCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_StockCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_StockCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -931,16 +1012,79 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string s = "";
                DAL.ClsQC_StockCheckBill BillOld = new DAL.ClsQC_StockCheckBill();
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //开始事物
                oCN.BeginTran();
                oCN.BeginTran();
                //删除前控制=========================================
                string sql1 = "exec h_p_QC_StockCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_QC_StockCheckBill_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //==================================================================================
                oCN.RunProc("Delete From QC_StockCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_StockCheckBillSub where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_StockCheckBillSub_ValueGrid where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_StockCheckBillSub_Result where HInterID = " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_QC_StockCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_QC_StockCheckBill_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==============================================================================================
                //提交事务
                oCN.Commit();
                objJsonResult.code = "1";
WebAPI/Controllers/Æ·ÖʹÜÀí/¼ìÑéÈ¡Ñù»¹Ñùµ¥/QC_TakeSampleCheckBillController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -81,6 +82,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒå–样单列表 åˆ†é¡µåˆ—表
        [Route("QC_TakeSampleCheckBill/getQC_TakeSampleCheckBillListPage")]
        [HttpGet]
        public json getQC_TakeSampleCheckBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_TakeSampleCheckBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_TakeSampleCheckBillList " + page + "," + size + ",''", "h_p_QC_TakeSampleCheckBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_TakeSampleCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_TakeSampleCheckBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -342,6 +398,9 @@
                        return objJsonResult;
                    }
                    oCN.BeginTran();
                    //删除前控制=========================================      
                    string sql1 = "exec h_p_QC_TakeSampleCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_TakeSampleCheckBill_BeforeDelCtrl");
@@ -364,9 +423,6 @@
                    }
                    //==================================================================================  
                    oCN.BeginTran();
                    oCN.RunProc("delete from QC_TakeSampleCheckBillMain where HInterID = " + HInterID);
                    oCN.RunProc("delete from QC_TakeSampleCheckBillSub where HInterID= " + HInterID);
@@ -732,8 +788,30 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_TakeSampleCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_TakeSampleCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_TakeSampleCheckBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -752,8 +830,30 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_TakeSampleCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_TakeSampleCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_TakeSampleCheckBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -1002,6 +1102,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region æ£€éªŒè¿˜æ ·å•列表 åˆ†é¡µåˆ—表
        [Route("QC_TakeSampleCheckBill/get_QC_BackSampleCheckBillListPage")]
        [HttpGet]
        public json get_QC_BackSampleCheckBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_BackSampleCheckBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_BackSampleCheckBillList " + page + "," + size + ",''", "h_p_QC_BackSampleCheckBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_BackSampleCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_BackSampleCheckBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -1281,6 +1436,9 @@
                        return objJsonResult;
                    }
                    oCN.BeginTran();
                    //删除前控制=========================================      
                    string sql1 = "exec h_p_QC_BackSampleCheckBill_BeforeDelCtrl " + BillOld1.omodel.HInterID + ",'" + BillOld1.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_BackSampleCheckBill_BeforeDelCtrl");
@@ -1302,10 +1460,6 @@
                        return objJsonResult;
                    }
                    //==================================================================================  
                    oCN.BeginTran();
                    oCN.RunProc("delete from QC_BackSampleCheckBillMain where HInterID = " + HInterID);
                    oCN.RunProc("delete from QC_BackSampleCheckBillSub where HInterID= " + HInterID);
@@ -1671,8 +1825,30 @@
                //进行需要进行的关闭/反关闭操作
                if (IsAudit == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_BackSampleCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_BackSampleCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_BackSampleCheckBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -1691,8 +1867,30 @@
                }
                if (IsAudit == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_BackSampleCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_BackSampleCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_BackSampleCheckBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
WebAPI/Controllers/Æ·ÖʹÜÀí/»·¾³¼ì²âµ¥/QC_EnvironmentTestDotCheckBillController.cs
@@ -2,6 +2,7 @@
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SyntacticSugar.constant;
using System;
using System.Collections.Generic;
using System.Data;
@@ -77,6 +78,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region çŽ¯å¢ƒæ£€æµ‹é¡¹ç›® åˆ†é¡µåˆ—表
        [Route("QC_EnvironmentTestDotCheckBill/getQC_EnvironmentTestDotCheckBillListPage")]
        [HttpGet]
        public json QC_EnvironmentTestDotCheckBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_EnvironmentTestDotCheckBillMain_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_EnvironmentTestDotCheckBillList " + page + "," + size + ",''", "h_p_QC_EnvironmentTestDotCheckBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_QC_EnvironmentTestDotCheckBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_QC_EnvironmentTestDotCheckBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -315,7 +371,55 @@
                oCN.BeginTran();
                //删除前控制=========================================
                string sql1 = "exec h_p_QC_EnvironmentTestDotCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_QC_EnvironmentTestDotCheckBill_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //==================================================================================
                oCN.RunProc("delete from QC_EnvironmentTestDotCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from QC_EnvironmentTestDotCheckBillSub where HInterID = " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_QC_EnvironmentTestDotCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_QC_EnvironmentTestDotCheckBill_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==============================================================================================
                oCN.Commit();
@@ -364,42 +468,30 @@
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_EnvironmentTestDotCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQC_EnvironmentTestDotCheckBillMain oBill = new DAL.ClsQC_EnvironmentTestDotCheckBillMain();                   //实例化单据操作类,用于进行相关操作
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(long.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -407,42 +499,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -450,26 +510,113 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    oCN.BeginTran();
                    //审核前控制=========================================
                    string sql1 = "exec h_p_QC_EnvironmentTestDotCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_EnvironmentTestDotCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_EnvironmentTestDotCheckBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_QC_EnvironmentTestDotCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_EnvironmentTestDotCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_EnvironmentTestDotCheckBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
@@ -507,59 +654,48 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_EnvironmentTestDotCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQC_EnvironmentTestDotCheckBillMain oBill = new DAL.ClsQC_EnvironmentTestDotCheckBillMain();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -567,56 +703,101 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_EnvironmentTestDotCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_EnvironmentTestDotCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_EnvironmentTestDotCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_EnvironmentTestDotCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_EnvironmentTestDotCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_EnvironmentTestDotCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
WebAPI/Controllers/Æ·ÖʹÜÀí/³µ¼ä×Լ쵥/QC_WorkSelfCheckBillController.cs
@@ -24,7 +24,7 @@
        //获取系统参数
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
        #region è½¦é—´è‡ªæ£€å•列表  ä¸Ž  ç¼–辑回显
        #region è½¦é—´è‡ªæ£€å•列表
        [Route("QC_WorkSelfCheckBill/QC_WorkSelfCheckBillList")]
        [HttpGet]
        public object QC_FirstPieceCheckBillList(string sWhere, string user)
@@ -43,9 +43,59 @@
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_QC_WorkSelfCheckBill where 1 = 1  ";
                string sql1 = "select * from h_v_QC_WorkSelfCheckBillList where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_WorkSelfCheckBill");
                ds = oCN.RunProcReturn(sql, "h_v_QC_WorkSelfCheckBillList");
                //添加列名
                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_WorkSelfCheckBill/QC_WorkSelfCheckBillEdit")]
        [HttpGet]
        public object QC_WorkSelfCheckBillEdit(string sWhere, string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("QC_WorkSelfCheckBill_Query", 3, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "您没有该模块权限,请与管理员联系!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                string sql1 = "select * from h_v_QC_WorkSelfCheckBillEdit where 1 = 1  ";
                string sql = sql1 + sWhere + " order by hmainid desc";
                ds = oCN.RunProcReturn(sql, "h_v_QC_WorkSelfCheckBillEdit");
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
@@ -461,44 +511,32 @@
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_WorkSelfCheckBillMain";
                oCN.BeginTran();//开始事务
                ClsPub.CurUserName = user;
                DAL.ClsQC_WorkSelfCheckBill oBill = new DAL.ClsQC_WorkSelfCheckBill();
                oBill.MvarItemKey = "QC_WorkSelfCheckBillMain";
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(long.Parse(HInterID), ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -506,42 +544,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -549,25 +555,113 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                {
                    oCN.BeginTran();
                    //审核前控制=========================================
                    string sql1 = "exec h_p_QC_WorkSelfCheckBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_WorkSelfCheckBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_WorkSelfCheckBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_QC_WorkSelfCheckBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_WorkSelfCheckBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_QC_WorkSelfCheckBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -608,57 +702,47 @@
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_WorkSelfCheckBillMain";
                oCN.BeginTran();//开始事务
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                DAL.ClsQC_WorkSelfCheckBill oBill = new DAL.ClsQC_WorkSelfCheckBill();           //实例化单据操作类,用于进行相关操作
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -666,55 +750,101 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_WorkSelfCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_WorkSelfCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_WorkSelfCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_WorkSelfCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_WorkSelfCheckBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_WorkSelfCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
@@ -890,13 +1020,58 @@
                //开始事物
                oCN.BeginTran();
                oCN.BeginTran();
                //删除前控制=========================================
                string sql1 = "exec h_p_QC_WorkSelfCheckBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql1, "h_p_QC_WorkSelfCheckBill_BeforeDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //==================================================================================
                oCN.RunProc("Delete From QC_WorkSelfCheckBillMain where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_WorkSelfCheckBillSub where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_WorkSelfCheckBillSub_ValueGrid where HInterID = " + HInterID);
                oCN.RunProc("Delete From QC_WorkSelfCheckBillSub_Result where HInterID = " + HInterID);
                //删除后控制==================================================================================
                string sql2 = "exec h_p_QC_WorkSelfCheckBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                ds = oCN.RunProcReturn(sql2, "h_p_QC_WorkSelfCheckBill_AfterDelCtrl");
                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 1;
                    objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==============================================================================================
                //提交事务
                oCN.Commit();
                objJsonResult.code = "1";
WebAPI/Controllers/Æ·ÖʹÜÀí/Ê×¼þ¼ìÑéµ¥/QC_FirstPieceCheckBillController.cs
@@ -769,52 +769,49 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "QC_FirstPieceCheckBillMain";
                oCN.BeginTran();//开始事务
                DAL.ClsQC_FirstPieceCheckBill oBill = new DAL.ClsQC_FirstPieceCheckBill();
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                BillOld.MvarItemKey = "QC_FirstPieceCheckBillMain";
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HCloseMan"] != null && ds.Tables[0].Rows[0]["HCloseMan"].ToString() != "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -822,48 +819,101 @@
                }
                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]["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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_QC_FirstPieceCheckBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_FirstPieceCheckBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_FirstPieceCheckBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_QC_FirstPieceCheckBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_QC_FirstPieceCheckBill_BeforeUnCloseCtrl    ");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_QC_FirstPieceCheckBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反关闭失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
WebAPI/Controllers/»ù´¡×ÊÁÏ/»ù´¡×ÊÁÏ/Gy_DisposeWayController.cs
@@ -55,32 +55,20 @@
                    ds = oCN.RunProcReturn(sql, "h_v_Gy_DisposeWayList");
                }
                if (ds.Tables[0].Rows.Count != 0 && ds != null)
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    //添加列名
                    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;
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "没有查询到数据!";
                    objJsonResult.data = ds.Tables[0];
                    objJsonResult.list = columnNameList;
                    return objJsonResult;
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = columnNameList;
                return objJsonResult;
            }
            catch (Exception e)
            {
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESBeginStepWorkBillController.cs
@@ -3,6 +3,7 @@
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections.Generic;
using System.Data;
@@ -95,6 +96,62 @@
            }
        }
        #region å¼€å·¥å• åˆ†é¡µåˆ—表
        [Route("Sc_MESBeginStepWorkBill/GetMESBeginStepWorkBillPage")]
        [HttpGet]
        public json GetMESBeginStepWorkBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("MES_MESBeginWorkBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MESBeginWorkBillList " + page + "," + size + ",''", "h_p_Sc_MESBeginWorkBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MESBeginWorkBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MESBeginWorkBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #endregion
@@ -406,6 +463,333 @@
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region å¼€å·¥å• å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_MESBeginStepWorkBill/CloseSc_MESBeginWorkBill")]
        [HttpGet]
        public object CloseSc_MESBeginWorkBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESBeginWorkBill_Close";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "关闭失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                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);                                         //对HInterID进行类型的转换
                DLL.ClsSc_MESBeginWorkBill oBill = new DLL.ClsSc_MESBeginWorkBill();             //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.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) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MESBeginWorkBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESBeginWorkBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESBeginWorkBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MESBeginWorkBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESBeginWorkBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESBeginWorkBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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
        #region å¼€å·¥å• ä½œåºŸ/反作废
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">作废(0),反作废(1)</param>
        /// <param name="CurUserName">作废人</param>
        /// <returns></returns>
        [Route("Sc_MESBeginStepWorkBill/DeleteSc_MESBeginWorkBill")]
        [HttpGet]
        public object DeleteSc_MESBeginWorkBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESBeginWorkBill_Delete";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "作废失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                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);                                         //对HInterID进行类型的转换
                DLL.ClsSc_MESBeginWorkBill oBill = new DLL.ClsSc_MESBeginWorkBill();             //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HChecker.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反作废判断
                    {
                        if (oBill.omodel.HDeleteMan.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.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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;
            }
@@ -1207,7 +1591,7 @@
                oCN.Commit();
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "删除产量汇报单成功!";
                objJsonResult.Message = "删除成功!";
                objJsonResult.data = ds;
                return objJsonResult;
            }
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESEndStepWorkBillController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections.Generic;
using System.Data;
@@ -87,6 +88,62 @@
        }
        #endregion
        #region å®Œå·¥å• åˆ†é¡µåˆ—表
        [Route("Sc_MESEndStepWorkBill/GetSc_MESEndWorkBillPage")]
        [HttpGet]
        public json GetSc_MESEndWorkBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("MES_MESEndWorkBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MESEndWorkBillList " + page + "," + size + ",''", "h_p_Sc_MESEndWorkBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MESEndWorkBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MESEndWorkBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
        #region[完工单编辑时获取表头数据]
        [Route("Sc_MESEndStepWorkBill/Sc_MESEndWorkBillListCheckDetai")]
@@ -505,6 +562,333 @@
        }
        #endregion
        #region å®Œå·¥å• å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_MESEndStepWorkBill/CloseSc_MESEndWorkBill")]
        [HttpGet]
        public object CloseSc_MESEndWorkBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESEndWorkBill_Close";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "关闭失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                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);                                         //对HInterID进行类型的转换
                DLL.ClsSc_MESEndWorkBill oBill = new DLL.ClsSc_MESEndWorkBill();           //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.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) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MESEndWorkBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESEndWorkBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESEndWorkBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MESEndWorkBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESEndWorkBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESEndWorkBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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
        #region å®Œå·¥å• ä½œåºŸ/反作废
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">作废(0),反作废(1)</param>
        /// <param name="CurUserName">作废人</param>
        /// <returns></returns>
        [Route("Sc_MESEndStepWorkBill/DeleteSc_MESEndWorkBill")]
        [HttpGet]
        public object DeleteSc_MESEndWorkBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESEndWorkBill_Delete";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "作废失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                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);                                         //对HInterID进行类型的转换
                DLL.ClsSc_MESEndWorkBill oBill = new DLL.ClsSc_MESEndWorkBill();           //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HChecker.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反作废判断
                    {
                        if (oBill.omodel.HDeleteMan.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.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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
        #endregion
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESProductReportStepBillController.cs
@@ -145,7 +145,7 @@
        #endregion
        #region è´¨é‡æ±‡æŠ¥å• åˆ†é¡µåˆ—表
        #region äº§é‡æ±‡æŠ¥å• åˆ†é¡µåˆ—表
        [Route("Sc_MESProductReportStepBill/Get_Sc_MESProductReportBillPage")]
        [HttpGet]
        public json Get_Sc_MESProductReportBillPage(string sWhere, string user, int page, int size)
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MESStopStepWorkBillController.cs
@@ -1,6 +1,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Pub_Class;
using SyntacticSugar.constant;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -76,6 +77,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region åœå·¥å• åˆ†é¡µåˆ—表
        [Route("Sc_MESStopStepWorkBill/GetSc_MESStopStepWorkBillPage")]
        [HttpGet]
        public json GetSc_MESStopStepWorkBillPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("MES_MESStopWorkBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MESStopWorkBillList " + page + "," + size + ",''", "h_p_Sc_MESStopWorkBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MESStopWorkBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MESStopWorkBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -497,6 +553,332 @@
        }
        #endregion
        #region åœå·¥å• å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_MESStopStepWorkBill/CloseSc_MESStopStepWorkBill")]
        [HttpGet]
        public object CloseSc_MESStopStepWorkBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESStopWorkBill_Close";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "关闭失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                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);                                         //对HInterID进行类型的转换
                DLL.ClsSc_MESStopWorkBill oBill = new DLL.ClsSc_MESStopWorkBill();            //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.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) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MESStopStepWorkBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESStopStepWorkBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESStopStepWorkBill_AfterCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MESStopStepWorkBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MESStopStepWorkBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MESStopStepWorkBill_AfterUnCloseCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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
        #region åœå·¥å• ä½œåºŸ/反作废
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="IsAudit">作废(0),反作废(1)</param>
        /// <param name="CurUserName">作废人</param>
        /// <returns></returns>
        [Route("Sc_MESStopStepWorkBill/DeleteSc_MESStopStepWorkBill")]
        [HttpGet]
        public object DeleteSc_MESStopStepWorkBill(int HInterID, int IsAudit, string CurUserName)
        {
            string ModRightNameCheck = "MES_MESStopWorkBill_Delete";
            DBUtility.ClsPub.CurUserName = CurUserName;
            try
            {
                //检查权限
                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "作废失败!无权限!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //HInterID数据判断
                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);                                         //对HInterID进行类型的转换
                DLL.ClsSc_MESStopWorkBill oBill = new DLL.ClsSc_MESStopWorkBill();             //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HChecker.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已审核!不能进行作废!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (IsAudit == 0)  //作废判断
                    {
                        if (oBill.omodel.HDeleteMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能再作废!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (IsAudit == 1) //反作废判断
                    {
                        if (oBill.omodel.HDeleteMan.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.Cancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 == 1) //反关闭提交
                {
                    //反关闭提交
                    if (oBill.AbandonCancelltion(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反作废成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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
        #endregion
        #region æŠ¥å·¥å¹³å°åœå·¥å•(走工序)保存/编辑
WebAPI/Controllers/Éú²ú¹ÜÀí/±¨¹¤Ì¨¹¤Ðò/Sc_MaterToSourceStepBillController.cs
@@ -8,6 +8,8 @@
using System.Data.SqlClient;
using System.Web.Http;
using WebAPI.Models;
using Newtonsoft.Json;
using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
@@ -83,6 +85,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ä¸Šæ–™é˜²é”™å• åˆ†é¡µåˆ—表
        [Route("Sc_MaterToSourceStepBill/getSc_MaterToSourceStepBillListPage")]
        [HttpGet]
        public json Sc_MaterToSourceStepBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MaterToSourceStepBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MaterToSourceBillList " + page + "," + size + ",''", "h_p_Sc_MaterToSourceBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_MaterToSourceBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_MaterToSourceBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -197,7 +254,33 @@
                    return objJsonResult;
                }
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
                //删除前控制=========================================
                DataSet Ds;
                string sql1 = "exec h_p_Sc_MaterToSourceBill_BeforeDelCtrl " + HInterID + ",'" + oBill.omodel.HBillNo + "','" + UserName + "'";
                Ds = oCN.RunProcReturn(sql1, "h_p_Sc_MaterToSourceBill_BeforeDelCtrl");
                if (Ds == null || Ds.Tables.Count == 0 || Ds.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                if (Ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "删除失败!原因:" + Ds.Tables[0].Rows[0]["HRemark"].ToString();
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //==================================================================================
                bool IsDete = oBill.DeleteBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MaterToSourceBill_AfterDelCtrl", UserName, ref DBUtility.ClsPub.sExeReturnInfo);
                if (IsDete)
                {
                    objJsonResult.code = "0";
@@ -729,9 +812,33 @@
                }
                if (IsAudit == 0) //审核提交
                {
                    //审核提交
                    if (oBill.CheckBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Sc_MaterToSourceBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MaterToSourceBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MaterToSourceBill_AfterCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功";
@@ -749,8 +856,30 @@
                }
                if (IsAudit == 1) //反审核提交
                {
                        //反审核前控制=========================================
                        string sql1 = "exec h_p_Sc_MaterToSourceBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + CurUserName + "'";
                        ds = oCN.RunProcReturn(sql1, "h_p_Sc_MaterToSourceBill_BeforeUnCheckCtrl");
                        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 1;
                            objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_MaterToSourceBill_AfterUnCheckCtrl", CurUserName, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
@@ -779,5 +908,327 @@
            }
        }
        #endregion
        #region ä¸Šæ–™é˜²é”™å• å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="Type">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_MaterToSourceStepBill/CloseSc_MaterToSourceBill")]
        [HttpGet]
        public object CloseSc_MaterToSourceBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有删除权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MaterToSourceStepBill_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;
                }
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsSc_MESMaterToSourceBill oBill = new DAL.ClsSc_MESMaterToSourceBill();          //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据未审核!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (Type == 0)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                    }
                    if (Type == 1) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.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 (Type == 0) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MaterToSourceBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MaterToSourceBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MaterToSourceBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 1) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_MaterToSourceBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_MaterToSourceBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_MaterToSourceBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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
        #region ä¸Šæ–™é˜²é”™å• ä½œåºŸ/反作废功能
        [Route("Sc_MaterToSourceStepBill/DropSc_MaterToSourceBill")]
        [HttpGet]
        public object DropSc_MaterToSourceBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有作废权限
                if (!DBUtility.ClsPub.Security_Log("Sc_MaterToSourceStepBill_Delete", 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 = "Sc_MaterToSourceBillMain";
                oCN.BeginTran();//开始事务
                //Type 0 ä½œåºŸ  1  åä½œåºŸ
                if (Type == 0)
                {
                    //判断单据是否已经作废
                    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
    }
}
WebAPI/Controllers/Éú²ú¹ÜÀí/°à´Î¿ª°àµ¥/Sc_ShiftsBeginInfoBillController.cs
@@ -2,6 +2,7 @@
using Model;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using SyntacticSugar.constant;
using System;
using System.Collections.Generic;
using System.Data;
@@ -76,6 +77,61 @@
                objJsonResult.Message = "Exception!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç­æ¬¡å¼€ç­å• åˆ†é¡µåˆ—表
        [Route("Sc_ShiftsBeginInfoBill/getSc_ShiftsBeginInfoBillListPage")]
        [HttpGet]
        public json Sc_ShiftsBeginInfoBillListPage(string sWhere, string user, int page, int size)
        {
            DataSet ds;
            json res = new json();
            try
            {
                List<object> columnNameList = new List<object>();
                //判断权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ShiftsBeginInfoBill_Query", 1, false, user))
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "无权限查询!";
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                sWhere = sWhere.Replace("'", "''");
                if (sWhere == null || sWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_ShiftsBeginInfoBillList " + page + "," + size + ",''", "h_p_Sc_ShiftsBeginInfoBillList");
                }
                else
                {
                    ds = oCN.RunProcReturn("exec h_p_Sc_ShiftsBeginInfoBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_Sc_ShiftsBeginInfoBillList");
                }
                //添加列名
                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列对象的列名
                }
                res.code = CodeConstant.SUCCEED;
                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
                res.Message = "Sucess!";
                res.list = columnNameList;
                res.data = ds.Tables[0];
                return res;
            }
            catch (Exception e)
            {
                res.code = CodeConstant.FAIL;
                res.count = CountConstant.FAIL;
                res.Message = "Exception!" + e.ToString();
                res.data = null;
                return res;
            }
        }
        #endregion
@@ -293,6 +349,7 @@
        {
            try
            {
                string s = "";
                //查看权限
                if (!DBUtility.ClsPub.Security_Log("Sc_ShiftsBeginInfoBill_Delete", 1, false, user))
                {
@@ -311,13 +368,80 @@
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                DAL.ClsSc_ShiftsBeginInfoBill BillOld = new DAL.ClsSc_ShiftsBeginInfoBill();
                if (BillOld.ShowBill(long.Parse(HInterID), ref s) == false)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据有误!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否可删除
                if (BillOld.omodel.HChecker != "" && BillOld.omodel.HChecker != null)
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "此单据已经被审核,不允许删除!";
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                //判断是否是创建状态进行删除
                if (int.Parse(BillOld.omodel.HBillStatus.ToString()) <= 1)
                {
                    oCN.BeginTran();
                oCN.BeginTran();
                    //删除前控制=========================================
                    string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                oCN.RunProc("delete from Sc_ShiftsBeginInfoBillMain where HInterID = " + HInterID);
                oCN.RunProc("delete from Sc_ShiftsBeginInfoBillSub where HInterID = " + HInterID);
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                oCN.Commit();
                    oCN.RunProc("delete from Sc_ShiftsBeginInfoBillMain where HInterID = " + HInterID);
                    oCN.RunProc("delete from Sc_ShiftsBeginInfoBillSub where HInterID = " + HInterID);
                    //删除后控制==================================================================================
                    string sql2 = "exec h_p_Sc_ShiftsBeginInfoBill_AfterDelCtrl " + BillOld.omodel.HInterID + ",'" + BillOld.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql2, "h_p_Sc_ShiftsBeginInfoBill_AfterDelCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:删除后判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "删除失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString();
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==============================================================================================
                    oCN.Commit();
                }
                objJsonResult.code = "1";
                objJsonResult.count = 1;
@@ -334,13 +458,15 @@
                return objJsonResult;
            }
        }
        #endregion
        #endregion
        #region ç­æ¬¡å¼€ç­å• å®¡æ ¸/反审核
        #region ç­æ¬¡å¼€ç­å• å®¡æ ¸/反审核
        [Route("Sc_ShiftsBeginInfoBill/AuditSc_ShiftsBeginInfoBill")]
        [HttpGet]
        public object AuditSc_ShiftsBeginInfoBill(string HInterID, int Type, string user)
        public object AuditXs_SeQuotationBillMain(string HInterID, int Type, string user)
        {
            DBUtility.ClsPub.CurUserName = user;
            try
            {
                //判断是否有审核权限
@@ -362,44 +488,33 @@
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Sc_ShiftsBeginInfoBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å®¡æ ¸  2  åå®¡æ ¸
                if (Type == 1)
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsSc_ShiftsBeginInfoBill oBill = new DAL.ClsSc_ShiftsBeginInfoBill();                   //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经审核
                    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)
                    if (oBill.omodel.HCloseMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已关闭!不能再次审核!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        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 (Type == 1)  //审核判断
                    {
                        if (oBill.omodel.HChecker.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -407,42 +522,10 @@
                            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 (Type == 2) //反审核判断
                    {
                        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() == "")
                        if (oBill.omodel.HChecker.Trim() == "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
@@ -450,43 +533,140 @@
                            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;
                        }
                    }
                }
                else
                {
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的审核/反审核操作
                if (Type == 1) //审核提交
                {
                    oCN.BeginTran();
                    //审核前控制=========================================
                    string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        oCN.RollBack();
                        return objJsonResult;
                    }
                    //==================================================================================
                    //审核提交
                    if (oBill.CheckBill(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        oCN.Commit();
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "审核成功!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                if (Type == 2) //反审核提交
                {
                    //反审核前控制=========================================
                    string sql1 = "exec h_p_Xs_SeQuotationBill_BeforeUnCheckCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeUnCheckCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:反审核前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //===========================================================
                    //反审核提交AbandonCheck
                    if (oBill.AbandonCheck(oBill.omodel.HInterID, oBill.omodel.HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterUnCheckCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反审核成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "反审核失败!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                }
                return objJsonResult;
            }
            catch (Exception e)
            {
                oCN.RollBack();
                objJsonResult.code = "0";
                objJsonResult.count = 0;
                objJsonResult.Message = "执行失败!" + e.ToString();
                objJsonResult.Message = "审核失败或者反审核失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
        }
        #endregion
        #region ç­æ¬¡å¼€ç­å• å…³é—­/反关闭功能
        #region ç­æ¬¡å¼€ç­å• å…³é—­/反关闭
        /// <summary>
        /// </summary>
        /// <param name="HInterID">单据ID</param>
        /// <param name="Type">关闭(0),反关闭(1)</param>
        /// <param name="CurUserName">关闭人</param>
        /// <returns></returns>
        [Route("Sc_ShiftsBeginInfoBill/CloseSc_ShiftsBeginInfoBill")]
        [HttpGet]
        public object CloseSc_ShiftsBeginInfoBill(string HInterID, int Type, string user)
        {
            try
            {
                //判断是否有删除权限
@@ -508,58 +688,49 @@
                    return objJsonResult;
                }
                ClsPub.CurUserName = user;
                BillOld.MvarItemKey = "Sc_ShiftsBeginInfoBillMain";
                oCN.BeginTran();//开始事务
                //Type 1 å…³é—­  2  åå…³é—­
                if (Type == 1)
                Int64 lngBillKey = 0;
                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //对HInterID进行类型的转换
                DAL.ClsSc_ShiftsBeginInfoBill oBill = new DAL.ClsSc_ShiftsBeginInfoBill();           //实例化单据操作类,用于进行相关操作
                //针对需要进行的操作,检验当前单据的状态是否支持需要进行的操作
                if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))                    //根据HInterID获取该单据的数据
                {
                    //判断单据是否已经关闭
                    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)
                    if (oBill.omodel.HDeleteMan.Trim() != "")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        objJsonResult.Message = "单据不存在!";
                        objJsonResult.Message = "单据已作废!不能进行关闭!";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
                    if (oBill.omodel.HChecker.Trim() == "")
                    {
                        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 (Type == 1)  //关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() != "")
                        {
                            objJsonResult.code = "0";
                            objJsonResult.count = 0;
                            objJsonResult.Message = "单据已作废!不能进行关闭!";
                            objJsonResult.Message = "单据已关闭!不能再次关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
                    }
                    if (Type == 2) //反关闭判断
                    {
                        if (oBill.omodel.HCloseMan.Trim() == "")
                        {
                            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.Message = "单据未关闭!不需要反关闭!";
                            objJsonResult.data = null;
                            return objJsonResult;
                        }
@@ -567,62 +738,107 @@
                }
                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;
                        }
                    }
                    objJsonResult.code = "0";
                    objJsonResult.count = 0;
                    objJsonResult.Message = "单据不存在!原因:" + DBUtility.ClsPub.sExeReturnInfo;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
                objJsonResult.Message = "执行成功!";
                objJsonResult.data = null;
                return objJsonResult; ;
                //进行需要进行的关闭/反关闭操作
                if (Type == 1) //关闭提交
                {
                    //关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //关闭提交
                    if (oBill.CloseBill(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        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 (Type == 2) //反关闭提交
                {
                    //反关闭前控制=========================================
                    string sql1 = "exec h_p_Sc_ShiftsBeginInfoBill_BeforeUnCloseCtrl " + oBill.omodel.HInterID + ",'" + oBill.omodel.HBillNo + "','" + user + "'";
                    ds = oCN.RunProcReturn(sql1, "h_p_Sc_ShiftsBeginInfoBill_BeforeUnCloseCtrl");
                    if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:反关闭前判断失败,请与网络管理人员联系";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    if (ds.Tables[0].Rows[0]["HBack"].ToString() != "0")
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭失败!原因:" + ds.Tables[0].Rows[0]["HRemark"].ToString(); ;
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    //==================================================================================
                    //反关闭提交
                    if (oBill.CancelClose(lngBillKey, oBill.omodel.HBillNo, "h_p_Sc_ShiftsBeginInfoBill_AfterUnCloseCtrl", user, ref DBUtility.ClsPub.sExeReturnInfo) == true)
                    {
                        objJsonResult.code = "1";
                        objJsonResult.count = 1;
                        objJsonResult.Message = "反关闭成功";
                        objJsonResult.data = null;
                        return objJsonResult;
                    }
                    else
                    {
                        objJsonResult.code = "0";
                        objJsonResult.count = 0;
                        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.Message = "关闭失败或者反关闭失败!" + e.ToString();
                objJsonResult.data = null;
                return objJsonResult;
            }
WebAPI/DLL/ClsOA_ErrMsgBackBill.cs
@@ -40,6 +40,23 @@
            {
                //
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',2", "h_p_OA_ErrMsgBackBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //更新主表
                oCn.RunProc("UpDate OA_ErrMsgBackBillMain set  " +
                " HBillNo='" + omodel.HBillNo + "'" +  //固定赋值===============
@@ -121,6 +138,23 @@
                //    }
                //}
                sReturn = "修改单据成功!";
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_OA_ErrMsgBackBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',2 ", "h_p_OA_ErrMsgBackBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                oCn.Commit();
                return true;
            }
@@ -136,10 +170,26 @@
        {
            try
            {
                //得到mainid
                //omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                DataSet ds;
                //若MAINDI重复则重新获取
                oCn.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCn.RunProcReturn("Exec h_p_OA_ErrMsgBackBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_OA_ErrMsgBackBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //主表
                oCn.RunProc("Insert Into OA_ErrMsgBackBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
@@ -196,6 +246,24 @@
                //}
                //
                sReturn = omodel.HInterID.ToString();
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("h_p_OA_ErrMsgBackBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_OA_ErrMsgBackBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                oCn.Commit();
                return true;
            }
WebAPI/Properties/PublishProfiles/JFAPI.pubxml.user
@@ -5,7 +5,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <_PublishTargetUrl>D:\网站发布\智云MESWMS\API</_PublishTargetUrl>
    <History>True|2025-03-19T05:45:31.7138375Z;True|2025-03-19T11:09:17.0875638+08:00;False|2025-03-19T11:05:00.7852430+08:00;True|2025-03-18T17:07:26.8842323+08:00;False|2025-03-18T17:02:33.5857720+08:00;False|2025-03-17T11:09:34.0681444+08:00;True|2025-03-17T10:50:21.9158331+08:00;True|2025-03-17T09:42:47.9252167+08:00;False|2025-03-17T09:31:53.1872136+08:00;True|2025-03-14T17:46:56.2806627+08:00;True|2025-03-14T16:26:15.6828252+08:00;True|2025-03-14T16:14:53.0710942+08:00;True|2025-03-14T16:08:09.5365263+08:00;True|2025-03-14T15:59:01.3358337+08:00;True|2025-03-14T14:22:42.7725023+08:00;True|2025-03-14T09:54:22.0848434+08:00;False|2025-03-14T09:51:59.6649411+08:00;True|2025-03-14T09:36:17.1134782+08:00;False|2025-03-14T09:31:58.5198805+08:00;True|2025-03-13T13:08:01.9024847+08:00;False|2025-03-13T13:03:35.7160929+08:00;True|2025-03-12T15:37:13.4111189+08:00;True|2025-03-12T15:23:55.5422176+08:00;True|2025-03-12T15:16:21.2123980+08:00;True|2025-03-12T14:49:24.9895017+08:00;True|2025-03-12T14:41:41.5663090+08:00;False|2025-03-12T14:39:27.3156286+08:00;True|2025-03-12T14:10:23.4204108+08:00;False|2025-03-12T14:08:08.4985635+08:00;True|2025-03-12T13:34:39.8492928+08:00;False|2025-03-12T13:31:34.8359622+08:00;True|2025-03-12T11:39:34.2976894+08:00;False|2025-03-12T09:22:45.9334513+08:00;True|2025-03-10T15:59:42.1283263+08:00;False|2025-03-10T15:53:57.2115226+08:00;True|2025-03-07T16:23:25.1589274+08:00;True|2025-03-07T16:18:46.0202723+08:00;True|2025-03-07T15:59:34.8313474+08:00;True|2025-03-07T15:37:59.1693363+08:00;True|2025-03-07T14:05:40.7253978+08:00;True|2025-03-07T11:21:14.9610137+08:00;False|2025-03-07T11:15:41.4171028+08:00;True|2025-03-07T10:23:24.0437379+08:00;True|2025-03-07T10:07:03.4231550+08:00;False|2025-03-07T10:04:32.6854924+08:00;True|2025-03-06T16:32:23.7096239+08:00;True|2025-03-06T15:45:46.0345284+08:00;True|2025-03-06T15:40:00.7026164+08:00;True|2025-03-06T15:20:20.3523488+08:00;True|2025-03-06T14:19:37.2403331+08:00;True|2025-03-06T13:49:03.6420821+08:00;False|2025-03-06T13:46:35.7037619+08:00;True|2025-03-06T11:03:29.5882789+08:00;True|2025-03-06T09:59:53.3080173+08:00;True|2025-03-06T09:43:48.4337079+08:00;False|2025-03-06T09:35:05.3462434+08:00;True|2025-03-05T18:25:35.2595591+08:00;True|2025-03-05T18:03:37.5687895+08:00;True|2025-03-05T17:48:08.3418269+08:00;False|2025-03-05T17:44:40.0721881+08:00;True|2025-03-05T17:23:30.5871011+08:00;True|2025-03-05T16:31:12.2285816+08:00;True|2025-03-05T16:00:25.5496303+08:00;True|2025-03-05T15:11:30.9434230+08:00;True|2025-03-05T14:22:08.4650724+08:00;True|2025-03-05T13:29:42.9306833+08:00;True|2025-03-05T11:28:17.5541196+08:00;True|2025-03-05T11:10:22.3318023+08:00;True|2025-03-05T10:55:33.6796527+08:00;True|2025-03-05T10:08:26.7761472+08:00;True|2025-03-05T10:02:32.8701262+08:00;False|2025-03-05T09:59:55.0044057+08:00;True|2025-03-04T17:48:24.6869079+08:00;True|2025-03-04T17:42:05.0276293+08:00;False|2025-03-04T17:39:53.6208557+08:00;False|2025-03-04T17:39:30.0759309+08:00;False|2025-03-04T17:05:37.2163588+08:00;True|2025-03-04T16:51:15.6884461+08:00;True|2025-03-04T16:49:03.3836181+08:00;True|2025-03-04T16:31:36.5847402+08:00;True|2025-03-04T15:52:09.1977151+08:00;True|2025-03-04T15:24:25.0194954+08:00;True|2025-03-04T15:12:44.1606138+08:00;False|2025-03-04T15:10:47.3915404+08:00;True|2025-03-04T14:31:42.7483906+08:00;True|2025-03-04T11:28:36.6001869+08:00;False|2025-02-27T19:55:43.0462466+08:00;True|2025-02-24T16:03:00.5507258+08:00;False|2025-02-24T16:00:00.9104160+08:00;True|2025-02-19T16:55:31.8966125+08:00;True|2025-02-19T14:51:19.5866770+08:00;False|2025-02-19T14:49:16.2857645+08:00;True|2025-02-19T14:11:03.8109482+08:00;False|2025-02-19T14:08:17.7243950+08:00;True|2025-02-19T11:16:48.1875981+08:00;False|2025-02-19T11:14:24.0571589+08:00;True|2025-02-19T10:17:34.3257301+08:00;False|2025-02-19T10:14:49.0730325+08:00;True|2025-02-18T09:38:54.9616937+08:00;True|2025-02-18T09:16:03.1196071+08:00;False|2025-02-18T09:13:52.5022130+08:00;True|2025-02-17T17:28:38.1103164+08:00;True|2025-02-17T17:06:19.1494960+08:00;True|2025-02-17T16:58:21.8893871+08:00;False|2025-02-17T16:56:34.0012780+08:00;True|2025-02-17T15:56:45.9560949+08:00;False|2025-02-17T15:29:32.9323141+08:00;False|2025-02-17T15:27:54.6615301+08:00;False|2025-02-17T15:25:42.7179137+08:00;True|2025-02-12T10:48:39.4029671+08:00;True|2025-02-12T10:45:09.8138793+08:00;False|2025-02-12T10:43:37.5751112+08:00;False|2025-02-12T10:43:24.8201898+08:00;False|2025-02-12T10:42:58.2736984+08:00;False|2025-02-12T10:42:46.1482594+08:00;False|2025-02-12T10:42:01.5427330+08:00;False|2025-02-12T10:41:48.3761346+08:00;False|2025-02-12T10:41:29.3367142+08:00;True|2025-02-11T15:41:34.0746843+08:00;True|2025-02-11T15:39:37.3374891+08:00;False|2025-02-11T15:39:27.0449176+08:00;False|2025-02-11T15:08:35.2970100+08:00;True|2025-02-11T14:59:59.6539416+08:00;True|2025-02-11T14:56:20.5954601+08:00;False|2025-02-11T14:55:35.6700921+08:00;True|2025-02-10T09:39:38.7399451+08:00;False|2025-02-10T09:39:10.1358642+08:00;True|2025-02-08T16:00:23.1136903+08:00;False|2025-02-08T15:59:50.0414065+08:00;True|2025-01-17T10:17:41.6850215+08:00;False|2025-01-17T10:16:20.3202054+08:00;True|2025-01-17T09:00:26.6966310+08:00;False|2025-01-17T08:59:59.9527727+08:00;True|2025-01-16T11:06:57.1014257+08:00;True|2025-01-16T10:27:57.2742426+08:00;False|2025-01-16T10:27:27.5197746+08:00;True|2025-01-15T11:05:17.5523582+08:00;True|2025-01-15T09:37:34.6118980+08:00;False|2025-01-15T09:36:27.7987949+08:00;True|2025-01-14T12:52:06.2234405+08:00;True|2025-01-14T12:50:08.8487446+08:00;False|2025-01-14T12:49:45.2743330+08:00;True|2025-01-14T10:31:18.6477403+08:00;False|2025-01-14T10:29:30.1534049+08:00;True|2025-01-13T15:27:00.4497527+08:00;True|2025-01-13T15:01:33.6142160+08:00;True|2025-01-13T10:29:49.4772980+08:00;True|2025-01-13T10:11:15.7993265+08:00;True|2025-01-13T10:08:58.9378828+08:00;False|2025-01-13T10:08:44.9869073+08:00;True|2025-01-13T10:02:17.5175561+08:00;False|2025-01-13T10:02:00.9991870+08:00;True|2025-01-08T17:50:21.7468469+08:00;True|2025-01-08T16:38:48.8592252+08:00;True|2025-01-08T10:44:42.9161086+08:00;False|2025-01-08T10:44:09.4840640+08:00;True|2025-01-08T10:34:31.5982265+08:00;False|2025-01-08T10:33:57.3576390+08:00;True|2025-01-03T17:19:09.1765100+08:00;True|2025-01-03T17:10:41.8794009+08:00;True|2025-01-03T17:10:11.4245485+08:00;True|2025-01-03T15:54:22.3387906+08:00;True|2025-01-03T15:41:44.9897120+08:00;False|2025-01-03T15:40:42.1357112+08:00;False|2025-01-03T15:39:09.0564197+08:00;True|2025-01-03T14:58:31.5701467+08:00;True|2025-01-03T14:29:13.4456304+08:00;False|2025-01-03T14:27:18.9925263+08:00;True|2025-01-02T16:08:24.1819376+08:00;True|2025-01-02T16:07:01.1636705+08:00;True|2025-01-02T16:03:02.6520904+08:00;True|2025-01-02T10:03:56.0551738+08:00;False|2025-01-02T10:03:34.8632732+08:00;True|2024-12-31T15:27:01.3180960+08:00;True|2024-12-31T11:17:12.2977529+08:00;True|2024-12-31T10:48:14.7205535+08:00;True|2024-12-31T10:18:45.6669875+08:00;False|2024-12-31T10:18:21.6706557+08:00;True|2024-12-30T09:32:44.3898729+08:00;True|2024-12-30T09:31:24.5771941+08:00;False|2024-12-30T09:30:52.4031391+08:00;True|2024-12-27T16:12:20.2836752+08:00;False|2024-12-27T16:11:04.6614343+08:00;True|2024-12-27T15:07:23.0750147+08:00;True|2024-12-27T15:04:52.7876532+08:00;True|2024-12-27T14:37:54.3154829+08:00;False|2024-12-27T14:37:26.9546174+08:00;True|2024-12-26T16:33:56.0452167+08:00;True|2024-12-26T16:29:21.4115458+08:00;True|2024-12-26T16:29:02.0242815+08:00;True|2024-12-26T15:17:24.7390981+08:00;False|2024-12-26T15:13:26.8863189+08:00;True|2024-12-26T15:06:35.4541902+08:00;True|2024-12-26T11:35:42.2760106+08:00;False|2024-12-26T11:35:08.9255789+08:00;True|2024-12-26T10:10:29.7487991+08:00;True|2024-12-26T09:27:40.2637311+08:00;False|2024-12-26T09:25:52.1339136+08:00;True|2024-12-24T15:11:48.9968778+08:00;True|2024-12-24T15:06:55.0283993+08:00;True|2024-12-24T14:36:29.6466740+08:00;True|2024-12-24T10:28:42.7489880+08:00;False|2024-12-24T10:28:08.6809715+08:00;True|2024-12-24T10:06:05.9449103+08:00;False|2024-12-24T10:05:32.8409161+08:00;True|2024-12-23T14:56:40.3416256+08:00;True|2024-12-23T14:50:50.2677378+08:00;True|2024-12-23T14:48:27.8169391+08:00;True|2024-12-23T14:45:25.5341474+08:00;True|2024-12-23T14:42:23.7825087+08:00;True|2024-12-23T14:35:53.8876449+08:00;True|2024-12-23T14:14:00.4257926+08:00;True|2024-12-23T11:10:54.5874876+08:00;True|2024-12-23T11:08:44.0250304+08:00;False|2024-12-23T11:08:18.5757850+08:00;True|2024-12-20T12:51:29.2354841+08:00;True|2024-12-20T12:46:13.7636932+08:00;False|2024-12-20T12:44:21.1473486+08:00;False|2024-12-20T12:44:06.5427106+08:00;True|2024-12-20T12:29:33.9971940+08:00;False|2024-12-20T12:29:01.0285205+08:00;True|2024-12-19T15:49:19.9906264+08:00;True|2024-12-19T14:55:54.3323405+08:00;True|2024-12-19T14:17:50.5086161+08:00;True|2024-12-19T14:08:16.0919011+08:00;True|2024-12-19T14:02:50.3092759+08:00;True|2024-12-19T13:54:41.2332165+08:00;False|2024-12-19T13:54:07.6973483+08:00;True|2024-12-19T09:34:54.5332110+08:00;True|2024-12-19T08:49:05.5690428+08:00;False|2024-12-19T08:48:51.0618113+08:00;True|2024-12-18T15:45:34.7174246+08:00;False|2024-12-18T15:45:10.3226822+08:00;True|2024-12-18T15:32:03.5983267+08:00;True|2024-12-18T15:31:20.1219502+08:00;True|2024-12-18T11:57:09.1595607+08:00;True|2024-12-18T11:13:37.4765697+08:00;True|2024-12-18T10:07:54.1294714+08:00;True|2024-12-18T10:04:16.0967342+08:00;False|2024-12-18T10:04:04.1561560+08:00;True|2024-12-16T17:07:07.3386872+08:00;True|2024-12-16T16:34:59.1101964+08:00;True|2024-12-16T16:19:07.9287470+08:00;False|2024-12-16T16:18:46.4617432+08:00;True|2024-12-13T18:06:11.0778539+08:00;True|2024-12-13T16:53:52.2283177+08:00;True|2024-12-13T16:23:15.9531944+08:00;True|2024-12-13T13:58:03.7464045+08:00;True|2024-12-13T10:40:33.9285602+08:00;True|2024-12-13T10:38:03.8494063+08:00;False|2024-12-13T10:37:52.4251132+08:00;True|2024-12-13T10:31:07.4994631+08:00;False|2024-12-13T10:30:40.8021885+08:00;True|2024-12-12T10:01:42.4944750+08:00;False|2024-12-12T10:01:15.7147977+08:00;True|2024-12-11T17:21:58.0453583+08:00;True|2024-12-11T10:59:15.3836831+08:00;True|2024-12-11T09:49:19.4060272+08:00;False|2024-12-11T09:48:51.7603525+08:00;True|2024-12-11T08:58:41.4567855+08:00;False|2024-12-11T08:58:09.2160433+08:00;True|2024-12-10T17:25:49.3068154+08:00;True|2024-12-10T17:21:30.0155027+08:00;True|2024-12-10T17:16:56.7587487+08:00;False|2024-12-10T17:16:34.7816611+08:00;True|2024-12-10T16:55:40.3777585+08:00;False|2024-12-10T16:55:13.2621448+08:00;False|2024-12-09T13:59:27.6362265+08:00;True|2024-12-06T16:55:30.6422980+08:00;True|2024-12-06T15:08:49.5834939+08:00;True|2024-12-06T14:31:56.0968616+08:00;False|2024-12-06T14:31:44.2264009+08:00;True|2024-12-06T13:59:52.8150929+08:00;False|2024-12-06T13:48:22.6073939+08:00;True|2024-12-05T17:33:27.9247467+08:00;True|2024-12-05T17:30:23.1740838+08:00;False|2024-12-05T17:30:03.9977311+08:00;True|2024-12-04T15:18:41.4963816+08:00;True|2024-12-04T15:16:45.1121101+08:00;True|2024-12-04T15:14:33.5954776+08:00;True|2024-12-04T15:12:27.2913137+08:00;True|2024-12-04T14:10:19.6190673+08:00;False|2024-12-04T14:10:02.0319713+08:00;True|2024-12-03T16:08:46.6721098+08:00;True|2024-12-03T15:16:04.1754554+08:00;True|2024-12-03T15:13:25.4927626+08:00;True|2024-12-03T14:55:09.4413291+08:00;True|2024-12-03T14:43:11.8243897+08:00;True|2024-12-03T14:29:16.1511932+08:00;True|2024-12-03T14:24:07.9561838+08:00;False|2024-12-03T14:23:55.1293602+08:00;True|2024-12-02T16:31:22.0404862+08:00;False|2024-12-02T16:28:53.1721961+08:00;True|2024-12-02T15:41:24.9462025+08:00;True|2024-12-02T14:12:12.9356193+08:00;False|2024-12-02T14:11:35.7159488+08:00;True|2024-12-02T10:59:31.5582757+08:00;True|2024-11-29T12:08:55.4868083+08:00;False|2024-11-29T12:08:37.0353185+08:00;True|2024-11-28T10:47:27.2071355+08:00;False|2024-11-28T10:47:13.6670955+08:00;True|2024-11-27T15:21:57.6747082+08:00;False|2024-11-27T15:20:07.2403056+08:00;True|2024-11-27T15:13:36.1461091+08:00;True|2024-11-27T14:34:35.5908753+08:00;False|2024-11-27T14:33:30.7118923+08:00;True|2024-11-26T15:16:44.1854927+08:00;True|2024-11-26T15:14:33.4021067+08:00;False|2024-11-26T15:14:07.9955135+08:00;True|2024-11-26T14:48:35.6408418+08:00;True|2024-11-26T14:45:00.7251556+08:00;True|2024-11-26T14:04:58.4232988+08:00;False|2024-11-26T14:04:28.1286675+08:00;True|2024-11-25T13:45:07.6935933+08:00;True|2024-11-25T13:43:59.0788650+08:00;False|2024-11-25T13:43:44.2225194+08:00;True|2024-11-25T08:54:05.5144014+08:00;False|2024-11-25T08:53:49.2284063+08:00;False|2024-11-22T09:53:13.7879664+08:00;True|2024-11-21T13:48:31.7056264+08:00;True|2024-11-21T13:46:55.0891551+08:00;True|2024-11-21T13:44:05.5221110+08:00;True|2024-11-21T13:43:39.1385899+08:00;False|2024-11-21T13:43:19.9351488+08:00;True|2024-11-20T11:33:52.0324053+08:00;True|2024-11-20T11:20:58.4917889+08:00;True|2024-11-20T11:03:46.9552623+08:00;True|2024-11-20T10:45:10.9517109+08:00;False|2024-11-20T10:44:58.3221116+08:00;False|2024-11-19T15:39:27.3889104+08:00;True|2024-11-19T14:42:32.0854561+08:00;True|2024-11-19T14:19:19.6198070+08:00;True|2024-11-19T14:13:08.2003750+08:00;False|2024-11-19T14:12:15.5442850+08:00;True|2024-11-18T13:05:41.0455534+08:00;True|2024-11-18T11:05:30.2819404+08:00;True|2024-11-18T10:51:07.1852818+08:00;False|2024-11-18T10:50:21.5098527+08:00;True|2024-11-18T10:15:38.5429366+08:00;True|2024-11-18T10:00:51.0847524+08:00;True|2024-11-18T09:34:52.1772715+08:00;True|2024-11-18T09:27:23.6013754+08:00;False|2024-11-18T09:26:00.9323551+08:00;True|2024-11-15T11:20:51.7576376+08:00;True|2024-11-15T11:11:17.5580168+08:00;True|2024-11-15T11:03:58.4142996+08:00;True|2024-11-15T10:44:50.5207827+08:00;True|2024-11-15T10:10:05.5550418+08:00;True|2024-11-15T09:49:30.6631382+08:00;False|2024-11-15T09:47:05.3973379+08:00;True|2024-11-14T18:31:54.8247681+08:00;True|2024-11-14T17:14:56.3660185+08:00;True|2024-11-14T16:49:44.7526912+08:00;True|2024-11-14T16:49:09.3427608+08:00;True|2024-11-14T15:59:00.2572264+08:00;True|2024-11-14T11:21:03.5110818+08:00;True|2024-11-14T10:51:10.7864658+08:00;False|2024-11-14T10:50:55.5384248+08:00;True|2024-11-14T10:29:13.6760158+08:00;False|2024-11-14T10:28:09.8622863+08:00;True|2024-11-13T17:48:46.4827219+08:00;True|2024-11-13T17:45:13.0659280+08:00;True|2024-11-13T16:01:55.2278671+08:00;False|2024-11-13T16:01:03.0040446+08:00;True|2024-11-12T17:24:06.3763535+08:00;True|2024-11-12T17:21:51.8459552+08:00;True|2024-11-12T17:11:57.9239909+08:00;True|2024-11-12T17:09:04.4322824+08:00;True|2024-11-12T17:07:12.1839548+08:00;True|2024-11-12T17:04:27.4579152+08:00;True|2024-11-12T17:03:59.6843282+08:00;True|2024-11-12T16:40:44.0714862+08:00;True|2024-11-12T16:36:27.7792764+08:00;True|2024-11-12T16:32:36.5262040+08:00;False|2024-11-12T16:32:23.9550194+08:00;True|2024-11-12T10:58:16.1987697+08:00;False|2024-11-12T10:58:04.8469631+08:00;True|2024-11-11T13:40:53.2582255+08:00;True|2024-11-11T13:37:45.0401833+08:00;True|2024-11-11T12:35:13.2429166+08:00;True|2024-11-11T11:27:29.0530688+08:00;False|2024-11-11T11:27:12.2765506+08:00;True|2024-11-08T15:52:17.1278870+08:00;False|2024-11-08T15:52:04.4379380+08:00;True|2024-11-07T18:27:41.8163960+08:00;False|2024-11-07T18:27:30.6037983+08:00;True|2024-11-06T15:55:27.6450488+08:00;True|2024-11-06T15:54:13.5957004+08:00;True|2024-11-06T15:25:33.3862531+08:00;True|2024-11-06T13:33:57.8502278+08:00;False|2024-11-06T13:33:39.2337086+08:00;True|2024-11-06T11:33:12.6755239+08:00;True|2024-11-05T18:34:17.7048247+08:00;True|2024-11-05T18:30:08.5724471+08:00;True|2024-11-05T18:24:35.5372980+08:00;True|2024-11-05T18:06:29.7644779+08:00;True|2024-11-05T17:53:50.9554703+08:00;True|2024-11-05T17:50:05.6376900+08:00;True|2024-11-05T11:13:46.2906508+08:00;True|2024-11-05T10:35:55.5423834+08:00;False|2024-11-05T10:35:20.4104039+08:00;True|2024-11-01T10:22:05.7636122+08:00;False|2024-11-01T10:21:33.2954398+08:00;True|2024-10-31T20:03:37.9075888+08:00;True|2024-10-31T18:35:31.6618415+08:00;True|2024-10-31T18:34:56.2479021+08:00;True|2024-10-31T09:43:29.0841188+08:00;False|2024-10-31T09:43:04.8780818+08:00;True|2024-10-30T18:42:11.0523067+08:00;True|2024-10-30T18:07:05.5603627+08:00;True|2024-10-30T18:03:15.3516621+08:00;True|2024-10-30T17:58:14.3276504+08:00;False|2024-10-30T17:57:44.5353118+08:00;True|2024-10-30T17:47:41.2889491+08:00;True|2024-10-30T17:19:36.6172721+08:00;True|2024-10-30T17:10:00.4399703+08:00;False|2024-10-30T17:08:57.6500450+08:00;True|2024-10-29T16:58:15.6006676+08:00;True|2024-10-29T16:51:56.8406649+08:00;True|2024-10-29T16:05:48.4297695+08:00;True|2024-10-29T15:12:15.1522377+08:00;True|2024-10-29T15:10:51.8431754+08:00;True|2024-10-29T11:21:01.5660940+08:00;False|2024-10-29T11:20:33.3958980+08:00;True|2024-10-28T17:51:26.7156861+08:00;False|2024-10-28T17:50:41.4388196+08:00;True|2024-10-28T13:34:14.8764262+08:00;True|2024-10-28T12:44:27.2083620+08:00;False|2024-10-28T12:43:57.5942717+08:00;True|2024-10-25T11:49:47.9817458+08:00;True|2024-10-25T11:49:34.4754546+08:00;True|2024-10-25T09:59:35.6471379+08:00;True|2024-10-25T09:47:46.8035540+08:00;True|2024-10-25T09:25:57.7872618+08:00;False|2024-10-25T09:25:30.0950732+08:00;True|2024-10-24T20:39:06.1992535+08:00;False|2024-10-24T20:38:33.1009731+08:00;True|2024-10-24T11:17:46.9974483+08:00;False|2024-10-24T11:17:17.0925356+08:00;True|2024-10-23T19:16:25.5189930+08:00;True|2024-10-23T17:10:44.4267777+08:00;False|2024-10-23T17:10:10.2947971+08:00;True|2024-10-23T14:13:22.6901287+08:00;False|2024-10-23T14:12:24.3997100+08:00;True|2024-10-22T16:25:12.9514711+08:00;False|2024-10-22T16:24:42.9025167+08:00;True|2024-10-22T10:22:33.9932601+08:00;False|2024-10-22T10:22:05.3030308+08:00;True|2024-10-21T17:53:29.9552741+08:00;True|2024-10-21T16:37:31.4159544+08:00;True|2024-10-21T16:35:43.6207036+08:00;True|2024-10-21T16:00:05.5040651+08:00;False|2024-10-21T15:59:35.9279259+08:00;True|2024-10-21T12:06:42.5768961+08:00;False|2024-10-21T12:06:16.6344662+08:00;True|2024-10-18T10:44:02.6495536+08:00;True|2024-10-18T09:55:47.9769914+08:00;True|2024-10-18T09:47:46.6365831+08:00;True|2024-10-18T09:46:40.4036657+08:00;True|2024-10-18T09:44:25.4598960+08:00;True|2024-10-18T09:30:07.6972377+08:00;False|2024-10-18T09:28:18.9251743+08:00;True|2024-10-17T12:13:34.8639685+08:00;True|2024-10-17T12:02:26.5251711+08:00;False|2024-10-17T12:01:31.3822430+08:00;True|2024-10-17T11:49:09.2395208+08:00;False|2024-10-17T11:48:38.0189241+08:00;True|2024-10-16T19:35:29.2047484+08:00;False|2024-10-16T19:32:43.0637947+08:00;True|2024-10-16T11:27:13.1263407+08:00;False|2024-10-16T11:25:49.8688677+08:00;True|2024-10-15T18:26:50.9948482+08:00;False|2024-10-15T18:26:23.6998750+08:00;True|2024-08-26T14:17:37.8502046+08:00;False|2024-08-26T14:16:09.8501361+08:00;True|2024-08-22T11:12:48.4249984+08:00;</History>
    <History>True|2025-03-24T08:49:42.0663422Z;True|2025-03-24T13:12:18.9244375+08:00;False|2025-03-24T13:07:19.8409939+08:00;False|2025-03-24T12:48:52.4860847+08:00;False|2025-03-24T11:39:21.1805195+08:00;False|2025-03-24T11:37:43.6802081+08:00;False|2025-03-24T11:33:57.1454920+08:00;False|2025-03-24T11:30:14.3844034+08:00;False|2025-03-24T11:28:02.5067052+08:00;False|2025-03-21T12:21:29.9136433+08:00;True|2025-03-20T16:39:21.8390481+08:00;True|2025-03-20T14:41:37.0419379+08:00;False|2025-03-20T14:37:15.3728461+08:00;True|2025-03-20T12:27:20.0312759+08:00;True|2025-03-20T10:42:53.0161637+08:00;True|2025-03-20T09:30:05.5790815+08:00;False|2025-03-20T09:25:15.2327164+08:00;True|2025-03-19T17:06:57.7672924+08:00;True|2025-03-19T15:46:30.3411577+08:00;True|2025-03-19T13:45:31.7138375+08:00;True|2025-03-19T11:09:17.0875638+08:00;False|2025-03-19T11:05:00.7852430+08:00;True|2025-03-18T17:07:26.8842323+08:00;False|2025-03-18T17:02:33.5857720+08:00;False|2025-03-17T11:09:34.0681444+08:00;True|2025-03-17T10:50:21.9158331+08:00;True|2025-03-17T09:42:47.9252167+08:00;False|2025-03-17T09:31:53.1872136+08:00;True|2025-03-14T17:46:56.2806627+08:00;True|2025-03-14T16:26:15.6828252+08:00;True|2025-03-14T16:14:53.0710942+08:00;True|2025-03-14T16:08:09.5365263+08:00;True|2025-03-14T15:59:01.3358337+08:00;True|2025-03-14T14:22:42.7725023+08:00;True|2025-03-14T09:54:22.0848434+08:00;False|2025-03-14T09:51:59.6649411+08:00;True|2025-03-14T09:36:17.1134782+08:00;False|2025-03-14T09:31:58.5198805+08:00;True|2025-03-13T13:08:01.9024847+08:00;False|2025-03-13T13:03:35.7160929+08:00;True|2025-03-12T15:37:13.4111189+08:00;True|2025-03-12T15:23:55.5422176+08:00;True|2025-03-12T15:16:21.2123980+08:00;True|2025-03-12T14:49:24.9895017+08:00;True|2025-03-12T14:41:41.5663090+08:00;False|2025-03-12T14:39:27.3156286+08:00;True|2025-03-12T14:10:23.4204108+08:00;False|2025-03-12T14:08:08.4985635+08:00;True|2025-03-12T13:34:39.8492928+08:00;False|2025-03-12T13:31:34.8359622+08:00;True|2025-03-12T11:39:34.2976894+08:00;False|2025-03-12T09:22:45.9334513+08:00;True|2025-03-10T15:59:42.1283263+08:00;False|2025-03-10T15:53:57.2115226+08:00;True|2025-03-07T16:23:25.1589274+08:00;True|2025-03-07T16:18:46.0202723+08:00;True|2025-03-07T15:59:34.8313474+08:00;True|2025-03-07T15:37:59.1693363+08:00;True|2025-03-07T14:05:40.7253978+08:00;True|2025-03-07T11:21:14.9610137+08:00;False|2025-03-07T11:15:41.4171028+08:00;True|2025-03-07T10:23:24.0437379+08:00;True|2025-03-07T10:07:03.4231550+08:00;False|2025-03-07T10:04:32.6854924+08:00;True|2025-03-06T16:32:23.7096239+08:00;True|2025-03-06T15:45:46.0345284+08:00;True|2025-03-06T15:40:00.7026164+08:00;True|2025-03-06T15:20:20.3523488+08:00;True|2025-03-06T14:19:37.2403331+08:00;True|2025-03-06T13:49:03.6420821+08:00;False|2025-03-06T13:46:35.7037619+08:00;True|2025-03-06T11:03:29.5882789+08:00;True|2025-03-06T09:59:53.3080173+08:00;True|2025-03-06T09:43:48.4337079+08:00;False|2025-03-06T09:35:05.3462434+08:00;True|2025-03-05T18:25:35.2595591+08:00;True|2025-03-05T18:03:37.5687895+08:00;True|2025-03-05T17:48:08.3418269+08:00;False|2025-03-05T17:44:40.0721881+08:00;True|2025-03-05T17:23:30.5871011+08:00;True|2025-03-05T16:31:12.2285816+08:00;True|2025-03-05T16:00:25.5496303+08:00;True|2025-03-05T15:11:30.9434230+08:00;True|2025-03-05T14:22:08.4650724+08:00;True|2025-03-05T13:29:42.9306833+08:00;True|2025-03-05T11:28:17.5541196+08:00;True|2025-03-05T11:10:22.3318023+08:00;True|2025-03-05T10:55:33.6796527+08:00;True|2025-03-05T10:08:26.7761472+08:00;True|2025-03-05T10:02:32.8701262+08:00;False|2025-03-05T09:59:55.0044057+08:00;True|2025-03-04T17:48:24.6869079+08:00;True|2025-03-04T17:42:05.0276293+08:00;False|2025-03-04T17:39:53.6208557+08:00;False|2025-03-04T17:39:30.0759309+08:00;False|2025-03-04T17:05:37.2163588+08:00;True|2025-03-04T16:51:15.6884461+08:00;True|2025-03-04T16:49:03.3836181+08:00;True|2025-03-04T16:31:36.5847402+08:00;True|2025-03-04T15:52:09.1977151+08:00;True|2025-03-04T15:24:25.0194954+08:00;True|2025-03-04T15:12:44.1606138+08:00;False|2025-03-04T15:10:47.3915404+08:00;True|2025-03-04T14:31:42.7483906+08:00;True|2025-03-04T11:28:36.6001869+08:00;False|2025-02-27T19:55:43.0462466+08:00;True|2025-02-24T16:03:00.5507258+08:00;False|2025-02-24T16:00:00.9104160+08:00;True|2025-02-19T16:55:31.8966125+08:00;True|2025-02-19T14:51:19.5866770+08:00;False|2025-02-19T14:49:16.2857645+08:00;True|2025-02-19T14:11:03.8109482+08:00;False|2025-02-19T14:08:17.7243950+08:00;True|2025-02-19T11:16:48.1875981+08:00;False|2025-02-19T11:14:24.0571589+08:00;True|2025-02-19T10:17:34.3257301+08:00;False|2025-02-19T10:14:49.0730325+08:00;True|2025-02-18T09:38:54.9616937+08:00;True|2025-02-18T09:16:03.1196071+08:00;False|2025-02-18T09:13:52.5022130+08:00;True|2025-02-17T17:28:38.1103164+08:00;True|2025-02-17T17:06:19.1494960+08:00;True|2025-02-17T16:58:21.8893871+08:00;False|2025-02-17T16:56:34.0012780+08:00;True|2025-02-17T15:56:45.9560949+08:00;False|2025-02-17T15:29:32.9323141+08:00;False|2025-02-17T15:27:54.6615301+08:00;False|2025-02-17T15:25:42.7179137+08:00;True|2025-02-12T10:48:39.4029671+08:00;True|2025-02-12T10:45:09.8138793+08:00;False|2025-02-12T10:43:37.5751112+08:00;False|2025-02-12T10:43:24.8201898+08:00;False|2025-02-12T10:42:58.2736984+08:00;False|2025-02-12T10:42:46.1482594+08:00;False|2025-02-12T10:42:01.5427330+08:00;False|2025-02-12T10:41:48.3761346+08:00;False|2025-02-12T10:41:29.3367142+08:00;True|2025-02-11T15:41:34.0746843+08:00;True|2025-02-11T15:39:37.3374891+08:00;False|2025-02-11T15:39:27.0449176+08:00;False|2025-02-11T15:08:35.2970100+08:00;True|2025-02-11T14:59:59.6539416+08:00;True|2025-02-11T14:56:20.5954601+08:00;False|2025-02-11T14:55:35.6700921+08:00;True|2025-02-10T09:39:38.7399451+08:00;False|2025-02-10T09:39:10.1358642+08:00;True|2025-02-08T16:00:23.1136903+08:00;False|2025-02-08T15:59:50.0414065+08:00;True|2025-01-17T10:17:41.6850215+08:00;False|2025-01-17T10:16:20.3202054+08:00;True|2025-01-17T09:00:26.6966310+08:00;False|2025-01-17T08:59:59.9527727+08:00;True|2025-01-16T11:06:57.1014257+08:00;True|2025-01-16T10:27:57.2742426+08:00;False|2025-01-16T10:27:27.5197746+08:00;True|2025-01-15T11:05:17.5523582+08:00;True|2025-01-15T09:37:34.6118980+08:00;False|2025-01-15T09:36:27.7987949+08:00;True|2025-01-14T12:52:06.2234405+08:00;True|2025-01-14T12:50:08.8487446+08:00;False|2025-01-14T12:49:45.2743330+08:00;True|2025-01-14T10:31:18.6477403+08:00;False|2025-01-14T10:29:30.1534049+08:00;True|2025-01-13T15:27:00.4497527+08:00;True|2025-01-13T15:01:33.6142160+08:00;True|2025-01-13T10:29:49.4772980+08:00;True|2025-01-13T10:11:15.7993265+08:00;True|2025-01-13T10:08:58.9378828+08:00;False|2025-01-13T10:08:44.9869073+08:00;True|2025-01-13T10:02:17.5175561+08:00;False|2025-01-13T10:02:00.9991870+08:00;True|2025-01-08T17:50:21.7468469+08:00;True|2025-01-08T16:38:48.8592252+08:00;True|2025-01-08T10:44:42.9161086+08:00;False|2025-01-08T10:44:09.4840640+08:00;True|2025-01-08T10:34:31.5982265+08:00;False|2025-01-08T10:33:57.3576390+08:00;True|2025-01-03T17:19:09.1765100+08:00;True|2025-01-03T17:10:41.8794009+08:00;True|2025-01-03T17:10:11.4245485+08:00;True|2025-01-03T15:54:22.3387906+08:00;True|2025-01-03T15:41:44.9897120+08:00;False|2025-01-03T15:40:42.1357112+08:00;False|2025-01-03T15:39:09.0564197+08:00;True|2025-01-03T14:58:31.5701467+08:00;True|2025-01-03T14:29:13.4456304+08:00;False|2025-01-03T14:27:18.9925263+08:00;True|2025-01-02T16:08:24.1819376+08:00;True|2025-01-02T16:07:01.1636705+08:00;True|2025-01-02T16:03:02.6520904+08:00;True|2025-01-02T10:03:56.0551738+08:00;False|2025-01-02T10:03:34.8632732+08:00;True|2024-12-31T15:27:01.3180960+08:00;True|2024-12-31T11:17:12.2977529+08:00;True|2024-12-31T10:48:14.7205535+08:00;True|2024-12-31T10:18:45.6669875+08:00;False|2024-12-31T10:18:21.6706557+08:00;True|2024-12-30T09:32:44.3898729+08:00;True|2024-12-30T09:31:24.5771941+08:00;False|2024-12-30T09:30:52.4031391+08:00;True|2024-12-27T16:12:20.2836752+08:00;False|2024-12-27T16:11:04.6614343+08:00;True|2024-12-27T15:07:23.0750147+08:00;True|2024-12-27T15:04:52.7876532+08:00;True|2024-12-27T14:37:54.3154829+08:00;False|2024-12-27T14:37:26.9546174+08:00;True|2024-12-26T16:33:56.0452167+08:00;True|2024-12-26T16:29:21.4115458+08:00;True|2024-12-26T16:29:02.0242815+08:00;True|2024-12-26T15:17:24.7390981+08:00;False|2024-12-26T15:13:26.8863189+08:00;True|2024-12-26T15:06:35.4541902+08:00;True|2024-12-26T11:35:42.2760106+08:00;False|2024-12-26T11:35:08.9255789+08:00;True|2024-12-26T10:10:29.7487991+08:00;True|2024-12-26T09:27:40.2637311+08:00;False|2024-12-26T09:25:52.1339136+08:00;True|2024-12-24T15:11:48.9968778+08:00;True|2024-12-24T15:06:55.0283993+08:00;True|2024-12-24T14:36:29.6466740+08:00;True|2024-12-24T10:28:42.7489880+08:00;False|2024-12-24T10:28:08.6809715+08:00;True|2024-12-24T10:06:05.9449103+08:00;False|2024-12-24T10:05:32.8409161+08:00;True|2024-12-23T14:56:40.3416256+08:00;True|2024-12-23T14:50:50.2677378+08:00;True|2024-12-23T14:48:27.8169391+08:00;True|2024-12-23T14:45:25.5341474+08:00;True|2024-12-23T14:42:23.7825087+08:00;True|2024-12-23T14:35:53.8876449+08:00;True|2024-12-23T14:14:00.4257926+08:00;True|2024-12-23T11:10:54.5874876+08:00;True|2024-12-23T11:08:44.0250304+08:00;False|2024-12-23T11:08:18.5757850+08:00;True|2024-12-20T12:51:29.2354841+08:00;True|2024-12-20T12:46:13.7636932+08:00;False|2024-12-20T12:44:21.1473486+08:00;False|2024-12-20T12:44:06.5427106+08:00;True|2024-12-20T12:29:33.9971940+08:00;False|2024-12-20T12:29:01.0285205+08:00;True|2024-12-19T15:49:19.9906264+08:00;True|2024-12-19T14:55:54.3323405+08:00;True|2024-12-19T14:17:50.5086161+08:00;True|2024-12-19T14:08:16.0919011+08:00;True|2024-12-19T14:02:50.3092759+08:00;True|2024-12-19T13:54:41.2332165+08:00;False|2024-12-19T13:54:07.6973483+08:00;True|2024-12-19T09:34:54.5332110+08:00;True|2024-12-19T08:49:05.5690428+08:00;False|2024-12-19T08:48:51.0618113+08:00;True|2024-12-18T15:45:34.7174246+08:00;False|2024-12-18T15:45:10.3226822+08:00;True|2024-12-18T15:32:03.5983267+08:00;True|2024-12-18T15:31:20.1219502+08:00;True|2024-12-18T11:57:09.1595607+08:00;True|2024-12-18T11:13:37.4765697+08:00;True|2024-12-18T10:07:54.1294714+08:00;True|2024-12-18T10:04:16.0967342+08:00;False|2024-12-18T10:04:04.1561560+08:00;True|2024-12-16T17:07:07.3386872+08:00;True|2024-12-16T16:34:59.1101964+08:00;True|2024-12-16T16:19:07.9287470+08:00;False|2024-12-16T16:18:46.4617432+08:00;True|2024-12-13T18:06:11.0778539+08:00;True|2024-12-13T16:53:52.2283177+08:00;True|2024-12-13T16:23:15.9531944+08:00;True|2024-12-13T13:58:03.7464045+08:00;True|2024-12-13T10:40:33.9285602+08:00;True|2024-12-13T10:38:03.8494063+08:00;False|2024-12-13T10:37:52.4251132+08:00;True|2024-12-13T10:31:07.4994631+08:00;False|2024-12-13T10:30:40.8021885+08:00;True|2024-12-12T10:01:42.4944750+08:00;False|2024-12-12T10:01:15.7147977+08:00;True|2024-12-11T17:21:58.0453583+08:00;True|2024-12-11T10:59:15.3836831+08:00;True|2024-12-11T09:49:19.4060272+08:00;False|2024-12-11T09:48:51.7603525+08:00;True|2024-12-11T08:58:41.4567855+08:00;False|2024-12-11T08:58:09.2160433+08:00;True|2024-12-10T17:25:49.3068154+08:00;True|2024-12-10T17:21:30.0155027+08:00;True|2024-12-10T17:16:56.7587487+08:00;False|2024-12-10T17:16:34.7816611+08:00;True|2024-12-10T16:55:40.3777585+08:00;False|2024-12-10T16:55:13.2621448+08:00;False|2024-12-09T13:59:27.6362265+08:00;True|2024-12-06T16:55:30.6422980+08:00;True|2024-12-06T15:08:49.5834939+08:00;True|2024-12-06T14:31:56.0968616+08:00;False|2024-12-06T14:31:44.2264009+08:00;True|2024-12-06T13:59:52.8150929+08:00;False|2024-12-06T13:48:22.6073939+08:00;True|2024-12-05T17:33:27.9247467+08:00;True|2024-12-05T17:30:23.1740838+08:00;False|2024-12-05T17:30:03.9977311+08:00;True|2024-12-04T15:18:41.4963816+08:00;True|2024-12-04T15:16:45.1121101+08:00;True|2024-12-04T15:14:33.5954776+08:00;True|2024-12-04T15:12:27.2913137+08:00;True|2024-12-04T14:10:19.6190673+08:00;False|2024-12-04T14:10:02.0319713+08:00;True|2024-12-03T16:08:46.6721098+08:00;True|2024-12-03T15:16:04.1754554+08:00;True|2024-12-03T15:13:25.4927626+08:00;True|2024-12-03T14:55:09.4413291+08:00;True|2024-12-03T14:43:11.8243897+08:00;True|2024-12-03T14:29:16.1511932+08:00;True|2024-12-03T14:24:07.9561838+08:00;False|2024-12-03T14:23:55.1293602+08:00;True|2024-12-02T16:31:22.0404862+08:00;False|2024-12-02T16:28:53.1721961+08:00;True|2024-12-02T15:41:24.9462025+08:00;True|2024-12-02T14:12:12.9356193+08:00;False|2024-12-02T14:11:35.7159488+08:00;True|2024-12-02T10:59:31.5582757+08:00;True|2024-11-29T12:08:55.4868083+08:00;False|2024-11-29T12:08:37.0353185+08:00;True|2024-11-28T10:47:27.2071355+08:00;False|2024-11-28T10:47:13.6670955+08:00;True|2024-11-27T15:21:57.6747082+08:00;False|2024-11-27T15:20:07.2403056+08:00;True|2024-11-27T15:13:36.1461091+08:00;True|2024-11-27T14:34:35.5908753+08:00;False|2024-11-27T14:33:30.7118923+08:00;True|2024-11-26T15:16:44.1854927+08:00;True|2024-11-26T15:14:33.4021067+08:00;False|2024-11-26T15:14:07.9955135+08:00;True|2024-11-26T14:48:35.6408418+08:00;True|2024-11-26T14:45:00.7251556+08:00;True|2024-11-26T14:04:58.4232988+08:00;False|2024-11-26T14:04:28.1286675+08:00;True|2024-11-25T13:45:07.6935933+08:00;True|2024-11-25T13:43:59.0788650+08:00;False|2024-11-25T13:43:44.2225194+08:00;True|2024-11-25T08:54:05.5144014+08:00;False|2024-11-25T08:53:49.2284063+08:00;False|2024-11-22T09:53:13.7879664+08:00;True|2024-11-21T13:48:31.7056264+08:00;True|2024-11-21T13:46:55.0891551+08:00;True|2024-11-21T13:44:05.5221110+08:00;True|2024-11-21T13:43:39.1385899+08:00;False|2024-11-21T13:43:19.9351488+08:00;True|2024-11-20T11:33:52.0324053+08:00;True|2024-11-20T11:20:58.4917889+08:00;True|2024-11-20T11:03:46.9552623+08:00;True|2024-11-20T10:45:10.9517109+08:00;False|2024-11-20T10:44:58.3221116+08:00;False|2024-11-19T15:39:27.3889104+08:00;True|2024-11-19T14:42:32.0854561+08:00;True|2024-11-19T14:19:19.6198070+08:00;True|2024-11-19T14:13:08.2003750+08:00;False|2024-11-19T14:12:15.5442850+08:00;True|2024-11-18T13:05:41.0455534+08:00;True|2024-11-18T11:05:30.2819404+08:00;True|2024-11-18T10:51:07.1852818+08:00;False|2024-11-18T10:50:21.5098527+08:00;True|2024-11-18T10:15:38.5429366+08:00;True|2024-11-18T10:00:51.0847524+08:00;True|2024-11-18T09:34:52.1772715+08:00;True|2024-11-18T09:27:23.6013754+08:00;False|2024-11-18T09:26:00.9323551+08:00;True|2024-11-15T11:20:51.7576376+08:00;True|2024-11-15T11:11:17.5580168+08:00;True|2024-11-15T11:03:58.4142996+08:00;True|2024-11-15T10:44:50.5207827+08:00;True|2024-11-15T10:10:05.5550418+08:00;True|2024-11-15T09:49:30.6631382+08:00;False|2024-11-15T09:47:05.3973379+08:00;True|2024-11-14T18:31:54.8247681+08:00;True|2024-11-14T17:14:56.3660185+08:00;True|2024-11-14T16:49:44.7526912+08:00;True|2024-11-14T16:49:09.3427608+08:00;True|2024-11-14T15:59:00.2572264+08:00;True|2024-11-14T11:21:03.5110818+08:00;True|2024-11-14T10:51:10.7864658+08:00;False|2024-11-14T10:50:55.5384248+08:00;True|2024-11-14T10:29:13.6760158+08:00;False|2024-11-14T10:28:09.8622863+08:00;True|2024-11-13T17:48:46.4827219+08:00;True|2024-11-13T17:45:13.0659280+08:00;True|2024-11-13T16:01:55.2278671+08:00;False|2024-11-13T16:01:03.0040446+08:00;True|2024-11-12T17:24:06.3763535+08:00;True|2024-11-12T17:21:51.8459552+08:00;True|2024-11-12T17:11:57.9239909+08:00;True|2024-11-12T17:09:04.4322824+08:00;True|2024-11-12T17:07:12.1839548+08:00;True|2024-11-12T17:04:27.4579152+08:00;True|2024-11-12T17:03:59.6843282+08:00;True|2024-11-12T16:40:44.0714862+08:00;True|2024-11-12T16:36:27.7792764+08:00;True|2024-11-12T16:32:36.5262040+08:00;False|2024-11-12T16:32:23.9550194+08:00;True|2024-11-12T10:58:16.1987697+08:00;False|2024-11-12T10:58:04.8469631+08:00;True|2024-11-11T13:40:53.2582255+08:00;True|2024-11-11T13:37:45.0401833+08:00;True|2024-11-11T12:35:13.2429166+08:00;True|2024-11-11T11:27:29.0530688+08:00;False|2024-11-11T11:27:12.2765506+08:00;True|2024-11-08T15:52:17.1278870+08:00;False|2024-11-08T15:52:04.4379380+08:00;True|2024-11-07T18:27:41.8163960+08:00;False|2024-11-07T18:27:30.6037983+08:00;True|2024-11-06T15:55:27.6450488+08:00;True|2024-11-06T15:54:13.5957004+08:00;True|2024-11-06T15:25:33.3862531+08:00;True|2024-11-06T13:33:57.8502278+08:00;False|2024-11-06T13:33:39.2337086+08:00;True|2024-11-06T11:33:12.6755239+08:00;True|2024-11-05T18:34:17.7048247+08:00;True|2024-11-05T18:30:08.5724471+08:00;True|2024-11-05T18:24:35.5372980+08:00;True|2024-11-05T18:06:29.7644779+08:00;True|2024-11-05T17:53:50.9554703+08:00;True|2024-11-05T17:50:05.6376900+08:00;True|2024-11-05T11:13:46.2906508+08:00;True|2024-11-05T10:35:55.5423834+08:00;False|2024-11-05T10:35:20.4104039+08:00;True|2024-11-01T10:22:05.7636122+08:00;False|2024-11-01T10:21:33.2954398+08:00;True|2024-10-31T20:03:37.9075888+08:00;True|2024-10-31T18:35:31.6618415+08:00;True|2024-10-31T18:34:56.2479021+08:00;True|2024-10-31T09:43:29.0841188+08:00;False|2024-10-31T09:43:04.8780818+08:00;True|2024-10-30T18:42:11.0523067+08:00;True|2024-10-30T18:07:05.5603627+08:00;True|2024-10-30T18:03:15.3516621+08:00;True|2024-10-30T17:58:14.3276504+08:00;False|2024-10-30T17:57:44.5353118+08:00;True|2024-10-30T17:47:41.2889491+08:00;True|2024-10-30T17:19:36.6172721+08:00;True|2024-10-30T17:10:00.4399703+08:00;False|2024-10-30T17:08:57.6500450+08:00;True|2024-10-29T16:58:15.6006676+08:00;True|2024-10-29T16:51:56.8406649+08:00;True|2024-10-29T16:05:48.4297695+08:00;True|2024-10-29T15:12:15.1522377+08:00;True|2024-10-29T15:10:51.8431754+08:00;True|2024-10-29T11:21:01.5660940+08:00;False|2024-10-29T11:20:33.3958980+08:00;True|2024-10-28T17:51:26.7156861+08:00;False|2024-10-28T17:50:41.4388196+08:00;True|2024-10-28T13:34:14.8764262+08:00;True|2024-10-28T12:44:27.2083620+08:00;False|2024-10-28T12:43:57.5942717+08:00;True|2024-10-25T11:49:47.9817458+08:00;True|2024-10-25T11:49:34.4754546+08:00;True|2024-10-25T09:59:35.6471379+08:00;True|2024-10-25T09:47:46.8035540+08:00;True|2024-10-25T09:25:57.7872618+08:00;False|2024-10-25T09:25:30.0950732+08:00;True|2024-10-24T20:39:06.1992535+08:00;False|2024-10-24T20:38:33.1009731+08:00;True|2024-10-24T11:17:46.9974483+08:00;False|2024-10-24T11:17:17.0925356+08:00;True|2024-10-23T19:16:25.5189930+08:00;True|2024-10-23T17:10:44.4267777+08:00;False|2024-10-23T17:10:10.2947971+08:00;True|2024-10-23T14:13:22.6901287+08:00;False|2024-10-23T14:12:24.3997100+08:00;True|2024-10-22T16:25:12.9514711+08:00;False|2024-10-22T16:24:42.9025167+08:00;True|2024-10-22T10:22:33.9932601+08:00;False|2024-10-22T10:22:05.3030308+08:00;True|2024-10-21T17:53:29.9552741+08:00;True|2024-10-21T16:37:31.4159544+08:00;True|2024-10-21T16:35:43.6207036+08:00;True|2024-10-21T16:00:05.5040651+08:00;False|2024-10-21T15:59:35.9279259+08:00;True|2024-10-21T12:06:42.5768961+08:00;False|2024-10-21T12:06:16.6344662+08:00;True|2024-10-18T10:44:02.6495536+08:00;True|2024-10-18T09:55:47.9769914+08:00;True|2024-10-18T09:47:46.6365831+08:00;True|2024-10-18T09:46:40.4036657+08:00;True|2024-10-18T09:44:25.4598960+08:00;True|2024-10-18T09:30:07.6972377+08:00;False|2024-10-18T09:28:18.9251743+08:00;True|2024-10-17T12:13:34.8639685+08:00;True|2024-10-17T12:02:26.5251711+08:00;False|2024-10-17T12:01:31.3822430+08:00;True|2024-10-17T11:49:09.2395208+08:00;False|2024-10-17T11:48:38.0189241+08:00;True|2024-10-16T19:35:29.2047484+08:00;False|2024-10-16T19:32:43.0637947+08:00;True|2024-10-16T11:27:13.1263407+08:00;False|2024-10-16T11:25:49.8688677+08:00;True|2024-10-15T18:26:50.9948482+08:00;False|2024-10-15T18:26:23.6998750+08:00;True|2024-08-26T14:17:37.8502046+08:00;False|2024-08-26T14:16:09.8501361+08:00;True|2024-08-22T11:12:48.4249984+08:00;</History>
  </PropertyGroup>
  <ItemGroup>
    <File Include="apiapp.json">
@@ -45,28 +45,28 @@
      <publishTime>02/22/2013 16:43:40</publishTime>
    </File>
    <File Include="bin/BLL.dll">
      <publishTime>03/19/2025 13:43:28</publishTime>
      <publishTime>03/24/2025 16:47:39</publishTime>
    </File>
    <File Include="bin/BLL.pdb">
      <publishTime>03/19/2025 13:43:28</publishTime>
      <publishTime>03/24/2025 16:47:39</publishTime>
    </File>
    <File Include="bin/BouncyCastle.Crypto.dll">
      <publishTime>12/18/2020 05:32:28</publishTime>
    </File>
    <File Include="bin/DAL.dll">
      <publishTime>03/19/2025 13:43:15</publishTime>
      <publishTime>03/24/2025 16:46:53</publishTime>
    </File>
    <File Include="bin/DAL.pdb">
      <publishTime>03/19/2025 13:43:15</publishTime>
      <publishTime>03/24/2025 16:46:53</publishTime>
    </File>
    <File Include="bin/Dapper.dll">
      <publishTime>07/22/2016 22:52:40</publishTime>
    </File>
    <File Include="bin/DBUtility.dll">
      <publishTime>03/19/2025 13:43:07</publishTime>
      <publishTime>03/24/2025 16:46:44</publishTime>
    </File>
    <File Include="bin/DBUtility.pdb">
      <publishTime>03/19/2025 13:43:07</publishTime>
      <publishTime>03/24/2025 16:46:44</publishTime>
    </File>
    <File Include="bin/Grpc.Core.Api.dll">
      <publishTime>03/22/2022 13:17:26</publishTime>
@@ -111,10 +111,10 @@
      <publishTime>07/25/2012 19:48:56</publishTime>
    </File>
    <File Include="bin/Model.dll">
      <publishTime>03/19/2025 13:43:12</publishTime>
      <publishTime>03/24/2025 16:46:49</publishTime>
    </File>
    <File Include="bin/Model.pdb">
      <publishTime>03/19/2025 13:43:12</publishTime>
      <publishTime>03/24/2025 16:46:49</publishTime>
    </File>
    <File Include="bin/Models/ClsSc_MouldScrapOutBillMain.cs">
      <publishTime>02/12/2025 09:59:05</publishTime>
@@ -147,34 +147,34 @@
      <publishTime>10/23/2021 17:07:54</publishTime>
    </File>
    <File Include="bin/Pub_Class.dll">
      <publishTime>03/19/2025 13:42:56</publishTime>
      <publishTime>03/24/2025 16:46:26</publishTime>
    </File>
    <File Include="bin/Pub_Class.pdb">
      <publishTime>03/19/2025 13:42:56</publishTime>
      <publishTime>03/24/2025 16:46:26</publishTime>
    </File>
    <File Include="bin/Pub_Control.dll">
      <publishTime>03/19/2025 13:43:00</publishTime>
      <publishTime>03/24/2025 16:46:37</publishTime>
    </File>
    <File Include="bin/Pub_Control.pdb">
      <publishTime>03/19/2025 13:43:00</publishTime>
      <publishTime>03/24/2025 16:46:37</publishTime>
    </File>
    <File Include="bin/RestSharp.dll">
      <publishTime>08/31/2012 06:22:50</publishTime>
    </File>
    <File Include="bin/SQLHelper.dll">
      <publishTime>03/19/2025 13:43:01</publishTime>
      <publishTime>03/24/2025 16:46:38</publishTime>
    </File>
    <File Include="bin/SQLHelper.pdb">
      <publishTime>03/19/2025 13:43:01</publishTime>
      <publishTime>03/24/2025 16:46:38</publishTime>
    </File>
    <File Include="bin/Swashbuckle.Core.dll">
      <publishTime>02/16/2015 01:57:08</publishTime>
    </File>
    <File Include="bin/SyntacticSugar.dll">
      <publishTime>03/19/2025 13:36:04</publishTime>
      <publishTime>03/24/2025 16:19:23</publishTime>
    </File>
    <File Include="bin/SyntacticSugar.pdb">
      <publishTime>03/19/2025 13:36:04</publishTime>
      <publishTime>03/24/2025 16:19:23</publishTime>
    </File>
    <File Include="bin/System.Buffers.dll">
      <publishTime>07/19/2017 18:01:28</publishTime>
@@ -285,19 +285,19 @@
      <publishTime>05/09/2023 10:43:40</publishTime>
    </File>
    <File Include="bin/TopSdk.dll">
      <publishTime>03/19/2025 13:36:07</publishTime>
      <publishTime>03/24/2025 16:20:16</publishTime>
    </File>
    <File Include="bin/TopSdk.pdb">
      <publishTime>03/19/2025 13:36:07</publishTime>
      <publishTime>03/24/2025 16:20:16</publishTime>
    </File>
    <File Include="bin/WebActivatorEx.dll">
      <publishTime>11/24/2014 19:18:48</publishTime>
    </File>
    <File Include="bin/WebAPI.dll">
      <publishTime>03/19/2025 13:43:45</publishTime>
      <publishTime>03/24/2025 16:48:10</publishTime>
    </File>
    <File Include="bin/WebAPI.pdb">
      <publishTime>03/19/2025 13:43:45</publishTime>
      <publishTime>03/24/2025 16:48:10</publishTime>
    </File>
    <File Include="bin/WebGrease.dll">
      <publishTime>07/18/2013 01:03:52</publishTime>
WebAPI/WebAPI.csproj.user
@@ -3,7 +3,7 @@
  <PropertyGroup>
    <LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
    <NameOfLastUsedPublishProfile>D:\网站发布\后端代码\MES-WEB-API\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfile2.pubxml</NameOfLastUsedPublishProfile>
    <LastActiveSolutionConfig>Debug|x86</LastActiveSolutionConfig>
    <LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>C:\Users\86130\Desktop\智云迈思\MES-WEB-API\WebAPI\Properties\PublishProfiles\FolderProfilewtt.pubxml</NameOfLastUsedPublishProfile>
    <NameOfLastUsedPublishProfile>D:\工作代码\智云迈思\MES\MES-WEB-API\WebAPI\Properties\PublishProfiles\JFAPI.pubxml</NameOfLastUsedPublishProfile>
sdk_dingding/TopSdk/bin/Debug/TopSdk.dll
Binary files differ
sdk_dingding/TopSdk/bin/Debug/TopSdk.pdb
Binary files differ
sdk_dingding/TopSdk/obj/Debug/TopSdk.dll
Binary files differ
sdk_dingding/TopSdk/obj/Debug/TopSdk.pdb
Binary files differ