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
b2984210
Commit
b2984210
authored
Feb 06, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
2da17f65
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
99 deletions
+24
-99
AutomationController.cs
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
+0
-0
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+6
-93
AutomationStateController.cs
...pis/Siger.ApiACC/Controllers/AutomationStateController.cs
+2
-0
QmsCheckController.cs
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
+9
-2
ApiAccDbContext.cs
...tories/Siger.Middlelayer.AccRepository/ApiAccDbContext.cs
+2
-0
AutomationTaskListRepository.cs
...ccRepository/Repositories/AutomationTaskListRepository.cs
+4
-4
ResponseAutomationMachineStatus.cs
...AccRepository/Response/ResponseAutomationMachineStatus.cs
+1
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationController.cs
View file @
b2984210
This diff is collapsed.
Click to expand it.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
b2984210
...
...
@@ -333,7 +333,10 @@ namespace Siger.ApiACC.Controllers
updatetime
=
DateTime
.
Now
});
}
if
(
machineStatus
.
status
!=(
int
)
Automation
.
MachineStatus
.
Waiting
)
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
var
plandts
=
_planDetails
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
OrderNumber
==
loading
.
code
);
if
(
plandts
==
null
)
{
...
...
@@ -401,47 +404,6 @@ namespace Siger.ApiACC.Controllers
});
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
{
fixtureguid
=
fixtureToolsObj
.
FixtureGuid
,
fixturename
=
fixtureToolsObj
.
FixtureCode
,
projectId
=
ProjectId
,
section
=
loading
.
section
,
sn
=
sn
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
,
productId
=
plan
.
product_id
,
productCode
=
plan
.
product_code
,
productName
=
plan
.
product_name
,
ordernumber
=
plandts
.
OrderNumber
,
locationId
=
fixtureToolsObj
.
Location
,
unixtime
=
unixtime
,
route
=
route
.
id
,
taskno
=
taskNo
});
}
else
{
monitor
.
sn
=
sn
;
monitor
.
section
=
loading
.
section
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
productId
=
plan
.
product_id
;
monitor
.
productName
=
plan
.
product_name
;
monitor
.
productCode
=
plan
.
product_code
;
monitor
.
ordernumber
=
plandts
.
OrderNumber
;
monitor
.
locationId
=
fixtureToolsObj
.
Location
;
monitor
.
unixtime
=
unixtime
;
monitor
.
route
=
route
.
id
;
monitor
.
taskno
=
taskNo
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
{
Logger
.
WriteLineError
(
$"准备上料任务:
{
taskNo
}
创建成功-
{
EnumHelper
.
GetEnumDesc
(
Automation
.
TaskAction
.
Step_LK_SXLW
)}
"
);
...
...
@@ -471,11 +433,6 @@ namespace Siger.ApiACC.Controllers
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
if
(
machineStatus
.
auto
==
0
)
{
machineStatus
.
status
=
(
int
)
Automation
.
MachineStatus
.
Waiting
;
}
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
projectId
==
ProjectId
&&
f
.
section
==
assemble
.
section
);
if
(
monitor
==
null
)
{
...
...
@@ -607,45 +564,9 @@ namespace Siger.ApiACC.Controllers
processid
=
0
,
programnumber
=
""
,
remark
=
lineMode
.
inspect
==
1
?
"准备下料-》抽检台"
:
"准备下料"
,
extend1
=
unixtime
.
ToStr
()
extend1
=
section
.
ToStr
()
});
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
if
(
monitor
==
null
)
{
_automationFixtureMonitor
.
Insert
(
new
siger_automation_fixture_tools_monitor
{
fixtureguid
=
location
.
fixturetools
,
fixturename
=
location
.
fixturename
,
projectId
=
ProjectId
,
section
=
section
,
sn
=
location
.
sn
,
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
,
productId
=
location
.
productid
,
productCode
=
location
.
productcode
,
productName
=
location
.
productname
,
ordernumber
=
location
.
ordernumber
,
locationId
=
location
.
locationid
,
unixtime
=
unixtime
,
taskno
=
taskNo
});
}
else
{
monitor
.
sn
=
location
.
sn
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
productId
=
location
.
productid
;
monitor
.
productName
=
location
.
productname
;
monitor
.
productCode
=
location
.
productcode
;
monitor
.
ordernumber
=
location
.
ordernumber
;
monitor
.
locationId
=
location
.
locationid
;
monitor
.
unixtime
=
unixtime
;
monitor
.
taskno
=
taskNo
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
if
(
_unitOfWork
.
Commit
()
>
0
)
{
...
...
@@ -681,19 +602,11 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
AccEnum
.
MachineDisable
);
}
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
monitor
.
locationId
);
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
location
id
==
monitor
.
locationId
);
if
(
location
==
null
)
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
string
.
IsNullOrEmpty
(
location
.
sn
))
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
location
.
status
==
(
int
)
LocationStatus
.
Out
)
{
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
if
(
location
!=
null
)
{
...
...
Server/Apis/Siger.ApiACC/Controllers/AutomationStateController.cs
View file @
b2984210
...
...
@@ -126,6 +126,7 @@ namespace Siger.ApiACC.Controllers
}
var
dataList
=
new
List
<
AutomationStateList
>();
foreach
(
var
item
in
data
)
{
var
model
=
Mapper
<
ResponseAutomationTasklist
,
AutomationStateList
>.
Map
(
item
);
...
...
@@ -147,6 +148,7 @@ namespace Siger.ApiACC.Controllers
model
.
status_value
=
""
;
break
;
}
dataList
.
Add
(
model
);
}
if
(
dataList
.
Any
())
...
...
Server/Apis/Siger.ApiACC/Controllers/QmsCheckController.cs
View file @
b2984210
...
...
@@ -266,7 +266,11 @@ namespace Siger.ApiACC.Controllers
{
try
{
//还有未完成任务 退出 等待任务下发
if
(!
_automationTaskList
.
CanTask
(
ProjectId
,
req
.
sectionid
))
{
return
new
ObjectResult
(
CommonEnum
.
Succefull
);
}
CreateTaskList
(
req
.
sectionid
,
req
.
productid
,
product
.
code
,
req
.
sn
,
req
.
routeid
.
ToInt
());
AddSnList
(
req
.
materialid
.
ToInt
(),
inspection
,
product
.
code
,
section
.
parentid
);
//把二维码插入到 sn_list表
}
...
...
@@ -325,6 +329,7 @@ namespace Siger.ApiACC.Controllers
private
void
CreateTaskList
(
int
section
,
int
productid
,
string
productcode
,
string
sn
,
int
routeid
)
{
var
monitor
=
_fixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
if
(
monitor
==
null
)
{
...
...
@@ -356,7 +361,9 @@ namespace Siger.ApiACC.Controllers
projectId
=
ProjectId
,
productid
=
productid
,
sn
=
sn
,
ordercode
=
""
,
ordercode
=
monitor
.
ordernumber
,
fixturename
=
monitor
.
fixturename
,
productname
=
monitor
.
productName
,
fixtureguid
=
monitor
.
fixtureguid
,
locationid
=
monitor
.
locationId
,
productcode
=
productcode
,
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/ApiAccDbContext.cs
View file @
b2984210
...
...
@@ -171,5 +171,7 @@ namespace Siger.Middlelayer.AccRepository
public
DbSet
<
siger_check_sn_trace_inspection
>
siger_check_sn_trace_inspection
{
get
;
set
;
}
public
DbSet
<
siger_check_sn_trace_detail
>
siger_check_sn_trace_detail
{
get
;
set
;
}
public
DbSet
<
siger_check_sn_list
>
siger_check_sn_list
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationTaskListRepository.cs
View file @
b2984210
...
...
@@ -110,7 +110,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
complatevalue
=
q
.
completetime
,
complatetime
=
q
.
completetime
==
DateTime
.
MinValue
?
""
:
q
.
completetime
.
ToString
(),
action
=
EnumHelper
.
GetEnumDesc
(
q
.
action
),
actionType
=
EnumHelper
.
GetEnumDesc
(
q
.
actiontype
),
actionType
=
EnumHelper
.
GetEnumDesc
(
q
.
actiontype
),
fixtureCode
=
t
.
code
,
fixtureName
=
t
.
name
,
location
=
q
.
locationid
.
ToString
(),
...
...
@@ -178,12 +178,12 @@ namespace Siger.Middlelayer.AccRepository.Repositories
if
(
toexcel
.
ToInt
()
==
1
)
{
var
entities
=
query
.
Where
(
expression
).
AsNoTracking
().
ToList
();
return
new
PagedCollectionResult
<
ResponseAutomationTasklist
>(
entities
,
entities
.
Count
);
var
entities
=
query
.
Where
(
expression
).
OrderByDescending
(
d
=>
d
.
id
).
AsNoTracking
();
return
new
PagedCollectionResult
<
ResponseAutomationTasklist
>(
entities
,
entities
.
Count
()
);
}
else
{
var
entities
=
query
.
Where
(
expression
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
AsNoTracking
().
ToList
();
var
entities
=
query
.
Where
(
expression
).
Skip
((
page
-
1
)
*
pagesize
).
Take
(
pagesize
).
OrderByDescending
(
d
=>
d
.
id
).
AsNoTracking
();
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseAutomationTasklist
>(
entities
,
totalCount
);
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationMachineStatus.cs
View file @
b2984210
...
...
@@ -6,6 +6,7 @@ namespace Siger.Middlelayer.AccRepository.Response
{
public
class
ResponseAutomationMachineStatus
{
public
int
id
{
get
;
set
;
}
public
int
sectionid
{
get
;
set
;
}
public
string
section
{
get
;
set
;
}
// public string machine { 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