Commit 048d2734 by yiyu.li
parents e115b4d7 45001263
...@@ -345,10 +345,15 @@ namespace Siger.ApiACC.Controllers ...@@ -345,10 +345,15 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(CommonEnum.Fail); throw new BadRequestException(CommonEnum.Fail);
} }
/// <summary>
///
/// </summary>
/// <param name="fillsn">0:全部 1: 储位有SN</param>
/// <returns></returns>
[HttpGet] [HttpGet]
public IActionResult GetLocationList() public IActionResult GetLocationList(int fillsn=0)
{ {
return new ObjectResult(_autoLocationRepository.GetDataList(ProjectId).ToList()); return new ObjectResult(_autoLocationRepository.GetDataList(ProjectId, fillsn).ToList());
} }
} }
} }
...@@ -95,7 +95,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -95,7 +95,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
return _context.siger_wms_storage_location.Where(q => q.projectId == projectid && q.status == (int)RowState.Valid); return _context.siger_wms_storage_location.Where(q => q.projectId == projectid && q.status == (int)RowState.Valid);
} }
public IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid) public IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid,int hasMaterial)
{ {
var query = from q in _context.siger_automation_location var query = from q in _context.siger_automation_location
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
...@@ -119,7 +119,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -119,7 +119,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
materialsn = q.sn ?? "", materialsn = q.sn ?? "",
categoryid = c == null ? 0 : c.id categoryid = c == null ? 0 : c.id
}; };
var entities = query.AsNoTracking().ToList(); Expression<Func<ResponseAutomationLocationList, bool>> locationidExpression = f => true;
if (hasMaterial != 0)
{
locationidExpression = q =>!string.IsNullOrEmpty(q.materialsn);
}
var entities = query.Where(locationidExpression).AsNoTracking().ToList();
return entities; return entities;
} }
......
...@@ -14,7 +14,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface ...@@ -14,7 +14,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
siger_wms_storage_location GetLocation(int id, int projectid); siger_wms_storage_location GetLocation(int id, int projectid);
IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid); /// <summary>
/// 获取储位
/// </summary>
/// <param name="projectid">项目ID</param>
/// <param name="hasMaterial">只查有SN</param>
/// <returns></returns>
IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid, int hasMaterial);
IEnumerable<siger_wms_storage_location> GetLocationList(int projectid); IEnumerable<siger_wms_storage_location> GetLocationList(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