From 00e25e4a9c9bd2fc91558c3c1a68f47db6d08b1d Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期一, 08 七月 2024 18:57:35 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
---
WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs | 229 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 223 insertions(+), 6 deletions(-)
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
index 5494a1d..c08f545 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipMaintainRuleBillController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json;
+锘縰sing DBUtility;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -74,6 +75,70 @@
}
#endregion
+ #region 璁惧淇濆吇瑙勭▼鍗曞垪琛≒DA
+ [Route("Sb_EquipMaintainRuleBill/GetEquipMaintainRuleListPDA")]
+ [HttpGet]
+ public object GetEquipMaintainRuleListPDA(string sWhere, string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainRuleBillList", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("select * from h_v_Sb_GetMaintainRuleListByEquip " + sWhere, "h_v_Sb_GetMaintainRuleListByEquip");
+ }
+ else
+ {
+ string sql1 = "select * from h_v_Sb_GetMaintainRuleListByEquip where 1 = 1";
+ string sql = sql1 + sWhere;
+ ds = oCN.RunProcReturn(sql, "h_v_Sb_GetMaintainRuleListByEquip");
+ }
+
+ //娣诲姞鍒楀悕
+ 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.Tables[0].Rows.Count != 0 || ds != null)
+ //{
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
+ return objJsonResult;
+ //}
+ //else
+ //{
+ //objJsonResult.code = "0";
+ //objJsonResult.count = 0;
+ //objJsonResult.Message = "鏃犳暟鎹�";
+ //objJsonResult.data = null;
+ //return objJsonResult;
+ //}
+ }
+ catch (Exception ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁杩斿洖浠讳綍璁板綍锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
#region 璁惧淇濆吇瑙勭▼璁板綍鍒犻櫎鍔熻兘
[Route("Sb_EquipMaintainRuleBill/DeleteEquipMaintainRuleBillList")]
[HttpGet]
@@ -98,9 +163,10 @@
return objJsonResult;
}
DLL.ClsSb_EquipMaintainRuleBill oBill = new DLL.ClsSb_EquipMaintainRuleBill();
- if (oBill.ShowBill(lngBillKey, ref DBUtility.ClsPub.sExeReturnInfo))
+ ds = oCN.RunProcReturn("select * from Sb_EquipMaintainRuleBillMain where HInterID=" + HInterID, "Sb_EquipMaintainRuleBillMain");
+ if (ds.Tables[0].Rows.Count > 0)
{
- if (oBill.omodel.HBillStatus > 1)
+ if (DBUtility.ClsPub.isInt(ds.Tables[0].Rows[0]["HBillStatus"].ToString()) > 1)
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -108,7 +174,7 @@
objJsonResult.data = null;
return objJsonResult;
}
- if (oBill.omodel.HChecker != ""&& oBill.omodel.HChecker != null)
+ if (ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -199,9 +265,9 @@
if (string.IsNullOrEmpty(HID))
return new ApiResult<DataSet> { code = -1, msg = "ID涓嶈兘涓虹┖" };
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- var dataSet = oCN.RunProcReturn("select top 1 * from Sb_EquipMaintainRuleBillMain where HInterID= " + HID + " ", "Sb_EquipMaintainRuleBillMain");
+ var dataSet = oCN.RunProcReturn("select top 1 * from h_v_Sb_EquipMaintainRuleBillList where HInterID= " + HID + " ", "h_v_Sb_EquipMaintainRuleBillList");
if (dataSet == null || dataSet.Tables[0].Rows.Count == 0)
- return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄧ偣妫�璁″垝琛�" };
+ return new ApiResult<DataSet> { code = -1, msg = "涓嶅瓨鍦ㄤ繚鍏昏绋嬭〃" };
return new ApiResult<DataSet> { code = 1, msg = "鏌ヨ鎴愬姛", data = dataSet };
}
#endregion
@@ -399,5 +465,156 @@
}
}
#endregion
+
+ #region 璁惧淇濆吇瑙勭▼鍗曞鏍�/鍙嶅鏍稿姛鑳�
+ [Route("Sb_EquipMaintainRuleBill/CheckSb_EquipMaintainRuleBill")]
+ [HttpGet]
+ public object CheckSb_EquipMaintainRuleBill(string HInterID, int Type, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainRuleBill_Check", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愬鏍�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (string.IsNullOrWhiteSpace(HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 瀹℃牳 2 鍙嶅鏍�
+ if (Type == 1)
+ {
+ if (!BillOld.CheckBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (BillOld.AbandonCheck(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
+ }
+ else
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 璁惧淇濆吇瑙勭▼鍗曞叧闂�/鍙嶅叧闂姛鑳�
+ [Route("Sb_EquipMaintainRuleBill/CloseSb_EquipMaintainRuleBill")]
+ [HttpGet]
+ public object CloseSb_EquipMaintainRuleBill(string HInterID, int Type, string user)
+ {
+ try
+ {
+ //鍒ゆ柇鏄惁鏈夊垹闄ゆ潈闄�
+ if (!DBUtility.ClsPub.Security_Log("Sb_EquipMaintainRuleBill_Close", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳潈闄愬叧闂�!";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ if (string.IsNullOrWhiteSpace(HInterID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HInterID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+
+ ClsPub.CurUserName = user;
+
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+
+ //Type 1 鍏抽棴 2 鍙嶅叧闂�
+ if (Type == 1)
+ {
+ if (!BillOld.CloseBill(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍏抽棴澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ else
+ {
+ if (!BillOld.CancelClose(int.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鍙嶅叧闂け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+
+ oCN.Commit();//鎻愪氦浜嬪姟
+
+ objJsonResult.code = "0";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
}
}
--
Gitblit v1.9.1