From a91fdba94705dd25cecccc7a4a5dcc2b3f2c09a6 Mon Sep 17 00:00:00 2001
From: llj <132905093+newwwwwwtree@users.noreply.github.com>
Date: 星期一, 22 十二月 2025 16:16:00 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 596 ++++++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 447 insertions(+), 149 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 098b807..f6d5708 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -1808,12 +1808,12 @@
}
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFileList " + sWhere + "order by 鏃ユ湡 desc", "h_v_Gy_MouldFileList");
+ ds = oCN.RunProcReturn("select * from h_v_Gy_MouldFileList " + sWhere + "order by 鏉$爜缂栧彿 desc", "h_v_Gy_MouldFileList");
}
else
{
string sql1 = "select * from h_v_Gy_MouldFileList where 1 = 1 ";
- string sql = sql1 + sWhere + "order by 鏃ユ湡 desc";
+ string sql = sql1 + sWhere + "order by 鏉$爜缂栧彿 desc";
ds = oCN.RunProcReturn(sql, "h_v_Gy_MouldFileList");
}
@@ -2584,11 +2584,8 @@
}
}
#endregion
- /// <summary>
- /// 鏂板妯″叿妗f-淇濆瓨鎸夐挳
- ///鍙傛暟锛歴tring sql銆�
- ///杩斿洖鍊硷細object銆�
- /// </summary>
+
+ #region[鍣ㄥ叿妗f淇濆瓨涓庝慨鏀逛繚瀛樻柟娉昡
[Route("Gy_Mould_Edit/AddBill")]
[HttpPost]
public object AddBill([FromBody] JObject oMain)
@@ -2695,6 +2692,22 @@
string HMouldUseStatus = mainList[0].HMouldUseStatus;
int HCREATEORGID = mainList[0].HCREATEORGID;
int HUSEORGID = mainList[0].HUSEORGID;
+ bool HTransPackFlag = mainList[0].HTransPackFlag; //鍛ㄨ浆瀹瑰櫒鏍囪
+ bool HSendPackFlag = mainList[0].HSendPackFlag; //鍙戣揣瀹瑰櫒鏍囪
+ int HMouldLength = mainList[0].HMouldLength; //闀�
+ int HMouldWidth = mainList[0].HMouldWidth; //瀹�
+ int HMouldHeight = mainList[0].HMouldHeight; //楂�
+ int HMouldFoldHeight = mainList[0].HMouldFoldHeight; //鎶樺彔楂樺害
+
+ int HUserID = mainList[0].HUserID; // 浣跨敤浜猴紙Gy_Employee锛�
+ string HBrand = mainList[0].HBrand; // 鍝佺墝
+ string HCalibrationType = mainList[0].HCalibrationType; // 鏍″噯绫诲瀷 (鍐�/澶栨牎)
+ string HLocation = mainList[0].HLocation; // 浣嶇疆
+ DateTime HCalibrationDate = mainList[0].HCalibrationDate; // 鏍″噯鏃ユ湡
+ string HCalibrationCycle = mainList[0].HCalibrationCycle; // 鏍″噯鍛ㄦ湡
+ string HProductDesignSize = mainList[0].HProductDesignSize; // 浜у搧璁捐灏哄
+ string HGaugeDesignSize = mainList[0].HGaugeDesignSize; // 妫�鍏疯璁″昂瀵�
+ int HProductQTY = mainList[0].HProductQTY; // 浜у搧鏁伴噺
//淇濆瓨鍓嶆帶鍒�=========================================
string HBillNote = "";
@@ -2730,8 +2743,11 @@
",HPrintQty,HMouldStatus,HWhID,HRoutingID,HCaveQty" +
",HBomID,HVersion,HSPGroupID,HSPID,HDesignLife,HNowSupID,HNowSupTypeID" +
",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID,HBarCode,HMadeSupID" +
- ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID) " +
- " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
+ ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus,HCREATEORGID,HUSEORGID " +
+ ",HMouldLength,HMouldWidth,HMouldHeight,HMouldFoldHeight,HTransPackFlag,HSendPackFlag," +
+ "HUserID,HBrand,HCalibrationType,HLocation,HCalibrationDate,HCalibrationCycle,HProductDesignSize,HGaugeDesignSize,HProductQTY ) " +
+
+ " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
"," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
@@ -2740,7 +2756,9 @@
"," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
"," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
- ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "',"+ HCREATEORGID + ","+ HUSEORGID + ") ");
+ ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "'," + HCREATEORGID + "," + HUSEORGID +
+ "," + HMouldLength + "," + HMouldWidth + "," + HMouldHeight + "," + HMouldFoldHeight + "," + Convert.ToString(HTransPackFlag ? 1 : 0) + "," + Convert.ToString(HSendPackFlag ? 1 : 0) + "," +
+ "'" + HUserID + "','" + HBrand + "','" + HCalibrationType + "','" + HLocation + "','" + HCalibrationDate + "','" + HCalibrationCycle + "','" + HProductDesignSize + "','" + HGaugeDesignSize + "','" + HProductQTY + "') ");
//瀛愯〃
oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -2787,6 +2805,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
+ objJsonResult.HInterID = HInterID.ToString();
objJsonResult.Message = null;
objJsonResult.data = null;
return objJsonResult;
@@ -2802,12 +2821,6 @@
}
}
-
- /// <summary>
- /// 淇敼鍗曟嵁-淇濆瓨鎸夐挳
- ///鍙傛暟锛歴tring sql銆�
- ///杩斿洖鍊硷細object銆�
- /// </summary>
[Route("Gy_Mould_Edit/AddBill1")]
[HttpPost]
public object AddBill1([FromBody] JObject oMain)
@@ -2893,6 +2906,24 @@
string HMouldUseStatus = mainList[0].HMouldUseStatus;
int HUSEORGID = mainList[0].HUSEORGID;
DateTime HNextMainDate = mainList[0].HNextMainDate;
+ bool HTransPackFlag = mainList[0].HTransPackFlag; //鍛ㄨ浆瀹瑰櫒鏍囪
+ bool HSendPackFlag = mainList[0].HSendPackFlag; //鍙戣揣瀹瑰櫒鏍囪
+ int HMouldLength = mainList[0].HMouldLength; //闀�
+ int HMouldWidth = mainList[0].HMouldWidth; //瀹�
+ int HMouldHeight = mainList[0].HMouldHeight; //楂�
+ int HMouldFoldHeight = mainList[0].HMouldFoldHeight; //鎶樺彔楂樺害
+
+
+ int HUserID = mainList[0].HUserID; // 浣跨敤浜猴紙Gy_Employee锛�
+ string HBrand = mainList[0].HBrand; // 鍝佺墝
+ string HCalibrationType = mainList[0].HCalibrationType; // 鏍″噯绫诲瀷 (鍐�/澶栨牎)
+ string HLocation = mainList[0].HLocation; // 浣嶇疆
+ DateTime HCalibrationDate = mainList[0].HCalibrationDate; // 鏍″噯鏃ユ湡
+ string HCalibrationCycle = mainList[0].HCalibrationCycle; // 鏍″噯鍛ㄦ湡
+ string HProductDesignSize = mainList[0].HProductDesignSize; // 浜у搧璁捐灏哄
+ string HGaugeDesignSize = mainList[0].HGaugeDesignSize; // 妫�鍏疯璁″昂瀵�
+ int HProductQTY = mainList[0].HProductQTY; // 浜у搧鏁伴噺
+
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
@@ -2918,69 +2949,79 @@
}
//=========================================================
- //涓昏〃
+ //涓昏〃
oCN.RunProc("UpDate Gy_MouldFileMain set " +
- " HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
- ",HDate='" + HDate + "'" +
- ",HYear='" + HYear.ToString() + "'" +
- ",HPeriod='" + HPeriod.ToString() + "'" +
- ",HRemark='" + HRemark + "'" +
- ",HUpDater='" + HUpDater + "'" +
- ",HUpDateDate=getdate()" +
- //========================================
- ",HMouldNo='" + HMouldNo + "'" +
- ",HName='" + HName + "'" +
- ",HModel='" + HModel + "'" +
- ",HModel2='" + HModel2 + "'" +
- ",HDiameter='" + HDiameter + "'" +
- ",HSubjoin='" + HSubjoin + "'" +
- ",HSubjoin2='" + HSubjoin2 + "'" +
- ",HPICNo='" + HPICNo + "'" +
- ",HWorkMaterModel='" + HWorkMaterModel + "'" +
- ",HMaterID=" + HMaterID.ToString() +
- ",HUSEORGID=" + HUSEORGID.ToString() +
- ",HMaterNumber='" + HMaterNumber + "'" +
- ",HMouldClass='" + HMouldClass + "'" +
- ",HMouldType=" + HMouleTypeID.ToString() +
- ",HUnitID=" + HUnitID.ToString() +
- ",HOutComDate='" + HOutComDate + "'" +
- ",HOutComNo='" + HOutComNo + "'" +
- ",HDeptID=" + HDeptID.ToString() +
- ",HSupID=" + HSupID.ToString() +
- ",HSupNumber='" + HSupNumber + "'" +
- ",HPrintQty=" + HPrintQty.ToString() +
- ",HMouldStatus='" + HMouldStatus + "'" +
- ",HSaveLife='" + HSaveLife + "'" +
- ",HWhID=" + HWHID.ToString() +
- ",HRoutingID=" + HRoutingID.ToString() +
- ",HBomID=" + HBOMID.ToString() +
- ",HVersion='" + HVersion + "'" +
- ",HSPGroupID=" + HSPGroupID.ToString() +
- ",HSPID=" + HSPID.ToString() +
- ",HDesignLife=" + HDesignLife.ToString() +
- ",HCaveQty=" + HCaveQty.ToString() +
- ",HUseLife=" + HUseLife.ToString() +
- ",HLeaveLife=" + HLeaveLife.ToString() +
- ",HProdQty=" + HProdQty.ToString() +
- ",HMouldDotCheckRuleInterID=" + HMouldDotCheckRuleInterID.ToString() +
- ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
- ",HMouldOWNER='" + HMouldOWNER + "'" +
- ",HNowSupID=" + HNowSupID.ToString() +
- ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
- ",HProdWeight=" + HProdWeight.ToString() +
- ",HBarCode='" + HBarCode.ToString() + "'" +
- ",HMadeSupID=" + HMadeSupID +
- ",HNowWHID=" + HNowWHID +
- ",HNowSPID=" + HNowSPID +
- ",HInitLife='" + HInitLife +
- "',HNextMainDate='" + HNextMainDate +
- "',HMouldUseStatus='" + HMouldUseStatus +
- "' where HInterID=" + HInterID.ToString());
-
- //淇敼瀛愰」鐩唬鐮�
- //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
- //灏嗕笂绾� 涓洪潪鏈骇
- // oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
+ " HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
+ ",HDate='" + HDate + "'" +
+ ",HYear='" + HYear.ToString() + "'" +
+ ",HPeriod='" + HPeriod.ToString() + "'" +
+ ",HRemark='" + HRemark + "'" +
+ ",HUpDater='" + HUpDater + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ ",HMouldNo='" + HMouldNo + "'" +
+ ",HName='" + HName + "'" +
+ ",HModel='" + HModel + "'" +
+ ",HModel2='" + HModel2 + "'" +
+ ",HDiameter='" + HDiameter + "'" +
+ ",HSubjoin='" + HSubjoin + "'" +
+ ",HSubjoin2='" + HSubjoin2 + "'" +
+ ",HPICNo='" + HPICNo + "'" +
+ ",HWorkMaterModel='" + HWorkMaterModel + "'" +
+ ",HMaterID=" + HMaterID.ToString() +
+ ",HUSEORGID=" + HUSEORGID.ToString() +
+ ",HMaterNumber='" + HMaterNumber + "'" +
+ ",HMouldClass='" + HMouldClass + "'" +
+ ",HMouldType=" + HMouleTypeID.ToString() +
+ ",HUnitID=" + HUnitID.ToString() +
+ ",HOutComDate='" + HOutComDate + "'" +
+ ",HOutComNo='" + HOutComNo + "'" +
+ ",HDeptID=" + HDeptID.ToString() +
+ ",HSupID=" + HSupID.ToString() +
+ ",HSupNumber='" + HSupNumber + "'" +
+ ",HPrintQty=" + HPrintQty.ToString() +
+ ",HMouldStatus='" + HMouldStatus + "'" +
+ ",HSaveLife='" + HSaveLife + "'" +
+ ",HWhID=" + HWHID.ToString() +
+ ",HRoutingID=" + HRoutingID.ToString() +
+ ",HBomID=" + HBOMID.ToString() +
+ ",HVersion='" + HVersion + "'" +
+ ",HSPGroupID=" + HSPGroupID.ToString() +
+ ",HSPID=" + HSPID.ToString() +
+ ",HDesignLife=" + HDesignLife.ToString() +
+ ",HCaveQty=" + HCaveQty.ToString() +
+ ",HUseLife=" + HUseLife.ToString() +
+ ",HLeaveLife=" + HLeaveLife.ToString() +
+ ",HProdQty=" + HProdQty.ToString() +
+ ",HMouldDotCheckRuleInterID=" + HMouldDotCheckRuleInterID.ToString() +
+ ",HMouldMaintainRuleInterID=" + HMouldMaintainRuleInterID.ToString() +
+ ",HMouldOWNER='" + HMouldOWNER + "'" +
+ ",HNowSupID=" + HNowSupID.ToString() +
+ ",HNowSupTypeID=" + HNowSupTypeID.ToString() +
+ ",HProdWeight=" + HProdWeight.ToString() +
+ ",HBarCode='" + HBarCode.ToString() + "'" +
+ ",HMadeSupID=" + HMadeSupID +
+ ",HNowWHID=" + HNowWHID +
+ ",HNowSPID=" + HNowSPID +
+ ",HTransPackFlag=" + Convert.ToString(HTransPackFlag ? 1 : 0) +
+ ",HSendPackFlag=" + Convert.ToString(HSendPackFlag ? 1 : 0) +
+ ",HMouldLength=" + HMouldLength +
+ ",HMouldWidth=" + HMouldWidth +
+ ",HMouldHeight=" + HMouldHeight +
+ ",HMouldFoldHeight=" + HMouldFoldHeight +
+ ",HInitLife='" + HInitLife +
+ "',HNextMainDate='" + HNextMainDate +
+ "',HMouldUseStatus='" + HMouldUseStatus +
+ "',HUserID='" + HUserID +
+ "',HBrand='" + HBrand +
+ "',HCalibrationType='" + HCalibrationType +
+ "',HLocation='" + HLocation +
+ "',HCalibrationDate='" + HCalibrationDate +
+ "',HCalibrationCycle='" + HCalibrationCycle +
+ "',HProductDesignSize='" + HProductDesignSize +
+ "',HGaugeDesignSize='" + HGaugeDesignSize +
+ "',HProductQTY='" + HProductQTY +
+ "' where HInterID=" + HInterID.ToString());
oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'");
oCN.RunProc("delete from Gy_MouldFileSub_MaintainRule where HInterID='" + HInterID + "'");
@@ -3014,7 +3055,7 @@
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "淇敼鍗曟嵁鎴愬姛锛�";
- //objJsonResult.data = null;
+ objJsonResult.HInterID = HInterID.ToString();
return objJsonResult;
}
catch (Exception e)
@@ -3109,11 +3150,9 @@
return objJsonResult;
}
- /// <summary>
- /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍
- ///鍙傛暟锛歴tring sql銆�
- ///杩斿洖鍊硷細object銆�
- /// </summary>
+ #endregion
+
+ #region [妯″叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍]
[Route("Gy_Mould_Edit/calculateHNextMainDate")]
[HttpGet]
public object calculateHNextMainDate(long HInterID)
@@ -3143,6 +3182,8 @@
return objJsonResult;
}
}
+ #endregion
+
/// <summary>
/// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶
@@ -3975,7 +4016,7 @@
#region [妯″叿妗f鎵归噺鐢熸垚]
[Route("Gy_Mould/SaveBatchGen_MouldFile")]
[HttpGet]
- public object SaveBatchGen_MouldFile(long HInterID, string StarNum, string EndNum)
+ public object SaveBatchGen_MouldFile(long HInterID, string StarNum, string EndNum,string user)
{
int StarNum1 = int.Parse(StarNum);
int EndNum1 = int.Parse(EndNum);
@@ -4028,10 +4069,10 @@
",HUseLife,HLeaveLife,HProdQty,HProdWeight,HMouldOWNER,HSaveLife,HMouldDotCheckRuleInterID,HMouldMaintainRuleInterID" +
") " +
" values('3899','3899'," + HItemID + ",'" + Num1 + j + "',getdate()" +
- "," + dr["HYear"] + "," + dr["HPeriod"] + ",'" + dr["HRemark"] + "','" + dr["HMaker"] + "',getdate(),'" + Num1 + j +
+ "," + dr["HYear"] + "," + dr["HPeriod"] + ",'" + dr["HRemark"] + "','" + user + "',getdate(),'" + Num1 + j +
"','" + Num1 + j + "','" + dr["HName"] + "','" + dr["HModel"] + "','" + dr["HModel2"] + "','" + dr["HDiameter"] + "'" +
",'" + dr["HSubjoin"] + "','" + dr["HSubjoin2"] + "','" + dr["HPICNo"] + "','" + dr["HWorkMaterModel"] + "'" +
- "," + dr["HMaterID"] + ",'" + dr["HMaterNumber"] + "',0," + dr["HUnitID"] +
+ "," + dr["HMaterID"] + ",'" + dr["HMaterNumber"] + "',"+dr["HMouldType"]+"," + dr["HUnitID"] +
",'" + dr["HOutComDate"] + "','" + dr["HOutComNo"] + "'," + dr["HDeptID"] + "," + dr["HSupID"] + ",'" + dr["HSupNumber"] + "'" +
"," + dr["HPrintQty"] + ",'" + dr["HMouldStatus"] + "'," + dr["HWHID"] + "," + dr["HRoutingID"] + ",'" + dr["HCaveQty"] +
"'," + dr["HBOMID"] + ",'" + dr["HVersion"] + "'," + dr["HSPGroupID"] + "," + dr["HSPID"] + ",'" + dr["HDesignLife"] + "','" + dr["HNowSupID"] + "','" + dr["HNowSupTypeID"] + "'" +
@@ -4377,11 +4418,11 @@
if (!tb2.Columns.Contains("鐘舵��"))
error += "娌℃湁鎵惧埌銆愮姸鎬併�戠殑鏍囬,";
- if (!tb2.Columns.Contains("榛樿浠撳簱"))
- error += "娌℃湁鎵惧埌銆愰粯璁や粨搴撱�戠殑鏍囬,";
+ //if (!tb2.Columns.Contains("榛樿浠撳簱"))
+ // error += "娌℃湁鎵惧埌銆愰粯璁や粨搴撱�戠殑鏍囬,";
- if (!tb2.Columns.Contains("榛樿浠撲綅"))
- error += "娌℃湁鎵惧埌銆愰粯璁や粨浣嶃�戠殑鏍囬,";
+ //if (!tb2.Columns.Contains("榛樿浠撲綅"))
+ // error += "娌℃湁鎵惧埌銆愰粯璁や粨浣嶃�戠殑鏍囬,";
if (!tb2.Columns.Contains("鐗堟湰鍙�"))
error += "娌℃湁鎵惧埌銆愮増鏈彿銆戠殑鏍囬,";
@@ -4534,67 +4575,83 @@
{
tb2.Rows[i]["HDeptID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
}
- //鏌ヨ浠撳簱
- ds = oCN.RunProcReturn("select * from Gy_Warehouse where HName='" + HWHName + "' and HUSEORGID=" + HORGid + "", "Gy_Warehouse");
+ if (HWHName != "")
+ {
+ //鏌ヨ浠撳簱
+ ds = oCN.RunProcReturn("select * from Gy_Warehouse where HName='" + HWHName + "' and HUSEORGID=" + HORGid + "", "Gy_Warehouse");
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撳簱:" + HWHName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- tb2.Rows[i]["HWHID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
- }
- string HWHID = tb2.Rows[i]["HWHID"].ToString();
- //鏌ヨ浠撲綅
- ds = oCN.RunProcReturn("select * from Gy_StockPlace where HName='" + HSPName + "'and HSPGroupID=" + HWHID+ " and HUSEORGID=" + HORGid + "", "Gy_Warehouse");
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撳簱:" + HWHName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HWHID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+
+ string HWHID = tb2.Rows[i]["HWHID"].ToString();
+ if (HWHID != "")
+ {
+ //鏌ヨ浠撲綅
+ ds = oCN.RunProcReturn("select * from Gy_StockPlace where HName='" + HSPName + "'and HSPGroupID=" + HWHID + " and HUSEORGID=" + HORGid + "", "Gy_StockPlace");
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撲綅:" + HSPName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,浠撲綅:" + HSPName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HSPID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ }
+
}
- else
+ if(HSupName!="")
{
- tb2.Rows[i]["HSPID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ ds = oCN.RunProcReturn("select * from Gy_Supplier where HNumber='" + HSupNumber + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,渚涘簲鍟�:" + HSupName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
}
//鏌ヨ渚涘簲鍟�
- ds = oCN.RunProcReturn("select * from Gy_Supplier where HNumber='" + HSupNumber + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
+ if(HMadeSupName!="")
+ {
+ //鏌ヨ鍒堕�犲晢
+ ds = oCN.RunProcReturn("select * from Gy_Supplier where HName='" + HMadeSupName + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,渚涘簲鍟�:" + HSupName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍒堕�犲晢:" + HMadeSupName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HMadeSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
}
- else
- {
- tb2.Rows[i]["HSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
- }
- //鏌ヨ鍒堕�犲晢
- ds = oCN.RunProcReturn("select * from Gy_Supplier where HName='" + HMadeSupName + "' and HUSEORGID=" + HORGid + "", "Gy_Supplier");
-
- if (ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍒堕�犲晢:" + HMadeSupName + ",涓嶅瓨鍦紒";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- tb2.Rows[i]["HMadeSupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
- }
+
+
//鍣ㄥ叿妗f鍚嶇О
if (HMouldName == "")
@@ -4704,15 +4761,19 @@
long HUnitID = int.Parse(item["HUnitID"].ToString());
DateTime HOutComDate = DateTime.Now;
string HOutComNo = item["鍣ㄥ叿鍑哄巶缂栧彿"].ToString();
- long HDeptID = int.Parse(item["HDeptID"].ToString());
- long HSupID = int.Parse(item["HSupID"].ToString());
+ var HDeptID_temp = item["HDeptID"].ToString() == "" ? "0" : item["HDeptID"].ToString();
+ long HDeptID = int.Parse(HDeptID_temp);
+ var HSupID_temp = item["HSupID"].ToString() == "" ? "0" : item["HSupID"].ToString();
+ long HSupID = int.Parse(HSupID_temp);
string HMouldStatus = item["鐘舵��"].ToString();
- long HWHID = int.Parse(item["HWHID"].ToString());
+ var HWHID_TEMP = item["HWHID"].ToString() == "" ? "0" : item["HWHID"].ToString();
+ long HWHID = int.Parse(HWHID_TEMP);
long HRoutingID = 0;//宸ヨ壓璺嚎id
long HBOMID = 0;
string HVersion = "";//鐗堟湰
long HSPGroupID = 0;//榛樿浠撲綅缁�
- long HSPID = int.Parse(item["HSPID"].ToString());//浠撲綅id
+ var HSPID_temp = item["HSPID"].ToString() == "" ? "0" : item["HSPID"].ToString();
+ long HSPID = int.Parse(HSPID_temp);//浠撲綅id
Double HDesignLife = item["璁捐瀵垮懡"].ToString()=="" ? 0: double.Parse(item["璁捐瀵垮懡"].ToString());
Double HUseLife = item["浣跨敤瀵垮懡"].ToString() == "" ? 0 : double.Parse(item["浣跨敤瀵垮懡"].ToString());
Double HInitLife = 0;//涓婄嚎鍒濆鍖栧鍛�
@@ -4771,7 +4832,7 @@
"," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID + "," + HCaveQty +
"," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "','" + HNowSupID + "','" + HNowSupTypeID + "'" +
",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
- ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "') ");
+ ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + " ) ");
}
else
{
@@ -4855,5 +4916,242 @@
#endregion
#endregion
+ #region 鍣ㄥ叿妗f 鏂囦欢涓婁紶
+ [Route("Gy_MouldFileBIllMain/UploadFile_Gy_MouldFilen")]
+ [HttpPost]
+ public object UploadFile_Gy_MouldFilen()
+ {
+
+ string HBillNo = HttpContext.Current.Request.Params["HBillNo"]; //鍗曟嵁鍙�
+ string HRemark = HttpContext.Current.Request.Params["HRemark"]; //澶囨敞
+ string HUserName = HttpContext.Current.Request.Params["HUserName"]; //鍒涘缓浜�
+ HttpPostedFile files = HttpContext.Current.Request.Files["file"];
+ string path = HttpContext.Current.Server.MapPath("~/../Files/Gy_MouldFilen/" + HBillNo);
+ dynamic dyResult = UploadFile_Gy_MouldFilen(files, path, HBillNo, HRemark, HUserName);
+ if (dyResult != null && dyResult.result == 1)
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "涓婁紶鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = dyResult.returnval;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ }
+
+ public dynamic UploadFile_Gy_MouldFilen(HttpPostedFile files, string path, string HBillNo, string HRemark, string HUserName)
+ {
+ dynamic Result_Ob = new { result = 1, returnval = "涓婁紶鎴愬姛锛�" };
+ string filePath = Path.GetFullPath(files.FileName);//鏂囦欢涓婁紶璺緞
+ string fileExtension = Path.GetExtension(files.FileName);// 鏂囦欢鎵╁睍鍚�
+ string filename = files.FileName;//鏂囦欢鍚�
+ string fileSavePath = path;// 涓婁紶淇濆瓨璺緞
+ int filesize = files.ContentLength;//鑾峰彇涓婁紶鏂囦欢鐨勫ぇ灏忓崟浣嶄负瀛楄妭byte
+ int Maxsize = 40000 * 1024;//瀹氫箟涓婁紶鏂囦欢鐨勬渶澶х┖闂村ぇ灏忎负40M
+ try
+ {
+ if (files == null || files.ContentLength <= 0)
+ {
+ Result_Ob = new { result = 0, returnval = "鏂囦欢涓嶈兘涓虹┖!" };
+ return Result_Ob;
+ }
+ if (filesize >= Maxsize)
+ {
+ Result_Ob = new { result = 0, returnval = "涓婁紶鏂囦欢瓒呰繃40M锛屼笉鑳戒笂浼狅紒" };
+ return Result_Ob;
+ }
+
+ string fileurl = Path.Combine(fileSavePath, filename);
+ if (Directory.Exists(fileurl) == true) //濡傛灉瀛樺湪閲嶅悕鏂囦欢灏辨彁绀�
+ {
+ Result_Ob = new { result = 0, returnval = "瀛樺湪鍚屽悕鏂囦欢锛�" };
+ return Result_Ob;
+ }
+ //鍒犻櫎鏁版嵁琛ㄦ暟鎹�
+ ds = oCN.RunProcReturn("delete from MES_AccessoriesList where HSourceBillNo ='" + HBillNo + "' and HFileName='" + filename + "'", "MES_AccessoriesList");
+ if (Directory.Exists(path))
+ {
+ File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢
+ files.SaveAs(fileurl);
+ string StrPath = "/files/Gy_MouldFilen/" + HBillNo + "/" + filename;
+ if (File.Exists(fileurl))
+ {
+ //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱
+ //鍐欏叆鏁版嵁琛�
+ oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
+ ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
+ ",HFileClsID,HSourceBillNo" +
+ ") values('"
+ + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
+ ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
+ "','" + 0 + "','" + HBillNo +
+ "') ");
+ }
+ else
+ {
+ Result_Ob = new { result = 0, returnval = "涓婁紶澶辫触锛佹鏂囦欢涓烘伓鎰忔枃浠�" };
+ }
+ }
+ else
+ {
+ Directory.CreateDirectory(fileSavePath); //娣诲姞鏂囦欢澶�
+ files.SaveAs(fileurl);
+ string StrPath = "/files/Gy_MouldFilen/" + HBillNo + "/" + filename;
+ if (File.Exists(fileurl))
+ {
+ //杩欓噷鍙互鎵ц涓�浜涘叾瀹冪殑鎿嶄綔锛屾瘮濡傛洿鏂版暟鎹簱
+ //鍐欏叆鏁版嵁琛�
+ oCN.RunProc("Insert into MES_AccessoriesList (HFileName,HFilePath,HFilePath_Cus,HFileType" +
+ ",HLoadMan,HLoadDate,HRemark,HVerNum,HFileSize" +
+ ",HFileClsID,HSourceBillNo" +
+ ") values('"
+ + filename.ToString() + "','" + StrPath.ToString() + "','" + filePath.ToString() + "','" + fileExtension.ToString() + "'" +
+ ",'" + HUserName + "',getdate(),'" + HRemark + "','V1','" + filesize +
+ "','" + 0 + "','" + HBillNo +
+ "') ");
+ }
+ else
+ {
+ Result_Ob = new { result = 0, returnval = "涓婁紶澶辫触锛佹鏂囦欢涓烘伓鎰忔枃浠�" };
+ }
+ }
+
+ }
+ catch (Exception e)
+ {
+ Result_Ob = new { result = 0, returnval = e.Message };
+ }
+ return Result_Ob;
+ }
+
+ /// <summary>
+ /// 鏍规嵁鍗曟嵁鍙锋煡鎵句笂浼犳枃浠跺垪琛�
+ /// </summary>
+ /// <param name="sWhere"></param>
+ /// <returns></returns>
+ [Route("Gy_MouldFileBIllMain/Gy_MouldFilen_Filelist")]
+ [HttpGet]
+ public object Gy_MouldFilen_Filelist(string HBillNo)
+ {
+ var url = fileip + "/Files/Gy_MouldFilen/" + HBillNo + "/";
+
+ try
+ {
+ ds = oCN.RunProcReturn("select *,'" + url + "'+CAST(HFileName as varchar(200))as url from MES_AccessoriesList where HSourceBillNo='" + HBillNo + "'", "MES_AccessoriesList");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ 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>
+ /// 鏍规嵁ID,鍗曟嵁鍙�,鏂囦欢鍚� 鍒犻櫎鏂囦欢
+ /// </summary>
+ /// <param name="sWhere"></param>
+ /// <returns></returns>
+ [Route("Gy_MouldFileBIllMain/Gy_MouldFilen_DeleteFilelist")]
+ [HttpGet]
+ public object Gy_MouldFilen_DeleteFilelist(string HItemID, string HSourceBillNo, string HFileName)
+ {
+ try
+ {
+
+ oCN.RunProc("delete from MES_AccessoriesList where HItemID =" + HItemID);
+ string fileurl = Path.Combine(HttpContext.Current.Server.MapPath("~/../Files/Gy_MouldFilen/" + HSourceBillNo), HFileName);
+ File.Delete(fileurl); //鍒犻櫎鎸囧畾鏂囦欢
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+
+ //鏍规嵁鏉$爜鎵剧墿鏂欎俊鎭�
+ [Route("Gy_Material/findMaterialByNumber")]
+ [HttpGet]
+ public object findMaterialByNumber(string HbarCode,string HSTOCKORGID)
+ {
+ try
+ {
+ ds = oCN.RunProcReturn($"select * from Gy_BarCodeBill where HBarCode='{HbarCode}' ", "Gy_Material");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ユ壘澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎴愬姛";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+
+ }
+ catch (Exception)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+ [Route("Gy_BarCodeBillList/GetBarCodeBillPermission")]
+ [HttpGet]
+ public object GetBarCodeBillPermission(string user)
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBillList_Print", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愭煡璇�!";
+ objJsonResult.data = 0;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ }
}
}
\ No newline at end of file
--
Gitblit v1.9.1