ch
2021-07-02 3e291c359a5ee1a024ccf4daa1c8694d0b1acc3c
WebAPI/Controllers/QC_ManagementController.cs
@@ -151,7 +151,7 @@
                }
                else
                {
                    string sql1 = "select * from h_v_QC_POStockInCheckBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_QC_POStockInCheckBillList where 关闭人='' ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_QC_POStockInCheckBillList");
                }
@@ -182,11 +182,11 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList ", "h_v_QC_FirstPieceCheckBillList");
                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_FirstPieceCheckBillList  where  关闭人='' ", "h_v_QC_FirstPieceCheckBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_QC_FirstPieceCheckBillList where 关闭人='' ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_QC_FirstPieceCheckBillList");
                }
@@ -217,11 +217,11 @@
                SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
                if (sqlWhere == null || sqlWhere.Equals(""))
                {
                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList ", "h_v_QC_PatrolProcCheckBillList");
                    ds = oCN.RunProcReturn("select top 500 * from h_v_QC_PatrolProcCheckBillList where  关闭人=''", "h_v_QC_PatrolProcCheckBillList");
                }
                else
                {
                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 1 = 1 ";
                    string sql1 = "select * from h_v_QC_PatrolProcCheckBillList where 关闭人='' ";
                    string sql = sql1 + sqlWhere;
                    ds = oCN.RunProcReturn(sql, "h_v_QC_PatrolProcCheckBillList");
                }
@@ -435,6 +435,7 @@
        #region 保存/编辑/删除方法
        #region 检验方案
        /// <summary>
        /// 保存检验方案
        /// </summary>
@@ -510,7 +511,7 @@
                    oItemSub.HSourceEntryID =0;
                    oItemSub.HSourceInterID =0;
                    oItemSub.HEntryID = i;
                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;
                    oItemSub.HSourceBillNo = "";
                    oItemSub.HSourceBillType = "";
@@ -634,8 +635,9 @@
                return objJsonResult;
            }
        }
        #endregion
        #region 来料检验
        /// <summary>
        /// 保存来料检验单
        /// </summary>
@@ -711,7 +713,7 @@
                    oItemSub.HSourceInterID = 0;
                    oItemSub.HEntryID = i;
                    // DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;
                    oItemSub.HSourceBillNo = "";
                    oItemSub.HSourceBillType = "";
@@ -836,7 +838,9 @@
                return objJsonResult;
            }
        }
        #endregion
        #region 首件检验
        /// <summary>
        /// 保存首件检验单
        /// </summary>
@@ -913,7 +917,7 @@
                    oItemSub.HSourceInterID = 0;
                    oItemSub.HEntryID = i;
                    // DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;
                    oItemSub.HSourceBillNo = "";
                    oItemSub.HSourceBillType = "";
@@ -996,8 +1000,8 @@
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain");
                DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub");
                ds = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillMain where HInterID=" + HInterID, "QC_FirstPieceCheckBillMain");
                DataSet ds2 = oCN.RunProcReturn("select * from QC_FirstPieceCheckBillSub where HInterID=" + HInterID, "QC_FirstPieceCheckBillSub");
                if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -1018,8 +1022,8 @@
                    return objJsonResult;
                }
                oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.RunProc("update QC_FirstPieceCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.RunProc("update QC_FirstPieceCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -1037,7 +1041,9 @@
                return objJsonResult;
            }
        }
        #endregion
        #region 巡检
        /// <summary>
        /// 保存巡检单
        /// </summary>
@@ -1058,7 +1064,7 @@
            ListModels oListModels = new ListModels();
            try
            {
                DAL.ClsQC_PatrolProcCheckBill oBill = new DAL.ClsQC_PatrolProcCheckBill();
                WebAPI.DLL.ClsQC_PatrolProcCheckBill oBill = new WebAPI.DLL.ClsQC_PatrolProcCheckBill();
                List<Model.ClsQC_PatrolProcCheckBillMain> lsmain = new List<Model.ClsQC_PatrolProcCheckBillMain>();
                msg2 = msg2.Replace("\\", "");
                msg2 = msg2.Replace("\n", "");  //\n
@@ -1070,8 +1076,8 @@
                    oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
                    oItem.HDate = DBUtility.ClsPub.isDate(DateTime.Now.ToString("yyyy-MM-dd"));
                    oItem.HBillType = "7503";
                    oItem.HBillSubType = "7503";
                    oItem.HBillType = "7506";
                    oItem.HBillSubType = "7506";
                    oItem.HBillStatus = 0;
                    oItem.HPeriod = 0;
                    oItem.HMaker = "";
@@ -1113,7 +1119,7 @@
                    oItemSub.HSourceInterID = 0;
                    oItemSub.HEntryID = i;
                    // DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HEntryCloseDate = Convert.ToDateTime("");
                    oItemSub.HEntryCloseDate = DBUtility.ClsPub.isDate(DateTime.Now);
                    oItemSub.HCloseType = false;
                    oItemSub.HSourceBillNo = "";
                    oItemSub.HSourceBillType = "";
@@ -1196,8 +1202,8 @@
                    return objJsonResult;
                }
                oCN.BeginTran();//开始事务
                ds = oCN.RunProcReturn("select * from QC_POStockInCheckBillMain where HInterID=" + HInterID, "QC_POStockInCheckBillMain");
                DataSet ds2 = oCN.RunProcReturn("select * from QC_POStockInCheckBillSub where HInterID=" + HInterID, "QC_POStockInCheckBillSub");
                ds = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillMain where HInterID=" + HInterID, "QC_PatrolProcCheckBillMain");
                DataSet ds2 = oCN.RunProcReturn("select * from QC_PatrolProcCheckBillSub where HInterID=" + HInterID, "QC_PatrolProcCheckBillSub");
                if (ds == null || ds.Tables[0].Rows.Count == 0 || ds2 == null || ds2.Tables[0].Rows.Count == 0)
                {
                    objJsonResult.code = "0";
@@ -1218,8 +1224,8 @@
                    return objJsonResult;
                }
                oCN.RunProc("update QC_POStockInCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.RunProc("update QC_POStockInCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.RunProc("update QC_PatrolProcCheckBillMain set HCloseMan='-1',HCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.RunProc("update QC_PatrolProcCheckBillSub set HCloseMan='-1',HEntryCloseDate=GETDATE()  where HInterID=" + HInterID);
                oCN.Commit();//提交事务
                objJsonResult.code = "0";
                objJsonResult.count = 1;
@@ -1237,7 +1243,7 @@
                return objJsonResult;
            }
        }
        #endregion
        #endregion