Related API
Cancel stock-in and create stock-in (stockin.data.create) are paired.
Cancel requires TB001/TB002 returned by ERP after successful creation (stored in TL011/TL012).
Important: ERP will not be called if TL011/TL012 is empty
In the program logic, only when both TL011 and TL012 are not empty, the cancel API will be called.
If empty, the cancel check-out action only executes on MES side, ERP is not affected.
{
"code": 500,
"msg": "Stock-in has been posted, cannot cancel"
}
8. Race Condition Risk Description
Known Issue: TL011/TL012 is empty when cancelling check-out
When user cancels check-out before ERP returns, TL011/TL012 has not been written back yet, cancel API will not be called.
This causes MES and ERP data inconsistency.
Timeline Example
Root Cause
// GeneralUpdater.java:1571if(!SftTransorderLine.getTl011().equals("") && !SftTransorderLine.getTl012().equals("")){
// Only call cancel API when TL011/TL012 is not empty// If cancel before ERP returns, this if is false, skip ERP call
}
Recommended Solutions
Solution
Description
Impact
Immediate
Manually void the stock-in in ERP
Requires manual intervention
Wait mechanism
Wait for ERP return before allowing cancel
Requires code modification
Lock mechanism
Disable cancel during check-out processing
Requires code modification
Periodic comparison
Scheduled job to compare MES and ERP document status
Requires new feature
Reference Case
See CLAUDE.md record on 2026-03-12 "0000675600 Cancel Check-out outsourcingProcess Not Called Analysis"