Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
鲁鑫
topsun-bpm
Commits
0f17487c
Commit
0f17487c
authored
Jan 08, 2024
by
赵汉亭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
价格主数据查询接口调用完成
parent
82f03be2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
10 deletions
+63
-10
DefaultHttpClient.java
.../java/com/huigou/topsun/sap/common/DefaultHttpClient.java
+1
-1
SapPriceMasterDataApplicationImpl.java
...a/application/impl/SapPriceMasterDataApplicationImpl.java
+57
-9
SapPriceMasterDataQueryRequest.java
...sterData/domain/query/SapPriceMasterDataQueryRequest.java
+5
-0
No files found.
topsun/src/main/java/com/huigou/topsun/sap/common/DefaultHttpClient.java
View file @
0f17487c
...
...
@@ -44,7 +44,7 @@ public class DefaultHttpClient extends BaseApplication implements HttpClient {
// 上下文
String
applicationContext
=
SystemCache
.
getParameter
(
"sap.service.application.context"
,
String
.
class
);
// 用户名
String
password
=
SystemCache
.
getParameter
(
"ap.service.password"
,
String
.
class
);
String
password
=
SystemCache
.
getParameter
(
"
s
ap.service.password"
,
String
.
class
);
// 密码
String
username
=
SystemCache
.
getParameter
(
"sap.service.username"
,
String
.
class
);
// 客户端
...
...
topsun/src/main/java/com/huigou/topsun/sap/priceMasterData/application/impl/SapPriceMasterDataApplicationImpl.java
View file @
0f17487c
package
com
.
huigou
.
topsun
.
sap
.
priceMasterData
.
application
.
impl
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.cache.SystemCache
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.sap.common.HttpClient
;
import
com.huigou.topsun.sap.priceMasterData.application.SapPriceMasterDataApplication
;
import
com.huigou.topsun.sap.priceMasterData.domain.SapPriceMasterData
;
import
com.huigou.topsun.sap.priceMasterData.domain.SapPriceMasterDataItem
;
...
...
@@ -26,6 +29,7 @@ import org.springframework.data.domain.Example;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.io.IOException
;
import
java.util.*
;
/**
...
...
@@ -43,6 +47,9 @@ public class SapPriceMasterDataApplicationImpl extends FlowBroker implements Sap
@Resource
private
SapPriceMasterDataItemRepository
sapPriceMasterDataItemRepository
;
@Autowired
private
HttpClient
httpClient
;
@Override
protected
void
onEnd
(
DelegateExecution
delegateExecution
)
{
super
.
onEnd
(
delegateExecution
);
...
...
@@ -61,7 +68,7 @@ public class SapPriceMasterDataApplicationImpl extends FlowBroker implements Sap
String
returnVo
=
getReturnVo
(
sapPriceMasterData
,
sapPriceMasterDataItemList
);
// System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
// System.out.println(returnVo);
// TODO 调接口
// TODO 调接口
-價格主數據維護接口
}
...
...
@@ -134,14 +141,55 @@ public class SapPriceMasterDataApplicationImpl extends FlowBroker implements Sap
@Override
public
Map
<
String
,
Object
>
queryPriceMasterDataList
(
SapPriceMasterDataQueryRequest
queryRequest
)
{
// TODO 需调用ICP接口
// 需要获取priceMasterDataId
// QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "sapFixedAssets");
// QueryModel queryModel = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
// Map<String, Object> map = this.sqlExecutorDao.executeSlicedQuery(queryModel);
// return map;
return
null
;
// TODO 需调用ICP接口--價格主數據查詢接口
// ps: 顺序问题,需商量后选择
// 获取URL地址
String
url
=
SystemCache
.
getParameter
(
"sap.service.priceMasterData.url"
,
String
.
class
);
// 封装查询参数
Map
<
String
,
Object
>
param
=
new
HashMap
<>();
param
.
put
(
"KSCHL"
,
queryRequest
.
getKschl
());
param
.
put
(
"VKORG"
,
queryRequest
.
getVkorg
());
param
.
put
(
"VTWEG"
,
queryRequest
.
getVtweg
());
param
.
put
(
"KUNNR"
,
queryRequest
.
getKunnr
());
param
.
put
(
"MATNR"
,
queryRequest
.
getMatnr
());
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
"["
)
.
append
(
"{"
)
.
append
(
"KSCHL:"
).
append
(
queryRequest
.
getKschl
()).
append
(
","
)
.
append
(
"VKORG:"
).
append
(
queryRequest
.
getVkorg
()).
append
(
","
)
.
append
(
"VTWEG:"
).
append
(
queryRequest
.
getVtweg
()).
append
(
","
)
.
append
(
"KUNNR:"
).
append
(
queryRequest
.
getKunnr
()).
append
(
","
)
.
append
(
"MATNR:"
).
append
(
queryRequest
.
getMatnr
())
.
append
(
"}"
)
.
append
(
"]"
);
List
<
SapPriceMasterDataItem
>
sapPriceMasterDataItemList
=
null
;
try
{
// 调用接口,获取返回数据
// String execute = httpClient.execute(param, url);
String
execute1
=
httpClient
.
execute
(
stringBuilder
.
toString
(),
url
);
// 解析返回数据
execute1
=
execute1
.
replaceAll
(
"MATNR"
,
"matnr"
)
.
replaceAll
(
"KBETR"
,
"kbetr"
)
.
replaceAll
(
"KONWA"
,
"konwa"
)
.
replaceAll
(
"KMEIN"
,
"kmein"
)
.
replaceAll
(
"DATAB"
,
"datab"
)
.
replaceAll
(
"DATBI"
,
"datbi"
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
sapPriceMasterDataItemList
=
objectMapper
.
readValue
(
execute1
,
new
TypeReference
<
List
<
SapPriceMasterDataItem
>>()
{
});
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
}
// 封装返回数据
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"Total"
,
sapPriceMasterDataItemList
.
size
());
map
.
put
(
"Page"
,
1
);
map
.
put
(
"Rows"
,
sapPriceMasterDataItemList
);
return
map
;
}
/**
...
...
topsun/src/main/java/com/huigou/topsun/sap/priceMasterData/domain/query/SapPriceMasterDataQueryRequest.java
View file @
0f17487c
...
...
@@ -49,6 +49,11 @@ public class SapPriceMasterDataQueryRequest extends QueryAbstractRequest {
*/
private
String
kunnr
;
/**
* MATNR-产品物料(可选)
*/
private
String
matnr
;
/**
* 版本号
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment