From d592d9d64ea962dcf07de2a5287cc517a1566e58 Mon Sep 17 00:00:00 2001
From: yxj <1qaz@123>
Date: 星期二, 18 一月 2022 11:02:03 +0800
Subject: [PATCH] 新增条码异常查询报表模块

---
 WebAPI/Controllers/基础资料/基础资料/Gy_StockCheckItemBillController.cs |  445 +++++++++++++++++++++++--------------------------------
 1 files changed, 188 insertions(+), 257 deletions(-)

diff --git "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs" "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs"
index 0421bde..e7c4cb2 100644
--- "a/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs"
+++ "b/WebAPI/Controllers/\345\237\272\347\241\200\350\265\204\346\226\231/\345\237\272\347\241\200\350\265\204\346\226\231/Gy_StockCheckItemBillController.cs"
@@ -16,7 +16,7 @@
         private json objJsonResult = new json();
         public DataSet ds = new DataSet();
         public SQLHelper.ClsCN oCn = new SQLHelper.ClsCN();
-        public Models.ClsGy_StockCheckItemBill BillNew0 = new Models.ClsGy_StockCheckItemBill();
+        public Models.ClsGy_StockCheckItemBill BillNew0 = new ClsGy_StockCheckItemBill();
 
         #region 鐩樼偣鏂规鍒楄〃
         [Route("Gy_StockCheckItemBill/Get_StockCheckItemList")]
@@ -254,155 +254,24 @@
         #region 鐩樼偣鍒嗘瀽鍒楄〃
         [Route("Gy_StockCheckItemBill/Get_InventoryAnalysisList")]
         [HttpGet]
