From d94d583abc305f679db67962aa7f9bc7023b89d5 Mon Sep 17 00:00:00 2001
From: jingh <jingh@LAPTOP-I53VDLOO>
Date: 星期三, 29 十二月 2021 23:33:29 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/WebAPIController.cs | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 214 insertions(+), 26 deletions(-)
diff --git a/WebAPI/Controllers/WebAPIController.cs b/WebAPI/Controllers/WebAPIController.cs
index ff11189..bab1e9c 100644
--- a/WebAPI/Controllers/WebAPIController.cs
+++ b/WebAPI/Controllers/WebAPIController.cs
@@ -106,14 +106,14 @@
string sql = string.Format(@" select a.* from Gy_UserByOrgRelation a
where a.HUserID = '{0}' and a.HOrgID = '{1}'", UserName, HOrgName);
DataSet _ds = oCnLoc.RunProcReturn(sql, "h_p_Xt_UserRelationOrg_Check");
- if (_ds == null || _ds.Tables[0].Rows.Count == 0)
- {
- objjson.code = "0";
- objjson.count = 0;
- objjson.Message = "鐢ㄦ埛" + UserName + "娌℃湁璇ョ粍缁囨潈闄�";
- objjson.data = null;
- return objjson;
- }
+ //if (_ds == null || _ds.Tables[0].Rows.Count == 0)
+ //{
+ // objjson.code = "0";
+ // objjson.count = 0;
+ // objjson.Message = "鐢ㄦ埛" + UserName + "娌℃湁璇ョ粍缁囨潈闄�";
+ // objjson.data = null;
+ // return objjson;
+ //}
objjson.code = "0";
objjson.count = 1;
@@ -184,6 +184,45 @@
objjson.data = null;
return objjson; ;
}
+ }
+
+
+
+ //鎾ら攢缂撳瓨鍒楄〃璁板綍
+ [Route("Web/Rescind_Json")]
+ [HttpGet]
+ public object Rescind_Json(long sHInterID, string sBillNo, string sBillType)
+ {
+ string sErrMsg = string.Empty;
+ try
+ {
+ if (webserver.RescindBillList(sHInterID, sBillNo, sBillType, ref sErrMsg))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ catch (Exception)
+ {
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鍒犻櫎澶辫触锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
}
@@ -2093,6 +2132,7 @@
[HttpGet]
public object GetMaintainItemtemByMouldProjectID(int MouldProjectID)
{
+
if (MouldProjectID <= 0)
{
objjson.code = "0";
@@ -2104,28 +2144,29 @@
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- string sql = string.Format(@"select t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
+ List<object> list = new List<object>();
+ DataSet ds2;
+ DataSet ds1;
+ string sql1 = string.Format(@"select t.HMaintainItemID ,m.HNumber HMaintainItemNumber,t.HMaintainItem,t.HMaintainPart,t.HClaim,t.HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
from Sc_MouldMaintainRuleBillMain a left join Sc_MouldMaintainRuleBillSub_Item t on a.HInterID=t.HInterID
left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
left join Gy_Employee e on e.HItemID=t.HManagerID
where a.HInterID=(select HMouldMaintainRuleInterID from Gy_MouldFileMain where HInterID=" + MouldProjectID + ") ");
- ds = oCN.RunProcReturn(sql, "Sc_MouldMaintainRuleBillMain");
- 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 = "1";
- objjson.count = 1;
- objjson.Message = "鑾峰彇鎴愬姛!";
- objjson.data = ds.Tables[0];
- return objjson;
- }
+
+ string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName, m.HModel HMaterSpec,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HQtyMust,b.HRemark from Sc_MouldMaintainRuleBillMain a
+ left join Sc_MouldMaintainRuleBillSub b on a.HInterID=b.HInterID
+ left join h_v_IF_Material m on b.HMaterID=m.HItemID
+ left join h_v_IF_Unit u on b.HUnitID=u.HItemID
+ where a.HInterID=(select HMouldMaintainRuleInterID from Gy_MouldFileMain where HInterID=" + MouldProjectID + ") ");
+ ds1 = oCN.RunProcReturn(sql1, "Sc_MouldMaintainRuleBillMain");//淇濆吇
+ ds2 = oCN.RunProcReturn(sql2, "Sc_MouldMaintainRuleBillMain");//閰嶄欢
+ list.Add(ds1.Tables[0]);
+ list.Add(ds2.Tables[0]);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.list = list;
+ return objJsonResult;
}
catch (Exception ex)
{
@@ -2178,6 +2219,111 @@
}
}
+ /// <summary>
+ /// 鏍规嵁璁惧鏄剧ず璁惧淇濆吇瑙勭▼椤圭洰
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetMaintainItemtemByEquipProjectID")]
+ [HttpGet]
+ public object GetMaintainItemtemByEquipProjectID(int EquipProjectID)
+ {
+ if (EquipProjectID <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "浜у搧鍣ㄥ叿鏈�夋嫨";
+ objjson.data = null;
+ return objjson;
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ List<object> list = new List<object>();
+ DataSet ds2;
+ DataSet ds1;
+ string sql1 = string.Format(@"select t.HMaintainItemID HMaintainItemID,m.HNumber HMaintainItemNumber,t.HMaintainItem HMaintainItem,t.HMaintainPart HMaintainPart,t.HClaim HClaim,t.HManagerID HManagerID,e.HNumber HManagerNumber,e.HName HManagerName,a.HRemark
+ from Sb_EquipMaintainRuleBillMain a left join Sb_EquipMaintainRuleBillSub_Item t on a.HInterID=t.HInterID
+ left join Gy_Maintain m on m.HItemID=t.HMaintainItemID
+ left join Gy_Employee e on e.HItemID=t.HManagerID
+ where a.HInterID=(select HEquipMaintainRuleInterID from Gy_EquipFileBillMain where HInterID=" + EquipProjectID + ") ");
+ string sql2 = string.Format(@"select b.HMaterID,m.HNumber HMaterNumber,m.HName HMaterName,b.HUnitID,u.HNumber HUnitNumber,u.HName HUnitName,b.HQty,b.HRemark from Sb_EquipMaintainRuleBillMain a
+ left join Sb_EquipMaintainRuleBillSub b on a.HInterID=b.HInterID
+ left join h_v_IF_Material m on b.HMaterID=m.HItemID
+ left join h_v_IF_Unit u on b.HUnitID=u.HItemID
+ where a.HInterID=(select HEquipMaintainRuleInterID from Gy_EquipFileBillMain where HInterID=" + EquipProjectID + ") ");
+
+ ds1 = oCN.RunProcReturn(sql1, "Sb_EquipMaintainRuleBillMain");//淇濆吇
+ ds2 = oCN.RunProcReturn(sql2, "Sc_MouldMaintainRuleBillMain");//閰嶄欢
+ list.Add(ds1.Tables[0]);
+ list.Add(ds2.Tables[0]);
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.list = list;
+ return objJsonResult;
+ }
+ catch (Exception ex)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "鑾峰彇澶辫触" + ex.ToString();
+ objjson.data = null;
+ return objjson;
+ }
+ }
+
+ /// <summary>
+ /// 鏍规嵁璁惧鏄剧ず璁惧鐐规绋嬮」鐩�
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/GetDotCheckRuleItemByEquipProjectID")]
+ [HttpGet]
+ public object GetDotCheckRuleItemByEquipProjectID(int EquipProjectID)
+ {
+ if (EquipProjectID <= 0)
+ {
+ objjson.code = "0";
+ objjson.count = 0;
+ objjson.Message = "浜у搧鍣ㄥ叿鏈�夋嫨";
+ objjson.data = null;
+ return objjson;
+ }
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = string.Format(@"select b.HDotCheckItemID HDotCheckItemID,c.HNumber HDotCheckCode,b.HDotCheckItem,b.HDotCheckPart,b.HClaim,
+ b.HManagerID,e.HNumber HManagerCode,e.HName HManagerName,b.HRemark from Sb_EquipDotCheckRuleBillMain a
+ left join Sb_EquipDotCheckRuleBillSub b on a.HInterID=b.HInterID
+ left join Gy_QCCheckItem c on c.HItemID=b.HDotCheckItemID
+ left join Gy_Employee e on e.HItemID=b.HManagerID
+ where a.HInterID=(select HEquipDotCheckRuleInterID from Gy_EquipFileBillMain where HInterID=" + EquipProjectID + ") ");
+ ds = oCN.RunProcReturn(sql, "Sb_EquipDotCheckRuleBillMain");
+ 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 = "1";
+ 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>
/// 鑾峰彇缁翠慨椤圭洰鍒楄〃
@@ -2351,6 +2497,48 @@
}
#endregion
+
+ /// <summary>
+ /// 浜у搧鍏ュ簱缂撳瓨鍒楄〃鍒锋柊淇℃伅
+ /// </summary>
+ /// <returns></returns>
+ [Route("Web/chanpinruk")]
+ [HttpGet]
+ public object chanpinruk(string HBillType, string sHMaker, Int64 HOrgID)
+ {
+ try
+ {
+ ds = webserver.GetKf_PonderationBillMain_TempList_New(HBillType, sHMaker, HOrgID);
+ if (ds == null || ds.Tables[0].Rows.Count <= 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ //DBUtility.ClsPub.MessageBeep((int)DBUtility.ClsPub.BeepType.Warning);
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
+ objJsonResult.data = ds.Tables[0];
+ return objJsonResult;
+ }
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+
+
}
}
--
Gitblit v1.9.1