Merge branch 'master' of https://gitee.com/cquni-wcs/wcs
# Conflicts: # WCS.BLL/Tool/Helper.cs # WCS.WebApi/Program.cs
This commit is contained in:
83
WCS.WebApi/Controllers/FileDownLoadController.cs
Normal file
83
WCS.WebApi/Controllers/FileDownLoadController.cs
Normal file
@ -0,0 +1,83 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.HPSF;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel;
|
||||
using WCS.Model.ApiModel.User;
|
||||
using WCS.Model.WebSocketModel;
|
||||
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件下载
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class FileDownLoadController : ControllerBase
|
||||
{
|
||||
|
||||
public FileDownLoadController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
[HttpGet("downloadApp")]
|
||||
public IActionResult downloadApp(string fileName)
|
||||
{
|
||||
// 这里是文件的物理路径,你需要根据实际情况提供
|
||||
var filePath = Path.Combine(Directory.GetCurrentDirectory(), $"Files/{fileName}");
|
||||
|
||||
// 检查文件是否存在
|
||||
if (!System.IO.File.Exists(filePath))
|
||||
{
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
// 获取文件流
|
||||
var stream = System.IO.File.OpenRead(filePath);
|
||||
// 设置HTTP响应头,使浏览器知道这是一个附件,应该下载而不是打开
|
||||
Response.Headers.Add("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
|
||||
// 返回文件流作为FileResult
|
||||
return File(stream, "application/octet-stream", fileName);
|
||||
}
|
||||
|
||||
[HttpGet("getLatestAppName")]
|
||||
public ResponseCommon<string> getLatestAppName()
|
||||
{
|
||||
string directoryPath = Path.Combine(AppContext.BaseDirectory, $"Files");
|
||||
|
||||
// 获取目录下的所有文件信息
|
||||
FileInfo[] files = Directory.GetFiles(directoryPath, "*.APK")
|
||||
.Select(file => new FileInfo(file))
|
||||
.ToArray();
|
||||
|
||||
if (files == null || files.Length == 0)
|
||||
{
|
||||
return new ResponseCommon<string>()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "服务器不存在App安装包"
|
||||
};
|
||||
}
|
||||
//获取最后修改的一个
|
||||
FileInfo lastModifiedFile = files.OrderByDescending(f => f.LastWriteTime).First();
|
||||
if (lastModifiedFile != null)
|
||||
{
|
||||
return new ResponseCommon<string>()
|
||||
{
|
||||
Code = 200,
|
||||
Data = lastModifiedFile.Name
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ResponseCommon<string>()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "服务器不存在App安装包"
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using SqlSugar;
|
||||
using WCS.BLL.DbModels;
|
||||
using WCS.BLL.HardWare;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.BLL.Services.Service;
|
||||
@ -18,10 +19,12 @@ namespace WCS.WebApi.Controllers
|
||||
public class HomeController : ControllerBase
|
||||
{
|
||||
public IHomerService _homerService { get; set; }
|
||||
public ISelfCheckService _selfCheckService { get; set; }
|
||||
|
||||
public HomeController(IHomerService homerService)
|
||||
public HomeController(IHomerService homerService, ISelfCheckService selfCheckService)
|
||||
{
|
||||
_homerService = homerService;
|
||||
_selfCheckService = selfCheckService;
|
||||
}
|
||||
|
||||
[Route("getShelfTypes")]
|
||||
@ -73,21 +76,104 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
Code = 200,
|
||||
Message = "success",
|
||||
Data = shelfs.Select(t => new Shelf
|
||||
Data = shelfs.Select(t => new ShelfModel
|
||||
{
|
||||
ShelfId = t.ShelfId,
|
||||
ShelfCode = t.ShelfCode,
|
||||
CurentMode = (int)t.CurrentMode,
|
||||
ModulesStr = t.ModulesStr,
|
||||
GroupName = t.GroupName
|
||||
GroupName = t.GroupName,
|
||||
OrderNumber = t.OrderNumber,
|
||||
}).ToList(),
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return null;
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "获取失败:" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[Route("shelfCheckAll")]
|
||||
[HttpPost(Name = "shelfCheckAll")]
|
||||
public async Task<ResponseBase> shelfCheckAll(GetShelfStatusRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _selfCheckService.StartSelfCheckByGroupName(request.GroupNames);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "操作失败:" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 重置货架的状态 使其回到待机模式
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("resetShelfStatus")]
|
||||
[HttpPost(Name = "resetShelfStatus")]
|
||||
public async Task<ResponseBase> resetShelfStatus(ResetShelfStatusRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (request.IsResetAll == false && (request.SelfIds == null || request.SelfIds.Count == 0))
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "复位失败:请选择需要复位的货架!",
|
||||
};
|
||||
}
|
||||
if (request.IsResetAll == true && (request.GroupNames == null || request.GroupNames.Count == 0))
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "复位失败:请选择需要复位的货架区域!",
|
||||
};
|
||||
}
|
||||
var shelfs = new List<IShelfBase>();
|
||||
if (request.IsResetAll == false)
|
||||
shelfs = ShelfManager.Shelves
|
||||
.Where(t => request.SelfIds.Contains(t.ShelfId))
|
||||
.Where(t => t.CurrentMode != Mode.待机模式)
|
||||
.ToList();
|
||||
else
|
||||
shelfs = ShelfManager.Shelves
|
||||
.Where(t => request.GroupNames.Contains(t.GroupName))
|
||||
.Where(t => t.CurrentMode != Mode.待机模式)
|
||||
.ToList();
|
||||
foreach (var shelf in shelfs)
|
||||
{
|
||||
shelf.Reset();
|
||||
}
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 200,
|
||||
Message = "success",
|
||||
};
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Mvc;
|
||||
using WCS.BLL.HardWare;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.BLL.Tool;
|
||||
using WCS.Model;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
@ -141,9 +142,12 @@ namespace WebApi.Controllers
|
||||
//TODO:<3A><><EFBFBD><EFBFBD> <20><><EFBFBD>ƻ<EFBFBD><C6BB><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD>
|
||||
try
|
||||
{
|
||||
var aa = Helper.Query();
|
||||
var bb = Helper.SetId();
|
||||
return await _instoreService.queryInstoreStatusSingle(request);
|
||||
//ShelfManager.
|
||||
//
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -86,5 +86,13 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
return await _matInventoryDetailService.getMatInventorySummary(request);
|
||||
}
|
||||
|
||||
[Route("compareMatInventoryDetail")]
|
||||
[HttpPost(Name = "compareMatInventoryDetail")]
|
||||
public async Task<ResponseBase> compareMatInventoryDetail(CompareMatInventoryDetailRequest request)
|
||||
{
|
||||
return await _matInventoryDetailService.compareMatInventoryDetail(request);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using MiniExcelLibs;
|
||||
using WCS.BLL.HardWare;
|
||||
using WCS.BLL.Manager;
|
||||
using WCS.BLL.Services.IService;
|
||||
using WCS.BLL.Services.Service;
|
||||
using WCS.Model;
|
||||
using WCS.Model.ApiModel.MatBaseInfo;
|
||||
using WCS.Model.ApiModel.OutStore;
|
||||
|
||||
namespace WebApi.Controllers
|
||||
@ -15,12 +17,54 @@ namespace WebApi.Controllers
|
||||
private readonly IOutstoreService _outstoreService;
|
||||
private readonly IGenerateService _generateService;
|
||||
|
||||
public OutstoreController(IOutstoreService outstoreService,IGenerateService generateService)
|
||||
public OutstoreController(IOutstoreService outstoreService, IGenerateService generateService)
|
||||
{
|
||||
_outstoreService = outstoreService;
|
||||
_generateService = generateService;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>У<EFBFBD><D0A3><EFBFBD>ͱȶ<CDB1>
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[Route("importMat")]
|
||||
[HttpPost(Name = "importMat")]
|
||||
public async Task<ResponseBase> importMat([FromForm] IFormFile excelFile, [FromForm] string userName, [FromForm] string deviceType)
|
||||
{
|
||||
try
|
||||
{
|
||||
//<2F>ļ<EFBFBD>У<EFBFBD><D0A3>
|
||||
if (excelFile == null || excelFile.Length == 0)
|
||||
{
|
||||
return new ResponseCommon()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "<22><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>:<3A>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD>ݣ<EFBFBD>"
|
||||
};
|
||||
}
|
||||
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD><D0B5><EFBFBD><EFBFBD><EFBFBD>
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
await excelFile.CopyToAsync(stream);
|
||||
stream.Position = 0;
|
||||
var list = MiniExcelLibs.MiniExcel.Query<OutImportMatModel>(stream, "<22><><EFBFBD><EFBFBD><E2B5BC>ģ<EFBFBD><C4A3>", ExcelType.XLSX).ToList();
|
||||
return await _outstoreService.importMat(list);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 201,
|
||||
Message = "<22><><EFBFBD><EFBFBD>ʧ<EFBFBD>ܣ<EFBFBD>" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD><CFB1><EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// </summary>
|
||||
@ -33,7 +77,7 @@ namespace WebApi.Controllers
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.OrderNumber))
|
||||
{
|
||||
{
|
||||
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
||||
}
|
||||
return await _outstoreService.SysOutOrderByMatCode(request);
|
||||
@ -62,7 +106,12 @@ namespace WebApi.Controllers
|
||||
{
|
||||
if (string.IsNullOrEmpty(request.OrderNumber))
|
||||
{
|
||||
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
||||
if (request.IsMXPD)
|
||||
{
|
||||
request.OrderNumber = await _generateService.generateMXPDOutOrderNumber();
|
||||
}
|
||||
else
|
||||
request.OrderNumber = await _generateService.generateOutOrderNumber();
|
||||
}
|
||||
return await _outstoreService.SysOutOrderByMatSn(request);
|
||||
}
|
||||
@ -146,6 +195,25 @@ namespace WebApi.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
[Route("getOutOrderDetailSingleLight")]
|
||||
[HttpPost(Name = "getOutOrderDetailSingleLight")]
|
||||
public async Task<ResponseBase> getOutOrderDetailSingleLight(GetOutOrderDetailRequest request)
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _outstoreService.GetOutOrderDetailSingleLight(request);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return new ResponseBase()
|
||||
{
|
||||
Code = 300,
|
||||
Message = "<22><>ѯʧ<D1AF>ܣ<EFBFBD>" + ex.Message,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <20><>ȡ<EFBFBD><C8A1><EFBFBD>ⵥ<EFBFBD><E2B5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϸ
|
||||
/// </summary>
|
||||
|
@ -72,28 +72,45 @@ namespace WCS.WebApi.Controllers
|
||||
|
||||
finally
|
||||
{
|
||||
var guid = Guid.NewGuid();
|
||||
//TO DO如何将记日志的 和不记日志的分开 解耦
|
||||
if (!context.Request.Path.ToString().Contains("getInterfaceRecord"))
|
||||
{
|
||||
try
|
||||
{
|
||||
Logs.Write($"[记录接口日志]{guid},开始记录{context.Request.Path.ToString()}", LogsType.Api);
|
||||
var logRecord = new SystemApiLogRecord()
|
||||
{
|
||||
DeviceIp = context?.Connection?.RemoteIpAddress?.ToString(),
|
||||
RequestUrl = context.Request.Path,
|
||||
RequestUrl = context.Request?.Path.ToString(),
|
||||
RequestBody = requestBody,
|
||||
QueryString = context.Request.QueryString.ToString(),
|
||||
QueryString = context.Request?.QueryString.ToString(),
|
||||
IsResponse = true,
|
||||
ResponseJson = responseBody,
|
||||
RequestTime = requestTime,
|
||||
ResponseTime = DateTime.Now,
|
||||
ExecutionTime = stopwatch.ElapsedMilliseconds
|
||||
};
|
||||
await DbHelp.dbLog.Insertable(logRecord).ExecuteCommandAsync();
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
DbHelp.dbLog.Insertable(logRecord).ExecuteCommand();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logs.Write($"[记录接口日志]{guid}保存数据失败!发生异常:" + ex.Message, LogsType.Api);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
//TO DO txt记录失败的日志和响应实体
|
||||
Logs.Write($"[记录接口日志]{guid}失败!发生异常:" + e.Message, LogsType.Api);
|
||||
}
|
||||
}
|
||||
else
|
||||
Logs.Write($"[记录接口日志]{guid},不记录getInterfaceRecord", LogsType.Api);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,20 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
return await _storeInfoService.GetModules(request);
|
||||
}
|
||||
|
||||
[Route("disableOrEnableModule")]
|
||||
[HttpPost(Name = "disableOrEnableModule")]
|
||||
public async Task<ResponseBase> disableOrEnableModule(DisableOrEnableModuleRequest request)
|
||||
{
|
||||
return await _storeInfoService.disableOrEnableModule(request);
|
||||
}
|
||||
|
||||
[Route("queryModuleVoltage")]
|
||||
[HttpPost(Name = "queryModuleVoltage")]
|
||||
public async Task<ResponseBase> queryModuleVoltage(QueryModuleVoltageRequest request)
|
||||
{
|
||||
return await _storeInfoService.queryModuleVoltage(request);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 库位管理
|
||||
@ -61,6 +75,13 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
return await _storeInfoService.GetStores(request);
|
||||
}
|
||||
|
||||
[Route("disableOrEnableStore")]
|
||||
[HttpPost(Name = "disableOrEnableStore")]
|
||||
public async Task<ResponseBase> disableOrEnableStore(DisableOrEnableStoreRequest request)
|
||||
{
|
||||
return await _storeInfoService.disableOrEnableStore(request);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,8 @@ namespace WCS.WebApi.Controllers
|
||||
[HttpPost(Name = "userLogin")]
|
||||
public async Task<ResponseBase> userLogin(UserLoginRequest request)
|
||||
{
|
||||
//获取调用设备的Ip地址
|
||||
request.WebSocketIpAddress = HttpContext?.Connection?.RemoteIpAddress?.ToString();
|
||||
return await _userService.UserLogin(request);
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,6 @@ using WCS.Model.WebSocketModel;
|
||||
|
||||
namespace WCS.WebApi.Controllers
|
||||
{
|
||||
/// <summary>
|
||||
/// 权限/用户界面的接口
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class WarningController : ControllerBase
|
||||
@ -27,5 +24,7 @@ namespace WCS.WebApi.Controllers
|
||||
{
|
||||
return await _warningService.SolveWarning(request);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +0,0 @@
|
||||
using WCS.BLL;
|
||||
|
||||
namespace WCS.WebApi
|
||||
{
|
||||
public static class LocalStatic
|
||||
{
|
||||
|
||||
}
|
||||
}
|
@ -20,57 +20,80 @@ namespace WebApi
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
WebSoceketManager.InitWebSocket();
|
||||
|
||||
DbInit.InitDb();
|
||||
|
||||
LocalFile.SaveConfig();
|
||||
|
||||
TCPClientManager.InitTcpClient();
|
||||
|
||||
ShelfManager.InitShelves();
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ƺͰ<C6BA><CDB0><EFBFBD>
|
||||
//TCPClientManager.InitStatus();
|
||||
|
||||
WarningManager.StartWarningMessageThread();
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.AddScoped<IInstoreService, InstoreService>();
|
||||
builder.Services.AddScoped<IOutstoreService, OutstoreService>();
|
||||
builder.Services.AddScoped<IHomerService, HomerService>();
|
||||
builder.Services.AddScoped<IUserService, UserService>();
|
||||
builder.Services.AddScoped<IInterfaceRecordService, InterfaceRecordService>();
|
||||
builder.Services.AddScoped<IMatBaseInfoService, MatBaseInfoService>();
|
||||
builder.Services.AddScoped<IMatInventoryDetailService, MatInventoryDetailService>();
|
||||
builder.Services.AddScoped<IStoreInfoService, StoreInfoService>();
|
||||
builder.Services.AddScoped<IStockTakingService, StockTakingService>();
|
||||
builder.Services.AddScoped<ISelfCheckService, SelfCheckService>();
|
||||
builder.Services.AddScoped<IWarningService, WarningService>();
|
||||
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EBA1A2><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ģʽ
|
||||
builder.Services.AddSingleton<IGenerateService, GenerateService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseMiddleware<RequestResponseLoggingMiddleware>();
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
=======
|
||||
try
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
//<2F><>ʼ<EFBFBD><CABC>websocket
|
||||
WebSoceketManager.InitWebSocket();
|
||||
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
app.Run("http://+:8888");
|
||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
||||
DbInit.InitDb();
|
||||
>>>>>>> 7f35077c07959e9571515ee1a1f88123f9e20bd5
|
||||
|
||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
||||
LocalFile.SaveConfig();
|
||||
|
||||
//<2F><>ʼ<EFBFBD><CABC>TCP<43><50><EFBFBD><EFBFBD>
|
||||
TCPClientManager.InitTcpClient();
|
||||
|
||||
//<2F><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD>ܻ<EFBFBD><DCBB><EFBFBD><EFBFBD><EFBFBD>Ϣ
|
||||
ShelfManager.InitShelves();
|
||||
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>ط<EFBFBD><D8B7>߳<EFBFBD>
|
||||
WarningManager.StartWarningMessageThread();
|
||||
|
||||
//<2F><>Ѷ<EFBFBD><D1B6>˾<EFBFBD><CBBE>̨<EFBFBD>߳<EFBFBD>
|
||||
if (LocalFile.Config.IsMx)
|
||||
{
|
||||
MXBackgroundThread.InitBackgroundThread();
|
||||
var str = string.Empty;
|
||||
MXBackgroundThread.SendDingDingMsg("<22><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>", new List<string> { "104379" }, ref str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
// Add services to the container.
|
||||
builder.Services.AddControllers();
|
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
builder.Services.AddSwaggerGen();
|
||||
|
||||
builder.Services.AddScoped<IInstoreService, InstoreService>();
|
||||
builder.Services.AddScoped<IOutstoreService, OutstoreService>();
|
||||
builder.Services.AddScoped<IHomerService, HomerService>();
|
||||
builder.Services.AddScoped<IUserService, UserService>();
|
||||
builder.Services.AddScoped<IInterfaceRecordService, InterfaceRecordService>();
|
||||
builder.Services.AddScoped<IMatBaseInfoService, MatBaseInfoService>();
|
||||
builder.Services.AddScoped<IMatInventoryDetailService, MatInventoryDetailService>();
|
||||
builder.Services.AddScoped<IStoreInfoService, StoreInfoService>();
|
||||
builder.Services.AddScoped<IStockTakingService, StockTakingService>();
|
||||
builder.Services.AddScoped<ISelfCheckService, SelfCheckService>();
|
||||
builder.Services.AddScoped<IWarningService, WarningService>();
|
||||
builder.Services.AddScoped<IInOutRecordService, InOutRecordService>();
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롢<EFBFBD><EBA1A2><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ģʽ
|
||||
builder.Services.AddSingleton<IGenerateService, GenerateService>();
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
app.UseMiddleware<RequestResponseLoggingMiddleware>();
|
||||
// Configure the HTTP request pipeline.
|
||||
if (app.Environment.IsDevelopment())
|
||||
{
|
||||
app.UseSwagger();
|
||||
app.UseSwaggerUI();
|
||||
}
|
||||
|
||||
app.UseAuthorization();
|
||||
app.MapControllers();
|
||||
app.Run("http://0.0.0.0:8888");//0.0.0.0<EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ipv4
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
-->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||
<DeleteExistingFiles>true</DeleteExistingFiles>
|
||||
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
|
||||
@ -13,5 +13,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||
<PublishUrl>bin\Release\net6.0\publish\</PublishUrl>
|
||||
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||
<_TargetId>Folder</_TargetId>
|
||||
<SiteUrlToLaunchAfterPublish />
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
<ProjectGuid>118d453b-1693-4c00-8378-20ecbfcf2700</ProjectGuid>
|
||||
<SelfContained>false</SelfContained>
|
||||
<PublishSingleFile>false</PublishSingleFile>
|
||||
</PropertyGroup>
|
||||
</Project>
|
@ -18,4 +18,14 @@
|
||||
<ProjectReference Include="..\WCS.Model\WCS.Model.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Files\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Files\APP.app">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
Reference in New Issue
Block a user