@ -117,11 +117,12 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
sqlString . Append ( $ @ "
SELECT * from ( select row_number ( ) over ( partition by a . ApplyCode ORDER BY a . ApplyCode ) as row ,
a . ApplyCode as Code , a . CreateDateTime as MTIME , a . createperson as MUSER ,
a . ApplyCode as Code , a . CreateDateTime as MTIME , a . createperson as MUSER , a . WHCode , b . EATTRIBUTE1 AS Area ,
case when max ( e . SourceID ) is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , f . Colspan ,
f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 ,
f . cFree4 , f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10
from ICSMOApply a
left JOIN ICSInventory b ON b . InvCode = a . InvCode
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . WorkPoint = ' { WorkPoint } ' ");
@ -135,10 +136,19 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
{
sqlString . Append ( $@" and a.InvCode like '%{queryParam[" InvCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.WHCode like '%{queryParam[" WHCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and b.EATTRIBUTE1 like '%{queryParam[" Area "]}%' " ) ;
}
}
sqlString . Append ( @ " group by a.ApplyCode, a.WorkPoint,a.CreateDateTime,a.createperson,
f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 ,
f . cFree3 , f . cFree4 , f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 ) as t where t . row = 1 ");
f . cFree3 , f . cFree4 , f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . WHCode , b . EATTRIBUTE1 ) as t where t . row = 1 ");
#endregion
@ -146,22 +156,39 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'";
}
//工单领料(发料申请)子表查询
public DataTable GetSubGridJson2 ( string Code )
public DataTable GetSubGridJson2 ( string queryJson , string Code )
{
string WorkPoint = NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . Location ;
DataTable dt = new DataTable ( ) ;
//var queryParam = queryJson.ToJObject();
var queryParam = queryJson . ToJObject ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
string sql = @ "select a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName ,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
string sql = @ "SELECT * FROM (select row_number() over(partition by a.ApplyCode,a.InvCode,a.Sequence ORDER BY a.ApplyCode) as row,
a . ID , a . ApplyCode as Code , a . Sequence , a . MTIME , a . MUSERName , a . MUSER , a . WHCode , b . WarehouseName , a . InvCode , d . InvName , d . InvDesc , d . InvStd , d . InvUnit , d . EATTRIBUTE1 AS Area ,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSMOApply a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . ApplyCode = ' { 0 } ' and a . WorkPoint = ' { 1 } ' ";
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sql + = " and a.WHCode like '%" + queryParam [ "WHCode" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sql + = " and d.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvCode" ] . ToString ( ) ) )
{
sql + = " and a.InvCode like '%" + queryParam [ "InvCode" ] . ToString ( ) + "%' " ;
}
}
sql + = " ) c WHERE c.row=1 " ;
sql = string . Format ( sql , Code , WorkPoint ) ;
return Repository ( ) . FindTableBySql ( sql . ToString ( ) ) ;
}
@ -329,6 +356,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
from ICSOApply a
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
where a . WorkPoint = ' { WorkPoint } ' ");
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
@ -340,6 +368,15 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString . Append ( $@" and a.InvCode like '%{queryParam[" InvCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.WHCode like '%{queryParam[" WHCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and d.EATTRIBUTE1 like '%{queryParam[" Area "]}%' " ) ;
}
}
sqlString . Append ( @ "group by a.ApplyCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,
f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4 , f . cFree5 ,
@ -350,22 +387,37 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
}
//委外领料(委外发料申请)子表查询
public DataTable GetSubGridJson5 ( string Code )
public DataTable GetSubGridJson5 ( string Code , string queryJson )
{
string WorkPoint = NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . Location ;
DataTable dt = new DataTable ( ) ;
//var queryParam = queryJson.ToJObject();
var queryParam = queryJson . ToJObject ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
string sql = @ "select a.ID,a.ApplyCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity , d . EATTRIBUTE1 AS Area ,
f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . IssueQuantity as IssueQuantity
from ICSOApply a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . ApplyCode = ' { 0 } ' and a . WorkPoint = ' { 1 } ' ";
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sql + = " and a.WHCode like '%" + queryParam [ "WHCode" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sql + = " and d.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvCode" ] . ToString ( ) ) )
{
sql + = " and a.InvCode like '%" + queryParam [ "InvCode" ] . ToString ( ) + "%' " ;
}
}
sql = string . Format ( sql , Code , WorkPoint ) ;
return Repository ( ) . FindTableBySql ( sql . ToString ( ) ) ;
}
@ -477,6 +529,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
FROM ICSSDN a
LEFT JOIN ICSMOPickMerge e ON a . ID = e . SourceID AND a . WorkPoint = e . WorkPoint
LEFT JOIN ICSExtension f ON a . ExtensionID = f . ID AND a . WorkPoint = f . WorkPoint
LEFT JOIN ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
WHERE a . WorkPoint = ' { WorkPoint } ' ");
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
@ -488,6 +541,15 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString . Append ( $" and a.InvCode like '%{queryParam[" InvCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.WHCode like '%{queryParam[" WHCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and d.EATTRIBUTE1 like '%{queryParam[" Area "]}%' " ) ;
}
}
sqlString . Append ( @ "GROUP BY a.SDNCode, a.CreateDateTime, a.CreatePerson, f.Colspan, f.ProjectCode, f.BatchCode, f.Version, f.Brand,
f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4 , f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 ) t WHERE t . r = 1 ");
@ -496,22 +558,37 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
}
//销售发货(销售发货)子表查询
public DataTable GetSubGridJson7 ( string Code )
public DataTable GetSubGridJson7 ( string Code , string queryJson )
{
string WorkPoint = NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . Location ;
DataTable dt = new DataTable ( ) ;
//var queryParam = queryJson.ToJObject();
var queryParam = queryJson . ToJObject ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
string sql = @ "select a.ID,a.SDNCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . SDNQuantity as IssueQuantity
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity , d . EATTRIBUTE1 AS Area
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . SDNQuantity as IssueQuantity
from ICSSDN a
left join ICSWarehouse b on a . WHCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . SDNCode = ' { 0 } ' and a . WorkPoint = ' { 1 } ' ";
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . SDNCode = ' { 0 } ' and a . WorkPoint = ' { 1 } ' ";
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sql + = " and a.WHCode like '%" + queryParam [ "WHCode" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sql + = " and d.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvCode" ] . ToString ( ) ) )
{
sql + = " and a.InvCode like '%" + queryParam [ "InvCode" ] . ToString ( ) + "%' " ;
}
}
sql = string . Format ( sql , Code , WorkPoint ) ;
return Repository ( ) . FindTableBySql ( sql . ToString ( ) ) ;
}
@ -545,6 +622,7 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
from ICSOtherOut a
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
where a . WorkPoint = ' { WorkPoint } ' ");
#endregion
@ -558,6 +636,15 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
{
sqlString . Append ( $@" and a.InvCode like '%{queryParam[" InvCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.WHCode like '%{queryParam[" WHCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and d.EATTRIBUTE1 like '%{queryParam[" Area "]}%' " ) ;
}
}
sqlString . Append ( @ " group by a.OutCode,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,f.BatchCode,
f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4 , f . cFree5 , f . cFree6 ,
@ -567,14 +654,14 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
}
//其它出库(其它出库)子表查询
public DataTable GetSubGridJson8 ( string Code )
public DataTable GetSubGridJson8 ( string Code , string queryJson )
{
string WorkPoint = NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . Location ;
DataTable dt = new DataTable ( ) ;
//var queryParam = queryJson.ToJObject();
var queryParam = queryJson . ToJObject ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
string sql = @ "select a.ID,a.OutCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , d . EATTRIBUTE1 AS Area , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . OutQuantity as IssueQuantity
from ICSOtherOut a
@ -583,6 +670,21 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . OutCode = ' { 0 } ' and a . WorkPoint = ' { 1 } ' ";
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sql + = " and a.WHCode like '%" + queryParam [ "WHCode" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sql + = " and d.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvCode" ] . ToString ( ) ) )
{
sql + = " and a.InvCode like '%" + queryParam [ "InvCode" ] . ToString ( ) + "%' " ;
}
}
sql = string . Format ( sql , Code , WorkPoint ) ;
return Repository ( ) . FindTableBySql ( sql . ToString ( ) ) ;
}
@ -688,17 +790,27 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
from ICSTransfer a
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
where a . WorkPoint = ' { WorkPoint } ' and a . Status = '2' ");
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "POCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.BrrowCode like '%{queryParam[" POCode "]}%' " ) ;
sqlString . Append ( $@" and a.TransferNO like '%{queryParam[" POCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.InvCode like '%{queryParam[" InvCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and a.ToWarehouseCode like '%{queryParam[" WHCode "]}%' " ) ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sqlString . Append ( $@" and d.EATTRIBUTE1 like '%{queryParam[" Area "]}%' " ) ;
}
}
sqlString . Append ( @ "group by a.TransferNO,a.CreateDateTime,a.CreatePerson,f.Colspan,f.ProjectCode,
f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4 ,
@ -708,22 +820,39 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'";
return Repository ( ) . FindTablePageBySql ( sqlString . ToString ( ) , parameter . ToArray ( ) , ref jqgridparam ) ;
}
//物料调拨子表查询
public DataTable GetSubGridJson10 ( string Code )
public DataTable GetSubGridJson10 ( string Code , string queryJson )
{
string WorkPoint = NFine . Code . OperatorProvider . Provider . GetCurrent ( ) . Location ;
DataTable dt = new DataTable ( ) ;
//var queryParam = queryJson.ToJObject();
var queryParam = queryJson . ToJObject ( ) ;
List < DbParameter > parameter = new List < DbParameter > ( ) ;
string sql = @ "select a.ID,a.TransferNO as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.FromWarehouseCode as WHCode,b.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
string sql = @ "SELECT * from (select row_number() over(partition by a.TransferNO,a.InvCode,a.Sequence ORDER BY a.TransferNO) as row, a.ID,a.TransferNO as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.FromWarehouseCode as WHCode,b.WarehouseName,d.EATTRIBUTE1 AS Area,
a . InvCode , a . ToWarehouseCode , a . EATTRIBUTE1 AS ReceiveWork , d . InvName , d . InvDesc , d . InvStd , d . InvUnit ,
case when e . SourceID is null then ' 未 合 并 ' else ' 已 合 并 ' end as IsNew , a . Quantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . TransferQuantity as IssueQuantity
, f . Colspan , f . ProjectCode , f . BatchCode , f . Version , f . Brand , f . cFree1 , f . cFree2 , f . cFree3 , f . cFree4
, f . cFree5 , f . cFree6 , f . cFree7 , f . cFree8 , f . cFree9 , f . cFree10 , a . TransferQuantity as IssueQuantity
from ICSTransfer a
left join ICSWarehouse b on a . FromWarehouseCode = b . WarehouseCode and a . WorkPoint = b . WorkPoint
left join ICSInventory d on a . InvCode = d . InvCode and a . WorkPoint = d . WorkPoint
left join ICSMOPickMerge e on a . ID = e . SourceID and a . WorkPoint = e . WorkPoint
left join ICSExtension f on a . ExtensionID = f . ID and a . WorkPoint = f . WorkPoint
where a . TransferNO = ' { 0 } ' and b . WorkPoint = ' { 1 } ' ";
if ( ! string . IsNullOrWhiteSpace ( queryJson ) )
{
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "WHCode" ] . ToString ( ) ) )
{
sql + = " and a.ToWarehouseCode like '%" + queryParam [ "WHCode" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "Area" ] . ToString ( ) ) )
{
sql + = " and d.EATTRIBUTE1 like '%" + queryParam [ "Area" ] . ToString ( ) + "%' " ;
}
if ( ! string . IsNullOrWhiteSpace ( queryParam [ "InvCode" ] . ToString ( ) ) )
{
sql + = " and a.InvCode like '%" + queryParam [ "InvCode" ] . ToString ( ) + "%' " ;
}
}
sql + = " ) as t where t.row=1" ;
sql = string . Format ( sql , Code , WorkPoint ) ;
return Repository ( ) . FindTableBySql ( sql . ToString ( ) ) ;
}
@ -1775,7 +1904,7 @@ a.ExtensionID
GROUP BY a . TransferNO , a . InvCode , b . InvName , b . InvStd , b . InvUnit , a . FromWarehouseCode , a . ExtensionID , x . MergeID ";
#endregion
}
if ( Type = = "10 " )
if ( Type = = "11 " )
{
#region 两步调出
sqls = @ "select
xxxxxxxxxx