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
54b81565
Commit
54b81565
authored
Jan 25, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate AutoMes
parent
dbfc3567
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
83 additions
and
5 deletions
+83
-5
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+0
-0
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+11
-1
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+6
-3
DictKeyValConst.cs
...ommon/Siger.Middlelayer.Share/Constant/DictKeyValConst.cs
+5
-0
AccEnum.cs
...Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
+3
-1
siger_automation_location.cs
...layer.AccRepository/Entities/siger_automation_location.cs
+20
-0
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+21
-0
IAutomationFixtureToolsProductRepository.cs
...ies/Interface/IAutomationFixtureToolsProductRepository.cs
+8
-0
ResponseProductFixtureInfo.cs
...ayer.AccRepository/Response/ResponseProductFixtureInfo.cs
+9
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
54b81565
This diff is collapsed.
Click to expand it.
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
54b81565
...
...
@@ -30,10 +30,11 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationLocationRepository
_autoLocationRepository
;
private
readonly
IAutomationFixtureMonitor
_fixtureMonitor
;
private
readonly
IProductRouteRepository
_routeRepository
;
private
readonly
IAutomationFixtureToolsProductRepository
_automationFixtureToolsProduct
;
public
AutomationLocationController
(
IUnitOfWork
unitOfWork
,
IAutomationFixtureToolsCategoryRepository
toolsCategoryRepository
,
IAutomationFixtureToolsRepository
toolsRepository
,
IAutomationLocationRepository
autoLocationRepository
,
IAutomationFixtureMonitor
fixtureMonitor
,
IProductRouteRepository
routeRepository
)
IAutomationFixtureMonitor
fixtureMonitor
,
IProductRouteRepository
routeRepository
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
)
{
_unitOfWork
=
unitOfWork
;
_toolsCategoryRepository
=
toolsCategoryRepository
;
...
...
@@ -41,6 +42,7 @@ namespace Siger.ApiACC.Controllers
_autoLocationRepository
=
autoLocationRepository
;
_fixtureMonitor
=
fixtureMonitor
;
_routeRepository
=
routeRepository
;
_automationFixtureToolsProduct
=
automationFixtureToolsProduct
;
}
[
HttpGet
]
...
...
@@ -192,6 +194,8 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
fixturetoolProduct
=
_automationFixtureToolsProduct
.
Get
(
f
=>
f
.
fixturetools
==
fixturetool
.
guid
);
var
location
=
_autoLocationRepository
.
GetLocation
(
req
.
locationid
.
ToInt
(),
ProjectId
);
if
(
location
==
null
)
{
...
...
@@ -209,6 +213,8 @@ namespace Siger.ApiACC.Controllers
guid
=
Guid
.
NewGuid
().
ToString
(),
locationid
=
location
.
locationid
,
fixturetools
=
fixturetool
.
guid
,
productid
=
fixturetoolProduct
!=
null
?
fixturetoolProduct
.
productid
:
0
,
productcode
=
fixturetoolProduct
!=
null
?
fixturetoolProduct
.
productcode
:
""
,
attachment
=
req
.
fileurl
,
filename
=
req
.
filename
,
remark
=
req
.
remark
,
...
...
@@ -244,6 +250,7 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
RequestEnum
.
FixtureToolNotFound
);
}
var
fixturetoolProduct
=
_automationFixtureToolsProduct
.
Get
(
f
=>
f
.
fixturetools
==
fixturetool
.
guid
);
var
location
=
_autoLocationRepository
.
GetLocation
(
req
.
locationid
.
ToInt
(),
ProjectId
);
if
(
location
==
null
)
{
...
...
@@ -263,6 +270,9 @@ namespace Siger.ApiACC.Controllers
entity
.
remark
=
req
.
remark
;
entity
.
updatetime
=
DateTime
.
Now
;
entity
.
updator
=
UserId
;
entity
.
productid
=
fixturetoolProduct
!=
null
?
fixturetoolProduct
.
productid
:
0
;
entity
.
productcode
=
fixturetoolProduct
!=
null
?
fixturetoolProduct
.
productcode
:
""
;
_autoLocationRepository
.
Update
(
entity
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
54b81565
...
...
@@ -35,9 +35,10 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
private
readonly
IAutomationFixtureToolsProductRepository
_automationFixtureToolsProduct
;
private
readonly
IAutomationFixtureToolsRepository
_automationFixtureTools
;
private
readonly
IAutomationLocationRepository
_automationLocation
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
,
IAutomationTaskListRepository
automationTaskList
,
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
)
IProductPlanDetails
planDetails
,
IProductPlanRepository
productPlan
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationFixtureToolsProductRepository
automationFixtureToolsProduct
,
IAutomationFixtureToolsRepository
automationFixtureTools
,
IAutomationLocationRepository
automationLocation
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
...
...
@@ -50,6 +51,7 @@ namespace Siger.ApiACC.Controllers
_automationFixtureMonitor
=
automationFixtureMonitor
;
_automationFixtureToolsProduct
=
automationFixtureToolsProduct
;
_automationFixtureTools
=
automationFixtureTools
;
_automationLocation
=
automationLocation
;
}
/// <summary>
...
...
@@ -173,7 +175,7 @@ namespace Siger.ApiACC.Controllers
return
new
ObjectResult
(
result
);
}
/// <summary>
/// 准备上料 -生成指令 load
/// 准备上料 -生成指令 load
(立库->上料位)
/// </summary>
/// <param name="loading"></param>
/// <returns></returns>
...
...
@@ -348,6 +350,8 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
var
taskNo
=
_automationTaskList
.
CrateTaskNumber
(
Automation
.
TaskTrigerType
.
Manual
);
_automationTaskList
.
Insert
(
new
siger_automation_task_list
{
...
...
@@ -376,7 +380,6 @@ namespace Siger.ApiACC.Controllers
});
if
(
_unitOfWork
.
Commit
()
>
0
)
{
Logger
.
WriteLineError
(
$"手动任务创建成功-
{
Siger
.
Middlelayer
.
Common
.
Helpers
.
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_SXLW_LK
)}
"
);
...
...
Server/Common/Siger.Middlelayer.Share/Constant/DictKeyValConst.cs
View file @
54b81565
...
...
@@ -38,5 +38,10 @@ namespace Siger.Middlelayer.Share.Constant
/// </summary>
public
const
string
UploadloadStation
=
"LoadStation"
;
/// <summary>
/// 立库
/// </summary>
public
const
string
WarehouseStation
=
"WarehouseStation"
;
}
}
Server/Common/Siger.Middlelayer.Share/Enum/ModuleEnum/AccEnum.cs
View file @
54b81565
...
...
@@ -334,7 +334,9 @@ namespace Siger.Middlelayer.Common.ModuleEnum
[
Description
(
"设备已经生产完成"
)]
MachineProCompalate
,
[
Description
(
"该设备当前无工装状态"
)]
MonitorNotfound
MonitorNotfound
,
[
Description
(
"未配置字典信息"
)]
AutomationDictNotfound
}
public
enum
SeriNumCfg
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_location.cs
View file @
54b81565
...
...
@@ -18,6 +18,26 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 工装GUID
/// </summary>
public
string
fixturetools
{
get
;
set
;
}
public
int
productid
{
get
;
set
;
}
public
string
productcode
{
get
;
set
;
}
/// <summary>
/// 工件对应的工单号
/// </summary>
public
string
ordernumber
{
get
;
set
;
}
/// <summary>
/// 工装工件
/// </summary>
public
string
sn
{
get
;
set
;
}
/// <summary>
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public
int
routeid
{
get
;
set
;
}
/// <summary>
/// 每加工CNC 设备 经过的工序: 标准节拍表
/// </summary>
public
string
route
{
get
;
set
;
}
/// <summary>
/// 附件
/// </summary>
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
54b81565
...
...
@@ -97,6 +97,27 @@ namespace Siger.Middlelayer.AccRepository.Repositories
}
}
/// <summary>
/// 获取 交期最早的订单
/// </summary>
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
public
IEnumerable
<
ResponseAutomationPlanOrder
>
GetDeliveryOrder
(
List
<
int
>
productIds
,
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
select
new
ResponseAutomationPlanOrder
{
ordernumber
=
d
.
OrderNumber
,
productCode
=
p
.
product_code
,
productName
=
p
.
product_name
,
delvery
=
p
.
delivery_time
,
};
return
query
.
OrderBy
(
f
=>
f
.
delvery
);
}
public
ResponsePlanlFixtureInfo
GetPlanFixtureInfo
(
int
projectId
,
string
ordernumber
)
{
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsProductRepository.cs
View file @
54b81565
...
...
@@ -23,5 +23,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
CommonImportResult
ImportData
(
IEnumerable
<
FixtureToolsProductTemplate
>
list
,
int
projectid
,
int
userid
);
/// <summary>
/// 获取交期最近的订单
/// </summary>
/// <param name="productIds"></param>
/// <param name="projectId"></param>
/// <returns></returns>
IEnumerable
<
ResponseAutomationPlanOrder
>
GetDeliveryOrder
(
List
<
int
>
productIds
,
int
projectId
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseProductFixtureInfo.cs
View file @
54b81565
...
...
@@ -40,4 +40,13 @@ namespace Siger.Middlelayer.AccRepository.Response
public
int
Location
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
}
public
class
ResponseAutomationPlanOrder
{
public
string
ordernumber
{
get
;
set
;
}
public
string
productCode
{
get
;
set
;
}
public
string
productName
{
get
;
set
;
}
public
int
delvery
{
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