Inventory of the materials to teach you how to query a date certain combination of dimensions

Please correct me if any omission or error

From the Inventory Management-> journals-> Item Counting> Counting can enter the inventory:

Lines can create a new inventory record, click into the inventory:

Need to be aware that disk Points: changes in the respective fields, will be updated in real time.

Basically every field modified method of the corresponding field in the data source will triggerto update disk Points:

The inventory part by class: InventMov_Jour_Loss_SumUp, control, it is a subclass ofinventmov_journal InventMovement subclass inventmov_journal.

InventMov_Jour_Loss_SumUp use: InventQty   dateOnHandPhysical (InventDim _inventDim) disc calculatorspoints,

Which in turn calls a static method of InventSumDatePhysicalDim:

server static InventQty   onHandQty (

    TransDate        _transDate

    ItemId           _itemId

    InventDim        _inventDim

    InventDimParm    _inventDimParm

    )

To calculate the static method to invoke class: InventSumDatePhysicalDim this class inherits fromInventSumDatePhysical, which is responsible for the combined dimension to query the amount of materials.

Declare a the class inventmov_journal statement:

InventJournalTrans inventJournalTrans;

When entering the inventory row will operate the inventJournalTrans

First of all:

When you create a new inventory record is triggered to calculate the plate number of points, then used inventDim inventDim InventMovement declared InventMovement:

InventDim inventdim (InventDim _inventDim = inventDim)

{

    ;

    inventDim = _inventDim;

    if (! inventDim)

        inventDim = InventDim :: find (this.inventDimId ());

    return inventDim;

}

To get inventDim! inventDim will call table: find inventDim:

static public InventDim find (InventDimId inventDimId, boolean _forupdate = false)

{

    InventDim inventDim;

    ;

    if (inventDimId)

    {

        if (_forupdate)

            inventDim.selectForUpdate (_forupdate);

        select firstonly inventDim

            index hint DimIdIdx

            where inventDim.InventDimId   The == inventDimId;

    }

   return inventDim;

}

In this way, you will know:

InventQty   dateOnHandPhysical (InventDim _inventDim)

The parameters from there, you get your new a new definition inventdim, you add two records record the actual modify this inventdim.

Then:

InventQty   dateOnHandPhysical (InventDim _inventDim)

{

    InventDimParm    _inventDimParm;

    ;

/ / Lower sentence based on previous inventDim construct a _InventDimParm of   

    _inventDimParm.initFromInventDim (_inventDim);

    _inventDimParm = InventDimParm :: orParms (_inventDimParm, InventJournalTable :: journalId2inventDimParm (inventJournalTrans.JournalId));

    return InventSumDatePhysicalDim :: onHandQty (inventJournalTrans.TransDate, inventJournalTrans.ItemId, _inventDim, _inventDimParm);

}

This code: InventJournalTable :: journalId2inventDimParm:

static InventDimParm journalId2inventDimParm (InventJournalId inventJournalId)

{

    InventDimParm inventDimParm;

    ;

InventDimFixedClass :: inventDimFixed2InventDimParm (InventJournalTable :: find (inventJournalId). InventDimFixed, inventDimParm);

    return inventDimParm;

}

The based of the field InventDimFixed inventJournalTable to construct a inventDimParm.

This field is derived from this:

When you create a new record will pop up:

InventDimFixed is an integer of 0 to 255, on eight dimensions, respectively, corresponding to 8bits in a byte, if the dimension is selected, this bit is:

Color

Size

Config

Serial

Pallet

Location

Batch

warehouse

128

64

32

16

8

4

2

1

InventJournalTable the call InventDimFixedClass class to initial this field, the core of the code is:

InventDimFixed inventDimFixed ()

