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
971259e2
Commit
971259e2
authored
Feb 05, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixedbug
parent
675758a1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
25 deletions
+52
-25
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+50
-25
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+2
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
971259e2
...
...
@@ -44,10 +44,11 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationLocationRepository
_automationLocation
;
private
readonly
IAutomationLineMode
_automationLine
;
private
readonly
IProductRouteRepository
_productRoute
;
private
readonly
IAutomationSectionPropertyRepository
_sectionPropertyRepository
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationTaskListRepository
automationTaskList
,
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
,
IAutomationLocationRepository
automationLocation
,
IAutomationLineMode
automationLine
,
IProductRouteRepository
productRoute
)
IAutomationLineMode
automationLine
,
IProductRouteRepository
productRoute
,
IAutomationSectionPropertyRepository
sectionPropertyRepository
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -63,6 +64,7 @@ namespace Siger.ApiACC.Controllers
_automationLocation
=
automationLocation
;
_automationLine
=
automationLine
;
_productRoute
=
productRoute
;
_sectionPropertyRepository
=
sectionPropertyRepository
;
}
/// <summary>
...
...
@@ -409,7 +411,7 @@ namespace Siger.ApiACC.Controllers
});
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
fixtureguid
==
fixtureToolsObj
.
FixtureGuid
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
loading
.
section
);
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
...
...
@@ -483,16 +485,23 @@ namespace Siger.ApiACC.Controllers
{
machineStatus
.
status
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
}
//创建 安装完成动作
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
if
(
monitor
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
var
tasklist
=
_automationTaskList
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
no
==
monitor
.
taskno
);
if
(
tasklist
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
if
(
tasklist
.
status
!=(
int
)
Automation
.
TaskResultStatus
.
Complated
)
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
//检测工序是否配置正确
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
@@ -553,9 +562,12 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
location
.
status
==(
int
)
Automation
.
LocationStatus
.
Out
)
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
var
levelSection
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
unloading
.
section
);
var
lineMode
=
_automationLine
.
Get
(
f
=>
f
.
section
==
levelSection
.
parentid
);
if
(
lineMode
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
LineModeNotfound
);
...
...
@@ -570,8 +582,17 @@ namespace Siger.ApiACC.Controllers
//1. 有检验状态 (立库-》检验工位)
//2. 无检验状态 (立库-》上下料工位)
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
action
=
lineMode
.
inspect
==
1
?
Automation
.
TaskAction
.
Step_LK_CJT
:
Automation
.
TaskAction
.
Step_LK_SXLW
;
var
section
=
unloading
.
section
;
if
(
lineMode
.
inspect
==
1
)
{
var
sectionProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
propertytype
==
3
);
if
(
sectionProperty
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
SectionPropertyNull
);
}
section
=
sectionProperty
.
sectionid
;
}
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
no
=
taskNo
,
...
...
@@ -599,7 +620,7 @@ namespace Siger.ApiACC.Controllers
extend1
=
unixtime
.
ToStr
()
});
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
unloading
.
section
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
...
...
@@ -607,7 +628,7 @@ namespace Siger.ApiACC.Controllers
fixtureguid
=
location
.
fixturetools
,
fixturename
=
location
.
fixturename
,
projectId
=
ProjectId
,
section
=
unloading
.
section
,
section
=
section
,
sn
=
location
.
sn
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
...
...
@@ -655,20 +676,6 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
public
IActionResult
Disassemble
([
FromBody
]
Requestdisassemble
disassemble
)
{
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
disassemble
.
section
);
if
(
machineStatus
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
if
(
machineStatus
.
enable
==
0
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
if
(
machineStatus
.
auto
==
0
)
{
machineStatus
.
status
=
1
;
}
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
disassemble
.
section
))
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
...
...
@@ -679,7 +686,25 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
var
tasklist
=
_automationTaskList
.
Get
(
f
=>
f
.
no
==
monitor
.
taskno
);
if
(
tasklist
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
monitor
.
locationId
);
if
(
location
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
string
.
IsNullOrEmpty
(
location
.
sn
))
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
location
.
status
==
(
int
)
LocationStatus
.
Out
)
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
location
!=
null
)
{
location
.
sn
=
""
;
...
...
@@ -714,7 +739,7 @@ namespace Siger.ApiACC.Controllers
});
//移出 上料位
monitor
.
section
=
0
;
monitor
.
taskno
=
taskNo
;
_automationFixtureMonitor
.
Update
(
monitor
);
...
...
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
971259e2
...
...
@@ -344,6 +344,8 @@ namespace Siger.Middlelayer.Common.ModuleEnum
TaskIsSend
,
[
Description
(
"该储位无工件"
)]
LocationNoSn
,
[
Description
(
"工站属性为空"
)]
SectionPropertyNull
}
public
enum
SeriNumCfg
...
...
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