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
6faa999e
Commit
6faa999e
authored
Jan 26, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
3f0e0000
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
10 deletions
+25
-10
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+2
-2
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+14
-6
AutomationStateController.cs
...pis/Siger.ApiACC/Controllers/AutomationStateController.cs
+1
-0
siger_automation_fixture_tools_monitor.cs
...sitory/Entities/siger_automation_fixture_tools_monitor.cs
+4
-0
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+1
-1
DB.script
Server/Infrastructure/Script/DB.script
+3
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
6faa999e
...
@@ -161,7 +161,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -161,7 +161,7 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
throw
new
BadRequestException
(
AccEnum
.
AutomationDictNotfound
);
}
}
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
>=
(
int
)
TaskResultStatus
.
Cancel
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
var
tasklist
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(!
tasklist
.
Any
())
if
(!
tasklist
.
Any
())
{
{
Logger
.
WriteLineInfo
(
$"LineMode Mode=1 触发自动任务检查"
);
Logger
.
WriteLineInfo
(
$"LineMode Mode=1 触发自动任务检查"
);
...
@@ -231,7 +231,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -231,7 +231,7 @@ namespace Siger.ApiACC.Controllers
}
}
//是否还有未完成任务
//是否还有未完成任务
var
taskDone
=
_automationTaskList
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
>
(
int
)
TaskResultStatus
.
Cancel
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
var
taskDone
=
_automationTaskList
.
Get
(
f
=>
f
.
projectId
==
PID
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(
taskDone
!=
null
)
if
(
taskDone
!=
null
)
{
{
//还有未完成任务 退出 等待任务下发
//还有未完成任务 退出 等待任务下发
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
6faa999e
...
@@ -103,7 +103,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -103,7 +103,7 @@ namespace Siger.ApiACC.Controllers
var
machintAttr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
section
.
id
);
var
machintAttr
=
_sigerProjectMachineAttribution
.
Get
(
f
=>
f
.
station
==
section
.
id
);
if
(
machintAttr
==
null
)
if
(
machintAttr
==
null
)
{
{
Logger
.
WriteLineInfo
(
$"GetloadStation 未配置
清洗
工站字典"
);
Logger
.
WriteLineInfo
(
$"GetloadStation 未配置工站字典"
);
continue
;
continue
;
}
}
var
loadStatus
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
var
loadStatus
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
...
@@ -118,8 +118,10 @@ namespace Siger.ApiACC.Controllers
...
@@ -118,8 +118,10 @@ namespace Siger.ApiACC.Controllers
section
=
section
.
id
,
section
=
section
.
id
,
updatetime
=
DateTime
.
Now
updatetime
=
DateTime
.
Now
});
});
}
else
}
else
{
{
loadStatus
=
machineStatus
.
status
;
loadStatus
=
machineStatus
.
status
;
}
}
data
.
Add
(
new
ResponseLoadStation
{
data
.
Add
(
new
ResponseLoadStation
{
...
@@ -128,6 +130,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -128,6 +130,8 @@ namespace Siger.ApiACC.Controllers
status
=
loadStatus
status
=
loadStatus
});
});
}
}
_unitOfWork
.
Commit
();
return
new
ObjectResult
(
data
);
return
new
ObjectResult
(
data
);
}
}
...
@@ -281,6 +285,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -281,6 +285,7 @@ namespace Siger.ApiACC.Controllers
createtime
=
DateTime
.
Now
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
status
=(
int
)
Automation
.
MachineStatus
.
Produce
,
status
=(
int
)
Automation
.
MachineStatus
.
Produce
,
productId
=
plan
.
product_id
,
productCode
=
plan
.
product_code
,
productCode
=
plan
.
product_code
,
productName
=
plan
.
product_name
,
productName
=
plan
.
product_name
,
ordernumber
=
plandts
.
OrderNumber
,
ordernumber
=
plandts
.
OrderNumber
,
...
@@ -293,6 +298,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -293,6 +298,7 @@ namespace Siger.ApiACC.Controllers
monitor
.
section
=
loading
.
section
;
monitor
.
section
=
loading
.
section
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
productId
=
plan
.
product_id
;
monitor
.
productName
=
plan
.
product_name
;
monitor
.
productName
=
plan
.
product_name
;
monitor
.
productCode
=
plan
.
product_code
;
monitor
.
productCode
=
plan
.
product_code
;
monitor
.
ordernumber
=
plandts
.
OrderNumber
;
monitor
.
ordernumber
=
plandts
.
OrderNumber
;
...
@@ -334,10 +340,10 @@ namespace Siger.ApiACC.Controllers
...
@@ -334,10 +340,10 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
MachineOnFree
);
throw
new
BadRequestException
(
AccEnum
.
MachineOnFree
);
}
}
if
(
machineStatus
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
//
if (machineStatus.status == (int)Automation.MachineStatus.Complated)
{
//
{
throw
new
BadRequestException
(
AccEnum
.
MachineProCompalate
);
//
throw new BadRequestException(AccEnum.MachineProCompalate);
}
//
}
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
assemble
.
section
))
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
assemble
.
section
))
{
{
...
@@ -349,6 +355,8 @@ namespace Siger.ApiACC.Controllers
...
@@ -349,6 +355,8 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
throw
new
BadRequestException
(
AccEnum
.
MonitorNotfound
);
}
}
//移出 上料位
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
...
@@ -368,7 +376,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -368,7 +376,7 @@ namespace Siger.ApiACC.Controllers
completetime
=
DateTime
.
MinValue
,
completetime
=
DateTime
.
MinValue
,
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
trigger
=
Automation
.
TaskTrigerType
.
Manual
,
projectId
=
ProjectId
,
projectId
=
ProjectId
,
productid
=
0
,
productid
=
monitor
.
pr
,
sn
=
monitor
.
sn
,
sn
=
monitor
.
sn
,
ordercode
=
monitor
.
ordernumber
,
ordercode
=
monitor
.
ordernumber
,
fixtureguid
=
monitor
.
fixtureguid
,
fixtureguid
=
monitor
.
fixtureguid
,
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationStateController.cs
View file @
6faa999e
...
@@ -69,6 +69,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -69,6 +69,7 @@ namespace Siger.ApiACC.Controllers
item
.
sn
=
fixture
.
sn
;
item
.
sn
=
fixture
.
sn
;
item
.
fixtureCode
=
fixture
.
fixtureguid
;
item
.
fixtureCode
=
fixture
.
fixtureguid
;
item
.
fixtureName
=
fixture
.
fixturename
;
item
.
fixtureName
=
fixture
.
fixturename
;
item
.
status
=
fixture
.
status
;
}
}
result
.
Add
(
item
);
result
.
Add
(
item
);
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_monitor.cs
View file @
6faa999e
...
@@ -40,6 +40,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
...
@@ -40,6 +40,10 @@ namespace Siger.Middlelayer.AccRepository.Entities
public
DateTime
updatetime
{
get
;
set
;
}
public
DateTime
updatetime
{
get
;
set
;
}
public
string
ordernumber
{
get
;
set
;
}
public
string
ordernumber
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 产品ID
/// </summary>
public
int
productId
{
get
;
set
;
}
/// <summary>
///
///
/// </summary>
/// </summary>
public
string
productCode
{
get
;
set
;
}
public
string
productCode
{
get
;
set
;
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
View file @
6faa999e
...
@@ -27,7 +27,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
...
@@ -27,7 +27,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
public
bool
CanTask
(
int
projectId
,
int
section
)
public
bool
CanTask
(
int
projectId
,
int
section
)
{
{
var
taskObj
=
_context
.
siger_automation_task_list
.
FirstOrDefault
(
f
=>
f
.
projectId
==
projectId
&&
f
.
status
>=
(
int
)
TaskResultStatus
.
Cancel
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
var
taskObj
=
_context
.
siger_automation_task_list
.
FirstOrDefault
(
f
=>
f
.
projectId
==
projectId
&&
f
.
status
<
(
int
)
TaskResultStatus
.
Complated
);
if
(
taskObj
==
null
)
if
(
taskObj
==
null
)
return
true
;
return
true
;
...
...
Server/Infrastructure/Script/DB.script
View file @
6faa999e
...
@@ -267,6 +267,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` (
...
@@ -267,6 +267,7 @@ CREATE TABLE IF NOT EXISTS `siger_automation_fixture_tools_product` (
-- ----------------------------
-- ----------------------------
CREATE TABLE IF NOT EXISTS `siger_automation_location` (
CREATE TABLE IF NOT EXISTS `siger_automation_location` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id` int(11) NOT NULL AUTO_INCREMENT,
`guid` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位位置',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`fixturetools` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '工装GUID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
...
@@ -401,7 +402,7 @@ CREATE TABLE `siger_automation_produce_history` (
...
@@ -401,7 +402,7 @@ CREATE TABLE `siger_automation_produce_history` (
`statusid` int(11) NOT NULL DEFAULT 0 COMMENT '设备状态ID',
`statusid` int(11) NOT NULL DEFAULT 0 COMMENT '设备状态ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '产线ID',
`section` int(11) NOT NULL DEFAULT 0 COMMENT '产线ID',
`projectid` int(11) NOT NULL DEFAULT 0,
`projectid` int(11) NOT NULL DEFAULT 0,
`productid` int(1
) NOT NULL DEFAULT 1
COMMENT '产品ID',
`productid` int(1
1) NULL DEFAULT 0
COMMENT '产品ID',
`productcode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品编号',
`productcode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品编号',
`productname` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`productname` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位ID',
`locationid` int(11) NOT NULL DEFAULT 0 COMMENT '储位ID',
...
@@ -432,6 +433,7 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
...
@@ -432,6 +433,7 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
`createtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
`createtime` datetime(0) NULL DEFAULT NULL COMMENT '添加时间',
`updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`updatetime` datetime(0) NULL DEFAULT NULL COMMENT '操作时间',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工令单',
`ordernumber` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '工令单',
`productid` int(11) NULL DEFAULT 0 COMMENT '产品ID',
`productCode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`productCode` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品CODE',
`productName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`productName` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '产品名称',
`locationId` int(11) NOT NULL DEFAULT 0,
`locationId` int(11) NOT NULL DEFAULT 0,
...
...
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