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
2dc55539
Commit
2dc55539
authored
Feb 03, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
4e7fad66
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
20 deletions
+42
-20
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+1
-3
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+17
-16
AutomationStateController.cs
...pis/Siger.ApiACC/Controllers/AutomationStateController.cs
+24
-1
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
2dc55539
...
@@ -325,11 +325,9 @@ namespace Siger.ApiACC.Controllers
...
@@ -325,11 +325,9 @@ namespace Siger.ApiACC.Controllers
}
}
}
}
if
(
monitor
!=
null
)
if
(
monitor
!=
null
&&
taskObj
.
action
!=
TaskAction
.
Step_SXLW_LK
)
{
{
monitor
.
section
=
0
;
monitor
.
section
=
0
;
}
}
}
}
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
2dc55539
...
@@ -344,10 +344,10 @@ namespace Siger.ApiACC.Controllers
...
@@ -344,10 +344,10 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
MachineBusy
);
throw
new
BadRequestException
(
AccEnum
.
MachineBusy
);
}
}
}
}
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
loading
.
section
))
//
if (!_automationTaskList.CanTask(ProjectId,loading.section))
{
//
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
//
throw new BadRequestException(AccEnum.TaskProcessing);
}
//
}
var
plandts
=
_planDetails
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
OrderNumber
==
loading
.
code
);
var
plandts
=
_planDetails
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
OrderNumber
==
loading
.
code
);
if
(
plandts
==
null
)
if
(
plandts
==
null
)
...
@@ -474,19 +474,21 @@ namespace Siger.ApiACC.Controllers
...
@@ -474,19 +474,21 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
}
//if (machineStatus.status == (int)Automation.MachineStatus.Waiting)
if
(
machineStatus
.
status
==
(
int
)
Automation
.
MachineStatus
.
Waiting
)
//{
// throw new BadRequestException(AccEnum.MachineOnFree);
//}
//if (machineStatus.status == (int)Automation.MachineStatus.Complated)
//{
// throw new BadRequestException(AccEnum.MachineProCompalate);
//}
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
assemble
.
section
))
{
{
throw
new
BadRequestException
(
AccEnum
.
TaskProcessing
);
throw
new
BadRequestException
(
AccEnum
.
MachineOnFree
);
}
if
(
machineStatus
.
status
==
(
int
)
Automation
.
MachineStatus
.
Complated
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineProCompalate
);
}
}
machineStatus
.
status
=
(
int
)
Automation
.
MachineStatus
.
Complated
;
//if (!_automationTaskList.CanTask(ProjectId, assemble.section))
//{
// throw new BadRequestException(AccEnum.TaskProcessing);
//}
//创建 安装完成动作
//创建 安装完成动作
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
if
(
monitor
==
null
)
if
(
monitor
==
null
)
...
@@ -711,7 +713,6 @@ namespace Siger.ApiACC.Controllers
...
@@ -711,7 +713,6 @@ namespace Siger.ApiACC.Controllers
if
(
_unitOfWork
.
Commit
()
>
0
)
if
(
_unitOfWork
.
Commit
()
>
0
)
{
{
Logger
.
WriteLineError
(
$"手动任务-拆卸完成-
{
Siger
.
Middlelayer
.
Common
.
Helpers
.
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_SXLW_LK
)}
"
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
}
else
else
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationStateController.cs
View file @
2dc55539
...
@@ -10,19 +10,23 @@ using Siger.Middlelayer.AccRepository.Response;
...
@@ -10,19 +10,23 @@ using Siger.Middlelayer.AccRepository.Response;
using
Siger.ApiCommon.Result
;
using
Siger.ApiCommon.Result
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Common
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
Siger.Middlelayer.Share.Enum.ModuleEnum
;
using
Siger.Middlelayer.Repository
;
using
Siger.Middlelayer.Log
;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace
Siger.ApiACC.Controllers
namespace
Siger.ApiACC.Controllers
{
{
public
class
AutomationStateController
:
BaseController
public
class
AutomationStateController
:
BaseController
{
{
private
readonly
IUnitOfWork
_unitOfWork
;
private
readonly
ISigerProjectLevelSectionRepository
_sigerProjectLevelSection
;
private
readonly
ISigerProjectLevelSectionRepository
_sigerProjectLevelSection
;
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
public
AutomationStateController
(
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationMachineStatus
automationMachineStatus
,
IAutomationTaskListRepository
automationTaskList
,
IAutomationFixtureMonitor
automationFixtureMonitor
)
public
AutomationStateController
(
I
UnitOfWork
unitOfWork
,
I
SigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationMachineStatus
automationMachineStatus
,
IAutomationTaskListRepository
automationTaskList
,
IAutomationFixtureMonitor
automationFixtureMonitor
)
{
{
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_automationMachineStatus
=
automationMachineStatus
;
_automationMachineStatus
=
automationMachineStatus
;
_automationTaskList
=
automationTaskList
;
_automationTaskList
=
automationTaskList
;
...
@@ -102,5 +106,24 @@ namespace Siger.ApiACC.Controllers
...
@@ -102,5 +106,24 @@ namespace Siger.ApiACC.Controllers
return
new
PagedObjectResult
(
resulst
,
resulst
.
Total
,
page
,
pageSize
);
return
new
PagedObjectResult
(
resulst
,
resulst
.
Total
,
page
,
pageSize
);
}
}
public
IActionResult
DeleteTask
(
int
id
)
{
var
record
=
_automationTaskList
.
Get
(
f
=>
f
.
id
==
id
);
if
(
record
==
null
)
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
_automationTaskList
.
Delete
(
record
);
if
(
_unitOfWork
.
Commit
()
>
0
)
{
Logger
.
WriteLineError
(
$"手动任务创建成功-
{
Siger
.
Middlelayer
.
Common
.
Helpers
.
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_LK_SXLW
)}
"
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
else
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
}
}
}
}
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