Commit 818b8888 by xin.yang

fix bug

parent 1073830f
...@@ -132,7 +132,7 @@ namespace Siger.ApiACC.Controllers ...@@ -132,7 +132,7 @@ namespace Siger.ApiACC.Controllers
{ {
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var data = _toolsRepository.Get(q => q.projectId == ProjectId && (q.name == req.name || q.code == req.code || q.partnumber == req.partnumber)); var data = _toolsRepository.Get(q => q.projectId == ProjectId && q.code == req.code);
if (data != null) if (data != null)
{ {
throw new BadRequestException(RequestEnum.DataExist); throw new BadRequestException(RequestEnum.DataExist);
...@@ -184,7 +184,7 @@ namespace Siger.ApiACC.Controllers ...@@ -184,7 +184,7 @@ namespace Siger.ApiACC.Controllers
throw new BadRequestException(RequestEnum.ParameterMiss); throw new BadRequestException(RequestEnum.ParameterMiss);
} }
var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == req.id); var entity = _toolsRepository.Get(q => q.projectId == ProjectId && q.id == req.id);
var data = _toolsRepository.Get(q => q.projectId == ProjectId && (q.name == req.name || q.code == req.code || q.partnumber == req.partnumber) && q.id != req.id); var data = _toolsRepository.Get(q => q.projectId == ProjectId && q.code == req.code && q.id != req.id);
if (data != null) if (data != null)
{ {
throw new BadRequestException(RequestEnum.DataExist); throw new BadRequestException(RequestEnum.DataExist);
......
...@@ -82,7 +82,7 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -82,7 +82,7 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("工装类型")] [ExcelColumn("工装类型")]
public string Categroy { get; set; } public string Categroy { get; set; }
[ExcelColumn("*工装名称")] [ExcelColumn("*工装编号")]
public string FixtureTool { get; set; } public string FixtureTool { get; set; }
[ExcelColumn("*产品编号")] [ExcelColumn("*产品编号")]
...@@ -127,13 +127,13 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -127,13 +127,13 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("父工装类型")] [ExcelColumn("父工装类型")]
public string ParentCategory { get; set; } public string ParentCategory { get; set; }
[ExcelColumn("*父工装名称")] [ExcelColumn("*父工装编号")]
public string ParentFixtureTool { get; set; } public string ParentFixtureTool { get; set; }
[ExcelColumn("子工装类型")] [ExcelColumn("子工装类型")]
public string Category { get; set; } public string Category { get; set; }
[ExcelColumn("*子工装名称")] [ExcelColumn("*子工装编号")]
public string FixtureTool { get; set; } public string FixtureTool { get; set; }
[ExcelColumn("备注")] [ExcelColumn("备注")]
...@@ -195,7 +195,7 @@ namespace Siger.Middlelayer.Utility.ImportEntities ...@@ -195,7 +195,7 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("*储位ID")] [ExcelColumn("*储位ID")]
public string LocationId { get; set; } public string LocationId { get; set; }
[ExcelColumn("*工装名称")] [ExcelColumn("*工装编号")]
public string FixtureTool { get; set; } public string FixtureTool { get; set; }
[ExcelColumn("备注")] [ExcelColumn("备注")]
......
...@@ -191,12 +191,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -191,12 +191,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.ParentSonSame}"); errors.Add($"{rowIndex},{(int)RequestEnum.ParentSonSame}");
} }
var parent = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.name == item.ParentFixtureTool && q.projectId == projectid); var parent = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.ParentFixtureTool && q.projectId == projectid);
if (parent == null) if (parent == null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}"); errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
} }
var son = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.name == item.FixtureTool && q.projectId == projectid); var son = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.FixtureTool && q.projectId == projectid);
if (son == null) if (son == null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}"); errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
......
...@@ -156,7 +156,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -156,7 +156,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}"); errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}");
} }
var fixtureTool = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.projectId == projectid && q.name == item.FixtureTool); var fixtureTool = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.projectId == projectid && q.code == item.FixtureTool);
if (fixtureTool == null) if (fixtureTool == null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}"); errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
......
...@@ -147,12 +147,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -147,12 +147,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}"); errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}");
} }
var data = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.projectId == projectid && (q.name == item.Name || q.code == item.Code || q.partnumber == item.PartNumber)); var data = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.projectId == projectid && q.code == item.Code);
if (data != null) if (data != null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}"); errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
} }
if (list.Count(q => q.Name == item.Name || q.Code == item.Code || q.PartNumber == item.PartNumber) > 1) if (list.Count(q => q.Code == item.Code) > 1)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}"); errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
} }
......
...@@ -137,7 +137,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories ...@@ -137,7 +137,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}"); errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}");
} }
var fixturetool = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.name == item.FixtureTool && q.projectId == projectid); var fixturetool = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.FixtureTool && q.projectId == projectid);
if (fixturetool == null) if (fixturetool == null)
{ {
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}"); errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
......
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