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
90d8ef8f
Commit
90d8ef8f
authored
Jan 30, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
9015d39e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
13 deletions
+27
-13
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+15
-13
AutoMES.cs
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
+4
-0
DBhelper.cs
Server/Apis/Siger.ApiACC/Tasks/DBhelper.cs
+8
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
90d8ef8f
...
...
@@ -105,21 +105,23 @@ namespace Siger.ApiACC.Controllers
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
}
var
uploadStation
=
stationDicts
.
Where
(
f
=>
f
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
var
uploadStations
=
uploadStation
.
Select
(
f
=>
f
.
dval
.
ToInt
()).
ToList
();
if
(!
uploadStations
.
Contains
(
machineAttr
.
station
))
if
(
_automationTaskList
.
CanTask
(
PID
,
machineAttr
.
station
))
{
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(!
tasklist
.
Any
())
var
uploadStation
=
stationDicts
.
Where
(
f
=>
f
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
var
uploadStations
=
uploadStation
.
Select
(
f
=>
f
.
dval
.
ToInt
()).
ToList
();
if
(!
uploadStations
.
Contains
(
machineAttr
.
station
))
{
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
machineAttr
.
station
);
if
(
section
!=
null
)
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(!
tasklist
.
Any
())
{
Logger
.
WriteLineInfo
(
$"MachineStatus 设备
{
section
.
title
}
状态 触发自动任务检查"
);
AutoProcess
(
section
.
parentid
,
stationDicts
);
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
machineAttr
.
station
);
if
(
section
!=
null
)
{
Logger
.
WriteLineInfo
(
$"MachineStatus 设备
{
section
.
title
}
状态 触发自动任务检查"
);
AutoProcess
(
section
.
parentid
,
stationDicts
);
}
}
}
}
...
...
@@ -175,7 +177,7 @@ namespace Siger.ApiACC.Controllers
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
}
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(!
tasklist
.
Any
())
{
...
...
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
View file @
90d8ef8f
...
...
@@ -34,6 +34,10 @@ namespace Siger.ApiACC.Tasks
{
return
;
}
if
(!
dbhelper
.
CanTask
(
projectId
))
{
return
;
}
var
tasks
=
tasklist
.
OrderBy
(
s
=>
s
.
actiontype
);
var
task
=
tasks
.
FirstOrDefault
();
...
...
Server/Apis/Siger.ApiACC/Tasks/DBhelper.cs
View file @
90d8ef8f
...
...
@@ -3,6 +3,7 @@ using Siger.Middlelayer.AccRepository.Entities;
using
Siger.Middlelayer.CncRepository
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Repository.Entities
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -44,6 +45,13 @@ namespace Siger.ApiACC.Tasks
select
q
;
return
query
;
}
public
bool
CanTask
(
int
projectId
)
{
var
query
=
from
q
in
AccDbContext
.
siger_automation_task_list
where
q
.
projectId
==
projectId
&&
q
.
send
==
1
&&
q
.
status
<(
int
)
TaskResultStatus
.
Complated
select
q
;
return
!
query
.
Any
();
}
public
siger_automation_fixture_tools_monitor
GetMonitor
(
int
section
)
{
return
AccDbContext
.
siger_automation_fixture_tools_moniter
.
FirstOrDefault
(
f
=>
f
.
section
==
section
);
...
...
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