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
6ab8fbe9
Commit
6ab8fbe9
authored
Jan 25, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
e0c0ef05
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
12 deletions
+83
-12
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+26
-4
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+48
-2
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+3
-1
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+2
-1
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+3
-3
IAutomationTaskListRepository.cs
...y/Repositories/Interface/IAutomationTaskListRepository.cs
+1
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
6ab8fbe9
...
...
@@ -197,6 +197,15 @@ namespace Siger.ApiACC.Controllers
taskObj
.
status
=
request
.
status
;
_automationTaskList
.
Update
(
taskObj
);
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
taskObj
.
sectionid
);
if
(
machineStatus
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
machineStatus
.
status
=
request
.
status
;
_automationMachineStatus
.
Update
(
machineStatus
);
if
(
_unitOfWork
.
Commit
()
<=
0
)
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
...
...
@@ -266,6 +275,12 @@ namespace Siger.ApiACC.Controllers
return
;
}
var
updownDic
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
var
uploadStations
=
updownDic
.
Select
(
f
=>
f
.
dval
).
ToList
();
/* 自动任务创建只有CNC 设备;排除上料设备(手动任务) */
var
dictClean
=
stationDicts
.
FirstOrDefault
(
s
=>
s
.
dkey
==
DictKeyValConst
.
CleanStation
);
if
(
dictClean
==
null
)
{
...
...
@@ -287,7 +302,7 @@ namespace Siger.ApiACC.Controllers
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 有清洗机完成,创建清洗剂Task"
);
CreateTask
(
cleanMachine
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
);
CreateTask
(
cleanMachine
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
uploadStations
);
return
;
//完成当前任务 退出
}
}
...
...
@@ -298,7 +313,7 @@ namespace Siger.ApiACC.Controllers
if
(
freeMachine
!=
null
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 普通空闲,创建普通设备上料Task"
);
CreateTask
(
freeMachine
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
);
CreateTask
(
freeMachine
,
TaskActionType
.
Load
,
TaskAction
.
Step_LK_JGZX
,
uploadStations
);
return
;
//完成当前任务 退出
}
//优先级3:其他设备下料 (加工中心 ->立库)
...
...
@@ -308,7 +323,7 @@ namespace Siger.ApiACC.Controllers
if
(
fullMachine
!=
null
&&
cleanMachine
.
status
==(
int
)
Automation
.
MachineStatus
.
Waiting
)
{
Logger
.
WriteLineInfo
(
$"AutoProcess 普通空闲,创建普通设备下料Task "
);
CreateTask
(
fullMachine
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
);
CreateTask
(
fullMachine
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
uploadStations
);
return
;
//完成当前任务 退出
}
...
...
@@ -322,8 +337,15 @@ namespace Siger.ApiACC.Controllers
/// <param name="machineStatus"></param>
/// <param name="actionType"></param>
/// <param name="taskAction"></param>
void
CreateTask
(
siger_automation_machine_status
machineStatus
,
TaskActionType
actionType
,
TaskAction
taskAction
)
/// <param name="uploadStations"></param>
void
CreateTask
(
siger_automation_machine_status
machineStatus
,
TaskActionType
actionType
,
TaskAction
taskAction
,
List
<
string
>
uploadStations
)
{
var
uploadPostion
=
uploadStations
.
Exists
(
f
=>
f
.
Contains
(
machineStatus
.
section
.
ToString
()));
if
(
uploadPostion
)
{
Logger
.
WriteLineInfo
(
$"CreateTask 上料料工站 无需自动创建任务 "
);
return
;
}
//j检查工装监控状态
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
machineStatus
.
section
);
if
(
monitor
==
null
)
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
6ab8fbe9
...
...
@@ -261,7 +261,7 @@ namespace Siger.ApiACC.Controllers
productcode
=
plan
.
product_code
,
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务"
,
remark
=
"手动任务
-准备上料
"
,
});
...
...
@@ -301,10 +301,15 @@ namespace Siger.ApiACC.Controllers
if
(
_unitOfWork
.
Commit
()
>
0
)
{
Logger
.
WriteLineError
(
$"手动任务创建成功-
{
Siger
.
Middlelayer
.
Common
.
Helpers
.
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_LK_SXLW
)}
"
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
/// <summary>
/// 安装完成 -生成指令 unload
...
...
@@ -337,9 +342,50 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
//创建 安装完成动作
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
if
(
monitor
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
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
.
MinValue
,
tasktype
=
Automation
.
TaskActionType
.
Load
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
sectionid
=
assemble
.
section
,
send
=
0
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
projectId
=
ProjectId
,
productid
=
0
,
sn
=
monitor
.
sn
,
ordercode
=
monitor
.
ordernumber
,
fixtureguid
=
monitor
.
fixtureguid
,
locationid
=
monitor
.
locationId
,
productcode
=
monitor
.
productCode
,
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务-安装完成"
,
return
new
ObjectResult
(
1
);
});
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
);
}
}
/// <summary>
/// 准备下料
...
...
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
6ab8fbe9
...
...
@@ -332,7 +332,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"设备正在空闲中"
)]
MachineOnFree
,
[
Description
(
"设备已经生产完成"
)]
MachineProCompalate
MachineProCompalate
,
[
Description
(
"该设备当前无工装状态"
)]
MonitorNotfound
}
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
6ab8fbe9
...
...
@@ -93,7 +93,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join
q
in
_context
.
siger_automation_fixture_tools_product
on
p
.
product_code
equals
q
.
productcode
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
l
in
_context
.
siger_automation_location
on
t
.
guid
equals
l
.
fixturetools
where
q
.
projectId
==
projectId
&&
d
.
OrderNumber
==
ordernumber
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
where
q
.
projectId
==
projectId
&&
d
.
OrderNumber
==
ordernumber
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==(
int
)
RowState
.
Valid
select
new
ResponsePlanlFixtureInfo
{
OrderNumber
=
ordernumber
,
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
View file @
6ab8fbe9
...
...
@@ -36,14 +36,14 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
var
date
=
DateTime
.
Now
;
var
lable
=
date
.
ToString
(
UnixTimeHelper
.
DateTimeFormatYmd
)+
date
.
Hour
+
date
.
Minute
+
date
.
Second
+
date
.
Millisecond
;
var
lableUnix
=
UnixTimeHelper
.
GetNow
();
var
radon
=
new
Random
().
Next
(
1000
,
9999
);
if
(
trigerType
==
TaskTrigerType
.
Auto
)
{
return
$"A
{
radon
}
T
{
lable
}
"
;
return
$"A
{
lableUnix
}
R
{
radon
}
T
{
lable
}
"
;
}
else
{
return
$"M
{
radon
}
T
{
lable
}
"
;
return
$"M
{
lableUnix
}
R
{
radon
}
T
{
lable
}
"
;
}
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationTaskListRepository.cs
View file @
6ab8fbe9
...
...
@@ -10,7 +10,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <summary>
/// 是否能创建任务
///
上下料时候
是否能创建任务
/// </summary>
/// <param name="projectId"></param>
/// <param name="section"></param>
...
...
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