From 1739eb7838984e9a55fbbb5d4705f55908749375 Mon Sep 17 00:00:00 2001 From: duhe <226547893@qq.com> Date: 星期五, 01 九月 2023 09:00:06 +0800 Subject: [PATCH] 器具主档:增加制造厂商字段HMadeSupID,计算 保养/校正日期 --- WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 46 +++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 43 insertions(+), 3 deletions(-) diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs index 45d8bee..55727f9 100644 --- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs +++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs @@ -386,6 +386,7 @@ try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); + if (user == "10000")//api鍚屾鏂瑰紡 { oCN.RunProc("delete from Gy_Material where HERPItemID=" + HItemID); @@ -395,6 +396,7 @@ objJsonResult.data = null; return objJsonResult; ; } + //鍒犻櫎鏉冮檺 if (!DBUtility.ClsPub.Security_Log("Gy_Material_Delete", 1, false, user)) { @@ -416,6 +418,7 @@ ds = oCN.RunProcReturn("select * from Gy_Material where HItemID=" + HItemID, "Gy_Material"); if (ds == null || ds.Tables[0].Rows.Count == 0) { + oCN.RollBack();//鍥炴粴浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒"; @@ -444,6 +447,7 @@ } catch (Exception e) { + oCN.RollBack();//鍥炴粴浜嬪姟 objJsonResult.code = "0"; objJsonResult.count = 0; objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString(); @@ -1005,7 +1009,7 @@ int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID; int HNowSupID = mainList[0].HNowSupID; int HNowSupTypeID = mainList[0].HNowSupTypeID; - + int HMadeSupID = mainList[0].HMadeSupID; //涓昏〃 @@ -1018,7 +1022,7 @@ ",HOutComDate,HOutComNo,HDeptID,HSupID,HSupNumber" + ",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" + ",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" + - ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode" + + ",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" + ") " + " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" + "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" + @@ -1028,7 +1032,7 @@ ",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" + "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty + "," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" + - ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'" + + ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID + ") "); @@ -1146,6 +1150,7 @@ int HMouldMaintainRuleInterID = mainList[0].HMouldMaintainRuleInterID; int HNowSupID = mainList[0].HNowSupID; int HNowSupTypeID = mainList[0].HNowSupTypeID; + int HMadeSupID = mainList[0].HMadeSupID; //鑻AINDI閲嶅鍒欓噸鏂拌幏鍙� oCN.BeginTran(); @@ -1198,6 +1203,7 @@ ",HNowSupTypeID=" + HNowSupTypeID.ToString() + ",HProdWeight=" + HProdWeight.ToString() + ",HBarCode='" + HBarCode.ToString() + "'" + + ",HMadeSupID=" + HMadeSupID + " where HInterID=" + HInterID.ToString()); //淇敼瀛愰」鐩唬鐮� @@ -1224,6 +1230,40 @@ } + /// <summary> + /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍 + ///鍙傛暟锛歴tring sql銆� + ///杩斿洖鍊硷細object銆� + /// </summary> + [Route("Gy_Mould_Edit/calculateHNextMainDate")] + [HttpGet] + public object calculateHNextMainDate(long HInterID) + { + try + { + string sql = @"select top(1) a.HInterID, b.HEndDate 淇濆吇璁板綍缁撴潫鏃ユ湡 + from Gy_MouldFileMain AS a LEFT OUTER JOIN + Sc_MouldMaintainBillMain AS b on a.HInterID = b.HMouldID + where a.HInterID = " + HInterID + + " order by b.HEndDate desc"; + + ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainBillMain"); + + objJsonResult.code = "1"; + objJsonResult.count = 1; + objJsonResult.Message = ""; + objJsonResult.data = ds.Tables[0]; + return objJsonResult; + } + catch (Exception e) + { + objJsonResult.code = "0"; + objJsonResult.count = 0; + objJsonResult.Message = "Exception锛�" + e.ToString(); + objJsonResult.data = null; + return objJsonResult; + } + } /// <summary> /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶 -- Gitblit v1.9.1