From 493c053a3fbc2db47c46ca46944ed911de84b0a9 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 26 十月 2023 13:19:18 +0800
Subject: [PATCH] 应付收款单

---
 WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs |   41 +++++++++++++++++++++++++++--------------
 1 files changed, 27 insertions(+), 14 deletions(-)

diff --git a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
index 0250992..14811d3 100644
--- a/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
+++ b/WebAPI/Controllers/SCGL/Sc_MESTransFerWorkBillController.cs
@@ -1,4 +1,5 @@
 锘縰sing DBUtility;
+using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
@@ -129,10 +130,11 @@
                     }
 
                     DBUtility.ClsPub.CurUserName = oItem.HMaker;
-                    oItem.HBillType = "3787";
-                    oItem.HBillSubType = "3787";
+                    oItem.HBillType = "4502";
+                    oItem.HBillSubType = "4502";
                     oItem.HBillStatus = 1;   //鍗曟嵁鐘舵�侊紙1鏈锛�2瀹℃牳閫氳繃锛�3鍏抽棴锛�4浣滃簾锛�5瀹℃牳閫�鍥�,6瀹℃牳涓�,7宸查槄锛�8宸插洖澶嶏紝9缁撴锛�10楠岃瘉,11涓嬭揪锛�12寮�宸�,13鐢宠瀹℃壒,15鐢宠妫�楠岋紝16 鍒ゅ畾鍚堟牸锛�17鍒ゅ畾涓嶅悎鏍硷級     
                     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"));
                     if (DBUtility.ClsPub.isStrNull(oItem.HDate) == "")
                     {
@@ -373,6 +375,8 @@
         {
             try
             {
+                List<object> columnNameList = new List<object>();
+
                 //鏌ョ湅鏉冮檺
                 if (!DBUtility.ClsPub.Security_Log("OA_ErrMsgBackBill_Query", 1, false, user))
                 {
@@ -383,23 +387,32 @@
                     return objJsonResult;
                 }
 
-                ds = Get_TransFerBillList(sWhere);
-                if (ds == null)
+                if (sWhere == null || sWhere.Equals(""))
                 {
-                    objJsonResult.code = "0";
-                    objJsonResult.count = 0;
-                    objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
+                    string sql = "select * from h_v_OA_ErrMsgBackBillList order by 鍗曟嵁鍙� desc";
+                    ds = oCN.RunProcReturn(sql, "p_v_OA_ErrMsgBackBillList");
                 }
                 else
                 {
-                    objJsonResult.code = "1";
-                    objJsonResult.count = 1;
-                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
-                    objJsonResult.data = ds.Tables[0];
-                    return objJsonResult;
+                    string sql1 = "select * from h_v_OA_ErrMsgBackBillList where 1 = 1 ";
+                    string sql = sql1 + sWhere + " order by 鍗曟嵁鍙� desc";
+                    ds = oCN.RunProcReturn(sql, "p_v_OA_ErrMsgBackBillList");
                 }
+
+                //娣诲姞鍒楀悕
+                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)
             {

--
Gitblit v1.9.1