企业供应链解决方案

用户反馈问题处理

物流业务部台账明细表,系统里面有交接费,但物流台账里是0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- 根据托运单号 查询 托运单uuid cef4d4fe1dd74c52acedb2b7e56d896f
select csg_uuid from dwd.fct_tms_csg_df where csg_no = '26E004345'
-- 根据托运单uuid 查询 结算送货信息uuid a3e70be3205c48f1935a4bb54b3577f8
select demd_uuid,csg_sub_uuid,csg_uuid,crr_head_uuid,stl_dlvr_uuid
from dwd.fct_tms_order_rela_df_add --物流单据关系表
where 1=1 and csg_uuid = '8c393f2db841449cbd72e60c67239469'
group by demd_uuid,csg_sub_uuid,csg_uuid,crr_head_uuid,stl_dlvr_uuid
-- 根据结算送货信息uuid 查询 交接费
with cte_adj as (
select
t1.stl_dlvr_uuid,
t1.csg_no,
t1.csg_uuid,
t1.csg_status,
t2.stl_dlvr_cost_uuid,
case t1.cost_type when '6' then t1.adj_amt else 0 end as fangk_fee , --放空
case t1.cost_type when '39' then t1.adj_amt else 0 end as jud_fee --拒单
from ads.ads_tms_cost_adj_di t1 --物流费用调整明细
left join dwd.fct_tms_stl_dlvr_cost_di t2
on t1.stl_dlvr_uuid = t2.stl_dlvr_uuid and t1.cost_type = t2.cost_type
where t1.cost_type in ('39','6') and t1.csg_status in ('80','0') and t1.task_status = '20'
)
,cte_yzf_yjs as (
select
t2.demd_uuid,t2.csg_sub_uuid,t2.csg_uuid,t2.crr_head_uuid,t2.stl_dlvr_uuid,t1.stl_dlvr_cost_uuid,t1.csg_status,t1.fangk_fee,t1.jud_fee
from cte_adj t1
left join dwd.fct_tms_order_rela_df_add t2
on t1.csg_uuid = t2.csg_uuid and t1.stl_dlvr_uuid = t2.stl_dlvr_uuid
)
select a.stl_dlvr_uuid,b.tax_includ_amt,b.cost_type,c.csg_status
,case when (c.csg_status != '0' or c.csg_status is null) and b.cost_type = '7' then b.tax_includ_amt else 0 end
from dwd.fct_tms_stl_dlvr_di a
join dwd.fct_tms_stl_dlvr_cost_di b
on a.stl_dlvr_uuid = b.stl_dlvr_uuid and b.delete_flag = '0' and b.cost_type not in ('37','1')
left join cte_yzf_yjs c
on b.stl_dlvr_uuid = c.stl_dlvr_uuid and b.stl_dlvr_cost_uuid = c.stl_dlvr_cost_uuid
WHERE a.is_valid = '1' and a.stl_dlvr_uuid = 'a3e70be3205c48f1935a4bb54b3577f8'
  • 产生原因 :
    • 托运单号对应的uuid没有查到结算送货信息uuid,拿不到交接费
    • saas系统入账状态为未入账,回单审核日期为当天,结算送货信息uuid没有生成
  • 解决方案 :
    • 当客户托运单签收后才能产生交接费