Commit 15bb8b77 by yiyu.li
parents 73cc5fc8 69cfb0e8
......@@ -740,6 +740,8 @@ export default {
'9000515': '请填写仓库名称后面的储位层级',
'9000516': '请填写父工装编号',
'9000517': '请填写子工装编号',
'9000518': '请填写储位ID',
'9000519': '请填写仓库名称',
'9100000': 'Departments cannot be empty',
'9100001': 'Position cannot be empty',
......
......@@ -767,6 +767,8 @@ export default {
'9000515': '请填写仓库名称后面的储位层级',
'9000516': '请填写父工装编号',
'9000517': '请填写子工装编号',
'9000518': '请填写储位ID',
'9000519': '请填写仓库名称',
'9100000': '部门不能为空',
......
......@@ -523,19 +523,8 @@ namespace Siger.ApiACC.Controllers
[HttpPost]
public IActionResult Unloading([FromBody]requestAutomationUnloading unloading)
{
//var monitor = _automationFixtureMonitor.Get(f => f.section == unloading.section);
//if (monitor == null)
//{
// Logger.WriteLineInfo($"AutoProcess 找不到CNC监控信息");
// return new ObjectResult(CommonEnum.RecordNotFound);
//}
//if (string.IsNullOrEmpty( monitor.sn))
//{
// Logger.WriteLineInfo($"AutoProcess 找不到CNC监控SN信息");
// return new ObjectResult(CommonEnum.RecordNotFound);
//}
var location = _automationLocation.Get(f => f.id == unloading.locationid);
var location = _automationLocation.Get(f => f.id == unloading.id);
if (location==null)
{
throw new BadRequestException(CommonEnum.RecordNotFound);
......@@ -551,7 +540,10 @@ namespace Siger.ApiACC.Controllers
{
throw new BadRequestException(AccEnum.LineModeNotfound);
}
if (!_automationTaskList.CanTask(ProjectId, unloading.section))
{
throw new BadRequestException(AccEnum.TaskProcessing);
}
//TODO
//1. 有检验状态 (立库-》检验工位)
//2. 无检验状态 (立库-》上下料工位)
......
......@@ -1500,10 +1500,10 @@ namespace Siger.Middlelayer.Common
PleaseInputFixtureName,
[Description("请填写工装料号")]
PleaseInputFixtureCode,
PleaseInputPartNumber,
[Description("请填写工装编号")]
PleaseInputPartNumber,
PleaseInputFixtureCode,
[Description("请填写规格型号")]
PleaseInputSpecfication,
......@@ -1538,5 +1538,11 @@ namespace Siger.Middlelayer.Common
[Description("请填写子工装编号")]
PleaseInputSonFixtureCode,
[Description("请填写储位ID")]
PleaseInputLocationID,
[Description("请填写仓库名称")]
PleaseInputWarehouseName,
}
}
......@@ -195,6 +195,9 @@ namespace Siger.Middlelayer.Utility.ImportEntities
[ExcelColumn("*储位ID")]
public string LocationId { get; set; }
[ExcelColumn("*工装类型")]
public string Category { get; set; }
[ExcelColumn("*工装编号")]
public string FixtureTool { get; set; }
......
......@@ -148,31 +148,56 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
rowIndex++;
if (string.IsNullOrEmpty(item.LocationId) || string.IsNullOrEmpty(item.FixtureTool))
if (string.IsNullOrEmpty(item.Warehouse))
{
errors.Add($"{rowIndex},{(int)RequestEnum.ParameterMiss}");
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputWarehouseName}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (string.IsNullOrEmpty(item.LocationId))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputLocationID}");
}
if(item.LocationId.ToInt() <= 0)
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputNotZeroIntID}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (string.IsNullOrEmpty(item.Category))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputFixtureCategory}");
return new CommonImportResult(0, string.Join(";", errors));
}
if (string.IsNullOrEmpty(item.FixtureTool))
{
errors.Add($"{rowIndex},{(int)RequestEnum.PleaseInputFixtureCode}");
return new CommonImportResult(0, string.Join(";", errors));
}
var fixturetool = _context.siger_automation_fixture_tools.FirstOrDefault(q => q.code == item.FixtureTool && q.projectId == projectid);
if (fixturetool == null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.FixtureToolNotFound}");
return new CommonImportResult(0, string.Join(";", errors));
}
var warehouse = _context.siger_wms_storage.FirstOrDefault(q => q.status == (int)RowState.Valid && q.projectId == projectid && q.name == item.Warehouse);
if(warehouse == null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.WaveHouseIDNotExist}");
return new CommonImportResult(0, string.Join(";", errors));
}
var location = _context.siger_wms_storage_location.FirstOrDefault(q => q.locationid == item.LocationId.ToInt() && q.storageid == warehouse.id && q.projectId == projectid && q.status == (int)RowState.Valid);
if (location == null || item.LocationId.ToInt() <= 0)
if (location == null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.LocationNull}");
}
if (fixturetool != null)
{
var exsit = _context.siger_automation_location.FirstOrDefault(q => q.projectId == projectid && q.status == (int)RowState.Valid &&
(q.fixturetools == fixturetool.guid || q.locationid == item.LocationId.ToInt()));
if (exsit != null)
{
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
}
}
if (list.Count(q => q.FixtureTool == item.FixtureTool || q.LocationId == item.LocationId) > 1)
{
errors.Add($"{rowIndex},{(int)RequestEnum.DataExist}");
......@@ -215,17 +240,25 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
var query = from q in _context.siger_automation_location
join t in _context.siger_automation_fixture_tools on q.fixturetools equals t.guid
where q.projectId==projectId && !string.IsNullOrEmpty(q.sn)
join l in _context.siger_wms_storage_location on q.location_cid equals l.id
join w in _context.siger_wms_storage on l.storageid equals w.id
where q.projectId==projectId
select new ResponseAutomationLocationList
{
id = q.id,
typeid = t.id,
fixtureguid = t.guid,
locationid = q.locationid,
locationid = l.locationid,
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 =q.sn
materialsn = q.sn ?? ""
};
Expression<Func<ResponseAutomationLocationList, bool>> locationidExpression = f => true;
if (full != 0)
......
......@@ -31,7 +31,7 @@ namespace Siger.Middlelayer.AccRepository.Request
{
public int section { get; set; }
public int locationid { get; set; }
public int id { 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