Commit f565d820 by zxw

解决冲突

parents fd3d9732 f36b2dd1
...@@ -9,8 +9,6 @@ using Microsoft.AspNetCore.Mvc.Filters; ...@@ -9,8 +9,6 @@ using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nacos;
using Nacos.AspNetCore;
using Nancy.Json; using Nancy.Json;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
...@@ -30,8 +28,6 @@ namespace JunmpPoliceStation.App_Start ...@@ -30,8 +28,6 @@ namespace JunmpPoliceStation.App_Start
public class AuthLoginAttribute : ActionFilterAttribute public class AuthLoginAttribute : ActionFilterAttribute
{ {
private readonly INacosServerManager _serverManager;
private readonly INacosNamingClient _serverNamingClient;
private readonly IHttpClientFactory _clientFactory; private readonly IHttpClientFactory _clientFactory;
public IConfiguration Configuration { get; } public IConfiguration Configuration { get; }
private ILogger<PrintController> _logger; private ILogger<PrintController> _logger;
...@@ -40,22 +36,14 @@ namespace JunmpPoliceStation.App_Start ...@@ -40,22 +36,14 @@ namespace JunmpPoliceStation.App_Start
string urlGetSecretKey = string.Empty;//获取seckey的路由 string urlGetSecretKey = string.Empty;//获取seckey的路由
string urlCheckApp = string.Empty;//获取审核的路由 string urlCheckApp = string.Empty;//获取审核的路由
public AuthLoginAttribute(IConfiguration configuration, ApiConfig apicfg, INacosServerManager _serverManager, INacosNamingClient _serverNamingClient, IHttpClientFactory _clientFactory, Boolean AuthFlg = true) public AuthLoginAttribute(IConfiguration configuration, ApiConfig apicfg, IHttpClientFactory _clientFactory, Boolean AuthFlg = true)
{ {
flg = AuthFlg; flg = AuthFlg;
this.apicfg = apicfg; this.apicfg = apicfg;
this._serverManager = _serverManager;
this._serverNamingClient = _serverNamingClient;
this._clientFactory = _clientFactory; this._clientFactory = _clientFactory;
this.Configuration = configuration; this.Configuration = configuration;
_serverNamingClient.RegisterInstanceAsync(new RegisterInstanceRequest
{
ServiceName = apicfg.serviceName,
Ip = apicfg.serviceIp,
Port = Convert.ToInt32(apicfg.servicePort)
});
var url = "http://" + apicfg.serviceIp + ":" + apicfg.servicePort; var url = "http://" + apicfg.serviceIp + ":" + apicfg.servicePort;
var baseUrl = _serverManager.GetServerAsync(apicfg.serviceName);
urlGetSecretKey = $"{url}/api/yewu/Auth/GetSecretKey"; urlGetSecretKey = $"{url}/api/yewu/Auth/GetSecretKey";
urlCheckApp = $"{url}/api/yewu/Auth/JpVerification"; urlCheckApp = $"{url}/api/yewu/Auth/JpVerification";
} }
......
...@@ -14,7 +14,6 @@ using Microsoft.AspNetCore.Http; ...@@ -14,7 +14,6 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nacos;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using static JmpModel.Model.Enumerates.BorrowEnum; using static JmpModel.Model.Enumerates.BorrowEnum;
using static JmpModel.Model.Enumerates.EquipmentHistroyEnum; using static JmpModel.Model.Enumerates.EquipmentHistroyEnum;
...@@ -26,12 +25,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -26,12 +25,10 @@ namespace JunmpPoliceStation.Controllers
///借用领用模块 ///借用领用模块
public class BorrowController : ControllerBase public class BorrowController : ControllerBase
{ {
private readonly INacosConfigClient _configClient;
private ILogger<BorrowController> _logger; private ILogger<BorrowController> _logger;
UnitOfWork _unitOfWork; UnitOfWork _unitOfWork;
public BorrowController(ILogger<BorrowController> logger, UnitOfWork unitOfWork, INacosConfigClient configClient) public BorrowController(ILogger<BorrowController> logger, UnitOfWork unitOfWork)
{ {
_configClient = configClient;
_logger = logger; _logger = logger;
//_CabinetRepository = CabinetRepository; //_CabinetRepository = CabinetRepository;
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
......
...@@ -12,8 +12,6 @@ using Microsoft.AspNetCore.Http.Features; ...@@ -12,8 +12,6 @@ using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nacos;
using Nacos.AspNetCore;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
...@@ -41,21 +39,17 @@ namespace JunmpPoliceStation.Controllers ...@@ -41,21 +39,17 @@ namespace JunmpPoliceStation.Controllers
[Route("api/[controller]")] [Route("api/[controller]")]
public class ChannelCfgController : ControllerBase public class ChannelCfgController : ControllerBase
{ {
private HttpHelper _httpHelper;
private IWebHostEnvironment _hostingEnvironment; private IWebHostEnvironment _hostingEnvironment;
private readonly INacosServerManager _serverManager;
private readonly INacosNamingClient _serverManager2;
private readonly IHttpClientFactory _clientFactory; private readonly IHttpClientFactory _clientFactory;
private ILogger<ChannelCfgController> _logger; private ILogger<ChannelCfgController> _logger;
private UnitOfWork _unitOfWork; private UnitOfWork _unitOfWork;
protected MQTTServer mqttServer; protected MQTTServer mqttServer;
private HttpHelper _httpHelper; private HttpHelper _httpHelper;
public ChannelCfgController(ILogger<ChannelCfgController> logger, INacosNamingClient serverManager2, INacosServerManager serverManager, IHttpClientFactory clientFactory, UnitOfWork unitOfWork, IWebHostEnvironment _hostingEnvironment, MQTTServer mqttServer, HttpHelper httpHelper) public ChannelCfgController(ILogger<ChannelCfgController> logger, IHttpClientFactory clientFactory, UnitOfWork unitOfWork, IWebHostEnvironment _hostingEnvironment, MQTTServer mqttServer, HttpHelper httpHelper)
{ {
_httpHelper = httpHelper; _httpHelper = httpHelper;
_clientFactory = clientFactory;
_serverManager2 = serverManager2;
_serverManager = serverManager;
this._logger = logger; this._logger = logger;
this._hostingEnvironment = _hostingEnvironment; this._hostingEnvironment = _hostingEnvironment;
this._unitOfWork = unitOfWork; this._unitOfWork = unitOfWork;
......
...@@ -9,8 +9,6 @@ using JunmpPoliceStation.Models.Repository; ...@@ -9,8 +9,6 @@ using JunmpPoliceStation.Models.Repository;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nacos;
using Nacos.AspNetCore;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
...@@ -29,15 +27,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -29,15 +27,10 @@ namespace JunmpPoliceStation.Controllers
{ {
//private ICabinetRepository _CabinetRepository; //private ICabinetRepository _CabinetRepository;
private ILogger<PuchaseOrderController> _logger; private ILogger<PuchaseOrderController> _logger;
//private readonly INacosServerManager _serverManager;
//private readonly INacosNamingClient _serverManager;
//private readonly IHttpClientFactory _clientFactory; //private readonly IHttpClientFactory _clientFactory;
UnitOfWork _unitOfWork; UnitOfWork _unitOfWork;
public InventoryTableController(ILogger<PuchaseOrderController> logger, UnitOfWork unitOfWork) public InventoryTableController(ILogger<PuchaseOrderController> logger, UnitOfWork unitOfWork)
{ {
//, INacosServerManager serverManager, IHttpClientFactory clientFactory
//_serverManager = serverManager;
//_clientFactory = clientFactory;
_logger = logger; _logger = logger;
//_CabinetRepository = CabinetRepository; //_CabinetRepository = CabinetRepository;
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
......
...@@ -5,7 +5,6 @@ using JmpModel.Model.Repository; ...@@ -5,7 +5,6 @@ using JmpModel.Model.Repository;
using JunmpPoliceStation.Models.Repository; using JunmpPoliceStation.Models.Repository;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nacos;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -22,13 +21,11 @@ namespace JunmpPoliceStation.Controllers ...@@ -22,13 +21,11 @@ namespace JunmpPoliceStation.Controllers
[ApiController] [ApiController]
public class MissionController : Controller public class MissionController : Controller
{ {
private readonly INacosConfigClient _configClient;
private ILogger<BorrowController> _logger; private ILogger<BorrowController> _logger;
private readonly object _createEpcLockObj = new object(); private readonly object _createEpcLockObj = new object();
UnitOfWork _unitOfWork; UnitOfWork _unitOfWork;
public MissionController(ILogger<BorrowController> logger, UnitOfWork unitOfWork, INacosConfigClient configClient) public MissionController(ILogger<BorrowController> logger, UnitOfWork unitOfWork)
{ {
_configClient = configClient;
_logger = logger; _logger = logger;
//_CabinetRepository = CabinetRepository; //_CabinetRepository = CabinetRepository;
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
......
...@@ -285,10 +285,11 @@ namespace JunmpPoliceStation.Controllers ...@@ -285,10 +285,11 @@ namespace JunmpPoliceStation.Controllers
var scrapList = _unitOfWork.ScrapViewRepository.GetPage(expression, "WarrantyTime", 0, 999999); var scrapList = _unitOfWork.ScrapViewRepository.GetPage(expression, "WarrantyTime", 0, 999999);
var data = scrapList.content var data = scrapList.content
.GroupBy(x => new { x.WarehouseName, x.EquName, x.SizeName }) .GroupBy(x => new { x.WarehouseName, x.WarehouseId, x.EquName, x.SizeName })
.Select(s => new .Select(s => new
{ {
warehouseName = s.Key.WarehouseName, warehouseName = s.Key.WarehouseName,
warehouseId = s.Key.WarehouseId,
equName = s.Key.EquName, equName = s.Key.EquName,
sizeName = s.Key.SizeName, sizeName = s.Key.SizeName,
count = s.Count(), count = s.Count(),
......
...@@ -3820,6 +3820,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -3820,6 +3820,10 @@ namespace JunmpPoliceStation.Controllers
if (!(!bRepair || repairCycle <= 0)) if (!(!bRepair || repairCycle <= 0))
{ {
if (repairCycle > 999)
{
return JsonManager.SimpleCustResponse($"维保周期不能大于999");
}
updateObject.RepairCycle = repairCycle;//装维保周期 updateObject.RepairCycle = repairCycle;//装维保周期
} }
if (!(!bPrice || price <= 0)) if (!(!bPrice || price <= 0))
...@@ -3828,6 +3832,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -3828,6 +3832,10 @@ namespace JunmpPoliceStation.Controllers
} }
if (!(!bWarranty || warrantyCycle < 0)) if (!(!bWarranty || warrantyCycle < 0))
{ {
if (warrantyCycle>999)
{
return JsonManager.SimpleCustResponse($"质保周期不能大于999");
}
updateObject.WarrantyCycle = warrantyCycle; //质保周期 updateObject.WarrantyCycle = warrantyCycle; //质保周期
} }
if (!(!bUse || useTime == default)) if (!(!bUse || useTime == default))
......
...@@ -9,8 +9,6 @@ using JunmpPoliceStation.Models.Repository; ...@@ -9,8 +9,6 @@ using JunmpPoliceStation.Models.Repository;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Nacos;
using Nacos.AspNetCore;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
...@@ -29,15 +27,10 @@ namespace JunmpPoliceStation.Controllers ...@@ -29,15 +27,10 @@ namespace JunmpPoliceStation.Controllers
{ {
//private ICabinetRepository _CabinetRepository; //private ICabinetRepository _CabinetRepository;
private ILogger<PuchaseOrderController> _logger; private ILogger<PuchaseOrderController> _logger;
//private readonly INacosServerManager _serverManager;
//private readonly INacosNamingClient _serverManager;
//private readonly IHttpClientFactory _clientFactory; //private readonly IHttpClientFactory _clientFactory;
UnitOfWork _unitOfWork; UnitOfWork _unitOfWork;
public PuchaseOrderController(ILogger<PuchaseOrderController> logger, UnitOfWork unitOfWork) public PuchaseOrderController(ILogger<PuchaseOrderController> logger, UnitOfWork unitOfWork)
{ {
//, INacosServerManager serverManager, IHttpClientFactory clientFactory
//_serverManager = serverManager;
//_clientFactory = clientFactory;
_logger = logger; _logger = logger;
//_CabinetRepository = CabinetRepository; //_CabinetRepository = CabinetRepository;
_unitOfWork = unitOfWork; _unitOfWork = unitOfWork;
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
<ItemGroup> <ItemGroup>
<Compile Remove="Controllers\WebSocketController.cs" /> <Compile Remove="Controllers\WebSocketController.cs" />
<Compile Remove="ListenConfigurationBgTask.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
......
...@@ -111,9 +111,9 @@ namespace JunmpPoliceStation ...@@ -111,9 +111,9 @@ namespace JunmpPoliceStation
}); });
services.AddControllers(); services.AddControllers();
services.AddNacosNaming(Configuration) // services.AddNacosNaming(Configuration)
.AddNacosConfig(Configuration) //.AddNacosConfig(Configuration)
.AddNacosAspNetCore(Configuration); //.AddNacosAspNetCore(Configuration);
//启动MQTT //启动MQTT
services.AddSingleton<MQTTServer>(); services.AddSingleton<MQTTServer>();
...@@ -132,7 +132,7 @@ namespace JunmpPoliceStation ...@@ -132,7 +132,7 @@ namespace JunmpPoliceStation
public static IServiceProvider Instance { get; set; } public static IServiceProvider Instance { get; set; }
} }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, INacosNamingClient _namingClient, MQTTServer mqttServer) public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, MQTTServer mqttServer)
{ {
ServiceLocator.Instance = app.ApplicationServices; ServiceLocator.Instance = app.ApplicationServices;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论