From 799a9c42f11f3f2112775c3714abab965ccce0fd Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期五, 04 十月 2024 12:52:32 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |   86 +++++++++++++------------------------------
 1 files changed, 26 insertions(+), 60 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 85d9401..d15cceb 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -2,6 +2,7 @@
 using Newtonsoft.Json;
 using Newtonsoft.Json.Linq;
 using Pub_Class;
+using SyntacticSugar.constant;
 using System;
 using System.Collections;
 using System.Collections.Generic;
@@ -1715,67 +1716,32 @@
         }
         #endregion
 
-        #region 杩斿洖宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�     20240926鏂板
-        [Route("Cj_StationOutBillController/GetSc_StationOutBillList_Json")]
+        #region 宸ュ簭鍑虹珯姹囨姤鍗曞垪琛�
+        [Route("Cj_StationOutBill/page")]
         [HttpGet]
-        public object GetSc_StationOutBillList_Json(string sWhere, string HMaker, string HBillSubType, string OperationType, string ViewName)
+        public json page(string sWhere, string user, int page, int size)
         {
+            json res = new json();
             try
             {
                 List<object> columnNameList = new List<object>();
-                //鍒ゆ柇鏉冮檺
-                if (HBillSubType == "SUB")
-                {
                     //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Sub_Query", 1, false, HMaker))
+             if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, user))
                     {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "瀹屽伐鍗曟棤鏌ヨ鏉冮檺!";
-                        objJsonResult.data = null;
-                        return objJsonResult;
+                        res.code = "0";
+                        res.count = 0;
+                        res.Message = "鍑虹珯鍗曟棤鏌ヨ鏉冮檺!";
+                        res.data = null;
+                        return res;
                     }
-                }
-                else if(OperationType == "1")
+                if (sWhere == null || sWhere.Equals(""))
                 {
-                    //鍒ゆ柇鏄惁鏈夋煡璇㈡潈闄�
-                    if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Query", 1, false, HMaker))
-                    {
-                        objJsonResult.code = "0";
-                        objJsonResult.count = 0;
-                        objJsonResult.Message = "鍑虹珯鍗曟棤鏌ヨ鏉冮檺!";
-                        objJsonResult.data = null;
-                        return objJsonResult;
-                    }
+                    ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",''", "h_p_MES_StationOutBillList");
                 }
-
-                //鑾峰彇绯荤粺鍙傛暟
-                string Ret = "";
-                if (oSystemParameter.ShowBill(ref Ret))
+                else
                 {
-                    //鍒ゆ柇瀹㈡埛涓洪緳灞辨苯閰�
-                    if (oSystemParameter.omodel.WMS_CampanyName == "榫欏北姹介厤")
-                    {
-                        //鑾峰彇闇�瑕佹嫾鎺ョ殑瀛楃涓�
-                        string sql_splice = DBUtility.ClsPub.SpliceSQL(HMaker, "宸ュ簭姹囨姤鍗曞垪琛�");
-
-                        if (sql_splice == "娌℃湁鏌ヨ鍒扮浉鍏崇敤鎴蜂俊鎭�")
-                        {
-                            objJsonResult.code = "0";
-                            objJsonResult.count = 0;
-                            objJsonResult.Message = "娌℃湁鏌ヨ鍒扮浉鍏崇敤鎴蜂俊鎭�!";
-                            objJsonResult.data = null;
-                            return objJsonResult;
-                        }
-                        else
-                        {
-                            sWhere += sql_splice;
-                        }
-                    }
+                    ds = oCN.RunProcReturn("exec h_p_MES_StationOutBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_MES_StationOutBillList");
                 }
-
-                //杩斿洖鍒楄〃淇℃伅
-                ds = oCN.RunProcReturn("select * from " + ViewName + " where 1=1 " + sWhere + " order by hmainid desc", ViewName);
 
                 //娣诲姞鍒楀悕
                 foreach (DataColumn col in ds.Tables[0].Columns)
@@ -1784,24 +1750,24 @@
                     string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                     columnNameList.Add(JsonConvert.DeserializeObject(ColmString));//鑾峰彇鍒癉ataColumn鍒楀璞$殑鍒楀悕
                 }
-                objJsonResult.code = "0";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "鎴愬姛锛�";
-                objJsonResult.data = ds.Tables[0];
-                objJsonResult.list = columnNameList;
-                return objJsonResult;
+
+                res.code = CodeConstant.SUCCEED;
+                res.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                res.Message = "Sucess锛�";
+                res.list = columnNameList;
+                res.data = ds.Tables[0];
+                return res;
             }
             catch (Exception e)
             {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鏌ヨ鍒楄〃淇℃伅澶辫触锛�" + e.ToString();
-                objJsonResult.data = null;
+                res.code = CodeConstant.FAIL;
+                res.count = CountConstant.FAIL;
+                res.Message = "Exception锛�" + e.ToString();
+                res.data = null;
                 return objJsonResult;
             }
         }
         #endregion
-
         #region 宸ュ簭鍑虹珯姹囨姤鍗� 瀛愯〃鏌ヨ
         [Route("Cj_StationOutBill/get_SubDisplay")]
         [HttpGet]

--
Gitblit v1.9.1