昂捷论坛≡FAQ≡□-系统配置管理类 → 前台销售传不到后台怎么处理?


  共有26787人关注过本帖树形打印

主题:前台销售传不到后台怎么处理?

帅哥哟,离线,有人找我吗?
czg1981
  1楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:昂捷团队↑ 帖子:262 积分:3772 威望:0 精华:3 注册:2005/10/21 12:33:38
前台销售传不到后台怎么处理?  发帖心情 Post By:2010/7/19 18:44:53

系统中有前台服务器和后台服务器,前台的销售数据是直接传到前台服务器的,而后台是通过作业定时从前台获取销售记录的。分析原因:

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编辑过]

使用IE9无法添加附件的解决方法 支持(0中立(0反对(0回到顶部
帅哥哟,离线,有人找我吗?
大脑袋
  2楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:少尉 帖子:142 积分:1797 威望:0 精华:0 注册:2005/10/25 10:51:44
  发帖心情 Post By:2010/10/5 19:48:38

还有一种:

select c_guid from tb_o_sale
where c_identity>(select isnull(c_id,0) from tb_trans_status where c_proc='销售分拆')
group by c_guid

having count(*)>1


使用IE9无法添加附件的解决方法 支持(0中立(0反对(0回到顶部
帅哥哟,离线,有人找我吗?
nizao2008
  3楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:中士 帖子:23 积分:569 威望:0 精华:0 注册:2010/1/27 9:20:26
  发帖心情 Post By:2010/10/13 8:54:15

还有一种情况,没有可用的资源了,比方磁盘空间或者内存设置过低 或者本身服务器内存就比较小

导致服务被终止,传输无法运行,我这出现过类似的问题


使用IE9无法添加附件的解决方法 支持(0中立(0反对(0回到顶部
帅哥哟,离线,有人找我吗?
czg1981
  4楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:昂捷团队↑ 帖子:262 积分:3772 威望:0 精华:3 注册:2005/10/21 12:33:38
  发帖心情 Post By:2011/8/15 16:33:17

处理方法:

1 先将数据做好备份

2 删除重复数据

3 观察作业是否成功

以/*tb_o_sale.c_guid重复*/为例:

第一步:

select * into tb_o_sale_20110815

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)

第二步:

delete 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)

第三步:

查看作业是否成功,实时销售监察是否正确


使用IE9无法添加附件的解决方法 支持(0中立(0反对(0回到顶部
帅哥哟,离线,有人找我吗?
czg1981
  5楼 个性首页 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:昂捷团队↑ 帖子:262 积分:3772 威望:0 精华:3 注册:2005/10/21 12:33:38
  发帖心情 Post By:2014/6/25 11:58:59

如果不想让错误数据影响当天销售,可以建立作业,将错误数据做好备份,让剩余数据正常拆分,建议一天晚上执行一次

 

if not exists(select * from sysobjects where name='tb_o_sale_err')
begin
 CREATE TABLE [dbo].[tb_o_sale_err](
  [c_guid] [varchar](36) NULL,
  [c_identity] [int] NOT NULL,
  [c_pos_identity] [int] NULL,
  [c_id] [int] NOT NULL,
  [c_computer_id] [int] NOT NULL,
  [c_datetime] [datetime] NOT NULL,
  [c_cashier] [varchar](10) NOT NULL,
  [c_flag] [char](1) NULL,
  [c_cardno] [varchar](20) NULL,
  [c_adno] [varchar](10) NULL,
  [c_gcode] [varchar](13) NOT NULL,
  [c_subcode] [varchar](10) NOT NULL,
  [c_pt_cost] [money] NULL,
  [c_price] [money] NULL,
  [c_price_pro] [money] NULL,
  [c_price_disc] [money] NULL,
  [c_qtty] [decimal](12, 3) NULL,
  [c_amount] [money] NULL,
  [c_score] [money] NULL,
  [c_gds_type] [varchar](20) NULL,
  [c_pro_status] [varchar](20) NULL,
  [c_present_name] [varchar](40) NULL,
  [c_type] [varchar](20) NULL,
  [c_seller] [varchar](10) NULL,
  [c_charger] [varchar](10) NULL,
  [c_in_code] [varchar](20) NULL,
  [c_note] [varchar](100) NULL,
  [c_store_id] [varchar](20) NULL
 ) ON [PRIMARY]

end
if exists (select * from tempdb.dbo.sysobjects where id=object_id('tempdb..#tb_o_sale'))
BEGIN
 drop table #tb_o_sale
END

select c_guid,MIN(c_identity) as c_identity  into #tb_o_sale
from tb_o_sale
where c_identity>(select isnull(c_id,0)
from tb_trans_status where c_proc='销售分拆')
group by c_guid
having count(*)>1

insert into tb_o_sale_err(
 c_guid,c_identity,c_pos_identity,c_id,c_computer_id,c_datetime,c_cashier,c_flag,
 c_cardno,c_adno,c_gcode,c_subcode,c_pt_cost,c_price,c_price_pro,c_price_disc,c_qtty,
 c_amount,c_score,c_gds_type,c_pro_status,c_present_name,c_type,c_seller,c_charger,
 c_in_code,c_note,c_store_id
)
select c_guid,c_identity,c_pos_identity,c_id,c_computer_id,c_datetime,c_cashier,c_flag,
 c_cardno,c_adno,c_gcode,c_subcode,c_pt_cost,c_price,c_price_pro,c_price_disc,c_qtty,
 c_amount,c_score,c_gds_type,c_pro_status,c_present_name,c_type,c_seller,c_charger,
 c_in_code,c_note,c_store_id
from tb_o_sale(nolock)
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)
 or exists (select c_guid from #tb_o_sale b where tb_o_sale.c_guid=b.c_guid and tb_o_sale.c_identity<>b.c_identity))

delete 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)
 or exists (select c_guid from #tb_o_sale b where tb_o_sale.c_guid=b.c_guid and tb_o_sale.c_identity<>b.c_identity))

go


使用IE9无法添加附件的解决方法 支持(0中立(0反对(0回到顶部