Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
QisdaNew
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 22306c42
由
sunke
编写于
2023-01-13 17:37:04 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
禁用托盘接口增加禁用时间
两个月前未完成需求单不再加载
1 个父辈
aa6455fd
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
7 行删除
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDisabledTrayController.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/util/OutInfoCache.java
查看文件 @
22306c4
...
@@ -506,6 +506,9 @@ public class OutInfoCache {
...
@@ -506,6 +506,9 @@ public class OutInfoCache {
List
<
OutInfo
>
unEndOutInfoList
=
outInfoDao
.
findUnEndOutInfos
();
List
<
OutInfo
>
unEndOutInfoList
=
outInfoDao
.
findUnEndOutInfos
();
long
now
=
System
.
currentTimeMillis
();
long
now
=
System
.
currentTimeMillis
();
for
(
OutInfo
outInfo
:
unEndOutInfoList
)
{
for
(
OutInfo
outInfo
:
unEndOutInfoList
)
{
if
(
now
-
outInfo
.
getMdate
().
getTime
()
>
60
*
24
*
60
*
60
*
1000
){
log
.
info
(
outInfo
.
gethSerial
()
+
"为两个月前需求单,忽略"
);
}
// if(now - outInfo.getMdate().getTime() > 10 * 24 * 60 * 60 * 1000){
// if(now - outInfo.getMdate().getTime() > 10 * 24 * 60 * 60 * 1000){
// //10天前的需求单(非紧急料),关闭,并解绑
// //10天前的需求单(非紧急料),关闭,并解绑
// if(!outInfo.isUrgentAction()){
// if(!outInfo.isUrgentAction()){
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDisabledTrayController.java
查看文件 @
22306c4
package
com
.
myproject
.
webapp
.
controller
.
webService
;
package
com
.
myproject
.
webapp
.
controller
.
webService
;
import
com.google.common.collect.Lists
;
import
com.myproject.bean.qisda.ResultBean
;
import
com.myproject.bean.qisda.ResultBean
;
import
com.myproject.bean.update.Barcode
;
import
com.myproject.bean.update.Barcode
;
import
com.myproject.bean.update.Component
;
import
com.myproject.bean.update.Component
;
import
com.myproject.bean.update.StoragePos
;
import
com.myproject.bean.update.StoragePos
;
import
com.myproject.util.DateUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.util.Strings
;
import
org.apache.logging.log4j.util.Strings
;
...
@@ -12,10 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -12,10 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 禁用托盘信息
* 禁用托盘信息
...
@@ -32,6 +31,11 @@ public class QisdaDisabledTrayController {
...
@@ -32,6 +31,11 @@ public class QisdaDisabledTrayController {
*/
*/
protected
String
disabledTray
=
""
;
protected
String
disabledTray
=
""
;
/**
* 禁用托盘缓存信息,key为托盘号,value为禁用时间
*/
protected
Map
<
String
,
String
>
disabledTrayMap
=
new
HashMap
<>();
protected
final
static
Logger
log
=
LogManager
.
getLogger
(
QisdaDisabledTrayController
.
class
);
protected
final
static
Logger
log
=
LogManager
.
getLogger
(
QisdaDisabledTrayController
.
class
);
/**
/**
...
@@ -39,8 +43,8 @@ public class QisdaDisabledTrayController {
...
@@ -39,8 +43,8 @@ public class QisdaDisabledTrayController {
*/
*/
@RequestMapping
(
value
=
"/getDisabledTray"
)
@RequestMapping
(
value
=
"/getDisabledTray"
)
@ResponseBody
@ResponseBody
public
String
smallBindCount
(
HttpServletRequest
request
){
public
Map
<
String
,
String
>
smallBindCount
(
HttpServletRequest
request
){
return
disabledTray
;
return
disabledTray
Map
;
}
}
@RequestMapping
(
value
=
"/updateDisabledTray"
)
@RequestMapping
(
value
=
"/updateDisabledTray"
)
...
@@ -48,13 +52,32 @@ public class QisdaDisabledTrayController {
...
@@ -48,13 +52,32 @@ public class QisdaDisabledTrayController {
public
ResultBean
getReelSize
(
HttpServletRequest
request
)
{
public
ResultBean
getReelSize
(
HttpServletRequest
request
)
{
try
{
try
{
String
trayList
=
request
.
getParameter
(
"disabledTray"
);
String
trayList
=
request
.
getParameter
(
"disabledTray"
);
if
(
Strings
.
is
Empty
(
trayList
)){
if
(
Strings
.
is
Blank
(
trayList
)){
trayList
=
""
;
trayList
=
""
;
}
}
if
(!
disabledTray
.
equals
(
trayList
)){
if
(!
disabledTray
.
equals
(
trayList
)){
log
.
info
(
"收到禁用托盘更新信息:"
+
trayList
);
log
.
info
(
"收到禁用托盘更新信息:"
+
trayList
);
}
}
if
(
Strings
.
isNotBlank
(
trayList
)){
List
<
String
>
newDisabeldTrayList
=
Lists
.
newArrayList
(
trayList
.
split
(
","
));
Collection
<
String
>
existDisabedTrayList
=
disabledTrayMap
.
keySet
();
for
(
String
existDisabedTray
:
existDisabedTrayList
)
{
if
(!
newDisabeldTrayList
.
contains
(
existDisabedTray
)){
//已经启用
log
.
info
(
"托盘["
+
existDisabedTray
+
"]已启用,从缓存中清除"
);
disabledTrayMap
.
remove
(
existDisabedTray
);
};
}
for
(
String
newDisabeldTray
:
newDisabeldTrayList
)
{
if
(!
existDisabedTrayList
.
contains
(
newDisabeldTray
)){
String
dateTime
=
DateUtil
.
toDateString
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
log
.
info
(
"托盘["
+
newDisabeldTray
+
"]已禁用,加入缓存,禁用时间:"
+
dateTime
);
disabledTrayMap
.
put
(
newDisabeldTray
,
dateTime
);
}
}
}
disabledTray
=
trayList
;
disabledTray
=
trayList
;
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
"上传禁用托盘信息出错"
,
e
);
log
.
error
(
"上传禁用托盘信息出错"
,
e
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论