From 2df469d76274eee773d8e247659f9ee09eed67b5 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期四, 07 九月 2023 10:23:32 +0800
Subject: [PATCH] 任务汇报单:子表记录源单

---
 WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs |  119 ++++++++++++++++++++++-------------------------------------
 1 files changed, 44 insertions(+), 75 deletions(-)

diff --git "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs" "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
index bd5d3b4..44b6bdf 100644
--- "a/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
+++ "b/WebAPI/Controllers/\351\241\271\347\233\256\347\256\241\347\220\206/\345\267\245\344\275\234\344\273\273\345\212\241/PM_WorkTaskBillController.cs"
@@ -992,6 +992,10 @@
             public string HReportNote;
             public string HAdv;
             public string HRemarkSub;
+            public int HSourceInterID;
+            public int HSourceEntryID;
+            public string HSourceBillNo;
+            public string HSourceBillType;
         }
         #endregion
         #region 椤圭洰闃舵娓呭崟 鏂板/缂栬緫-淇濆瓨
@@ -1186,7 +1190,7 @@
                     oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "鏂板浠诲姟姹囨姤锛�" + HBillNo + "','LMES-浠诲姟姹囨姤妯″潡','" + DBUtility.ClsPub.IPAddress + "','鏂板鍗曟嵁'", ref DBUtility.ClsPub.sExeReturnInfo);
                 }
                 //淇濆瓨瀛愯〃
-                objJsonResult = AddBillSub_WorkTaskReportBill(msg3, HInterID, HBillNo, OperationType, HProID, HProjectStageID, HMainSourceBillType, HMainSourceBillNo);
+                objJsonResult = AddBillSub_WorkTaskReportBill(msg3, HInterID, HBillNo, OperationType);
 
                 if (objJsonResult.code == "0")
                 {
@@ -1214,88 +1218,53 @@
         }
         #endregion
         #region 娣诲姞椤圭洰闃舵娓呭崟 瀛愯〃
-        public json AddBillSub_WorkTaskReportBill(string msg3, long HInterID, string HBillNo, int OperationType, int HSourceInterID, int HSourceEntryID, string HSourceBillType, string HSourceBillNo)
+        public json AddBillSub_WorkTaskReportBill(string msg3, long HInterID, string HBillNo, int OperationType)
         {
             List<PM_WorkTaskReportBill_Sub> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PM_WorkTaskReportBill_Sub>>(msg3);
             int i = 0;                                          //浣滀负瀛愯〃鍐呯爜
-            if(OperationType == 4) {
-                foreach (PM_WorkTaskReportBill_Sub oSub in DetailColl)
-                {
-                    i++;                                            //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
-
-                    int HEntryID = i;
-                    string HProNumber = oSub.HProNumber;
-                    int HProjectStageID = oSub.HProjectStageID;
-                    string HName = oSub.HName;
-                    string HTaskNote = oSub.HTaskNote;
-                    string HType = oSub.HType;
-                    double HRelTimes = oSub.HRelTimes;
-                    string HReportNote = oSub.HReportNote;
-                    string HAdv = oSub.HAdv;
-                    string HRemark = oSub.HRemarkSub;
-
-                    string sql = "insert into PM_WorkTaskReportBillSub" +
-                        "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo) " +
-                        "values(" +
-                        "" + HInterID +
-                        ",'" + HBillNo +
-                        "'," + HEntryID +
-                        ",'" + HRemark +
-                        "','" + HProNumber +
-                        "'," + HProjectStageID +
-                        ",'" + HName +
-                        "','" + HTaskNote +
-                        "','" + HType +
-                        "'," + HRelTimes +
-                        ",'" + HReportNote +
-                        "','" + HAdv +
-                        "'," + HSourceInterID +
-                        "," + HSourceEntryID +
-                        ",'" + HSourceBillType +
-                        "','" + HSourceBillNo +
-                        "')";
-
-                    oCN.RunProc(sql);
-                }
-            }
-            else
+            foreach (PM_WorkTaskReportBill_Sub oSub in DetailColl)
             {
-                foreach (PM_WorkTaskReportBill_Sub oSub in DetailColl)
-                {
-                    i++;                                            //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+                i++;                                            //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
 
-                    int HEntryID = i;
-                    string HProNumber = oSub.HProNumber;
-                    int HProjectStageID = oSub.HProjectStageID;
-                    string HName = oSub.HName;
-                    string HTaskNote = oSub.HTaskNote;
-                    string HType = oSub.HType;
-                    double HRelTimes = oSub.HRelTimes;
-                    string HReportNote = oSub.HReportNote;
-                    string HAdv = oSub.HAdv;
-                    string HRemark = oSub.HRemarkSub;
+                int HEntryID = i;
+                string HProNumber = oSub.HProNumber;
+                int HProjectStageID = oSub.HProjectStageID;
+                string HName = oSub.HName;
+                string HTaskNote = oSub.HTaskNote;
+                string HType = oSub.HType;
+                double HRelTimes = oSub.HRelTimes;
+                string HReportNote = oSub.HReportNote;
+                string HAdv = oSub.HAdv;
+                string HRemark = oSub.HRemarkSub;
+                int HSourceInterID = oSub.HSourceInterID;
+                int HSourceEntryID = oSub.HSourceEntryID;
+                string HSourceBillNo = oSub.HSourceBillNo;
+                string HSourceBillType = oSub.HSourceBillType;
 
-                    string sql = "insert into PM_WorkTaskReportBillSub" +
-                        "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv) " +
-                        "values(" +
-                        "" + HInterID +
-                        ",'" + HBillNo +
-                        "'," + HEntryID +
-                        ",'" + HRemark +
-                        "','" + HProNumber +
-                        "'," + HProjectStageID +
-                        ",'" + HName +
-                        "','" + HTaskNote +
-                        "','" + HType +
-                        "'," + HRelTimes +
-                        ",'" + HReportNote +
-                        "','" + HAdv +
-                        "')";
 
-                    oCN.RunProc(sql);
-                }
+                string sql = "insert into PM_WorkTaskReportBillSub" +
+                    "(HInterID,HBillNo_bak,HEntryID,HRemark,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo) " +
+                    "values(" +
+                    "" + HInterID +
+                    ",'" + HBillNo +
+                    "'," + HEntryID +
+                    ",'" + HRemark +
+                    "','" + HProNumber +
+                    "'," + HProjectStageID +
+                    ",'" + HName +
+                    "','" + HTaskNote +
+                    "','" + HType +
+                    "'," + HRelTimes +
+                    ",'" + HReportNote +
+                    "','" + HAdv +
+                    "'," + HSourceInterID +
+                    "," + HSourceEntryID +
+                    ",'" + HSourceBillType +
+                    "','" + HSourceBillNo +
+                    "')";
+
+                oCN.RunProc(sql);
             }
-            
 
             objJsonResult.code = "1";
             objJsonResult.count = 1;

--
Gitblit v1.9.1