webapi 生产领料单 即时库存表唯一索引冲突原创
39人赞赏了该文章
416次浏览
编辑于2023年02月24日 00:20:51
场景:生产领料单提交下推WMS,WMS回传信息更新并审核
问题发生的前提条件:物料的主单位和辅单位均已设置,且单位不同
问题:生产领料单提交直接审核,不报错,由WMS使用webapi回传更新后审核报错
感觉是一个比较玄学的问题,webapi让你永远不知道错在哪
分析:可直接提交审核,说明库存本身不存在唯一索引冲突,可定位到本次的WMS回传报文异常,由错误提示可推测出问题大概出在三个方面:
1、某个单位字段未设置值
2、某个单位字段未设置但设置了数量(此时不确定有数量无单位是否有问题),
3、某个单位设置了,却没有设置数量
从以下几个方面,检查回传报文:
检查单位是否存在和物料不一致的情况 (无)
检查数量是否存在差异性(无)
尝试去掉非必填项单位
尝试去掉某个回传数量,发现问题
尝试多次,去掉fBaseStockActualQty ,api保存更新通过,问题解决。
玄学问题报文(解决后的报文,搜索fBaseStockActualQty,并删除对应行):
{ "formid": "PRD_PickMtrl", "data": { "isAutoAdjustField": "true", "needUpDateFields": [ "fEntity", "fActualQty", "fAppQty", "fBaseActualQty", "fBaseStockActualQty", "fBaseUnitId", "fEntity_Link", "fEntity_Link_FRuleId", "fEntity_Link_FSBillId", "fEntity_Link_FSId", "fEntity_Link_FSTableName", "fEntrySrcEnteryId", "fEntrySrcEntrySeq", "fEntrySrcInterId", "fEntryWorkShopId", "fExpiryDate", "fGroupRow", "fKEEPERID", "fKEEPERTYPEID", "fLOT", "fMaterialID", "fMoBillNo", "fMoEntryId", "fMoEntrySeq", "fMoId", "fOperId", "fOwnerId", "fParentMaterialId", "fParentOwnerId", "fParentOwnerTypeId", "fPPBomBillNo", "fPPBomEntryId", "fProduceDate", "fReqBillId", "fReqBillNo", "fReqEntryId", "fReqEntrySeq", "fReqSrc", "fSrcBillType", "fReserveType", "fSrcBillNo", "fStockActualQty", "fStockId", "fStockLocId", "fStockStatusId", "fStockUnitId", "fUnitID", "f_KING_WMSCJR", "f_KING_WMSRHR", "fMoId" ], "model": { "fID": "980161", "f_KING_AUTO": "0", "f_KING_WMSCJR": "kingdee", "fEntity": [ { "fReqSrc": " ", "fParentMaterialId": { "fNumber": "01.04.0004.01432" }, "fReqEntrySeq": "0", "fExpiryDate": "2023-07-31 00:00:00", "fReqBillId": "0", "fProduceDate": "2023-02-01 00:00:00", "fKEEPERTYPEID": "BD_KeeperOrg", "fStockActualQty": 194, "fReqEntryId": "0", "fStockId": { "fNumber": "022B006" }, "fBaseActualQty": 194, "fBaseStockActualQty": 194, "fParentOwnerTypeId": "BD_OwnerOrg", "fStockUnitId": { "fNumber": "sheet" }, "fPPBomEntryId": "4032484", "fPPBomBillNo": "PPBOM02200131731", "fMoBillNo": "MO022027143-001", "fStockLocId": { "FStockLocId__FF100002": { "fNumber": "0220301" } }, "fAppQty": 194, "fReqBillNo": " ", "fReserveType": "1", "fMoId": "409762", "fUnitID": { "fNumber": "sheet" }, "fKEEPERID": { "fNumber": "022" }, "fLOT": { "fNumber": "MP323010901-01-03-001\\V-70X8" }, "fMoEntrySeq": "1", "fParentOwnerId": { "fNumber": "022" }, "fSrcBillType": "PRD_PPBOM", "fEntrySrcEnteryId": "4032484", "fStockStatusId": { "fNumber": "KCZT01_SYS" }, "fOperId": "10", "fGroupRow": "d0f19f2b-427f-4daa-93d3-6a17cfcc10df", "fBaseUnitId": { "fNumber": "sheet" }, "fEntrySrcEntrySeq": "1", "fEntrySrcInterId": "669535", "fMoEntryId": "506821", "fEntity_Link": [ { "fEntity_Link_FSTableName": "T_PRD_PPBOMENTRY", "fEntity_Link_FRuleId": "PRD_PPBOM2PICKMTRL_NORMAL", "fEntity_Link_FSBillId": "669535", "fEntity_Link_FSId": "4032484" } ], "fMaterialID": { "fNumber": "01.04.0001.01220" }, "fActualQty": 194, "fOwnerId": { "fNumber": "022" }, "fOwnerTypeId": "BD_OwnerOrg", "fSrcBillNo": "PPBOM02200131731", "fEntryWorkShopId": { "fNumber": "022.52" } } ] }, "isDeleteEntry": "true" } }
推荐阅读