Commit 82ace874 by xin.yang

some update

parent 3c53163a
......@@ -218,5 +218,11 @@ namespace Siger.ApiACC.Controllers
return new ObjectResult(CommonEnum.Succefull);
throw new BadRequestException(CommonEnum.Fail);
}
[HttpGet]
public IActionResult GetLocationList()
{
return new ObjectResult(_autoLocationRepository.GetDataList(ProjectId).ToList());
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using Microsoft.EntityFrameworkCore;
......@@ -78,5 +79,31 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
return _context.siger_wms_storage_location.FirstOrDefault(q => q.locationid == id && q.projectId == projectid && q.status == (int)RowState.Valid);
}
public IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid)
{
var query = from q in _context.siger_automation_location
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
join c in _context.siger_automation_fixture_tools_category on t.category equals c.guid
join l in _context.siger_wms_storage_location on q.locationid equals l.locationid
join w in _context.siger_wms_storage on l.storageid equals w.id
where q.projectId == projectid && q.status == (int)RowState.Valid
select new ResponseAutomationLocationList
{
id = q.id,
locationid = l.id,
location = l.realname,
locationcode = l.serial_number,
wavehouseid = w.id,
wavehouse = w.name,
wavehousecode = w.serial_number,
fixturetoolid = t.id,
code = t.code,
name = t.name,
materialsn = "TestData"
};
var entities = query.OrderByDescending(q => q.id).AsNoTracking().ToList();
return entities;
}
}
}
......@@ -2,6 +2,7 @@
using Siger.Middlelayer.AccRepository.Response;
using Siger.Middlelayer.Repository.Data.Acc;
using Siger.Middlelayer.Repository.Paged;
using System.Collections.Generic;
namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
......@@ -11,5 +12,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
siger_wms_storage_location GetLocation(int id, int projectid);
IEnumerable<ResponseAutomationLocationList> GetDataList(int projectid);
}
}
......@@ -53,4 +53,31 @@ namespace Siger.Middlelayer.AccRepository.Response
public int status { get; set; }
}
public class ResponseAutomationLocationList
{
public int id { get; set; }
/// <summary>
/// 储位位置
/// </summary>
public int locationid { get; set; }
/// <summary>
/// 储位
/// </summary>
public string location { get; set; }
public string locationcode { get; set; }
public int wavehouseid { get; set; }
/// <summary>
/// 仓库
/// </summary>
public string wavehouse { get; set; }
public string wavehousecode { get; set; }
/// <summary>
/// 工装ID
/// </summary>
public int fixturetoolid { get; set; }
public string code { get; set; }
public string name { get; set; }
public string materialsn { get; set; }
}
}
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