Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit c5b0a79c
由
zshaohui
编写于
2023-04-24 09:39:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.抛异常时,保存到消息列表
2.料盒操作,mes提示禁用,但实际已经入进去了,任务没生成,bug修改
1 个父辈
24c875a9
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
100 行增加
和
229 行删除
src/main/java/com/neotel/smfcore/common/exception/handler/GlobalExceptionHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/message/rest/MessageController.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
src/main/resources/messages.properties
src/main/java/com/neotel/smfcore/common/exception/handler/GlobalExceptionHandler.java
查看文件 @
c5b0a79
...
...
@@ -5,6 +5,9 @@ import com.neotel.smfcore.common.exception.EntityNotFoundException;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.ThrowableUtil
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.message.service.manager.IMessageManager
;
import
com.neotel.smfcore.core.message.service.po.Message
;
import
io.swagger.annotations.Api
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -28,6 +31,9 @@ import static org.springframework.http.HttpStatus.NOT_FOUND;
public
class
GlobalExceptionHandler
{
@Autowired
private
MessageUtils
messageUtils
;
@Autowired
IMessageManager
messageManager
;
/**
* 处理所有不可知的异常
*/
...
...
@@ -87,6 +93,14 @@ public class GlobalExceptionHandler {
// 打印堆栈信息
//log.error(ThrowableUtil.getStackTrace(e));
String
targetMsg
=
messageUtils
.
getText
(
e
.
getMsgKey
(),
e
.
getMsgParam
(),
servlet
.
getLocale
()
,
e
.
getDefaultMsg
());
e
.
getMessage
();
Message
message
=
new
Message
();
message
.
setType
(
MessageType
.
ERROR
.
name
());
message
.
setDeviceName
(
"server"
);
message
.
setMsgCode
(
e
.
getMsgKey
());
message
.
setMsgParams
(
e
.
getMsgParam
());
message
.
setMsg
(
e
.
getDefaultMsg
());
messageManager
.
save
(
message
);
return
buildResponseEntity
(
ApiError
.
error
(
e
.
getStatus
(),
targetMsg
));
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
c5b0a79
...
...
@@ -333,6 +333,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
storagePos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
);
}
else
{
log
.
info
(
"料仓"
+
storageCid
+
"有出库任务未完成,不允许入库"
);
throw
new
ValidateException
(
"smfcore.error.storage.outNotEnd"
,
"料仓{0}有出库任务未完成,不允许入库"
,
new
String
[]{
storageCid
});
}
}
if
(
storagePos
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/message/rest/MessageController.java
查看文件 @
c5b0a79
...
...
@@ -53,6 +53,7 @@ public class MessageController {
public
PageData
<
MessageDto
>
query
(
MessageCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
){
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
query
.
addCriteria
(
Criteria
.
where
(
"msg"
).
exists
(
true
).
ne
(
""
));
PageData
<
Message
>
messagePageData
=
messageManager
.
findByPage
(
query
,
pageable
);
List
<
MessageDto
>
dtos
=
messageMapper
.
toDto
(
messagePageData
.
getContent
());
for
(
int
i
=
0
;
i
<
dtos
.
size
();
i
++)
{
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
查看文件 @
c5b0a79
package
com
.
neotel
.
smfcore
.
core
.
storage
.
rest
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
...
...
@@ -77,6 +78,10 @@ public class MaterialBoxController {
@Autowired
private
LiteOrderCache
liteOrderCache
;
private
static
Map
<
String
,
Long
>
inLastScanMap
=
Maps
.
newConcurrentMap
();
private
static
Map
<
String
,
Long
>
outLastScanMap
=
Maps
.
newConcurrentMap
();
@ApiOperation
(
"查询料盒信息"
)
@PostMapping
@PreAuthorize
(
"@el.check('materialBox')"
)
...
...
@@ -103,7 +108,6 @@ public class MaterialBoxController {
if
(
component
==
null
||(
component
.
getType
()!=
COMPONENT_TYPE
.
FIXTURE
)){
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
BarcodeDto
barcodeDto
=
barcodeMapper
.
toDto
(
barcode
);
// if(barcodeDto.getSubCodeMap()==null){
// barcodeDto.setSubCodeMap(new HashMap<>());
...
...
@@ -113,7 +117,7 @@ public class MaterialBoxController {
}
else
{
//按时间进行排序
List
<
BarcodeDto
>
subCodeList
=
barcodeDto
.
getSubCodeList
();
subCodeList
=
subCodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
BarcodeDto
::
get
Cre
ateDate
).
reversed
()).
collect
(
Collectors
.
toList
());
subCodeList
=
subCodeList
.
stream
().
sorted
(
Comparator
.
comparing
(
BarcodeDto
::
get
Upd
ateDate
).
reversed
()).
collect
(
Collectors
.
toList
());
barcodeDto
.
setSubCodeList
(
subCodeList
);
}
return
barcodeDto
;
...
...
@@ -206,7 +210,8 @@ public class MaterialBoxController {
@ApiOperation
(
"操作料盒内的物料信息"
)
@PostMapping
(
value
=
"/operatePos"
)
@PreAuthorize
(
"@el.check('materialBox')"
)
public
ResultBean
operatePos
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
operatePos
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
throws
ValidateException
{
try
{
String
code
=
paramMap
.
get
(
"barcode"
);
//料盒条码
String
operageStr
=
paramMap
.
get
(
"operatePN"
);
//操作信息
...
...
@@ -233,7 +238,19 @@ public class MaterialBoxController {
throw
new
ValidateException
(
"smfcore.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
pos
.
getPosName
()});
}
long
currentTimeMillis
=
System
.
currentTimeMillis
();
Long
outTime
=
outLastScanMap
.
get
(
subBarcode
.
getBarcode
());
if
(
outTime
!=
null
&&
currentTimeMillis
-
outTime
<=
1000
*
60
*
10
)
{
throw
new
ValidateException
(
"smfcore.materialBox.outBox"
,
"物料{0}已经取出"
,
new
String
[]{
subBarcode
.
getBarcode
()});
}
Long
inTime
=
inLastScanMap
.
get
(
subBarcode
.
getBarcode
());
if
(
inTime
!=
null
&&
currentTimeMillis
-
inTime
<=
1000
*
60
*
10
)
{
throw
new
ValidateException
(
"smfcore.materialBox.inBox"
,
"物料{0}已在料盒{1}中"
,
new
String
[]{
subBarcode
.
getBarcode
(),
barcode
.
getBarcode
()});
}
if
(
subBarcode
.
getHostBarcodeId
()
==
null
)
{
smfApi
.
canPutInAfterResolve
(
subBarcode
);
//不存在,入库
opQty
=
OP
.
PUT_IN
;
int
newCount
=
subBarcode
.
getAmount
();
...
...
@@ -243,18 +260,17 @@ public class MaterialBoxController {
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
newCount
);
barcodeManager
.
saveBarcode
(
subBarcode
);
smfApi
.
canPutInAfterResolve
(
subBarcode
);
finishTask
(
barcode
,
opQty
,
currentTask
,
subBarcode
,
subBarcode
.
getAmount
());
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]入库到料盒["
+
barcode
.
getBarcode
()
+
"]数量:"
+
barcode
.
getAmount
());
inLastScanMap
.
put
(
subBarcode
.
getBarcode
(),
System
.
currentTimeMillis
());
}
else
if
(
subBarcode
.
getHostBarcodeId
().
equals
(
barcode
.
getId
()))
{
int
qty
=
subBarcode
.
getAmount
();
//出库
subBarcode
.
setAmount
(
0
);
opQty
=
OP
.
CHECKOUT
;
finishTask
(
barcode
,
opQty
,
currentTask
,
subBarcode
,
qty
);
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]从料盒["
+
barcode
.
getBarcode
()
+
"]出库,数量:"
+
qty
);
int
qty
=
subBarcode
.
getAmount
();
//出库
subBarcode
.
setAmount
(
0
);
opQty
=
OP
.
CHECKOUT
;
finishTask
(
barcode
,
opQty
,
currentTask
,
subBarcode
,
qty
);
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]从料盒["
+
barcode
.
getBarcode
()
+
"]出库,数量:"
+
qty
);
outLastScanMap
.
put
(
subBarcode
.
getBarcode
(),
System
.
currentTimeMillis
());
}
else
{
//在别的料盒中
Barcode
hostBarcode
=
barcodeManager
.
get
(
subBarcode
.
getHostBarcodeId
());
...
...
@@ -267,125 +283,6 @@ public class MaterialBoxController {
// return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams());
return
ResultBean
.
newOkResult
(
operageStr
);
}
// //用+或-分割,如果最后几位是数量,按手动输入处理
// String[] codeArray = operageStr.split(" -");
// String pnStr = "";
// int opQty = 0;
// int opType = OP.NON_OP;
// if(codeArray.length == 2){
// try{
// opQty = Integer.valueOf(codeArray[1].trim());
// pnStr = codeArray[0].trim();
// opType = OP .CHECKOUT;
// }catch (Exception e){
//
// }
// }
// if(opType == OP.NON_OP){
// codeArray = operageStr.split(" \\+");
// if(codeArray.length == 2){
// try{
// opQty = Integer.valueOf(codeArray[1].trim());
// pnStr = codeArray[0].trim();
// opType = OP.PUT_IN;
// }catch (Exception e){
//
// }
// }
// }
//
// if(opType != OP.NON_OP){
// //手动输入,按PN来处理
// //先查找是否有相同的PN,没有创建一个
// Component component = autoGetComponent(pnStr,opQty);
// //查看该库位中是否有相同的物料,有的话,数量累加
// Barcode subBarcode=barcode.getSubCode(pnStr);
//
// if(opType == OP.PUT_IN) {
// //入库
// if (subBarcode != null) {
// int oldAmount = subBarcode.getAmount();
//
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(oldAmount + opQty);
// subBarcode = barcodeManager.save(subBarcode);
//
// finishTask(barcode, opType, currentTask, subBarcode, opQty);
// log.info(subBarcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + oldAmount + " + " + opQty + " = " + subBarcode.getAmount());
//
// } else {
// subBarcode=autoGetBarcode(barcode,component,pnStr,opQty);
// finishTask(barcode, opType, currentTask, subBarcode, opQty);
// log.info(barcode.getPartNumber() + "入库到料盒[" + barcode.getBarcode() + "],物料数量:" + barcode.getAmount());
// }
// }else {
// //出库
// if(subBarcode != null){
//
// int oldAmount = subBarcode.getAmount();
// if(oldAmount < opQty){
// throw new ValidateException("smfcore.materialBox.quantityshort","物料数量不足");
// }
// int newAmount = oldAmount - opQty;
//
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(newAmount);
// subBarcode = barcodeManager.save(subBarcode);
//
// finishTask(barcode, opType, currentTask,subBarcode, opQty);
// log.info(subBarcode.getPartNumber() + "从料盒["+barcode.getPosName()+"]出库,物料数量:" + oldAmount + " - " + opQty + " = " + newAmount);
// }else{
// //无库存
// throw new ValidateException("smfcore.materialBox.noReel","料盒中未找到对应物料");
// }
// }
//
// }else {
//
// String newCodeStr = "=1x1=" + operageStr;
// CodeBean codeBean = codeResolve.resolveSingleCode(newCodeStr );
// if (codeBean.isValid()) {
// Barcode subBarcode = codeBean.getBarcode();
// StoragePos pos = storagePosManager.getByBarcode(subBarcode.getBarcode());
// if (pos != null) {
// throw new ValidateException("smfcore.materialBox.inPos", "物料已在库位{0}中", new String[]{pos.getPosName()});
// }
//
// if (subBarcode.getHostBarcodeId() == null) {
// //不存在,入库
// opQty = OP.PUT_IN;
// int newCount = subBarcode.getAmount() ;
// if(newCount<=0){
// newCount=1;
// }
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(newCount);
// barcodeManager.saveBarcode(subBarcode);
// finishTask(barcode, opQty, currentTask, subBarcode, subBarcode.getAmount());
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]入库到料盒[" + barcode.getBarcode() + "]数量:" + barcode.getAmount());
// }
// else if (subBarcode.getHostBarcodeId().equals(barcode.getId())) {
// int qty = subBarcode.getAmount();
// //出库
// subBarcode.setAmount(0);
// opQty = OP.CHECKOUT;
// finishTask(barcode, opQty, currentTask, subBarcode, qty);
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]从料盒[" + barcode.getBarcode() + "]出库,数量:" + qty);
//
// } else {
// //在别的料盒中
// Barcode hostBarcode = barcodeManager.get(subBarcode.getHostBarcodeId());
// if (hostBarcode != null) {
// throw new ValidateException("smfcore.materialBox.inOtherBox", "物料已在料盒{0}中", new String[]{hostBarcode.getBarcode()});
// }
// }
// } else {
// return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams());
// }
// }
}
catch
(
Exception
e
)
{
// return "出入库操作出错:" + e.getMessage();
log
.
error
(
e
.
getMessage
());
...
...
@@ -398,7 +295,7 @@ public class MaterialBoxController {
@PostMapping
(
value
=
"/sureOperate"
)
@PreAuthorize
(
"@el.check('materialBox')"
)
public
ResultBean
sureOperate
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
try
{
try
{
//1.查找元器件pn是否存在,存在时需要弹框输入数量
//2.pn不存在,解析条码 成功,作为RI处理
...
...
@@ -408,9 +305,9 @@ public class MaterialBoxController {
String
qtyStr
=
paramMap
.
get
(
"qty"
);
//数量
int
opQty
=
Integer
.
valueOf
(
qtyStr
);
DataLog
currentTask
=
null
;
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
)
{
DataLog
currentTask
=
null
;
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
//用+或-分割,如果最后几位是数量,按手动输入处理
...
...
@@ -418,13 +315,13 @@ public class MaterialBoxController {
String
pnStr
=
operageStr
;
int
opType
=
OP
.
NON_OP
;
if
(
opQty
<
0
)
{
opType
=
OP
.
CHECKOUT
;
}
else
if
(
opQty
>
0
)
{
opType
=
OP
.
PUT_IN
;
}
else
{
if
(
opQty
<
0
)
{
opType
=
OP
.
CHECKOUT
;
}
else
if
(
opQty
>
0
)
{
opType
=
OP
.
PUT_IN
;
}
else
{
//请输入正确的数量
throw
new
ValidateException
(
"smfcore.materialBox.qtyError"
,
"请输入正确的数量"
);
throw
new
ValidateException
(
"smfcore.materialBox.qtyError"
,
"请输入正确的数量"
);
}
//料盒中放入料盘数量
...
...
@@ -432,99 +329,54 @@ public class MaterialBoxController {
barcode
.
setAmount
(
amount
+
opQty
);
// if(opType != OP.NON_OP){
//手动输入,按PN来处理
//先查找是否有相同的PN,没有创建一个
Component
component
=
autoGetComponent
(
pnStr
,
opQty
);
//查看该库位中是否有相同的物料,有的话,数量累加
Barcode
subBarcode
=
barcode
.
getSubCode
(
pnStr
);
if
(
opType
==
OP
.
PUT_IN
)
{
//入库
if
(
subBarcode
!=
null
)
{
int
oldAmount
=
subBarcode
.
getAmount
();
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
oldAmount
+
opQty
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
finishTask
(
barcode
,
opType
,
currentTask
,
subBarcode
,
opQty
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"入库到料盒["
+
barcode
.
getBarcode
()
+
"],物料数量:"
+
oldAmount
+
" + "
+
opQty
+
" = "
+
subBarcode
.
getAmount
());
}
else
{
subBarcode
=
autoGetBarcode
(
barcode
,
component
,
pnStr
,
opQty
);
finishTask
(
barcode
,
opType
,
currentTask
,
subBarcode
,
opQty
);
log
.
info
(
barcode
.
getPartNumber
()
+
"入库到料盒["
+
barcode
.
getBarcode
()
+
"],物料数量:"
+
barcode
.
getAmount
());
}
}
else
{
//出库
if
(
subBarcode
!=
null
){
int
oldAmount
=
subBarcode
.
getAmount
();
if
(
oldAmount
<
opQty
){
throw
new
ValidateException
(
"smfcore.materialBox.quantityshort"
,
"物料数量不足"
);
}
int
newAmount
=
oldAmount
-
opQty
;
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
newAmount
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
finishTask
(
barcode
,
opType
,
currentTask
,
subBarcode
,
opQty
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
}
else
{
//无库存
throw
new
ValidateException
(
"smfcore.materialBox.noReel"
,
"料盒中未找到对应物料"
);
}
//手动输入,按PN来处理
//先查找是否有相同的PN,没有创建一个
Component
component
=
autoGetComponent
(
pnStr
,
opQty
);
//查看该库位中是否有相同的物料,有的话,数量累加
Barcode
subBarcode
=
barcode
.
getSubCode
(
pnStr
);
if
(
opType
==
OP
.
PUT_IN
)
{
//入库
if
(
subBarcode
!=
null
)
{
int
oldAmount
=
subBarcode
.
getAmount
();
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
oldAmount
+
opQty
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
finishTask
(
barcode
,
opType
,
currentTask
,
subBarcode
,
opQty
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"入库到料盒["
+
barcode
.
getBarcode
()
+
"],物料数量:"
+
oldAmount
+
" + "
+
opQty
+
" = "
+
subBarcode
.
getAmount
());
}
else
{
subBarcode
=
autoGetBarcode
(
barcode
,
component
,
pnStr
,
opQty
);
finishTask
(
barcode
,
opType
,
currentTask
,
subBarcode
,
opQty
);
log
.
info
(
barcode
.
getPartNumber
()
+
"入库到料盒["
+
barcode
.
getBarcode
()
+
"],物料数量:"
+
barcode
.
getAmount
());
}
}
else
{
//出库
if
(
subBarcode
!=
null
)
{
// }else {
//
// String newCodeStr = "=1x1=" + operageStr;
// CodeBean codeBean = codeResolve.resolveSingleCode(newCodeStr );
// if (codeBean.isValid()) {
// Barcode subBarcode = codeBean.getBarcode();
// StoragePos pos = storagePosManager.getByBarcode(subBarcode.getBarcode());
// if (pos != null) {
// throw new ValidateException("smfcore.materialBox.inPos", "物料已在库位{0}中", new String[]{pos.getPosName()});
// }
//
// if (subBarcode.getHostBarcodeId() == null) {
// //不存在,入库
// opQty = OP.PUT_IN;
// int newCount = subBarcode.getAmount() ;
// if(newCount<=0){
// newCount=1;
// }
// subBarcode.setHostBarcodeId(barcode.getId());
// subBarcode.setAmount(newCount);
// barcodeManager.saveBarcode(subBarcode);
// finishTask(barcode, opQty, currentTask, subBarcode, subBarcode.getAmount());
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]入库到料盒[" + barcode.getBarcode() + "]数量:" + barcode.getAmount());
// }
// else if (subBarcode.getHostBarcodeId().equals(barcode.getId())) {
// int qty = subBarcode.getAmount();
// //出库
// subBarcode.setAmount(0);
// opQty = OP.CHECKOUT;
// finishTask(barcode, opQty, currentTask, subBarcode, qty);
// log.info("条码" + subBarcode.getBarcode() + "[" + subBarcode.getPartNumber() + "]从料盒[" + barcode.getBarcode() + "]出库,数量:" + qty);
//
// } else {
// //在别的料盒中
// Barcode hostBarcode = barcodeManager.get(subBarcode.getHostBarcodeId());
// if (hostBarcode != null) {
// throw new ValidateException("smfcore.materialBox.inOtherBox", "物料已在料盒{0}中", new String[]{hostBarcode.getBarcode()});
// }
// }
// } else {
// return ResultBean.newErrorResult(1, codeBean.getErrorCode(), codeBean.getError(), codeBean.getParams());
// }
// }
int
oldAmount
=
subBarcode
.
getAmount
();
if
(
oldAmount
<
opQty
)
{
throw
new
ValidateException
(
"smfcore.materialBox.quantityshort"
,
"物料数量不足"
);
}
int
newAmount
=
oldAmount
-
opQty
;
}
catch
(
Exception
e
){
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
newAmount
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
finishTask
(
barcode
,
opType
,
currentTask
,
subBarcode
,
opQty
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()
+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
}
else
{
//无库存
throw
new
ValidateException
(
"smfcore.materialBox.noReel"
,
"料盒中未找到对应物料"
);
}
}
}
catch
(
Exception
e
)
{
// return "出入库操作出错:" + e.getMessage();
log
.
error
(
e
.
toString
());
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
toString
()});
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
toString
()});
}
return
ResultBean
.
newOkResult
(
""
);
}
...
...
src/main/resources/messages.properties
查看文件 @
c5b0a79
...
...
@@ -120,7 +120,9 @@ smfcore.materialBox.invalid=\u672A\u627E\u5230\u6599\u76D2\u4FE1\u606F{0}
smfcore.materialBox.noReel
=
\u6599\u
76D2
\u
4E2D
\u
672A
\u
627E
\u5230\u
5BF9
\u
5E94
\u7269\u6599
smfcore.materialBox.boxNoReel
=
\u6599\u
76D2
\u
4E2D
\u
65E0
\u7269\u6599
smfcore.materialBox.inPos
=
\u7269\u6599\u
5DF2
\u5728\u
5E93
\u
4F4D{0}
\u
4E2D
smfcore.materialBox.inBox
=
\u7269\u6599
{0}
\u
5DF2
\u5728\u6599\u
76D2{1}
\u
4E2D
smfcore.materialBox.inOtherBox
=
\u7269\u6599\u
5DF2
\u5728\u6599\u
76D2{0}
\u
4E2D
smfcore.materialBox.outBox
=
\u7269\u6599
{0}
\u
5DF2
\u
7ECF
\u
53D6
\u
51FA
smfcore.materialBox
=
\u6599\u
76D2
\u
64CD
\u
4F5C
smfcore.shelf.nextPos.hasReel
=
\u
5E93
\u
4F4D[{0}]
\u
5DF2
\u6709\u7269\u6599
,
\u
8BF7
\u
91CD
\u
65B0
\u
626B
\u
63CF
\u
5E93
\u
4F4D
\u7801
smfcore.shelf.nextPos.hasTask
=
\u
5E93
\u
4F4D[{0}]
\u
5DF2
\u6709\u
4EFB
\u
52A1,
\u
8BF7
\u
91CD
\u
65B0
\u
626B
\u
63CF
\u
5E93
\u
4F4D
\u7801
...
...
@@ -258,6 +260,7 @@ smfcore.error.virtualOut.noItem=\u5DE5\u5355{0}\u4E2D\u672A\u627E\u5230\u5BF9\u5
smfcore.error.mimo.outFial
=
\u
672A
\u
627E
\u5230\u
53EF
\u
51FA
\u
5E93
\u7684\u7269\u6599
smfcore.error.getMaterialLot.in
=
\u6761\u7801
[{0}]
\u
9A8C
\u
8BC1
\u5931\u
8D25
\u
FF0C
\u
65E0
\u
6CD5
\u5165\u
5E93
smfcore.error.getMaterialLot.out
=
\u6761\u7801
[{0}]
\u
9A8C
\u
8BC1
\u5931\u
8D25
\u
FF0C
\u
65E0
\u
6CD5
\u
51FA
\u
5E93
smfcore.error.storage.outNotEnd
=
\u6599\u
4ED3{0}
\u6709\u
51FA
\u
5E93
\u
4EFB
\u
52A1
\u
672A
\u
5B8C
\u6210\u
FF0C
\u
4E0D
\u5141\u
8BB8
\u5165\u
5E93
#smfclient.nlp.onlyOneTray=\u4E0D\u53EF\u540C\u65F6\u653E\u5165\u591A\u76D8\u7269\u6599:{0}
#smfclient.nlp.cannotFindPos={0}\u672A\u627E\u5230\u5E93\u4F4D:{1}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论