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
02048770
Commit
02048770
authored
Feb 04, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
1316c4ab
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
71 deletions
+11
-71
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+11
-70
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+0
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
02048770
...
@@ -82,7 +82,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -82,7 +82,7 @@ namespace Siger.ApiACC.Controllers
machineid
=
request
.
machineid
,
machineid
=
request
.
machineid
,
projectId
=
PID
,
projectId
=
PID
,
updatetime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
enable
=
request
.
enable
,
enable
=
request
.
enable
==
1
?
1
:
0
,
status
=
request
.
status
status
=
request
.
status
});
});
}
else
}
else
...
@@ -257,34 +257,12 @@ namespace Siger.ApiACC.Controllers
...
@@ -257,34 +257,12 @@ namespace Siger.ApiACC.Controllers
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
}
//3.Tasklist 任务全部完成 ,创建自动任务
//3.Tasklist 任务全部完成 ,创建自动任务
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
taskObj
.
sectionid
);
switch
(
request
.
status
)
if
(
section
!=
null
)
{
{
case
(
int
)
TaskResultStatus
.
Cancel
:
AutoProcess
(
section
.
parentid
,
stationDicts
,
taskObj
);
case
(
int
)
TaskResultStatus
.
Complated
:
{
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
taskObj
.
sectionid
);
if
(
section
!=
null
)
{
var
updownDic
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
var
uploadStations
=
updownDic
.
Select
(
f
=>
f
.
dval
.
ToInt
()).
ToList
();
var
uploadPostion
=
uploadStations
.
Contains
(
taskObj
.
sectionid
);
if
(
uploadPostion
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 上料料工站 无需自动创建任务 "
);
break
;
}
AutoProcess
(
section
.
parentid
,
stationDicts
,
taskObj
);
}
break
;
}
case
(
int
)
TaskResultStatus
.
Waiting
:
case
(
int
)
TaskResultStatus
.
Produce
:
default
:
{
break
;
}
}
}
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
}
...
@@ -322,23 +300,21 @@ namespace Siger.ApiACC.Controllers
...
@@ -322,23 +300,21 @@ namespace Siger.ApiACC.Controllers
location
.
sn
=
taskObj
.
sn
;
location
.
sn
=
taskObj
.
sn
;
_automationLocation
.
Update
(
location
);
_automationLocation
.
Update
(
location
);
}
}
}
}
if
(
monitor
!=
null
&&
taskObj
.
action
!
=
TaskAction
.
Step_SXLW_LK
)
if
(
monitor
!=
null
&&
taskObj
.
action
=
=
TaskAction
.
Step_SXLW_LK
)
{
{
monitor
.
section
=
0
;
monitor
.
section
=
0
;
}
}
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
taskObj
.
sectionid
);
if
(
machineStatus
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
if
(
machineStatus
!=
null
)
//上料上下料设备状态为后台控制,CNC是PLC控制
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
taskObj
.
sectionid
&&
f
.
auto
==
0
);
if
(
machineStatus
!=
null
)
{
{
machineStatus
.
status
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
machineStatus
.
status
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
_automationMachineStatus
.
Update
(
machineStatus
);
_automationMachineStatus
.
Update
(
machineStatus
);
}
}
}
}
if
(
monitor
!=
null
)
if
(
monitor
!=
null
)
...
@@ -421,41 +397,6 @@ namespace Siger.ApiACC.Controllers
...
@@ -421,41 +397,6 @@ namespace Siger.ApiACC.Controllers
var
location
=
SelectLocation
(
freeMachine
.
Select
(
s
=>
s
.
machineid
).
ToList
());
var
location
=
SelectLocation
(
freeMachine
.
Select
(
s
=>
s
.
machineid
).
ToList
());
if
(
location
!=
null
)
if
(
location
!=
null
)
{
{
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
location
.
section
);
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
{
projectId
=
PID
,
productId
=
location
.
productId
,
productCode
=
location
.
productCode
,
productName
=
location
.
productName
,
fixtureguid
=
location
.
fixture
,
fixturename
=
location
.
fixturename
,
ordernumber
=
location
.
ordernumber
,
locationId
=
location
.
location
,
section
=
location
.
section
,
sn
=
location
.
sn
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
route
=
location
.
route
,
});
}
else
{
monitor
.
productId
=
location
.
productId
;
monitor
.
productCode
=
location
.
productCode
;
monitor
.
productName
=
location
.
productName
;
monitor
.
fixtureguid
=
location
.
fixture
;
monitor
.
fixturename
=
location
.
fixturename
;
monitor
.
ordernumber
=
location
.
ordernumber
;
monitor
.
locationId
=
location
.
location
;
monitor
.
sn
=
location
.
sn
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
route
=
location
.
route
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
// * 更新下一个工序到储位
// * 更新下一个工序到储位
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
location
.
lid
);
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
location
.
lid
);
if
(
locationObj
!=
null
)
if
(
locationObj
!=
null
)
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
View file @
02048770
...
@@ -29,7 +29,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories
...
@@ -29,7 +29,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
{
//已经下发,并且任务完成
//已经下发,并且任务完成
var
taskObjs
=
_context
.
siger_automation_task_list
.
Where
(
f
=>
f
.
projectId
==
projectId
&&
f
.
send
==
0
);
var
taskObjs
=
_context
.
siger_automation_task_list
.
Where
(
f
=>
f
.
projectId
==
projectId
&&
f
.
send
==
0
);
if
(
taskObjs
.
Any
())
if
(
taskObjs
.
Any
())
{
{
return
false
;
return
false
;
...
...
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