Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
Laisi_AutoMES2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiawei.su
Laisi_AutoMES2
Commits
6dd307b8
Commit
6dd307b8
authored
Feb 06, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
0b279d64
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
83 deletions
+98
-83
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+88
-73
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+8
-8
siger_automation_machine_property.cs
...cRepository/Entities/siger_automation_machine_property.cs
+2
-2
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
6dd307b8
...
@@ -71,12 +71,12 @@ namespace Siger.ApiACC.Controllers
...
@@ -71,12 +71,12 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
[
HttpPost
]
public
IActionResult
MachineStatus
([
FromBody
]
RequestAutomationMachine
request
)
public
IActionResult
MachineStatus
([
FromBody
]
RequestAutomationMachine
request
)
{
{
var
machineAttr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
projectid
==
PID
&&
f
.
machine
==
request
.
machineid
);
var
machineAttr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
projectid
==
PID
&&
f
.
machine
==
request
.
machineid
&&
f
.
status
==(
int
)
RowState
.
Valid
);
if
(
machineAttr
==
null
)
if
(
machineAttr
==
null
)
{
{
throw
new
BadRequestException
(
ConfigEnum
.
MachineAttributionNotFound
);
throw
new
BadRequestException
(
ConfigEnum
.
MachineAttributionNotFound
);
}
}
var
exitsObj
=
_automationMachineStatus
.
Get
(
f
=>
f
.
machineid
==
request
.
machineid
);
var
exitsObj
=
_automationMachineStatus
.
Get
(
f
=>
f
.
machineid
==
request
.
machineid
);
if
(
exitsObj
==
null
)
if
(
exitsObj
==
null
)
{
{
_automationMachineStatus
.
Insert
(
new
siger_automation_machine_status
{
_automationMachineStatus
.
Insert
(
new
siger_automation_machine_status
{
...
@@ -89,6 +89,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -89,6 +89,7 @@ namespace Siger.ApiACC.Controllers
});
});
}
else
}
else
{
{
exitsObj
.
section
=
machineAttr
.
station
;
exitsObj
.
enable
=
request
.
enable
;
exitsObj
.
enable
=
request
.
enable
;
exitsObj
.
status
=
request
.
status
;
exitsObj
.
status
=
request
.
status
;
exitsObj
.
updatetime
=
DateTime
.
Now
;
exitsObj
.
updatetime
=
DateTime
.
Now
;
...
@@ -103,31 +104,13 @@ namespace Siger.ApiACC.Controllers
...
@@ -103,31 +104,13 @@ namespace Siger.ApiACC.Controllers
{
{
if
(
request
.
status
==
(
int
)
Automation
.
MachineStatus
.
Waiting
||
request
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
if
(
request
.
status
==
(
int
)
Automation
.
MachineStatus
.
Waiting
||
request
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
{
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
PID
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
}
//Logger.WriteLineInfo($"设备状态更变{request.status}触发");
if
(
_automationTaskList
.
CanTask
(
PID
,
machineAttr
.
station
))
if
(
_automationTaskList
.
CanTask
(
PID
,
machineAttr
.
station
))
{
{
var
uploadStation
=
stationDicts
.
Where
(
f
=>
f
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
var
uploadStations
=
uploadStation
.
Select
(
f
=>
f
.
dval
.
ToInt
()).
ToList
();
if
(!
uploadStations
.
Contains
(
machineAttr
.
station
))
{
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(!
tasklist
.
Any
())
{
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
machineAttr
.
station
);
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
machineAttr
.
station
);
if
(
section
!=
null
)
if
(
section
!=
null
)
{
{
Logger
.
WriteLineInfo
(
$"MachineStatus 设备
{
section
.
title
}
状态 触发自动任务检查"
);
Logger
.
WriteLineInfo
(
$"MachineStatus 设备
{
section
.
title
}
状态 触发自动任务检查"
);
AutoProcess
(
section
.
parentid
,
stationDicts
);
AutoProcess
(
section
.
parentid
);
}
}
}
}
}
}
}
}
...
@@ -174,20 +157,11 @@ namespace Siger.ApiACC.Controllers
...
@@ -174,20 +157,11 @@ namespace Siger.ApiACC.Controllers
{
{
//TODO
//TODO
//手动-》自动 时
//手动-》自动 时
//task 无任务时候 ,根据设备状态创建任务
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
PID
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
}
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(!
tasklist
.
Any
())
if
(!
tasklist
.
Any
())
{
{
Logger
.
WriteLineInfo
(
$"LineMode Mode=1 触发自动任务检查"
);
Logger
.
WriteLineInfo
(
$"LineMode Mode=1 触发自动任务检查"
);
AutoProcess
(
line
,
stationDicts
);
AutoProcess
(
line
);
}
}
}
}
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
...
@@ -238,15 +212,9 @@ namespace Siger.ApiACC.Controllers
...
@@ -238,15 +212,9 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
AutoTaskDone
);
throw
new
BadRequestException
(
AccEnum
.
AutoTaskDone
);
}
}
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
PID
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
}
//更新Tasklist
//更新Tasklist
PlCfeeback
(
taskObj
,
request
.
status
,
stationDicts
);
PlCfeeback
(
taskObj
,
request
.
status
);
if
(
_unitOfWork
.
Commit
()
<=
0
)
if
(
_unitOfWork
.
Commit
()
<=
0
)
{
{
...
@@ -263,13 +231,13 @@ namespace Siger.ApiACC.Controllers
...
@@ -263,13 +231,13 @@ namespace Siger.ApiACC.Controllers
if
(
section
!=
null
)
if
(
section
!=
null
)
{
{
Logger
.
WriteLineInfo
(
$" 设备
{
section
.
title
}
任务编号:
{
taskObj
.
no
}
状态:
{
request
.
status
}
"
);
Logger
.
WriteLineInfo
(
$" 设备
{
section
.
title
}
任务编号:
{
taskObj
.
no
}
状态:
{
request
.
status
}
"
);
AutoProcess
(
section
.
parentid
,
stationDicts
,
taskObj
);
AutoProcess
(
section
.
parentid
,
taskObj
);
}
}
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
}
void
PlCfeeback
(
siger_automation_task_list
taskObj
,
int
status
,
IEnumerable
<
SigerTrDict
>
stationDicts
)
void
PlCfeeback
(
siger_automation_task_list
taskObj
,
int
status
)
{
{
//2.更新状态
//2.更新状态
taskObj
.
status
=
status
;
taskObj
.
status
=
status
;
...
@@ -286,17 +254,18 @@ namespace Siger.ApiACC.Controllers
...
@@ -286,17 +254,18 @@ namespace Siger.ApiACC.Controllers
//PLC 反馈结束.
//PLC 反馈结束.
if
(
status
==
(
int
)
TaskResultStatus
.
Complated
)
if
(
status
==
(
int
)
TaskResultStatus
.
Complated
)
{
{
if
(
taskObj
.
action
==
TaskAction
.
Step_SXLW_LK
)
{
// 业务入口: 上料位-》 入库 如果是上料工装 安装完成 ,绑定 储位与装配
// 业务入口: 上料位-》 入库 如果是上料工装 安装完成 ,绑定 储位与装配
if
(
sectionProperty
.
propertytype
==
1
)
if
(
sectionProperty
.
propertytype
==
1
)
{
{
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
fixturetools
==
taskObj
.
fixturegu
id
);
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
fixturetools
==
taskObj
.
fixtureguid
&&
f
.
locationid
==
taskObj
.
location
id
);
if
(
location
==
null
)
if
(
location
==
null
)
{
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 未找到该工装储位信息"
);
Logger
.
WriteLineInfo
(
$"PlCfeeback 未找到该工装储位信息"
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
}
//绑定SN 工件到立库储位
if
(
taskObj
.
action
==
TaskAction
.
Step_SXLW_LK
)
{
location
.
fixturetools
=
taskObj
.
fixtureguid
;
location
.
fixturetools
=
taskObj
.
fixtureguid
;
location
.
fixturename
=
taskObj
.
fixturename
;
location
.
fixturename
=
taskObj
.
fixturename
;
location
.
ordernumber
=
taskObj
.
ordercode
;
location
.
ordernumber
=
taskObj
.
ordercode
;
...
@@ -307,6 +276,40 @@ namespace Siger.ApiACC.Controllers
...
@@ -307,6 +276,40 @@ namespace Siger.ApiACC.Controllers
location
.
status
=
(
int
)
LocationStatus
.
In
;
location
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
location
);
_automationLocation
.
Update
(
location
);
}
}
//从立库储位拿SN 工件到上料位
if
(
taskObj
.
action
==
TaskAction
.
Step_LK_SXLW
)
{
//location.sn = "";
location
.
status
=
(
int
)
LocationStatus
.
Out
;
}
}
if
(
sectionProperty
.
propertytype
==
2
)
{
if
(
taskObj
.
action
==
TaskAction
.
Step_LK_JGZX
)
{
}
}
if
(
sectionProperty
.
propertytype
==
4
)
{
if
(
taskObj
.
action
==
TaskAction
.
Step_LK_CJT
)
{
}
//清洗即 完成
if
(
taskObj
.
action
==
TaskAction
.
Step_QXJ_LK
)
{
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
fixturetools
==
taskObj
.
fixtureguid
&&
f
.
locationid
==
taskObj
.
locationid
);
if
(
location
==
null
)
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 未找到该工装储位信息"
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
//location.sn = "";
location
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
location
);
}
}
}
if
(
monitor
!=
null
&&
taskObj
.
action
==
TaskAction
.
Step_SXLW_LK
)
if
(
monitor
!=
null
&&
taskObj
.
action
==
TaskAction
.
Step_SXLW_LK
)
{
{
...
@@ -331,7 +334,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -331,7 +334,7 @@ namespace Siger.ApiACC.Controllers
/// <param name="fixture"></param>
/// <param name="fixture"></param>
/// <param name="stationDicts"></param>
/// <param name="stationDicts"></param>
/// <param name="tasklist"></param>
/// <param name="tasklist"></param>
void
AutoProcess
(
int
line
,
IEnumerable
<
SigerTrDict
>
stationDicts
,
siger_automation_task_list
tasklist
=
null
)
void
AutoProcess
(
int
line
,
siger_automation_task_list
tasklist
=
null
)
{
{
var
lineMode
=
_automationLineMode
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
section
==
line
);
var
lineMode
=
_automationLineMode
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
section
==
line
);
if
(
lineMode
==
null
)
if
(
lineMode
==
null
)
...
@@ -352,15 +355,9 @@ namespace Siger.ApiACC.Controllers
...
@@ -352,15 +355,9 @@ namespace Siger.ApiACC.Controllers
//3.其他设备下料
//3.其他设备下料
*/
*/
//var updownDic= stationDicts.Where(s => s.dkey == DictKeyValConst.UploadloadStation);
//var uploadStations = updownDic.Select(f => f.dval.ToInt()).ToList();
///* 自动任务创建只有CNC 设备;排除上料设备(手动任务) */
///* 自动任务创建只有CNC 设备;排除上料设备(手动任务) */
//var dictClean = stationDicts.FirstOrDefault(s=>s.dkey==DictKeyValConst.CleanStation);
//if (dictClean==null)
//{
// Logger.WriteLineInfo($"AutoProcess 未配置清洗机字典");
// return;
//}
var
sectionPropertys
=
_automationSectionProperty
.
GetList
(
f
=>
f
.
projectId
==
PID
).
ToList
();
var
sectionPropertys
=
_automationSectionProperty
.
GetList
(
f
=>
f
.
projectId
==
PID
).
ToList
();
if
(!
sectionPropertys
.
Any
())
if
(!
sectionPropertys
.
Any
())
{
{
...
@@ -376,42 +373,55 @@ namespace Siger.ApiACC.Controllers
...
@@ -376,42 +373,55 @@ namespace Siger.ApiACC.Controllers
return
;
return
;
}
}
//优先级1 :清洗机完成 。待下料
//优先级1 :清洗机完成 。待下料
var
cleanMachine
=
sectionPropertys
.
FirstOrDefault
(
f
=>
f
.
projectId
==
PID
&&
f
.
propertytype
==
4
);
var
cleanProperty
=
sectionPropertys
.
FirstOrDefault
(
f
=>
f
.
propertytype
==
4
);
if
(
cleanProperty
==
null
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 设备属性清洗机未配置"
);
return
;
}
var
cleanMachine
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
cleanProperty
.
sectionid
);
if
(
cleanMachine
!=
null
)
if
(
cleanMachine
!=
null
)
{
{
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
{
Logger
.
WriteLineError
(
$"AutoProcess 有清洗机
{
cleanMachine
.
section
id
}
完成,创建清洗机Task"
);
Logger
.
WriteLineError
(
$"AutoProcess 有清洗机
{
cleanMachine
.
section
}
完成,创建清洗机Task"
);
if
(
tasklist
==
null
)
if
(
tasklist
==
null
)
{
{
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空"
);
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空"
);
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空,查找设备Monitor
{
cleanMachine
.
section
id
}
状态"
);
Logger
.
WriteLineError
(
$"AutoProcess Tasklist 为空,查找设备Monitor
{
cleanMachine
.
section
}
状态"
);
var
machineMonitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
cleanMachine
.
section
id
);
var
machineMonitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
cleanMachine
.
section
);
if
(
machineMonitor
==
null
)
if
(
machineMonitor
==
null
)
{
{
Logger
.
WriteLineError
(
$"AutoProcess 清洗机
{
cleanMachine
.
section
id
}
machineMonitor 为空"
);
Logger
.
WriteLineError
(
$"AutoProcess 清洗机
{
cleanMachine
.
section
}
machineMonitor 为空"
);
return
;
return
;
}
}
CreateTask
(
cleanMachine
.
section
id
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
machineMonitor
.
fixtureguid
,
machineMonitor
.
ordernumber
,
machineMonitor
.
sn
,
""
,
machineMonitor
.
productId
,
machineMonitor
.
productCode
,
machineMonitor
.
locationId
,
machineMonitor
.
route
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
machineMonitor
.
fixtureguid
,
machineMonitor
.
ordernumber
,
machineMonitor
.
sn
,
""
,
machineMonitor
.
productId
,
machineMonitor
.
productCode
,
machineMonitor
.
locationId
,
machineMonitor
.
route
);
}
}
else
//
else
{
//
{
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
locationid
==
tasklist
.
locationid
);
//
var locationObj = _automationLocation.Get(f => f.projectId == PID && f.locationid == tasklist.locationid);
if
(
locationObj
==
null
)
//
if (locationObj == null)
{
//
{
Logger
.
WriteLineError
(
$"AutoProcess 立库 为空"
);
//
Logger.WriteLineError($"AutoProcess 立库 为空");
return
;
//
return;
}
//
}
//工件回到立库
//
//工件回到立库
locationObj
.
status
=
(
int
)
LocationStatus
.
In
;
//
locationObj.status = (int)LocationStatus.In;
_automationLocation
.
Update
(
locationObj
);
//
_automationLocation.Update(locationObj);
CreateTask
(
cleanMachine
.
sectionid
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
"无程序"
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
locationid
,
tasklist
.
route
);
// CreateTask(cleanMachine.section, TaskActionType.Unload, TaskAction.Step_QXJ_LK, tasklist.fixtureguid, tasklist.ordercode, tasklist.sn, "无程序", tasklist.productid, tasklist.productcode, tasklist.locationid, tasklist.route);
return
;
//完成当前任务 退出
// return; //完成当前任务 退出
//}
}
else
{
Logger
.
WriteLineInfo
(
$"AutoProcess 清洗机未完成"
);
}
}
}
}
else
{
Logger
.
WriteLineInfo
(
$"AutoProcess 清洗机没找到"
);
}
}
//优先级2 :其他设备待上料 (立库->加工中心)
//优先级2 :其他设备待上料 (立库->加工中心)
var
freeMachine
=
machineStatusList
.
Where
(
f
=>
f
.
status
==(
int
)
Automation
.
MachineStatus
.
Waiting
);
var
freeMachine
=
machineStatusList
.
Where
(
f
=>
f
.
status
==(
int
)
Automation
.
MachineStatus
.
Waiting
);
...
@@ -458,12 +468,12 @@ namespace Siger.ApiACC.Controllers
...
@@ -458,12 +468,12 @@ namespace Siger.ApiACC.Controllers
{
{
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,创建普通设备下料到清洗机Task "
);
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,创建普通设备下料到清洗机Task "
);
//更新清洗机监控
//更新清洗机监控
var
monitor
=
_automationFixtureMonitor
.
Get
(
cleanMachine
.
section
id
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
cleanMachine
.
section
);
if
(
monitor
==
null
)
if
(
monitor
==
null
)
{
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
{
{
section
=
cleanMachine
.
section
id
,
section
=
cleanMachine
.
section
,
fixtureguid
=
tasklist
.
fixtureguid
,
fixtureguid
=
tasklist
.
fixtureguid
,
fixturename
=
tasklist
.
fixturename
,
fixturename
=
tasklist
.
fixturename
,
productCode
=
tasklist
.
productcode
,
productCode
=
tasklist
.
productcode
,
...
@@ -612,6 +622,11 @@ namespace Siger.ApiACC.Controllers
...
@@ -612,6 +622,11 @@ namespace Siger.ApiACC.Controllers
Logger
.
WriteLineError
(
$"SelectLocation 设备
{
b
.
machineID
}
routeid:
{
b
.
route_number
}
-
{
b
.
route_name
}
productId:
{
b
.
product_name
}
储位
{
autoLocation
.
locationid
}
工件Sn:
{
autoLocation
.
sn
}
不在储位上"
);
Logger
.
WriteLineError
(
$"SelectLocation 设备
{
b
.
machineID
}
routeid:
{
b
.
route_number
}
-
{
b
.
route_name
}
productId:
{
b
.
product_name
}
储位
{
autoLocation
.
locationid
}
工件Sn:
{
autoLocation
.
sn
}
不在储位上"
);
continue
;
continue
;
}
}
if
(
autoLocation
.
routeid
==
0
)
{
Logger
.
WriteLineError
(
$"SelectLocation 有效订单号
{
autoLocation
.
ordernumber
}
工序
{
b
.
route_number
}
-
{
b
.
route_name
}
完成"
);
continue
;
}
Logger
.
WriteLineError
(
$"SelectLocation 有效订单号
{
autoLocation
.
ordernumber
}
beasetId:
{
b
.
id
}
工序
{
b
.
route_number
}
-
{
b
.
route_name
}
"
);
Logger
.
WriteLineError
(
$"SelectLocation 有效订单号
{
autoLocation
.
ordernumber
}
beasetId:
{
b
.
id
}
工序
{
b
.
route_number
}
-
{
b
.
route_name
}
"
);
TempList
.
Add
(
new
ResponseAutoRouteInfo
TempList
.
Add
(
new
ResponseAutoRouteInfo
{
{
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
6dd307b8
...
@@ -326,10 +326,6 @@ namespace Siger.ApiACC.Controllers
...
@@ -326,10 +326,6 @@ namespace Siger.ApiACC.Controllers
updatetime
=
DateTime
.
Now
updatetime
=
DateTime
.
Now
});
});
}
}
if
(
machineStatus
.
auto
==
1
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
var
plandts
=
_planDetails
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
OrderNumber
==
loading
.
code
);
var
plandts
=
_planDetails
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
OrderNumber
==
loading
.
code
);
if
(
plandts
==
null
)
if
(
plandts
==
null
)
...
@@ -348,10 +344,15 @@ namespace Siger.ApiACC.Controllers
...
@@ -348,10 +344,15 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
FixtureToolsIsNone
);
throw
new
BadRequestException
(
AccEnum
.
FixtureToolsIsNone
);
}
}
var
exitsUpload
=
_automationTaskList
.
Get
(
f
=>
f
.
send
==
0
&&
f
.
locationid
==
loading
.
locationid
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
loading
.
section
);
if
(
exitsUpload
!=
null
)
if
(
monitor
!=
null
)
{
{
throw
new
BadRequestException
(
AccEnum
.
FixtureOrderNulll
);
var
exitsUpload
=
_automationTaskList
.
Get
(
f
=>
f
.
no
==
monitor
.
taskno
);
if
(
exitsUpload
!=
null
)
{
if
(
exitsUpload
.
status
!=
(
int
)
Automation
.
TaskResultStatus
.
Complated
)
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
}
}
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
sn
=
_automationTaskList
.
CreateRandonSn
(
plan
.
product_code
);
var
sn
=
_automationTaskList
.
CreateRandonSn
(
plan
.
product_code
);
...
@@ -394,7 +395,6 @@ namespace Siger.ApiACC.Controllers
...
@@ -394,7 +395,6 @@ namespace Siger.ApiACC.Controllers
});
});
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
loading
.
section
);
if
(
monitor
==
null
)
if
(
monitor
==
null
)
{
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_machine_property.cs
View file @
6dd307b8
...
@@ -21,11 +21,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
...
@@ -21,11 +21,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary>
/// <summary>
/// 0:不是上料1:是上料
/// 0:不是上料1:是上料
/// </summary>
/// </summary>
public
string
upload
{
get
;
set
;
}
public
int
upload
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 0:不是下料1:是下料
/// 0:不是下料1:是下料
/// </summary>
/// </summary>
public
string
down
{
get
;
set
;
}
public
int
down
{
get
;
set
;
}
public
DateTime
createtime
{
get
;
set
;
}
public
DateTime
createtime
{
get
;
set
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment