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
8c5d4f65
Commit
8c5d4f65
authored
Feb 22, 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
f5fa1526
ee54ef29
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
148 additions
and
94 deletions
+148
-94
zh-CN.js
Html/src/locale/lang/zh-CN.js
+8
-0
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+55
-30
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+2
-2
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+23
-2
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+7
-1
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+1
-0
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+49
-58
IAutomationLocationRepository.cs
...y/Repositories/Interface/IAutomationLocationRepository.cs
+1
-1
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+2
-0
No files found.
Html/src/locale/lang/zh-CN.js
View file @
8c5d4f65
...
...
@@ -2101,6 +2101,14 @@ export default {
'3000166'
:
'未配置字典信息'
,
'3000167'
:
'产线当前为自动模式'
,
'3000168'
:
'该任务已经下发'
,
'3000169'
:
'该储位无工件'
,
'3000170'
:
'工站属性为空'
,
'3000171'
:
'该储位已存在工件'
,
'3000172'
:
'该工站正在上料中'
,
'3000173'
:
'该工站正在下料中'
,
'3000174'
:
'储位不存在'
,
'3000175'
:
'工序加工未完成'
,
'3000176'
:
'工序未开始加工'
,
'400000'
:
'设备状态'
,
'400002'
:
'更改状态'
,
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
8c5d4f65
...
...
@@ -22,6 +22,7 @@ using NPOI.SS.Formula.Functions;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common.Helpers
;
using
NPOI.SS.Formula
;
using
NPOI.OpenXml4Net.OPC.Internal
;
namespace
Siger.ApiACC.Controllers
{
...
...
@@ -551,31 +552,41 @@ namespace Siger.ApiACC.Controllers
}
else
{
//优先级1 :清洗机完成 。待下料
if
(
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
Logger
.
WriteLineError
(
$"AutoProcess 有清洗机
{
cleanMachine
.
section
}
完成,创建清洗机Task"
);
//取最近完成的 Task
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
cleanMachine
.
section
,
"id"
,
true
).
FirstOrDefault
(
);
if
(
lastTask
!=
null
)
var
monitorClean
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
cleanMachine
.
section
);
if
(
monitorClean
!=
null
)
{
if
(
lastTask
.
action
==
TaskAction
.
Step_QXJ_LK
)
if
(
string
.
IsNullOrEmpty
(
monitorClean
.
sn
)
)
{
Logger
.
WriteLineError
(
$"AutoProcess 清洗机完成,上一个任务与本次任务指令重复"
);
return
;
//任务重复
}
if
(
lastTask
.
status
==
(
int
)
TaskResultStatus
.
Complated
)
Logger
.
WriteLineError
(
$"AutoProcess 清洗机完成,清洗监控无工件"
);
}
else
{
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
cleanMachine
.
section
}
task:
{
TaskAction
.
Step_QXJ_LK
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
//if (TargetFree(invenSection.sectionid, cleanMachine.section, TaskAction.Step_QXJ_LK))
//{
CreateTask
(
invenSection
.
sectionid
,
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
lastTask
.
fixtureguid
,
lastTask
.
fixturename
,
lastTask
.
ordercode
,
lastTask
.
sn
,
"无程序"
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
productname
,
lastTask
.
locationid
,
lastTask
.
route
);
return
;
//完成当前任务 退出
//}
//取最近完成的 Task
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
cleanMachine
.
section
,
"id"
,
true
).
FirstOrDefault
();
if
(
lastTask
!=
null
)
{
if
(
lastTask
.
action
==
TaskAction
.
Step_QXJ_LK
)
{
Logger
.
WriteLineError
(
$"AutoProcess 清洗机完成,上一个任务与本次任务指令重复"
);
return
;
//任务重复
}
if
(
lastTask
.
status
==
(
int
)
TaskResultStatus
.
Complated
)
{
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
cleanMachine
.
section
}
task:
{
TaskAction
.
Step_QXJ_LK
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
//if (TargetFree(invenSection.sectionid, cleanMachine.section, TaskAction.Step_QXJ_LK))
//{
CreateTask
(
invenSection
.
sectionid
,
cleanMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_QXJ_LK
,
lastTask
.
fixtureguid
,
lastTask
.
fixturename
,
lastTask
.
ordercode
,
lastTask
.
sn
,
"无程序"
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
productname
,
lastTask
.
locationid
,
lastTask
.
route
);
return
;
//完成当前任务 退出
//}
}
}
}
}
}
}
//优先级2 :其他设备待上料 (立库->加工中心)
...
...
@@ -602,7 +613,7 @@ namespace Siger.ApiACC.Controllers
//优先级3:其他设备下料 (加工中心 ->清洗机)
if
(
cleanMachine
!=
null
)
{
siger_automation_machine_status
fullMachine
=
null
;
//
siger_automation_machine_status fullMachine = null;
var
fullAllMachine
=
machineStatusList
.
Where
(
f
=>
f
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
);
if
(
fullAllMachine
.
Any
()
&&
cleanMachine
.
status
==
(
int
)
Automation
.
MachineStatus
.
Waiting
)
...
...
@@ -611,7 +622,7 @@ namespace Siger.ApiACC.Controllers
//清洗机上料 为 任务触发 触发
if
(
tasklist
!=
null
&&
fullAllMachine
.
Where
(
p
=>
p
.
section
==
tasklist
.
sectionid
).
Any
())
{
fullMachine
=
fullAllMachine
.
Where
(
p
=>
p
.
section
==
tasklist
.
sectionid
).
FirstOrDefault
();
var
fullMachine
=
fullAllMachine
.
Where
(
p
=>
p
.
section
==
tasklist
.
sectionid
).
FirstOrDefault
();
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,TaskResult触发 "
);
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
fullMachine
.
section
}
task:
{
TaskAction
.
Step_JGZX_QXJ
.
ToStr
()}
sn
{
tasklist
.
sn
}
"
);
...
...
@@ -631,24 +642,26 @@ namespace Siger.ApiACC.Controllers
}
else
{
fullMachine
=
fullAllMachine
.
First
();
if
(
_automationTaskList
.
CanTask
(
PID
,
fullMachine
.
section
))
var
fullmids
=
fullAllMachine
.
Select
(
s
=>
s
.
section
).
ToList
();
var
lastMonitorItem
=
_automationFixtureMonitor
.
GetList
(
p
=>
fullmids
.
Contains
(
p
.
section
)
&&
!
string
.
IsNullOrEmpty
(
p
.
sn
)).
OrderByDescending
(
p
=>
p
.
id
).
FirstOrDefault
();
if
(
lastMonitorItem
==
null
)
{
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,设备监控无可下料的设备 "
);
return
;
}
if
(
_automationTaskList
.
CanTask
(
PID
,
lastMonitorItem
.
section
))
{
Logger
.
WriteLineError
(
$"AutoProcess 清洗机空闲,MachineStatus触发 "
);
var
last
MonitorItem
=
_automationFixtureMonitor
.
GetList
(
p
=>
p
.
section
==
fullMachine
.
section
).
OrderByDescending
(
p
=>
p
.
id
).
FirstOrDefault
();
if
(
last
MonitorItem
!=
null
)
var
last
Task
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
lastMonitorItem
.
section
&&
f
.
sn
==
lastMonitorItem
.
sn
&&
f
.
status
==
(
int
)
Automation
.
TaskResultStatus
.
Complated
,
"id"
,
true
).
FirstOrDefault
();
if
(
last
Task
!=
null
)
{
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
sectionid
==
fullMachine
.
section
&&
f
.
sn
==
lastMonitorItem
.
sn
&&
f
.
status
==
(
int
)
Automation
.
TaskResultStatus
.
Complated
,
"id"
,
true
).
FirstOrDefault
(
);
if
(
lastTask
!=
null
)
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
lastMonitorItem
.
section
}
task:
{
TaskAction
.
Step_JGZX_QXJ
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
if
(
TargetFree
(
cleanMachine
.
section
,
lastMonitorItem
.
section
,
TaskAction
.
Step_JGZX_QXJ
)
)
{
Logger
.
WriteLineInfo
(
$"自动化业务流转--AutoProcess section
{
fullMachine
.
section
}
task:
{
TaskAction
.
Step_JGZX_QXJ
.
ToStr
()}
sn
{
lastTask
.
sn
}
"
);
if
(
TargetFree
(
cleanMachine
.
section
,
fullMachine
.
section
,
TaskAction
.
Step_JGZX_QXJ
))
{
CreateTask
(
cleanMachine
.
section
,
fullMachine
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
lastTask
.
fixtureguid
,
lastTask
.
fixturename
,
lastTask
.
ordercode
,
lastTask
.
sn
,
lastTask
.
programnumber
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
productname
,
lastTask
.
locationid
,
lastTask
.
route
);
}
CreateTask
(
cleanMachine
.
section
,
lastMonitorItem
.
section
,
TaskActionType
.
Unload
,
TaskAction
.
Step_JGZX_QXJ
,
lastTask
.
fixtureguid
,
lastTask
.
fixturename
,
lastTask
.
ordercode
,
lastTask
.
sn
,
lastTask
.
programnumber
,
lastTask
.
productid
,
lastTask
.
productcode
,
lastTask
.
productname
,
lastTask
.
locationid
,
lastTask
.
route
);
}
}
}
}
}
...
...
@@ -716,9 +729,21 @@ namespace Siger.ApiACC.Controllers
{
// 当前空闲设备能加工的产品
var
beats
=
_productionBeatSet
.
GetList
(
f
=>
f
.
projectID
==
PID
&&
machines
.
Contains
(
f
.
machineID
)
&&
f
.
status
==
(
int
)
RowState
.
Valid
).
ToList
();
var
TempList
=
new
List
<
ResponseAutoRouteInfo
>();
foreach
(
var
b
in
beats
)
{
var
moniter
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
b
.
section_id
);
if
(
moniter
!=
null
)
{
//防错 监控设备中无SN 加工的工站
if
(!
string
.
IsNullOrEmpty
(
moniter
.
sn
))
{
Logger
.
WriteLineInfo
(
$"CreateTask machineId:
{
b
.
machineID
}
设备上有SN在加工"
);
continue
;
}
}
Logger
.
WriteLineError
(
$"SelectLocation 设备
{
b
.
machineID
}
标准节拍
{
b
.
route_number
}{
b
.
route_name
}
"
);
var
autoLocationIds
=
_automationLocation
.
GetList
(
f
=>
f
.
status
==
(
int
)
RowState
.
Valid
&&
f
.
projectId
==
b
.
projectID
&&
f
.
routeid
==
b
.
route_number
.
ToInt
()
&&
f
.
productid
==
b
.
product_name
.
ToInt
());
if
(!
autoLocationIds
.
Any
())
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
8c5d4f65
...
...
@@ -361,10 +361,10 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
GetLocationList
(
string
productcode
,
int
fillsn
=
0
)
{
var
productFix
=
_automationFixtureToolsProduct
.
Get
(
f
=>
f
.
productcode
==
productcode
);
//
var productFix = _automationFixtureToolsProduct.Get(f => f.productcode == productcode);
var
locations
=
_autoLocationRepository
.
GetFulllocation
(
ProjectId
,
fillsn
);
var
locations
=
_autoLocationRepository
.
GetFulllocation
(
ProjectId
,
fillsn
,
productcode
);
return
new
ObjectResult
(
locations
);
//if (fillsn == 1)
//{
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
8c5d4f65
...
...
@@ -45,10 +45,11 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationLineMode
_automationLine
;
private
readonly
IProductRouteRepository
_productRoute
;
private
readonly
IAutomationSectionPropertyRepository
_sectionPropertyRepository
;
private
readonly
IAutomationProduceHistoryRepository
_automationProduceHistory
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationTaskListRepository
automationTaskList
,
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
,
IAutomationLocationRepository
automationLocation
,
IAutomationLineMode
automationLine
,
IProductRouteRepository
productRoute
,
IAutomationSectionPropertyRepository
sectionPropertyRepository
)
IAutomationLineMode
automationLine
,
IProductRouteRepository
productRoute
,
IAutomationSectionPropertyRepository
sectionPropertyRepository
,
IAutomationProduceHistoryRepository
automationProduceHistory
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -65,6 +66,7 @@ namespace Siger.ApiACC.Controllers
_automationLine
=
automationLine
;
_productRoute
=
productRoute
;
_sectionPropertyRepository
=
sectionPropertyRepository
;
_automationProduceHistory
=
automationProduceHistory
;
}
/// <summary>
...
...
@@ -320,7 +322,15 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
}
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
locationid
==
loading
.
locationid
);
if
(
location
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoExits
);
}
if
(!
string
.
IsNullOrEmpty
(
location
.
sn
))
{
throw
new
BadRequestException
(
AccEnum
.
LocationSnExits
);
}
var
plandts
=
_planDetails
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
OrderNumber
==
loading
.
code
);
if
(
plandts
==
null
)
{
...
...
@@ -543,6 +553,17 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
location
.
routeid
!=
0
)
{
throw
new
BadRequestException
(
AccEnum
.
RouteProcessing
);
}
else
{
var
historys
=
_automationProduceHistory
.
GetList
(
f
=>
f
.
sn
==
location
.
sn
);
if
(!
historys
.
Any
())
{
throw
new
BadRequestException
(
AccEnum
.
RouteNotStart
);
}
}
var
levelSection
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
unloading
.
section
);
var
lineMode
=
_automationLine
.
Get
(
f
=>
f
.
section
==
levelSection
.
parentid
);
if
(
lineMode
==
null
)
...
...
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
8c5d4f65
...
...
@@ -351,7 +351,13 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"该工站正在上料中"
)]
Uploading
,
[
Description
(
"该工站正在下料中"
)]
Downloading
Downloading
,
[
Description
(
"储位不存在"
)]
LocationNoExits
,
[
Description
(
"工序加工未完成"
)]
RouteProcessing
,
[
Description
(
"工序未开始加工"
)]
RouteNotStart
}
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
8c5d4f65
...
...
@@ -130,6 +130,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join
pd
in
_context
.
siger_project_product
on
p
.
product_id
equals
pd
.
id
where
q
.
projectId
==
projectId
&&
d
.
OrderNumber
==
ordernumber
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==(
int
)
RowState
.
Valid
&&
string
.
IsNullOrEmpty
(
l
.
sn
)
select
new
ResponsePlanlFixtureInfo
{
OrderNumber
=
ordernumber
,
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
8c5d4f65
...
...
@@ -101,8 +101,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
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
tp
in
_context
.
siger_automation_fixture_tools_product
on
t
.
guid
equals
tp
.
fixturetools
into
tptemp
from
tp
in
tptemp
.
DefaultIfEmpty
()
join
tp
in
_context
.
siger_automation_fixture_tools_product
on
t
.
guid
equals
tp
.
fixturetools
join
l
in
_context
.
siger_wms_storage_location
on
q
.
location_cid
equals
l
.
id
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
...
...
@@ -122,7 +121,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
name
=
t
.
name
,
materialsn
=
q
.
sn
??
""
,
categoryid
=
c
==
null
?
0
:
c
.
id
,
productcode
=
tp
!=
null
?
tp
.
productcode
:
""
productcode
=
tp
.
productcode
,
routeid
=
q
.
routeid
,
route
=
q
.
route
};
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
locationidExpression
=
f
=>
true
;
if
(
hasMaterial
!=
0
)
...
...
@@ -238,67 +239,57 @@ namespace Siger.Middlelayer.AccRepository.Repositories
}
}
public
IEnumerable
<
ResponseAutomationLocationList
>
GetFulllocation
(
int
projectId
,
int
full
)
public
IEnumerable
<
ResponseAutomationLocationList
>
GetFulllocation
(
int
projectId
,
int
full
,
string
productCode
)
{
//获取有SN 的储位
if
(
full
==
1
)
var
query
=
from
q
in
_context
.
siger_automation_location
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
tp
in
_context
.
siger_automation_fixture_tools_product
on
t
.
guid
equals
tp
.
fixturetools
join
l
in
_context
.
siger_wms_storage_location
on
q
.
location_cid
equals
l
.
id
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
join
r
in
_context
.
siger_project_product_route
on
q
.
routeid
equals
r
.
id
into
rtemp
from
r
in
rtemp
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==
(
int
)
RowState
.
Valid
&&
w
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAutomationLocationList
{
id
=
q
.
id
,
typeid
=
t
.
id
,
fixtureguid
=
t
.
guid
,
locationid
=
l
.
locationid
,
location
=
l
.
realname
,
locationcode
=
l
.
serial_number
,
wavehouseid
=
w
.
id
,
wavehouse
=
w
.
name
,
wavehousecode
=
w
.
serial_number
,
fixturetoolid
=
t
.
id
,
code
=
t
.
code
,
name
=
t
.
name
,
materialsn
=
q
.
sn
,
productcode
=
tp
.
productcode
,
routeid
=
q
.
routeid
,
route
=
r
!=
null
?
r
.
name
:
""
};
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
locationidFullExpression
=
f
=>
true
;
if
(
full
==
1
)
{
var
query
=
from
q
in
_context
.
siger_automation_location
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
l
in
_context
.
siger_wms_storage_location
on
q
.
location_cid
equals
l
.
id
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
where
q
.
projectId
==
projectId
&&
!
string
.
IsNullOrEmpty
(
q
.
sn
)
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==
(
int
)
RowState
.
Valid
&&
w
.
status
==
(
int
)
RowState
.
Valid
&&
q
.
routeid
==
0
select
new
ResponseAutomationLocationList
{
id
=
q
.
id
,
typeid
=
t
.
id
,
fixtureguid
=
t
.
guid
,
locationid
=
l
.
locationid
,
location
=
l
.
realname
,
locationcode
=
l
.
serial_number
,
wavehouseid
=
w
.
id
,
wavehouse
=
w
.
name
,
wavehousecode
=
w
.
serial_number
,
fixturetoolid
=
t
.
id
,
code
=
t
.
code
,
name
=
t
.
name
,
materialsn
=
q
.
sn
};
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
locationidExpression
=
f
=>
true
;
return
query
.
Where
(
locationidExpression
);
locationidFullExpression
=
f
=>
!
string
.
IsNullOrEmpty
(
f
.
materialsn
);
}
else
{
//选择SN为空的储位
var
query
=
from
q
in
_context
.
siger_automation_location
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
l
in
_context
.
siger_wms_storage_location
on
q
.
location_cid
equals
l
.
id
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
where
q
.
projectId
==
projectId
&&
string
.
IsNullOrEmpty
(
q
.
sn
)
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
&&
l
.
status
==
(
int
)
RowState
.
Valid
&&
w
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAutomationLocationList
{
id
=
q
.
id
,
typeid
=
t
.
id
,
fixtureguid
=
t
.
guid
,
locationid
=
l
.
locationid
,
location
=
l
.
realname
,
locationcode
=
l
.
serial_number
,
wavehouseid
=
w
.
id
,
wavehouse
=
w
.
name
,
wavehousecode
=
w
.
serial_number
,
fixturetoolid
=
t
.
id
,
code
=
t
.
code
,
name
=
t
.
name
,
materialsn
=
q
.
sn
};
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
locationidExpression
=
f
=>
true
;
return
query
.
Where
(
locationidExpression
);
locationidFullExpression
=
f
=>
string
.
IsNullOrEmpty
(
f
.
materialsn
);
}
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
productExpression
=
f
=>
true
;
if
(!
string
.
IsNullOrEmpty
(
productCode
))
{
productExpression
=
f
=>
f
.
productcode
.
Contains
(
productCode
);
}
var
expression
=
locationidFullExpression
.
And
(
productExpression
);
return
query
.
Where
(
expression
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
View file @
8c5d4f65
...
...
@@ -26,6 +26,6 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
CommonImportResult
ImportData
(
IEnumerable
<
AutomationLocationTemplate
>
list
,
int
projectid
,
int
userid
);
IEnumerable
<
ResponseAutomationLocationList
>
GetFulllocation
(
int
projectId
,
int
full
);
IEnumerable
<
ResponseAutomationLocationList
>
GetFulllocation
(
int
projectId
,
int
full
,
string
productcode
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
View file @
8c5d4f65
...
...
@@ -105,5 +105,7 @@ namespace Siger.Middlelayer.AccRepository.Response
public
int
categoryid
{
get
;
set
;
}
//产品CODE
public
string
productcode
{
get
;
set
;
}
public
int
routeid
{
get
;
set
;
}
public
string
route
{
get
;
set
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment