Commit 20ea8ec3 by xin.yang

some update

parent 4e5891a7
......@@ -416,7 +416,8 @@ namespace Siger.ApiWMS.Controllers
storageName = waveHouseDic[item.storageid],
serialNumber = item.serial_number,
state = item.status,
field = new List<string>()
field = new List<string>(),
storeID = item.locationid
};
int i = 1;
tmp.field.Insert(0, item.realname);
......@@ -898,7 +899,7 @@ namespace Siger.ApiWMS.Controllers
[HttpPost]
public IActionResult AddLocation([FromBody]RequestAddLocationModel req)
{
if (req.storeID.ToInt() <= 0 || req.locations == null || !req.locations.Any() || req.warehouseid <= 0)
if (req.storeID.ToInt() <= 0 || req.storeArr == null || !req.storeArr.Any() || req.warehouseid <= 0)
{
throw new BadRequestException(RequestEnum.ParameterError);
}
......@@ -914,12 +915,12 @@ namespace Siger.ApiWMS.Controllers
throw new BadRequestException(RequestEnum.WaveHouseIDNotExist);
}
if (req.locations.Count != locationTypes.Count)
if (req.storeArr.Count != locationTypes.Count)
{
throw new BadRequestException(RequestEnum.LocationCountError);
}
foreach (var Location in req.locations)
foreach (var Location in req.storeArr)
{
var loca = location.Get(q => q.realname == Location.val && q.projectid == ProjectId);
if (loca != null)
......@@ -932,7 +933,7 @@ namespace Siger.ApiWMS.Controllers
var parentid = 0;
foreach (var locationType in sonLocationTypes)
{
var Location = req.locations.FirstOrDefault(q => q.id == locationType.id);
var Location = req.storeArr.FirstOrDefault(q => q.id == locationType.id);
if (Location == null)
{
throw new BadRequestException(CommonEnum.Fail);//TODO
......@@ -1017,7 +1018,7 @@ namespace Siger.ApiWMS.Controllers
[HttpPost]
public IActionResult UpdateLocation([FromBody]RequestAddLocationModel req)
{
if (req.storeID.ToInt() <= 0 || req.locations == null || !req.locations.Any() || req.warehouseid <= 0)
if (req.storeID.ToInt() <= 0 || req.storeArr == null || !req.storeArr.Any() || req.warehouseid <= 0)
{
throw new BadRequestException(RequestEnum.ParameterError);
}
......@@ -1033,12 +1034,12 @@ namespace Siger.ApiWMS.Controllers
throw new BadRequestException(RequestEnum.WaveHouseIDNotExist);
}
if (req.locations.Count != locationTypes.Count)
if (req.storeArr.Count != locationTypes.Count)
{
throw new BadRequestException(RequestEnum.LocationCountError);
}
foreach (var Location in req.locations)
foreach (var Location in req.storeArr)
{
var loca = location.Get(q => q.realname == Location.val && q.projectid == ProjectId && q.id != Location.locationid.ToInt());
if (loca != null)
......@@ -1050,7 +1051,7 @@ namespace Siger.ApiWMS.Controllers
var ids = new List<int>();
foreach (var locationType in sonLocationTypes)
{
var Location = req.locations.FirstOrDefault(q => q.id == locationType.id);
var Location = req.storeArr.FirstOrDefault(q => q.id == locationType.id);
if (Location == null)
{
throw new BadRequestException(CommonEnum.Fail);//TODO
......
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