Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4aba1dfc
由
LN
编写于
2023-06-21 15:45:23 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
获取库位号接口修改
1 个父辈
d94616f8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
48 行增加
和
59 行删除
src/main/java/com/neotel/smfcore/common/service/CommonResponseAdvice.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
src/main/resources/messages.properties
src/main/java/com/neotel/smfcore/common/service/CommonResponseAdvice.java
查看文件 @
4aba1df
package
com
.
neotel
.
smfcore
.
common
.
service
;
package
com
.
neotel
.
smfcore
.
common
.
service
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.http.HttpHeaders
;
import
org.springframework.http.HttpHeaders
;
...
@@ -44,6 +45,11 @@ public class CommonResponseAdvice implements ResponseBodyAdvice<Object> {
...
@@ -44,6 +45,11 @@ public class CommonResponseAdvice implements ResponseBodyAdvice<Object> {
List
<
Locale
>
locales
=
headers
.
getAcceptLanguageAsLocales
();
List
<
Locale
>
locales
=
headers
.
getAcceptLanguageAsLocales
();
if
(
locales
!=
null
&&
locales
.
size
()
>
0
)
{
if
(
locales
!=
null
&&
locales
.
size
()
>
0
)
{
resultBean
.
updateLocal
(
locales
.
get
(
0
));
resultBean
.
updateLocal
(
locales
.
get
(
0
));
}
else
{
Locale
defaultLocal
=
MessageUtils
.
getDefaultLocal
();
if
(
defaultLocal
!=
null
){
resultBean
.
updateLocal
(
defaultLocal
);
}
}
}
return
resultBean
;
return
resultBean
;
// resultBean.updateLocal(request.getLocale());
// resultBean.updateLocal(request.getLocale());
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
4aba1df
...
@@ -17,6 +17,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
...
@@ -17,6 +17,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.bean.PosInfo
;
import
com.neotel.smfcore.core.device.bean.PosInfo
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.message.util.DeviceMessageUtil
;
import
com.neotel.smfcore.core.message.util.DeviceMessageUtil
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
...
@@ -186,7 +187,15 @@ public class DeviceController {
...
@@ -186,7 +187,15 @@ public class DeviceController {
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"未找到有效的条码"
);
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"未找到有效的条码"
);
}
}
if
(
barcode
.
getExpireDate
()
!=
null
&&
System
.
currentTimeMillis
()
>
barcode
.
getExpireDate
().
getTime
())
{
// throw new ValidateException("smfcore.error.barcode.expired", "物料已过期,无法入库.");
resultMap
.
put
(
"result"
,
"107"
);
errorMsg
=
"["
+
barcode
.
getBarcode
()+
"]"
+
MessageUtils
.
getText
(
"smfcore.error.barcode.expired"
,
new
Locale
(
"en"
,
"US"
),
"物料已过期,无法入库"
);
resultMap
.
put
(
"msg"
,
errorMsg
);
log
.
error
(
"物料["
+
barcode
.
getBarcode
()+
"]已过期,无法入库"
);
return
resultMap
;
}
for
(
DataLog
dataLog
:
taskService
.
getQueueTasks
())
{
for
(
DataLog
dataLog
:
taskService
.
getQueueTasks
())
{
// if(!dataLog.isPackageReel()){
// if(!dataLog.isPackageReel()){
//已经在任务当中,返回对应的信息
//已经在任务当中,返回对应的信息
...
@@ -230,70 +239,34 @@ public class DeviceController {
...
@@ -230,70 +239,34 @@ public class DeviceController {
StoragePos
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
,
rfid
,
lastPosId
);
StoragePos
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
,
rfid
,
lastPosId
);
if
(
pos
!=
null
)
{
if
(
pos
!=
null
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
//
Storage storage = dataCache.getStorageById(pos.getStorageId());
//
//如果所在料仓有出库任务未完成,暂停入库
//
if(!storage.isPackage()){
//
Collection<DataLog> tasks = taskService.getAllTasks();
//
//不是包装仓,如果所在料仓有出库任务,暂停入库
//
for (DataLog task : tasks) {
//
Collection<DataLog> tasks = taskService.getQueueTasks();
//
if (task.isCheckOutTask() && task.getStorageId().equals(pos.getStorageId())) {
//
for (DataLog task : tasks
) {
//
if ((!task.isFinished()) && (!task.isInRobot())&&(!task.isInLine())
) {
//
if(task.isCheckOutTask() && task.getStorageId().equals(pos.getStorageId())){
//
// errorMsg = "库位[" + pos.getPosName() + "]所在料仓有出库任务,暂停入库";
// errorMsg = "
库位["+ pos.getPosName() + "]所在料仓有出库任务,暂停入库
";
// errorMsg = "
PosName[" + pos.getPosName() + "]There are outgoing tasks in the silo, suspend storage
";
// lineMsg = errorMsg;
// lineMsg = errorMsg;
// resultMap.put("result","99");
// resultMap.put("result", "99");
// resultMap.put("msg",errorMsg);
// resultMap.put("msg", errorMsg);
// log.info("[" + barcode.getBarcode() + "]分到库位[" + pos.getPosName() + "]所在料仓有出库任务,暂停入库");
// return resultMap;
// return resultMap;
// }
// }
// }
// }
// }
// }
Storage
theStorage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
resultMap
.
put
(
"result"
,
"0"
);
resultMap
.
put
(
"result"
,
"0"
);
resultMap
.
put
(
"msg"
,
""
);
resultMap
.
put
(
"msg"
,
"ok"
);
DataLog
newTask
=
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
);
okMsg
=
"["
+
rfid
+
"]["
+
barcode
.
getBarcode
()
+
"]锁定库位["
+
pos
.
getPosName
()
+
"]优先级["
+
pos
.
getPriority
()
+
"] 上个库位号["
+
lastPosId
+
"]"
;
ReelLockPosInfo
oldLockInfo
=
ReelLockPosUtil
.
getLockPosInfoByCode
(
barcode
.
getBarcode
());
okMsg
=
"["
+
barcode
.
getBarcode
()
+
"]锁定库位["
+
pos
.
getPosName
()
+
"]优先级["
+
pos
.
getPriority
()
+
"] 上个库位号["
+
lastPosId
+
"]"
;
if
(
oldLockInfo
!=
null
)
{
if
(!
oldLockInfo
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
String
result
=
"-1"
;
okMsg
=
rfid
+
"["
+
rfidLoc
+
"]["
+
barcode
.
getBarcode
()
+
"]锁定库位["
+
pos
.
getPosName
()
+
"],清理旧有锁定信息"
;
resultMap
.
put
(
"result"
,
result
);
resultMap
.
put
(
"msg"
,
okMsg
);
//已经锁定过库位,但不是同一个条码,需要把对应位置的锁定信息清理掉
ReelLockPosUtil
.
removeReelLockPosInfo
(
oldLockInfo
.
getBarcode
());
log
.
info
(
"清理锁定库位:库位号["
+
oldLockInfo
.
getLockPosName
()
+
"]上物料["
+
oldLockInfo
.
getBarcode
()
+
"]锁定的库位"
);
}
}
log
.
info
(
okMsg
+
oldLockInfo
);
ReelLockPosInfo
reelLocInfo
=
new
ReelLockPosInfo
();
reelLocInfo
.
setBarcode
(
barcode
.
getBarcode
());
reelLocInfo
.
setCid
(
theStorage
.
getCid
());
reelLocInfo
.
setLockPosName
(
pos
.
getPosName
());
reelLocInfo
.
setLockPosId
(
pos
.
getId
());
reelLocInfo
=
ReelLockPosUtil
.
addReelLockPosInfo
(
reelLocInfo
,
cidList
);
if
(
reelLocInfo
==
null
)
{
errorMsg
=
"["
+
barcode
.
getBarcode
()
+
"]库位["
+
reelLocInfo
.
getLockPosName
()+
"]已被锁定,暂停入库"
;
lineMsg
=
errorMsg
;
DeviceMessageUtil
.
updateLineMsg
(
lineMsg
,
code
,
cids
,
reelLocInfo
.
getLockPosName
(),
"smfcore.linemsg.posLock"
,
new
String
[]{
barcode
.
getBarcode
(),
reelLocInfo
.
getLockPosName
()});
resultMap
.
put
(
"result"
,
"99"
);
resultMap
.
put
(
"msg"
,
errorMsg
);
return
resultMap
;
}
else
{
resultMap
.
put
(
"pos"
,
pos
.
getPosName
());
resultMap
.
put
(
"barcode"
,
barcode
.
getBarcode
());
resultMap
.
put
(
"cid"
,
theStorage
.
getCid
());
}
log
.
info
(
okMsg
);
resultMap
.
put
(
"pos"
,
pos
.
getPosName
());
resultMap
.
put
(
"barcode"
,
barcode
.
getBarcode
());
resultMap
.
put
(
"cid"
,
storage
.
getCid
());
resultMap
.
put
(
"taskId"
,
newTask
.
getId
());
}
else
{
}
else
{
resultMap
.
put
(
"result"
,
"104"
);
resultMap
.
put
(
"result"
,
"104"
);
errorMsg
=
"["
+
barcode
.
getBarcode
()
+
"]未找到可用的["
+
barcode
.
getPlateSize
()
+
"x"
+
barcode
.
getHeight
()
+
"]仓位"
;
errorMsg
=
"["
+
barcode
.
getBarcode
()
+
"]未找到可用的["
+
barcode
.
getPlateSize
()
+
"x"
+
barcode
.
getHeight
()
+
"]仓位"
;
...
@@ -611,6 +584,7 @@ public class DeviceController {
...
@@ -611,6 +584,7 @@ public class DeviceController {
pos
=
storagePosManager
.
getByPosName
(
posName
);
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(
101
,
"smfcore.queryPos.cannotFind"
,
"cannot find posName ["
+
posName
+
"]"
,
new
String
[]{
posName
});
return
ResultBean
.
newErrorResult
(
101
,
"smfcore.queryPos.cannotFind"
,
"cannot find posName ["
+
posName
+
"]"
,
new
String
[]{
posName
});
}
else
if
(
pos
.
getBarcode
()
==
null
)
{
}
else
if
(
pos
.
getBarcode
()
==
null
)
{
return
ResultBean
.
newErrorResult
(
100
,
"smfcore.queryPos.posIsEmpty"
,
"["
+
posName
+
"] is empty"
,
new
String
[]{
posName
});
return
ResultBean
.
newErrorResult
(
100
,
"smfcore.queryPos.posIsEmpty"
,
"["
+
posName
+
"] is empty"
,
new
String
[]{
posName
});
}
}
...
...
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
查看文件 @
4aba1df
...
@@ -8,6 +8,7 @@ import com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager;
...
@@ -8,6 +8,7 @@ import com.neotel.smfcore.core.language.service.nanager.ILanguageMsgManager;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
...
@@ -86,7 +87,12 @@ public class MessageUtils {
...
@@ -86,7 +87,12 @@ public class MessageUtils {
log
.
error
(
"语言信息导入出错"
,
e
);
log
.
error
(
"语言信息导入出错"
,
e
);
}
}
}
}
private
static
String
defLanguage
=
""
;
@Value
(
"${app.defLanguage: zh-CN}"
)
public
void
setDefLanguage
(
String
defLanguage
)
{
MessageUtils
.
defLanguage
=
defLanguage
;
}
private
void
initLanguageMsgList
()
{
private
void
initLanguageMsgList
()
{
...
@@ -104,6 +110,9 @@ public class MessageUtils {
...
@@ -104,6 +110,9 @@ public class MessageUtils {
//-----------------以下为从缓存读取资源-------------------------------------
//-----------------以下为从缓存读取资源-------------------------------------
public
static
Locale
getDefaultLocal
(){
public
static
Locale
getDefaultLocal
(){
if
(
ObjectUtil
.
isNotEmpty
(
defLanguage
)){
return
new
Locale
(
defLanguage
);
}
return
new
Locale
(
"zh-CH"
);
return
new
Locale
(
"zh-CH"
);
}
}
...
...
src/main/resources/messages.properties
查看文件 @
4aba1df
...
@@ -327,9 +327,9 @@ smfcore.errorLog=ErrorLog
...
@@ -327,9 +327,9 @@ smfcore.errorLog=ErrorLog
smfcore.errorReport
=
ErrorReport
smfcore.errorReport
=
ErrorReport
smfcore.eventLog
=
EventLog
smfcore.eventLog
=
EventLog
smfcore.reports
=
Report
smfcore.reports
=
Report
smfcore.queryPos.cannotFind
=
cannot find posName
[{0}]
smfcore.queryPos.cannotFind
=
\u
627E
\u
4E0D
\u5230\u
5E93
\u
4F4D
[{0}]
smfcore.queryPos.posIsEmpty
=
[{0}]
is empty
smfcore.queryPos.posIsEmpty
=
[{0}]
\u
4E3A
\u
7A7A
smfcore.queryPos.cannotFindBarcode
=
cannot find barcode [{0}] In storage
smfcore.queryPos.cannotFindBarcode
=
\u
672A
\u5728\u
5E93
\u
5B58
\u
4E2D
\u
627E
\u5230\u6761\u7801
[{0}]
smfcore.storage.notAvailable
=
\u6599\u
4ED3{0}
\u
4E0D
\u
53EF
\u7528\u
FF0C
\u
65E0
\u
6CD5
\u
51FA
\u
5E93
smfcore.storage.notAvailable
=
\u6599\u
4ED3{0}
\u
4E0D
\u
53EF
\u7528\u
FF0C
\u
65E0
\u
6CD5
\u
51FA
\u
5E93
smfcore.selfAuditManagerment
=
\u
76D8
\u
70B9
smfcore.selfAuditManagerment
=
\u
76D8
\u
70B9
smfcore.selfAudit
=
\u
76D8
\u
70B9
smfcore.selfAudit
=
\u
76D8
\u
70B9
...
@@ -343,7 +343,7 @@ smfcore.selfAudit.pause=\u76D8\u70B9{0}\u5DF2\u6682\u505C
...
@@ -343,7 +343,7 @@ smfcore.selfAudit.pause=\u76D8\u70B9{0}\u5DF2\u6682\u505C
smfcore.shelf.error.orderError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u
5DE5
\u5355
[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.orderError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u
5DE5
\u5355
[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
smfcore.shelf.error.storageError
=
\u
4EFB
\u
52A1
\u
4E0E
\u6307\u
5B9A
\u6599\u
67B6[{0}]
\u
4E0D
\u
4E00
\u
81F4
order.error.executing
=
{0}
\u
5DF2
\u5728\u
4EFB
\u
52A1
\u5217\u8868\u
4E2D
order.error.executing
=
{0}
\u
5DF2
\u5728\u
4EFB
\u
52A1
\u5217\u8868\u
4E2D
smfcore.queryPos.solderOutFail
=
[{0}]
checkOut fail,currStatus
[{1}]
smfcore.queryPos.solderOutFail
=
[{0}]
\u
51FA
\u
5E93
\u5931\u
8D25,
\u
5F53
\u
524D
\u
72B6
\u6001
[{1}]
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.operationFailure
=
\u
64CD
\u
4F5C
\u5931\u
8D25
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.hotayi.machineID.error
=
machineID inconsistency [{0}] [{1}]
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
smfcore.selfAudit.noPos
=
\u
76D8
\u
70B9{0}
\u
672A
\u
627E
\u5230\u
5E93
\u
4F4D
\u
53F7
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论