From c9521814f494493441254a887a706de4321dfd40 Mon Sep 17 00:00:00 2001 From: zzr99 <1940172413@qq.com> Date: 星期一, 20 十二月 2021 17:35:45 +0800 Subject: [PATCH] 增加根据盘点分析报表,点击审核按钮,生成对应领用出库单 --- WebAPI/Controllers/基础资料/基础资料/Gy_StockCheckItemBillController.cs | 376 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 367 insertions(+), 9 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 9787f05..0421bde 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" @@ -258,20 +258,20 @@ { DataSet ds; List<object> list = new List<object>(); - List<object> list1 = new List<object>(); - 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>(); + 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>();//閫�搴� try { SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); string sql; if (sWhere != null&&sWhere!="") { - sql = string.Format(@"select k.HBarCode 鏉$爜,s.HName 鐩樼偣鏂规, + 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 璐﹂潰浣嶇疆绫诲瀷, @@ -289,7 +289,7 @@ } else { - sql = string.Format(@"select k.HBarCode 鏉$爜,s.HName 鐩樼偣鏂规, + 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 璐﹂潰浣嶇疆绫诲瀷, @@ -419,5 +419,363 @@ } } #endregion + + #region 鐩樼偣鍒嗘瀽瀹℃牳 + #region 璋冩嫧鈥旂洿鎺ヨ皟鎷� + [Route("Gy_StockCheckItemBill/MakeProdMove")] + [HttpGet] + public object MakeProdMove(string HBarCode, string user, string userID) + { + 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("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,"*/ + ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('3814','3814'," + 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,'')"); + //涓昏〃 + oCn.RunProc(sql); + oCn.RunProc(sql1); + + 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; + } + return objJsonResult; + + } + #endregion + + #region 鐩樼泩鈥斿叾浠栧叆搴撳崟 + [Route("Gy_StockCheckItemBill/MakeOtherIn")] + [HttpGet] + public object MakeOtherIn(string HBarCode, string user, string userID) + { + 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("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,"*/ + ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('3827','3827'," + 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,'')"); + //涓昏〃 + oCn.RunProc(sql); + oCn.RunProc(sql1); + + 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; + } + return objJsonResult; + + } + #endregion + + #region 鐩樹簭鈥斿鐞嗗嚭搴撳崟 + [Route("Gy_StockCheckItemBill/MakeScrapOut")] + [HttpGet] + public object MakeScrapOut(string HBarCode, string user, string userID) + { + 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("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,"*/ + ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + + ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + + ") " + + " values('3832','3832'," + 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,'')"); + //涓昏〃 + oCn.RunProc(sql); + oCn.RunProc(sql1); + + 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; + } + return objJsonResult; + + } + #endregion + + #region 鍑哄簱鈥旈鐢ㄥ嚭搴撳崟 + [Route("Gy_StockCheckItemBill/MakeProdOut")] + [HttpGet] + public object MakeProdOut(string HBarCode, string user, string userID) + { + 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,'')"); + //涓昏〃 + oCn.RunProc(sql); + oCn.RunProc(sql1); + + 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; + } + return objJsonResult; + + } + #endregion + + #region 閫�搴撯�旈鐢ㄩ��搴撳崟 + [Route("Gy_StockCheckItemBill/MakeProdBack")] + [HttpGet] + public object MakeProdBack(string HBarCode, string user, string userID) + { + 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("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,"*/ + ",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 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,'')"); + //涓昏〃 + oCn.RunProc(sql); + oCn.RunProc(sql1); + + 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; + } + return objJsonResult; + + } + #endregion + + #region 鍏堥鐢ㄩ��搴撳啀棰嗙敤鍑哄簱 + [Route("Gy_StockCheckItemBill/MakeProdOutBack")] + [HttpGet] + public object MakeProdOutBack(string HBarCode, string user, string userID) + { + 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; + } + return objJsonResult; + + } + #endregion + #endregion } } -- Gitblit v1.9.1