Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ef49ca01
由
LN
编写于
2023-02-20 10:57:17 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1053修改:1.outbox的任务显示问题。2.获取任务数量接口修改
1 个父辈
48dd6f0e
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
19 行增加
和
30 行删除
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronServiceController.java → src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
查看文件 @
ef49ca0
...
@@ -417,7 +417,7 @@ public class DataLog extends BasePo implements Serializable {
...
@@ -417,7 +417,7 @@ public class DataLog extends BasePo implements Serializable {
* 判断任务是否异常,执行中,且10分钟未更新的认为异常
* 判断任务是否异常,执行中,且10分钟未更新的认为异常
*/
*/
public
boolean
isAbnormal
(){
public
boolean
isAbnormal
(){
if
(
isExecuting
()
||
isInLine
()||
isInRobot
()||
isBoxdoor
()
){
if
(
isExecuting
()
||
isInLine
()||
isInRobot
()||
isBoxdoor
()
||
isOutBox
()
){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>
10
*
60
*
1000
){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>
10
*
60
*
1000
){
return
true
;
return
true
;
}
}
...
@@ -428,7 +428,7 @@ public class DataLog extends BasePo implements Serializable {
...
@@ -428,7 +428,7 @@ public class DataLog extends BasePo implements Serializable {
* 是否正常执行中,执行中,且10分钟内有更新
* 是否正常执行中,执行中,且10分钟内有更新
*/
*/
public
boolean
isNormal
(){
public
boolean
isNormal
(){
if
(
isExecuting
()
||
isInLine
()||
isInRobot
()||
isBoxdoor
()
){
if
(
isExecuting
()
||
isInLine
()||
isInRobot
()||
isBoxdoor
()
||
isOutBox
()
){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
<=
10
*
60
*
1000
){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
<=
10
*
60
*
1000
){
return
true
;
return
true
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/Micron
Ser
viceController.java
→
src/main/java/com/neotel/smfcore/custom/micron1053/controller/Micron
De
viceController.java
查看文件 @
ef49ca0
...
@@ -14,13 +14,15 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,13 +14,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Slf4j
@RestController
@RestController
@Api
(
tags
=
"1053:设备端接口"
)
@Api
(
tags
=
"1053:设备端接口"
)
@RequestMapping
(
"/rest/micron/
ser
vice"
)
@RequestMapping
(
"/rest/micron/
de
vice"
)
public
class
Micron
Ser
viceController
{
public
class
Micron
De
viceController
{
@Autowired
@Autowired
private
TaskService
taskService
;
private
TaskService
taskService
;
...
@@ -44,38 +46,25 @@ public class MicronServiceController {
...
@@ -44,38 +46,25 @@ public class MicronServiceController {
}
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
" 获取
治具任务数量,料盘
任务数量 "
)
@ApiOperation
(
" 获取任务数量 "
)
@PostMapping
(
value
=
"/getTaskCount"
)
@PostMapping
(
value
=
"/getTaskCount"
)
@ResponseBody
@ResponseBody
@AnonymousAccess
@AnonymousAccess
public
ResultBean
getTaskCount
(
HttpServletRequest
request
)
{
public
ResultBean
getTaskCount
(
HttpServletRequest
request
)
{
String
type
=
request
.
getParameter
(
"type"
);
// String type = request.getParameter("type");
int
count
=
0
;
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
for
(
DataLog
task
:
dataLogs
)
{
String
taskType
=
MicronDataCache
.
GetMaterialType
(
task
);
if
(
taskType
.
toLowerCase
().
equals
(
type
.
toLowerCase
())){
count
++;
}
}
//SBSH1,SBSH2,SBDH1-1,SBDH1-2,SBDH2-1.SBDH2-2这些都是Pizza box,对应的料架是M01开头的,每个料架可以放5盘料
//SBDH3-1里面有pcb,对应的料架是M02开头,每个料架可以放5盘料。
// tray对应的料架是M03开头,每个料架可以放4盘料,
// 还有reel料盘尺寸是13*44,13*56,13*72
//SBDH3-2里面是pcb物料
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
// String[] types=new String[]{"pizzaBox","pcb","tray","reel"};
Map
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
// 310*80是PCB
// 330*120是tray
// 13*72的入13*44,13*56,13*72的料盘
//pizzaBox (料架M01,每个料架5盘) SBSH1,SBSH2,SBDH1-1,SBDH1-2,SBDH2-1.SBDH2-2
for
(
DataLog
task
:
dataLogs
//pcb (料架M02,每个料架5盘) SBDH3-2,SBDH3-1部分
)
{
//tray (料架M03,每个料架4盘) SBDH3-1 里
String
taskType
=
MicronDataCache
.
GetMaterialType
(
task
);
//reel (料架M01,每个料架5盘) SBDH3-1 13*44,13*56,13*72
int
count
=
resultMap
.
getOrDefault
(
taskType
,
0
)
+
1
;
resultMap
.
put
(
taskType
,
count
);
return
ResultBean
.
newOkResult
(
count
);
}
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
查看文件 @
ef49ca0
...
@@ -84,7 +84,7 @@ public class MicronDataCache {
...
@@ -84,7 +84,7 @@ public class MicronDataCache {
//reel (料架M01,每个料架5盘) SBDH3-1 13*44,13*56,13*72
//reel (料架M01,每个料架5盘) SBDH3-1 13*44,13*56,13*72
}
}
public
static
String
GetMaterialType
(
DataLog
dataLog
){
public
static
String
GetMaterialType
(
DataLog
dataLog
){
return
REEL
;
return
GetMaterialType
(
dataLog
.
getCid
(),
dataLog
.
getStorageId
(),
dataLog
.
getW
(),
dataLog
.
getH
())
;
}
}
public
static
String
getShelfType
(
String
materialType
){
public
static
String
getShelfType
(
String
materialType
){
if
(
materialType
.
equals
(
PIZZABOX
)){
if
(
materialType
.
equals
(
PIZZABOX
)){
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论