Qc 之前
This commit is contained in:
parent
ac20efae2f
commit
f4f612a39e
@ -12,6 +12,7 @@ using DOAN.Common.DynamicApiSimple.Extens;
|
||||
using DOAN.Infrastructure.WebExtensions;
|
||||
using DOAN.ServiceCore.Signalr;
|
||||
using DOAN.ServiceCore.SqlSugar;
|
||||
using Microsoft.Extensions.FileProviders;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
// NLog: Setup NLog for Dependency injection
|
||||
@ -134,6 +135,19 @@ app.Use((context, next) =>
|
||||
return next();
|
||||
});
|
||||
//开启访问静态文件/wwwroot目录文件,要放在UseRouting前面
|
||||
|
||||
var fileProvider = new PhysicalFileProvider(InternalApp.Configuration.GetSection("Upload").GetSection("rootDirectory").Get<string>());
|
||||
var requestPath = "/device";
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = fileProvider,
|
||||
RequestPath = requestPath
|
||||
});
|
||||
app.UseStaticFiles(new StaticFileOptions
|
||||
{
|
||||
FileProvider = fileProvider
|
||||
});
|
||||
|
||||
app.UseStaticFiles();
|
||||
//开启路由访问
|
||||
app.UseRouting();
|
||||
@ -165,5 +179,14 @@ app.MapControllerRoute(
|
||||
name: "default",
|
||||
pattern: "{controller=Home}/{action=Index}/{id?}");
|
||||
|
||||
|
||||
|
||||
app.MapControllers();
|
||||
|
||||
|
||||
app.UseDirectoryBrowser(new DirectoryBrowserOptions
|
||||
{
|
||||
FileProvider = fileProvider,
|
||||
RequestPath = requestPath
|
||||
});
|
||||
app.Run();
|
||||
@ -3,7 +3,7 @@
|
||||
{
|
||||
// 远程测试服务器
|
||||
"Conn": "Data Source=139.224.232.211;User ID=root;Password=doantech123;Initial Catalog=bzfm_mes;Port=3308",
|
||||
// "Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||
// "Conn": "Data Source=192.168.0.58;User ID=root;Password=123456;Initial Catalog=bzfm_mes;Port=3306",
|
||||
"DbType": 0, //数据库类型 MySql = 0, SqlServer = 1, Oracle = 3,PgSql = 4
|
||||
"ConfigId": "0", //多租户唯一标识
|
||||
"IsAutoCloseConnection": true
|
||||
@ -19,6 +19,15 @@
|
||||
"DbName": "bzfm_mes" //代码生成默认连接数据库,Oracle库是实例的名称
|
||||
},
|
||||
"ShowDbLog": true, //是否打印db日志
|
||||
"urls": "http://localhost:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"corsUrls": [ "http://localhost:8887", "http://localhost:8886", "http://localhost:9090", "http://localhost:8080" ] //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||
"urls": "http://0.0.0.0:8888", //项目启动url,如果改动端口前端对应devServer也需要进行修改
|
||||
"corsUrls": [ "http://localhost:8887", "http://localhost:8886", "http://localhost:9090", "http://localhost:8080" ], //跨域地址(前端启动项目,前后端分离单独部署需要设置),多个用","隔开
|
||||
"Upload": {
|
||||
"rootDirectory": "D:/MES/file",
|
||||
"uploadUrl": "http://172.18.32.1:8888", //本地存储资源访问路径
|
||||
"localSavePath": "", //本地上传默认文件存储目录 wwwroot
|
||||
"maxSize": 30, //上传文件大小限制 15M
|
||||
"notAllowedExt": [ ".bat", ".exe", ".jar", ".js" ],
|
||||
"requestLimitSize": 100 //请求body大小限制
|
||||
}
|
||||
|
||||
}
|
||||
@ -24,13 +24,7 @@
|
||||
"SingleLogin": false, //是否允许多设备/浏览器登录
|
||||
"workId": 1, //雪花id唯一数字
|
||||
"sqlExecutionTime": 5, //Sql执行时间超过多少秒记录日志并警报
|
||||
"Upload": {
|
||||
"uploadUrl": "http://127.0.0.1:8888", //本地存储资源访问路径
|
||||
"localSavePath": "", //本地上传默认文件存储目录 wwwroot
|
||||
"maxSize": 30, //上传文件大小限制 15M
|
||||
"notAllowedExt": [ ".bat", ".exe", ".jar", ".js" ],
|
||||
"requestLimitSize": 100 //请求body大小限制
|
||||
},
|
||||
|
||||
//阿里云存储配置
|
||||
"ALIYUN_OSS": {
|
||||
"REGIONID": "", //eg:cn-hangzhou
|
||||
|
||||
@ -27,7 +27,7 @@ namespace DOAN.Model.MES.base_.Dto
|
||||
/// </summary>
|
||||
public class BaseDeviceDto
|
||||
{
|
||||
[Required(ErrorMessage = "主键不能为空")]
|
||||
// [Required(ErrorMessage = "主键不能为空")]
|
||||
public int Id { get; set; }
|
||||
|
||||
public int? FkWorkStation { get; set; }
|
||||
|
||||
@ -16,7 +16,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public class DeviceFormConfigDto
|
||||
{
|
||||
[Required(ErrorMessage = "id 雪花不能为空")]
|
||||
//[Required(ErrorMessage = "id 雪花不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public int FkDeviceInspectId { get; set; }
|
||||
|
||||
@ -46,7 +46,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public class DeviceInspectDto
|
||||
{
|
||||
[Required(ErrorMessage = "id不能为空")]
|
||||
// [Required(ErrorMessage = "id不能为空")]
|
||||
public int Id { get; set; }
|
||||
public string Image { get; set; }
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public class DeviceMaintenanceRecordDto
|
||||
{
|
||||
[Required(ErrorMessage = "id不能为空")]
|
||||
// [Required(ErrorMessage = "id不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string FkRepairId { get; set; }
|
||||
|
||||
@ -19,7 +19,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public class DevicePointInspectionPlanDto
|
||||
{
|
||||
[Required(ErrorMessage = "id不能为空")]
|
||||
// [Required(ErrorMessage = "id不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
@ -41,7 +41,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public class DeviceRepairDto
|
||||
{
|
||||
[Required(ErrorMessage = "雪花id不能为空")]
|
||||
// [Required(ErrorMessage = "雪花id不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string RepairOrder { get; set; }
|
||||
|
||||
@ -20,7 +20,7 @@ namespace DOAN.Model.MES.dev.Dto
|
||||
/// </summary>
|
||||
public class DeviceRouteInspectionPlanDto
|
||||
{
|
||||
[Required(ErrorMessage = "id不能为空")]
|
||||
// [Required(ErrorMessage = "id不能为空")]
|
||||
public string Id { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
@ -48,5 +48,41 @@ public class PrintHelper
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 打印二维码
|
||||
/// </summary>
|
||||
/// <param name="message"></param>
|
||||
/// <param name="width"></param>
|
||||
/// <param name="height"></param>
|
||||
/// <returns></returns>
|
||||
public static byte[] CreateQcCode(string message, int width, int height)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(message))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var w = new ZXing.OneD.Code128Writer();
|
||||
BitMatrix b = w.encode(message, BarcodeFormat.QR_CODE, width, height);
|
||||
var zzb = new ZXing.ZKWeb.BarcodeWriter();
|
||||
zzb.Options = new EncodingOptions()
|
||||
{
|
||||
Margin = 0,
|
||||
PureBarcode = false
|
||||
};
|
||||
|
||||
Bitmap b2 = zzb.Write(b);
|
||||
|
||||
|
||||
using (var ms = new System.IO.MemoryStream())
|
||||
{
|
||||
b2.Save(ms, ImageFormat.Png);
|
||||
var bytes = ms.ToArray();
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user