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
70a1d7ff
Commit
70a1d7ff
authored
Feb 06, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
5fd3417b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
52 deletions
+82
-52
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+41
-19
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+10
-2
QmsCheckController.cs
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
+12
-18
SectionPropertyController.cs
...pis/Siger.ApiACC/Controllers/SectionPropertyController.cs
+13
-8
AutoMES.cs
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
+6
-5
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
70a1d7ff
...
@@ -207,11 +207,10 @@ namespace Siger.ApiACC.Controllers
...
@@ -207,11 +207,10 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
}
//if (taskObj.status==(int)TaskResultStatus.Complated)
if
(
taskObj
.
status
==
(
int
)
TaskResultStatus
.
Complated
)
//{
{
// throw new BadRequestException(AccEnum.AutoTaskDone);
throw
new
BadRequestException
(
AccEnum
.
AutoTaskDone
);
//}
}
//更新Tasklist
//更新Tasklist
PlCfeeback
(
taskObj
,
request
.
status
);
PlCfeeback
(
taskObj
,
request
.
status
);
...
@@ -321,31 +320,54 @@ namespace Siger.ApiACC.Controllers
...
@@ -321,31 +320,54 @@ namespace Siger.ApiACC.Controllers
location
.
status
=
(
int
)
LocationStatus
.
Out
;
location
.
status
=
(
int
)
LocationStatus
.
Out
;
_automationLocation
.
Update
(
location
);
_automationLocation
.
Update
(
location
);
}
}
if
(
taskObj
.
action
==
TaskAction
.
Step_CJT_SXLW
)
{
}
}
}
//清洗机
//清洗机
if
(
sectionProperty
.
propertytype
==
4
)
if
(
sectionProperty
.
propertytype
==
4
)
{
{
if
(
taskObj
.
action
==
TaskAction
.
Step_QXJ_LK
)
if
(
taskObj
.
action
==
TaskAction
.
Step_QXJ_LK
)
{
{
//上料 指定的第一道工序
var
route
=
_productRoute
.
GetList
(
f
=>
f
.
productId
==
taskObj
.
productid
&&
f
.
status
==
(
int
)
RowState
.
Valid
,
"serialNumber"
,
true
).
FirstOrDefault
(
);
var
currenRute
=
_productRoute
.
Get
(
f
=>
f
.
id
==
taskObj
.
route
);
if
(
route
==
null
)
if
(
currenRute
==
null
)
{
{
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
}
}
if
(
route
.
id
==
location
.
routeid
)
var
nextRoute
=
_productRoute
.
GetList
(
f
=>
f
.
productId
==
taskObj
.
productid
&&
f
.
serialNumber
>
currenRute
.
serialNumber
&&
f
.
status
==
(
int
)
RowState
.
Valid
,
"serialNumber"
,
false
).
FirstOrDefault
();
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 工装储位
{
taskObj
.
locationid
}
工序
{
location
.
routeid
}
-
{
location
.
routenum
}
完成"
);
var
route
=
0
;
//最后一道工序
if
(
nextRoute
!=
null
)
location
.
routeid
=
0
;
location
.
route
=
"0"
;
location
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
location
);
}
else
{
{
Logger
.
WriteLineInfo
(
$"PlCfeeback 工装储位
{
taskObj
.
locationid
}
工序
{
location
.
routeid
}
-
{
location
.
routenum
}
为完成"
)
;
route
=
nextRoute
.
id
;
}
}
//更新下一到工序
location
.
routeid
=
route
;
location
.
route
=
route
.
ToString
();
location
.
status
=
(
int
)
LocationStatus
.
In
;
_automationLocation
.
Update
(
location
);
Logger
.
WriteLineInfo
(
$"PlCfeeback 工装储位
{
taskObj
.
locationid
}
工序
{
location
.
routeid
}
-
{
location
.
routenum
}
完成"
);
Logger
.
WriteLineInfo
(
$"PlCfeeback 工装储位
{
taskObj
.
locationid
}
下一工序
{
route
}
更新完成"
);
//if (route.id == location.routeid)
//{
// Logger.WriteLineInfo($"PlCfeeback 工装储位{taskObj.locationid} 工序{location.routeid}-{location.routenum}完成");
// //最后一道工序
// location.routeid = 0;
// location.route = "0";
// location.status = (int)LocationStatus.In;
// _automationLocation.Update(location);
//}
//else
//{
// Logger.WriteLineInfo($"PlCfeeback 工装储位{taskObj.locationid} 工序{location.routeid}-{location.routenum}为完成");
//}
}
}
}
}
if
(
monitor
==
null
)
if
(
monitor
==
null
)
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
70a1d7ff
...
@@ -519,9 +519,17 @@ namespace Siger.ApiACC.Controllers
...
@@ -519,9 +519,17 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
LineModeNotfound
);
throw
new
BadRequestException
(
AccEnum
.
LineModeNotfound
);
}
}
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
unloading
.
section
))
var
machineAttr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
unloading
.
section
&&
f
.
status
==
(
int
)
RowState
.
Valid
);
if
(
machineAttr
==
null
)
{
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
machineid
==
machineAttr
.
machine
);
if
(
machineStatus
.
status
!=
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
}
var
unixtime
=
UnixTimeHelper
.
GetNow
();
var
unixtime
=
UnixTimeHelper
.
GetNow
();
...
...
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
View file @
70a1d7ff
...
@@ -329,20 +329,14 @@ namespace Siger.ApiACC.Controllers
...
@@ -329,20 +329,14 @@ namespace Siger.ApiACC.Controllers
private
void
CreateTaskList
(
int
section
,
int
productid
,
string
productcode
,
string
sn
,
int
routeid
)
private
void
CreateTaskList
(
int
section
,
int
productid
,
string
productcode
,
string
sn
,
int
routeid
)
{
{
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
extend1
==
section
.
ToString
()
&&
f
.
action
==
Automation
.
TaskAction
.
Step_LK_CJT
).
LastOrDefault
();
var
monitor
=
_fixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
if
(
tasklist
==
null
)
if
(
monitor
==
null
)
{
{
Logger
.
WriteLineInfo
(
$"检验工站
{
section
}
monitor 为空"
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
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
);
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
{
...
@@ -361,18 +355,18 @@ namespace Siger.ApiACC.Controllers
...
@@ -361,18 +355,18 @@ namespace Siger.ApiACC.Controllers
projectId
=
ProjectId
,
projectId
=
ProjectId
,
productid
=
productid
,
productid
=
productid
,
sn
=
sn
,
sn
=
sn
,
ordercode
=
monitor
.
ordernumber
,
ordercode
=
tasklist
.
ordercode
,
fixturename
=
monitor
.
fixturename
,
fixturename
=
tasklist
.
fixturename
,
productname
=
monitor
.
productN
ame
,
productname
=
tasklist
.
productn
ame
,
fixtureguid
=
monitor
.
fixtureguid
,
fixtureguid
=
tasklist
.
fixtureguid
,
locationid
=
monitor
.
locationI
d
,
locationid
=
tasklist
.
locationi
d
,
productcode
=
productcode
,
productcode
=
productcode
,
processid
=
routeid
,
processid
=
routeid
,
programnumber
=
""
,
programnumber
=
""
,
remark
=
"质量检验->上下料位置"
,
remark
=
"质量检验->上下料位置"
,
extend1
=
tasklst
.
sectionid
.
ToString
()
,
//上下料位发起到检验的工站
extend1
=
""
,
//上下料位发起到检验的工站
});
});
monitor
.
taskno
=
taskNo
;
_unitOfWork
.
Commit
();
_unitOfWork
.
Commit
();
}
}
...
...
Server/Apis/Siger.ApiACC/Controllers/SectionPropertyController.cs
View file @
70a1d7ff
...
@@ -38,6 +38,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -38,6 +38,7 @@ namespace Siger.ApiACC.Controllers
_fixtureMonitor
=
fixtureMonitor
;
_fixtureMonitor
=
fixtureMonitor
;
_routeRepository
=
routeRepository
;
_routeRepository
=
routeRepository
;
_productRepository
=
productRepository
;
_productRepository
=
productRepository
;
_taskListRepository
=
taskListRepository
;
}
}
[
HttpGet
]
[
HttpGet
]
...
@@ -67,16 +68,20 @@ namespace Siger.ApiACC.Controllers
...
@@ -67,16 +68,20 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
[
HttpGet
]
public
IActionResult
GetMonitorSnProduct
(
int
sectionid
)
public
IActionResult
GetMonitorSnProduct
(
int
sectionid
)
{
{
var
res
=
new
ResponseMonitorSnProduct
();
var
tasklist
=
_taskListRepository
.
GetList
(
f
=>
f
.
extend1
==
sectionid
.
ToString
()
&&
f
.
action
==
Automation
.
TaskAction
.
Step_LK_CJT
).
LastOrDefault
();
var
monitor
=
_fixtureMonitor
.
Get
(
q
=>
q
.
section
==
sectionid
);
if
(
tasklist
==
null
)
if
(
monitor
!=
null
)
{
{
var
product
=
_productRepository
.
Get
(
monitor
.
productId
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
res
.
id
=
monitor
.
productId
;
res
.
name
=
product
?.
name
??
""
;
res
.
code
=
monitor
.
productCode
;
res
.
sn
=
monitor
.
sn
;
}
}
var
res
=
new
ResponseMonitorSnProduct
();
//var monitor = _fixtureMonitor.Get(q => q.section == sectionid);
var
product
=
_productRepository
.
Get
(
tasklist
.
productid
);
res
.
id
=
tasklist
.
productid
;
res
.
name
=
product
?.
name
??
""
;
res
.
code
=
tasklist
.
productcode
;
res
.
sn
=
tasklist
.
sn
;
return
new
ObjectResult
(
res
);
return
new
ObjectResult
(
res
);
}
}
}
}
...
...
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
View file @
70a1d7ff
...
@@ -5,7 +5,7 @@ using Siger.Middlelayer.Common;
...
@@ -5,7 +5,7 @@ using Siger.Middlelayer.Common;
using
Siger.Middlelayer.Common.Configuration
;
using
Siger.Middlelayer.Common.Configuration
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Common.Helpers
;
using
Siger.Middlelayer.Common.Helpers
;
using
Siger.Middlelayer.
Common.
Log
;
using
Siger.Middlelayer.Log
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -34,12 +34,13 @@ namespace Siger.ApiACC.Tasks
...
@@ -34,12 +34,13 @@ namespace Siger.ApiACC.Tasks
var
tasklist
=
dbhelper
.
GetTaskList
(
projectId
);
var
tasklist
=
dbhelper
.
GetTaskList
(
projectId
);
if
(!
tasklist
.
Any
())
if
(!
tasklist
.
Any
())
{
{
return
;
return
;
}
}
if
(!
dbhelper
.
CanTask
(
projectId
))
//
if (!dbhelper.CanTask(projectId))
{
//
{
return
;
//
return;
}
//
}
var
tasks
=
tasklist
.
OrderBy
(
s
=>
s
.
actiontype
);
var
tasks
=
tasklist
.
OrderBy
(
s
=>
s
.
actiontype
);
var
task
=
tasks
.
FirstOrDefault
();
var
task
=
tasks
.
FirstOrDefault
();
...
...
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