修改协同视图的查询条件

master
leo 3 years ago
parent 79525941a5
commit 8879212606

@ -608,7 +608,7 @@ namespace FactorySystemBll
FTeamID = teamInfo.FID, FTeamID = teamInfo.FID,
FFactoryID = teamInfo.FCreateFactoryID, FFactoryID = teamInfo.FCreateFactoryID,
FFactoryCode = teamInfo.FCreateFactoryCode, FFactoryCode = teamInfo.FCreateFactoryCode,
FViewType = (int)Constant.ViewType., FViewType = (int)Constant.ViewType.,
FLevel = 1, FLevel = 1,
FEditUser = userId, FEditUser = userId,
FBaseMaterialCode = teamInfo.FMdmCode, FBaseMaterialCode = teamInfo.FMdmCode,

@ -32,25 +32,24 @@ namespace FactorySystemBll
* viewTypeTBasicCodeFType=33FRemark * viewTypeTBasicCodeFType=33FRemark
* **/ * **/
List<Dictionary<string, object>> viewList = new List<Dictionary<string, object>>(); List<Dictionary<string, object>> viewList = new List<Dictionary<string, object>>();
List<int> viewTypes=new List<int> { 2,3,4,5,10}; List<int> viewTypes=new List<int> { 2,3,4,5,1};
if (viewTypes.Contains(viewType)) if (viewTypes.Contains(viewType))
{ {
viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((a, b) => viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((a, b) =>
new JoinQueryInfos(JoinType.Inner, a.FMaterialID == b.FID)) new JoinQueryInfos(JoinType.Inner, a.FMaterialID == b.FID))
.Where((a, b) => a.FTeamID == teamId) .Where((a, b) => a.FTeamID == teamId)
.WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID) .WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID)
.WhereIF(viewType > 0, (a, b) => a.FViewType == 2 || a.FViewType == 3 || a.FViewType == 4 || a.FViewType == 5||a.FViewType==10) .WhereIF(viewType > 0, (a, b) => a.FViewType == viewType)
.Select<object>("distinct a.*,b.FTypeID1,b.FTypeID2,b.FK3Code,b.FK3Name,b.FK3ShortCode,b.FTestCode,b.FRelationCode,b.FRelationName,b.FSAPCode,b.FSAPDescription,b.FMaterialGroup,b.FMaterialType,b.FCustomerCode,b.FStoreHouse," + .Select<object>("distinct a.*,b.FTypeID1,b.FTypeID2,b.FK3Code,b.FK3Name,b.FK3ShortCode,b.FTestCode,b.FRelationCode,b.FRelationName,b.FSAPCode,b.FSAPDescription,b.FMaterialGroup,b.FMaterialType,b.FCustomerCode,b.FStoreHouse," +
"b.FBomEntry,b.FLineHouse,b.FProductDesc,b.FWorkCenter,b.FCraftExplain,b.FIidentifier,b.FGuaranteePeriod,b.FBStorageConditions,b.FSafetyStock,b.FTriggerRatio,b.FMinAmount,b.FMaxAmount,b.FYield,b.FFixedLoss,b.FTheoryYield," + "b.FBomEntry,b.FLineHouse,b.FProductDesc,b.FWorkCenter,b.FCraftExplain,b.FIidentifier,b.FGuaranteePeriod,b.FBStorageConditions,b.FSafetyStock,b.FTriggerRatio,b.FMinAmount,b.FMaxAmount,b.FYield,b.FFixedLoss,b.FTheoryYield," +
"b.FQualityTest1,b.FQualityTest2").ToDictionaryList(); "b.FQualityTest1,b.FQualityTest2").ToDictionaryList();
} }
else else if (viewType == 10)
{ {
viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((a, b) => viewList = db.Queryable<TFS_ViewMaterial, TFS_Material>((a, b) =>
new JoinQueryInfos(JoinType.Inner, a.FMaterialID == b.FID)) new JoinQueryInfos(JoinType.Inner, a.FMaterialID == b.FID))
.Where((a, b) => a.FTeamID == teamId) .Where((a, b) => a.FTeamID == teamId)
.WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID) .WhereIF(currUser != null, (a, b) => a.FFactoryID == currUser.FFactoryID)
.WhereIF(viewType > 0, (a, b) => a.FViewType == viewType)
.Select<object>("distinct a.*,b.FTypeID1,b.FTypeID2,b.FK3Code,b.FK3Name,b.FK3ShortCode,b.FTestCode,b.FRelationCode,b.FRelationName,b.FSAPCode,b.FSAPDescription,b.FMaterialGroup,b.FMaterialType,b.FCustomerCode,b.FStoreHouse," + .Select<object>("distinct a.*,b.FTypeID1,b.FTypeID2,b.FK3Code,b.FK3Name,b.FK3ShortCode,b.FTestCode,b.FRelationCode,b.FRelationName,b.FSAPCode,b.FSAPDescription,b.FMaterialGroup,b.FMaterialType,b.FCustomerCode,b.FStoreHouse," +
"b.FBomEntry,b.FLineHouse,b.FProductDesc,b.FWorkCenter,b.FCraftExplain,b.FIidentifier,b.FGuaranteePeriod,b.FBStorageConditions,b.FSafetyStock,b.FTriggerRatio,b.FMinAmount,b.FMaxAmount,b.FYield,b.FFixedLoss,b.FTheoryYield," + "b.FBomEntry,b.FLineHouse,b.FProductDesc,b.FWorkCenter,b.FCraftExplain,b.FIidentifier,b.FGuaranteePeriod,b.FBStorageConditions,b.FSafetyStock,b.FTriggerRatio,b.FMinAmount,b.FMaxAmount,b.FYield,b.FFixedLoss,b.FTheoryYield," +
"b.FQualityTest1,b.FQualityTest2").ToDictionaryList(); "b.FQualityTest1,b.FQualityTest2").ToDictionaryList();

Loading…
Cancel
Save