Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9e01f250
由
孙克
编写于
2023-10-11 13:35:37 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge branch 'master' of
http://106.15.194.121:8083/sunke/smf-core
2 个父辈
83a63add
1e024f20
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
33 个修改的文件
包含
1041 行增加
和
42 行删除
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
src/main/java/com/neotel/smfcore/common/utils/SmbUtil.java
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/humiture/rest/HumitureController.java
src/main/java/com/neotel/smfcore/core/language/rest/LanguageMsgController.java
src/main/java/com/neotel/smfcore/core/language/util/LanguageMsgService.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/hicks20714/HicksMenu.java
src/main/java/com/neotel/smfcore/custom/hicks20714/bean/LNBResidueInfo.java
src/main/java/com/neotel/smfcore/custom/hicks20714/bean/dto/LNBResidueInfoDto.java
src/main/java/com/neotel/smfcore/custom/hicks20714/rest/HicksController.java
src/main/java/com/neotel/smfcore/custom/hicks20714/util/FileUtil.java
src/main/java/com/neotel/smfcore/custom/hicks20714/util/HicksUtil.java
src/main/java/com/neotel/smfcore/custom/iriichi1081/IriichiApi.java
src/main/java/com/neotel/smfcore/custom/iriichi1081/IriichiMenu.java
src/main/java/com/neotel/smfcore/custom/iriichi1081/config/IriichiConfig.java
src/main/java/com/neotel/smfcore/custom/iriichi1081/controller/CycleCountController.java
src/main/java/com/neotel/smfcore/custom/neotel/NeotelApi.java
src/main/java/com/neotel/smfcore/custom/smdbox/MesApiController.java
src/main/java/com/neotel/smfcore/mimo/controller/SmdBoxMimoController.java
src/main/resources/config/application.yml
src/main/resources/messages.properties
src/main/resources/messages_en_US.properties
src/main/resources/messages_ja_JP.properties
src/main/resources/messages_zh_CN.properties
src/main/resources/messages_zh_TW.properties
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
查看文件 @
9e01f25
...
@@ -113,9 +113,14 @@ public class MenuInit {
...
@@ -113,9 +113,14 @@ public class MenuInit {
//AGV看板
//AGV看板
//addDefaultFunctionMenu(1,null,"AGV看板","agvkanban", "agv/agvkanban/index","agv");
//addDefaultFunctionMenu(1,null,"AGV看板","agvkanban", "agv/agvkanban/index","agv");
//Mimo临时看板
addDefaultFunctionMenu
(
0
,
null
,
"SMD BOX MIMO"
,
"SMDBOXMIMO"
,
"smdBoxMimo/index"
,
"smdMimo"
);
//电子看板
addDefaultFunctionMenu
(
1
,
null
,
"电子看板"
,
"eleckanban"
,
"eleckanban/index"
,
"kanban"
);
//设备看板
//设备看板
addDefaultFunctionMenu
(
1
,
null
,
"设备看板"
,
"lockMaterial"
,
"lockMaterial/material/index"
,
"kanban"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
1
,
null
,
"设备看板"
,
"lockMaterial"
,
"lockMaterial/material/index"
,
"kanban"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
1
,
null
,
"电子看板"
,
"eleckanban"
,
"elecKanban/index"
,
"kanban"
,
DEFAULT_SHOW_MENU
);
//设备互联
//设备互联
addDefaultFunctionMenu
(
2
,
null
,
"设备互联"
,
"equipmentView"
,
"neolight/equipmentView/index"
,
"sKanban"
);
addDefaultFunctionMenu
(
2
,
null
,
"设备互联"
,
"equipmentView"
,
"neolight/equipmentView/index"
,
"sKanban"
);
...
@@ -182,6 +187,7 @@ public class MenuInit {
...
@@ -182,6 +187,7 @@ public class MenuInit {
addDefaultFunctionMenu
(
71
,
pMenuReport
,
"出入库"
,
"inOutDataCount"
,
"neolight/inOutDataCount/index"
,
"outPut"
);
addDefaultFunctionMenu
(
71
,
pMenuReport
,
"出入库"
,
"inOutDataCount"
,
"neolight/inOutDataCount/index"
,
"outPut"
);
addDefaultFunctionMenu
(
72
,
pMenuReport
,
"库存"
,
"inventory"
,
"neolight/inventory/index"
,
"inventory"
);
addDefaultFunctionMenu
(
72
,
pMenuReport
,
"库存"
,
"inventory"
,
"neolight/inventory/index"
,
"inventory"
);
addDefaultFunctionMenu
(
73
,
pMenuReport
,
"温湿度"
,
"humiture"
,
"humiture/humitureReport/index"
,
"humiture"
);
addDefaultFunctionMenu
(
73
,
pMenuReport
,
"温湿度"
,
"humiture"
,
"humiture/humitureReport/index"
,
"humiture"
);
addDefaultFunctionMenu
(
73
,
pMenuReport
,
"温湿度"
,
"spHumiture"
,
"humiture/spHumitureReport/index"
,
"humiture"
);
//可观测性:物料追踪
//可观测性:物料追踪
Menu
guanceMenu
=
Menu
.
CreatePMenu
(
"可观测性"
,
8
,
"observability"
,
"scanKey"
,
null
);
Menu
guanceMenu
=
Menu
.
CreatePMenu
(
"可观测性"
,
8
,
"observability"
,
"scanKey"
,
null
);
...
@@ -217,6 +223,7 @@ public class MenuInit {
...
@@ -217,6 +223,7 @@ public class MenuInit {
addDefaultFunctionMenu
(
99991
,
helpAbout
,
"说明书"
,
"instruction"
,
"system/instruction/index"
,
"aboutBook"
);
addDefaultFunctionMenu
(
99991
,
helpAbout
,
"说明书"
,
"instruction"
,
"system/instruction/index"
,
"aboutBook"
);
addDefaultFunctionMenu
(
99992
,
helpAbout
,
"关于"
,
"about"
,
"system/about/index"
,
"message"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
99992
,
helpAbout
,
"关于"
,
"about"
,
"system/about/index"
,
"message"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
123
,
null
,
"LNB残数"
,
"LNBResidue"
,
"neolight/lnbResidue/index"
,
"kanban"
);
return
allMenuMap
;
return
allMenuMap
;
}
}
...
...
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
查看文件 @
9e01f25
...
@@ -358,6 +358,46 @@ public class HttpHelper {
...
@@ -358,6 +358,46 @@ public class HttpHelper {
}
}
}
}
public
static
String
getJson
(
String
url
,
Map
<
String
,
String
>
headerMap
,
Object
params
)
throws
ApiException
{
// 设置请求参数
if
(
params
!=
null
)
{
try
{
ObjectMapper
mapper
=
new
ObjectMapper
();
String
requestBody
=
mapper
.
writeValueAsString
(
params
);
List
<
NameValuePair
>
nameValuePairs
=
new
LinkedList
<>();
nameValuePairs
.
add
(
new
BasicNameValuePair
(
"JSON"
,
requestBody
));
String
paramStr
=
EntityUtils
.
toString
(
new
UrlEncodedFormEntity
(
nameValuePairs
));
url
=
appendString
(
url
,
paramStr
);
// url=url+"?JSON="+requestBody;
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"getJson append params to ["
+
url
+
"] exception:"
+
e
.
getMessage
());
}
}
try
{
HttpGet
httpGet
=
new
HttpGet
(
url
);
RequestConfig
requestConfig
=
RequestConfig
.
custom
().
setConnectTimeout
(
CONNECTION_TIMEOUT
).
build
();
httpGet
.
setConfig
(
requestConfig
);
if
(
headerMap
!=
null
&&
!
headerMap
.
isEmpty
())
{
for
(
Entry
<
String
,
String
>
entry
:
headerMap
.
entrySet
())
{
httpGet
.
addHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
CloseableHttpResponse
response
=
httpClient
.
execute
(
httpGet
);
int
code
=
response
.
getStatusLine
().
getStatusCode
();
HttpEntity
entity
=
response
.
getEntity
();
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
response
.
close
();
httpClient
.
close
();
return
responseContent
;
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
}
private
static
String
appendString
(
String
url
,
String
paramStr
)
{
private
static
String
appendString
(
String
url
,
String
paramStr
)
{
StringBuffer
stringBuffer
=
new
StringBuffer
();
StringBuffer
stringBuffer
=
new
StringBuffer
();
stringBuffer
.
append
(
url
);
stringBuffer
.
append
(
url
);
...
...
src/main/java/com/neotel/smfcore/common/utils/SmbUtil.java
查看文件 @
9e01f25
...
@@ -123,4 +123,98 @@ public class SmbUtil {
...
@@ -123,4 +123,98 @@ public class SmbUtil {
}
}
return
false
;
return
false
;
}
}
/**
* @Title smbGet
* @Param shareUrl 共享目录中的文件路径,如smb://132.20.2.33/CIMPublicTest/eg.txt
* @Param localDirectory 本地目录,如tempStore/smb
*/
public
static
boolean
smbGetByAuth
(
String
smbFile
,
NtlmPasswordAuthentication
auth
,
String
localDirectory
){
InputStream
in
=
null
;
OutputStream
out
=
null
;
try
{
Config
.
registerSmbURLHandler
();
SmbFile
remoteFile
=
new
SmbFile
(
smbFile
,
auth
);
if
(!
remoteFile
.
exists
())
{
log
.
info
(
"共享文件不存在"
);
return
false
;
}
// 有文件的时候再初始化输入输出流
log
.
info
(
"下载共享目录的文件 "
+
smbFile
+
" 到 "
+
localDirectory
);
String
fileName
=
remoteFile
.
getName
();
File
localFile
=
new
File
(
localDirectory
+
File
.
separator
+
fileName
);
File
fileParent
=
localFile
.
getParentFile
();
if
(
null
!=
fileParent
&&
!
fileParent
.
exists
())
{
fileParent
.
mkdirs
();
}
in
=
new
BufferedInputStream
(
new
SmbFileInputStream
(
remoteFile
));
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
localFile
));
byte
[]
buffer
=
new
byte
[
1024
];
while
(
in
.
read
(
buffer
)
!=
-
1
)
{
out
.
write
(
buffer
);
buffer
=
new
byte
[
1024
];
}
out
.
flush
();
//刷新缓冲区输出流
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"获取 SMB 文件出错"
,
e
);
}
finally
{
close
(
in
,
out
);
}
return
false
;
}
/**
* 列出SMB服务器文件夹中的所有文件,如果目录不存在或者访问出错返回null
*/
public
static
List
<
SmbFile
>
smbFileList
(
String
smbDir
)
{
try
{
SmbFile
remoteFile
=
new
SmbFile
(
smbDir
);
if
(
remoteFile
.
exists
()
&&
remoteFile
.
isDirectory
())
{
return
Lists
.
newArrayList
(
remoteFile
.
listFiles
());
}
else
{
log
.
info
(
"SMB目录["
+
smbDir
+
"]不存在"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"访问SMB目录["
+
smbDir
+
"]出错"
,
e
);
}
return
null
;
}
/**
* @Title smbGet
* @Param shareUrl 共享目录中的文件路径,如smb://132.20.2.33/CIMPublicTest/eg.txt
* @Param localDirectory 本地目录,如tempStore/smb
*/
public
static
boolean
smbGet
(
SmbFile
smbFile
,
String
localDirectory
)
{
InputStream
in
=
null
;
OutputStream
out
=
null
;
try
{
// 有文件的时候再初始化输入输出流
log
.
info
(
"下载共享目录的文件 "
+
smbFile
+
" 到 "
+
localDirectory
);
String
fileName
=
smbFile
.
getName
();
File
localFile
=
new
File
(
localDirectory
+
File
.
separator
+
fileName
);
File
fileParent
=
localFile
.
getParentFile
();
if
(
null
!=
fileParent
&&
!
fileParent
.
exists
())
{
fileParent
.
mkdirs
();
}
in
=
new
BufferedInputStream
(
new
SmbFileInputStream
(
smbFile
));
out
=
new
BufferedOutputStream
(
new
FileOutputStream
(
localFile
));
byte
[]
buffer
=
new
byte
[
1024
];
while
(
in
.
read
(
buffer
)
!=
-
1
)
{
out
.
write
(
buffer
);
buffer
=
new
byte
[
1024
];
}
out
.
flush
();
//刷新缓冲区输出流
return
true
;
}
catch
(
Exception
e
)
{
log
.
error
(
"获取 SMB 文件出错"
,
e
);
}
finally
{
close
(
in
,
out
);
}
return
false
;
}
}
}
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
查看文件 @
9e01f25
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.csv.CsvReader;
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.csv.CsvReader;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.FileUtil
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.core.barcode.bean.BarcodeRule
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeRuleDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeRuleDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper
;
import
com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper
;
...
@@ -179,6 +180,15 @@ public class BarcodeController {
...
@@ -179,6 +180,15 @@ public class BarcodeController {
return
ResultBean
.
newOkResult
(
resultMsg
);
return
ResultBean
.
newOkResult
(
resultMsg
);
}
}
/*@ApiOperation("根据条码信息获取条码规则")
@PostMapping(value = "getBarcodeRule")
public ResultBean getBarcodeRule(@RequestBody Map<String, String> paramMap) {
String ruleStr = BarcodeRule.toCodeRule(paramMap.get("codeStr"), paramMap);
return ResultBean.newOkResult(ruleStr);
}*/
protected
String
handleBarcode
(
String
fileURL
)
throws
Exception
{
protected
String
handleBarcode
(
String
fileURL
)
throws
Exception
{
log
.
info
(
"开始读取文件:"
+
fileURL
);
log
.
info
(
"开始读取文件:"
+
fileURL
);
CsvReader
csvRead
=
CsvReader
.
newReader
(
fileURL
,
"条码"
,
"RI"
);
CsvReader
csvRead
=
CsvReader
.
newReader
(
fileURL
,
"条码"
,
"RI"
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
查看文件 @
9e01f25
...
@@ -165,6 +165,10 @@ public class ComponentManagerImpl implements IComponentManager {
...
@@ -165,6 +165,10 @@ public class ComponentManagerImpl implements IComponentManager {
logName
=
"修改元器件"
;
logName
=
"修改元器件"
;
c
.
and
(
"id"
).
ne
(
resources
.
getId
());
c
.
and
(
"id"
).
ne
(
resources
.
getId
());
}
}
if
(
StringUtils
.
isNotBlank
(
resources
.
getProvider
())){
c
.
and
(
"provider"
).
is
(
resources
.
getProvider
());
}
Component
com
=
componentDao
.
findOne
(
new
Query
(
c
));
Component
com
=
componentDao
.
findOne
(
new
Query
(
c
));
if
(
com
!=
null
)
{
if
(
com
!=
null
)
{
throw
new
ValidateException
(
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"partNumber"
,
resources
.
getPartNumber
()});
throw
new
ValidateException
(
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"partNumber"
,
resources
.
getPartNumber
()});
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
9e01f25
...
@@ -626,12 +626,24 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -626,12 +626,24 @@ public class BaseDeviceHandler implements IDeviceHandler {
updateInOutDateExecuteTime
(
task
.
getPosName
(),
executeTime
);
updateInOutDateExecuteTime
(
task
.
getPosName
(),
executeTime
);
}
}
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,执行时间["
+
executeTime
+
"]秒"
);
log
.
info
(
task
.
getBarcode
()
+
"出仓位["
+
task
.
getPosName
()
+
"]完成,执行时间["
+
executeTime
+
"]秒"
);
DataLog
cancelTask
=
taskService
.
findFinishedOutTask
(
cid
,
task
.
getPosName
(),
task
.
getBarcode
());
List
<
DataLog
>
taskList
=
taskService
.
findFinishedTaskList
(
cid
,
task
.
getPosName
(),
task
.
getBarcode
(),
false
);
if
(
taskList
!=
null
&&
!
taskList
.
isEmpty
()){
for
(
DataLog
dataLog
:
taskList
)
{
if
(
dataLog
.
isCancel
()){
//将相同库位已经取消的任务从完成队列里删除
taskService
.
removeFinishedTask
(
dataLog
);
log
.
info
(
"从已完成的任务列表中删除之前取消的任务:"
+
dataLog
.
getPosName
()
+
" ReelId:"
+
dataLog
.
getBarcode
());
}
}
}
/* DataLog cancelTask = taskService.findFinishedOutTask(cid, task.getPosName(),task.getBarcode());
if (cancelTask != null && cancelTask.isCancel()) {
if (cancelTask != null && cancelTask.isCancel()) {
//将相同库位已经取消的任务从完成队列里删除
//将相同库位已经取消的任务从完成队列里删除
taskService.removeFinishedTask(cancelTask);
taskService.removeFinishedTask(cancelTask);
log.info("从已完成的任务列表中删除之前取消的任务:" + cancelTask.getPosName() + " ReelId:" + cancelTask.getBarcode());
log.info("从已完成的任务列表中删除之前取消的任务:" + cancelTask.getPosName() + " ReelId:" + cancelTask.getBarcode());
}
}
*/
updateCheckoutData
(
task
,
outBoxStatus
);
updateCheckoutData
(
task
,
outBoxStatus
);
}
else
{
}
else
{
//log.error(operationKey + "触发仓位完成时,操作队列中不存在");
//log.error(operationKey + "触发仓位完成时,操作队列中不存在");
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLLShelfHandler.java
0 → 100644
查看文件 @
9e01f25
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
9e01f25
...
@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
...
@@ -5,6 +5,7 @@ import com.google.common.base.Strings;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
...
@@ -228,11 +229,18 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -228,11 +229,18 @@ public class NLPShelfHandler extends BaseDeviceHandler {
dataLogList
.
add
(
queueTask
);
dataLogList
.
add
(
queueTask
);
outMap
.
put
(
queueTask
.
getSourceId
(),
dataLogList
);
outMap
.
put
(
queueTask
.
getSourceId
(),
dataLogList
);
}
else
{
}
else
{
color
=
ORDER_COLOR
.
BLUE
;
if
(
StringUtils
.
isNotBlank
(
rgb
)){
log
.
info
(
queueTask
.
getPosName
()
+
"库位亮灯:"
+
"#"
+
rgb
);
statusBean
.
addData
(
"open"
,
queueTask
.
getPosName
()
+
"=#"
+
rgb
);
}
else
{
color
=
ORDER_COLOR
.
BLUE
;
}
}
}
}
}
statusBean
.
addData
(
"open"
,
queueTask
.
getPosName
()
+
"="
+
color
.
name
());
if
(
color
!=
null
){
log
.
info
(
"库位["
+
queueTask
.
getPosName
()
+
"]+亮灯:"
+
color
.
name
());
statusBean
.
addData
(
"open"
,
queueTask
.
getPosName
()
+
"="
+
color
.
name
());
log
.
info
(
"库位["
+
queueTask
.
getPosName
()
+
"]+亮灯:"
+
color
.
name
());
}
}
}
}
}
...
@@ -306,7 +314,8 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -306,7 +314,8 @@ public class NLPShelfHandler extends BaseDeviceHandler {
List
<
String
>
newList
=
new
ArrayList
<>();
List
<
String
>
newList
=
new
ArrayList
<>();
for
(
String
posName
:
hasReelPosList
)
{
for
(
String
posName
:
hasReelPosList
)
{
if
(
disabledPosNameSet
.
contains
(
posName
)){
if
(
disabledPosNameSet
.
contains
(
posName
)){
//log.info(cid + "sensorChange hasReelPosList [" + posName + "]库位被禁用,忽略");
log
.
info
(
cid
+
"sensorChange hasReelPosList ["
+
posName
+
"]库位被禁用,忽略"
);
inOkList
.
add
(
posName
);
continue
;
continue
;
}
else
if
(
usedPosList
.
contains
(
posName
)){
}
else
if
(
usedPosList
.
contains
(
posName
)){
log
.
info
(
cid
+
"sensorChange hasReelPosList ["
+
posName
+
"]库位已有物料,加入到ok列表"
);
log
.
info
(
cid
+
"sensorChange hasReelPosList ["
+
posName
+
"]库位已有物料,加入到ok列表"
);
...
@@ -495,10 +504,17 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -495,10 +504,17 @@ public class NLPShelfHandler extends BaseDeviceHandler {
String
rgb
=
task
.
getLightColor
();
String
rgb
=
task
.
getLightColor
();
ORDER_COLOR
color
=
ORDER_COLOR
.
fromRgb
(
rgb
);
ORDER_COLOR
color
=
ORDER_COLOR
.
fromRgb
(
rgb
);
if
(
color
==
null
)
{
if
(
color
==
null
)
{
color
=
ORDER_COLOR
.
BLUE
;
if
(
StringUtils
.
isNotBlank
(
rgb
)){
String
outTaskPos
=
task
.
getPosName
()
+
"=#"
+
rgb
;
outTaskPosList
.
add
(
outTaskPos
);
}
else
{
color
=
ORDER_COLOR
.
BLUE
;
}
}
if
(
color
!=
null
)
{
String
outTaskPos
=
task
.
getPosName
()
+
"="
+
color
.
name
();
outTaskPosList
.
add
(
outTaskPos
);
}
}
String
outTaskPos
=
task
.
getPosName
()
+
"="
+
color
.
name
();
outTaskPosList
.
add
(
outTaskPos
);
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
9e01f25
...
@@ -283,6 +283,13 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -283,6 +283,13 @@ public class NLShelfHandler extends BaseDeviceHandler {
}
}
}
}
if
(
pos
!=
null
)
{
if
(
pos
!=
null
)
{
//判断当前库位是否有任务
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
if
(
excludePosIds
.
contains
(
pos
.
getId
())){
throw
new
ValidateException
(
"smfcore.shelf.nextPos.hasTask"
,
"库位[{0}]已有任务,请重新扫描库位码"
,
new
String
[]{
pos
.
getPosName
()});
}
//扫描的为库位条码,先关掉上一个库位灯, 当前库位中没有物料的话点亮库位灯
//扫描的为库位条码,先关掉上一个库位灯, 当前库位中没有物料的话点亮库位灯
closeLastPos
(
token
);
closeLastPos
(
token
);
//判断库位是否是对应设备或者租
//判断库位是否是对应设备或者租
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
9e01f25
...
@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
...
@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.core.barcode.service.manager.IComponentManager
;
import
com.neotel.smfcore.core.barcode.service.manager.IComponentManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
...
@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
...
@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
@@ -44,6 +46,7 @@ import org.springframework.stereotype.Repository;
...
@@ -44,6 +46,7 @@ import org.springframework.stereotype.Repository;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.regex.Pattern
;
/**
/**
* 缓存
* 缓存
...
@@ -942,4 +945,15 @@ public class DataCache {
...
@@ -942,4 +945,15 @@ public class DataCache {
return
inOutData
;
return
inOutData
;
}
}
public
List
getCacheList
(
String
keyStr
)
{
List
<
Object
>
list
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
cacheMap
.
entrySet
())
{
String
key
=
entry
.
getKey
();
Object
value
=
entry
.
getValue
();
if
(
key
.
startsWith
(
keyStr
))
{
list
.
add
(
value
);
}
}
return
list
;
}
}
}
src/main/java/com/neotel/smfcore/core/humiture/rest/HumitureController.java
查看文件 @
9e01f25
...
@@ -10,6 +10,7 @@ import com.neotel.smfcore.core.humiture.rest.bean.query.HumitureQueryCriteria;
...
@@ -10,6 +10,7 @@ import com.neotel.smfcore.core.humiture.rest.bean.query.HumitureQueryCriteria;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.msd.bean.MSDSettiings
;
import
com.neotel.smfcore.core.msd.bean.MSDSettiings
;
import
com.neotel.smfcore.core.solder.bean.SpSettings
;
import
com.neotel.smfcore.core.solder.bean.SpSettings
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.service.manager.IHumitureManager
;
import
com.neotel.smfcore.core.system.service.manager.IHumitureManager
;
import
com.neotel.smfcore.core.system.service.po.Humiture
;
import
com.neotel.smfcore.core.system.service.po.Humiture
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -44,22 +45,22 @@ public class HumitureController {
...
@@ -44,22 +45,22 @@ public class HumitureController {
@GetMapping
(
"api/humiture/list"
)
@GetMapping
(
"api/humiture/list"
)
public
HumitureDto
info
(
HumitureQueryCriteria
criteria
,
Pageable
pageable
)
{
public
HumitureDto
info
(
HumitureQueryCriteria
criteria
,
Pageable
pageable
)
{
MSDSettiings
msdSettiings
=
dataCache
.
getCache
(
Constants
.
CACHE_msdSetting
);
MSDSettiings
msdSettiings
=
dataCache
.
getCache
(
Constants
.
CACHE_msdSetting
);
if
(
msdSettiings
==
null
){
if
(
msdSettiings
==
null
)
{
msdSettiings
=
new
MSDSettiings
();
msdSettiings
=
new
MSDSettiings
();
}
}
Float
maxTemperature
=
msdSettiings
.
getMaxTemperature
();
Float
maxTemperature
=
msdSettiings
.
getMaxTemperature
();
Float
maxHumidity
=
msdSettiings
.
getMaxHumidity
();
Float
maxHumidity
=
msdSettiings
.
getMaxHumidity
();
Float
minTemperature
=
msdSettiings
.
getMinTemperature
();
Float
minTemperature
=
msdSettiings
.
getMinTemperature
();
Float
minHumidity
=
msdSettiings
.
getMinHumidity
();
Float
minHumidity
=
msdSettiings
.
getMinHumidity
();
List
<
String
>
cids
=
criteria
.
getCids
();
List
<
String
>
cids
=
criteria
.
getCids
();
if
(
cids
==
null
||
cids
.
isEmpty
()){
if
(
cids
==
null
||
cids
.
isEmpty
())
{
criteria
.
setCids
(
SecurityUtils
.
getUserGroupCid
());
criteria
.
setCids
(
SecurityUtils
.
getUserGroupCid
());
}
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"createDate"
));
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"createDate"
));
query
.
addCriteria
(
Criteria
.
where
(
"temperature"
).
ne
(
"0"
));
query
.
addCriteria
(
Criteria
.
where
(
"temperature"
).
ne
(
"0"
));
PageData
<
Humiture
>
humitureList
=
humitureManager
.
findByPage
(
query
,
pageable
);
PageData
<
Humiture
>
humitureList
=
humitureManager
.
findByPage
(
query
,
pageable
);
HumitureDto
restultDto
=
new
HumitureDto
();
HumitureDto
restultDto
=
new
HumitureDto
();
restultDto
.
setMaxHumidity
(
maxHumidity
);
restultDto
.
setMaxHumidity
(
maxHumidity
);
restultDto
.
setMinHumidity
(
minHumidity
);
restultDto
.
setMinHumidity
(
minHumidity
);
...
@@ -69,7 +70,7 @@ public class HumitureController {
...
@@ -69,7 +70,7 @@ public class HumitureController {
//获取锡膏料仓冷藏区温度设置
//获取锡膏料仓冷藏区温度设置
SpSettings
spSettings
=
dataCache
.
getCache
(
Constants
.
CACHE_spSettings
);
SpSettings
spSettings
=
dataCache
.
getCache
(
Constants
.
CACHE_spSettings
);
if
(
spSettings
==
null
)
{
if
(
spSettings
==
null
)
{
spSettings
=
new
SpSettings
();
spSettings
=
new
SpSettings
();
}
}
restultDto
.
setMinColdAreaTemp
(
spSettings
.
getMinColdAreaTemp
());
restultDto
.
setMinColdAreaTemp
(
spSettings
.
getMinColdAreaTemp
());
...
@@ -77,6 +78,7 @@ public class HumitureController {
...
@@ -77,6 +78,7 @@ public class HumitureController {
return
restultDto
;
return
restultDto
;
}
}
public
static
boolean
isSpStorage
=
false
;
@ApiOperation
(
"导出温湿度列表"
)
@ApiOperation
(
"导出温湿度列表"
)
@GetMapping
(
value
=
"api/humiture/list/download"
)
@GetMapping
(
value
=
"api/humiture/list/download"
)
...
@@ -88,22 +90,42 @@ public class HumitureController {
...
@@ -88,22 +90,42 @@ public class HumitureController {
Float
maxTemperature
=
msdSettiings
.
getMaxTemperature
();
Float
maxTemperature
=
msdSettiings
.
getMaxTemperature
();
Float
maxHumidity
=
msdSettiings
.
getMaxHumidity
();
Float
maxHumidity
=
msdSettiings
.
getMaxHumidity
();
List
<
String
>
cids
=
criteria
.
getCids
();
List
<
String
>
cids
=
criteria
.
getCids
();
if
(
cids
==
null
||
cids
.
isEmpty
()){
if
(
cids
==
null
||
cids
.
isEmpty
())
{
criteria
.
setCids
(
SecurityUtils
.
getUserGroupCid
());
criteria
.
setCids
(
SecurityUtils
.
getUserGroupCid
());
}
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"createDate"
));
query
.
with
(
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"createDate"
));
query
.
addCriteria
(
Criteria
.
where
(
"temperature"
).
ne
(
"0"
));
query
.
addCriteria
(
Criteria
.
where
(
"temperature"
).
ne
(
"0"
));
//如果有一个锡膏料仓,就添加冷藏区
Map
<
String
,
Storage
>
allStorages
=
dataCache
.
getAllStorage
();
boolean
isSp
=
false
;
for
(
Storage
s
:
allStorages
.
values
())
{
if
(
s
.
isSolderPaste
())
{
isSp
=
true
;
}
}
isSpStorage
=
isSp
;
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
@Override
@Override
public
List
<
List
<
String
>>
getHeader
()
{
public
List
<
List
<
String
>>
getHeader
()
{
List
<
List
<
String
>>
header
=
new
ArrayList
<>();
List
<
List
<
String
>>
header
=
new
ArrayList
<>();
Locale
locale
=
request
.
getLocale
();
Locale
locale
=
request
.
getLocale
();
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.cid"
,
locale
,
"CID"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.cid"
,
locale
,
"CID"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.temperature"
,
locale
,
"温度"
)));
if
(
isSpStorage
)
{
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.ntemperature"
,
locale
,
"回温区温度"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.codetemperature"
,
locale
,
"冷藏区温度"
)));
}
else
{
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.temperature"
,
locale
,
"温度"
)));
}
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.humiture"
,
locale
,
"湿度"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.humiture"
,
locale
,
"湿度"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.createDate"
,
locale
,
"
创建
时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.createDate"
,
locale
,
"时间"
)));
header
.
add
(
Lists
.
newArrayList
(
MessageUtils
.
getText
(
"smfcore.humiture.updateDate"
,
locale
,
"更新时间"
)));
//
header.add(Lists.newArrayList(MessageUtils.getText("smfcore.humiture.updateDate", locale, "更新时间")));
return
header
;
return
header
;
}
}
...
@@ -121,9 +143,12 @@ public class HumitureController {
...
@@ -121,9 +143,12 @@ public class HumitureController {
List
<
Object
>
data
=
new
ArrayList
<>();
List
<
Object
>
data
=
new
ArrayList
<>();
data
.
add
(
humiture
.
getCid
());
data
.
add
(
humiture
.
getCid
());
data
.
add
(
humiture
.
getTemperature
());
data
.
add
(
humiture
.
getTemperature
());
if
(
isSpStorage
)
{
data
.
add
(
humiture
.
getCodeAirTemp
());
}
data
.
add
(
humiture
.
getHumidity
());
data
.
add
(
humiture
.
getHumidity
());
data
.
add
(
createDate
);
data
.
add
(
createDate
);
data
.
add
(
updateDate
);
//
data.add(updateDate);
dataList
.
add
(
data
);
dataList
.
add
(
data
);
}
}
return
dataList
;
return
dataList
;
...
...
src/main/java/com/neotel/smfcore/core/language/rest/LanguageMsgController.java
查看文件 @
9e01f25
...
@@ -137,24 +137,50 @@ public class LanguageMsgController {
...
@@ -137,24 +137,50 @@ public class LanguageMsgController {
@ApiOperation
(
"查询列表"
)
@ApiOperation
(
"查询列表"
)
@GetMapping
@GetMapping
@PreAuthorize
(
"@el.check('translation')"
)
@PreAuthorize
(
"@el.check('translation')"
)
public
PageData
<
LanguageMsgDto
>
query
(
LanguageMsgCriteria
criteria
,
Pageable
pageable
){
public
PageData
<
LanguageMsgDto
>
query
(
LanguageMsgCriteria
criteria
,
Pageable
pageable
)
{
List
<
String
>
typeList
=
languageMsgManager
.
findTypeList
();
List
<
String
>
typeList
=
languageMsgManager
.
findTypeList
();
int
languageSize
=
messageService
.
getAllLanList
().
size
();
int
languageSize
=
messageService
.
getAllLanList
().
size
();
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
if
(
criteria
.
getTranslationState
()
!=
null
)
{
if
(
criteria
.
getTranslationState
()
!=
null
)
{
if
(
criteria
.
getTranslationState
()
==
1
)
{
if
(
criteria
.
getTranslationState
()
==
1
)
{
query
.
addCriteria
(
Criteria
.
where
(
"contentList"
).
size
(
languageSize
));
query
.
addCriteria
(
Criteria
.
where
(
"contentList"
).
size
(
languageSize
));
}
else
if
(
criteria
.
getTranslationState
()
==
2
)
{
}
else
if
(
criteria
.
getTranslationState
()
==
2
)
{
// db.getCollection('languageMsg').find({ "contentList.3" : { "$exists" : 0 } })
// db.getCollection('languageMsg').find({ "contentList.3" : { "$exists" : 0 } })
String
proName
=
"contentList."
+(
languageSize
-
1
);
String
proName
=
"contentList."
+
(
languageSize
-
1
);
query
.
addCriteria
(
Criteria
.
where
(
proName
).
exists
(
false
));
query
.
addCriteria
(
Criteria
.
where
(
proName
).
exists
(
false
));
}
}
}
}
PageData
<
LanguageMsg
>
barcodes
=
languageMsgManager
.
findByPage
(
query
,
pageable
);
PageData
<
LanguageMsg
>
barcodes
=
languageMsgManager
.
findByPage
(
query
,
pageable
);
List
<
LanguageMsgDto
>
barcodeDtos
=
languageMsgMapper
.
toDto
(
barcodes
.
getContent
());
return
new
PageData
(
barcodeDtos
,
barcodes
.
getTotalElements
());
List
<
LanguageMsg
>
languageMsgList
=
barcodes
.
getContent
();
if
(
languageMsgList
!=
null
&&
!
languageMsgList
.
isEmpty
())
{
for
(
LanguageMsg
languageMsg
:
languageMsgList
)
{
List
<
Content
>
contentList
=
languageMsg
.
getContentList
();
if
(
contentList
==
null
)
{
contentList
=
new
ArrayList
<>();
}
List
<
String
>
allLantypeList
=
messageService
.
getAllLanList
();
for
(
String
type
:
allLantypeList
)
{
boolean
hasType
=
false
;
for
(
Content
content
:
contentList
)
{
if
(
type
.
equals
(
content
.
getLanCode
()))
{
hasType
=
true
;
break
;
}
}
if
(!
hasType
)
{
languageMsg
.
setContent
(
type
,
""
);
}
}
}
}
List
<
LanguageMsgDto
>
barcodeDtos
=
languageMsgMapper
.
toDto
(
languageMsgList
);
return
new
PageData
(
barcodeDtos
,
barcodes
.
getTotalElements
());
}
}
@ApiOperation
(
"新增资源"
)
@ApiOperation
(
"新增资源"
)
@PostMapping
@PostMapping
...
...
src/main/java/com/neotel/smfcore/core/language/util/LanguageMsgService.java
查看文件 @
9e01f25
...
@@ -331,8 +331,14 @@ public class LanguageMsgService {
...
@@ -331,8 +331,14 @@ public class LanguageMsgService {
newLanguageList
.
add
(
msg
);
newLanguageList
.
add
(
msg
);
}
else
{
}
else
{
boolean
isUpdate
=
false
;
boolean
isUpdate
=
false
;
if
(!
oldMsg
.
getEdited
()){
boolean
needUpdate
=
false
;
isNeedUpdate
=
true
;
if
(!
oldMsg
.
getEdited
())
{
needUpdate
=
true
;
}
if
(
isNeedUpdate
){
needUpdate
=
true
;
}
}
//只新增不修改
//只新增不修改
List
<
String
>
allLanList
=
getAllLanList
();
List
<
String
>
allLanList
=
getAllLanList
();
...
@@ -340,7 +346,7 @@ public class LanguageMsgService {
...
@@ -340,7 +346,7 @@ public class LanguageMsgService {
String
oldValue
=
oldMsg
.
getContent
(
lanType
);
String
oldValue
=
oldMsg
.
getContent
(
lanType
);
String
newValue
=
msg
.
getContent
(
lanType
);
String
newValue
=
msg
.
getContent
(
lanType
);
if
(
ObjectUtil
.
isNotEmpty
(
newValue
))
{
if
(
ObjectUtil
.
isNotEmpty
(
newValue
))
{
if
(
ObjectUtil
.
isEmpty
(
oldValue
)||(
isN
eedUpdate
&&(!
newValue
.
equals
(
oldValue
)))
)
{
if
(
ObjectUtil
.
isEmpty
(
oldValue
)||(
n
eedUpdate
&&(!
newValue
.
equals
(
oldValue
)))
)
{
oldMsg
.
setContent
(
lanType
,
newValue
);
oldMsg
.
setContent
(
lanType
,
newValue
);
isUpdate
=
true
;
isUpdate
=
true
;
//内容默认更改为中文
//内容默认更改为中文
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
9e01f25
...
@@ -367,6 +367,40 @@ public class TaskService {
...
@@ -367,6 +367,40 @@ public class TaskService {
return
null
;
return
null
;
}
}
/**
* 根据料仓编号和库位获取已完成/取消的任务
*
* @param cid
* @param posName
* @return
*/
public
List
<
DataLog
>
findFinishedTaskList
(
String
cid
,
String
posName
,
String
barcode
,
boolean
putInTask
)
{
List
<
DataLog
>
dataLogList
=
new
ArrayList
<>();
Collection
<
DataLog
>
areaFinishedTasks
=
theFinishedTaskMap
.
values
();
for
(
DataLog
task
:
areaFinishedTasks
)
{
boolean
isSameTask
=
false
;
if
(
ObjectUtil
.
isNotEmpty
(
posName
)
&&
task
.
getPosName
().
equals
(
posName
)
&&
task
.
getCid
().
equals
(
cid
))
{
isSameTask
=
true
;
}
else
if
(
ObjectUtil
.
isNotEmpty
(
barcode
)
&&
task
.
getBarcode
().
equals
(
barcode
)
&&
task
.
getCid
().
equals
(
cid
))
{
isSameTask
=
true
;
}
if
(
isSameTask
)
{
if
(
putInTask
)
{
if
(
task
.
isPutInTask
())
{
dataLogList
.
add
(
task
);
}
}
else
{
if
(
task
.
isCheckOutTask
())
{
dataLogList
.
add
(
task
);
}
}
}
}
return
dataLogList
;
}
/**
/**
* 根据cid 和 posName ,barcode 查找正在执行的任务,不存在时返回 null
* 根据cid 和 posName ,barcode 查找正在执行的任务,不存在时返回 null
*/
*/
...
@@ -549,6 +583,10 @@ public class TaskService {
...
@@ -549,6 +583,10 @@ public class TaskService {
public
synchronized
String
checkout
(
StoragePos
pos
,
boolean
forceOut
,
String
subSourceId
,
boolean
isSingleOut
)
{
public
synchronized
String
checkout
(
StoragePos
pos
,
boolean
forceOut
,
String
subSourceId
,
boolean
isSingleOut
)
{
return
checkout
(
pos
,
forceOut
,
subSourceId
,
isSingleOut
,
""
);
}
public
synchronized
String
checkout
(
StoragePos
pos
,
boolean
forceOut
,
String
subSourceId
,
boolean
isSingleOut
,
String
rgbCode
)
{
Barcode
barcode
=
pos
.
getBarcode
();
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
)
{
if
(
barcode
!=
null
)
{
...
@@ -589,6 +627,12 @@ public class TaskService {
...
@@ -589,6 +627,12 @@ public class TaskService {
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setSingleOut
(
isSingleOut
);
task
.
setSingleOut
(
isSingleOut
);
//判断颜色是否为空
if
(
StringUtils
.
isNotBlank
(
rgbCode
)){
task
.
setLightColor
(
rgbCode
);
}
//工单出库任务
//工单出库任务
if
(!
Strings
.
isNullOrEmpty
(
subSourceId
))
{
if
(!
Strings
.
isNullOrEmpty
(
subSourceId
))
{
// LiteOrderItem liteOrderItem = liteOrderItemDao.findOneById(subSourceId);
// LiteOrderItem liteOrderItem = liteOrderItemDao.findOneById(subSourceId);
...
...
src/main/java/com/neotel/smfcore/custom/hicks20714/HicksMenu.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
hicks20714
;
import
com.neotel.smfcore.common.init.MenuInit
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
@Component
public
class
HicksMenu
{
@Autowired
MenuInit
menuInit
;
@Autowired
SmfApi
smfApi
;
@PostConstruct
public
void
init
()
{
String
[]
menus
=
new
String
[]{
"LNBResidue"
};
menuInit
.
labelMenu
(
"hicks"
,
menus
);
String
apiName
=
smfApi
.
getApiName
();
if
(
Strings
.
isNotBlank
(
apiName
)
&&
apiName
.
equals
(
"hicks"
))
{
menuInit
.
showMenu
(
apiName
);
}
}
}
src/main/java/com/neotel/smfcore/custom/hicks20714/bean/LNBResidueInfo.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
hicks20714
.
bean
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
lombok.Data
;
import
lombok.ToString
;
/**
* LNB残数信息
*/
@Data
@ToString
public
class
LNBResidueInfo
{
@ExcelProperty
(
value
=
"Splicing remaining time"
)
private
String
splicingRemainingTime
;
@ExcelProperty
(
value
=
"Machine No."
)
private
String
machineNo
;
@ExcelProperty
(
value
=
"Table No."
)
private
String
tableNo
;
@ExcelProperty
(
value
=
"Table"
)
private
String
table
;
@ExcelProperty
(
value
=
"Feeder"
)
private
String
feeder
;
@ExcelProperty
(
value
=
"Part name"
)
private
String
partName
;
@ExcelProperty
(
value
=
"Remaining reel"
)
private
String
remainingReel
;
@ExcelProperty
(
value
=
"Remaining chips"
)
private
String
remainingChips
;
@ExcelProperty
(
value
=
"Remaining PCBs"
)
private
String
remainingPCBs
;
@ExcelProperty
(
value
=
"Z"
)
private
String
z
;
@ExcelProperty
(
value
=
"Exchange Frequency"
)
private
String
exchangeFrequency
;
@ExcelProperty
(
value
=
"Parts empty remaining time"
)
private
String
partsEmptyRemainingTime
;
@ExcelProperty
(
value
=
"Feeder serial"
)
private
String
feederSerial
;
@ExcelProperty
(
value
=
"Machine name"
)
private
String
machineName
;
@ExcelProperty
(
value
=
"Address"
)
private
String
address
;
@ExcelProperty
(
value
=
"Sub"
)
private
String
sub
;
@ExcelProperty
(
value
=
"Current LotName"
)
private
String
currentLotName
;
@ExcelProperty
(
value
=
"Splice LotName"
)
private
String
spliceLotName
;
@ExcelProperty
(
value
=
"Warning Status"
)
private
String
warningStatus
;
/**
* 默认没有出库
*/
private
boolean
isOut
=
false
;
private
boolean
isLight
=
false
;
}
src/main/java/com/neotel/smfcore/custom/hicks20714/bean/dto/LNBResidueInfoDto.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
hicks20714
.
bean
.
dto
;
import
com.neotel.smfcore.custom.hicks20714.bean.LNBResidueInfo
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
LNBResidueInfoDto
{
// 0不展示亮灯, 1展示亮灯
boolean
isLight
=
false
;
//解析的详细信息
List
<
LNBResidueInfo
>
residueInfoList
;
}
src/main/java/com/neotel/smfcore/custom/hicks20714/rest/HicksController.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
hicks20714
.
rest
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.hicks20714.bean.LNBResidueInfo
;
import
com.neotel.smfcore.custom.hicks20714.bean.dto.LNBResidueInfoDto
;
import
com.neotel.smfcore.custom.hicks20714.util.HicksUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
@Slf4j
@RestController
@RequestMapping
(
"/hicks"
)
public
class
HicksController
{
@Autowired
private
DataCache
dataCache
;
/**
* 是否刷新页面
*
* @return
*/
@RequestMapping
(
"/isRefreshIndex"
)
@AnonymousAccess
public
ResultBean
isRefreshIndex
()
{
boolean
isRefresh
=
HicksUtil
.
isIsRefresh
();
if
(
isRefresh
)
{
HicksUtil
.
setIsRefresh
(
false
);
}
return
ResultBean
.
newOkResult
(
isRefresh
);
}
/**
* 获取LNB残数详情
*
* @return
*/
@RequestMapping
(
"/getLNBResidueInfo"
)
@AnonymousAccess
public
ResultBean
getLNBResidueInfo
()
{
LNBResidueInfoDto
dto
=
new
LNBResidueInfoDto
();
List
<
LNBResidueInfo
>
infoList
=
HicksUtil
.
getInfo
();
for
(
LNBResidueInfo
lnbResidueInfo
:
infoList
)
{
lnbResidueInfo
.
setLight
(
HicksUtil
.
idNeedLight
(
Arrays
.
asList
(
lnbResidueInfo
)));
}
dto
.
setResidueInfoList
(
infoList
);
return
ResultBean
.
newOkResult
(
dto
);
}
/**
* 亮灯出库
*
* @return
*/
@RequestMapping
(
"/lightOut"
)
@AnonymousAccess
public
ResultBean
lightOut
(
String
machineNo
,
String
tableNo
,
String
table
,
String
feeder
)
{
List
<
LNBResidueInfo
>
infoList
=
HicksUtil
.
getInfo
();
String
id
=
machineNo
+
"_"
+
tableNo
+
"_"
+
table
+
"_"
+
feeder
;
LNBResidueInfo
info
=
null
;
for
(
LNBResidueInfo
lnbResidueInfo
:
infoList
)
{
String
lnbResidueInfoId
=
lnbResidueInfo
.
getMachineNo
()
+
"_"
+
lnbResidueInfo
.
getTableNo
()
+
"_"
+
lnbResidueInfo
.
getTable
()
+
"_"
+
lnbResidueInfo
.
getFeeder
();
if
(
lnbResidueInfoId
.
equals
(
id
)){
info
=
lnbResidueInfo
;
break
;
}
}
int
count
=
0
;
if
(
info
!=
null
){
count
=
HicksUtil
.
lightOut
(
Arrays
.
asList
(
info
));
}
if
(
count
==
0
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.label.noReel"
,
"未找到可出库的物料"
);
}
return
ResultBean
.
newOkResult
(
""
);
}
//是否自动亮灯
@RequestMapping
(
"/isAutoLight"
)
@AnonymousAccess
public
ResultBean
isAutoLight
(
String
isAutoLight
)
{
Boolean
auto
=
Boolean
.
valueOf
(
isAutoLight
);
dataCache
.
updateCache
(
HicksUtil
.
HICKS_AUTO_LIGHT
,
Boolean
.
valueOf
(
auto
));
if
(
auto
)
{
HicksUtil
.
setIsRefresh
(
true
);
List
<
LNBResidueInfo
>
infoList
=
HicksUtil
.
getInfo
();
int
count
=
HicksUtil
.
lightOut
(
infoList
);
if
(
count
==
0
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.label.noReel"
,
"未找到可出库的物料"
);
}
}
return
ResultBean
.
newOkResult
(
""
);
}
//亮灯时间设置
@RequestMapping
(
"/timeSetting"
)
@AnonymousAccess
public
ResultBean
timeSetting
(
String
time
)
{
try
{
dataCache
.
updateCache
(
HicksUtil
.
HICKS_TIME_SETTING
,
time
);
HicksUtil
.
setIsRefresh
(
true
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"设置失败,请确认格式是否为数字"
);
}
return
ResultBean
.
newOkResult
(
""
);
}
//获取设置
@RequestMapping
(
"/getSetting"
)
@AnonymousAccess
public
ResultBean
getSetting
(){
boolean
isAutoLight
=
dataCache
.
getCache
(
HicksUtil
.
HICKS_AUTO_LIGHT
)
==
null
?
false
:
dataCache
.
getCache
(
HicksUtil
.
HICKS_AUTO_LIGHT
);
String
time
=
dataCache
.
getCache
(
HicksUtil
.
HICKS_TIME_SETTING
)
==
null
?
20
+
""
:
dataCache
.
getCache
(
HicksUtil
.
HICKS_TIME_SETTING
);
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"isAutoLight"
,
isAutoLight
);
resultMap
.
put
(
"time"
,
time
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/com/neotel/smfcore/custom/hicks20714/util/FileUtil.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
hicks20714
.
util
;
import
com.google.common.collect.Lists
;
import
jcifs.smb.NtlmPasswordAuthentication
;
import
jcifs.smb.SmbFile
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
java.io.File
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.stream.Collectors
;
@Slf4j
@Component
public
class
FileUtil
{
/**
* 读取远程最新的文件
*
* @param path
* @return
*/
public
static
SmbFile
getSmbFile
(
String
path
,
String
userName
,
String
password
)
{
List
<
SmbFile
>
fileList
=
smbFileList
(
path
,
userName
,
password
);
if
(
fileList
!=
null
&&
!
fileList
.
isEmpty
())
{
fileList
=
fileList
.
stream
().
sorted
(
Comparator
.
comparing
(
SmbFile:
:
getDate
).
reversed
()).
collect
(
Collectors
.
toList
());
return
fileList
.
get
(
0
);
}
return
null
;
}
/**
* 列出SMB服务器文件夹中的所有文件名称,如果目录不存在或者访问出错返回null
*/
public
static
List
<
SmbFile
>
smbFileList
(
String
smbDir
,
String
userName
,
String
password
)
{
try
{
//String domain = "admin";
NtlmPasswordAuthentication
nt
=
new
NtlmPasswordAuthentication
(
null
,
userName
,
password
);
SmbFile
remoteFile
=
new
SmbFile
(
smbDir
,
nt
);
//SmbFile remoteFile = new SmbFile(smbDir);
if
(
remoteFile
.
exists
()
&&
remoteFile
.
isDirectory
())
{
SmbFile
[]
smbFiles
=
remoteFile
.
listFiles
();
return
Lists
.
newArrayList
(
smbFiles
);
}
else
{
log
.
info
(
"SMB目录["
+
smbDir
+
"]不存在"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"访问SMB目录["
+
smbDir
+
"]出错"
,
e
);
}
return
null
;
}
/**
* 删除文件
*
* @param file
* @return
*/
public
static
boolean
deleteFile
(
File
file
)
{
//判断文件不为null或文件目录存在
if
(
file
==
null
||
!
file
.
exists
())
{
return
false
;
}
//取得这个目录下的所有子文件对象
File
[]
files
=
file
.
listFiles
();
if
(
files
==
null
)
{
file
.
delete
();
return
true
;
}
//遍历该目录下的文件对象
for
(
File
f
:
files
)
{
//判断子目录是否存在子目录,如果是文件则删除
if
(
f
.
isDirectory
())
{
deleteFile
(
f
);
}
else
{
f
.
delete
();
}
}
return
true
;
}
}
src/main/java/com/neotel/smfcore/custom/hicks20714/util/HicksUtil.java
0 → 100644
查看文件 @
9e01f25
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/iriichi1081/IriichiApi.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
iriichi1081
;
import
cn.hutool.core.util.NumberUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderManager
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.custom.iriichi1081.config.IriichiConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.poi.ss.usermodel.IgnoredErrorType
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Service
public
class
IriichiApi
extends
BaseSmfApiListener
{
@Autowired
private
ILiteOrderManager
liteOrderManager
;
@Autowired
private
LiteOrderCache
liteOrderCache
;
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"iriichi"
);
}
@Override
public
LiteOrder
fetchOrder
(
String
fetchOrderUrl
,
String
orderNumber
,
String
username
)
{
String
token
=
getToken
();
if
(
StringUtils
.
isBlank
(
token
))
{
log
.
info
(
orderNumber
+
"获取token信息失败"
);
return
null
;
}
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
headerMap
.
put
(
"Authorization"
,
token
);
headerMap
.
put
(
"Accept"
,
IriichiConfig
.
accept
);
/* Map<String, Object> paramMap = new HashMap<>();
paramMap.put("customloadmethod", "IR_GetJobMaterialPickListSp");
paramMap.put("customloadmethodparms", orderNumber);
paramMap.put("loadtype", "NEXT");
paramMap.put("readonly", "TRUE");*/
try
{
String
result
=
HttpHelper
.
getJson
(
fetchOrderUrl
+
"?customloadmethod=IR_GetJobMaterialPickListSp"
+
"&readonly=true"
+
"&loadtype=NEXT"
+
"&customloadmethodparms="
+
orderNumber
,
headerMap
,
null
);
return
getOrderByResult
(
orderNumber
,
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
public
void
cycleCount
(
Barcode
barcode
)
{
String
token
=
getToken
();
if
(
StringUtils
.
isBlank
(
token
))
{
log
.
info
(
barcode
.
getBarcode
()
+
"获取token信息失败"
);
return
;
}
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
headerMap
.
put
(
"Authorization"
,
token
);
headerMap
.
put
(
"Accept"
,
IriichiConfig
.
accept
);
String
parms
=
barcode
.
getPartNumber
()
+
","
+
barcode
.
getMemo
()
+
","
+
barcode
.
getPosName
()
+
","
+
barcode
.
getBatch
()
+
","
+
barcode
.
getAmount
()
+
","
+
barcode
.
getPutInDateStr
()
+
","
+
"NULL"
+
","
+
"NULL"
;
log
.
info
(
barcode
.
getBarcode
()
+
"cycleCount入参为:"
+
parms
);
try
{
String
result
=
HttpHelper
.
getJson
(
IriichiConfig
.
cycleCount_url
+
"?parms="
+
parms
,
headerMap
,
null
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
}
}
public
String
getToken
()
{
Map
<
String
,
String
>
headerMap
=
new
HashMap
<>();
headerMap
.
put
(
"UserId"
,
IriichiConfig
.
userId
);
headerMap
.
put
(
"Password"
,
IriichiConfig
.
passWord
);
headerMap
.
put
(
"Accept"
,
IriichiConfig
.
accept
);
try
{
String
result
=
HttpHelper
.
getJson
(
IriichiConfig
.
token_url
,
headerMap
,
null
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
result
);
if
(
"Success"
.
equals
(
jsonObject
.
getString
(
"Message"
)))
{
return
jsonObject
.
getString
(
"Token"
);
}
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
}
return
""
;
}
private
LiteOrder
getOrderByResult
(
String
orderNo
,
String
result
)
{
JSONObject
resultObj
=
JSONObject
.
parseObject
(
result
);
List
<
List
<
Map
<
String
,
String
>>>
itemArr
=
resultObj
.
getObject
(
"Items"
,
List
.
class
);
List
<
LiteOrderItem
>
itemList
=
new
ArrayList
<>();
for
(
List
<
Map
<
String
,
String
>>
mapList
:
itemArr
)
{
LiteOrderItem
orderItem
=
new
LiteOrderItem
();
for
(
Map
<
String
,
String
>
map
:
mapList
)
{
if
(
"item_code"
.
equals
(
map
.
get
(
"Name"
)))
{
orderItem
.
setPn
(
map
.
get
(
"Value"
));
}
else
if
(
"qty_to_pick"
.
equals
(
map
.
get
(
"Name"
)))
{
try
{
orderItem
.
setNeedReelCount
(
NumberUtil
.
parseInt
(
map
.
get
(
"Value"
)));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
itemList
.
add
(
orderItem
);
}
if
(
itemList
!=
null
&&
!
itemList
.
isEmpty
())
{
LiteOrder
order
=
new
LiteOrder
();
order
.
setOrderItems
(
itemList
);
liteOrderManager
.
createWithItems
(
order
);
liteOrderCache
.
addOrderToMap
(
order
);
return
order
;
}
return
null
;
}
}
src/main/java/com/neotel/smfcore/custom/iriichi1081/IriichiMenu.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
iriichi1081
;
import
com.neotel.smfcore.common.init.MenuInit
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.security.service.po.Menu
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
@Component
public
class
IriichiMenu
{
@Autowired
MenuInit
menuInit
;
@Autowired
SmfApi
smfApi
;
@PostConstruct
public
void
init
(){
String
menuLabel
=
"iriichi"
;
MenuInit
.
addMenu
(
menuLabel
,
null
,
124
,
"Cycle Count"
,
"cycleCount"
,
"neolight/cycleCount/index"
,
""
);
String
apiName
=
smfApi
.
getApiName
();
if
(
Strings
.
isNotBlank
(
apiName
)
&&
apiName
.
equals
(
menuLabel
)){
menuInit
.
showMenu
(
apiName
);
}
}
}
src/main/java/com/neotel/smfcore/custom/iriichi1081/config/IriichiConfig.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
iriichi1081
.
config
;
public
class
IriichiConfig
{
//config name
public
static
final
String
iriichi_config_name
=
"app_neotel"
;
public
static
final
String
iriichi_crp_config_name
=
"Neotel@478*"
;
// token url
public
static
final
String
token_url
=
"http://myprai.iriichi.com.my:8888/IDORequestService/MGRestService.svc/json/token/IRIICHI_CRP"
;
// Job Material Picklist url 在配置文件中,配置fetchOrderUrl 地址
//public static final String picklist_url = "http://myprai.iriichi.com.my:8888/IDORequestService/MGRestService.svc/json/IR_SLAPIs/pick_list,job,job_suffix,job_item,job_item_desc,item_code,Rating,workcenter,vendnum,vendor_name,qty_to_pick/adv";
//Cycle Count url
public
static
final
String
cycleCount_url
=
"http://myprai.iriichi.com.my:8888/IDORequestService/MGRestService.svc/json/method/IR_SLAPIs/IR_InsertCycleCountSp"
;
// userId
public
static
final
String
userId
=
"app_neotel"
;
//password
public
static
final
String
passWord
=
"Neotel@478*"
;
//请求类型
public
static
final
String
accept
=
"application/json"
;
}
src/main/java/com/neotel/smfcore/custom/iriichi1081/controller/CycleCountController.java
0 → 100644
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
iriichi1081
.
controller
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.custom.iriichi1081.IriichiApi
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@RestController
@RequestMapping
(
"/cycleCount"
)
public
class
CycleCountController
{
@Autowired
private
IriichiApi
iriichiApi
;
@Autowired
private
IStoragePosManager
storagePosManager
;
private
boolean
cycleCount
=
false
;
/**
* 发送库存信息
*
* @return
*/
@RequestMapping
(
"/cycle"
)
//@AnonymousAccess
public
ResultBean
CycleCount
()
{
//10分钟内 不允许重复点击
if
(
cycleCount
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.cyclecount.executing"
,
"Cycle Count正在执行中"
);
}
cycleCount
=
true
;
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findNotEmpty
();
for
(
StoragePos
storagePos
:
storagePosList
)
{
try
{
iriichiApi
.
cycleCount
(
storagePos
.
getBarcode
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
cycleCount
=
false
;
return
ResultBean
.
newOkResult
(
""
);
}
}
src/main/java/com/neotel/smfcore/custom/neotel/NeotelApi.java
查看文件 @
9e01f25
package
com
.
neotel
.
smfcore
.
custom
.
neotel
;
package
com
.
neotel
.
smfcore
.
custom
.
neotel
;
import
cn.hutool.core.util.NumberUtil
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
...
@@ -178,7 +179,7 @@ public class NeotelApi extends BaseSmfApiListener {
...
@@ -178,7 +179,7 @@ public class NeotelApi extends BaseSmfApiListener {
String
qtyStr
=
getData
(
dataMap
,
"qty"
);
String
qtyStr
=
getData
(
dataMap
,
"qty"
);
if
(
Strings
.
isNotBlank
(
qtyStr
))
{
if
(
Strings
.
isNotBlank
(
qtyStr
))
{
int
qty
=
Integer
.
valueOf
(
qtyStr
);
int
qty
=
NumberUtil
.
parseInt
(
qtyStr
);
if
(
qty
>
0
)
{
if
(
qty
>
0
)
{
barcode
.
setAmount
(
qty
);
barcode
.
setAmount
(
qty
);
}
}
...
@@ -199,6 +200,16 @@ public class NeotelApi extends BaseSmfApiListener {
...
@@ -199,6 +200,16 @@ public class NeotelApi extends BaseSmfApiListener {
log
.
error
(
"日期转换出错"
,
e
);
log
.
error
(
"日期转换出错"
,
e
);
}
}
try
{
String
expireDateStr
=
getData
(
dataMap
,
"expireDate"
);
if
(
Strings
.
isNotBlank
(
expireDateStr
))
{
Date
expireDate
=
DateUtil
.
toDate
(
expireDateStr
,
"yyyy-MM-dd HH:mm:ss"
);
barcode
.
setExpireDate
(
expireDate
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"日期转换出错"
,
e
);
}
resolveComponent
(
barcode
);
resolveComponent
(
barcode
);
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
return
barcode
;
return
barcode
;
...
@@ -250,7 +261,7 @@ public class NeotelApi extends BaseSmfApiListener {
...
@@ -250,7 +261,7 @@ public class NeotelApi extends BaseSmfApiListener {
String
qtyStr
=
getData
(
dataMap
,
"qty"
);
String
qtyStr
=
getData
(
dataMap
,
"qty"
);
if
(
Strings
.
isNotBlank
(
qtyStr
))
{
if
(
Strings
.
isNotBlank
(
qtyStr
))
{
int
qty
=
Integer
.
valueOf
(
qtyStr
);
int
qty
=
NumberUtil
.
parseInt
(
qtyStr
);
if
(
qty
>
0
)
{
if
(
qty
>
0
)
{
barcode
.
setAmount
(
qty
);
barcode
.
setAmount
(
qty
);
}
}
...
@@ -271,7 +282,17 @@ public class NeotelApi extends BaseSmfApiListener {
...
@@ -271,7 +282,17 @@ public class NeotelApi extends BaseSmfApiListener {
log
.
error
(
"日期转换出错"
,
e
);
log
.
error
(
"日期转换出错"
,
e
);
}
}
barcode
=
barcodeManager
.
saveBarcode
(
barcode
);
try
{
String
expireDateStr
=
getData
(
dataMap
,
"expireDate"
);
if
(
Strings
.
isNotBlank
(
expireDateStr
))
{
Date
expireDate
=
DateUtil
.
toDate
(
expireDateStr
,
"yyyy-MM-dd HH:mm:ss"
);
barcode
.
setExpireDate
(
expireDate
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"日期转换出错"
,
e
);
}
barcode
=
barcodeManager
.
save
(
barcode
);
return
barcode
;
return
barcode
;
}
else
{
}
else
{
return
null
;
return
null
;
...
...
src/main/java/com/neotel/smfcore/custom/smdbox/MesApiController.java
查看文件 @
9e01f25
...
@@ -30,6 +30,7 @@ import io.swagger.annotations.Api;
...
@@ -30,6 +30,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.core.util.Integers
;
import
org.apache.logging.log4j.core.util.Integers
;
...
@@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -38,6 +39,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.PostConstruct
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.*
;
import
java.util.*
;
...
@@ -69,6 +71,31 @@ public class MesApiController {
...
@@ -69,6 +71,31 @@ public class MesApiController {
@Autowired
@Autowired
protected
CodeResolve
codeResolve
;
protected
CodeResolve
codeResolve
;
private
Map
<
String
,
String
>
colorMap
=
Maps
.
newConcurrentMap
();
@PostConstruct
private
void
initColor
()
{
colorMap
.
put
(
"FF0000"
,
"Red"
);
colorMap
.
put
(
"FFC0CB"
,
"Pink"
);
colorMap
.
put
(
"C71585"
,
"Medium Violet Red"
);
colorMap
.
put
(
"FF8C00"
,
"Dark Orange"
);
colorMap
.
put
(
"FFFF00"
,
"Yellow"
);
colorMap
.
put
(
"BDB76B"
,
"Dark Khaki"
);
colorMap
.
put
(
"E6E6FA"
,
"Lavender"
);
colorMap
.
put
(
"9370DB"
,
"Medium Purple"
);
colorMap
.
put
(
"800080"
,
"Purple"
);
colorMap
.
put
(
"ADFF2F"
,
"Green Yellow"
);
colorMap
.
put
(
"98FB98"
,
"Pale Green"
);
colorMap
.
put
(
"008000"
,
"Green"
);
colorMap
.
put
(
"808000"
,
"Olive"
);
colorMap
.
put
(
"00FFFF"
,
"Aqua"
);
colorMap
.
put
(
"7FFFD4"
,
"Aquamarine"
);
colorMap
.
put
(
"B0C4DE"
,
"Light Steel Blue"
);
colorMap
.
put
(
"0000FF"
,
"Blue"
);
colorMap
.
put
(
"FFE4C4"
,
"Bisque"
);
colorMap
.
put
(
"f4A460"
,
"Sandy Brown"
);
}
//http://localhost/myproject/rest/api/v2/mes/inventory?LOC=1
//http://localhost/myproject/rest/api/v2/mes/inventory?LOC=1
@ApiOperation
(
"查询有料仓位"
)
@ApiOperation
(
"查询有料仓位"
)
@RequestMapping
(
value
=
"/inventory"
)
@RequestMapping
(
value
=
"/inventory"
)
...
@@ -217,11 +244,18 @@ public class MesApiController {
...
@@ -217,11 +244,18 @@ public class MesApiController {
try
{
try
{
String
[]
REEL_IDS
=
request
.
getParameterValues
(
"RIS"
);
String
[]
REEL_IDS
=
request
.
getParameterValues
(
"RIS"
);
String
rgbCode
=
request
.
getParameter
(
"rgbCode"
);
//亮灯颜色
if
(
REEL_IDS
==
null
||
REEL_IDS
.
length
==
0
){
if
(
REEL_IDS
==
null
||
REEL_IDS
.
length
==
0
){
return
"Error: RI 为必须项"
;
return
"Error: RI 为必须项"
;
}
}
//判断亮灯颜色是否在这20种内
if
(
StringUtils
.
isBlank
(
colorMap
.
get
(
rgbCode
))
||
StringUtils
.
isBlank
(
rgbCode
)){
return
"Error :rgbCode不在指定范围内"
;
//return "Error: rgbCode 不在颜色范围内";
}
ArrayList
<
StoragePos
>
poses
=
Lists
.
newArrayList
();
ArrayList
<
StoragePos
>
poses
=
Lists
.
newArrayList
();
for
(
String
REEL_ID
:
REEL_IDS
)
{
for
(
String
REEL_ID
:
REEL_IDS
)
{
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
REEL_ID
);
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
REEL_ID
);
...
@@ -232,7 +266,7 @@ public class MesApiController {
...
@@ -232,7 +266,7 @@ public class MesApiController {
}
}
for
(
StoragePos
pos
:
poses
)
{
for
(
StoragePos
pos
:
poses
)
{
log
.
info
(
"出库位置仓位【"
+
pos
.
getPosName
()+
"】"
);
log
.
info
(
"出库位置仓位【"
+
pos
.
getPosName
()+
"】"
);
taskService
.
checkout
(
pos
,
false
,
null
,
false
);
taskService
.
checkout
(
pos
,
false
,
null
,
false
,
rgbCode
);
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
src/main/java/com/neotel/smfcore/mimo/controller/SmdBoxMimoController.java
0 → 100644
查看文件 @
9e01f25
此文件的差异被折叠,
点击展开。
src/main/resources/config/application.yml
查看文件 @
9e01f25
...
@@ -48,3 +48,7 @@ menu:
...
@@ -48,3 +48,7 @@ menu:
show
:
show
:
hide
:
hide
:
smd
:
filePath
:
userName
:
password
:
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages.properties
查看文件 @
9e01f25
...
@@ -309,7 +309,7 @@ smfcore.storagePos.batch=\u6279\u6B21
...
@@ -309,7 +309,7 @@ smfcore.storagePos.batch=\u6279\u6B21
smfcore.humiture.cid
=
CID
smfcore.humiture.cid
=
CID
smfcore.humiture.temperature
=
\u
6E29
\u
5EA6
smfcore.humiture.temperature
=
\u
6E29
\u
5EA6
smfcore.humiture.humiture
=
\u
6E7F
\u
5EA6
smfcore.humiture.humiture
=
\u
6E7F
\u
5EA6
smfcore.humiture.createDate
=
\u
521B
\u
5EFA
\u
65F6
\u
95F4
smfcore.humiture.createDate
=
\u
65F6
\u
95F4
smfcore.humiture.updateDate
=
\u
66F4
\u
65B0
\u
65F6
\u
95F4
smfcore.humiture.updateDate
=
\u
66F4
\u
65B0
\u
65F6
\u
95F4
smfcore.order.ri
=
RI
smfcore.order.ri
=
RI
smfcore.order.pn
=
PN
smfcore.order.pn
=
PN
...
@@ -369,4 +369,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
...
@@ -369,4 +369,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.spbox.backFail
=
\u
56DE
\u
5E93
\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.spbox.backFail
=
\u
56DE
\u
5E93
\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.spbox.expireOut
=
\u
8FC7
\u
671F
\u7269\u6599\u
51FA
\u
5E93
\ No newline at end of file
\ No newline at end of file
smfcore.spbox.expireOut
=
\u
8FC7
\u
671F
\u7269\u6599\u
51FA
\u
5E93
smfcore.humiture.codetemperature
=
\u
51B7
\u
85CF
\u
533A
\u
6E29
\u
5EA6
smfcore.humiture.ntemperature
=
\u
56DE
\u
6E29
\u
533A
\u
6E29
\u
5EA6
smfcore.cyclecount.executing
=
Cycle Count
\u
6B63
\u5728\u6267\u
884C
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_en_US.properties
查看文件 @
9e01f25
...
@@ -358,4 +358,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0} canot null
...
@@ -358,4 +358,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0} canot null
smfcore.storagePos.weight
=
Weight
smfcore.storagePos.weight
=
Weight
smfcore.expireSolderPaste
=
Expired Solder Paste
smfcore.expireSolderPaste
=
Expired Solder Paste
smfcore.spbox.backFail
=
Back to the library verification failure
smfcore.spbox.backFail
=
Back to the library verification failure
smfcore.spbox.expireOut
=
Expired solder paste out of storage
\ No newline at end of file
\ No newline at end of file
smfcore.spbox.expireOut
=
Expired solder paste out of storage
smfcore.humiture.codetemperature
=
Refrigeration zone temperature
smfcore.humiture.ntemperature
=
Return temperature zone temperature
smfcore.cyclecount.executing
=
Cycle Count are being executed
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
9e01f25
...
@@ -355,4 +355,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
...
@@ -355,4 +355,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.spbox.backFail
=
\u
56DE
\u
5E93
\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.spbox.backFail
=
\u
56DE
\u
5E93
\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.spbox.expireOut
=
\u
8FC7
\u
671F
\u7269\u6599\u
51FA
\u
5E93
\ No newline at end of file
\ No newline at end of file
smfcore.spbox.expireOut
=
\u
8FC7
\u
671F
\u7269\u6599\u
51FA
\u
5E93
smfcore.humiture.codetemperature
=
\u
51B7
\u
85CF
\u
533A
\u
6E29
\u
5EA6
smfcore.humiture.ntemperature
=
\u
56DE
\u
6E29
\u
533A
\u
6E29
\u
5EA6
smfcore.cyclecount.executing
=
Cycle Count
\u
5B9F
\u
884C
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
9e01f25
...
@@ -355,4 +355,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
...
@@ -355,4 +355,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.spbox.backFail
=
\u
56DE
\u
5E93
\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.spbox.backFail
=
\u
56DE
\u
5E93
\u
9A8C
\u
8BC1
\u5931\u
8D25
smfcore.spbox.expireOut
=
\u
8FC7
\u
671F
\u7269\u6599\u
51FA
\u
5E93
\ No newline at end of file
\ No newline at end of file
smfcore.spbox.expireOut
=
\u
8FC7
\u
671F
\u7269\u6599\u
51FA
\u
5E93
smfcore.humiture.codetemperature
=
\u
51B7
\u
85CF
\u
533A
\u
6E29
\u
5EA6
smfcore.humiture.ntemperature
=
\u
56DE
\u
6E29
\u
533A
\u
6E29
\u
5EA6
smfcore.cyclecount.executing
=
Cycle Count
\u
6B63
\u5728\u6267\u
884C
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
9e01f25
...
@@ -356,4 +356,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
...
@@ -356,4 +356,7 @@ smfcore.mesApi.codeResolveUrl.paramNull={0}\u4E0D\u80FD\u4E3A\u7A7A
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.storagePos.weight
=
\u
91CD
\u
91CF
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.expireSolderPaste
=
\u
8FC7
\u
671F
\u9521\u
818F
smfcore.spbox.backFail
=
\u
56DE
\u
5EAB
\u
9A57
\u
8B49
\u5931\u6557
smfcore.spbox.backFail
=
\u
56DE
\u
5EAB
\u
9A57
\u
8B49
\u5931\u6557
smfcore.spbox.expireOut
=
\u
904E
\u
671F
\u7269\u6599\u
51FA
\u
5EAB
\ No newline at end of file
\ No newline at end of file
smfcore.spbox.expireOut
=
\u
904E
\u
671F
\u7269\u6599\u
51FA
\u
5EAB
smfcore.humiture.codetemperature
=
\u
51B7
\u
85CF
\u
533A
\u
6E29
\u
5EA6
smfcore.humiture.ntemperature
=
\u
56DE
\u
6E29
\u
533A
\u
6E29
\u
5EA6
smfcore.cyclecount.executing
=
Cycle Count
\u
6B63
\u5728\u
57F7
\u
884C
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论