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
0a6ba9b6
Commit
0a6ba9b6
authored
Jan 21, 2021
by
yucheng.jiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
ec2949f8
b0295f37
Hide whitespace changes
Inline
Side-by-side
Showing
48 changed files
with
3404 additions
and
63 deletions
+3404
-63
serialnumcfg.vue
Html/src/view/fml/config/serialnumcfg.vue
+678
-0
feedingBlanking.vue
Html/src/view/fml/operation_manage/feedingBlanking.vue
+195
-7
taskList.vue
Html/src/view/fml/statistical_analysis/taskList.vue
+147
-3
assemblyInfo.vue
Html/src/view/fms/associate/assemblyInfo.vue
+156
-0
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+169
-9
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+204
-0
FixtureToolsAssemblyController.cs
...iger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
+42
-0
FixtureToolsController.cs
...r/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
+311
-5
FixtureToolsProductController.cs
...Siger.ApiACC/Controllers/FixtureToolsProductController.cs
+182
-0
LaisiBaseController.cs
Server/Apis/Siger.ApiACC/Controllers/LaisiBaseController.cs
+30
-0
AccDictCost.cs
...er/Common/Siger.Middlelayer.Share/Constant/AccDictCost.cs
+8
-0
DictKeyValConst.cs
...ommon/Siger.Middlelayer.Share/Constant/DictKeyValConst.cs
+13
-0
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+3
-1
Automation.cs
...mon/Siger.Middlelayer.Share/Enum/ModuleEnum/Automation.cs
+12
-1
RequestEnum.cs
Server/Common/Siger.Middlelayer.Share/Enum/RequestEnum.cs
+6
-0
ApiAccDbContext.cs
...tories/Siger.Middlelayer.AccRepository/ApiAccDbContext.cs
+9
-0
siger_automation_fixture_tools.cs
....AccRepository/Entities/siger_automation_fixture_tools.cs
+60
-0
siger_automation_fixture_tools_assembly.cs
...itory/Entities/siger_automation_fixture_tools_assembly.cs
+11
-6
siger_automation_fixture_tools_category.cs
...itory/Entities/siger_automation_fixture_tools_category.cs
+2
-2
siger_automation_fixture_tools_product.cs
...sitory/Entities/siger_automation_fixture_tools_product.cs
+36
-0
siger_automation_location.cs
...layer.AccRepository/Entities/siger_automation_location.cs
+48
-0
siger_automation_machine_property.cs
...cRepository/Entities/siger_automation_machine_property.cs
+36
-0
siger_automation_section_route.cs
....AccRepository/Entities/siger_automation_section_route.cs
+32
-0
siger_automation_task_list.cs
...ayer.AccRepository/Entities/siger_automation_task_list.cs
+97
-0
siger_wms_storage.cs
...r.Middlelayer.AccRepository/Entities/siger_wms_storage.cs
+73
-0
siger_wms_storage_location.cs
...ayer.AccRepository/Entities/siger_wms_storage_location.cs
+76
-0
AutomationFixtureToolsAssemblyRepository.cs
.../Repositories/AutomationFixtureToolsAssemblyRepository.cs
+30
-0
AutomationFixtureToolsCategoryRepository.cs
.../Repositories/AutomationFixtureToolsCategoryRepository.cs
+30
-0
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+66
-0
AutomationFixtureToolsRepository.cs
...pository/Repositories/AutomationFixtureToolsRepository.cs
+75
-0
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+81
-0
AutomationSectionPropertyRepository.cs
...itory/Repositories/AutomationSectionPropertyRepository.cs
+20
-0
AutomationSectionRouteRepository.cs
...pository/Repositories/AutomationSectionRouteRepository.cs
+20
-0
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+20
-0
IAutomationFixtureToolsAssemblyRepository.cs
...es/Interface/IAutomationFixtureToolsAssemblyRepository.cs
+2
-1
IAutomationFixtureToolsCategoryRepository.cs
...es/Interface/IAutomationFixtureToolsCategoryRepository.cs
+2
-0
IAutomationFixtureToolsProductRepository.cs
...ies/Interface/IAutomationFixtureToolsProductRepository.cs
+12
-0
IAutomationFixtureToolsRepository.cs
...positories/Interface/IAutomationFixtureToolsRepository.cs
+13
-0
IAutomationLocationRepository.cs
...y/Repositories/Interface/IAutomationLocationRepository.cs
+15
-0
IAutomationSectionPropertyRepository.cs
...itories/Interface/IAutomationSectionPropertyRepository.cs
+11
-0
IAutomationSectionRouteRepository.cs
...positories/Interface/IAutomationSectionRouteRepository.cs
+11
-0
IAutomationTaskListRepository.cs
...y/Repositories/Interface/IAutomationTaskListRepository.cs
+11
-0
RequestAutomationMachine.cs
...lelayer.AccRepository/Request/RequestAutomationMachine.cs
+1
-1
RequestFixtureToolsCategory.cs
...ayer.AccRepository/Request/RequestFixtureToolsCategory.cs
+128
-0
FixtureToolsCategory.cs
...iddlelayer.AccRepository/Response/FixtureToolsCategory.cs
+122
-0
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+55
-0
ResponseFixtureTools.cs
...iddlelayer.AccRepository/Response/ResponseFixtureTools.cs
+15
-0
DB.script
Server/Infrastructure/Script/DB.script
+28
-27
No files found.
Html/src/view/fml/config/serialnumcfg.vue
0 → 100644
View file @
0a6ba9b6
<
template
>
<div
class=
"testdiv"
>
<div
class=
"divborder newSearchDiv"
style=
"margin:0px;"
>
<div
class=
"filter"
>
<label>
{{
$t
(
'100089'
)
}}
:
</label>
<Select
v-model=
"productname"
label-in-value
clearable
filterable
remote
:remote-method=
"remoteMethod1"
:loading=
"loading1"
class=
"searchSelect"
>
<Option
v-for=
"(item,index) in products"
:value=
"item.code"
:key=
"index"
>
{{
item
.
name
}}
(
{{
item
.
code
}}
)
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label>
{{
$t
(
'10300002'
)
}}
:
</label>
<Select
v-model=
"type"
label-in-value
clearable
class=
"searchSelect"
>
<Option
value=
"1"
>
SN
</Option>
<Option
value=
"2"
>
BOX
</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=
"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
style=
"display:inline-block"
ref=
"upload"
:action=
"action"
name=
"excel-file"
:headers=
"headers"
:show-upload-list=
"false"
:on-format-error=
"handleFormatError"
:on-success=
"handleSuccess"
:on-error=
"handleError"
:format=
"['xlsx']"
>
<Button
type=
"primary"
class=
"fourWord"
icon=
"md-cloud-upload"
>
{{
$t
(
'1006'
)
}}
</Button>
</Upload>
<Button
type=
"primary"
class=
"fourWord"
icon=
"ios-cloud-download"
@
click=
"Export()"
>
{{
$t
(
'1007'
)
}}
</Button>
</div>
</div>
<div
class=
"divborder newTableDiv"
>
<Table
class=
"tableClass"
@
on-current-change=
"handleRowChange"
highlight-row
:data=
"tableData1"
@
on-selection-change=
"handleSelectRow"
:columns=
"tableColumns1"
></Table>
<div
class=
"pageDiv"
>
<div
class=
"pageDirection"
>
<Page
:total=
"total"
:current=
"page"
:page-size=
"pagesize"
@
on-change=
"changePage"
show-elevator
show-sizer
show-total
@
on-page-size-change=
"handlePageSize"
:page-size-opts=
"[10,20,30,40,100]"
></Page>
</div>
</div>
<Modal
class=
"newModalClass"
v-model=
"addmodal"
:styles=
"
{width:'400px'}">
<p
slot=
"header"
>
<span
v-if=
"modaltype===1"
>
{{
$t
(
'1002'
)
}}
</span>
<span
v-if=
"modaltype===2"
>
{{
$t
(
'1003'
)
}}
</span>
</p>
<div
class=
"modal_body"
>
<div
class=
"filter"
>
<label>
<i>
*
</i>
{{
$t
(
'100089'
)
}}
:
</label>
<Select
v-model=
"addobj.productId"
label-in-value
class=
"searchSelect"
filterable
remote
:remote-method=
"remoteMethod1"
:loading=
"loading1"
>
<Option
v-for=
"(item,index) in products"
:value=
"item.code"
:key=
"index"
>
{{
item
.
name
}}
(
{{
item
.
code
}}
)
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label>
<i>
*
</i>
{{
$t
(
'10300002'
)
}}
:
</label>
<Select
v-model=
"addobj.ruleType"
label-in-value
class=
"searchSelect"
>
<Option
:value=
"1"
>
SN
</Option>
<Option
:value=
"2"
>
BOX
</Option>
</Select>
</div>
<div
class=
"filter"
>
<label>
<i>
*
</i>
{{
$t
(
'10300004'
)
}}
:
</label>
<InputNumber
class=
"searchInput"
type=
"text"
v-model=
"addobj.step"
:min=
"0"
/>
</div>
<div
class=
"filter"
>
<label>
<i>
*
</i>
{{
$t
(
'10300005'
)
}}
:
</label>
<Select
v-model=
"addobj.codeType"
label-in-value
class=
"searchSelect"
@
on-change=
"codeTypeChange"
>
<Option
:value=
"0"
>
{{
$t
(
'5500241'
)
}}
</Option>
<Option
:value=
"1"
>
{{
$t
(
'5500242'
)
}}
</Option>
<Option
:value=
"2"
>
{{
$t
(
'5500243'
)
}}
</Option>
<Option
:value=
"4"
>
{{
$t
(
'5500251'
)
}}
</Option>
</Select>
</div>
<div
class=
"filter"
v-show=
"addobj.codeType===1"
>
<label>
<i>
*
</i>
{{
$t
(
'10300006'
)
}}
:
</label>
<Select
v-if=
"codeshow"
v-model=
"addobj.codeFormat"
label-in-value
class=
"searchSelect"
>
<Option
v-for=
"item in codeFormats"
:value=
"item.id"
:key=
"item.id"
>
{{
item
.
title
}}
</Option>
</Select>
<Input
v-else
v-model=
"addobj.codeFormat"
class=
"searchInput"
type=
"text"
/>
</div>
<div
class=
"filter"
v-show=
"addobj.codeType===2"
>
<label>
{{
this
.
$t
(
'10300009'
)
}}
:
</label>
<InputNumber
class=
"searchInput"
type=
"text"
v-model=
"addobj.length"
:min=
"0"
/>
</div>
<div
class=
"filter"
v-show=
"addobj.codeType===0||addobj.codeType===2"
>
<label>
{{
this
.
$t
(
'10300008'
)
}}
:
</label>
<Input
class=
"searchInput"
type=
"text"
v-model=
"addobj.codeValue"
/>
</div>
</div>
<div
slot=
"footer"
>
<Button
type=
"text"
size=
"large"
@
click=
"addmodal = false"
>
{{
$t
(
'1033'
)
}}
</Button>
<Button
type=
"primary"
v-if=
"modaltype===1"
size=
"large"
@
click=
"adddata()"
>
{{
$t
(
'1002'
)
}}
</Button>
<Button
type=
"primary"
v-if=
"modaltype===2"
size=
"large"
@
click=
"editdata()"
>
{{
$t
(
'1003'
)
}}
</Button>
</div>
</Modal>
</div>
</div>
</
template
>
<
script
>
import
axios
from
'@/libs/api.request'
;
export
default
{
data
()
{
return
{
action
:
axios
.
publicPath
+
'acc/upload/UploadExcel?templateName=SnRule'
,
headers
:
{
token
:
localStorage
.
getItem
(
'token'
),
timestamp
:
localStorage
.
getItem
(
'timestamp'
),
nonce
:
localStorage
.
getItem
(
'nonce'
),
sign
:
localStorage
.
getItem
(
'sign'
)
},
// 搜索
loading1
:
false
,
products
:
[],
productname
:
''
,
type
:
0
,
modaltype
:
1
,
// 添加
codeFormats
:
[],
codeshow
:
true
,
addobj
:
{
productId
:
''
,
// 产品编号
ruleType
:
''
,
// 规则类型
step
:
0
,
// 顺序
codeType
:
''
,
// 编码类型
codeFormat
:
''
,
// 编码格式
length
:
0
,
// 长度
codeValue
:
''
// 编码值
},
tableData1
:
[],
total
:
0
,
page
:
1
,
pagesize
:
10
,
addmodal
:
false
,
detailobj
:
''
,
tableColumns1
:
[
{
type
:
'index2'
,
title
:
this
.
$t
(
'1008'
),
key
:
'xuhao'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'span'
,
params
.
index
+
(
this
.
page
-
1
)
*
this
.
pagesize
+
1
);
},
width
:
'70px'
},
{
title
:
this
.
$t
(
'100089'
),
key
:
'productId'
},
{
title
:
this
.
$t
(
'10300003'
),
key
:
'ruleDesc'
},
{
title
:
this
.
$t
(
'10300004'
),
key
:
'step'
},
{
title
:
this
.
$t
(
'10300005'
),
key
:
'codeDesc'
},
{
title
:
this
.
$t
(
'10300006'
),
key
:
'codeFormat'
},
{
title
:
this
.
$t
(
'10300007'
),
key
:
'lengthNull'
},
{
title
:
this
.
$t
(
'10300008'
),
key
:
'value'
}
]
};
},
created
()
{
this
.
iniproducts
(
''
);
this
.
tosearch
();
this
.
tableColumns1
=
this
.
$time
.
initTableTitle
(
this
.
tableColumns1
);
},
methods
:
{
iniproducts
(
name
)
{
var
params
=
{
name
:
name
,
count
:
50
};
axios
.
request
({
url
:
'/config/ProjectProduct/GetProductsByCode'
,
params
,
method
:
'get'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
&&
res
.
data
.
data
.
length
>
0
)
{
this
.
products
=
res
.
data
.
data
;
}
});
},
remoteMethod1
(
name
)
{
if
(
name
!==
''
)
{
this
.
loading1
=
true
;
setTimeout
(()
=>
{
this
.
loading1
=
false
;
this
.
iniproducts
(
name
);
},
200
);
}
else
{
this
.
iniproducts
(
''
);
}
},
handleFormatError
(
file
)
{
this
.
$Message
.
error
(
this
.
$t
(
'950396'
)
+
file
.
name
+
this
.
$t
(
'950397'
));
},
handleSuccess
(
res
,
file
)
{
if
(
res
.
ret
==
1
)
{
this
.
$Message
.
success
(
this
.
$t
(
'950398'
));
this
.
tosearch
();
}
else
{
if
((
res
.
msg
+
''
).
indexOf
(
','
)
!=
-
1
)
{
inittip
(
res
.
msg
);
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
msg
));
}
}
},
handleError
()
{
this
.
$Message
.
error
(
this
.
$t
(
'2010006'
)
+
'!'
);
},
handleSelectRow
:
function
(
data
)
{
var
ids
=
[];
for
(
var
i
in
data
)
{
ids
.
push
(
data
[
i
].
id
);
}
this
.
selectids
=
ids
.
join
(
','
);
},
tosearch
()
{
this
.
page
=
1
;
this
.
pagesize
=
10
;
this
.
search
();
},
search
()
{
var
params
=
{
productCode
:
this
.
productname
,
rule
:
this
.
type
,
// type,
page
:
this
.
page
,
pagesize
:
this
.
pagesize
};
axios
.
request
({
url
:
'/acc/SerinumConfig/GetList'
,
params
,
method
:
'get'
})
.
then
((
res
)
=>
{
this
.
total
=
0
;
this
.
tableData1
=
[];
if
(
res
.
data
.
ret
===
1
&&
res
.
data
.
data
!=
null
&&
res
.
data
.
data
.
length
>
0
)
{
this
.
total
=
res
.
data
.
total
;
this
.
mockTableData1
(
res
.
data
.
data
);
}
});
},
mockTableData1
(
tablelist
)
{
let
data
=
[];
tablelist
.
forEach
((
item
)
=>
{
if
(
item
)
{
data
.
push
({
productId
:
item
.
productId
,
productCode
:
item
.
productCode
,
ruleDesc
:
item
.
ruleDesc
,
code
:
item
.
code
,
codeDesc
:
item
.
codeDesc
,
codeFormat
:
item
.
codeFormat
,
step
:
item
.
step
,
length
:
item
.
length
,
value
:
item
.
value
,
ruleKey
:
item
.
ruleKey
,
id
:
item
.
id
,
lengthNull
:
item
.
lengthNull
});
}
});
this
.
tableData1
=
data
;
},
handleRowChange
(
currentRow
,
oldCurrentRow
)
{
this
.
detailobj
=
currentRow
;
},
handlePageSize
(
value
)
{
this
.
pagesize
=
value
;
this
.
tableData1
=
this
.
search
();
},
changePage
(
value
)
{
this
.
page
=
value
;
this
.
tableData1
=
this
.
search
();
},
codeTypeChange
()
{
if
(
this
.
addobj
.
codeType
===
1
)
{
this
.
codeshow
=
true
;
this
.
codeFormats
=
[
{
id
:
'YYDDD'
,
title
:
'YYDDD'
},
{
id
:
'YYYYMMDD'
,
title
:
'YYYYMMDD'
},
{
id
:
'YYMMDD'
,
title
:
'YYMMDD'
}
];
}
else
{
this
.
codeshow
=
false
;
}
},
add
()
{
this
.
modaltype
=
1
;
// 添加
this
.
addmodal
=
true
;
this
.
codeshow
=
true
;
this
.
addobj
=
{
productId
:
''
,
// 产品编号
ruleType
:
''
,
// 规则类型
step
:
0
,
// 顺序
codeType
:
''
,
// 编码类型
codeFormat
:
''
,
// 编码格式
length
:
0
,
// 长度
codeValue
:
''
// 编码值
};
},
adddata
()
{
if
(
this
.
addobj
.
length
===
null
)
{
this
.
addobj
.
length
=
0
;
}
if
(
this
.
addobj
.
productId
===
''
||
this
.
addobj
.
ruleType
===
''
||
this
.
addobj
.
step
===
0
||
this
.
addobj
.
step
===
null
||
this
.
addobj
.
codeType
===
''
)
{
this
.
$Message
.
error
(
this
.
$t
(
'9000136'
));
return
false
;
}
if
(
this
.
addobj
.
codeType
===
1
){
if
(
this
.
addobj
.
codeFormat
===
''
){
this
.
$Message
.
error
(
this
.
$t
(
'9000136'
));
return
false
;
}
}
if
(
this
.
addobj
.
codeType
===
0
){
this
.
addobj
.
length
=
0
this
.
addobj
.
codeFormat
=
''
}
else
if
(
this
.
addobj
.
codeType
===
1
){
this
.
addobj
.
length
=
0
this
.
addobj
.
codeValue
=
''
}
else
if
(
this
.
addobj
.
codeType
===
2
){
this
.
addobj
.
codeFormat
=
''
}
else
if
(
this
.
addobj
.
codeType
===
4
){
this
.
addobj
.
codeFormat
=
''
this
.
addobj
.
length
=
0
this
.
addobj
.
codeValue
=
''
}
let
data
=
{
productId
:
this
.
addobj
.
productId
,
ruleType
:
parseInt
(
this
.
addobj
.
ruleType
),
step
:
this
.
addobj
.
step
,
codeType
:
parseInt
(
this
.
addobj
.
codeType
),
codeFormat
:
this
.
addobj
.
codeFormat
,
length
:
this
.
addobj
.
length
,
codeValue
:
this
.
addobj
.
codeValue
};
axios
.
request
({
url
:
'/acc/SerinumConfig/Add'
,
data
,
method
:
'post'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
this
.
$Message
.
success
(
this
.
$t
(
'1055'
));
this
.
addmodal
=
false
;
this
.
detailobj
=
''
;
this
.
tosearch
();
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
});
},
dele
()
{
if
(
this
.
detailobj
===
''
||
this
.
detailobj
===
undefined
||
this
.
detailobj
.
id
===
undefined
||
this
.
detailobj
.
id
===
0
)
{
this
.
$Message
.
error
(
this
.
$t
(
'1017'
));
return
false
;
}
else
{
var
data
=
{
Id
:
this
.
detailobj
.
id
,
resultStatus
:
this
.
detailobj
.
resultStatus
};
this
.
$Modal
.
confirm
({
title
:
this
.
$t
(
'1018'
),
content
:
''
,
width
:
'290px'
,
closable
:
true
,
okText
:
this
.
$t
(
'1004'
),
onOk
:
()
=>
{
axios
.
request
({
url
:
'/acc/SerinumConfig/Delete'
,
data
,
method
:
'post'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
this
.
$Message
.
success
(
this
.
$t
(
'1058'
));
this
.
tosearch
();
this
.
detailobj
=
''
;
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
});
}
});
}
},
edit
()
{
this
.
modaltype
=
2
;
if
(
this
.
detailobj
===
''
||
this
.
detailobj
===
undefined
||
this
.
detailobj
.
id
===
undefined
)
{
this
.
$Message
.
error
(
this
.
$t
(
'1017'
));
return
false
;
}
this
.
modaltype
=
2
;
// 编辑
this
.
addmodal
=
true
;
this
.
addobj
.
productId
=
this
.
detailobj
.
productId
===
null
?
''
:
this
.
detailobj
.
productId
;
this
.
addobj
.
ruleType
=
this
.
detailobj
.
ruleKey
;
this
.
addobj
.
step
=
this
.
detailobj
.
step
;
this
.
addobj
.
length
=
this
.
detailobj
.
length
===
''
?
0
:
parseInt
(
this
.
detailobj
.
length
);
this
.
addobj
.
codeValue
=
this
.
detailobj
.
value
;
this
.
addobj
.
codeType
=
this
.
detailobj
.
code
;
this
.
codeTypeChange
();
this
.
addobj
.
codeFormat
=
this
.
detailobj
.
codeFormat
;
},
editdata
()
{
if
(
this
.
addobj
.
productId
===
''
||
this
.
addobj
.
ruleType
===
''
||
this
.
addobj
.
step
===
0
||
this
.
addobj
.
codeType
===
''
)
{
this
.
$Message
.
error
(
this
.
$t
(
'9000136'
));
return
false
;
}
if
(
this
.
addobj
.
codeType
===
1
){
if
(
this
.
addobj
.
codeFormat
===
''
){
this
.
$Message
.
error
(
this
.
$t
(
'9000136'
));
return
false
;
}
}
if
(
this
.
addobj
.
codeType
===
0
){
this
.
addobj
.
length
=
0
this
.
addobj
.
codeFormat
=
''
}
else
if
(
this
.
addobj
.
codeType
===
1
){
this
.
addobj
.
length
=
0
this
.
addobj
.
codeValue
=
''
}
else
if
(
this
.
addobj
.
codeType
===
2
){
this
.
addobj
.
codeFormat
=
''
}
else
if
(
this
.
addobj
.
codeType
===
4
){
this
.
addobj
.
codeFormat
=
''
this
.
addobj
.
length
=
0
this
.
addobj
.
codeValue
=
''
}
let
data
=
{
id
:
this
.
detailobj
.
id
,
productId
:
this
.
addobj
.
productId
,
ruleType
:
parseInt
(
this
.
addobj
.
ruleType
),
step
:
this
.
addobj
.
step
,
codeType
:
parseInt
(
this
.
addobj
.
codeType
),
codeFormat
:
this
.
addobj
.
codeFormat
,
length
:
this
.
addobj
.
length
,
codeValue
:
this
.
addobj
.
codeValue
};
axios
.
request
({
url
:
'/acc/SerinumConfig/Update'
,
data
,
method
:
'post'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
this
.
$Message
.
success
(
this
.
$t
(
'1060'
));
this
.
detailobj
=
''
;
this
.
addmodal
=
false
;
this
.
search
();
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
});
},
loadexcel
()
{
axios
.
request
({
url
:
'/config/Download/GetTemplate?name=SnRule'
,
method
:
'get'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
window
.
location
.
href
=
axios
.
publicPath
+
''
+
res
.
data
.
data
;
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
});
},
Export
()
{
let
data
=
{
productCode
:
this
.
productname
,
runtype
:
this
.
type
};
axios
.
request
({
url
:
'/acc/SerinumConfig/ExportData'
,
data
,
method
:
'get'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
window
.
location
.
href
=
axios
.
publicPath
+
''
+
res
.
data
.
data
;
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
});
},
unloadexcel
()
{
let
file
=
this
.
readyFiles
[
0
];
const
data
=
new
FormData
();
data
.
append
(
'file'
,
file
);
data
.
append
(
'type'
,
2
);
axios
.
request
({
url
:
'/acc/Upload/UploadExcel?templateName=SnRule'
,
data
,
method
:
'post'
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
this
.
tosearch
();
this
.
$Message
.
success
(
this
.
$t
(
'100378'
));
}
else
{
this
.
$Message
.
error
(
this
.
$t
(
res
.
data
.
msg
));
}
})
.
catch
((
err
)
=>
{
this
.
$Message
.
error
(
this
.
$t
(
err
.
msg
));
});
}
}
};
</
script
>
<
style
lang=
"less"
scoped
>
</
style
>
Html/src/view/fml/operation_manage/feedingBlanking.vue
View file @
0a6ba9b6
<
template
>
<div>
员工上下料管理
</div>
<div>
员工上下料管理
<div
class=
"divborder"
>
<div
class=
"choose"
>
<p
class=
"selectTitle"
>
1.请选择生产线
<span
class=
"red"
>
*
</span>
</p>
<div
class=
"row"
>
<p
:key=
"index"
class=
"options"
v-for=
"(item, index) in productionLine"
@
click=
"change(index)"
:class=
"
{ active: a == index }"
>
{{
item
.
title
}}
</p>
</div>
<div
class=
"choose"
>
<p
class=
"selectTitle"
>
2.上下料工位
<span
class=
"red"
>
*
</span>
</p>
<div
class=
"row"
>
<p
:key=
"index"
class=
"options"
v-for=
"(item, index) in productionLine"
@
click=
"change(index)"
:class=
"
{ active: a == index }"
>
{{
item
.
title
}}
</p>
</div>
</div>
<div
class=
"choose"
>
<p
class=
"selectTitle"
>
3.操作
<span
class=
"red"
>
*
</span>
</p>
<Tabs
type=
"card"
>
<TabPane
label=
"上料"
>
<div
class=
"filter"
>
<label>
上料信息:
</label>
<Input
type=
"text"
class=
"searchInput"
style=
"width: 300px"
></Input>
</div>
<div
class=
"row"
>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
工单信息:
</span>
<span
class=
"info"
></span>
</p>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
产品编号:
</span>
<span
class=
"info"
></span>
</p>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
产品名称:
</span>
<span
class=
"info"
></span>
</p>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
工件编号:
</span>
<span
class=
"info"
></span>
</p>
</div>
<div
class=
"row"
>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
状态:
</span>
<span
class=
"info"
></span>
</p>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
储位编号:
</span>
<span
class=
"info"
></span>
</p>
<p
class=
"flex"
>
<span
class=
"infoLabel"
>
工装编号:
</span>
<span
class=
"info"
></span>
</p>
<Button
type=
"primary"
>
储位选择
</Button>
</div>
<div>
<Button
type=
"primary"
>
准备上料
</Button>
<Button
type=
"primary"
>
安装完成
</Button>
</div>
</TabPane>
<TabPane
label=
"下料"
>
下料
</TabPane>
</Tabs>
<Modal
class=
"newModalClass"
:title=
"$t(900249)"
v-model=
"modal"
:styles=
"
{ width: '940px' }"
>
<div
class=
"modal_body"
style=
"padding-right: 40px"
>
<Table
class=
"tableClass"
:data=
"data1"
:columns=
"columns1"
:max-height=
"200"
></Table>
</div>
<div
slot=
"footer"
>
<Button
type=
"text"
size=
"large"
@
click=
"modal = false"
v-text=
"$t('1033')"
>
取消
</Button
>
<Button
type=
"primary"
size=
"large"
v-text=
"$t('1011')"
>
提交
</Button
>
</div>
</Modal>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
}
data
()
{
return
{
productionLine
:
[],
a
:
0
,
modal
:
false
,
columns1
:[],
data1
:[]
};
},
created
()
{},
methods
:
{
change
(
i
)
{
this
.
a
=
i
;
// 1. 选中产线后自动带出来工位属性中为上下料属性的工位
},
},
};
</
script
>
<
style
>
<
style
scoped
>
.selectTitle
{
font-size
:
18px
;
}
.row
{
display
:
flex
;
flex-direction
:
row
;
flex-wrap
:
wrap
;
flex-shrink
:
1
;
}
.options
{
font-size
:
12px
;
padding
:
0
12px
;
/* width: 100px; */
height
:
50px
;
line-height
:
50px
;
text-align
:
center
;
border-radius
:
5px
;
background-color
:
#f2f2f2
;
margin
:
10px
0
;
margin-right
:
50px
;
cursor
:
pointer
;
}
.active
{
background-color
:
#2d8cf0
;
color
:
#fff
;
}
.actionTitle
{
height
:
50px
;
width
:
100px
;
line-height
:
50px
;
font-size
:
25px
;
text-align
:
center
;
/* border: 1px solid #b2b2b2; */
/* color: #c0c0c0; */
}
.flex
{
display
:
flex
;
}
.infoLabel
{
display
:
inline-block
;
margin-right
:
10px
;
width
:
100px
;
text-align
:
right
;
font-size
:
16px
;
}
.info
{
display
:
inline-block
;
width
:
200px
;
font-size
:
20px
;
}
</
style
>
\ No newline at end of file
Html/src/view/fml/statistical_analysis/taskList.vue
View file @
0a6ba9b6
<
template
>
<div>
任务清单管理
<div
class=
"testdiv"
>
\任务清单管理
<div
class=
"divborder"
>
<h2>
基本信息
</h2>
<div
class=
"newSearchDiv"
>
<div
class=
"filter"
>
<label>
{{
$t
(
"1950574"
)
}}
:
</label>
<Cascader
trigger=
"click"
class=
"searchSelect"
></Cascader>
</div>
<div
class=
"filter"
>
<label>
任务类型:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"filter"
>
<label>
发起地:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"filter"
>
<label>
产品编号:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"filter"
>
<label>
任务编号:
</label>
<Input
type=
"text"
class=
"searchInput"
></Input>
</div>
<div
class=
"filter"
>
<label>
工件编号:
</label>
<Input
type=
"text"
class=
"searchInput"
></Input>
</div>
<div
class=
"filter"
>
<label>
状态:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"filter"
>
<label>
执行类型:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"filter"
>
<label>
触发时间:
</label>
<DatePicker
type=
"datetimerange"
placeholder=
"Select date"
style=
"width: 200px"
></DatePicker>
</div>
<div
class=
"filter"
>
<label>
完成时间:
</label>
<DatePicker
type=
"datetimerange"
placeholder=
"Select date"
style=
"width: 200px"
></DatePicker>
</div>
<div
class=
"searchBtn"
>
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
>
{{
$t
(
"1001"
)
}}
</Button>
<!-- -->
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
>
取消
</Button
>
<!--只有状态是待执行的可以改成取消-->
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
>
手动
</Button
>
<!--当生产线的模式是手动是才可以进行手动任务执行-->
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
>
导出
</Button
>
</div>
</div>
</div>
<div
class=
"divborder newTableDiv"
>
<Table
class=
"tableClass"
:columns=
"columns1"
:data=
"data1"
></Table>
<div
class=
"pageDiv"
>
<div
class=
"pageDirection"
>
<Page
:total=
"total"
:current=
"page"
show-elevator
show-sizer
show-total
:page-size-opts=
"[10, 20, 30, 40, 100]"
></Page>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{};
export
default
{
data
()
{
return
{
columns1
:
[
{
title
:
this
.
$t
(
'1008'
),
key
:
'xuhao'
,
render
:
(
h
,
params
)
=>
{
return
h
(
'span'
,
params
.
index
+
(
this
.
page
-
1
)
*
this
.
pagesize
+
1
);
},
width
:
70
},
{
title
:
this
.
$t
(
'100089'
),
key
:
'productcode'
,
minWidth
:
150
},
],
data1
:
[],
total
:
0
,
page
:
1
,
pagesize
:
10
,
};
},
created
()
{
this
.
columns1
=
this
.
$time
.
initTableTitle
(
this
.
columns1
);
},
methods
:
{},
};
</
script
>
<
style
>
...
...
Html/src/view/fms/associate/assemblyInfo.vue
View file @
0a6ba9b6
<
template
>
<div
class=
"testdiv"
>
工装装配信息
<div
class=
"divborder"
>
<h2>
基本信息
</h2>
<div
class=
"newSearchDiv"
>
<div
class=
"filter"
>
<label>
工装类别:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"filter"
>
<label>
夹具类型:
</label>
<Select
label-in-value
clearable
filterable
class=
"searchSelect"
>
</Select>
</div>
<div
class=
"searchBtn"
>
<Button
type=
"primary"
class=
"twoWord"
icon=
"ios-search"
@
click=
"search(1, 10)"
>
{{
$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=
"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
style=
"display: inline-block"
ref=
"upload"
:action=
"action"
name=
"excel-file"
:headers=
"headers"
:show-upload-list=
"false"
:on-format-error=
"handleFormatError"
:on-success=
"handleSuccess"
:on-error=
"handleError"
:format=
"['xlsx']"
>
-->
<Button
type=
"primary"
class=
"fourWord"
icon=
"md-cloud-upload"
>
{{
$t
(
"1006"
)
}}
</Button
>
<!--
</Upload>
-->
<Button
type=
"primary"
class=
"fourWord"
icon=
"ios-cloud-download"
@
click=
"exportEecel()"
>
{{
$t
(
"1007"
)
}}
</Button
>
</div>
</div>
</div>
<div
class=
"divborder newTableDiv"
>
<Table
class=
"tableClass"
:columns=
"columns1"
:data=
"data1"
></Table>
<div
class=
"pageDiv"
>
<div
class=
"pageDirection"
>
<Page
:total=
"total"
:current=
"page"
show-elevator
show-sizer
show-total
:page-size-opts=
"[10, 20, 30, 40, 100]"
></Page>
</div>
</div>
</div>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
columns1
:
[
{
title
:
this
.
$t
(
"1008"
),
key
:
"xuhao"
,
render
:
(
h
,
params
)
=>
{
return
h
(
"span"
,
params
.
index
+
(
this
.
page
-
1
)
*
this
.
pagesize
+
1
);
},
width
:
70
,
},
{
title
:
this
.
$t
(
"100089"
),
key
:
"productcode"
,
minWidth
:
150
,
},
],
data1
:
[],
total
:
0
,
page
:
1
,
pagesize
:
10
,
};
},
created
()
{
this
.
columns1
=
this
.
$time
.
initTableTitle
(
this
.
columns1
);
},
methods
:
{
search
(
page
,
pagesize
){},
add
(){},
edit
(){},
dele
(){},
loadExcel
(){},
exportEecel
(){},
},
};
</
script
>
<
style
>
</
style
>
\ No newline at end of file
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
0a6ba9b6
...
...
@@ -3,14 +3,40 @@ using System.Collections.Generic;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Mvc
;
using
Microsoft.CodeAnalysis
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Request
;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Log
;
using
Siger.Middlelayer.Common.ModuleEnum
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Repository.Repositories.Interface
;
using
Siger.Middlelayer.Share.Constant
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
static
Siger
.
Middlelayer
.
Share
.
Enum
.
ModuleEnum
.
Automation
;
namespace
Siger.ApiACC.Controllers
{
public
class
AutomationController
:
BaseController
public
class
AutomationController
:
Laisi
BaseController
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
ISigerProjectLevelSectionRepository
_sigerProjectLevelSection
;
private
readonly
IAutomationLineMode
_automationLineMode
;
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
private
readonly
ISigerDict
_sigerDict
;
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
public
AutomationController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationLineMode
automationLineMode
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerDict
sigerDict
,
IAutomationTaskListRepository
automationTaskList
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_automationLineMode
=
automationLineMode
;
_automationMachineStatus
=
automationMachineStatus
;
_sigerDict
=
sigerDict
;
_automationTaskList
=
automationTaskList
;
}
/// <summary>
/// 设备状态接口 用于 保存 设备当前可用状态
/// </summary>
...
...
@@ -19,27 +45,161 @@ namespace Siger.ApiACC.Controllers
[
HttpPost
]
public
IActionResult
MachineStatus
([
FromBody
]
RequestAutomationMachine
request
)
{
return
new
ObjectResult
(
"1"
);
var
exitsObj
=
_automationMachineStatus
.
Get
(
f
=>
f
.
machineid
==
request
.
machineid
);
if
(
exitsObj
==
null
)
{
_automationMachineStatus
.
Insert
(
new
siger_automation_machine_status
{
machineid
=
request
.
machineid
,
projectId
=
PID
,
updatetime
=
DateTime
.
Now
,
enable
=
request
.
enable
,
status
=
request
.
status
});
}
else
{
exitsObj
.
enable
=
request
.
enable
;
exitsObj
.
status
=
request
.
status
;
exitsObj
.
updatetime
=
DateTime
.
Now
;
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
else
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
/// <summary>
/// 任务状态接口 用于保存PLC 实时任务状态
/// 任务状态接口 用于保存PLC 实时任务状态
()
/// </summary>
/// <returns></returns>
public
IActionResult
TaskResult
([
FromBody
]
RequestAutomationTaskResult
request
)
{
//1.检查Tasklist
var
taskObj
=
_automationTaskList
.
Get
(
f
=>
f
.
guid
==
request
.
guid
);
if
(
taskObj
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
if
(
taskObj
.
status
==(
int
)
TaskResultStatus
.
Complated
)
{
throw
new
BadRequestException
(
AccEnum
.
AutoTaskDone
);
}
//2.更新状态
taskObj
.
status
=
request
.
status
;
if
(
_unitOfWork
.
Commit
()
<=
0
)
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
//是否还有未完成任务
var
taskDone
=
_automationTaskList
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
>
(
int
)
TaskResultStatus
.
Cancel
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(
taskDone
!=
null
)
{
//还有未完成任务 退出 等待任务下发
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
//3.Tasklist 任务全部完成 ,创建自动任务
switch
(
request
.
status
)
{
case
(
int
)
TaskResultStatus
.
Cancel
:
case
(
int
)
TaskResultStatus
.
Complated
:
{
CreateAutoTask
(
taskObj
);
break
;
}
case
(
int
)
TaskResultStatus
.
Waiting
:
case
(
int
)
TaskResultStatus
.
Produce
:
default
:
{
break
;
}
}
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
/// <summary>
/// 创建自动 Task任务
/// </summary>
/// <param name="tasklist"></param>
void
CreateAutoTask
(
siger_automation_task_list
tasklist
)
{
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
tasklist
.
startsection
);
if
(
section
==
null
)
{
Logger
.
WriteLineInfo
(
$"CreateAutoTask 工站未找到"
);
throw
new
BadRequestException
(
RequestEnum
.
LevelSectionNotFound
);
}
var
lineMode
=
_automationLineMode
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
section
==
section
.
parentid
);
if
(
lineMode
==
null
)
{
Logger
.
WriteLineInfo
(
$"CreateAutoTask 产线未找到"
);
throw
new
BadRequestException
(
RequestEnum
.
LevelSectionNotFound
);
}
if
(
lineMode
.
mode
==
0
)
{
Logger
.
WriteLineInfo
(
$"CreateAutoTask 手动模式"
);
//手动模式时 退出
return
;
}
var
machineList
=
_automationMachineStatus
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
enable
==
1
);
//自动Task任务 顺序
//1.清洗机下料
//2.其他设备上料
//3.其他设备下料
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
PID
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"CreateAutoTask 未配置设备类型字典"
);
return
;
}
var
dictClean
=
stationDicts
.
FirstOrDefault
(
s
=>
s
.
dkey
==
DictKeyValConst
.
CleanStation
);
if
(
dictClean
==
null
)
{
Logger
.
WriteLineInfo
(
$"CreateAutoTask 未配置清洗机字典"
);
return
;
}
return
new
ObjectResult
(
"1"
);
}
/// <summary>
/// 产线模式 0:手动模式 /1:自动模式(产生自动任务)
/// </summary>
/// <param name="line"></param>
/// <param name="mode"></param>
/// <returns></returns>
public
IActionResult
LineMode
(
int
mode
)
public
IActionResult
LineMode
(
int
line
,
int
mode
)
{
return
new
ObjectResult
(
"1"
);
var
exitObj
=
_automationLineMode
.
Get
(
f
=>
f
.
section
==
line
);
if
(
exitObj
==
null
)
{
_automationLineMode
.
Insert
(
new
siger_automation_line_mode
{
section
=
line
,
projectId
=
PID
,
status
=
1
,
updatetime
=
DateTime
.
Now
,
mode
=
mode
})
;
}
else
{
exitObj
.
updatetime
=
DateTime
.
Now
;
exitObj
.
mode
=
mode
;
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
else
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
}
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Linq.Expressions
;
using
Microsoft.AspNetCore.Mvc
;
using
Siger.ApiCommon.Result
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.AccRepository.Request
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Repository.Repositories.Interface
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Repository.Extensions
;
using
System.Linq
;
using
Siger.Middlelayer.Repository.Entities
;
namespace
Siger.ApiACC.Controllers
{
public
class
AutomationLocationController
:
BaseController
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureToolsRepository
_toolsRepository
;
private
readonly
IAutomationLocationRepository
_autoLocationRepository
;
private
readonly
ISigerTrMaterialsRepository
_materialsRepository
;
public
AutomationLocationController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureToolsRepository
toolsRepository
,
IAutomationLocationRepository
autoLocationRepository
,
ISigerTrMaterialsRepository
materialsRepository
)
{
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_toolsRepository
=
toolsRepository
;
_autoLocationRepository
=
autoLocationRepository
;
_materialsRepository
=
materialsRepository
;
}
public
IActionResult
GetPageList
(
string
category
,
string
code
,
string
name
,
string
state
,
int
page
,
int
pagesize
)
{
var
data
=
_toolsRepository
.
GetPagedList
(
category
.
ToInt
(),
code
,
name
,
string
.
IsNullOrEmpty
(
state
)
?
-
1
:
state
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
[
HttpPost
]
public
IActionResult
Add
([
FromBody
]
RequestAddAutomationLocation
req
)
{
if
(
string
.
IsNullOrEmpty
(
req
.
locationid
)
||
string
.
IsNullOrEmpty
(
req
.
fixturetoolid
)
||
string
.
IsNullOrEmpty
(
req
.
materialid
))
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
fixturetool
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
fixturetoolid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
if
(
fixturetool
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
location
=
_autoLocationRepository
.
GetLocation
(
req
.
locationid
.
ToInt
(),
ProjectId
);
if
(
location
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
LocationNull
);
}
var
material
=
_materialsRepository
.
Get
(
q
=>
q
.
id
==
req
.
materialid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
var
data
=
_autoLocationRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
fixturetools
==
fixturetool
.
guid
&&
q
.
locationid
==
req
.
locationid
.
ToInt
());
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
state
=
1
;
if
(
fixturetool
!=
null
&&
material
==
null
)
{
state
=
1
;
//有工装 无工件
}
else
if
(
fixturetool
!=
null
&&
material
!=
null
)
{
state
=
2
;
//有工装 有工件
}
var
entity
=
new
siger_automation_location
{
guid
=
Guid
.
NewGuid
().
ToString
(),
locationid
=
req
.
locationid
.
ToInt
(),
fixturetools
=
fixturetool
.
guid
,
materialid
=
req
.
materialid
.
ToInt
(),
processid
=
req
.
processid
.
ToInt
(),
materialstate
=
state
,
attachment
=
req
.
attachment
,
remark
=
req
.
remark
,
projectId
=
ProjectId
,
updatetime
=
DateTime
.
Now
,
updator
=
UserId
,
};
_autoLocationRepository
.
Insert
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Update
([
FromBody
]
RequestUpdateAutomationLocation
req
)
{
if
(
string
.
IsNullOrEmpty
(
req
.
locationid
)
||
string
.
IsNullOrEmpty
(
req
.
fixturetoolid
)
||
string
.
IsNullOrEmpty
(
req
.
materialid
))
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entity
=
_autoLocationRepository
.
Get
(
q
=>
q
.
id
==
req
.
id
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
var
fixturetool
=
_toolsRepository
.
Get
(
q
=>
q
.
id
==
req
.
fixturetoolid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
if
(
fixturetool
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
location
=
_autoLocationRepository
.
GetLocation
(
req
.
locationid
.
ToInt
(),
ProjectId
);
if
(
location
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
LocationNull
);
}
var
material
=
_materialsRepository
.
Get
(
q
=>
q
.
id
==
req
.
materialid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
var
data
=
_autoLocationRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
fixturetools
==
fixturetool
.
guid
&&
q
.
locationid
==
req
.
locationid
.
ToInt
()
&&
q
.
id
!=
req
.
id
);
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
state
=
1
;
if
(
fixturetool
!=
null
&&
material
==
null
)
{
state
=
1
;
//有工装 无工件
}
else
if
(
fixturetool
!=
null
&&
material
!=
null
)
{
state
=
2
;
//有工装 有工件
}
entity
.
locationid
=
req
.
locationid
.
ToInt
();
entity
.
fixturetools
=
fixturetool
.
guid
;
entity
.
materialid
=
req
.
materialid
.
ToInt
();
entity
.
processid
=
req
.
processid
.
ToInt
();
entity
.
materialstate
=
state
;
entity
.
attachment
=
req
.
attachment
;
entity
.
remark
=
req
.
remark
;
entity
.
updatetime
=
DateTime
.
Now
;
entity
.
updator
=
UserId
;
_autoLocationRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpGet
]
public
IActionResult
Delete
(
int
id
)
{
var
entity
=
_autoLocationRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
id
);
if
(
entity
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_autoLocationRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Deletes
([
FromBody
]
RequestDeleteRange
req
)
{
if
(
req
.
ids
==
null
||
!
req
.
ids
.
Any
())
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entities
=
_autoLocationRepository
.
GetList
(
t
=>
req
.
ids
.
Contains
(
t
.
id
)
&&
t
.
projectId
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
if
(!
entities
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
foreach
(
var
entity
in
entities
)
{
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_autoLocationRepository
.
Update
(
entity
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
}
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Linq.Expressions
;
using
Microsoft.AspNetCore.Mvc
;
using
Siger.ApiCommon.Result
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.AccRepository.Request
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Repository.Repositories.Interface
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Repository.Extensions
;
using
System.Linq
;
using
Siger.Middlelayer.Repository.Entities
;
namespace
Siger.ApiACC.Controllers
{
public
class
FixtureToolsAssemblyController
:
BaseController
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureToolsRepository
_toolsRepository
;
private
readonly
IAutomationFixtureToolsAssemblyRepository
_toolsAssemblyRepository
;
public
FixtureToolsAssemblyController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureToolsRepository
toolsRepository
,
IAutomationFixtureToolsAssemblyRepository
toolsAssemblyRepository
)
{
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_toolsRepository
=
toolsRepository
;
_toolsAssemblyRepository
=
toolsAssemblyRepository
;
}
public
IActionResult
GetPageList
(
string
category
,
int
page
,
int
pagesize
)
{
var
data
=
_toolsAssemblyRepository
.
GetPagedList
(
category
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
}
}
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
View file @
0a6ba9b6
...
...
@@ -21,16 +21,322 @@ namespace Siger.ApiACC.Controllers
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureTools
AssemblyRepository
_toolsAssembly
Repository
;
private
readonly
IAutomationFixtureTools
Repository
_tools
Repository
;
public
FixtureToolsController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureTools
AssemblyRepository
toolsAssembly
Repository
)
public
FixtureToolsController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureTools
Repository
tools
Repository
)
{
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_tools
AssemblyRepository
=
toolsAssembly
Repository
;
_tools
Repository
=
tools
Repository
;
}
public
IActionResult
GetPageList
(
string
category
,
string
code
,
string
name
,
string
state
,
int
page
,
int
pagesize
)
{
var
data
=
_toolsRepository
.
GetPagedList
(
category
.
ToInt
(),
code
,
name
,
string
.
IsNullOrEmpty
(
state
)
?
-
1
:
state
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
[
HttpPost
]
public
IActionResult
Add
([
FromBody
]
RequestAddFixtureTools
req
)
{
if
(
string
.
IsNullOrEmpty
(
req
.
partnumber
)
||
string
.
IsNullOrEmpty
(
req
.
code
)
||
string
.
IsNullOrEmpty
(
req
.
name
)
||
string
.
IsNullOrEmpty
(
req
.
categoryid
)
||
string
.
IsNullOrEmpty
(
req
.
managetype
)
||
string
.
IsNullOrEmpty
(
req
.
managetype
))
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
data
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
(
q
.
name
==
req
.
name
||
q
.
code
==
req
.
code
||
q
.
partnumber
==
req
.
partnumber
));
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
category
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
id
==
req
.
categoryid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
if
(
category
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolCatgeoryNotFound
);
}
var
entity
=
new
siger_automation_fixture_tools
{
guid
=
Guid
.
NewGuid
().
ToString
(),
category
=
category
.
guid
,
managetype
=
req
.
managetype
.
ToInt
(),
partnumber
=
req
.
partnumber
,
name
=
req
.
name
,
specification
=
req
.
specifition
,
number
=
req
.
number
.
ToInt
(),
remark
=
req
.
remark
,
attachment
=
req
.
attachment
,
code
=
req
.
code
,
projectId
=
ProjectId
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
creator
=
UserId
,
updator
=
UserId
,
};
_toolsRepository
.
Insert
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Update
([
FromBody
]
RequestUpdateFixtureTools
req
)
{
if
(
string
.
IsNullOrEmpty
(
req
.
partnumber
)
||
string
.
IsNullOrEmpty
(
req
.
code
)
||
string
.
IsNullOrEmpty
(
req
.
name
)
||
string
.
IsNullOrEmpty
(
req
.
categoryid
)
||
string
.
IsNullOrEmpty
(
req
.
managetype
)
||
string
.
IsNullOrEmpty
(
req
.
managetype
)
||
req
.
id
<=
0
)
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entity
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
id
);
var
data
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
(
q
.
name
==
req
.
name
||
q
.
code
==
req
.
code
||
q
.
partnumber
==
req
.
partnumber
)
&&
q
.
id
!=
req
.
id
);
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
category
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
id
==
req
.
categoryid
.
ToInt
()
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
if
(
category
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolCatgeoryNotFound
);
}
entity
.
category
=
category
.
guid
;
entity
.
managetype
=
req
.
managetype
.
ToInt
();
entity
.
partnumber
=
req
.
partnumber
;
entity
.
name
=
req
.
name
;
entity
.
specification
=
req
.
specifition
;
entity
.
number
=
req
.
number
.
ToInt
();
entity
.
remark
=
req
.
remark
;
entity
.
attachment
=
req
.
attachment
;
entity
.
code
=
req
.
code
;
entity
.
updatetime
=
DateTime
.
Now
;
entity
.
updator
=
UserId
;
_toolsRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpGet
]
public
IActionResult
Delete
(
int
id
)
{
var
entity
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
id
);
if
(
entity
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_toolsRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Deletes
([
FromBody
]
RequestDeleteRange
req
)
{
if
(
req
.
ids
==
null
||
!
req
.
ids
.
Any
())
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entities
=
_toolsRepository
.
GetList
(
t
=>
req
.
ids
.
Contains
(
t
.
id
)
&&
t
.
projectId
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
if
(!
entities
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
foreach
(
var
entity
in
entities
)
{
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_toolsRepository
.
Update
(
entity
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
[
HttpGet
]
public
IActionResult
GetCategoryPageList
(
int
id
,
int
page
,
int
pagesize
)
{
var
data
=
_toolsCategoryRepository
.
GetPagedList
(
id
,
ProjectId
,
page
,
pagesize
);
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
[
HttpPost
]
public
IActionResult
AddCategory
([
FromBody
]
RequestAddFixtureToolsCategory
req
)
{
var
data
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
name
==
req
.
name
);
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
parent
=
""
;
if
(
req
.
parentid
.
ToInt
()
>
0
)
{
var
exsit
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
parentid
.
ToInt
());
if
(
exsit
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
else
{
parent
=
exsit
.
guid
;
}
}
var
entity
=
new
siger_automation_fixture_tools_category
{
name
=
req
.
name
,
parent
=
parent
,
guid
=
Guid
.
NewGuid
().
ToString
(),
projectId
=
ProjectId
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
};
_toolsCategoryRepository
.
Insert
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
UpdateCategory
([
FromBody
]
RequestUpdateFixtureToolsCategory
req
)
{
var
entity
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
id
);
var
data
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
name
==
req
.
name
&&
q
.
id
!=
req
.
id
);
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
parent
=
""
;
if
(
req
.
parentid
.
ToInt
()
>
0
)
{
var
exsit
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
parentid
.
ToInt
());
if
(
exsit
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
else
{
parent
=
exsit
.
guid
;
}
}
entity
.
name
=
req
.
name
;
entity
.
parent
=
parent
;
entity
.
updatetime
=
DateTime
.
Now
;
_toolsCategoryRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpGet
]
public
IActionResult
DeleteCategory
(
int
id
)
{
var
entity
=
_toolsCategoryRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
id
);
if
(
entity
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_toolsCategoryRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
DeleteCategorys
([
FromBody
]
RequestDeleteRange
req
)
{
if
(
req
.
ids
==
null
||
!
req
.
ids
.
Any
())
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entities
=
_toolsCategoryRepository
.
GetList
(
t
=>
req
.
ids
.
Contains
(
t
.
id
)
&&
t
.
projectId
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
if
(!
entities
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
foreach
(
var
entity
in
entities
)
{
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_toolsCategoryRepository
.
Update
(
entity
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
[
HttpGet
]
public
IActionResult
GetCategoryList
()
{
var
list
=
_toolsCategoryRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
res
=
GetChildren
(
""
,
list
);
return
new
ObjectResult
(
res
);
}
private
List
<
FixtureToolsCategoryTree
>
GetChildren
(
string
parentid
,
List
<
siger_automation_fixture_tools_category
>
sectionDatas
)
{
var
resp
=
new
List
<
FixtureToolsCategoryTree
>();
var
query
=
sectionDatas
.
Where
(
f
=>
f
.
parent
==
parentid
);
if
(!
query
.
Any
())
{
return
null
;
}
foreach
(
var
section
in
query
)
{
var
data
=
new
FixtureToolsCategoryTree
{
value
=
section
.
id
,
label
=
section
.
name
};
data
.
children
=
GetChildren
(
section
.
guid
,
sectionDatas
);
resp
.
Add
(
data
);
}
return
resp
;
}
}
}
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsProductController.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Linq.Expressions
;
using
Microsoft.AspNetCore.Mvc
;
using
Siger.ApiCommon.Result
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.AccRepository.Request
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Repository.Repositories.Interface
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Repository.Extensions
;
using
System.Linq
;
using
Siger.Middlelayer.Repository.Entities
;
namespace
Siger.ApiACC.Controllers
{
public
class
FixtureToolsProductController
:
BaseController
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureToolsRepository
_toolsRepository
;
private
readonly
IAutomationFixtureToolsProductRepository
_toolsProductRepository
;
private
readonly
ISigerProjectProductRepository
_productRepository
;
public
FixtureToolsProductController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureToolsRepository
toolsRepository
,
IAutomationFixtureToolsProductRepository
toolsProductRepository
,
ISigerProjectProductRepository
productRepository
)
{
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_toolsRepository
=
toolsRepository
;
_toolsProductRepository
=
toolsProductRepository
;
_productRepository
=
productRepository
;
}
public
IActionResult
GetPageList
(
string
category
,
string
tool
,
string
product
,
int
page
,
int
pagesize
)
{
var
data
=
_toolsProductRepository
.
GetPagedList
(
category
.
ToInt
(),
tool
.
ToInt
(),
product
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
[
HttpPost
]
public
IActionResult
Add
([
FromBody
]
RequestAddFixtureToolsProduct
req
)
{
if
(
string
.
IsNullOrEmpty
(
req
.
fixturetoolid
)
||
string
.
IsNullOrEmpty
(
req
.
productid
))
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
fixtureTool
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
fixturetoolid
.
ToInt
());
if
(
fixtureTool
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
product
=
_productRepository
.
Get
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
productid
.
ToInt
());
if
(
product
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
ProductNotFound
);
}
var
data
=
_toolsProductRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
(
q
.
fixturetools
==
fixtureTool
.
guid
||
q
.
productid
==
req
.
productid
.
ToInt
()));
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
var
entity
=
new
siger_automation_fixture_tools_product
{
guid
=
Guid
.
NewGuid
().
ToString
(),
fixturetools
=
fixtureTool
.
guid
,
remark
=
req
.
remark
,
productid
=
req
.
productid
.
ToInt
(),
projectId
=
ProjectId
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
creator
=
UserId
,
updator
=
UserId
,
};
_toolsProductRepository
.
Insert
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Update
([
FromBody
]
RequestUpdateFixtureToolsProduct
req
)
{
if
(
string
.
IsNullOrEmpty
(
req
.
fixturetoolid
)
||
string
.
IsNullOrEmpty
(
req
.
productid
))
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entity
=
_toolsProductRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
id
);
if
(
entity
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
fixtureTool
=
_toolsRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
fixturetoolid
.
ToInt
());
if
(
fixtureTool
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
product
=
_productRepository
.
Get
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
req
.
productid
.
ToInt
());
if
(
product
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
ProductNotFound
);
}
var
data
=
_toolsProductRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
(
q
.
fixturetools
==
fixtureTool
.
guid
||
q
.
productid
==
req
.
productid
.
ToInt
())
&&
q
.
id
!=
req
.
id
);
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
entity
.
fixturetools
=
fixtureTool
.
guid
;
entity
.
remark
=
req
.
remark
;
entity
.
productid
=
req
.
productid
.
ToInt
();
entity
.
updatetime
=
DateTime
.
Now
;
entity
.
updator
=
UserId
;
_toolsProductRepository
.
Insert
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpGet
]
public
IActionResult
Delete
(
int
id
)
{
var
entity
=
_toolsProductRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
id
==
id
);
if
(
entity
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_toolsProductRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
[
HttpPost
]
public
IActionResult
Deletes
([
FromBody
]
RequestDeleteRange
req
)
{
if
(
req
.
ids
==
null
||
!
req
.
ids
.
Any
())
{
throw
new
BadRequestException
(
RequestEnum
.
ParameterMiss
);
}
var
entities
=
_toolsProductRepository
.
GetList
(
t
=>
req
.
ids
.
Contains
(
t
.
id
)
&&
t
.
projectId
==
ProjectId
&&
t
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
if
(!
entities
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
foreach
(
var
entity
in
entities
)
{
entity
.
status
=
(
int
)
RowState
.
Invalid
;
_toolsProductRepository
.
Update
(
entity
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
}
Server/Apis/Siger.ApiACC/Controllers/LaisiBaseController.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Mvc
;
using
Siger.ApiCommon
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Configuration
;
using
Siger.Middlelayer.Common.Extensions
;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace
Siger.ApiACC.Controllers
{
[
Route
(
"acc/[controller]/[action]"
)]
public
class
LaisiBaseController
{
/// <summary>
/// 自动线 ProjectID 通过配置
/// </summary>
public
int
PID
=
0
;
public
LaisiBaseController
()
{
var
_pid
=
ConfigManager
.
GetValue
(
"ProjectSetting"
,
"ProjectId"
,
string
.
Empty
);
if
(
string
.
IsNullOrEmpty
(
_pid
))
throw
new
Exception
(
"DbSetting about [ProjectSetting] ProjectId not found."
);
PID
=
_pid
.
ToInt
();
}
}
}
Server/Common/Siger.Middlelayer.Share/Constant/AccDictCost.cs
View file @
0a6ba9b6
...
...
@@ -63,6 +63,12 @@ namespace Siger.Middlelayer.Common
/// 罗美特分类
/// </summary>
public
const
string
FlowMetek
=
"FlowMetek"
;
/// <summary>
/// MES 自动线类型
/// </summary>
public
const
string
Automation
=
"automation"
;
}
public
class
AccDictCostNoProjectId
...
...
@@ -102,4 +108,6 @@ namespace Siger.Middlelayer.Common
/// </summary>
public
const
string
outgoing_type
=
"outgoing_type"
;
}
}
Server/Common/Siger.Middlelayer.Share/Constant/DictKeyValConst.cs
View file @
0a6ba9b6
...
...
@@ -28,5 +28,18 @@ namespace Siger.Middlelayer.Share.Constant
/// 表头 工站
/// </summary>
public
const
string
EleHeader
=
"EleHeader"
;
/// <summary>
/// automation key:清洗工站
/// </summary>
public
const
string
CleanStation
=
"CleanStation"
;
/// <summary>
/// key:上料工站
/// </summary>
public
const
string
UploadloadStation
=
"UploadloadStation"
;
/// <summary>
/// key:下料工站
/// </summary>
public
const
string
DownloadStation
=
"DownloadStation"
;
}
}
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
0a6ba9b6
...
...
@@ -314,7 +314,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"序号规则未配置"
)]
SerinumCfgEmpty
,
[
Description
(
"序号已全部生成"
)]
SerinumFull
SerinumFull
,
[
Description
(
"该任务状态已经完成"
)]
AutoTaskDone
...
...
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/Automation.cs
View file @
0a6ba9b6
...
...
@@ -8,7 +8,7 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
public
class
Automation
{
/// <summary>
/// 任务触发
类型
/// 任务触发
方式 1 手动 2 自动
/// </summary>
public
enum
TaskTrigerType
{
...
...
@@ -61,6 +61,17 @@ namespace Siger.Middlelayer.Share.Enum.ModuleEnum
/// </summary>
Complated
=
3
}
/// <summary>
/// 动作类型 1:load 2:Unload
/// </summary>
public
enum
TaskActionType
{
[
Description
(
"Load"
)]
Load
=
1
,
[
Description
(
"Unload"
)]
Unload
=
2
}
/// <summary>
/// 动作
/// </summary>
...
...
Server/Common/Siger.Middlelayer.Share/Enum/RequestEnum.cs
View file @
0a6ba9b6
...
...
@@ -1464,5 +1464,11 @@ namespace Siger.Middlelayer.Common
[
Description
(
"未找到储位类别"
)]
LocationTypeNotFound
,
[
Description
(
"未找到工装类别"
)]
FixtureToolCatgeoryNotFound
,
[
Description
(
"未找到工装信息"
)]
FixtureToolNotFound
,
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/ApiAccDbContext.cs
View file @
0a6ba9b6
...
...
@@ -150,6 +150,15 @@ namespace Siger.Middlelayer.AccRepository
public
DbSet
<
siger_automation_fixture_tools_category
>
siger_automation_fixture_tools_category
{
get
;
set
;
}
public
DbSet
<
siger_automation_fixture_tools_assembly
>
siger_automation_fixture_tools_assembly
{
get
;
set
;
}
public
DbSet
<
siger_automation_fixture_tools
>
siger_automation_fixture_tools
{
get
;
set
;
}
public
DbSet
<
siger_automation_fixture_tools_product
>
siger_automation_fixture_tools_product
{
get
;
set
;
}
public
DbSet
<
siger_automation_location
>
siger_automation_location
{
get
;
set
;
}
public
DbSet
<
siger_automation_section_property
>
siger_automation_section_property
{
get
;
set
;
}
public
DbSet
<
siger_automation_section_route
>
siger_automation_section_route
{
get
;
set
;
}
public
DbSet
<
siger_automation_task_list
>
siger_automation_task_list
{
get
;
set
;
}
public
DbSet
<
siger_wms_storage
>
siger_wms_storage
{
get
;
set
;
}
public
DbSet
<
siger_wms_storage_location
>
siger_wms_storage_location
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 工装台账信息
/// </summary>
public
class
siger_automation_fixture_tools
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 工装类别
/// </summary>
public
string
category
{
get
;
set
;
}
/// <summary>
/// 管理类型
/// </summary>
public
int
managetype
{
get
;
set
;
}
/// <summary>
/// 工装料号
/// </summary>
public
string
partnumber
{
get
;
set
;
}
/// <summary>
/// 工装名称
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 规格型号
/// </summary>
public
string
specification
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
int
number
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
public
string
attachment
{
get
;
set
;
}
/// <summary>
/// 工装编号
/// </summary>
public
string
code
{
get
;
set
;
}
public
DateTime
createtime
{
get
;
set
;
}
public
int
creator
{
get
;
set
;
}
public
int
updator
{
get
;
set
;
}
public
DateTime
?
updatetime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_assembly.cs
View file @
0a6ba9b6
...
...
@@ -4,20 +4,25 @@ using System.Text;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 工装装配信息
/// </summary>
public
class
siger_automation_fixture_tools_assembly
:
AccEntityBase
{
public
string
name
{
get
;
set
;
}
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 父工装GUID
/// </summary>
public
string
parent
{
get
;
set
;
}
/// <summary>
/// 工装GUID
/// </summary>
public
string
son
{
get
;
set
;
}
public
int
creator
{
get
;
set
;
}
public
DateTime
create
T
ime
{
get
;
set
;
}
public
DateTime
create
t
ime
{
get
;
set
;
}
public
int
updator
{
get
;
set
;
}
public
DateTime
?
update
T
ime
{
get
;
set
;
}
public
DateTime
?
update
t
ime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_category.cs
View file @
0a6ba9b6
...
...
@@ -12,9 +12,9 @@ namespace Siger.Middlelayer.AccRepository.Entities
public
string
parent
{
get
;
set
;
}
public
DateTime
create
T
ime
{
get
;
set
;
}
public
DateTime
create
t
ime
{
get
;
set
;
}
public
DateTime
?
update
T
ime
{
get
;
set
;
}
public
DateTime
?
update
t
ime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_product.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 工装对应产品
/// </summary>
public
class
siger_automation_fixture_tools_product
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 工装GUID
/// </summary>
public
string
fixturetools
{
get
;
set
;
}
/// <summary>
/// 产品ID
/// </summary>
public
int
productid
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
public
DateTime
createtime
{
get
;
set
;
}
public
int
creator
{
get
;
set
;
}
public
int
updator
{
get
;
set
;
}
public
DateTime
?
updatetime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_location.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 储位信息
/// </summary>
public
class
siger_automation_location
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 储位位置
/// </summary>
public
int
locationid
{
get
;
set
;
}
/// <summary>
/// 工装GUID
/// </summary>
public
string
fixturetools
{
get
;
set
;
}
/// <summary>
/// 物料ID
/// </summary>
public
int
materialid
{
get
;
set
;
}
/// <summary>
/// 工序ID
/// </summary>
public
int
processid
{
get
;
set
;
}
/// <summary>
/// 物料状态
/// </summary>
public
int
materialstate
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
public
string
attachment
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
public
int
updator
{
get
;
set
;
}
public
DateTime
?
updatetime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_machine_property.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 工位属性
/// </summary>
public
class
siger_automation_section_property
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 工位ID
/// </summary>
public
int
sectionid
{
get
;
set
;
}
/// <summary>
/// 1:上下料工位2:加工工位3:检验工位4:装配工位5:存储工位
/// </summary>
public
int
propertytype
{
get
;
set
;
}
/// <summary>
/// 0:不是上料1:是上料
/// </summary>
public
string
upload
{
get
;
set
;
}
/// <summary>
/// 0:不是下料1:是下料
/// </summary>
public
string
down
{
get
;
set
;
}
public
DateTime
createtime
{
get
;
set
;
}
public
DateTime
?
updatetime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_section_route.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 自动线路径
/// </summary>
public
class
siger_automation_section_route
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 产线
/// </summary>
public
int
sectionid
{
get
;
set
;
}
/// <summary>
/// 开始工位
/// </summary>
public
int
startsection
{
get
;
set
;
}
/// <summary>
/// 目标工位
/// </summary>
public
int
endsection
{
get
;
set
;
}
public
DateTime
createtime
{
get
;
set
;
}
public
DateTime
?
updatetime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_task_list.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
static
Siger
.
Middlelayer
.
Share
.
Enum
.
ModuleEnum
.
Automation
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// 工装台账信息
/// </summary>
public
class
siger_automation_task_list
:
AccEntityBase
{
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 工位ID
/// </summary>
public
string
sectionid
{
get
;
set
;
}
/// <summary>
/// 触发方式
/// </summary>
public
TaskTrigerType
trigger
{
get
;
set
;
}
/// <summary>
/// 任务类型
/// </summary>
public
TaskActionType
tasktype
{
get
;
set
;
}
/// <summary>
/// 发起工位
/// </summary>
public
int
startsection
{
get
;
set
;
}
/// <summary>
/// 工件ID
/// </summary>
public
int
materialid
{
get
;
set
;
}
/// <summary>
/// 工单号
/// </summary>
public
string
ordercode
{
get
;
set
;
}
/// <summary>
/// 产品ID
/// </summary>
public
int
productid
{
get
;
set
;
}
/// <summary>
/// 工序ID
/// </summary>
public
int
processid
{
get
;
set
;
}
/// <summary>
/// 程序号
/// </summary>
public
string
programnumber
{
get
;
set
;
}
/// <summary>
/// 储位位置
/// </summary>
public
int
locationid
{
get
;
set
;
}
/// <summary>
/// 工装GUID
/// </summary>
public
int
fixturetools
{
get
;
set
;
}
/// <summary>
/// 动作类型 1 手动 2 自动
/// </summary>
public
TaskTrigerType
actiontype
{
get
;
set
;
}
/// <summary>
/// 动作
/// </summary>
public
TaskAction
action
{
get
;
set
;
}
/// <summary>
/// 是否已下发PLC 0:未下发 1:已下发
/// </summary>
public
int
send
{
get
;
set
;
}
/// <summary>
/// 触发时间
/// </summary>
public
DateTime
triggertime
{
get
;
set
;
}
/// <summary>
/// 完成时间
/// </summary>
public
DateTime
?
completetime
{
get
;
set
;
}
/// <summary>
/// 操作人
/// </summary>
public
int
operater
{
get
;
set
;
}
/// <summary>
/// 操作时间
/// </summary>
public
DateTime
?
operatetime
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_wms_storage.cs
0 → 100644
View file @
0a6ba9b6
//-----------------------------------------------------------------------
// <copyright file=" siger_wms_storage.cs" company="xxxx Enterprises">
// * Copyright (C) 2019 xxxx Enterprises All Rights Reserved
// * version : 4.0.30319.42000
// * author : auto generated by T4
// * FileName: siger_wms_storage.cs
// * history : Created by T4 04/01/2019 09:14:26
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// siger_wms_storage Entity Model
/// </summary>
public
class
siger_wms_storage
:
AccEntityBase
{
/// <summary>
/// 分类
/// </summary>
public
int
typeid
{
get
;
set
;
}
/// <summary>
/// 仓库名称
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 编号
/// </summary>
public
string
serial_number
{
get
;
set
;
}
/// <summary>
/// 仓库详细地址
/// </summary>
public
string
address
{
get
;
set
;
}
/// <summary>
/// 联系人
/// </summary>
public
string
manager
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
creator
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
DateTime
create_time
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
updator
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
DateTime
update_time
{
get
;
set
;
}
public
string
description
{
get
;
set
;
}
public
string
phone
{
get
;
set
;
}
public
string
mobile
{
get
;
set
;
}
public
string
option
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_wms_storage_location.cs
0 → 100644
View file @
0a6ba9b6
//-----------------------------------------------------------------------
// <copyright file=" siger_wms_storage_location.cs" company="xxxx Enterprises">
// * Copyright (C) 2019 xxxx Enterprises All Rights Reserved
// * version : 4.0.30319.42000
// * author : auto generated by T4
// * FileName: siger_wms_storage_location.cs
// * history : Created by T4 04/01/2019 09:14:26
// </copyright>
//-----------------------------------------------------------------------
using
System
;
using
System.ComponentModel.DataAnnotations
;
namespace
Siger.Middlelayer.AccRepository.Entities
{
/// <summary>
/// siger_wms_storage_location Entity Model
/// </summary>
public
class
siger_wms_storage_location
:
AccEntityBase
{
/// <summary>
/// 仓库id
/// </summary>
public
int
storageid
{
get
;
set
;
}
/// <summary>
/// 父类
/// </summary>
public
int
parentid
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 区分层级 区域1,货架2,层号3,位置4
/// </summary>
public
int
level
{
get
;
set
;
}
/// <summary>
/// 分类
/// </summary>
public
int
typeid
{
get
;
set
;
}
/// <summary>
/// 储位编号-只有level=4才有
/// </summary>
public
string
serial_number
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
creator
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
DateTime
create_time
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
int
updator
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
DateTime
update_time
{
get
;
set
;
}
public
string
option
{
get
;
set
;
}
public
string
realname
{
get
;
set
;
}
public
int
locationid
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsAssemblyRepository.cs
View file @
0a6ba9b6
...
...
@@ -4,7 +4,10 @@ using System.Linq.Expressions;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Extensions
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
...
...
@@ -16,5 +19,32 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
_context
=
context
;
}
public
IPagedCollectionResult
<
ResponseAumationFixtureToolsAssembly
>
GetPagedList
(
int
categor
,
int
projectid
,
int
page
,
int
pagesize
)
{
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools_assembly
join
t1
in
_context
.
siger_automation_fixture_tools
on
q
.
parent
equals
t1
.
guid
into
tt1
from
t1
in
tt1
.
DefaultIfEmpty
()
join
c1
in
_context
.
siger_automation_fixture_tools_category
on
t1
.
category
equals
c1
.
guid
join
t2
in
_context
.
siger_automation_fixture_tools
on
q
.
son
equals
t2
.
guid
join
c2
in
_context
.
siger_automation_fixture_tools_category
on
t2
.
category
equals
c2
.
guid
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
from
u
in
uu
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
string
.
IsNullOrEmpty
(
q
.
parent
)
select
new
ResponseAumationFixtureToolsAssembly
{
id
=
q
.
id
,
parentid
=
t1
==
null
?
0
:
t1
.
id
,
parentname
=
t1
.
name
??
""
,
sonid
=
t2
.
id
,
sonname
=
t2
.
name
??
""
,
updator
=
u
.
name
??
""
,
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
};
var
entities
=
query
.
OrderByDescending
(
q
=>
q
.
id
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
AsNoTracking
().
ToList
();
var
totalCount
=
query
.
Count
();
return
new
PagedCollectionResult
<
ResponseAumationFixtureToolsAssembly
>(
entities
,
totalCount
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsCategoryRepository.cs
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
...
...
@@ -16,5 +19,32 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
_context
=
context
;
}
public
IPagedCollectionResult
<
ResponseFixtureToolsCategory
>
GetPagedList
(
int
id
,
int
projectid
,
int
page
,
int
pagesize
)
{
Expression
<
Func
<
ResponseFixtureToolsCategory
,
bool
>>
FunNum
=
f
=>
true
;
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools_category
join
p
in
_context
.
siger_automation_fixture_tools_category
on
q
.
parent
equals
p
.
guid
into
pp
from
p
in
pp
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseFixtureToolsCategory
{
id
=
q
.
id
,
name
=
q
.
name
,
parentid
=
p
==
null
?
0
:
p
.
id
,
parentname
=
p
.
name
??
""
,
parent
=
q
.
parent
,
guid
=
q
.
guid
,
createtime
=
q
.
createtime
.
ToString
(
ParameterConstant
.
DateTimeFormat
),
time
=
q
.
createtime
};
if
(
id
>
0
)
{
FunNum
=
q
=>
q
.
id
==
id
;
}
var
entities
=
query
.
Where
(
FunNum
).
OrderBy
(
q
=>
q
.
parentid
).
OrderBy
(
q
=>
q
.
createtime
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
AsNoTracking
().
ToList
();
var
totalCount
=
query
.
Where
(
FunNum
).
Count
();
return
new
PagedCollectionResult
<
ResponseFixtureToolsCategory
>(
entities
,
totalCount
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Extensions
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
{
internal
class
AutomationFixtureToolsProductRepository
:
AccRepositoryBase
<
siger_automation_fixture_tools_product
>,
IAutomationFixtureToolsProductRepository
{
private
ApiAccDbContext
_context
;
public
AutomationFixtureToolsProductRepository
(
ApiAccDbContext
context
)
:
base
(
context
)
{
_context
=
context
;
}
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
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
c
in
_context
.
siger_automation_fixture_tools_category
on
t
.
category
equals
c
.
guid
join
p
in
_context
.
siger_project_product
on
q
.
productid
equals
p
.
id
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
from
u
in
uu
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAumationFixtureToolsProduct
{
id
=
q
.
id
,
categoryid
=
c
.
id
,
categoryname
=
c
.
name
,
fixturetoolid
=
t
.
id
,
fixturetool
=
t
.
name
,
productid
=
q
.
productid
,
productname
=
p
.
name
,
remark
=
q
.
remark
,
updator
=
q
.
updator
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
};
Expression
<
Func
<
ResponseAumationFixtureToolsProduct
,
bool
>>
categoryExpression
=
f
=>
true
;
if
(
category
>
0
)
{
categoryExpression
=
q
=>
q
.
categoryid
==
category
;
}
Expression
<
Func
<
ResponseAumationFixtureToolsProduct
,
bool
>>
toolExpression
=
f
=>
true
;
if
(
tool
>
0
)
{
toolExpression
=
q
=>
q
.
fixturetoolid
==
tool
;
}
Expression
<
Func
<
ResponseAumationFixtureToolsProduct
,
bool
>>
productExpression
=
f
=>
true
;
if
(
product
>
0
)
{
productExpression
=
q
=>
q
.
productid
==
product
;
}
var
expression
=
categoryExpression
.
And
(
toolExpression
).
And
(
productExpression
);
var
entities
=
query
.
Where
(
expression
).
OrderByDescending
(
q
=>
q
.
id
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
AsNoTracking
().
ToList
();
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseAumationFixtureToolsProduct
>(
entities
,
totalCount
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsRepository.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Extensions
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
{
internal
class
AutomationFixtureToolsRepository
:
AccRepositoryBase
<
siger_automation_fixture_tools
>,
IAutomationFixtureToolsRepository
{
private
ApiAccDbContext
_context
;
public
AutomationFixtureToolsRepository
(
ApiAccDbContext
context
)
:
base
(
context
)
{
_context
=
context
;
}
public
IPagedCollectionResult
<
ResponseFixtureTools
>
GetPagedList
(
int
category
,
string
code
,
string
name
,
int
state
,
int
projectid
,
int
page
,
int
pagesize
)
{
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools
join
p
in
_context
.
siger_automation_fixture_tools_category
on
q
.
category
equals
p
.
guid
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
from
u
in
uu
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseFixtureTools
{
id
=
q
.
id
,
name
=
q
.
name
,
guid
=
q
.
guid
,
categoryid
=
p
.
id
,
category
=
p
.
name
,
managetype
=
q
.
managetype
,
partnumber
=
q
.
partnumber
,
specification
=
q
.
specification
,
number
=
q
.
number
,
remark
=
q
.
remark
,
attachment
=
q
.
attachment
,
code
=
q
.
code
,
updator
=
u
.
name
??
""
,
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
};
Expression
<
Func
<
ResponseFixtureTools
,
bool
>>
categoryExpression
=
f
=>
true
;
if
(
category
>
0
)
{
categoryExpression
=
q
=>
q
.
categoryid
==
category
;
}
Expression
<
Func
<
ResponseFixtureTools
,
bool
>>
codeExpression
=
f
=>
true
;
if
(!
string
.
IsNullOrEmpty
(
code
))
{
categoryExpression
=
q
=>
q
.
code
.
Contains
(
code
);
}
Expression
<
Func
<
ResponseFixtureTools
,
bool
>>
nameExpression
=
f
=>
true
;
if
(!
string
.
IsNullOrEmpty
(
name
))
{
nameExpression
=
q
=>
q
.
name
.
Contains
(
name
);
}
Expression
<
Func
<
ResponseFixtureTools
,
bool
>>
stateExpression
=
f
=>
true
;
if
(
state
>=
0
)
{
stateExpression
=
q
=>
q
.
status
==
state
;
}
var
expression
=
categoryExpression
.
And
(
codeExpression
).
And
(
nameExpression
).
And
(
stateExpression
);
var
entities
=
query
.
Where
(
expression
).
OrderByDescending
(
q
=>
q
.
id
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
AsNoTracking
().
ToList
();
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseFixtureTools
>(
entities
,
totalCount
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Extensions
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
{
internal
class
AutomationLocationRepository
:
AccRepositoryBase
<
siger_automation_location
>,
IAutomationLocationRepository
{
private
ApiAccDbContext
_context
;
public
AutomationLocationRepository
(
ApiAccDbContext
context
)
:
base
(
context
)
{
_context
=
context
;
}
public
IPagedCollectionResult
<
ResponseAutomationLocation
>
GetPagedList
(
int
wavehouseid
,
int
locationid
,
int
projectid
,
int
page
,
int
pagesize
)
{
var
query
=
from
q
in
_context
.
siger_automation_location
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
c
in
_context
.
siger_automation_fixture_tools_category
on
t
.
category
equals
c
.
guid
join
l
in
_context
.
siger_wms_storage_location
on
q
.
locationid
equals
l
.
locationid
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
join
m
in
_context
.
siger_tr_assist_materials
on
q
.
materialid
equals
m
.
id
join
p
in
_context
.
siger_project_process
on
q
.
processid
equals
p
.
id
into
pp
from
p
in
pp
.
DefaultIfEmpty
()
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
from
u
in
uu
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAutomationLocation
{
id
=
q
.
id
,
locationid
=
l
.
id
,
location
=
l
.
name
,
wavehouseid
=
w
.
id
,
wavehouse
=
w
.
name
,
fixturetoolid
=
t
.
id
,
fixturetool
=
t
.
name
,
category
=
c
.
name
,
code
=
t
.
code
,
specfication
=
t
.
specification
,
materialid
=
q
.
materialid
,
materialcode
=
m
.
pn
,
processid
=
q
.
processid
,
processnumber
=
p
==
null
?
0
:
p
.
Process_Seq
,
processname
=
p
.
Process_name
??
""
,
materialstate
=
q
.
materialstate
,
attachment
=
q
.
attachment
,
remark
=
q
.
remark
,
updator
=
u
.
name
??
""
,
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
};
Expression
<
Func
<
ResponseAutomationLocation
,
bool
>>
wavehouseidExpression
=
f
=>
true
;
if
(
wavehouseid
>
0
)
{
wavehouseidExpression
=
q
=>
q
.
wavehouseid
==
wavehouseid
;
}
Expression
<
Func
<
ResponseAutomationLocation
,
bool
>>
locationidExpression
=
f
=>
true
;
if
(
locationid
>
0
)
{
locationidExpression
=
q
=>
q
.
locationid
==
locationid
;
}
var
expression
=
wavehouseidExpression
.
And
(
locationidExpression
);
var
entities
=
query
.
Where
(
expression
).
OrderByDescending
(
q
=>
q
.
id
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
AsNoTracking
().
ToList
();
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseAutomationLocation
>(
entities
,
totalCount
);
}
public
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
)
{
return
_context
.
siger_wms_storage_location
.
FirstOrDefault
(
q
=>
q
.
locationid
==
id
&&
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationSectionPropertyRepository.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
{
internal
class
AutomationSectionPropertyRepository
:
AccRepositoryBase
<
siger_automation_section_property
>,
IAutomationSectionPropertyRepository
{
private
ApiAccDbContext
_context
;
public
AutomationSectionPropertyRepository
(
ApiAccDbContext
context
)
:
base
(
context
)
{
_context
=
context
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationSectionRouteRepository.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
{
internal
class
AutomationSectionRouteRepository
:
AccRepositoryBase
<
siger_automation_section_route
>,
IAutomationSectionRouteRepository
{
private
ApiAccDbContext
_context
;
public
AutomationSectionRouteRepository
(
ApiAccDbContext
context
)
:
base
(
context
)
{
_context
=
context
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories
{
internal
class
AutomationTaskListRepository
:
AccRepositoryBase
<
siger_automation_task_list
>,
IAutomationTaskListRepository
{
private
ApiAccDbContext
_context
;
public
AutomationTaskListRepository
(
ApiAccDbContext
context
)
:
base
(
context
)
{
_context
=
context
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsAssemblyRepository.cs
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
...
...
@@ -6,6 +7,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationFixtureToolsAssemblyRepository
:
IAccRepositoryBase
<
siger_automation_fixture_tools_assembly
>
{
IPagedCollectionResult
<
ResponseAumationFixtureToolsAssembly
>
GetPagedList
(
int
categor
,
int
projectid
,
int
page
,
int
pagesize
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsCategoryRepository.cs
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
...
...
@@ -6,5 +7,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationFixtureToolsCategoryRepository
:
IAccRepositoryBase
<
siger_automation_fixture_tools_category
>
{
IPagedCollectionResult
<
ResponseFixtureToolsCategory
>
GetPagedList
(
int
id
,
int
projectid
,
int
page
,
int
pagesize
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsProductRepository.cs
0 → 100644
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
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
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsRepository.cs
0 → 100644
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationFixtureToolsRepository
:
IAccRepositoryBase
<
siger_automation_fixture_tools
>
{
IPagedCollectionResult
<
ResponseFixtureTools
>
GetPagedList
(
int
category
,
string
code
,
string
name
,
int
state
,
int
projectid
,
int
page
,
int
pagesize
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
0 → 100644
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationLocationRepository
:
IAccRepositoryBase
<
siger_automation_location
>
{
IPagedCollectionResult
<
ResponseAutomationLocation
>
GetPagedList
(
int
wavehouseid
,
int
locationid
,
int
projectid
,
int
page
,
int
pagesize
);
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationSectionPropertyRepository.cs
0 → 100644
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationSectionPropertyRepository
:
IAccRepositoryBase
<
siger_automation_section_property
>
{
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationSectionRouteRepository.cs
0 → 100644
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationSectionRouteRepository
:
IAccRepositoryBase
<
siger_automation_section_route
>
{
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationTaskListRepository.cs
0 → 100644
View file @
0a6ba9b6
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
public
interface
IAutomationTaskListRepository
:
IAccRepositoryBase
<
siger_automation_task_list
>
{
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/RequestAutomationMachine.cs
View file @
0a6ba9b6
...
...
@@ -10,7 +10,7 @@ namespace Siger.Middlelayer.AccRepository.Request
/// 设备ID
/// </summary>
public
int
machine
{
get
;
set
;
}
public
int
machine
id
{
get
;
set
;
}
/// <summary>
/// 是否可用
/// </summary>
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/RequestFixtureToolsCategory.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel.DataAnnotations
;
using
Siger.Middlelayer.Common.ModuleEnum
;
using
Siger.Middlelayer.Repository.Request
;
namespace
Siger.Middlelayer.AccRepository.Request
{
public
class
RequestAddFixtureToolsCategory
{
public
string
parentid
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
}
public
class
RequestUpdateFixtureToolsCategory
:
RequestAddFixtureToolsCategory
{
public
int
id
{
get
;
set
;
}
}
public
class
RequestDeleteRange
{
public
List
<
int
>
ids
{
get
;
set
;
}
=
new
List
<
int
>();
}
public
class
RequestAddFixtureTools
{
/// <summary>
/// 工装类别
/// </summary>
public
string
categoryid
{
get
;
set
;
}
/// <summary>
/// 管理类型
/// </summary>
public
string
managetype
{
get
;
set
;
}
/// <summary>
/// 工装料号
/// </summary>
public
string
partnumber
{
get
;
set
;
}
/// <summary>
/// 工装名称
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 规格型号
/// </summary>
public
string
specifition
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
string
number
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
public
string
attachment
{
get
;
set
;
}
/// <summary>
/// 工装编号
/// </summary>
public
string
code
{
get
;
set
;
}
}
public
class
RequestUpdateFixtureTools
:
RequestAddFixtureTools
{
public
int
id
{
get
;
set
;
}
}
public
class
RequestAddFixtureToolsProduct
{
/// <summary>
/// 工装ID
/// </summary>
public
string
fixturetoolid
{
get
;
set
;
}
/// <summary>
/// 产品ID
/// </summary>
public
string
productid
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
}
public
class
RequestUpdateFixtureToolsProduct
:
RequestAddFixtureToolsProduct
{
public
int
id
{
get
;
set
;
}
}
public
class
RequestAddAutomationLocation
{
/// <summary>
/// 储位位置
/// </summary>
public
string
locationid
{
get
;
set
;
}
/// <summary>
/// 工装ID
/// </summary>
public
string
fixturetoolid
{
get
;
set
;
}
/// <summary>
/// 物料ID
/// </summary>
public
string
materialid
{
get
;
set
;
}
/// <summary>
/// 工序ID
/// </summary>
public
string
processid
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
public
string
attachment
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
}
public
class
RequestUpdateAutomationLocation
:
RequestAddAutomationLocation
{
public
int
id
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/FixtureToolsCategory.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Response
{
public
class
ResponseFixtureToolsCategory
{
public
int
id
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
public
int
parentid
{
get
;
set
;
}
public
string
parentname
{
get
;
set
;
}
public
string
guid
{
get
;
set
;
}
public
string
parent
{
get
;
set
;
}
public
DateTime
time
{
get
;
set
;
}
public
string
createtime
{
get
;
set
;
}
public
string
updatetime
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
}
public
class
ResponseFixtureTools
{
public
int
id
{
get
;
set
;
}
public
string
guid
{
get
;
set
;
}
/// <summary>
/// 工装类别ID
/// </summary>
public
int
categoryid
{
get
;
set
;
}
/// <summary>
/// 工装类别名称
/// </summary>
public
string
category
{
get
;
set
;
}
/// <summary>
/// 管理类型
/// </summary>
public
int
managetype
{
get
;
set
;
}
/// <summary>
/// 工装料号
/// </summary>
public
string
partnumber
{
get
;
set
;
}
/// <summary>
/// 工装名称
/// </summary>
public
string
name
{
get
;
set
;
}
/// <summary>
/// 规格型号
/// </summary>
public
string
specification
{
get
;
set
;
}
/// <summary>
/// 数量
/// </summary>
public
int
number
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
public
string
attachment
{
get
;
set
;
}
/// <summary>
/// 工装编号
/// </summary>
public
string
code
{
get
;
set
;
}
public
string
updator
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
string
updatetime
{
get
;
set
;
}
}
public
class
ResponseAumationFixtureToolsProduct
{
public
int
id
{
get
;
set
;
}
public
int
categoryid
{
get
;
set
;
}
public
string
categoryname
{
get
;
set
;
}
/// <summary>
/// 工装ID
/// </summary>
public
int
fixturetoolid
{
get
;
set
;
}
public
string
fixturetool
{
get
;
set
;
}
/// <summary>
/// 产品ID
/// </summary>
public
int
productid
{
get
;
set
;
}
public
string
productname
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
public
int
updator
{
get
;
set
;
}
public
string
updatetime
{
get
;
set
;
}
}
public
class
ResponseAumationFixtureToolsAssembly
{
public
int
id
{
get
;
set
;
}
public
int
parentid
{
get
;
set
;
}
public
string
parentname
{
get
;
set
;
}
public
int
sonid
{
get
;
set
;
}
public
string
sonname
{
get
;
set
;
}
public
string
partnumber
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
public
string
specfication
{
get
;
set
;
}
public
string
code
{
get
;
set
;
}
public
string
updator
{
get
;
set
;
}
public
string
updatetime
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Response
{
public
class
ResponseAutomationLocation
{
public
int
id
{
get
;
set
;
}
/// <summary>
/// 储位位置
/// </summary>
public
int
locationid
{
get
;
set
;
}
public
string
location
{
get
;
set
;
}
public
int
wavehouseid
{
get
;
set
;
}
public
string
wavehouse
{
get
;
set
;
}
/// <summary>
/// 工装ID
/// </summary>
public
int
fixturetoolid
{
get
;
set
;
}
public
string
fixturetool
{
get
;
set
;
}
public
string
category
{
get
;
set
;
}
public
string
code
{
get
;
set
;
}
public
string
specfication
{
get
;
set
;
}
/// <summary>
/// 物料ID
/// </summary>
public
int
materialid
{
get
;
set
;
}
public
string
materialcode
{
get
;
set
;
}
/// <summary>
/// 工序ID
/// </summary>
public
int
processid
{
get
;
set
;
}
public
int
processnumber
{
get
;
set
;
}
public
string
processname
{
get
;
set
;
}
/// <summary>
/// 物料状态
/// </summary>
public
int
materialstate
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
public
string
attachment
{
get
;
set
;
}
/// <summary>
/// 备注
/// </summary>
public
string
remark
{
get
;
set
;
}
public
string
updator
{
get
;
set
;
}
public
string
updatetime
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseFixtureTools.cs
0 → 100644
View file @
0a6ba9b6
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Response
{
public
class
FixtureToolsCategoryTree
{
public
int
value
{
get
;
set
;
}
public
string
label
{
get
;
set
;
}
public
List
<
FixtureToolsCategoryTree
>
children
=
new
List
<
FixtureToolsCategoryTree
>();
}
}
Server/Infrastructure/Script/DB.script
View file @
0a6ba9b6
...
...
@@ -177,15 +177,15 @@ SET FOREIGN_KEY_CHECKS = 0;
-- 工装类型维护
-- Table structure for siger_automation_fixture_tools_category
-- ----------------------------
CREATE TABLE IF NOT EX
SIT
`siger_automation_fixture_tools_category` (
CREATE TABLE IF NOT EX
ISTS
`siger_automation_fixture_tools_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`parent` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'siger_automation_fixture_tools_category.guid',
`projectid` int(11) NOT NULL,
`status` int(11) NOT NULL,
`create
T
ime` datetime(0) NOT NULL,
`update
T
ime` datetime(0) NULL DEFAULT NULL,
`create
t
ime` datetime(0) NOT NULL,
`update
t
ime` datetime(0) NULL DEFAULT NULL,
`extend1` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
...
...
@@ -194,14 +194,14 @@ CREATE TABLE IF NOT EXSIT `siger_automation_fixture_tools_category` (
-- 工装台账信息
-- Table structure for siger_automation_fixture_tools
-- ----------------------------
CREATE TABLE IF NOT EX
SIT
`siger_automation_fixture_tools` (
CREATE TABLE IF NOT EX
ISTS
`siger_automation_fixture_tools` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`category` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装类别siger_automation_fixture_tools_category.guid',
`managetype` int(11) NOT NULL DEFAULT 0 COMMENT '管理类型',
`partnumber` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装料号',
`name` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装名称',
`specifition` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格型号',
`specifi
ca
tion` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '规格型号',
`number` int(11) NOT NULL DEFAULT 0 COMMENT '数量',
`remark` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`attachment` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
...
...
@@ -219,17 +219,17 @@ CREATE TABLE IF NOT EXSIT `siger_automation_fixture_tools` (
-- 工装装配信息
-- Table structure for siger_automation_fixture_tools_assembly
-- ----------------------------
CREATE TABLE IF NOT EX
SIT
`siger_automation_fixture_tools_assembly` (
CREATE TABLE IF NOT EX
ISTS
`siger_automation_fixture_tools_assembly` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`parent` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '父类工装GUID',
`son` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '
子类
工装GUID',
`son` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1,
`creator` int(11) NOT NULL DEFAULT 0,
`createtime` datetime(0) NOT NULL,
`updator` int(11) NOT NULL DEFAULT 0,
`update
T
ime` datetime(0) NULL DEFAULT NULL,
`update
t
ime` datetime(0) NULL DEFAULT NULL,
`extend1` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
...
...
@@ -238,7 +238,7 @@ CREATE TABLE IF NOT EXSIT `siger_automation_fixture_tools_assembly` (
-- 工装类型应产品
-- Table structure for siger_automation_fixture_tools_product
-- ----------------------------
CREATE TABLE IF NOT EX
SIT
`siger_automation_fixture_tools_product` (
CREATE TABLE IF NOT EX
ISTS
`siger_automation_fixture_tools_product` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`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',
...
...
@@ -255,10 +255,10 @@ CREATE TABLE IF NOT EXSIT `siger_automation_fixture_tools_product` (
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
--
托盘台账列表
-- Table structure for siger_automation_
tray
--
储位工装信息
-- Table structure for siger_automation_
location
-- ----------------------------
CREATE TABLE IF NOT EX
SIT `siger_automation_tray
` (
CREATE TABLE IF NOT EX
ISTS `siger_automation_location
` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
...
...
@@ -275,12 +275,12 @@ CREATE TABLE IF NOT EXSIT `siger_automation_tray` (
-- ----------------------------
-- 工位属性
-- Table structure for siger_automation_
machine
_property
-- Table structure for siger_automation_
section
_property
-- ----------------------------
CREATE TABLE IF NOT EX
SIT `siger_automation_machine
_property` (
CREATE TABLE IF NOT EX
ISTS `siger_automation_section
_property` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`
machineid` int(11) NOT NULL DEFAULT 0 COMMENT '设备
ID',
`
sectionid` int(11) NOT NULL DEFAULT 0 COMMENT '工位
ID',
`propertytype` int(11) NOT NULL DEFAULT 0 COMMENT '1:上下料工位2:加工工位3:检验工位4:装配工位5:存储工位',
`upload` int(11) NOT NULL DEFAULT 0 COMMENT '0:不是上料1:是上料',
`down` int(11) NOT NULL DEFAULT 0 COMMENT '0:不是下料1:是下料',
...
...
@@ -296,12 +296,12 @@ CREATE TABLE IF NOT EXSIT `siger_automation_machine_property` (
-- 自动线路径
-- Table structure for siger_automation_section_route
-- ----------------------------
CREATE TABLE IF NOT EX
SIT
`siger_automation_section_route` (
CREATE TABLE IF NOT EX
ISTS
`siger_automation_section_route` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`sectionid` int(11) NOT NULL DEFAULT 0 COMMENT '产线',
`start
machine` int(11) NOT NULL DEFAULT 0 COMMENT '开始设备ID
',
`end
machine` int(11) NOT NULL DEFAULT 0 COMMENT '目标设备ID
',
`start
section` int(11) NOT NULL DEFAULT 0 COMMENT '开始工位
',
`end
section` int(11) NOT NULL DEFAULT 0 COMMENT '目标工位
',
`projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1,
`createtime` datetime(0) NOT NULL,
...
...
@@ -314,13 +314,13 @@ CREATE TABLE IF NOT EXSIT `siger_automation_section_route` (
-- 任务清单管理
-- Table structure for siger_automation_task_list
-- ----------------------------
CREATE TABLE IF NOT EX
SIT
`siger_automation_task_list` (
CREATE TABLE IF NOT EX
ISTS
`siger_automation_task_list` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`
machineid` int(11) NOT NULL DEFAULT 0 COMMENT '设备
ID',
`trigger` int(1
1
) NOT NULL DEFAULT 0 COMMENT '触发方',
`tasktype`
varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
COMMENT '任务类型',
`start
machine` int(11) NOT NULL DEFAULT 0 COMMENT '发起地
',
`
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 '任务类型',
`start
section` int(11) NOT NULL DEFAULT 0 COMMENT '发起工位
',
`materialid` int(11) NOT NULL DEFAULT 0 COMMENT '工件ID',
`ordercode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工单号',
`productid` int(11) NOT NULL DEFAULT 0 COMMENT '产品ID',
...
...
@@ -328,14 +328,15 @@ CREATE TABLE IF NOT EXSIT `siger_automation_task_list` (
`programnumber` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '程序号',
`locationid` int(11) NOT NULL COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`action`
varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
COMMENT '动作',
`action`
int(1) int(11) NOT NULL DEFAULT 0
COMMENT '动作',
`actiontype` int(11) NOT NULL DEFAULT 0 COMMENT '动作类型',
`projectid` int(11) NOT NULL DEFAULT 0,
`status` int(11) NOT NULL DEFAULT 1 COMMENT '状态',
`send` int(1) NOT NULL DEFAULT 0 COMMENT '0:未下发 1:已下发',
`status` int(11) NOT NULL DEFAULT 1 COMMENT '任务进度状态:0 取消 1待生产 2生产中 3生产完成',
`triggertime` datetime(0) NOT NULL COMMENT '触发时间',
`completetime` datetime(0) NULL DEFAULT NULL COMMENT '完成时间',
`op
rato
r` int(11) NOT NULL DEFAULT 0 COMMENT '操作人',
`opratetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`op
erate
r` int(11) NOT NULL DEFAULT 0 COMMENT '操作人',
`op
e
ratetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
`extend1` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
...
...
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