1
llj
2026-04-09 d59ee61a5295c30dd28d7f9324628f54534b540e
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -1728,17 +1728,19 @@
                //保存
                //保存完毕后处理
                bool bResult = false;
                string RetHInterID = "0";
                if (oBill.omodel.HInterID == 0)
                {
                    bResult = oBill.AddBill(ref DBUtility.ClsPub.sExeReturnInfo);
                    if(bResult)
                    {
                        RetHInterID = DBUtility.ClsPub.sExeReturnInfo;
                    }
                }
                LogService.Write("开工单自动生成工作联系单...1  " + oBill.omodel.HBillNo);
                ds = oCN.RunProcReturn("select * from Sc_MESBeginWorkBillMain where HBillNo='" + oBill.omodel.HBillNo + "'", "Sc_MESBeginWorkBillMain");
                if (ds.Tables[0].Rows.Count == 0)
                // ds = oCN.RunProcReturn("select * from Sc_MESBeginWorkBillMain nolock where HBillNo='" + oBill.omodel.HBillNo + "'", "Sc_MESBeginWorkBillMain");
                //if (ds.Tables[0].Rows.Count == 0)
                if(RetHInterID == "0")
                {
                    oCN.RollBack();
                    objJsonResult.code = "0";
@@ -1747,15 +1749,12 @@
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                LogService.Write("开工单自动生成工作联系单...2 " + ds.Tables[0].Rows.Count);
                string sAutoCheck = oClsXt_SystemParameter.GetSingleSystemParameter("Sc_MESBeginWorkBill_AutoCheck", ref DBUtility.ClsPub.sExeReturnInfo);
                if (sAutoCheck == "Y")
                {
                    LogService.Write("开工单自动生成工作联系单...3 " + sAutoCheck);
                    if (!oBill.CheckBill(long.Parse(ds.Tables[0].Rows[0]["HInterID"].ToString()), ref DBUtility.ClsPub.sExeReturnInfo))
                    if (!oBill.CheckBill(long.Parse(RetHInterID), ref DBUtility.ClsPub.sExeReturnInfo))
                    {
                        oCN.RollBack();
                        objJsonResult.code = "0";