Commit 1a03f27e by xin.yang

fix bug

parent 3817cbfb
......@@ -41,7 +41,7 @@ namespace Siger.ApiACC.Controllers
[HttpGet]
public IActionResult GetPageList(string category, string code, string name, string state, int page, int pagesize, string toexcel = "")
{
var data = _toolsAssemblyRepository.GetPagedList(category.ToInt(), code, name,state.ToInt(), ProjectId, page, pagesize, toexcel);
var data = _toolsAssemblyRepository.GetPagedList(category.ToInt(), code, name, state, ProjectId, page, pagesize, toexcel);
var categorys = _toolsCategoryRepository.GetList(q => q.projectId == ProjectId && q.status == (int)RowState.Valid).ToList();
var list = new List<ResponseAumationFixtureToolsAssembly>();
foreach(var item in data.Data)
......
......@@ -24,7 +24,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context = context;
}
public IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, int state, int projectid, int page, int pagesize, string toexcel = "")
public IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, string state, int projectid, int page, int pagesize, string toexcel = "")
{
var query = from q in _context.siger_automation_fixture_tools_assembly
join t1 in _context.siger_automation_fixture_tools on q.parent equals t1.guid into tt1
......@@ -80,9 +80,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
nameExpression = q => q.name.Contains(name);
}
Expression<Func<ResponseAumationFixtureToolsAssembly, bool>> stateExpression = f => true;
if (state > 0)
if (!string.IsNullOrEmpty(state))
{
stateExpression = q => q.status == state;
stateExpression = q => q.status == state.ToInt();
}
var expression = categoryExpression.And(codeExpression).And(nameExpression).And(stateExpression);
if (toexcel.ToInt() == 1)
......
......@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public interface IAutomationFixtureToolsAssemblyRepository : IAccRepositoryBase<siger_automation_fixture_tools_assembly>
{
IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, int state, int projectid, int page, int pagesize, string toexcel = "");
IPagedCollectionResult<ResponseAumationFixtureToolsAssembly> GetPagedList(int category, string code, string name, string state, int projectid, int page, int pagesize, string toexcel = "");
IEnumerable<ResponseAumationFixtureToolsAssembly> GetDetailList(string parent, int projectid);
......
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