Closed smlsunxie closed 10 years ago
static belongsTo = [ item: Item, ] static hasMany = [ batchRoutes: BatchRoute, batchSources: BatchSource ]
/* * 最接近的直接上層批號 */ static belongsTo = [batch: Batch] /* * 目前子批號 */ Batch childBatch /* * 是否是最底層批號(原物料) */ Boolean isEndBatch = false
ex: batch.batchSource[0].childBatch.batchSource[2].childBatch
foodprint 專注在履歷最終結果呈現 由另一個服務,foodpaint(暫定) 專注在追朔關係與資料來源處理,也就包括現階段必要的 erp 資料,各單據所必要的欄位
會這樣設計考量到:
如過沒有第三方來源 foodprint 可以獨力運作 需要第三方來源,統一由 foodpaint 處理 而 foodprint 只需要對 foodpaint 進行 service 溝通
因此傳回 foodprint 只有最終履歷的資料,也就是 batch 以及供給的物料,還有檢驗以及收集資料的相關履歷
本來考慮直接將 erp 的資料轉換為 batch與 batchSource,轉換邏輯太過複雜,配合撰寫資料匯入邏輯不易,需要投入時間釐清規格與實作,而直接與erp 對應的 domain 匯入將可以更直接產出需要的結果。
http://localhost:8180/footprint/queryBatchReport/batchId
完成foodpaint準備履歷資料部分
domain 說明
batch
batchSource
由成品查往物料
ex: batch.batchSource[0].childBatch.batchSource[2].childBatch
由物料查往成品
新增專案 foodpaint 與 foodprint 各自服務範圍說明
foodprint 專注在履歷最終結果呈現 由另一個服務,foodpaint(暫定) 專注在追朔關係與資料來源處理,也就包括現階段必要的 erp 資料,各單據所必要的欄位
會這樣設計考量到:
如過沒有第三方來源 foodprint 可以獨力運作 需要第三方來源,統一由 foodpaint 處理 而 foodprint 只需要對 foodpaint 進行 service 溝通
因此傳回 foodprint 只有最終履歷的資料,也就是 batch 以及供給的物料,還有檢驗以及收集資料的相關履歷
footprint 只提供最低限度的履歷資料建立作業:
foodpaint 提供:
本來考慮直接將 erp 的資料轉換為 batch與 batchSource,轉換邏輯太過複雜,配合撰寫資料匯入邏輯不易,需要投入時間釐清規格與實作,而直接與erp 對應的 domain 匯入將可以更直接產出需要的結果。
兩個系統間的溝通說明
從 foodprint 發起
http://localhost:8180/footprint/queryBatchReport/batchId
由 foodpaint 處理
回到 foodprint 進行顯示