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
edc534b6
Commit
edc534b6
authored
Jan 28, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
c25b6bee
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
121 additions
and
16 deletions
+121
-16
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+116
-15
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+3
-1
requestAutoLoad.cs
...iger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
+2
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
edc534b6
...
...
@@ -21,6 +21,7 @@ using Siger.Middlelayer.Share.Enum.ModuleEnum;
using
Siger.Middlelayer.Common.Configuration
;
using
Siger.Middlelayer.Common.Helpers
;
using
Newtonsoft.Json
;
using
NPOI.SS.Formula
;
namespace
Siger.ApiACC.Controllers
{
...
...
@@ -452,7 +453,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
//移出 上料位
monitor
.
s
tatus
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
monitor
.
s
ection
=
0
;
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
@@ -500,18 +501,27 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
public
IActionResult
Unloading
([
FromBody
]
requestAutomationUnloading
unloading
)
{
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
unloading
.
section
);
if
(
monitor
==
null
)
//var monitor = _automationFixtureMonitor.Get(f => f.section == unloading.section);
//if (monitor == null)
//{
// Logger.WriteLineInfo($"AutoProcess 找不到CNC监控信息");
// return new ObjectResult(CommonEnum.RecordNotFound);
//}
//if (string.IsNullOrEmpty( monitor.sn))
//{
// Logger.WriteLineInfo($"AutoProcess 找不到CNC监控SN信息");
// return new ObjectResult(CommonEnum.RecordNotFound);
//}
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
locationid
==
unloading
.
locationid
);
if
(
location
==
null
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 找不到CNC监控信息"
);
return
new
ObjectResult
(
CommonEnum
.
RecordNotFound
);
}
if
(
string
.
IsNullOrEmpty
(
monitor
.
sn
))
if
(
string
.
IsNullOrEmpty
(
location
.
sn
))
{
Logger
.
WriteLineInfo
(
$"AutoProcess 找不到CNC监控SN信息"
);
return
new
ObjectResult
(
CommonEnum
.
RecordNotFound
);
return
new
ObjectResult
(
AccEnum
.
LocationNoSn
);
}
var
levelSection
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
unloading
.
section
);
var
lineMode
=
_automationLine
.
Get
(
f
=>
f
.
section
==
levelSection
.
parentid
);
...
...
@@ -540,17 +550,51 @@ namespace Siger.ApiACC.Controllers
completetime
=
DateTime
.
MinValue
,
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
projectId
=
ProjectId
,
productid
=
monitor
.
productI
d
,
sn
=
monitor
.
sn
,
ordercode
=
monitor
.
ordernumber
,
fixtureguid
=
monitor
.
fixtureguid
,
locationid
=
monitor
.
locationI
d
,
productcode
=
monitor
.
productC
ode
,
productid
=
location
.
producti
d
,
sn
=
location
.
sn
,
ordercode
=
location
.
ordernumber
,
fixtureguid
=
location
.
fixturetools
,
locationid
=
location
.
locationi
d
,
productcode
=
location
.
productc
ode
,
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务-准备上料"
,
});
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
unloading
.
section
);
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
{
fixtureguid
=
location
.
fixturetools
,
fixturename
=
location
.
fixturename
,
projectId
=
ProjectId
,
section
=
unloading
.
section
,
sn
=
location
.
sn
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
,
productId
=
location
.
productid
,
productCode
=
location
.
productcode
,
productName
=
location
.
productname
,
ordernumber
=
location
.
ordernumber
,
locationId
=
location
.
locationid
});
}
else
{
monitor
.
sn
=
location
.
sn
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
productId
=
location
.
productid
;
monitor
.
productName
=
location
.
productname
;
monitor
.
productCode
=
location
.
productcode
;
monitor
.
ordernumber
=
location
.
ordernumber
;
monitor
.
locationId
=
location
.
locationid
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
{
...
...
@@ -571,7 +615,64 @@ namespace Siger.ApiACC.Controllers
public
IActionResult
Disassemble
([
FromBody
]
Requestdisassemble
disassemble
)
{
return
new
ObjectResult
(
1
);
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
(!
_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
);
}
//移出 上料位
monitor
.
section
=
0
;
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
no
=
taskNo
,
action
=
Automation
.
TaskAction
.
Step_SXLW_LK
,
actiontype
=
Automation
.
ExcueType
.
None
,
triggertime
=
DateTime
.
Now
,
tasktype
=
Automation
.
TaskActionType
.
Load
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
sectionid
=
disassemble
.
section
,
send
=
0
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
projectId
=
ProjectId
,
productid
=
monitor
.
productId
,
sn
=
monitor
.
sn
,
ordercode
=
monitor
.
ordernumber
,
fixtureguid
=
monitor
.
fixtureguid
,
locationid
=
monitor
.
locationId
,
productcode
=
monitor
.
productCode
,
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务-拆卸完成"
,
});
if
(
_unitOfWork
.
Commit
()
>
0
)
{
Logger
.
WriteLineError
(
$"手动任务-拆卸完成-
{
Siger
.
Middlelayer
.
Common
.
Helpers
.
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_SXLW_LK
)}
"
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
}
}
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
edc534b6
...
...
@@ -341,7 +341,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"产线当前为自动模式"
)]
LineIsAutoMode
,
[
Description
(
"该任务已经下发"
)]
TaskIsSend
TaskIsSend
,
[
Description
(
"该储位无工件"
)]
LocationNoSn
,
}
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
View file @
edc534b6
...
...
@@ -31,6 +31,8 @@ namespace Siger.Middlelayer.AccRepository.Request
{
public
int
section
{
get
;
set
;
}
public
int
locationid
{
get
;
set
;
}
}
/// <summary>
...
...
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