From 385da37de94758dfe8befb0635307409869ec68a Mon Sep 17 00:00:00 2001
From: yangle <admin@YINMOU>
Date: 星期二, 08 四月 2025 11:06:07 +0800
Subject: [PATCH] 还样获取取样单数据
---
WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs | 89 ++++++++++++++++++++++++++++++++++++++++++--
1 files changed, 84 insertions(+), 5 deletions(-)
diff --git a/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs b/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
index 8385d23..f99c9ef 100644
--- a/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
+++ b/WebAPI/Controllers/SBGL/Sb_EquipStopBillController.cs
@@ -11,7 +11,7 @@
using System.Windows.Forms;
using WebAPI.Models;
-namespace WebAPI.Controllers.SBGL
+namespace WebAPI.Controllers
{
public class Sb_EquipStopBillController : ApiController
{
@@ -21,6 +21,7 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
public DAL.ClsSb_EquipStopBillMain OBill = new DAL.ClsSb_EquipStopBillMain();
public DAL.ClsSb_EquipStopBillMain BillOld = new DAL.ClsSb_EquipStopBillMain();
+ Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); //鑾峰彇绯荤粺鍙傛暟
#region 璁惧鍋滄満鍗曞垪琛� 鏌ヨ
@@ -33,7 +34,7 @@
List<object> columnNameList = new List<object>();
//鏌ョ湅鏉冮檺
- if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Check", 1, false, user))
+ if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Query", 1, false, user))
{
objJsonResult.code = "0";
objJsonResult.count = 0;
@@ -67,6 +68,59 @@
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
objJsonResult.list = columnNameList;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "Exception锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
+ #endregion
+
+ #region 璁惧鍋滄満鍗曞垎椤垫煡璇�
+ [Route("Sb_EquipStopBill/get锘縎b_EquipStopBillListPage")]
+ [HttpGet]
+ public object Sb_EquipStopBillListPage(string sWhere, string user, int page, int size)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ //缂栬緫鏉冮檺
+ if (!DBUtility.ClsPub.Security_Log_second("Sb_EquipStopBillMain_Query", 1, false, user))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ sWhere = sWhere.Replace("'", "''");
+ if (sWhere == null || sWhere.Equals(""))
+ {
+ ds = oCN.RunProcReturn("exec h_p_Sb_EquipStopBillMainListPage " + page + "," + size + ",''", "h_p_Sb_EquipStopBillMainListPage");
+ }
+ else
+ {
+ ds = oCN.RunProcReturn("exec h_p_Sb_EquipStopBillMainListPage " + page + "," + size + ",'" + sWhere + "'", "h_p_Sb_EquipStopBillMainListPage");
+ }
+
+ //娣诲姞鍒楀悕
+ 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)
@@ -210,7 +264,7 @@
oItem.HYear = DBUtility.ClsPub.isLong(DateTime.Now.Year);
oItem.HPeriod = DBUtility.ClsPub.isLong(DateTime.Now.Month);
- oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now.ToString("yyyy-MM-dd"));
+ oItem.HMakeDate = DBUtility.ClsPub.isStrNull(DateTime.Now);
if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
{
@@ -240,6 +294,31 @@
}
if (bResult)
{
+ //鑷姩瀹℃牳璁剧疆
+ if (refSav == "Add")
+ {
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ string sReturn = "";
+ if (oSystemParameter.ShowBill(ref sReturn) == true)
+ {
+ if (oSystemParameter.omodel.Sb_EquipStopBill_AutoCheck == "Y") //绯荤粺鍙傛暟 鑷姩瀹℃牳
+ {
+ objJsonResult.Verify = "Y";
+ }
+ else
+ {
+ objJsonResult.Verify = "N";
+ }
+ }
+ }
+ else
+ if (refSav == "Update")
+ {
+ objJsonResult.HInterID = oBill.omodel.HInterID.ToString(); //杩斿洖涓籌D
+ objJsonResult.Verify = "N";
+ }
+
objJsonResult.code = "0";
objJsonResult.count = 1;
objJsonResult.Message = "淇濆瓨鎴愬姛锛�";
@@ -445,7 +524,7 @@
objJsonResult.code = "0";
objJsonResult.count = 1;
- objJsonResult.Message = "鎵ц鎴愬姛锛�";
+ objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
objJsonResult.data = null;
return objJsonResult; ;
@@ -454,7 +533,7 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "鎵ц澶辫触锛�" + e.ToString();
+ objJsonResult.Message = "瀹℃牳澶辫触锛�" + e.ToString();
objJsonResult.data = null;
return objJsonResult;
}
--
Gitblit v1.9.1