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
b7db37a4
Commit
b7db37a4
authored
Jan 23, 2021
by
yiyu.li
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://test.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
4e299047
9d78ae09
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
340 additions
and
45 deletions
+340
-45
collection.vue
Html/src/view/qms/manual/collection.vue
+18
-3
storagemaintenance.vue
Html/src/view/wms/config/storagemaintenance.vue
+1
-1
storageInfoQuery.vue
Html/src/view/wms/whStatusQuery/storageInfoQuery.vue
+9
-1
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+31
-2
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+57
-3
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+6
-3
FixtureToolsAssemblyController.cs
...iger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
+23
-0
FixtureToolsController.cs
...r/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
+8
-17
FixtureToolsProductController.cs
...Siger.ApiACC/Controllers/FixtureToolsProductController.cs
+2
-0
SectionPropertyController.cs
...pis/Siger.ApiACC/Controllers/SectionPropertyController.cs
+16
-4
LocationController.cs
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
+63
-0
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+2
-0
siger_automation_machine_status.cs
...AccRepository/Entities/siger_automation_machine_status.cs
+4
-0
siger_automation_task_list.cs
...ayer.AccRepository/Entities/siger_automation_task_list.cs
+4
-0
AutomationFixtureToolsAssemblyRepository.cs
.../Repositories/AutomationFixtureToolsAssemblyRepository.cs
+3
-1
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+7
-6
AutomationFixtureToolsRepository.cs
...pository/Repositories/AutomationFixtureToolsRepository.cs
+41
-0
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+7
-1
IAutomationFixtureToolsRepository.cs
...positories/Interface/IAutomationFixtureToolsRepository.cs
+5
-0
IAutomationLocationRepository.cs
...y/Repositories/Interface/IAutomationLocationRepository.cs
+2
-0
RequestAutomationMachine.cs
...lelayer.AccRepository/Request/RequestAutomationMachine.cs
+1
-0
requestAutoLoad.cs
...iger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
+5
-0
FixtureToolsCategory.cs
...iddlelayer.AccRepository/Response/FixtureToolsCategory.cs
+5
-0
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+3
-0
ResponseProductFixtureInfo.cs
...ayer.AccRepository/Response/ResponseProductFixtureInfo.cs
+2
-0
DB.script
Server/Infrastructure/Script/DB.script
+15
-3
No files found.
Html/src/view/qms/manual/collection.vue
View file @
b7db37a4
...
...
@@ -654,7 +654,6 @@ export default {
});
},
linechange
(
i
)
{
console
.
log
(
1111111111
);
this
.
a
=
i
;
this
.
line
=
this
.
lineList
[
i
];
this
.
initstations
(
this
.
line
.
id
);
...
...
@@ -672,7 +671,7 @@ export default {
axios
.
request
({
url
:
"
http://localhost:8105
/acc/SectionProperty/GetSections"
"/acc/SectionProperty/GetSections"
,
params
,
method
:
"get"
,
...
...
@@ -715,6 +714,22 @@ export default {
this
.
b
=
i
;
this
.
station
=
this
.
stationList
[
i
];
this
.
initproduct
(
this
.
station
.
id
);
this
.
initSn
(
this
.
station
.
id
)
},
initSn
(
sectionid
){
if
(
sectionid
>
0
)
{
axios
.
request
({
url
:
"/acc/SectionProperty/GetSn?productId="
+
productid
+
"§ionId="
+
sectionid
,
method
:
"get"
,
})
.
then
((
res
)
=>
{
if
(
res
.
data
.
ret
===
1
)
{
this
.
qrcode
=
res
.
data
.
data
;
}
});
}
},
productchange
(
i
)
{
this
.
c
=
i
;
...
...
@@ -730,7 +745,7 @@ export default {
axios
.
request
({
url
:
"/acc/SectionProperty/GetRouteByProduct?productId="
+
productid
,
"/acc/SectionProperty/GetRouteByProduct?productId="
+
productid
+
"§ionId="
+
sectionid
,
method
:
"get"
,
})
.
then
((
res
)
=>
{
...
...
Html/src/view/wms/config/storagemaintenance.vue
View file @
b7db37a4
...
...
@@ -231,7 +231,7 @@ export default {
page
:
this
.
page
,
pageSize
:
this
.
pagesize
,
id
:
this
.
whid
,
// 仓库id
isWa
r
ehouse
:
1
,
isWa
v
ehouse
:
1
,
};
this
.
detailobj
=
{};
this
.
request
(
"/wms/Location/GetLocationList"
,
data
,
"get"
).
then
(
...
...
Html/src/view/wms/whStatusQuery/storageInfoQuery.vue
View file @
b7db37a4
...
...
@@ -309,7 +309,7 @@ export default {
this
.
storageList1
=
[];
this
.
addstorageid
=
""
;
if
(
value
!=
undefined
){
this
.
warehouseid
=
value
.
value
;
this
.
add
warehouseid
=
value
.
value
;
this
.
addinitStorage
();
}
},
...
...
@@ -460,6 +460,14 @@ export default {
},
add
(){
this
.
type
=
1
;
this
.
initFrockType
();
//工装类型
this
.
addstorageid
=
''
;
//仓库id
this
.
parentType
=
[];
//工装类型
this
.
parentTypeid
=
''
;
//工装类型id
this
.
addfrockid
=
''
;
//工装id
this
.
addremark
=
''
;
//备注
this
.
filename
=
''
;
this
.
fileurl
=
''
;
this
.
addmodal
=
true
;
},
/*********文件上传 start******** */
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
b7db37a4
...
...
@@ -28,9 +28,10 @@ namespace Siger.ApiACC.Controllers
private
readonly
ISigerDict
_sigerDict
;
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
private
readonly
ISigerProjectMachineAttributionRepository
_sigerProjectMachineAttribution
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
public
AutomationController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationLineMode
automationLineMode
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerDict
sigerDict
,
IAutomationTaskListRepository
automationTaskList
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
)
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationFixtureMonitor
automationFixtureMonitor
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -39,6 +40,7 @@ namespace Siger.ApiACC.Controllers
_sigerDict
=
sigerDict
;
_automationTaskList
=
automationTaskList
;
_sigerProjectMachineAttribution
=
sigerProjectMachineAttribution
;
_automationFixtureMonitor
=
automationFixtureMonitor
;
}
/// <summary>
...
...
@@ -181,7 +183,7 @@ namespace Siger.ApiACC.Controllers
public
IActionResult
TaskResult
([
FromBody
]
RequestAutomationTaskResult
request
)
{
//1.检查Tasklist
var
taskObj
=
_automationTaskList
.
Get
(
f
=>
f
.
guid
==
request
.
guid
);
var
taskObj
=
_automationTaskList
.
Get
(
f
=>
f
.
no
==
request
.
guid
);
if
(
taskObj
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
...
...
@@ -311,8 +313,28 @@ namespace Siger.ApiACC.Controllers
}
}
/// <summary>
/// 创建自动任务
/// </summary>
/// <param name="machineStatus"></param>
/// <param name="actionType"></param>
/// <param name="taskAction"></param>
void
CreateTask
(
siger_automation_machine_status
machineStatus
,
TaskActionType
actionType
,
TaskAction
taskAction
)
{
//j检查工装监控状态
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
machineStatus
.
section
);
if
(
monitor
==
null
)
{
Logger
.
WriteLineInfo
(
$"CreateTask 工装监控状态无数据,请确认业务链正确 "
);
return
;
}
if
(
monitor
.
section
==
0
)
{
Logger
.
WriteLineInfo
(
$"CreateTask 工装监控状态无当前工站信息,请确认业务链正确 "
);
return
;
}
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
@@ -328,9 +350,16 @@ namespace Siger.ApiACC.Controllers
send
=
0
,
operater
=
0
,
status
=
1
,
fixtureguid
=
monitor
.
fixtureguid
,
productcode
=
monitor
.
productCode
,
locationid
=
monitor
.
locationId
,
ordercode
=
monitor
.
ordernumber
,
sn
=
monitor
.
sn
,
remark
=
"自动任务"
});
if
(
_unitOfWork
.
Commit
()
>
0
)
Logger
.
WriteLineInfo
(
$"CreateTask 工站 完成"
);
else
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
b7db37a4
...
...
@@ -23,22 +23,76 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationFixtureToolsCategoryRepository
_toolsCategoryRepository
;
private
readonly
IAutomationFixtureToolsRepository
_toolsRepository
;
private
readonly
IAutomationLocationRepository
_autoLocationRepository
;
private
readonly
IAutomationFixtureMonitor
_fixtureMonitor
;
private
readonly
IProductRouteRepository
_routeRepository
;
public
AutomationLocationController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureToolsRepository
toolsRepository
,
IAutomationLocationRepository
autoLocationRepository
)
IAutomationFixtureToolsRepository
toolsRepository
,
IAutomationLocationRepository
autoLocationRepository
,
IAutomationFixtureMonitor
fixtureMonitor
,
IProductRouteRepository
routeRepository
)
{
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
_toolsRepository
=
toolsRepository
;
_autoLocationRepository
=
autoLocationRepository
;
_fixtureMonitor
=
fixtureMonitor
;
_routeRepository
=
routeRepository
;
}
public
IActionResult
GetPageList
(
string
wavehouseid
,
string
locationid
,
int
page
,
int
pagesize
)
{
var
data
=
_autoLocationRepository
.
GetPagedList
(
wavehouseid
.
ToInt
(),
locationid
.
ToInt
(),
ProjectId
,
page
,
pagesize
);
var
list
=
new
List
<
ResponseAutomationLocation
>();
var
locations
=
_autoLocationRepository
.
GetLocationList
(
ProjectId
);
foreach
(
var
item
in
data
.
Data
)
{
if
(
item
.
fixturetoolid
>
0
&&
string
.
IsNullOrEmpty
(
item
.
sn
))
{
item
.
materialstate
=
1
;
//有工装无工件
}
else
if
(
item
.
fixturetoolid
>
0
&&
!
string
.
IsNullOrEmpty
(
item
.
sn
))
{
item
.
materialstate
=
2
;
//有工装有工件
}
else
if
(
item
.
fixturetoolid
<=
0
&&
string
.
IsNullOrEmpty
(
item
.
sn
))
{
item
.
materialstate
=
3
;
//无工装无工件
}
else
if
(
item
.
fixturetoolid
<=
0
&&
string
.
IsNullOrEmpty
(
item
.
sn
))
{
item
.
materialstate
=
4
;
//无工装有工件
}
var
monitor
=
_fixtureMonitor
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
locationId
==
item
.
locationid
).
OrderByDescending
(
q
=>
q
.
updatetime
).
FirstOrDefault
();
if
(
monitor
!=
null
)
{
item
.
sn
=
monitor
.
sn
;
var
route
=
_routeRepository
.
Get
(
q
=>
q
.
id
==
monitor
.
route
&&
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
if
(
route
!=
null
)
{
item
.
route
=
route
.
name
;
item
.
routenumber
=
route
.
serialNumber
.
ToString
();
}
}
var
loca
=
locations
.
FirstOrDefault
(
q
=>
q
.
locationid
==
item
.
locaid
);
if
(
loca
!=
null
)
{
var
locas
=
GetParentLocations
(
loca
.
id
,
locations
);
var
locationIds
=
locas
.
Select
(
q
=>
q
.
id
).
ToList
();
locationIds
.
Distinct
().
Reverse
();
item
.
locationIds
=
locationIds
;
}
}
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
private
IEnumerable
<
siger_wms_storage_location
>
GetParentLocations
(
int
pid
,
IEnumerable
<
siger_wms_storage_location
>
types
)
{
var
query
=
from
c
in
types
where
c
.
id
==
pid
select
c
;
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetParentLocations
(
t
.
parentid
,
types
)));
}
[
HttpPost
]
public
IActionResult
Add
([
FromBody
]
RequestAddAutomationLocation
req
)
{
...
...
@@ -66,7 +120,7 @@ namespace Siger.ApiACC.Controllers
var
entity
=
new
siger_automation_location
{
guid
=
Guid
.
NewGuid
().
ToString
(),
locationid
=
req
.
locationid
.
ToInt
()
,
locationid
=
location
.
locationid
,
fixturetools
=
fixturetool
.
guid
,
attachment
=
req
.
fileurl
,
filename
=
req
.
filename
,
...
...
@@ -115,7 +169,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
entity
.
locationid
=
req
.
locationid
.
ToInt
()
;
entity
.
locationid
=
location
.
locationid
;
entity
.
fixturetools
=
fixturetool
.
guid
;
entity
.
attachment
=
req
.
fileurl
;
entity
.
filename
=
req
.
filename
;
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
b7db37a4
...
...
@@ -33,9 +33,10 @@ namespace Siger.ApiACC.Controllers
private
readonly
IProductPlanRepository
_productPlan
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
private
readonly
IAutomationFixtureToolsProductRepository
_automationFixtureToolsProduct
;
private
readonly
IAutomationFixtureToolsRepository
_automationFixtureTools
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationTaskListRepository
automationTaskList
,
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
)
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -47,6 +48,7 @@ namespace Siger.ApiACC.Controllers
_productPlan
=
productPlan
;
_automationFixtureMonitor
=
automationFixtureMonitor
;
_automationFixtureToolsProduct
=
automationFixtureToolsProduct
;
_automationFixtureTools
=
automationFixtureTools
;
}
/// <summary>
...
...
@@ -159,7 +161,7 @@ namespace Siger.ApiACC.Controllers
var
result
=
_automationFixtureToolsProduct
.
GetPlanFixtureInfo
(
ProjectId
,
code
);
if
(
result
==
null
)
{
throw
new
BadRequestException
(
CncEnum
.
PlanHasExist
);
throw
new
BadRequestException
(
AccEnum
.
FixtureOrderNulll
);
}
var
sn
=
_automationTaskList
.
CreateRandonSn
(
result
.
ProductCode
);
result
.
Sn
=
sn
;
...
...
@@ -208,7 +210,8 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
CncEnum
.
PlanHasExist
);
}
//检查工装
var
fixtureToolsObj
=
_automationFixtureToolsProduct
.
GetFixtureInfoByProductCode
(
ProjectId
,
plan
.
product_code
);
var
fixtureToolsObj
=
_automationFixtureTools
.
GetProductFixtureLocation
(
ProjectId
,
loading
.
guid
);
//var fixtureToolsObj = _automationFixtureToolsProduct.GetFixtureInfoByProductCode(ProjectId, plan.product_code);
if
(
fixtureToolsObj
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
FixtureToolsIsNone
);
...
...
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsAssemblyController.cs
View file @
b7db37a4
...
...
@@ -37,9 +37,32 @@ namespace Siger.ApiACC.Controllers
public
IActionResult
GetPageList
(
string
category
,
string
code
,
string
name
,
int
page
,
int
pagesize
)
{
var
data
=
_toolsAssemblyRepository
.
GetPagedList
(
category
.
ToInt
(),
code
,
name
,
ProjectId
,
page
,
pagesize
);
var
categorys
=
_toolsCategoryRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
list
=
new
List
<
ResponseAumationFixtureToolsAssembly
>();
foreach
(
var
item
in
data
.
Data
)
{
var
cates
=
GetParentCategoryList
(
item
.
cate_guid
,
categorys
);
var
cateIds
=
cates
.
Select
(
q
=>
q
.
id
).
ToList
();
cateIds
.
Reverse
();
item
.
categoryids
=
cateIds
;
var
parentcates
=
GetParentCategoryList
(
item
.
parentcate_guid
,
categorys
);
var
parentcateIds
=
parentcates
.
Select
(
q
=>
q
.
id
).
ToList
();
parentcateIds
.
Reverse
();
item
.
parentcategoryids
=
parentcateIds
;
list
.
Add
(
item
);
}
return
new
PagedObjectResult
(
data
.
Data
,
data
.
Total
,
page
,
pagesize
);
}
private
IEnumerable
<
siger_automation_fixture_tools_category
>
GetParentCategoryList
(
string
parentId
,
List
<
siger_automation_fixture_tools_category
>
sections
)
{
var
query
=
from
c
in
sections
where
c
.
guid
==
parentId
select
c
;
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetParentCategoryList
(
t
.
parent
,
sections
)));
}
[
HttpGet
]
public
IActionResult
GetDetail
(
string
id
)
{
...
...
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsController.cs
View file @
b7db37a4
...
...
@@ -191,23 +191,6 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
[
HttpGet
]
public
IActionResult
GetFxitureTooolList
()
{
var
list
=
_toolsRepository
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
Select
(
q
=>
new
{
q
.
id
,
q
.
code
,
q
.
partnumber
,
q
.
name
,
q
.
specification
,
q
.
number
}).
ToList
();
return
new
ObjectResult
(
list
);
}
[
HttpGet
]
...
...
@@ -370,5 +353,13 @@ namespace Siger.ApiACC.Controllers
}
return
resp
;
}
[
HttpGet
]
public
IActionResult
GetFixtureToolList
()
{
var
list
=
_toolsRepository
.
GetDataList
(
ProjectId
);
return
new
ObjectResult
(
list
);
}
}
}
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsProductController.cs
View file @
b7db37a4
...
...
@@ -72,6 +72,7 @@ namespace Siger.ApiACC.Controllers
fixturetools
=
fixtureTool
.
guid
,
remark
=
req
.
remark
,
productid
=
req
.
productid
.
ToInt
(),
productcode
=
product
.
code
,
projectId
=
ProjectId
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
...
...
@@ -123,6 +124,7 @@ namespace Siger.ApiACC.Controllers
entity
.
fixturetools
=
fixtureTool
.
guid
;
entity
.
remark
=
req
.
remark
;
entity
.
productid
=
req
.
productid
.
ToInt
();
entity
.
productcode
=
product
.
code
;
entity
.
updatetime
=
DateTime
.
Now
;
entity
.
updator
=
UserId
;
entity
.
filename
=
req
.
filename
;
...
...
Server/Apis/Siger.ApiACC/Controllers/SectionPropertyController.cs
View file @
b7db37a4
...
...
@@ -23,14 +23,17 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationSectionPropertyRepository
_sectionPropertyRepository
;
private
readonly
ISigerProjectLevelSectionRepository
_levelSectionRepository
;
private
readonly
IProductionBeatSetRepository
_beatSetRepository
;
private
readonly
IAutomationFixtureMonitor
_fixtureMonitor
;
public
SectionPropertyController
(
IUnitOfWork
unitOfWork
,
IAutomationSectionPropertyRepository
sectionPropertyRepository
,
ISigerProjectLevelSectionRepository
levelSectionRepository
,
IProductionBeatSetRepository
beatSetRepository
)
ISigerProjectLevelSectionRepository
levelSectionRepository
,
IProductionBeatSetRepository
beatSetRepository
,
IAutomationFixtureMonitor
fixtureMonitor
)
{
_unitOfWork
=
unitOfWork
;
_sectionPropertyRepository
=
sectionPropertyRepository
;
_levelSectionRepository
=
levelSectionRepository
;
_beatSetRepository
=
beatSetRepository
;
_fixtureMonitor
=
fixtureMonitor
;
}
[
HttpGet
]
...
...
@@ -44,10 +47,11 @@ namespace Siger.ApiACC.Controllers
return
new
ObjectResult
(
sections
);
}
public
IActionResult
GetRouteByProduct
(
string
productId
)
[
HttpGet
]
public
IActionResult
GetRouteByProduct
(
string
productId
,
int
sectionId
)
{
var
list
=
_beatSetRepository
.
GetList
(
q
=>
q
.
projectID
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
product_name
.
ToInt
()
==
productId
.
ToInt
()
).
Select
(
q
=>
new
var
list
=
_beatSetRepository
.
GetList
(
q
=>
q
.
projectID
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
product_name
.
ToInt
()
==
productId
.
ToInt
()
&&
q
.
section_id
==
sectionId
).
Select
(
q
=>
new
{
q
.
id
,
name
=
q
.
route_name
,
...
...
@@ -56,5 +60,13 @@ namespace Siger.ApiACC.Controllers
return
new
ObjectResult
(
list
);
}
[
HttpGet
]
public
IActionResult
GetSn
(
int
sectionid
)
{
var
monitor
=
_fixtureMonitor
.
GetList
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
section
==
sectionid
).
OrderByDescending
(
q
=>
q
.
updatetime
).
FirstOrDefault
();
return
new
ObjectResult
(
monitor
?.
sn
??
""
);
}
}
}
Server/Apis/Siger.ApiWMS/Controllers/LocationController.cs
View file @
b7db37a4
...
...
@@ -1127,5 +1127,67 @@ namespace Siger.ApiWMS.Controllers
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetSonTypes
(
t
.
id
,
types
)));
}
[
HttpGet
]
public
IActionResult
GetLocationTree
(
int
warehouseid
)
{
var
locationTypes
=
locationtype
.
GetList
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
sonLocationTypes
=
GetSonTypes
(
0
,
locationTypes
).
ToList
();
var
lastLocationId
=
sonLocationTypes
.
LastOrDefault
()?.
id
??
0
;
var
allLocas
=
location
.
GetList
(
q
=>
q
.
projectid
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
locations
=
allLocas
.
Where
(
q
=>
q
.
typeid
==
lastLocationId
);
if
(
warehouseid
>
0
)
{
locations
=
locations
.
Where
(
q
=>
q
.
storageid
==
warehouseid
);
}
var
locationTreeList
=
new
List
<
LevelSectionTree
>();
foreach
(
var
loca
in
locations
)
{
var
locas
=
GetParentLocations
(
loca
.
id
,
allLocas
.
Select
(
q
=>
new
LevelSectionTree
{
id
=
q
.
id
,
pid
=
q
.
parentid
,
title
=
q
.
realname
,
name
=
q
.
realname
}));
locationTreeList
.
AddRange
(
locas
);
}
var
locationTree
=
locationTreeList
.
GroupBy
(
q
=>
q
.
id
).
Select
(
q
=>
q
.
FirstOrDefault
()).
ToList
();
return
new
ObjectResult
(
ConvertToTree
(
locationTree
));
}
private
IEnumerable
<
LevelSectionTree
>
GetParentLocations
(
int
pid
,
IEnumerable
<
LevelSectionTree
>
types
)
{
var
query
=
from
c
in
types
where
c
.
id
==
pid
select
c
;
return
query
.
ToList
().
Concat
(
query
.
ToList
().
SelectMany
(
t
=>
GetParentLocations
(
t
.
pid
,
types
)));
}
private
IList
<
LevelSectionTree
>
ConvertToTree
(
IEnumerable
<
LevelSectionTree
>
models
)
{
var
section
=
new
Dictionary
<
int
,
LevelSectionTree
>();
foreach
(
var
item
in
models
)
{
section
.
Add
(
item
.
id
,
item
);
}
var
result
=
new
List
<
LevelSectionTree
>();
foreach
(
var
item
in
section
.
Values
)
{
if
(
item
.
pid
==
0
)
{
result
.
Add
(
item
);
}
else
{
if
(
section
.
ContainsKey
(
item
.
pid
))
{
section
[
item
.
pid
].
AddChilrden
(
item
);
}
}
}
return
result
;
}
}
}
\ No newline at end of file
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
b7db37a4
...
...
@@ -327,6 +327,8 @@ namespace Siger.Middlelayer.Common.ModuleEnum
TaskProcessing
,
[
Description
(
"产品工装未找到"
)]
FixtureToolsIsNone
,
[
Description
(
"未找到工装信息"
)]
FixtureOrderNulll
}
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_machine_status.cs
View file @
b7db37a4
...
...
@@ -25,6 +25,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 更新时间
/// </summary>
public
DateTime
updatetime
{
get
;
set
;
}
/// <summary>
/// 程序号
/// </summary>
public
string
program
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_task_list.cs
View file @
b7db37a4
...
...
@@ -40,6 +40,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// </summary>
public
int
productid
{
get
;
set
;
}
/// <summary>
/// 产品code
/// </summary>
public
string
productcode
{
get
;
set
;
}
/// <summary>
/// 工序ID
/// </summary>
public
int
processid
{
get
;
set
;
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsAssemblyRepository.cs
View file @
b7db37a4
...
...
@@ -48,7 +48,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
filename
=
q
.
filename
,
categoryid
=
c2
.
id
,
category
=
c2
.
name
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
,
cate_guid
=
t2
.
guid
,
parentcate_guid
=
t1
.
guid
};
Expression
<
Func
<
ResponseAumationFixtureToolsAssembly
,
bool
>>
categoryExpression
=
f
=>
true
;
if
(
category
>
0
)
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
b7db37a4
...
...
@@ -89,17 +89,18 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var
query
=
from
d
in
_context
.
siger_project_product_plan_detail
join
p
in
_context
.
siger_project_product_plan
on
d
.
PlanId
equals
p
.
id
join
q
in
_context
.
siger_automation_fixture_tools_product
on
p
.
product_code
equals
q
.
productcode
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
l
in
_context
.
siger_automation_location
on
t
.
guid
equals
l
.
fixturetools
join
q
in
_context
.
siger_automation_fixture_tools_product
on
p
.
product_code
equals
q
.
productcode
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
l
in
_context
.
siger_automation_location
on
t
.
guid
equals
l
.
fixturetools
where
q
.
projectId
==
projectId
&&
d
.
OrderNumber
==
ordernumber
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponsePlanlFixtureInfo
{
OrderNumber
=
ordernumber
,
ProductName
=
p
.
product_name
,
ProductCode
=
q
.
productcode
,
Location
=
l
.
locationid
,
FixtureName
=
t
.
name
,
FixtureGuid
=
t
.
guid
,
ProductCode
=
q
!=
null
?
q
.
productcode
:
""
,
Location
=
l
!=
null
?
l
.
locationid
:
0
,
};
return
query
.
FirstOrDefault
();
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsRepository.cs
View file @
b7db37a4
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq.Expressions
;
using
Microsoft.EntityFrameworkCore
;
...
...
@@ -73,5 +74,45 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseFixtureTools
>(
entities
,
totalCount
);
}
public
IEnumerable
<
ResponseFixtureTools
>
GetDataList
(
int
projectid
)
{
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
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseFixtureTools
{
id
=
q
.
id
,
name
=
q
.
name
,
guid
=
q
.
guid
,
cate_guid
=
p
.
guid
,
categoryid
=
p
.
id
,
category
=
p
.
name
,
managetype
=
q
.
managetype
,
partnumber
=
q
.
partnumber
,
specification
=
q
.
specification
,
number
=
q
.
number
,
remark
=
q
.
remark
,
code
=
q
.
code
,
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
};
var
entities
=
query
.
OrderByDescending
(
q
=>
q
.
id
).
AsNoTracking
().
ToList
();
return
entities
;
}
public
ResponseProductFixtureInfo
GetProductFixtureLocation
(
int
projectId
,
string
guid
)
{
var
query
=
from
q
in
_context
.
siger_automation_fixture_tools
join
l
in
_context
.
siger_automation_location
on
q
.
guid
equals
l
.
guid
select
new
ResponseProductFixtureInfo
{
FixtureGuid
=
q
.
guid
,
FixtureId
=
q
.
id
,
Location
=
l
.
locationid
};
return
query
.
FirstOrDefault
();
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
b7db37a4
...
...
@@ -35,6 +35,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
{
id
=
q
.
id
,
locationid
=
l
.
id
,
locaid
=
q
.
locationid
,
location
=
l
.
name
,
wavehouseid
=
w
.
id
,
wavehouse
=
w
.
name
,
...
...
@@ -68,7 +69,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
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
);
return
_context
.
siger_wms_storage_location
.
FirstOrDefault
(
q
=>
q
.
id
==
id
&&
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
}
public
IEnumerable
<
siger_wms_storage_location
>
GetLocationList
(
int
projectid
)
{
return
_context
.
siger_wms_storage_location
.
Where
(
q
=>
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
}
public
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
)
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsRepository.cs
View file @
b7db37a4
...
...
@@ -2,6 +2,7 @@
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Repository.Data.Acc
;
using
Siger.Middlelayer.Repository.Paged
;
using
System.Collections.Generic
;
namespace
Siger.Middlelayer.AccRepository.Repositories.Interface
{
...
...
@@ -9,5 +10,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
{
IPagedCollectionResult
<
ResponseFixtureTools
>
GetPagedList
(
int
category
,
string
code
,
string
name
,
int
state
,
int
projectid
,
int
page
,
int
pagesize
);
IEnumerable
<
ResponseFixtureTools
>
GetDataList
(
int
projectid
);
ResponseProductFixtureInfo
GetProductFixtureLocation
(
int
projectId
,
string
guid
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
View file @
b7db37a4
...
...
@@ -14,5 +14,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
siger_wms_storage_location
GetLocation
(
int
id
,
int
projectid
);
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
);
IEnumerable
<
siger_wms_storage_location
>
GetLocationList
(
int
projectid
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/RequestAutomationMachine.cs
View file @
b7db37a4
...
...
@@ -19,5 +19,6 @@ namespace Siger.Middlelayer.AccRepository.Request
/// 完成状态
/// </summary>
public
int
status
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
View file @
b7db37a4
...
...
@@ -11,6 +11,11 @@ namespace Siger.Middlelayer.AccRepository.Request
{
public
int
section
{
get
;
set
;
}
public
string
code
{
get
;
set
;
}
/// <summary>
/// 工装GUID
/// </summary>
public
string
guid
{
get
;
set
;
}
}
/// <summary>
/// 安装完成
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/FixtureToolsCategory.cs
View file @
b7db37a4
...
...
@@ -130,5 +130,10 @@ namespace Siger.Middlelayer.AccRepository.Response
public
int
status
{
get
;
set
;
}
public
string
fileurl
{
get
;
set
;
}
public
string
filename
{
get
;
set
;
}
public
string
parentcate_guid
{
get
;
set
;
}
public
List
<
int
>
parentcategoryids
{
get
;
set
;
}
=
new
List
<
int
>();
public
string
cate_guid
{
get
;
set
;
}
public
List
<
int
>
categoryids
{
get
;
set
;
}
=
new
List
<
int
>();
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
View file @
b7db37a4
...
...
@@ -11,6 +11,7 @@ namespace Siger.Middlelayer.AccRepository.Response
/// 储位位置
/// </summary>
public
int
locationid
{
get
;
set
;
}
public
int
locaid
{
get
;
set
;
}
public
string
location
{
get
;
set
;
}
public
int
wavehouseid
{
get
;
set
;
}
public
string
wavehouse
{
get
;
set
;
}
...
...
@@ -47,6 +48,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public
string
updatetime
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
List
<
int
>
locationIds
{
get
;
set
;
}
=
new
List
<
int
>();
}
public
class
ResponseAutomationLocationList
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseProductFixtureInfo.cs
View file @
b7db37a4
...
...
@@ -34,6 +34,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public
string
ProductCode
{
get
;
set
;
}
public
string
ProductName
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
string
FixtureName
{
get
;
set
;
}
public
string
FixtureGuid
{
get
;
set
;
}
public
int
Location
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
}
...
...
Server/Infrastructure/Script/DB.script
View file @
b7db37a4
...
...
@@ -269,9 +269,6 @@ CREATE TABLE IF NOT EXISTS `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',
`materialid` int(11) NOT NULL DEFAULT 0 COMMENT '物料ID',
`processid` int(11) NOT NULL DEFAULT 0 COMMENT '工序ID',
`materialstate` int(11) NOT NULL DEFAULT 0 COMMENT '物料状态',
`attachment` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件',
`filename` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '附件名称',
`remark` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
...
...
@@ -430,4 +427,19 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
DROP TABLE IF EXISTS `siger_automation_machine_status`;
CREATE TABLE `siger_automation_machine_status` (
`id` int NOT NULL AUTO_INCREMENT,
`section` int NOT NULL DEFAULT '0' COMMENT '工位ID',
`machineid` int NOT NULL DEFAULT '0' COMMENT '工位对应设备ID',
`projectid` int NOT NULL DEFAULT '0',
`enable` int NOT NULL DEFAULT '1' COMMENT '设备可用状态 0:不可用 1:可用',
`status` int NOT NULL DEFAULT '1' COMMENT '完工状态 0:取消 1:待生产 2:生产中 3:生产完成 ',
`updatetime` datetime DEFAULT NULL COMMENT '操作时间',
`program` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '程序号',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
SET FOREIGN_KEY_CHECKS=1;
SET FOREIGN_KEY_CHECKS = 1;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment