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
c8dff077
Commit
c8dff077
authored
Jan 29, 2021
by
yiyu.li
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://test.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
6ea9d5de
7b8adb92
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
36 additions
and
17 deletions
+36
-17
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+5
-2
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+8
-4
AutomationStateController.cs
...pis/Siger.ApiACC/Controllers/AutomationStateController.cs
+1
-1
AutoMES.cs
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
+7
-1
DBhelper.cs
Server/Apis/Siger.ApiACC/Tasks/DBhelper.cs
+5
-0
AutomationMachineStatusRepository.cs
...ository/Repositories/AutomationMachineStatusRepository.cs
+3
-2
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+7
-7
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
c8dff077
...
...
@@ -315,8 +315,11 @@ namespace Siger.ApiACC.Controllers
_automationLocation
.
Update
(
location
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
taskObj
.
sectionid
);
monitor
.
section
=
0
;
_automationFixtureMonitor
.
Update
(
monitor
);
if
(
monitor
!=
null
)
{
monitor
.
section
=
0
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
}
}
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
c8dff077
...
...
@@ -193,7 +193,11 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
LineIsAutoMode
);
}
var
attr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
taskobj
.
sectionid
&&
f
.
status
==
1
);
if
(
attr
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
host
=
GetHost
();
if
(
string
.
IsNullOrEmpty
(
host
))
{
...
...
@@ -202,7 +206,7 @@ namespace Siger.ApiACC.Controllers
var
sendToPLC
=
new
RequestPLC
{
LineID
=
levelsection
.
parentid
,
RStation
=
taskobj
.
sectionid
,
RStation
=
attr
.
machine
,
Fixture
=
taskobj
.
fixtureguid
,
RequestForm
=
taskobj
.
no
,
RobotStep
=
(
int
)
taskobj
.
action
,
...
...
@@ -268,7 +272,7 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
ScanCode
(
string
code
,
int
id
)
{
if
(
string
.
IsNullOrEmpty
(
code
))
if
(
!
string
.
IsNullOrEmpty
(
code
))
{
var
result
=
_automationFixtureToolsProduct
.
GetPlanFixtureInfo
(
ProjectId
,
code
);
if
(
result
==
null
)
...
...
@@ -471,7 +475,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
//移出 上料位
monitor
.
section
=
0
;
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationStateController.cs
View file @
c8dff077
...
...
@@ -50,7 +50,7 @@ namespace Siger.ApiACC.Controllers
var
item
=
new
ResponseAutomationMachineStatus
{
sectionid
=
d
.
sectionid
,
section
=
$"
{
d
.
section
}
(
{
d
.
linemode
}
)
"
,
section
=
$"
{
d
.
section
}
{
d
.
linemode
}
"
,
enable
=
d
.
enable
,
product
=
""
,
location
=
0
,
...
...
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
View file @
c8dff077
...
...
@@ -38,10 +38,16 @@ namespace Siger.ApiACC.Tasks
var
tasks
=
tasklist
.
OrderBy
(
s
=>
s
.
actiontype
);
var
task
=
tasks
.
FirstOrDefault
();
var
levelsction
=
dbhelper
.
GetLevelsection
(
task
.
sectionid
);
if
(
levelsction
==
null
)
return
;
var
attr
=
dbhelper
.
GetAttribution
(
task
.
sectionid
);
if
(
attr
==
null
)
return
;
var
sendToPLC
=
new
RequestPLC
{
LineID
=
levelsction
.
parentid
,
RStation
=
task
.
sectionid
,
RStation
=
attr
.
machine
,
Fixture
=
task
.
fixtureguid
,
RequestForm
=
task
.
no
,
RobotStep
=
(
int
)
task
.
action
,
...
...
Server/Apis/Siger.ApiACC/Tasks/DBhelper.cs
View file @
c8dff077
...
...
@@ -57,6 +57,11 @@ namespace Siger.ApiACC.Tasks
{
return
AccDbContext
.
siger_project_level_section
.
FirstOrDefault
(
f
=>
f
.
id
==
id
);
}
public
siger_project_machine_attribution
GetAttribution
(
int
section
)
{
return
AccDbContext
.
siger_project_machine_attribution
.
FirstOrDefault
(
f
=>
f
.
station
==
section
&&
f
.
status
==
1
);
}
public
void
Dispose
()
{
CncDbContext
?.
Dispose
();
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationMachineStatusRepository.cs
View file @
c8dff077
...
...
@@ -22,7 +22,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
var
data
=
from
atr
in
_context
.
siger_project_machine_attribution
join
lv
in
_context
.
siger_project_level_section
on
atr
.
station
equals
lv
.
id
join
lm
in
_context
.
siger_automation_line_mode
on
lv
.
parentid
equals
lm
.
id
join
lm
in
_context
.
siger_automation_line_mode
on
lv
.
parentid
equals
lm
.
id
into
lstemp
from
lm
in
lstemp
.
DefaultIfEmpty
()
join
ms
in
_context
.
siger_automation_machine_status
on
lv
.
id
equals
ms
.
section
into
mstemp
join
plv
in
_context
.
siger_project_level_section
on
lv
.
parentid
equals
plv
.
id
from
ms
in
mstemp
.
DefaultIfEmpty
()
...
...
@@ -33,7 +34,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
lastupdate
=
ms
!=
null
?
ms
.
updatetime
.
ToString
()
:
""
,
enable
=
ms
!=
null
?
ms
.
enable
:
1
,
status
=
ms
!=
null
?
ms
.
status
:
1
,
linemode
=
lm
.
mode
==
0
?
"手动模式"
:
"自动模式
"
,
linemode
=
lm
!=
null
?
lm
.
mode
==
0
?
"手动模式"
:
"自动模式"
:
"
"
,
};
Expression
<
Func
<
ResponseAutomationMachineStatus
,
bool
>>
sectionsExpression
=
f
=>
true
;
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
View file @
c8dff077
...
...
@@ -49,15 +49,15 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public
string
CrateTaskNumber
(
TaskTrigerType
trigerType
)
{
var
date
=
DateTime
.
Now
;
var
lable
=
date
.
Year
+
date
.
Day
+
date
.
Hour
+
date
.
Minute
+
date
.
Second
;
var
lableUnix
=
UnixTimeHelper
.
GetNow
();
var
serinum
=
date
.
DayOfYear
+
date
.
Month
+
date
.
Day
+
date
.
Hour
+
date
.
Minute
+
date
.
Second
+
date
.
Millisecond
;
var
dayofyear
=
GetDayOfYear
(
date
);
if
(
trigerType
==
TaskTrigerType
.
Auto
)
{
return
$"
{
date
.
Year
}{
date
.
DayOfYear
}
A
{
lable
}
"
;
}
else
return
$"A
{
date
.
Year
}{
dayofyear
}{
serinum
}
"
;
}
else
{
return
$"
{
date
.
Year
}{
date
.
DayOfYear
}
M
{
lable
}
"
;
return
$"
M
{
date
.
Year
}{
dayofyear
}{
serinum
}
"
;
}
}
/// <summary>
...
...
@@ -68,7 +68,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public
string
CreateRandonSn
(
string
productCode
)
{
var
date
=
DateTime
.
Now
;
var
serinum
=
date
.
DayOfYear
+
date
.
Hour
+
date
.
Minute
+
date
.
Second
+
date
.
Millisecond
;
var
serinum
=
date
.
DayOfYear
+
date
.
Month
+
date
.
Day
+
date
.
Hour
+
date
.
Minute
+
date
.
Second
+
date
.
Millisecond
;
var
dayofyear
=
GetDayOfYear
(
date
);
var
lable
=
$"
{
date
.
Year
}{
dayofyear
}{
serinum
}
"
;
return
lable
;
...
...
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