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
7864f19f
Commit
7864f19f
authored
Jan 27, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
94559985
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
20 deletions
+9
-20
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+7
-19
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+2
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
7864f19f
...
...
@@ -245,16 +245,13 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
//是否还有未完成任务
var
taskDone
=
_automationTaskList
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(
taskDone
!=
null
)
//还有未完成任务 退出 等待任务下发
if
(!
_automationTaskList
.
CanTask
(
PID
,
taskObj
.
sectionid
))
{
//还有未完成任务 退出 等待任务下发
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
//3.Tasklist 任务全部完成 ,创建自动任务
switch
(
request
.
status
)
{
case
(
int
)
TaskResultStatus
.
Cancel
:
...
...
@@ -353,21 +350,15 @@ namespace Siger.ApiACC.Controllers
//2.其他设备上料
//3.其他设备下料
*/
var
updownDic
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
var
uploadStations
=
updownDic
.
Select
(
f
=>
f
.
dval
.
ToInt
()).
ToList
();
/* 自动任务创建只有CNC 设备;排除上料设备(手动任务) */
var
dictClean
=
stationDicts
.
FirstOrDefault
(
s
=>
s
.
dkey
==
DictKeyValConst
.
CleanStation
);
if
(
dictClean
==
null
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置清洗机字典"
);
return
;
}
// 获取可用 设备状态列表 排除上料工位
var
machineStatusList
=
_automationMachineStatus
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
!
uploadStations
.
Contains
(
f
.
section
)
&&
f
.
enable
==
1
);
if
(!
machineStatusList
.
Any
())
...
...
@@ -464,7 +455,6 @@ namespace Siger.ApiACC.Controllers
/// <param name="machineStatus"></param>
/// <param name="actionType"></param>
/// <param name="taskAction"></param>
/// <param name="uploadStations"></param>
/// <param name="guid">工装GUID</param>
/// <param name="orderno">订单</param>
/// <param name="sn">工件</param>
...
...
@@ -534,7 +524,6 @@ namespace Siger.ApiACC.Controllers
//}
//储位有SN 工件
var
location
=
_automationLocation
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
productIds
.
Contains
(
f
.
productid
));
var
hasSnloaction
=
location
.
Where
(
f
=>!
string
.
IsNullOrEmpty
(
f
.
sn
));
if
(!
hasSnloaction
.
Any
())
...
...
@@ -551,14 +540,13 @@ namespace Siger.ApiACC.Controllers
return
new
ResponseAutomationLocationRouteInfo
{
fixture
=
result
.
fixturetools
,
//fixturename=result.n
ordernumber
=
result
.
ordernumber
,
fixturename
=
result
.
fixturename
,
ordernumber
=
result
.
ordernumber
,
location
=
result
.
locationid
,
productId
=
result
.
productid
,
productCode
=
result
.
productcode
,
//productName=result.pr
sn
=
result
.
sn
,
productName
=
result
.
productname
,
sn
=
result
.
sn
,
pn
=
valiateBeat
.
process_number
,
route
=
valiateBeat
.
route_name
};
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
View file @
7864f19f
...
...
@@ -27,7 +27,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public
bool
CanTask
(
int
projectId
,
int
section
)
{
var
taskObj
=
_context
.
siger_automation_task_list
.
FirstOrDefault
(
f
=>
f
.
projectId
==
projectId
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
//已经下发,并且任务完成
var
taskObj
=
_context
.
siger_automation_task_list
.
FirstOrDefault
(
f
=>
f
.
projectId
==
projectId
&&
f
.
send
==
1
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(
taskObj
==
null
)
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