From 20cad24a52eed56cf3c790112496f2df27255656 Mon Sep 17 00:00:00 2001
From: yxj <yxj@hz-kingdee.com>
Date: 星期二, 07 十一月 2023 19:01:05 +0800
Subject: [PATCH] 新增销售出库扫码模块相关调用方法;条码生成模块,选源单增加返回生产日期有效期至等
---
WebAPI/Controllers/WebAPIController.cs | 553 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 534 insertions(+), 19 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index 98b0bd7..4e05ac2 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -342,6 +342,122 @@
}
+ #region 鐢ㄦ埛璁剧疆
+ #region 鑾峰彇鐢ㄦ埛淇℃伅
+ [Route("Gy_USERSet_PDA/GetGy_Czygl_Info")]
+ [HttpGet]
+ public object GetGy_Czygl_Info(string Czybm, string user)
+ {
+ try
+ {
+ //鏌ョ湅鏉冮檺
+ //if (!DBUtility.ClsPub.Security_Log("Gy_ProjectStage_Query", 1, false, user))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ string sql = @"select Czybm, Czymc, HWhID, HWhName, HSecManagerID, HSecManager, HKeeperID, HKeeper, HDeptID, HDept, HCloudUserName, HCloudUserPsd from Gy_Czygl where Czybm = '" + Czybm + "'";
+ ds = oCN.RunProcReturn(sql, "Gy_Czygl");
+
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏈壘鍒扮浉鍏虫暟鎹紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ 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;
+ }
+ }
+ #endregion
+ #region 淇濆瓨鐢ㄦ埛淇℃伅
+ [Route("Gy_USERSet_PDA/SaveGy_Czygl_Info")]
+ [HttpPost]
+ public object SaveGy_Czygl_Info([FromBody] JObject sMainSub)
+ {
+ try
+ {
+ //鑾峰彇鍙傛暟
+ var _value = sMainSub["sMainSub"].ToString();
+ string msg1 = _value.ToString();
+ string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+
+ Int64 HWhID = Int64.Parse(sArray[0].ToString());
+ string HWhName = sArray[1].ToString();
+ Int64 HSecManagerID = Int64.Parse(sArray[2].ToString());
+ string HSecManager = sArray[3].ToString();
+ Int64 HKeeperID = Int64.Parse(sArray[4].ToString());
+ string HKeeper = sArray[5].ToString();
+ Int64 HDeptID = Int64.Parse(sArray[6].ToString());
+ string HDept = sArray[7].ToString();
+ string HCloudUserName = sArray[8].ToString().Trim();
+ string HCloudUserPsd = sArray[9].ToString().Trim();
+
+ string Czybm = sArray[10].ToString();
+ string user = sArray[11].ToString(); //鎿嶄綔鐢ㄦ埛鐨勭敤鎴峰悕
+
+ ////鍒ゆ柇鏄惁鏈夋柊澧炴潈闄�
+ //if (!DBUtility.ClsPub.Security_Log("Sc_ICMOBillQualityStatus_Tmp_Edit", 1, false, user))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犳柊澧炴潈闄�!";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ string sql = "update Gy_Czygl set " +
+ "HWhID = " + HWhID +
+ ", HWhName = '" + HWhName +
+ "', HSecManagerID = " + HSecManagerID +
+ ", HSecManager = '" + HSecManager +
+ "', HKeeperID = " + HKeeperID +
+ ", HKeeper = '" + HKeeper +
+ "', HDeptID = " + HDeptID +
+ ", HDept = '" + HDept +
+ "', HCloudUserName = '" + HCloudUserName +
+ "', HCloudUserPsd = '" + HCloudUserPsd +
+ "' where Czybm = '" + Czybm + "'";
+
+ oCN.RunProc(sql);
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ 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
+ #endregion
+
+
//鎾ら攢缂撳瓨鍒楄〃璁板綍
[Route("Web/Rescind_Json")]
@@ -1692,7 +1808,7 @@
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- ds = oCN.RunProcReturn("Select p.HItemID,p.HNumber 宸ュ簭浠g爜,p.HName 宸ュ簭,w.HItemID 宸ヤ綔涓績ID,w.HNumber 宸ヤ綔涓績浠g爜,w.HName 宸ヤ綔涓績,d.HItemID 閮ㄩ棬ID,d.HNumber 閮ㄩ棬浠g爜,d.HName 閮ㄩ棬 from Gy_Process p left join Gy_WorkCenter w on p.HWorkCenterID = w.HItemID left join Gy_Department d on p.HDeptID = d.HItemID where p.HStopflag = 0 " + sWhere + " Order by HItemID ", "Gy_Process");
+ ds = oCN.RunProcReturn("Select p.HItemID,p.HNumber 宸ュ簭浠g爜,p.HName 宸ュ簭,w.HItemID 宸ヤ綔涓績ID,w.HNumber 宸ヤ綔涓績浠g爜,w.HName 宸ヤ綔涓績,d.HItemID 閮ㄩ棬ID,d.HNumber 閮ㄩ棬浠g爜,d.HName 閮ㄩ棬 from Gy_Process p left join Gy_WorkCenter w on p.HWorkCenterID = w.HItemID left join Gy_Department d on p.HDeptID = d.HItemID where p.HStopflag = 0 " + sWhere + " Order by p.HNumber ", "Gy_Process");
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
objjson.code = "0";
@@ -2663,7 +2779,7 @@
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- string sql = "Select a.HItemID ,HNumber 鏍哥畻鏂瑰紡缁勪唬鐮�,HName 鏍哥畻鏂瑰紡缁勫悕绉�,HDeptID,b.閮ㄩ棬鍚嶇О 閮ㄩ棬 from Gy_ClassTimePrjGroup a left join h_v_Gy_Department b on a.HDeptID=b.HItemID";
+ string sql = "Select a.HItemID ,HNumber 鏍哥畻鏂瑰紡缁勪唬鐮�,HName 鏍哥畻鏂瑰紡缁勫悕绉�,HDeptID,b.閮ㄩ棬浠g爜,b.閮ㄩ棬鍚嶇О 閮ㄩ棬 from Gy_ClassTimePrjGroup a left join h_v_Gy_Department b on a.HDeptID=b.HItemID";
if (sWhere == null || sWhere.Equals(""))
{
ds = oCN.RunProcReturn(sql, "Gy_ClassTimePrjGroup");
@@ -3232,6 +3348,59 @@
}
/// <summary>
+ /// 鑾峰彇褰撳墠鐢熶骇璧勬簮涓嬪凡缁忓紑宸ョ殑鐢熶骇浠诲姟鍗曞垪琛�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetSc_ICMOBillListView3")]
+ [HttpGet]
+ public object GetSc_ICMOBillListView3(string ICMOBill, int OrganizationID,int HSourceID)
+ {
+ if (ICMOBill != "")
+ {
+ sWhere = " where 1=1 and (鍗曟嵁鍙� like '%" + ICMOBill + "%' or 浜у搧浠g爜 like '%" + ICMOBill + "%' or 浜у搧鍚嶇О like '%" + ICMOBill + "%' or 瑙勬牸鍨嬪彿 like '%" + ICMOBill + "%' )";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_IF_ICMOBillList where 1=1 and isnull(瀹℃牳浜�,'')<>'' and isnull(鍏抽棴浜�,'')='' and isnull(琛屽叧闂汉,'')='' and 鐘舵�� = '寮�宸�' and HSourceID_b = " + HSourceID + " order by 鍗曟嵁鍙�,hsubid ", "h_v_IF_ICMOBillList");
+ }
+ else
+ {
+ string sql = "select * from h_v_IF_ICMOBillList " + sWhere + " and isnull(瀹℃牳浜�,'')<>'' and isnull(鍏抽棴浜�,'')='' and isnull(琛屽叧闂汉,'')='' " +
+ "and 鐘舵�� = '寮�宸�' and HSourceID_b = " + HSourceID + " order by 鍗曟嵁鍙�,hsubid ";
+ ds = oCN.RunProcReturn(sql, "h_v_IF_ICMOBillList");
+ }
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "0";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
/// 鑾峰彇宸ュ簭娴佽浆鍗″垪琛�
/// </summary>
/// <returns></returns>
@@ -3379,12 +3548,180 @@
}
/// <summary>
+ /// 鑾峰彇鎶芥牱鏂规鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetGy_SampleScheme")]
+ [HttpGet]
+ public object GetSampleScheme(string SampleScheme, int OrganizationID)
+ {
+ if (SampleScheme != "")
+ {
+ sWhere = " and ( 鎶芥牱鏂规浠g爜 like '%" + SampleScheme + "%' or 鎶芥牱鏂规鍚嶇О like '%" + SampleScheme + "%' ) ";
+ }
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = "Select * from h_v_Gy_GetSampleSchemeListView where 1 = 1 " + sWhere + "Order by hmainid ";
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_GetSampleSchemeListView");
+
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ",娌℃湁鏌ヨ鍒版暟鎹�";
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇妫�楠屽�煎垪琛�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetGy_InspectValue")]
+ [HttpGet]
+ public object GetInspectValue(string InspectValue, int OrganizationID)
+ {
+ if (InspectValue != "")
+ {
+ sWhere = " and ( 妫�楠屽�间唬鐮� like '%" + InspectValue + "%' or 妫�楠屽�煎悕绉� like '%" + InspectValue + "%' ) ";
+ }
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = "Select * from h_v_Gy_GetInspectValueList where 1 = 1 " + sWhere + "Order by hmainid ";
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_GetInspectValueList");
+
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ",娌℃湁鏌ヨ鍒版暟鎹�";
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇妫�浠櫒鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetGy_InspectInstruMent")]
+ [HttpGet]
+ public object GetGy_InspectInstruMent(string InspectInstruMent, int OrganizationID)
+ {
+ if (InspectInstruMent != "")
+ {
+ sWhere = " and ( 妫�楠屼华鍣ㄤ唬鐮� like '%" + InspectInstruMent + "%' or 妫�楠屼华鍣ㄥ悕绉� like '%" + InspectInstruMent + "%' ) ";
+ }
+ try
+ {
+ List<object> columnNameList = new List<object>();
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = "Select * from h_v_Gy_InspectInstruMent where 1 = 1 " + sWhere + "Order by HItemID ";
+ ds = oCN.RunProcReturn(sql, "h_v_Gy_InspectInstruMent");
+
+ //娣诲姞鍒楀悕
+ 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鍒楀璞$殑鍒楀悕
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ",娌℃湁鏌ヨ鍒版暟鎹�";
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "1";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ objjson.list = columnNameList;
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
/// 鏍规嵁妫�楠屾柟妗堜富鍐呯爜鑾峰彇妫�楠岄」鐩�
/// </summary>
/// <returns></returns>
[Route("Web/GetCheckItemByCheckProjectID")]
[HttpGet]
- public object GetCheckItemByCheckProjectID(int CheckProjectID)
+ public object GetCheckItemByCheckProjectID(int CheckProjectID,int HBatchQty)
{
if (CheckProjectID <= 0)
{
@@ -3397,8 +3734,8 @@
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- string sql = "select c.HItemID HQCCheckItemID,c.HName 妫�楠岄」鐩�,b.HQCStd,b.HQCUnit HUnit from Gy_QCCheckProjectMain a left join Gy_QCCheckProjectSub b on a.HInterID = b.HInterID left join Gy_QCCheckItem c on b.HQCCheckItemID = c.HItemID where a.HInterID = " + CheckProjectID;
- ds = oCN.RunProcReturn(sql, "Gy_QCCheckProjectMain");
+ string sql = "exec h_p_Gy_GetQCCheckItemByProject " + CheckProjectID + "," + HBatchQty;
+ ds = oCN.RunProcReturn(sql, "h_p_Gy_GetQCCheckItemByProject");
if (ds == null || ds.Tables[0].Rows.Count <= 0)
{
objjson.code = "0";
@@ -3927,17 +4264,17 @@
[Route("Web/MenuList")]
[HttpGet]
- public object MenuList(string HMakeName)
+ public object MenuList(string HMakeName, string HType)
{
try
{
List<MenuLoad> mu = new List<MenuLoad>(); //浠ョ埗瀛愮骇缁撴瀯瀛樻斁鑿滃崟娓呭崟淇℃伅
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN(); //鏁版嵁搴撴搷浣滃伐鍏�
- string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' order by HItemID";
+ string sql = "select HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HPicNum from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HType + "' order by HPosition";
ds = oCn.RunProcReturn(sql, "Gy_MenuDefineSet"); //鏌ヨ褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鑿滃崟鏁版嵁
if (ds.Tables[0]==null || ds.Tables[0].Rows.Count == 0) //鍒ゆ柇褰撳墠鐢ㄦ埛鏄惁鏈夎缃繃鑷畾涔変俊鎭紝鑻ヨ褰曟暟涓�0锛屽垯娌℃湁璁剧疆杩囷紝鍔犺浇鎵�鏈夌殑鑿滃崟淇℃伅
{
- sql = "Select * from Gy_Menu_1 Order by HItemID ";
+ sql = "Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HPosition ";
ds = oCn.RunProcReturn(sql, "Gy_Menu");
}
@@ -4052,7 +4389,7 @@
//鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
[Route("Web/MenuDefineSet")]
[HttpGet]
- public object MenuDefineSet(string HMakeName)
+ public object MenuDefineSet(string HMakeName, string HType)
{
try
{
@@ -4060,7 +4397,7 @@
List<MenuInit> menuInitList = new List<MenuInit>(); //鐢ㄤ互鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝浠ュ強瀵瑰簲鑺傜偣鏄惁琚�変腑闇�瑕佸姞杞芥樉绀�
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
- ds = oCn.RunProcReturn("Select * from Gy_Menu_1 Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁
+ ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where HType = '" +HType + "' Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁
DataSet ds1 = new DataSet();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //灏咷y_Menu_1涓殑鑿滃崟淇℃伅鍙婇�変腑鎯呭喌淇濆瓨鍒癿enuInitList鍒楄〃涓紝
@@ -4149,6 +4486,7 @@
string[] sArray = msg.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
string HMakeName = sArray[1].ToString();
string saveData = sArray[0].ToString();
+ string HTypes = sArray[2].ToString();
List<SaveDefineMenu> saveDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SaveDefineMenu>>(saveData);
//澹版槑鏁版嵁搴撴搷浣滃伐鍏�
@@ -4158,7 +4496,7 @@
oCN.BeginTran();
//鍒犻櫎褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鏁版嵁
- string sql = "delete from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "'";
+ string sql = "delete from Gy_MenuDefineSet where HMakeName = '" + HMakeName + "' and HType = '" + HTypes + "'";
oCN.RunProc(sql);
//鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹�
@@ -4173,9 +4511,20 @@
int HLevel = int.Parse(ds.Tables[0].Rows[0]["HLevel"].ToString());
string Hurl = ds.Tables[0].Rows[0]["Hurl"].ToString();
string HType = ds.Tables[0].Rows[0]["HType"].ToString();
+ string HPicNum = ds.Tables[0].Rows[0]["HPicNum"].ToString();
- sql = "insert into Gy_MenuDefineSet values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "')";
- oCN.RunProc(sql);
+ if(HPartentID == "0" || HPartentID == ds.Tables[0].Rows[0]["HItemID"].ToString())
+ {
+ string HPosition = ds.Tables[0].Rows[0]["HPosition"].ToString();
+ sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','" + HPosition + "')";
+ oCN.RunProc(sql);
+ }
+ else
+ {
+ sql = "insert into Gy_MenuDefineSet(HItemID,HPartentID,HNumber,HName,HLevel,Hurl,HType,HMakeName,HPicNum,HPosition) values('" + saveDataList[i].HItemID + "','" + HPartentID + "','" + HNumber + "','" + saveDataList[i].HName + "'," + HLevel + ",'" + Hurl + "','" + HType + "','" + HMakeName + "','" + HPicNum + "','z')";
+ oCN.RunProc(sql);
+ }
+
}
}
//鎻愪氦鏁版嵁搴撴搷浣�
@@ -4211,7 +4560,7 @@
//蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
[Route("Web/Xt_UserFastMenu_Display")]
[HttpGet]
- public object Xt_UserFastMenu_Display(string HMakeName)
+ public object Xt_UserFastMenu_Display(string HMakeName, string HType)
{
try
{
@@ -4219,7 +4568,7 @@
List<MenuInit> menuInitList = new List<MenuInit>(); //鐢ㄤ互鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝浠ュ強瀵瑰簲鑺傜偣鏄惁琚�変腑闇�瑕佸姞杞芥樉绀�
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
- ds = oCn.RunProcReturn("Select * from Gy_Menu_1 Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁
+ ds = oCn.RunProcReturn("Select * from Gy_Menu_1 where HType = '" + HType + "' Order by HItemID ", "Gy_Menu"); //鑾峰彇Gy_Menu_1涓殑鎵�鏈夎彍鍗曚俊鎭紝鐢ㄤ簬涓簃enuInitList鍒楄〃鍏呭疄鏁版嵁
DataSet ds1 = new DataSet();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //灏咷y_Menu_1涓殑鑿滃崟淇℃伅鍙婇�変腑鎯呭喌淇濆瓨鍒癿enuInitList鍒楄〃涓紝
@@ -4303,6 +4652,7 @@
string[] sArray = msg.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
string HMakeName = sArray[1].ToString();
string saveData = sArray[0].ToString();
+ string HTypes = sArray[2].ToString();
List<SaveDefineMenu> saveDataList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<SaveDefineMenu>>(saveData);
//澹版槑鏁版嵁搴撴搷浣滃伐鍏�
@@ -4312,7 +4662,7 @@
oCN.BeginTran();
//鍒犻櫎褰撳墠鐢ㄦ埛鐨勮嚜瀹氫箟鏁版嵁
- string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "'";
+ string sql = "delete from Xt_UserFastMenu where HUserID = '" + HMakeName + "' and HType = '" + HTypes + "'";
oCN.RunProc(sql);
//鎻掑叆褰撳墠鐢ㄦ埛鏈�鏂扮殑鑷畾涔夋暟鎹�
@@ -4329,8 +4679,9 @@
string HUserID = HMakeName;
string HSubFuncID = ds.Tables[0].Rows[0]["HItemID"].ToString();
string HCaption = ds.Tables[0].Rows[0]["HName"].ToString();
+ string HType = ds.Tables[0].Rows[0]["HType"].ToString();
- sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "')";
+ sql = "insert into Xt_UserFastMenu(HUserID,HSubFuncID,HCaption,HType) values('" + HUserID + "','" + HSubFuncID + "','" + HCaption + "','" + HType + "')";
oCN.RunProc(sql);
}
}
@@ -4360,12 +4711,68 @@
//蹇嵎鏂瑰紡鑷畾涔夎彍鍗曪細鑾峰彇鏍戠粍浠舵暟鎹�
[Route("Web/Xt_UserFastMenu_Init")]
[HttpGet]
- public object Xt_UserFastMenu_Init(string HMakeName)
+ public object Xt_UserFastMenu_Init(string HMakeName, string HType)
{
try
{
SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
- string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = '" + HMakeName + "' Order by a.HItemID";
+ string sql = "select a.HSubFuncID, a.HCaption,a.HPicNum,b.Hurl from Xt_UserFastMenu as a join Gy_Menu_1 as b on a.HSubFuncID = b.HItemID where a.HUserID = '" + HMakeName + "' and b.HType = '" + HType + "' Order by a.HItemID";
+ ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇
+
+ 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 = "鏌ヨ澶辫触锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 淇濆瓨蹇嵎鏂瑰紡鐨勫浘鏍�
+ [Route("Web/Xt_UserFastMenu_IconSave")]
+ [HttpGet]
+ public object Xt_UserFastMenu_IconSave(string Icon, string HItemID, string HMakeName)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ string sql = "update Xt_UserFastMenu set HPicNum = '" + Icon + "' where HSubFuncID='" + HItemID + "' and HUserID = '" + HMakeName + "'";
+ oCN.RunProc(sql); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鏌ヨ鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ澶辫触锛�";
+ objJsonResult.data = e.ToString();
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 鑾峰彇蹇嵎鏂瑰紡鐨勫浘鏍�
+ [Route("Web/Xt_UserFastMenu_IconGet")]
+ [HttpGet]
+ public object Xt_UserFastMenu_IconGet(string HItemID, string HMakeName)
+ {
+ try
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ string sql = "select HPicNum from Xt_UserFastMenu where HSubFuncID='" + HItemID + "' and HUserID = '" + HMakeName + "'";
ds = oCn.RunProcReturn(sql, "Xt_UserFastMenu"); //鑾峰彇Xt_UserFastMenu涓鐢ㄦ埛璁剧疆鐨勮嚜瀹氫箟鑿滃崟淇℃伅锛岀敤浜庡湪鍓嶇鍔犺浇
objJsonResult.code = "1";
@@ -4633,6 +5040,114 @@
return objJsonResult;
}
+ /// <summary>
+ /// 鑾峰彇杩愯緭鍏徃鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetConveyCompList_Json")]
+ [HttpGet]
+ public object GetConveyCompList_Json(string ConveyComp)
+ {
+ if (ConveyComp != "")
+ {
+ sWhere = sWhere + " and ( HNumber like '%" + ConveyComp + "%' or HName like '%" + ConveyComp + "%' ) ";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_ConveyComp where HStopflag=0 Order by HItemID ", "Gy_ConveyComp");
+ }
+ else
+ {
+ string sql1 = "Select HItemID,HNumber ,HName from Gy_ConveyComp where HStopflag=0 and HEndFlag=1 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "Gy_ConveyComp");
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "0";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
+ /// 鑾峰彇杩愯緭鏂瑰紡鍒楄〃
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetConveyTypeList_Json")]
+ [HttpGet]
+ public object GetConveyTypeList_Json(string ConveyType)
+ {
+ if (ConveyType != "")
+ {
+ sWhere = sWhere + " and ( HNumber like '%" + ConveyType + "%' or HName like '%" + ConveyType + "%' ) ";
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("Select HItemID,HNumber ,HName from Gy_ConveyType where HStopflag=0 Order by HItemID ", "Gy_ConveyType");
+ }
+ else
+ {
+ string sql1 = "Select HItemID,HNumber ,HName from Gy_ConveyType where HStopflag=0 and HEndFlag=1 ";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "Gy_ConveyType");
+ }
+
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + DBUtility.ClsPub.sErrInfo;
+ objjson.data = null;
+ return objjson;
+ }
+ else
+ {
+ objjson.code = "0";
+ objjson.count = 1;
+ objjson.Message = "鑾峰彇鎴愬姛!";
+ objjson.data = ds.Tables[0];
+ return objjson;
+ }
+ }
+ catch (Exception ex)
+ {
+
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
}
}
--
Gitblit v1.9.1