From 50c163d99127dd1af9526646c0a41438e9d2b486 Mon Sep 17 00:00:00 2001
From: yusijie <ysj@hz-kingdee.com>
Date: 星期二, 30 一月 2024 13:18:00 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API

---
 WebAPI/Controllers/工资管理/Pay_ErrWorkTimesRequestBillController.cs |  117 ++++++++++++++++++++++++++++++++++++++++------------------
 1 files changed, 81 insertions(+), 36 deletions(-)

diff --git "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs" "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs"
index 87789e0..e8753ec 100644
--- "a/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs"
+++ "b/WebAPI/Controllers/\345\267\245\350\265\204\347\256\241\347\220\206/Pay_ErrWorkTimesRequestBillController.cs"
@@ -205,19 +205,27 @@
                 string HBackerDate = mainList[0].HBackerDate;
                 string HBackRemark = mainList[0].HBackRemark;
 
-
-                //if (OperationType == 2)
-                //{
-                //    ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain");
-                //    if (ds.Tables[0].Rows.Count > 0)
-                //    {
-                //        objJsonResult.code = "0";
-                //        objJsonResult.count = 0;
-                //        objJsonResult.Message = "鍗曟嵁鍙烽噸澶�,璇烽噸鏂拌緭鍏�!";
-                //        objJsonResult.data = null;
-                //        return objJsonResult;
-                //    }
-                //}
+                //淇濆瓨鍓嶆帶鍒�
+                DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_BeforeSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ErrWorkTimesRequestBill_BeforeSaveCtrl");
+                if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨鍓嶅垽鏂け璐ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
 
                 ds = oCN.RunProcReturn("select * from Pay_ErrWorkTimesRequestBillMain where HInterID = " + HInterID + " and HBillNo = '" + HBillNo + "'", "Pay_ErrWorkTimesRequestBillMain");
 
@@ -300,11 +308,35 @@
                     return objJsonResult;
                 }
 
-                objJsonResult.code = "1";
-                objJsonResult.count = 1;
-                objJsonResult.Message = null;
-                objJsonResult.data = null;
-                return objJsonResult;
+                //淇濆瓨鍚庢帶鍒�
+                DataSet AfterDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_AfterSaveCtrl " + HInterID.ToString() + ",'" + HBillNo + "'," + OperationType.ToString(), "h_p_Pay_ErrWorkTimesRequestBill_AfterSaveCtrl");
+                if (AfterDs == null || AfterDs.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "淇濆瓨鍚庡垽鏂け璐ワ紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    if (DBUtility.ClsPub.isLong(AfterDs.Tables[0].Rows[0]["HBack"]) == 1)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛�" + DBUtility.ClsPub.isStrNull(AfterDs.Tables[0].Rows[0]["HRemark"]);
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = null;
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
             }
             catch (Exception e)
             {
@@ -579,26 +611,32 @@
                 //Type 1 瀹℃牳  2  鍙嶅鏍�
                 if (Type == 1)
                 {
-                    //鍒ゆ柇鍗曟嵁鏄惁宸茬粡瀹℃牳
-                    DataSet ds;
-                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
-                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
-                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+                    //瀹℃牳鍓嶆帶鍒�
+                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_BeforeCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Pay_ErrWorkTimesRequestBill_BeforeCheckCtrl");
+                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                     {
-                        if (ds.Tables[0].Rows[0]["HChecker"] != null && ds.Tables[0].Rows[0]["HChecker"].ToString() != "")
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "瀹℃牳鍓嶅垽鏂け璐ワ紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
-                            objJsonResult.Message = "鍗曟嵁宸插鏍�!涓嶉渶瑕佸啀瀹℃牳!";
+                            objJsonResult.Message = "瀹℃牳澶辫触锛�" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
                     }
                     //瀹℃牳鍗曟嵁
-                    if (!BillOld.CheckBill(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+                    if (!BillOld.CheckBill(Int64.Parse(HInterID), "", "h_p_Pay_ErrWorkTimesRequestBill_AfterCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                     {
                         objJsonResult.code = "0";
-                        objJsonResult.count = 1;
+                        objJsonResult.count = 0;
                         objJsonResult.Message = "瀹℃牳澶辫触!鍘熷洜:" + ClsPub.sExeReturnInfo;
                         objJsonResult.data = null;
                         return objJsonResult;
@@ -606,26 +644,33 @@
                 }
                 else
                 {
-                    //鍒ゆ柇鍗曟嵁鏄惁宸茬粡鍙嶅鏍�
-                    DataSet ds;
-                    string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
-                    ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
-                    if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
+                    //鍙嶅鏍稿墠鎺у埗
+                    DataSet BeforeDs = oCN.RunProcReturn("Exec h_p_Pay_ErrWorkTimesRequestBill_BeforeUnCheckCtrl " + HInterID.ToString() + ",'" + user + "'", "h_p_Pay_ErrWorkTimesRequestBill_BeforeUnCheckCtrl");
+                    if (BeforeDs == null || BeforeDs.Tables[0].Rows.Count == 0)
                     {
-                        if (ds.Tables[0].Rows[0]["HChecker"] == null || ds.Tables[0].Rows[0]["HChecker"].ToString() == "")
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍙嶅鏍稿墠鍒ゆ柇澶辫触锛�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        if (DBUtility.ClsPub.isLong(BeforeDs.Tables[0].Rows[0]["HBack"]) == 1)
                         {
                             objJsonResult.code = "0";
                             objJsonResult.count = 0;
-                            objJsonResult.Message = "鍗曟嵁宸插弽瀹℃牳!涓嶉渶瑕佸啀鍙嶅鏍�!";
+                            objJsonResult.Message = "鍙嶅鏍稿け璐ワ紒" + DBUtility.ClsPub.isStrNull(BeforeDs.Tables[0].Rows[0]["HRemark"]);
                             objJsonResult.data = null;
                             return objJsonResult;
                         }
                     }
+
                     //鍙嶅鏍稿崟鎹�
-                    if (!BillOld.AbandonCheck(Int64.Parse(HInterID), ref ClsPub.sExeReturnInfo))
+                    if (!BillOld.AbandonCheck(Int64.Parse(HInterID), "", "h_p_Pay_ErrWorkTimesRequestBill_AfterUnCheckCtrl", user, ref ClsPub.sExeReturnInfo))
                     {
                         objJsonResult.code = "0";
-                        objJsonResult.count = 1;
+                        objJsonResult.count = 0;
                         objJsonResult.Message = "鍙嶅鏍稿け璐�!鍘熷洜:" + ClsPub.sExeReturnInfo;
                         objJsonResult.data = null;
                         return objJsonResult;

--
Gitblit v1.9.1