Merge branch 'dev' of http://47.101.211.7:10101/r/TIANMA_JITUAN into dev_lhj
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateOrUpdate ( |
| | | MacroPlan owner, |
| | | String productid, |
| | | String stockingpointid, |
| | | String description, |
| | | Real actualinventorylevelend, |
| | | Date manufactureddate |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Administrator Sep-6-2023 (created) |
| | | date := Date :: Today(); |
| | | actualpispip := ActualProductInStockingPointInPeriod::FindActualProductInStockingPointInPeriodTypeIndex( productid, stockingpointid, date, manufactureddate ); |
| | | |
| | | if( isnull( actualpispip ) ){ |
| | | ActualProductInStockingPointInPeriod::Create( owner, |
| | | productid, |
| | | stockingpointid, |
| | | description, |
| | | actualinventorylevelend, |
| | | date, |
| | | manufactureddate, |
| | | true); |
| | | }else{ |
| | | actualpispip.Update( actualinventorylevelend, description, true ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization ActualProductInStockingPointInPeriod #extension |
| | | { |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod CreateOrUpdate ( |
| | | String id, |
| | | Product_MP productmp, |
| | | StockingPoint_MP stockingpoint, |
| | | Date date, |
| | | Date manufacturedate, |
| | | Real userquantity, |
| | | String description |
| | | ) |
| | | { |
| | | TextBody: |
| | | [* |
| | | // Administrator Sep-6-2023 (created) |
| | | inventorysupply := InventorySupply::FindInventorySupplyTypeIndex( id ); |
| | | |
| | | if( isnull( inventorysupply ) ){ |
| | | InventorySupply::Create(id, |
| | | productmp, |
| | | stockingpoint, |
| | | date, |
| | | manufacturedate, |
| | | userquantity, |
| | | description, |
| | | true); |
| | | }else{ |
| | | inventorysupply.Update( userquantity ); |
| | | } |
| | | *] |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | Quintiq file version 2.0 |
| | | #root |
| | | #parent: #DomainModel |
| | | TypeSpecialization InventorySupply #extension |
| | | { |
| | | } |
| | |
| | | isfromdb ); |
| | | } |
| | | |
| | | Currency_MP::CreateCurrency( this, "CNY", "CNY", "", true ); |
| | | currency := Currency_MP::FindById( this, "EUR" ); |
| | | currency.IsBase(false); |
| | | Transaction::Transaction().Propagate(); |
| | | existcurrency := Currency_MP::FindById( this, "CNY" ); |
| | | if( isnull( existcurrency ) ){ |
| | | Currency_MP::CreateCurrency( this, "CNY", "CNY", "", true ); |
| | | currency := Currency_MP::FindById( this, "EUR" ); |
| | | currency.IsBase(false); |
| | | Transaction::Transaction().Propagate(); |
| | | } |
| | | |
| | | isproductcatagory := false; |
| | | isfromdb := false; |
| | | |
| | | ProductLevel_MP::Create( "1", isproductcatagory, this, isfromdb ); |
| | | ProductLevel_MP::Create( "2", isproductcatagory, this, isfromdb ); |
| | | ProductLevel_MP::Create( "3", isproductcatagory, this, isfromdb ); |
| | | existproductlevel := ProductLevel_MP::FindProductLevelTypeIndex( "2" ); |
| | | if( isnull( existproductlevel ) ){ |
| | | ProductLevel_MP::Create( "1", isproductcatagory, this, isfromdb ); |
| | | ProductLevel_MP::Create( "2", isproductcatagory, this, isfromdb ); |
| | | ProductLevel_MP::Create( "3", isproductcatagory, this, isfromdb ); |
| | | } |
| | | *] |
| | | } |
| | |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | date := Date :: Today(); |
| | | listtodeal := selectset( this,MappingActualPISPIP,actual,true ); |
| | | listtodeal := selectset( this,MappingActualPISPIP,actual,not isnull( Product_MP::FindById( this, actual.ProductID() ) ) ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ActualPISPIP has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | | count := 0; |
| | | traverse( this,MappingActualPISPIP,actual){ |
| | | traverse( listtodeal,Elements,actual){ |
| | | count := count + 1; |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "ActualPISPIP " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | |
| | | for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | businessType := businessTypes.Element( i); |
| | | if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | ActualProductInStockingPointInPeriod::Create( this,actual.ProductID(),actual.StockingPointID(),actual.Description(),actual.ActualInventoryLevelEnd(), |
| | | date,actual.ManufacturedDate(),true); |
| | | ActualProductInStockingPointInPeriod::CreateOrUpdate( this, |
| | | actual.ProductID(), |
| | | actual.StockingPointID(), |
| | | actual.Description(), |
| | | actual.ActualInventoryLevelEnd(), |
| | | actual.ManufacturedDate()); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | ActualProductInStockingPointInPeriod::Create( this,actual.ProductID(),actual.StockingPointID(),actual.Description(),actual.ActualInventoryLevelEnd(), |
| | | date,actual.ManufacturedDate(),true); |
| | | ActualProductInStockingPointInPeriod::CreateOrUpdate( this, |
| | | actual.ProductID(), |
| | | actual.StockingPointID(), |
| | | actual.Description(), |
| | | actual.ActualInventoryLevelEnd(), |
| | | actual.ManufacturedDate()); |
| | | } |
| | | |
| | | } |
| | |
| | | [* |
| | | // renhao Aug-14-2023 (created) |
| | | |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, not isnull( StockingPoint_MP::FindById( this, externalSupply.StockingPointID() ) ) ); |
| | | listtodeal := selectset( this,MappingExternalSupply,externalSupply, |
| | | not isnull( StockingPoint_MP::FindById( this, externalSupply.StockingPointID() ) ) and not isnull( Product_MP::FindById( this, externalSupply.ProductID() ) ) ); |
| | | totalcount := listtodeal.Size(); |
| | | info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" ); |
| | | |
| | |
| | | if( count - [Number](count/100) * 100 = 0 or count = totalcount ){ |
| | | info( "Now is dealing with the " + count.AsQUILL() + "ExternalSupply " + "( " + count.AsQUILL() + "/" + totalcount.AsQUILL() + " ) " + (count/totalcount*100).Round( 1 ).AsQUILL() + "%" ); |
| | | } |
| | | // product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID() and product.KeyProduct() = nuclear,true); |
| | | // |
| | | // if( not isnull( product)){ |
| | | // productMP := select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true); |
| | | // stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true); |
| | | // if( not isnull(businessTypes)){ |
| | | // |
| | | // for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | // businessType := businessTypes.Element( i); |
| | | // if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | // InventorySupply::Create(externalSupply.ID(),productMP,stockingpoint,externalSupply.Date(),externalSupply.ManufacturedDate(),externalSupply.UserQuantity(),"å¨éå¨å¶",true); |
| | | // } |
| | | // } |
| | | // |
| | | // }else{ |
| | | productMP := Product_MP::FindById( this, externalSupply.ProductID() ); |
| | | stockingpoint := StockingPoint_MP::FindById( this, externalSupply.StockingPointID() ); |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | InventorySupply::Create(externalSupply.ID(),productMP,stockingpoint,externalSupply.Date(),externalSupply.ManufacturedDate(),externalSupply.UserQuantity(),"å¨éå¨å¶",true); |
| | | } |
| | | product := select( this,MappingProduct,product,product.ID() = externalSupply.ProductID() and product.KeyProduct() = nuclear,true); |
| | | |
| | | // } |
| | | // |
| | | // }else{ |
| | | // info( "Invaild product" ); |
| | | // } |
| | | if( not isnull( product)){ |
| | | productMP := select( this,Product_MP,productMP,productMP.ID() = externalSupply.ProductID() ,true); |
| | | stockingpoint := select( this,StockingPoint_MP,st,st.ID() = externalSupply.StockingPointID(),true); |
| | | if( not isnull(businessTypes)){ |
| | | |
| | | for( i :=0 ;i < businessTypes.Size();i++ ){ |
| | | businessType := businessTypes.Element( i); |
| | | if( product.BusinessType() = businessType and not product.IsCommon()){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | productMP, |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | } |
| | | } |
| | | |
| | | }else{ |
| | | if( not isnull( stockingpoint) and not isnull( productMP)){ |
| | | InventorySupply::CreateOrUpdate( externalSupply.ID(), |
| | | productMP, |
| | | stockingpoint, |
| | | externalSupply.Date(), |
| | | externalSupply.ManufacturedDate(), |
| | | externalSupply.UserQuantity(),"å¨éå¨å¶"); |
| | | } |
| | | |
| | | } |
| | | |
| | | }else{ |
| | | info( "Invaild product" ); |
| | | } |
| | | } |
| | | *] |
| | | } |