Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit bc2948f2
由
zshaohui
编写于
2025-07-25 16:03:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.nexim增加在线功能
1 个父辈
006361a0
显示空白字符变更
内嵌
并排
正在显示
16 个修改的文件
包含
124 行增加
和
123 行删除
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipViewController.java
src/main/java/com/neotel/smfcore/custom/fuji/config/FujiCacheConfig.java
src/main/java/com/neotel/smfcore/custom/fuji/config/FujiUrlConfig.java
src/main/java/com/neotel/smfcore/custom/fuji/FujiApi.java → src/main/java/com/neotel/smfcore/custom/nexim/NeximApi.java
src/main/java/com/neotel/smfcore/custom/fuji/FujiMenu.java → src/main/java/com/neotel/smfcore/custom/nexim/NeximMenu.java
src/main/java/com/neotel/smfcore/custom/fuji/bean/FujiConfig.java → src/main/java/com/neotel/smfcore/custom/nexim/bean/NeximConfig.java
src/main/java/com/neotel/smfcore/custom/fuji/bean/dto/FujiConfigDto.java → src/main/java/com/neotel/smfcore/custom/nexim/bean/dto/NeximConfigDto.java
src/main/java/com/neotel/smfcore/custom/nexim/config/NeximCacheConfig.java
src/main/java/com/neotel/smfcore/custom/fuji/controller/FujiController.java → src/main/java/com/neotel/smfcore/custom/nexim/controller/NeximController.java
src/main/java/com/neotel/smfcore/custom/fuji/order/JobHandler.java → src/main/java/com/neotel/smfcore/custom/nexim/order/JobHandler.java
src/main/java/com/neotel/smfcore/custom/fuji/order/bean/Job.java → src/main/java/com/neotel/smfcore/custom/nexim/order/bean/Job.java
src/main/java/com/neotel/smfcore/custom/fuji/order/bean/JobItem.java → src/main/java/com/neotel/smfcore/custom/nexim/order/bean/JobItem.java
src/main/java/com/neotel/smfcore/custom/fuji/order/service/JobService.java → src/main/java/com/neotel/smfcore/custom/nexim/order/service/JobService.java
src/main/java/com/neotel/smfcore/custom/nexim/util/NeximUtil.java
src/main/java/com/neotel/smfcore/custom/fuji/util/NotifyUtil.java → src/main/java/com/neotel/smfcore/custom/nexim/util/NotifyUtil.java
src/main/java/com/neotel/smfcore/custom/fuji/util/OrderUtil.java → src/main/java/com/neotel/smfcore/custom/nexim/util/OrderUtil.java
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipViewController.java
查看文件 @
bc2948f
...
@@ -2,26 +2,21 @@ package com.neotel.smfcore.core.equipment.rest;
...
@@ -2,26 +2,21 @@ package com.neotel.smfcore.core.equipment.rest;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.core.dashboard.bean.dto.box.MesInfoDto
;
import
com.neotel.smfcore.core.dashboard.bean.dto.box.MesInfoDto
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.equipment.enums.EquipmentType
;
import
com.neotel.smfcore.core.equipment.enums.EquipmentType
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipGroupDto
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipGroupDto
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipKanbanDto
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipKanbanDto
;
import
com.neotel.smfcore.core.equipment.rest.dto.NsViewDto
;
import
com.neotel.smfcore.core.equipment.rest.dto.NsViewDto
;
import
com.neotel.smfcore.core.equipment.util.EquipmentCache
;
import
com.neotel.smfcore.core.equipment.util.EquipmentCache
;
import
com.neotel.smfcore.core.equipment.bean.EquipMsg
;
import
com.neotel.smfcore.core.equipment.bean.EquipStatusBean
;
import
com.neotel.smfcore.core.equipment.bean.EquipStatusBean
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipStatusDto
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipStatusDto
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.message.enums.MessageType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.EquipStatusUtil
;
import
com.neotel.smfcore.core.system.util.EquipStatusUtil
;
import
com.neotel.smfcore.custom.fuji.bean.FujiConfig
;
import
com.neotel.smfcore.custom.fuji.config.FujiCacheConfig
;
import
com.neotel.smfcore.custom.hanwha.handler.TMSCommunicator
;
import
com.neotel.smfcore.custom.hanwha.handler.TMSCommunicator
;
import
com.neotel.smfcore.custom.nexim.bean.NeximConfig
;
import
com.neotel.smfcore.custom.nexim.config.NeximCacheConfig
;
import
com.neotel.smfcore.custom.nexim.util.NeximUtil
;
import
com.neotel.smfcore.custom.panacim.PanaApiController
;
import
com.neotel.smfcore.custom.panacim.PanaApiController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -54,6 +49,9 @@ public class EquipViewController {
...
@@ -54,6 +49,9 @@ public class EquipViewController {
@Autowired
@Autowired
private
TMSCommunicator
tmsCommunicator
;
private
TMSCommunicator
tmsCommunicator
;
@Autowired
private
NeximUtil
neximUtil
;
// @ApiOperation("获取看板数据")
// @ApiOperation("获取看板数据")
// @GetMapping
// @GetMapping
// @PreAuthorize("@el.check('equipmentView:info')")
// @PreAuthorize("@el.check('equipmentView:info')")
...
@@ -151,9 +149,13 @@ public class EquipViewController {
...
@@ -151,9 +149,13 @@ public class EquipViewController {
}
else
if
(
equip
.
getType
().
equalsIgnoreCase
(
EquipmentType
.
NEXIM
.
name
())){
}
else
if
(
equip
.
getType
().
equalsIgnoreCase
(
EquipmentType
.
NEXIM
.
name
())){
if
(
dto
.
isActivate
())
{
if
(
dto
.
isActivate
())
{
//配置了且激活就显示在线
//配置了且激活就显示在线
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
!=
null
)
{
if
(
config
!=
null
)
{
// dto.setStatus(1);
boolean
onLine
=
neximUtil
.
isOnLine
();
if
(
onLine
){
dto
.
setOnLine
(
true
);
dto
.
setStatus
(
1
);
}
}
}
}
}
}
else
if
(
equip
.
getType
().
equalsIgnoreCase
(
EquipmentType
.
PANACIMNEOLINK
.
name
()))
{
}
else
if
(
equip
.
getType
().
equalsIgnoreCase
(
EquipmentType
.
PANACIMNEOLINK
.
name
()))
{
...
...
src/main/java/com/neotel/smfcore/custom/fuji/config/FujiCacheConfig.java
deleted
100644 → 0
查看文件 @
006361a
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
config
;
public
class
FujiCacheConfig
{
public
static
final
String
FujiConfig_Cache_Name
=
"FujiConfig_Cache_Name"
;
}
src/main/java/com/neotel/smfcore/custom/fuji/config/FujiUrlConfig.java
deleted
100644 → 0
查看文件 @
006361a
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
config
;
import
lombok.Data
;
@Data
public
class
FujiUrlConfig
{
//private static final String baseUrl = "http://175.41.238.212/fujiopenwebapi/api/v1";
//public static final String userName = "Neotel";
//public static final String password = "Neotel";
//private static final String authLogin = "/auth/login";
//private static final String inventoryDids = "/inventory/dids";
}
src/main/java/com/neotel/smfcore/custom/
fuji/Fuji
Api.java
→
src/main/java/com/neotel/smfcore/custom/
nexim/Nexim
Api.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
...
@@ -15,10 +15,9 @@ import com.neotel.smfcore.core.apiInteraction.service.po.ApiInteraction;
...
@@ -15,10 +15,9 @@ import com.neotel.smfcore.core.apiInteraction.service.po.ApiInteraction;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.fuji.bean.FujiConfig
;
import
com.neotel.smfcore.custom.nexim.bean.NeximConfig
;
import
com.neotel.smfcore.custom.fuji.config.FujiCacheConfig
;
import
com.neotel.smfcore.custom.nexim.config.NeximCacheConfig
;
import
com.neotel.smfcore.custom.fuji.config.FujiUrlConfig
;
import
com.neotel.smfcore.custom.nexim.util.NotifyUtil
;
import
com.neotel.smfcore.custom.fuji.util.NotifyUtil
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -31,7 +30,7 @@ import java.util.Map;
...
@@ -31,7 +30,7 @@ import java.util.Map;
@Service
@Service
@Slf4j
@Slf4j
public
class
Fuji
Api
extends
BaseSmfApiListener
{
public
class
Nexim
Api
extends
BaseSmfApiListener
{
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
...
@@ -193,7 +192,7 @@ public class FujiApi extends BaseSmfApiListener {
...
@@ -193,7 +192,7 @@ public class FujiApi extends BaseSmfApiListener {
log
.
info
(
"获取Fuji的token结果为:"
+
result
);
log
.
info
(
"获取Fuji的token结果为:"
+
result
);
JSONObject
resultObj
=
JSONObject
.
parseObject
(
result
);
JSONObject
resultObj
=
JSONObject
.
parseObject
(
result
);
accessToken
=
resultObj
.
getString
(
"accessToken"
);
accessToken
=
resultObj
.
getString
(
"accessToken"
);
}
catch
(
Api
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
"获取Fuji的token异常:"
,
e
);
log
.
info
(
"获取Fuji的token异常:"
,
e
);
accessToken
=
""
;
accessToken
=
""
;
}
}
...
@@ -211,50 +210,50 @@ public class FujiApi extends BaseSmfApiListener {
...
@@ -211,50 +210,50 @@ public class FujiApi extends BaseSmfApiListener {
}
}
private
String
getAuthLogin
(){
private
String
getAuthLogin
(){
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
return
config
.
getAuthUrl
();
return
config
.
getAuthUrl
();
}
}
private
String
getAuthUserName
(){
private
String
getAuthUserName
(){
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
return
config
.
getUserName
();
return
config
.
getUserName
();
}
}
private
String
getAuthPassword
(){
private
String
getAuthPassword
(){
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
return
config
.
getPassword
();
return
config
.
getPassword
();
}
}
private
String
getInventoryDids
(){
private
String
getInventoryDids
(){
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
return
config
.
getGetDidInfoUrl
();
return
config
.
getGetDidInfoUrl
();
}
}
private
String
inventoryDids
(){
private
String
inventoryDids
(){
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
return
config
.
getRegisterDidInfoUrl
();
return
config
.
getRegisterDidInfoUrl
();
}
}
private
String
getNotifyEtn
(){
private
String
getNotifyEtn
(){
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
return
config
.
getOutputEtn
();
return
config
.
getOutputEtn
();
}
}
...
...
src/main/java/com/neotel/smfcore/custom/
fuji/Fuji
Menu.java
→
src/main/java/com/neotel/smfcore/custom/
nexim/Nexim
Menu.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
;
import
com.neotel.smfcore.common.init.MenuInit
;
import
com.neotel.smfcore.common.init.MenuInit
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.SmfApi
;
...
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
...
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Component;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
@Component
@Component
public
class
Fuji
Menu
{
public
class
Nexim
Menu
{
@Autowired
@Autowired
MenuInit
menuInit
;
MenuInit
menuInit
;
...
@@ -20,7 +20,7 @@ public class FujiMenu {
...
@@ -20,7 +20,7 @@ public class FujiMenu {
@PostConstruct
@PostConstruct
public
void
init
(){
public
void
init
(){
String
menuLabel
=
"
fuji
"
;
String
menuLabel
=
"
nexim
"
;
// Menu nexim = Menu.CreatePMenu("Nexim", 3, "nexim", "nexim", null);
// Menu nexim = Menu.CreatePMenu("Nexim", 3, "nexim", "nexim", null);
Menu
poutOut
=
Menu
.
CreatePMenu
(
"物料管理"
,
3
,
"order"
,
"workOrder"
,
null
);
Menu
poutOut
=
Menu
.
CreatePMenu
(
"物料管理"
,
3
,
"order"
,
"workOrder"
,
null
);
...
...
src/main/java/com/neotel/smfcore/custom/
fuji/bean/Fuji
Config.java
→
src/main/java/com/neotel/smfcore/custom/
nexim/bean/Nexim
Config.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
bean
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@Data
public
class
Fuji
Config
{
public
class
Nexim
Config
{
private
String
authUrl
=
""
;
private
String
authUrl
=
""
;
private
String
userName
=
""
;
private
String
userName
=
""
;
private
String
password
=
""
;
private
String
password
=
""
;
...
...
src/main/java/com/neotel/smfcore/custom/
fuji/bean/dto/Fuji
ConfigDto.java
→
src/main/java/com/neotel/smfcore/custom/
nexim/bean/dto/Nexim
ConfigDto.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
bean
.
dto
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
bean
.
dto
;
import
com.neotel.smfcore.custom.
fuji.bean.Fuji
Config
;
import
com.neotel.smfcore.custom.
nexim.bean.Nexim
Config
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.Date
;
@Data
@Data
public
class
FujiConfigDto
extends
Fuji
Config
{
public
class
NeximConfigDto
extends
Nexim
Config
{
private
String
etoUpdateDateStr
;
private
String
etoUpdateDateStr
;
private
String
etnUpdateDateStr
;
private
String
etnUpdateDateStr
;
}
}
src/main/java/com/neotel/smfcore/custom/nexim/config/NeximCacheConfig.java
0 → 100644
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
config
;
public
class
NeximCacheConfig
{
public
static
final
String
NeximConfig_Cache_Name
=
"FujiConfig_Cache_Name"
;
}
src/main/java/com/neotel/smfcore/custom/
fuji/controller/Fuji
Controller.java
→
src/main/java/com/neotel/smfcore/custom/
nexim/controller/Nexim
Controller.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
controller
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
...
@@ -9,12 +9,11 @@ import com.neotel.smfcore.core.device.util.DataCache;
...
@@ -9,12 +9,11 @@ import com.neotel.smfcore.core.device.util.DataCache;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.custom.fuji.FujiApi
;
import
com.neotel.smfcore.custom.nexim.NeximApi
;
import
com.neotel.smfcore.custom.fuji.bean.FujiConfig
;
import
com.neotel.smfcore.custom.nexim.bean.NeximConfig
;
import
com.neotel.smfcore.custom.fuji.bean.dto.FujiConfigDto
;
import
com.neotel.smfcore.custom.nexim.bean.dto.NeximConfigDto
;
import
com.neotel.smfcore.custom.fuji.config.FujiCacheConfig
;
import
com.neotel.smfcore.custom.nexim.config.NeximCacheConfig
;
import
com.neotel.smfcore.custom.fuji.order.service.JobService
;
import
com.neotel.smfcore.custom.nexim.order.service.JobService
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -30,7 +29,7 @@ import java.util.stream.Collectors;
...
@@ -30,7 +29,7 @@ import java.util.stream.Collectors;
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/fuji"
)
@RequestMapping
(
"/fuji"
)
public
class
Fuji
Controller
{
public
class
Nexim
Controller
{
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
...
@@ -39,7 +38,7 @@ public class FujiController {
...
@@ -39,7 +38,7 @@ public class FujiController {
private
CodeResolve
codeResolve
;
private
CodeResolve
codeResolve
;
@Autowired
@Autowired
private
FujiApi
fuji
Api
;
private
NeximApi
nexim
Api
;
@Autowired
@Autowired
private
LiteOrderCache
liteOrderCache
;
private
LiteOrderCache
liteOrderCache
;
...
@@ -50,11 +49,11 @@ public class FujiController {
...
@@ -50,11 +49,11 @@ public class FujiController {
@ApiOperation
(
"修改配置"
)
@ApiOperation
(
"修改配置"
)
@RequestMapping
(
"/updateFujiConfig"
)
@RequestMapping
(
"/updateFujiConfig"
)
//@AnonymousAccess
//@AnonymousAccess
public
ResultBean
updateFujiConfig
(
@RequestBody
Fuji
Config
newConfig
)
{
public
ResultBean
updateFujiConfig
(
@RequestBody
Nexim
Config
newConfig
)
{
log
.
info
(
"修改配置信息为:"
+
JSON
.
toJSONString
(
newConfig
));
log
.
info
(
"修改配置信息为:"
+
JSON
.
toJSONString
(
newConfig
));
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
config
.
setAuthUrl
(
newConfig
.
getAuthUrl
());
config
.
setAuthUrl
(
newConfig
.
getAuthUrl
());
config
.
setGetDidInfoUrl
(
newConfig
.
getGetDidInfoUrl
());
config
.
setGetDidInfoUrl
(
newConfig
.
getGetDidInfoUrl
());
...
@@ -64,7 +63,7 @@ public class FujiController {
...
@@ -64,7 +63,7 @@ public class FujiController {
config
.
setTime
(
newConfig
.
getTime
());
config
.
setTime
(
newConfig
.
getTime
());
config
.
setUserName
(
newConfig
.
getUserName
());
config
.
setUserName
(
newConfig
.
getUserName
());
config
.
setPassword
(
newConfig
.
getPassword
());
config
.
setPassword
(
newConfig
.
getPassword
());
dataCache
.
updateCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
,
config
);
dataCache
.
updateCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
,
config
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -72,11 +71,11 @@ public class FujiController {
...
@@ -72,11 +71,11 @@ public class FujiController {
@RequestMapping
(
"/getFujiConfig"
)
@RequestMapping
(
"/getFujiConfig"
)
//@AnonymousAccess
//@AnonymousAccess
public
ResultBean
getFujiConfig
()
{
public
ResultBean
getFujiConfig
()
{
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
FujiConfigDto
dto
=
new
Fuji
ConfigDto
();
NeximConfigDto
dto
=
new
Nexim
ConfigDto
();
dto
.
setAuthUrl
(
config
.
getAuthUrl
());
dto
.
setAuthUrl
(
config
.
getAuthUrl
());
dto
.
setGetDidInfoUrl
(
config
.
getGetDidInfoUrl
());
dto
.
setGetDidInfoUrl
(
config
.
getGetDidInfoUrl
());
dto
.
setRegisterDidInfoUrl
(
config
.
getRegisterDidInfoUrl
());
dto
.
setRegisterDidInfoUrl
(
config
.
getRegisterDidInfoUrl
());
...
@@ -106,10 +105,10 @@ public class FujiController {
...
@@ -106,10 +105,10 @@ public class FujiController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
}
}
String
accessToken
=
fuji
Api
.
getAccessToken
();
String
accessToken
=
nexim
Api
.
getAccessToken
();
boolean
hasDid
=
fuji
Api
.
inventoryHasDid
(
barcode
.
getBarcode
(),
accessToken
);
boolean
hasDid
=
nexim
Api
.
inventoryHasDid
(
barcode
.
getBarcode
(),
accessToken
);
if
(!
hasDid
){
if
(!
hasDid
){
fuji
Api
.
registerNewDid
(
barcode
,
accessToken
);
nexim
Api
.
registerNewDid
(
barcode
,
accessToken
);
}
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -197,9 +196,9 @@ public class FujiController {
...
@@ -197,9 +196,9 @@ public class FujiController {
@RequestMapping
(
"/getFileUpdateDate"
)
@RequestMapping
(
"/getFileUpdateDate"
)
//@AnonymousAccess
//@AnonymousAccess
public
ResultBean
getFileUpdateDate
(
String
param
)
{
public
ResultBean
getFileUpdateDate
(
String
param
)
{
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
String
updateStr
=
""
;
String
updateStr
=
""
;
String
fileName
=
""
;
String
fileName
=
""
;
...
...
src/main/java/com/neotel/smfcore/custom/
fuji
/order/JobHandler.java
→
src/main/java/com/neotel/smfcore/custom/
nexim
/order/JobHandler.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
order
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
order
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
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.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.fuji.bean.FujiConfig
;
import
com.neotel.smfcore.custom.nexim.bean.NeximConfig
;
import
com.neotel.smfcore.custom.fuji.config.FujiCacheConfig
;
import
com.neotel.smfcore.custom.nexim.config.NeximCacheConfig
;
import
com.neotel.smfcore.custom.fuji.order.bean.Job
;
import
com.neotel.smfcore.custom.nexim.order.bean.Job
;
import
com.neotel.smfcore.custom.fuji.order.bean.JobItem
;
import
com.neotel.smfcore.custom.nexim.order.service.JobService
;
import
com.neotel.smfcore.custom.fuji.order.service.JobService
;
import
com.neotel.smfcore.custom.nexim.util.OrderUtil
;
import
com.neotel.smfcore.custom.fuji.util.NotifyUtil
;
import
com.neotel.smfcore.custom.fuji.util.OrderUtil
;
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.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.io.BufferedWriter
;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.StandardCopyOption
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.ScheduledExecutorService
;
...
@@ -65,9 +52,9 @@ public class JobHandler {
...
@@ -65,9 +52,9 @@ public class JobHandler {
public
void
init
()
{
public
void
init
()
{
if
(
"fuji"
.
equals
(
smfApi
.
getApiName
()))
{
if
(
"fuji"
.
equals
(
smfApi
.
getApiName
()))
{
scheduledThreadPool
.
scheduleAtFixedRate
(()
->
{
scheduledThreadPool
.
scheduleAtFixedRate
(()
->
{
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
if
(
System
.
currentTimeMillis
()-
lastHandleTime
>=
1000
*
config
.
getTime
()){
if
(
System
.
currentTimeMillis
()-
lastHandleTime
>=
1000
*
config
.
getTime
()){
//log.info(DateUtil.toDateString(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss"));
//log.info(DateUtil.toDateString(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss"));
...
@@ -88,9 +75,9 @@ public class JobHandler {
...
@@ -88,9 +75,9 @@ public class JobHandler {
public
void
handler
()
throws
IOException
{
public
void
handler
()
throws
IOException
{
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
String
path
=
config
.
getInputEto
();
String
path
=
config
.
getInputEto
();
if
(
StringUtils
.
isEmpty
(
path
)){
if
(
StringUtils
.
isEmpty
(
path
)){
...
...
src/main/java/com/neotel/smfcore/custom/
fuji
/order/bean/Job.java
→
src/main/java/com/neotel/smfcore/custom/
nexim
/order/bean/Job.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
order
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
order
.
bean
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/neotel/smfcore/custom/
fuji
/order/bean/JobItem.java
→
src/main/java/com/neotel/smfcore/custom/
nexim
/order/bean/JobItem.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
order
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
order
.
bean
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/neotel/smfcore/custom/
fuji
/order/service/JobService.java
→
src/main/java/com/neotel/smfcore/custom/
nexim
/order/service/JobService.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
order
.
service
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
order
.
service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
...
@@ -19,10 +19,10 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
...
@@ -19,10 +19,10 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.
fuji.bean.Fuji
Config
;
import
com.neotel.smfcore.custom.
nexim.bean.Nexim
Config
;
import
com.neotel.smfcore.custom.
fuji.config.Fuji
CacheConfig
;
import
com.neotel.smfcore.custom.
nexim.config.Nexim
CacheConfig
;
import
com.neotel.smfcore.custom.
fuji
.order.bean.Job
;
import
com.neotel.smfcore.custom.
nexim
.order.bean.Job
;
import
com.neotel.smfcore.custom.
fuji
.order.bean.JobItem
;
import
com.neotel.smfcore.custom.
nexim
.order.bean.JobItem
;
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.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -309,9 +309,9 @@ public class JobService {
...
@@ -309,9 +309,9 @@ public class JobService {
//int pos = ansName.lastIndexOf(".");
//int pos = ansName.lastIndexOf(".");
//ansName = pos > 0 ? ansName.substring(0,pos) :ansName;
//ansName = pos > 0 ? ansName.substring(0,pos) :ansName;
FujiConfig
config
=
dataCache
.
getCache
(
FujiCacheConfig
.
Fuji
Config_Cache_Name
);
NeximConfig
config
=
dataCache
.
getCache
(
NeximCacheConfig
.
Nexim
Config_Cache_Name
);
if
(
config
==
null
)
{
if
(
config
==
null
)
{
config
=
new
Fuji
Config
();
config
=
new
Nexim
Config
();
}
}
String
path
=
config
.
getInputEto
();
String
path
=
config
.
getInputEto
();
String
ansFilePath
=
path
+
"\\"
+
ansName
+
".ANS"
;
String
ansFilePath
=
path
+
"\\"
+
ansName
+
".ANS"
;
...
...
src/main/java/com/neotel/smfcore/custom/nexim/util/NeximUtil.java
0 → 100644
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
util
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.custom.nexim.NeximApi
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Slf4j
@Service
public
class
NeximUtil
{
@Autowired
private
NeximApi
neximApi
;
private
long
lastOnLineTime
=
0
l
;
private
boolean
lastOnLine
=
false
;
public
boolean
isOnLine
()
{
if
(
lastOnLineTime
!=
0
l
&&
System
.
currentTimeMillis
()
-
lastOnLineTime
<=
1000
*
60
*
5
)
{
return
lastOnLine
;
}
lastOnLineTime
=
System
.
currentTimeMillis
();
String
accessToken
=
""
;
try
{
accessToken
=
neximApi
.
getAccessToken
();
}
catch
(
Exception
e
)
{
log
.
error
(
"获取token失败:"
,
e
);
}
if
(
StringUtils
.
isNotEmpty
(
accessToken
))
{
lastOnLine
=
true
;
return
lastOnLine
;
}
lastOnLine
=
false
;
return
lastOnLine
;
}
}
src/main/java/com/neotel/smfcore/custom/
fuji
/util/NotifyUtil.java
→
src/main/java/com/neotel/smfcore/custom/
nexim
/util/NotifyUtil.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
util
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
util
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
...
src/main/java/com/neotel/smfcore/custom/
fuji
/util/OrderUtil.java
→
src/main/java/com/neotel/smfcore/custom/
nexim
/util/OrderUtil.java
查看文件 @
bc2948f
package
com
.
neotel
.
smfcore
.
custom
.
fuji
.
util
;
package
com
.
neotel
.
smfcore
.
custom
.
nexim
.
util
;
import
com.neotel.smfcore.common.utils.SmbUtil
;
import
com.neotel.smfcore.common.utils.SmbUtil
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
jcifs.smb.SmbFile
;
import
jcifs.smb.SmbFile
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -10,7 +9,6 @@ import java.io.FileOutputStream;
...
@@ -10,7 +9,6 @@ import java.io.FileOutputStream;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.OutputStreamWriter
;
import
java.io.OutputStreamWriter
;
import
java.nio.charset.Charset
;
import
java.nio.charset.Charset
;
import
java.nio.charset.StandardCharsets
;
import
java.nio.file.Files
;
import
java.nio.file.Files
;
import
java.nio.file.Path
;
import
java.nio.file.Path
;
import
java.nio.file.Paths
;
import
java.nio.file.Paths
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论