Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit edd8a5ff
由
LN
编写于
2023-06-22 16:39:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加接口地址配置
1 个父辈
cd8a0ac9
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
39 行增加
和
6 行删除
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
src/main/java/com/neotel/smfcore/core/api/SmfApi.java
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpApiListener.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpLoadController.java
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
查看文件 @
edd8a5f
...
@@ -144,7 +144,10 @@ public class HttpHelper {
...
@@ -144,7 +144,10 @@ public class HttpHelper {
if
(
params
==
null
||
params
.
isEmpty
())
{
if
(
params
==
null
||
params
.
isEmpty
())
{
params
=
null
;
params
=
null
;
}
}
return
postJsonWithAuth
(
url
,
params
,
null
);
String
result
=
postJsonWithAuth
(
url
,
params
,
null
);
log
.
info
(
" postJson url=["
+
url
+
"],return=["
+
result
+
"]"
);
return
result
;
}
}
public
static
String
postJsonWithAuth
(
String
url
,
Object
params
,
String
auth
)
throws
ApiException
{
public
static
String
postJsonWithAuth
(
String
url
,
Object
params
,
String
auth
)
throws
ApiException
{
...
@@ -172,6 +175,8 @@ public class HttpHelper {
...
@@ -172,6 +175,8 @@ public class HttpHelper {
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
response
.
close
();
response
.
close
();
httpClient
.
close
();
httpClient
.
close
();
log
.
info
(
"postJsonWithAuth url=["
+
url
+
"] return= ["
+
responseContent
+
"]"
);
return
responseContent
;
return
responseContent
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
...
...
src/main/java/com/neotel/smfcore/core/api/SmfApi.java
查看文件 @
edd8a5f
...
@@ -225,7 +225,7 @@ public class SmfApi {
...
@@ -225,7 +225,7 @@ public class SmfApi {
return
null
;
return
null
;
}
}
public
boolean
canLogin
(
String
username
,
String
pwd
)
throws
ValidateException
{
public
boolean
canLogin
(
String
username
,
String
pwd
)
throws
ValidateException
{
if
(
ObjectUtil
.
isNotEmpty
(
username
)
&&
ObjectUtil
.
isNotEmpty
(
pwd
)
)
{
if
(
ObjectUtil
.
isNotEmpty
(
username
)
)
{
if
(
isUrlExist
(
loginCheckUrl
))
{
if
(
isUrlExist
(
loginCheckUrl
))
{
for
(
ISmfApiListener
apiListener
:
apiListenerList
)
{
for
(
ISmfApiListener
apiListener
:
apiListenerList
)
{
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
查看文件 @
edd8a5f
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpApiListener.java
查看文件 @
edd8a5f
...
@@ -12,8 +12,9 @@ import com.neotel.smfcore.core.inList.util.InListCache;
...
@@ -12,8 +12,9 @@ import com.neotel.smfcore.core.inList.util.InListCache;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
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
javax.swing.text.html.InlineView
;
@Service
@Slf4j
@Slf4j
public
class
MicronSpApiListener
extends
BaseSmfApiListener
{
public
class
MicronSpApiListener
extends
BaseSmfApiListener
{
...
@@ -21,7 +22,11 @@ public class MicronSpApiListener extends BaseSmfApiListener {
...
@@ -21,7 +22,11 @@ public class MicronSpApiListener extends BaseSmfApiListener {
private
InListCache
inListCache
;
private
InListCache
inListCache
;
@Override
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
public
boolean
isForThisApi
(
String
apiName
)
{
return
Micron20031Api
.
isEnable
();
if
(
Micron20031Api
.
isEnable
())
{
return
true
;
}
// return apiName != null && apiName.equalsIgnoreCase("20031");
return
false
;
}
}
@Override
@Override
public
Barcode
canPutInAfterResolve
(
String
inCheckUrl
,
CodeValidateParam
params
,
Barcode
barcode
)
throws
ValidateException
{
public
Barcode
canPutInAfterResolve
(
String
inCheckUrl
,
CodeValidateParam
params
,
Barcode
barcode
)
throws
ValidateException
{
...
@@ -58,4 +63,19 @@ public class MicronSpApiListener extends BaseSmfApiListener {
...
@@ -58,4 +63,19 @@ public class MicronSpApiListener extends BaseSmfApiListener {
}
}
return
null
;
return
null
;
}
}
@Override
public
boolean
canLogin
(
String
loginCheckUrl
,
String
userName
,
String
pwd
)
throws
ValidateException
{
try
{
return
Micron20031Api
.
checkUserRights
(
userName
);
}
catch
(
ValidateException
e
){
throw
e
;
}
catch
(
Exception
e
)
{
log
.
error
(
"登陆验证接口出错:"
+
e
.
getMessage
());
throw
new
ValidateException
(
"smfcore.mesApi.loginCheck.error"
,
"MES Login Error:"
+
e
.
getMessage
());
}
}
}
}
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpLoadController.java
查看文件 @
edd8a5f
...
@@ -13,6 +13,7 @@ import com.neotel.smfcore.core.inList.util.InListCache;
...
@@ -13,6 +13,7 @@ import com.neotel.smfcore.core.inList.util.InListCache;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.manager.IStorageManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStorageManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -105,9 +106,12 @@ public class MicronSpLoadController {
...
@@ -105,9 +106,12 @@ public class MicronSpLoadController {
inListCache
.
addInListToMap
(
inList
);
inListCache
.
addInListToMap
(
inList
);
storage
.
setInListName
(
matReqNo
);
storage
.
setInListName
(
matReqNo
);
log
.
info
(
"设置料仓["
+
storage
.
getName
()
+
"]的入库单为:["
+
matReqNo
+
"],同时更新入库单开始时间"
);
log
.
info
(
"设置料仓["
+
storage
.
getName
()
+
"]的入库单为:["
+
matReqNo
+
"],同时更新入库单开始时间
,同时发送 closeInLock=doit
"
);
storageManager
.
save
(
storage
);
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
,
""
);
dataCache
.
reloadStorage
(
storage
,
""
);
//设置开始入库
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"closeInLock"
,
"doit"
);
return
ResultBean
.
newOkResult
(
matReqNo
);
return
ResultBean
.
newOkResult
(
matReqNo
);
}
}
...
@@ -122,9 +126,13 @@ public class MicronSpLoadController {
...
@@ -122,9 +126,13 @@ public class MicronSpLoadController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
}
storage
.
setInListName
(
""
);
storage
.
setInListName
(
""
);
log
.
info
(
"设置料仓["
+
storage
.
getName
()
+
"]开始 return "
);
log
.
info
(
"设置料仓["
+
storage
.
getName
()
+
"]开始 return
,同时发送 closeInLock=doit
"
);
storageManager
.
save
(
storage
);
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
,
""
);
dataCache
.
reloadStorage
(
storage
,
""
);
//设置开始入库
DevicesStatusUtil
.
appendOp
(
storage
.
getCid
(),
"closeInLock"
,
"doit"
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论