Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
WeiChuangOrderStorage
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ad213aa4
由
sunke
编写于
2020-03-03 09:17:27 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
条码异常中英文提示
1 个父辈
26a758a3
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
42 行增加
和
28 行删除
myproject/src/main/java/com/myproject/bean/utils/StatusBean.java
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
myproject/src/main/java/com/myproject/webapp/controller/webService/StatusController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
myproject/src/main/webapp/WEB-INF/pages/storage/boxView.jsp
myproject/src/main/java/com/myproject/bean/utils/StatusBean.java
查看文件 @
ad213aa
...
@@ -246,7 +246,7 @@ public class StatusBean {
...
@@ -246,7 +246,7 @@ public class StatusBean {
* 是否需要往数据库保存(5分钟保存一次)
* 是否需要往数据库保存(5分钟保存一次)
*/
*/
public
boolean
needSaveToMongo
(){
public
boolean
needSaveToMongo
(){
return
System
.
currentTimeMillis
()
-
lastSaveTime
>=
1
*
1000
;
return
System
.
currentTimeMillis
()
-
lastSaveTime
>=
1
0
*
60
*
1000
;
}
}
public
long
getLastSaveTime
()
{
public
long
getLastSaveTime
()
{
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
查看文件 @
ad213aa
...
@@ -48,6 +48,8 @@ public interface ITaskService {
...
@@ -48,6 +48,8 @@ public interface ITaskService {
*/
*/
List
<
DataLog
>
getWaitingTasks
();
List
<
DataLog
>
getWaitingTasks
();
Exception
getServerException
(
String
cid
);
StatusBean
getStatus
(
String
cid
);
StatusBean
getStatus
(
String
cid
);
Map
<
String
,
StatusBean
>
allStatus
();
Map
<
String
,
StatusBean
>
allStatus
();
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/StatusController.java
查看文件 @
ad213aa
...
@@ -7,6 +7,7 @@ import com.myproject.bean.update.Humiture;
...
@@ -7,6 +7,7 @@ import com.myproject.bean.update.Humiture;
import
com.myproject.bean.update.Settings
;
import
com.myproject.bean.update.Settings
;
import
com.myproject.bean.utils.BoxStatusBean
;
import
com.myproject.bean.utils.BoxStatusBean
;
import
com.myproject.bean.utils.StatusBean
;
import
com.myproject.bean.utils.StatusBean
;
import
com.myproject.exception.ValidateException
;
import
com.myproject.manager.IHumitureManager
;
import
com.myproject.manager.IHumitureManager
;
import
com.myproject.webapp.controller.storage.BaseController
;
import
com.myproject.webapp.controller.storage.BaseController
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
...
@@ -51,6 +52,17 @@ public class StatusController extends BaseController{
...
@@ -51,6 +52,17 @@ public class StatusController extends BaseController{
// }
// }
//log.debug("Get cid: " + cid + " status: " + statusBean.getStatus() + " and error: " + statusBean.getError());
//log.debug("Get cid: " + cid + " status: " + statusBean.getStatus() + " and error: " + statusBean.getError());
Exception
e
=
taskService
.
getServerException
(
cid
);
if
(
e
!=
null
){
if
(
e
instanceof
ValidateException
){
String
msg
=
getText
(
e
.
getMessage
(),((
ValidateException
)
e
).
getParams
(),
request
.
getLocale
(),
e
.
getMessage
());
statusBean
.
setMsg
(
msg
);
statusBean
.
setMsgEn
(
msg
);
}
else
{
statusBean
.
setMsg
(
e
.
getMessage
());
statusBean
.
setMsgEn
(
e
.
getMessage
());
}
}
return
statusBean
;
return
statusBean
;
}
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
ad213aa
...
@@ -99,7 +99,7 @@ public class TaskService implements ITaskService {
...
@@ -99,7 +99,7 @@ public class TaskService implements ITaskService {
/**
/**
* CID的服务器消息(key 为 cid)
* CID的服务器消息(key 为 cid)
*/
*/
private
static
Map
<
String
,
String
>
serverMsg
s
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
Exception
>
serverException
s
=
new
ConcurrentHashMap
<>();
/**
/**
...
@@ -248,16 +248,16 @@ public class TaskService implements ITaskService {
...
@@ -248,16 +248,16 @@ public class TaskService implements ITaskService {
log
.
info
(
barcode
+
"["
+
plateW
+
"x"
+
plateH
+
"]开始入库到"
+
storage
.
getCid
()+
"["
+
posId
+
"]"
);
log
.
info
(
barcode
+
"["
+
plateW
+
"x"
+
plateH
+
"]开始入库到"
+
storage
.
getCid
()+
"["
+
posId
+
"]"
);
//清空展示的消息
//清空展示的消息
server
Msgs
.
put
(
storage
.
getCid
(),
""
);
server
Exceptions
.
remove
(
storage
.
getCid
()
);
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
log
.
warn
(
"入库到"
+
storage
.
getCid
()
+
"失败:"
+
e
.
getMessage
());
log
.
warn
(
"入库到"
+
storage
.
getCid
()
+
"失败:"
+
e
.
getMessage
());
statusBean
.
setMsg
(
e
.
getMessage
());
statusBean
.
setMsg
(
e
.
getMessage
());
server
Msgs
.
put
(
storage
.
getCid
(),
e
.
getMessage
()
);
server
Exceptions
.
put
(
storage
.
getCid
(),
e
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
statusBean
.
getCode
()
+
"入库到"
+
storage
.
getCid
()
+
"失败"
,
e
);
log
.
error
(
statusBean
.
getCode
()
+
"入库到"
+
storage
.
getCid
()
+
"失败"
,
e
);
statusBean
.
setMsg
(
e
.
getMessage
());
statusBean
.
setMsg
(
e
.
getMessage
());
server
Msgs
.
put
(
storage
.
getCid
(),
e
.
getMessage
()
);
server
Exceptions
.
put
(
storage
.
getCid
(),
e
);
}
}
return
statusBean
;
return
statusBean
;
}
}
...
@@ -1176,6 +1176,12 @@ public class TaskService implements ITaskService {
...
@@ -1176,6 +1176,12 @@ public class TaskService implements ITaskService {
}
}
@Override
@Override
public
Exception
getServerException
(
String
cid
){
return
serverExceptions
.
get
(
cid
);
}
@Override
public
StatusBean
getStatus
(
String
cid
)
{
public
StatusBean
getStatus
(
String
cid
)
{
StatusBean
statusBean
=
statusMap
.
get
(
cid
);
StatusBean
statusBean
=
statusMap
.
get
(
cid
);
if
(
statusBean
==
null
||
statusBean
.
timeOut
())
{
if
(
statusBean
==
null
||
statusBean
.
timeOut
())
{
...
@@ -1183,10 +1189,6 @@ public class TaskService implements ITaskService {
...
@@ -1183,10 +1189,6 @@ public class TaskService implements ITaskService {
statusBean
.
setCid
(
cid
);
statusBean
.
setCid
(
cid
);
statusBean
.
setStatus
(
StorageConstants
.
STATUS
.
OFFLINE
);
statusBean
.
setStatus
(
StorageConstants
.
STATUS
.
OFFLINE
);
}
}
String
serverMsg
=
serverMsgs
.
get
(
cid
);
if
(!
Strings
.
isNullOrEmpty
(
serverMsg
)){
statusBean
.
setMsg
(
serverMsg
);
}
return
statusBean
;
return
statusBean
;
}
}
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/boxView.jsp
查看文件 @
ad213aa
...
@@ -101,6 +101,13 @@
...
@@ -101,6 +101,13 @@
text-decoration:line-through;
text-decoration:line-through;
}
}
.red{
color:red;
}
.green{
color:green;
}
</style>
</style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
...
@@ -111,19 +118,6 @@
...
@@ -111,19 +118,6 @@
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
</div>
</div>
<div id="chart">
<div id="chart">
<div class='itembox' id="7x8">
<div class='item-start barheight'>7 x 8 mm</div>
<div class='progress my-progress'>
<div class='progress-bar progress-bar-used barheight' style='width: 0%' title=""></div>
<div class='progress-bar progress-bar-idle barheight' style='width: 0%' title=""></div>
</div>
</div>
<div class='itembox' id="7x16"><div class='item-start barheight'>7 x 16 mm</div>
<div class='progress my-progress'>
<div class='progress-bar progress-bar-used barheight' style='width: 0%'></div>
<div class='progress-bar progress-bar-idle barheight' style='width: 0%'></div>
</div>
</div>
</div>
</div>
...
@@ -536,17 +530,21 @@
...
@@ -536,17 +530,21 @@
function flushStatus(){
function flushStatus(){
$.get('${ctx}/service/store/status?cid=${show}', function (statusBean) {
$.get('${ctx}/service/store/status?cid=${show}', function (statusBean) {
if(statusBean && statusBean.boxStatus["1"]){
if(statusBean && statusBean.boxStatus["1"]){
var statusTxt = statusMsg[statusBean.boxStatus["1"].status];
var boxStatusBean = statusBean.boxStatus["1"];
var statusTxt = statusMsg[boxStatusBean.status];
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
var locale = "${locale}";
var color = "green";
var msg = statusBean.msg;
if(boxStatusBean.status == 2 || boxStatusBean.status == 3 || boxStatusBean.status == 4 || boxStatusBean.status == 5){
if(locale == 'en'){
color = "red";
msg = statusBean.msgEn;
}
}
$("#clientMsg").html(msg);
$("#smdstatus").attr("class","smdstatus " + color);
$("#clientMsg").html(statusBean.msg);
}else{
}else{
var statusTxt = statusMsg["999"];
var statusTxt = statusMsg["999"];
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
$("#smdstatus").attr("class","smdstatus red");
$("#clientMsg").html("");
$("#clientMsg").html("");
}
}
});
});
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论