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
b1b5e769
Commit
b1b5e769
authored
Mar 23, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate Laisi NewFeature
parent
ae082147
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
2 deletions
+141
-2
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+129
-0
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+3
-1
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+1
-1
requestAutoLoad.cs
...iger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
+8
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
b1b5e769
...
@@ -378,6 +378,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -378,6 +378,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
FixtureToolsIsNone
);
throw
new
BadRequestException
(
AccEnum
.
FixtureToolsIsNone
);
}
}
upload
.
upload
=
1
;
upload
.
upload
=
1
;
upload
.
updatetime
=
DateTime
.
Now
;
_sectionPropertyRepository
.
Update
(
upload
);
_sectionPropertyRepository
.
Update
(
upload
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
loading
.
section
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
loading
.
section
);
...
@@ -479,6 +480,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -479,6 +480,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
TaskCreateDone
);
throw
new
BadRequestException
(
AccEnum
.
TaskCreateDone
);
}
}
upload
.
upload
+=
1
;
upload
.
upload
+=
1
;
upload
.
updatetime
=
DateTime
.
Now
;
_sectionPropertyRepository
.
Update
(
upload
);
_sectionPropertyRepository
.
Update
(
upload
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
...
@@ -569,6 +571,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -569,6 +571,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
TaskCreateDone
);
throw
new
BadRequestException
(
AccEnum
.
TaskCreateDone
);
}
}
upload
.
down
+=
1
;
upload
.
down
+=
1
;
upload
.
updatetime
=
DateTime
.
Now
;
_sectionPropertyRepository
.
Update
(
upload
);
_sectionPropertyRepository
.
Update
(
upload
);
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
unloading
.
id
);
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
unloading
.
id
);
...
@@ -728,6 +731,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -728,6 +731,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
TaskCreateDone
);
throw
new
BadRequestException
(
AccEnum
.
TaskCreateDone
);
}
}
upload
.
down
+=
1
;
upload
.
down
+=
1
;
upload
.
updatetime
=
DateTime
.
Now
;
_sectionPropertyRepository
.
Update
(
upload
);
_sectionPropertyRepository
.
Update
(
upload
);
//创建 安装完成动作
//创建 安装完成动作
...
@@ -783,6 +787,131 @@ namespace Siger.ApiACC.Controllers
...
@@ -783,6 +787,131 @@ namespace Siger.ApiACC.Controllers
}
}
}
}
/// <summary>
/// 同工单上料 -获取新工件信息
/// </summary>
/// <param name="section"></param>
/// <param name="scan"></param>
/// <param name="code"></param>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
CurrentOrder
([
FromBody
]
RequestDissasembleAndLoad
request
)
{
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
request
.
section
);
if
(
monitor
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineOnFree
);
}
var
newCode
=
monitor
.
ordernumber
;
if
(!
string
.
IsNullOrEmpty
(
request
.
code
))
{
newCode
=
request
.
code
;
}
var
result
=
_automationFixtureToolsProduct
.
GetPlanFixtureInfo
(
ProjectId
,
newCode
);
if
(
result
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
FixtureOrderNulll
);
}
if
(!
string
.
IsNullOrEmpty
(
request
.
code
))
{
//新扫描的工单,工装与原托盘工装一致
if
(
result
.
FixtureGuid
!=
monitor
.
fixtureguid
)
{
throw
new
BadRequestException
(
AccEnum
.
FixtureDiff
);
}
}
var
sn
=
_automationTaskList
.
CreateRandonSn
(
result
.
ProductCode
);
result
.
Sn
=
sn
;
result
.
status
=
monitor
!=
null
?
monitor
.
status
:
1
;
return
new
ObjectResult
(
result
);
}
/// <summary>
/// 拆卸完成 并上料
/// </summary>
/// <param name="assemble"></param>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
DisassembleAndAssemble
([
FromBody
]
RequestDissasembleAndLoad
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
);
if
(
upload
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
Station_Null
);
}
if
(
upload
.
upload
>
0
)
{
throw
new
BadRequestException
(
AccEnum
.
Uploading
);
}
if
(
upload
.
down
!=
1
)
{
throw
new
BadRequestException
(
AccEnum
.
Downloading
);
}
upload
.
upload
+=
1
;
upload
.
updatetime
=
DateTime
.
Now
;
_sectionPropertyRepository
.
Update
(
upload
);
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
.
Now
,
tasktype
=
Automation
.
TaskActionType
.
Load
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
sectionid
=
invenProperty
.
sectionid
,
send
=
0
,
status
=
1
,
completetime
=
DateTime
.
MinValue
,
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
projectId
=
ProjectId
,
productid
=
monitor
.
productId
,
productname
=
monitor
.
productName
,
sn
=
monitor
.
sn
,
ordercode
=
monitor
.
ordernumber
,
fixtureguid
=
monitor
.
fixtureguid
,
fixturename
=
monitor
.
fixturename
,
locationid
=
monitor
.
locationId
,
productcode
=
monitor
.
productCode
,
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务-下料并安装完成"
,
route
=
monitor
.
route
,
extend1
=
assemble
.
section
.
ToStr
()
});
monitor
.
taskno
=
taskNo
;
_automationFixtureMonitor
.
Update
(
monitor
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
Logger
.
WriteLineError
(
$"安装完成任务
{
taskNo
}
创建成功-
{
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_SXLW_LK
)}
"
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
}
}
}
}
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
b1b5e769
...
@@ -361,7 +361,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
...
@@ -361,7 +361,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"同步报工记录失败"
)]
[
Description
(
"同步报工记录失败"
)]
SyncSnReportErro
,
SyncSnReportErro
,
[
Description
(
"请勿重复提交任务"
)]
[
Description
(
"请勿重复提交任务"
)]
TaskCreateDone
TaskCreateDone
,
[
Description
(
"该工单对应当前工装不一致"
)]
FixtureDiff
,
}
}
public
enum
SeriNumCfg
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
b1b5e769
...
@@ -251,7 +251,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
...
@@ -251,7 +251,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join
r
in
_context
.
siger_project_product_route
on
q
.
routeid
equals
r
.
id
into
rtemp
join
r
in
_context
.
siger_project_product_route
on
q
.
routeid
equals
r
.
id
into
rtemp
from
r
in
rtemp
.
DefaultIfEmpty
()
from
r
in
rtemp
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectId
where
q
.
projectId
==
projectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
//
&& q.status == (int)RowState.Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==
(
int
)
RowState
.
Valid
&&
w
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==
(
int
)
RowState
.
Valid
&&
w
.
status
==
(
int
)
RowState
.
Valid
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
View file @
b1b5e769
...
@@ -46,4 +46,12 @@ namespace Siger.Middlelayer.AccRepository.Request
...
@@ -46,4 +46,12 @@ namespace Siger.Middlelayer.AccRepository.Request
{
{
public
int
section
{
get
;
set
;
}
public
int
section
{
get
;
set
;
}
}
}
/// <summary>
/// 拆卸并上料
/// </summary>
public
class
RequestDissasembleAndLoad
{
public
int
section
{
get
;
set
;
}
public
string
code
{
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