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
f45b4e53
Commit
f45b4e53
authored
Jan 21, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
1912d10a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
282 additions
and
8 deletions
+282
-8
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+147
-0
PositionController.cs
Server/Apis/Siger.ApiConfig/Controller/PositionController.cs
+42
-2
DictKeyValConst.cs
...ommon/Siger.Middlelayer.Share/Constant/DictKeyValConst.cs
+3
-6
requestAutoLoad.cs
...iger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
+38
-0
ResponseAutomationInfo.cs
...dlelayer.AccRepository/Response/ResponseAutomationInfo.cs
+30
-0
ResponseLoadStation.cs
...er.Middlelayer.Repository/Response/ResponseLoadStation.cs
+22
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
0 → 100644
View file @
f45b4e53
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Threading.Tasks
;
using
Microsoft.AspNetCore.Mvc
;
using
Siger.Middlelayer.AccRepository.Entities
;
using
Siger.Middlelayer.AccRepository.Repositories.Interface
;
using
Siger.Middlelayer.AccRepository.Request
;
using
Siger.Middlelayer.AccRepository.Response
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common.Extensions
;
using
Siger.Middlelayer.Log
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Repository.Repositories.Interface
;
using
Siger.Middlelayer.Repository.Response
;
using
Siger.Middlelayer.Share.Constant
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
namespace
Siger.ApiACC.Controllers
{
public
class
AutomationOperateController
:
BaseController
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
ISigerProjectLevelSectionRepository
_sigerProjectLevelSection
;
private
readonly
ISigerDict
_sigerDict
;
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_sigerDict
=
sigerDict
;
_automationMachineStatus
=
automationMachineStatus
;
}
public
IActionResult
Get
()
{
return
new
ObjectResult
(
1
);
}
[
HttpGet
]
public
IActionResult
GetloadStation
(
int
line
)
{
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
ProjectId
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
dictLoad
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
if
(!
dictLoad
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置上下料工站字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
loadStation
=
dictLoad
.
Select
(
s
=>
s
.
dval
).
ToList
();
var
objs
=
_sigerProjectLevelSection
.
GetAccStationByline
(
ProjectId
,
line
);
if
(!
objs
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
data
=
new
List
<
ResponseLoadStation
>();
foreach
(
var
station
in
loadStation
)
{
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
station
.
ToInt
()
&&
f
.
status
==
(
int
)
RowState
.
Valid
);
if
(
section
==
null
)
continue
;
var
loadStatus
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
station
.
ToInt
());
if
(
machineStatus
==
null
)
{
_automationMachineStatus
.
Insert
(
new
siger_automation_machine_status
{
projectId
=
ProjectId
,
enable
=
1
,
machineid
=
0
,
section
=
section
.
id
,
updatetime
=
DateTime
.
Now
});
}
else
{
loadStatus
=
machineStatus
.
status
;
}
data
.
Add
(
new
ResponseLoadStation
{
section
=
section
.
id
,
title
=
section
.
title
,
status
=
loadStatus
});
}
return
new
ObjectResult
(
data
);
}
/// <summary>
/// 准备上料
/// </summary>
/// <param name="loading"></param>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
Loading
([
FromBody
]
requestAutomationLoading
loading
)
{
var
data
=
new
ResponseAutomationInfo
{
sn
=
"sn0001"
,
wo
=
"wo123123"
};
return
new
ObjectResult
(
data
);
}
/// <summary>
/// 安装完成
/// </summary>
/// <param name="assemble"></param>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
CompalateAssemble
([
FromBody
]
requestAutoCompalateAssemble
assemble
)
{
return
new
ObjectResult
(
1
);
}
/// <summary>
/// 准备下料
/// </summary>
/// <param name="unloading"></param>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
Unloading
([
FromBody
]
requestAutomationUnloading
unloading
)
{
return
new
ObjectResult
(
1
);
}
/// <summary>
/// 拆卸完成
/// </summary>
/// <param name="disassemble"></param>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
Disassemble
([
FromBody
]
Requestdisassemble
disassemble
)
{
return
new
ObjectResult
(
1
);
}
}
}
Server/Apis/Siger.ApiConfig/Controller/PositionController.cs
View file @
f45b4e53
using
System.Linq
;
using
System.Collections.Generic
;
using
System.Linq
;
using
Microsoft.AspNetCore.Mvc
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Log
;
using
Siger.Middlelayer.Repository.Repositories.Interface
;
using
Siger.Middlelayer.Repository.Response
;
using
Siger.Middlelayer.Share.Constant
;
namespace
Siger.ApiConfig.Controller
{
public
class
PositionController
:
BaseController
{
private
readonly
ISigerProjectLevelSectionRepository
_projectLevelSection
;
public
PositionController
(
ISigerProjectLevelSectionRepository
projectLevelSection
)
private
readonly
ISigerDict
_sigerDict
;
public
PositionController
(
ISigerProjectLevelSectionRepository
projectLevelSection
,
ISigerDict
sigerDict
)
{
_projectLevelSection
=
projectLevelSection
;
_sigerDict
=
sigerDict
;
}
[
HttpGet
]
...
...
@@ -30,6 +37,38 @@ namespace Siger.ApiConfig.Controller
return
new
ObjectResult
(
obj
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
[
HttpGet
]
public
IActionResult
GetloadStation
(
int
line
)
{
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
ProjectId
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置设备类型字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
dictLoad
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
if
(!
dictLoad
.
Any
())
{
Logger
.
WriteLineInfo
(
$"AutoProcess 未配置上下料工站字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
loadStation
=
dictLoad
.
Select
(
s
=>
s
.
dval
).
ToList
();
var
objs
=
_projectLevelSection
.
GetAccStationByline
(
ProjectId
,
line
);
if
(!
objs
.
Any
())
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
var
data
=
new
List
<
ResponseLoadStation
>();
foreach
(
var
station
in
objs
)
{
}
return
new
ObjectResult
(
data
);
}
}
}
\ No newline at end of file
Server/Common/Siger.Middlelayer.Share/Constant/DictKeyValConst.cs
View file @
f45b4e53
...
...
@@ -34,12 +34,9 @@ namespace Siger.Middlelayer.Share.Constant
/// </summary>
public
const
string
CleanStation
=
"CleanStation"
;
/// <summary>
/// key:上料工站
/// key:上料
下料
工站
/// </summary>
public
const
string
UploadloadStation
=
"UploadloadStation"
;
/// <summary>
/// key:下料工站
/// </summary>
public
const
string
DownloadStation
=
"DownloadStation"
;
public
const
string
UploadloadStation
=
"LoadStation"
;
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Request/requestAutoLoad.cs
0 → 100644
View file @
f45b4e53
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Request
{
/// <summary>
/// 准备上料
/// </summary>
public
class
requestAutomationLoading
{
public
int
section
{
get
;
set
;
}
public
string
code
{
get
;
set
;
}
}
/// <summary>
/// 安装完成
/// </summary>
public
class
requestAutoCompalateAssemble
{
public
int
section
{
get
;
set
;
}
}
/// <summary>
/// 准备下料
/// </summary>
public
class
requestAutomationUnloading
{
public
int
section
{
get
;
set
;
}
}
/// <summary>
/// 拆卸
/// </summary>
public
class
Requestdisassemble
{
public
int
section
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationInfo.cs
0 → 100644
View file @
f45b4e53
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.AccRepository.Response
{
public
class
ResponseAutomationInfo
{
/// <summary>
/// 工单信息
/// </summary>
public
string
wo
{
get
;
set
;
}
public
string
productCode
{
get
;
set
;
}
public
string
productName
{
get
;
set
;
}
/// <summary>
/// 工件编码
/// </summary>
public
string
sn
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
int
statusDesc
{
get
;
set
;
}
/// <summary>
/// 储位位置
/// </summary>
public
string
locationDesc
{
get
;
set
;
}
/// <summary>
/// 工装编号
/// </summary>
public
string
fixture
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.Repository/Response/ResponseLoadStation.cs
0 → 100644
View file @
f45b4e53
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Siger.Middlelayer.Repository.Response
{
public
class
ResponseLoadStation
{
/// <summary>
/// 工站ID
/// </summary>
public
int
section
{
get
;
set
;
}
/// <summary>
/// 工站名称
/// </summary>
public
string
title
{
get
;
set
;
}
/// <summary>
/// 上料位状态
/// </summary>
public
int
status
{
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