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
cc832d0e
Commit
cc832d0e
authored
Jan 29, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
0a021699
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
16 deletions
+39
-16
AutomationLocationController.cs
.../Siger.ApiACC/Controllers/AutomationLocationController.cs
+3
-2
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+4
-4
FixtureToolsProductController.cs
...Siger.ApiACC/Controllers/FixtureToolsProductController.cs
+6
-6
AutoMES.cs
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
+3
-0
AutomationLocationRepository.cs
...ccRepository/Repositories/AutomationLocationRepository.cs
+13
-3
IAutomationLocationRepository.cs
...y/Repositories/Interface/IAutomationLocationRepository.cs
+1
-1
ResponseAutomationLocation.cs
...ayer.AccRepository/Response/ResponseAutomationLocation.cs
+9
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationLocationController.cs
View file @
cc832d0e
...
...
@@ -355,12 +355,13 @@ namespace Siger.ApiACC.Controllers
/// <summary>
///
/// </summary>
/// <param name="productcode"></param>
/// <param name="fillsn">0:全部 1: 储位有SN</param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
GetLocationList
(
int
fillsn
=
0
)
public
IActionResult
GetLocationList
(
string
productcode
,
int
fillsn
=
0
)
{
return
new
ObjectResult
(
_autoLocationRepository
.
GetDataList
(
ProjectId
,
fillsn
).
ToList
());
return
new
ObjectResult
(
_autoLocationRepository
.
GetDataList
(
ProjectId
,
fillsn
,
productcode
).
ToList
());
}
}
}
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
cc832d0e
...
...
@@ -535,21 +535,21 @@ namespace Siger.ApiACC.Controllers
// return new ObjectResult(CommonEnum.RecordNotFound);
//}
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
location
id
==
unloading
.
locationid
);
var
location
=
_automationLocation
.
Get
(
f
=>
f
.
id
==
unloading
.
locationid
);
if
(
location
==
null
)
{
return
new
ObjectResult
(
CommonEnum
.
RecordNotFound
);
throw
new
BadRequestException
(
CommonEnum
.
RecordNotFound
);
}
if
(
string
.
IsNullOrEmpty
(
location
.
sn
))
{
return
new
ObjectResult
(
AccEnum
.
LocationNoSn
);
throw
new
BadRequestException
(
AccEnum
.
LocationNoSn
);
}
var
levelSection
=
_sigerProjectLevelSection
.
Get
(
f
=>
f
.
id
==
unloading
.
section
);
var
lineMode
=
_automationLine
.
Get
(
f
=>
f
.
section
==
levelSection
.
parentid
);
if
(
lineMode
==
null
)
{
return
new
ObjectResult
(
AccEnum
.
LineModeNotfound
);
throw
new
BadRequestException
(
AccEnum
.
LineModeNotfound
);
}
//TODO
...
...
Server/Apis/Siger.ApiACC/Controllers/FixtureToolsProductController.cs
View file @
cc832d0e
...
...
@@ -135,12 +135,12 @@ namespace Siger.ApiACC.Controllers
{
throw
new
BadRequestException
(
RequestEnum
.
ProductNotFound
);
}
var
data
=
_toolsProductRepository
.
Get
(
q
=>
q
.
projectId
==
ProjectId
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
(
q
.
fixturetools
==
fixtureTool
.
guid
||
q
.
productid
==
req
.
productid
.
ToInt
()));
if
(
data
!=
null
)
{
throw
new
BadRequestException
(
RequestEnum
.
DataExist
);
}
//
var data = _toolsProductRepository.Get(q => q.projectId == ProjectId && q.status == (int)RowState.Valid && (q.fixturetools == fixtureTool.guid ||
//
q.productid == req.productid.ToInt()));
//
if (data != null)
//
{
//
throw new BadRequestException(RequestEnum.DataExist);
//
}
var
entity
=
new
siger_automation_fixture_tools_product
{
...
...
Server/Apis/Siger.ApiACC/Tasks/AutoMES.cs
View file @
cc832d0e
...
...
@@ -37,6 +37,8 @@ namespace Siger.ApiACC.Tasks
var
tasks
=
tasklist
.
OrderBy
(
s
=>
s
.
actiontype
);
var
task
=
tasks
.
FirstOrDefault
();
if
(
task
.
send
==
1
)
return
;
var
levelsction
=
dbhelper
.
GetLevelsection
(
task
.
sectionid
);
if
(
levelsction
==
null
)
return
;
...
...
@@ -56,6 +58,7 @@ namespace Siger.ApiACC.Tasks
Program
=
task
.
programnumber
};
Logger
.
WriteLineError
(
$"TASK 开始下发 :
{
EnumHelper
.
GetEnumDesc
(
task
.
action
)}
"
);
var
result
=
PushTask
(
hostDic
,
sendToPLC
,
out
string
message
);
if
(!
result
)
{
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationLocationRepository.cs
View file @
cc832d0e
...
...
@@ -95,17 +95,20 @@ namespace Siger.Middlelayer.AccRepository.Repositories
return
_context
.
siger_wms_storage_location
.
Where
(
q
=>
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
);
}
public
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
,
int
hasMaterial
)
public
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
,
int
hasMaterial
,
string
productcode
)
{
var
query
=
from
q
in
_context
.
siger_automation_location
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
c
in
_context
.
siger_automation_fixture_tools_category
on
t
.
category
equals
c
.
guid
join
tp
in
_context
.
siger_automation_fixture_tools_product
on
t
.
guid
equals
tp
.
fixturetools
into
tptemp
from
tp
in
tptemp
.
DefaultIfEmpty
()
join
l
in
_context
.
siger_wms_storage_location
on
q
.
location_cid
equals
l
.
id
join
w
in
_context
.
siger_wms_storage
on
l
.
storageid
equals
w
.
id
where
q
.
projectId
==
projectid
&&
q
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponseAutomationLocationList
{
id
=
q
.
id
,
typeid
=
t
.
id
,
fixtureguid
=
t
.
guid
,
locationid
=
l
.
locationid
,
location
=
l
.
realname
,
...
...
@@ -117,14 +120,21 @@ namespace Siger.Middlelayer.AccRepository.Repositories
code
=
t
.
code
,
name
=
t
.
name
,
materialsn
=
q
.
sn
??
""
,
categoryid
=
c
==
null
?
0
:
c
.
id
categoryid
=
c
==
null
?
0
:
c
.
id
,
productcode
=
tp
!=
null
?
tp
.
productcode
:
""
};
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
locationidExpression
=
f
=>
true
;
if
(
hasMaterial
!=
0
)
{
locationidExpression
=
q
=>!
string
.
IsNullOrEmpty
(
q
.
materialsn
);
}
var
entities
=
query
.
Where
(
locationidExpression
).
AsNoTracking
().
ToList
();
Expression
<
Func
<
ResponseAutomationLocationList
,
bool
>>
producExpression
=
f
=>
true
;
if
(!
string
.
IsNullOrEmpty
(
productcode
))
{
producExpression
=
q
=>
q
.
productcode
==
productcode
;
}
var
expression
=
locationidExpression
.
And
(
producExpression
);
var
entities
=
query
.
Where
(
expression
).
GroupBy
(
g
=>
g
.
typeid
).
Select
(
f
=>
f
.
FirstOrDefault
());
return
entities
;
}
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationLocationRepository.cs
View file @
cc832d0e
...
...
@@ -20,7 +20,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
/// <param name="projectid">项目ID</param>
/// <param name="hasMaterial">只查有SN</param>
/// <returns></returns>
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
,
int
hasMaterial
);
IEnumerable
<
ResponseAutomationLocationList
>
GetDataList
(
int
projectid
,
int
hasMaterial
,
string
productcode
);
IEnumerable
<
siger_wms_storage_location
>
GetLocationList
(
int
projectid
);
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseAutomationLocation.cs
View file @
cc832d0e
...
...
@@ -62,6 +62,10 @@ namespace Siger.Middlelayer.AccRepository.Response
{
public
int
id
{
get
;
set
;
}
/// <summary>
/// 工装ID
/// </summary>
public
int
typeid
{
get
;
set
;
}
/// <summary>
/// 储位位置
/// </summary>
public
int
locationid
{
get
;
set
;
}
...
...
@@ -80,11 +84,16 @@ namespace Siger.Middlelayer.AccRepository.Response
/// 工装ID
/// </summary>
public
int
fixturetoolid
{
get
;
set
;
}
/// <summary>
/// 工装GUID
/// </summary>
public
string
fixtureguid
{
get
;
set
;
}
public
string
code
{
get
;
set
;
}
public
string
name
{
get
;
set
;
}
public
string
materialsn
{
get
;
set
;
}
public
int
categoryid
{
get
;
set
;
}
//产品CODE
public
string
productcode
{
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