From bfdba143a3228e23d40862b76a7b0ee2563f4d82 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期一, 08 十一月 2021 14:36:23 +0800
Subject: [PATCH] 基础资料列表优化
---
WebAPI/Controllers/BaseSet/Gy_UnitController.cs | 12 ---
WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs | 33 +++-------
WebAPI/Controllers/BaseSet/Gy_CustomerController.cs | 23 ++-----
WebAPI/Controllers/BaseSet/Gy_MaterialController.cs | 82 ++++++++++++---------------
WebAPI/Controllers/BaseSet/Gy_SupplierController.cs | 13 ---
5 files changed, 56 insertions(+), 107 deletions(-)
diff --git a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
index 9ec1e53..ee9a7f6 100644
--- a/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_CustomerController.cs
@@ -25,7 +25,7 @@
/// </summary>
[Route("Gy_Customer/list")]
[HttpGet]
- public object list(string sWhere,string Organization)
+ public object list(string sWhere, string Organization)
{
try
{
@@ -39,22 +39,11 @@
string sql = sql1 + sWhere + " order by HItemID desc";
ds = oCN.RunProcReturn(sql, "h_v_Gy_CustomerList");
}
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
}
catch (Exception e)
{
diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 0bdeb9f..f7ab835 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -27,7 +27,7 @@
/// </summary>
[Route("Gy_Material/list")]
[HttpGet]
- public object list(string sWhere,string Organization)
+ public object list(string sWhere, string Organization)
{
try
{
@@ -41,22 +41,12 @@
string sql = sql1 + sWhere + "order by HItemID desc";
ds = oCN.RunProcReturn(sql, "h_v_Gy_MaterialList");
}
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
+
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
}
catch (Exception e)
{
@@ -231,7 +221,7 @@
objJsonResult.data = 1;
return objJsonResult;
}
-
+
oItem.HShortNumber = sShortNumber;//鐭唬鐮�
oItem.HEndFlag = true;//鏈骇鏍囧織
oItem.HLevel = DBUtility.ClsPub.GetLevel(oItem.HNumber.Trim()); //绛夌骇
@@ -359,7 +349,7 @@
/// </summary>
[Route("Gy_Mould/list1")]
[HttpGet]
- public object list1(string sWhere,string ModRightNameSelect, string user)
+ public object list1(string sWhere, string ModRightNameSelect, string user)
{
try
{
@@ -373,7 +363,7 @@
}
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
{
@@ -425,7 +415,7 @@
{
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_Gy_CheckToolsFileMainList " + sWhere+ "order by 鏃ユ湡 desc", "h_v_Gy_CheckToolsFileMainList");
+ ds = oCN.RunProcReturn("select * from h_v_Gy_CheckToolsFileMainList " + sWhere + "order by 鏃ユ湡 desc", "h_v_Gy_CheckToolsFileMainList");
}
else
{
@@ -473,7 +463,7 @@
{
if (sWhere == null || sWhere.Equals(""))
{
- ds = oCN.RunProcReturn("select * from h_v_IF_BarCodeBillList " + sWhere+ "order by 鏃ユ湡 desc", "h_v_IF_BarCodeBillList");
+ ds = oCN.RunProcReturn("select * from h_v_IF_BarCodeBillList " + sWhere + "order by 鏃ユ湡 desc", "h_v_IF_BarCodeBillList");
}
else
{
@@ -617,9 +607,9 @@
"," + HYear + "," + HPeriod + ",'" + HRemark + "','" + HMaker + "',getdate()" +
",'" + HMouldNo + "','" + HName + "','" + HModel + "','" + HModel2 + "','" + HDiameter + "'" +
",'" + HSubjoin + "','" + HSubjoin2 + "','" + HPICNo + "','" + HWorkMaterModel + "'" +
- "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
+ "," + HMaterID + ",'" + HMaterNumber + "'," + HMouleTypeID + "," + HUnitID +
",'" + HOutComDate + "','" + HOutComNo + "'," + HDeptID + "," + HSupID + ",'" + HSupNumber + "'" +
- "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +
+ "," + HPrintQty + ",'" + HMouldStatus + "'," + HWHID + "," + HRoutingID +
"," + HBOMID + ",'" + HVersion + "'," + HSPGroupID + "," + HSPID + ",'" + HDesignLife + "'" +
",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "'" +
") ");
@@ -633,7 +623,7 @@
" values('" + HInterID + "',0,''" +
",0,0,'','',0,0 " +
") ");
-
+
if (objJsonResult.code == "0")
{
objJsonResult.code = "0";
@@ -692,7 +682,7 @@
//鍙嶅簭鍒楀寲
msg2 = "[" + msg2.ToString() + "]";
List<Gy_Mould> mainList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_Mould>>(msg2);
-
+
long HInterID = mainList[0].HInterID;//閫掑叆type寰楀埌鐨勫崟鎹甀D
string HBillNo = mainList[0].HBillNo;//閫掑叆type寰楀埌鐨勫崟鎹彿
DateTime HDate = mainList[0].HDate;//鏃ユ湡
@@ -733,7 +723,7 @@
long HPrintQty = mainList[0].HPrintQty;
-
+
//鑻AINDI閲嶅鍒欓噸鏂拌幏鍙�
@@ -780,7 +770,7 @@
",HProdQty=" + HProdQty.ToString() +
",HProdWeight=" + HProdWeight.ToString() +
" where HInterID=" + HInterID.ToString());
-
+
//淇敼瀛愰」鐩唬鐮�
//oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
//灏嗕笂绾� 涓洪潪鏈骇
@@ -856,24 +846,24 @@
return objJsonResult;
}
if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo))
- {
- //鍐欏叆鏃ュ織
- ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName);
- //鏇存柊涓婄骇涓� 鏈骇
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "鍒犻櫎鎴愬姛";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鍒犻櫎澶辫触";
- objJsonResult.data = null;
- return objJsonResult;
- }
+ {
+ //鍐欏叆鏃ュ織
+ ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName);
+ //鏇存柊涓婄骇涓� 鏈骇
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
//ds = oCN.RunProcReturn("delete from Gy_Department where HItemID = " + HItemID, "Gy_Department");
}
diff --git a/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs b/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs
index 58001c2..4e10ae8 100644
--- a/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_SupplierController.cs
@@ -39,22 +39,13 @@
string sql = sql1 + sWhere + " order by HItemID desc";
ds = oCN.RunProcReturn(sql, "h_v_Gy_SupplierList");
}
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
+
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
return objJsonResult;
- }
+
}
catch (Exception e)
{
diff --git a/WebAPI/Controllers/BaseSet/Gy_UnitController.cs b/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
index ce6c01c..792754c 100644
--- a/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_UnitController.cs
@@ -41,22 +41,12 @@
string sql = sql1 + sWhere + "order by HItemID desc";
ds = oCN.RunProcReturn(sql, "h_v_Gy_UnitList");
}
- if (ds == null || ds.Tables[0].Rows.Count == 0)
- {
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
- objJsonResult.data = null;
- return objJsonResult;
- }
- else
- {
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
return objJsonResult;
- }
+
}
catch (Exception e)
{
diff --git a/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs b/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
index 6baaaa8..b41c069 100644
--- a/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
+++ b/WebAPI/Controllers/BaseSet/Xt_ORGANIZATIONSController.cs
@@ -25,7 +25,7 @@
/// </summary>
[Route("Xt_ORGANIZATIONS/list")]
[HttpGet]
- public object list(string sWhere,string Organization)
+ public object list(string sWhere, string Organization)
{
try
{
@@ -39,22 +39,11 @@
string sql = sql1 + sWhere + "order by HItemID desc";
ds = oCN.RunProcReturn(sql, "h_v_IF_ORGANIZATIONSList");
}
- 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 = "Sucess锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
}
catch (Exception e)
{
@@ -85,12 +74,12 @@
long HItemID = list[0].HItemID;
string HNumber = list[0].HNumber;
string HName = list[0].HName;
-
+
long HParentID = list[0].HParentID;
-
+
string HRemark = list[0].HRemark;
bool HStopflag = list[0].HStopflag;
-
+
if (!DBUtility.ClsPub.AllowNumber(HNumber))
{
objJsonResult.code = "0";
@@ -203,7 +192,7 @@
",HStopflag,HMakeTime" +
",HRemark) " +
" Values('" + HNumber + "','" + HName + "'," + HParentID.ToString() +
- "," + HStopflag + "getdate()"+
+ "," + HStopflag + "getdate()" +
",'" + HRemark + "')", ref DBUtility.ClsPub.sExeReturnInfo);
//淇敼涓婄骇涓洪潪鏈骇浠g爜
@@ -246,7 +235,7 @@
/// </summary>
/// <returns></returns>
[Route("DeltetXt_ORGANIZATIONSList")]
-
+
[HttpGet]
public object DeltetXt_ORGANIZATIONSList(string HItemID)
{
--
Gitblit v1.9.1