_Main/BL/Type_PRData/StaticMethod_Export#346.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,209 @@ Quintiq file version 2.0 #parent: #root StaticMethod Export ( PRDatas toExportList ) as String { TextBody: [* // generate by generate_export_method.py xmlTemplate := '<?xml version="1.0" encoding="UTF-16"?> <table> <name>PRData</name> '; convDateToString := DateToString::StandardConverter(); convDateToString.SetCustomConversion(); convDateToString.CustomFormatString( 'yyyy-MM-dd' ); debuginfo( "export start" ); //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç©æç¼ç </name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { productID := toExportItem.ProductID(); cellStr := '<cell value="' + productID + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç©æåç§°</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { productName := toExportItem.ProductName(); cellStr := '<cell value="' + productName + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>颿¿ç©ææ è¯</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { isPanelMaterial := toExportItem.IsPanelMaterial(); cellStr := '<cell value="' + isPanelMaterial + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>äº¤è´§æ¥æ</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { deliveryDate := toExportItem.DeliveryDate(); cellStr := '<cell value="' + ifexpr( deliveryDate = Date::MinDate(), "", convDateToString.Convert( deliveryDate )) + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>PRå»ºè®®æ¥æ</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { pRSuggestionDate := toExportItem.PRSuggestionDate(); cellStr := '<cell value="' + ifexpr( pRSuggestionDate = Date::MinDate(), "", convDateToString.Convert( pRSuggestionDate )) + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>交货æ°é</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { quantity := toExportItem.Quantity(); cellStr := '<cell value="' + [String]quantity + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>MRP计ç®çæ¬å·</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { mRPCalverNo := toExportItem.MRPCalverNo(); cellStr := '<cell value="' + mRPCalverNo + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ä¸å¡ç±»å</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { businessType := toExportItem.BusinessType(); cellStr := '<cell value="' + businessType + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç»ç»ç¼ç </name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { organCode := toExportItem.OrganCode(); cellStr := '<cell value="' + organCode + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>æ¯å¦é¿å¨æ</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { isLongLeadItem := toExportItem.IsLongLeadItem(); cellStr := '<cell value="' + isLongLeadItem + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>æ¯å¦ä¸ç¨æ</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { isGenericMaterial := toExportItem.IsGenericMaterial(); cellStr := '<cell value="' + isGenericMaterial + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç©æè®¡åçç¥</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { materialMRPType := toExportItem.MaterialMRPType(); cellStr := '<cell value="' + materialMRPType + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>æåæ</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { leadTime := toExportItem.LeadTime(); cellStr := '<cell value="' + [String]leadTime + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ä¾åºå代ç </name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { providerCode := toExportItem.ProviderCode(); cellStr := '<cell value="' + providerCode + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ä¾åºååç§°</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { providerName := toExportItem.ProviderName(); cellStr := '<cell value="' + providerName + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>æ¶è´§åºåç¹</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { stockingPointID := toExportItem.StockingPointID(); cellStr := '<cell value="' + stockingPointID + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>计éåä½</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { unitOfMeasure := toExportItem.UnitOfMeasure(); cellStr := '<cell value="' + unitOfMeasure + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>PRæ°æ®åéç¶æ</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { pRReleaseStatus := toExportItem.PRReleaseStatus(); cellStr := '<cell value="' + pRReleaseStatus + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>åéæ¶é´</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { createTimeString := toExportItem.CreateTimeString(); cellStr := '<cell value="' + createTimeString + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>åé人</name><type>String</type>"; traverse( toExportList, Elements, toExportItem ) { createBy := toExportItem.CreateBy(); cellStr := '<cell value="' + createBy + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- xmlTemplate := xmlTemplate + "</table>"; tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlTemplate ) ); XLS::SaveTable( tableHandle, OS::TempPath() + "PRData.xlsx" ); file := OSFile::Construct(); file.Open( OS::TempPath() + "PRData.xlsx", "Read", true ); data := file.ReadBinary() debuginfo( "export end" ); return data.AsBase64EncodedString(); *] } _Main/BL/Type_PRData/StaticMethod_Export.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ Quintiq file version 2.0 #parent: #root StaticMethod Export ( MacroPlan parent ) as String { TextBody: [* // generate by generate_export_method.py toExportList := selectset( parent, PRData, item, true ); return PRData::Export( toExportList ); *] } _Main/BL/Type_PRData/StaticMethod_ExportTheFileStream#595.qbl
ÎļþÒÑɾ³ý _Main/BL/Type_PRData/StaticMethod_ExportTheFileStream.qbl
ÎļþÒÑɾ³ý _Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning.qbl
@@ -14,10 +14,15 @@ // æMRPCalverNoæ¥ï¼å·²ææ§è®°å½æ¶ä¸å¤ç oldRecords := selectset( macroPlan, PRData, item, item.MRPCalverNo() = mrpCalverNo ); nowNo := 1; if( isnull( oldRecords ) or oldRecords.Size() = 0 ) { pispips := ProductInStockingPointInPeriod::GetByMRPCalverNo( macroPlan, mrpCalverNo ); traverse( pispips, Elements, item, item.NewSupplyQuantity() > 0 ) { PRData::FromSupplyPlanning( otdTable, macroPlan, item, userId ); nowNo := nowNo + 1; if( nowNo mod 1000 = 0 ) { info( "SupplyPlanning to prData : " + [String]nowNo ); } } } *] _Main/BL/Type_PRHistoryData/StaticMethod_Export#527.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,199 @@ Quintiq file version 2.0 #parent: #root StaticMethod Export ( PRHistoryDatas toExportList ) as String { TextBody: [* // generate by generate_export_method.py xmlTemplate := '<?xml version="1.0" encoding="UTF-16"?> <table> <name>PRHistoryData</name> '; convDateToString := DateToString::StandardConverter(); convDateToString.SetCustomConversion(); convDateToString.CustomFormatString( 'yyyy-MM-dd' ); debuginfo( "export start" ); //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç©æç¼ç </name><type>String</type>"; debuginfo( "export column ProductID" ); traverse( toExportList, Elements, toExportItem ) { productID := toExportItem.ProductID(); cellStr := '<cell value="' + productID + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç©æåç§°</name><type>String</type>"; debuginfo( "export column ProductName" ); traverse( toExportList, Elements, toExportItem ) { productName := toExportItem.ProductName(); cellStr := '<cell value="' + productName + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>äº¤è´§æ¥æ</name><type>String</type>"; debuginfo( "export column DeliveryDate" ); traverse( toExportList, Elements, toExportItem ) { deliveryDate := toExportItem.DeliveryDate(); cellStr := '<cell value="' + ifexpr( deliveryDate = Date::MinDate(), "", convDateToString.Convert( deliveryDate )) + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>交货æ°é</name><type>String</type>"; debuginfo( "export column Quantity" ); traverse( toExportList, Elements, toExportItem ) { quantity := toExportItem.Quantity(); cellStr := '<cell value="' + [String]quantity + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>MRP计ç®çæ¬å·</name><type>String</type>"; debuginfo( "export column MRPCalverNo" ); traverse( toExportList, Elements, toExportItem ) { mRPCalverNo := toExportItem.MRPCalverNo(); cellStr := '<cell value="' + mRPCalverNo + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ä¸å¡ç±»å</name><type>String</type>"; debuginfo( "export column BusinessType" ); traverse( toExportList, Elements, toExportItem ) { businessType := toExportItem.BusinessType(); cellStr := '<cell value="' + businessType + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ç»ç»ç¼ç </name><type>String</type>"; debuginfo( "export column OrganCode" ); traverse( toExportList, Elements, toExportItem ) { organCode := toExportItem.OrganCode(); cellStr := '<cell value="' + organCode + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ä¾åºå代ç </name><type>String</type>"; debuginfo( "export column ProviderCode" ); traverse( toExportList, Elements, toExportItem ) { providerCode := toExportItem.ProviderCode(); cellStr := '<cell value="' + providerCode + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ä¾åºååç§°</name><type>String</type>"; debuginfo( "export column ProviderName" ); traverse( toExportList, Elements, toExportItem ) { providerName := toExportItem.ProviderName(); cellStr := '<cell value="' + providerName + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>æ¶è´§åºåç¹</name><type>String</type>"; debuginfo( "export column StockingPointID" ); traverse( toExportList, Elements, toExportItem ) { stockingPointID := toExportItem.StockingPointID(); cellStr := '<cell value="' + stockingPointID + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>计éåä½</name><type>String</type>"; debuginfo( "export column UnitOfMeasure" ); traverse( toExportList, Elements, toExportItem ) { unitOfMeasure := toExportItem.UnitOfMeasure(); cellStr := '<cell value="' + unitOfMeasure + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>PRæ°æ®åéç¶æ</name><type>String</type>"; debuginfo( "export column SendStatus" ); traverse( toExportList, Elements, toExportItem ) { sendStatus := toExportItem.SendStatus(); cellStr := '<cell value="' + sendStatus + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>åéæ¶é´</name><type>String</type>"; debuginfo( "export column SendTimeString" ); traverse( toExportList, Elements, toExportItem ) { sendTimeString := toExportItem.SendTimeString(); cellStr := '<cell value="' + sendTimeString + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>åé人</name><type>String</type>"; debuginfo( "export column ReleaseBy" ); traverse( toExportList, Elements, toExportItem ) { releaseBy := toExportItem.ReleaseBy(); cellStr := '<cell value="' + releaseBy + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ERPæ¥æ¶æ¶é´</name><type>String</type>"; debuginfo( "export column ReceiveTimeString" ); traverse( toExportList, Elements, toExportItem ) { receiveTimeString := toExportItem.ReceiveTimeString(); cellStr := '<cell value="' + receiveTimeString + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>ERPæ¥æ¶ç¶æ</name><type>String</type>"; debuginfo( "export column ReceiveStatus" ); traverse( toExportList, Elements, toExportItem ) { receiveStatus := toExportItem.ReceiveStatus(); cellStr := '<cell value="' + receiveStatus + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- columnStr := "<column><name>éè¯¯ä¿¡æ¯æè¿°</name><type>String</type>"; debuginfo( "export column ReceiveError" ); traverse( toExportList, Elements, toExportItem ) { receiveError := toExportItem.ReceiveError(); cellStr := '<cell value="' + receiveError.ReplaceAll( '"', "'" ) + '"/>'; columnStr := columnStr + cellStr; } columnStr := columnStr + "</column>"; xmlTemplate := xmlTemplate + columnStr; //--------------------------------------------------------------------------------------------- xmlTemplate := xmlTemplate + "</table>"; tableHandle := TableHandle::ImportXML( BinaryValue::Construct( xmlTemplate ) ); XLS::SaveTable( tableHandle, OS::TempPath() + "PRHistoryData.xlsx" ); file := OSFile::Construct(); file.Open( OS::TempPath() + "PRHistoryData.xlsx", "Read", true ); data := file.ReadBinary() debuginfo( "export end" ); return data.AsBase64EncodedString(); *] } _Main/BL/Type_PRHistoryData/StaticMethod_Export.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,13 @@ Quintiq file version 2.0 #parent: #root StaticMethod Export ( GlobalOTDTable parent ) as String { TextBody: [* // generate by generate_export_method.py toExportList := selectset( parent, PRHistoryData, item, true ); return PRHistoryData::Export( toExportList ); *] } _Main/BL/Type_PRHistoryData/StaticMethod_ExportTheFileStream#45.qbl
ÎļþÒÑɾ³ý _Main/BL/Type_PRHistoryData/StaticMethod_ExportTheFileStream.qbl
ÎļþÒÑɾ³ý _Main/UI/MacroPlannerWebApp/Component_Form633/Response_PanelPRDataButton_ButtonExportPR_OnClick.def
@@ -13,8 +13,7 @@ { Body: [* tableBinaryData := PRData::ExportTheFileStream( MacroPlan ).AsBinaryData(); Application.Download( "PRData.xlsx", tableBinaryData ); Application.Download( "PRData.xlsx", PRData::Export( MacroPlan ) ); *] GroupServerCalls: false } _Main/UI/MacroPlannerWebApp/Component_FormPRHistoryData/Response_PanelPRHistoryButton_ButtonExportPRHistory_OnClick.def
@@ -13,8 +13,7 @@ { Body: [* tableBinaryData := PRHistoryData::ExportTheFileStream( GlobalOTDTable ).AsBinaryData(); Application.Download( "PRData.xlsx", tableBinaryData ); Application.Download( "PRHistoryData.xlsx", PRHistoryData::Export( GlobalOTDTable ) ); *] GroupServerCalls: false }