Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 40aa49ce
由
sunke
编写于
2023-01-04 14:27:25 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
镁光20031API
1 个父辈
63434ac1
全部展开
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
91 行增加
和
4 行删除
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/DepositMatReqBean.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/MatOrderBean.java
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
查看文件 @
40aa49c
...
@@ -46,12 +46,23 @@ public class HttpHelper {
...
@@ -46,12 +46,23 @@ public class HttpHelper {
private
static
final
int
READ_DATA_TIMEOUT
=
10000
;
private
static
final
int
READ_DATA_TIMEOUT
=
10000
;
public
static
String
postJson
(
String
url
,
Map
<
String
,
Object
>
params
)
throws
ApiException
{
public
static
String
postJson
(
String
url
,
Map
<
String
,
Object
>
params
)
throws
ApiException
{
// 设置请求参数
if
(
params
==
null
||
params
.
isEmpty
())
{
params
=
null
;
}
return
postJsonWithAuth
(
url
,
params
,
null
);
}
public
static
String
postJsonWithAuth
(
String
url
,
Object
params
,
String
auth
)
throws
ApiException
{
HttpPost
httpPost
=
new
HttpPost
(
url
);
HttpPost
httpPost
=
new
HttpPost
(
url
);
httpPost
.
addHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
httpPost
.
addHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
if
(
auth
!=
null
&&
!
auth
.
isEmpty
()){
httpPost
.
addHeader
(
"Authorization"
,
auth
);
}
// 设置请求参数
// 设置请求参数
if
(
params
!=
null
&&
!
params
.
isEmpty
())
{
if
(
params
!=
null
)
{
ObjectMapper
mapper
=
new
ObjectMapper
();
try
{
try
{
ObjectMapper
mapper
=
new
ObjectMapper
();
String
requestBody
=
mapper
.
writeValueAsString
(
params
);
String
requestBody
=
mapper
.
writeValueAsString
(
params
);
httpPost
.
setEntity
(
new
StringEntity
(
requestBody
,
CONTENT_CHARSET
));
httpPost
.
setEntity
(
new
StringEntity
(
requestBody
,
CONTENT_CHARSET
));
}
catch
(
JsonProcessingException
e
)
{
}
catch
(
JsonProcessingException
e
)
{
...
@@ -71,7 +82,6 @@ public class HttpHelper {
...
@@ -71,7 +82,6 @@ public class HttpHelper {
}
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/barcode/service/po/Barcode.java
查看文件 @
40aa49c
...
@@ -225,6 +225,35 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -225,6 +225,35 @@ public class Barcode extends BasePo implements Serializable {
* 呆滞到期时间(入库时间+呆滞日期)
* 呆滞到期时间(入库时间+呆滞日期)
*/
*/
private
Date
sluggishTime
;
private
Date
sluggishTime
;
/**
* 自定义的附加信息
*/
private
Map
<
String
,
Object
>
appendData
=
new
HashMap
<>();
/**
* 添加或更新自定义附加信息
* @param appendKey
* @param appendValue
*/
public
void
updateAppendData
(
String
appendKey
,
Object
appendValue
){
appendData
.
put
(
appendKey
,
appendValue
);
}
/**
* 获取自定义附加信息
* @param appendKey
* @param <T>
* @return
*/
public
<
T
>
T
getAppendData
(
String
appendKey
){
Object
value
=
appendData
.
get
(
appendKey
);
if
(
value
!=
null
){
return
(
T
)
value
;
}
return
null
;
}
/**
/**
* 添加相关联条码
* 添加相关联条码
*
*
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
查看文件 @
40aa49c
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/micron20031/bean/DepositMatReqBean.java
0 → 100644
查看文件 @
40aa49c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
lombok.Data
;
/**
* @author sunke
* @date 2023/1/3 3:28 PM
*/
@Data
public
class
DepositMatReqBean
{
/**
* {
* * "MatReqNo": "0730000956",
* * "MaterialType": "SOLDER_PASTE"
* * }
* * //Input: MatReqNo, MaterialType
* * //Output: MatReqNo, Micron Part Number, Lot No, Quantity, UnitOfMeasures, MaterialType, Message, Status
*/
@JsonProperty
(
"MicronPN"
)
private
String
micronPN
;
@JsonProperty
(
"LotNo"
)
private
String
lotNo
;
@JsonProperty
(
"Quantity"
)
private
Integer
quantity
;
@JsonProperty
(
"UnitOfMeasures"
)
private
String
unitOfMeasures
;
@JsonProperty
(
"MaterialType"
)
private
String
materialType
;
@JsonProperty
(
"MatReqNo"
)
private
String
matReqNo
;
@JsonProperty
(
"Message"
)
private
String
message
;
@JsonProperty
(
"Status"
)
private
String
status
;
}
src/main/java/com/neotel/smfcore/custom/micron20031/bean/MatOrderBean.java
查看文件 @
40aa49c
...
@@ -8,7 +8,7 @@ import lombok.Data;
...
@@ -8,7 +8,7 @@ import lombok.Data;
* @date 2022/12/21 9:33 AM
* @date 2022/12/21 9:33 AM
*/
*/
@Data
@Data
public
class
MatOrderBean
{
public
class
MatOrderBean
{
@JsonProperty
(
"MicronPN"
)
@JsonProperty
(
"MicronPN"
)
private
String
micronPN
;
private
String
micronPN
;
...
@@ -19,4 +19,13 @@ public class MatOrderBean {
...
@@ -19,4 +19,13 @@ public class MatOrderBean {
@JsonProperty
(
"MaterialType"
)
@JsonProperty
(
"MaterialType"
)
private
String
materialType
;
private
String
materialType
;
private
Integer
stockRoomQty
;
@JsonProperty
(
"MatReqNo"
)
private
String
matReqNo
;
@JsonProperty
(
"Message"
)
private
String
message
;
@JsonProperty
(
"Status"
)
private
String
status
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论