From 461a7bfc0a2250ec5ff4b7a85cb6ce3c2f0bf06e Mon Sep 17 00:00:00 2001
From: zrg <z18737863051@163.com>
Date: 星期二, 13 八月 2024 11:20:44 +0800
Subject: [PATCH] 1

---
 WebAPI/Controllers/BaseSet/Gy_MaterialController.cs |  413 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 406 insertions(+), 7 deletions(-)

diff --git a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
index 02ff4d3..d899f19 100644
--- a/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
+++ b/WebAPI/Controllers/BaseSet/Gy_MaterialController.cs
@@ -13,6 +13,7 @@
 using System.Windows.Forms;
 using WebAPI.Models;
 using WebAPI.Service;
+using System.Text.RegularExpressions;
 
 namespace WebAPI.Controllers
 {
@@ -113,6 +114,127 @@
                 return objJsonResult;
             }
         }
+
+        #region 鐗╂枡鏍规嵁鍒嗙被鑾峰彇鏈�澶х墿鏂欑紪鐮�
+        [Route("Gy_Material/getMaxNum")]
+        [HttpGet]
+        public object getMaxNum(int HMaterTypeID, string user, string Organization)
+        {
+            try
+            {
+                List<object> columnNameList = new List<object>();
+                //缂栬緫鏉冮檺
+                if (!DBUtility.ClsPub.Security_Log_second("Gy_Material", 1, false, user))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏃犳煡鐪嬫潈闄愶紒";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                if (HMaterTypeID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁閫夋嫨鍏蜂綋鍒嗙被锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    ds = oCN.RunProcReturn(@"select * from h_v_Gy_MaterialList where 缁勭粐鍚嶇О='" + Organization + "'" + "and HMaterTypeID = '"+ HMaterTypeID + "'" + " order by 鐗╂枡浠g爜 desc", "h_v_Gy_MaterialList");
+                    if (ds == null || ds.Tables[0].Rows.Count == 0)
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "娌℃湁鎵惧埌璇ュ垎绫荤殑鐗╂枡缂栫爜璇蜂娇鐢ㄦ櫘閫氭柊澧�";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    string HNumber = ds.Tables[0].Rows[0]["鐗╂枡浠g爜"].ToString();
+                    // 浣跨敤姝e垯琛ㄨ揪寮忔壘鍒版暟瀛楅儴鍒�  (?<=\D)鏄竴涓浂瀹芥柇瑷�锛岃〃绀哄墠闈㈢殑瀛楃涓嶆槸鏁板瓧 (\d+)$琛ㄧず鍚庨潰璺熺潃涓�杩炰覆瀛楃涓茬煡閬撴湯灏�
+                    Match match = Regex.Match(HNumber, @"(?<=\D)(\d+)$");
+                    if (match.Success)
+                    {
+                        string prefix = HNumber.Substring(0, HNumber.Length - match.Length); // 鎻愬彇鍓嶇紑  
+                        int number = int.Parse(match.Value); // 瑙f瀽鏁板瓧  
+                        // 鏁板瓧+1  
+                        number++;
+                        // 鏍煎紡鍖栨暟瀛楋紝淇濇寔鍘熼暱搴�  
+                        string formattedNumber = number.ToString().PadLeft(match.Length, '0');
+                        // 閲嶆柊缁勫悎瀛楃涓�  
+                        string result = prefix + formattedNumber;
+
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "success";
+                        objJsonResult.data = result;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "姝ゅ垎绫荤墿鏂欑紪鐮佹牸寮忔湁璇�";
+                        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
+
+        #region 鑾峰彇鐗╂枡绮惧害閫氳繃id
+        [Route("Gy_Material/getDecByID")]
+        [HttpGet]
+        public object getDecByID(int HMaterID)
+        {
+            try
+            {
+                if(HMaterID == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "娌℃湁閫夋嫨鐗╂枡";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                ds = oCN.RunProcReturn(@"select HQtyDec,HPriceDec,HMoneyDec from Gy_Material where HitemID=" + HMaterID , "Gy_Material");
+                if (ds == null || ds.Tables[0].Rows.Count == 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "娌℃湁鎵惧埌璇ョ墿鏂欑紪鐮�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "Success";
+                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
+
+
 
         /// <summary>
         /// 鐗╂枡璁剧疆鑾峰彇淇℃伅
@@ -852,7 +974,7 @@
                     return objJsonResult;
                 }
 
-                string sql1 = "select top 1000 * from h_v_IF_BarCodeBillList where 1 = 1 ";
+                string sql1 = "select top 5000 * from h_v_IF_BarCodeBillList where 1 = 1 ";
                 string sql = sql1 + sWhere + " order by hmainid desc";
                 ds = oCN.RunProcReturn(sql, "h_v_IF_BarCodeBillList");
 
@@ -1004,7 +1126,186 @@
         }
         #endregion
 
+        #region 鏉$爜涓绘。缁存姢 浣滃簾/鍙嶄綔搴�
+        /// <summary>
+        /// </summary>
+        /// <param name="HInterID">鍗曟嵁ID</param>
+        /// <param name="IsAudit">浣滃簾(0),鍙嶄綔搴�(1)</param>
+        /// <param name="CurUserName">浣滃簾浜�</param>
+        /// <returns></returns>
+        [Route("Gy_BarCodeBillList/DeleteGy_BarCodeBillList")]
+        [HttpGet]
+        public object DeleteGy_BarCodeBillList(int HInterID, int IsAudit, string CurUserName)
+        {
+            string ModRightNameCheck = "Gy_BarCodeBillList_Delete";
+            DBUtility.ClsPub.CurUserName = CurUserName;
+            try
+            {
+                //妫�鏌ユ潈闄�
+                if (!DBUtility.ClsPub.Security_Log_second(ModRightNameCheck, 1, false, CurUserName))
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "浣滃簾澶辫触锛佹棤鏉冮檺锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                //HInterID鏁版嵁鍒ゆ柇
+                if (HInterID <= 0)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "HInterID灏忎簬0锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
 
+
+                Int64 lngBillKey = 0;
+                lngBillKey = DBUtility.ClsPub.isLong(HInterID);                                         //瀵笻InterID杩涜绫诲瀷鐨勮浆鎹�
+
+                //杩涜闇�瑕佽繘琛岀殑浣滃簾/鍙嶄綔搴熸搷浣�
+                if (IsAudit == 0) //浣滃簾鎻愪氦
+                {
+                    oCN.BeginTran();
+
+                    //浣滃簾鏉$爜
+                    oCN.RunProc("update Gy_BarCodeBill set HStopflag=1,HDeleteMan='" + CurUserName + "',HDeleteDate=getdate() where HItemID in (" + HInterID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                    string sql = "select * from Gy_BarCodeBill where HItemID = " + HInterID;
+                    ds = oCN.RunProcReturn(sql, "Gy_BarCodeBill");
+                    if(ds!=null && ds.Tables[0].Rows.Count > 0)
+                    {
+                        string HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString();
+
+                        //娣诲姞鎿嶄綔鏃ュ織
+                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','浣滃簾鏉$爜锛�" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','浣滃簾'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "浣滃簾鎴愬姛";
+                        objJsonResult.data = null;
+
+                        oCN.Commit();
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "浣滃簾澶辫触!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+
+                        oCN.RollBack();
+                    }
+
+
+                    return objJsonResult;
+                }
+                if (IsAudit == 1) //鍙嶅叧闂彁浜�
+                {
+                    oCN.BeginTran();
+
+                    #region 鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇
+                    //鍙嶄綔搴熸潯鐮佸墠杩涜鍒ゆ柇------------------------------------------------------------------------------------------------------------------------------------------------------
+                    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+                    DataSet DS = oCN.RunProcReturn("exec h_p_Gy_BarCodeBill_UnCancelltion '" + HInterID + "','N'", "h_p_Gy_BarCodeBill_UnCancelltion", ref DBUtility.ClsPub.sExeReturnInfo);
+                    if (DS == null || DS.Tables[0].Rows.Count <= 0)
+                    {
+                        oCN.RollBack();
+
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛氬弽浣滃簾鏉$爜鍓嶅垽鏂彂鐢熼敊璇紒";
+                        objJsonResult.data = null;
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        if (DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0][0]) == "1")
+                        {
+                            oCN.RollBack();
+
+                            objJsonResult.code = "1";
+                            objJsonResult.count = 1;
+                            objJsonResult.Message = "鍙嶄綔搴熷け璐ワ紝鍘熷洜锛�" + DBUtility.ClsPub.isStrNull(DS.Tables[0].Rows[0]["HRemark"]);
+                            objJsonResult.data = null;
+                            return objJsonResult;
+                        }
+                    }
+                    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+                    //--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+                    #endregion
+
+                    //鍙嶄綔搴熸潯鐮�
+                    oCN.RunProc("update Gy_BarCodeBill set HStopflag=0,HDeleteMan='',HDeleteDate=null where HItemID in (" + HInterID + ")", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                    //澧炲姞鎿嶄綔鏃ュ織
+                    string sql = "select * from Gy_BarCodeBill where HItemID = " + HInterID;
+                    ds = oCN.RunProcReturn(sql, "Gy_BarCodeBill");
+                    if (ds != null && ds.Tables[0].Rows.Count > 0)
+                    {
+                        string HBarCode = ds.Tables[0].Rows[0]["HBarCode"].ToString();
+                        oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + CurUserName + "','" + DBUtility.ClsPub.ComputerName + "','鍙嶄綔搴熸潯鐮侊細" + HBarCode + "','WMS绯荤粺-鏉$爜妗f鍒楄〃妯″潡','" + DBUtility.ClsPub.IPAddress + "','鍙嶄綔搴�'", ref DBUtility.ClsPub.sExeReturnInfo);
+
+                        objJsonResult.code = "1";
+                        objJsonResult.count = 1;
+                        objJsonResult.Message = "鍙嶄綔搴熸垚鍔�";
+                        objJsonResult.data = null;
+                        oCN.Commit();
+                        return objJsonResult;
+                    }
+                    else
+                    {
+                        objJsonResult.code = "0";
+                        objJsonResult.count = 0;
+                        objJsonResult.Message = "鍙嶄綔搴熷け璐�!鍘熷洜:" + DBUtility.ClsPub.sExeReturnInfo;
+                        objJsonResult.data = null;
+                        oCN.RollBack();
+                        return objJsonResult;
+                    }
+                }
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                oCN.RollBack();
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "浣滃簾澶辫触鎴栬�呭弽浣滃簾澶辫触锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
+
+        #region[鍣ㄥ叿妗f缂栬緫鏃惰幏鍙栧瓙琛ㄦ暟鎹甝
+        [Route("Gy_MouldFileMain/Gy_MouldFileSubDetai")]
+        [HttpGet]
+        public object Gy_MouldFileSubDetai(long HInterID)
+        {
+            try
+            {
+                List<DataTable> tableList = new List<DataTable>();
+                ds = oCN.RunProcReturn("select a.*,b.HBillNo from Gy_MouldFileSub_MaintainRule AS a left join Sc_MouldMaintainRuleBillMain as b on b.HInterID = a.HMaintainRuleID where a.HInterID = " + HInterID, "Gy_MouldFileBill_MaintainRule");
+                tableList.Add(ds.Tables[0]);
+                ds = oCN.RunProcReturn("select a.*,b.HBillNo from Gy_MouldFileSub_DotCheckRule AS a left join Sc_MouldDotCheckRuleBillMain as b on b.HInterID = a.HDotCheckRuleID where a.HInterID = " + HInterID, "Gy_MouldFileBill_DotCheckRule");
+                tableList.Add(ds.Tables[0]);
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "";
+                objJsonResult.data = tableList;
+                return objJsonResult;
+            }
+            catch (Exception e)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "Exception锛�" + e.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+        #endregion
         /// <summary>
         /// 鏂板妯″叿妗f-淇濆瓨鎸夐挳
         ///鍙傛暟锛歴tring sql銆�
@@ -1031,10 +1332,9 @@
                 return objJsonResult;
             }
             //淇濆瓨涓昏〃
-            objJsonResult = AddBillMain(msg2);
+            objJsonResult = AddBillMain(msg1);
             if (objJsonResult.code == "0")
             {
-                oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = objJsonResult.Message;
@@ -1048,8 +1348,15 @@
             return objJsonResult;
         }
 
-        public json AddBillMain(string msg2)
+        public json AddBillMain(string msg1)
         {
+            string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries);
+            string msg2 = sArray[0].ToString();
+            string msg3 = sArray[1].ToString();//妯″潡鏉冮檺
+            string msg4 = sArray[2].ToString();//褰撳墠浜�
+            string msg5 = sArray[3].ToString();//瀛愯〃鏁版嵁
+            string msg6 = sArray[4].ToString();//瀛愯〃1鏁版嵁
+            string msg7 = sArray[5].ToString();//瀛愯〃2鏁版嵁
             try
             {
                 msg2 = "[" + msg2.ToString() + "]";
@@ -1130,7 +1437,6 @@
                 ",'" + HUseLife + "','" + HLeaveLife + "','" + HProdQty + "','" + HProdWeight + "','" + HMouldOWNER + "','" + HSaveLife + "','" + HMouldDotCheckRuleInterID + "','" + HMouldMaintainRuleInterID + "','" + HBarCode + "'," + HMadeSupID +
                 ",'"+ HMouldClass + "'," + HNowWHID + "," + HNowSPID + ") ");
 
-
                 //瀛愯〃
                 oCN.RunProc("Insert into Gy_MouldFileSub " +
                     " (HInterID,HEntryID,HRemark" +
@@ -1139,6 +1445,8 @@
                 " values('" + HInterID + "',0,''" +
                 ",0,0,'','',0,0 " +
                 ") ");
+
+                objJsonResult = AddBillSub(msg5,msg6,msg7,HInterID, HBillNo);
 
                 if (objJsonResult.code == "0")
                 {
@@ -1157,6 +1465,7 @@
             }
             catch (Exception e)
             {
+                oCN.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
                 objJsonResult.Message = "Exception锛�" + e.ToString();
@@ -1181,6 +1490,9 @@
             string msg2 = sArray[0].ToString();
             string msg3 = sArray[1].ToString();//妯″潡鏉冮檺
             string msg4 = sArray[2].ToString();//褰撳墠浜�
+            string msg5 = sArray[3].ToString();//瀛愯〃鏁版嵁
+            string msg6 = sArray[4].ToString();//瀛愯〃2鏁版嵁
+            string msg7 = sArray[5].ToString();//瀛愯〃3鏁版嵁
             try
             {
                 if (!DBUtility.ClsPub.Security_Log(msg3, 1, false, msg4))
@@ -1311,7 +1623,12 @@
                 //oCN.RunProc("exec h_p_Gy_UpdateNumber Gy_Department,'" + HNumber + ".','" + this.HOldNumber + ".'", ref DBUtility.ClsPub.sExeReturnInfo);
                 //灏嗕笂绾� 涓洪潪鏈骇
                 // oCN.RunProc("Update Gy_Department set HEndflag=0 where HItemID=" + HInterID, ref DBUtility.ClsPub.sExeReturnInfo);
-                //
+
+                oCN.RunProc("delete from Gy_MouldFileSub_SubMater where HInterID='" + HInterID + "'");
+                oCN.RunProc("delete from Gy_MouldFileSub_MaintainRule where HInterID='" + HInterID + "'");
+                oCN.RunProc("delete from Gy_MouldFileSub_DotCheckRule where HInterID='" + HInterID + "'");
+                objJsonResult = AddBillSub(msg5, msg6, msg7, HInterID, HBillNo);
+
                 oCN.Commit();
                 objJsonResult.code = "1";
                 objJsonResult.count = 1;
@@ -1330,6 +1647,86 @@
             }
         }
 
+        public json AddBillSub(string msg5, string msg6, string msg7, long HInterID, string HBillNo)
+        {
+            List<Gy_MouldFileSub_SubMater> DetailColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<Gy_MouldFileSub_SubMater>>(msg5);
+            List<ClsGy_MouldFileBillSub_MaintainRule> MaintainRuleColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_MouldFileBillSub_MaintainRule>>(msg6);
+
+            List<ClsGy_MouldFileBillSub_DotCheckRule> DotCheckRuleColl = Newtonsoft.Json.JsonConvert.DeserializeObject<List<ClsGy_MouldFileBillSub_DotCheckRule>>(msg7);
+            int i = 0;                                          //浣滀负瀛愯〃鍐呯爜
+            foreach (Gy_MouldFileSub_SubMater oSub in DetailColl)
+            {
+                i++;                                            //鍚屼竴涓富琛ㄤ笅鐨勫瓙琛ㄧ殑鍐呯爜鑷
+
+                int HEntryID = i;
+                string HRemark = oSub.HRemark;
+                int HMouldFileID = oSub.HMouldFileID;
+                DateTime HUnionDate = oSub.HUnionDate;
+                            
+                string sql = "insert into Gy_MouldFileSub_SubMater" +
+                    "(HInterID,HBillNo_bak,HEntryID,HRemark,HMouldFileID,HUnionDate) " +
+                    "values(" +
+                    "" + HInterID +
+                    ",'" + HBillNo +
+                    "'," + HEntryID +
+                    ",'" + HRemark +
+                    "','" + HMouldFileID +
+                    "','" + HUnionDate +                   
+                    "')";
+
+                oCN.RunProc(sql);
+            }
+            i = 0;
+            //淇濆瓨淇濆吇瑙勬牸
+            foreach (ClsGy_MouldFileBillSub_MaintainRule oSub in MaintainRuleColl)
+            {
+                i++;
+                Int64 NewHEntryID = i;
+                Int64 newHFlag = 1;
+                if (oSub.HStdFlag == true)
+                {
+                    newHFlag = 1;
+                }
+                else
+                {
+                    newHFlag = 0;
+                }
+                oCN.RunProc($@"Insert into Gy_MouldFileSub_MaintainRule 
+                (HInterID,HBillNo_bak,HEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,
+                 HMaintainRuleID,HStdFlag
+	            ) 
+                 values({HInterID},'{HBillNo}',{NewHEntryID},'{oSub.HRemark}',{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney}
+                ,{oSub.HMaintainRuleID},{newHFlag})");
+            }
+            i = 0;
+            //淇濆瓨鐐规瑙勭▼
+            foreach (ClsGy_MouldFileBillSub_DotCheckRule oSub in DotCheckRuleColl)
+            {
+                i++;
+                Int64 NewHEntryID = i;
+                Int64 newHFlag = 1;
+                if (oSub.HStdFlag == true)
+                {
+                    newHFlag = 1;
+                }
+                else
+                {
+                    newHFlag = 0;
+                }
+                oCN.RunProc($@"Insert into Gy_MouldFileSub_DotCheckRule 
+                (HInterID,HBillNo_bak,HEntryID,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,
+                 HDotCheckRuleID,HStdFlag
+	            ) 
+                 values({HInterID},'{HBillNo}',{NewHEntryID},'{oSub.HRemark}',{oSub.HSourceInterID},{oSub.HSourceEntryID},'{oSub.HSourceBillNo}','{oSub.HSourceBillType}',{oSub.HRelationQty},{oSub.HRelationMoney}
+                ,{oSub.HDotCheckRuleID},{newHFlag})");
+            }
+
+            objJsonResult.code = "1";
+            objJsonResult.count = 1;
+            objJsonResult.Message = null;
+            objJsonResult.data = null;
+            return objJsonResult;
+        }
 
         /// <summary>
         /// 纾ㄥ叿妗f淇敼鎸夐挳鏂规硶-璁$畻涓嬫淇濆吇/鏍℃鏃ユ湡-鑾峰彇妗f鏈�杩戜竴娆$殑淇濆吇璁板綍
@@ -1417,6 +1814,8 @@
                 }
                 if (oBill.DeleteBill(hmainid, ref DBUtility.ClsPub.sExeReturnInfo))
                 {
+                    oCN.RunProc("Delete From Gy_MouldFileSub_MaintainRule  where HInterID=" + hmainid);
+                    oCN.RunProc("Delete From Gy_MouldFileSub_DotCheckRule  where HInterID=" + hmainid);
                     //鍐欏叆鏃ュ織
                     ClsPub.Add_Log("", "鍒犻櫎椤圭洰锛屼唬鐮侊細" + oBill.omodel.HMouldNo + ",鍚嶇О锛�" + oBill.omodel.HName, ClsPub.CurUserName);
                     //鏇存柊涓婄骇涓� 鏈骇
@@ -1674,7 +2073,7 @@
                 ,HPERUNITSTANDHOUR,HSTDLABORPREPARETIME,HSTDMACHINEPREPARETIME
                  )
                 values
-                ({jsonData.HItemID},{jsonData.HERPItemID},'{jsonData.HNumber}','{jsonData.HName}','{jsonData.HModel}',
+                ({jsonData.HItemID},{jsonData.HItemID},'{jsonData.HNumber}','{jsonData.HName}','{jsonData.HModel}',
                 '{jsonData.HShortNumber}',{jsonData.HParentID},{jsonData.HLevel},{jsonData.HEndFlag},{jsonData.HStopflag},'{jsonData.HRemark}',{jsonData.HMaterClsID},{jsonData.HUnitID},{jsonData.HUnitGroupID},{jsonData.HLength},{jsonData.HWidth},{jsonData.HHeight},{jsonData.HJQty},{jsonData.HMQty},'{jsonData.HOldMaterNumber}',{jsonData.HWHID},{jsonData.HSPID},'{jsonData.HPlanMode}','{jsonData.HUseFlag}','{jsonData.HMakeTime}',{jsonData.HMinPickQty},{jsonData.HCREATEORGID},{jsonData.HUSEORGID},'{jsonData.HBatchManager}',{jsonData.HCHECKINCOMING},{jsonData.HAuxPropFlag},{jsonData.HISKFPERIOD},{jsonData.HAuxUnitID},{jsonData.HSNUnitID},{jsonData.HBASEUNITID},{jsonData.HSALEUNITID},{jsonData.HSALEPRICEUNITID},{jsonData.HPERUNITSTANDHOUR},'{jsonData.HSTDLABORPREPARETIME}','{jsonData.HSTDMACHINEPREPARETIME}')";
 
                     oCN.RunProc(sql);

--
Gitblit v1.9.1