Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
semi-server
Project
Project
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
Graph
比较
统计图
议题
0
议题
0
列表
看板
标记
Milestones
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
inroi
semi-server
Commits
39765da2
提交
39765da2
authored
10月 27, 2022
作者:
inroi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
微调
上级
7d98941d
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
49 行增加
和
17 行删除
+49
-17
CommonGetApi.java
...ate-system/src/main/java/com/system/api/CommonGetApi.java
+2
-2
CommonGetConstants.java
...rc/main/java/com/system/constants/CommonGetConstants.java
+0
-1
CommonPostConstants.java
...c/main/java/com/system/constants/CommonPostConstants.java
+1
-1
CommonHttpController.java
...main/java/com/system/controller/CommonHttpController.java
+14
-1
CustomFormConfigMapper.xml
...ain/java/com/system/dao/mapper/CustomFormConfigMapper.xml
+1
-2
SynchronizationOperationMapper.xml
.../com/system/dao/mapper/SynchronizationOperationMapper.xml
+3
-1
FacePlusThrowErrorHandler.java
...in/java/com/system/handler/FacePlusThrowErrorHandler.java
+23
-0
SynchronizationServiceImpl.java
...a/com/system/serivce/impl/SynchronizationServiceImpl.java
+2
-1
CustomFormConfigListOutVoRecords.java
...ystem/transfer/form/CustomFormConfigListOutVoRecords.java
+0
-6
HttpUtil.java
...grate-system/src/main/java/com/system/utils/HttpUtil.java
+3
-2
没有找到文件。
integrate-system/src/main/java/com/system/api/CommonGetApi.java
浏览文件 @
39765da2
...
...
@@ -60,9 +60,9 @@ public class CommonGetApi {
return
JsonUtil
.
toString
(
response
);
}
public
String
commonS
endBySync
(
Map
<
String
,
String
>
config
,
String
json
,
String
queueId
)
{
public
String
commonS
ync
(
String
responseAddress
,
String
queueId
,
Map
<
String
,
String
>
config
,
String
json
)
{
try
{
String
result
=
HttpUtil
.
httpPost
(
config
.
get
(
"responseAddress"
)
,
json
).
getBody
();
String
result
=
HttpUtil
.
httpPost
(
responseAddress
,
json
).
getBody
();
thirdPartyLogUtil
.
thirdPartyLogCreate
(
config
.
get
(
"name"
),
config
.
get
(
"docType"
),
queueId
,
config
.
get
(
"configureDirection"
),
json
,
result
);
return
result
;
}
catch
(
Exception
e
)
{
...
...
integrate-system/src/main/java/com/system/constants/CommonGetConstants.java
浏览文件 @
39765da2
...
...
@@ -51,7 +51,6 @@ public class CommonGetConstants {
result
.
put
(
"configureDirection"
,
records
.
getConfigureDirection
());
result
.
put
(
"operation"
,
records
.
getOperation
()
==
1
?
"Get"
:
"Post"
);
result
.
put
(
"requestAddress"
,
records
.
getRequestAddress
());
result
.
put
(
"responseAddress"
,
records
.
getResponseAddress
());
result
.
put
(
"customSql"
,
records
.
getCustomSql
());
result
.
put
(
"formFieldMappingDetail"
,
records
.
getFormFieldMappingDetail
());
return
result
;
...
...
integrate-system/src/main/java/com/system/constants/CommonPostConstants.java
浏览文件 @
39765da2
...
...
@@ -48,8 +48,8 @@ public class CommonPostConstants {
Map
<
String
,
String
>
result
=
new
HashMap
<>(
10
);
result
.
put
(
"docType"
,
records
.
getDocType
());
result
.
put
(
"name"
,
records
.
getName
());
result
.
put
(
"configureDirection"
,
records
.
getConfigureDirection
());
result
.
put
(
"operation"
,
records
.
getOperation
()
==
1
?
"Get"
:
"Post"
);
result
.
put
(
"configureDirection"
,
records
.
getConfigureDirection
());
result
.
put
(
"customSql"
,
records
.
getCustomSql
());
result
.
put
(
"formFieldMappingDetail"
,
records
.
getFormFieldMappingDetail
());
return
result
;
...
...
integrate-system/src/main/java/com/system/controller/CommonHttpController.java
浏览文件 @
39765da2
...
...
@@ -8,6 +8,9 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
...
...
@@ -28,8 +31,18 @@ public class CommonHttpController {
@PostMapping
(
"/docking/shopping/mall/commodity"
)
public
RestResponse
dockingShoppingMallCommodity
(
@RequestBody
PlatformDockingShoppingMallCommodityInVo
inVo
)
{
System
.
out
.
println
(
inVo
);
ResponseEntity
<
String
>
responseEntity
=
HttpUtil
.
httpPost
(
"http://192.168.0.9:8089/api/dataSyn/getSyn"
,
JsonUtil
.
toString
(
Stream
.
of
(
12
).
collect
(
Collectors
.
toList
())));
ResponseEntity
<
String
>
responseEntity
=
HttpUtil
.
httpPost
(
"http://192.168.0.9:8089/api/dataSyn/getSyn"
,
JsonUtil
.
toString
(
Stream
.
of
(
20
).
collect
(
Collectors
.
toList
())));
System
.
out
.
println
(
responseEntity
.
getBody
());
List
<
Object
>
tempList
=
JsonUtil
.
toList
(
JsonUtil
.
toString
(
responseEntity
.
getBody
()),
Object
.
class
);
Map
<
String
,
Object
>
map
=
JsonUtil
.
toMap
(
JsonUtil
.
toString
(
tempList
.
get
(
0
)),
String
.
class
,
Object
.
class
);
Map
<
String
,
Object
>
request
=
new
HashMap
<>(
3
);
request
.
put
(
"dataId"
,
map
.
get
(
"dataId"
));
request
.
put
(
"form"
,
map
.
get
(
"form"
));
request
.
put
(
"operation"
,
map
.
get
(
"operation"
));
ResponseEntity
<
String
>
result
=
HttpUtil
.
httpPost
(
"http://192.168.0.9:8089/api/dataSyn/synData"
,
JsonUtil
.
toString
(
request
));
System
.
out
.
println
(
result
.
getBody
());
return
RestResponse
.
success
();
}
...
...
integrate-system/src/main/java/com/system/dao/mapper/CustomFormConfigMapper.xml
浏览文件 @
39765da2
...
...
@@ -7,8 +7,7 @@
<select
id=
"customFormConfigList"
parameterType=
"com.system.transfer.form.CustomFormConfigListInVo"
resultType=
"com.system.transfer.form.CustomFormConfigListOutVoRecords"
>
SELECT
id, doc_type, `name`, configure_direction, operation, request_address,
response_address, custom_sql, form_field_mapping_detail, create_time
id, doc_type, `name`, configure_direction, operation, request_address, custom_sql, form_field_mapping_detail, create_time
FROM tb_custom_form_config
</select>
...
...
integrate-system/src/main/java/com/system/dao/mapper/SynchronizationOperationMapper.xml
浏览文件 @
39765da2
...
...
@@ -6,7 +6,9 @@
<select
id=
"synchronizationOperationList"
resultType=
"java.util.Map"
>
SELECT id, job_class_name, doc_type FROM tb_synchronization_operation WHERE job_class_name = #{jobClassName}
SELECT
id, job_class_name, doc_type, response_address
FROM tb_synchronization_operation WHERE job_class_name = #{jobClassName}
</select>
...
...
integrate-system/src/main/java/com/system/handler/FacePlusThrowErrorHandler.java
0 → 100644
浏览文件 @
39765da2
package
com
.
system
.
handler
;
import
org.springframework.http.client.ClientHttpResponse
;
import
org.springframework.web.client.ResponseErrorHandler
;
import
javax.annotation.Nonnull
;
/**
* @author Inori
*/
public
class
FacePlusThrowErrorHandler
implements
ResponseErrorHandler
{
@Override
public
boolean
hasError
(
@Nonnull
ClientHttpResponse
response
)
{
return
false
;
}
@Override
public
void
handleError
(
@Nonnull
ClientHttpResponse
response
)
{
}
}
integrate-system/src/main/java/com/system/serivce/impl/SynchronizationServiceImpl.java
浏览文件 @
39765da2
...
...
@@ -53,7 +53,8 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
Map
<
String
,
Object
>
map
=
JsonUtil
.
toMap
(
result
,
String
.
class
,
Object
.
class
);
if
(!
CollectionUtils
.
isEmpty
(
map
)
&&
Constants
.
SUCCESS_CODE
.
equals
(
String
.
valueOf
(
map
.
get
(
Constants
.
SUCCESS_NAME
))))
{
commonGetApi
.
commonSendBySync
(
config
,
JsonUtil
.
toString
(
JsonUtil
.
toMap
(
JsonUtil
.
toString
(
map
.
get
(
"data"
)),
String
.
class
,
Object
.
class
)),
queueId
);
Map
<
String
,
Object
>
data
=
JsonUtil
.
toMap
(
JsonUtil
.
toString
(
map
.
get
(
"data"
)),
String
.
class
,
Object
.
class
);
commonGetApi
.
commonSync
(
String
.
valueOf
(
temp
.
get
(
"response_address"
)),
queueId
,
config
,
JsonUtil
.
toString
(
data
));
}
});
}
...
...
integrate-system/src/main/java/com/system/transfer/form/CustomFormConfigListOutVoRecords.java
浏览文件 @
39765da2
...
...
@@ -45,12 +45,6 @@ public class CustomFormConfigListOutVoRecords {
/**
* 发送地址
*/
private
String
responseAddress
;
/**
* 自定义Sql
*/
private
String
customSql
;
...
...
integrate-system/src/main/java/com/system/utils/HttpUtil.java
浏览文件 @
39765da2
package
com
.
system
.
utils
;
import
com.system.handler.FacePlusThrowErrorHandler
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.http.HttpEntity
;
...
...
@@ -42,6 +43,7 @@ public class HttpUtil {
requestFactory
.
setConnectTimeout
(
CONN_TIMEOUT
);
requestFactory
.
setReadTimeout
(
READ_TIMEOUT
);
restTemplate
=
new
RestTemplate
(
requestFactory
);
restTemplate
.
setErrorHandler
(
new
FacePlusThrowErrorHandler
());
}
/**
...
...
@@ -50,8 +52,6 @@ public class HttpUtil {
private
static
HttpHeaders
initHeader
()
{
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
"Accept"
,
"application/json"
);
headers
.
add
(
"Accpet-Encoding"
,
"gzip"
);
headers
.
add
(
"Content-Encoding"
,
"UTF-8"
);
headers
.
add
(
"Content-Type"
,
"application/json; charset=UTF-8"
);
return
headers
;
}
...
...
@@ -76,6 +76,7 @@ public class HttpUtil {
HttpHeaders
httpHeaders
=
initHeader
();
//发送请求
HttpEntity
<
String
>
httpEntity
=
new
HttpEntity
<>(
null
,
httpHeaders
);
log
.
info
(
"【Get请求】Url: {}"
,
url
);
return
restTemplate
.
exchange
(
url
,
HttpMethod
.
GET
,
httpEntity
,
String
.
class
);
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论