Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-API
| | |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | if (sqlWhere == null || sqlWhere.Equals("")) |
| | | { |
| | | ds = oCN.RunProcReturn(string.Format(@"select HMaterID ,ç©æä»£ç HMaterCode ,ç©æåç§° HMaterName,è§æ ¼åå· HMaterSpec,HUnitID,计éåä½ä»£ç HUnitCode,计éåä½ HUnitName,åºæ¶æ°é HQtyMust,宿¶æ°é HQty,åä»· HPrice,éé¢ HMoney,HWHID,颿ä»åºä»£ç HWHCode,颿ä»åº HWHName,表ä½å¤æ³¨ HRemark |
| | | ds = oCN.RunProcReturn(string.Format(@"select HMaterID ,ç©æä»£ç HMaterCode ,ç©æåç§° HMaterName,ç©æåç±» HMaterRuleType,è§æ ¼åå· HMaterSpec,ç¨é HRate,HUnitID,计éåä½ä»£ç HUnitCode,计éåä½ HUnitName,åºæ¶æ°é HQtyMust,宿¶æ°é HQty,åä»· HPrice,éé¢ HMoney,HWHID,颿ä»åºä»£ç HWHCode,颿ä»åº HWHName,表ä½å¤æ³¨ HRemark |
| | | from h_v_IF_MateOutBillList"), "H_V_IF_MATEOUTBILLLIST"); |
| | | |
| | | } |
| | |
| | | { |
| | | |
| | | //string sql1 = "select HRepairCheckID,HRepairCheckContent,HManagerID,HRemark from Sc_MouldRepairCheckBillSub where 1 = 1 "; |
| | | string sql1 = string.Format(@"select HMaterID ,ç©æä»£ç HMaterCode ,ç©æåç§° HMaterName,è§æ ¼åå· HMaterSpec,HUnitID,计éåä½ä»£ç HUnitCode,计éåä½ HUnitName,åºæ¶æ°é HQtyMust,宿¶æ°é HQty,åä»· HPrice,éé¢ HMoney,HWHID,颿ä»åºä»£ç HWHCode,颿ä»åº HWHName,表ä½å¤æ³¨ HRemark |
| | | string sql1 = string.Format(@"select HMaterID ,ç©æä»£ç HMaterCode ,ç©æåç§° HMaterName,ç©æåç±» HMaterRuleType,è§æ ¼åå· HMaterSpec,ç¨é HRate, HUnitID,计éåä½ä»£ç HUnitCode,计éåä½ HUnitName,åºæ¶æ°é HQtyMust,宿¶æ°é HQty,åä»· HPrice,éé¢ HMoney,HWHID,颿ä»åºä»£ç HWHCode,颿ä»åº HWHName,表ä½å¤æ³¨ HRemark |
| | | from h_v_IF_MateOutBillList WHERE 1=1"); |
| | | string sql = sql1 + sqlWhere; |
| | | ds = oCN.RunProcReturn(sql, "H_V_IF_MATEOUTBILLLIST"); |
| | |
| | | string msg3 = sArray[1].ToString(); |
| | | string refSav = sArray[2].ToString(); |
| | | string msg4 = sArray[3].ToString(); |
| | | |
| | | DBUtility.ClsPub.CurUserName = msg4; |
| | | |
| | | string UserName = ""; |
| | | string s = ""; |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®å·¥èºåå·(å·¥åºæµè½¬å¡å·)è·åä¿¡æ¯ |
| | | [Route("Kf_MateOutBill/getMainDataByHProcExchBillNo")] |
| | | [HttpGet] |
| | | public ApiResult<DataSet> getMainDataByHProcExchBillNo(string HProcExchBillNo) |
| | | { |
| | | if (string.IsNullOrEmpty(HProcExchBillNo)) |
| | | return new ApiResult<DataSet> { code = -1, msg = "å·¥èºåå·ä¸è½ä¸ºç©º" }; |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | string sql = "select top(1) " + |
| | | "a.HICMOInterID,a.HICMOEntryID,a.HICMOBillNo,a.HInterID HProcExchInterID,a.HMaterID,m1.HName HMaterName,a.HMaterModel HModel,a.HMaterModel2 HModel2,a.HCusID,c1.HName HCusName,a.HWeight" + |
| | | " from Sc_ProcessExchangeBillMain AS a " + |
| | | " LEFT OUTER JOIN Gy_Material AS m1 on a.HMaterID = m1.HItemID " + |
| | | " LEFT OUTER JOIN Gy_Customer AS c1 on a.HCusID = c1.HItemID " + |
| | | " where a.HBillNo = '" + HProcExchBillNo + "'"; |
| | | |
| | | var dataSet = oCN.RunProcReturn(sql, "h_v_Sc_ProcessExchangeBillList"); |
| | | |
| | | |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataSet> { code = -1, msg = "ä¸åå¨åå·" }; |
| | | |
| | | return new ApiResult<DataSet> { code = 1, msg = "æ¥è¯¢æå", data = dataSet }; |
| | | } |
| | | #endregion |
| | | |
| | | #region æ ¹æ®ç©æå
ç è·åç©æä¿¡æ¯ |
| | | [Route("Kf_MateOutBill/getMaterialByMaterID")] |
| | | [HttpGet] |
| | | public ApiResult<DataTable> getMaterialByMaterID(Int64 HMaterID) |
| | | { |
| | | SQLHelper.ClsCN oCN = new SQLHelper.ClsCN(); |
| | | |
| | | string sql = "select a.HItemID HMaterID,a.HNumber HMaterNumber,a.HName HMaterName,a.HMaterRuleType,a.HModel HMaterModel,a.HUnitID, b.HNumber HUnitNumber, b.HName HUnitName" + |
| | | " from Gy_Material AS a " + |
| | | " LEFT OUTER JOIN Gy_Unit AS b on a.HUnitID = b.HItemID " + |
| | | " where a.HItemID =" + HMaterID; |
| | | |
| | | var dataSet = oCN.RunProcReturn(sql, "Gy_Material"); |
| | | |
| | | |
| | | if (dataSet == null || dataSet.Tables[0].Rows.Count == 0) |
| | | return new ApiResult<DataTable> { code = -1, msg = "ä¸åå¨è¯¥ç©æ" }; |
| | | |
| | | return new ApiResult<DataTable> { code = 1, msg = "æ¥è¯¢æå", data = dataSet.Tables[0] }; |
| | | } |
| | | #endregion |
| | | |
| | | #region å¨å
·éè´å
¥åºåå®¡æ ¸/åå®¡æ ¸ |
| | | [Route("Sc_MouldProdInHouseBill/AuditMouldProdInHouseBill")] |
| | | [HttpGet] |
| | |
| | | public int HInterID; |
| | | public string HBillNo; |
| | | public string HDate; |
| | | public int HProID; |
| | | public int HProjectID; |
| | | public string HProNumber; |
| | | public string HMainSourceBillNo; |
| | | public string HMainSourceBillType; |
| | | public int HProjectStageID; |
| | | public string HProjectStageName; |
| | | public string HStageNote; |
| | |
| | | public int HOrgID; |
| | | public string HRemark; |
| | | public string HMaker; |
| | | |
| | | public int HMainSourceInterID; |
| | | public int HMainSourceEntryID; |
| | | public string HMainSourceBillNo; |
| | | public string HMainSourceBillType; |
| | | |
| | | public string HUpdater; |
| | | public string HChecker; |
| | | public string HMakerDate; |
| | |
| | | int HInterID = mainList[0].HInterID; |
| | | string HBillNo = mainList[0].HBillNo; |
| | | string HDate = mainList[0].HDate; |
| | | int HProID = mainList[0].HProID; |
| | | int HProjectID = mainList[0].HProjectID; |
| | | string HProNumber = mainList[0].HProNumber; |
| | | string HMainSourceBillNo = mainList[0].HMainSourceBillNo; |
| | | string HMainSourceBillType = mainList[0].HMainSourceBillType; |
| | | int HProjectStageID = mainList[0].HProjectStageID; |
| | | string HStageNote = mainList[0].HStageNote; |
| | | string HRelationGoods = mainList[0].HRelationGoods; |
| | |
| | | double HRate = mainList[0].HRate; |
| | | int HOrgID = mainList[0].HOrgID; |
| | | string HRemark = mainList[0].HRemark; |
| | | |
| | | int HMainSourceInterID = mainList[0].HMainSourceInterID; |
| | | int HMainSourceEntryID = mainList[0].HMainSourceEntryID; |
| | | string HMainSourceBillNo = mainList[0].HMainSourceBillNo; |
| | | string HMainSourceBillType = mainList[0].HMainSourceBillType; |
| | | |
| | | string HMaker = mainList[0].HMaker; |
| | | string HMakerDate = mainList[0].HMakerDate; |
| | | string HUpdater = mainList[0].HUpdater; |
| | |
| | | { |
| | | string sql = "insert into PM_ProjectReportBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" + |
| | | ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID) " + |
| | | ",HProjectID,HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillNo,HMainSourceBillType) " + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | ",'" + HRemark + |
| | | "','" + HMaker + |
| | | "','" + HMakerDate + |
| | | "','" + HProNumber + |
| | | "'," + HProjectID + |
| | | ",'" + HProNumber + |
| | | "'," + HProjectStageID + |
| | | ",'" + HStageNote + |
| | | "','" + HRelationGoods + |
| | |
| | | "','" + HCopyEmp + |
| | | "'," + HRate + |
| | | "," + HOrgID + |
| | | ")"; |
| | | "," + HMainSourceInterID + |
| | | "," + HMainSourceEntryID + |
| | | ",'" + HMainSourceBillNo + |
| | | "','" + HMainSourceBillType + |
| | | "')"; |
| | | |
| | | //主表 |
| | | oCN.RunProc(sql); |
| | |
| | | ",HRemark = '" + HRemark + |
| | | "',HUpdater = '" + HUpdater + |
| | | "',HUpdateDate = '" + HUpdaterDate + |
| | | "',HProNumber = '" + HProNumber + |
| | | "',HProjectID = " + HProjectID + |
| | | ",HProNumber = '" + HProNumber + |
| | | "',HProjectStageID = " + HProjectStageID + |
| | | ",HStageNote = '" + HStageNote + |
| | | "',HRelationGoods = '" + HRelationGoods + |
| | |
| | | "',HCopyEmp = '" + HCopyEmp + |
| | | "',HRate = " + HRate + |
| | | ",HOrgID = " + HOrgID + |
| | | " where HInterID = " + HInterID; |
| | | ",HMainSourceInterID = " + HMainSourceInterID + |
| | | ",HMainSourceEntryID = " + HMainSourceEntryID + |
| | | ",HMainSourceBillNo = '" + HMainSourceBillNo + |
| | | "',HMainSourceBillType = '" + HMainSourceBillType + |
| | | "' where HInterID = " + HInterID; |
| | | |
| | | oCN.RunProc(sql); |
| | | |
| | |
| | | { |
| | | string sql = "insert into PM_ProjectReportBillMain" + |
| | | "(HYear,HPeriod,HBillType,HBillSubType,HInterID,HDate,HBillNo,HBillStatus,HRemark,HMaker,HMakeDate" + |
| | | ",HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " + |
| | | ",HProjectID,HProNumber,HProjectStageID,HStageNote,HRelationGoods,HIsKey,HReportEmpID,HReportNote,HReportGoods,HReceiveEmp,HCopyEmp,HRate,HOrgID,HMainSourceInterID,HMainSourceEntryID,HMainSourceBillType,HMainSourceBillNo) " + |
| | | "values(" + |
| | | "" + HYear + |
| | | "," + HPeriod + |
| | |
| | | ",'" + HRemark + |
| | | "','" + HMaker + |
| | | "','" + HMakerDate + |
| | | "','" + HProNumber + |
| | | "'," + HProjectID + |
| | | ",'" + HProNumber + |
| | | "'," + HProjectStageID + |
| | | ",'" + HStageNote + |
| | | "','" + HRelationGoods + |
| | |
| | | "','" + HCopyEmp + |
| | | "'," + HRate + |
| | | "," + HOrgID + |
| | | "," + HProID + |
| | | "," + HProjectStageID + |
| | | "," + HMainSourceInterID + |
| | | "," + HMainSourceEntryID + |
| | | ",'" + HMainSourceBillType + |
| | | "','" + HMainSourceBillNo + |
| | | "')"; |
| | |
| | | oCN.RunProc("Insert into System_log (GeginDate, userid, WorkstationName, WorkList, SystemName, NetuserName, State) select GETDATE(),'" + user + "','" + HComputerName + "','" + "æ°å¢é¡¹ç®é¶æ®µæ±æ¥ï¼" + HBillNo + "','LMES-项ç®é¶æ®µæ±æ¥æ¨¡å','" + DBUtility.ClsPub.IPAddress + "','æ°å¢åæ®'", ref DBUtility.ClsPub.sExeReturnInfo); |
| | | } |
| | | //ä¿åå表 |
| | | objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HProID, HProjectStageID, HMainSourceBillType, HMainSourceBillNo); |
| | | objJsonResult = AddBillSub_ProjectReportBill(msg3, HInterID, HBillNo, OperationType,HMainSourceInterID, HMainSourceEntryID, HMainSourceBillType, HMainSourceBillNo); |
| | | |
| | | if (objJsonResult.code == "0") |
| | | { |
| | |
| | | { |
| | | // |
| | | oCn.BeginTran(); |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc("UpDate Kf_ICStockBillMain set " + |
| | | |
| | | string mainSql = "UpDate Kf_ICStockBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + "'" + //åºå®èµå¼=============== |
| | | ",HDate='" + omodel.HDate + "'" + |
| | | ",HYear='" + omodel.HYear.ToString() + "'" + |
| | |
| | | ",HExplanation='" + omodel.HExplanation + "'" + |
| | | ",HInnerBillNo='" + omodel.HInnerBillNo + "'" + |
| | | ",HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + |
| | | " where HInterID=" + lngBillKey.ToString()); |
| | | " where HInterID=" + lngBillKey.ToString(); |
| | | |
| | | |
| | | //å¤æä½¿ç¨å®¢æ·ï¼æ ¹æ®å®¢æ·è¿è¡ä¸ªæ§åè°æ´ |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | string sErrMsg = ""; |
| | | oSystemParameter.ShowBill(ref sErrMsg); |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "") //ä¹ä¸å®¢æ· |
| | | { |
| | | mainSql = "UpDate Kf_ICStockBillMain set " + |
| | | " HBillNo='" + omodel.HBillNo + |
| | | "',HDate='" + omodel.HDate + |
| | | "',HYear='" + omodel.HYear.ToString() + |
| | | "',HPeriod='" + omodel.HPeriod.ToString() + |
| | | "',HRemark='" + omodel.HRemark + |
| | | "',HUpDater='" + DBUtility.ClsPub.CurUserName + |
| | | "',HUpDateDate=getdate()" + |
| | | //======================================== |
| | | ",HSupID=" + omodel.HSupID.ToString() + |
| | | ",HWHID=" + omodel.HWHID.ToString() + |
| | | ",HSCWHID=" + omodel.HSCWHID.ToString() + |
| | | ",HEmpID=" + omodel.HEmpID.ToString() + |
| | | ",HManagerID=" + omodel.HManagerID.ToString() + |
| | | ",HSecManagerID=" + omodel.HSecManagerID.ToString() + |
| | | ",HKeeperID=" + omodel.HKeeperID.ToString() + |
| | | ",HDeptID=" + omodel.HDeptID.ToString() + |
| | | ",HExplanation='" + omodel.HExplanation + |
| | | "',HInnerBillNo='" + omodel.HInnerBillNo + |
| | | "',HRedBlueFlag=" + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + |
| | | |
| | | ",HICMOInterID=" + omodel.HICMOInterID + |
| | | ",HICMOEntryID=" + omodel.HICMOEntryID + |
| | | ",HICMOBillNo='" + omodel.HICMOBillNo + |
| | | "',HProcExchInterID=" + omodel.HProcExchInterID + |
| | | ",HProcExchEntryID=" + omodel.HProcExchEntryID + |
| | | ",HProcExchBillNo='" + omodel.HProcExchBillNo + |
| | | "',HMaterID=" + omodel.HMaterID + |
| | | ",HMaterName='" + omodel.HMaterName + |
| | | "',HVerNo='" + omodel.HVerNo + |
| | | "',HModel='" + omodel.HModel + |
| | | "',HModel2='" + omodel.HModel2 + |
| | | "',HPieceQty='" + omodel.HPieceQty + |
| | | "',HCusID=" + omodel.HCusID + |
| | | ",HWeight=" + omodel.HWeight + |
| | | ",HLong=" + omodel.HLong + |
| | | ",HSingleWeight=" + omodel.HSingleWeigth + |
| | | ",HMaterSumWeight=" + omodel.HMaterSumWeight + |
| | | ",HMaterEmpID=" + omodel.HMaterEmpID + |
| | | ",HMachineSpeed=" + omodel.HMachineSpeed + |
| | | ",HWaterRush=" + omodel.HWaterRush + |
| | | ",HWaterQty=" + omodel.HWaterQty + |
| | | ",HWaterRate=" + omodel.HWaterRate + |
| | | " where HInterID=" + lngBillKey.ToString(); |
| | | } |
| | | //æ´æ°ä¸»è¡¨ |
| | | oCn.RunProc(mainSql); |
| | | |
| | | |
| | | //å é¤å
³è |
| | | DeleteRelation(ref sReturn, lngBillKey); |
| | | //å é¤å表 |
| | | DeleteBillSub(lngBillKey); |
| | | |
| | | |
| | | //æå
¥å表 |
| | | omodel.HInterID = lngBillKey; |
| | | foreach (Models.ClsKf_MateOutBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Kf_ICStockBillSub " + |
| | | string subSql = "Insert into Kf_ICStockBillSub " + |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + |
| | |
| | | "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + |
| | | "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + |
| | | "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + |
| | | ") "); |
| | | ") "; |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "") //ä¹ä¸å®¢æ· |
| | | { |
| | | subSql = "Insert into Kf_ICStockBillSub" + |
| | | "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + |
| | | ",HRate,HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo)" + |
| | | " values(" + |
| | | omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + |
| | | "','" + oSub.HEntryCloseDate.ToShortDateString() + |
| | | "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + |
| | | ",'" + oSub.HRemark + |
| | | "'," + oSub.HSourceInterID.ToString() + |
| | | "," + oSub.HSourceEntryID.ToString() + |
| | | ",'" + oSub.HSourceBillNo + |
| | | "','" + oSub.HSourceBillType + |
| | | "'," + oSub.HRelationQty.ToString() + |
| | | "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HMaterID.ToString() + |
| | | "," + oSub.HPropertyID.ToString() + |
| | | "," + oSub.HSecUnitID.ToString() + |
| | | "," + oSub.HSecUnitRate.ToString() + |
| | | "," + oSub.HUnitID.ToString() + |
| | | "," + oSub.HQtyMust.ToString() + |
| | | "," + oSub.HRate.ToString() + |
| | | "," + oSub.HQty.ToString() + |
| | | "," + oSub.HPrice.ToString() + |
| | | "," + oSub.HMoney.ToString() + |
| | | "," + oSub.HWHID.ToString() + |
| | | "," + oSub.HSCWHID.ToString() + |
| | | "," + oSub.HSPID.ToString() + |
| | | "," + oSub.HSCSPID.ToString() + |
| | | "," + oSub.HSPGroupID.ToString() + |
| | | ",'" + oSub.HBatchNo + |
| | | "'," + oSub.HPOOrderInterID.ToString() + |
| | | "," + oSub.HPOOrderEntryID.ToString() + |
| | | ",'" + oSub.HPOOrderBillNo + |
| | | "'," + oSub.HSeOrderInterID.ToString() + |
| | | "," + oSub.HSeOrderEntryID.ToString() + |
| | | ",'" + oSub.HSeOrderBillNo + |
| | | "') "; |
| | | } |
| | | |
| | | oCn.RunProc(subSql); |
| | | } |
| | | // |
| | | //foreach (Model.ClsKf_MateOutBillSub oSub in DetailColl) |
| | |
| | | { |
| | | //å¾å°mainid |
| | | omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo); |
| | | omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //omodel.HBillNo = DBUtility.ClsPub.CreateBillCode(BillType, ref DBUtility.ClsPub.sExeReturnInfo, true); |
| | | //è¥MAINDIéå¤åéæ°è·å |
| | | if (IsExistBillNo(ref DBUtility.ClsPub.sExeReturnInfo, omodel.HBillNo, Pub_Class.ClsPub.Enum_BillStatus.BillStatus_AddNew, omodel.HInterID)) |
| | | { |
| | |
| | | } |
| | | // |
| | | oCn.BeginTran(); |
| | | //主表 |
| | | oCn.RunProc("Insert Into Kf_ICStockBillMain " + |
| | | |
| | | string mainSql = "Insert Into Kf_ICStockBillMain " + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate" + |
| | | ",HYear,HPeriod,HRemark,HMaker,HMakeDate" + |
| | | ",HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID" + |
| | | ",HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + |
| | | ") " + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | " values('" + this.BillType + "','" + this.HBillSubType + "'," + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "'" + |
| | | ", " + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" + |
| | | ", " + omodel.HSupID.ToString() + "," + omodel.HWHID.ToString() + "," + omodel.HSCWHID.ToString() + "," + omodel.HEmpID.ToString() + "," + omodel.HManagerID.ToString() + "," + omodel.HSecManagerID.ToString() + |
| | | ", " + omodel.HKeeperID.ToString() + "," + omodel.HDeptID.ToString() + ",'" + omodel.HExplanation + "','" + omodel.HInnerBillNo + "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + |
| | | ") "); |
| | | ") "; |
| | | |
| | | |
| | | //å¤æä½¿ç¨å®¢æ·ï¼æ ¹æ®å®¢æ·è¿è¡ä¸ªæ§åè°æ´ |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | string sErrMsg = ""; |
| | | oSystemParameter.ShowBill(ref sErrMsg); |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "") //ä¹ä¸å®¢æ· |
| | | { |
| | | mainSql = "Insert Into Kf_ICStockBillMain" + |
| | | "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HYear,HPeriod,HRemark,HMainSourceInterID,HMainSourceBillNo,HMainSourceBillType,HMaker,HMakeDate,HSupID,HWHID,HSCWHID,HEmpID,HManagerID,HSecManagerID,HKeeperID,HDeptID,HExplanation,HInnerBillNo,HRedBlueFlag" + |
| | | ",HICMOInterID,HICMOEntryID,HICMOBillNo,HProcExchInterID,HProcExchEntryID,HProcExchBillNo,HMaterID,HMaterName,HVerNo,HModel,HModel2,HPieceQty,HCusID,HWeight,HLong,HSingleWeight,HMaterSumWeight,HMaterEmpID" + |
| | | ",HMachineSpeed,HWaterRush,HWaterQty,HWaterRate) " + |
| | | " values(" + |
| | | "'" + this.BillType + |
| | | "','" + this.HBillSubType + |
| | | "'," + omodel.HInterID.ToString() + |
| | | ",'" + omodel.HBillNo + |
| | | "','" + omodel.HDate + |
| | | "'," + omodel.HYear.ToString() + |
| | | "," + omodel.HPeriod.ToString() + |
| | | ",'" + omodel.HRemark + |
| | | "'," + omodel.HProcExchInterID + |
| | | ",'" + omodel.HProcExchBillNo + |
| | | "','" + "3772" + |
| | | "','" + DBUtility.ClsPub.CurUserName + |
| | | "',getdate()" + |
| | | "," + omodel.HSupID.ToString() + |
| | | "," + omodel.HWHID.ToString() + |
| | | "," + omodel.HSCWHID.ToString() + |
| | | "," + omodel.HEmpID.ToString() + |
| | | "," + omodel.HManagerID.ToString() + |
| | | "," + omodel.HSecManagerID.ToString() + |
| | | ", " + omodel.HKeeperID.ToString() + |
| | | "," + omodel.HDeptID.ToString() + |
| | | ",'" + omodel.HExplanation + |
| | | "','" + omodel.HInnerBillNo + |
| | | "'," + DBUtility.ClsPub.BoolToString(omodel.HRedBlueFlag) + |
| | | "," + omodel.HICMOInterID + |
| | | "," + omodel.HICMOEntryID + |
| | | ",'" + omodel.HICMOBillNo + |
| | | "'," + omodel.HProcExchInterID + |
| | | "," + omodel.HProcExchEntryID + |
| | | ",'" + omodel.HProcExchBillNo + |
| | | "'," + omodel.HMaterID + |
| | | ",'" + omodel.HMaterName + |
| | | "','" + omodel.HVerNo + |
| | | "','" + omodel.HModel + |
| | | "','" + omodel.HModel2 + |
| | | "','" + omodel.HPieceQty + |
| | | "'," + omodel.HCusID + |
| | | "," + omodel.HWeight + |
| | | "," + omodel.HLong + |
| | | "," + omodel.HSingleWeigth + |
| | | "," + omodel.HMaterSumWeight + |
| | | "," + omodel.HMaterEmpID + |
| | | "," + omodel.HMachineSpeed + |
| | | "," + omodel.HWaterRush + |
| | | "," + omodel.HWaterQty + |
| | | "," + omodel.HWaterRate + |
| | | ")"; |
| | | } |
| | | |
| | | //主表 |
| | | oCn.RunProc(mainSql); |
| | | //æå
¥å表 |
| | | foreach (Models.ClsKf_MateOutBillSub oSub in DetailColl) |
| | | { |
| | | oCn.RunProc("Insert into Kf_ICStockBillSub " + |
| | | string subSql = "Insert into Kf_ICStockBillSub " + |
| | | " (HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark" + |
| | | ",HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney" + |
| | | ",HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + |
| | |
| | | "," + oSub.HQty.ToString() + "," + oSub.HPrice.ToString() + "," + oSub.HMoney.ToString() + "," + oSub.HWHID.ToString() + "," + oSub.HSCWHID.ToString() + "," + oSub.HSPID.ToString() + |
| | | "," + oSub.HSCSPID.ToString() + "," + oSub.HSPGroupID.ToString() + ",'" + oSub.HBatchNo + "'," + oSub.HPOOrderInterID.ToString() + "," + oSub.HPOOrderEntryID.ToString() + ",'" + oSub.HPOOrderBillNo + "'" + |
| | | "," + oSub.HSeOrderInterID.ToString() + "," + oSub.HSeOrderEntryID.ToString() + ",'" + oSub.HSeOrderBillNo + "'" + |
| | | ") "); |
| | | ") "; |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "") //ä¹ä¸å®¢æ· |
| | | { |
| | | subSql = "Insert into Kf_ICStockBillSub" + |
| | | "(HInterID,HEntryID,HCloseMan,HEntryCloseDate,HCloseType,HRemark,HSourceInterID,HSourceEntryID,HSourceBillNo,HSourceBillType,HRelationQty,HRelationMoney,HMaterID,HPropertyID,HSecUnitID,HSecUnitRate,HUnitID,HQtyMust" + |
| | | ",HRate,HQty,HPrice,HMoney,HWHID,HSCWHID,HSPID,HSCSPID,HSPGroupID,HBatchNo,HPOOrderInterID,HPOOrderEntryID,HPOOrderBillNo,HSeOrderInterID,HSeOrderEntryID,HSeOrderBillNo)" + |
| | | " values(" + |
| | | omodel.HInterID.ToString() + |
| | | "," + oSub.HEntryID.ToString() + |
| | | ",'" + oSub.HCloseMan + |
| | | "','" + oSub.HEntryCloseDate.ToShortDateString() + |
| | | "'," + Convert.ToString(oSub.HCloseType ? 1 : 0) + |
| | | ",'" + oSub.HRemark + |
| | | "'," + oSub.HSourceInterID.ToString() + |
| | | "," + oSub.HSourceEntryID.ToString() + |
| | | ",'" + oSub.HSourceBillNo + |
| | | "','" + oSub.HSourceBillType + |
| | | "'," + oSub.HRelationQty.ToString() + |
| | | "," + oSub.HRelationMoney.ToString() + |
| | | "," + oSub.HMaterID.ToString() + |
| | | "," + oSub.HPropertyID.ToString() + |
| | | "," + oSub.HSecUnitID.ToString() + |
| | | "," + oSub.HSecUnitRate.ToString() + |
| | | "," + oSub.HUnitID.ToString() + |
| | | "," + oSub.HQtyMust.ToString() + |
| | | "," + oSub.HRate.ToString() + |
| | | "," + oSub.HQty.ToString() + |
| | | "," + oSub.HPrice.ToString() + |
| | | "," + oSub.HMoney.ToString() + |
| | | "," + oSub.HWHID.ToString() + |
| | | "," + oSub.HSCWHID.ToString() + |
| | | "," + oSub.HSPID.ToString() + |
| | | "," + oSub.HSCSPID.ToString() + |
| | | "," + oSub.HSPGroupID.ToString() + |
| | | ",'" + oSub.HBatchNo + |
| | | "'," + oSub.HPOOrderInterID.ToString() + |
| | | "," + oSub.HPOOrderEntryID.ToString() + |
| | | ",'" + oSub.HPOOrderBillNo + |
| | | "'," + oSub.HSeOrderInterID.ToString() + |
| | | "," + oSub.HSeOrderEntryID.ToString() + |
| | | ",'" + oSub.HSeOrderBillNo + |
| | | "') "; |
| | | } |
| | | oCn.RunProc(subSql); |
| | | } |
| | | // |
| | | //foreach (Model.ClsKf_MateOutBillSub oSub in DetailColl) |
| | |
| | | omodel.HExplanation = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HExplanation"]); |
| | | omodel.HInnerBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HInnerBillNo"]); |
| | | omodel.HRedBlueFlag = DBUtility.ClsPub.isBool(Ds.Tables[0].Rows[0]["HRedBlueFlag"]); |
| | | // |
| | | |
| | | |
| | | |
| | | //å¤æä½¿ç¨å®¢æ·ï¼æ ¹æ®å®¢æ·è¿è¡ä¸ªæ§åè°æ´ |
| | | Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); |
| | | string sErrMsg = ""; |
| | | oSystemParameter.ShowBill(ref sErrMsg); |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "") //ä¹ä¸å®¢æ· |
| | | { |
| | | omodel.HICMOInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOInterID"]); |
| | | omodel.HICMOEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HICMOEntryID"]); |
| | | omodel.HICMOBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HICMOBillNo"]); |
| | | omodel.HProcExchInterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchInterID"]); |
| | | omodel.HProcExchEntryID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HProcExchEntryID"]); |
| | | omodel.HProcExchBillNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HProcExchBillNo"]); |
| | | omodel.HMaterID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterID"]); |
| | | omodel.HMaterName = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HMaterName"]); |
| | | omodel.HVerNo = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HVerNo"]); |
| | | omodel.HModel = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HModel"]); |
| | | omodel.HModel2 = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HModel2"]); |
| | | omodel.HPieceQty = DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HPieceQty"]); |
| | | omodel.HCusID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HCusID"]); |
| | | omodel.HWeight = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWeight"]); |
| | | omodel.HLong = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HLong"]); |
| | | omodel.HSingleWeigth = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HSingleWeight"]); |
| | | omodel.HMaterSumWeight = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMaterSumWeight"]); |
| | | omodel.HMaterEmpID = DBUtility.ClsPub.isLong(Ds.Tables[0].Rows[0]["HMaterEmpID"]); |
| | | |
| | | omodel.HMachineSpeed = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HMachineSpeed"]); |
| | | omodel.HWaterRush = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterRush"]); |
| | | omodel.HWaterQty = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterQty"]); |
| | | omodel.HWaterRate = DBUtility.ClsPub.isDoule(Ds.Tables[0].Rows[0]["HWaterRate"]); |
| | | } |
| | | |
| | | // |
| | | |
| | | //å¾ªç¯ |
| | | DataSet DsSub ; |
| | | DsSub = oCn.RunProcReturn("Select * from Kf_ICStockBillSub Where HInterID=" + lngBillKey.ToString(), "Kf_ICStockBillSub"); |
| | |
| | | oSub.HSeOrderInterID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderInterID"]); |
| | | oSub.HSeOrderEntryID = DBUtility.ClsPub.isLong(DsSub.Tables[0].Rows[i]["HSeOrderEntryID"]); |
| | | oSub.HSeOrderBillNo = DBUtility.ClsPub.isStrNull(DsSub.Tables[0].Rows[i]["HSeOrderBillNo"]); |
| | | |
| | | if (oSystemParameter.omodel.WMS_CampanyName == "") //ä¹ä¸å®¢æ· |
| | | { |
| | | oSub.HRate = DBUtility.ClsPub.isDoule(DsSub.Tables[0].Rows[0]["HRate"]); |
| | | } |
| | | |
| | | DetailColl.Add(oSub); |
| | | } |
| | | sReturn = "æ¾ç¤ºåæ®æåï¼"; |
| | |
| | | public string HExplanation;// varchar(200) --ÕªÒª |
| | | public string HInnerBillNo;// varchar(50) --å
é¨åæ®å· |
| | | public bool HRedBlueFlag;// bit --红èå |
| | | |
| | | public Int64 HICMOInterID; //int --ä»»å¡åå
ç |
| | | public Int64 HICMOEntryID; //int --ä»»å¡ååå
ç |
| | | public string HICMOBillNo; //int --ä»»å¡åå· |
| | | public Int64 HProcExchInterID; //int --å·¥åºæµè½¬å¡å
ç |
| | | public Int64 HProcExchEntryID; //int --å·¥åºæµè½¬å¡åå
ç |
| | | public string HProcExchBillNo; //int --å·¥åºæµè½¬å¡å· |
| | | public Int64 HMaterID; //int --主产åå
ç |
| | | public string HMaterName; //varchar(100) --é¢è² |
| | | public string HVerNo; //varchar(50) --è±çå· |
| | | public string HModel; //varchar(100) --è§æ ¼åå·1 |
| | | public string HModel2; //varchar(100) --è§æ ¼åå·2 |
| | | public string HPieceQty; //varchar(20) --åªæ° |
| | | public Int64 HCusID; //int --å®¢æ· |
| | | public double HWeight; //dec(18,8) --éé |
| | | public double HLong; //dec(18,8) --ç±³æ° |
| | | public double HSingleWeigth; //dec(18,8) --åæ¡¶éé |
| | | public double HMaterSumWeight; //dec(18,8) --æ»æµéé |
| | | public Int64 HMaterEmpID; //int --ææµäºº |
| | | |
| | | public double HMachineSpeed; //dec(18,8) --æºé |
| | | public double HWaterRush; //dec(18,8) --æ°´å² |
| | | public double HWaterQty; //dec(18,8) --æ°´é |
| | | public double HWaterRate; //dec(18,8) --æ°´æ¯ |
| | | } |
| | | } |
| | |
| | | public Int64 HSeOrderEntryID;// int --éå®è®¢ååå
ç |
| | | public string HSeOrderBillNo;// varchar(50) --éå®è®¢åå· |
| | | |
| | | public double HRate; //money --ç¨é |
| | | |
| | | } |
| | | } |