Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 40ff0fc6
由
zshaohui
编写于
2023-07-21 15:32:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.neoteapi修改
2.mimo电子看板
1 个父辈
afbbc4b7
全部展开
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
73 行增加
和
3 行删除
src/main/java/com/neotel/smfcore/common/init/MenuInit.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/device/util/DataCache.java
src/main/java/com/neotel/smfcore/custom/neotel/NeotelApi.java
src/main/java/com/neotel/smfcore/mimo/controller/SmdBoxMimoController.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
查看文件 @
40ff0fc
...
...
@@ -115,7 +115,7 @@ public class MenuInit {
//设备看板
addDefaultFunctionMenu
(
1
,
null
,
"设备看板"
,
"lockMaterial"
,
"lockMaterial/material/index"
,
"kanban"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
1
,
null
,
"电子看板"
,
"eleckanban"
,
"elecKanban/index"
,
"kanban"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
1
,
null
,
"电子看板"
,
"eleckanban"
,
"elecKanban/index"
,
"kanban"
);
//设备互联
addDefaultFunctionMenu
(
2
,
null
,
"设备互联"
,
"equipmentView"
,
"neolight/equipmentView/index"
,
"sKanban"
);
...
...
@@ -218,6 +218,7 @@ public class MenuInit {
addDefaultFunctionMenu
(
99991
,
helpAbout
,
"说明书"
,
"instruction"
,
"system/instruction/index"
,
"aboutBook"
);
addDefaultFunctionMenu
(
99992
,
helpAbout
,
"关于"
,
"about"
,
"system/about/index"
,
"message"
,
DEFAULT_SHOW_MENU
);
addDefaultFunctionMenu
(
123
,
null
,
"LNB残数"
,
"LNBResidue"
,
"neolight/lnbResidue/index"
,
"kanban"
);
return
allMenuMap
;
}
...
...
src/main/java/com/neotel/smfcore/common/utils/SmbUtil.java
查看文件 @
40ff0fc
...
...
@@ -123,4 +123,45 @@ public class SmbUtil {
}
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
;
}
}
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
查看文件 @
40ff0fc
...
...
@@ -7,6 +7,7 @@ import com.neotel.smfcore.common.csv.CsvReader;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.FileUtil
;
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.BarcodeRuleDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper
;
...
...
@@ -179,6 +180,15 @@ public class BarcodeController {
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
{
log
.
info
(
"开始读取文件:"
+
fileURL
);
CsvReader
csvRead
=
CsvReader
.
newReader
(
fileURL
,
"条码"
,
"RI"
);
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
40ff0fc
...
...
@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.exception.ValidateException
;
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.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
...
...
@@ -35,6 +36,7 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.query.Criteria
;
...
...
@@ -44,6 +46,7 @@ import org.springframework.stereotype.Repository;
import
javax.annotation.PostConstruct
;
import
java.util.*
;
import
java.util.concurrent.ConcurrentHashMap
;
import
java.util.regex.Pattern
;
/**
* 缓存
...
...
@@ -942,4 +945,15 @@ public class DataCache {
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/custom/neotel/NeotelApi.java
查看文件 @
40ff0fc
...
...
@@ -292,7 +292,7 @@ public class NeotelApi extends BaseSmfApiListener {
log
.
error
(
"日期转换出错"
,
e
);
}
barcode
=
barcodeManager
.
save
Barcode
(
barcode
);
barcode
=
barcodeManager
.
save
(
barcode
);
return
barcode
;
}
else
{
return
null
;
...
...
src/main/java/com/neotel/smfcore/mimo/controller/SmdBoxMimoController.java
0 → 100644
查看文件 @
40ff0fc
此文件的差异被折叠,
点击展开。
src/main/resources/config/application.yml
查看文件 @
40ff0fc
...
...
@@ -2,7 +2,7 @@ server:
port
:
8800
api
:
name
:
name
:
neotel
inCheckUrl
:
outNotifyUrl
:
inNotifyUrl
:
...
...
@@ -48,3 +48,7 @@ menu:
show
:
hide
:
smd
:
filePath
:
userName
:
password
:
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论