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
6ee6b282
Commit
6ee6b282
authored
Feb 16, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate 设备状态,任务状态触发自动任务重复检查
parent
7181970c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
8 deletions
+21
-8
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+21
-8
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
6ee6b282
...
...
@@ -531,6 +531,11 @@ namespace Siger.ApiACC.Controllers
var
location
=
SelectLocation
(
freeMachine
.
Select
(
s
=>
s
.
machineid
).
ToList
());
if
(
location
!=
null
)
{
if
(
RepeatTaskCheck
(
location
.
section
,
TaskAction
.
Step_LK_JGZX
))
{
Logger
.
WriteLineError
(
$"AutoProcess CNC加工中心空闲,上一个任务与本次任务指令重复"
);
return
;
//任务已经创建
}
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
location
.
section
}
task:
{
TaskAction
.
Step_LK_JGZX
.
ToStr
()}
sn
{
location
.
sn
}
"
);
CreateTask
(
location
.
section
,
location
.
section
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
,
location
.
fixture
,
location
.
fixturename
,
location
.
ordernumber
,
location
.
sn
,
location
.
pn
,
location
.
productId
,
location
.
productCode
,
location
.
productName
,
location
.
location
,
location
.
route
);
...
...
@@ -548,11 +553,6 @@ namespace Siger.ApiACC.Controllers
//清洗机上料 为 任务触发 触发
if
(
tasklist
!=
null
&&
fullAllMachine
.
Where
(
p
=>
p
.
section
==
tasklist
.
sectionid
).
Any
())
{
//if (!fullAllMachine.Where(p => p.section == tasklist.sectionid).Any())
//{
// Logger.WriteLineError($"自动化业务流转-- tasklist判断,无待执行任务!");
// return;
//}
fullMachine
=
fullAllMachine
.
Where
(
p
=>
p
.
section
==
tasklist
.
sectionid
).
FirstOrDefault
();
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,TaskResult触发 "
);
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
fullMachine
.
section
}
task:
{
TaskAction
.
Step_JGZX_QXJ
.
ToStr
()}
sn
{
tasklist
.
sn
}
"
);
...
...
@@ -642,9 +642,9 @@ namespace Siger.ApiACC.Controllers
extend1
=
fromSection
.
ToString
()
});
if
(
_unitOfWork
.
Commit
()
>
0
)
Logger
.
WriteLineInfo
(
$"CreateTask sectionId:
{
fromSection
}
工站->
{
toSection
}
工站
{
EnumHelper
.
GetEnumDesc
(
taskAction
)}
完成"
);
Logger
.
WriteLineInfo
(
$"CreateTask
{
taskNo
}
sectionId:
{
fromSection
}
工站->
{
toSection
}
工站
{
EnumHelper
.
GetEnumDesc
(
taskAction
)}
完成"
);
else
Logger
.
WriteLineInfo
(
$"CreateTask sectionId:
{
fromSection
}
工站->
{
toSection
}
工站
{
EnumHelper
.
GetEnumDesc
(
taskAction
)}
失败"
);
Logger
.
WriteLineInfo
(
$"CreateTask
{
taskNo
}
sectionId:
{
fromSection
}
工站->
{
toSection
}
工站
{
EnumHelper
.
GetEnumDesc
(
taskAction
)}
失败"
);
}
/// <summary>
/// 自动匹配储位 储位 ->CNC
...
...
@@ -737,6 +737,19 @@ namespace Siger.ApiACC.Controllers
}
/// <summary>
/// 当前发起工站 任务重复检查
/// </summary>
/// <param name="section"></param>
/// <returns></returns>
bool
RepeatTaskCheck
(
int
section
,
TaskAction
taskAction
)
{
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
,
"id"
,
true
).
FirstOrDefault
();
if
(
lastTask
.
extend1
==
section
.
ToStr
()
&&
lastTask
.
action
==
taskAction
&&
lastTask
.
status
!=
(
int
)
TaskResultStatus
.
Complated
)
{
return
false
;
}
return
true
;
}
}
}
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