From 00d2dab9f1367067b27906be93a43949beb43aa7 Mon Sep 17 00:00:00 2001
From: duhe <226547893@qq.com>
Date: 星期一, 18 九月 2023 15:42:14 +0800
Subject: [PATCH] 1

---
 WarM/条码打印/Kf_WeighToBarCode_StationOutBill.cs             |   13 +
 WebAPI/Web.config                                         |    6 
 WebAPI/Controllers/BaseSet/Gy_SourceController.cs         |  356 ++++++++++++++++++++++++++++++++++++++++++++++++++
 WebAPI/Controllers/项目管理/工作任务/PM_WorkTaskBillController.cs |   23 ++-
 4 files changed, 384 insertions(+), 14 deletions(-)

diff --git "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs" "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs"
index a00df63..5822cc5 100644
--- "a/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs"
+++ "b/WarM/\346\235\241\347\240\201\346\211\223\345\215\260/Kf_WeighToBarCode_StationOutBill.cs"
@@ -594,6 +594,11 @@
                 MessageBox.Show("宸ュ簭涓嶅厑璁镐负绌猴紝璇峰厛杈撳叆娴佹按鍙峰悗鍥炶溅纭锛�", "鎻愮ず");
                 return false;
             }
+            else if (DBUtility.ClsPub.isInt(txtHProcNo.Text) == 0)
+            {
+                MessageBox.Show("璇疯緭鍏ユ纭祦姘村彿锛�", "鎻愮ず");
+                return false;
+            }
             else if (DBUtility.ClsPub.isLong(txtHSourceID.Tag) == 0)
             {
                 MessageBox.Show("鐢熶骇璧勬簮涓嶅厑璁镐负绌猴紝璇峰厛閫夋嫨鐢熶骇璧勬簮锛�", "鎻愮ず");
@@ -973,13 +978,13 @@
         {
             if (e.KeyCode == Keys.Return)
             {
-                if (txtHProcNo.Text == "")
+                if (DBUtility.ClsPub.isLong(txtHProcNo.Text) == 0)
                 {
-                    MessageBox.Show("娴佹按鍙蜂负绌猴紝璇疯緭鍏ユ祦姘村彿锛�");
+                    MessageBox.Show("娴佹按鍙蜂负绌烘垨鎵�杈撳叆娴佹按鍙蜂笉姝g‘锛岃閲嶆柊杈撳叆娴佹按鍙凤紒");
                     return;
                 }
                 //鏍规嵁杞崱涓籌D銆佹祦姘村彿甯﹀嚭娴佽浆鍗′笂鐩稿簲宸ュ簭銆佺彮缁勩�佸伐浣滀腑蹇冦�佺敓浜ц祫婧�
-                DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetBCPWeighSource_HProcNo " + HProcessExchangeInterID.ToString() + "," + txtHProcNo.Text, "h_p_KF_GetBCPWeighSource_HProcNo");
+                DataSet Ds = oCn.RunProcReturn("exec h_p_KF_GetBCPWeighSource_HProcNo2 " + HProcessExchangeInterID.ToString() + "," + DBUtility.ClsPub.isLong(txtHProcNo.Text) + ",'" + DBUtility.ClsPub.CurUserID + "'", "h_p_KF_GetBCPWeighSource_HProcNo2");
                 if (Ds == null || Ds.Tables[0].Rows.Count == 0)
                 {
                     txtHProcNo.Text = "";
@@ -991,7 +996,7 @@
                     txtHGroupID.Text = "";
                     txtHSourceID.Tag = 0;
                     txtHSourceID.Text = "";
-                    MessageBox.Show("鎵�杈撳叆娴佹按鍙蜂笉鍦ㄥ綋鍓嶅伐搴忔祦杞崱涓嬶紝璇烽噸鏂拌緭鍏ユ祦姘村彿锛�");
+                    MessageBox.Show("鎵�杈撳叆娴佹按鍙蜂笉鍦ㄥ綋鍓嶅伐搴忔祦杞崱涓嬫垨鐢ㄦ埛鏈叧鑱旇娴佹按鍙锋墍瀵瑰簲鐩稿叧宸ュ簭锛岃閲嶆柊杈撳叆娴佹按鍙凤紒");
                     return;
                 }
                 else
diff --git a/WebAPI/Controllers/BaseSet/Gy_SourceController.cs b/WebAPI/Controllers/BaseSet/Gy_SourceController.cs
index 2dd8b65..e5bed9c 100644
--- a/WebAPI/Controllers/BaseSet/Gy_SourceController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_SourceController.cs
@@ -6,7 +6,10 @@
 using System.Collections.Generic;
 using System.Data;
 using System.Data.SqlClient;
+using System.IO;
+using System.Web;
 using System.Web.Http;
+using WebAPI.Controllers.SCGL.鏃ヨ鍒掔鐞�;
 using WebAPI.Models;
 using WebAPI.Service;
 
@@ -307,6 +310,359 @@
             return model;
         }
 
+        #region 鐢熶骇璧勬簮 鏂囦欢涓婁紶
+        [Route("Gy_Source/Gy_Source_Excel")]
+        [HttpPost]
+        public object Gy_Source_Excel()
+        {
+            try
+            {
+                //鑾峰彇鏂囦欢鍚嶇О
+                var file = HttpContext.Current.Request.Files[0];
+                //鑾峰彇鏂囦欢鐗╃悊璺緞
+                string ExcelPath = HttpContext.Current.Server.MapPath("~/" + file.FileName);
+                //淇濆瓨鏂囦欢
+                file.SaveAs(ExcelPath);
+
+                NpoiHelper np = new NpoiHelper();
+                DataSet ExcelDs = np.ReadExcel(ExcelPath, 1, 1, "0");
+
+                //鍒犻櫎鏂囦欢
+                File.Delete(ExcelPath);
+
+                //鍒涘缓涓存椂琛�
+                DataTable tb2 = new DataTable("dt2");
+
+                //娣诲姞鍒楀悕
+                for (int i = 0; i < ExcelDs.Tables[0].Columns.Count; i++)
+                {
+                    tb2.Columns.Add(ExcelDs.Tables[0].Rows[0][i].ToString());
+                }
+
+                //妯℃澘缂哄皯鍒� 浣嗛渶瑕佷粠鏁版嵁搴撲腑鏌ヨ鍑烘潵鏄剧ず鍦ㄩ〉闈㈢殑瀛楁
+                tb2.Columns.Add("HOrgID", typeof(Int32));//缁勭粐ID
+                tb2.Columns.Add("HDeptID", typeof(Int32));//閮ㄩ棬ID
+                tb2.Columns.Add("HEmpID", typeof(Int32));//璐熻矗浜篒D
+                tb2.Columns.Add("HWorkCenterID", typeof(Int32));//宸ヤ綔涓績ID
+
+                //娣诲姞鏁版嵁
+                for (int i = 1; i < ExcelDs.Tables[0].Rows.Count; i++)
+                {
+                    DataRow row = tb2.NewRow();
+                    for (int j = 0; j < ExcelDs.Tables[0].Columns.Count; j++)
+                    {
+                        row[j] = ExcelDs.Tables[0].Rows[i][j].ToString();
+                    }
+                    tb2.Rows.Add(row);
+                }
+
+
+                var error = "";
+
+                //鏌ヨ宸ヨ壓璺嚎娌℃湁鐨勫垪
+                if (!tb2.Columns.Contains("缁勭粐浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愮粍缁囦唬鐮併�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("缁勭粐鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愮粍缁囧悕绉般�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鐢熶骇璧勬簮鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愮敓浜ц祫婧愬悕绉般�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鐢熶骇璧勬簮浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愮敓浜ц祫婧愪唬鐮併�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("閮ㄩ棬浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愰儴闂ㄤ唬鐮併�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("閮ㄩ棬鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愰儴闂ㄥ悕绉般�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("璐熻矗浜轰唬鐮�"))
+                    error += "娌℃湁鎵惧埌銆愯礋璐d汉浠g爜銆戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("璐熻矗浜�"))
+                    error += "娌℃湁鎵惧埌銆愯礋璐d汉銆戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("宸ヤ綔涓績浠g爜"))
+                    error += "娌℃湁鎵惧埌銆愬伐浣滀腑蹇冧唬鐮併�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("宸ヤ綔涓績鍚嶇О"))
+                    error += "娌℃湁鎵惧埌銆愬伐浣滀腑蹇冨悕绉般�戠殑鏍囬,";
+
+                if (!tb2.Columns.Contains("鍗曠彮宸ユ椂"))
+                    error += "娌℃湁鎵惧埌銆愬崟鐝伐鏃躲�戠殑鏍囬,";
+
+                if (error.Length > 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = $"Excel妯℃澘瀛樺湪閿欒,{error}\r\n";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                for (int i = 0; i <= tb2.Rows.Count - 1; i++)
+                {
+                    string HSourceName = "";
+                    string HSourceNum = "";
+                    string HORGNumber = "";
+                    string HORGName = "";
+                    string HDeptNum = "";
+                    string HDeptName = "";
+                    string HEmpNum = "";
+                    string HEmpName = "";
+                    string HCentNum = "";
+                    string HCentName = "";
+                    string HWorkTime = "";
+
+                    HSourceName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐢熶骇璧勬簮鍚嶇О"].ToString());
+                    HSourceNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鐢熶骇璧勬簮浠g爜"].ToString());
+                    HORGNumber = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐浠g爜"].ToString());
+                    HORGName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["缁勭粐鍚嶇О"].ToString());
+                    HDeptNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["閮ㄩ棬浠g爜"].ToString());
+                    HDeptName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["閮ㄩ棬鍚嶇О"].ToString());
+                    HEmpNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["璐熻矗浜轰唬鐮�"].ToString());
+                    HEmpName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["璐熻矗浜�"].ToString());
+                    HCentNum = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["宸ヤ綔涓績浠g爜"].ToString());
+                    HCentName = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["宸ヤ綔涓績鍚嶇О"].ToString());
+                    HWorkTime = DBUtility.ClsPub.isStrNull(tb2.Rows[i]["鍗曠彮宸ユ椂"].ToString());
+
+                    //妫�鏌ョ墿鏂�
+                    int index = i + 1;
+
+                    if (HORGNumber != "")
+                    {
+
+
+                        //鏌ヨ缁勭粐
+                        ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where  HNumber='" + HORGNumber + "' and Hname='" + HORGName + "'", "Xt_ORGANIZATIONS");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,缁勭粐涓嶅瓨鍦紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            tb2.Rows[i]["HOrgID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                        }
+                        string HORGid = ds.Tables[0].Rows[0]["HItemID"].ToString();
+
+
+                        //鏌ヨ閮ㄩ棬
+                        ds = oCN.RunProcReturn("select * from Gy_Department where  HNumber='" + HDeptNum + "'  and HUSEORGID=" + HORGid + "", "Gy_Department");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,閮ㄩ棬:" + HDeptName + ",涓嶅瓨鍦紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            tb2.Rows[i]["HDeptID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                        }
+
+                        //鏌ヨ璐熻矗浜�
+                        ds = oCN.RunProcReturn("select * from Gy_Employee where  HNumber='" + HEmpNum + "' and HUSEORGID=" + HORGid + "", "Gy_Employee");
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,璐熻矗浜�:" + HEmpName + ",涓嶅瓨鍦紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            tb2.Rows[i]["HEmpID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                        }
+
+                        //鏌ヨ宸ヤ綔涓績
+                        ds = oCN.RunProcReturn("select * from Gy_WorkCenter where  HNumber='" + HCentNum + "' and HUSEORGID=" + HORGid + "", "Gy_WorkCenter"); //
+
+                        if (ds.Tables[0].Rows.Count == 0)
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,璇�" + HORGName + "缁勭粐,宸ヤ綔涓績:" + HCentName + ",涓嶅瓨鍦紒";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                        else
+                        {
+                            tb2.Rows[i]["HWorkCenterID"] = ds.Tables[0].Rows[0]["HItemID"].ToString();
+                        }
+
+                        //鍗曠彮宸ユ椂
+                        if (HWorkTime == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,鍗曠彮宸ユ椂涓嶈兘涓虹┖锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        //鐢熶骇璧勬簮鍚嶇О
+                        if (HSourceName == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,鐢熶骇璧勬簮鍚嶇О涓嶈兘涓虹┖锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+
+                        //鐢熶骇璧勬簮浠g爜
+                        if (HSourceNum == "")
+                        {
+                            objJsonResult.code = "0";
+                            objJsonResult.count = 0;
+                            objJsonResult.Message = "绗�" + index + "琛�,鐢熶骇璧勬簮浠g爜涓嶈兘涓虹┖锛�";
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    else
+                    {
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "绗�" + index + "琛�,缁勭粐浠g爜涓虹┖";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                }
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = error;
+                objJsonResult.data = tb2;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region 鐢熶骇璧勬簮 瀵煎叆(淇濆瓨)
+        [Route("Gy_Source/Gy_Source_btnSave")]
+        [HttpPost]
+        public object Gy_Source_btnSave([FromBody] JObject sMainSub)
+        {
+            var _value = sMainSub["sMainSub"].ToString();
+            string msg1 = _value.ToString();
+            string[] sArray = msg1.Split(new string[] { "&鍜�" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string user = sArray[1].ToString();
+            try
+            {
+                if (!DBUtility.ClsPub.Security_Log("Gy_Source_Edit", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犱繚瀛樻潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+
+                List<object> Excel = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(msg2);
+                List<Dictionary<string, string>> list = new List<Dictionary<string, string>>();
+
+                foreach (JObject item in Excel)
+                {
+                    Dictionary<string, string> dic = new Dictionary<string, string>();
+                    foreach (var itm in item.Properties())
+                    {
+                        dic.Add(itm.Name, itm.Value.ToString());
+                    }
+                    list.Add(dic);
+                }
+
+                oCN.BeginTran();
+                int i = 1;
+                foreach (Dictionary<string, string> item in list)
+                {
+                    string HDeptID = item["HDeptID"].ToString();//閮ㄩ棬
+                    string HEmpID = item["HEmpID"].ToString();//璐熻矗浜�
+                    string HOrgID = item["HOrgID"].ToString();//缁勭粐ID
+                    string HWorkCenterID = item["HWorkCenterID"].ToString();//宸ヤ綔涓績
+                    string HsouceName = item["鐢熶骇璧勬簮鍚嶇О"].ToString();
+                    string HsouceNum = item["鐢熶骇璧勬簮浠g爜"].ToString();
+                    string HWorkTime = item["鍗曠彮宸ユ椂"].ToString();
+                    string sShortNumber;
+                    sShortNumber = DBUtility.ClsPub.GetShortNumber(HsouceName);//鐭唬鐮�
+                    if (sShortNumber.Trim() == "")
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佺煭浠g爜涓虹┖锛�";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+                    int HEndFlag = 1;//鏈骇鏍囧織
+                    int HLevel = DBUtility.ClsPub.GetLevel(HsouceName); //绛夌骇
+
+
+                    if (!DBUtility.ClsPub.AllowNumber(HsouceNum.Trim()))
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "淇濆瓨澶辫触锛佷唬鐮佷腑涓嶈兘鍑虹幇杩炵画鈥�.鈥欏苟涓旈浣嶆湯浣嶄笉鑳戒负鈥�.鈥欙紒";
+                        objJsonResult.data = 1;
+                        return objJsonResult;
+                    }
+
+                    ds = oCN.RunProcReturn("select * from Gy_Source where HNumber='" + HsouceNum + "'", "Gy_Source");
+
+                    if (ds.Tables[0].Rows.Count == 0)
+                    {
+
+                        string sql = "insert into Gy_Source(HName,HNumber,HDeptID,HEmpID,HUSEORGID,HCenterID,HWorkTimes,HShortNumber,HEndFlag,HLevel,HHelpCode,HParentID,HStopflag,HRemark,HType)" +
+                            $"values('{HsouceName}', '{HsouceNum}',{HDeptID}, {HEmpID}, '{HOrgID}', '{HWorkCenterID}', {HWorkTime},'{sShortNumber}',{HEndFlag},{HLevel},'',0,0,'','')";
+                        oCN.RunProc(sql);
+                    }
+                    else
+                    {
+                        oCN.RunProc("	update  Gy_Source set HWorkTimes=" + HWorkTime + ",HDeptID="+ HDeptID + ",HEmpID="+ HEmpID + ",HCenterID="+HWorkCenterID+"  where HNumber='" + HsouceNum +"'");
+                    }
+
+                    i++;
+                }
+
+                oCN.Commit();
+
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "瀵煎叆鎴愬姛!";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                LogService.Write(e);
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
         #region 鐢熶骇璧勬簮 鏍戝舰鍥�
         public class TreeModel
         {
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 d5bcf69..ce78f4e 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"
@@ -1010,9 +1010,10 @@
             public int HSourceEntryID;
             public string HSourceBillNo;
             public string HSourceBillType;
+            public bool HFinishFlag;
         }
         #endregion
-        #region 椤圭洰闃舵娓呭崟 鏂板/缂栬緫-淇濆瓨
+        #region 浠诲姟姹囨姤 鏂板/缂栬緫-淇濆瓨
         /// <summary>
         /// 鏂板鍗曟嵁-淇濆瓨鎸夐挳
         ///鍙傛暟锛歴tring sql銆�
@@ -1046,7 +1047,7 @@
             return objJsonResult;
         }
         #endregion
-        #region 娣诲姞 椤圭洰闃舵娓呭崟 涓昏〃
+        #region 娣诲姞 浠诲姟姹囨姤 涓昏〃
         public json AddBillMain_WorkTaskReportBill(string msg1)
         {
             string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
@@ -1169,6 +1170,8 @@
 
                     oCN.RunProc(sql);
 
+                    //鍒犻櫎瀛愯〃鏃�  鍥炲~宸ヤ綔浠诲姟鍗曞叧鑱旀暟閲忋�佸崟鎹姸鎬�
+                    oCN.RunProc("exec h_p_PM_UpDateRelation_WorkTaskToWorkTaskReport_Delete " + HInterID.ToString());
                     //鍒犻櫎瀛愯〃
                     oCN.RunProc("delete from PM_WorkTaskReportBillSub where HInterID='" + HInterID + "'");
                     //璁板綍鏃ュ織
@@ -1231,7 +1234,7 @@
             }
         }
         #endregion
-        #region 娣诲姞椤圭洰闃舵娓呭崟 瀛愯〃
+        #region 娣诲姞浠诲姟姹囨姤 瀛愯〃
         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);
@@ -1255,10 +1258,10 @@
                 int HSourceEntryID = oSub.HSourceEntryID;
                 string HSourceBillNo = oSub.HSourceBillNo;
                 string HSourceBillType = oSub.HSourceBillType;
-
+                bool HFinishFlag = oSub.HFinishFlag;
 
                 string sql = "insert into PM_WorkTaskReportBillSub" +
-                    "(HInterID,HBillNo_bak,HEntryID,HRemark,HProjectID,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo) " +
+                    "(HInterID,HBillNo_bak,HEntryID,HRemark,HProjectID,HProNumber,HProjectStageID,HName,HTaskNote,HType,HRelTimes,HReportNote,HAdv,HSourceInterID,HSourceEntryID,HSourceBillType,HSourceBillNo,HFinishFlag) " +
                     "values(" +
                     "" + HInterID +
                     ",'" + HBillNo +
@@ -1277,10 +1280,14 @@
                     "," + HSourceEntryID +
                     ",'" + HSourceBillType +
                     "','" + HSourceBillNo +
-                    "')";
+                    "'," + DBUtility.ClsPub.BoolToString(HFinishFlag) +
+                    ")";
 
                 oCN.RunProc(sql);
             }
+
+            //鍥炲~宸ヤ綔浠诲姟鍗曞叧鑱旀暟閲忋�佸崟鎹姸鎬�
+            oCN.RunProc("exec h_p_PM_UpDateRelation_WorkTaskToWorkTaskReport_Add " + HInterID.ToString());
 
             objJsonResult.code = "1";
             objJsonResult.count = 1;
@@ -1436,6 +1443,8 @@
 
                 oCN.BeginTran();
 
+                //鍒犻櫎瀛愯〃鏃�  鍥炲~宸ヤ綔浠诲姟鍗曞叧鑱旀暟閲忋�佸崟鎹姸鎬�
+                oCN.RunProc("exec h_p_PM_UpDateRelation_WorkTaskToWorkTaskReport_Delete " + HInterID.ToString());
                 oCN.RunProc("delete from PM_WorkTaskReportBillMain where HInterID = " + HInterID);
                 oCN.RunProc("delete from PM_WorkTaskReportBillSub where HInterID='" + HInterID + "'");
 
@@ -1443,7 +1452,7 @@
 
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
-                objJsonResult.Message = "Sucess锛�";
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
                 objJsonResult.data = null;
                 return objJsonResult;
             }
diff --git a/WebAPI/Web.config b/WebAPI/Web.config
index e4c50fb..fcea7eb 100644
--- a/WebAPI/Web.config
+++ b/WebAPI/Web.config
@@ -22,7 +22,7 @@
 		<!--<add key="FileIP" value="http://localhost:8082/LuBaoAPI"/>-->
 		<!--<add key="FileIP" value="http://localhost:8080/" />-->
 		<!--<add key="sUrl" value="http://183.129.128.86:9090/WEBS-WMSTest/WebService1.asmx"/>    -->
-		<add key="sUrl" value="http://192.168.110.51/WEBS-WMS/WebService1.asmx"/><!--棰滃彴寮忔満-->
+		<add key="sUrl" value="http://192.168.63.20/WEBS-WMS/WebService1.asmx"/><!--棰滃彴寮忔満-->
 		<!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> 澶忓疂-->
 		<!--<add key="sUrl" value="http://60.190.4.42:9003/WebService/WebService1.asmx" /> -->
 		<!--<add key="sUrl" value="http://10.10.130.181/WEBS-WMS/WebService1.asmx"/>    鍗氭棩绉戞妧-->
@@ -100,7 +100,7 @@
 			</basicHttpBinding>
 		</bindings>
 		<client>
-			<endpoint address="http://192.168.110.51/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
+			<endpoint address="http://192.168.63.20/WEBS-WMS/WebService1.asmx" binding="basicHttpBinding"
      bindingConfiguration="WebService1Soap" contract="Webs1.WebService1Soap"
      name="WebService1Soap" />
 		</client>
@@ -109,7 +109,7 @@
  <applicationSettings>
   <WebAPI.Properties.Settings>
    <setting name="WebAPI_WebS_WebService1" serializeAs="String">
-    <value>http://192.168.110.51/WEBS-WMS/WebService1.asmx</value>
+    <value>http://192.168.63.20/WEBS-WMS/WebService1.asmx</value>
    </setting>
   </WebAPI.Properties.Settings>
  </applicationSettings>

--
Gitblit v1.9.1