{

    InventDimFixed inventDimFixed;

    ;

    # InventDimDevelop

    if (inventDimParm.inventLocationIdFlag)      inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # INVENTLOCATIONID_IDX);

    if (inventDimParm.inventBatchIdFlag)         inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # BATCH_IDX);

    if (inventDimParm.WMSLocationIdFlag)         inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # LOCATION_IDX);

    if (inventDimParm.WMSPalletIdFlag)           inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # PALLET_IDX);

    if (inventDimParm.inventSerialIdFlag)        inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # SERIALID_IDX);

    if (inventDimParm.configIdFlag)              inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # CONFIGID_IDX);

    if (inventDimParm.inventSizeIdFlag)          inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # INVENTSIZEID_IDX);

    if (inventDimParm.inventColorIdFlag)         inventDimFixed = InventDimFixedClass :: setField (inventDimFixed, # INVENTCOLORID_IDX);

    return inventDimFixed;

}

View the class declaration you can see:

public class InventDimFixedClass

{

    InventDimParm                     inventDimParm;

    # DEFINE.INVENTLOCATIONID_IDX (0)

    # DEFINE.BATCH_IDX ??(1)

    # DEFINE.LOCATION_IDX (2)

    # DEFINE.PALLET_IDX (3)

    # DEFINE.SERIALID_IDX (4)

    # DEFINE.CONFIGID_IDX (5)

    # DEFINE.INVENTSIZEID_IDX (6)

    # DEFINE.INVENTCOLORID_IDX (7)

    / / Indexes 0 .. 15 reserved for the SYS layer

    / / Indexes 16 .. 30 reserved for distributors, vars and customers

    # INVENTDIMDEVELOP

}

SetField performed:

static InventDimFixed setField (InventDimFixed inventDimFixed, Integer idx)

{

    ;

    inventDimFixed   = InventDimFixed | (1 << idx);

    return inventDimFixed;

}

That is, with the 1-bit or a result.

Continue to look at the code:

InventQty   dateOnHandPhysical (InventDim _inventDim)

{

    InventDimParm    _inventDimParm;

    ;

/ / Lower sentence based on previous inventDim construct a _InventDimParm of   

    _inventDimParm.initFromInventDim (_inventDim);

    _inventDimParm = InventDimParm :: orParms (_inventDimParm, InventJournalTable :: journalId2inventDimParm (inventJournalTrans.JournalId));

    return InventSumDatePhysicalDim :: onHandQty (inventJournalTrans.TransDate, inventJournalTrans.ItemId, _inventDim, _inventDimParm);

}

Two inventDimParm by bit or get a inventDimParm of, and then use the Enter dates onHandQty starta dimension materials knot stock:

server static InventQty   onHandQty (

    TransDate        _transDate

    ItemId           _itemId

    InventDim        _inventDim

    InventDimParm    _inventDimParm

    )

{

    InventSumDatePhysicalDim    inventSumDatePhysicalDim = InventSumDatePhysicalDim :: newParameters (_transDate, _itemId, _inventDim, _inventDimParm);

    ;

    the return inventSumDatePhysicalDim.postedQty ()      +

           inventSumDatePhysicalDim.receivedQty ()    -

           inventSumDatePhysicalDim.deductedQty ()    -

           inventSumDatePhysicalDim.pickedQty ()      +

           inventSumDatePhysicalDim.registeredQty ();

}

To construct a class InventSumDatePhysicalDim to calculate balances.

Final first InventSumDatePhysicalDim selectInventTransPicked selectInventTransPostingFinancial selectInventTransPostingPhysical selectInventTransRegistered

These four methods will be combined with the two macro statements to query the transaction records the various date is greater than the selected dates, stock from the InventSum table query to the current node, then the middle of the current date and query date the number of transactions according to the actual access to addition and subtraction, the The Query Date junction stock.

These two macros: # InventDimSelect,

# InventDimExistsJoin:

exists join tableId from% 2

    where (% 2.InventDimId        == 1) &&

          (% 2.ConfigId           ==% 3.ConfigId               | |!% 4.ConfigIdFlag of)            &&

          (% 2.InventSizeId        ==% 3.InventSizeId           | |!% 4.InventSizeIdFlag of)        &&

          (% 2.InventColorId      ==% 3.InventColorId          | |!% 4.InventColorIdFlag of)       &&

          (% 2.InventLocationId   ==% 3.InventLocationId       | |!% 4.InventLocationIdFlag of)    &&

          (% 2.InventBatchId      ==% 3.InventBatchId          | |!% 4.InventBatchIdFlag of)       &&

          (% 2.WMSLocationId      ==% 3.WMSLocationId          | |!% 4.WMSLocationIdFlag of)       &&

          (% 2.WMSPalletId        ==% 3.WMSPalletId            | |!% 4.WMSPalletIdFlag of)         &&

          (% 2.InventSerialId     ==% 3.InventSerialId         | |!% 4.InventSerialIdFlag of)

# InventDimDevelop

This macro realized: If you choose a certain dimension, then it must be with you to your dimensions to match the dimension table in the database to find the corresponding data if you do not choose this dimension, this dimension all match.

Finally, we talk about how to use it:

An example:

If you want to query material B-Pack1 dimensions: Warehouse: GW, SIZE: 5, Color: red 4/22/2008junction stock

Can do:

InventDim inventDim;

InventDimParm    _inventDimParm;

Date          _date;

ItemId itemId;

;

inventDim.inventColorId = "red";

inventDim.inventSizeId = 5;

inventDim.inventLocationId = "gw";

_inventDimParm.initFromInventDim (_inventDim);

_date = 22/4/2008;

itemId = "b-pack1";

return InventSumDatePhysicalDim :: onHandQty (_date, iItemId, inventDim, _inventDimParm);

CAN长字节DM1报文是指在CAN总线上传输的长度超过8个字节的DM1报文。根据引用\[1\],当要传输的数据长度超过8个字节时,首先使用TPCM进行广播,广播内容包含即将传输报文的PGN、总的数据包长度等信息,然后使用TP.DT进行数据传输。相邻两个TP.DT之间的时间间隔是50ms到200ms。根据引用\[2\],当字节数大于8时,将会使用多帧传输参数组。根据引用\[3\],DM1报文是Diagnostic Message 1, Active Diagnostic Trouble Codes的缩写,用于点亮故障指示灯、红色停机灯等,并周期性播报控制器中处于激活状态的故障码。DM1报文的格式包括各个字节的定义,如故障指示灯、红色停机灯、琥珀色警告指示灯等。因此,CAN长字节DM1报文是指在CAN总线上传输的长度超过8个字节的DM1报文,用于传输更多的故障码信息。 #### 引用[.reference_title] - *1* [车载通信——J1939 DM1](https://blog.csdn.net/weixin_64064747/article/details/130193432)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [J1939广播DM1报文](https://blog.csdn.net/mengdeguodu_/article/details/108173263)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [J1939商用车在线诊断DM1报文](https://blog.csdn.net/traveller93/article/details/120735912)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值