由于订单不是创建状态,所以订单审核失败【关联交易没有生成入库实绩】

查询 订单号,入库通知单号,出库通知单号备用

对比 出库通知单和入库通知单的 MID1是否一致 ,并删除已经生成的入库实绩头

SELECT A.*,A.rowid FROM INFORMTBL A WHERE 1=1 AND A.INFORMNO='01747209695' ;--入库通知单
SELECT A.*,A.rowid FROM INFORMDTTBL A WHERE 1=1 AND A.INFORMNO='01747209695' ;--

SELECT A.*,A.rowid FROM OUTSTOCKINFORMTBL A WHERE 1=1 AND A.OUTSTOCKINFORMID='3356015279633' ; --出库通知单
SELECT A.*,A.rowid FROM OUTSTOCKINFORMDTTBL A WHERE 1=1 AND A.OUTSTOCKINFORMID='3356015279633' ; --


SELECT A.*,A.rowid FROM WMSIFSTOCKINACTTBL A WHERE   A.STOCKINNO = '01747209695';--入库实绩
SELECT A.*,A.rowid FROM WMSIFSTOCKINACTDETAILTBL A WHERE  A.STOCKINNO = '01747209695';--


SELECT A.*,A.rowid FROM WMSIFSTOCKOUTACTTBL A WHERE   A.Stockoutno = '3356015279633';--出库实绩
SELECT A.*,A.rowid FROM WMSIFSTOCKOUTACTDETAILTBL A WHERE  A.Stockoutno = '3356015279633';

确保出库明细的MID1 和入库明细的MID1 一致 。

如果审核没成功,先执行以下步骤

按查询 审核订单 逻辑,检查库存

检查批次库存,没有则需要补上,需要和erp的批次号一致

--总库存
select a.bigunitnum,
       a.bigunitnum * b.bigpernum bigcount,
       a.standunitnum,
       a.*,
       a.rowid
  from stockgoodstbl a, goodsbatchmst b
 where a.goodsid = b.goodsid
   and a.goodsbatch = b.goodsbatch
   and a.goodsid = '1110620779'
   and a.goodsbatch = 'TYY13'
   and a.stockareaid = '2'
   and a.bigunitnum + a.standunitnum > 0;

--分公司库存
select a.mid1, a.totalnum, a.*, a.rowid
  from stockgoodstbl_company a
 where 
    a.goodsid = '1110620779'
   and a.goodsbatch = 'TYY13';

--批次库存
select a.*, a.rowid
  from companybatchstocktbl a
 where 
    a.goodsid = '1110620779'
   and a.goodsbatch = 'TYY13';

####

确保 OUTSTOCKINFORMTBL.isdealmid1 的值为 1


1.确保入库实绩头 为空,有数据则删除

SELECT A.*,A.rowid FROM WMSIFSTOCKINACTTBL A WHERE   A.STOCKINNO = '01747209695';--入库实绩
SELECT A.*,A.rowid FROM WMSIFSTOCKINACTDETAILTBL A WHERE  A.STOCKINNO = '01747209695';--
SELECT A.*,A.rowid FROM WMSIFSTOCKOUTACTTBL A WHERE   A.Stockoutno = '3356015279633';--出库实绩
SELECT A.*,A.rowid FROM WMSIFSTOCKOUTACTDETAILTBL A WHERE  A.Stockoutno = '3356015279633';

2.调用报文,重新生成 入库实绩

调用地址:http://esb.cq-p.com.cn:7001/WP_CQP_SOA/APP_WMS_SERVICES/Proxy_Services/TA_WMS/BeJMS_WMS_PO_10_InStockAct_PS

{
    "REQUEST": {
        "HEAD": {
            "BIZTRANSACTIONID": "WMS_InAct_6196010383912",
            "COUNT": "1",
            "CONSUMER": "10018;",
            "SRVLEVEL": "1",
            "ACCOUNT": "420739",
            "PASSWORD": "",
            "PAGENUM": "",
            "PAGESIZE": "",
            "Module": ""
        },
        "LIST": [{
            "STOCKID": "80",
            "INSTOCKID": "6196010383912",
            "COMPANYID": "61",
            "INSTOCKTYPE": "9",
            "TYPE": "INFORMNO"
        }]
    }
}
文档更新时间: 2024-07-12 17:27   作者:周骏