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
bd1cc65b
Commit
bd1cc65b
authored
Jan 22, 2021
by
yucheng.jiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.siger-data.com:9000/jiawei.su/Laisi_AutoMES2
parents
9a735041
d3f72134
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
9 deletions
+58
-9
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+26
-0
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+22
-8
ApiAccDbContext.cs
...tories/Siger.Middlelayer.AccRepository/ApiAccDbContext.cs
+3
-0
siger_automation_line_mode.cs
...ayer.AccRepository/Entities/siger_automation_line_mode.cs
+5
-0
DB.script
Server/Infrastructure/Script/DB.script
+2
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
bd1cc65b
...
...
@@ -105,6 +105,7 @@ namespace Siger.ApiACC.Controllers
/// <param name="line"></param>
/// <param name="mode"></param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
LineMode
(
int
line
,
int
mode
)
{
var
exitObj
=
_automationLineMode
.
Get
(
f
=>
f
.
section
==
line
);
...
...
@@ -148,10 +149,35 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
/// <summary>
/// 产线 需要检验
/// </summary>
/// <param name="line"></param>
/// <param name="enable"></param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
inspect
(
int
line
,
int
enable
)
{
var
exitObj
=
_automationLineMode
.
Get
(
f
=>
f
.
section
==
line
);
if
(
exitObj
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
exitObj
.
updatetime
=
DateTime
.
Now
;
exitObj
.
inspect
=
enable
;
if
(
_unitOfWork
.
Commit
()
>
0
)
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
else
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
/// <summary>
/// 任务状态接口 用于保存PLC 实时任务状态 ()
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
IActionResult
TaskResult
([
FromBody
]
RequestAutomationTaskResult
request
)
{
//1.检查Tasklist
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
bd1cc65b
...
...
@@ -25,26 +25,35 @@ namespace Siger.ApiACC.Controllers
private
readonly
ISigerProjectLevelSectionRepository
_sigerProjectLevelSection
;
private
readonly
ISigerDict
_sigerDict
;
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
private
readonly
ISigerProjectMachineAttributionRepository
_sigerProjectMachineAttribution
;
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
)
public
AutomationOperateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
ISigerDict
sigerDict
,
IAutomationMachineStatus
automationMachineStatus
,
ISigerProjectMachineAttributionRepository
sigerProjectMachineAttribution
)
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_sigerDict
=
sigerDict
;
_automationMachineStatus
=
automationMachineStatus
;
_sigerProjectMachineAttribution
=
sigerProjectMachineAttribution
;
}
public
IActionResult
Get
()
{
return
new
ObjectResult
(
1
);
}
/// <summary>
/// 获取字典配置
/// </summary>
/// <param name="line">产线</param>
/// <param name="type">类型:0:上料 1:检验</param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
GetloadStation
(
int
line
,
int
type
)
{
var
stationDicts
=
_sigerDict
.
GetDataByCat
(
AccDictCost
.
Automation
,
ProjectId
);
if
(!
stationDicts
.
Any
())
{
Logger
.
WriteLineInfo
(
$"
AutoProcess
未配置设备类型字典"
);
Logger
.
WriteLineInfo
(
$"
GetloadStation
未配置设备类型字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
...
...
@@ -55,7 +64,7 @@ namespace Siger.ApiACC.Controllers
var
dictLoad
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
UploadloadStation
);
if
(!
dictLoad
.
Any
())
{
Logger
.
WriteLineInfo
(
$"
AutoProcess
未配置上下料工站字典"
);
Logger
.
WriteLineInfo
(
$"
GetloadStation
未配置上下料工站字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
loadStation
=
dictLoad
.
Select
(
s
=>
s
.
dval
).
ToList
();
...
...
@@ -64,7 +73,7 @@ namespace Siger.ApiACC.Controllers
var
dictLoad
=
stationDicts
.
Where
(
s
=>
s
.
dkey
==
DictKeyValConst
.
CleanStation
);
if
(!
dictLoad
.
Any
())
{
Logger
.
WriteLineInfo
(
$"
AutoProcess
未配置清洗工站字典"
);
Logger
.
WriteLineInfo
(
$"
GetloadStation
未配置清洗工站字典"
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
loadStation
=
dictLoad
.
Select
(
s
=>
s
.
dval
).
ToList
();
...
...
@@ -75,19 +84,24 @@ namespace Siger.ApiACC.Controllers
foreach
(
var
station
in
loadStation
)
{
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
station
.
ToInt
()
&&
f
.
status
==
(
int
)
RowState
.
Valid
);
var
section
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
station
.
ToInt
()
&&
f
.
parentid
==
line
&&
f
.
status
==
(
int
)
RowState
.
Valid
);
if
(
section
==
null
)
continue
;
var
machintAttr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
section
.
id
);
if
(
machintAttr
==
null
)
{
Logger
.
WriteLineInfo
(
$"GetloadStation 未配置清洗工站字典"
);
continue
;
}
var
loadStatus
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
station
.
ToInt
());
var
machineStatus
=
_automationMachineStatus
.
Get
(
f
=>
f
.
section
==
station
.
ToInt
()
&&
f
.
status
==(
int
)
RowState
.
Valid
);
if
(
machineStatus
==
null
)
{
_automationMachineStatus
.
Insert
(
new
siger_automation_machine_status
{
projectId
=
ProjectId
,
enable
=
1
,
machineid
=
0
,
machineid
=
machintAttr
.
machine
,
section
=
section
.
id
,
updatetime
=
DateTime
.
Now
});
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/ApiAccDbContext.cs
View file @
bd1cc65b
...
...
@@ -160,5 +160,8 @@ namespace Siger.Middlelayer.AccRepository
public
DbSet
<
siger_wms_storage
>
siger_wms_storage
{
get
;
set
;
}
public
DbSet
<
siger_wms_storage_location
>
siger_wms_storage_location
{
get
;
set
;
}
public
DbSet
<
siger_automation_line_mode
>
siger_automation_line_mode
{
get
;
set
;
}
public
DbSet
<
siger_automation_machine_status
>
siger_automation_machine_status
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_line_mode.cs
View file @
bd1cc65b
...
...
@@ -14,6 +14,11 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 生产线模式 0:手动 1 自动
/// </summary>
public
int
mode
{
get
;
set
;
}
/// <summary>
/// 是否检验
/// </summary>
public
int
inspect
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
...
...
Server/Infrastructure/Script/DB.script
View file @
bd1cc65b
...
...
@@ -373,7 +373,8 @@ CREATE TABLE `siger_automation_line_mode` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`section` int(11) NOT NULL DEFAULT 0 COMMENT '产线ID',
`projectid` int(11) NOT NULL DEFAULT 0,
`mode` int(11) NOT NULL DEFAULT 1 COMMENT '0:手动模式 1:自动模式',
`mode` int(1) NOT NULL DEFAULT 1 COMMENT '0:手动模式 1:自动模式',
`inspect` int(1) NOT NULL DEFAULT 1 COMMENT '0:不需要检验 1:检验',
`updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
...
...
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