1.Startup.cs 文件中增加授权.apk文件
2.Excel下载方法中增加.net core直接下载wwwroot下的文件代码(暂时不用,先注释掉)
| | |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | |
| | | //[ChannelActionFilter] |
| | | public class ImportExcelController : Controller |
| | | { |
| | | private readonly IWebHostEnvironment _hostingEnvironment; |
| | | |
| | | public ImportExcelController(IWebHostEnvironment hostingEnvironment) |
| | | { |
| | | _hostingEnvironment = hostingEnvironment; |
| | | } |
| | | |
| | | #region[Excel导入模板列表] |
| | | /// <summary> |
| | |
| | | mes.code = "200"; |
| | | mes.data = msg; |
| | | return Json(mes); |
| | | |
| | | //ToMessage mes = new ToMessage(); |
| | | //List<ScoreReport> list = ExcelList.ExcelData(); |
| | | //list = list.Where(s => s.FileCode == FileCode).ToList(); |
| | | //var filename = list[0].FileName + ".xls"; |
| | | //var wwwRootPath = _hostingEnvironment.WebRootPath; |
| | | //var fileDirectory = Path.Combine(wwwRootPath, "Excel"); // 替换为您的Excel文件所在目录 |
| | | //var filePath = Path.Combine(fileDirectory, $"{filename}.xlsx"); // 假设文件名编码为文件名 |
| | | |
| | | //if (System.IO.File.Exists(filePath)) |
| | | //{ |
| | | // var fileInfo = new FileInfo(filePath); |
| | | // var result = new |
| | | // { |
| | | // FileName = fileInfo.Name, |
| | | // FilePath = filePath, |
| | | // FileSize = fileInfo.Length |
| | | // }; |
| | | // return Json(result); |
| | | //} |
| | | //else |
| | | //{ |
| | | // mes.code = "300"; |
| | | // mes.data = ""; |
| | | // mes.message = "文件不存在"; |
| | | //} |
| | | //return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | |
| | | IEnumerable<object> data; |
| | | try |
| | | { |
| | | if (flag == "-1" && stckcode == null) |
| | | { |
| | | mes.code = "200"; |
| | | mes.count = 0; |
| | | mes.message = "暂无数据!"; |
| | | mes.data = null; |
| | | return mes; |
| | | } |
| | | string[] classcode = Array.ConvertAll<string, string>(stckcode.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string分割转string[] |
| | | switch (flag) |
| | | { |
| | |
| | | #endregion |
| | | |
| | | #region[仓位信息新增/编辑保存] |
| | | public static ToMessage TSecLocaAddUpdate(string data_sources, string locacode, string locaname, string stckcode, string parentlocacode,string depth, string status, string description, string OperType, User us) |
| | | public static ToMessage TSecLocaAddUpdate(string data_sources, string locacode, string locaname, string stckcode, string parentlocacode, string depth, string status, string description, string OperType, User us) |
| | | { |
| | | string sql = ""; |
| | | List<object> list = new List<object>(); |
| | |
| | | lm_user = us.usercode, |
| | | lm_date = DateTime.Now.ToString(), |
| | | data_sources = data_sources, |
| | | depth= depth |
| | | depth = depth |
| | | } |
| | | }); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | |
| | | name = locaname, |
| | | idwarehouse = stckcode, |
| | | idparent = parentlocacode, |
| | | depth= depth, |
| | | depth = depth, |
| | | status = status, |
| | | description = description, |
| | | lm_user = us.usercode, |
| | |
| | | |
| | | |
| | | #region[工序查询] |
| | | public static ToMessage StepSearch(string stepcode, string stepname, string enable, string steptypecode,int startNum, int endNum, string prop, string order) |
| | | public static ToMessage StepSearch(string stepcode, string stepname, string enable, string steptypecode, int startNum, int endNum, string prop, string order) |
| | | { |
| | | var dynamicParams = new DynamicParameters(); |
| | | string search = ""; |
| | |
| | | } |
| | | sql = @"update TStep set stepname=@stepname,flwtype=@steptypecode,enable=@enable,descr=@description, |
| | | lm_user=@username,lm_date=@CreateDate where id=@stepid"; |
| | | list.Add(new { str = sql, parm = new {stepid = stepid, stepname = stepname, steptypecode = steptypecode, enable = enable, description = description, username = us.usercode, CreateDate = DateTime.Now.ToString() } }); |
| | | list.Add(new { str = sql, parm = new { stepid = stepid, stepname = stepname, steptypecode = steptypecode, enable = enable, description = description, username = us.usercode, CreateDate = DateTime.Now.ToString() } }); |
| | | bool aa = DapperHelper.DoTransaction(list); |
| | | if (aa) |
| | | { |
| | |
| | | Description = $"Panda.Sewerage : {version} ", |
| | | }); |
| | | }); |
| | | |
| | | |
| | | string basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); |
| | | string xmlPath = Path.Combine(basePath, "VueWebCoreApi.xml"); |
| | | c.IncludeXmlComments(xmlPath, true); |
| | |
| | | { |
| | | c.SwaggerEndpoint($"/swagger/{version}/swagger.json", $"{version}"); |
| | | }); |
| | | |
| | | |
| | | }); |
| | | #endregion |
| | | app.UseHttpsRedirection(); |
| | |
| | | //添加静态文件中间件 |
| | | app.UseDefaultFiles(); |
| | | //添加授权文件 |
| | | app.UseStaticFiles(new StaticFileOptions() |
| | | { |
| | | ContentTypeProvider = new FileExtensionContentTypeProvider() |
| | | { |
| | | Mappings = { [".xls"] = "application/vnd.ms-excel" } |
| | | } |
| | | app.UseStaticFiles(new StaticFileOptions() { |
| | | ContentTypeProvider = new FileExtensionContentTypeProvider() { |
| | | Mappings = { |
| | | [".xls"] = "application/vnd.ms-excel", |
| | | [".apk"] = "application/vnd.android.package-archive" |
| | | } |
| | | } |
| | | }); |
| | | app.UseStaticFiles(); |
| | | //跨域 |
| | |
| | | // Mappings = { [".exe"] = "application/octect-stream" } |
| | | // } |
| | | //}); |
| | | |
| | | |
| | | app.UseEndpoints(endpoints => |
| | | { |
| | | endpoints.MapControllers(); |
| | | endpoints.MapHub<ChatHub>("/ChatHub", options => |
| | | { |
| | | options.Transports = |
| | | HttpTransportType.WebSockets | |
| | | HttpTransportType.LongPolling; |
| | | options.Transports = |
| | | HttpTransportType.WebSockets | |
| | | HttpTransportType.LongPolling; |
| | | }); |
| | | }); |
| | | loggerFactory.AddLog4Net("Config/log4net.config"); |
| | |
| | | //new ScoreReport("7","库位设置"), |
| | | new ScoreReport("8","存货档案"), |
| | | new ScoreReport("9","设备清单"), |
| | | new ScoreReport("10","设备点检项目"), |
| | | new ScoreReport("10_1","设备点检标准"), |
| | | new ScoreReport("11","设备保养项目"), |
| | | new ScoreReport("11_1","设备保养标准"), |
| | | //new ScoreReport("10","设备点检项目"), |
| | | //new ScoreReport("10_1","设备点检标准"), |
| | | //new ScoreReport("11","设备保养项目"), |
| | | //new ScoreReport("11_1","设备保养标准"), |
| | | new ScoreReport("12","模具清单"), |
| | | new ScoreReport("13","模具点检项目"), |
| | | new ScoreReport("13_1","模具点检标准"), |
| | |
| | | //session失效时间 |
| | | "InProc": "240", |
| | | //Excel导出模板配置IP |
| | | "FileIP": "http://121.196.36.24:8025/", |
| | | "FileIP": "http://121.196.36.24:8021/", |
| | | //jwtkey |
| | | "SigningKey": "Hello World" |
| | | } |