From 4ba4077f93ce9b3423e1ac5f5e8a21ebfd1e3ce0 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期五, 26 一月 2024 10:23:12 +0800
Subject: [PATCH] 收款单 保存方法,增加 调用 保存前控制 h_p_YS_ReceiveBill_BeforeSaveCtrl 和保存后控制 h_p_YS_ReceiveBill_AfterSaveCtrl的 存储过程。 收款单 反审核 审核 方法,增加 调用 反审核 审核前控制 h_p_YS_ReceiveBill_BeforeUnCheckCtrl 、h_p_YS_ReceiveBill_BeforeCheckCtrl 和 反审核 审核后控制 h_p_YS_ReceiveBill_AfterUnCheckCtrl、h_p_YS_ReceiveBill_AfterCheckCtrl的 存储过程。 应收退款单 保存方法,增加 调用 保存前控制 h_p_YS_ReceiveBackBill_BeforeSaveCtrl 和保存后控制 h_p_YS_ReceiveBackBill_AfterSaveCtrl的 存储过程。 应收退款单 反审核 审核 方法,增加 调用 反审核 审核前控制 h_p_YS_ReceiveBackBill_BeforeUnCheckCtrl 、h_p_YS_ReceiveBackBill_BeforeCheckCtrl 和 反审核 审核后控制 h_p_YS_ReceiveBackBill_AfterUnCheckCtrl、h_p_YS_ReceiveBackBill_AfterCheckCtrl的 存储过程。
---
WebAPI/Controllers/Gy_MateMouldController.cs | 100 +++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 91 insertions(+), 9 deletions(-)
diff --git a/WebAPI/Controllers/Gy_MateMouldController.cs b/WebAPI/Controllers/Gy_MateMouldController.cs
index 595a5e4..d92ce2b 100644
--- a/WebAPI/Controllers/Gy_MateMouldController.cs
+++ b/WebAPI/Controllers/Gy_MateMouldController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -28,6 +29,7 @@
{
try
{
+ List<object> columnNameList = new List<object>();
//缂栬緫鏉冮檺
//if (!DBUtility.ClsPub.Security_Log_second("Gy_MateMould", 1, false, user))
//{
@@ -48,10 +50,19 @@
ds = oCN.RunProcReturn(sql, "h_v_Gy_MateMouldInfoList");
}
+ //娣诲姞鍒楀悕
+ 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 = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
return objJsonResult;
}
catch (Exception e)
@@ -172,7 +183,7 @@
}
else
{
- bResult = BillNew.ModifyByID(DBUtility.ClsPub.isLong(mainList[0].HItemID));
+ bResult = BillNew.ModifyByID(DBUtility.ClsPub.isLong(subList[0].HItemID));
}
//鎻愮ず
if (bResult == true)
@@ -210,14 +221,26 @@
{
try
{
+ List<object> columnNameList = new List<object>();
+ //ds = oCN.RunProcReturn("select " +
+ // "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HRelationID) 妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.HName HRelationNameCol" +
+ // ",b.HNumber HRelationNumberCol,a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" +
+ // ",a.HRelationID HRelationIDCol,d.HNumber HUnitNumberCol,d.HName HUnitNameCol" +
+ // ",a.HUnitID HUnitIDCol" +
+ // ",a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" +
+ // ",a.HRemark HRemarkCol " +
+ // " from Gy_MateMouldInfo a " +
+ // " left join h_v_Gy_Mould b on a.HRelationID = b.HItemID " +
+ // " left join Gy_Material c on a.HMaterID = c.HItemID " +
+ // " left join Gy_Unit d on a.HUnitID = d.HItemID where a.HItemID = " + HItemID, "Gy_MateMouldInfo");
ds = oCN.RunProcReturn("select " +
- "a.HItemID,ltrim(a.HMaterID)+'-'+ltrim(a.HRelationID) 妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.HName HRelationNameCol" +
- ",b.HNumber HRelationNumberCol,a.HMaterID HMaterIDCol,c.HNumber HMaterNumberCol,c.HName HMaterNameCol,c.HModel HMaterModelCol" +
- ",a.HRelationID HRelationIDCol,d.HNumber HUnitNumberCol,d.HName HUnitNameCol" +
+ "a.HItemID,a.妯″叿浜у搧瀵瑰簲琛ㄤ唬鐮�,a.HUnitID,b.hitemid HMouldIDCol,b.HNumber 妯″叿浠g爜" +
+ ",b.HName 妯″叿鍚嶇О,a.HMaterID HMaterIDCol,c.HNumber 鐗╂枡浠g爜,c.HName 鐗╂枡鍚嶇О,c.HModel 瑙勬牸鍨嬪彿" +
+ ",a.HRelationID HRelationIDCol,d.HNumber 鍗曚綅浠g爜,d.HName 鍗曚綅鍚嶇О" +
",a.HUnitID HUnitIDCol" +
- ",a.HBeginDate HBeginDateCol,a.HEndDate HEndDateCol" +
- ",a.HRemark HRemarkCol " +
- " from Gy_MateMouldInfo a " +
+ ",a.寮�濮嬫棩鏈�,a.缁撴潫鏃ユ湡" +
+ ",a.澶囨敞 " +
+ " from h_v_Gy_MateMouldInfoList a " +
" left join h_v_Gy_Mould b on a.HRelationID = b.HItemID " +
" left join Gy_Material c on a.HMaterID = c.HItemID " +
" left join Gy_Unit d on a.HUnitID = d.HItemID where a.HItemID = " + HItemID, "Gy_MateMouldInfo");
@@ -225,16 +248,25 @@
{
objJsonResult.code = "0";
objJsonResult.count = 0;
- objJsonResult.Message = "false锛�";
+ objJsonResult.Message = "鏃犲垪琛ㄤ俊鎭紒";
objJsonResult.data = null;
return objJsonResult;
}
else
{
+ //娣诲姞鍒楀悕
+ 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 = 1;
objJsonResult.Message = "Sucess锛�";
objJsonResult.data = ds.Tables[0];
+ objJsonResult.list = columnNameList;
return objJsonResult;
}
}
@@ -249,5 +281,55 @@
}
#endregion
+ /// <summary>
+ /// 浜у搧鍣ㄥ叿鍒楄〃鍒犻櫎鍔熻兘
+ /// </summary>
+ /// <returns></returns>
+ [Route("DeltetGy_MateMould")]
+ [HttpGet]
+ public object DeltetGy_MateMould(string HItemID)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ if (string.IsNullOrWhiteSpace(HItemID))
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "HItemID涓虹┖锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ oCN.BeginTran();//寮�濮嬩簨鍔�
+ ds = oCN.RunProcReturn("select * from Gy_MateMouldInfo where HItemID=" + HItemID, "Gy_MateMouldInfo");
+ if (ds == null || ds.Tables[0].Rows.Count == 0)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "娌℃湁鏁版嵁锛屾棤娉曞垹闄わ紒";
+ objJsonResult.data = null;
+ return objJsonResult; ;
+ }
+
+ oCN.RunProc("delete from Gy_MateMouldInfo where HItemID=" + HItemID);
+ 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;
+ }
+ }
+
}
}
\ No newline at end of file
--
Gitblit v1.9.1