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
2d5fcb24
Commit
2d5fcb24
authored
Feb 07, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixedbug
parent
51dfd90c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
22 deletions
+33
-22
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+33
-22
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
2d5fcb24
...
...
@@ -134,23 +134,27 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
GetLoadingState
(
int
section
)
{
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
var
s
tate
=
(
int
)
Automation
.
TaskResultStatus
.
Waiting
;
if
(
monitor
!
=
null
)
var
s
ectionProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
section
)
;
if
(
sectionProperty
=
=
null
)
{
var
taskobj
=
_automationTaskList
.
Get
(
f
=>
f
.
no
==
monitor
.
taskno
);
state
=
taskobj
!=
null
?
taskobj
.
status
:
(
int
)
Automation
.
TaskResultStatus
.
Waiting
;
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
if
(
sectionProperty
.
upload
==
0
&&
sectionProperty
.
down
==
0
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
monitor
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
section
,
"id"
,
true
).
FirstOrDefault
();
var
result
=
new
ResponsePlanlFixtureInfo
{
OrderNumber
=
monitor
!=
null
?
monitor
.
order
number
:
""
,
OrderNumber
=
monitor
!=
null
?
monitor
.
order
code
:
""
,
FixtureGuid
=
monitor
!=
null
?
monitor
.
fixtureguid
:
""
,
FixtureName
=
monitor
!=
null
?
monitor
.
fixturename
:
""
,
ProductCode
=
monitor
!=
null
?
monitor
.
product
C
ode
:
""
,
ProductName
=
monitor
!=
null
?
monitor
.
product
N
ame
:
""
,
ProductCode
=
monitor
!=
null
?
monitor
.
product
c
ode
:
""
,
ProductName
=
monitor
!=
null
?
monitor
.
product
n
ame
:
""
,
Sn
=
monitor
!=
null
?
monitor
.
sn
:
""
,
status
=
state
,
Location
=
monitor
!=
null
?
monitor
.
location
I
d
:
0
,
status
=
monitor
!=
null
?
monitor
.
status
:
0
,
Location
=
monitor
!=
null
?
monitor
.
location
i
d
:
0
,
};
return
new
ObjectResult
(
result
);
}
...
...
@@ -406,7 +410,11 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
Station_Null
);
}
if
(
upload
.
upload
<=
2
)
if
(
upload
.
upload
==
0
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineOnFree
);
}
if
(
upload
.
upload
!=
2
)
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
...
...
@@ -593,29 +601,32 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
public
IActionResult
Disassemble
([
FromBody
]
Requestdisassemble
disassemble
)
{
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
disassemble
.
section
))
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
//创建 安装完成动作
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
disassemble
.
section
);
if
(
monitor
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
disassemble
.
section
);
if
(
upload
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
Station_Null
);
}
if
(
upload
.
down
<
2
)
if
(
upload
.
down
==
0
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineOnFree
);
}
if
(
upload
.
down
!=
2
)
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
upload
.
down
+=
1
;
_sectionPropertyRepository
.
Update
(
upload
);
//创建 安装完成动作
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
disassemble
.
section
);
if
(
monitor
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
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