|
@ -27,7 +27,7 @@ namespace NFine.Application.WMS |
|
|
DataTable dt = new DataTable(); |
|
|
DataTable dt = new DataTable(); |
|
|
var queryParam = queryJson.ToJObject(); |
|
|
var queryParam = queryJson.ToJObject(); |
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
List<DbParameter> parameter = new List<DbParameter>(); |
|
|
string sql = ""; |
|
|
|
|
|
|
|
|
StringBuilder sqlstring = new StringBuilder(); |
|
|
#region [SQL]
|
|
|
#region [SQL]
|
|
|
|
|
|
|
|
|
// sql = @"select a.ID,b.MOCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,c.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
|
|
|
// sql = @"select a.ID,b.MOCode as Code,a.Sequence,a.MTIME,a.MUSERName,a.MUSER,a.WHCode,c.WarehouseName,a.InvCode,d.InvName,d.InvDesc,d.InvStd,d.InvUnit,
|
|
@ -39,34 +39,34 @@ namespace NFine.Application.WMS |
|
|
//left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint";
|
|
|
//left join ICSMOPickMerge e on a.ID=e.SourceID and a.WorkPoint=e.WorkPoint";
|
|
|
// sql += " WHERE 1=1 and e.ID is null";
|
|
|
// sql += " WHERE 1=1 and e.ID is null";
|
|
|
|
|
|
|
|
|
sql = @"select
|
|
|
|
|
|
a.MOCode as Code,a.CreateDateTime as MTIME,a.createperson as MUSER,case when max(d.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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sqlstring.Append($@"select a.MOCode as Code,a.CreateDateTime as MTIME,a.createperson as MUSER,
|
|
|
|
|
|
case when max(d.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 ICSMO a |
|
|
from ICSMO a |
|
|
inner join ICSMOPick b on b.MODetailID=a.MODetailID and b.WorkPoint=a.WorkPoint |
|
|
inner join ICSMOPick b on b.MODetailID=a.MODetailID and b.WorkPoint=a.WorkPoint |
|
|
left join ICSMOPickMerge d on d.SourceID=b.ID and d.WorkPoint=b.WorkPoint |
|
|
left join ICSMOPickMerge d on d.SourceID=b.ID and d.WorkPoint=b.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.WorkPoint='{0}' |
|
|
|
|
|
group by a.MOCode, 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";
|
|
|
|
|
|
sql = string.Format(sql, WorkPoint); |
|
|
|
|
|
sql = string.Format(sql, DbHelper.GetErpIp(), DbHelper.GetErpName()); |
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
where a.WorkPoint='{WorkPoint}' ");
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(queryJson)) |
|
|
if (!string.IsNullOrWhiteSpace(queryJson)) |
|
|
{ |
|
|
{ |
|
|
if (!string.IsNullOrWhiteSpace(queryParam["POCode"].ToString())) |
|
|
if (!string.IsNullOrWhiteSpace(queryParam["POCode"].ToString())) |
|
|
{ |
|
|
{ |
|
|
sql += " and b.MOCode like '%" + queryParam["POCode"].ToString() + "%' "; |
|
|
|
|
|
|
|
|
sqlstring.Append($" and b.MOCode like '%{queryParam["POCode"]}%' "); |
|
|
} |
|
|
} |
|
|
if (!string.IsNullOrWhiteSpace(queryParam["InvCode"].ToString())) |
|
|
if (!string.IsNullOrWhiteSpace(queryParam["InvCode"].ToString())) |
|
|
{ |
|
|
{ |
|
|
sql += " and a.InvCode like '%" + queryParam["InvCode"].ToString() + "%' "; |
|
|
|
|
|
|
|
|
sqlstring.Append($" and a.InvCode like '%{queryParam["InvCode"]}%' "); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return Repository().FindTablePageBySql(sql.ToString(), parameter.ToArray(), ref jqgridparam); |
|
|
|
|
|
|
|
|
sqlstring.Append(@" group by a.MOCode, 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");
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
return Repository().FindTablePageBySql(sqlstring.ToString(), parameter.ToArray(), ref jqgridparam); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//工单备料(工单子件)子表查询
|
|
|
//工单备料(工单子件)子表查询
|
|
|