| | |
| | | try |
| | | { |
| | | ds = StockCheckItemList(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; |
| | | } |
| | | |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //return objJsonResult; |
| | | //} |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | ",HLevel,HEndFlag,HStopflag,HRemark,HUseFlag,HMakeTime,HMakeEmp,HEndDate,HOrgID) " + |
| | | " Values('" + oBill.HNumber + "','" + oBill.HName + "','" + oBill.HHelpCode + "','" + oBill.HShortNumber + "'," + oBill.HParentID.ToString() + |
| | | "," + oBill.HLevel.ToString() + "," + Convert.ToString(oBill.HEndFlag ? 1 : 0) + "," + Convert.ToString(oBill.HStopflag ? 1 : 0) + ",'" + oBill.HRemark + |
| | | "','" + oBill.HUseFlag + "',getdate(),'" + msg3 + "','" + oBill.HEndDate.ToString() + "'," + oBill.HOrgID.ToString()+ |
| | | "','" + oBill.HUseFlag + "',getdate(),'" + msg3 + "','" + oBill.HEndDate.ToString() + "'," + oBill.HOrgID.ToString() + |
| | | ")", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //ä¿®æ¹ä¸çº§ä¸ºéæ«çº§ä»£ç |
| | | oCn.RunProc("Update Gy_StockCheckItem set HEndflag=0 where HItemID=" + oBill.HParentID, ref DBUtility.ClsPub.sExeReturnInfo); |
| | |
| | | #region çç¹åæå表 |
| | | [Route("Gy_StockCheckItemBill/Get_InventoryAnalysisList")] |
| | | [HttpGet] |
| | | public object Get_InventoryAnalysisList(string sWhere,string sID) |
| | | public object Get_InventoryAnalysisList(string sWhere, string sID) |
| | | { |
| | | DataSet ds; |
| | | List<object> list = new List<object>(); |
| | |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sID==null||sID=="") |
| | | if (sID == null || sID == "") |
| | | { |
| | | sql = string.Format(@"select k.HBarCode æ¡ç ,m.HBillNo å¨å
·ç¼å·,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.HNowSupID=p1.HItemID |
| | | left join Gy_Customer c on k.HCorrespondentID=c.HItemID |
| | | left join Gy_Customer c1 on m.HNowSupID=c1.HItemID |
| | | left join Gy_Warehouse w on k.HCorrespondentID=w.HItemID |
| | | left join Gy_Warehouse w1 on m.HNowSupID=w1.HItemID |
| | | where " + sWhere); |
| | | sql = string.Format(@"select * from h_v_Sc_MouldInventoryAnalysisList where " + sWhere + " order by HItemID desc "); |
| | | } |
| | | else |
| | | { |
| | | sql = string.Format(@"select k.HBarCode æ¡ç ,m.HBillNo å¨å
·ç¼å·,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.HNowSupID=p1.HItemID |
| | | left join Gy_Customer c on k.HCorrespondentID=c.HItemID |
| | | left join Gy_Customer c1 on m.HNowSupID=c1.HItemID |
| | | left join Gy_Warehouse w on k.HCorrespondentID=w.HItemID |
| | | left join Gy_Warehouse w1 on m.HNowSupID=w1.HItemID |
| | | where " + sWhere+ " and k.HSourceInterID=(select HItemID from Gy_StockCheckItem where HItemID="+sID+") and k.HMakeDate<=(select HEndDate from Gy_StockCheckItem where HItemID="+sID+")"); |
| | | 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 + ") order by HItemID desc "); |
| | | } |
| | | |
| | | ds = oCN.RunProcReturn(sql, "Sc_MouldStockBillMain_Temp"); |
| | | list.Add(ds.Tables[0]); |
| | | objJsonResult.code = "0"; |
| | | |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.list = list; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region çç¹åæå®¡æ ¸ |
| | | #region è°æ¨âç´æ¥è°æ¨ |
| | | [Route("Gy_StockCheckItemBill/MakeProdMove")] |
| | | [HttpGet] |
| | | public object MakeProdMove(string HBarCode, string user, string userID) |
| | | #region çç¹è®°å½å表 |
| | | [Route("Gy_StockCheckItemBill/Get_MouldStockBillMainTemp")] |
| | | [HttpGet] |
| | | public object Get_MouldStockBillMainTemp(string sWhere) |
| | | { |
| | | 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" + |
| | | ds = MouldStockBillMainTemp(sWhere); |
| | | |
| | | ") "; |
| | | 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); |
| | | //if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | //{ |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "Sucessï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | return objJsonResult; |
| | | //} |
| | | //else |
| | | //{ |
| | | //objJsonResult.code = "0"; |
| | | //objJsonResult.count = 0; |
| | | //objJsonResult.Message = "æ æ°æ®"; |
| | | //objJsonResult.data = null; |
| | | //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 hitemid desc", "h_v_Gy_MouldStockBillMainTempList"); |
| | | } |
| | | else |
| | | { |
| | | string sql = sql1 + sWhere + "order by hitemid 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")] |
| | | [HttpPost] |
| | | public object MakeProdMove([FromBody] JObject msg) |
| | | { |
| | | try |
| | | { |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString();//è¡¨æ ¼æ°æ® |
| | | string user = sArray[1].ToString();//user |
| | | string userID = sArray[2].ToString();//userID |
| | | |
| | | //è½¬åæ ¼å¼ |
| | | ListModels oListModels = new ListModels(); |
| | | List<Models.Cls_InventoryAnalysisList> lsmain = new List<Models.Cls_InventoryAnalysisList>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | lsmain = oListModels.getObjectByJson_Gy_StockCheckItemBill(msg2); |
| | | |
| | | foreach (Models.Cls_InventoryAnalysisList item in lsmain) |
| | | { |
| | | var HBarCode = item.HBarCode; |
| | | var HItemID = item.HItemID; |
| | | 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" + |
| | | ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('3814','3814'," + HInterID + ",'" + HBillNo + "','2022-01-02'" + |
| | | ", '" + user + "',getdate()" + |
| | | ", " + 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," + 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 Sc_MouldStockBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID); |
| | | oCn.Commit(); |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå§å失败ï¼"; |
| | | objJsonResult.Message = e.Message; |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | |
| | | |
| | | #region ççâå
¶ä»å
¥åºå |
| | | [Route("Gy_StockCheckItemBill/MakeOtherIn")] |
| | | [HttpGet] |
| | | public object MakeOtherIn(string HBarCode, string user, string userID) |
| | | [HttpPost] |
| | | public object MakeOtherIn([FromBody] JObject msg) |
| | | { |
| | | 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" + |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString();//è¡¨æ ¼æ°æ® |
| | | string user = sArray[1].ToString();//user |
| | | string userID = sArray[2].ToString();//userID |
| | | |
| | | ") "; |
| | | 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); |
| | | //è½¬åæ ¼å¼ |
| | | ListModels oListModels = new ListModels(); |
| | | List<Models.Cls_InventoryAnalysisList> lsmain = new List<Models.Cls_InventoryAnalysisList>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | lsmain = oListModels.getObjectByJson_Gy_StockCheckItemBill(msg2); |
| | | |
| | | foreach (Models.Cls_InventoryAnalysisList item in lsmain) |
| | | { |
| | | var HBarCode = item.HBarCode; |
| | | var HItemID = item.HItemID; |
| | | string HBillNo = ""; |
| | | Int64 HInterID = 0;//æ¾ç¤ºçåæ®µ |
| | | DataSet ds1 = new DataSet(); |
| | | ds = oCn.RunProcReturn("select * from Gy_MouldFileMain where HBarCode='W11201609050013'", "Gy_MouldFileMain"); |
| | | ds1 = oCn.RunProcReturn("select top 1 * from Sc_MouldStockBillMain_Temp where HBarCode='W11201609050013' and HItemID='38'", "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" + |
| | | ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('3827','3827'," + HInterID + ",'" + HBillNo + "','2022-01-02'" + |
| | | ", '" + user + "',getdate()" + |
| | | ", " + dr1["HCorrespondentID"].ToString() + "," + dr1["HCorrespondentTypeID"].ToString() + ",isnull('" + dr["HNowSupID"].ToString() + "',0),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," + 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 Sc_MouldStockBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID); |
| | | oCn.Commit(); |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå§å失败ï¼"; |
| | | objJsonResult.Message = e.Message; |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | |
| | | |
| | | #region çäºâå¤çåºåºå |
| | | [Route("Gy_StockCheckItemBill/MakeScrapOut")] |
| | | [HttpGet] |
| | | public object MakeScrapOut(string HBarCode, string user, string userID) |
| | | [HttpPost] |
| | | public object MakeScrapOut([FromBody] JObject msg) |
| | | { |
| | | 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" + |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString();//è¡¨æ ¼æ°æ® |
| | | string user = sArray[1].ToString();//user |
| | | string userID = sArray[2].ToString();//userID |
| | | |
| | | ") "; |
| | | 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); |
| | | //è½¬åæ ¼å¼ |
| | | ListModels oListModels = new ListModels(); |
| | | List<Models.Cls_InventoryAnalysisList> lsmain = new List<Models.Cls_InventoryAnalysisList>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | lsmain = oListModels.getObjectByJson_Gy_StockCheckItemBill(msg2); |
| | | foreach (Models.Cls_InventoryAnalysisList item in lsmain) |
| | | { |
| | | var HBarCode = item.HBarCode; |
| | | var HItemID = item.HItemID; |
| | | 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" + |
| | | ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('3832','3832'," + HInterID + ",'" + HBillNo + "','2022-01-02'" + |
| | | ", '" + user + "',getdate()" + |
| | | ", " + 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," + 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 Sc_MouldStockBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID); |
| | | oCn.Commit(); |
| | | } |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå§å失败ï¼"; |
| | | objJsonResult.Message = e.Message; |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | |
| | | |
| | | #region åºåºâé¢ç¨åºåºå |
| | | [Route("Gy_StockCheckItemBill/MakeProdOut")] |
| | | [HttpGet] |
| | | public object MakeProdOut(string HBarCode, string user, string userID) |
| | | [HttpPost] |
| | | public object MakeProdOut([FromBody] JObject msg) |
| | | { |
| | | 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" + |
| | | var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString();//è¡¨æ ¼æ°æ® |
| | | string user = sArray[1].ToString();//user |
| | | string userID = sArray[2].ToString();//userID |
| | | |
| | | ") "; |
| | | 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); |
| | | //è½¬åæ ¼å¼ |
| | | ListModels oListModels = new ListModels(); |
| | | List<Models.Cls_InventoryAnalysisList> lsmain = new List<Models.Cls_InventoryAnalysisList>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | lsmain = oListModels.getObjectByJson_Gy_StockCheckItemBill(msg2); |
| | | foreach (Models.Cls_InventoryAnalysisList item in lsmain) |
| | | { |
| | | var HBarCode = item.HBarCode; |
| | | var HItemID = item.HItemID; |
| | | 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" + |
| | | ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('3802','3802'," + HInterID + ",'" + HBillNo + "','2022-01-02'" + |
| | | ", '" + user + "',getdate()" + |
| | | ", " + 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," + 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() + ",'1548785'," + dr["HNowSupID"].ToString() + ",0,0" |
| | | + ",0,0,0," + userID + ",0,100005,'')"); |
| | | |
| | | //主表 |
| | | oCn.BeginTran(); |
| | | oCn.RunProc(sql); |
| | | oCn.RunProc(sql1); |
| | | oCn.RunProc("update Sc_MouldStockBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID); |
| | | oCn.Commit(); |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå§å失败ï¼"; |
| | | objJsonResult.Message = e.Message; |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | |
| | | |
| | | #region éåºâé¢ç¨éåºå |
| | | [Route("Gy_StockCheckItemBill/MakeProdBack")] |
| | | [HttpGet] |
| | | public object MakeProdBack(string HBarCode, string user, string userID) |
| | | [HttpPost] |
| | | public object MakeProdBack([FromBody] JObject msg) |
| | | { |
| | | 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" + |
| | | { var _value = msg["msg"].ToString(); |
| | | string msg1 = _value.ToString(); |
| | | string[] sArray = msg1.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); |
| | | string msg2 = sArray[0].ToString();//è¡¨æ ¼æ°æ® |
| | | string user = sArray[1].ToString();//user |
| | | string userID = sArray[2].ToString();//userID |
| | | |
| | | ") "; |
| | | 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); |
| | | //è½¬åæ ¼å¼ |
| | | ListModels oListModels = new ListModels(); |
| | | List<Models.Cls_InventoryAnalysisList> lsmain = new List<Models.Cls_InventoryAnalysisList>(); |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); |
| | | lsmain = oListModels.getObjectByJson_Gy_StockCheckItemBill(msg2); |
| | | foreach (Models.Cls_InventoryAnalysisList item in lsmain) |
| | | { |
| | | var HBarCode = item.HBarCode; |
| | | var HItemID = item.HItemID; |
| | | 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" + |
| | | ",HSupID,HSupTypeID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('3803','3803'," + HInterID + ",'" + HBillNo + "','2022-01-02'" + |
| | | ", '" + user + "',getdate()" + |
| | | ", " + dr["HNowSupID"].ToString() + "," + dr["HNowSupTypeID"].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," + 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 Sc_MouldStockBillMain_Temp set HCheckStatus=1 where HitemID=" + HItemID); |
| | | oCn.Commit(); |
| | | } |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | oCn.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "åå§å失败ï¼"; |
| | | objJsonResult.Message = e.Message; |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | |
| | | |
| | | #region å
é¢ç¨éåºåé¢ç¨åºåº |
| | | [Route("Gy_StockCheckItemBill/MakeProdOutBack")] |
| | | [HttpGet] |
| | | public object MakeProdOutBack(string HBarCode, string user, string userID) |
| | | [HttpPost] |
| | | public object MakeProdOutBack([FromBody] JObject msg) |
| | | { |
| | | 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(msg); |
| | | MakeProdOut(msg); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å®¡æ ¸æåï¼"; |
| | | //WebAPIController.Add_Log("éè´§å䏿¨", UserName, "çæéè´§å"); |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #endregion |
| | | } |
| | | } |