1.设置文件上传大小
2.工艺SOP查看接口
3.工单SOP查看接口
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工单SOP] |
| | | /// <summary> |
| | | /// MES工单查看工单SOP |
| | | /// </summary> |
| | | /// <param name="wocode">工单编号</param> |
| | | /// <param name="materielcode">产品编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderSopSearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderSopSearch(string wocode, string materielcode) |
| | | { |
| | | mes = WorkOrderBLL.MesOrderSopSearch(wocode, materielcode); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工艺SOP] |
| | | /// <summary> |
| | | /// MES工单查看工艺SOP |
| | | /// </summary> |
| | | /// <param name="materielcode">产品编码</param> |
| | | /// <param name="routecode">工艺路线编码</param> |
| | | /// <param name="stepcode">工序编码</param> |
| | | /// <returns></returns> |
| | | [Route(template: "MesOrderProcessSopSearch")] |
| | | [HttpGet] |
| | | public JsonResult MesOrderProcessSopSearch(string materielcode,string routecode,string stepcode) |
| | | { |
| | | var token = HttpContext.Request.Headers["Token"].ToString(); |
| | | User us = JwtTools.Denocode(token.ToString()); |
| | | mes = WorkOrderBLL.MesOrderProcessSopSearch(materielcode, routecode, stepcode,us); |
| | | return Json(mes); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[MES工单派发提交] |
| | | /// <summary> |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工单SOP] |
| | | public static ToMessage MesOrderSopSearch(string wocode, string materielcode) |
| | | { |
| | | return WorkOrderDAL.MesOrderSopSearch(wocode, materielcode); |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工艺SOP] |
| | | public static ToMessage MesOrderProcessSopSearch(string materielcode, string routecode, string stepcode, User us) |
| | | { |
| | | return WorkOrderDAL.MesOrderProcessSopSearch(materielcode, routecode, stepcode,us); |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[MES工单派发提交] |
| | | public static ToMessage MesOrderDistribution(string[] wocodelist, User us) |
| | |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工单SOP] |
| | | public static ToMessage MesOrderSopSearch(string wocode, string materielcode) |
| | | { |
| | | string sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | //获取SOP文件信息 |
| | | sql = @"select filename,filepath,version from TWrkOrderSop |
| | | where wo=@wocode and materielcode=@materielcode |
| | | order by version"; |
| | | dynamicParams.Add("@wocode", wocode); |
| | | dynamicParams.Add("@materielcode", materielcode); |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | if (data.Rows.Count > 0) |
| | | { |
| | | mes.code = "200"; |
| | | mes.message = "查询成功!"; |
| | | mes.data = data; |
| | | } |
| | | else |
| | | { |
| | | mes.code = "300"; |
| | | mes.message = "当前工单产品暂无SOP文件!"; |
| | | mes.data = null; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | #region[MES工单查看工艺SOP] |
| | | public static ToMessage MesOrderProcessSopSearch(string materielcode, string routecode, string stepcode, User us) |
| | | { |
| | | var sql = ""; |
| | | List<object> list = new List<object>(); |
| | | var dynamicParams = new DynamicParameters(); |
| | | try |
| | | { |
| | | dynamic dynObj = JObject.Parse(us.mesSetting); |
| | | bool route = dynObj.route; |
| | | if (route) //工艺路线版 |
| | | { |
| | | //获取SOP文件信息 |
| | | sql = @"select filename,filepath,version from TProcessSop |
| | | where materielcode=@materielcode and routecode=@routecode and stepcode=@stepcode |
| | | order by version"; |
| | | dynamicParams.Add("@materielcode", materielcode); |
| | | dynamicParams.Add("@routecode", routecode); |
| | | dynamicParams.Add("@stepcode", stepcode); |
| | | } |
| | | else |
| | | { |
| | | //获取SOP文件信息 |
| | | sql = @"select filename,filepath,version from TProcessSop |
| | | where materielcode=@materielcode and stepcode=@stepcode |
| | | order by version"; |
| | | dynamicParams.Add("@materielcode", materielcode); |
| | | dynamicParams.Add("@stepcode", stepcode); |
| | | } |
| | | |
| | | var data = DapperHelper.selectdata(sql, dynamicParams); |
| | | mes.code = "200"; |
| | | mes.count = data.Rows.Count; |
| | | mes.data = data; |
| | | mes.message = "查询成功!"; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | mes.code = "300"; |
| | | mes.count = 0; |
| | | mes.message = e.Message; |
| | | mes.data = null; |
| | | } |
| | | return mes; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | #region[MES工单派发提交] |
| | | public static ToMessage MesOrderDistribution(string[] wocodelist, User us) |
| | |
| | | Host.CreateDefaultBuilder(args) |
| | | .ConfigureWebHostDefaults(webBuilder => |
| | | { |
| | | //设置Kestrel文件上传大小 |
| | | webBuilder.ConfigureKestrel((context, options) => |
| | | { |
| | | // 获取或设置任何请求正文的最大允许大小(以字节为单位)。 设置为 null 时,最大请求正文大小不受限制 |
| | | // 默认为 30000000 字节 大约为 28.6MB |
| | | |
| | | options.Limits.MaxRequestBodySize = 1073741824; //限制1G |
| | | //options.Limits.MaxRequestBodySize = null; //表示不限制 |
| | | }); |
| | | webBuilder.UseStartup<Startup>(); |
| | | }); |
| | | } |
| | |
| | | using Microsoft.AspNetCore.Hosting; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Http.Connections; |
| | | using Microsoft.AspNetCore.Http.Features; |
| | | using Microsoft.AspNetCore.HttpsPolicy; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.AspNetCore.Mvc.Authorization; |
| | | using Microsoft.AspNetCore.Server.Kestrel.Core; |
| | | using Microsoft.AspNetCore.StaticFiles; |
| | | using Microsoft.Extensions.Configuration; |
| | | using Microsoft.Extensions.DependencyInjection; |
| | |
| | | string basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); |
| | | string xmlPath = Path.Combine(basePath, "VueWebCoreApi.xml"); |
| | | c.IncludeXmlComments(xmlPath, true); |
| | | |
| | | }); |
| | | #endregion |
| | | |
| | |
| | | //设置Cookies |
| | | services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie(); |
| | | |
| | | #region 允许大文件上传 |
| | | //允许上传大文件 |
| | | services.Configure<IISServerOptions>(options => |
| | | { |
| | | options.MaxRequestBodySize = 1073741824;//此处限制最大1G |
| | | }); |
| | | //解决文件上传Multipart body length limit 134217728 exceeded. |
| | | services.Configure<FormOptions>(x => |
| | | { |
| | | x.ValueLengthLimit = int.MaxValue; |
| | | x.MultipartBodyLengthLimit = 1073741824; //此处限制最大1G |
| | | }); |
| | | #endregion 允许大文件上传 |
| | | } |
| | | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. |
| | | public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime applicationLeftTime, ILoggerFactory loggerFactory) |
| | |
| | | //添加静态文件中间件 |
| | | app.UseDefaultFiles(); |
| | | //添加授权文件 |
| | | app.UseStaticFiles(new StaticFileOptions() { |
| | | ContentTypeProvider = new FileExtensionContentTypeProvider() { |
| | | app.UseStaticFiles(new StaticFileOptions() |
| | | { |
| | | ContentTypeProvider = new FileExtensionContentTypeProvider() |
| | | { |
| | | Mappings = { |
| | | [".xls"] = "application/vnd.ms-excel", |
| | | [".xls"] = "application/vnd.ms-excel", |
| | | [".apk"] = "application/vnd.android.package-archive" |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | app.UseStaticFiles(); |
| | | //跨域 |