首页上一页 1 下一页尾页 3 条记录 1/1页
Java项目开发全程实录 企业进销存管理系统问题
发表在Java图书答疑
2014-03-20
是否精华
是
否
版块置顶:
是
否
设置时间:
非永久
永久
起始时间:
结束时间:
是否扣分:
是
否
添加销售单成功,点击销售也显示成功。可是去查询版块销售查询却没有信息数据显示不出来。程序也没有提示出错。求解答
精彩评论 3
2014-03-20
沙发
这是因为在导出数据库时,将原来的视图转换为表了,所以数据不能及时更新。需要将附加后的数据库中的表节点下的v_rkthView、v_rukuView、v_sellView、v_xsthView删除,然后在查询分析器中的执行下面的SQL语句来创建视图就可以了。
USE [db_JXC]
GO
CREATE VIEW [dbo].[v_xsthView]
AS
SELECT dbo.tb_xsth_main.xsthID, dbo.tb_xsth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_xsth_detail.dj, dbo.tb_xsth_detail.sl, dbo.tb_xsth_main.je,
dbo.tb_xsth_main.khname, dbo.tb_xsth_main.thdate, dbo.tb_xsth_main.czy, dbo.tb_xsth_main.jsr, dbo.tb_xsth_main.jsfs
FROM dbo.tb_xsth_detail INNER JOIN
dbo.tb_xsth_main ON dbo.tb_xsth_detail.xsthID = dbo.tb_xsth_main.xsthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_xsth_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_sellView]
AS
SELECT dbo.tb_sell_main.sellID, dbo.tb_sell_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_sell_detail.dj, dbo.tb_sell_detail.sl, dbo.tb_sell_main.je,
dbo.tb_sell_main.khname, dbo.tb_sell_main.xsdate, dbo.tb_sell_main.czy, dbo.tb_sell_main.jsr, dbo.tb_sell_main.jsfs
FROM dbo.tb_sell_detail INNER JOIN
dbo.tb_sell_main ON dbo.tb_sell_detail.sellID = dbo.tb_sell_main.sellID INNER JOIN
dbo.tb_spinfo ON dbo.tb_sell_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rukuView]
AS
SELECT dbo.tb_ruku_main.rkID, dbo.tb_ruku_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_ruku_detail.dj, dbo.tb_ruku_detail.sl, dbo.tb_ruku_main.je,
dbo.tb_ruku_main.gysname, dbo.tb_ruku_main.rkdate, dbo.tb_ruku_main.czy, dbo.tb_ruku_main.jsr, dbo.tb_ruku_main.jsfs
FROM dbo.tb_ruku_detail INNER JOIN
dbo.tb_ruku_main ON dbo.tb_ruku_detail.rkID = dbo.tb_ruku_main.rkID INNER JOIN
dbo.tb_spinfo ON dbo.tb_ruku_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rkthView]
AS
SELECT dbo.tb_rkth_main.rkthID, dbo.tb_rkth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_rkth_detail.dj, dbo.tb_rkth_detail.sl, dbo.tb_rkth_main.je,
dbo.tb_rkth_main.gysname, dbo.tb_rkth_main.rtdate, dbo.tb_rkth_main.czy, dbo.tb_rkth_main.jsr, dbo.tb_rkth_main.jsfs
FROM dbo.tb_rkth_detail INNER JOIN
dbo.tb_rkth_main ON dbo.tb_rkth_detail.rkthID = dbo.tb_rkth_main.rkthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_rkth_detail.spid = dbo.tb_spinfo.id
GO
USE [db_JXC]
GO
CREATE VIEW [dbo].[v_xsthView]
AS
SELECT dbo.tb_xsth_main.xsthID, dbo.tb_xsth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_xsth_detail.dj, dbo.tb_xsth_detail.sl, dbo.tb_xsth_main.je,
dbo.tb_xsth_main.khname, dbo.tb_xsth_main.thdate, dbo.tb_xsth_main.czy, dbo.tb_xsth_main.jsr, dbo.tb_xsth_main.jsfs
FROM dbo.tb_xsth_detail INNER JOIN
dbo.tb_xsth_main ON dbo.tb_xsth_detail.xsthID = dbo.tb_xsth_main.xsthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_xsth_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_sellView]
AS
SELECT dbo.tb_sell_main.sellID, dbo.tb_sell_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_sell_detail.dj, dbo.tb_sell_detail.sl, dbo.tb_sell_main.je,
dbo.tb_sell_main.khname, dbo.tb_sell_main.xsdate, dbo.tb_sell_main.czy, dbo.tb_sell_main.jsr, dbo.tb_sell_main.jsfs
FROM dbo.tb_sell_detail INNER JOIN
dbo.tb_sell_main ON dbo.tb_sell_detail.sellID = dbo.tb_sell_main.sellID INNER JOIN
dbo.tb_spinfo ON dbo.tb_sell_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rukuView]
AS
SELECT dbo.tb_ruku_main.rkID, dbo.tb_ruku_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_ruku_detail.dj, dbo.tb_ruku_detail.sl, dbo.tb_ruku_main.je,
dbo.tb_ruku_main.gysname, dbo.tb_ruku_main.rkdate, dbo.tb_ruku_main.czy, dbo.tb_ruku_main.jsr, dbo.tb_ruku_main.jsfs
FROM dbo.tb_ruku_detail INNER JOIN
dbo.tb_ruku_main ON dbo.tb_ruku_detail.rkID = dbo.tb_ruku_main.rkID INNER JOIN
dbo.tb_spinfo ON dbo.tb_ruku_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rkthView]
AS
SELECT dbo.tb_rkth_main.rkthID, dbo.tb_rkth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_rkth_detail.dj, dbo.tb_rkth_detail.sl, dbo.tb_rkth_main.je,
dbo.tb_rkth_main.gysname, dbo.tb_rkth_main.rtdate, dbo.tb_rkth_main.czy, dbo.tb_rkth_main.jsr, dbo.tb_rkth_main.jsfs
FROM dbo.tb_rkth_detail INNER JOIN
dbo.tb_rkth_main ON dbo.tb_rkth_detail.rkthID = dbo.tb_rkth_main.rkthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_rkth_detail.spid = dbo.tb_spinfo.id
GO
2014-03-20
板凳
[FIELDSET][LEGEND]引自:1楼[/LEGEND]
这是因为在导出数据库时,将原来的视图转换为表了,所以数据不能及时更新。需要将附加后的数据库中的表节点下的v_rkthView、v_rukuView、v_sellView、v_xsthView删除,然后在查询分析器中的执行下面的SQL语句来创建视图就可以了。
USE [db_JXC]
GO
CREATE VIEW [dbo].[v_xsthView]
AS
SELECT dbo.tb_xsth_main.xsthID, dbo.tb_xsth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_xsth_detail.dj, dbo.tb_xsth_detail.sl, dbo.tb_xsth_main.je,
dbo.tb_xsth_main.khname, dbo.tb_xsth_main.thdate, dbo.tb_xsth_main.czy, dbo.tb_xsth_main.jsr, dbo.tb_xsth_main.jsfs
FROM dbo.tb_xsth_detail INNER JOIN
dbo.tb_xsth_main ON dbo.tb_xsth_detail.xsthID = dbo.tb_xsth_main.xsthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_xsth_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_sellView]
AS
SELECT dbo.tb_sell_main.sellID, dbo.tb_sell_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_sell_detail.dj, dbo.tb_sell_detail.sl, dbo.tb_sell_main.je,
dbo.tb_sell_main.khname, dbo.tb_sell_main.xsdate, dbo.tb_sell_main.czy, dbo.tb_sell_main.jsr, dbo.tb_sell_main.jsfs
FROM dbo.tb_sell_detail INNER JOIN
dbo.tb_sell_main ON dbo.tb_sell_detail.sellID = dbo.tb_sell_main.sellID INNER JOIN
dbo.tb_spinfo ON dbo.tb_sell_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rukuView]
AS
SELECT dbo.tb_ruku_main.rkID, dbo.tb_ruku_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_ruku_detail.dj, dbo.tb_ruku_detail.sl, dbo.tb_ruku_main.je,
dbo.tb_ruku_main.gysname, dbo.tb_ruku_main.rkdate, dbo.tb_ruku_main.czy, dbo.tb_ruku_main.jsr, dbo.tb_ruku_main.jsfs
FROM dbo.tb_ruku_detail INNER JOIN
dbo.tb_ruku_main ON dbo.tb_ruku_detail.rkID = dbo.tb_ruku_main.rkID INNER JOIN
dbo.tb_spinfo ON dbo.tb_ruku_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rkthView]
AS
SELECT dbo.tb_rkth_main.rkthID, dbo.tb_rkth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_rkth_detail.dj, dbo.tb_rkth_detail.sl, dbo.tb_rkth_main.je,
dbo.tb_rkth_main.gysname, dbo.tb_rkth_main.rtdate, dbo.tb_rkth_main.czy, dbo.tb_rkth_main.jsr, dbo.tb_rkth_main.jsfs
FROM dbo.tb_rkth_detail INNER JOIN
dbo.tb_rkth_main ON dbo.tb_rkth_detail.rkthID = dbo.tb_rkth_main.rkthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_rkth_detail.spid = dbo.tb_spinfo.id
GO
[/FIELDSET]
回复:问题解决了,但是我发现销售退货的时候,退货的数量是在库存那里减的,比如一件商品库存有20,我售卖10件,然后退货5件,可是库存盘点时库存数量确实5件。应该是在退货的时候数量直接在库存那里减去了。是不是在销售退货那里的代码搞错了。
这是因为在导出数据库时,将原来的视图转换为表了,所以数据不能及时更新。需要将附加后的数据库中的表节点下的v_rkthView、v_rukuView、v_sellView、v_xsthView删除,然后在查询分析器中的执行下面的SQL语句来创建视图就可以了。
USE [db_JXC]
GO
CREATE VIEW [dbo].[v_xsthView]
AS
SELECT dbo.tb_xsth_main.xsthID, dbo.tb_xsth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_xsth_detail.dj, dbo.tb_xsth_detail.sl, dbo.tb_xsth_main.je,
dbo.tb_xsth_main.khname, dbo.tb_xsth_main.thdate, dbo.tb_xsth_main.czy, dbo.tb_xsth_main.jsr, dbo.tb_xsth_main.jsfs
FROM dbo.tb_xsth_detail INNER JOIN
dbo.tb_xsth_main ON dbo.tb_xsth_detail.xsthID = dbo.tb_xsth_main.xsthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_xsth_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_sellView]
AS
SELECT dbo.tb_sell_main.sellID, dbo.tb_sell_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_sell_detail.dj, dbo.tb_sell_detail.sl, dbo.tb_sell_main.je,
dbo.tb_sell_main.khname, dbo.tb_sell_main.xsdate, dbo.tb_sell_main.czy, dbo.tb_sell_main.jsr, dbo.tb_sell_main.jsfs
FROM dbo.tb_sell_detail INNER JOIN
dbo.tb_sell_main ON dbo.tb_sell_detail.sellID = dbo.tb_sell_main.sellID INNER JOIN
dbo.tb_spinfo ON dbo.tb_sell_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rukuView]
AS
SELECT dbo.tb_ruku_main.rkID, dbo.tb_ruku_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_ruku_detail.dj, dbo.tb_ruku_detail.sl, dbo.tb_ruku_main.je,
dbo.tb_ruku_main.gysname, dbo.tb_ruku_main.rkdate, dbo.tb_ruku_main.czy, dbo.tb_ruku_main.jsr, dbo.tb_ruku_main.jsfs
FROM dbo.tb_ruku_detail INNER JOIN
dbo.tb_ruku_main ON dbo.tb_ruku_detail.rkID = dbo.tb_ruku_main.rkID INNER JOIN
dbo.tb_spinfo ON dbo.tb_ruku_detail.spid = dbo.tb_spinfo.id
GO
/**************************************************************/
CREATE VIEW [dbo].[v_rkthView]
AS
SELECT dbo.tb_rkth_main.rkthID, dbo.tb_rkth_detail.spid, dbo.tb_spinfo.spname, dbo.tb_spinfo.gg, dbo.tb_rkth_detail.dj, dbo.tb_rkth_detail.sl, dbo.tb_rkth_main.je,
dbo.tb_rkth_main.gysname, dbo.tb_rkth_main.rtdate, dbo.tb_rkth_main.czy, dbo.tb_rkth_main.jsr, dbo.tb_rkth_main.jsfs
FROM dbo.tb_rkth_detail INNER JOIN
dbo.tb_rkth_main ON dbo.tb_rkth_detail.rkthID = dbo.tb_rkth_main.rkthID INNER JOIN
dbo.tb_spinfo ON dbo.tb_rkth_detail.spid = dbo.tb_spinfo.id
GO
[/FIELDSET]
回复:问题解决了,但是我发现销售退货的时候,退货的数量是在库存那里减的,比如一件商品库存有20,我售卖10件,然后退货5件,可是库存盘点时库存数量确实5件。应该是在退货的时候数量直接在库存那里减去了。是不是在销售退货那里的代码搞错了。