方法1(有点麻烦)
建表danzel_Temp(Id、itemid、等),放入需要更新item
方法2
Class:DA_checkCanbeStopped
public static boolean DA_checkCanbeStopped2(InventTable _item) { boolean l_ret = true; InventSum l_inventSum; InventQtyPhysicalOnhand l_onHand; InventDim l_dim; while select l_inventSum where l_inventSum.ItemId == _item.ItemId { l_onHand = l_inventSum.physicalInventCalculated(); if(l_onHand > 0) { l_ret = false; l_dim = l_inventSum.inventDim(); info(strfmt("Inventory not zero, Batch ID:%3 Qty.:%4 Warehouse:%1.%2,%5" ,l_dim.InventLocationId,l_dim.wMSLocationId,l_dim.inventBatchId,l_onHand,_item.ItemId)); } } return l_ret; }
Job:
static void DA_UpdateItemStatus2(Args _args) { List paramAsList; ListEnumerator le; InventTable l_item; int i = 1,j = 1; str param = '10101961,10101971,10101981,10101991,10102001,10102011,10102061,10102071'; paramAsList = strSplit(param,","); le = paramAsList.getEnumerator(); while(le.moveNext()) { ttsbegin; select forUpdate l_item where l_item.ItemId ==le.current(); if(DA_checkCanbeStopped::DA_checkCanbeStopped2(l_item)) { l_item.TEK_ItemStatus = TEK_ItemStatus::Stopped; l_item.selectForUpdate(); l_item.update(); info(strFmt("料号:%1,数量:%2",le.current(),i)); i++; }else{ info(strFmt("料号有库存:%1,数量:%2",le.current(),j)); j++; } ttscommit; } }
隐藏的下载地址
本站资源下载绝不收费,输入验证码后查看(防止机器采集被和谐)
请关注“LeftShare”官方公众号,回复关键字“微信验证码”,获取验证码。 【注】在微信里搜索“LeftShare”或者微信扫描右侧二维码都可以关注本站微信公众号。
留言评论
暂无留言