Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj
已重命名2个文件
已修改15个文件
已添加5个文件
ÎļþÃû´Ó _Main/BL/Type_BusinessType/StaticMethod_GetBusinessNameStr.qbl ÐÞ¸Ä |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod GetBusinessNameStr ( |
| | | StaticMethod GetScenarioNamesStr ( |
| | | GlobalOTDTable owner |
| | | ) as String |
| | | { |
| | |
| | | // NBoTk Sep-7-2023 (created) |
| | | // è·åbusinessType éå |
| | | result := ""; |
| | | businessTypeList := construct( structured[String]); |
| | | scenarioNameList := construct( structured[String]); |
| | | |
| | | traverse( owner,BusinessType,b) |
| | | { |
| | | businessTypeList.Add( b.BusinessTypeName()); |
| | | scenarioNameList.Add( b.ScenarioName() ); |
| | | } |
| | | |
| | | // 妿åå¨businessTypeæ°æ® åè¿å : a,b,c |
| | | |
| | | if( not isnull( businessTypeList ) ) |
| | | if( not isnull( scenarioNameList ) ) |
| | | { |
| | | result := businessTypeList.Concatenate( ";" ); |
| | | result := scenarioNameList.Concatenate( ";" ); |
| | | } |
| | | |
| | | // æµè¯æ°æ® |
| | |
| | | // æ°å¢/æ´æ° |
| | | result := CustomerOrder::FindById( macroPlan, id ); |
| | | if( isnull( result ) ) { |
| | | CustomerOrder::Create( product, stockingPoint, id, orderDate, quantity, price, |
| | | result := CustomerOrder::Create( product, stockingPoint, id, orderDate, quantity, price, |
| | | priorityName, salesSegmentName, currencyId, unitOfMeasureName, |
| | | false, customerName, customerId, orderId, orderLineId, true, true, true ); |
| | | } else { |
| | |
| | | strMsg :=""; |
| | | |
| | | try{ |
| | | if( Owner.MappingBOM(relsize )>0) |
| | | if( GlobData.Global_MappingOperationBOM(relsize )>0) |
| | | { |
| | | // å¾å°ä¸ä¸çº§æ°æ® |
| | | AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ComponentCode()=ParentSKU); |
| | | AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ProductCode()=ParentSKU); |
| | | ObjProduct := null( Product_MP,constcontent ); |
| | | ObjUnit := null( Unit,constcontent ); |
| | | MaterialType:=""; |
| | |
| | | traverse( AllData,Elements,Obj,not isnull( Obj)) |
| | | { |
| | | // å¾å°å½åå·²åå¨çç©æä¿¡æ¯ï¼è®¢åID + SKUï¼ |
| | | ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ProductCode()); |
| | | ObjMaterial := select( Owner,H_MaterialInfo,ObjM,ObjM.ForecastID()=ForecastId and ObjM.SKU()=Obj.ComponentCode()); |
| | | if( isnull( ObjMaterial)) |
| | | { |
| | | // ç©æç±»å |
| | | MaterialType := Obj.ProductType(); |
| | | // å¾å°ç©æä¿¡æ¯ |
| | | ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ProductCode()); |
| | | ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ComponentCode()); |
| | | if( not isnull( ObjProduct)) |
| | | { |
| | | MaterialType:= ObjProduct.ParentID(); |
| | | MaterialName:=ObjProduct.Name(); |
| | | } |
| | | ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ProductCode()); |
| | | ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode()); |
| | | if( not isnull( ObjUnit)) |
| | | { |
| | | StockPoint:= ObjUnit.Name(); |
| | | } |
| | | Owner.H_MaterialInfo(relnew,ParentSKU := Obj.ComponentCode(),SKU := Obj.ProductCode(),ForecastID := ForecastId,OrgCode := Obj.OrganCode(),VCode := VCode |
| | | Owner.H_MaterialInfo(relnew,ParentSKU := ParentSKU,SKU := Obj.ComponentCode(),ForecastID := ForecastId,OrgCode := Obj.OrganCode(),VCode := VCode |
| | | ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := MaterialType,NeedDate := NDate |
| | | ,NeedQty := [Number](ProductQty/NRate*NComponentsUsed).Round( 0),Unit := Obj.UnitOfMeasureName() |
| | | ,StockPoint :=StockPoint,MaterialName := MaterialName ); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod SM_OrderHedgingEx ( |
| | | MacroPlan Owner, |
| | | String Operator |
| | | ) as owning JSON |
| | | { |
| | | Description: '填产åå²å' |
| | | TextBody: |
| | | [* |
| | | /*******************************填产å订åå²å*********************** |
| | | *彿°åç§°ï¼SM_OrderHedgingEx |
| | | *å 建 人ï¼yunying |
| | | *å建æ¶é´ï¼2023-09-27 |
| | | *æ è¿°ï¼å¡«äº§å订åå²å,填产åç表ï¼Owner.FillingCapacityOrder |
| | | *å æ°ï¼Operator æä½äºº |
| | | *è¿ å å¼ï¼JSON {Status: true æå/false 失败,Msg:"æç¤ºæ¶æ¯",Count: 0ï¼å²å订åçæ°éï¼} |
| | | *******************************************************************/ |
| | | // åå§åç»æ |
| | | bStatus := false; |
| | | strMsg :=""; |
| | | // å²åæåæ¡æ° |
| | | nCount:=0; |
| | | try |
| | | { |
| | | if(not isnull( Owner)) |
| | | { |
| | | // è·åæä½è®¢å |
| | | NewOrders := selectset( Owner,FillingCapacityOrder,Obj,Obj.State() = "æªå²å" or Obj.State() =""); |
| | | if(NewOrders.Size()>0) |
| | | { |
| | | // æ°è®¢åä¸å订åå²å |
| | | traverse( NewOrders,Elements,Obj) |
| | | { |
| | | if( (Obj.OrderType()="åç¾" or Obj.OrderType()="ææ") and Obj.Quantity()>0 ) |
| | | { |
| | | // å¾å°æä½ç¸å
³çåç¾è®¢å |
| | | ROrders:= select( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder, |
| | | ObjOrder.CustomerName() = Obj.Customer() |
| | | and ObjOrder.ProductID()=Obj.ProductID() |
| | | and ObjOrder.OrderTag() ="åç¾" |
| | | ); |
| | | // åç¾æ å²åï¼ç´æ¥å订åä¸å å
¥åç¾æ°æ® |
| | | if( Obj.OrderType()="åç¾") |
| | | { |
| | | if( not isnull( ROrders)) |
| | | { |
| | | ROrders.Quantity(ROrders.Quantity()+Obj.Quantity()); |
| | | } |
| | | else |
| | | { |
| | | // æ°å¢è®¢å |
| | | error( "----------------请å®ç°æ°å¢åç¾è®¢ååè½ä»£ç ---------------------"); |
| | | // 订åå¿
è¦ä¿¡æ¯å¦ä¸ï¼ |
| | | // OrderTag = "åç¾" |
| | | // Quantity = Obj.Quantity() |
| | | // å
¶ä»ä¿¡æ¯ç»§æ¿å½åç订å |
| | | } |
| | | } |
| | | else if(Obj.OrderType()="ææ") |
| | | { |
| | | // å¾å°æä½ç¸å
³çææè®¢å |
| | | AOrders:= select( Owner,SalesDemand.astype( CustomerOrder ),ObjOrder, |
| | | ObjOrder.CustomerName() = Obj.Customer() |
| | | and ObjOrder.ProductID()=Obj.ProductID() |
| | | and ObjOrder.OrderTag() ="ææ" |
| | | ); |
| | | if( not isnull( ROrders)) |
| | | { |
| | | // å½ååç¾æ°é |
| | | RQty:=ROrders.Quantity(); |
| | | // è®¡ç®æ°çæææ°é |
| | | AQty:= Obj.Quantity() - ROrders.Quantity(); |
| | | // ææå¤§äº0ï¼åç¾è¢«å²æ²¡,å¦åææè¢«å²ï¼åç¾çäºAQtyçç»å¯¹å¼ |
| | | if( AQty>=0) |
| | | { |
| | | RQty:=0; |
| | | } |
| | | else |
| | | { |
| | | RQty :=ROrders.Quantity() - Obj.Quantity(); |
| | | AQty :=0; |
| | | } |
| | | // æ´æ°åç¾æ°æ® |
| | | if( RQty>=0) |
| | | { |
| | | ROrders.Quantity(RQty); |
| | | } |
| | | else |
| | | { |
| | | ROrders.Delete(); |
| | | } |
| | | // æ´æ°æææ°æ® |
| | | if(AQty>0 ) |
| | | { |
| | | if( not isnull( AOrders)) |
| | | { |
| | | AOrders.Quantity(AOrders.Quantity()+AQty); |
| | | } |
| | | // æ°å¢ææè®¢å |
| | | error( "----------------请å®ç°æ°å¢ææè®¢ååè½ä»£ç ---------------------"); |
| | | // 订åå¿
è¦ä¿¡æ¯å¦ä¸ï¼ |
| | | // OrderTag = "ææ" |
| | | // Quantity = AQty |
| | | // å
¶ä»ä¿¡æ¯ç»§æ¿å½åç订å |
| | | } |
| | | } |
| | | else |
| | | { |
| | | // å°æ°æææ°æ®ç´¯å å°è®¢åä¸ |
| | | if( not isnull( AOrders)) |
| | | { |
| | | AOrders.Quantity(AOrders.Quantity()+Obj.Quantity()); |
| | | } |
| | | else |
| | | { |
| | | // æ°å¢ææè®¢å |
| | | error( "----------------请å®ç°æ°å¢ææè®¢ååè½ä»£ç ---------------------"); |
| | | // 订åå¿
è¦ä¿¡æ¯å¦ä¸ï¼ |
| | | // OrderTag = "ææ" |
| | | // Quantity = Obj.Quantity() |
| | | // å
¶ä»ä¿¡æ¯ç»§æ¿å½åç订å |
| | | } |
| | | } |
| | | } |
| | | // æ´æ°å²åç¶æ |
| | | Obj.State("å·²å²å"); |
| | | nCount++; |
| | | } |
| | | else |
| | | { |
| | | // æ æ³è¯å«çç±»åï¼ææ°é为0æ¶æä¸å¤ç |
| | | //strMsg :="订åç±»åï¼" + Obj.OrderType() + "æ æ³å²åï¼"; |
| | | } |
| | | } |
| | | bStatus:=true; |
| | | strMsg :="填产åå²å宿ï¼"; |
| | | } |
| | | else |
| | | { |
| | | strMsg :="æ å¯å²åçæ°æ®ï¼"; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | strMsg :="å è½½æ°æ®å¤±è´¥ï¼è¯·å建æéæ©åºæ¯ååæä½ï¼"; |
| | | } |
| | | } |
| | | onerror |
| | | { |
| | | strMsg :="填产å订åå²ååçé误ï¼è¯·è系系ç»ç®¡çåï¼"; |
| | | // è®°å½é误æ¥å¿ |
| | | // Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_OrderHedgingEx", |
| | | // DeveloperInformation := e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(), |
| | | // GeneralInformation := e.GeneralInformation()); |
| | | } |
| | | return JSON::Object().Add( "Status",bStatus) |
| | | .Add( "Count",nCount) |
| | | .Add( "Msg",strMsg).Build(); |
| | | *] |
| | | } |
| | |
| | | nReverseQtyNew :=0; //计ç®åçåç¾æ°é |
| | | nAuthorizeQtyNew :=0; //计ç®åçæææ°é |
| | | nHaveForecastQty :=0; //æé¢æµæ°é |
| | | nNoHaveForecastQty:=0;//äºé¢æµæ°é |
| | | nNoHaveForecastQty:=0;//æ 颿µæ°é |
| | | // è·å颿µæ°éï¼å®¢æ·+SKU+æä»½ çè®ºæ¯æ²¡æç©æé¢æµï¼ |
| | | OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = SKU |
| | | and Obj.CustomCode() = CustomerCode |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Attribute ScenarioName |
| | | { |
| | | #keys: '3[412960.0.288500040][412960.0.288500039][412960.0.288500041]' |
| | | Description: 'åºæ¯åç§°ï¼å¯¹åºäºä¸é¨&ç»ç»ç¼ç ç»´æ¤ä¸ç»´æ¤çåºæ¯åç§°' |
| | | ValueType: String |
| | | } |
ÎļþÃû´Ó _Main/BL/Type_ScenarioManager/StaticMethod_AvailableBusinessTypes.qbl ÐÞ¸Ä |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod AvailableBusinessTypes ( |
| | | StaticMethod AvailableScenarioNames ( |
| | | GlobalOTDTable globalOTDTable |
| | | ) as String |
| | | { |
| | |
| | | //} |
| | | |
| | | // 使ç¨businessTypeè·åæ°æ® |
| | | strings := BusinessType::GetBusinessNameStr( globalOTDTable); |
| | | strings := BusinessType::GetScenarioNamesStr( globalOTDTable); |
| | | |
| | | return strings; |
| | | *] |
| | |
| | | Properties: |
| | | [ |
| | | AllowEmpty: true |
| | | DataBinding: 'DataHolderDialogData.Data.BusinessType' |
| | | Label: 'BusinessType' |
| | | DataBinding: 'DataHolderDialogData.Data.ScenarioName' |
| | | Label: 'Scenario Name' |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | |
| | | data.Name( versionname ); |
| | | } |
| | | |
| | | // Get Business Type from Scenario Name |
| | | businesstype := select( globalotdtable, |
| | | BusinessType, |
| | | b, |
| | | b.ScenarioName()=data.ScenarioName() ).BusinessTypeName(); |
| | | data.BusinessType( businesstype ); |
| | | |
| | | // Copy scenario |
| | | if( isnull( data.WrappedInstance() ) ) |
| | | { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | Method Edit ( |
| | | PriorityPolicy selection |
| | | ) id:Method_DialogNewPriorityPolicy_Edit |
| | | { |
| | | #keys: '[414382.0.603040472]' |
| | | Body: |
| | | [* |
| | | data := shadow( selection ); |
| | | |
| | | DataHolderNewPriorityPolicy.Data( &data); |
| | | ApplicationMacroPlanner.ShowFormModal( this ); |
| | | *] |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | PanelPriorityPolicyOperation.Visible(true); |
| | | dlg := construct( DialogNewPriorityPolicy ); |
| | | businessType := PriorityPolicyBusinessType.Text(); |
| | | dlg.Edit( selection); |
| | | |
| | | PanelPriorityPolicyOperationName.Text(selection.Name()); |
| | | |
| | | businessType := PriorityPolicyBusinessType.Text(); |
| | | str := PriorityFactor::GetNameList( MacroPlan, businessType); |
| | | DropDownStringList.Strings(str); |
| | | |
| | | LabelFormula.Text(selection.Formula()); |
| | | LabelCalculateValue.Text(selection.CalculateValue()); |
| | | |
| | | data := shadow( selection ); |
| | | DataHolderEditPriorityPolicy.Data( &data ); |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | |
| | | { |
| | | Body: |
| | | [* |
| | | strings := BusinessType::GetBusinessNameStr( GlobalOTDTable ); |
| | | strings := BusinessType::GetScenarioNamesStr( GlobalOTDTable ); |
| | | this.Strings(strings); |
| | | |
| | | list := PriorityPolicy::GetDataByBusinessType( MacroPlan, PriorityPolicyBusinessType.Text()); |
| | |
| | | dlg := construct( DialogCreateEditScenario ); |
| | | dlg.checkboxEnableSync().Visible( true ); |
| | | dlg.dropDownStringListGeneral().Visible( true ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableBusinessTypes(GlobalOTDTable) ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableScenarioNames( GlobalOTDTable ) ); |
| | | dlg.checkboxIsKeyProduct().Visible( true ); |
| | | dlg.checkboxCreatePurchaseSupplyProduct().Visible( true ); |
| | | dlg.NewScenario( ScenarioManager, selection, true ); |
| | |
| | | dlg := construct( DialogCreateEditScenario ); |
| | | dlg.checkboxEnableSync().Visible( true ); |
| | | dlg.dropDownStringListGeneral().Visible( true ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableBusinessTypes(GlobalOTDTable) ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableScenarioNames( GlobalOTDTable ) ); |
| | | dlg.checkboxIsKeyProduct().Visible( true ); |
| | | dlg.checkboxCreatePurchaseSupplyProduct().Visible( true ); |
| | | parent := selection.Element( 0 ).Parent(); |
| | |
| | | dlg.checkboxEnableSync().Checked( false ); |
| | | dlg.checkboxEnableSync().Visible( false ); |
| | | dlg.dropDownStringListGeneral().Visible( false ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableBusinessTypes(GlobalOTDTable) ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableScenarioNames( GlobalOTDTable ) ); |
| | | dlg.checkboxIsKeyProduct().Visible( false ); |
| | | dlg.checkboxCreatePurchaseSupplyProduct().Visible( false ); |
| | | dlg.NewScenario( ScenarioManager, selection ); |
| | |
| | | dlg.checkboxEnableSync().Checked( false ); |
| | | dlg.checkboxEnableSync().Visible( false ); |
| | | dlg.dropDownStringListGeneral().Visible( false ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableBusinessTypes(GlobalOTDTable) ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableScenarioNames( GlobalOTDTable ) ); |
| | | dlg.checkboxIsKeyProduct().Visible( false ); |
| | | dlg.checkboxCreatePurchaseSupplyProduct().Visible( false ); |
| | | parent := selection.Element( 0 ).Parent(); |
| | |
| | | // Edit scenario |
| | | dlg := construct( DialogCreateEditScenario ); |
| | | dlg.dropDownStringListGeneral().Visible( selection.EnableSync() ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableBusinessTypes(GlobalOTDTable) ); |
| | | dlg.dropDownStringListGeneral().Strings( ScenarioManager::AvailableScenarioNames( GlobalOTDTable ) ); |
| | | dlg.checkboxIsKeyProduct().Visible( selection.EnableSync() ); |
| | | dlg.checkboxCreatePurchaseSupplyProduct().Visible( selection.EnableSync() ); |
| | | |
| | |
| | | lb_SKUCode_FAAC.Text(SelForecast.Get( "SKU").GetString()); |
| | | lb_SKUName_FAAC.Text("产å"); |
| | | lb_Util_FAAC.Text(SelForecast.Get( "Util").GetString()); |
| | | lb_SKUName_FAAC.Text(SelForecast.Get( "SKUName").GetString()); |
| | | txt_CustomID_FAAC.Text(SelForecast.Get( "CustomCode").GetString()); |
| | | txt_CustomName_FAAC.Text(SelForecast.Get( "CustomName").GetString()); |
| | | lb_Operator_FAAC.Text(ApplicationMacroPlanner.GetUserName()); |
| | | |
| | | // StrValue := SelectItem.Value().Tokenize( ";"); |
| | | // lb_SKUCode_FAAC.Text(StrValue.Element( 0)); |
| | | // lb_SKUName_FAAC.Text("产å"); |
| | | // lb_Operator_FAAC.Text(""); |
| | | // lb_Util_FAAC.Text(StrValue.Element( 1)); |
| | | // txt_CustomID_FAAC.Text(StrValue.Element( 2)); |
| | | // txt_CustomName_FAAC.Text(StrValue.Element( 3)); |
| | | // lb_Operator_FAAC.Text(ApplicationMacroPlanner.GetUserName()); |
| | | } |
| | | } |
| | | *] |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 1 |
| | | Taborder: 2 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | Component Panel391 |
| | | { |
| | | #keys: '[414724.0.193860534]' |
| | | BaseType: 'WebPanel' |
| | | Children: |
| | | [ |
| | | Component Button655 |
| | | { |
| | | #keys: '[414724.0.193860558]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | Image: 'BULL' |
| | | Label: '填产å²å' |
| | | Taborder: 0 |
| | | ] |
| | | } |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 0 |
| | | ] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: Panel391/Button655 |
| | | Response OnClick () id:Response_Panel391_Button655_OnClick |
| | | { |
| | | #keys: '[414724.0.194975663]' |
| | | CanBindMultiple: false |
| | | DefinitionID: 'Responsedef_WebButton_OnClick' |
| | | Precondition: |
| | | [* |
| | | return not isnull( MacroPlan); |
| | | *] |
| | | QuillAction |
| | | { |
| | | Body: |
| | | [* |
| | | HResult := H_FunctionClass::SM_OrderHedgingEx( MacroPlan,"æµè¯ç¨æ·" ); |
| | | Msg := HResult.Get( "Msg").GetString(); |
| | | if( HResult.Get( "Status").GetBoolean()) |
| | | { |
| | | if( Msg.Length()>0) |
| | | { |
| | | WebMessageBox::Information(Msg); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if( Msg.Length()>0) |
| | | { |
| | | WebMessageBox::Warning(Msg); |
| | | } |
| | | else |
| | | { |
| | | WebMessageBox::Information("è¿è¡é误ï¼"); |
| | | } |
| | | } |
| | | *] |
| | | GroupServerCalls: false |
| | | } |
| | | } |
| | |
| | | ] |
| | | Properties: |
| | | [ |
| | | Taborder: 0 |
| | | Taborder: 1 |
| | | ] |
| | | } |
| | | #child: Panel391 |
| | | ] |
| | | Properties: |
| | | [ |