当前位置:编程学习 > asp >>

[Ext.Net]易飞IQC来料批次分析与MsChart 使用双轴显示

涉及到ERP系统数据分析:三个数据分析表,三个图形展示。前台EXT.NET1.5 +MSCHART
 
IQC来料情况表:
 
存储过程:
 
[sql] 
-- =============================================      
-- Author: <David Gong>      
-- Create date: <2013-03-08>      
-- Description: <IQC来料批次情况表>      
-- =============================================   
ALTER Proc [dbo].[UF_ZEIQCReport]  
(  
  @year as varchar(4)  
    
)  
as begin  
  
--IQC检验情况   
--创建临时表   
create table #Tmp --创建临时表#Tmp   
(  
    Item  varchar(20),  
    Jan decimal(9,2),  
    Feb decimal(9,2),  
    Mar decimal(9,2),   
    Apr decimal(9,2),   
    May decimal(9,2),   
    Jun decimal(9,2),  
    Jul decimal(9,2),  
    Aug decimal(9,2),  
    Sep decimal(9,2),   
    Oct decimal(9,2),   
    Nov decimal(9,2),   
    [Dec] decimal(9,2)       
         
)  
declare @Rate as decimal(10,2)  
select @Rate=Goal from OA.dbo.IQCGoal where Company='ZE' AND [Year]=@year  
  
Insert into #Tmp(Item,Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec) select *  from(  
SELECT  '检验批数' AS Item,  
sum(case when substring(TA004,5,2)='01' then 1 else 0 end) as Jan,  
sum(case when substring(TA004,5,2)='02' then 1 else 0 end) as Feb,  
sum(case when substring(TA004,5,2)='03' then 1 else 0 end) as Mar,  
sum(case when substring(TA004,5,2)='04' then 1 else 0 end) as Apr,  
sum(case when substring(TA004,5,2)='05' then 1 else 0 end) as May,  
sum(case when substring(TA004,5,2)='06' then 1 else 0 end) as Jun,  
sum(case when substring(TA004,5,2)='07' then 1 else 0 end) as Jul,  
sum(case when substring(TA004,5,2)='08' then 1 else 0 end) as Aug,  
sum(case when substring(TA004,5,2)='09' then 1 else 0 end) as Sep,  
sum(case when substring(TA004,5,2)='10' then 1 else 0 end) as Oct,  
sum(case when substring(TA004,5,2)='11' then 1 else 0 end) as Nov,  
sum(case when substring(TA004,5,2)='12' then 1 else 0 end) as Dec  
FROM QMSTA  
where left(TA004,4)=@year  
UNION ALL  
SELECT  '合格批数' AS Item,  
sum(case when substring(TA004,5,2)='01' then 1 else 0 end) as Jan,  
sum(case when substring(TA004,5,2)='02' then 1 else 0 end) as Feb,  
sum(case when substring(TA004,5,2)='03' then 1 else 0 end) as Mar,  
sum(case when substring(TA004,5,2)='04' then 1 else 0 end) as Apr,  
sum(case when substring(TA004,5,2)='05' then 1 else 0 end) as May,  
sum(case when substring(TA004,5,2)='06' then 1 else 0 end) as Jun,  
sum(case when substring(TA004,5,2)='07' then 1 else 0 end) as Jul,  
sum(case when substring(TA004,5,2)='08' then 1 else 0 end) as Aug,  
sum(case when substring(TA004,5,2)='09' then 1 else 0 end) as Sep,  
sum(case when substring(TA004,5,2)='10' then 1 else 0 end) as Oct,  
sum(case when substring(TA004,5,2)='11' then 1 else 0 end) as Nov,  
sum(case when substring(TA004,5,2)='12' then 1 else 0 end) as Dec  
FROM QMSTA  
where left(TA004,4)=@year AND TA011='2'  
UNION ALL  
SELECT  '不合格批数' AS Item,  
sum(case when substring(TA004,5,2)='01' then 1 else 0 end) as Jan,  
sum(case when substring(TA004,5,2)='02' then 1 else 0 end) as Feb,  
sum(case when substring(TA004,5,2)='03' then 1 else 0 end) as Mar,  
sum(case when substring(TA004,5,2)='04' then 1 else 0 end) as Apr,  
sum(case when substring(TA004,5,2)='05' then 1 else 0 end) as May,  
sum(case when substring(TA004,5,2)='06' then 1 else 0 end) as Jun,  
sum(case when substring(TA004,5,2)='07' then 1 else 0 end) as Jul,  
sum(case when substring(TA004,5,2)='08' then 1 else 0 end) as Aug,  
sum(case when substring(TA004,5,2)='09' then 1 else 0 end) as Sep,  
sum(case when substring(TA004,5,2)='10' then 1 else 0 end) as Oct,  
sum(case when substring(TA004,5,2)='11' then 1 else 0 end) as Nov,  
sum(case when substring(TA004,5,2)='12' then 1 else 0 end) as Dec  
FROM QMSTA  
where left(TA004,4)=@year AND TA011 in ('3','4')  
UNION ALL  
SELECT  '退货' AS Item,  
sum(case when substring(TA004,5,2)='01' then 1 else 0 end) as Jan,  
sum(case when substring(TA004,5,2)='02' then 1 else 0 end) as Feb,  
sum(case when substring(TA004,5,2)='03' then 1 else 0 end) as Mar,  
sum(case when substring(TA004,5,2)='04' then 1 else 0 end) as Apr,  
sum(case when substring(TA004,5,2)='05' then 1 else 0 end) as May,  
sum(case when substring(TA004,5,2)='06' then 1 else 0 end) as Jun,  
sum(case when substring(TA004,5,2)='07' then 1 else 0 end) as Jul,  
sum(case when substring(TA004,5,2)='08' then 1 else 0 end) as Aug,  
sum(case when substring(TA004,5,2)='09' then 1 else 0 end) as Sep,  
sum(case when substring(TA004,5,2)='10' then 1 else 0 end) as Oct,  
sum(case when substring(TA004,5,2)='11' then 1 else 0 end) as Nov,  
sum(case when substring(TA004,5,2)='12' then 1 else 0 end) as Dec  
FROM QMSTA  
where left(TA004,4)=@year AND TA011='3'  
UNION ALL  
SELECT  '特采' AS Item,  
sum(case when substring(TA004,5,2)='01' then 1 else 0 end) as Jan,  
sum(case when substring(TA004,5,2)='02' then 1 else 0 end) as Feb,  
sum(case when substring(TA004,5,2)='03' then 1 else 0 end) as Mar,  
sum(case when substring(TA004,5,2)='04' then 1 else 0 end) as Apr,  
sum(case when substring(TA004,5,2)='05' then 1 else 0 end) as May,  
sum(case when substring(TA004,5,2)='06' then 1 else 0 end) as Jun,  
sum(case when substring(TA004,5,2)='07' then 1 else 0 end) as Jul,  
sum(case when substring(TA004,5,2)='08' then 1 else 0 end) as Aug,  
sum(case when subst
补充:Web开发 , ASP.Net ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,