Merge branch 'dev' of http://47.101.211.7:10101/r/VWED into dev
| | |
| | | Boolean versionflag, |
| | | const Product_MPs products, |
| | | String executor |
| | | ) |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | |
| | | |
| | | } |
| | | loginfo.TotalRow( ms64.MS64Data( relsize ) ); |
| | | AOnlineAndMOfflinePlanMS64::Publish( owner, loginfo ); |
| | | return AOnlineAndMOfflinePlanMS64::Publish( owner, loginfo ); |
| | | //InterfaceLoginfo::CallInterfaceForSAPGet( owner, loginfo ); |
| | | *] |
| | | } |
| | |
| | | StaticMethod Publish ( |
| | | InterfaceDataset owner, |
| | | InterfaceLoginfo loginfo |
| | | ) |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | |
| | | loginfo.RequestBody( jsondata.Build().AsString() ); |
| | | info( loginfo.RequestBody() ); |
| | | data := InterfaceLoginfo::CallInterfaceForSAPGet( owner, loginfo ); |
| | | info( '----------------', data.Size() ); |
| | | info( '----------------', data ); |
| | | return data; |
| | | *] |
| | | } |
| | |
| | | Date startdate, |
| | | Date enddate, |
| | | String executor |
| | | ) |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | |
| | | } |
| | | } |
| | | loginfo.TotalRow( pir.PIRData( relsize ) ); |
| | | AOnlineAndMOfflinePlanPIR::Publish( owner, loginfo ); |
| | | return AOnlineAndMOfflinePlanPIR::Publish( owner, loginfo ); |
| | | *] |
| | | } |
| | |
| | | StaticMethod Publish ( |
| | | InterfaceDataset owner, |
| | | InterfaceLoginfo loginfo |
| | | ) |
| | | ) as String |
| | | { |
| | | TextBody: |
| | | [* |
| | |
| | | loginfo.RequestBody( jsondata.Build().AsString() ); |
| | | info( loginfo.RequestBody() ); |
| | | data := InterfaceLoginfo::CallInterfaceForSAPGet( owner, loginfo ); |
| | | info( '----------------', data.Size() ); |
| | | info( '----------------', data ); |
| | | return data; |
| | | *] |
| | | } |
| | |
| | | // CustomerDemandPPAIDS::GenerateData( this, macroplan, iscustomdemandcc, iscustomdemanddl, executor ); |
| | | } |
| | | if ( isofflineplandl or isofflineplancc ) { // 各产线下线计划 |
| | | InterfaceDataset::PushOfflinePlanData( macroplan, this, executor ); |
| | | InterfaceDataset::PushOfflinePlanData( macroplan, this, executor, isofflineplandl, isofflineplancc ); |
| | | } |
| | | if( isshiftplandl or isshiftplancc ){//班次计划 |
| | | DispatchShiftPlan::Dispatch(this, archive,executor ); |
| | |
| | | AssemblyOnlinePlanPPPSPush::GenerateData( this, macroplan, isassembleonlineplancc, isassembleonlineplandl, executor ); |
| | | } |
| | | if ( isinventoryplandl or isinventoryplancc ) { // 计划库存数据 |
| | | InterfaceDataset::PushPlanInventoryData( macroplan, this, executor ); |
| | | InterfaceDataset::PushPlanInventoryData( macroplan, this, executor, isinventoryplandl, isinventoryplancc ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | StaticMethod PushOfflinePlanData ( |
| | | const MacroPlan macroPlan, |
| | | InterfaceDataset interfaceDataset, |
| | | String executor |
| | | String executor, |
| | | Boolean isofflineplandl, |
| | | Boolean isofflineplancc |
| | | ) |
| | | { |
| | | Description: '发送下线计划数据接口' |
| | |
| | | |
| | | jsonarray := JSON::Array(); |
| | | |
| | | traverse ( table, Row, r ){ |
| | | traverse ( table, Row, r, ifexpr( isofflineplandl, r.Unit().Regex( "DL" ), false ) or ifexpr( isofflineplancc, r.Unit().Regex( "CC" ), false ) ){ |
| | | traverse ( table, Column, c ) {//, c.TimeUnit() = Translations::MP_GlobalParameters_Day() |
| | | cell := select( r, Cell, tempC, tempC.Column() = c ); |
| | | |
| | |
| | | StaticMethod PushPlanInventoryData ( |
| | | const MacroPlan macroPlan, |
| | | InterfaceDataset interfaceDataset, |
| | | String executor |
| | | String executor, |
| | | Boolean isinventoryplandl, |
| | | Boolean isinventoryplancc |
| | | ) |
| | | { |
| | | Description: '发送计划库存数据接口' |
| | |
| | | |
| | | jsonarray := JSON::Array(); |
| | | |
| | | traverse ( table, Row, r ){ |
| | | traverse ( table, Row, r, ifexpr( isinventoryplandl, r.Unit().Regex( "DL" ), false ) or ifexpr( isinventoryplancc, r.Unit().Regex( "CC" ), false ) ){ |
| | | traverse ( table, Column, c ) {//, c.TimeUnit() = Translations::MP_GlobalParameters_Day() |
| | | cell := select( r, Cell, tempC, tempC.Column() = c ); |
| | | |
| | |
| | | StaticMethod CallInterfaceForSAPGet ( |
| | | InterfaceDataset owner, |
| | | InterfaceLoginfo loginfo |
| | | ) as owning InterfaceSAPResponseLoginfos |
| | | ) as String |
| | | { |
| | | Description: '调用数据中台接口' |
| | | TextBody: |
| | | [* |
| | | // 甄兰鸽 Jul-22-2024 (created) |
| | | address := Translations::InterfaceDataset_SAP_Address(); |
| | | httpinterface := HTTPInterface::Create( address,80); |
| | | httpinterface := HTTPInterface::Create( address,8080); |
| | | httpinterface.PostMethod( true ); ; |
| | | httpinterface.MediaType( Translations::InterfaceDataset_ContentType() ); |
| | | try{ |
| | |
| | | //后续公共处理 |
| | | loginfo.FinishTime( DateTime::ActualTime() ); |
| | | data := JSON::Null().Build(); |
| | | saploginfos := construct( InterfaceSAPResponseLoginfos ); |
| | | sapresponse := construct( InterfaceSAPResponseLoginfos ); |
| | | feedback := ''; |
| | | if( loginfo.Success() ){ |
| | | resultJson := JSON::Parse( loginfo.Response() ); |
| | | code := resultJson.Get( "code" ).GetNumber(); |
| | |
| | | } |
| | | for( i := 0; i < data.Size(); i++ ){ |
| | | item := data.Get( i ); |
| | | saploginfos.Add( InterfaceSAPResponseLoginfo::GenerateData( loginfo, item ) ); |
| | | sapresponse.Add( InterfaceSAPResponseLoginfo::GenerateData( loginfo, item ) ); |
| | | } |
| | | sucproduct := selectuniquevalues( sapresponse, Elements, e, e.IsSuccess(), e.Msg_v1() ); |
| | | failmssages := selectuniquevalues( sapresponse, Elements, e, not e.IsSuccess(), ifexpr( e.Msg().FindString( e.Msg_v1(), 0 ) > -1, e.Msg().ReplaceAll( e.Msg_v1(), '*' ), e.Msg() ) ); |
| | | feedback := feedback.Concat( '产品' ).Concat( sucproduct.Concatenate( "、" ) ).Concat( '推送成功' ).Concat( ';' ); |
| | | traverse( failmssages, Elements, failmsg ){ |
| | | failproduct := selectuniquevalues( sapresponse, Elements, e, not e.IsSuccess() and ( failmsg = e.Msg() or failmsg = e.Msg().ReplaceAll( e.Msg_v1(), '*' ) ), e.Msg_v1() ); |
| | | if( failmsg.FindString( '*', 0 ) > -1 ){ |
| | | feedback := feedback.Concat( failmsg.ReplaceAll( '*', failproduct.Concatenate( '、' ) ) ).Concat( ';' ); |
| | | }else{ |
| | | feedback := feedback.Concat( '产品' ).Concat( failproduct.Concatenate( '、' ) ).Concat( '因为' ).Concat( failmsg ).Concat( '推送失败' ).Concat( ';' ); |
| | | } |
| | | } |
| | | feedback := feedback.Replace( feedback.Length() - 1, 1, '。' ); |
| | | } |
| | | |
| | | return &saploginfos; |
| | | return feedback; |
| | | *] |
| | | } |
| | |
| | | TextBody: |
| | | [* |
| | | // 甄兰鸽 Aug-23-2024 (created) |
| | | owner.IL_InterfaceLogInfoMiddlesBroker().Execute(); |
| | | // 清空临时数据库 |
| | | owner.IL_InterfaceLogInfoMiddlesBroker().Source().FlatQuery( "truncate table A_InterfaceLogInfoMiddle" ); |
| | | traverse( owner, InterfaceLoginfoMiddle, middle ){ |
| | | loginfo := selectobject( owner, InterfaceLoginfo, loginfo, loginfo.Name() = middle.Name() and loginfo.IsShow() = false and loginfo.Last() = true ); |
| | | loginfo.FinishTime( middle.FinishTime() ); |
| | | loginfo.Response( middle.Response() ); |
| | | loginfo.IsShow( true ); |
| | | middle.Delete(); |
| | | } |
| | | //owner.IL_InterfaceLogInfoMiddlesBroker().Execute(); |
| | | //// 清空临时数据库 |
| | | //owner.IL_InterfaceLogInfoMiddlesBroker().Source().FlatQuery( "truncate table A_InterfaceLogInfoMiddle" ); |
| | | //traverse( owner, InterfaceLoginfoMiddle, middle ){ |
| | | // loginfo := selectobject( owner, InterfaceLoginfo, loginfo, loginfo.Name() = middle.Name() and loginfo.IsShow() = false and loginfo.Last() = true ); |
| | | // loginfo.FinishTime( middle.FinishTime() ); |
| | | // loginfo.Response( middle.Response() ); |
| | | // loginfo.IsShow( true ); |
| | | // middle.Delete(); |
| | | //} |
| | | *] |
| | | } |
| | |
| | | if( WebMessageBox::Question( this, '是否确认推送', 'OK|Cancel' ) = 0 ){ |
| | | currentuser := QuintiqUser::CurrentUser().DisplayName(); |
| | | |
| | | AOnlineAndMOfflinePlanMS64::GenerateData( InterfaceDataset, ddslFactory.Text(), dsStartDate.Date(), dsEndDate.Date(), efVersionFrom.Text(), efVersionTo.Text(), cbActiveVersion.Checked(), dhProducts.Data(), currentuser ); |
| | | WebMessageBox::Success( "推送成功!" ); |
| | | msg := AOnlineAndMOfflinePlanMS64::GenerateData( InterfaceDataset, ddslFactory.Text(), dsStartDate.Date(), dsEndDate.Date(), efVersionFrom.Text(), efVersionTo.Text(), cbActiveVersion.Checked(), dhProducts.Data(), currentuser ); |
| | | WebMessageBox::Warning( ApplicationMacroPlanner, msg, 'Yes|No' ) |
| | | } |
| | | Form.Close(); |
| | | *] |
| | |
| | | [* |
| | | Form.ApplyChanges(); |
| | | if( WebMessageBox::Question( this, '是否确认推送', 'OK|Cancel' ) = 0 ){ |
| | | AOnlineAndMOfflinePlanPIR::GenerateData( InterfaceDataset, ddslFactory.Text(), efVersion.Text(), dsStartDate.Date(), dsEndDate.Date(), QuintiqUser::CurrentUser().DisplayName() ); |
| | | WebMessageBox::Success( "推送成功!" ); |
| | | msg := AOnlineAndMOfflinePlanPIR::GenerateData( InterfaceDataset, ddslFactory.Text(), efVersion.Text(), dsStartDate.Date(), dsEndDate.Date(), QuintiqUser::CurrentUser().DisplayName() ); |
| | | WebMessageBox::Warning( ApplicationMacroPlanner, msg, 'Yes|No' ) |
| | | } |
| | | Form.Close(); |
| | | *] |