系统中有前台服务器和后台服务器,前台的销售数据是直接传到前台服务器的,而后台是通过作业定时从前台获取销售记录的。分析原因:
1 后台定时执行没有执行,由于数据库的代理服务没有启动或者人为的将作业停了,导致后台定时执行没有执行;处理办法,启动作业,开启数据库代理的服务
2 销售拆分问题:销售数据传到后台后,系统会进行拆分,拆分完成后,才会在相关报表中体现,才会真正算销售。销售拆分出错是绝大多少销售没有传到后台的原因。导致这样的情况一般有下面几个情况 1、有人修改tb_trans_status,导致记录已拆分记录错误 处理办法:修改 tb_trans_status中销售拆分的id,可以找最大tb_o_sg.c_identity;2、前台硬件故障,销售重复传送,特征:tb_o_sale.c_guid重复处理办法:删除重复的c_guid;3、商品后台不存在,这个一般由于后台删除商品后,没有及时传到前台,前台正好做了销售,处理办法:删除改流水,用正确的商品编码销售;4、商品在一个门店存在2个部门,销售拆分时不知道是哪个部门算哪个部门的销售,处理办法:删除错误的部门。
辅助查询语句:
/*tb_o_sale.c_guid重复*/
select * from tb_o_sale
where c_identity>(select isnull(c_id,0) from tb_trans_status where c_proc='销售分拆')
and exists (select * from tb_o_sg (nolock) where tb_o_sale.c_guid=tb_o_sg.c_guid)
/*一个商品在一个门店存在2个部门*/
select c_store_id,c_gcode,COUNT(*) as c_count
from(
select tb_o_sale.c_gcode,tb_gdsstore.c_store_id,tb_gdsstore.c_adno
from tb_o_sale(nolock),tb_gdsstore(nolock)
where c_identity>(select isnull(c_id,0) from tb_trans_status where c_proc='销售分拆')
and tb_o_sale.c_gcode=tb_gdsstore.c_gcode
group by tb_o_sale.c_gcode,tb_gdsstore.c_store_id,tb_gdsstore.c_adno
)a
group by c_store_id,c_gcode
having COUNT(*)>1
/*商品编码后台不存在*/
select * from tb_o_sale
where c_identity>(select isnull(c_id,0) from tb_trans_status where c_proc='销售分拆')
and not exists (select * from tb_gds (nolock) where tb_o_sale.c_gcode=tb_gds.c_gcode)
and c_flag='G'
[此贴子已经被作者于2010-12-12 21:10:19编辑过]