From 221e2c1be8053f750805c1335fc32b1bafe1c76b Mon Sep 17 00:00:00 2001
From: wtt <1985833171@qq.com>
Date: 星期三, 02 四月 2025 09:27:13 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/项目管理/工程项目/PM_ProjectBillController.cs |  689 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 677 insertions(+), 12 deletions(-)

diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs"
index 59fb125..cf4b219 100644
--- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs"
+++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\347\250\213\351\241\271\347\233\256/PM_ProjectBillController.cs"
@@ -10,7 +10,7 @@
 using System.Web.Http;
 using System.Windows.Forms;
 using WebAPI.Models;
-
+using SyntacticSugar.constant;
 namespace WebAPI.Controllers.椤圭洰绠$悊.宸ョ▼椤圭洰
 {
     public class PM_ProjectBillController : ApiController
@@ -48,6 +48,7 @@
         public class PM_ProjectBill_Main
         {
             public int HInterID;
+            public string HBillSubType;
             public string HBillNo;
             public string HProNumber;
             public string HProName;
@@ -100,6 +101,68 @@
             public string HProjectNote;
             public string HContacts;
             public string HContactNumber;
+
+            public int HSupplierID;                  //鍒嗗寘鍗曚綅锛坓y_supllier锛�
+            public int HMangerEmpID;                 //绠$悊鍛橈紙gy_Employee锛�
+            public string HMaterPlanDate;               //鏉愭枡璁″垝 
+            public int HWorkerID;                    //鏂藉伐鍛橈紙gy_Employee锛�
+            public double HPlanWorkTimes;               //璁″垝宸ユ湡
+            public double HRelWorkTimes;                //瀹為檯宸ユ湡
+            public string HTestDate;                    //璇曞帇鏃ユ湡
+            public int HTestCheckerID;               //璇曞帇楠屾敹浜猴紙gy_Employee锛�
+            public string HTestNote;                    //璇曞帇璁板綍锛堝瘜鏂囨湰锛�
+            public string HSewageDate;                  //鎺掓薄鏃ユ湡
+            public string HWaterSupplyDate;             //閫氭按鏃ユ湡
+            public string HWorkNote;                    //绔e伐璧勬枡锛堝瘜鏂囨湰锛�
+            public string HWorkProcNote;                //鏂藉伐瀹屾垚鎯呭喌锛堝瘜鏂囨湰锛�
+
+            public double HYuSuanMoney;                 //棰勭畻閫犱环
+            public double HHeTongMoney;                 //鍚堝悓閫犱环
+            public double HJieSuanMoney;                //缁撶畻閫犱环
+            public double HShenJiMoney;                 //瀹¤閫犱环
+            public double HCaiLiaoMoney;                //鏉愭枡璐�
+            public double HAnZhuangMoney;               //瀹夎璐�
+            public double HBanZuMoney;                  //鐝粍宸ヨ垂
+            public double HYuShouKuanMoney;             //棰勬敹娆�
+            public double HGongFeiMoney;                //宸ヨ垂缁撹处
+            public double HJieZhangMoney;				//缁撶畻缁撹处
+
+            public int HTaskClassID; //浠诲姟澶х被(Gy_TaskClass)
+            public int HTaskClassEntryID; //浠诲姟椤圭洰鍒嗙被(Gy_TaskClass)
+            public string  HTaskAddress; //浠诲姟鍦扮偣 
+            public string  HBreakStatus; //鎹熷潖鎯呭喌 
+            public string  HWaterLeakage; //婕忔按閲� 
+            public string  HPipeDiameter; //绠″緞 
+            public string  HPipeMaterial; //绠¢亾鏉愯川 
+            public string  HAlarmEmp; //鎶ユ紡浜� 
+            public string  HAlarmLink; //鎶ユ紡浜鸿仈绯荤數璇� 
+            public string  HReceEmp; //鍙楃悊浜� 
+            public string  HReceTime; //鍙楃悊鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+            public double HTaskMaterMoney; //浠诲姟鏉愭枡璐� 
+            public double HTaskSetupMoney; //浠诲姟瀹夎璐� 
+            public double HTaskOtherMoney; //浠诲姟闄勫睘璐� 
+            public double HTaskExamMoney; //浠诲姟鑰冩牳璐� 
+            public double HTaskWorkMoney; //浠诲姟宸ヨ垂 
+            public bool  HIsAccount; //鏄惁缁撹处(澶嶉�夋)
+            public string  HAccountDate; //缁撶畻缁撹处鏃ユ湡 
+            public string  HAccountWorkMoneyDate; //宸ヨ垂缁撹处鏃ユ湡 
+            public bool HIsCheckExam; //鏄惁瀹℃牳鑰冩牳璐�(澶嶉�夋)
+            public bool HIsCheckWorkMoney; //鏄惁瀹℃牳宸ヨ垂(澶嶉�夋)
+            public string  HInfoBackTime; //鍥炲鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+            public string HInfoBackMan; //鍥炲浜� 
+            public string HInfoNote; //鍥炲鍐呭(瀵屾枃鏈級 
+            public string  HTaskBTime; //浠诲姟寮�濮嬫椂闂达紙骞存湀鏃ユ椂鍒嗙锛� 
+            public string  HTaskETime; //浠诲姟瀹屽伐鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+            public string  HTaskNote; //浠诲姟璇︾粏鍐呭锛堝瘜鏂囨湰锛� 
+            public string  HTaskWorkEmp; //宸ヤ綔浜哄憳锛堝瘜鏂囨湰锛� 
+            public string  HBeginCloseValveTime; //寮�濮嬪叧闃�鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+            public string  HEndCloseValveTime; //缁撴潫鍏抽榾鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級
+            public long  HCloseValveQty; //鍏抽榾鍙暟
+            public string  HBeginOpenValveTime; //寮�濮嬪紑闃�鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+            public string  HEndOpenValveTime; //缁撴潫寮�闃�鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+            public long HOpenValveQty; //寮�闃�鍙暟
+            public string  HValveWorkEmp; //鎿嶄綔浜哄憳
+            public string  HTaskRemark; //浠诲姟澶囨敞锛堝瘜鏂囨湰锛�
 
         }
         #endregion
@@ -215,7 +278,7 @@
                 int HYear = int.Parse(mainList[0].HDate.Split('-')[0]);
                 int HPeriod = int.Parse(mainList[0].HDate.Split('-')[1]);
                 string HBillType = "4750";
-                string HBillSubType = "";
+                string HBillSubType = mainList[0].HBillSubType;
                 int HInterID = mainList[0].HInterID;
                 string HDate = mainList[0].HDate;
                 string HBillNo = mainList[0].HBillNo;
@@ -254,6 +317,71 @@
                 string HProjectNote = mainList[0].HProjectNote;
                 string HContacts = mainList[0].HContacts;
                 string HContactNumber = mainList[0].HContactNumber;
+
+
+                int HSupplierID = mainList[0].HSupplierID;                      //鍒嗗寘鍗曚綅锛坓y_supllier锛�
+                int HMangerEmpID = mainList[0].HMangerEmpID;                    //绠$悊鍛橈紙gy_Employee锛�
+                string HMaterPlanDate = mainList[0].HMaterPlanDate;             //鏉愭枡璁″垝 
+                int HWorkerID = mainList[0].HWorkerID;                          //鏂藉伐鍛橈紙gy_Employee锛�
+                double HPlanWorkTimes = mainList[0].HPlanWorkTimes;             //璁″垝宸ユ湡
+                double HRelWorkTimes = mainList[0].HRelWorkTimes;               //瀹為檯宸ユ湡
+                string HTestDate = mainList[0].HTestDate;                       //璇曞帇鏃ユ湡
+                int HTestCheckerID = mainList[0].HTestCheckerID;                //璇曞帇楠屾敹浜猴紙gy_Employee锛�
+                string HTestNote = mainList[0].HTestNote;                       //璇曞帇璁板綍锛堝瘜鏂囨湰锛�
+                string HSewageDate = mainList[0].HSewageDate;                   //鎺掓薄鏃ユ湡
+                string HWaterSupplyDate = mainList[0].HWaterSupplyDate;         //閫氭按鏃ユ湡
+                string HWorkNote = mainList[0].HWorkNote;                       //绔e伐璧勬枡锛堝瘜鏂囨湰锛�
+                string HWorkProcNote = mainList[0].HWorkProcNote;               //鏂藉伐瀹屾垚鎯呭喌锛堝瘜鏂囨湰锛�
+
+                double HYuSuanMoney = mainList[0].HYuSuanMoney;                 //棰勭畻閫犱环
+                double HHeTongMoney = mainList[0].HHeTongMoney;                 //鍚堝悓閫犱环
+                double HJieSuanMoney = mainList[0].HJieSuanMoney;               //缁撶畻閫犱环
+                double HShenJiMoney = mainList[0].HShenJiMoney;                 //瀹¤閫犱环
+                double HCaiLiaoMoney = mainList[0].HCaiLiaoMoney;               //鏉愭枡璐�
+                double HAnZhuangMoney = mainList[0].HAnZhuangMoney;             //瀹夎璐�
+                double HBanZuMoney = mainList[0].HBanZuMoney;                   //鐝粍宸ヨ垂
+                double HYuShouKuanMoney = mainList[0].HYuShouKuanMoney;         //棰勬敹娆�
+                double HGongFeiMoney = mainList[0].HGongFeiMoney;               //宸ヨ垂缁撹处
+                double HJieZhangMoney = mainList[0].HJieZhangMoney;				//缁撶畻缁撹处
+
+                int HTaskClassID = mainList[0].HTaskClassID; //浠诲姟澶х被(Gy_TaskClass)
+                int HTaskClassEntryID = mainList[0].HTaskClassEntryID; //浠诲姟椤圭洰鍒嗙被(Gy_TaskClass)
+                string HTaskAddress = mainList[0].HTaskAddress; //浠诲姟鍦扮偣 
+                string HBreakStatus = mainList[0].HBreakStatus; //鎹熷潖鎯呭喌 
+                string HWaterLeakage = mainList[0].HWaterLeakage; //婕忔按閲� 
+                string HPipeDiameter = mainList[0].HPipeDiameter; //绠″緞 
+                string HPipeMaterial = mainList[0].HPipeMaterial; //绠¢亾鏉愯川 
+                string HAlarmEmp = mainList[0].HAlarmEmp; //鎶ユ紡浜� 
+                string HAlarmLink = mainList[0].HAlarmLink; //鎶ユ紡浜鸿仈绯荤數璇� 
+                string HReceEmp = mainList[0].HReceEmp; //鍙楃悊浜� 
+                string HReceTime = mainList[0].HReceTime; //鍙楃悊鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+                double HTaskMaterMoney = mainList[0].HTaskMaterMoney; //浠诲姟鏉愭枡璐� 
+                double HTaskSetupMoney = mainList[0].HTaskSetupMoney; //浠诲姟瀹夎璐� 
+                double HTaskOtherMoney = mainList[0].HTaskOtherMoney; //浠诲姟闄勫睘璐� 
+                double HTaskExamMoney = mainList[0].HTaskExamMoney; //浠诲姟鑰冩牳璐� 
+                double HTaskWorkMoney = mainList[0].HTaskWorkMoney; //浠诲姟宸ヨ垂 
+                bool HIsAccount = mainList[0].HIsAccount; //鏄惁缁撹处(澶嶉�夋)
+                string HAccountDate = mainList[0].HAccountDate; //缁撶畻缁撹处鏃ユ湡 
+                string HAccountWorkMoneyDate = mainList[0].HAccountWorkMoneyDate; //宸ヨ垂缁撹处鏃ユ湡 
+                bool HIsCheckExam = mainList[0].HIsCheckExam; //鏄惁瀹℃牳鑰冩牳璐�(澶嶉�夋)
+                bool HIsCheckWorkMoney = mainList[0].HIsCheckWorkMoney; //鏄惁瀹℃牳宸ヨ垂(澶嶉�夋)
+                string HInfoBackTime = mainList[0].HInfoBackTime; //鍥炲鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+                string HInfoBackMan = mainList[0].HInfoBackMan; //鍥炲浜� 
+                string HInfoNote = mainList[0].HInfoNote; //鍥炲鍐呭(瀵屾枃鏈級 
+                string HTaskBTime = mainList[0].HTaskBTime; //浠诲姟寮�濮嬫椂闂达紙骞存湀鏃ユ椂鍒嗙锛� 
+                string HTaskETime = mainList[0].HTaskETime; //浠诲姟瀹屽伐鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+                string HTaskNote = mainList[0].HTaskNote; //浠诲姟璇︾粏鍐呭锛堝瘜鏂囨湰锛� 
+                string HTaskWorkEmp = mainList[0].HTaskWorkEmp; //宸ヤ綔浜哄憳锛堝瘜鏂囨湰锛� 
+                string HBeginCloseValveTime = mainList[0].HBeginCloseValveTime; //寮�濮嬪叧闃�鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+                string HEndCloseValveTime = mainList[0].HEndCloseValveTime; //缁撴潫鍏抽榾鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級
+                long HCloseValveQty = mainList[0].HCloseValveQty; //鍏抽榾鍙暟
+                string HBeginOpenValveTime = mainList[0].HBeginOpenValveTime; //寮�濮嬪紑闃�鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+                string HEndOpenValveTime = mainList[0].HEndOpenValveTime; //缁撴潫寮�闃�鏃堕棿锛堝勾鏈堟棩鏃跺垎绉掞級 
+                long HOpenValveQty = mainList[0].HOpenValveQty; //寮�闃�鍙暟
+                string HValveWorkEmp = mainList[0].HValveWorkEmp; //鎿嶄綔浜哄憳
+                string HTaskRemark = mainList[0].HTaskRemark; //浠诲姟澶囨敞锛堝瘜鏂囨湰锛�
+
+
                 if (OperationType == 2)
                 {
                     ds = oCN.RunProcReturn("select * from PM_ProjectBillMain where HBillNo ='" + HBillNo + "'", "PM_ProjectBillMain");
@@ -273,7 +401,9 @@
                 {
                     string sql = "insert into PM_ProjectBillMain" +
                         "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate,HProNumber,HProName,HCusID,HBeginDate,HEndDate,HSumMoney," +
-                        "HProMoney,HWorkMoney,HOtherMoney,HProType,HPMEmpID,HWorkEmpID,HDepEmpID,HConWorkDays,HDepDays,HLastMoney,HPayCusID,HOrgID,HMaterID,HProjectClassID,HBuildComp,HBuildAddress,HWorkNo,HReDate,HPicNo,HWorkTask,HProjectNote,HContacts,HContactNumber) " +
+                        "HProMoney,HWorkMoney,HOtherMoney,HProType,HPMEmpID,HWorkEmpID,HDepEmpID,HConWorkDays,HDepDays,HLastMoney,HPayCusID,HOrgID,HMaterID,HProjectClassID,HBuildComp,HBuildAddress,HWorkNo,HReDate,HPicNo,HWorkTask,HProjectNote,HContacts,HContactNumber" +
+                        ",HSupplierID,HMangerEmpID,HMaterPlanDate,HWorkerID,HPlanWorkTimes,HRelWorkTimes,HTestDate,HTestCheckerID,HTestNote,HSewageDate,HWaterSupplyDate,HWorkNote,HWorkProcNote,HYuSuanMoney,HHeTongMoney,HJieSuanMoney,HShenJiMoney,HCaiLiaoMoney,HAnZhuangMoney,HBanZuMoney,HYuShouKuanMoney,HGongFeiMoney,HJieZhangMoney," +
+                        "HTaskClassID,HTaskClassEntryID,HTaskAddress,HBreakStatus,HWaterLeakage,HPipeDiameter,HPipeMaterial,HAlarmEmp,HAlarmLink,HReceEmp,HReceTime,HTaskMaterMoney,HTaskSetupMoney,HTaskOtherMoney,HTaskExamMoney,HTaskWorkMoney,HIsAccount,HAccountDate,HAccountWorkMoneyDate,HIsCheckExam,HIsCheckWorkMoney,HInfoBackTime,HInfoBackMan,HInfoNote,HTaskBTime,HTaskETime,HTaskNote,HTaskWorkEmp,HBeginCloseValveTime,HEndCloseValveTime,HCloseValveQty,HBeginOpenValveTime,HEndOpenValveTime,HOpenValveQty,HValveWorkEmp,HTaskRemark)" +
                         "values(" +
                         "" + HYear +
                         "," + HPeriod +
@@ -315,7 +445,36 @@
                         "','" + HProjectNote +
                         "','" + HContacts +
                         "','" + HContactNumber +
-                        "')";
+                        "','" + HSupplierID + "'" + 
+                        ",'" + HMangerEmpID + "'" + 
+                        ",'" + HMaterPlanDate + "'" + 
+                        ",'" + HWorkerID + "'" + 
+                        ",'" + HPlanWorkTimes + "'" + 
+                        ",'" + HRelWorkTimes + "'" + 
+                        ",'" + HTestDate + "'" + 
+                        ",'" + HTestCheckerID + "'" + 
+                        ",'" + HTestNote + "'" + 
+                        ",'" + HSewageDate + "'" + 
+                        ",'" + HWaterSupplyDate + "'" + 
+                        ",'" + HWorkNote + "'" + 
+                        ",'" + HWorkProcNote + "'" + 
+                        ",'" + HYuSuanMoney + "'" + 
+                        ",'" + HHeTongMoney + "'" + 
+                        ",'" + HJieSuanMoney + "'" + 
+                        ",'" + HShenJiMoney + "'" + 
+                        ",'" + HCaiLiaoMoney + "'" + 
+                        ",'" + HAnZhuangMoney + "'" + 
+                        ",'" + HBanZuMoney + "'" + 
+                        ",'" + HYuShouKuanMoney + "'" + 
+                        ",'" + HGongFeiMoney + "'" + 
+                        ",'" + HJieZhangMoney + "'" +
+                        ",'" + HTaskClassID + "'" + ",'" + HTaskClassEntryID + "'" + ",'" + HTaskAddress + "'" + ",'" + HBreakStatus + "'" + ",'" + HWaterLeakage + "'" + ",'" + HPipeDiameter + "'" + ",'" + HPipeMaterial + "'" + 
+                        ",'" + HAlarmEmp + "'" +",'" + HAlarmLink + "'" + ",'" + HReceEmp + "'" + ",'" + HReceTime + "'" + ",'" + HTaskMaterMoney + "'" + ",'" + HTaskSetupMoney + "'" + ",'" + HTaskOtherMoney + "'" +
+                        ",'" + HTaskExamMoney + "'" + ",'" + HTaskWorkMoney + "'" + ",'" + (HIsAccount?1:0) + "'" + ",'" + HAccountDate + "'" + ",'" + HAccountWorkMoneyDate + "'" + ",'" + (HIsCheckExam ? 1 : 0) + "'" +
+                        ",'" + (HIsCheckWorkMoney ? 1 : 0) + "'" + ",'" + HInfoBackTime + "'" + ",'" + HInfoBackMan + "'" + ",'" + HInfoNote + "'" + ",'" + HTaskBTime + "'" +
+                        ",'" + HTaskETime + "'" + ",'" + HTaskNote + "'" + ",'" + HTaskWorkEmp + "'" + ",'" + HBeginCloseValveTime + "'" + ",'" + HEndCloseValveTime + "'" +
+                        ",'" + HCloseValveQty + "'" + ",'" + HBeginOpenValveTime + "'" + ",'" + HEndOpenValveTime + "'" + ",'" + HOpenValveQty + "'" + ",'" + HValveWorkEmp + "'" + ",'" + HTaskRemark + "'" +
+                        ")";
 
                     //涓昏〃
                     oCN.RunProc(sql);
@@ -325,14 +484,14 @@
                 else if (OperationType == 3 || ds.Tables[0].Rows.Count != 0)                    //缂栬緫
                 {
                     string sql = "update PM_ProjectBillMain set " +
-                        "HYear = " + HYear +
-                        ",HPeriod = " + HPeriod +
-                        ",HBillType = '" + HBillType +
-                        "',HBillSubType = '" + HBillSubType +
-                        "',HDate = '" + HDate +
-                        "',HBillNo = '" + HBillNo +
-                        "',HBillStatus = " + HBillStatus +
-                        ",HRemark = '" + HRemark +
+                        //"HYear = " + HYear +
+                        //",HPeriod = " + HPeriod +
+                        //",HBillType = '" + HBillType +
+                        //"',HBillSubType = '" + HBillSubType +
+                        //"',HDate = '" + HDate +
+                        "HBillNo = '" + HBillNo +
+                        //"',HBillStatus = " + HBillStatus +
+                        "',HRemark = '" + HRemark +
                         "',HUpdater = '" + HUpdater +
                         "',HUpdateDate = '" + HUpdaterDate +
                         "',HProNumber = '" + HProNumber +
@@ -364,6 +523,37 @@
                         "',HProjectNote ='" + HProjectNote +
                         "',HContacts ='" + HContacts +
                         "',HContactNumber ='" + HContactNumber +
+
+                        "',HSupplierID = '" + HSupplierID +
+                        "',HMangerEmpID = '" + HMangerEmpID +
+                        "',HMaterPlanDate = '" + HMaterPlanDate +
+                        "',HWorkerID = '" + HWorkerID +
+                        "',HPlanWorkTimes = '" + HPlanWorkTimes +
+                        "',HRelWorkTimes = '" + HRelWorkTimes +
+                        "',HTestDate = '" + HTestDate +
+                        "',HTestCheckerID = '" + HTestCheckerID +
+                        "',HTestNote = '" + HTestNote +
+                        "',HSewageDate = '" + HSewageDate +
+                        "',HWaterSupplyDate = '" + HWaterSupplyDate +
+                        "',HWorkNote = '" + HWorkNote +
+                        "',HWorkProcNote = '" + HWorkProcNote +
+                        "',HYuSuanMoney = '" + HYuSuanMoney +
+                        "',HHeTongMoney = '" + HHeTongMoney +
+                        "',HJieSuanMoney = '" + HJieSuanMoney +
+                        "',HShenJiMoney = '" + HShenJiMoney +
+                        "',HCaiLiaoMoney = '" + HCaiLiaoMoney +
+                        "',HAnZhuangMoney = '" + HAnZhuangMoney +
+                        "',HBanZuMoney = '" + HBanZuMoney +
+                        "',HYuShouKuanMoney = '" + HYuShouKuanMoney +
+                        "',HGongFeiMoney = '" + HGongFeiMoney +
+                        "',HJieZhangMoney = '" + HJieZhangMoney +
+                        "',HTaskClassID = '" + HTaskClassID + "',HTaskClassEntryID = '" + HTaskClassEntryID + "',HTaskAddress = '" + HTaskAddress + "',HBreakStatus = '" + HBreakStatus + "',HWaterLeakage = '" + HWaterLeakage + "',HPipeDiameter = '" + HPipeDiameter +
+                        "',HPipeMaterial = '" + HPipeMaterial + "',HAlarmEmp = '" + HAlarmEmp + "',HAlarmLink = '" + HAlarmLink + "',HReceEmp = '" + HReceEmp + "',HReceTime = '" + HReceTime + "',HTaskMaterMoney = '" + HTaskMaterMoney +
+                        "',HTaskSetupMoney = '" + HTaskSetupMoney + "',HTaskOtherMoney = '" + HTaskOtherMoney + "',HTaskExamMoney = '" + HTaskExamMoney + "',HTaskWorkMoney = '" + HTaskWorkMoney + "',HIsAccount = '" + (HIsAccount?1:0) + "',HAccountDate = '" + HAccountDate +
+                        "',HAccountWorkMoneyDate = '" + HAccountWorkMoneyDate + "',HIsCheckExam = '" + (HIsCheckExam?1:0) + "',HIsCheckWorkMoney = '" + (HIsCheckWorkMoney?1:0) + "',HInfoBackTime = '" + HInfoBackTime + "',HInfoBackMan = '" + HInfoBackMan + "',HInfoNote = '" + HInfoNote +
+                        "',HTaskBTime = '" + HTaskBTime + "',HTaskETime = '" + HTaskETime + "',HTaskNote = '" + HTaskNote + "',HTaskWorkEmp = '" + HTaskWorkEmp + "',HBeginCloseValveTime = '" + HBeginCloseValveTime + "',HEndCloseValveTime = '" + HEndCloseValveTime +
+                        "',HCloseValveQty = '" + HCloseValveQty + "',HBeginOpenValveTime = '" + HBeginOpenValveTime + "',HEndOpenValveTime = '" + HEndOpenValveTime + "',HOpenValveQty = '" + HOpenValveQty + "',HValveWorkEmp = '" + HValveWorkEmp + "',HTaskRemark = '" + HTaskRemark +
+
                         "' where HInterID = " + HInterID;
 
                     oCN.RunProc(sql);
@@ -563,6 +753,62 @@
             }
         }
         #endregion
+
+        #region 宸ョ▼椤圭洰鍒嗛〉鍒楄〃
+        [Route("PM_ProjectBill/page")]
+        [HttpGet]
+        public object PM_ProjectBillPage(string sWhere, string user, int page, int size)
+        {
+            DataSet ds;
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+
+                if (sWhere == null || sWhere.Equals(""))
+                {
+                    ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillList " + page + "," + size + ",''", "h_p_PM_ProjectBillList");
+                }
+                else
+                {
+                    sWhere = sWhere.Replace("'", "''");
+                    ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillList " + page + "," + size + ",'" + sWhere + "'", "h_p_PM_ProjectBillList");
+                }
+
+                //娣诲姞鍒楀悕
+                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 = CodeConstant.SUCCEED;
+                objJsonResult.count = int.Parse(ds.Tables[1].Rows[0]["count"].ToString());
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = CodeConstant.FAIL;
+                objJsonResult.count = CountConstant.FAIL;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
 
         #region 宸ョ▼椤圭洰 缂栬緫-椤甸潰璧嬪��
         /// <summary>
@@ -1256,6 +1502,44 @@
                 return objJsonResult;
             }
         }
+        #endregion
+
+        #region 宸ョ▼椤圭洰  浠诲姟瀹夎璐� 銆佷换鍔¤�冩牳璐广�佷换鍔¢檮灞炶垂銆佷换鍔″伐璐�  閫夋嫨椤圭洰璐圭敤鍒嗙被杩斿洖 瀵瑰簲鍒嗙被鐨勯」鐩垂鐢�
+        [Route("PM_ProjectBill/getGy_Project")]
+        [HttpGet]
+        public object getGy_Project(string HItemID)
+        {
+            try
+            {
+    
+                ds = oCN.RunProcReturn("select top 1 * from Gy_ProjectMoney where HProjectMoneyClassID='"+HItemID+ "' and isnull(HCheckEmp,'') !='' and HStopflag=0 order by HItemID desc", "Gy_ProjectMoney");
+
+                if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "璇ラ」鐩垂鐢ㄥ垎绫讳笅鐨勯」鐩垂鐢ㄦ棤鏁版嵁";
+                    objJsonResult.data = null;                 
+                    return objJsonResult;
+                }
+
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
         #endregion
 
         #region 鏈堝害闃舵璁″垝淇濆瓨/缂栬緫
@@ -5424,5 +5708,386 @@
         }
         #endregion
         #endregion
+
+
+        #region 椤圭洰璐圭敤寰呭鏍稿垪琛�
+        #region 宸ョ▼椤圭洰璐圭敤寰呭鏍稿垪琛�
+        [Route("PM_ProjectBill/NeedCheckQuery")]
+        [HttpGet]
+        public object PM_ProjectBillNeedCheckQuery(string user)
+        {
+            DataSet ds;
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //sWhere = sWhere.Replace("'", "''");
+                ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillNeedCheckQuery ", "h_p_PM_ProjectBillNeedCheckQuery");
+
+                //娣诲姞鍒楀悕
+                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 = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = CodeConstant.FAIL;
+                objJsonResult.count = CountConstant.FAIL;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ョ▼椤圭洰璐圭敤 瀹℃牳/鍙嶅鏍�
+        
+        [Route("PM_ProjectBill/AuditTaskMoney")]
+        [HttpGet]
+        public object AuditTaskMoney(string HInterID, string Type, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Pm_ProjectBill_Check", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愬鏍�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (string.IsNullOrWhiteSpace(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ClsPub.CurUserName = user;
+                BillOld.MvarItemKey = "PM_ProjectBillMain";
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                DataSet ds;
+                string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+                ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //Type 浠诲姟瀹夎璐瑰鏍告爣璁�
+                if (Type == "SetupMoneyCheck")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskSetupMoneyCheckFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskSetupMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸插鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //浠诲姟闄勫睘瀹℃牳
+                else if (Type == "OtherMoneyCheck")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskOtherMoneyCheckFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskOtherMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸插鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //浠诲姟鑰冩牳璐瑰鏍�
+                else if (Type == "ExamMoneyCheck")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskExamMoneyCheckFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskExamMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸插鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //浠诲姟宸ヨ垂瀹℃牳鏍囪
+                else if (Type == "WorkMoneyCheck")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskWorkMoneyCheckFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneyCheckFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸插鏍革紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //鍙嶅鏍歌垂鐢�
+                else if (Type == "UnCheck")
+                {
+                    
+                    oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneyCheckFlag = 0,HTaskExamMoneyCheckFlag = 0,HTaskOtherMoneyCheckFlag = 0,HTaskSetupMoneyCheckFlag = 0 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳绫诲瀷涓嶅瓨鍦紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+
+                oCN.Commit();//鎻愪氦浜嬪姟
+
+                objJsonResult.code = "0";
+                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
+
+        #endregion
+
+        #region 椤圭洰璐圭敤寰呬繚瀛樺垪琛�
+        #region 宸ョ▼椤圭洰璐圭敤寰呬繚瀛樺垪琛�
+        [Route("PM_ProjectBill/NeedSaveQuery")]
+        [HttpGet]
+        public object PM_ProjectBillNeedSaveQuery(string user)
+        {
+            DataSet ds;
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //鍒ゆ柇鏉冮檺
+                //if (!DBUtility.ClsPub.Security_Log("Cg_POInStockBillQuery", 1, false, user))
+                //{
+                //    objJsonResult.code = CodeConstant.FAIL;
+                //    objJsonResult.count = CountConstant.FAIL;
+                //    objJsonResult.Message = "鎮ㄦ病鏈夎妯″潡鏉冮檺,璇蜂笌绠$悊鍛樿仈绯伙紒";
+                //    objJsonResult.data = null;
+                //    return objJsonResult;
+                //}
+                //sWhere = sWhere.Replace("'", "''");
+                ds = oCN.RunProcReturn("exec h_p_PM_ProjectBillNeedSaveQuery ", "h_p_PM_ProjectBillNeedSaveQuery");
+
+                //娣诲姞鍒楀悕
+                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 = CodeConstant.SUCCEED;
+                objJsonResult.count = CountConstant.SUCCEED;
+                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.list = columnNameList;
+                objJsonResult.data = ds.Tables[0];
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = CodeConstant.FAIL;
+                objJsonResult.count = CountConstant.FAIL;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 宸ョ▼椤圭洰璐圭敤 淇濆瓨鍙嶄繚瀛�
+
+        [Route("PM_ProjectBill/SaveTaskMoney")]
+        [HttpGet]
+        public object SaveTaskMoney(string HInterID, string Type, string user)
+        {
+            try
+            {
+                //鍒ゆ柇鏄惁鏈夊鏍告潈闄�
+                if (!DBUtility.ClsPub.Security_Log("Pm_ProjectBill_edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳潈闄愬鏍�!";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                if (string.IsNullOrWhiteSpace(HInterID))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID涓虹┖锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                ClsPub.CurUserName = user;
+                BillOld.MvarItemKey = "PM_ProjectBillMain";
+                oCN.BeginTran();//寮�濮嬩簨鍔�
+                DataSet ds;
+                string sql = "select * from " + BillOld.MvarItemKey + " where HinterID = " + HInterID;
+                ds = oCN.RunProcReturn(sql, BillOld.MvarItemKey);
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鍗曟嵁涓嶅瓨鍦紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //Type 浠诲姟瀹夎璐瑰鏍告爣璁�
+                if (Type == "SetupMoneySave")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskSetupMoneySaveFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskSetupMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //浠诲姟闄勫睘瀹℃牳
+                else if (Type == "OtherMoneySave")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskOtherMoneySaveFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskOtherMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //浠诲姟鑰冩牳璐瑰鏍�
+                else if (Type == "ExamMoneySave")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskExamMoneySaveFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskExamMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //浠诲姟宸ヨ垂瀹℃牳鏍囪
+                else if (Type == "WorkMoneySave")
+                {
+                    if (ds.Tables[0].Rows[0]["HTaskWorkMoneySaveFlag"].ToString() == "False")
+                    {
+                        oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneySaveFlag = 1 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "璐圭敤宸蹭繚瀛橈紒";
+                        objJsonResult.data = null;
+                        return objJsonResult; ;
+                    }
+                }
+                //鍙嶅鏍歌垂鐢�
+                else if (Type == "UnSave")
+                {
+
+                    oCN.RunProcReturn("update PM_ProjectBillMain set HTaskWorkMoneySaveFlag = 0,HTaskExamMoneySaveFlag = 0,HTaskOtherMoneySaveFlag = 0,HTaskSetupMoneySaveFlag = 0 where HInterID = " + HInterID, "PM_ProjectBillMain");
+                }
+                else
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "瀹℃牳绫诲瀷涓嶅瓨鍦紒";
+                    objJsonResult.data = null;
+                    return objJsonResult; ;
+                }
+
+                oCN.Commit();//鎻愪氦浜嬪姟
+
+                objJsonResult.code = "0";
+                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
+
+        #endregion
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1