@ -25,8 +25,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List < HQHSettledDetailDiff > _l ist = new List < HQHSettledDetailDiff > ( ) ;
string condition = " " ;
//string condition = " where 1=1 ";
string condition = " " ;
////if (!string.IsNullOrEmpty(materialCode))
////{
//// condition += string.Format(" and d.MaterialCode in ({0}) ", materialCode);
////}
if ( ! string . IsNullOrEmpty ( begin ) )
{
condition + = string . Format ( " and b.LastModificationTime>='{0}' " , begin ) ;
@ -35,9 +41,28 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
condition + = string . Format ( " and b.LastModificationTime<='{0}' " , end ) ;
}
//if (!string.IsNullOrEmpty(cp7begin))
//{
// condition += string.Format(" and B.cp7>='{0}' ", cp7begin);
//}
//if (!string.IsNullOrEmpty(cp7end))
//{
// condition += string.Format(" and B.cp7<='{0}' ", cp7end);
//}
////if (!string.IsNullOrEmpty(kennCode))
////{
//// condition += string.Format(" and B.kenncode='{0}' ", kennCode);
////}
////if (!string.IsNullOrEmpty(chassisNumber))
////{
//// condition += string.Format(" and B.chassisNumber='{0}' ", chassisNumber);
////}
////if (!string.IsNullOrEmpty(materialGroup))
////{
//// condition += string.Format(" B.chassisNumber='{0}' ", materialGroup);
////}
string str =
"SELECT\n" +
" temp1.行号, \n" +
" isnull(temp1.交货单号,'') 交货单号,\n" +
" temp1.交货时间,\n" +
" isnull(temp1.手工或自动,'') 手工或自动,\n" +
@ -63,7 +88,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
"FROM\n" +
" (\n" +
" SELECT\n" +
" b.poLine AS 行号,\n" +
" b.WmsBillNum AS 交货单号,\n" +
" b.LastModificationTime AS 交货时间,\n" +
" b.IsAuto AS 手工或自动,\n" +
@ -111,18 +135,31 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
{
List < HQHSettleQtyDiff > _l ist = new List < HQHSettleQtyDiff > ( ) ;
var str =
"SELECT\n" +
" temp1.MaterialCode 客户物料号,\n" +
" temp1.HQHKanBan 看板号,\n" +
" temp1.SettleQty 结算数量,\n" +
" ISNULL( temp2.Qty, 0 ) 发货数量,(\n" +
" temp1.SettleQty - ISNULL( temp2.Qty, 0 )) 差异数量 \n" +
"FROM\n" +
" ( SELECT SUM( Qty ) SettleQty, HQHKanBan, MaterialCode FROM Set_HQ_H_Platform WHERE version = '{0}' GROUP BY HQHKanBan, MaterialCode ) temp1\n" +
" LEFT JOIN ( SELECT SUM( Qty ) Qty, Kanban, MaterialCode FROM Set_HQ_H_Kanban GROUP BY Kanban, MaterialCode ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode \n" +
"WHERE\n" +
" temp1.SettleQty != ISNULL( temp2.Qty, 0 )" ;
"SELECT temp1.MaterialCode 客户物料号,temp1.HQHKanBan 看板号 ,temp1.SettleQty 结算数量, temp2.Qty 发货数量,( temp1.SettleQty - temp2.Qty ) 差异数量 \n" +
"FROM\n" +
" (\n" +
" SELECT\n" +
" SUM( Qty ) SettleQty,\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Platform where version='{0}'\n" +
" GROUP BY\n" +
" HQHKanBan,\n" +
" MaterialCode \n" +
" ) temp1\n" +
" LEFT JOIN (\n" +
" SELECT\n" +
" SUM( Qty ) Qty,\n" +
" Kanban,\n" +
" MaterialCode \n" +
" FROM\n" +
" Set_HQ_H_Kanban \n" +
" GROUP BY\n" +
" Kanban,\n" +
" MaterialCode \n" +
" ) temp2 ON temp1.HQHKanBan = temp2.Kanban \n" +
" AND temp1.MaterialCode = temp2.MaterialCode where temp1.SettleQty!=temp2.Qty " ;
str = string . Format ( str , version ) ;
var _ query = DbConnection . Query < HQHSettleQtyDiff > ( str , null , null , true , 1 2 0 0 , null ) ;
@ -137,9 +174,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
List < HQHSharePartSettledDetailDiff > _l ist = new List < HQHSharePartSettledDetailDiff > ( ) ;
string condition = " " ;
//string condition = " where 1=1 ";
string condition = " " ;
if ( ! string . IsNullOrEmpty ( begin ) )
{
@ -205,6 +242,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report
return _l ist ;
}
}
public class HQHSharePartSettledDetailDiff