交易引擎的对账状态为空的处理方式

来源:互联网 发布:sql constraint 编辑:程序博客网 时间:2024/06/05 07:33

现象:

1首先确认下是否具有权限

2支付笔数是2583 商户汇总和商户对账笔数2047 

处理方式:

(1)

  A查询清分数据

  SELECT count(*)
  FROM t_busi_trans_detail t
 where t.mchnt_code = '02440108044790000'
   and t.settle_date = date '2016-8-1'
   and t.trans_status='B'
   and t.delete_flag='0'
   --and t.settle_flag is null
   ; 得2583

 B查询未清分数据

SELECT count(*)
  FROM t_busi_trans_detail t
 where t.mchnt_code = '02440108044790000'
   and t.settle_date = date '2016-8-1'
   and t.trans_status='B'
   and t.delete_flag='0'
   and t.settle_flag is null
   ; 

未清分数据是536

综上可得:

                   未清分数据没有进入商户对账和汇总

故问题明确:

                   确认未清分数据为什么没有进入商户对账和汇总?


处理方式:

                   (1)SELECT t.chk_status, t.*
  FROM t_order_main t
 WHERE t.our_trans_no in
       (SELECT t.our_trans_no
          FROM t_busi_trans_detail t
         where t.mchnt_code = '02440108044790000'
           and t.settle_date = date '2016-8-1'
           and t.trans_status = 'B'
           and t.delete_flag = '0'
           and t.settle_flag is null)
and t.chk_status='C'     --表示初始化      
;


sql语句说明:①从业务交易详情表中获取所有未清分的数据的平台流水号

                          ②拿着这个平台流水号到主单表中查询对账状态


现在去看下内部勾兑代码

                          为什么没有确定对账状态


交易引擎下单没有把check_status打上


手动把主单表中这些对账状态为空的订单 打上对账初始化的标识 然后重新跑内部勾兑

                    





0 0