Commit 2da17f65 by xin.yang

fix bug

parent b29d7b7f
......@@ -26,16 +26,18 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureMonitor _fixtureMonitor;
private readonly IProductRouteRepository _routeRepository;
private readonly IAutomationTaskListRepository _taskListRepository;
private readonly ISigerProjectProductRepository _productRepository;
public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IAutomationFixtureMonitor fixtureMonitor, IProductRouteRepository routeRepository,
IAutomationTaskListRepository taskListRepository)
IAutomationTaskListRepository taskListRepository, ISigerProjectProductRepository productRepository)
{
_unitOfWork = unitOfWork;
_sectionPropertyRepository = sectionPropertyRepository;
_levelSectionRepository = levelSectionRepository;
_fixtureMonitor = fixtureMonitor;
_routeRepository = routeRepository;
_productRepository = productRepository;
}
[HttpGet]
......@@ -66,11 +68,12 @@ namespace Siger.ApiACC.Controllers
public IActionResult GetMonitorSnProduct(int sectionid)
{
var res = new ResponseMonitorSnProduct();
var monitor = _fixtureMonitor.Get(q => q.section == sectionid);
var monitor = _fixtureMonitor.Get(q => q.section == sectionid);
if(monitor != null)
{
var product = _productRepository.Get(monitor.productId);
res.id = monitor.productId;
res.name = monitor.productName;
res.name = product?.name ?? "";
res.code = monitor.productCode;
res.sn = monitor.sn;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment