From 2568dccd86ae777f49dcf9c23e5ddd5a55bc2795 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期三, 06 十一月 2024 12:10:36 +0800
Subject: [PATCH] 森楷其他入库模块扫条码同步入库申请单
---
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 1314 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 1,307 insertions(+), 7 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 596820f..6763499 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -14,6 +14,8 @@
using WebAPI.Models;
using WebAPI.Service;
using System.Text.RegularExpressions;
+using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
+using SyntacticSugar.constant;
namespace WebAPI.Controllers
{
@@ -22,7 +24,7 @@
//鑾峰彇绯荤粺鍙傛暟
Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
public DBUtility.ClsPub.Enum_BillStatus BillStatus;
-
+ public string sWhere = "";
private json objJsonResult = new json();
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
DataSet ds;
@@ -79,7 +81,7 @@
objJsonResult.data = null;
return objJsonResult;
}
- string sql1 = string.Format(@"select * from h_v_Gy_MaterialList where 缁勭粐鍚嶇О='" + Organization + "'");
+ string sql1 = string.Format(@"select top(500) * from h_v_Gy_MaterialList where 缁勭粐鍚嶇О='" + Organization + "'");
if (sWhere == null || sWhere.Equals(""))
{
ds = oCN.RunProcReturn(sql1 + sWhere + " order by 鐗╂枡浠g爜 desc", "h_v_Gy_MaterialList");
@@ -114,6 +116,58 @@
return objJsonResult;
}
}
+
+ #region 鐗╂枡鍒嗛〉鍒楄〃
+ [Route("Gy_Material/page")]
+ [HttpGet]
+ public object page(string sWhere, string user, string Organization,int page,int size)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Gy_MaterialList " + page + "," + size + ",'" + Organization +"'," + "''", "h_p_Gy_MaterialList");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Gy_MaterialList " + page + "," + size + ",'" + Organization + "','" + sWhere + "'", "h_p_Gy_MaterialList");
+ }
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.list = columnNameList;
+ 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;
+ }
+ }
+ #endregion
#region 鐗╂枡鏍规嵁鍒嗙被鑾峰彇鏈�澶х墿鏂欑紪鐮�
[Route("Gy_Material/getMaxNum")]
@@ -186,6 +240,155 @@
objJsonResult.code = "0";
objJsonResult.count = 0;
objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鑾峰彇鐗╂枡绮惧害閫氳繃id
+ [Route("Gy_Material/getDecByID")]
+ [HttpGet]
+ public object getDecByID(int HMaterID)
+ {
+ try
+ {
+ if(HMaterID == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁閫夋嫨鐗╂枡";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ ds = oCN.RunProcReturn(@"select HQtyDec,HPriceDec,HMoneyDec from Gy_Material where HitemID=" + HMaterID , "Gy_Material");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "娌℃湁鎵惧埌璇ョ墿鏂欑紪鐮�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Success";
+ 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;
+ }
+ }
+ #endregion
+
+ #region 鑾峰彇椤圭洰鍙�
+ [Route("Gy_Material/Get_HProject")]
+ [HttpGet]
+ public object Get_HProject()
+ {
+ try
+ {
+ DataSet oDs = new DataSet();
+ //==========
+ oDs = oCN.RunProcReturn("select top(20) HInterID as HItemID,HProName HName from PM_ProjectBillMain", "PM_ProjectBillMain");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇鎴愬姛锛�";
+ objJsonResult.data = oDs.Tables[0];
+ return objJsonResult; ;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ /// <summary>
+ /// 鑾峰彇椤圭洰鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ [Route("Gy_Material/GetProjectGroupList_Json")]
+ [HttpGet]
+ public object GetProjectGroupList_Json(string Unit)
+ {
+ if (Unit != "" && Unit != null)
+ {
+ sWhere = sWhere + " and ( HBillNo like '%" + Unit + "%' or HProName like '%" + Unit + "%' ) ";
+ }
+
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("Select HInterID,HBillNo 椤圭洰浠g爜,HProName 椤圭洰缁� from PM_ProjectBillMain where HCloseType = 0 Order by HInterID ", "PM_ProjectBillMain");
+ }
+ else
+ {
+ string sql1 = "Select HInterID,HBillNo 椤圭洰浠g爜,HProName 椤圭洰缁� from PM_ProjectBillMain where HCloseType = 0 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "PM_ProjectBillMain");
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇鎴愬姛!";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #region 鑾峰彇浜嬩笟閮�
+ [Route("Gy_Material/Get_Gy_Division")]
+ [HttpGet]
+ public object Get_Gy_Division(string HOrgID)
+ {
+ try
+ {
+ DataSet oDs = new DataSet();
+ //==========
+ oDs = oCN.RunProcReturn(" select HItemID,HName from Gy_Division", "Gy_Division");
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇鎴愬姛锛�";
+ objJsonResult.data = oDs.Tables[0];
+ return objJsonResult; ;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
@@ -455,6 +658,458 @@
}
}
+ #region 鐗╂枡 鏂囦欢瀵煎叆淇濆瓨
+ #region 鐗╂枡 鏂囦欢涓婁紶
+ [Route("Gy_Material/Gy_Material_Excel")]
+ [HttpPost]
+ public object Gy_Material_Excel()
+ {
+ try
+ {
+ //鑾峰彇鏂囦欢鍚嶇О
+ var file = HttpContext.Current.Request.Files[0];
+ //鑾峰彇鏂囦欢鐗╃悊璺緞
+ string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+ //淇濆瓨鏂囦欢
+ file.SaveAs(ExcelPath);
+
+ NpoiHelper np = new NpoiHelper();
+ DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+
+ //鍒犻櫎鏂囦欢
+ File.Delete(ExcelPath);
+
+ //鍒涘缓涓存椂琛�
+ DataTable tb2 = new DataTable("dt2");
+
+ //娣诲姞鍒楀悕
+ for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
+ {
+ tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString());
+ }
+
+ //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
+ tb2.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
+ tb2.Columns.Add("HMaterClsID", typeof(Int32));//鐗╂枡灞炴�D
+ tb2.Columns.Add("HUnitGroupID", typeof(Int32));//璁¢噺鍗曚綅缁処D
+ tb2.Columns.Add("HUnitID", typeof(Int32));//鍗曚綅ID
+ tb2.Columns.Add("HSecUnitID", typeof(Int32));//杈呭姪璁¢噺鍗曚綅ID
+ tb2.Columns.Add("HWhID", typeof(Int32));//榛樿浠撳簱ID
+ //娣诲姞鏁版嵁
+ for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
+ {
+ DataRow row = tb2.NewRow();
+ for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++)
+ {
+ row[j] = ExcelDs.Tables[0].Rows[i][j].ToString();
+ }
+ tb2.Rows.Add(row);
+ }
+
+
+ var error = "";
+
+ //鍒ゆ柇瀵煎叆鏂囦欢鍒楁槸鍚﹀畬鏁�
+ if (!tb2.Columns.Contains("缁勭粐浠g爜"))
+ error += "娌℃湁鎵惧埌銆愮粍缁囦唬鐮併�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("缁勭粐鍚嶇О"))
+ error += "娌℃湁鎵惧埌銆愮粍缁囧悕绉般�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("鐗╂枡鍚嶇О"))
+ error += "娌℃湁鎵惧埌銆愮墿鏂欏悕绉般�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("鐗╂枡浠g爜"))
+ 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 += "娌℃湁鎵惧埌銆愯閲忓崟浣嶇粍銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("璁¢噺鍗曚綅浠g爜"))
+ 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 += "娌℃湁鎵惧埌銆愭渶楂樺簱瀛樸�戠殑鏍囬,";
+
+ 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 += "娌℃湁鎵惧埌銆愭爣鍑嗘垚鏈�戠殑鏍囬,";
+
+ 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 (error.Length > 0)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = $"Excel妯℃澘瀛樺湪閿欒,{error}\r\n";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ for (int i = 0; i <= tb2.Rows.Count - 1; i++)
+ {
+ string HMaterName = "";
+ string HMaterNumber = "";
+ string HORGNumber = "";
+ string HORGName = "";
+ string HMaterClsName = "";
+ string HUnitGroupName = "";
+ string HUnitNumber = "";
+ string HUnitName = "";
+ string HSecUnitName = "";
+ string HWhName = "";
+
+ HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐浠g爜"].ToString());
+ HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐鍚嶇О"].ToString());
+ HMaterNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐗╂枡浠g爜"].ToString());
+ HMaterName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐗╂枡鍚嶇О"].ToString());
+ HMaterClsName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐗╂枡灞炴��"].ToString());
+ HUnitGroupName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["璁¢噺鍗曚綅缁�"].ToString());
+ HUnitNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["璁¢噺鍗曚綅浠g爜"].ToString());
+ HUnitName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["璁¢噺鍗曚綅"].ToString());
+ HSecUnitName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["杈呭姪璁¢噺鍗曚綅"].ToString());
+ HWhName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["榛樿浠撳簱"].ToString());
+ //妫�鏌ョ墿鏂�
+ int index = i + 1;
+
+ if (HORGNumber != "")
+ {
+
+ //鏌ヨ缁勭粐
+ ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,缁勭粐涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ //鏌ヨ灞炴��
+ if (HMaterClsName == "澶栬喘")
+ {
+ tb2.Rows[i]["HMaterClsID"] = 1;
+ }
+ else if(HMaterClsName == "鑷埗")
+ {
+ tb2.Rows[i]["HMaterClsID"] = 2;
+ }
+ else if (HMaterClsName == "濮斿")
+ {
+ tb2.Rows[i]["HMaterClsID"] = 3;
+ }
+ else
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,鐗╂枡灞炴�т笉瀛樺湪锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ //鏌ヨ璁¢噺鍗曚綅缁�
+ ds = oCN.RunProcReturn("select * from Gy_UnitGroup where HName='" + HUnitGroupName + "'", "Gy_UnitGroup");
+
+ if (ds.Tables[0].Rows.Count == 0 && HUnitGroupName != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + "璁¢噺鍗曚綅缁�:" + HUnitGroupName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (HMaterNumber == "")
+ {
+ tb2.Rows[i]["HUnitGroupID"] = 0;
+ }
+ else
+ {
+ tb2.Rows[i]["HUnitGroupID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ //鏌ヨ鍗曚綅
+ ds = oCN.RunProcReturn("select * from Gy_Unit where HNumber='" + HUnitNumber + "' and HUSEORGID=" + HORGid + "", "Gy_Unit");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍗曚綅:" + HUnitName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HUnitID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ //鏌ヨ杈呭姪鍗曚綅
+ ds = oCN.RunProcReturn("select * from Gy_Unit where HName='" + HSecUnitName + "' and HUSEORGID=" + HORGid + "", "Gy_Unit");
+
+ if (ds.Tables[0].Rows.Count == 0 && HSecUnitName != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍗曚綅:" + HSecUnitName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }else if (HSecUnitName == "")
+ {
+ tb2.Rows[i]["HSecUnitID"] = 0;
+ }
+ else
+ {
+ tb2.Rows[i]["HSecUnitID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ //鏌ヨ浠撳簱
+ 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();
+ }
+ //鐗╂枡鍚嶇О
+ if (HMaterName == "")
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,鐗╂枡鍚嶇О涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鐗╂枡浠g爜
+ if (HMaterNumber == "")
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,鐗╂枡缂栧彿涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,缁勭粐浠g爜涓虹┖";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = error;
+ objJsonResult.data = tb2;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鐗╂枡椤圭洰 瀵煎叆(淇濆瓨)
+ [Route("Gy_Material/Gy_Material_btnSave")]
+ [HttpPost]
+ public object Gy_Material_btnSave([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { "&鍜�" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string user = sArray[1].ToString();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_Material_Edit", 1, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2);
+ List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
+
+ foreach (JObject item in Excel)
+ {
+ Dictionary<string, string> dic = new Dictionary<string, string>();
+ foreach (var itm in item.Properties())
+ {
+ dic.Add(itm.Name, itm.Value.ToString());
+ }
+ list.Add(dic);
+ }
+
+ oCN.BeginTran();
+ int i = 1;
+ foreach (Dictionary<string, string> item in list)
+ {
+ DLL.ClsGy_Material_Ctl oBill = new DLL.ClsGy_Material_Ctl();
+ ClsGy_Material_Model oItem = new ClsGy_Material_Model();
+ //璧嬪�煎墠绔紶鍏ョ殑
+ oItem.HUSEORGID = int.Parse(item["HOrgID"].ToString());
+ oItem.HNumber = item["鐗╂枡浠g爜"].ToString();
+ oItem.HName = item["鐗╂枡鍚嶇О"].ToString();
+ oItem.HModel = item["瑙勬牸鍨嬪彿"].ToString();
+ oItem.HHelpCode = item["鍔╄鐮�"].ToString();
+ oItem.HVersion = item["鐗堟湰鍙�"].ToString();
+ oItem.HMaterClsID = int.Parse(item["HMaterClsID"].ToString());
+ oItem.HUnitGroupID = int.Parse(item["HUnitGroupID"].ToString());
+ oItem.HUnitID = int.Parse(item["HUnitID"].ToString());
+ oItem.HSecUnitID = int.Parse(item["HSecUnitID"].ToString());
+ oItem.HSecUnitRate = double.Parse(item["鎹㈢畻鐜�"].ToString()==""?"0": item["鎹㈢畻鐜�"].ToString());
+ oItem.HWhID = int.Parse(item["HWhID"].ToString());
+ oItem.HHighStock = int.Parse(item["鏈�楂樺簱瀛�"].ToString() == "" ? "0" : item["鏈�楂樺簱瀛�"].ToString());
+ oItem.HLowStock = int.Parse(item["鏈�浣庡簱瀛�"].ToString() == "" ? "0" : item["鏈�浣庡簱瀛�"].ToString());
+ oItem.HSafeStock = int.Parse(item["瀹夊叏搴撳瓨"].ToString() == "" ? "0" : item["瀹夊叏搴撳瓨"].ToString());
+ oItem.HOrderPrice = int.Parse(item["閲囪喘鍗曚环"].ToString() == "" ? "0" : item["閲囪喘鍗曚环"].ToString());
+ oItem.HSalePrice = int.Parse(item["閿�鍞崟浠�"].ToString() == "" ? "0" : item["閿�鍞崟浠�"].ToString());
+ oItem.HPlanPrice = int.Parse(item["璁″垝鍗曚环"].ToString() == "" ? "0" : item["璁″垝鍗曚环"].ToString());
+ oItem.HstdPrice = int.Parse(item["鏍囧噯鎴愭湰"].ToString() == "" ? "0" : item["鏍囧噯鎴愭湰"].ToString());
+ oItem.HKeepDays = int.Parse(item["淇濊川鏈�"].ToString() == "" ? "0" : item["淇濊川鏈�"].ToString());
+ oItem.HQtyMin = int.Parse(item["鏈�灏忚璐ч噺"].ToString() == "" ? "0" : item["鏈�灏忚璐ч噺"].ToString());
+ oItem.HQtyMin = int.Parse(item["鏈�澶ц璐ч噺"].ToString() == "" ? "0" : item["鏈�澶ц璐ч噺"].ToString());
+ oItem.HEngName = item["鑻辨枃鍚嶇О"].ToString();
+ oItem.HEngModel = item["鑻辨枃瑙勬牸"].ToString();
+ //甯歌璧嬪�艰祴绌哄�奸槻姝㈡姤閿�
+ oItem.HMaterTypeID = 0;
+ oItem.HColorRemark = "";
+ oItem.HColorNo = "";
+ oItem.HMaterRuleType = "";
+ string sShortNumber;
+ sShortNumber = DBUtility.ClsPub.GetShortNumber(oItem.HNumber.Trim());
+ if (sShortNumber.Trim() == "")
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+ oItem.HShortNumber = sShortNumber;//鐭唬鐮�
+ oItem.HEndFlag = true;//鏈骇鏍囧織
+ oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
+ oBill.oModel = oItem;
+ if (!DBUtility.ClsPub.AllowNumber(oItem.HNumber.Trim()))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn("select * from Gy_Material where HNumber='" + oItem.HNumber.Trim() + "'", "Gy_Material");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+
+ oBill.AddNew();
+ }
+ else
+ {
+
+ int HItemID = int.Parse(ds.Tables[0].Rows[0]["HItemID"].ToString());
+ oBill.oModel.HItemID = HItemID;
+ oBill.ModifyByID(oBill.oModel.HItemID);
+
+ }
+
+ i++;
+ }
+
+ oCN.Commit();
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "瀵煎叆鎴愬姛!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ LogService.Write(e);
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ #endregion
/// <summary>
/// 鐗╂枡璁剧疆鍒犻櫎鍔熻兘
/// </summary>
@@ -921,6 +1576,7 @@
{
try
{
+ List<object> columnNameList = new List<object>();
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
if (!DBUtility.ClsPub.Security_Log("Gy_BarCodeBill_Query", 1, false, user))
{
@@ -931,14 +1587,23 @@
return objJsonResult;
}
- string sql1 = "select top 5000 * from h_v_IF_BarCodeBillList where 1 = 1 ";
+ string sql1 = "select top 15000 * from h_v_IF_BarCodeBillList where 1 = 1 ";
string sql = sql1 + sWhere + " order by hmainid desc";
ds = oCN.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
+ {
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
+ }
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
@@ -1351,6 +2016,7 @@
long HSPID = mainList[0].HSPID;
Double HDesignLife = mainList[0].HDesignLife;
Double HUseLife = mainList[0].HUseLife;
+ Double HInitLife = mainList[0].HInitLife;//涓婄嚎鍒濆鍖栧鍛�
Double HLeaveLife = mainList[0].HLeaveLife;
Double HProdQty = mainList[0].HProdQty;
Double HProdWeight = mainList[0].HProdWeight;
@@ -1370,6 +2036,30 @@
string HMouldClass = mainList[0].HMouldClass;
int HNowWHID = mainList[0].HNowWHID;
int HNowSPID = mainList[0].HNowSPID;
+ string HMouldUseStatus = mainList[0].HMouldUseStatus;
+
+ //淇濆瓨鍓嶆帶鍒�=========================================
+ string HBillNote = "";
+ ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_BeforeSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_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_MouldFileMain " +
@@ -1382,7 +2072,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) " +
+ ",HMouldClass,HNowWHID,HNowSPID,HInitLife,HMouldUseStatus) " +
" values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
"," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
@@ -1392,7 +2082,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 + ") ");
+ ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "','" + HMouldUseStatus + "') ");
//瀛愯〃
oCN.RunProc("Insert into Gy_MouldFileSub " +
@@ -1404,6 +2094,29 @@
") ");
objJsonResult = AddBillSub(msg5,msg6,msg7,HInterID, HBillNo);
+
+ //淇濆瓨鍚庢帶鍒�=========================================
+ ds = oCN.RunProcReturn("Exec h_p_Gy_MouldFileMain_AfterSaveCtrl " + HInterID.ToString() + ", '" + HBillNo + "','" + HBillNote + "',1 ", "h_p_Gy_MouldFileMain_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;
+ }
+ //=========================================================
+
if (objJsonResult.code == "0")
{
@@ -1499,6 +2212,7 @@
long HSPID = mainList[0].HSPID;
Double HDesignLife = mainList[0].HDesignLife;
Double HUseLife = mainList[0].HUseLife;
+ Double HInitLife = mainList[0].HInitLife;
Double HLeaveLife = mainList[0].HLeaveLife;
Double HProdQty = mainList[0].HProdQty;
Double HProdWeight = mainList[0].HProdWeight;
@@ -1518,7 +2232,7 @@
string HMouldClass = mainList[0].HMouldClass;
int HNowWHID = mainList[0].HNowWHID;
int HNowSPID = mainList[0].HNowSPID;
-
+ string HMouldUseStatus = mainList[0].HMouldUseStatus;
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
oCN.BeginTran();
//涓昏〃
@@ -1574,7 +2288,9 @@
",HMadeSupID=" + HMadeSupID +
",HNowWHID=" + HNowWHID +
",HNowSPID=" + HNowSPID +
- " where HInterID=" + HInterID.ToString());
+ ",HInitLife='" + HInitLife +
+ "',HMouldUseStatus='" + HMouldUseStatus +
+ "' where HInterID=" + HInterID.ToString());
//淇敼瀛愰」鐩唬鐮�
//oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
@@ -2496,5 +3212,589 @@
}
#endregion
+ #region 鍣ㄥ叿妗f 鏂囦欢瀵煎叆淇濆瓨
+ #region 鍣ㄥ叿妗f 鏂囦欢涓婁紶
+ [Route("Gy_MouldFile/Gy_MouldFile_Excel")]
+ [HttpPost]
+ public object Gy_Mould_Excel()
+ {
+ try
+ {
+ //鑾峰彇鏂囦欢鍚嶇О
+ var file = HttpContext.Current.Request.Files[0];
+ //鑾峰彇鏂囦欢鐗╃悊璺緞
+ string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+ //淇濆瓨鏂囦欢
+ file.SaveAs(ExcelPath);
+
+ NpoiHelper np = new NpoiHelper();
+ DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+
+ //鍒犻櫎鏂囦欢
+ File.Delete(ExcelPath);
+
+ //鍒涘缓涓存椂琛�
+ DataTable tb2 = new DataTable("dt2");
+
+ //娣诲姞鍒楀悕
+ for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
+ {
+ tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString());
+ }
+
+ //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
+ tb2.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
+ tb2.Columns.Add("HMaterID", typeof(Int32));//鐗╂枡ID
+ tb2.Columns.Add("HMouldTypeID", typeof(Int32));//鍒嗙被ID
+ tb2.Columns.Add("HUnitID", typeof(Int32));//鍗曚綅ID
+ tb2.Columns.Add("HDeptID", typeof(Int32));//閮ㄩ棬ID
+ tb2.Columns.Add("HWHID", typeof(Int32));//浠撳簱ID
+ tb2.Columns.Add("HSupID", typeof(Int32));//渚涘簲鍟咺D
+ tb2.Columns.Add("HSPID", typeof(Int32));//浠撲綅ID
+ tb2.Columns.Add("HMadeSupID", typeof(Int32));//鍒堕�犲晢ID
+ //娣诲姞鏁版嵁
+ for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
+ {
+ DataRow row = tb2.NewRow();
+ for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++)
+ {
+ row[j] = ExcelDs.Tables[0].Rows[i][j].ToString();
+ }
+ tb2.Rows.Add(row);
+ }
+
+
+ var error = "";
+
+ //鍒ゆ柇瀵煎叆鏂囦欢鍒楁槸鍚﹀畬鏁�
+ if (!tb2.Columns.Contains("缁勭粐浠g爜"))
+ 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 += "娌℃湁鎵惧埌銆愬櫒鍏疯鏍笺�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("鍣ㄥ叿鍨嬪彿"))
+ error += "娌℃湁鎵惧埌銆愬櫒鍏峰瀷鍙枫�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("绌存暟"))
+ error += "娌℃湁鎵惧埌銆愮┐鏁般�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("杈呭姪灞炴��1"))
+ error += "娌℃湁鎵惧埌銆愯緟鍔╁睘鎬�1銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("杈呭姪灞炴��2"))
+ error += "娌℃湁鎵惧埌銆愯緟鍔╁睘鎬�2銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("鍥惧彿"))
+ error += "娌℃湁鎵惧埌銆愬浘鍙枫�戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("瀵瑰簲ERP鐗╂枡浠g爜"))
+ error += "娌℃湁鎵惧埌銆愬搴擡RP鐗╂枡浠g爜銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("瀵瑰簲ERP鐗╂枡"))
+ error += "娌℃湁鎵惧埌銆愬搴擡RP鐗╂枡銆戠殑鏍囬,";
+
+ 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 += "娌℃湁鎵惧埌銆愰粯璁や粨浣嶃�戠殑鏍囬,";
+
+ 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 += "娌℃湁鎵惧埌銆愪緵搴斿晢浠g爜銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("渚涘簲鍟�"))
+ error += "娌℃湁鎵惧埌銆愪緵搴斿晢銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("鍒堕�犲晢"))
+ error += "娌℃湁鎵惧埌銆愬埗閫犲晢銆戠殑鏍囬,";
+
+ if (!tb2.Columns.Contains("澶囨敞"))
+ error += "娌℃湁鎵惧埌銆愬娉ㄣ�戠殑鏍囬,";
+
+
+ if (error.Length > 0)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = $"Excel妯℃澘瀛樺湪閿欒,{error}\r\n";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ for (int i = 0; i <= tb2.Rows.Count - 1; i++)
+ {
+ string HMouldName = "";
+ string HMouldNum = "";
+ string HORGNumber = "";
+ string HORGName = "";
+ string HMaterNumber = "";
+ string HMaterName = "";
+ string HUnitName = "";
+ string HDeptName = "";
+ string HWHName = "";
+ string HSPName = "";
+ string HSupName = "";
+ string HSupNumber = "";
+ string HMadeSupName = "";
+ string HMouldTypeName = "";
+
+ HMouldName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鍣ㄥ叿鍚嶇О"].ToString());
+ HMouldNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鍣ㄥ叿缂栧彿"].ToString());
+ HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐浠g爜"].ToString());
+ HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐鍚嶇О"].ToString());
+ HMaterNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["瀵瑰簲ERP鐗╂枡浠g爜"].ToString());
+ HMaterName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["瀵瑰簲ERP鐗╂枡"].ToString());
+ HUnitName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["璁¢噺鍗曚綅"].ToString());
+ HDeptName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["浣跨敤閮ㄩ棬"].ToString());
+ HWHName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["榛樿浠撳簱"].ToString());
+ HSPName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["榛樿浠撲綅"].ToString());
+ HSupName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["渚涘簲鍟�"].ToString());
+ HSupNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["渚涘簲鍟嗕唬鐮�"].ToString());
+ HMadeSupName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鍒堕�犲晢"].ToString());
+ HMouldTypeName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鍣ㄥ叿鍒嗙被"].ToString());
+ //妫�鏌ョ墿鏂�
+ int index = i + 1;
+
+ if (HORGNumber != "")
+ {
+
+ //鏌ヨ缁勭粐
+ ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,缁勭粐涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ //鏌ヨ鍒嗙被
+ ds = oCN.RunProcReturn("select * from Gy_MouldType where HName='" + HMouldTypeName + "' ", "Gy_MouldType");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,鍒嗙被:" + HMouldTypeName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HMouldTypeID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ //鏌ヨ鐗╂枡
+ ds = oCN.RunProcReturn("select * from Gy_Material where HNumber='" + HMaterNumber + "' and HUSEORGID=" + HORGid + "", "Gy_Department");
+
+ if (ds.Tables[0].Rows.Count == 0 && HMaterNumber != "")
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鐗╂枡:" + HMaterName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else if (HMaterNumber == "")
+ {
+ tb2.Rows[i]["HMaterID"] = 0;
+ }
+ else
+ {
+ tb2.Rows[i]["HMaterID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ //鏌ヨ鍗曚綅
+ ds = oCN.RunProcReturn("select * from Gy_Unit where HName='" + HUnitName + "' and HUSEORGID=" + HORGid + "", "Gy_Unit");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,鍗曚綅:" + HUnitName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ tb2.Rows[i]["HUnitID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+ }
+ //鏌ヨ閮ㄩ棬
+ ds = oCN.RunProcReturn("select * from Gy_Department where HName='" + HDeptName + "' and HUSEORGID=" + HORGid + "", "Gy_Department");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,閮ㄩ棬:" + HDeptName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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 (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 + "缁勭粐,浠撲綅:" + HSPName + ",涓嶅瓨鍦紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ 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 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 == "")
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,鍣ㄥ叿妗f鍚嶇О涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ //鍣ㄥ叿妗f浠g爜
+ if (HMouldNum == "")
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,鍣ㄥ叿妗f浠g爜涓嶈兘涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "绗�" + index + "琛�,缁勭粐浠g爜涓虹┖";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = error;
+ objJsonResult.data = tb2;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鍣ㄥ叿妗f椤圭洰 瀵煎叆(淇濆瓨)
+ [Route("Gy_MouldFile/Gy_MouldFile_btnSave")]
+ [HttpPost]
+ public object Gy_Mould_btnSave([FromBody] JObject sMainSub)
+ {
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { "&鍜�" }, StringSplitOptions.RemoveEmptyEntries);
+ string msg2 = sArray[0].ToString();
+ string user = sArray[1].ToString();
+ try
+ {
+ if (!DBUtility.ClsPub.Security_Log("Gy_MouldFile_Edit", 1, false, user))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2);
+ List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
+
+ foreach (JObject item in Excel)
+ {
+ Dictionary<string, string> dic = new Dictionary<string, string>();
+ foreach (var itm in item.Properties())
+ {
+ dic.Add(itm.Name, itm.Value.ToString());
+ }
+ list.Add(dic);
+ }
+
+ oCN.BeginTran();
+ int i = 1;
+ foreach (Dictionary<string, string> item in list)
+ {
+ string HOrgID = item["HOrgID"].ToString();//缁勭粐ID
+ string BillType = "3899";
+ //寰楀埌mainid
+ long HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
+ string HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); ;//閫掑叆type寰楀埌鐨勫崟鎹彿
+ DateTime HDate = DateTime.Now;//鏃ユ湡
+ int HYear = DBUtility.ClsPub.isInt(DateTime.Now.Year);
+ double HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
+ string HMouldNo = item["鍣ㄥ叿缂栧彿"].ToString();
+ string HBarCode = item["鏉″舰鐮�"].ToString();
+ string HName = item["鍣ㄥ叿鍚嶇О"].ToString();
+ string HModel = item["鍣ㄥ叿瑙勬牸"].ToString();
+ string HModel2 = item["鍣ㄥ叿鍨嬪彿"].ToString();
+ string HDiameter = "";//鐩村緞
+ string HSubjoin = item["杈呭姪灞炴��1"].ToString();
+ string HSubjoin2 = item["杈呭姪灞炴��2"].ToString();
+ string HPICNo = item["鍥惧彿"].ToString();
+ string HWorkMaterModel = "";//鐢熶骇浜у搧鍨嬪彿
+ long HMaterID = int.Parse(item["HMaterID"].ToString());
+ long HMouleTypeID = int.Parse(item["HMouldTypeID"].ToString());
+ 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());
+ string HMouldStatus = item["鐘舵��"].ToString();
+ long HWHID = int.Parse(item["HWHID"].ToString());
+ long HRoutingID = 0;//宸ヨ壓璺嚎id
+ long HBOMID = 0;
+ string HVersion = "";//鐗堟湰
+ long HSPGroupID = 0;//榛樿浠撲綅缁�
+ long HSPID = int.Parse(item["HSPID"].ToString());//浠撲綅id
+ Double HDesignLife = item["璁捐瀵垮懡"].ToString()=="" ? 0: double.Parse(item["璁捐瀵垮懡"].ToString());
+ Double HUseLife = item["浣跨敤瀵垮懡"].ToString() == "" ? 0 : double.Parse(item["浣跨敤瀵垮懡"].ToString());
+ Double HInitLife = 0;//涓婄嚎鍒濆鍖栧鍛�
+ Double HLeaveLife = 0;//鍓╀綑瀵垮懡
+ Double HProdQty = 0;//宸茬敓浜ф暟閲�
+ Double HProdWeight = 0;//宸茬敓浜ч噸閲�
+ string HRemark = item["澶囨敞"].ToString();
+ string HMaker = user;
+ string HMaterNumber = item["瀵瑰簲ERP鐗╂枡浠g爜"].ToString();
+ string HSupNumber = item["渚涘簲鍟嗕唬鐮�"].ToString();
+ long HPrintQty = 0;//宸茬敓浜ф暟閲�
+ string HMouldOWNER = "鑷垂";//璐т富绫诲瀷
+ string HSaveLife = "";//瀹夊叏瀵垮懡
+ int HCaveQty = item["绌存暟"].ToString() == "" ? 0 : int.Parse(item["绌存暟"].ToString());
+ int HMouldDotCheckRuleInterID = 0;
+ int HMouldMaintainRuleInterID = 0;
+ int HNowSupID = 0;//铏氭嫙浠�
+ int HNowSupTypeID = 0;
+ int HMadeSupID = 0;
+ string HMouldClass = "妯″叿";//鍣ㄥ叿绫诲瀷
+ int HNowWHID = 0;
+ int HNowSPID = 0;
+
+
+ if (!DBUtility.ClsPub.AllowNumber(HMouldNo.Trim()))
+ {
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+ objJsonResult.data = 1;
+ return objJsonResult;
+ }
+
+ ds = oCN.RunProcReturn("select * from Gy_MouldFileMain where HMouldNo='" + HMouldNo + "'", "Gy_MouldFileMain");
+
+ if (ds.Tables[0].Rows.Count == 0)
+ {
+
+ oCN.RunProc("Insert Into Gy_MouldFileMain " +
+ "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
+ ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
+ ",HMouldNo,HName,HModel,HModel2,HDiameter" +
+ ",HSubjoin,HSubjoin2,HPICNo,HWorkMaterModel" +
+ ",HMaterID,HMaterNumber,HMouldType,HUnitID" +
+ ",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,HMadeSupID" +
+ ",HMouldClass,HNowWHID,HNowSPID,HInitLife) " +
+ " values('" + BillType + "','" + BillType + "'," + HInterID + ",'" + HBillNo + "','" + HDate + "'" +
+ "," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
+ ",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
+ ",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
+ "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
+ ",'" + 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 + "'," + HMadeSupID +
+ ",'" + HMouldClass + "'," + HNowWHID + "," + HNowSPID + ",'" + HInitLife + "') ");
+ }
+ else
+ {
+ oCN.RunProc("UpDate Gy_MouldFileMain set " +
+ //" HBillNo='" + HBillNo + "'" + //鍥哄畾璧嬪��===============
+ //",HDate='" + HDate + "'" +
+ //",HYear='" + HYear.ToString() + "'" +
+ //",HPeriod='" + HPeriod.ToString() + "'" +
+ "HRemark='" + HRemark + "'" +
+ ",HUpDater='" + user + "'" +
+ ",HUpDateDate=getdate()" +
+ //========================================
+ //",HMouldNo='" + HMouldNo + "'" +
+ ",HName='" + HName + "'" +
+ ",HModel='" + HModel + "'" +
+ ",HModel2='" + HModel2 + "'" +
+ ",HDiameter='" + HDiameter + "'" +
+ ",HSubjoin='" + HSubjoin + "'" +
+ ",HSubjoin2='" + HSubjoin2 + "'" +
+ ",HPICNo='" + HPICNo + "'" +
+ ",HWorkMaterModel='" + HWorkMaterModel + "'" +
+ ",HMaterID=" + HMaterID.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 +
+ "' where HMouldNo='" + HMouldNo.ToString()+"'");
+ }
+
+ i++;
+ }
+
+ oCN.Commit();
+
+ objJsonResult.code = CodeConstant.SUCCEED;
+ objJsonResult.count = CountConstant.SUCCEED;
+ objJsonResult.Message = "瀵煎叆鎴愬姛!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ LogService.Write(e);
+ objJsonResult.code = CodeConstant.FAIL;
+ objJsonResult.count = CountConstant.FAIL;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+ #endregion
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1