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
92b52ceb
Commit
92b52ceb
authored
Mar 13, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
a6972f82
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
4 deletions
+51
-4
AutomationStateController.cs
...pis/Siger.ApiACC/Controllers/AutomationStateController.cs
+46
-1
QmsCheckController.cs
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
+5
-3
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationStateController.cs
View file @
92b52ceb
...
@@ -17,6 +17,8 @@ using Siger.Middlelayer.Common.Helpers;
...
@@ -17,6 +17,8 @@ using Siger.Middlelayer.Common.Helpers;
using
Siger.Middlelayer.Utility.Helpers
;
using
Siger.Middlelayer.Utility.Helpers
;
using
Siger.Middlelayer.Utility.ImportEntities
;
using
Siger.Middlelayer.Utility.ImportEntities
;
using
System.IO
;
using
System.IO
;
using
Siger.Middlelayer.Common.ModuleEnum
;
using
Microsoft.AspNetCore.Mvc.ModelBinding.Validation
;
// 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
...
@@ -28,14 +30,19 @@ namespace Siger.ApiACC.Controllers
...
@@ -28,14 +30,19 @@ namespace Siger.ApiACC.Controllers
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
private
readonly
IAutomationMachineStatus
_automationMachineStatus
;
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
private
readonly
IAutomationTaskListRepository
_automationTaskList
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
private
readonly
IAutomationFixtureMonitor
_automationFixtureMonitor
;
private
readonly
IAutomationLineMode
_automationLineMode
;
private
readonly
IAutomationSectionPropertyRepository
_automationSectionProperty
;
public
AutomationStateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationMachineStatus
automationMachineStatus
,
IAutomationTaskListRepository
automationTaskList
,
IAutomationFixtureMonitor
automationFixtureMonitor
)
public
AutomationStateController
(
IUnitOfWork
unitOfWork
,
ISigerProjectLevelSectionRepository
sigerProjectLevelSection
,
IAutomationMachineStatus
automationMachineStatus
,
IAutomationTaskListRepository
automationTaskList
,
IAutomationFixtureMonitor
automationFixtureMonitor
,
IAutomationLineMode
automationLineMode
,
IAutomationSectionPropertyRepository
automationSectionProperty
)
{
{
_unitOfWork
=
unitOfWork
;
_unitOfWork
=
unitOfWork
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_sigerProjectLevelSection
=
sigerProjectLevelSection
;
_automationMachineStatus
=
automationMachineStatus
;
_automationMachineStatus
=
automationMachineStatus
;
_automationTaskList
=
automationTaskList
;
_automationTaskList
=
automationTaskList
;
_automationFixtureMonitor
=
automationFixtureMonitor
;
_automationFixtureMonitor
=
automationFixtureMonitor
;
_automationLineMode
=
automationLineMode
;
_automationSectionProperty
=
automationSectionProperty
;
}
}
/// <summary>
/// <summary>
...
@@ -194,6 +201,44 @@ namespace Siger.ApiACC.Controllers
...
@@ -194,6 +201,44 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
}
if
(
record
.
send
!=
0
)
{
throw
new
BadRequestException
(
AccEnum
.
TaskIsSend
);
}
var
_property
=
_automationSectionProperty
.
GetList
(
f
=>
f
.
propertytype
==
1
&&
(
f
.
upload
>
0
||
f
.
down
>
0
));
if
(
_property
.
Any
())
{
foreach
(
var
perperty
in
_property
)
{
if
(
perperty
.
upload
>
0
)
{
//重置上料位状态
if
(
record
.
sectionid
==
perperty
.
sectionid
&&
record
.
action
==
Automation
.
TaskAction
.
Step_LK_SXLW
)
{
perperty
.
upload
=
0
;
_automationSectionProperty
.
Update
(
perperty
);
}
}
if
(
perperty
.
down
>
0
)
{
//重置下料位置
//去抽检台
if
(
record
.
extend1
.
ToInt
()==
perperty
.
sectionid
&&
record
.
action
==
Automation
.
TaskAction
.
Step_LK_CJT
)
{
perperty
.
upload
=
0
;
_automationSectionProperty
.
Update
(
perperty
);
}
//去下料位
if
(
record
.
extend1
.
ToInt
()==
perperty
.
sectionid
&&
record
.
action
==
Automation
.
TaskAction
.
Step_LK_SXLW
)
{
perperty
.
upload
=
0
;
_automationSectionProperty
.
Update
(
perperty
);
}
}
}
}
_automationTaskList
.
Delete
(
record
);
_automationTaskList
.
Delete
(
record
);
if
(
_unitOfWork
.
Commit
()
>
0
)
if
(
_unitOfWork
.
Commit
()
>
0
)
...
...
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
View file @
92b52ceb
...
@@ -272,9 +272,10 @@ namespace Siger.ApiACC.Controllers
...
@@ -272,9 +272,10 @@ namespace Siger.ApiACC.Controllers
//{
//{
// return new ObjectResult(CommonEnum.Succefull);
// return new ObjectResult(CommonEnum.Succefull);
//}
//}
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
ProjectId
,
"id"
,
true
).
FirstOrDefault
();
var
lastTask
=
_automationTaskList
.
GetList
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
action
==
TaskAction
.
Step_CJT_SXLW
,
"id"
,
true
).
FirstOrDefault
();
if
(
lastTask
.
extend1
==
section
.
ToStr
()
&&
lastTask
.
action
==
TaskAction
.
Step_CJT_SXLW
&&
lastTask
.
status
!=
(
int
)
TaskResultStatus
.
Complated
)
if
(
lastTask
.
status
!=
(
int
)
TaskResultStatus
.
Complated
)
{
{
Logger
.
WriteLineError
(
$"重复检验提交数据,无需创建Task任务"
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
}
...
@@ -283,6 +284,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -283,6 +284,7 @@ namespace Siger.ApiACC.Controllers
{
{
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
throw
new
BadRequestException
(
CommonEnum
.
Fail
);
}
}
inspection
.
workorder
=
tasklist
.
ordercode
;
inspection
.
workorder
=
tasklist
.
ordercode
;
CreateTaskList
(
tasklist
,
req
.
sectionid
,
req
.
productid
,
product
.
code
,
req
.
sn
,
req
.
routeid
.
ToInt
());
CreateTaskList
(
tasklist
,
req
.
sectionid
,
req
.
productid
,
product
.
code
,
req
.
sn
,
req
.
routeid
.
ToInt
());
AddSnList
(
req
.
materialid
.
ToInt
(),
inspection
,
product
.
code
,
section
.
parentid
);
//把二维码插入到 sn_list表
AddSnList
(
req
.
materialid
.
ToInt
(),
inspection
,
product
.
code
,
section
.
parentid
);
//把二维码插入到 sn_list表
...
@@ -353,7 +355,7 @@ namespace Siger.ApiACC.Controllers
...
@@ -353,7 +355,7 @@ namespace Siger.ApiACC.Controllers
action
=
Automation
.
TaskAction
.
Step_CJT_SXLW
,
action
=
Automation
.
TaskAction
.
Step_CJT_SXLW
,
actiontype
=
Automation
.
ExcueType
.
None
,
actiontype
=
Automation
.
ExcueType
.
None
,
triggertime
=
DateTime
.
Now
,
triggertime
=
DateTime
.
Now
,
tasktype
=
Automation
.
TaskActionType
.
Unload
,
tasktype
=
TaskActionType
.
Unload
,
operater
=
UserId
,
operater
=
UserId
,
operatetime
=
DateTime
.
Now
,
operatetime
=
DateTime
.
Now
,
sectionid
=
tasklist
.
extend1
.
ToInt
(),
sectionid
=
tasklist
.
extend1
.
ToInt
(),
...
...
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