From dc719f0fc2d595a3b4ad51415a8bcf2b8eecde44 Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期五, 06 十二月 2024 16:52:48 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs |   90 +++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 90 insertions(+), 0 deletions(-)

diff --git a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
index 93e8a5a..543ee6c 100644
--- a/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
+++ b/WebAPI/Controllers/CJGL/Cj_StationOutBillController.cs
@@ -3976,5 +3976,95 @@
             }
         }
         #endregion
+
+        #region 缂栬緫椤甸潰鏍规嵁id鑾峰彇宸ュ簭鍑虹珯姹囨姤鍗曚俊鎭�
+        [Route("Cj_StationOutBill/SetBillTime")]
+        [HttpGet]
+        public object SetBillTime(int HInterID,DateTime dateTime,string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夌紪杈戞潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Cj_StationOutBill_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍑虹珯鍗曟棤缂栬緫鏉冮檺!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                string sql = "select * from Sc_StationOutBillMain  with(nolock) where HInterID=" + HInterID;
+                ds = oCN.RunProcReturn(sql, "Sc_StationOutBillMain");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇敼澶辫触娌℃壘鍒扮浉鍏冲嚭绔欐眹鎶ュ崟";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //淇敼鍓嶆椂闂翠慨鏀瑰悗鏃堕棿鍒ゆ柇鏈夋棤宸ヨ祫璁$畻
+                string HGroupID = ds.Tables[0].Rows[0]["HGroupID"].ToString();
+                string HOldDate = ds.Tables[0].Rows[0]["HDate"].ToString();
+                string sql1 = "select * from Pay_SingleBalBillMain where HGroupID =" +HGroupID + " and HDate ='" + HOldDate + "'";
+                string sql2 = "select * from Pay_GroupBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + HOldDate + "'";
+                string sql3 = "select * from Pay_SingleBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + dateTime + "'";
+                string sql4 = "select * from Pay_GroupBalBillMain where HGroupID =" + HGroupID + " and HDate ='" + dateTime + "'";
+                ds = oCN.RunProcReturn(sql1, "Sc_StationOutBillMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + HOldDate;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ds = oCN.RunProcReturn(sql2, "Sc_StationOutBillMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + HOldDate;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ds = oCN.RunProcReturn(sql3, "Sc_StationOutBillMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + dateTime;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ds = oCN.RunProcReturn(sql4, "Sc_StationOutBillMain");
+                if (ds.Tables[0].Rows.Count > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇敼澶辫触璇ユ椂闂寸彮缁勫凡璁$畻宸ヨ祫:" + dateTime;
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //淇敼鏃堕棿
+                sql = "update Sc_StationOutBillMain set HDate = '" + dateTime + "' where HInterID = " + HInterID;
+                oCN.RunProcReturn(sql, "Sc_StationOutBillMain");
+                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 = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1