Commit 9f5b644a by xin.yang

fix bug

parent fec99e86
......@@ -23,7 +23,6 @@ namespace Siger.ApiACC.Controllers
private readonly IAutomationFixtureToolsCategoryRepository _toolsCategoryRepository;
private readonly IAutomationFixtureToolsRepository _toolsRepository;
private readonly IAutomationLocationRepository _autoLocationRepository;
private readonly ISigerTrMaterialsRepository _materialsRepository;
public AutomationLocationController(IUnitOfWork unitOfWork, IAutomationFixtureToolsCategoryRepository toolsCategoryRepository,
IAutomationFixtureToolsRepository toolsRepository, IAutomationLocationRepository autoLocationRepository)
......@@ -90,7 +89,7 @@ namespace Siger.ApiACC.Controllers
[HttpPost]
public IActionResult Update([FromBody]RequestUpdateAutomationLocation req)
{
if (string.IsNullOrEmpty(req.locationid) || string.IsNullOrEmpty(req.fixturetoolid) || string.IsNullOrEmpty(req.materialid))
if (string.IsNullOrEmpty(req.locationid) || string.IsNullOrEmpty(req.fixturetoolid))
{
throw new BadRequestException(RequestEnum.ParameterMiss);
}
......
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using Microsoft.AspNetCore.Mvc;
using Siger.ApiCommon.Result;
using Siger.Middlelayer.AccRepository.Entities;
using Siger.Middlelayer.AccRepository.Repositories.Interface;
using Siger.Middlelayer.AccRepository.Response;
using Siger.Middlelayer.AccRepository.Request;
using Siger.Middlelayer.Common;
using Siger.Middlelayer.Common.Extensions;
using Siger.Middlelayer.Repository.Repositories.Interface;
using Siger.Middlelayer.Repository;
using Siger.Middlelayer.Repository.Extensions;
using System.Linq;
using Siger.Middlelayer.Repository.Entities;
namespace Siger.ApiACC.Controllers
{
public class SectionPropertyController : BaseController
{
private readonly IUnitOfWork _unitOfWork;
private readonly IAutomationSectionPropertyRepository _sectionPropertyRepository;
private readonly ISigerProjectLevelSectionRepository _levelSectionRepository;
private readonly IProductionBeatSetRepository _beatSetRepository;
public SectionPropertyController(IUnitOfWork unitOfWork, IAutomationSectionPropertyRepository sectionPropertyRepository,
ISigerProjectLevelSectionRepository levelSectionRepository, IProductionBeatSetRepository beatSetRepository)
{
_unitOfWork = unitOfWork;
_sectionPropertyRepository = sectionPropertyRepository;
_levelSectionRepository = levelSectionRepository;
_beatSetRepository = beatSetRepository;
}
[HttpGet]
public IActionResult GetSections(string line)
{
var sectionIds = _levelSectionRepository.GetLevelSectionIds(line.ToInt(), ProjectId);
var sectionids = _sectionPropertyRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && sectionIds.Contains(q.sectionid)).
Select(q => q.sectionid).ToList();
var sections = _levelSectionRepository.GetList(q => q.projectid == ProjectId && q.status == (int)RowState.Valid && sectionids.Contains(q.id)).
Select(q => new { q.id, q.title }).ToList();
return new ObjectResult(sections);
}
public IActionResult GetRouteByProduct(string productid)
{
var list = _beatSetRepository.GetList(q => q.projectID == ProjectId && q.status == (int)RowState.Valid && q.product_name.ToInt() == productid.ToInt()).
Select(q => new
{
q.id,
q.route_name,
q.route_number
}).ToList();
return new ObjectResult(list);
}
}
}
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