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
aa1df8d2
Commit
aa1df8d2
authored
Feb 10, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixedubug 添加起始工站
parent
ec42324c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
35 deletions
+50
-35
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+0
-0
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+29
-14
QmsCheckController.cs
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
+3
-3
SectionPropertyController.cs
...pis/Siger.ApiACC/Controllers/SectionPropertyController.cs
+1
-1
AutoMES.cs
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
+3
-3
DBhelper.cs
Server/Apis/Siger.ApiACC/Tasks/DBhelper.cs
+9
-9
siger_automation_task_list.cs
...ayer.AccRepository/Entities/siger_automation_task_list.cs
+2
-2
Siger.Middlelayer.License_MarkupCompile.cache
...e/obj/Debug/Siger.Middlelayer.License_MarkupCompile.cache
+3
-3
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
aa1df8d2
This diff is collapsed.
Click to expand it.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
aa1df8d2
...
@@ -185,11 +185,11 @@ namespace Siger.ApiACC.Controllers
...
@@ -185,11 +185,11 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
LineIsAutoMode
);
throw
new
BadRequestException
(
AccEnum
.
LineIsAutoMode
);
}
}
var
section
=
taskobj
.
sectionid
;
var
section
=
taskobj
.
extend1
.
ToInt
()
;
//抽检台-》上料位特殊逻辑
//抽检台-》上料位特殊逻辑
if
(
taskobj
.
action
==
Automation
.
TaskAction
.
Step_CJT_SXLW
)
if
(
taskobj
.
action
==
Automation
.
TaskAction
.
Step_CJT_SXLW
)
{
{
section
=
taskobj
.
extend1
.
ToInt
()
;
section
=
taskobj
.
sectionid
;
}
}
var
attr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
section
&&
f
.
status
==
1
);
var
attr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
section
&&
f
.
status
==
1
);
...
@@ -354,6 +354,11 @@ namespace Siger.ApiACC.Controllers
...
@@ -354,6 +354,11 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
}
}
var
invenProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
propertytype
==
5
);
if
(
invenProperty
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
SectionPropertyNull
);
}
var
unixtime
=
UnixTimeHelper
.
GetNow
();
var
unixtime
=
UnixTimeHelper
.
GetNow
();
_automationTaskList
.
Insert
(
new
siger_automation_task_list
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
{
...
@@ -381,7 +386,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -381,7 +386,7 @@ namespace Siger.ApiACC.Controllers
programnumber
=
""
,
programnumber
=
""
,
remark
=
"手动任务-准备上料"
,
remark
=
"手动任务-准备上料"
,
route
=
route
.
id
,
route
=
route
.
id
,
extend1
=
""
extend1
=
loading
.
section
.
ToStr
(),
});
});
...
@@ -404,7 +409,12 @@ namespace Siger.ApiACC.Controllers
...
@@ -404,7 +409,12 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
[
HttpPost
]
public
IActionResult
CompalateAssemble
([
FromBody
]
requestAutoCompalateAssemble
assemble
)
public
IActionResult
CompalateAssemble
([
FromBody
]
requestAutoCompalateAssemble
assemble
)
{
{
var
invenProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
propertytype
==
5
);
if
(
invenProperty
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
SectionPropertyNull
);
}
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
assemble
.
section
);
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
assemble
.
section
);
if
(
upload
==
null
)
if
(
upload
==
null
)
{
{
...
@@ -447,7 +457,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -447,7 +457,7 @@ namespace Siger.ApiACC.Controllers
tasktype
=
Automation
.
TaskActionType
.
Load
,
tasktype
=
Automation
.
TaskActionType
.
Load
,
operater
=
UserId
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
operatetime
=
DateTime
.
Now
,
sectionid
=
assemble
.
section
,
sectionid
=
invenProperty
.
sectionid
,
send
=
0
,
send
=
0
,
status
=
1
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
completetime
=
DateTime
.
MinValue
,
...
@@ -464,7 +474,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -464,7 +474,8 @@ namespace Siger.ApiACC.Controllers
processid
=
0
,
processid
=
0
,
programnumber
=
""
,
programnumber
=
""
,
remark
=
"手动任务-安装完成"
,
remark
=
"手动任务-安装完成"
,
route
=
monitor
.
route
route
=
monitor
.
route
,
extend1
=
assemble
.
section
.
ToStr
()
});
});
monitor
.
taskno
=
taskNo
;
monitor
.
taskno
=
taskNo
;
...
@@ -489,7 +500,11 @@ namespace Siger.ApiACC.Controllers
...
@@ -489,7 +500,11 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
[
HttpPost
]
public
IActionResult
Unloading
([
FromBody
]
requestAutomationUnloading
unloading
)
public
IActionResult
Unloading
([
FromBody
]
requestAutomationUnloading
unloading
)
{
{
var
invenProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
propertytype
==
5
);
if
(
invenProperty
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
SectionPropertyNull
);
}
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
unloading
.
section
);
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
unloading
.
section
);
if
(
upload
==
null
)
if
(
upload
==
null
)
{
{
...
@@ -541,6 +556,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -541,6 +556,8 @@ namespace Siger.ApiACC.Controllers
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
action
=
lineMode
.
inspect
==
1
?
Automation
.
TaskAction
.
Step_LK_CJT
:
Automation
.
TaskAction
.
Step_LK_SXLW
;
var
action
=
lineMode
.
inspect
==
1
?
Automation
.
TaskAction
.
Step_LK_CJT
:
Automation
.
TaskAction
.
Step_LK_SXLW
;
var
section
=
unloading
.
section
;
var
section
=
unloading
.
section
;
var
fromSection
=
unloading
.
section
;
if
(
lineMode
.
inspect
==
1
)
if
(
lineMode
.
inspect
==
1
)
{
{
var
sectionProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
propertytype
==
3
);
var
sectionProperty
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
propertytype
==
3
);
...
@@ -549,6 +566,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -549,6 +566,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
SectionPropertyNull
);
throw
new
BadRequestException
(
AccEnum
.
SectionPropertyNull
);
}
}
section
=
sectionProperty
.
sectionid
;
section
=
sectionProperty
.
sectionid
;
fromSection
=
sectionProperty
.
sectionid
;
}
}
var
tasklst
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
unloading
.
section
&&
f
.
action
==
action
&&
f
.
status
!=(
int
)
TaskResultStatus
.
Complated
);
var
tasklst
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
unloading
.
section
&&
f
.
action
==
action
&&
f
.
status
!=(
int
)
TaskResultStatus
.
Complated
);
if
(
tasklst
.
Any
())
if
(
tasklst
.
Any
())
...
@@ -565,7 +583,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -565,7 +583,7 @@ namespace Siger.ApiACC.Controllers
tasktype
=
Automation
.
TaskActionType
.
Load
,
tasktype
=
Automation
.
TaskActionType
.
Load
,
operater
=
UserId
,
operater
=
UserId
,
operatetime
=
DateTime
.
MinValue
,
operatetime
=
DateTime
.
MinValue
,
sectionid
=
unloading
.
section
,
sectionid
=
section
,
send
=
0
,
send
=
0
,
status
=
1
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
completetime
=
DateTime
.
MinValue
,
...
@@ -580,7 +598,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -580,7 +598,7 @@ namespace Siger.ApiACC.Controllers
processid
=
0
,
processid
=
0
,
programnumber
=
""
,
programnumber
=
""
,
remark
=
lineMode
.
inspect
==
1
?
"准备下料-》抽检台"
:
"准备下料"
,
remark
=
lineMode
.
inspect
==
1
?
"准备下料-》抽检台"
:
"准备下料"
,
extend1
=
section
.
ToStr
()
extend1
=
fromSection
.
ToString
()
});
});
...
@@ -603,9 +621,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -603,9 +621,7 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
[
HttpPost
]
public
IActionResult
Disassemble
([
FromBody
]
Requestdisassemble
disassemble
)
public
IActionResult
Disassemble
([
FromBody
]
Requestdisassemble
disassemble
)
{
{
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
disassemble
.
section
);
var
upload
=
_sectionPropertyRepository
.
Get
(
f
=>
f
.
sectionid
==
disassemble
.
section
);
if
(
upload
==
null
)
if
(
upload
==
null
)
{
{
...
@@ -644,7 +660,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -644,7 +660,7 @@ namespace Siger.ApiACC.Controllers
tasktype
=
Automation
.
TaskActionType
.
Load
,
tasktype
=
Automation
.
TaskActionType
.
Load
,
operater
=
UserId
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
operatetime
=
DateTime
.
Now
,
sectionid
=
unloadSection
,
sectionid
=
sectionProperty
.
sectionid
,
send
=
0
,
send
=
0
,
status
=
1
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
completetime
=
DateTime
.
MinValue
,
...
@@ -659,10 +675,9 @@ namespace Siger.ApiACC.Controllers
...
@@ -659,10 +675,9 @@ namespace Siger.ApiACC.Controllers
processid
=
0
,
processid
=
0
,
programnumber
=
""
,
programnumber
=
""
,
remark
=
"手动任务-拆卸完成"
,
remark
=
"手动任务-拆卸完成"
,
extend1
=
disassemble
.
section
.
ToStr
()
});
});
//移出 上料位
if
(
_unitOfWork
.
Commit
()
>
0
)
if
(
_unitOfWork
.
Commit
()
>
0
)
{
{
Logger
.
WriteLineError
(
$"拆卸完成任务
{
taskNo
}
创建成功-
{
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_SXLW_LK
)}
"
);
Logger
.
WriteLineError
(
$"拆卸完成任务
{
taskNo
}
创建成功-
{
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_SXLW_LK
)}
"
);
...
...
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
View file @
aa1df8d2
...
@@ -329,7 +329,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -329,7 +329,7 @@ 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
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
section
&&
f
.
action
==
Automation
.
TaskAction
.
Step_LK_CJT
).
LastOrDefault
();
if
(
tasklist
==
null
)
if
(
tasklist
==
null
)
{
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
...
@@ -347,7 +347,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -347,7 +347,7 @@ namespace Siger.ApiACC.Controllers
tasktype
=
Automation
.
TaskActionType
.
Unload
,
tasktype
=
Automation
.
TaskActionType
.
Unload
,
operater
=
UserId
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
operatetime
=
DateTime
.
Now
,
sectionid
=
section
,
sectionid
=
tasklist
.
extend1
.
ToInt
()
,
send
=
0
,
send
=
0
,
status
=
1
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
completetime
=
DateTime
.
MinValue
,
...
@@ -365,7 +365,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -365,7 +365,7 @@ namespace Siger.ApiACC.Controllers
processid
=
routeid
,
processid
=
routeid
,
programnumber
=
""
,
programnumber
=
""
,
remark
=
"质量检验->上下料位置"
,
remark
=
"质量检验->上下料位置"
,
extend1
=
""
,
//上下料位发起到检验的工站
extend1
=
section
.
ToStr
()
,
//上下料位发起到检验的工站
});
});
...
...
Server/Apis/Siger.ApiACC/Controllers/SectionPropertyController.cs
View file @
aa1df8d2
...
@@ -68,7 +68,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -68,7 +68,7 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
[
HttpGet
]
public
IActionResult
GetMonitorSnProduct
(
int
sectionid
)
public
IActionResult
GetMonitorSnProduct
(
int
sectionid
)
{
{
var
tasklist
=
_taskListRepository
.
GetList
(
f
=>
f
.
extend1
==
sectionid
.
ToString
()
&&
f
.
action
==
Automation
.
TaskAction
.
Step_LK_CJT
).
LastOrDefault
();
var
tasklist
=
_taskListRepository
.
GetList
(
f
=>
f
.
sectionid
==
sectionid
&&
f
.
action
==
Automation
.
TaskAction
.
Step_LK_CJT
).
LastOrDefault
();
if
(
tasklist
==
null
)
if
(
tasklist
==
null
)
{
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
...
...
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
View file @
aa1df8d2
...
@@ -46,11 +46,11 @@ namespace Siger.ApiACC.Tasks
...
@@ -46,11 +46,11 @@ namespace Siger.ApiACC.Tasks
if
(
task
.
send
==
1
)
if
(
task
.
send
==
1
)
return
;
return
;
var
section
=
task
.
sectionid
;
var
section
=
task
.
extend1
.
ToInt
()
;
//抽检台-》上料位特殊逻辑
//抽检台-》上料位特殊逻辑
if
(
task
.
action
==
Automation
.
TaskAction
.
Step_CJT_SXLW
)
if
(
task
.
action
==
Automation
.
TaskAction
.
Step_CJT_SXLW
)
{
{
section
=
dbhelper
.
GetPreStation
(
task
)
;
section
=
task
.
sectionid
;
}
}
var
levelsction
=
dbhelper
.
GetLevelsection
(
section
);
var
levelsction
=
dbhelper
.
GetLevelsection
(
section
);
if
(
levelsction
==
null
)
if
(
levelsction
==
null
)
...
...
Server/Apis/Siger.ApiACC/Tasks/DBhelper.cs
View file @
aa1df8d2
...
@@ -70,15 +70,15 @@ namespace Siger.ApiACC.Tasks
...
@@ -70,15 +70,15 @@ namespace Siger.ApiACC.Tasks
{
{
return
AccDbContext
.
siger_project_machine_attribution
.
FirstOrDefault
(
f
=>
f
.
station
==
section
&&
f
.
status
==
1
);
return
AccDbContext
.
siger_project_machine_attribution
.
FirstOrDefault
(
f
=>
f
.
station
==
section
&&
f
.
status
==
1
);
}
}
public
int
GetPreStation
(
siger_automation_task_list
task
)
//
public int GetPreStation(siger_automation_task_list task )
{
//
{
//取抽检工位发起的上料位ID
//
//取抽检工位发起的上料位ID
var
preTask
=
AccDbContext
.
siger_automation_task_list
.
Where
(
f
=>
f
.
sn
==
task
.
sn
&&
f
.
extend1
==
task
.
sectionid
.
ToString
()
&&
f
.
action
==
TaskAction
.
Step_LK_CJT
).
OrderByDescending
(
d
=>
d
.
id
).
FirstOrDefault
();
//
var preTask = AccDbContext.siger_automation_task_list.Where(f => f.sn == task.sn && f.extend1 == task.sectionid.ToString() && f.action == TaskAction.Step_LK_CJT).OrderByDescending(d => d.id).FirstOrDefault();
if
(
preTask
!=
null
)
//
if (preTask != null)
return
preTask
.
sectionid
;
//
return preTask.sectionid;
else
//
else
return
0
;
//
return 0;
}
//
}
public
siger_automation_fixture_tools
GetFixture
(
string
guid
)
public
siger_automation_fixture_tools
GetFixture
(
string
guid
)
{
{
return
AccDbContext
.
siger_automation_fixture_tools
.
FirstOrDefault
(
f
=>
f
.
guid
==
guid
&&
f
.
status
==
1
);
return
AccDbContext
.
siger_automation_fixture_tools
.
FirstOrDefault
(
f
=>
f
.
guid
==
guid
&&
f
.
status
==
1
);
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_task_list.cs
View file @
aa1df8d2
...
@@ -24,7 +24,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
...
@@ -24,7 +24,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
/// </summary>
public
string
fixturename
{
get
;
set
;
}
public
string
fixturename
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 工位ID
/// 工位ID
目的
/// </summary>
/// </summary>
public
int
sectionid
{
get
;
set
;
}
public
int
sectionid
{
get
;
set
;
}
/// <summary>
/// <summary>
...
@@ -103,7 +103,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
...
@@ -103,7 +103,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
public
string
remark
{
get
;
set
;
}
public
string
remark
{
get
;
set
;
}
/// <summary>
/// <summary>
///
准备前往下一个
工站ID
///
发起
工站ID
/// </summary>
/// </summary>
public
string
extend1
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
...
...
Server/PC/Siger.Middlelayer.License/obj/Debug/Siger.Middlelayer.License_MarkupCompile.cache
View file @
aa1df8d2
...
@@ -4,15 +4,15 @@
...
@@ -4,15 +4,15 @@
winexe
winexe
C#
C#
.cs
.cs
E:\gitlabcode
\Laisi_AutoMES2\Server\PC\Siger.Middlelayer.License\obj\Debug\
D:\Code\20210208
\Laisi_AutoMES2\Server\PC\Siger.Middlelayer.License\obj\Debug\
Siger.Middlelayer.License
Siger.Middlelayer.License
none
none
false
false
DEBUG;TRACE
DEBUG;TRACE
E:\gitlabcode
\Laisi_AutoMES2\Server\PC\Siger.Middlelayer.License\App.xaml
D:\Code\20210208
\Laisi_AutoMES2\Server\PC\Siger.Middlelayer.License\App.xaml
11151548125
11151548125
13
8765104
70
13
-9178831
70
121654848548
121654848548
MainWindow.xaml;
MainWindow.xaml;
...
...
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