Commit 73cc5fc8 by yiyu.li
parents 115f52e7 91fb464c
......@@ -738,6 +738,8 @@ export default {
'9000513': '请填写大于0的整数ID',
'9000514': '请填写仓库名称',
'9000515': '请填写仓库名称后面的储位层级',
'9000516': '请填写父工装编号',
'9000517': '请填写子工装编号',
'9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty',
......
......@@ -765,6 +765,8 @@ export default {
'9000513': '请填写大于0的整数ID',
'9000514': '请填写仓库名称',
'9000515': '请填写仓库名称后面的储位层级',
'9000516': '请填写父工装编号',
'9000517': '请填写子工装编号',
'9100000': '部门不能为空',
......
......@@ -1532,5 +1532,11 @@ namespace Siger.Middlelayer.Common
[Description("请填写仓库名称后面的储位层级")]
PleaseInputLocation,
[Description("请填写父工装编号")]
PleaseInputParentFixtureCode,
[Description("请填写子工装编号")]
PleaseInputSonFixtureCode,
}
}
......@@ -183,9 +183,17 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var entities = new List<siger_automation_fixture_tools_assembly>();
if (string.IsNullOrEmpty(item.FixtureTool) || string.IsNullOrEmpty(item.ParentFixtureTool))
if (string.IsNullOrEmpty(item.ParentFixtureTool))
{
errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}");
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputParentFixtureCode}");
}
if (string.IsNullOrEmpty(item.FixtureTool))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputSonFixtureCode}");
}
if (string.IsNullOrEmpty(item.Status))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputStatus}");
}
if (item.ParentFixtureTool == item.FixtureTool)
{
......@@ -202,11 +210,14 @@ namespace Siger.Middlelayer.AccRepository.Repositories
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
}
var parentGuid = parent.guid;
if(son != null && parent != null)
{
var exsit = _context.siger_automation_fixture_tools_assembly.FirstOrDefault(q => q.projectId == projectid && q.son == son.guid && q.parent == parentGuid);
if (exsit != null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
}
}
if (list.Count(q => q.FixtureTool == item.FixtureTool && q.ParentFixtureTool == item.ParentFixtureTool) > 1)
{
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
......@@ -236,7 +247,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
projectId = projectid,
updatetime = DateTime.Now,
updator = userid,
status = item.Status == "可用" ? (int)RowState.Valid : (int)RowState.Invalid,
status = item.Status.Trim() == "可用" ? (int)RowState.Valid : (int)RowState.Invalid,
remark = item.Remark
};
_context.siger_automation_fixture_tools_assembly.Add(parentEntity);
......@@ -254,7 +265,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
projectId = projectid,
updatetime = DateTime.Now,
updator = userid,
status = item.Status == "可用" ? (int)RowState.Valid : (int)RowState.Invalid,
status = item.Status.Trim() == "可用" ? (int)RowState.Valid : (int)RowState.Invalid,
remark = item.Remark
};
entities.Add(entity);
......
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