From 877a3643ea89282775a2a5ca25a2d79fbdfad0b7 Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期四, 05 九月 2024 08:14:56 +0800
Subject: [PATCH] 1
---
WebAPI/Controllers/GG_NoticeController.cs | 134 ++++++++++++++++++++++++++++++++++++++------
1 files changed, 116 insertions(+), 18 deletions(-)
diff --git a/WebAPI/Controllers/GG_NoticeController.cs b/WebAPI/Controllers/GG_NoticeController.cs
index 74910c0..35c2687 100644
--- a/WebAPI/Controllers/GG_NoticeController.cs
+++ b/WebAPI/Controllers/GG_NoticeController.cs
@@ -1,4 +1,5 @@
锘縰sing DBUtility;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -28,8 +29,9 @@
{
try
{
+ List<object> columnNameList = new List<object>();
//缂栬緫鏉冮檺
- //if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldRepairChangeBillList", 1, true, user))
+ //if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldRepairChangeBillList", 1, false, user))
//{
// objJsonResult.code = "0";
// objJsonResult.count = 0;
@@ -39,22 +41,32 @@
//}
ds = Get_GG_NoticeBillList(sWhere);
- if (ds == null)
+
+ //娣诲姞鍒楀悕
+ foreach (DataColumn col in ds.Tables[0].Columns)
{
- objJsonResult.code = "0";
- objJsonResult.count = 0;
- objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
+ Type dataType = col.DataType;
+ string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
+ columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
}
- else
- {
- objJsonResult.code = "1";
- objJsonResult.count = 1;
- objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
- objJsonResult.data = ds.Tables[0];
- return objJsonResult;
- }
+
+ //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)
{
@@ -68,8 +80,8 @@
public static DataSet Get_GG_NoticeBillList(string sWhere)
{
- var sql = "select A.HInterID,b.HEntryID,A.HBillNo,A.HContext,A.HDeptID,D.HName HDeptName, A.HSendMan, B.HReceiveMan,A.HLevel,A.HDescription,case when B.HReadFlag=0 then '鏈槄' when B.HReadFlag=1 then '宸查槄' end HReadFlag, A.HMaker,A.HMakeDate,A.HUpDater,A.HUpDateDate" +
- " from OA_InformBillMain A inner join OA_InformBillSub B on A.HInterID=B.HInterID left join Gy_Department D on A.HDeptID=D.HItemID where 1=1 " + sWhere;
+ var sql = "select A.HInterID 涓诲唴鐮�,b.HEntryID 瀛愬唴鐮�,A.HBillNo 鍗曟嵁鍙�,A.HContext 涓婚,A.HDeptID,D.HName 鍙戦�侀儴闂�, A.HSendMan 鍙戦�佷汉, B.HReceiveMan 鎺ユ敹浜�,A.HLevel 绱ф�ョ▼搴�,A.HDescription 璇︾粏鍐呭,case when B.HReadFlag=0 then '鏈槄' when B.HReadFlag=1 then '宸查槄' end 鐘舵��, A.HMaker 鍒跺崟浜�,A.HMakeDate 鍒跺崟鏃ユ湡,A.HUpDater 淇敼浜�,A.HUpDateDate 淇敼鏃ユ湡" +
+ " from OA_InformBillMain A inner join OA_InformBillSub B on A.HInterID=B.HInterID left join Gy_Department D on A.HDeptID=D.HItemID where 1=1 " + sWhere+ " order by 涓诲唴鐮� desc";
return new SQLHelper.ClsCN().RunProcReturn(sql, "OA_InformBillMain");
}
@@ -114,7 +126,7 @@
try
{
//缂栬緫鏉冮檺
- //if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdInBill_Edit", 1, true, msg3))
+ //if (!DBUtility.ClsPub.Security_Log_second("Sc_MouldProdInBill_Edit", 1, false, msg3))
//{
// objJsonResult.code = "0";
// objJsonResult.count = 0;
@@ -255,5 +267,91 @@
}
#endregion
+ #region 鍏憡鍒楄〃鍒犻櫎
+ [Route("GG_Notice/Get_GG_Notice_DeleteBill")]
+ [HttpGet]
+ public object Get_GG_Notice_DeleteBill(string HInterID, string user)
+ {
+ try
+ {
+ //鍒犻櫎鏉冮檺
+ //if (!DBUtility.ClsPub.Security_Log_second("", 1, false, user))
+ //{
+ // objJsonResult.code = "0";
+ // objJsonResult.count = 0;
+ // objJsonResult.Message = "鏃犲垹闄ゆ潈闄愶紒";
+ // objJsonResult.data = null;
+ // return objJsonResult;
+ //}
+
+ SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
+ oCN.RunProc("delete from OA_InformBillSub where HInterID=" + HInterID);
+ oCN.RunProc("delete from OA_InformBillMain where HInterID=" + HInterID);
+ oCN.Commit();//鎻愪氦浜嬪姟
+ objJsonResult.code = "1";
+ 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
+
+ /// <summary>
+ /// 鏍规嵁鐢ㄦ埛鍚嶈幏鍙栧叕鍛婂垪琛�
+ /// </summary>
+ /// <param name="user"></param>
+ /// <returns></returns>
+ [Route("GG_Notice/notices")]
+ [HttpGet]
+ public object getNotices(string user)
+ {
+ try
+ {
+ List<object> columnNameList = new List<object>();
+ var sql = "select top(10) m.HMakeDate as 鏃ユ湡, m.HLevel as 鐘跺喌, m.HContext as 涓婚 " +
+ ", m.HContext as 鍐呭" +
+ ", m.HSendMan as 鍙戦�佷汉, s.HReceiveMan as 鎺ユ敹浜�, d.HName as 鍙戦�侀儴闂� " +
+ " from OA_InformBillMain as m" +
+ " inner join OA_InformBillSub as s on m.HInterID = s.HInterID" +
+ " left join Gy_Department d on m.HDeptID = d.HItemID" +
+ " where 1 = 1 and" + " s.HReceiveMan =" + "'" + user + "'" +
+ " order by m.HMakeDate desc";
+
+ ds = new SQLHelper.ClsCN().RunProcReturn(sql, "OA_InformBillMain");
+
+ //娣诲姞鍒楀悕
+ 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 ex)
+ {
+ objJsonResult.code = "0";
+ objJsonResult.count = 0;
+ objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+ objJsonResult.data = null;
+ return objJsonResult;
+ }
+ }
}
}
--
Gitblit v1.9.1