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
ecfc0698
Commit
ecfc0698
authored
Feb 02, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
8fe9c53b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
13 deletions
+62
-13
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+35
-9
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+2
-1
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+4
-3
ResponseAutomationInfo.cs
...dlelayer.AccRepository/Response/ResponseAutomationInfo.cs
+11
-0
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+10
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
ecfc0698
...
@@ -40,10 +40,11 @@ namespace Siger.ApiACC.Controllers
...
@@ -40,10 +40,11 @@ namespace Siger.ApiACC.Controllers
private
readonly
IProductionBeatSetRepository
_productionBeatSet
;
private
readonly
IProductionBeatSetRepository
_productionBeatSet
;
private
readonly
IAutomationFixtureToolsProductRepository
_automationFixtureToolsProduct
;
private
readonly
IAutomationFixtureToolsProductRepository
_automationFixtureToolsProduct
;
private
readonly
IAutomationFixtureToolsRepository
_automationFixtureTools
;
private
readonly
IAutomationFixtureToolsRepository
_automationFixtureTools
;
private
readonly
IProductRouteRepository
_productRoute
;
public
AutomationController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationLineMode
automationLineMode
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerDict
sigerDict
,
IAutomationTaskListRepository
automationTaskList
,
public
AutomationController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationLineMode
automationLineMode
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerDict
sigerDict
,
IAutomationTaskListRepository
automationTaskList
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationLocationRepository
automationLocation
,
IProductionBeatSetRepository
productionBeatSet
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationLocationRepository
automationLocation
,
IProductionBeatSetRepository
productionBeatSet
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
)
IAutomationFixtureToolsRepository
automationFixtureTools
,
IProductRouteRepository
productRoute
)
{
{
_unitOfWork
=
unitOfWork
;
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
@@ -57,6 +58,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -57,6 +58,7 @@ namespace Siger.ApiACC.Controllers
_productionBeatSet
=
productionBeatSet
;
_productionBeatSet
=
productionBeatSet
;
_automationFixtureToolsProduct
=
automationFixtureToolsProduct
;
_automationFixtureToolsProduct
=
automationFixtureToolsProduct
;
_automationFixtureTools
=
automationFixtureTools
;
_automationFixtureTools
=
automationFixtureTools
;
_productRoute
=
productRoute
;
}
}
/// <summary>
/// <summary>
...
@@ -383,7 +385,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -383,7 +385,7 @@ namespace Siger.ApiACC.Controllers
{
{
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
{
Logger
.
WriteLine
Info
(
$"AutoProcess 有清洗机完成,创建清洗机Task"
);
Logger
.
WriteLine
Error
(
$"AutoProcess 有清洗机完成,创建清洗机Task"
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
cleanMachine
.
section
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
cleanMachine
.
section
);
if
(
monitor
!=
null
)
if
(
monitor
!=
null
)
{
{
...
@@ -436,22 +438,44 @@ namespace Siger.ApiACC.Controllers
...
@@ -436,22 +438,44 @@ namespace Siger.ApiACC.Controllers
monitor
.
route
=
location
.
route
;
monitor
.
route
=
location
.
route
;
_automationFixtureMonitor
.
Update
(
monitor
);
_automationFixtureMonitor
.
Update
(
monitor
);
}
}
CreateTask
(
location
.
section
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
,
location
.
fixture
,
location
.
ordernumber
,
location
.
sn
,
location
.
pn
,
location
.
productId
,
location
.
productCode
,
location
.
location
);
// * 更新下一个工序到储位
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
locationid
==
location
.
lid
);
if
(
locationObj
!=
null
)
{
var
doneRoute
=
_productRoute
.
Get
(
f
=>
f
.
id
==
location
.
route
);
if
(
doneRoute
==
null
)
return
;
var
productRoutes
=
_productRoute
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
productId
==
location
.
productId
&&
f
.
status
==
(
int
)
RowState
.
Valid
&&
f
.
serialNumber
>
doneRoute
.
serialNumber
);
if
(!
productRoutes
.
Any
())
{
locationObj
.
route
=
string
.
Empty
;
}
else
{
var
nextRoute
=
productRoutes
.
OrderBy
(
d
=>
d
.
serialNumber
).
FirstOrDefault
();
locationObj
.
route
=
nextRoute
!=
null
?
nextRoute
.
id
.
ToString
()
:
""
;
}
_automationLocation
.
Update
(
locationObj
);
CreateTask
(
location
.
section
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
,
location
.
fixture
,
location
.
ordernumber
,
location
.
sn
,
location
.
pn
,
location
.
productId
,
location
.
productCode
,
location
.
location
);
return
;
//完成当前任务 退出
return
;
//完成当前任务 退出
}
}
}
}
}
//优先级3:其他设备下料 (加工中心 ->清洗机)
//优先级3:其他设备下料 (加工中心 ->清洗机)
if
(
cleanMachine
!=
null
)
if
(
cleanMachine
!=
null
)
{
{
var
fullMachine
=
machineStatusList
.
FirstOrDefault
(
f
=>
f
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
);
var
fullMachine
=
machineStatusList
.
FirstOrDefault
(
f
=>
f
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
);
if
(
fullMachine
!=
null
&&
cleanMachine
.
status
==(
int
)
Automation
.
MachineStatus
.
Waiting
)
if
(
fullMachine
!=
null
&&
cleanMachine
.
status
==(
int
)
Automation
.
MachineStatus
.
Waiting
)
{
{
Logger
.
WriteLine
Info
(
$"AutoProcess 普通空闲,创建普通设备下料Task "
);
Logger
.
WriteLine
Error
(
$"AutoProcess 普通空闲,创建普通设备下料Task "
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
fullMachine
.
section
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
fullMachine
.
section
);
if
(
monitor
==
null
)
if
(
monitor
==
null
)
{
{
Logger
.
WriteLine
Info
(
$"AutoProcess 找不到CNC监控信息"
);
Logger
.
WriteLine
Error
(
$"AutoProcess 找不到CNC监控信息"
);
return
;
return
;
}
}
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
monitor
.
fixtureguid
,
monitor
.
ordernumber
,
monitor
.
sn
,
"无程序"
,
monitor
.
productId
,
monitor
.
productCode
,
monitor
.
locationId
);
CreateTask
(
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
monitor
.
fixtureguid
,
monitor
.
ordernumber
,
monitor
.
sn
,
"无程序"
,
monitor
.
productId
,
monitor
.
productCode
,
monitor
.
locationId
);
...
@@ -504,9 +528,9 @@ namespace Siger.ApiACC.Controllers
...
@@ -504,9 +528,9 @@ namespace Siger.ApiACC.Controllers
if
(
_unitOfWork
.
Commit
()
>
0
)
if
(
_unitOfWork
.
Commit
()
>
0
)
Logger
.
WriteLineInfo
(
$"CreateTask
工站
完成"
);
Logger
.
WriteLineInfo
(
$"CreateTask
sectionId:
{
section
}
工站
{
EnumHelper
.
GetEnumDesc
(
taskAction
)}
完成"
);
else
else
Logger
.
WriteLineInfo
(
$"CreateTask
工站
失败"
);
Logger
.
WriteLineInfo
(
$"CreateTask
sectionId:
{
section
}
工站
{
EnumHelper
.
GetEnumDesc
(
taskAction
)}
失败"
);
}
}
/// <summary>
/// <summary>
/// 自动匹配储位 储位 ->CNC
/// 自动匹配储位 储位 ->CNC
...
@@ -534,7 +558,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -534,7 +558,8 @@ namespace Siger.ApiACC.Controllers
Route
=
b
.
route_number
.
ToInt
(),
Route
=
b
.
route_number
.
ToInt
(),
RouteName
=
b
.
route_name
,
RouteName
=
b
.
route_name
,
OrderNo
=
autoLocation
.
ordernumber
,
OrderNo
=
autoLocation
.
ordernumber
,
Sn
=
autoLocation
.
sn
Sn
=
autoLocation
.
sn
,
LId
=
autoLocation
.
id
});
});
}
}
...
@@ -565,7 +590,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -565,7 +590,8 @@ namespace Siger.ApiACC.Controllers
productName
=
result
.
ProductName
,
productName
=
result
.
ProductName
,
sn
=
result
.
Sn
,
sn
=
result
.
Sn
,
pn
=
result
.
Pn
,
pn
=
result
.
Pn
,
route
=
result
.
Route
route
=
result
.
Route
,
lid
=
result
.
LId
};
};
}
}
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
ecfc0698
...
@@ -369,7 +369,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -369,7 +369,8 @@ namespace Siger.ApiACC.Controllers
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
sn
=
_automationTaskList
.
CreateRandonSn
(
plan
.
product_code
);
var
sn
=
_automationTaskList
.
CreateRandonSn
(
plan
.
product_code
);
var
route
=
_productRoute
.
GetList
(
f
=>
f
.
productId
==
plan
.
product_id
,
"serialNumber"
,
false
).
FirstOrDefault
();
//上料 指定的第一道工序
var
route
=
_productRoute
.
GetList
(
f
=>
f
.
productId
==
plan
.
product_id
&&
f
.
status
==(
int
)
RowState
.
Valid
,
"serialNumber"
,
false
).
FirstOrDefault
();
if
(
route
==
null
)
if
(
route
==
null
)
{
{
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
ecfc0698
...
@@ -33,7 +33,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
...
@@ -33,7 +33,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
from
u
in
uu
.
DefaultIfEmpty
()
from
u
in
uu
.
DefaultIfEmpty
()
join
r
in
_context
.
siger_project_
beat_set
on
q
.
routeid
equals
r
.
id
into
rr
join
r
in
_context
.
siger_project_
product_route
on
q
.
routeid
equals
r
.
id
into
rr
from
r
in
rr
.
DefaultIfEmpty
()
from
r
in
rr
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAutomationLocation
select
new
ResponseAutomationLocation
...
@@ -56,8 +56,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
...
@@ -56,8 +56,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
status
=
q
.
status
,
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
,
sn
=
q
.
sn
??
""
,
sn
=
q
.
sn
??
""
,
route
=
r
.
route_name
??
""
,
route
=
r
.
name
??
""
,
routenumber
=
r
==
null
?
""
:
r
.
route_number
.
ToString
(),
routenumber
=
r
==
null
?
""
:
r
.
serialNumber
.
ToString
(),
routeid
=
q
.
routeid
,
cate_guid
=
c
.
guid
??
""
,
cate_guid
=
c
.
guid
??
""
,
categoryId
=
c
==
null
?
0
:
c
.
id
categoryId
=
c
==
null
?
0
:
c
.
id
};
};
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationInfo.cs
View file @
ecfc0698
...
@@ -43,6 +43,10 @@ namespace Siger.Middlelayer.AccRepository.Response
...
@@ -43,6 +43,10 @@ namespace Siger.Middlelayer.AccRepository.Response
public
string
productName
{
get
;
set
;
}
public
string
productName
{
get
;
set
;
}
public
int
route
{
get
;
set
;
}
public
int
route
{
get
;
set
;
}
public
string
pn
{
get
;
set
;
}
public
string
pn
{
get
;
set
;
}
/// <summary>
/// location.id主键
/// </summary>
public
int
lid
{
get
;
set
;
}
}
}
...
@@ -59,6 +63,13 @@ namespace Siger.Middlelayer.AccRepository.Response
...
@@ -59,6 +63,13 @@ namespace Siger.Middlelayer.AccRepository.Response
public
string
FixtureGuid
{
get
;
set
;
}
public
string
FixtureGuid
{
get
;
set
;
}
public
string
FixtureName
{
get
;
set
;
}
public
string
FixtureName
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
/// <summary>
/// 储位编号
/// </summary>
public
int
Location
{
get
;
set
;
}
public
int
Location
{
get
;
set
;
}
/// <summary>
/// location.id
/// </summary>
public
int
LId
{
get
;
set
;
}
}
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
View file @
ecfc0698
...
@@ -31,9 +31,19 @@ namespace Siger.Middlelayer.AccRepository.Response
...
@@ -31,9 +31,19 @@ namespace Siger.Middlelayer.AccRepository.Response
/// 工件
/// 工件
/// </summary>
/// </summary>
public
string
sn
{
get
;
set
;
}
public
string
sn
{
get
;
set
;
}
/// <summary>
/// 工序顺序
/// </summary>
public
string
routenumber
{
get
;
set
;
}
public
string
routenumber
{
get
;
set
;
}
/// <summary>
/// 工序萌宠
/// </summary>
public
string
route
{
get
;
set
;
}
public
string
route
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 工序id
/// </summary>
public
int
routeid
{
get
;
set
;
}
/// <summary>
/// 物料状态
/// 物料状态
/// </summary>
/// </summary>
public
int
materialstate
{
get
;
set
;
}
public
int
materialstate
{
get
;
set
;
}
...
...
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