commit by yzf

master
Yang 2 years ago
parent 0878253397
commit b35b6d2441

@ -845,10 +845,23 @@ namespace FactorySystemApi.Controllers
if (viewList != null && viewList.Count > 0)
{
int materialId = viewList[0].FMaterialID;
if (teamType == 3)
{
List<int> materialIds = viewList.Select(m => m.FMaterialID).ToList();
string ids = string.Join(",", materialIds);
dataList = MaterialTeamworkBll.GetViewMaterial(ids.ToString());
NPOIHelper.ExportDTtoExcel(dataList, "Sheet1", savePath.Replace(".xlsx", fType + ".xlsx"));
}
else
{
dataList = MaterialTeamworkBll.GetViewMaterial(materialId.ToString());
NPOIHelper.ExportDTtoExcel(dataList, "Sheet1", savePath.Replace(".xlsx", fType + ".xlsx"));
}
}
}
}
}

@ -473,6 +473,10 @@ namespace FactorySystemBll
{
viewList = db.Queryable<TFS_ViewMaterial>().Where(s => s.FTeamID == teamworkId && s.FTeamType == 1).ToList();
}
else if (teamworkType == 3)
{
viewList = db.Queryable<TFS_ViewMaterial>().Where(s => s.FHalfMaterialTeamID == teamworkId).ToList();
}
else
{
viewList = db.Queryable<TFS_ViewMaterial>().Where(s => s.FMdfMaterialTeamID == teamworkId && s.FTeamType == 1).ToList();
@ -618,6 +622,11 @@ namespace FactorySystemBll
string whereSql = string.Format(" Where FTeamType=1 And FMdfMaterialTeamID={0}", teamworkId);
strSql = strSql + whereSql;
}
else if ("3".Equals(teamworkType))
{
string whereSql = string.Format(" Where FHalfMaterialTeamID={0}", teamworkId);
strSql = strSql + whereSql;
}
else
{
string whereSql = string.Format(" Where FTeamType=1 And FTeamID={0}", teamworkId);
@ -632,6 +641,7 @@ namespace FactorySystemBll
{
SqlSugarClient db = AppSettingsHelper.GetSqlSugar();
string strSql = string.Format(@"
SELECT
isnull( FTypeName1, '' ) AS '',
isnull( FTypeName2, '' ) AS '',
@ -781,24 +791,25 @@ namespace FactorySystemBll
SELECT
isnull( b.FName, '' ) AS 'FTypeName1',
isnull( c.FName, '' ) AS 'FTypeName2',
isnull( FSAPCode, '' ) AS 'FCode',
isnull( FSAPDescription, '' ) AS 'FName',
isnull( e.FSAPCode, '' ) AS 'FCode',
isnull( e.FSAPDescription, '' ) AS 'FName',
isnull( FBaseMaterialDesc, '' ) AS 'FDesc',
isnull( FBaseMaterialDesc, '' ) AS 'FVersionCode',
isnull( FBaseMaterialDesc, '' ) AS 'FFactoryCode',
isnull( FBaseMaterialDesc, '' ) AS 'FSupplyCode',
isnull( FBaseMaterialGroup, '' ) AS 'FGroupCode',
isnull( FBaseWeightUnit, '' ) AS 'FBaseUnit',
isnull( FCraftExplain, '' ) AS 'FCraftDesc',
d.FName AS 'FtypeName',
isnull( e.FCraftExplain, '' ) AS 'FCraftDesc',
a.*
FROM
TFS_MaterialInfo AS a
LEFT JOIN TFS_Material AS e ON a.FDataID=e.FID
LEFT JOIN TFS_MaterialType AS d ON a.FType=d.FID
LEFT JOIN TFS_MaterialType AS b ON a.FTypeID1= b.FID
LEFT JOIN TFS_MaterialType AS C ON a.FTypeID2= b.FID
WHERE
FDataId = {0})a;", FID);
LEFT JOIN TFS_MaterialType AS b ON e.FTypeID1= b.FID
LEFT JOIN TFS_MaterialType AS C ON e.FTypeID2= c.FID
WHERE a.FDataID in ({0})
)a;
", FID);
DataTable data = db.Ado.GetDataTable(strSql);
return data;

Loading…
Cancel
Save