Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
SmdBox
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9794c7a0
由
sunke
编写于
2020-08-04 16:56:20 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
垂直货柜
1 个父辈
55bc85f5
显示空白字符变更
内嵌
并排
正在显示
28 个修改的文件
包含
1703 行增加
和
331 行删除
myproject/src/main/java/com/myproject/bean/json/VerticalBoxOperateBean.java
myproject/src/main/java/com/myproject/bean/update/Barcode.java
myproject/src/main/java/com/myproject/bean/update/Storage.java
myproject/src/main/java/com/myproject/bean/update/StoragePos.java
myproject/src/main/java/com/myproject/manager/IStoragePosManager.java
myproject/src/main/java/com/myproject/manager/impl/BarcodeManagerImpl.java
myproject/src/main/java/com/myproject/manager/impl/StoragePosManagerImpl.java
myproject/src/main/java/com/myproject/util/BarcodeRule.java
myproject/src/main/java/com/myproject/util/StorageConstants.java
myproject/src/main/java/com/myproject/webapp/controller/storage/AccShelfController.java
myproject/src/main/java/com/myproject/webapp/controller/storage/StoragePosFindController.java
myproject/src/main/java/com/myproject/webapp/controller/storage/VerticalBoxController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
myproject/src/main/java/com/myproject/webapp/controller/webService/boxHandler/VerticalBoxHandler.java
myproject/src/main/resources/ApplicationResources.properties
myproject/src/main/resources/ApplicationResources_en.properties
myproject/src/main/resources/ApplicationResources_jp.properties
myproject/src/main/resources/ApplicationResources_zh.properties
myproject/src/main/resources/StorageResources.properties
myproject/src/main/resources/StorageResources_en.properties
myproject/src/main/resources/StorageResources_jp.properties
myproject/src/main/resources/StorageResources_zh_CN.properties
myproject/src/main/webapp/WEB-INF/pages/component/storagePosFind.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/allBoxView.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/solderBox.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/verticalBox.jsp
myproject/src/main/webapp/decorators/metro.jsp
myproject/src/main/java/com/myproject/bean/json/VerticalBoxOperateBean.java
0 → 100644
查看文件 @
9794c7a
package
com
.
myproject
.
bean
.
json
;
import
com.myproject.bean.update.DataLog
;
import
com.myproject.bean.update.StoragePos
;
import
java.util.List
;
/**
* Created by sunke on 2020/7/27.
*/
public
class
VerticalBoxOperateBean
{
private
DataLog
currentTask
;
private
List
<
StoragePos
>
extendPosList
;
public
DataLog
getCurrentTask
()
{
return
currentTask
;
}
public
void
setCurrentTask
(
DataLog
currentTask
)
{
this
.
currentTask
=
currentTask
;
}
public
List
<
StoragePos
>
getExtendPosList
()
{
return
extendPosList
;
}
public
void
setExtendPosList
(
List
<
StoragePos
>
extendPosList
)
{
this
.
extendPosList
=
extendPosList
;
}
}
myproject/src/main/java/com/myproject/bean/update/Barcode.java
查看文件 @
9794c7a
...
...
@@ -628,6 +628,13 @@ public class Barcode extends BaseMongoBean {
return
DateUtil
.
toDateTimeString
(
needOutDate
);
}
public
String
getExpireDateStr
(){
if
(
expireDate
!=
null
){
return
DateUtil
.
toDateString
(
expireDate
);
}
return
""
;
}
// public void setNoChangeField(Barcode oldBarcode){
// if(oldBarcode != null){
// this.expireDate = oldBarcode.getExpireDate();
...
...
myproject/src/main/java/com/myproject/bean/update/Storage.java
查看文件 @
9794c7a
...
...
@@ -187,6 +187,15 @@ public class Storage extends BaseMongoBean {
}
/**
* 是否是垂直货柜
*/
public
boolean
isVerticalBox
(){
return
StorageConstants
.
TYPE
.
VERTICALBOX
.
name
().
equals
(
type
);
}
/**
* 是否是锡膏料仓
*/
public
boolean
isSolderPaste
(){
...
...
myproject/src/main/java/com/myproject/bean/update/StoragePos.java
查看文件 @
9794c7a
...
...
@@ -2,6 +2,7 @@ package com.myproject.bean.update;
import
com.google.common.base.Strings
;
import
com.myproject.bean.BaseMongoBean
;
import
com.myproject.util.StorageConstants
;
import
java.util.List
;
...
...
@@ -15,6 +16,11 @@ public class StoragePos extends BaseMongoBean {
private
String
posName
;
/**
* 扩展库位的主库位
*/
private
String
hostPosId
;
/**
* 该仓位是否限制物编,虚拟仓使用
*/
private
List
<
String
>
limitPnList
;
...
...
@@ -217,4 +223,16 @@ public class StoragePos extends BaseMongoBean {
public
void
setWarmPos
(
boolean
warmPos
)
{
this
.
warmPos
=
warmPos
;
}
public
boolean
isExpandPos
(){
return
!
Strings
.
isNullOrEmpty
(
hostPosId
);
}
public
String
getHostPosId
()
{
return
hostPosId
;
}
public
void
setHostPosId
(
String
hostPosId
)
{
this
.
hostPosId
=
hostPosId
;
}
}
myproject/src/main/java/com/myproject/manager/IStoragePosManager.java
查看文件 @
9794c7a
...
...
@@ -38,6 +38,8 @@ public interface IStoragePosManager extends IManager<StoragePos> {
StoragePos
getByBarcodeId
(
String
barcodeId
);
List
<
StoragePos
>
findEnablePosList
(
String
storageId
);
void
clearPos
(
String
storageId
);
StoragePos
getEmptyPosByPartNumber
(
String
storageId
,
String
partNumber
,
Collection
<
String
>
excludePosIds
);
...
...
@@ -88,6 +90,10 @@ public interface IStoragePosManager extends IManager<StoragePos> {
StoragePos
getByPosName
(
String
posName
);
StoragePos
getByHostPosId
(
String
hostPosId
,
String
pn
);
List
<
StoragePos
>
getExtendPosList
(
String
hostPosId
);
List
<
StoragePos
>
findByLabel
(
String
storageId
,
String
labelStr
);
void
insertAll
(
List
<
StoragePos
>
posList
);
...
...
myproject/src/main/java/com/myproject/manager/impl/BarcodeManagerImpl.java
查看文件 @
9794c7a
...
...
@@ -62,9 +62,9 @@ public class BarcodeManagerImpl implements IBarcodeManager {
if
(
barcode
.
getMaxStorageTime
()
<=
0
){
barcode
.
setMaxStorageTime
(
component
.
getMaxStorageTime
());
}
if
(
barcode
.
getAmount
()
==
1
){
barcode
.
setAmount
(
component
.
getAmount
());
}
//
if(barcode.getAmount() == 1){
//
barcode.setAmount(component.getAmount());
//
}
barcode
.
setType
(
component
.
getType
());
barcode
.
setWarmTime
(
component
.
getWarmTime
());
barcode
.
setMixTime
(
component
.
getMixTime
());
...
...
myproject/src/main/java/com/myproject/manager/impl/StoragePosManagerImpl.java
查看文件 @
9794c7a
...
...
@@ -48,6 +48,15 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
@Override
public
List
<
StoragePos
>
findEnablePosList
(
String
storageId
)
{
Criteria
c
=
Criteria
.
where
(
"storageId"
).
is
(
storageId
).
and
(
"enabled"
).
is
(
true
);
//可用
Query
query
=
new
Query
(
c
);
query
.
with
(
new
Sort
(
Sort
.
Direction
.
ASC
,
"posName"
));
List
<
StoragePos
>
storagePosList
=
storagePosDao
.
findByQuery
(
query
);
return
storagePosList
;
}
@Override
public
StoragePos
get
(
String
id
)
{
return
storagePosDao
.
findOneById
(
id
);
}
...
...
@@ -466,6 +475,20 @@ public class StoragePosManagerImpl implements IStoragePosManager {
return
storagePosDao
.
findOneByCondition
(
new
String
[]{
"posName"
},
new
String
[]{
posName
});
}
@Override
public
StoragePos
getByHostPosId
(
String
hostPosId
,
String
pn
){
return
storagePosDao
.
findOneByCondition
(
new
String
[]{
"hostPosId"
,
"barcode.partNumber"
},
new
String
[]{
hostPosId
,
pn
});
}
@Override
public
List
<
StoragePos
>
getExtendPosList
(
String
hostPosId
){
Criteria
c
=
Criteria
.
where
(
"hostPosId"
).
is
(
hostPosId
)
.
and
(
"enabled"
).
is
(
true
)
//可用
;
Query
q
=
new
Query
(
c
);
return
storagePosDao
.
findByQuery
(
q
);
}
/**
*查找一个库位可以放多种料的库位
*/
...
...
myproject/src/main/java/com/myproject/util/BarcodeRule.java
查看文件 @
9794c7a
...
...
@@ -25,7 +25,55 @@ import java.util.Date;
* MSL 为MSL等级
*
*
* 其中必须含有PN和 RI, QTY为空时使用产品档案的封装数量,如果字段前或者后有无用字符,可使用 x(一个字符) 替代
*
*
*
*
*
*
*
*条码规则,可用字段有:
* PN为物料编号即 PartNumber
* RI 为唯一码即ReelId,[RI]为所有字符串作为一个唯一码
* QTY 为数量
* PRODATE为生产日期xxPRODATEyyyyMMdd
* EXPDATE为过期日期xxxEXPDATEyyyyMMdd
* SP 为供应商,
* BATCH 为批次
* MSL 为MSL等级
* 其中必须含有PN和 RI, QTY为空时使用产品档案的封装数量
*
* 前面一位数字大于0表示去除前面第n位, -1表示不去除,并且对字段长数不做限制, 等于0表示不去除,但对字段长度做限制
* 中间一位数字0表示为变长,正值表示从前面截取,负值表示从后面开始截取,前缀和后缀及长度都有效时,需要验证字串总长度
* 后面一位数字大于0表示去除后面第n位, -1表示不去除,并且对字段长数不做限制, 等于0表示不去除,但对字段长度做限制
*
* 例一: QTY[-1,5,-1]取前5位作为数量
* 例二: QTY[-1,-5,-1]取后5位作为数量
* 例三: QTY[1,5,-1]去除前面第1位后,取前5位作为数量
* 例四: QTY[-1,-5,1]去除后面第1位后,取后5位作为数量
* 例五: QTY[1,0,-1]去除前面1位后,剩余的作为数量
* 例六: QTY[0,5,3]去除前面0位和后面3位,剩余的5位作为数量,也就是说只能为8位
*
* 示例:
* 规则为: [RI]_PN_PRODATEyyMMdd_QTY[0:5:4]
* 条码: 4500065747_CS000069_180101_030000041
* 解析后: RI=4500065747_CS000069_180101_030000041
* PN=CS000069
* 生产日期为: 2018年1月1日
* 数量为:去掉前面0位,去掉后面4位,剩下03000正好为5位,所以数量是3000,
* 如果条码变为4500065747_CS000069_180101_0300000410则会提示不合规则,因为去掉前面0位,去掉后面4位,剩下的030004是6位,不是5位
*
* 示例:
* 规则为: BATCH;PRODATEyyyyMMdd[1:8:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI
* 条码为: L00002019090199951797;E20190901 0365;B8C.R2003.V81506072019090103000;R506072019102200356
* 解析后: PN=8C.R2003.V81
* RI=R506072019102200356
* QTY=3000
* BATCH=L00002019090199951797
* PRODATE=2019年9月1日
* 供应商=50607
*
*
*
* 1@2@3@PN@5@6@7@8@9@10@11@12@13@14@15@16@RI@18@19@20@21@22@23@24
* [)>@06@12S0002@P5292001000@1P1690215@31P1690215@12V527973628@10VCHN-YANTAI@2P@20P@6D20170626@14D20171223@30PY@ZN@K0@16K0@V815@3SB370000000EZZ@Q500GRM000@20T1@1TMT72543954@2T@1Z@@
...
...
@@ -203,15 +251,7 @@ public class BarcodeRule {
private
int
index
=
-
1
;
//前缀(-1时表示没有前缀)如果要验证总长度,可设置为0
private
int
prefix
=
-
1
;
/**
*长度,0表示为变长,正值表示从前面截取,负值表示从后面开始截取,前缀和后缀及长度都有效时,需要验证字串总长度
* 例一: QTY[0,5,0]取前5位作为数量
* 例二: QTY[0,-5,0]取后5位作为数量
* 例三: QTY[1,5,0]去除前面第1位后,取前5位作为数量
* 例四: QTY[0,-5,1]去除后面第1位后,取后5位作为数量
* 例五: QTY[1,0,0]去除前面1位后,剩余的作为数量
* 例六: QTY[0,5,3]去除前面0位和后面3位,剩余的5位作为数量,也就是说只能为8位
*/
private
int
length
=
0
;
//后缀(-1时表示没有前缀)如果要验证总长度,可设置为0
private
int
suffix
=
-
1
;
...
...
@@ -577,14 +617,18 @@ public class BarcodeRule {
//
// rule = "PN[0:8:-1]QTY[8:5:-1]RI[13:7:-1]EXPDATEyyyyMMdd[20:8:-1]MSL[28:4:-1]BATCH[32:4:-1]SP[36:4:-1]";
// //佳世达
// rule ="BATCH;PRODATEyyyyMMdd[1:8:-1]EXPD[-1:-4:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI";
// codeStr = "L00002019090199951797;E20190901 0365;B8C.R2003.V81506072019090103000;R506072019102200356";
rule
=
"BATCH;PRODATEyyyy-MM-dd[1:10:-1]EXPD[-1:-4:-1];PN[1:12:-1]SP[13:5:-1]QTY[-1:-5:-1];RI"
;
codeStr
=
"L00002019090199951797;E2019-09-01 0365;B8C.R2003.V81506072019090103000;R506072019102200356"
;
//rule = "1;PN;BATCH;PRODATEyyyyMMdd;EXPDATEyyyyMMdd;QTY;RI";
//codeStr = ";RMK1608-K-B-10300;7B16081217B0;20200506;20250203;5000;000";
//rule = "1;2;PN;BATCH[2:0:-1];5;6;EXPDATEyyyy/MM/dd[2:0:8];QTY[2:0:-1];8;9;10;RI[2:0:-1]";
//codeStr = "锘緿M;IN13浠跺\uE69C缁勮灪涓濇壒09913涓栬揪;BM;PH11A-ZZG02;DDDDMO180525;GG624-71;SX2019/8/25 0:00:00;SL2;HG;DL;ZP;QT90CECB112D1448DA91F485D0AA984B08";
rule
=
"1;PN;BATCH;PRODATEyyyyMMdd;EXPDATEyyyyMMdd;QTY;RI
"
;
codeStr
=
";RMK1608-K-B-10300;7B16081217B0;20200506;20250203;5000;000
"
;
//rule = "1>PN[-1:0:6]>3>RI[-1:0:6]
";
//codeStr = "<ckdh>CC200612000194</ckdh><jybh>ADK20-\n" +"JY19060012~/jybh>
";
rule
=
"1;2;PN;BATCH[2:0:-1];5;6;EXPDATEyyyy/MM/dd[2:0:8];QTY[2:0:-1];8;9;10;RI[2:0:-1]"
;
codeStr
=
"锘緿M;IN13浠跺\uE69C缁勮灪涓濇壒09913涓栬揪;BM;PH11A-ZZG02;DDDDMO180525;GG624-71;SX2019/8/25 0:00:00;SL2;HG;DL;ZP;QT90CECB112D1448DA91F485D0AA984B08"
;
BarcodeRule
br
=
BarcodeRule
.
newRule
(
rule
);
Barcode
b
=
br
.
toCodeBean
(
codeStr
).
getBarcode
();
if
(
b
!=
null
){
...
...
myproject/src/main/java/com/myproject/util/StorageConstants.java
查看文件 @
9794c7a
...
...
@@ -223,7 +223,6 @@ public class StorageConstants {
public
final
static
int
MIX_END
=
22
;
}
/**
* 料仓类型:0单台自动料仓,1手动料仓2流水线料仓
*/
...
...
@@ -288,6 +287,12 @@ public class StorageConstants {
*/
SOLDERPASTE
(
"storage.type.solderPaste"
),
/**
* 11 垂直货柜
*/
VERTICALBOX
(
"storage.type.verticalBox"
)
;
private
String
key
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/storage/AccShelfController.java
查看文件 @
9794c7a
...
...
@@ -204,7 +204,7 @@ public class AccShelfController extends BaseController {
List
<
Storage
>
storageList
=
Lists
.
newArrayList
(
storage
);
StoragePos
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
);
int
delayCloseTime
=
30000
;
String
color
=
"
red
"
;
String
color
=
"
green
"
;
if
(
pos
!=
null
){
log
.
info
(
barcode
.
getPartNumber
()+
" [ "
+
barcode
.
getBarcode
()+
" ] "
+
"入库到:"
+
storage
.
getName
()+
"["
+
cid
+
"] "
+
pos
.
getPosName
());
taskService
.
addTaskToFinished
(
pos
,
barcode
,
null
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/storage/StoragePosFindController.java
查看文件 @
9794c7a
...
...
@@ -141,10 +141,12 @@ public class StoragePosFindController extends BaseSearchController {
}
int
inactionDay
=
dataCache
.
getSettings
().
getInactionDay
();
if
(
inactionDay
<=
0
){
inactionDay
=
3
;
if
(
inactionDay
>
0
){
Date
inactionDate
=
DateUtil
.
addDays
(
new
Date
(),
-
inactionDay
);
request
.
setAttribute
(
"inactionDate"
,
inactionDate
);
}
request
.
setAttribute
(
"inactionDay"
,
inactionDay
);
String
singeOutStr
=
request
.
getParameter
(
"singleOut"
);
boolean
isSingleOut
=
false
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/storage/VerticalBoxController.java
0 → 100644
查看文件 @
9794c7a
package
com
.
myproject
.
webapp
.
controller
.
storage
;
import
com.google.common.base.Strings
;
import
com.myproject.bean.CodeBean
;
import
com.myproject.bean.json.ResultBean
;
import
com.myproject.bean.json.VerticalBoxOperateBean
;
import
com.myproject.bean.update.*
;
import
com.myproject.dao.mongo.IDataLogDao
;
import
com.myproject.exception.ValidateException
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IComponentManager
;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.util.DateUtil
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.webapp.controller.webService.DataCache
;
import
com.myproject.webapp.controller.webService.ITaskService
;
import
com.myproject.webapp.controller.webService.StorageDataController
;
import
com.myproject.webapp.controller.webService.boxHandler.VerticalBoxHandler
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.ParseException
;
import
java.util.*
;
/**
* 锡膏料仓
*/
@Controller
public
class
VerticalBoxController
extends
BaseController
{
@Autowired
private
DataCache
dataCache
;
@Autowired
private
ITaskService
taskService
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
IBarcodeManager
barcodeManager
;
@Autowired
private
IComponentManager
componentManager
;
@Autowired
private
IDataLogDao
dataLogDao
;
@Autowired
private
VerticalBoxHandler
verticalBoxHandler
;
@RequestMapping
(
"/storage/vertical/{cid}"
)
public
String
solderView
(
@PathVariable
String
cid
,
HttpServletRequest
request
){
request
.
getSession
().
setAttribute
(
"show"
,
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
request
.
setAttribute
(
"storage"
,
storage
);
List
<
StoragePos
>
enabledPosList
=
storagePosManager
.
findEnablePosList
(
storage
.
getId
());
List
<
StoragePos
>
storagePosList
=
new
ArrayList
<>();
for
(
StoragePos
storagePos
:
enabledPosList
)
{
if
(!
storagePos
.
isExpandPos
()){
storagePosList
.
add
(
storagePos
);
}
}
request
.
setAttribute
(
"storagePosList"
,
storagePosList
);
return
"storage/verticalBox"
;
}
/**
* 查找下一个空位,并且点亮灯
*/
@RequestMapping
(
"/service/store/vertical/storagePosList"
)
@ResponseBody
public
List
<
StoragePos
>
checkAll
(
HttpServletRequest
request
){
String
cid
=
request
.
getParameter
(
"cid"
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
List
<
StoragePos
>
notEmptyPosList
=
storagePosManager
.
findNotEmptyByStorageId
(
storage
.
getId
());
return
notEmptyPosList
;
}
@RequestMapping
(
"/service/store/vertical/closeOperateWindow"
)
@ResponseBody
public
void
closeOperateWindow
(
HttpServletRequest
request
){
String
cid
=
request
.
getParameter
(
"cid"
);
DataLog
currentTask
=
verticalBoxHandler
.
getCurrentTask
(
cid
);
if
(
currentTask
!=
null
){
log
.
info
(
"关闭["
+
cid
+
"]的出入库["
+
currentTask
.
getPosName
()+
"]窗口"
);
if
(
currentTask
.
isExecuting
()){
log
.
info
(
"取消["
+
cid
+
"]的当前任务"
+
currentTask
.
getPosName
());
currentTask
.
setStatus
(
StorageConstants
.
OP_STATUS
.
CANCEL
.
name
());
dataLogDao
.
save
(
currentTask
);
taskService
.
moveTaskToFinished
(
currentTask
);
}
verticalBoxHandler
.
updateCurrentTask
(
cid
,
null
);
StorageDataController
.
addOp
(
cid
,
"closeDoor"
,
"doit"
);
}
}
@RequestMapping
(
"/service/store/vertical/putIn"
)
@ResponseBody
public
String
putIn
(
HttpServletRequest
request
){
String
pid
=
request
.
getParameter
(
"pid"
);
StoragePos
pos
=
storagePosManager
.
findOneById
(
pid
);
if
(
pos
.
isExpandPos
()){
pos
=
storagePosManager
.
findOneById
(
pos
.
getHostPosId
());
}
if
(
pos
!=
null
){
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
if
(
excludePosIds
.
contains
(
pos
.
getId
())){
return
"该库位已有任务"
;
}
DataLog
task
=
new
DataLog
();
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
task
.
setCid
(
storage
.
getCid
());
task
.
setStorageId
(
storage
.
getId
());
task
.
setStorageName
(
storage
.
getName
());
task
.
setPosId
(
pos
.
getId
());
task
.
setPosName
(
pos
.
getPosName
());
task
.
setType
(
StorageConstants
.
OP
.
PUT_IN
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
WAIT
.
name
());
task
=
dataLogDao
.
save
(
task
);
taskService
.
addTaskToExecute
(
task
);
}
return
"OK操作成功"
;
}
/**
* 对库位进行出库或入库操作
* @param request
* @return
*/
@RequestMapping
(
value
=
"/service/store/vertical/operatePos"
)
@ResponseBody
public
String
operatePos
(
HttpServletRequest
request
)
{
try
{
String
codeStr
=
request
.
getParameter
(
"code"
);
String
posName
=
request
.
getParameter
(
"pos"
);
String
cid
=
request
.
getParameter
(
"cid"
);
DataLog
currentTask
=
verticalBoxHandler
.
getCurrentTask
(
cid
);
StoragePos
hostPos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
hostPos
!=
null
&&
hostPos
.
isExpandPos
()){
hostPos
=
storagePosManager
.
get
(
hostPos
.
getHostPosId
());
}
if
(
hostPos
==
null
||
currentTask
==
null
||
!
currentTask
.
getPosName
().
equals
(
posName
)){
return
"未找到对应的库位"
;
}
String
[]
codeArray
=
codeStr
.
split
(
"x"
);
//手动输入,按PN来处理
if
(
codeArray
.
length
==
2
){
String
pnStr
=
codeArray
[
0
];
int
opQty
=
Integer
.
valueOf
(
codeArray
[
1
]);
//先查找是否有相同的PN,没有创建一个
Component
component
=
componentManager
.
findByPartNumber
(
pnStr
);
if
(
component
==
null
){
component
=
new
Component
();
component
.
setHeight
(
1
);
component
.
setPartNumber
(
pnStr
);
component
.
setPlateSize
(
1
);
component
.
setType
(
StorageConstants
.
COMPONENT_TYPE
.
OTHERS
);
component
.
setAmount
(
opQty
);
component
=
componentManager
.
save
(
component
);
}
//查看该库位中是否有相同的物料,有的话,数量累加
StoragePos
existPnPos
=
storagePosManager
.
getByHostPosId
(
hostPos
.
getId
(),
component
.
getPartNumber
());
if
(
currentTask
.
isPutInTask
()){
//入库
if
(
existPnPos
!=
null
){
Barcode
existBarcode
=
existPnPos
.
getBarcode
();
int
oldAmount
=
existBarcode
.
getAmount
();
existBarcode
.
setAmount
(
oldAmount
+
opQty
);
existBarcode
=
barcodeManager
.
save
(
existBarcode
);
existPnPos
.
setBarcode
(
existBarcode
);
storagePosManager
.
save
(
existPnPos
);
finishTask
(
existPnPos
,
currentTask
,
existBarcode
,
opQty
);
log
.
info
(
existBarcode
.
getPartNumber
()
+
"入库到库位["
+
existPnPos
.
getPosName
()+
"],物料数量:"
+
oldAmount
+
" + "
+
opQty
+
" = "
+
existBarcode
.
getAmount
());
}
else
{
//条码设置为P+PosId+C+ComponentId
String
barcodeStr
=
"P"
+
hostPos
.
getId
()
+
"C"
+
component
.
getId
();
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeStr
);
if
(
barcode
==
null
){
//不存在,需要创建条码和库位
barcode
=
new
Barcode
();
barcode
.
setBarcode
(
barcodeStr
);
barcode
.
setPlateSize
(
1
);
barcode
.
setHeight
(
1
);
barcode
.
setPartNumber
(
pnStr
);
}
barcode
.
setAmount
(
opQty
);
barcode
.
setUsedDate
(
new
Date
());
barcode
.
setPutInTime
(
System
.
currentTimeMillis
());
barcode
.
setCheckOutDate
(
null
,
""
);
barcode
=
barcodeManager
.
save
(
barcode
);
StoragePos
posToPut
=
getOrCreateNewPos
(
hostPos
,
barcode
.
getId
());
posToPut
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
posToPut
);
finishTask
(
posToPut
,
currentTask
,
barcode
,
opQty
);
log
.
info
(
barcode
.
getPartNumber
()
+
"入库到库位["
+
posToPut
.
getPosName
()+
"],物料数量:"
+
barcode
.
getAmount
());
}
}
else
{
//出库
if
(
existPnPos
!=
null
){
Barcode
existBarcode
=
existPnPos
.
getBarcode
();
int
oldAmount
=
existBarcode
.
getAmount
();
if
(
oldAmount
<
opQty
){
return
"物料数量不足"
;
}
int
newAmount
=
oldAmount
-
opQty
;
existBarcode
.
setAmount
(
newAmount
);
existBarcode
=
barcodeManager
.
save
(
existBarcode
);
if
(
newAmount
==
0
){
//全部出库,禁用库位
existPnPos
.
setBarcode
(
null
);
existPnPos
.
setEnabled
(
false
);
}
else
{
existPnPos
.
setBarcode
(
existBarcode
);
}
storagePosManager
.
save
(
existPnPos
);
finishTask
(
existPnPos
,
currentTask
,
existBarcode
,
opQty
);
log
.
info
(
existBarcode
.
getPartNumber
()
+
"从库位["
+
existPnPos
.
getPosName
()+
"]库位出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
}
else
{
//无库存
return
"该库位中未找到对应的物料"
;
}
}
}
else
{
String
newCodeStr
=
"=1x1="
+
codeStr
;
CodeBean
codeBean
=
dataCache
.
resolveSingleCode
(
newCodeStr
);
if
(
codeBean
.
isValid
()){
Barcode
barcode
=
codeBean
.
getBarcode
();
if
(
currentTask
.
isPutInTask
()){
StoragePos
posToPut
=
getOrCreateNewPos
(
hostPos
,
barcode
.
getId
());
posToPut
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
posToPut
);
finishTask
(
posToPut
,
currentTask
,
barcode
,
barcode
.
getAmount
());
log
.
info
(
"条码"
+
barcode
.
getBarcode
()+
"["
+
barcode
.
getPartNumber
()
+
"]入库到库位["
+
posToPut
.
getPosName
()+
"]数量:"
+
barcode
.
getAmount
());
}
else
{
//出库
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
){
Barcode
posBarcode
=
pos
.
getBarcode
();
pos
.
setBarcode
(
null
);
pos
.
setEnabled
(
false
);
storagePosManager
.
save
(
pos
);
finishTask
(
pos
,
currentTask
,
posBarcode
,
posBarcode
.
getAmount
());
log
.
info
(
"条码"
+
barcode
.
getBarcode
()+
"["
+
barcode
.
getPartNumber
()
+
"]从库位["
+
pos
.
getPosName
()+
"]出库,数量:"
+
barcode
.
getAmount
());
}
else
{
return
"该库位中未找到对应条码的物料"
;
}
}
}
else
{
String
msg
=
getText
(
codeBean
.
getErrorCode
(),
codeBean
.
getParams
(),
request
.
getLocale
(),
codeBean
.
getError
());
return
msg
;
}
}
}
catch
(
Exception
e
){
return
"入库出错:"
+
e
.
getMessage
();
}
return
"OK操作成功"
;
}
@RequestMapping
(
value
=
"/service/store/vertical/currentTask"
)
@ResponseBody
public
VerticalBoxOperateBean
currentTask
(
HttpServletRequest
request
)
{
String
cid
=
request
.
getParameter
(
"cid"
);
DataLog
currentTask
=
verticalBoxHandler
.
getCurrentTask
(
cid
);
// if(currentTask == null){
// //测试使用
// Collection<DataLog> queueTasks = taskService.getQueueTasks(cid);
// for (DataLog queueTask : queueTasks) {
// queueTask.setStatus(StorageConstants.OP_STATUS.EXECUTING.name());
// taskService.updateQueueTask(queueTask);
// verticalBoxHandler.updateCurrentTask(queueTask.getCid(), queueTask);
// break;
// }
// currentTask = verticalBoxHandler.getCurrentTask(cid);
// }
if
(
currentTask
!=
null
){
VerticalBoxOperateBean
operateBean
=
new
VerticalBoxOperateBean
();
operateBean
.
setCurrentTask
(
currentTask
);
StoragePos
hostPos
=
storagePosManager
.
get
(
currentTask
.
getPosId
());
if
(
hostPos
.
isExpandPos
()){
hostPos
=
storagePosManager
.
get
(
hostPos
.
getHostPosId
());
}
List
<
StoragePos
>
extendPosList
=
storagePosManager
.
getExtendPosList
(
hostPos
.
getId
());
operateBean
.
setExtendPosList
(
extendPosList
);
return
operateBean
;
}
return
null
;
}
/**
* 完成出入库任务
* @param operatePos 库位
* @param currentTask 当前任务
* @param barcode 条码
* @param opQty 数量
* @throws ValidateException
*/
private
void
finishTask
(
StoragePos
operatePos
,
DataLog
currentTask
,
Barcode
barcode
,
int
opQty
)
throws
ValidateException
{
DataLog
task
=
null
;
//先查看是否有相同类型且库位相同的任务
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
for
(
DataLog
queueTask
:
queueTasks
)
{
if
(
queueTask
.
getType
()
==
currentTask
.
getType
()){
if
(
queueTask
.
getPosName
().
equals
(
operatePos
.
getPosName
())){
task
=
queueTask
;
break
;
}
}
}
if
(
task
==
null
){
if
(
currentTask
.
isExecuting
()){
task
=
currentTask
;
}
else
{
task
=
new
DataLog
();
}
}
if
(
currentTask
.
isPutInTask
()){
task
.
setType
(
StorageConstants
.
OP
.
PUT_IN
);
}
else
{
task
.
setType
(
StorageConstants
.
OP
.
CHECKOUT
);
}
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
task
.
setPartNumber
(
barcode
.
getPartNumber
());
task
.
setBarcode
(
barcode
.
getBarcode
());
task
.
setNum
(
opQty
);
Storage
storage
=
dataCache
.
getStorage
(
currentTask
.
getCid
());
task
.
setCid
(
storage
.
getCid
());
task
.
setStorageId
(
storage
.
getId
());
task
.
setStorageName
(
storage
.
getName
());
task
.
setPosId
(
operatePos
.
getId
());
task
.
setPosName
(
operatePos
.
getPosName
());
task
=
dataLogDao
.
save
(
task
);
taskService
.
moveTaskToFinished
(
task
);
dataCache
.
updateInventoryAmount
(
currentTask
.
getCid
(),
barcode
.
getPartNumber
(),
opQty
);
dataCache
.
reloadStorage
(
storage
);
}
private
StoragePos
getOrCreateNewPos
(
StoragePos
hostPos
,
String
barcodeId
){
String
newPosName
=
hostPos
.
getPosName
()+
":"
+
barcodeId
;
StoragePos
newPos
=
storagePosManager
.
getByPosName
(
newPosName
);
if
(
newPos
==
null
){
newPos
=
new
StoragePos
();
newPos
.
setPosName
(
newPosName
);
newPos
.
setW
(
hostPos
.
getW
());
newPos
.
setH
(
hostPos
.
getH
());
newPos
.
setHostPosId
(
hostPos
.
getId
());
newPos
.
setPriority
(
hostPos
.
getPriority
());
newPos
.
setStorageId
(
hostPos
.
getStorageId
());
log
.
info
(
"创建新库位["
+
newPosName
+
"]"
);
}
newPos
.
setEnabled
(
true
);
return
newPos
;
}
}
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
查看文件 @
9794c7a
...
...
@@ -44,6 +44,12 @@ public interface ITaskService {
*/
Collection
<
DataLog
>
getQueueTasks
();
Collection
<
DataLog
>
getQueueTasks
(
String
cid
);
void
updateQueueTask
(
DataLog
task
);
void
moveTaskToFinished
(
DataLog
task
);
List
<
DataLog
>
getFinishedTasks
();
Exception
getServerException
(
String
cid
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
9794c7a
...
...
@@ -3,7 +3,6 @@ package com.myproject.webapp.controller.webService;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.*
;
import
com.myproject.api.ITaskNotify
;
import
com.myproject.bean.CodeBean
;
import
com.myproject.bean.json.LiteOrder
;
import
com.myproject.bean.json.LiteOrderItem
;
...
...
@@ -18,6 +17,7 @@ import com.myproject.manager.IHumitureManager;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.model.User
;
import
com.myproject.service.UserManager
;
import
com.myproject.webapp.controller.webService.boxHandler.VerticalBoxHandler
;
import
com.myproject.util.HttpHelper
;
import
com.myproject.util.StorageConstants
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -81,9 +81,9 @@ public class TaskService implements ITaskService {
//private static Map<String, DataLog> executingTaskMap = Maps.newConcurrentMap();
/**
* 完成的任务列表Key 为
ReelId 即 barcode
, Value 为 Datalog
* 完成的任务列表Key 为
dataLog的ID
, Value 为 Datalog
*/
private
static
Map
<
String
,
DataLog
>
f
inishedTaskMap
=
Maps
.
newConcurrentMap
();
private
static
Map
<
String
,
DataLog
>
theF
inishedTaskMap
=
Maps
.
newConcurrentMap
();
/**
* 状态 map,key为 cid value 为状态 Bean
...
...
@@ -107,6 +107,9 @@ public class TaskService implements ITaskService {
*/
public
static
Map
<
String
,
LiteOrder
>
liteOrderMap
=
new
ConcurrentHashMap
<>();
@Autowired
private
VerticalBoxHandler
verticalBoxHandler
;
/**
* 更新客户端发上来的消息(设备故障等消息)
*/
...
...
@@ -129,16 +132,42 @@ public class TaskService implements ITaskService {
return
taskMap
.
values
();
}
@Override
public
Collection
<
DataLog
>
getQueueTasks
(
String
cid
)
{
List
<
DataLog
>
tasks
=
new
ArrayList
<>();
for
(
DataLog
dataLog
:
taskMap
.
values
())
{
if
(
dataLog
.
getCid
().
equals
(
cid
)){
tasks
.
add
(
dataLog
);
}
}
return
tasks
;
}
@Override
public
void
updateQueueTask
(
DataLog
task
){
taskMap
.
put
(
task
.
getId
(),
task
);
}
/**
* 将任务从执行队列中移动到完成队列中
* @param task
*/
@Override
public
void
moveTaskToFinished
(
DataLog
task
){
taskMap
.
remove
(
task
.
getId
());
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
}
/**
* 获取某区域已完成的任务
*/
@Override
public
List
<
DataLog
>
getFinishedTasks
(){
List
<
DataLog
>
areaFinishedTasks
=
Lists
.
newArrayList
(
f
inishedTaskMap
.
values
());
List
<
DataLog
>
areaFinishedTasks
=
Lists
.
newArrayList
(
theF
inishedTaskMap
.
values
());
List
<
DataLog
>
resultTasks
=
Lists
.
newArrayList
();
for
(
DataLog
task
:
areaFinishedTasks
){
if
(
task
.
needRemoveFromCache
()){
finishedTaskMap
.
remove
(
task
.
getBarcode
());
theFinishedTaskMap
.
remove
(
task
.
getId
());
}
else
{
resultTasks
.
add
(
task
);
}
...
...
@@ -672,10 +701,8 @@ public class TaskService implements ITaskService {
if
(
task
!=
null
){
//从正在执行和等待列表中移除
taskMap
.
remove
(
task
.
getId
());
String
barcode
=
task
.
getBarcode
();
if
(!
Strings
.
isNullOrEmpty
(
barcode
)){
finishedTaskMap
.
put
(
task
.
getBarcode
(),
task
);
}
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
CANCEL
.
name
());
dataLogDao
.
save
(
task
);
...
...
@@ -983,52 +1010,16 @@ public class TaskService implements ITaskService {
synchronized
(
storage
){
//log.info("reqseq:"+statusBean.getSeq());
StatusBean
resultStatus
=
saveStatus
(
statusBean
);
if
(
storage
.
isVerticalBox
()){
//垂直货柜
return
verticalBoxHandler
.
handleClientStatusBean
(
statusBean
);
}
//清空 msg 的内容,因为客户端会据此决定命令是否执行
statusBean
.
setMsg
(
""
);
if
(
storage
.
isSolderPaste
()){
if
(
statusBean
.
getStatus
()
==
StorageConstants
.
STATUS
.
READY
){
//锡膏料仓空闲
Collection
<
DataLog
>
areaWaitTasks
=
taskMap
.
values
();
for
(
DataLog
task
:
areaWaitTasks
)
{
if
(
cid
.
equals
(
task
.
getCid
())&&
task
.
isWait
()){
if
(
task
.
isRewarmTakingTask
()){
//回温取料任务
statusBean
.
setOp
(
StorageConstants
.
OP
.
REWARM_TAKING
);
statusBean
.
addData
(
"posId"
,
task
.
getPosName
());
DataLog
rewarmPuttingTask
=
findRewarmPuttingTask
(
task
);
statusBean
.
addData
(
"secondPosId"
,
rewarmPuttingTask
.
getPosName
());
log
.
info
(
task
.
getBarcode
()
+
"回温移库信息发送到客户端["
+
task
.
getPosName
()+
"]=>"
+
rewarmPuttingTask
.
getPosName
());
rewarmPuttingTask
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskMap
.
put
(
rewarmPuttingTask
.
getId
(),
rewarmPuttingTask
);
dataLogDao
.
save
(
rewarmPuttingTask
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskMap
.
put
(
task
.
getId
(),
task
);
dataLogDao
.
save
(
task
);
return
statusBean
;
}
else
if
(
task
.
isMixTask
()){
//搅拌任务
statusBean
.
setOp
(
StorageConstants
.
OP
.
MIX
);
statusBean
.
addData
(
"posId"
,
task
.
getPosName
());
statusBean
.
addData
(
"barcode"
,
task
.
getBarcode
());
statusBean
.
addData
(
"weight"
,
task
.
getNum
()+
""
);
statusBean
.
addData
(
"mixTime"
,
task
.
getMixTime
()
+
""
);
statusBean
=
handleClientStatusBean
(
statusBean
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskMap
.
put
(
task
.
getId
(),
task
);
dataLogDao
.
save
(
task
);
return
statusBean
;
}
}
}
}
if
(
storage
.
isSolderPaste
()){
return
handleSolderPaste
(
cid
,
statusBean
);
}
//料柜
...
...
@@ -1064,8 +1055,6 @@ public class TaskService implements ITaskService {
return
statusBean
;
}
if
(
statusBean
.
getOp
()
==
StorageConstants
.
OP
.
ALARM_DATA
){
log
.
info
(
"获取温湿度报警值"
);
statusBean
.
setTemperature
(
dataCache
.
getSettings
().
getMaxTemperature
());
...
...
@@ -1096,6 +1085,53 @@ public class TaskService implements ITaskService {
}
/**
* 处理锡膏料仓相关信息
*/
private
StatusBean
handleSolderPaste
(
String
cid
,
StatusBean
statusBean
){
if
(
statusBean
.
getStatus
()
==
StorageConstants
.
STATUS
.
READY
){
//锡膏料仓空闲
Collection
<
DataLog
>
areaWaitTasks
=
taskMap
.
values
();
for
(
DataLog
task
:
areaWaitTasks
)
{
if
(
cid
.
equals
(
task
.
getCid
())&&
task
.
isWait
()){
if
(
task
.
isRewarmTakingTask
()){
//回温取料任务
statusBean
.
setOp
(
StorageConstants
.
OP
.
REWARM_TAKING
);
statusBean
.
addData
(
"posId"
,
task
.
getPosName
());
DataLog
rewarmPuttingTask
=
findRewarmPuttingTask
(
task
);
statusBean
.
addData
(
"secondPosId"
,
rewarmPuttingTask
.
getPosName
());
log
.
info
(
task
.
getBarcode
()
+
"回温移库信息发送到客户端["
+
task
.
getPosName
()+
"]=>"
+
rewarmPuttingTask
.
getPosName
());
rewarmPuttingTask
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskMap
.
put
(
rewarmPuttingTask
.
getId
(),
rewarmPuttingTask
);
dataLogDao
.
save
(
rewarmPuttingTask
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskMap
.
put
(
task
.
getId
(),
task
);
dataLogDao
.
save
(
task
);
return
statusBean
;
}
else
if
(
task
.
isMixTask
()){
//搅拌任务
statusBean
.
setOp
(
StorageConstants
.
OP
.
MIX
);
statusBean
.
addData
(
"posId"
,
task
.
getPosName
());
statusBean
.
addData
(
"barcode"
,
task
.
getBarcode
());
statusBean
.
addData
(
"weight"
,
task
.
getNum
()+
""
);
statusBean
.
addData
(
"mixTime"
,
task
.
getMixTime
()
+
""
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskMap
.
put
(
task
.
getId
(),
task
);
dataLogDao
.
save
(
task
);
return
statusBean
;
}
}
}
}
return
statusBean
;
}
/**
* 处理客户端发送上来的消息(保存故障信息,并显示界面)
* @param statusBean
*/
...
...
@@ -1110,104 +1146,49 @@ public class TaskService implements ITaskService {
}
}
/**
* 出库完成 status为 OUT_FINISHED = 10 出仓位完成,设置posId
* @param statusBeanToSave
* @return
*/
public
StatusBean
saveStatus
(
StatusBean
statusBeanToSave
)
{
String
cid
=
statusBeanToSave
.
getCid
();
StatusBean
statusBean
=
statusMap
.
get
(
cid
);
boolean
needSaveToMongo
=
false
;
if
(
statusBean
==
null
)
{
statusBean
=
statusBeanToSave
;
needSaveToMongo
=
true
;
}
else
{
needSaveToMongo
=
statusBean
.
needSaveToMongo
();
}
statusBean
.
setTime
(
System
.
currentTimeMillis
());
Map
<
Integer
,
BoxStatusBean
>
statusOfBoxes
=
statusBeanToSave
.
getBoxStatus
();
statusBean
.
setBoxStatus
(
statusOfBoxes
);
statusBean
.
setData
(
statusBeanToSave
.
getData
());
statusBean
.
setMsg
(
statusBeanToSave
.
getMsg
());
statusBean
.
setStatus
(
statusBeanToSave
.
getStatus
());
statusBean
.
setOp
(
statusBeanToSave
.
getOp
());
statusBean
.
setSeq
(
statusBeanToSave
.
getSeq
());
/**
* 已解除的报警信息存到数据库中
*/
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
!=
null
){
List
<
AlarmInfo
>
endAlarmList
=
statusBean
.
getEndAlarmList
(
storage
.
getName
(),
statusBeanToSave
.
getAlarmList
());
alarmInfoDao
.
insertAll
(
endAlarmList
);
}
private
StatusBean
handleClientStatusBean
(
StatusBean
statusBean
){
Map
<
Integer
,
BoxStatusBean
>
statusOfBoxes
=
statusBean
.
getBoxStatus
();
if
(
statusOfBoxes
!=
null
)
{
for
(
BoxStatusBean
boxStatus
:
statusOfBoxes
.
values
())
{
int
boxId
=
boxStatus
.
getBoxId
();
//判断设备状态是否需要保存到数据库中
dataCache
.
updateDeviceStatus
(
cid
,
boxId
,
boxStatus
.
getData
());
if
(
needSaveToMongo
)
{
//保存温湿度到数据库
Humiture
humiture
=
new
Humiture
();
humiture
.
setCid
(
cid
);
humiture
.
setBoxId
(
boxId
);
String
humidity
=
boxStatus
.
getHumidity
();
String
temperature
=
boxStatus
.
getTemperature
();
if
(!
Strings
.
isNullOrEmpty
(
humidity
)
&&
!
Strings
.
isNullOrEmpty
(
temperature
))
{
humiture
.
setHumidity
(
humidity
);
humiture
.
setTemperature
(
temperature
);
try
{
humitureManager
.
save
(
humiture
);
statusBean
.
setLastSaveTime
(
System
.
currentTimeMillis
());
}
catch
(
ValidateException
e
)
{
}
}
}
try
{
//出库入库完成处理
int
status
=
boxStatus
.
getStatus
();
String
posName
=
boxStatus
.
getPosId
();
if
(!
Strings
.
isNullOrEmpty
(
posName
)){
//客户端发一次完成之后,会发空的 posName,不需要处理
if
(
StorageConstants
.
BOX_STATUS
.
IN_FINISHED
==
status
)
{
//入仓完成
DataLog
task
=
findExecutingTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
task
=
findExecutingTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
task
!=
null
)
{
log
.
info
(
task
.
getBarcode
()
+
"入仓位["
+
task
.
getPosName
()
+
"]完成"
);
DataLog
cancelTask
=
findFinishedTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
cancelTask
=
findFinishedTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
cancelTask
!=
null
&&
cancelTask
.
isCancel
()){
//将相同库位已经取消的任务从完成队列里删除
finishedTaskMap
.
remove
(
cancelTask
.
getBarcode
());
theFinishedTaskMap
.
remove
(
cancelTask
.
getId
());
log
.
info
(
"从已完成的任务列表中删除之前取消的任务:"
+
cancelTask
.
getPosName
()
+
" ReelId:"
+
cancelTask
.
getBarcode
());
}
putInFinished
(
task
);
}
else
{
//从已完成列表中找,如果还找不到就忽略
task
=
findFinishedTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
task
=
findFinishedTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
task
!=
null
)
{
if
(
task
.
isCancel
()){
//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log
.
info
(
task
.
getBarcode
()
+
"入仓位["
+
task
.
getPosName
()
+
"]完成,但任务已被取消,修改为完成"
);
putInFinished
(
task
);
}
}
else
{
log
.
error
(
statusBean
ToSave
.
getCid
()
+
"入仓位["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
log
.
error
(
statusBean
.
getCid
()
+
"入仓位["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
}
}
}
else
if
(
StorageConstants
.
BOX_STATUS
.
IN_FAILED
==
status
)
{
//入库失败
//暂不处理
}
else
if
(
StorageConstants
.
BOX_STATUS
.
OUT_FINISHED
==
status
)
{
//出仓完成
DataLog
task
=
findExecutingTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
task
=
findExecutingTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
task
!=
null
)
{
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成"
);
DataLog
cancelTask
=
findFinishedTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
cancelTask
=
findFinishedTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
cancelTask
!=
null
&&
cancelTask
.
isCancel
()){
//将相同库位已经取消的任务从完成队列里删除
finishedTaskMap
.
remove
(
cancelTask
.
getBarcode
());
theFinishedTaskMap
.
remove
(
cancelTask
.
getId
());
log
.
info
(
"从已完成的任务列表中删除之前取消的任务:"
+
cancelTask
.
getPosName
()
+
" ReelId:"
+
cancelTask
.
getBarcode
());
}
//dataCache.unLockOneReel(task.getCid(),task.getPartNumber());
...
...
@@ -1215,32 +1196,32 @@ public class TaskService implements ITaskService {
}
else
{
//log.error(operationKey + "触发仓位完成时,操作队列中不存在");
//从已完成列表中找,如果还找不到就忽略
task
=
findFinishedTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
task
=
findFinishedTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
task
!=
null
)
{
if
(
task
.
isCancel
()){
//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,但任务已被取消,修改为完成"
);
checkoutFinished
(
task
);
}
}
else
{
log
.
warn
(
statusBean
ToSave
.
getCid
()
+
"出仓位["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
log
.
warn
(
statusBean
.
getCid
()
+
"出仓位["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
}
}
}
else
if
(
StorageConstants
.
BOX_STATUS
.
OUT_END
==
status
)
{
//出库完成(放到仓门口
//暂不处理
}
else
if
(
StorageConstants
.
BOX_STATUS
.
REWARM_TAKING_END
==
status
){
//回温取料完成, 将库位清空
DataLog
takingTask
=
findExecutingTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
takingTask
=
findExecutingTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
takingTask
==
null
){
//从已完成列表中找,如果还找不到就忽略
takingTask
=
findFinishedTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
takingTask
=
findFinishedTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
}
if
(
takingTask
!=
null
){
if
(
takingTask
.
isCancel
()){
//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log
.
warn
(
statusBean
ToSave
.
getCid
()
+
"回温取料["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
log
.
warn
(
statusBean
.
getCid
()
+
"回温取料["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
}
DataLog
puttingTask
=
null
;
for
(
DataLog
dataLog
:
taskMap
.
values
())
{
if
(
dataLog
.
getCid
().
equals
(
cid
))
{
if
(
dataLog
.
getCid
().
equals
(
statusBean
.
getCid
()
))
{
if
(
dataLog
.
getBarcode
().
equals
(
takingTask
.
getBarcode
())){
if
(
dataLog
.
isRewarmPuttingTask
()){
puttingTask
=
dataLog
;
...
...
@@ -1258,18 +1239,18 @@ public class TaskService implements ITaskService {
statusBean
.
addData
(
"secondPosId"
,
puttingTask
.
getPosName
());
}
}
else
{
log
.
warn
(
statusBeanToSave
.
getCid
()
+
"出仓位["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
log
.
warn
(
statusBean
.
getCid
()
+
"出仓位["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
}
}
else
if
(
StorageConstants
.
BOX_STATUS
.
REWARM_PUTTING_END
==
status
){
//回温放料结束
DataLog
puttingTask
=
findExecutingTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
puttingTask
=
findExecutingTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
if
(
puttingTask
==
null
){
//从已完成列表中找,如果还找不到就忽略
puttingTask
=
findFinishedTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
puttingTask
=
findFinishedTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
}
if
(
puttingTask
!=
null
)
{
if
(
puttingTask
.
isCancel
())
{
//被取消的任务,客户端发完成信号过来,修改取消状态为已完成
log
.
warn
(
statusBean
ToSave
.
getCid
()
+
"回温取料["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
log
.
warn
(
statusBean
.
getCid
()
+
"回温取料["
+
boxStatus
.
getPosId
()
+
"]完成时任务不存在"
);
}
}
rewarmPuttingEnd
(
puttingTask
);
...
...
@@ -1288,7 +1269,7 @@ public class TaskService implements ITaskService {
}
else
if
(
StorageConstants
.
BOX_STATUS
.
MIX_END
==
status
){
//搅拌放回原位完成
DataLog
mixTask
=
findExecutingTask
(
statusBean
ToSave
.
getCid
(),
boxStatus
.
getPosId
());
DataLog
mixTask
=
findExecutingTask
(
statusBean
.
getCid
(),
boxStatus
.
getPosId
());
mixEnd
(
mixTask
);
}
}
...
...
@@ -1297,8 +1278,75 @@ public class TaskService implements ITaskService {
}
}
}
return
statusBean
;
}
/**
* 出库完成 status为 OUT_FINISHED = 10 出仓位完成,设置posId
* @param statusBeanToSave
* @return
*/
public
StatusBean
saveStatus
(
StatusBean
statusBeanToSave
)
{
String
cid
=
statusBeanToSave
.
getCid
();
StatusBean
statusBean
=
statusMap
.
get
(
cid
);
boolean
needSaveToMongo
=
false
;
if
(
statusBean
==
null
)
{
statusBean
=
statusBeanToSave
;
needSaveToMongo
=
true
;
}
else
{
needSaveToMongo
=
statusBean
.
needSaveToMongo
();
}
statusBean
.
setTime
(
System
.
currentTimeMillis
());
Map
<
Integer
,
BoxStatusBean
>
statusOfBoxes
=
statusBeanToSave
.
getBoxStatus
();
statusBean
.
setBoxStatus
(
statusOfBoxes
);
statusBean
.
setData
(
statusBeanToSave
.
getData
());
statusBean
.
setMsg
(
statusBeanToSave
.
getMsg
());
statusBean
.
setStatus
(
statusBeanToSave
.
getStatus
());
statusBean
.
setOp
(
statusBeanToSave
.
getOp
());
statusBean
.
setSeq
(
statusBeanToSave
.
getSeq
());
/**
* 已解除的报警信息存到数据库中
*/
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
!=
null
){
List
<
AlarmInfo
>
endAlarmList
=
statusBean
.
getEndAlarmList
(
storage
.
getName
(),
statusBeanToSave
.
getAlarmList
());
alarmInfoDao
.
insertAll
(
endAlarmList
);
}
if
(
statusOfBoxes
!=
null
){
for
(
BoxStatusBean
boxStatus
:
statusOfBoxes
.
values
())
{
int
boxId
=
boxStatus
.
getBoxId
();
//判断设备状态是否需要保存到数据库中
dataCache
.
updateDeviceStatus
(
cid
,
boxId
,
boxStatus
.
getData
());
if
(
needSaveToMongo
)
{
//保存温湿度到数据库
Humiture
humiture
=
new
Humiture
();
humiture
.
setCid
(
cid
);
humiture
.
setBoxId
(
boxId
);
String
humidity
=
boxStatus
.
getHumidity
();
String
temperature
=
boxStatus
.
getTemperature
();
if
(!
Strings
.
isNullOrEmpty
(
humidity
)
&&
!
Strings
.
isNullOrEmpty
(
temperature
))
{
humiture
.
setHumidity
(
humidity
);
humiture
.
setTemperature
(
temperature
);
try
{
humitureManager
.
save
(
humiture
);
statusBean
.
setLastSaveTime
(
System
.
currentTimeMillis
());
}
catch
(
ValidateException
e
)
{
}
}
}
}
}
statusMap
.
put
(
cid
,
statusBean
);
//清空 msg 的内容,因为客户端会据此决定命令是否执行
statusBean
.
setMsg
(
""
);
return
statusBean
;
}
...
...
@@ -1321,7 +1369,7 @@ public class TaskService implements ITaskService {
taskMap
.
remove
(
mixTask
.
getId
());
mixTask
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
dataLogDao
.
save
(
mixTask
);
finishedTaskMap
.
put
(
mixTask
.
getBarcode
(),
mixTask
);
theFinishedTaskMap
.
put
(
mixTask
.
getId
(),
mixTask
);
changeSolderStatus
(
mixTask
.
getPosId
(),
StorageConstants
.
SOLDER_STATUS
.
TO_BE_OUT
);
}
else
{
...
...
@@ -1358,7 +1406,7 @@ public class TaskService implements ITaskService {
//记录日志,完成 task
puttingTask
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
dataLogDao
.
save
(
puttingTask
);
finishedTaskMap
.
put
(
puttingTask
.
getBarcode
(),
puttingTask
);
theFinishedTaskMap
.
put
(
puttingTask
.
getId
(),
puttingTask
);
}
/**
...
...
@@ -1386,7 +1434,7 @@ public class TaskService implements ITaskService {
//记录日志
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
dataLogDao
.
save
(
task
);
finishedTaskMap
.
put
(
task
.
getBarcode
(),
task
);
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
}
private
DataLog
findFinishedTask
(
String
cid
,
String
posName
){
...
...
@@ -1609,7 +1657,7 @@ public class TaskService implements ITaskService {
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
task
=
dataLogDao
.
save
(
task
);
finishedTaskMap
.
put
(
task
.
getBarcode
(),
task
);
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
}
catch
(
Exception
e
){
}
...
...
@@ -1726,7 +1774,7 @@ public class TaskService implements ITaskService {
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
dataLogDao
.
save
(
task
);
finishedTaskMap
.
put
(
task
.
getBarcode
(),
task
);
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
}
private
boolean
postInNotification
(
String
url
,
String
reelBarcode
,
String
storageId
){
...
...
@@ -1833,7 +1881,7 @@ public class TaskService implements ITaskService {
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
());
dataLogDao
.
save
(
task
);
finishedTaskMap
.
put
(
task
.
getBarcode
(),
task
);
theFinishedTaskMap
.
put
(
task
.
getId
(),
task
);
//notifyTask(task);
//dataCache.updateStorage(task.getCid());
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/boxHandler/VerticalBoxHandler.java
0 → 100644
查看文件 @
9794c7a
package
com
.
myproject
.
webapp
.
controller
.
webService
.
boxHandler
;
import
com.google.common.base.Strings
;
import
com.myproject.bean.search.PageList
;
import
com.myproject.bean.update.*
;
import
com.myproject.bean.utils.BoxStatusBean
;
import
com.myproject.bean.utils.StatusBean
;
import
com.myproject.dao.mongo.IBarcodeDao
;
import
com.myproject.dao.mongo.IDataLogDao
;
import
com.myproject.exception.ValidateException
;
import
com.myproject.manager.IBarcodeManager
;
import
com.myproject.manager.IComponentManager
;
import
com.myproject.manager.IStoragePosManager
;
import
com.myproject.util.StorageConstants
;
import
com.myproject.webapp.controller.webService.DataCache
;
import
com.myproject.webapp.controller.webService.TaskService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.Collection
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
/**
* 垂直货柜处理类
*/
@Service
public
class
VerticalBoxHandler
{
protected
final
transient
Logger
log
=
LogManager
.
getLogger
(
getClass
());
@Autowired
protected
TaskService
taskService
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
IDataLogDao
dataLogDao
;
/**
* 当前出入库操作的库位(key为cid, value为当前执行的任务)
*/
private
Map
<
String
,
DataLog
>
operateTaskMap
=
new
ConcurrentHashMap
<>();
/**
* 获取当前正在执行的任务
*/
public
DataLog
getCurrentTask
(
String
cid
){
return
operateTaskMap
.
get
(
cid
);
}
/**
* 更新或清理(task为null)当前正在执行的任务
*/
public
void
updateCurrentTask
(
String
cid
,
DataLog
task
){
if
(
task
==
null
){
operateTaskMap
.
remove
(
cid
);
}
else
{
operateTaskMap
.
put
(
cid
,
task
);
}
}
public
StatusBean
handleClientStatusBean
(
StatusBean
statusBean
){
String
cid
=
statusBean
.
getCid
();
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
(
cid
);
if
(
queueTasks
.
isEmpty
()){
return
statusBean
;
}
if
(
statusBean
.
getStatus
()
==
StorageConstants
.
STATUS
.
READY
){
for
(
DataLog
task
:
queueTasks
)
{
if
(
cid
.
equals
(
task
.
getCid
())
&&
task
.
isWait
())
{
if
(
task
.
isPutInTask
()){
statusBean
.
setOp
(
StorageConstants
.
OP
.
PUT_IN
);
}
else
if
(
task
.
isCheckOutTask
()){
statusBean
.
setOp
(
StorageConstants
.
OP
.
CHECKOUT
);
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
task
.
getPosName
());
if
(
pos
.
isExpandPos
()){
pos
=
storagePosManager
.
get
(
pos
.
getHostPosId
());
}
statusBean
.
addPosInfo
(
""
,
pos
.
getPosName
(),
pos
.
getW
(),
pos
.
getH
(),
false
);
log
.
info
(
"发送到["
+
task
.
getType
()+
"]任务["
+
pos
.
getPosName
()+
"]到客户端"
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
());
taskService
.
updateQueueTask
(
task
);
updateCurrentTask
(
task
.
getCid
(),
task
);
dataLogDao
.
save
(
task
);
return
statusBean
;
}
}
}
Map
<
Integer
,
BoxStatusBean
>
statusOfBoxes
=
statusBean
.
getBoxStatus
();
if
(
statusOfBoxes
!=
null
)
{
for
(
BoxStatusBean
boxStatus
:
statusOfBoxes
.
values
())
{
try
{
//出库入库动作完成处理
int
status
=
boxStatus
.
getStatus
();
String
posName
=
boxStatus
.
getPosId
();
if
(!
Strings
.
isNullOrEmpty
(
posName
)){
//客户端发一次完成之后,会发空的 posName,不需要处理
boolean
needShow
=
false
;
if
(
StorageConstants
.
BOX_STATUS
.
IN_FINISHED
==
status
)
{
//入仓完成
needShow
=
true
;
//弹出入库框
}
else
if
(
StorageConstants
.
BOX_STATUS
.
OUT_FINISHED
==
status
)
{
//出仓完成
//弹出出库框
needShow
=
true
;
}
if
(
needShow
){
DataLog
currentTask
=
null
;
for
(
DataLog
queueTask
:
queueTasks
)
{
if
(
queueTask
.
isExecuting
()
&&
queueTask
.
getPosName
().
equals
(
posName
)){
currentTask
=
queueTask
;
break
;
}
}
DataLog
cacheTask
=
operateTaskMap
.
get
(
cid
);
if
(
currentTask
!=
null
){
if
(
cacheTask
==
null
||
!
cacheTask
.
getId
().
equals
(
currentTask
.
getId
())){
updateCurrentTask
(
currentTask
.
getCid
(),
currentTask
);
}
}
}
}
}
catch
(
Exception
e
)
{
log
.
error
(
"垂直货柜到位时出错"
,
e
);
}
}
}
return
statusBean
;
}
}
myproject/src/main/resources/ApplicationResources.properties
查看文件 @
9794c7a
...
...
@@ -100,8 +100,7 @@ icon.email=E-Mail
icon.email.img
=
/images/iconEmail.gif
icon.warning
=
Warning
icon.warning.img
=
/images/iconWarning.gif
date.format
=
MM/dd/yyyy
search.enterTerms
=
Enter search terms...
date.format
=
yyyy-MM-dd
delete.confirm
=
Are you sure you want to delete this {0}?
# -- for calendar widget: bootstrap-datepicker --
#See: https://github.com/eternicode/bootstrap-datepicker#readme
...
...
myproject/src/main/resources/ApplicationResources_en.properties
查看文件 @
9794c7a
...
...
@@ -100,8 +100,7 @@ icon.email=E-Mail
icon.email.img
=
/images/iconEmail.gif
icon.warning
=
Warning
icon.warning.img
=
/images/iconWarning.gif
date.format
=
MM/dd/yyyy
search.enterTerms
=
Enter search terms...
date.format
=
yyyy-MM-dd
delete.confirm
=
Are you sure you want to delete this {0}?
# -- for calendar widget: bootstrap-datepicker --
#See: https://github.com/eternicode/bootstrap-datepicker#readme
...
...
myproject/src/main/resources/ApplicationResources_jp.properties
查看文件 @
9794c7a
...
...
@@ -83,7 +83,7 @@ icon.email=E-Mail
icon.email.img
=
/images/iconEmail.gif
icon.warning
=
\u
8B66
\u
544A
icon.warning.img
=
/images/iconWarning.gif
date.format
=
MM/dd/yyyy
date.format
=
yyyy-MM-dd
# -- role form --
roleForm.name
=
\u
540D
\u
79F0
...
...
myproject/src/main/resources/ApplicationResources_zh.properties
查看文件 @
9794c7a
...
...
@@ -83,7 +83,7 @@ icon.email=E-Mail
icon.email.img
=
/images/iconEmail.gif
icon.warning
=
\u
8B66
\u
544A
icon.warning.img
=
/images/iconWarning.gif
date.format
=
MM/dd/yyyy
date.format
=
yyyy-MM-dd
# -- role form --
roleForm.name
=
\u
540D
\u
79F0
...
...
myproject/src/main/resources/StorageResources.properties
查看文件 @
9794c7a
...
...
@@ -110,6 +110,7 @@ barcode.error.notExist={0} does not exist
barcode.error.inStorage
=
{0} in the storage
barcode.error.slotExist
=
Component is not in the storage
barcode.memo
=
Memo
barcode.lastDate
=
Put In Date
storage.search.subtitle
=
Storage Search
storage.item.name
=
Storage
...
...
@@ -131,6 +132,15 @@ storage.status.10=Materail Retrieval Completed
storage.status.11
=
Material Retrieval End
storage.status.12
=
Material transfering
storage.status.13
=
System resetting
storage.status.14
=
Fetching for rewarm
storage.status.15
=
rewarm fetch finished
storage.status.16
=
putting for rewarm
storage.status.17
=
rewarm put finished
storage.status.18
=
Fetching for stir
storage.status.19
=
Waiting to stir
storage.status.20
=
stirring
storage.status.21
=
Backing to position after stirring
storage.status.22
=
finish stirring
sotrage.status.999
=
Offline
storage.type
=
Type
storage.type.auto
=
Auto
...
...
@@ -409,3 +419,15 @@ error.storage.noPosFind=No availble position is found.
msg.line.putIn
=
Put [{0}] into [{1}]
delete.confirm
=
Are you sure to delete?
barcode.error.used
=
Barcode is used.
solderBox.btn.closeDoor
=
Close Door
solderBox.btn.openDoor
=
Open Door
solderBox.task.outTime
=
Estimated shipping time
solder.status.1
=
Refrigerated
solder.status.2
=
Rewarming
solder.status.3
=
Waiting to stir
solder.status.4
=
Strring
solder.status.5
=
Waiting shipment
solder.status.6
=
Outting
solder.status.7
=
Retreat storage
\ No newline at end of file
myproject/src/main/resources/StorageResources_en.properties
查看文件 @
9794c7a
...
...
@@ -404,3 +404,23 @@ settings.remind.title=Remind Setting
settings.remind.deadday
=
days dead metiral remind
order.num.modify
=
Order Qty Modify
order.modify.tip
=
Modify Qty to
\:
current quantity times
barcode.lastDate
=
Put In Date
solderBox.btn.closeDoor
=
Close Door
solderBox.btn.openDoor
=
Open Door
solderBox.task.outTime
=
Estimated shipping time
storage.status.14
=
Fetching for rewarm
storage.status.15
=
rewarm fetch finished
storage.status.16
=
putting for rewarm
storage.status.17
=
rewarm put finished
storage.status.18
=
Fetching for stir
storage.status.19
=
Waiting to stir
storage.status.20
=
stirring
storage.status.21
=
Backing to position after stirring
storage.status.22
=
finish stirring
solder.status.1
=
Refrigerated
solder.status.2
=
Rewarming
solder.status.3
=
Waiting to stir
solder.status.4
=
Strring
solder.status.5
=
Waiting shipment
solder.status.6
=
Outting
solder.status.7
=
Retreat storage
myproject/src/main/resources/StorageResources_jp.properties
查看文件 @
9794c7a
...
...
@@ -400,3 +400,23 @@ settings.remind.deadday=\u5929\u524D\u5446\u6EDE\u7269\u6599\u63D0\u9192
barcode.error.used
=
\u
5DF2
\u
88AB
\u
4F7F
\u7528\u7684\u6761\u7801\u
65E0
\u
6CD5
\u5220\u9664
order.num.modify
=
\u
5DE5
\u5355\u6570\u
91CF
\u
4FEE
\u6539
order.modify.tip
=
\u
4FEE
\u6539\u
5DE5
\u5355\u6570\u
91CF
\u
4E3A
\:
\u
5F53
\u
524D
\u6570\u
91CF x
barcode.lastDate
=
\u5165\u
5E93
\u
65F6
\u
95F4
solderBox.btn.closeDoor
=
\u6238\u3092\u9589\u3081\u
308B
solderBox.btn.openDoor
=
\u
30C9
\u
30A2
\u3092\u
958B
\u3051\u
308B
solderBox.task.outTime
=
\u
767A
\u9001\u
307E
\u3067\u
306E
\u6642\u9593\u
306E
\u
76EE
\u
5B89
storage.status.14
=
\u
518D
\u6696\u3092\u
53D6
\u
308B
\u3053\u3068
storage.status.15
=
\u
6E29
\u3081\u
76F4
\u3057
storage.status.16
=
\u
6E29
\u3081\u
7F6E
\u
304D
storage.status.17
=
\u
6E29
\u3081\u
76F4
\u3059
storage.status.18
=
\u
64B9
\u
62CC
\u
306E
\u
305F
\u3081\u
306E
\u
30D5
\u
30A7
\u
30C3
\u
30C1
\u
30F3
\u
30B0
storage.status.19
=
\u
652A
\u
62CC
\u3092\u
5F85
\u3063\u3066\u3044\u
308B
storage.status.20
=
\u9032\u
884C
\u
4E2D
\u
306E
\u
30DF
\u
30AD
\u
30B7
\u
30F3
\u
30B0
storage.status.21
=
\u
30DF
\u
30AD
\u
30B7
\u
30F3
\u
30B0
\u
304C
\u
7D42
\u
308F
\u3063\u3066\u5009\u
5EAB
\u
306B
\u
623B
\u
308B
storage.status.22
=
\u
304B
\u
304D
\u
307E
\u
308F
\u3059
solder.status.1
=
\u
51B7
\u8535
solder.status.2
=
\u
6E29
\u6696\u5316
solder.status.3
=
\u
652A
\u
62CC
\u3092\u
5F85
\u3063\u3066\u3044\u
308B
solder.status.4
=
\u9032\u
884C
\u
4E2D
\u
306E
\u
30DF
\u
30AD
\u
30B7
\u
30F3
\u
30B0
solder.status.5
=
\u5165\u8377\u
5F85
\u3061
solder.status.6
=
\u
4FDD
\u
7BA1
\u5834\u6240\u
306E
\u5916
solder.status.7
=
\u
30EA
\u
30C8
\u
30EA
\u
30FC
\u
30C8
\u
53CE
\u
7D0D
\ No newline at end of file
myproject/src/main/resources/StorageResources_zh_CN.properties
查看文件 @
9794c7a
...
...
@@ -400,3 +400,23 @@ settings.remind.deadday=\u5929\u524D\u5446\u6EDE\u7269\u6599\u63D0\u9192
barcode.error.used
=
\u
5DF2
\u
88AB
\u
4F7F
\u7528\u7684\u6761\u7801\u
65E0
\u
6CD5
\u5220\u9664
order.num.modify
=
\u
5DE5
\u5355\u6570\u
91CF
\u
4FEE
\u6539
order.modify.tip
=
\u
4FEE
\u6539\u
5DE5
\u5355\u6570\u
91CF
\u
4E3A
\:
\u
5F53
\u
524D
\u6570\u
91CF x
barcode.lastDate
=
\u5165\u
5E93
\u
65F6
\u
95F4
solderBox.btn.closeDoor
=
\u5173\u
95E8
solderBox.btn.openDoor
=
\u
5F00
\u
95E8
solderBox.task.outTime
=
\u9884\u
8BA1
\u
51FA
\u
5E93
\u
65F6
\u
95F4
storage.status.14
=
\u
56DE
\u
6E29
\u
53D6
\u6599\u
4E2D
storage.status.15
=
\u
56DE
\u
6E29
\u
53D6
\u6599\u
5B8C
\u6210
storage.status.16
=
\u
56DE
\u
6E29
\u
653E
\u6599\u
4E2D
storage.status.17
=
\u
56DE
\u
6E29
\u
653E
\u6599\u
5B8C
\u6210
storage.status.18
=
\u6405\u
62CC
\u
53D6
\u6599\u
4E2D
storage.status.19
=
\u
7B49
\u
5F85
\u6405\u
62CC
storage.status.20
=
\u6405\u
62CC
\u6267\u
884C
\u
4E2D
storage.status.21
=
\u6405\u
62CC
\u
5B8C
\u6210\u
56DE
\u
4ED3
storage.status.22
=
\u6405\u
62CC
\u
5B8C
\u6210
solder.status.1
=
\u
51B7
\u
85CF
\u
4E2D
solder.status.2
=
\u
56DE
\u
6E29
\u
4E2D
solder.status.3
=
\u
5F85
\u6405\u
62CC
solder.status.4
=
\u6405\u
62CC
\u
4E2D
solder.status.5
=
\u
5F85
\u
51FA
\u
5E93
solder.status.6
=
\u
51FA
\u
5E93
\u
4E2D
solder.status.7
=
\u9000\u
5E93
\u
5B58
\u
50A8
\ No newline at end of file
myproject/src/main/webapp/WEB-INF/pages/component/storagePosFind.jsp
查看文件 @
9794c7a
...
...
@@ -39,7 +39,6 @@
</c:if>
<div class="portlet-body">
<!-- 正常展示-->
<c:if test='<%=!DataCache.isProductionFor("ChengDuKaiTian") %>'>
<form:form commandName="searchCriteria" class="form-horizontal form-bordered" id="searchCriteria"
action="storagePosFind.html">
...
...
@@ -157,7 +156,7 @@
<c:set var="alarmClass" value="alarmItem"/>
</c:if>
<c:set var="inactionClass" value=""/>
<c:if test="${pos.
inStoreHour/24 >= inactionDay
}">
<c:if test="${pos.
updateDate <= inactionDate
}">
<c:set var="inactionClass" value="inactionItem"/>
</c:if>
...
...
@@ -194,11 +193,14 @@
<%--<display:column property="barcode.lockName" titleKey="menu.inRule"/>--%>
<display:column property="posName" titleKey="checkOut.pos" sortProperty="posName" sortable="true"/>
<display:column titleKey="barcode.inStoreRemainTime" sortProperty="barcode.putInTime" sortable="true" class="${inactionClass}">
<c:if test="${pos.inStoreHour >= 1}">${pos.inStoreHour}<fmt:message key="solder.hour"/></c:if><c:if test="${pos.inStoreMiniute != 0}">${pos.inStoreMiniute}<fmt:message key="runStatus.minutes"/>
<c:if test="${pos.barcode.maxStorageTime != 0 }">
/${pos.barcode.maxStorageTime}<fmt:message key="solder.hour"/></c:if>
</c:if>
<%--<display:column titleKey="barcode.inStoreRemainTime" sortProperty="barcode.putInTime" sortable="true" class="${inactionClass}">--%>
<%--<c:if test="${pos.inStoreHour >= 1}">${pos.inStoreHour}<fmt:message key="solder.hour"/></c:if><c:if test="${pos.inStoreMiniute != 0}">${pos.inStoreMiniute}<fmt:message key="runStatus.minutes"/>--%>
<%--<c:if test="${pos.barcode.maxStorageTime != 0 }">--%>
<%--/${pos.barcode.maxStorageTime}<fmt:message key="solder.hour"/></c:if>--%>
<%--</c:if>--%>
<%--</display:column>--%>
<display:column titleKey="barcode.lastDate" sortProperty="updateDate" sortable="true" class="${inactionClass}">
<fmt:formatDate value="${pos.updateDate}" pattern="yyyy-MM-dd"/>
</display:column>
<display:column titleKey="component.amount">
...
...
@@ -225,114 +227,7 @@
</c:if>
</display:table>
</div>
</c:if>
<!-- 成都凯天-->
<c:if test='<%=DataCache.isProductionFor("ChengDuKaiTian") %>'>
<form:form commandName="searchCriteria" class="form-horizontal form-bordered" id="searchCriteria"
action="storagePosFind.html">
<div class="form-group">
<label class="control-label col-md-1"><fmt:message key="产品型号"/></label>
<div class="col-md-2">
<input type="text" name="otherField2" class="form-control" value="${otherField2}"/>
</div>
<label class="control-label col-md-1"><fmt:message key="组件型号"/></label>
<div class="col-md-2">
<input type="text" name="otherField3" class="form-control" value="${otherField3}"/>
</div>
<label class="control-label col-md-1"><fmt:message key="配套单号"/></label>
<div class="col-md-2">
<input type="text" name="otherField1" class="form-control" value="${otherField1}"/>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-1"><fmt:message key="元件型号"/></label>
<div class="col-md-2">
<input type="text" name="otherField4" class="form-control" value="${otherField4}"/>
</div>
<label class="control-label col-md-1"><fmt:message key="检验编号"/></label>
<div class="col-md-2">
<input type="text" name="otherField5" class="form-control" value="${otherField5}"/>
</div>
<div class="col-md-2">
<button class="btn purple" type="submit"><i class="fa fa-search"></i><fmt:message key="button.search"/> </button>
</div>
</div>
</form:form>
<div class="table-toolbar">
<div class="col-md-6">
<div class="btn-group">
<button class="btn yellow" id="checkoutBtn">
<i class="fa fa-sign-out"></i><fmt:message key="出库所选仓位"/></button>
</div>
</div>
<div class="col-md-6">
<div class="input-inline input right">
<div class="input-group">
<input id="day" type="text" value="3" class="form-control" style="display: block;text-align:right;">
<span class="input-group-addon">天前</span>
<span class="input-group-btn">
<button class="btn green" type="button" id="inactionCheckOut"><i class="fa fa-check"></i>呆滞料出库</button>
</span>
</div>
</div>
</div>
</div>
<div class="table-scrollable">
<display:table name="searchCriteria.pageList" requestURI="storagePosFind.html" sort="external"
defaultsort="1" class="table table-striped table-bordered table-hover" export="false"
id="pos">
<c:set var="alarmClass" value=""/>
<c:if test="${pos.barcode.type == 1 && pos.barcode.maxStorageTime != 0 && pos.inStoreHour >= pos.barcode.maxStorageTime}">
<c:set var="alarmClass" value="alarmItem"/>
</c:if>
<c:set var="limitCheckOut" value="${pos.locked || (pos.barcode.solder && pos.barcode.solderStatus >= 5)}"/>
<display:column title="<input type='checkbox' id='allCheck'/>">
<c:if test="${!limitCheckOut}">
<input type="checkbox" name="posIds" value="${pos.id}" id="check${pos.id}" class="limit${pos.barcode.inFixture}"/>
</c:if>
</display:column>
<display:column titleKey="">${pos_rowNum}</display:column>
<display:column property="barcode.barcode" sortProperty="barcode.barcode" sortable="true" titleKey="barcode.barcode"/>
<%--<display:column property="barcode.otherField2" sortProperty="barcode.otherField2" sortable="true" titleKey="产品型号"/>--%>
<%--<display:column property="barcode.otherField3" sortProperty="barcode.otherField3" sortable="true" titleKey="组件型号"/>--%>
<%--<display:column property="barcode.otherField1" sortProperty="barcode.otherField1" sortable="true" titleKey="配套单号"/>--%>
<%--<display:column property="barcode.otherField4" sortProperty="barcode.otherField4" sortable="true" titleKey="元件型号"/>--%>
<%--<display:column property="barcode.otherField5" sortProperty="barcode.otherField5" sortable="true" titleKey="检验编号"/>--%>
<display:column property="barcode.otherField6" titleKey="barcode.memo"/>
<display:column property="barcode.amount" titleKey="barcode.amount"/>
<display:column property="barcode.lockName" titleKey="menu.inRule"/>
<display:column titleKey="barcode.inStoreRemainTime" sortProperty="barcode.putInTime" sortable="true">
<c:if test="${pos.inStoreHour >= 1}">${pos.inStoreHour}<fmt:message key="time.hours"/></c:if><c:if test="${pos.inStoreMiniute != 0}">${pos.inStoreMiniute}<fmt:message key="time.minutes"/>
<c:if test="${pos.barcode.maxStorageTime != 0 }">
/${pos.barcode.maxStorageTime}<fmt:message key="time.hours"/></c:if>
</c:if>
</display:column>
<display:column titleKey="checkOut.operate">
<c:if test="${!limitCheckOut}">
<button class="btn yellow limit${pos.barcode.inFixture}" id="btn${pos.id}"
onclick="checkoutStorage('${pos.id}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
</c:if>
</display:column>
<c:if test="${limitCheckOut}">
<c:set var="limitCodes" value="${pos.barcode.inFixture},${limitCodes}"/>
</c:if>
</display:table>
</div>
</c:if>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/allBoxView.jsp
查看文件 @
9794c7a
...
...
@@ -185,6 +185,11 @@
<c:if test="${storage.solderPaste}">
<c:set var="detailUrl" value="${ctx}/storage/solder/${storage.cid}"/>
</c:if>
<c:if test="${storage.verticalBox}">
<c:set var="detailUrl" value="${ctx}/storage/vertical/${storage.cid}"/>
</c:if>
<div class="portlet box green-haze tasks-widget">
<c:choose>
<c:when test="${storage.shelf || storage.cabinet || storage.accShelf || storage.virtual || storage.codeShelf}">
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/solderBox.jsp
查看文件 @
9794c7a
...
...
@@ -92,8 +92,8 @@
</div>
<div class="col-md-8">
<button class="btn yellow right sm-btn-box" id="openDoor" ><fmt:message key="
开门
"/></button>
<button class="btn yellow right sm-btn-box" id="closeDoor"><fmt:message key="
关门
"/></button>
<button class="btn yellow right sm-btn-box" id="openDoor" ><fmt:message key="
solderBox.btn.openDoor
"/></button>
<button class="btn yellow right sm-btn-box" id="closeDoor"><fmt:message key="
solderBox.btn.closeDoor
"/></button>
</div>
<div class="col-md-12 col-sm-12">
...
...
@@ -119,10 +119,10 @@
<th></th>
<th><fmt:message key="barcode.barcode"/></th>
<th><fmt:message key="barcode.partNumber"/></th>
<th><fmt:message key="
重量(克)
"/></th>
<th><fmt:message key="
barcode.expireDate
"/></th>
<th><fmt:message key="checkOut.pos"/></th>
<th><fmt:message key="dataLog.status"/></th>
<th><fmt:message key="
预计出库时间
"/></th>
<th><fmt:message key="
solderBox.task.outTime
"/></th>
<%--<th><fmt:message key="状态"/></th>--%>
<%--<th><fmt:message key="dataLog.date"/></th>--%>
</tr>
...
...
@@ -166,15 +166,15 @@
<fmt:message key="storage.status.11" var="status_11"/>
<fmt:message key="storage.status.12" var="status_12"/>
<fmt:message key="storage.status.13" var="status_13"/>
<fmt:message key="
回温取料中
" var="status_14"/>
<fmt:message key="
回温取料完成
" var="status_15"/>
<fmt:message key="
回温放料中
" var="status_16"/>
<fmt:message key="
回温放料完成
" var="status_17"/>
<fmt:message key="
搅拌取料中
" var="status_18"/>
<fmt:message key="
等待搅拌
" var="status_19"/>
<fmt:message key="
搅拌执行中
" var="status_20"/>
<fmt:message key="
搅拌完成回仓
" var="status_21"/>
<fmt:message key="
搅拌完成
" var="status_22"/>
<fmt:message key="
storage.status.14
" var="status_14"/>
<fmt:message key="
storage.status.15
" var="status_15"/>
<fmt:message key="
storage.status.16
" var="status_16"/>
<fmt:message key="
storage.status.17
" var="status_17"/>
<fmt:message key="
storage.status.18
" var="status_18"/>
<fmt:message key="
storage.status.19
" var="status_19"/>
<fmt:message key="
storage.status.20
" var="status_20"/>
<fmt:message key="
storage.status.21
" var="status_21"/>
<fmt:message key="
storage.status.22
" var="status_22"/>
<fmt:message key="sotrage.status.999" var="status_999"/>
...
...
@@ -189,13 +189,13 @@
<fmt:message key="boxView.taskWaiting" var="taskWaiting_label"/>
<fmt:message key="boxView.cancelTask" var="cancelTask_label"/>
<fmt:message key="
冷藏中
" var="solder_status_1"/>
<fmt:message key="
回温中
" var="solder_status_2"/>
<fmt:message key="
待搅拌
" var="solder_status_3"/>
<fmt:message key="
搅拌中
" var="solder_status_4"/>
<fmt:message key="
待出库
" var="solder_status_5"/>
<fmt:message key="
出库中
" var="solder_status_6"/>
<fmt:message key="
退库存储
" var="solder_status_7"/>
<fmt:message key="
solder.status.1
" var="solder_status_1"/>
<fmt:message key="
solder.status.2
" var="solder_status_2"/>
<fmt:message key="
solder.status.3
" var="solder_status_3"/>
<fmt:message key="
solder.status.4
" var="solder_status_4"/>
<fmt:message key="
solder.status.5
" var="solder_status_5"/>
<fmt:message key="
solder.status.6
" var="solder_status_6"/>
<fmt:message key="
solder.status.7
" var="solder_status_7"/>
<c:set var="scripts" scope="request">
...
...
@@ -271,14 +271,14 @@
checkBox = "";
}
var partNumber = data[item].barcode.partNumber;
var
weight = data[item].barcode.amount
;
var
expireDate = data[item].barcode.expireDateStr
;
var posStr = data[item].posName;
var statusStr = solderStatusMsg[barcodeObj.solderStatus];
var tdStr =
"<td>"+checkBox+"</td>" +
"<td>"+barcodeObj.barcode+"</td>"+
"<td>"+partNumber+"</td>"+
"<td>"+
weight
+"</td>" +
"<td>"+
expireDate
+"</td>" +
"<td>"+posStr+"</td>" +
"<td>"+statusStr+"</td>" +
"<td>"+needOutDateStr+"</td>";
...
...
@@ -339,6 +339,34 @@
}
});
var statusMsg={
"1":"${status_1}",
"2":"${status_2}",
"3":"${status_3}",
"4":"${status_4}",
"5":"${status_5}",
"6":"${status_6}",
"7":"${status_7}",
"8":"${status_8}",
"9":"${status_9}",
"10":"${status_10}",
"11":"${status_11}",
"12":"${status_12}",
"13":"${status_13}",
"14":"${status_14}",
"15":"${status_15}",
"16":"${status_16}",
"17":"${status_17}",
"18":"${status_18}",
"19":"${status_19}",
"20":"${status_20}",
"21":"${status_21}",
"22":"${status_22}",
"999":"${status_999}"
};
var allTasks = {};
function updateTasks(){
//任务列表
...
...
@@ -374,11 +402,11 @@
showStr = posStr+"${out_label}"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 6){//回温取料
options['icon']='fa fa-sign-out';
showStr = posStr+"
回温取料
"+ partNumber + "["+barcode+"]";
showStr = posStr+"
${status_14}
"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 7){//出库
showStr = posStr+"
回温放料
"+ partNumber + "["+barcode+"]";
showStr = posStr+"
${status_16}
"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 8){//出库
showStr = posStr+"
搅拌
"+ partNumber + "["+barcode+"]";
showStr = posStr+"
${status_20}
"+ partNumber + "["+barcode+"]";
}else{
//options['onClick']= modifyClick;
}
...
...
@@ -440,32 +468,6 @@
});
}
var statusMsg={
"1":"${status_1}",
"2":"${status_2}",
"3":"${status_3}",
"4":"${status_4}",
"5":"${status_5}",
"6":"${status_6}",
"7":"${status_7}",
"8":"${status_8}",
"9":"${status_9}",
"10":"${status_10}",
"11":"${status_11}",
"12":"${status_12}",
"13":"${status_13}",
"14":"${status_14}",
"15":"${status_15}",
"16":"${status_16}",
"17":"${status_17}",
"18":"${status_18}",
"19":"${status_19}",
"20":"${status_20}",
"21":"${status_21}",
"22":"${status_22}",
"999":"${status_999}"
};
function flushStatus(){
$.get('${ctx}/service/store/status?cid=${show}', function (statusBean) {
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/verticalBox.jsp
0 → 100644
查看文件 @
9794c7a
<%@ page import="com.myproject.util.StorageConstants" %>
<%@ include file="/common/taglibs.jsp" %>
<%@ page language="java" pageEncoding="UTF-8" %>
<style type="text/css">
.box{
margin-top: 10px;
}
.alert{
padding:8px;
}
.sm-btn-box{
margin-left:10px;
}
.partnumber-box{
height: 100px;text-align: center;
padding-top:35px;
margin-bottom:10px;
font-size: 16px;
vertical-align: middle;
word-wrap:break-word ;
cursor: pointer;
}
.table-scrollable{
overflow-y: auto;
}
.statusMsg{
background-color: #FFFFFF;
margin: 0px 10px;
padding: 10px;
text-align: center;
}
#clientMsg{
margin-left: 30px;
font-size: 18px;
color: #ff5500;
text-align: center;
}
#smdstatus{
line-height: 80px;
font-size: 30px;
}
.red{
color:red;
}
.green{
color:green;
}
.table>tbody>tr>td{
vertical-align: middle;
}
.theItems{
min-width: 200px;
}
</style>
<link href="${ctx}/scripts/lobibox/css/lobibox.min.css?id=2" rel="stylesheet" type="text/css"/>
<%--<div class="row" id="codeBox">--%>
<%--<div class="col-md-6 col-sm-6">--%>
<%--<input type="text" class="form-control" id="scan-code"/>--%>
<%--</div>--%>
<%--<div class="col-md-6 col-sm-6">--%>
<%--<div class="alert alert-success" id="msg"> --%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
<div class="statusMsg">
<div id="smdstatus"></div>
<div id="clientMsg"></div>
</div>
<div class="row">
<%--<div class="col-md-4">--%>
<%--<button class="btn yellow" id="checkoutBtn">--%>
<%--<i class="fa fa-upload"></i><fmt:message key="storagePosFind.outSelect"/></button>--%>
<%--</div>--%>
<div class="col-md-12">
<input type="text" class="form-control" id="searchText" placeholder="搜索"/>
</div>
<div class="col-md-12 col-sm-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
${storage.name}
</div>
<div class="actions">
<%--<button type="button" class="btn btn-fit-height yellow" onclick="showPartNumbers();">--%>
<%--<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/>--%>
<%--</button>--%>
</div>
</div>
<div class="portlet-body">
<div class="table-scrollable" style="height:400px;">
<table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info" id="list">
<thead>
<tr role="row">
<th><fmt:message key="checkOut.pos"/></th>
<th><fmt:message key="尺寸"/></th>
<th><fmt:message key="物料"/></th>
<th><fmt:message key="操作"/></th>
</tr>
</thead>
<tbody class="dataTables">
<c:forEach items="${storagePosList}" var="pos">
<tr>
<td>${pos.posName}</td>
<td>${pos.sizeStr}</td>
<td>
<div class="row theItems" id="${pos.id}">
</div>
</td>
<td>
<button class="btn green" onclick=putIn("${pos.id}")><i class="fa fa-download"></i><fmt:message key="入库"/></button>
</td>
</tr>
</c:forEach>
</tbody>
</table>
</div>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<div id="operateWindow" class="modal fade" tabindex="-1" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="margin-top: 10%;width:60%;margin-left:20%;">
<div class="modal-content">
<div class="modal-header bg-green" id="operateHead">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" style="font-weight: 500;"><span id="operateTitle"><fmt:message key="入库"/></span>: <span id="currentOperatePos">123</span></h4>
</div>
<div class="modal-body" style="height: 290px;">
<div class="row">
<div class="col-md-12">
<span class="help-block red" id="msg"></span>
</div>
<div class="col-md-12" >
<input type="text" class="form-control" id="posConfirm" placeholder="库位确认"/>
<span class="help-block red"></span>
</div>
<div class="col-md-12">
<input type="text" class="form-control" disabled id="scan-code" placeholder="扫码或填写要放入的物料信息"/>
</div>
<div class="col-md-12">
<div class="table-scrollable" style="height:400px;">
<table class="table table-striped table-hover table-bordered no-footer" role="grid" aria-describedby="sample_editable_1_info" id="list">
<thead>
<tr role="row">
<th></th>
<th><fmt:message key="barcode.barcode"/></th>
<th><fmt:message key="barcode.partNumber"/></th>
<th><fmt:message key="数量"/></th>
</tr>
</thead>
<tbody class="posTable" id="putInExtendPosList">
<tr role="row">
<td>1</td>
<td>234</td>
<td>ABC</td>
<td>3</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" data-dismiss="modal" class="btn default"><fmt:message key="关闭"/></button>
</div>
</div>
</div>
</div>
<fmt:message key="storage.status" var="currentStatus"/>
<fmt:message key="storage.status.1" var="status_1"/>
<fmt:message key="storage.status.2" var="status_2"/>
<fmt:message key="storage.status.3" var="status_3"/>
<fmt:message key="storage.status.4" var="status_4"/>
<fmt:message key="storage.status.5" var="status_5"/>
<fmt:message key="storage.status.6" var="status_6"/>
<fmt:message key="storage.status.7" var="status_7"/>
<fmt:message key="storage.status.8" var="status_8"/>
<fmt:message key="storage.status.9" var="status_9"/>
<fmt:message key="storage.status.10" var="status_10"/>
<fmt:message key="storage.status.11" var="status_11"/>
<fmt:message key="storage.status.12" var="status_12"/>
<fmt:message key="storage.status.13" var="status_13"/>
<fmt:message key="sotrage.status.999" var="status_999"/>
<fmt:message key="allBoxView.boxStatus" var="boxStatus_label"/>
<fmt:message key="inOutList.in" var="in_label"/>
<fmt:message key="inOutList.out" var="out_label"/>
<fmt:message key="dataLog.orderSource" var="source_label"/>
<fmt:message key="boxView.taskCancel" var="taskCancel_label"/>
<fmt:message key="boxView.taskExcuting" var="taskExcuting_label"/>
<fmt:message key="boxView.taskFinished" var="taskFinished_label"/>
<fmt:message key="boxView.taskWaiting" var="taskWaiting_label"/>
<fmt:message key="boxView.cancelTask" var="cancelTask_label"/>
<c:set var="scripts" scope="request">
<script type="text/javascript">
Lobibox.notify.DEFAULTS = $.extend({}, Lobibox.notify.DEFAULTS, {
size: 'mini',
closeOnClick: false,
sound: false,
delay: false,
position: 'bottom right',
});
//FormEditable.init();
$("#searchText").on('input propertychange',function(){
var searchText = $("#searchText").val();
$("#list tr").each(function(){
var needShow = false;
if($(this).text().indexOf(searchText) >=0){
$(this).show();
}else{
$(this).hide();
}
});
});
function showMsg(id, msg){
if(id == ""){
return;
}
var msgDocument = $("#"+id);
if(msg == ""){
msgDocument.attr("class","");
msgDocument.html(" ");
}else{
var error = true;
if(msg.indexOf("OK") == 0){
error = false;
msg = msg.substr(2);
}
if(msg.indexOf("0") == 0){
error = false;
msg = msg.substr(1);
}
if(msg.indexOf("x") == 0){
msg = msg.substr(1);
}
if(msg.indexOf("putIn") == 0){
error = false;
msg = " ";
}
if(error){
msgDocument.attr("class","help-block red");
}else{
msgDocument.attr("class","help-block green");
}
msgDocument.html(msg);
}
}
var solderStatusMsg={
"1":"${solder_status_1}",
"2":"${solder_status_2}",
"3":"${solder_status_3}",
"4":"${solder_status_4}",
"5":"${solder_status_5}",
"6":"${solder_status_6}",
"7":"${solder_status_7}"
};
listNotEmpty = function(){
var str= "";
$("[name=posIds]").each(function(){
if($(this).attr("checked")){
str+=$(this).val()+";";
}
});
var searchText = $("#searchText").val();
if(str != "" || searchText !="") {
//有选择的暂时不刷新
return;
}
$.post("${ctx}/service/store/vertical/storagePosList", {cid: '${show}'}, function (data) {
$(".theItems").html("");
for(var item in data){
var barcodeObj = data[item].barcode;
if(barcodeObj){
partNumber = barcodeObj.partNumber;
amount = barcodeObj.amount;
}else{
checkBox = "";
}
var itemHtml = '<div class="col-lg-3 col-md-3 col-sm-6 col-xs-12" onclick="checkout(\''+data[item].id+'\');">' +
'<div class="bg-blue-madison partnumber-box">'+partNumber+'<br>'+amount+'</div>' +
'</div>';
$("#"+data[item].hostPosId).append(itemHtml);
}
});
}
$("#checkoutBtn").click(function(){
var str= "";
$("[name=posIds]").each(function(){
if($(this).attr("checked")){
str+=$(this).val()+";";
$(this).removeAttr("checked");
}
});
if(str != "") {
checkout(str);
}else{
alert("请勾选");
}
});
putIn = function(posId){
$.post("${ctx}/service/store/vertical/putIn", {pid: posId}, function (data) {
//showMsg("",data);
alert(data);
});
};
function checkout(posId) {
var ids = posId.split(";");
$.post("${ctx}/service/store/checkout.html", {pids: posId}, function (data) {
alert(data);
});
}
cancelTask = function(taskToClose){
Lobibox.confirm({
title: "${msg_title}",
msg: "${cancel_msg}",
callback: function ($this, type, ev) {
if(type == 'yes'){
$.post("${ctx}/service/store/cancelTask", {tid: taskToClose.$options["taskId"]}, function (data) {
if(data){
Lobibox.alert(success, //AVAILABLE TYPES: "error", "info", "success", "warning"
{
msg: "${cancelFinished_msg}"
});
}
});
}
}
});
};
$(".sm-btn-box").click(function(){
if($(this).css("cursor") == "pointer"){
var opKey = $(this).attr("id");
$.post("${ctx}/service/store/saveOp", {opKey: opKey, cid: '${show}', opValue:'doit'}, function (data) {
waitting();
});
}
});
var allTasks = {};
function updateTasks(){
//任务列表
$.post("${ctx}/service/store/tasks", {cid: '${show}'}, function (data) {
var newTasks = [];
var cidTasks = allTasks["all"];
if(!cidTasks){
cidTasks={};
}
for(var item in data){
var taskId = data[item].id;
var partNumber = data[item].partNumber;
var posStr = data[item].posStr;
var barcode = data[item].barcode
newTasks.push(taskId);
var options = {};
//入库
var showStr = posStr+"${in_label}"+ partNumber + "["+barcode+"]";
var status = data[item].status.toLowerCase();
options['status'] = status;
options['showClass'] = 'label-'+status;
options['taskId'] = taskId;
options['barcode'] = barcode;
options['num'] = data[item].num;
options['icon']='fa fa-database';
if(data[item].type == 2){//出库
options['icon']='fa fa-sign-out';
showStr = posStr+"${out_label}"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 6){//回温取料
options['icon']='fa fa-sign-out';
showStr = posStr+"回温取料"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 7){//出库
showStr = posStr+"回温放料"+ partNumber + "["+barcode+"]";
}else if(data[item].type == 8){//出库
showStr = posStr+"搅拌"+ partNumber + "["+barcode+"]";
}else{
//options['onClick']= modifyClick;
}
//options['onClick']= modifyClick;
var statusMsg ="["+status+"]";
var operate = '';
if(data[item].cancel){
statusMsg ="[${taskCancel_label}]";
} else if(data[item].executing){
statusMsg ="[${taskExcuting_label}]";
options['onClose']= cancelTask;
operate = '<a class="btn btn-xs default" href="#" onclick=cancelTask('+data[item].id+');><i class="fa fa-trash-o"></i> ${cancelTask_label} </a>';
}else if(data[item].finished){
statusMsg ="[${taskFinished_label}]";
}else if(data[item].wait){
statusMsg ="[${taskWaiting_label}]";
options['onClose']=cancelTask;
operate = '<a class="btn btn-xs default" href="#" onclick=cancelTask('+data[item].id+');><i class="fa fa-trash-o"></i> ${cancelTask_label} </a>';
}else{
options['onClose']=hideTask;
}
var sourceStr = "";
if(data[item].sourceName){
sourceStr = "<br/>${source_label} " + data[item].sourceStr;
}
options['msg']= showStr + statusMsg + sourceStr;
var task = cidTasks[taskId];
if(!task){
cidTasks[taskId] = Lobibox.notify('success', options);
}else{
if(status != task.$options["status"]){
task.remove();
delete cidTasks[taskId];
cidTasks[taskId] = Lobibox.notify('success', options);
}
}
}
for(var taskKey in cidTasks){
if(newTasks.indexOf(taskKey) < 0){
var task = cidTasks[taskKey];
task.remove();
delete cidTasks[taskKey];
}
}
allTasks["all"] = cidTasks;
});
}
var statusMsg={
"1":"${status_1}",
"2":"${status_2}",
"3":"${status_3}",
"4":"${status_4}",
"5":"${status_5}",
"6":"${status_6}",
"7":"${status_7}",
"8":"${status_8}",
"9":"${status_9}",
"10":"${status_10}",
"11":"${status_11}",
"12":"${status_12}",
"13":"${status_13}",
"14":"${status_14}",
"15":"${status_15}",
"16":"${status_16}",
"17":"${status_17}",
"18":"${status_18}",
"19":"${status_19}",
"20":"${status_20}",
"21":"${status_21}",
"22":"${status_22}",
"999":"${status_999}"
};
function flushStatus(){
$.get('${ctx}/service/store/status?cid=${show}', function (statusBean) {
if(statusBean && statusBean.boxStatus["1"]){
var statusTxt = statusMsg[statusBean.boxStatus["1"].status];
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
var color = "green";
if(statusBean.status == 2 || statusBean.status == 3 || statusBean.status == 4 || statusBean.status == 5){
color = "red";
}
$("#smdstatus").attr("class","smdstatus " + color);
$("#clientMsg").html(statusBean.msg);
}else{
var statusTxt = statusMsg["999"];
$("#smdstatus").html("${boxStatus_label}: ["+statusTxt+"]");
$("#smdstatus").attr("class","smdstatus red");
$("#clientMsg").html("");
}
});
}
function flushCurrentTask(){
$.get('${ctx}/service/store/vertical/currentTask?cid=${show}', function (data) {
if(data){
var task = data.currentTask;
if(!task){
return;
}
var extendPosList = data.extendPosList;
$("#currentOperatePos").text(task.posName);
showOperateWindow(task, extendPosList);
}else{
$("#operateWindow").modal("hide");
}
});
}
$('#operateWindow').on('hide.bs.modal', function () {
//入库界面关闭.
$.get('${ctx}/service/store/vertical/closeOperateWindow?cid=${show}', function (data) {
$("#posConfirm").removeAttr("disabled");
$("#posConfirm").val("");
$("#scan-code").attr("disabled", true);
$("#scan-code").val("");
$("#msg").html("");
});
})
function showOperateWindow(task, extendPosList){
if(task.putInTask){
//入库任务
$("#operateHead").attr("class","modal-header bg-green-haze");
$("#operateTitle").text("入库");
}else{
$("#operateHead").attr("class","modal-header bg-yellow");
$("#operateTitle").text("出库");
$("#posConfirm").val(task.posName);
$("#posConfirm").attr("disabled", true);
$("#scan-code").removeAttr("disabled");
}
$("#putInExtendPosList").html("");
for(i in extendPosList){
var barcodeObj = extendPosList[i].barcode;
if(!extendPosList[i].enabled || barcodeObj == null){
continue;
}
var index = parseInt(i) + 1;
var barcode = barcodeObj.barcode;
var partNumber = barcodeObj.partNumber;
var amount = barcodeObj.amount;
var tdStr =
"<td>"+index+"</td>" +
"<td>"+barcode+"</td>"+
"<td>"+partNumber+"</td>" +
"<td>"+amount+"</td>";
var trStr = "<tr>" + tdStr+ "</tr>";
$("#putInExtendPosList").append(trStr);
}
$("#operateWindow").modal("show");
var confirmDisabled = $("#posConfirm").is(":disabled");
if(!confirmDisabled){
$("#posConfirm").focus();
}else{
$("#scan-code").focus();
}
}
$("#posConfirm").change(function () {
var posValue = $(this).val();
var currentOperatePos = $("#currentOperatePos").text();
if(posValue == currentOperatePos){
$(this).attr("disabled", true);
$("#scan-code").removeAttr("disabled");
}
showOperateWindow();
});
$("#scan-code").change(function () {
var codeValue = $(this).val();
var currentOperatePos = $("#currentOperatePos").text();
if(codeValue != ""){
$.post("${ctx}/service/store/vertical/operatePos", {cid: '${show}', code: codeValue, pos:currentOperatePos}, function (data) {
showMsg("msg",data);
$("#scan-code").val("");
});
}
showOperateWindow();
});
updateTasks();
listNotEmpty();
//showOperateWindow();
setInterval(function(){
flushStatus();
updateTasks();
listNotEmpty();
flushCurrentTask();
}, 1000);
waitting = function(){
Metronic.blockUI({
iconOnly: true,
overlayColor: '#4b8df8'
});
window.setTimeout(function() {
Metronic.unblockUI();
}, 1500);
}
</script>
</c:set>
\ No newline at end of file
myproject/src/main/webapp/decorators/metro.jsp
查看文件 @
9794c7a
...
...
@@ -67,6 +67,8 @@
<link
href=
"${ctx}/assets/admin/layout/css/custom.css?id=0"
rel=
"stylesheet"
type=
"text/css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"${ctx}/assets/global/plugins/bootstrap-editable/bootstrap-editable/css/bootstrap-editable.css"
/>
<!-- END THEME STYLES -->
<link
rel=
"shortcut icon"
href=
"${ctx}/favicon.ico"
/>
<decorator:head/>
...
...
@@ -330,6 +332,7 @@
<script
src=
"${ctx}/scripts/lobibox/js/lobibox.js?id=32"
></script>
<script
type=
"text/javascript"
src=
"${ctx}/assets/global/plugins/bootstrap-editable/bootstrap-editable/js/bootstrap-editable.js"
></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
jQuery
(
document
).
ready
(
function
()
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论