1
zrg
2024-11-25 59f31f0caeef6fb37f397646efbcd19738299122
WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs
@@ -323,6 +323,27 @@
                }
                //若MAINDI重复则重新获取
                oCN.BeginTran();
                //保存前控制=========================================
                string HBillNote = "";
                ds = oCN.RunProcReturn("Exec h_p_Gy_EquipFileBillMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + hbillno + "','" + HBillNote + "',1 ", "h_p_Gy_EquipFileBillMain_BeforeSaveCtrl");
                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]["HBackRemark"].ToString(); ;
                    objJsonResult.data = null;
                    return objJsonResult;
                }
                //=========================================================
                //主表
                oCN.RunProc("Insert into Gy_EquipFileBillMain " +
                   " (HInterID,hbillno,HEquipFileNumber,HEquipFileNo,HName,HModel,HModel2,HMaterID,HUnitID,HOutComDate" +
@@ -334,6 +355,29 @@
                   "','" + HBarCode + "','" + HWorkArea + "','" + HLogo + "'," + HSellSupID + "," + HMakeSupID + ",'3308','" + HDate + "','" + HYear + "','" + HMaker + "','" + HMakeDate + "','" + HEquipMaintainRuleInterID + "','" + HEquipDotCheckRuleInterID +"'," + HSourceID + ",'" + HMainSourceFlag + "','" + HMacAddress + "','" + HMainSourceID + "')", ref DBUtility.ClsPub.sExeReturnInfo);
                //修改上级为非末级代码
                objJsonResult = AddBillSub(msg3, msg4, HInterID, hbillno, 1);
                //保存后控制=========================================
                ds = oCN.RunProcReturn("Exec h_p_Gy_EquipFileBillMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + hbillno + "','" + HBillNote + "',1 ", "h_p_Gy_EquipFileBillMain_AfterSaveCtrl");
                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]["HBackRemark"].ToString(); ;
                    objJsonResult.data = null;
                    oCN.RollBack();
                    return objJsonResult;
                }
                //=========================================================
                oCN.Commit();
                //objJsonResult.data = null;
                return objJsonResult;