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
073d2815
Commit
073d2815
authored
Feb 06, 2021
by
xin.yang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://test.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
64d233a9
42d0244f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
87 additions
and
44 deletions
+87
-44
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+56
-38
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+9
-2
QmsCheckController.cs
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
+11
-2
AutoMES.cs
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
+11
-2
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
073d2815
...
...
@@ -254,15 +254,17 @@ namespace Siger.ApiACC.Controllers
//PLC 反馈结束.
if
(
status
==
(
int
)
TaskResultStatus
.
Complated
)
{
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
fixturetools
==
taskObj
.
fixtureguid
&&
f
.
locationid
==
taskObj
.
locationid
);
if
(
location
==
null
)
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 未找到该工装储位信息"
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
// 业务入口: 上料位-》 入库 如果是上料工装 安装完成 ,绑定 储位与装配
if
(
sectionProperty
.
propertytype
==
1
)
{
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
fixturetools
==
taskObj
.
fixtureguid
&&
f
.
locationid
==
taskObj
.
locationid
);
if
(
location
==
null
)
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 未找到该工装储位信息"
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
//绑定SN 工件到立库储位
if
(
taskObj
.
action
==
TaskAction
.
Step_SXLW_LK
)
{
...
...
@@ -281,40 +283,55 @@ namespace Siger.ApiACC.Controllers
{
//location.sn = "";
location
.
status
=
(
int
)
LocationStatus
.
Out
;
_automationLocation
.
Update
(
location
);
}
}
// CNC 设备
if
(
sectionProperty
.
propertytype
==
2
)
{
if
(
taskObj
.
action
==
TaskAction
.
Step_LK_JGZX
)
{
location
.
status
=
(
int
)
LocationStatus
.
Out
;
_automationLocation
.
Update
(
location
);
}
}
if
(
sectionProperty
.
propertytype
==
4
)
//抽检台
if
(
sectionProperty
.
propertytype
==
3
)
{
if
(
taskObj
.
action
==
TaskAction
.
Step_LK_CJT
)
{
location
.
status
=
(
int
)
LocationStatus
.
Out
;
_automationLocation
.
Update
(
location
);
}
//清洗即 完成
}
//清洗机
if
(
sectionProperty
.
propertytype
==
4
)
{
if
(
taskObj
.
action
==
TaskAction
.
Step_QXJ_LK
)
{
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
fixturetools
==
taskObj
.
fixtureguid
&&
f
.
locationid
==
taskObj
.
locationid
);
if
(
location
==
null
)
//上料 指定的第一道工序
var
route
=
_productRoute
.
GetList
(
f
=>
f
.
productId
==
taskObj
.
productid
&&
f
.
status
==
(
int
)
RowState
.
Valid
,
"serialNumber"
,
true
).
FirstOrDefault
();
if
(
route
==
null
)
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 未找到该工装储位信息"
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
}
if
(
route
.
id
==
location
.
routeid
)
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 工装储位
{
taskObj
.
locationid
}
工序
{
location
.
routeid
}
-
{
location
.
routenum
}
完成"
);
//最后一道工序
location
.
routeid
=
0
;
location
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
location
);
}
else
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 工装储位
{
taskObj
.
locationid
}
工序
{
location
.
routeid
}
-
{
location
.
routenum
}
为完成"
);
}
//location.sn = "";
location
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
location
);
}
}
if
(
monitor
!=
null
&&
taskObj
.
action
==
TaskAction
.
Step_SXLW_LK
)
{
monitor
.
section
=
0
;
}
}
if
(
monitor
!=
null
)
...
...
@@ -397,24 +414,25 @@ namespace Siger.ApiACC.Controllers
Logger
.
WriteLineError
(
$"AutoProcess 清洗机
{
cleanMachine
.
section
}
machineMonitor 为空"
);
return
;
}
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
machineMonitor
.
fixtureguid
,
machineMonitor
.
ordernumber
,
machineMonitor
.
sn
,
""
,
machineMonitor
.
productId
,
machineMonitor
.
productCode
,
machineMonitor
.
locationId
,
machineMonitor
.
route
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
machineMonitor
.
fixtureguid
,
machineMonitor
.
ordernumber
,
machineMonitor
.
sn
,
""
,
machineMonitor
.
productId
,
machineMonitor
.
productCode
,
machineMonitor
.
locationId
,
machineMonitor
.
route
);
}
else
{
var
locationObj
=
_automationLocation
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
locationid
==
tasklist
.
locationid
);
if
(
locationObj
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess 立库 为空"
);
return
;
}
//工件回到立库
locationObj
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
locationObj
);
CreateTask
(
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
tasklist
.
fixtureguid
,
tasklist
.
ordercode
,
tasklist
.
sn
,
"无程序"
,
tasklist
.
productid
,
tasklist
.
productcode
,
tasklist
.
locationid
,
tasklist
.
route
);
return
;
//完成当前任务 退出
}
//else
//{
// var locationObj = _automationLocation.Get(f => f.projectId == PID && f.locationid == tasklist.locationid);
// if (locationObj == null)
// {
// Logger.WriteLineError($"AutoProcess 立库 为空");
// return;
// }
// //工件回到立库
// locationObj.status = (int)LocationStatus.In;
// _automationLocation.Update(locationObj);
// CreateTask(cleanMachine.section, TaskActionType.Unload, TaskAction.Step_QXJ_LK, tasklist.fixtureguid, tasklist.ordercode, tasklist.sn, "无程序", tasklist.productid, tasklist.productcode, tasklist.locationid, tasklist.route);
// return; //完成当前任务 退出
//}
}
else
}
else
{
Logger
.
WriteLineInfo
(
$"AutoProcess 清洗机未完成"
);
}
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
073d2815
...
...
@@ -187,7 +187,14 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
LineIsAutoMode
);
}
var
attr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
taskobj
.
sectionid
&&
f
.
status
==
1
);
var
section
=
taskobj
.
sectionid
;
//抽检台-》上料位特殊逻辑
if
(
taskobj
.
action
==
Automation
.
TaskAction
.
Step_CJT_SXLW
)
{
section
=
taskobj
.
extend1
.
ToInt
();
}
var
attr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
section
&&
f
.
status
==
1
);
if
(
attr
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
...
...
@@ -599,7 +606,7 @@ namespace Siger.ApiACC.Controllers
productcode
=
location
.
productcode
,
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务-
准备下料"
,
remark
=
lineMode
.
inspect
==
1
?
"准备下料-》抽检台"
:
"
准备下料"
,
extend1
=
unixtime
.
ToStr
()
});
...
...
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
View file @
073d2815
...
...
@@ -266,6 +266,7 @@ namespace Siger.ApiACC.Controllers
{
try
{
CreateTaskList
(
req
.
sectionid
,
req
.
productid
,
product
.
code
,
req
.
sn
,
req
.
routeid
.
ToInt
());
AddSnList
(
req
.
materialid
.
ToInt
(),
inspection
,
product
.
code
,
section
.
parentid
);
//把二维码插入到 sn_list表
}
...
...
@@ -328,9 +329,16 @@ namespace Siger.ApiACC.Controllers
if
(
monitor
==
null
)
{
Logger
.
WriteLineInfo
(
$"检验工站
{
section
}
monitor 为空"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
//找到上下料位
var
tasklst
=
_automationTaskList
.
Get
(
f
=>
f
.
no
==
monitor
.
taskno
);
if
(
tasklst
==
null
)
{
Logger
.
WriteLineInfo
(
$"检验工站
{
section
}
tasklst 为空"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
no
=
taskNo
,
...
...
@@ -354,7 +362,8 @@ namespace Siger.ApiACC.Controllers
productcode
=
productcode
,
processid
=
routeid
,
programnumber
=
""
,
remark
=
"质量检验"
,
remark
=
"质量检验->上下料位置"
,
extend1
=
tasklst
.
sectionid
.
ToString
(),
//上下料位发起到检验的工站
});
monitor
.
taskno
=
taskNo
;
...
...
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
View file @
073d2815
...
...
@@ -3,8 +3,10 @@ using Newtonsoft.Json;
using
Siger.Middlelayer.AccRepository.Request
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Configuration
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Common.Helpers
;
using
Siger.Middlelayer.Common.Log
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
...
...
@@ -43,10 +45,17 @@ namespace Siger.ApiACC.Tasks
var
task
=
tasks
.
FirstOrDefault
();
if
(
task
.
send
==
1
)
return
;
var
levelsction
=
dbhelper
.
GetLevelsection
(
task
.
sectionid
);
var
section
=
task
.
sectionid
;
//抽检台-》上料位特殊逻辑
if
(
task
.
action
==
Automation
.
TaskAction
.
Step_CJT_SXLW
)
{
section
=
task
.
extend1
.
ToInt
();
}
var
levelsction
=
dbhelper
.
GetLevelsection
(
section
);
if
(
levelsction
==
null
)
return
;
var
attr
=
dbhelper
.
GetAttribution
(
task
.
sectionid
);
var
attr
=
dbhelper
.
GetAttribution
(
section
);
if
(
attr
==
null
)
return
;
...
...
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