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
b9a88432
Commit
b9a88432
authored
Jan 23, 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
4cf60917
77fcff6a
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
464 additions
and
67 deletions
+464
-67
associateProduct.vue
Html/src/view/fms/associate/associateProduct.vue
+1
-1
accountInfo.vue
Html/src/view/fms/config/accountInfo.vue
+1
-1
storageInfoQuery.vue
Html/src/view/wms/whStatusQuery/storageInfoQuery.vue
+247
-49
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+79
-10
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+3
-1
siger_automation_fixture_tools_monitor.cs
...sitory/Entities/siger_automation_fixture_tools_monitor.cs
+8
-1
siger_automation_fixture_tools_product.cs
...sitory/Entities/siger_automation_fixture_tools_product.cs
+4
-0
siger_automation_task_list.cs
...ayer.AccRepository/Entities/siger_automation_task_list.cs
+6
-2
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+36
-0
IAutomationFixtureToolsProductRepository.cs
...ies/Interface/IAutomationFixtureToolsProductRepository.cs
+11
-0
ResponseProductFixtureInfo.cs
...ayer.AccRepository/Response/ResponseProductFixtureInfo.cs
+40
-0
DB.script
Server/Infrastructure/Script/DB.script
+28
-2
No files found.
Html/src/view/fms/associate/associateProduct.vue
View file @
b9a88432
...
...
@@ -139,7 +139,7 @@
</div>
</div>
<div
slot=
"footer"
>
<Button
type=
"text"
size=
"large"
@
click=
"
this.
addmodal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"text"
size=
"large"
@
click=
"addmodal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"primary"
size=
"large"
@
click=
"addPost()"
>
{{
$t
(
'1011'
)
}}
</Button>
</div>
</Modal>
...
...
Html/src/view/fms/config/accountInfo.vue
View file @
b9a88432
...
...
@@ -143,7 +143,7 @@
</div>
</div>
<div
slot=
"footer"
>
<Button
type=
"text"
size=
"large"
@
click=
"
this.
addmodal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"text"
size=
"large"
@
click=
"addmodal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"primary"
size=
"large"
@
click=
"addPost()"
>
{{
$t
(
'1011'
)
}}
</Button>
</div>
</Modal>
...
...
Html/src/view/wms/whStatusQuery/storageInfoQuery.vue
View file @
b9a88432
...
...
@@ -9,18 +9,24 @@
:value=
"item.id"
:key=
"index"
:label=
"item.name"
>
{{
item
.
name
}}
</Option
>
>
{{
item
.
name
}}
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label>
{{
$t
(
5500316
)
}}
:
</label>
<Cascader
class=
"searchSelect"
:data=
"storageTree"
change-on-select
v-model=
"storageValue"
@
on-change=
"changeStorage"
></Cascader>
<Select
v-model=
"storageid"
label-in-value
clearable
filterable
filter-by-label
class=
"searchSelect"
>
<Option
v-for=
"(item,index) in storageList"
:value=
"item.id"
:key=
"index"
:label=
"item.name"
>
{{
item
.
name
}}
</Option>
</Select>
</div>
<div
class=
"searchBtn"
>
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
@
click=
"tosearch()"
>
{{
$t
(
1001
)
}}
</Button>
<
!--
<
Button
type=
"success"
class=
"twoWord"
icon=
"md-add-circle"
@
click=
"add()"
>
{{
$t
(
'1002'
)
}}
</Button>
<Button
type=
"warning"
class=
"twoWord"
icon=
"ios-create-outline"
@
click=
"edit()"
>
{{
$t
(
'1003'
)
}}
</Button>
<Button
type=
"success"
class=
"twoWord"
icon=
"md-add-circle"
@
click=
"add()"
>
{{
$t
(
'1002'
)
}}
</Button>
<
!--
<
Button
type=
"warning"
class=
"twoWord"
icon=
"ios-create-outline"
@
click=
"edit()"
>
{{
$t
(
'1003'
)
}}
</Button>
<Button
type=
"error"
class=
"twoWord intervalRight"
icon=
"md-close-circle"
@
click=
"dele()"
>
{{
$t
(
1004
)
}}
</Button>
<Button
type=
"primary"
class=
"fourWord"
icon=
"md-download"
@
click=
"loadexcel()"
>
{{
$t
(
'1005'
)
}}
</Button>
<Upload
...
...
@@ -68,47 +74,80 @@
</div>
</div>
<Modal
class=
"newModalClass"
v-model=
"addmodal"
:styles=
"
{width:'
40
0px'}">
<Modal
class=
"newModalClass"
v-model=
"addmodal"
:styles=
"
{width:'
65
0px'}">
<p
slot=
"header"
>
<span
v-show=
"type==1"
>
{{
$t
(
'1002'
)
}}
</span>
<span
v-show=
"type==2"
>
{{
$t
(
'1003'
)
}}
</span>
</p>
<div
style=
""
>
<div
class=
"demo-spin-col"
>
<Spin
fix
v-if=
"spinShow"
>
<div>
正在上传...
</div>
</Spin>
<div
class=
"filter"
>
<label><i>
*
</i>
{{
$t
(
8070
)
}}
:
</label>
<Select
v-model=
"
warehouseid1"
label-in-value
clearable
filterable
filter-by-label
class=
"searchSelect"
>
<Select
v-model=
"
addwarehouseid"
label-in-value
clearable
filterable
filter-by-label
@
on-change=
"changeWarehouse1"
class=
"searchSelect"
>
<Option
v-for=
"(item,index) in whdata
1
"
v-for=
"(item,index) in whdata"
:value=
"item.id"
:key=
"index"
:label=
"item.name"
>
{{
item
.
name
}}
</Option
>
>
{{
item
.
name
}}
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label><i>
*
</i>
储位信息:
</label>
<Input
type=
"text"
class=
"searchInput"
v-model=
"warehouseid1"
/>
<label><i>
*
</i>
{{
$t
(
5500316
)
}}
:
</label>
<Select
v-model=
"addstorageid"
label-in-value
clearable
filterable
filter-by-label
class=
"searchSelect"
>
<Option
v-for=
"(item,index) in storageList1"
:value=
"item.id"
:key=
"index"
:label=
"item.name"
>
{{
item
.
name
}}
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label><i>
*
</i>
工装类
别
:
</label>
<
Input
type=
"text"
class=
"searchInput"
v-model=
"warehouseid1"
/
>
<label><i>
*
</i>
工装类
型
:
</label>
<
Cascader
class=
"searchSelect"
:data=
"frockTypeTree"
v-model=
"parentType"
change-on-select
@
on-change=
"changeFrockType1"
></Cascader
>
</div>
<div
class=
"filter"
>
<label><i>
*
</i>
工装编号:
</label>
<Input
type=
"text"
class=
"searchInput"
v-model=
"warehouseid1"
/>
<label><i>
*
</i>
工装名称:
</label>
<Select
v-model=
"addfrockid"
label-in-value
clearable
filterable
filter-by-label
class=
"searchSelect"
>
<Option
v-for=
"(item,index) in addfrockList"
:value=
"item.id"
:key=
"index"
:label=
"item.name+'#'+item.code"
>
{{
item
.
name
+
'#'
+
item
.
code
}}
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label>
<i>
*
</i>
附件
:
</label>
<Input
type=
"text"
class=
"searchInput"
v-model=
"
warehouseid1
"
/>
<label>
备注
:
</label>
<Input
type=
"text"
class=
"searchInput"
v-model=
"
addremark
"
/>
</div>
<div
class=
"filter"
>
<label><i>
*
</i>
备注:
</label>
<Input
type=
"text"
class=
"searchInput"
v-model=
"warehouseid1"
/>
<div>
<label>
上传文件:
</label>
<div
class=
"accountInfoUploadFile"
>
<Upload
ref=
"upload"
:show-upload-list=
"false"
:on-success=
"handleSuccess1"
:before-upload=
"handleBeforeUpload"
:on-error=
"handleError1"
type=
"drag"
:headers=
"headers"
:action=
"UploadAction"
>
<div
class=
"descicon"
style=
""
>
<Icon
type=
"md-cloud-upload"
size=
"15"
></Icon>
<span>
上传文件
</span>
</div>
</Upload>
<div
v-show=
"filename"
class=
"hasfile"
>
{{
filename
}}
<Icon
@
click
.
native=
"delfile"
type=
"ios-close-circle"
size=
"15"
/></div>
</div>
</div>
</div>
<div
slot=
"footer"
>
<Button
type=
"text"
size=
"large"
@
click=
"
this.
modal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"text"
size=
"large"
@
click=
"
add
modal=false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"primary"
size=
"large"
@
click=
"addPost()"
>
{{
$t
(
'1011'
)
}}
</Button>
</div>
</Modal>
...
...
@@ -121,11 +160,11 @@ export default {
return
{
whdata
:[],
//仓库列表
warehouseid
:
""
,
//仓库id
//储位树形结构
storageTree
:[],
storageValue
:[],
//储位数据
//储位
storageList
:[],
storageid
:
""
,
//储位id
//列表
total
:
0
,
page
:
1
,
pagesize
:
10
,
...
...
@@ -204,14 +243,33 @@ export default {
}
],
addmodal
:
true
,
//添加弹窗
whdata1
:[],
//仓库数据集合
warehouseid1
:
''
,
//仓库id
//弹窗
addmodal
:
false
,
//添加弹窗
addwarehouseid
:
''
,
//仓库id
type
:
1
,
storageList1
:[],
//储位列表
addstorageid
:
''
,
//储位id
frockTypeTree
:[],
//工装类型
parentType
:[],
addfrockList
:[],
//工装列表
addfrockid
:
''
,
//工装名称
addremark
:
''
,
//备注
filename
:
''
,
fileurl
:
''
,
UploadAction
:
this
.
axios
.
publicPath
+
"config/upload/UploadImage"
,
headers
:
{
token
:
localStorage
.
getItem
(
"token"
),
timestamp
:
localStorage
.
getItem
(
"timestamp"
),
nonce
:
localStorage
.
getItem
(
"nonce"
),
sign
:
localStorage
.
getItem
(
"sign"
),
},
spinShow
:
false
,
}
},
created
(){
this
.
initWarehouse
();
//仓库
this
.
initStorage
();
this
.
tableColumns1
=
this
.
$time
.
initTableTitle
(
this
.
tableColumns1
);
},
methods
:{
...
...
@@ -240,52 +298,127 @@ export default {
},
//切换仓库
changeWarehouse
(
value
){
this
.
storage
Tree
=
[];
this
.
storage
List
=
[];
this
.
storageid
=
""
;
if
(
value
!=
undefined
){
this
.
warehouseid
=
value
.
value
;
this
.
initStorage
();
}
},
changeWarehouse1
(
value
){
this
.
storageList1
=
[];
this
.
addstorageid
=
""
;
if
(
value
!=
undefined
){
this
.
warehouseid
=
value
.
value
;
this
.
addinitStorage
();
}
},
//储位
initStorage
(){
let
params
=
{
id
:
this
.
warehouseid
?
this
.
warehouseid
:
0
}
page
:
1
,
pageSize
:
1000000
,
id
:
this
.
warehouseid
,
// 仓库id
isWarehouse
:
1
,
};
this
.
axios
.
request
({
url
:
"/wms/Location/GetLocationList"
,
params
,
method
:
"get"
,
})
.
then
(
(
res
)
=>
{
this
.
storageList
=
[];
let
data
=
res
.
data
.
data
;
if
(
res
.
data
.
ret
==
1
&&
Array
.
isArray
(
data
)
&&
data
.
length
)
{
this
.
storageList
=
res
.
data
.
data
;
}
}
);
},
addinitStorage
(){
let
params
=
{
page
:
1
,
pageSize
:
1000000
,
id
:
this
.
addwarehouseid
,
// 仓库id
isWarehouse
:
1
,
};
this
.
axios
.
request
({
url
:
"/wms/Location/GetLocation
TypeListNoPage
"
,
url
:
"/wms/Location/GetLocation
List
"
,
params
,
method
:
"get"
,
})
.
then
(
(
res
)
=>
{
this
.
storageList1
=
[];
let
data
=
res
.
data
.
data
;
if
(
res
.
data
.
ret
==
1
&&
Array
.
isArray
(
data
)
&&
data
.
length
)
{
this
.
storageList1
=
res
.
data
.
data
;
}
}
);
},
//工装类型
initFrockType
(){
this
.
axios
.
request
({
url
:
"/acc/FixtureTools/GetCategoryList"
,
method
:
"get"
,
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
==
1
)
{
let
arr
=
res
.
data
.
data
.
children
;
this
.
storageTree
=
arr
;
let
arr
=
res
.
data
.
data
;
this
.
contentTree
(
arr
);
this
.
frockTypeTree
=
arr
;
}
});
},
contentTree
(
arr
)
{
arr
.
forEach
(
ele
=>
{
ele
.
disabled
=
false
;
ele
.
value
=
ele
.
id
;
ele
.
label
=
ele
.
name
;
if
(
ele
.
children
.
length
!=
0
&&
ele
.
children
!=
undefined
&&
ele
.
children
!=
null
ele
.
children
!=
null
&&
ele
.
children
.
length
!=
0
)
{
this
.
contentTree
(
ele
.
children
);
}
else
{
ele
.
children
=
[]
}
});
},
//切换储位
changeStorage
(
value
){
this
.
storageid
=
""
;
changeFrockType1
(
value
){
this
.
parentTypeid
=
""
;
this
.
parentType
=
[]
;
if
(
value
!=
undefined
&&
value
.
length
){
this
.
storageid
=
value
[
value
.
length
-
1
];
this
.
parentTypeid
=
value
[
value
.
length
-
1
];
this
.
parentType
=
value
;
this
.
getFrocksChange
();
}
},
getFrocksChange
(){
this
.
addfrockid
=
''
;
let
params
=
{
category
:
this
.
parentTypeid
,
//工装类型id
code
:
''
,
name
:
''
,
state
:
1
,
//0停用 1可用
page
:
1
,
pagesize
:
1000000
,
toexcel
:
0
//0查询 1导出
}
this
.
axios
.
request
({
url
:
"/acc/FixtureTools/GetPageList"
,
params
,
method
:
"get"
,
})
.
then
((
res
)
=>
{
this
.
addfrockList
=
[];
let
data
=
res
.
data
.
data
;
if
(
res
.
data
.
ret
==
1
&&
Array
.
isArray
(
data
)
&&
data
.
length
)
{
this
.
addfrockList
=
res
.
data
.
data
;
}
});
},
tosearch
(){
this
.
page
=
1
;
this
.
pagesize
=
10
;
...
...
@@ -293,15 +426,15 @@ export default {
},
search
(
toexcel
){
let
params
=
{
wa
r
ehouseid
:
this
.
warehouseid
,
//仓库id
storage
id
:
this
.
storageid
,
//储位id
wa
v
ehouseid
:
this
.
warehouseid
,
//仓库id
location
id
:
this
.
storageid
,
//储位id
page
:
this
.
page
,
pagesize
:
this
.
pagesize
,
toexcel
:
toexcel
//0查询 1导出
}
this
.
detailobj
=
{};
this
.
axios
.
request
({
url
:
"/
wms/storageInfoQuery/search
"
,
url
:
"/
acc/AutomationLocation/GetPageList
"
,
params
,
method
:
"get"
,
})
...
...
@@ -309,7 +442,7 @@ export default {
if
(
toexcel
===
1
){
if
(
res
.
data
.
ret
===
1
)
{
window
.
location
.
href
=
axios
.
publicPath
+
""
+
res
.
data
.
data
;
this
.
axios
.
publicPath
+
""
+
res
.
data
.
data
;
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
...
...
@@ -325,6 +458,37 @@ export default {
}
});
},
add
(){
this
.
type
=
1
;
this
.
addmodal
=
true
;
},
/*********文件上传 start******** */
handleBeforeUpload
(
file
){
this
.
spinShow
=
true
;
if
(
!
file
){
this
.
spinShow
=
false
;
return
false
;
}
},
handleSuccess1
(
res
,
file
)
{
this
.
spinShow
=
false
;
if
(
res
.
ret
==
1
)
{
this
.
$Message
.
success
(
this
.
$t
(
"100378"
));
this
.
filename
=
file
.
name
;
this
.
fileurl
=
res
.
data
;
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
msg
+
''
));
}
},
handleError1
(){
this
.
spinShow
=
false
;
this
.
$Message
.
error
(
this
.
$t
(
"600512"
)
+
"!"
);
},
delfile
(){
this
.
filename
=
''
;
this
.
fileurl
=
''
;
},
/*********文件上传 end******** */
handleRowChange
(
currentRow
,
oldCurrentRow
)
{
this
.
detailobj
=
currentRow
;
},
...
...
@@ -340,6 +504,39 @@ export default {
}
}
</
script
>
<
style
>
<
style
lang=
"less"
>
.accountInfoUploadFile
{
display
:
inline-block
;
position
:
relative
;
left
:
5px
;
.ivu-upload{
display
:
inline-block
;
width
:
140px
;
height
:
29px
;
vertical-align
:
middle
;
.descicon{
width
:
140px
;
height
:
29px
;
line-height
:
29px
;
}
}
.ivu-upload-drag
{
border
:
1px
solid
#dcdee2
!important
;
}
.ivu-upload-drag
:hover
{
border
:
1px
solid
#2d8cf0
!important
;
}
.hasfile
{
display
:
inline-block
;
position
:
relative
;
left
:
-140px
;
top
:
29px
;
i{
color
:
red
;
font-size
:
15px
;
cursor
:
pointer
;
vertical-align
:
top
;
}
}
}
</
style
>
\ No newline at end of file
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
b9a88432
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Mvc
;
using
OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Request
;
...
...
@@ -30,9 +31,11 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
private
readonly
IProductPlanDetails
_planDetails
;
private
readonly
IProductPlanRepository
_productPlan
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
private
readonly
IAutomationFixtureToolsProductRepository
_automationFixtureToolsProduct
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationTaskListRepository
automationTaskList
,
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
)
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -42,6 +45,8 @@ namespace Siger.ApiACC.Controllers
_automationTaskList
=
automationTaskList
;
_planDetails
=
planDetails
;
_productPlan
=
productPlan
;
_automationFixtureMonitor
=
automationFixtureMonitor
;
_automationFixtureToolsProduct
=
automationFixtureToolsProduct
;
}
/// <summary>
...
...
@@ -130,15 +135,38 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
GetLoadingState
(
int
section
)
{
var
data
=
new
ResponseAutomationInfo
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
var
result
=
new
ResponsePlanlFixtureInfo
{
sn
=
"sn0001"
,
wo
=
"wo123123"
OrderNumber
=
monitor
.
ordernumber
,
ProductCode
=
monitor
.
productCode
,
ProductName
=
monitor
.
productName
,
Sn
=
monitor
.
sn
,
status
=
monitor
.
status
,
Location
=
monitor
.
locationId
,
};
return
new
ObjectResult
(
data
);
return
new
ObjectResult
(
result
);
}
/// <summary>
/// 扫描
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
ScanCode
(
string
code
)
{
var
result
=
_automationFixtureToolsProduct
.
GetPlanFixtureInfo
(
ProjectId
,
code
);
if
(
result
==
null
)
{
throw
new
BadRequestException
(
CncEnum
.
PlanHasExist
);
}
var
sn
=
_automationTaskList
.
CreateRandonSn
(
result
.
ProductCode
);
result
.
Sn
=
sn
;
return
new
ObjectResult
(
result
);
}
/// <summary>
/// 准备上料 -生成指令
/// 准备上料 -生成指令
load
/// </summary>
/// <param name="loading"></param>
/// <returns></returns>
...
...
@@ -179,13 +207,18 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
CncEnum
.
PlanHasExist
);
}
//检查工装
var
fixtureToolsObj
=
_automationFixtureToolsProduct
.
GetFixtureInfoByProductCode
(
ProjectId
,
plan
.
product_code
);
if
(
fixtureToolsObj
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
FixtureToolsIsNone
);
}
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
sn
=
_automationTaskList
.
CreateRandonSn
(
plan
.
product_code
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
guid
=
taskNo
,
no
=
taskNo
,
action
=
Automation
.
TaskAction
.
Step_LK_SXLW
,
actiontype
=
Automation
.
ExcueType
.
None
,
triggertime
=
DateTime
.
MinValue
,
...
...
@@ -201,10 +234,46 @@ namespace Siger.ApiACC.Controllers
productid
=
plan
.
product_id
,
sn
=
sn
,
ordercode
=
plandts
.
OrderNumber
,
remark
=
"手动任务"
,
fixtureguid
=
fixtureToolsObj
.
FixtureGuid
,
locationid
=
fixtureToolsObj
.
Location
,
remark
=
"手动任务"
,
});
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
fixtureguid
==
fixtureToolsObj
.
FixtureGuid
);
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
{
fixtureguid
=
fixtureToolsObj
.
FixtureGuid
,
projectId
=
ProjectId
,
section
=
loading
.
section
,
sn
=
sn
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
status
=(
int
)
Automation
.
MachineStatus
.
Produce
,
productCode
=
plan
.
product_code
,
productName
=
plan
.
product_name
,
ordernumber
=
plandts
.
OrderNumber
,
locationId
=
fixtureToolsObj
.
Location
});
}
else
{
monitor
.
sn
=
sn
;
monitor
.
section
=
loading
.
section
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
productName
=
plan
.
product_name
;
monitor
.
productCode
=
plan
.
product_code
;
monitor
.
ordernumber
=
plandts
.
OrderNumber
;
monitor
.
locationId
=
fixtureToolsObj
.
Location
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
else
...
...
@@ -212,7 +281,7 @@ namespace Siger.ApiACC.Controllers
}
/// <summary>
/// 安装完成 -生成指令
/// 安装完成 -生成指令
unload
/// </summary>
/// <param name="assemble"></param>
/// <returns></returns>
...
...
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
b9a88432
...
...
@@ -324,7 +324,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"设备正在使用中"
)]
MachineBusy
,
[
Description
(
"任务进行中"
)]
TaskProcessing
TaskProcessing
,
[
Description
(
"产品工装未找到"
)]
FixtureToolsIsNone
,
}
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_monitor.cs
View file @
b9a88432
...
...
@@ -9,7 +9,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary>
/// 工装ID
/// </summary>
public
int
fixtureI
d
{
get
;
set
;
}
public
string
fixturegui
d
{
get
;
set
;
}
/// <summary>
/// 当前工站ID
/// </summary>
...
...
@@ -34,5 +34,12 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 更新时间
/// </summary>
public
DateTime
updatetime
{
get
;
set
;
}
public
string
ordernumber
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
productCode
{
get
;
set
;
}
public
string
productName
{
get
;
set
;
}
public
int
locationId
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_product.cs
View file @
b9a88432
...
...
@@ -19,6 +19,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public
int
productid
{
get
;
set
;
}
/// <summary>
/// 产品CODE
/// </summary>
public
string
productcode
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_task_list.cs
View file @
b9a88432
...
...
@@ -10,7 +10,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public
class
siger_automation_task_list
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 任务编号
/// </summary>
public
string
no
{
get
;
set
;
}
/// <summary>
/// 工位ID
/// </summary>
...
...
@@ -50,7 +54,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// <summary>
/// 工装GUID
/// </summary>
public
int
fixturetools
{
get
;
set
;
}
public
string
fixtureguid
{
get
;
set
;
}
/// <summary>
/// Task 执行动作类型 1 手动 2 自动
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
b9a88432
...
...
@@ -20,6 +20,22 @@ namespace Siger.Middlelayer.AccRepository.Repositories
_context
=
context
;
}
public
ResponseProductFixtureInfo
GetFixtureInfoByProductCode
(
int
projectId
,
string
productCode
)
{
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools_product
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
&&
q
.
productcode
==
productCode
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseProductFixtureInfo
{
FixtureId
=
t
.
id
,
FixtureGuid
=
t
.
guid
,
ProductCode
=
q
.
productcode
,
Location
=
l
.
locationid
,
};
return
query
.
FirstOrDefault
();
}
public
IPagedCollectionResult
<
ResponseAumationFixtureToolsProduct
>
GetPagedList
(
int
category
,
int
tool
,
int
product
,
int
projectid
,
int
page
,
int
pagesize
)
{
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools_product
...
...
@@ -67,5 +83,25 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseAumationFixtureToolsProduct
>(
entities
,
totalCount
);
}
public
ResponsePlanlFixtureInfo
GetPlanFixtureInfo
(
int
projectId
,
string
ordernumber
)
{
var
query
=
from
d
in
_context
.
siger_project_product_plan_detail
join
p
in
_context
.
siger_project_product_plan
on
d
.
PlanId
equals
p
.
id
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
select
new
ResponsePlanlFixtureInfo
{
OrderNumber
=
ordernumber
,
ProductName
=
p
.
product_name
,
ProductCode
=
q
.
productcode
,
Location
=
l
.
locationid
,
};
return
query
.
FirstOrDefault
();
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsProductRepository.cs
View file @
b9a88432
...
...
@@ -8,5 +8,16 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
public
interface
IAutomationFixtureToolsProductRepository
:
IAccRepositoryBase
<
siger_automation_fixture_tools_product
>
{
IPagedCollectionResult
<
ResponseAumationFixtureToolsProduct
>
GetPagedList
(
int
category
,
int
tool
,
int
product
,
int
projectid
,
int
page
,
int
pagesize
);
ResponseProductFixtureInfo
GetFixtureInfoByProductCode
(
int
projectId
,
string
productCode
);
/// <summary>
/// 工令单获取 工装信息
/// </summary>
/// <param name="ordernumber"></param>
/// <returns></returns>
ResponsePlanlFixtureInfo
GetPlanFixtureInfo
(
int
projectId
,
string
ordernumber
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseProductFixtureInfo.cs
0 → 100644
View file @
b9a88432
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Response
{
public
class
ResponseProductFixtureInfo
{
/// <summary>
/// 工装ID
/// </summary>
public
int
FixtureId
{
get
;
set
;
}
/// <summary>
/// GUID
/// </summary>
public
string
FixtureGuid
{
get
;
set
;
}
/// <summary>
/// 产品名称
/// </summary>
public
string
ProductCode
{
get
;
set
;
}
/// <summary>
/// 储位
/// </summary>
public
int
Location
{
get
;
set
;
}
}
public
class
ResponsePlanlFixtureInfo
{
/// <summary>
/// 工令单号
/// </summary>
public
string
OrderNumber
{
get
;
set
;
}
public
string
ProductCode
{
get
;
set
;
}
public
string
ProductName
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
int
Location
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
}
}
Server/Infrastructure/Script/DB.script
View file @
b9a88432
...
...
@@ -247,6 +247,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` (
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT 'siger_automation_fixture_tools.guid',
`productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID',
`productcode` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`remark` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
...
...
@@ -325,7 +326,8 @@ CREATE TABLE IF NOT EXISTS `siger_automation_section_route` (
-- ----------------------------
CREATE TABLE IF NOT EXISTS `siger_automation_task_list` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`no` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`fixtureguid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`sectionid` int(11) NOT NULL DEFAULT 0 COMMENT '工位ID',
`trigger` int(1) NOT NULL DEFAULT 0 COMMENT '触发方',
`tasktype` int(1) NOT NULL DEFAULT 0 COMMENT '任务类型',
...
...
@@ -382,7 +384,7 @@ CREATE TABLE `siger_automation_line_mode` (
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 生产
线模式
-- 生产
操作记录
-- Table structure for siger_automation_produce_history
-- ----------------------------
...
...
@@ -404,4 +406,28 @@ CREATE TABLE `siger_automation_produce_history` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- 工装实时状态
-- Table structure for siger_automation_fixture_tools_moniter
-- ----------------------------
DROP TABLE IF EXISTS `siger_automation_fixture_tools_moniter`;
CREATE TABLE `siger_automation_fixture_tools_moniter` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`projectid` int(11) NOT NULL DEFAULT 0,
`fixtureguid` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工装ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '当前工站ID',
`sn` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前绑定工件',
`route` int(1) NOT NULL DEFAULT 1 COMMENT '工序ID',
`routedesc` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前工序',
`createtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
`updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工令单',
`productCode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`productName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`locationId` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
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