From 8a6281f8962f5ac973763bc03f5ff15c35c2a713 Mon Sep 17 00:00:00 2001 From: yangle <admin@YINMOU> Date: 星期五, 17 五月 2024 17:27:17 +0800 Subject: [PATCH] 流转卡派工 同步到生产状态临时表 --- WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs | 36 +++++++++++++++++++++--------------- 1 files changed, 21 insertions(+), 15 deletions(-) diff --git a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs index 6346119..312c52a 100644 --- a/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs +++ b/WebAPI/Controllers/SBGL/Gy_EquipFileMainController.cs @@ -49,22 +49,12 @@ ds = oCN.RunProcReturn(sql, "h_v_Gy_EquipFileMainList"); } - //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) { @@ -104,8 +94,18 @@ return objJsonResult; } DLL.ClsGy_EquipFileMain oBill = new DLL.ClsGy_EquipFileMain(); - if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo)) + ds = oCN.RunProcReturn("select * from Gy_EquipFileBillMain where HInterID=" + HItemID, "Gy_EquipFileBillMain"); + if (ds.Tables[0].Rows.Count > 0) { + if (int.Parse(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "鍗曟嵁褰撳墠澶勪簬涓嶈兘鍒犻櫎鐘舵�侊紒"; + objJsonResult.data = null; + return objJsonResult; + } + oCN.RunProc("Delete From Gy_EquipFileBillMain where HInterID=" + lngBillKey); objJsonResult.code = "1"; objJsonResult.count = 1; @@ -211,6 +211,8 @@ string HLogo = list[0].HLogo; //鈭� varchar(50) //鍝佺墝 int HSellSupID = list[0].HSellSupID; // 鈭� int //渚涘簲鍟�(Gy_Supplier) int HMakeSupID = list[0].HMakeSupID; // int //鍒堕�犲晢 (Gy_Supplier) + string HMainSourceFlag = list[0].HMainSourceFlag; //varchar(10) //鏄惁涓荤敓浜ц澶�(鍚︼紝鏄�) + string HMacAddress = list[0].HMacAddress; // varchar(50) //鏁伴噰鐗╃悊鍦板潃 string HMaker = msg4; string HMakeDate = DateTime.Now.Date.ToString(); int HEquipDotCheckRuleInterID = list[0].HEquipDotCheckRuleInterID; @@ -231,11 +233,11 @@ oCN.RunProc("Insert into Gy_EquipFileBillMain " + " (hbillno,HEquipFileNumber,HEquipFileNo,HName,HModel,HModel2,HMaterID,HUnitID,HOutComDate" + ",HOutComNo,HDeptID,HUseEmpID,HRepairEmpID,HAddress,HSetupDate,HStartupDate,HStatus," + -"HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID) " + +"HEquipFileTypeID,HProNum,HBarCode,HWorkArea,HLogo,HSellSupID,HMakeSupID,hbilltype,HDate,HYear,HMaker,HMakeDate,HEquipMaintainRuleInterID,HEquipDotCheckRuleInterID,HSourceID,HMainSourceFlag,HMacAddress) " + " Values('" + hbillno + "','" + HEquipFileNumber + "','" + HEquipFileNo + "','" + HName + "','" + HModel + "','" + HModel2 + "'," + HMaterID + "," + HUnitID + ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HUseEmpID + "," + HRepairEmpID + ",'" + HAddress + "','" + HSetupDate + "','" + HStartupDate + "','" + HStatus + "'," + HEquipFileTypeID + ",'" + HProNum + - "','" + HBarCode + "','" + HWorkArea + "','" + HLogo + "'," + HSellSupID + "," + HMakeSupID + ",'3308','" + HDate + "','" + HYear + "','" + HMaker + "','" + HMakeDate + "','" + HEquipMaintainRuleInterID + "','" + HEquipDotCheckRuleInterID +"'," + HSourceID + ")", ref DBUtility.ClsPub.sExeReturnInfo); + "','" + HBarCode + "','" + HWorkArea + "','" + HLogo + "'," + HSellSupID + "," + HMakeSupID + ",'3308','" + HDate + "','" + HYear + "','" + HMaker + "','" + HMakeDate + "','" + HEquipMaintainRuleInterID + "','" + HEquipDotCheckRuleInterID +"'," + HSourceID + ",'" + HMainSourceFlag + "','" + HMacAddress + "')", ref DBUtility.ClsPub.sExeReturnInfo); //淇敼涓婄骇涓洪潪鏈骇浠g爜 oCN.Commit(); objJsonResult.code = "1"; @@ -309,6 +311,8 @@ string HLogo = list[0].HLogo; //鈭� varchar(50) //鍝佺墝 int HSellSupID = list[0].HSellSupID; // 鈭� int //渚涘簲鍟�(Gy_Supplier) int HMakeSupID = list[0].HMakeSupID; // int //鍒堕�犲晢 (Gy_Supplier) + string HMainSourceFlag = list[0].HMainSourceFlag; //varchar(10) //鏄惁涓荤敓浜ц澶�(鍚︼紝鏄�) + string HMacAddress = list[0].HMacAddress; // varchar(50) //鏁伴噰鐗╃悊鍦板潃 string HUpDater = msg4; string HUpDateDate = DateTime.Now.Date.ToString(); int HEquipDotCheckRuleInterID = list[0].HEquipDotCheckRuleInterID; @@ -364,11 +368,13 @@ ",HLogo='" + HLogo + "'" + ",HSellSupID=" + HSellSupID + ",HMakeSupID= " + HMakeSupID + - ",HUpDater= '" + HUpDater + "'" + + ",HUpDater= '" + HUpDater + "'" + ",HUpDateDate= '" + HUpDateDate + "'" + ",HEquipDotCheckRuleInterID='" + HEquipDotCheckRuleInterID + "'" + ",HEquipMaintainRuleInterID='" + HEquipMaintainRuleInterID + "'" + ",HSourceID='" + HSourceID + "'" + + ",HMainSourceFlag= '" + HMainSourceFlag + "'" + + ",HMacAddress= '" + HMacAddress + "'" + " Where HInterID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo); //淇敼瀛愰」鐩唬鐮� //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_RepairCheck,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo); -- Gitblit v1.9.1