diff --git a/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs b/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs index 9c8af3c..0eeb085 100644 --- a/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs +++ b/IBKLinker-Minio/Controller/MinioController/MinioApiController.cs @@ -447,22 +447,38 @@ namespace IBKLinker_Minio.Controller.MinioController /// /// [HttpPost, Route("GetFileassociation")] - public RequestEntity GetFileassociation(string FileName) + public RequestEntity GetFileassociation(string FilePk) { RequestEntity request = new RequestEntity(); try { using (IDbContext db = ObjectContainer.GetObject("db")) { - if (FileName != null) + if (FilePk != null) { string sql = string.Empty; - IList result = new List(); - if (!string.IsNullOrEmpty(FileName.ToString())) + //先通过文件ID拿到文件的类型是技术协议还是质量要点或者工艺卡 + MinioStoragePath ds= db.Query("select * from MINIO_STORAGE_PATH where PK= " + int.Parse(FilePk) + " and CLEAR_FLAG='0' ORDER BY PK").FirstOrDefault(); + if (ds != null) { - sql += string.Format( " and FILE_NAME like'%{0}%' or ASSOCIATION_FILE_NAME like'%{0}%'", FileName); + if (ds.DocumentType == "1") + { + sql += string.Format(" and FILE_PK ={0}", int.Parse(FilePk)); + } + else if (ds.DocumentType == "2") + { + sql += string.Format(" and FILE_PK ={0} or ASSOCIATION_FILE_PK ={0}", int.Parse(FilePk)); + } + else + { + sql += string.Format(" and ASSOCIATION_FILE_PK ={0}", int.Parse(FilePk)); + } } - request.data = db.Query("select * from MINIO_FILEASSOCIATION where 1=1 " + sql + " ORDER BY PK"); + //通过文件类型判断是查文件的下一级还是查文件的上下级 + + + IList result = new List(); + request.data = db.Query("select * from MINIO_FILEASSOCIATION where 1=1 " + sql + " ORDER BY PK"); request.code = "0"; } }