-        public object Get_InventoryAnalysisList(string sWhere)
+        public object Get_InventoryAnalysisList(string sWhere,string sID)
         {
             DataSet ds;
             List<object> list = new List<object>();
-            List<object> list1 = new List<object>();//姝e父
-            List<object> list2 = new List<object>();//璋冩嫧
-            List<object> list3 = new List<object>();//鍑哄簱
-            List<object> list4 = new List<object>();//鍏堝仛棰嗙敤閫�搴撳崟锛屽啀鍋氶鐢ㄥ嚭搴撳崟
-            List<object> list5 = new List<object>();//鐩樼泩
-            List<object> list6 = new List<object>();//鐩樹簭
-            List<object> list7 = new List<object>();//閫�搴�
+            string sql;
             try
             {
                 SQLHelper.ClsCN oCN = new SQLHelper.ClsCN();
-                string sql;
-                if (sWhere != null&&sWhere!="")
+                if (sID == null || sID == "")
                 {
-                     sql = string.Format(@"select k.HBarCode 鏉$爜,m.HNumber 鍣ㄥ叿缂栧彿,s.HName 鐩樼偣鏂规,
-                        case when k.HCorrespondentTypeID=1 then '渚涘簲鍟�' when k.HCorrespondentTypeID=2 then '瀹㈡埛' when k.HCorrespondentTypeID=4 then '浠撳簱' end 瀹為檯浣嶇疆绫诲瀷,
-                        case when k.HCorrespondentTypeID=1 then p.HName when  k.HCorrespondentTypeID=2 then c.HName when k.HCorrespondentTypeID=4 then w.HName end 瀹為檯浣嶇疆,
-                        case when m.HNowSupTypeID=1 then '渚涘簲鍟�' when m.HNowSupTypeID=2 then '瀹㈡埛' when m.HNowSupTypeID=4 then '浠撳簱' end 璐﹂潰浣嶇疆绫诲瀷,
-                        case when m.HNowSupTypeID=1 then p1.HName when  m.HNowSupTypeID=2 then c1.HName when m.HNowSupTypeID=4 then w1.HName end 璐﹂潰浣嶇疆
-                        from Sc_MouldStockBillMain_Temp k 
-                        left join Gy_MouldFileMain m on k.HBarCode=m.HBarCode
-                        left join Gy_StockCheckItem s on k.HSourceInterID=s.HItemID 
-                        left join Gy_Supplier p on k.HCorrespondentID=p.HItemID
-                        left join Gy_Supplier p1 on m.HNowSupTypeID=p1.HItemID
-                        left join Gy_Customer c on k.HCorrespondentID=c.HItemID
-                        left join Gy_Customer c1 on m.HNowSupTypeID=c1.HItemID
-                        left join Gy_Warehouse w on k.HSourceInterID=w.HItemID
-                        left join Gy_Warehouse w1 on m.HNowSupTypeID=w1.HItemID
-                        where (select  HEndDate from Gy_StockCheckItem where Hitemid=(select top 1 HSourceInterID from Sc_MouldStockBillMain_Temp WHERE HSourceInterID=0))<getdate()");
+                    sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisList where " + sWhere);
                 }
                 else
                 {
-                     sql = string.Format(@"select k.HBarCode 鏉$爜,m.HNumber 鍣ㄥ叿缂栧彿,s.HName 鐩樼偣鏂规,
-                        case when k.HCorrespondentTypeID=1 then '渚涘簲鍟�' when k.HCorrespondentTypeID=2 then '瀹㈡埛' when k.HCorrespondentTypeID=4 then '浠撳簱' end 瀹為檯浣嶇疆绫诲瀷,
-                        case when k.HCorrespondentTypeID=1 then p.HName when  k.HCorrespondentTypeID=2 then c.HName when k.HCorrespondentTypeID=4 then w.HName end 瀹為檯浣嶇疆,
-                        case when m.HNowSupTypeID=1 then '渚涘簲鍟�' when m.HNowSupTypeID=2 then '瀹㈡埛' when m.HNowSupTypeID=4 then '浠撳簱' end 璐﹂潰浣嶇疆绫诲瀷,
-                        case when m.HNowSupTypeID=1 then p1.HName when  m.HNowSupTypeID=2 then c1.HName when m.HNowSupTypeID=4 then w1.HName end 璐﹂潰浣嶇疆
-                        from Sc_MouldStockBillMain_Temp k 
-                        left join Gy_MouldFileMain m on k.HBarCode=m.HBarCode
-                        left join Gy_StockCheckItem s on k.HSourceInterID=s.HItemID 
-                        left join Gy_Supplier p on k.HCorrespondentID=p.HItemID
-                        left join Gy_Supplier p1 on m.HNowSupTypeID=p1.HItemID
-                        left join Gy_Customer c on k.HCorrespondentID=c.HItemID
-                        left join Gy_Customer c1 on m.HNowSupTypeID=c1.HItemID
-                        left join Gy_Warehouse w on k.HSourceInterID=w.HItemID
-                        left join Gy_Warehouse w1 on m.HNowSupTypeID=w1.HItemID");
+                    sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisList where " + sWhere + " and HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID=" + sID + ") and HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID=" + sID + ")");
                 }
                 ds = oCN.RunProcReturn(sql, "Sc_MouldStockBillMain_Temp");
-                DataTable dt = ds.Tables[0];
-                if (dt.Rows.Count > 0) 
-                {
-                    foreach (DataRow dr in dt.Rows)
-                    {
-                        if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString()== dr["璐﹂潰浣嶇疆绫诲瀷"].ToString()&& dr["瀹為檯浣嶇疆绫诲瀷"].ToString()=="渚涘簲鍟�")
-                        {
-                            //姝e父
-                            if (dr["瀹為檯浣嶇疆"].ToString() == dr["璐﹂潰浣嶇疆"].ToString())
-                            {
-                                list1.Add(dr);
-                            }
-                            //鐩樼泩  瀹炵墿鍦ˋ渚涘簲鍟嗭紝浣嗘槸鍦ㄨ处闈笂娌℃湁杩欎釜鍙拌溅
-                            if (dr["瀹為檯浣嶇疆"].ToString() !=""|| dr["瀹為檯浣嶇疆"].ToString() != null && dr["璐﹂潰浣嶇疆"].ToString()==""|| dr["璐﹂潰浣嶇疆"].ToString() == null)
-                            {
-                                list5.Add(dr);
-                            }
-                            //鐩樹簭  A渚涘簲鍟嗘病鏈夎繖涓彴杞︼紝浣嗘槸鍦ㄨ处闈笂鏈夎繖涓彴杞�
-                            if (dr["瀹為檯浣嶇疆"].ToString() == "" || dr["瀹為檯浣嶇疆"].ToString() == null && dr["璐﹂潰浣嶇疆"].ToString() != "" || dr["璐﹂潰浣嶇疆"].ToString() != null)
-                            {
-                                list6.Add(dr);
-                            }
-                            //鍏堝仛棰嗙敤閫�搴撳崟锛屽啀鍋氶鐢ㄥ嚭搴撳崟  鍙拌溅鍦ˋ渚涘簲鍟�/瀹㈡埛锛屼絾鏄处闈笂鍙拌溅鍦˙渚涘簲鍟�/瀹㈡埛
-                            if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString()=="瀹㈡埛"&& dr["瀹為檯浣嶇疆"].ToString() != dr["瀹為檯浣嶇疆"].ToString())
-                            {
-                                list4.Add(dr);
-                            }
-                            //鍑哄簱
-                            if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == "渚涘簲鍟�" && dr["璐﹂潰浣嶇疆绫诲瀷"].ToString() == "浠撳簱")
-                            {
-                                list3.Add(dr);
-                            }
-                        }
-                        if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == dr["璐﹂潰浣嶇疆绫诲瀷"].ToString() && dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == "瀹㈡埛")
-                        {
-                            //姝e父
-                            if (dr["瀹為檯浣嶇疆"].ToString() == dr["璐﹂潰浣嶇疆"].ToString())
-                            {
-                                list1.Add(dr);
-                            }
-                            //鐩樼泩  瀹炵墿鍦ˋ渚涘簲鍟嗭紝浣嗘槸鍦ㄨ处闈笂娌℃湁杩欎釜鍙拌溅
-                            if (dr["瀹為檯浣嶇疆"].ToString() != "" || dr["瀹為檯浣嶇疆"].ToString() != null && dr["璐﹂潰浣嶇疆"].ToString() == "" || dr["璐﹂潰浣嶇疆"].ToString() == null)
-                            {
-                                list5.Add(dr);
-                            }
-                            //鐩樹簭  A渚涘簲鍟嗘病鏈夎繖涓彴杞︼紝浣嗘槸鍦ㄨ处闈笂鏈夎繖涓彴杞�
-                            if (dr["瀹為檯浣嶇疆"].ToString() == "" || dr["瀹為檯浣嶇疆"].ToString() == null && dr["璐﹂潰浣嶇疆"].ToString() != "" || dr["璐﹂潰浣嶇疆"].ToString() != null)
-                            {
-                                list6.Add(dr);
-                            }
-                            //鍑哄簱
-                            if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == "瀹㈡埛" && dr["璐﹂潰浣嶇疆绫诲瀷"].ToString() == "浠撳簱")
-                            {
-                                list3.Add(dr);
-                            }
-                            //鍏堝仛棰嗙敤閫�搴撳崟锛屽啀鍋氶鐢ㄥ嚭搴撳崟  鍙拌溅鍦ˋ渚涘簲鍟�/瀹㈡埛锛屼絾鏄处闈笂鍙拌溅鍦˙渚涘簲鍟�/瀹㈡埛
-                            if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == "渚涘簲鍟�" && dr["瀹為檯浣嶇疆"].ToString() != dr["瀹為檯浣嶇疆"].ToString())
-                            {
-                                list4.Add(dr);
-                            }
-                        }
-                        if (dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == dr["璐﹂潰浣嶇疆绫诲瀷"].ToString() && dr["瀹為檯浣嶇疆绫诲瀷"].ToString() == "浠撳簱")
-                        {
-                            //姝e父
-                            if (dr["瀹為檯浣嶇疆"].ToString() == dr["璐﹂潰浣嶇疆"].ToString())
-                            {
-                                list1.Add(dr);
-                            }
-                            //鐩樼泩  瀹炵墿鍦ˋ渚涘簲鍟嗭紝浣嗘槸鍦ㄨ处闈笂娌℃湁杩欎釜鍙拌溅
-                            if (dr["瀹為檯浣嶇疆"].ToString() != "" || dr["瀹為檯浣嶇疆"].ToString() != null && dr["璐﹂潰浣嶇疆"].ToString() == "" || dr["璐﹂潰浣嶇疆"].ToString() == null)
-                            {
-                                list5.Add(dr);
-                            }
-                            //鐩樹簭  A渚涘簲鍟嗘病鏈夎繖涓彴杞︼紝浣嗘槸鍦ㄨ处闈笂鏈夎繖涓彴杞�
-                            if (dr["瀹為檯浣嶇疆"].ToString() == "" || dr["瀹為檯浣嶇疆"].ToString() == null && dr["璐﹂潰浣嶇疆"].ToString() != "" || dr["璐﹂潰浣嶇疆"].ToString() != null)
-                            {
-                                list6.Add(dr);
-                            }
-                            //閫�搴�
-                            if (dr["璐﹂潰浣嶇疆绫诲瀷"].ToString()=="渚涘簲鍟�"|| dr["璐﹂潰浣嶇疆绫诲瀷"].ToString() == "瀹㈡埛")
-                            {
-                                list7.Add(dr);
-                            }
-                            //璋冩嫧
-                            if (dr["瀹為檯浣嶇疆"].ToString() != dr["璐﹂潰浣嶇疆"].ToString())
-                            {
-                                list2.Add(dr);
-                            }
-                        }
-                    }
-                    list.Add(list1);
-                    list.Add(list2);
-                    list.Add(list3);
-                    list.Add(list4);
-                    list.Add(list5);
-                    list.Add(list6);
-                    list.Add(list7);
-                }
+                list.Add(ds.Tables[0]);
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
                 objJsonResult.Message = "鑾峰彇淇℃伅鎴愬姛锛�";
