Commit 1073396e by xin.yang

fix bug

parent c5c2e4f3
...@@ -349,9 +349,11 @@ namespace Siger.ApiWMS.Controllers ...@@ -349,9 +349,11 @@ namespace Siger.ApiWMS.Controllers
private List<ResponseLocationList> SearchLocation(int page, int pageSize, out int totalCount, bool paged = true, int id = 0, int isWavehouse = 0) private List<ResponseLocationList> SearchLocation(int page, int pageSize, out int totalCount, bool paged = true, int id = 0, int isWavehouse = 0)
{ {
var locationData = new List<siger_wms_storage_location>(); var locationData = new List<siger_wms_storage_location>();
var parentid = locationtype.GetList(f => f.status == (int)RowState.Valid && f.projectid == ProjectId).Select(f => f.parentid).ToList(); var locationType = locationtype.GetList(f => f.status == (int)RowState.Valid && f.projectid == ProjectId).ToList();
var parentid = locationType.Select(f => f.parentid).ToList();
var typeids = locationtype.GetList(f => f.status == (int)RowState.Valid && !parentid.Contains(f.id) && f.projectid == ProjectId).Select(f => f.id).ToList(); var typeids = locationtype.GetList(f => f.status == (int)RowState.Valid && !parentid.Contains(f.id) && f.projectid == ProjectId).Select(f => f.id).ToList();
var sonLocationTyps = GetSonTypes(0, locationType);
var LastTypeId = sonLocationTyps.Any() ? sonLocationTyps.LastOrDefault()?.id ?? 0 : 0;
var locationAllData = location.GetList(f => f.status == (int)RowState.Valid && f.projectid == ProjectId); var locationAllData = location.GetList(f => f.status == (int)RowState.Valid && f.projectid == ProjectId);
...@@ -416,18 +418,29 @@ namespace Siger.ApiWMS.Controllers ...@@ -416,18 +418,29 @@ namespace Siger.ApiWMS.Controllers
storageName = waveHouseDic[item.storageid], storageName = waveHouseDic[item.storageid],
serialNumber = item.serial_number, serialNumber = item.serial_number,
state = item.status, state = item.status,
field = new List<string>(), field = new List<FiledName>(),
storeID = item.locationid
}; };
int i = 1; int i = 1;
tmp.field.Insert(0, item.realname); tmp.field.Add(new FiledName
{
id = item.id,
name = item.realname
});
while (pid != 0) while (pid != 0)
{ {
var entity = location.Get(pid); var entity = location.Get(pid);
if (entity == null) if (entity == null)
break; break;
if(entity.typeid == LastTypeId)
{
tmp.storeID = entity.locationid;//赋值前端填写的储位ID
}
//处理顺序问题 //处理顺序问题
tmp.field.Insert(0, entity.realname); tmp.field.Add(new FiledName
{
id = entity.id,
name = entity.realname
});
pid = entity.parentid; pid = entity.parentid;
//避免因为数据异常导致死循环 //避免因为数据异常导致死循环
...@@ -671,7 +684,7 @@ namespace Siger.ApiWMS.Controllers ...@@ -671,7 +684,7 @@ namespace Siger.ApiWMS.Controllers
var tmp = new List<string>(); var tmp = new List<string>();
tmp.Add(id++.ToString()); tmp.Add(id++.ToString());
tmp.Add(item.storageName); tmp.Add(item.storageName);
tmp.AddRange(item.field); tmp.AddRange(item.field.Select(q => q.name));
tmp.Add(item.state == (int)RowState.Valid ? "否" : "是"); tmp.Add(item.state == (int)RowState.Valid ? "否" : "是");
tmp.Add(item.serialNumber); tmp.Add(item.serialNumber);
excelData.Add(tmp); excelData.Add(tmp);
......
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