| | |
| | | using System.Collections.Generic; |
| | | using System.Configuration; |
| | | using System.Data; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Web; |
| | | |
| | |
| | | /// </summary> |
| | | /// <param name="args">XYZ参数</param> |
| | | /// <returns>行数</returns> |
| | | public static int Release(XYZArgs args) |
| | | public int Release(XYZArgs args) |
| | | { |
| | | List<SysMeta> list = XYZUtils.selectMetas(args.ids, "and type in ('mpt', '3dml')"); |
| | | if (null == list || list.Count == 0) return 0; |
| | | |
| | | int maxId = GetMaxId(); |
| | | RomoveNoneFiles(list); |
| | | |
| | | |
| | | |
| | | |
| | | List<SpatialItem> items = SelectItems(maxId); |
| | | if (null == items || items.Count == 0) return 0; |
| | | |
| | |
| | | DataTable dt = SQLiteHelper.GetDataTable(sql); |
| | | List<SpatialItem> list = ModelHandler.FillModel<SpatialItem>(dt); |
| | | |
| | | |
| | | return list; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 移除空文件 |
| | | /// </summary> |
| | | private void RomoveNoneFiles(List<SysMeta> list) |
| | | { |
| | | string uploadFolder = Tool.GetSetting("uploadFolder"); |
| | | |
| | | int i = 0; |
| | | while (i < list.Count) |
| | | { |
| | | SysMeta meta = list[i]; |
| | | string filePath = Path.Combine(uploadFolder, meta.path); |
| | | if (!File.Exists(filePath)) |
| | | { |
| | | list.RemoveAt(i); |
| | | continue; |
| | | } |
| | | |
| | | // |
| | | } |
| | | } |
| | | } |
| | | } |