From 7d40b174741ff3ee372d46a03b111cddf4546739 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期一, 12 十二月 2022 16:52:11 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/LMESController.cs | 65 ++++++++++++++++++++++++++++++--
1 files changed, 60 insertions(+), 5 deletions(-)
diff --git a/WebAPI/Controllers/LMESController.cs b/WebAPI/Controllers/LMESController.cs
index feb8c57..212335f 100644
--- a/WebAPI/Controllers/LMESController.cs
+++ b/WebAPI/Controllers/LMESController.cs
@@ -1,4 +1,5 @@
-锘縰sing Newtonsoft.Json.Linq;
+锘縰sing Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
using Pub_Class;
using System;
using System.Collections;
@@ -59,6 +60,7 @@
DataSet ds;
try
{
+ List<object> columnNameList = new List<object>();
//鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
//if (!DBUtility.ClsPub.Security_Log("Sc_ProcessExchangeBill_Query", 1, false, user))
//{
@@ -72,11 +74,19 @@
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
ds = oCN.RunProcReturn("select * from h_v_Sc_ProcessExchangeBillQuery where 1 = 1 " + sWhere + " order by hmainid desc ", "h_v_Sc_ProcessExchangeBillQuery");
+ //娣诲姞鍒楀悕
+ 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.list = columnNameList;
objJsonResult.data = ds.Tables[0];
return objJsonResult;
//}
@@ -115,6 +125,7 @@
string sql = "select * from h_v_Sc_ProcessExchangeBillQuerySub where hmainid = ";
string sql1 = sql + sWhere;
ds = oCN.RunProcReturn(sql1 + " order by cast(宸ュ簭鍙� as int)", "h_v_Sc_ProcessExchangeBillQuerySub");
+ return GetObjectJson(ds);
}
catch (Exception e)
{
@@ -124,7 +135,6 @@
objJsonResult.data = null;
return objJsonResult;
}
- return GetObjectJson(ds);
}
#region 宸ュ簭娴佽浆鍗★紙涓嬭揪锛�
@@ -174,13 +184,13 @@
/// <returns></returns>
[Route("LEMS/MES_Sc_ProcessExchangeIssue")]
[HttpGet]
- public object MES_Sc_ProcessExchangeIssue(string HGroupID, string HSourceID, string HEntryId)
+ public object MES_Sc_ProcessExchangeIssue(string HGroupID, string HSourceID, string HSourceSub1ID, string HSourceSub2ID, string HSourceSub3ID, string HEntryId)
{
DataSet ds;
try
{
SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
- ds = oCN.RunProcReturn($"exec REALESE_Sc_ProcessExchangeIssue '{HGroupID}','{HSourceID}','{HEntryId}' ", "REALESE_Sc_ProcessExchangeIssue");
+ ds = oCN.RunProcReturn($"exec REALESE_Sc_ProcessExchangeIssue '{HGroupID}','{HSourceID}','{HSourceSub1ID}','{HSourceSub2ID}','{HSourceSub3ID}','{HEntryId}' ", "REALESE_Sc_ProcessExchangeIssue");
objJsonResult.code = "1";
objJsonResult.count = 1;
objJsonResult.Message = "Sucess锛�";
@@ -196,7 +206,42 @@
return objJsonResult;
}
}
-
+ /// <summary>
+ /// 宸ュ簭娴佽浆鍗℃寚娲炬棩鏈�
+ /// </summary>
+ /// <returns></returns>
+ [Route("LEMS/MES_Sc_ProcessExchangePlanDate")]
+ [HttpGet]
+ public object MES_Sc_ProcessExchangePlanDate(string HPlanBeginDate, string HPlanEndDate, string HEntryId)
+ {
+ DataSet ds;
+ try
+ {
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ string sql = string.Format(@"
+update Sc_ProcessExchangeBillSub set
+HPlanBeginDate = '{0}',
+HPlanEndDate = '{1}'
+where cast(HInterID as varchar(20)) +'-'+ cast(HEntryID as varchar(20)) in
+(
+ select * from fn_Split('{2}',',')
+)", HPlanBeginDate, HPlanEndDate, HEntryId);
+ oCN.RunProc(sql);
+ objJsonResult.code = "1";
+ objJsonResult.count = 1;
+ objJsonResult.Message = "Sucess锛�";
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ catch (Exception e)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "寮傚父锛�" + e.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
/// <summary>
/// 宸ュ簭娴佽浆鍗″弽涓嬭揪
/// </summary>
@@ -564,11 +609,21 @@
{
try
{
+ List<object> columnNameList = new List<object>();
//if (ds.Tables[0].Rows.Count != 0 || ds != null)
//{
+ //娣诲姞鍒楀悕
+ 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.list = columnNameList;
objJsonResult.data = ds.Tables[0];
return objJsonResult;
//}
--
Gitblit v1.9.1