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
0e9077ae
Commit
0e9077ae
authored
Jan 22, 2021
by
jiawei.su
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
someupdate
parent
14b8e12a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
8 deletions
+91
-8
AutomationOperateController.cs
...s/Siger.ApiACC/Controllers/AutomationOperateController.cs
+37
-7
siger_automation_fixture_tools_monitor.cs
...sitory/Entities/siger_automation_fixture_tools_monitor.cs
+7
-0
AutomationFixtureToolsProductRepository.cs
...y/Repositories/AutomationFixtureToolsProductRepository.cs
+21
-1
IAutomationFixtureToolsProductRepository.cs
...ies/Interface/IAutomationFixtureToolsProductRepository.cs
+8
-0
ResponseProductFixtureInfo.cs
...ayer.AccRepository/Response/ResponseProductFixtureInfo.cs
+14
-0
DB.script
Server/Infrastructure/Script/DB.script
+4
-0
No files found.
Server/Apis/Siger.ApiACC/Controllers/AutomationOperateController.cs
View file @
0e9077ae
...
...
@@ -135,15 +135,38 @@ namespace Siger.ApiACC.Controllers
[
HttpGet
]
public
IActionResult
GetLoadingState
(
int
section
)
{
var
data
=
new
ResponseAutomationInfo
var
monitor
=
_automationFixtureMonitor
.
Get
(
f
=>
f
.
section
==
section
);
var
result
=
new
ResponsePlanlFixtureInfo
{
sn
=
"sn0001"
,
wo
=
"wo123123"
OrderNumber
=
monitor
.
ordernumber
,
ProductCode
=
monitor
.
productCode
,
ProductName
=
monitor
.
productName
,
Sn
=
monitor
.
sn
,
status
=
monitor
.
status
,
Location
=
monitor
.
locationId
,
};
return
new
ObjectResult
(
data
);
return
new
ObjectResult
(
result
);
}
/// <summary>
/// 扫描
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[
HttpGet
]
public
IActionResult
ScanCode
(
string
code
)
{
var
result
=
_automationFixtureToolsProduct
.
GetPlanFixtureInfo
(
ProjectId
,
code
);
if
(
result
==
null
)
{
throw
new
BadRequestException
(
CncEnum
.
PlanHasExist
);
}
var
sn
=
_automationTaskList
.
CreateRandonSn
(
result
.
ProductCode
);
result
.
Sn
=
sn
;
return
new
ObjectResult
(
result
);
}
/// <summary>
/// 准备上料 -生成指令
/// 准备上料 -生成指令
load
/// </summary>
/// <param name="loading"></param>
/// <returns></returns>
...
...
@@ -231,7 +254,10 @@ namespace Siger.ApiACC.Controllers
createtime
=
DateTime
.
Now
,
updatetime
=
DateTime
.
Now
,
status
=(
int
)
Automation
.
MachineStatus
.
Produce
,
productCode
=
plan
.
product_code
,
productName
=
plan
.
product_name
,
ordernumber
=
plandts
.
OrderNumber
,
locationId
=
fixtureToolsObj
.
Location
});
}
else
...
...
@@ -240,6 +266,10 @@ namespace Siger.ApiACC.Controllers
monitor
.
section
=
loading
.
section
;
monitor
.
updatetime
=
DateTime
.
Now
;
monitor
.
status
=
(
int
)
Automation
.
MachineStatus
.
Produce
;
monitor
.
productName
=
plan
.
product_name
;
monitor
.
productCode
=
plan
.
product_code
;
monitor
.
ordernumber
=
plandts
.
OrderNumber
;
monitor
.
locationId
=
fixtureToolsObj
.
Location
;
_automationFixtureMonitor
.
Update
(
monitor
);
}
...
...
@@ -251,7 +281,7 @@ namespace Siger.ApiACC.Controllers
}
/// <summary>
/// 安装完成 -生成指令
/// 安装完成 -生成指令
unload
/// </summary>
/// <param name="assemble"></param>
/// <returns></returns>
...
...
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Entities/siger_automation_fixture_tools_monitor.cs
View file @
0e9077ae
...
...
@@ -34,5 +34,12 @@ namespace Siger.Middlelayer.AccRepository.Entities
/// 更新时间
/// </summary>
public
DateTime
updatetime
{
get
;
set
;
}
public
string
ordernumber
{
get
;
set
;
}
/// <summary>
///
/// </summary>
public
string
productCode
{
get
;
set
;
}
public
string
productName
{
get
;
set
;
}
public
int
locationId
{
get
;
set
;
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/AutomationFixtureToolsProductRepository.cs
View file @
0e9077ae
...
...
@@ -31,7 +31,7 @@ namespace Siger.Middlelayer.AccRepository.Repositories
FixtureId
=
t
.
id
,
FixtureGuid
=
t
.
guid
,
ProductCode
=
q
.
productcode
,
Location
=
l
.
locationid
.
ToString
()
,
Location
=
l
.
locationid
,
};
return
query
.
FirstOrDefault
();
}
...
...
@@ -83,5 +83,25 @@ namespace Siger.Middlelayer.AccRepository.Repositories
var
totalCount
=
query
.
Where
(
expression
).
Count
();
return
new
PagedCollectionResult
<
ResponseAumationFixtureToolsProduct
>(
entities
,
totalCount
);
}
public
ResponsePlanlFixtureInfo
GetPlanFixtureInfo
(
int
projectId
,
string
ordernumber
)
{
var
query
=
from
d
in
_context
.
siger_project_product_plan_detail
join
p
in
_context
.
siger_project_product_plan
on
d
.
PlanId
equals
p
.
id
join
q
in
_context
.
siger_automation_fixture_tools_product
on
p
.
product_code
equals
q
.
productcode
join
t
in
_context
.
siger_automation_fixture_tools
on
q
.
fixturetools
equals
t
.
guid
join
l
in
_context
.
siger_automation_location
on
t
.
guid
equals
l
.
fixturetools
where
q
.
projectId
==
projectId
&&
d
.
OrderNumber
==
ordernumber
&&
q
.
status
==
(
int
)
RowState
.
Valid
&&
t
.
status
==
(
int
)
RowState
.
Valid
select
new
ResponsePlanlFixtureInfo
{
OrderNumber
=
ordernumber
,
ProductName
=
p
.
product_name
,
ProductCode
=
q
.
productcode
,
Location
=
l
.
locationid
,
};
return
query
.
FirstOrDefault
();
}
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Repositories/Interface/IAutomationFixtureToolsProductRepository.cs
View file @
0e9077ae
...
...
@@ -11,5 +11,13 @@ namespace Siger.Middlelayer.AccRepository.Repositories.Interface
ResponseProductFixtureInfo
GetFixtureInfoByProductCode
(
int
projectId
,
string
productCode
);
/// <summary>
/// 工令单获取 工装信息
/// </summary>
/// <param name="ordernumber"></param>
/// <returns></returns>
ResponsePlanlFixtureInfo
GetPlanFixtureInfo
(
int
projectId
,
string
ordernumber
);
}
}
Server/Infrastructure/Repositories/Siger.Middlelayer.AccRepository/Response/ResponseProductFixtureInfo.cs
View file @
0e9077ae
...
...
@@ -23,4 +23,18 @@ namespace Siger.Middlelayer.AccRepository.Response
/// </summary>
public
int
Location
{
get
;
set
;
}
}
public
class
ResponsePlanlFixtureInfo
{
/// <summary>
/// 工令单号
/// </summary>
public
string
OrderNumber
{
get
;
set
;
}
public
string
ProductCode
{
get
;
set
;
}
public
string
ProductName
{
get
;
set
;
}
public
int
status
{
get
;
set
;
}
public
int
Location
{
get
;
set
;
}
public
string
Sn
{
get
;
set
;
}
}
}
Server/Infrastructure/Script/DB.script
View file @
0e9077ae
...
...
@@ -423,6 +423,10 @@ CREATE TABLE `siger_automation_fixture_tools_moniter` (
`routedesc` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '当前工序',
`createtime` 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 '工令单',
`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 '产品名称',
`locationId` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
...
...
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