| | |
| | | return ResponseMsg<int>.fail("请输入元数据ID"); |
| | | } |
| | | |
| | | int count = SGUtils.Release(args); |
| | | SGUtils utils = new SGUtils(); |
| | | int count = utils.Release(args); |
| | | if (0 == count) |
| | | { |
| | | return ResponseMsg<int>.fail("失败"); |
| | |
| | | { |
| | | public SpatialItem() { } |
| | | |
| | | public int id { set; get; } |
| | | public Int64 id { set; get; } |
| | | |
| | | public string Name { set; get; } |
| | | |
| | |
| | | |
| | | public string LayerName { set; get; } |
| | | |
| | | public int DataSourceId { set; get; } |
| | | public Int64 DataSourceId { set; get; } |
| | | |
| | | public string Description { set; get; } |
| | | } |
| | |
| | | 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; |
| | | } |
| | | |
| | | // |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // 测试SG |
| | | function toSG() { |
| | | var data = { ids: [1523, 1525] }; |
| | | ajax("Convert/ToTileset", "POST", JSON.stringify(data), null, null, function (rs) { |
| | | ajax("Convert/ToSG", "POST", JSON.stringify(data), null, null, function (rs) { |
| | | alert("code = " + rs.code + ", msg = " + rs.msg + ", result = " + rs.result); |
| | | console.log(rs); |
| | | }); |