| | |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region å¢åè£
ç®±åå车äºä»¶ |
| | | [Route("Sc_ICMOBill/QK_PackingBillByXSBill")] |
| | | [HttpGet] |
| | |
| | | { |
| | | try |
| | | { |
| | | string sql = string.Format(@"select b.HMaterID,m.HNumber HMaterCode,m.HName HMaterName,b.HUnitID,u.HName HUnitName, |
| | | b.HQty HQty,a.HAddress HAddress,b.HDate HDate,b.HOutStockQty HOutStockQty,b.HInvoiceQty HInvoiceQty, |
| | | b.HTaxPrice HTaxPrice,b.HPrice HPrice,b.HMoney HMoney,a.HCusID HCusID,c.HName HCusName,a.HEmpID,e.HName HEmpName, |
| | | i.HInterID,i.HBillNo |
| | | from Xs_SeOrderBillMain a |
| | | left join Xs_SeOrderBillSub b on a.HInterID=b.HInterID |
| | | left join Gy_Material m on b.HMaterID=m.HItemID |
| | | left join Gy_Unit u on b.HUnitID=u.HItemID |
| | | left join Gy_Customer c on a.HCusID=c.HItemID |
| | | left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | left join Sc_ICMOBillMain i on i.HSeOrderInterID=a.HInterID |
| | | where a.HInterID=(select HSeOrderInterID from Sc_ICMOBillMain where HBillNo='" + HBillNo + "')"); |
| | | string sql = string.Format(@"select a.HInterID,a.HBillNo,a.HMaterID,m.HName HMaterName, a.HUnitID,u.HName HUnitName,a.HPlanQty,a.HCusID, c.HName HCusName,a.HEmpID,e.HName HEmpName,a.HDeptID,d.HName HDeptName,a.HPlanEndDate,0 HMinQty,0 HTotalQty,0 HSpsQty |
| | | from Sc_ICMOBillMain a |
| | | left join Gy_Material m on a.HMaterID=m.HItemID |
| | | left join Gy_Unit u on a.HUnitID=u.HItemID |
| | | left join Gy_Customer c on a.HCusID=c.HItemID |
| | | left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | left join Gy_Department d on a.HDeptID=d.HItemID |
| | | where HSeOrderInterID=(select HSeOrderInterID from Sc_ICMOBillMain where HBillNo='" + HBillNo + "')"); |
| | | |
| | | ds = oCN.RunProcReturn(sql, "Xs_SeOrderBillMain"); |
| | | ds = oCN.RunProcReturn(sql, "Sc_ICMOBillMain"); |
| | | if (ds.Tables[0].Rows.Count != 0 || ds != null) |
| | | { |
| | | objJsonResult.code = "1"; |
| | |
| | | string msg2 = sArray[0].ToString(); |
| | | string msg3 = sArray[1].ToString(); |
| | | string msg4 = sArray[2].ToString(); |
| | | string msg5 = sArray[3].ToString(); |
| | | |
| | | ListModels oListModels = new ListModels(); |
| | | DataSet ds = new DataSet(); |
| | | ds = oCN.RunProcReturn("select * from Xt_ORGANIZATIONS where HItemID=" + msg5, "Xt_ORGANIZATIONS"); |
| | | string OrgNum = ds.Tables[0].Rows[0]["HNumber"].ToString();//ç»ç»ä»£ç |
| | | DataSet Ds1 = new DataSet(); |
| | | try |
| | | { |
| | | //è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Models.ClsQK_PackingBill> ls = new List<Models.ClsQK_PackingBill>(); |
| | | ls = oListModels.getObjectByJson_QK_PackingBill(msg2); |
| | | |
| | | |
| | | //è·åå¹´ææ¥å¹¶æ¼æ¥æå符串 |
| | | string year = DateTime.Now.Year.ToString(); |
| | | string month = DateTime.Now.Month.ToString(); |
| | | string day = DateTime.Now.Day.ToString(); |
| | | string nowDate = year + month + day; |
| | | string materid = ""; |
| | | long sum = 0; |
| | | if (msg4=="ZZ") |
| | | { |
| | | //è¡¨ä½æ°æ® |
| | | //æ },{æ¥æåæ°ç» //廿ãåã |
| | | |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Models.ClsQK_PackingBill> ls = new List<Models.ClsQK_PackingBill>(); |
| | | ls = oListModels.getObjectByJson_QK_PackingBill(msg2); |
| | | oCN.BeginTran(); |
| | | foreach (Models.ClsQK_PackingBill oItemSub in ls) |
| | | { |
| | | var HInterID = DBUtility.ClsPub.CreateBillID("3783", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | var HBillNo = DBUtility.ClsPub.CreateBillCode("3783", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | string sql = string.Format(@"Insert Sc_PackUnionBillMain(HYear,HPeriod,HBillType,HInterID,HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID, |
| | | HRemark,HBacker,HChecker,HMaker,HMakeDate,HUpDater,HCloseMan,HCloseType,HDeleteMan, |
| | | HICMOInterID,HICMOBillNo,HBarCode_Pack,HMaterID,HUnitID,HWeight,HMWeight,HPWeight, |
| | | HProdOrgID,HDeptID,HEmpID,HSNum,HPackNum,HBarCode_Cus,HBatchNo,HBillSubType) |
| | | values('2022',1,'3783'," + HInterID + ",getdate(),'" + HBillNo + "',1,0,0," + |
| | | "'èªå¨ç»å®','','', " + msg3 + ",getdate(),'','',0,''," + |
| | | oItemSub.HInterID + ",'" + oItemSub.HBillNo + "','" + HBillNo + "'," + oItemSub.HMaterID + "," + oItemSub.HUnitID + "," + oItemSub.HWeight + "," + oItemSub.HMWeight + "," + oItemSub.HPWeight + "," + |
| | | "0,0," + oItemSub.HEmpID + ",0,0,'','','')"); |
| | | oCN.RunProc(sql); |
| | | //æ ¹æ®çææ¡æ°çæç¸åºæ°éæ¡ç |
| | | foreach (var item in oItemSub.HTotalQty.ToString()) |
| | | { |
| | | //çæå¯ä¸æ¡ç æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate; |
| | | Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | int LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | //è·åå
ç |
| | | long HInterID = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + LSH + "','å¯ä¸æ¡ç '," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString() |
| | | + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString() |
| | | + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HInterID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''" |
| | | + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,''" |
| | | + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()" |
| | | + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID.ToString() |
| | | + ",0" |
| | | + ",'" + oItemSub.HMaterName + "','','',0,'','')"); |
| | | |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | oCN.RunProc(sql1); |
| | | } |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "æ´è£
çææåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | objJsonResult.data = 1; |
| | | return objJsonResult; |
| | | } |
| | | else |
| | | { |
| | | msg2 = msg2.Replace("\\", ""); |
| | | msg2 = msg2.Replace("\n", ""); //\n |
| | | //msg2 = msg2.Replace("'", "â"); |
| | | List<Models.ClsQK_PackingBill> ls = new List<Models.ClsQK_PackingBill>(); |
| | | ls = oListModels.getObjectByJson_QK_PackingBill(msg2); |
| | | |
| | | var HInterID = DBUtility.ClsPub.CreateBillID("3783", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | var HBillNo = DBUtility.ClsPub.CreateBillCode("3783", ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | oCN.BeginTran(); |
| | | foreach (Models.ClsQK_PackingBill oItemSub in ls) |
| | | { |
| | | sum += oItemSub.HMinQty; |
| | | materid = oItemSub.HMaterNumber; |
| | | //è·åå
ç |
| | | long HInterID2 = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæå¯ä¸æ¡ç æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | string sTMNumber = OrgNum + oItemSub.HMaterNumber + nowDate; |
| | | Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | int LSH = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | //æå
¥æ¡ç æ¡£æ¡ |
| | | oCN.RunProc("insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + LSH + "','å¯ä¸æ¡ç '," + oItemSub.HMaterID.ToString() + "," + oItemSub.HUnitID.ToString() + "," + oItemSub.HMinQty.ToString() |
| | | + ",'',0,0,'" + msg3 + "',getdate(),0," + oItemSub.HMinQty.ToString() |
| | | + ", " + oItemSub.HInterID.ToString() + "," + oItemSub.HInterID.ToString() + ",'" + oItemSub.HBillNo + "','3710',''" |
| | | + ",1,1," + oItemSub.HDeptID.ToString() + ",0,0,''" |
| | | + ", " + oItemSub.HCusID.ToString() + ",'',getdate(),'',getdate()" |
| | | + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID2.ToString() |
| | | + ",0" |
| | | + ",'" + oItemSub.HMaterName + "','','',0,'','')"); |
| | | //æå
¥ç»æåå表 |
| | | string sql = string.Format(@"insert into Sc_PackUnionBillSub(HInterID,HEntryID,HCloseMan,HCloseType,HRemark, |
| | | HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType, |
| | | HRelationQty,HRelationMoney,HMaterID,HUnitID,HQty,HSourceID,HEquipID,HGroupID,HWorkerID, |
| | | HScanDate,HBarCode,HBarCode_Pack) |
| | | values("+HInterID+",'','',0,'èªå¨ç»å®',"+oItemSub.HInterID+",'',"+oItemSub.HBillNo+",'3710',"+ |
| | | "0,0,"+ oItemSub.HMaterID+","+ oItemSub.HUnitID+","+ oItemSub.HQty+", 0,0,0,0,"+ |
| | | "getdate(),'',"+HBillNo+")"); |
| | | values("+HInterID+",'','',0,'èªå¨ç»å®',"+oItemSub.HInterID+",'','"+oItemSub.HBillNo+"','3710',"+ |
| | | "0,0,"+ oItemSub.HMaterID+","+ oItemSub.HUnitID+","+ oItemSub.HPlanQty+", 0,0,0,0,"+ |
| | | "getdate(),'"+ LSH + "','" +HBillNo+"')"); |
| | | //æ´æ¹ç产订åçæ°é |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=" + oItemSub.HSpsQty + " where HInterID=" + oItemSub.HInterID); |
| | | |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc(sql1); |
| | | } |
| | | //çæç»æå主表 |
| | | string sql2 = string.Format(@"Insert Sc_PackUnionBillMain(HYear,HPeriod,HBillType,HInterID,HDate,HBillNo,HBillStatus,HCheckItemNowID,HCheckItemNextID, |
| | | HRemark,HBacker,HChecker,HMaker,HMakeDate,HUpDater,HCloseMan,HCloseType,HDeleteMan,HICMOInterID,HICMOBillNo, |
| | | HBarCode_Pack,HMaterID,HUnitID,HWeight,HMWeight,HPWeight, |
| | | HProdOrgID,HDeptID,HEmpID,HSNum,HPackNum,HBarCode_Cus,HBatchNo,HBillSubType) |
| | | values('2022',1,'3783'," + HInterID + ",getdate(),'" + HBillNo + "',1,0,0," + |
| | | "'èªå¨ç»å®','','', " + msg3 + ",getdate(),'','',0,'',0,0,'" + |
| | | HBillNo + "',0,0,0,0,0" + |
| | | "'èªå¨ç»å®','','', '" + msg3 + "',getdate(),'','',0,'',0,0,'" + |
| | | HBillNo + "',0,0,0,0,0," + |
| | | "0,0,0,0,0,'','','')"); |
| | | oCN.RunProc(sql2); |
| | | //忬¡çæå¯ä¸ç |
| | | //è·åå
ç |
| | | long HInterID3 = DBUtility.ClsPub.CreateBillID_Prod("85", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | //çæå¯ä¸æ¡ç æ¡ç åç¼ = ç»ç»ä»£ç + ç©æä»£ç + å¹´ + æ + æ¥ |
| | | string sTMNumber1 = OrgNum + materid+nowDate; |
| | | Ds1 = oCN.RunProcReturn("exec h_p_WMS_GetMaxNo '" + sTMNumber1 + "'", "h_p_WMS_GetMaxNo"); //è·åæå¤§æµæ°´å· |
| | | int LSH1 = ClsPub.isInt(Ds1.Tables[0].Rows[0][0]);//å¯ä¸ç |
| | | string sql3 = string.Format(@"insert into Gy_BarCodeBill (HBarCode,HBarCodeType,HMaterID,HUnitID,HQty" + |
| | | ",HBatchNo,HSupID,HGroupID,HMaker,HMakeDate,HPrintQty,HinitQty" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HEndQty " + |
| | | ",HBarcodeQtys,HBarcodeNo,HDeptID,HWhID,HSPID,HRemark " + |
| | | ",HCusID,HCusType,HEndDate,HWorkLineName,HBarCodeDate " + |
| | | ",HSTOCKORGID,HOWNERID,HSeOrderBillNo,HInterID " + |
| | | ",HGiveAwayFlag " + |
| | | ",HMaterName,HMaterModel,HPinfan,HAuxPropID,HMTONo,HInnerBillNo " + |
| | | ") values (" |
| | | + "'" + LSH1 + "','å¯ä¸æ¡ç ','" + materid.ToString() + "',0," + sum.ToString() |
| | | + ",'',0,0,'" + msg3 + "',getdate(),0," + sum.ToString() |
| | | + ", 0,0,'" + HBillNo + "','3710',''," |
| | | + sum.ToString() + "," + HInterID.ToString() + ",0,0,0,''" |
| | | + ",0,'',getdate(),'',getdate()" |
| | | + ", " + msg5.ToString() + "," + OrgNum.ToString() + ",''," + HInterID3.ToString() |
| | | + ",0" |
| | | + ",'','','',0,'','')"); |
| | | |
| | | oCN.RunProc(sql3); |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | # region[å¢åè£
ç®±ç¹å»ä¸»è¡¨å¸¦åºä»è¡¨] |
| | | [Route("Sc_ICMOBillController/QK_GetPackingBillListByMainID")] |
| | | [HttpGet] |
| | | public object QK_GetPackingBillListByMainID(string HInterID) |
| | | { |
| | | |
| | | DataSet ds; |
| | | try |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | //è·åä¿å
»é¡¹ç®ç¼è¾æ°æ® |
| | | string sql = string.Format(@"select a.HInterID hmainid,a.HBarCode,a.HBillType,a.HBarCodeType, |
| | | a.HMaterID,m.HName HMaterName,a.HUnitID,u.HName HUnitName, |
| | | a.HEmpID,e.HName HEmpName,a.HDeptID,d.HItemID HDeptName,P.HBarCode_Pack, |
| | | a.HMakeDate å¶åæ¥æ,a.HMaker å¶å人 |
| | | from Gy_BarCodeBill a |
| | | left join Gy_Material m on a.HMaterID=m.HItemID |
| | | left join Gy_Unit u on a.HUnitID=u.HItemID |
| | | left join Gy_Employee e on a.HEmpID=e.HItemID |
| | | left join Gy_Department d on a.HDeptID=d.HItemID |
| | | left join Sc_PackUnionBillMain p on a.HSourceInterID=p.HInterID |
| | | where a.HBarCode=(select HBarCode from Sc_PackUnionBillSub where HInterID= |
| | | (select HBarcodeNo from Gy_BarCodeBill where HBarCode='" + HInterID + "'))"); |
| | | ds = oCN.RunProcReturn(sql, "Sc_PackUnionBillSub"); |
| | | |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "è·åä¿¡æ¯æåï¼"; |
| | | objJsonResult.data = ds.Tables[0]; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "没æè¿åä»»ä½è®°å½ï¼" + e.ToString(); |
| | | objJsonResult.data = null; |
| | | } |
| | | return objJsonResult; |
| | | } |
| | | #endregion |
| | | |
| | | #region[å¢åè£
ç®±å表] |
| | | /// <summary> |
| | | /// 模å
·ä¿å
»è®°å½è¡¨å表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_ICMOBillController/QK_GetPackingBillList")] |
| | | [HttpGet] |
| | | public object QK_GetPackingBillList(string sWhere) |
| | | { |
| | | try |
| | | { |
| | | |
| | | ds = QK_GetPackingBillList_s(sWhere); |
| | | |
| | | //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; |
| | | } |
| | | } |
| | | |
| | | #region sqlè¯å¥ |
| | | |
| | | |
| | | public static DataSet QK_GetPackingBillList_s(string sWhere) |
| | | { |
| | | if (sWhere == null || sWhere.Equals("")) |
| | | { |
| | | return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_QK_PackedBillList order by hmainid desc", "h_v_QK_PackedBillList"); |
| | | } |
| | | else |
| | | { |
| | | string sql1 = "select * from h_v_QK_PackedBillList where 1 = 1 "; |
| | | string sql = sql1 + sWhere + "order by hmainid desc"; |
| | | return new SQLHelper.ClsCN().RunProcReturn(sql, "h_v_QK_PackedBillList"); |
| | | |
| | | } |
| | | //return new SQLHelper.ClsCN().RunProcReturn("select * from h_v_Sc_MouldMaintainBillList ", "h_v_Sc_MouldMaintainBillList"); |
| | | } |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region[å¢åè£
ç®±å表-å é¤] |
| | | /// <summary> |
| | | /// å¢åè£
ç®±å表-å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [Route("Sc_ICMOBillController/DeleteQK_GetPackingBillList")] |
| | | [HttpGet] |
| | | public object DeleteQK_GetPackingBillList(string HInterID,string Flag) |
| | | { |
| | | try |
| | | { |
| | | oCN.BeginTran(); |
| | | if (Flag=="0") |
| | | { |
| | | DataSet ds = new DataSet(); |
| | | ds = oCN.RunProcReturn("select * from Gy_BarCodeBill where HItemID=" + HInterID, "Gy_BarCodeBill"); |
| | | DataRow dr = ds.Tables[0].Rows[0]; |
| | | string sql = string.Format(@"delete from Gy_BarCodeBill where HItemID=" + HInterID); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=HPlanQty+" + dr["HQty"] +" where HInterID=(select HSourceInterID from Gy_BarCodeBill where HItemID="+ HInterID + ")"); |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc(sql1); |
| | | } |
| | | else |
| | | { |
| | | //éè¿æ¡ç idæ¾å°ææ¡ç ï¼éè¿ææ¡ç æ¾å°ç»æåå表ä¸çå¯ä¸ç |
| | | string sql2 = "select HBarCode from Sc_PackUnionBillSub where HInterID=(select HBarcodeNo from Gy_BarCodeBill where HItemID=" + HInterID; |
| | | //string sql2 = "select HBarCode from Sc_PackUnionBillSub where HInterID=(select HBarcodeNo from Gy_BarCodeBill where HItemID=3250)"; |
| | | DataSet ds1 = oCN.RunProcReturn(sql2, "Sc_PackUnionBillSub"); |
| | | DataTable dt = ds1.Tables[0]; |
| | | //éåæ¾å°çå¯ä¸ç å 餿¡ç æ¡£æ¡éçç¸å
³æ°æ®ï¼åæ¶éè¿å¯ä¸ç çæºåæ¾å°çäº§è®¢åæ´æ¹ç产订åçæ°é |
| | | if (dt.Rows.Count > 0) |
| | | { |
| | | foreach (DataRow dr in dt.Rows) |
| | | { |
| | | DataSet ds = new DataSet(); |
| | | ds = oCN.RunProcReturn("select * from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString()+"'", "Gy_BarCodeBill"); |
| | | DataRow dr1 = ds.Tables[0].Rows[0]; |
| | | |
| | | string sql = string.Format(@"delete from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString()+"'"); |
| | | string sql1 = string.Format(@"update Sc_ICMOBillMain set HPlanQty=HPlanQty+" + dr1["HQty"] + " where HInterID=(select HSourceInterID from Gy_BarCodeBill where HBarCode='" + dr["HBarCode"].ToString() + "')"); |
| | | oCN.RunProc(sql); |
| | | oCN.RunProc(sql1); |
| | | } |
| | | } |
| | | |
| | | //éåå®åå é¤éè¿æ¡ç idæ¾å°ææ¡ç ï¼éè¿ææ¡ç æ¾å°ç»æååè¡¨çæ°æ®ï¼ä»¥åä¸»è¡¨æ°æ® |
| | | string sql3 = string.Format(@"delect from Sc_PackUnionBillSub where HInterID=(select HBarcodeNo from Gy_BarCodeBill where HItemID="+ HInterID); |
| | | string sql4 = string.Format(@"delect from Sc_PackUnionBillMain where HInterID=(select HBarcodeNo from Gy_BarCodeBill where HItemID=" + HInterID); |
| | | //å 餿大çåæçå¯ä¸ç |
| | | string sql5 = string.Format(@"delete from Gy_BarCodeBill where HItemID=" + HInterID); |
| | | oCN.RunProc(sql3); |
| | | oCN.RunProc(sql4); |
| | | oCN.RunProc(sql5); |
| | | } |
| | | oCN.Commit(); |
| | | objJsonResult.code = "1"; |
| | | objJsonResult.count = 1; |
| | | objJsonResult.Message = "å 餿å"; |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | oCN.RollBack(); |
| | | objJsonResult.code = "0"; |
| | | objJsonResult.count = 0; |
| | | objJsonResult.Message = "å é¤å¤±è´¥" + ex.ToString(); |
| | | objJsonResult.data = null; |
| | | return objJsonResult; |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | } |