1
zrg
2026-04-15 0b8efdbce56a9df6eb2ec48dbc75b433e8c14256
WebAPI/Controllers/SCGL/Sc_MESBeginWorkBillController.cs
@@ -1728,14 +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;
                    }
                }
                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";
@@ -1744,12 +1749,12 @@
                    objJsonResult.data = 1;
                    return objJsonResult;
                }
                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";
@@ -1763,9 +1768,10 @@
                string sReturn = "";
                if (oSystemParameter.ShowBill(ref sReturn) == true)
                {
                    LogService.Write("开工单自动生成工作联系单...4 ");
                    if (oSystemParameter.omodel.WMS_CampanyName == "华舟")
                    {                       
                        LogService.Write("自动生成工作联系单..."+ oBill.omodel.HInterID);
                        LogService.Write("开工单自动生成工作联系单..."+ oBill.omodel.HInterID);
                        //自动生成工作联系单
                        ds2 = oCN.RunProcReturn("exec h_p_OA_WorkLinkBill_Create " + oBill.omodel.HInterID + "," + 3787, "h_p_OA_WorkLinkBill_Create");