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
5c16ef62
Commit
5c16ef62
authored
Feb 03, 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
3d2af0bc
ae802d94
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
180 additions
and
55 deletions
+180
-55
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+0
-0
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+3
-0
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+15
-3
AutomationStateController.cs
...pis/Siger.ApiACC/Controllers/AutomationStateController.cs
+5
-4
BeatAllocationController.cs
...Apis/Siger.ApiCNC/Controllers/BeatAllocationController.cs
+16
-4
siger_automation_task_list.cs
...ayer.AccRepository/Entities/siger_automation_task_list.cs
+2
-0
siger_project_beat_set.cs
...dlelayer.AccRepository/Entities/siger_project_beat_set.cs
+2
-2
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+4
-3
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+58
-35
IAutomationFixtureToolsProductRepository.cs
...ies/Interface/IAutomationFixtureToolsProductRepository.cs
+1
-1
ResponseAutomationInfo.cs
...dlelayer.AccRepository/Response/ResponseAutomationInfo.cs
+30
-1
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+10
-0
ResponseAutomationMachineStatus.cs
...AccRepository/Response/ResponseAutomationMachineStatus.cs
+7
-0
ProductionBeatSetRepository.cs
...CncRepository/Repositories/ProductionBeatSetRepository.cs
+18
-2
RequestAddBeatAllocation.cs
...lelayer.CncRepository/Request/RequestAddBeatAllocation.cs
+9
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
5c16ef62
This diff is collapsed.
Click to expand it.
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
5c16ef62
...
...
@@ -361,6 +361,9 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
GetLocationList
(
string
productcode
,
int
fillsn
=
0
)
{
var
productFix
=
_automationFixtureToolsProduct
.
Get
(
f
=>
f
.
productcode
==
productcode
);
var
locations
=
_autoLocationRepository
.
GetFulllocation
(
ProjectId
,
fillsn
);
return
new
ObjectResult
(
locations
);
//if (fillsn == 1)
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
5c16ef62
...
...
@@ -41,9 +41,11 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationFixtureToolsRepository
_automationFixtureTools
;
private
readonly
IAutomationLocationRepository
_automationLocation
;
private
readonly
IAutomationLineMode
_automationLine
;
private
readonly
IProductRouteRepository
_productRoute
;
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
)
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
,
IAutomationLocationRepository
automationLocation
,
IAutomationLineMode
automationLine
,
IProductRouteRepository
productRoute
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -58,6 +60,7 @@ namespace Siger.ApiACC.Controllers
_automationFixtureTools
=
automationFixtureTools
;
_automationLocation
=
automationLocation
;
_automationLine
=
automationLine
;
_productRoute
=
productRoute
;
}
/// <summary>
...
...
@@ -366,6 +369,12 @@ namespace Siger.ApiACC.Controllers
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
var
sn
=
_automationTaskList
.
CreateRandonSn
(
plan
.
product_code
);
//上料 指定的第一道工序
var
route
=
_productRoute
.
GetList
(
f
=>
f
.
productId
==
plan
.
product_id
&&
f
.
status
==(
int
)
RowState
.
Valid
,
"serialNumber"
,
false
).
FirstOrDefault
();
if
(
route
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
ProductRouteMissing
);
}
var
unixtime
=
UnixTimeHelper
.
GetNow
();
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
@@ -392,6 +401,7 @@ namespace Siger.ApiACC.Controllers
processid
=
0
,
programnumber
=
""
,
remark
=
"手动任务-准备上料"
,
route
=
route
.
id
,
extend1
=
unixtime
.
ToString
()
});
...
...
@@ -411,11 +421,12 @@ namespace Siger.ApiACC.Controllers
updatetime
=
DateTime
.
Now
,
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
,
productId
=
plan
.
product_id
,
productCode
=
plan
.
product_code
,
productCode
=
plan
.
product_code
,
productName
=
plan
.
product_name
,
ordernumber
=
plandts
.
OrderNumber
,
locationId
=
fixtureToolsObj
.
Location
,
unixtime
=
unixtime
unixtime
=
unixtime
,
route
=
route
.
id
});
}
else
...
...
@@ -430,6 +441,7 @@ namespace Siger.ApiACC.Controllers
monitor
.
ordernumber
=
plandts
.
OrderNumber
;
monitor
.
locationId
=
fixtureToolsObj
.
Location
;
monitor
.
unixtime
=
unixtime
;
monitor
.
route
=
route
.
id
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationStateController.cs
View file @
5c16ef62
...
...
@@ -58,7 +58,7 @@ namespace Siger.ApiACC.Controllers
fixtureCode
=
""
,
fixtureName
=
""
,
lastupdate
=
""
,
status
=(
int
)
Automation
.
MachineStatus
.
Waiting
,
machineStatus
=
d
.
status
,
linemode
=
d
.
linemode
};
...
...
@@ -71,6 +71,7 @@ namespace Siger.ApiACC.Controllers
item
.
fixtureCode
=
fixture
.
fixtureguid
;
item
.
fixtureName
=
fixture
.
fixturename
;
item
.
machineStatus
=
d
.
status
;
item
.
status
=
fixture
.
status
;
}
result
.
Add
(
item
);
...
...
@@ -80,9 +81,9 @@ namespace Siger.ApiACC.Controllers
{
sum
=
new
ResponseAutomationMachineStatusTotal
{
waittingTotal
=
result
.
Where
(
f
=>
f
.
status
==
(
int
)
Automation
.
MachineStatus
.
Waiting
).
Count
(),
produceTotal
=
result
.
Where
(
f
=>
f
.
s
tatus
==
(
int
)
Automation
.
MachineStatus
.
Produce
).
Count
(),
complateTotal
=
result
.
Where
(
f
=>
f
.
s
tatus
==
(
int
)
Automation
.
MachineStatus
.
Complated
).
Count
(),
waittingTotal
=
result
.
Where
(
f
=>
f
.
machineStatus
==
(
int
)
Automation
.
MachineStatus
.
Waiting
).
Count
(),
produceTotal
=
result
.
Where
(
f
=>
f
.
machineS
tatus
==
(
int
)
Automation
.
MachineStatus
.
Produce
).
Count
(),
complateTotal
=
result
.
Where
(
f
=>
f
.
machineS
tatus
==
(
int
)
Automation
.
MachineStatus
.
Complated
).
Count
(),
disableTotal
=
result
.
Where
(
f
=>
f
.
enable
==
0
).
Count
(),
},
dts
=
result
...
...
Server/Apis/Siger.ApiCNC/Controllers/BeatAllocationController.cs
View file @
5c16ef62
...
...
@@ -23,14 +23,16 @@ namespace Siger.ApiCNC.Controllers
private
readonly
IProductionBeatSetRepository
_beatSetRepository
;
private
readonly
ISigerProjectMachineRepository
_machineRepository
;
private
readonly
ISigerProjectProductRepository
_productRepository
;
private
readonly
IProductRouteRepository
_productRoute
;
public
BeatAllocationController
(
IUnitOfWork
unitOfWork
,
IProductionBeatSetRepository
beatSetRepository
,
ISigerProjectMachineRepository
machineRepository
,
ISigerProjectProductRepository
productRepository
)
ISigerProjectProductRepository
productRepository
,
IProductRouteRepository
productRoute
)
{
_unitOfWork
=
unitOfWork
;
_beatSetRepository
=
beatSetRepository
;
_machineRepository
=
machineRepository
;
_productRepository
=
productRepository
;
_productRoute
=
productRoute
;
}
[
HttpGet
]
...
...
@@ -43,6 +45,7 @@ namespace Siger.ApiCNC.Controllers
var
validMachines
=
_machineRepository
.
GetLevelSectionNames
(
sectionID
,
ProjectId
);
foreach
(
var
time
in
data
.
Data
)
{
var
route
=
_productRoute
.
Get
(
f
=>
f
.
id
==
time
.
route_number
.
ToInt
());
var
entity
=
Mapper
<
ResponseBeatSet
,
ResponseBeatSet
>.
Map
(
time
);
var
section
=
validMachines
.
FirstOrDefault
(
q
=>
q
.
machine_id
==
time
.
machineID
);
if
(
section
!=
null
)
...
...
@@ -50,6 +53,10 @@ namespace Siger.ApiCNC.Controllers
entity
.
sectionName
=
section
.
machine_name
;
entity
.
stationName
=
section
.
lastSecondSectionTitle
+
"-"
+
section
.
lastSectionTitle
;
}
if
(
route
!=
null
)
{
entity
.
routeName
=
route
.
name
;
}
list
.
Add
(
entity
);
}
return
new
PagedObjectResult
(
list
,
data
.
Total
,
page
,
pagesize
);
...
...
@@ -104,6 +111,11 @@ namespace Siger.ApiCNC.Controllers
{
throw
new
BadRequestException
(
RequestEnum
.
ProductNotFound
);
}
var
route
=
_productRoute
.
Get
(
f
=>
f
.
id
==
request
.
route_id
);
if
(
route
==
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
RouteNotFound
);
}
var
beatSet
=
new
siger_project_beat_set
{
daily_standard_output
=
request
.
daily_standard_output
,
...
...
@@ -117,8 +129,8 @@ namespace Siger.ApiCNC.Controllers
standard_besat
=
request
.
standard_besat
,
projectID
=
ProjectId
,
changemodeltime
=
request
.
time_num
.
ToInt
(),
route_number
=
request
.
route_
number
.
ToStr
(),
route_name
=
r
equest
.
route_
name
,
route_number
=
request
.
route_
id
.
ToStr
(),
route_name
=
r
oute
.
name
,
updown_besat
=
request
.
updown_besat
.
ToDouble
(),
yieldrate
=
request
.
yieldratio
,
start_time
=
timSet
?
start
:
DateTime
.
MinValue
,
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_task_list.cs
View file @
5c16ef62
...
...
@@ -103,5 +103,7 @@ namespace Siger.Middlelayer.AccRepository.Entities
public
string
remark
{
get
;
set
;
}
public
string
extend1
{
get
;
set
;
}
public
int
route
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_project_beat_set.cs
View file @
5c16ef62
...
...
@@ -67,8 +67,8 @@ namespace Siger.Middlelayer.AccRepository.Entities
public
int
changemodeltime
{
get
;
set
;
}
/// <summary>
/// 工序
顺序
/// </summary>
/// 工序
ID Route.Id
/// </summary>
public
string
route_number
{
get
;
set
;
}
=
""
;
/// <summary>
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
5c16ef62
...
...
@@ -103,11 +103,11 @@ namespace Siger.Middlelayer.AccRepository.Repositories
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public
IEnumerable
<
ResponseAutomationPlanOrder
>
GetDeliveryOrder
(
List
<
int
>
productId
s
,
int
projectId
)
public
IEnumerable
<
ResponseAutomationPlanOrder
>
GetDeliveryOrder
(
List
<
string
>
Ordernum
s
,
int
projectId
)
{
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
where
d
.
projectId
==
projectId
&&
productIds
.
Contains
(
p
.
product_id
)
&&
d
.
status
!=
(
int
)
RowState
.
Invalid
&&
p
.
status
!=
(
int
)
RowState
.
Invalid
where
d
.
projectId
==
projectId
&&
Ordernums
.
Contains
(
d
.
OrderNumber
)
&&
d
.
status
!=
(
int
)
RowState
.
Invalid
&&
p
.
status
!=
(
int
)
RowState
.
Invalid
select
new
ResponseAutomationPlanOrder
{
productId
=
p
.
product_id
,
...
...
@@ -136,7 +136,8 @@ namespace Siger.Middlelayer.AccRepository.Repositories
ProductName
=
p
.
product_name
,
Url
=
pd
.
image
,
FixtureName
=
t
.
name
,
FixtureGuid
=
t
.
code
,
FixtureGuid
=
t
.
guid
,
FixtureCode
=
t
.
code
,
ProductCode
=
q
!=
null
?
q
.
productcode
:
""
,
Location
=
l
!=
null
?
l
.
locationid
:
0
,
};
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
5c16ef62
...
...
@@ -33,7 +33,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
join
u
in
_context
.
siger_project_user
on
q
.
updator
equals
u
.
mid
into
uu
from
u
in
uu
.
DefaultIfEmpty
()
join
r
in
_context
.
siger_project_
beat_set
on
q
.
routeid
equals
r
.
id
into
rr
join
r
in
_context
.
siger_project_
product_route
on
q
.
routeid
equals
r
.
id
into
rr
from
r
in
rr
.
DefaultIfEmpty
()
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAutomationLocation
...
...
@@ -56,8 +56,9 @@ namespace Siger.Middlelayer.AccRepository.Repositories
status
=
q
.
status
,
updatetime
=
q
.
updatetime
.
HasValue
&&
q
.
updatetime
>
DateTime
.
MinValue
?
q
.
updatetime
.
Value
.
ToString
(
ParameterConstant
.
DateTimeFormat
)
:
""
,
sn
=
q
.
sn
??
""
,
route
=
r
.
route_name
??
""
,
routenumber
=
r
==
null
?
""
:
r
.
route_number
.
ToString
(),
route
=
r
.
name
??
""
,
routenumber
=
r
==
null
?
""
:
r
.
serialNumber
.
ToString
(),
routeid
=
q
.
routeid
,
cate_guid
=
c
.
guid
??
""
,
categoryId
=
c
==
null
?
0
:
c
.
id
};
...
...
@@ -238,42 +239,64 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public
IEnumerable
<
ResponseAutomationLocationList
>
GetFulllocation
(
int
projectId
,
int
full
)
{
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
&&
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
;
if
(
full
!=
0
)
//获取有SN 的储位
if
(
full
==
1
)
{
locationidExpression
=
q
=>
!
string
.
IsNullOrEmpty
(
q
.
materialsn
);
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
);
}
else
{
locationidExpression
=
q
=>
string
.
IsNullOrEmpty
(
q
.
materialsn
);
//选择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
);
}
return
query
.
Where
(
locationidExpression
);
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsProductRepository.cs
View file @
5c16ef62
...
...
@@ -37,7 +37,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
IEnumerable
<
ResponseAutomationPlanOrder
>
GetDeliveryOrder
(
List
<
int
>
productId
s
,
int
projectId
);
IEnumerable
<
ResponseAutomationPlanOrder
>
GetDeliveryOrder
(
List
<
string
>
Ordernum
s
,
int
projectId
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationInfo.cs
View file @
5c16ef62
...
...
@@ -31,6 +31,8 @@ namespace Siger.Middlelayer.AccRepository.Response
public
class
ResponseAutomationLocationRouteInfo
{
public
int
section
{
get
;
set
;
}
public
int
machine
{
get
;
set
;
}
public
string
fixture
{
get
;
set
;
}
public
string
fixturename
{
get
;
set
;
}
public
string
ordernumber
{
get
;
set
;
}
...
...
@@ -39,8 +41,35 @@ namespace Siger.Middlelayer.AccRepository.Response
public
int
productId
{
get
;
set
;
}
public
string
productCode
{
get
;
set
;
}
public
string
productName
{
get
;
set
;
}
public
string
route
{
get
;
set
;
}
public
int
route
{
get
;
set
;
}
public
string
pn
{
get
;
set
;
}
/// <summary>
/// location.id主键
/// </summary>
public
int
lid
{
get
;
set
;
}
}
public
class
ResponseAutoRouteInfo
{
public
int
Section
{
get
;
set
;
}
public
int
Machine
{
get
;
set
;
}
public
string
Pn
{
get
;
set
;
}
public
int
ProductId
{
get
;
set
;
}
public
string
ProductName
{
get
;
set
;
}
public
int
Route
{
get
;
set
;
}
public
string
RouteName
{
get
;
set
;
}
public
string
OrderNo
{
get
;
set
;
}
public
string
FixtureGuid
{
get
;
set
;
}
public
string
FixtureName
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
/// <summary>
/// 储位编号
/// </summary>
public
int
Location
{
get
;
set
;
}
/// <summary>
/// location.id
/// </summary>
public
int
LId
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
View file @
5c16ef62
...
...
@@ -31,9 +31,19 @@ namespace Siger.Middlelayer.AccRepository.Response
/// 工件
/// </summary>
public
string
sn
{
get
;
set
;
}
/// <summary>
/// 工序顺序
/// </summary>
public
string
routenumber
{
get
;
set
;
}
/// <summary>
/// 工序萌宠
/// </summary>
public
string
route
{
get
;
set
;
}
/// <summary>
/// 工序id
/// </summary>
public
int
routeid
{
get
;
set
;
}
/// <summary>
/// 物料状态
/// </summary>
public
int
materialstate
{
get
;
set
;
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationMachineStatus.cs
View file @
5c16ef62
...
...
@@ -15,6 +15,13 @@ namespace Siger.Middlelayer.AccRepository.Response
public
int
location
{
get
;
set
;
}
public
string
sn
{
get
;
set
;
}
public
int
enable
{
get
;
set
;
}
/// <summary>
/// 设备状态
/// </summary>
public
int
machineStatus
{
get
;
set
;
}
/// <summary>
/// 任务状态
/// </summary>
public
int
status
{
get
;
set
;
}
public
string
lastupdate
{
get
;
set
;
}
public
string
linemode
{
get
;
set
;
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.CncRepository/Repositories/ProductionBeatSetRepository.cs
View file @
5c16ef62
...
...
@@ -101,6 +101,8 @@ namespace Siger.Middlelayer.CncRepository.Repositories
var
sectionIds
=
new
List
<
int
>();
var
productIds
=
new
List
<
string
>();
var
machineIds
=
new
List
<
int
>();
var
validates
=
new
List
<
BeatSetEntity
>();
foreach
(
var
beatSetEntity
in
beatSetEntities
)
{
var
sectionId
=
0
;
...
...
@@ -180,14 +182,26 @@ namespace Siger.Middlelayer.CncRepository.Repositories
{
errors
.
Add
(
$"
{
rowIndex
}
,
{(
int
)
RequestEnum
.
UpDownBesatNotInteger
}
"
);
}
var
route
=
_context
.
siger_project_product_route
.
FirstOrDefault
(
f
=>
f
.
projectId
==
projectid
&&
f
.
productId
==
product
.
id
&&
f
.
name
==
beatSetEntity
.
RouteName
);
if
(
route
==
null
)
{
errors
.
Add
(
$"
{
rowIndex
}
,
{(
int
)
RequestEnum
.
RouteNotFound
}
"
);
}
if
(
errors
.
Any
())
{
return
new
CommonImportResult
(
0
,
string
.
Join
(
";"
,
errors
));
}
beatSetEntity
.
RouteNumber
=
route
.
id
.
ToString
();
validates
.
Add
(
beatSetEntity
);
}
var
index
=
0
;
var
maxTime
=
"2199-01-01 00:00:00"
.
ToDateTime
();
foreach
(
var
entity
in
beatSetEntiti
es
)
foreach
(
var
entity
in
validat
es
)
{
var
beat
=
new
siger_project_beat_set
{
...
...
@@ -201,12 +215,14 @@ namespace Siger.Middlelayer.CncRepository.Repositories
product_name
=
productIds
[
index
],
section_id
=
sectionIds
[
index
],
standard_besat
=
entity
.
CycleTime
.
ToInt
(),
route_name
=
entity
.
RouteName
,
machineID
=
machineIds
.
Count
>
index
?
machineIds
[
index
]:
0
,
changemodeltime
=
entity
.
ChangeModelTime
.
ToInt
(),
updown_besat
=
entity
.
UpDownBesat
.
ToDouble
(),
yieldrate
=
entity
.
YieldRate
.
ToInt
(),
route_number
=
entity
.
RouteNumber
,
//route_number = entity.RouteNumber,
route_number
=
entity
.
RouteNumber
,
start_time
=
string
.
IsNullOrEmpty
(
entity
.
StartTime
)
?
DateTime
.
MinValue
:
entity
.
StartTime
.
ToDateTime
(),
end_time
=
string
.
IsNullOrEmpty
(
entity
.
EndTime
)
?
maxTime
:
entity
.
EndTime
.
ToDateTime
().
AddDays
(
1
).
AddSeconds
(-
1
)
};
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.CncRepository/Request/RequestAddBeatAllocation.cs
View file @
5c16ef62
...
...
@@ -13,6 +13,10 @@ namespace Siger.Middlelayer.CncRepository.Request
public
string
product_name_text
{
get
;
set
;
}
/// <summary>
/// productId
/// </summary>
[
Required
(
ErrorMessage
=
"ProductNameIsEmpty"
)]
public
string
product_name
{
get
;
set
;
}
...
...
@@ -24,6 +28,11 @@ namespace Siger.Middlelayer.CncRepository.Request
public
string
time_num
{
get
;
set
;
}
/// <summary>
/// 产品工序表ID
/// </summary>
public
int
route_id
{
get
;
set
;
}
public
string
route_number
{
get
;
set
;
}
public
string
route_name
{
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