Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 04c3bd32
由
LN
编写于
2023-06-12 09:38:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
修改:1.增加重新获取库位号接口。2.温湿度报表增加过滤。
1 个父辈
56bc8e1e
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
136 行增加
和
1 行删除
src/main/java/com/neotel/smfcore/core/PageConfig.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/core/humiture/rest/HumitureController.java
src/main/java/com/neotel/smfcore/core/humiture/rest/bean/dto/HumitureDto.java
src/main/java/com/neotel/smfcore/core/humiture/rest/bean/query/HumitureQueryCriteria.java
src/main/java/com/neotel/smfcore/core/PageConfig.java
0 → 100644
查看文件 @
04c3bd3
package
com
.
neotel
.
smfcore
.
core
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.data.web.PageableHandlerMethodArgumentResolver
;
import
org.springframework.web.method.support.HandlerMethodArgumentResolver
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
import
java.util.List
;
@Configuration
public
class
PageConfig
extends
WebMvcConfigurerAdapter
{
private
static
final
int
PMP_MAX_PAGE_SIZE
=
20000
;
@Override
public
void
addArgumentResolvers
(
List
<
HandlerMethodArgumentResolver
>
argumentResolvers
)
{
PageableHandlerMethodArgumentResolver
resolver
=
new
PageableHandlerMethodArgumentResolver
();
resolver
.
setMaxPageSize
(
PMP_MAX_PAGE_SIZE
);
argumentResolvers
.
add
(
resolver
);
super
.
addArgumentResolvers
(
argumentResolvers
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
04c3bd3
...
@@ -7,6 +7,7 @@ import com.google.common.collect.Maps;
...
@@ -7,6 +7,7 @@ import com.google.common.collect.Maps;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
...
@@ -268,6 +269,33 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -268,6 +269,33 @@ public class RobotBoxHandler extends BaseDeviceHandler {
return
statusBean
;
return
statusBean
;
}
}
@ApiOperation
(
"第二次重新获取新入库库位"
)
@PostMapping
(
value
=
"/service/store/robotBox/renewPosForPutin"
)
@ResponseBody
@AnonymousAccess
public
Map
<
String
,
Object
>
renewPosForPutin
(
HttpServletRequest
request
)
{
//返回:97=已有入库任务,需继续执行入库动作
//返回:98=已有出库任务,需继续执行出库动作
//返回:99=所在料仓有出库任务,暂停入库
//返回:100=系统更新中,暂停出入库
//返回:104=未找到可用的仓位
//返回 105=查找空库位失败
//返回 106=唯一码已有入库任务
//返回 107=物料已过期,无法入库
//返回108=已有待完成的出入库任务,直接NG
String
code
=
request
.
getParameter
(
"code"
);
String
cids
=
request
.
getParameter
(
"cids"
);
String
preCid
=
request
.
getParameter
(
"preCid"
);
log
.
info
(
" renewPosForPutin 流水线["
+
cids
+
"]重新获取["
+
code
+
"]的入库库位, 需要排除上个料仓,cid=["
+
preCid
+
"],并取消入库任务"
);
return
posForPutin
(
code
,
cids
,
preCid
);
}
@ApiOperation
(
"扫码后获取库位号"
)
@ApiOperation
(
"扫码后获取库位号"
)
@PostMapping
(
value
=
"/service/store/robotBox/emptyPosForPutin"
)
@PostMapping
(
value
=
"/service/store/robotBox/emptyPosForPutin"
)
@ResponseBody
@ResponseBody
...
@@ -291,6 +319,15 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -291,6 +319,15 @@ public class RobotBoxHandler extends BaseDeviceHandler {
String
lastPosId
=
""
;
String
lastPosId
=
""
;
String
lineMsg
=
""
;
String
lineMsg
=
""
;
log
.
info
(
"流水线["
+
cids
+
"]获取["
+
code
+
"]的入库库位"
);
log
.
info
(
"流水线["
+
cids
+
"]获取["
+
code
+
"]的入库库位"
);
return
posForPutin
(
code
,
cids
,
""
);
}
public
Map
<
String
,
Object
>
posForPutin
(
String
code
,
String
cids
,
String
preCid
){
log
.
info
(
"posForPutin,code=["
+
code
+
"],cids=["
+
cids
+
"],preCid=["
+
preCid
+
"]"
);
String
lastPosId
=
""
;
String
lineMsg
=
""
;
Map
<
String
,
Object
>
resultMap
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
resultMap
=
Maps
.
newHashMap
();
if
(
dataCache
.
getCache
(
Constants
.
CACHE_StopOut
))
{
if
(
dataCache
.
getCache
(
Constants
.
CACHE_StopOut
))
{
// lineMsg = "系统更新中,暂停出入库";
// lineMsg = "系统更新中,暂停出入库";
...
@@ -321,8 +358,15 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -321,8 +358,15 @@ public class RobotBoxHandler extends BaseDeviceHandler {
continue
;
continue
;
}
}
}
}
if
(
ObjectUtil
.
isNotEmpty
(
preCid
))
{
if
(
cid
.
equals
(
preCid
))
{
log
.
info
(
"料仓["
+
cid
+
"]是上个入库料仓,排除此料仓"
);
}
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
!=
null
)
{
if
(
storage
!=
null
)
{
storageList
.
add
(
storage
);
storageList
.
add
(
storage
);
}
}
}
}
...
@@ -345,6 +389,31 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -345,6 +389,31 @@ public class RobotBoxHandler extends BaseDeviceHandler {
return
resultMap
;
return
resultMap
;
}
}
try
{
if
(
ObjectUtil
.
isNotEmpty
(
preCid
))
{
log
.
info
(
"preCid="
+
preCid
+
",["
+
barcode
.
getBarcode
()+
"]开始取消上个入库任务"
);
Collection
<
DataLog
>
tasks
=
taskService
.
getAllTasks
();
for
(
DataLog
task
:
tasks
)
{
if
(
task
.
isFinished
()
||
task
.
isCancel
())
{
continue
;
}
if
(
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
if
(
task
.
isPutInTask
())
{
boolean
cancelResult
=
taskService
.
cancelTask
(
task
.
getId
());
log
.
info
(
"renewPosForPutin 重新获取库位号时,取消["
+
barcode
.
getBarcode
()
+
"]上个入库任务["
+
task
.
getPosName
()
+
"-"
+
task
.
getCid
()
+
"]结果:"
+
cancelResult
);
}
}
}
log
.
info
(
"preCid="
+
preCid
+
",["
+
barcode
.
getBarcode
()+
"]清除锁定库位"
);
ReelLockPosUtil
.
removeReelLockPosInfo
(
barcode
.
getBarcode
());
}
}
catch
(
Exception
e
)
{
log
.
error
(
"取消上个入库任务出错:"
+
e
.
toString
());
}
for
(
DataLog
dataLog
:
taskService
.
getQueueTasks
())
{
for
(
DataLog
dataLog
:
taskService
.
getQueueTasks
())
{
//已取消或已完成的任务不返回
//已取消或已完成的任务不返回
if
(
dataLog
.
isFinished
()||
dataLog
.
isCancel
()){
if
(
dataLog
.
isFinished
()||
dataLog
.
isCancel
()){
...
@@ -399,6 +468,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -399,6 +468,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
boolean
smallReel
=
barcode
.
isSmallReel
();
boolean
smallReel
=
barcode
.
isSmallReel
();
resultMap
.
put
(
"smallReel"
,
smallReel
+
""
);
resultMap
.
put
(
"smallReel"
,
smallReel
+
""
);
resultMap
.
put
(
"taskId"
,
dataLog
.
getId
());
resultMap
.
put
(
"taskId"
,
dataLog
.
getId
());
resultMap
.
put
(
"cid"
,
dataLog
.
getCid
());
log
.
info
(
"条码["
+
dataLog
.
getBarcode
()
+
"]已有出库任务["
+
dataLog
.
getPosName
()+
"],需继续执行出库动作"
);
log
.
info
(
"条码["
+
dataLog
.
getBarcode
()
+
"]已有出库任务["
+
dataLog
.
getPosName
()+
"],需继续执行出库动作"
);
return
resultMap
;
return
resultMap
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/humiture/rest/HumitureController.java
查看文件 @
04c3bd3
...
@@ -66,6 +66,19 @@ public class HumitureController {
...
@@ -66,6 +66,19 @@ public class HumitureController {
}
}
PageData
<
Humiture
>
humitureList
=
humitureManager
.
findByPage
(
query
,
pageable
);
PageData
<
Humiture
>
humitureList
=
humitureManager
.
findByPage
(
query
,
pageable
);
HumitureDto
restultDto
=
new
HumitureDto
();
HumitureDto
restultDto
=
new
HumitureDto
();
if
(
humitureList
.
getContent
().
size
()>=
pageable
.
getPageSize
())
{
restultDto
.
setHasNextPage
(
true
);
}
else
{
restultDto
.
setHasNextPage
(
false
);
}
if
(
criteria
.
isChart
())
{
//需要过滤
List
<
Humiture
>
newList
=
filteringData
(
humitureList
.
getContent
());
int
totalCount
=
humitureList
.
getTotalElements
();
humitureList
=
new
PageData
<
Humiture
>(
newList
,
totalCount
);
}
restultDto
.
setMaxHumidity
(
maxHumidity
);
restultDto
.
setMaxHumidity
(
maxHumidity
);
restultDto
.
setMinTemperature
(
minTemperature
);
restultDto
.
setMinTemperature
(
minTemperature
);
restultDto
.
setMaxTemperature
(
maxTemperature
);
restultDto
.
setMaxTemperature
(
maxTemperature
);
...
@@ -74,6 +87,30 @@ public class HumitureController {
...
@@ -74,6 +87,30 @@ public class HumitureController {
return
restultDto
;
return
restultDto
;
}
}
private
List
<
Humiture
>
filteringData
(
List
<
Humiture
>
sList
){
//key=时间,value=设备列表,
Map
<
String
,
List
<
String
>>
dataMap
=
new
HashMap
<>();
List
<
Humiture
>
humitures
=
new
ArrayList
<>();
for
(
Humiture
humiture
:
sList
)
{
String
time
=
DateUtil
.
toDateString
(
humiture
.
getCreateDate
(),
"yyyyMMdd HH"
);
List
<
String
>
cidList
=
dataMap
.
get
(
time
);
if
(
cidList
==
null
){
cidList
=
new
ArrayList
<>();
}
if
(
cidList
.
contains
(
humiture
.
getCid
())){
continue
;
}
cidList
.
add
(
humiture
.
getCid
());
dataMap
.
put
(
time
,
cidList
);
humitures
.
add
(
humiture
);
}
return
humitures
;
}
@ApiOperation
(
"导出温湿度列表"
)
@ApiOperation
(
"导出温湿度列表"
)
@GetMapping
(
value
=
"api/humiture/list/download"
)
@GetMapping
(
value
=
"api/humiture/list/download"
)
...
...
src/main/java/com/neotel/smfcore/core/humiture/rest/bean/dto/HumitureDto.java
查看文件 @
04c3bd3
...
@@ -31,4 +31,8 @@ public class HumitureDto {
...
@@ -31,4 +31,8 @@ public class HumitureDto {
private
float
minHumidity
=
0.0
F
;
private
float
minHumidity
=
0.0
F
;
@ApiModelProperty
(
"温湿度数据"
)
@ApiModelProperty
(
"温湿度数据"
)
PageData
<
Humiture
>
humitureList
;
PageData
<
Humiture
>
humitureList
;
@ApiModelProperty
(
"是否有下一页"
)
private
boolean
hasNextPage
=
false
;
}
}
src/main/java/com/neotel/smfcore/core/humiture/rest/bean/query/HumitureQueryCriteria.java
查看文件 @
04c3bd3
...
@@ -25,4 +25,7 @@ public class HumitureQueryCriteria {
...
@@ -25,4 +25,7 @@ public class HumitureQueryCriteria {
@QueryCondition
(
type
=
QueryCondition
.
Type
.
BETWEEN
,
propName
=
"createDate"
)
@QueryCondition
(
type
=
QueryCondition
.
Type
.
BETWEEN
,
propName
=
"createDate"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
BetweenData
<
Date
>
createDate
;
private
BetweenData
<
Date
>
createDate
;
@ApiModelProperty
(
"是否是图表数据。false=非图表不需要过滤,true=图表需要过滤"
)
private
boolean
isChart
=
false
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论