@@ -420,42 +289,137 @@
         }
         #endregion
 
+        #region 鐩樼偣璁板綍鍒楄〃
+        [Route("Gy_StockCheckItemBill/Get_MouldStockBillMainTemp")]
+        [HttpGet]
+        public object Get_MouldStockBillMainTemp(string sWhere)
+        {
+            try
+            {
+                ds = MouldStockBillMainTemp(sWhere);
+                if (ds == null)
+                {
+                    objJsonResult.code = "0";
+                    objJsonResult.count = 0;
+                    objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�";
+                    objJsonResult.data = null;
+                    return objJsonResult;
+                }
+                else
+                {
+                    objJsonResult.code = "1";
+                    objJsonResult.count = 1;
+                    objJsonResult.Message = "杩斿洖璁板綍鎴愬姛锛�";
+                    objJsonResult.data = ds.Tables[0];
+                    return objJsonResult;
+                }
+            }
+            catch (Exception ex)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鏌ヨ鏁版嵁寮傚父锛岃涓庣鐞嗗憳鑱旂郴锛�" + ex.ToString();
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+        }
+
+        public static DataSet MouldStockBillMainTemp(string sWhere)
+        {
+            string sql1 = string.Format(@"select * from h_v_Gy_MouldStockBillMainTempList where 1=1 ");
+            if (sWhere == null || sWhere.Equals(""))
+            {
+                return new SQLHelper.ClsCN().RunProcReturn(sql1 + sWhere + " order by 鍒跺崟鏃ユ湡 desc", "h_v_Gy_MouldStockBillMainTempList");
+            }
+            else
+            {
+                string sql = sql1 + sWhere + "order by 鍒跺崟鏃ユ湡 desc";
+                return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_Gy_MouldStockBillMainTempList");
+            }
+        }
+        #endregion
+
+        #region [鐩樼偣璁板綍鍒犻櫎鍔熻兘]
+        [Route("Gy_StockCheckItemBill/set_DeleteBill_Temp")]
+        [HttpGet]
+        public object set_DeleteBill_Temp(string HItemID)
+        {
+            Int64 lngBillKey = 0;
+            lngBillKey = DBUtility.ClsPub.isLong(HItemID);
+            if (lngBillKey == 0)
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "鍗曟嵁ID涓虹┖锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            ds = oCn.RunProcReturn("select * from Sc_MouldStockBillMain_Temp where HItemID=" + lngBillKey, "Sc_MouldStockBillMain_Temp");
+            if (ds != null)
+            {
+                oCn.RunProc("Delete from Sc_MouldStockBillMain_Temp where HItemID=" + lngBillKey);
+                objJsonResult.code = "1";
+                objJsonResult.count = 1;
+                objJsonResult.Message = "鍒犻櫎鎴愬姛锛�";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+            else
+            {
+                objJsonResult.code = "0";
+                objJsonResult.count = 0;
+                objJsonResult.Message = "姝ゅ崟鎹笉瀛樺湪锛岃鏌ョ湅鏄惁閲嶅鍒犻櫎";
+                objJsonResult.data = null;
+                return objJsonResult;
+            }
+
+        }
+
+        #endregion
+
         #region 鐩樼偣鍒嗘瀽瀹℃牳
         #region 璋冩嫧鈥旂洿鎺ヨ皟鎷�
-            [Route("Gy_StockCheckItemBill/MakeProdMove")]
+        [Route("Gy_StockCheckItemBill/MakeProdMove")]
             [HttpGet]
-            public object MakeProdMove(string HBarCode, string user, string userID)
+            public object MakeProdMove(string HBarCode, string user, string userID,string HItemID)
         {
             try
             {
                 string HBillNo = "";
                 Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                DataSet ds1 = new DataSet();
                 ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='" + HBarCode + "'", "Gy_MouldFileMain");
+                ds1 = oCn.RunProcReturn("select top 1 * from Sc_MouldStockBillMain_Temp where HBarCode='" + HBarCode + "' and HItemID='"+ HItemID+"'", "Sc_MouldStockBillMain_Temp");
                 DataRow dr = ds.Tables[0].Rows[0];
+                DataRow dr1 = ds1.Tables[0].Rows[0];
                 HInterID = DBUtility.ClsPub.CreateBillID("3814", ref DBUtility.ClsPub.sExeReturnInfo);
                 HBillNo = DBUtility.ClsPub.CreateBillCode("3814", ref DBUtility.ClsPub.sExeReturnInfo, true);
+                
                 string sql = "Insert Into Sc_MouldStockBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HMaker,HMakeDate" + 
                 ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                 ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                 ") " +
-                " values('3814','3814'," + HInterID + ",'" + HBillNo + "',getdate()" +
+                " values('3814','3814'," + HInterID + ",'" + HBillNo + "','2022-01-02'" +
                 ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
+                ", " + dr["HSupID"].ToString() + ", 1," + dr["HNowSupID"].ToString() + ",0,0,0,0" +
                 ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
                 ") ";
                 string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
                 HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
                 HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
                 HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
+                "0,0," + dr["HInterID"].ToString() + ",0," + dr["HSecUnitRate"].ToString() + ",0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr1["HQty"].ToString() + ",0," +
+                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr1["HCorrespondentID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0"
+                + ",0,0,0," + userID + ",0,100005,'')");
                 //涓昏〃
+
+                oCn.BeginTran();
                 oCn.RunProc(sql);
                 oCn.RunProc(sql1);
+                oCn.RunProc("update KF_PonderationBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID);
+                oCn.Commit();
 
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -466,9 +430,10 @@
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+                objJsonResult.Message = e.Message;
                 objJsonResult.data = null;
             }
             return objJsonResult;
@@ -479,38 +444,43 @@
         #region 鐩樼泩鈥斿叾浠栧叆搴撳崟
         [Route("Gy_StockCheckItemBill/MakeOtherIn")]
         [HttpGet]
-        public object MakeOtherIn(string HBarCode, string user, string userID)
+        public object MakeOtherIn(string HBarCode, string user, string userID, string HItemID)
         {
             try
             {
                 string HBillNo = "";
                 Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                DataSet ds1 = new DataSet();
                 ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='" + HBarCode + "'", "Gy_MouldFileMain");
+                ds1 = oCn.RunProcReturn("select top 1 * from Sc_MouldStockBillMain_Temp where HBarCode='" + HBarCode + "' and HItemID='" + HItemID + "'", "Sc_MouldStockBillMain_Temp");
                 DataRow dr = ds.Tables[0].Rows[0];
+                DataRow dr1 = ds1.Tables[0].Rows[0];
                 HInterID = DBUtility.ClsPub.CreateBillID("3827", ref DBUtility.ClsPub.sExeReturnInfo);
                 HBillNo = DBUtility.ClsPub.CreateBillCode("3827", ref DBUtility.ClsPub.sExeReturnInfo, true);
                 string sql = "Insert Into Sc_MouldStockBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HMaker,HMakeDate" +
                 ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                 ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                 ") " +
-                " values('3827','3827'," + HInterID + ",'" + HBillNo + "',getdate()" +
+                " values('3827','3827'," + HInterID + ",'" + HBillNo + "','2022-01-02'" +
                 ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
+                ", " + dr1["HCorrespondentID"].ToString() + ","+ dr1["HCorrespondentTypeID"].ToString() + ","+ dr["HNowSupID"].ToString() + ",0,0,0,0" +
                 ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
                 ") ";
                 string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
                 HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
                 HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
                 HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
+                "0,0," + dr["HInterID"].ToString() + ",0," + dr["HSecUnitRate"].ToString() + ",0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr1["HQty"].ToString() + ",0," +
+                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr1["HCorrespondentID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0"
+                + ",0,0,0," + userID + ",0,100005,'')");
                 //涓昏〃
+                oCn.BeginTran();
                 oCn.RunProc(sql);
                 oCn.RunProc(sql1);
+                oCn.RunProc("update KF_PonderationBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID);
+                oCn.Commit();
 
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -521,9 +491,10 @@
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+                objJsonResult.Message = e.Message;
                 objJsonResult.data = null;
             }
             return objJsonResult;
@@ -534,38 +505,45 @@
         #region 鐩樹簭鈥斿鐞嗗嚭搴撳崟
         [Route("Gy_StockCheckItemBill/MakeScrapOut")]
         [HttpGet]
-        public object MakeScrapOut(string HBarCode, string user, string userID)
+        public object MakeScrapOut(string HBarCode, string user, string userID, string HItemID)
         {
             try
             {
                 string HBillNo = "";
                 Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                DataSet ds1 = new DataSet();
                 ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='" + HBarCode + "'", "Gy_MouldFileMain");
+                ds1 = oCn.RunProcReturn("select top 1 * from Sc_MouldStockBillMain_Temp where HBarCode='" + HBarCode + "' and HItemID='" + HItemID + "'", "Sc_MouldStockBillMain_Temp");
                 DataRow dr = ds.Tables[0].Rows[0];
+                DataRow dr1 = ds1.Tables[0].Rows[0];
                 HInterID = DBUtility.ClsPub.CreateBillID("3832", ref DBUtility.ClsPub.sExeReturnInfo);
                 HBillNo = DBUtility.ClsPub.CreateBillCode("3832", ref DBUtility.ClsPub.sExeReturnInfo, true);
+
                 string sql = "Insert Into Sc_MouldStockBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HMaker,HMakeDate" +
                 ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                 ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                 ") " +
-                " values('3832','3832'," + HInterID + ",'" + HBillNo + "',getdate()" +
+                " values('3827','3827'," + HInterID + ",'" + HBillNo + "','2022-01-02'" +
                 ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
+                ", " + dr1["HCorrespondentID"].ToString() + "," + dr1["HCorrespondentTypeID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0,0,0" +
                 ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
                 ") ";
                 string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
                 HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
                 HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
                 HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
+                "0,0," + dr["HInterID"].ToString() + ",0," + dr["HSecUnitRate"].ToString() + ",0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr1["HQty"].ToString() + ",0," +
+                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr1["HCorrespondentID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0"
+                + ",0,0,0," + userID + ",0,100005,'')");
+
                 //涓昏〃
+                oCn.BeginTran();
                 oCn.RunProc(sql);
                 oCn.RunProc(sql1);
+                oCn.RunProc("update KF_PonderationBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID);
+                oCn.Commit();
 
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -576,9 +554,10 @@
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+                objJsonResult.Message = e.Message;
                 objJsonResult.data = null;
             }
             return objJsonResult;
@@ -589,38 +568,44 @@
         #region 鍑哄簱鈥旈鐢ㄥ嚭搴撳崟
         [Route("Gy_StockCheckItemBill/MakeProdOut")]
         [HttpGet]
-        public object MakeProdOut(string HBarCode, string user, string userID)
+        public object MakeProdOut(string HBarCode, string user, string userID, string HItemID)
         {
             try
             {
                 string HBillNo = "";
                 Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                DataSet ds1 = new DataSet();
                 ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='" + HBarCode + "'", "Gy_MouldFileMain");
+                ds1 = oCn.RunProcReturn("select top 1 * from Sc_MouldStockBillMain_Temp where HBarCode='" + HBarCode + "' and HItemID='" + HItemID + "'", "Sc_MouldStockBillMain_Temp");
                 DataRow dr = ds.Tables[0].Rows[0];
+                DataRow dr1 = ds1.Tables[0].Rows[0];
                 HInterID = DBUtility.ClsPub.CreateBillID("3802", ref DBUtility.ClsPub.sExeReturnInfo);
                 HBillNo = DBUtility.ClsPub.CreateBillCode("3802", ref DBUtility.ClsPub.sExeReturnInfo, true);
+
                 string sql = "Insert Into Sc_MouldStockBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HMaker,HMakeDate" +
                 ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                 ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                 ") " +
-                " values('3802','3802'," + HInterID + ",'" + HBillNo + "',getdate()" +
+                " values('3827','3827'," + HInterID + ",'" + HBillNo + "','2022-01-02'" +
                 ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
+                ", " + dr1["HCorrespondentID"].ToString() + "," + dr1["HCorrespondentTypeID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0,0,0" +
                 ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
                 ") ";
                 string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
                 HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
                 HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
                 HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
+                "0,0," + dr["HInterID"].ToString() + ",0," + dr["HSecUnitRate"].ToString() + ",0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr1["HQty"].ToString() + ",0," +
+                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr1["HCorrespondentID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0"
+                + ",0,0,0," + userID + ",0,100005,'')");
                 //涓昏〃
+                oCn.BeginTran();
                 oCn.RunProc(sql);
                 oCn.RunProc(sql1);
+                oCn.RunProc("update KF_PonderationBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID);
+                oCn.Commit();
 
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -631,9 +616,10 @@
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+                objJsonResult.Message = e.Message;
                 objJsonResult.data = null;
             }
             return objJsonResult;
@@ -644,38 +630,45 @@
         #region 閫�搴撯�旈鐢ㄩ��搴撳崟
         [Route("Gy_StockCheckItemBill/MakeProdBack")]
         [HttpGet]
-        public object MakeProdBack(string HBarCode, string user, string userID)
+        public object MakeProdBack(string HBarCode, string user, string userID, string HItemID)
         {
             try
             {
                 string HBillNo = "";
                 Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
+                DataSet ds1 = new DataSet();
                 ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='" + HBarCode + "'", "Gy_MouldFileMain");
+                ds1 = oCn.RunProcReturn("select top 1 * from Sc_MouldStockBillMain_Temp where HBarCode='" + HBarCode + "' and HItemID='" + HItemID + "'", "Sc_MouldStockBillMain_Temp");
                 DataRow dr = ds.Tables[0].Rows[0];
+                DataRow dr1 = ds1.Tables[0].Rows[0];
                 HInterID = DBUtility.ClsPub.CreateBillID("3803", ref DBUtility.ClsPub.sExeReturnInfo);
                 HBillNo = DBUtility.ClsPub.CreateBillCode("3803", ref DBUtility.ClsPub.sExeReturnInfo, true);
+
                 string sql = "Insert Into Sc_MouldStockBillMain   " +
                 "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
+                ",HMaker,HMakeDate" +
                 ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
                 ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
                 ") " +
-                " values('3803','3803'," + HInterID + ",'" + HBillNo + "',getdate()" +
+                " values('3827','3827'," + HInterID + ",'" + HBillNo + "','2022-01-02'" +
                 ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
+                ", " + dr1["HCorrespondentID"].ToString() + "," + dr1["HCorrespondentTypeID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0,0,0" +
                 ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
                 ") ";
                 string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
                 HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
                 HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
                 HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
+                "0,0," + dr["HInterID"].ToString() + ",0," + dr["HSecUnitRate"].ToString() + ",0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr1["HQty"].ToString() + ",0," +
+                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr1["HCorrespondentID"].ToString() + "," + dr["HNowSupID"].ToString() + ",0,0"
+                + ",0,0,0," + userID + ",0,100005,'')");
+
                 //涓昏〃
+                oCn.BeginTran();
                 oCn.RunProc(sql);
                 oCn.RunProc(sql1);
+                oCn.RunProc("update KF_PonderationBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID);
+                oCn.Commit();
 
                 objJsonResult.code = "0";
                 objJsonResult.count = 1;
@@ -686,9 +679,10 @@
             }
             catch (Exception e)
             {
+                oCn.RollBack();
                 objJsonResult.code = "0";
                 objJsonResult.count = 0;
-                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
+                objJsonResult.Message = e.Message;
                 objJsonResult.data = null;
             }
             return objJsonResult;
@@ -699,83 +693,20 @@
         #region 鍏堥鐢ㄩ��搴撳啀棰嗙敤鍑哄簱
         [Route("Gy_StockCheckItemBill/MakeProdOutBack")]
         [HttpGet]
-        public object MakeProdOutBack(string HBarCode, string user, string userID)
+        public object MakeProdOutBack(string HBarCode, string user, string userID, string HItemID)
         {
-            try
-            {
-                string HBillNo = "";
-                Int64 HInterID = 0;//鏄剧ず鐨勫瓧娈�
-                ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='" + HBarCode + "'", "Gy_MouldFileMain");
-                DataRow dr = ds.Tables[0].Rows[0];
-                //鍑哄簱
-                HInterID = DBUtility.ClsPub.CreateBillID("3802", ref DBUtility.ClsPub.sExeReturnInfo);
-                HBillNo = DBUtility.ClsPub.CreateBillCode("3802", ref DBUtility.ClsPub.sExeReturnInfo, true);
-                string sql = "Insert Into Sc_MouldStockBillMain   " +
-                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
-                ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
-                ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
-                ") " +
-                " values('3802','3802'," + HInterID + ",'" + HBillNo + "',getdate()" +
-                ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
-                ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
-                ") ";
-                string sql1 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
-                HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
-                HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
-                HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
-
-                //閫�搴�
-                HInterID = DBUtility.ClsPub.CreateBillID("3803", ref DBUtility.ClsPub.sExeReturnInfo);
-                HBillNo = DBUtility.ClsPub.CreateBillCode("3803", ref DBUtility.ClsPub.sExeReturnInfo, true);
-                string sql2 = "Insert Into Sc_MouldStockBillMain   " +
-                "(HBillType,HBillSubType,HInterID,HBillNo,HDate" +
-                ",HMaker,HMakeDate" + /*"HYear, HPeriod,"*/
-                ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" +
-                ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" +
-                ") " +
-                " values('3803','3803'," + HInterID + ",'" + HBillNo + "',getdate()" +
-                ", '" + user + "',getdate()" +
-                ", " + dr["HSupID"].ToString() + ", 1," + dr["HWhID"].ToString() + ",0,0,0,0" +
-                ", 0," + dr["HDeptID"].ToString() + ",' ',0" +
-
-                ") ";
-                string sql3 = string.Format(@"Insert Into Sc_MouldStockBillSub   (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,
-                HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitRate,HSecUnitID,HUnitID,
-                HBatchNo,HQtyMust,HQty,HPrice,HMoney,HDesignLife,HLeaveLife,HUseLife,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HCorrespondentTypeID,HCorrespondentID,
-                HStockOrgID,HOWNERID,HOtherOrgID,HOWNERTYPEID) values(" + HInterID + ",1,'',getdate(),0,'',0,0,'',''," +
-                "0,0," + dr["HInterID"].ToString() + ",0,0,0," + dr["HUnitID"].ToString() + ",0," + dr["HProdQty"].ToString() + "," + dr["HProdQty"].ToString() + ",0," +
-                "0," + dr["HDesignLife"].ToString() + "," + dr["HLeaveLife"].ToString() + "," + dr["HUseLife"].ToString() + "," + dr["HWHID"].ToString() + ",0," + dr["HSPID"].ToString() + ",0,0"
-                + ",0,0," + userID + ",0,0,'')");
-                //涓昏〃
-                oCn.RunProc(sql);
-                oCn.RunProc(sql1);
-                oCn.RunProc(sql2);
-                oCn.RunProc(sql3);
-
-                objJsonResult.code = "0";
-                objJsonResult.count = 1;
-                objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
-                //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
-                objJsonResult.data = 1;
-                return objJsonResult;
-            }
-            catch (Exception e)
-            {
-                objJsonResult.code = "0";
-                objJsonResult.count = 0;
-                objJsonResult.Message = "鍒濆鍖栧け璐ワ紒";
-                objJsonResult.data = null;
-            }
+            MakeProdBack(HBarCode, user, userID, HItemID);
+            MakeProdOut(HBarCode, user, userID, HItemID);
+            objJsonResult.code = "0";
+            objJsonResult.count = 1;
+            objJsonResult.Message = "瀹℃牳鎴愬姛锛�";
+            //WebAPIController.Add_Log("閫佽揣鍗曚笅鎺�", UserName, "鐢熸垚閫佽揣鍗�");
+            objJsonResult.data = 1;
             return objJsonResult;
-
         }
         #endregion
+
+
         #endregion
     }
 }

--
Gitblit v1.9.1