| | |
| | | [HttpGet] |
| | | public string Test() |
| | | { |
| | | string name = "8-瑞丽站0.05m.cpt"; |
| | | string cnName = name.Substring(0, name.LastIndexOf(".")); |
| | | //string name = "8-瑞丽站0.05m.cpt"; |
| | | //string cnName = name.Substring(0, name.LastIndexOf(".")); |
| | | |
| | | return cnName; |
| | | return Tools.GetLocalIP(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | <appSettings> |
| | | <!-- 廊坊服务 --> |
| | | <add key="lfServer" value="http://127.0.0.1:12316/server"/> |
| | | <!-- 本机IP --> |
| | | <add key="localIP" value="192.168.20.106"/> |
| | | <!-- 临时目录 --> |
| | | <add key="tempFolder" value="D:\LF\temp"/> |
| | | <!-- 上传目录 --> |
| | |
| | | using System.Diagnostics; |
| | | using System.IO; |
| | | using System.Linq; |
| | | using System.Net; |
| | | using System.Net.Sockets; |
| | | using System.Reflection; |
| | | using System.Runtime.InteropServices; |
| | | using System.Runtime.Serialization; |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取本机IP |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public static string GetLocalIP() |
| | | { |
| | | var host = Dns.GetHostEntry(Dns.GetHostName()); |
| | | foreach (var ip in host.AddressList) |
| | | { |
| | | if (ip.AddressFamily == AddressFamily.InterNetwork) |
| | | { |
| | | return ip.ToString(); |
| | | } |
| | | } |
| | | |
| | | return GetSetting("localIP"); |
| | | } |
| | | |
| | | [DllImport("ReadLas.dll")] |
| | | public extern static int get_las_cs(string file_name); |
| | | } |
| | |
| | | /// <summary> |
| | | /// 根据ID集合查询 |
| | | /// </summary> |
| | | public static List<SysTask> selectByIds(List<int> ids) |
| | | public static List<SysTask> SelectByIds(List<int> ids) |
| | | { |
| | | string sql = string.Format("select * from lf.sys_task where id in ({0}) order by id desc", string.Join(",", ids.ToArray())); |
| | | |
| | |
| | | /// <summary> |
| | | /// 插入任务 |
| | | /// </summary> |
| | | public static int insert(SysTask task) |
| | | public static int Insert(SysTask task) |
| | | { |
| | | string sql = "insert into lf.sys_task (name, status, type, descr, err, ip, pid, gids, depcode, dircode, create_user) values (@name, @status, @type, @descr, @err, @ip, @pid, @gids, @depcode, @dircode, @create_user)"; |
| | | |
| | | List<DbParameter> list = Tools.GetParams<SysTask>(sql, task); |
| | | |
| | | object obj = Tools.DBHelper.GetScalar(sql, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | |
| | | /// <summary> |
| | | /// 更新任务 |
| | | /// </summary> |
| | | public static int update(SysTask task) |
| | | public static int Update(SysTask task) |
| | | { |
| | | string sql = "update lf.sys_task set name=@name, status=@status, type=@type, descr=@descr, err=@err, ip=@ip, pid=@pid, gids=@gids, depcode=@depcode, dircode=@dircode, update_user=@update_user, update_time=now() where id=@id"; |
| | | |
| | | List<DbParameter> list = Tools.GetParams<SysTask>(sql, task); |
| | | |
| | | object obj = Tools.DBHelper.GetScalar(sql, list.ToArray()); |
| | | |
| | | return obj == null ? 0 : Convert.ToInt32(obj); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 创建任务实体类 |
| | | /// </summary> |
| | | public static SysTask CreateTask(XYZArgs args, SysMeta meta) |
| | | { |
| | | SysTask task = new SysTask(); |
| | | // |
| | | |
| | | |
| | | |
| | | return task; |
| | | } |
| | | } |
| | | } |