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
38bf20b2
Commit
38bf20b2
authored
Mar 04, 2024
by
刘学辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
供应商主数据传递SAP,添加日志
parent
0f40f43f
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
465 additions
and
12 deletions
+465
-12
nonProdApplyList.js
...in/webapp/biz/topsun/sap/nonProdApply/nonProdApplyList.js
+27
-0
suppliersDataList.js
...main/webapp/biz/topsun/sap/suppliers/suppliersDataList.js
+50
-0
SapMutualEpLogApplication.java
...sun/sap/common/application/SapMutualEpLogApplication.java
+20
-0
SapMutualEpLogApplicationImpl.java
...ommon/application/impl/SapMutualEpLogApplicationImpl.java
+45
-0
SapMutualEpLog.java
...a/com/huigou/topsun/sap/common/domain/SapMutualEpLog.java
+125
-0
SapMutualEpLogRepository.java
...opsun/sap/common/repository/SapMutualEpLogRepository.java
+16
-0
NonProdApplyApplication.java
...sap/nonProdApply/application/NonProdApplyApplication.java
+3
-0
NonProdApplyApplicationImpl.java
...odApply/application/impl/NonProdApplyApplicationImpl.java
+81
-2
NonProdApplyController.java
...n/sap/nonProdApply/controller/NonProdApplyController.java
+8
-0
SuppliersDataApplicationImpl.java
...pliers/application/impl/SuppliersDataApplicationImpl.java
+87
-7
SuppliersInfo.java
...com/huigou/topsun/sap/suppliers/domain/SuppliersInfo.java
+3
-3
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/nonProdApply/nonProdApplyList.js
View file @
38bf20b2
...
...
@@ -29,6 +29,18 @@ function loadNonProdApplyListGrid() {
url
:
web_app
.
name
+
'/sapNonProdApplyNext/forwardNonProdApplyNext.do?bizId='
+
result
.
id
});
}
},
publishHandler
:
{
id
:
'publishData'
,
text
:
'数据发布'
,
img
:
'fa-map'
,
className
:
'btn-gray'
,
click
:
function
()
{
let
result
=
DataUtil
.
getUpdateRow
(
gridManager
);
if
(
result
.
status
!==
3
){
Public
.
tip
(
"请选择一条已审核后数据!"
)
return
false
;
}
publishDatas
(
'确实要发布数据吗?'
,
result
.
id
);
}
}
});
gridManager
=
UICtrl
.
grid
(
"#nonProdApplyListGrid"
,
{
...
...
@@ -120,6 +132,21 @@ function doView(id) {
});
}
// 发布数据
function
publishDatas
(
message
,
id
)
{
DataUtil
.
updateById
({
action
:
'/sapNonProdApply/publishDataToSap.ajax'
,
gridManager
:
gridManager
,
param
:
{
id
:
id
},
message
:
message
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
// function next(){
// UICtrl.addTabItem({
// tabid: 'showNonProdApplyNext',
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/suppliers/suppliersDataList.js
View file @
38bf20b2
...
...
@@ -13,6 +13,7 @@ function loadSuppliersDataListGrid() {
addHandler
:
function
(){
addHandler
()
},
updateHandler
:
showUpdateDialog
,
deleteHandler
:
deleteHandler
/* testHandler: {id: 'basicInfoMaintenance', text: '基本信息维护', img: 'fa-music', className: 'btn-gray',
click: function () {
...
...
@@ -135,7 +136,56 @@ function doView(id) {
url
:
web_app
.
name
+
'/sapSuppliersData/showSuppliersData.job?bizId='
+
id
+
"&isDetailPage=true"
});
}
function
initShowDialog
()
{
var
mainFileTable
=
$
(
'#compensateLibraryList'
).
fileList
();
mainFileTable
.
find
(
'table'
).
css
({
borderTopWidth
:
0
});
}
// 进行修改操作
function
showUpdateDialog
(
id
)
{
UICtrl
.
showAjaxDialog
({
title
:
"修改供应商主数据申请"
,
url
:
web_app
.
name
+
'/sapSuppliersData/showSuppliersData.load'
,
param
:
{
id
:
id
},
width
:
800
,
init
:
initShowDialog
,
ok
:
doSaveDefine
,
start
:
false
,
stop
:
false
,
close
:
onDialogCloseHandler
});
}
function
doSaveDefine
()
{
var
_self
=
this
;
var
id
=
getId
();
// var code = $('#code').val();
//if (code.substr(0, 1) != "B" && code.substr(0, 1) != "F" && code.substr(0, 1) != "Q") {
// UICtrl.alert("标准编号必须以F、B、Q开头(F表示房屋、B表示地上附属物、Q表示青苗)!")
// return false;
// }
var
libraryVersionYear
=
$
(
'#libraryVersion'
).
val
().
substr
(
0
,
4
);
var
libraryVersionFh
=
$
(
'#libraryVersion'
).
val
().
substr
(
4
,
1
);
var
libraryVersionNum
=
$
(
'#libraryVersion'
).
val
().
substr
(
5
,
2
);
//var url = "/compensateLibrary/insertCompensateLibrary.ajax";
if
(
id
&&
id
.
length
>
0
)
url
=
"/compensateLibrary/updateCompensateLibrary.ajax"
;
$
(
'#submitForm'
).
ajaxSubmit
({
url
:
web_app
.
name
+
(
url
),
success
:
function
(
id
)
{
setId
(
id
);
$
(
'#compensateLibraryList'
).
fileList
({
bizId
:
id
});
refreshFlag
=
true
;
}
});
}
// function next(){
// UICtrl.addTabItem({
// tabid: 'showNonProdApplyNext',
...
...
topsun/src/main/java/com/huigou/topsun/sap/common/application/SapMutualEpLogApplication.java
0 → 100644
View file @
38bf20b2
package
com
.
huigou
.
topsun
.
sap
.
common
.
application
;
import
com.huigou.topsun.sap.common.domain.SapMutualEpLog
;
import
java.util.Map
;
/**
* @Auther: LXH
* @Date: 2024/03/04
* @Description:
*/
public
interface
SapMutualEpLogApplication
{
//public static final String QUERY_XML_FILE_PATH = "config/topsun/sap/sapPurchase/sapPurchase.xml";
//String PROCESS_DEFINITION_KEY = "sapPurchaseProc";
//Map<String,Object> slicedSapPurchaseList(SapPurchaseQueryRequest queryRequest);
SapMutualEpLog
saveSapMutualEpLog
(
Map
<
String
,
Object
>
map
);
}
topsun/src/main/java/com/huigou/topsun/sap/common/application/impl/SapMutualEpLogApplicationImpl.java
0 → 100644
View file @
38bf20b2
package
com
.
huigou
.
topsun
.
sap
.
common
.
application
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.huigou.topsun.sap.common.application.SapMutualEpLogApplication
;
import
com.huigou.topsun.sap.common.domain.SapMutualEpLog
;
import
com.huigou.topsun.sap.common.repository.SapMutualEpLogRepository
;
import
com.huigou.util.ClassHelper
;
import
com.huigou.util.DateUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.SimpleDateFormat
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Map
;
@Service
(
"sapMutualEpLogApplication"
)
public
class
SapMutualEpLogApplicationImpl
implements
SapMutualEpLogApplication
{
@Autowired
SapMutualEpLogRepository
sapMutualEpLogRepository
;
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
SapMutualEpLog
saveSapMutualEpLog
(
Map
<
String
,
Object
>
map
){
SapMutualEpLog
sapMutualEpLog
=
new
SapMutualEpLog
();
try
{
sapMutualEpLog
.
setBusinessId
(
map
.
get
(
"businessId"
).
toString
());
sapMutualEpLog
.
setBusinessType
(
map
.
get
(
"businessType"
).
toString
());
sapMutualEpLog
=
ClassHelper
.
fromMap
(
SapMutualEpLog
.
class
,
map
);
//BeanUtil.mapToBean(map, ClassHelpersapMutualEpLog);
Date
date
=
new
Date
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
sapMutualEpLog
.
setCreatedDate
(
sdf
.
format
(
date
));
sapMutualEpLogRepository
.
save
(
sapMutualEpLog
);
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
}
return
sapMutualEpLog
;
}
}
topsun/src/main/java/com/huigou/topsun/sap/common/domain/SapMutualEpLog.java
0 → 100644
View file @
38bf20b2
package
com
.
huigou
.
topsun
.
sap
.
common
.
domain
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
lombok.Data
;
import
org.hibernate.annotations.GenericGenerator
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.persistence.*
;
import
java.io.Serializable
;
/**
*
* @TableName sap_mutual_ep_log
*/
@Table
(
name
=
"sap_mutual_ep_log"
)
@Data
@Entity
public
class
SapMutualEpLog
implements
Serializable
{
@Id
@GeneratedValue
(
generator
=
"system-uuid"
)
@GenericGenerator
(
name
=
"system-uuid"
,
strategy
=
"guid"
)
private
String
id
;
/**
* 业务类型
*/
@Column
(
name
=
"business_type"
)
private
String
businessType
;
/**
* 业务类型
*/
@Column
(
name
=
"business_id"
)
private
String
businessId
;
/**
* 类型 成功、失败
*/
@Column
(
name
=
"type"
)
private
String
type
;
/**
* 消息编号
*/
@Column
(
name
=
"number"
)
private
String
number
;
/**
* 返回信息
*/
@Column
(
name
=
"message"
)
private
String
message
;
/**
* 日志编号
*/
@Column
(
name
=
"log_no"
)
private
String
logNo
;
/**
* 日志消息
*/
@Column
(
name
=
"log_msg_no"
)
private
String
logMsgNo
;
/**
* 日志消息1
* */
@Column
(
name
=
"message_v1"
)
private
String
messageV1
;
/**
* 日志消息2
* */
@Column
(
name
=
"message_v2"
)
private
String
messageV2
;
/**
* 日志消息3
* */
@Column
(
name
=
"message_v3"
)
private
String
messageV3
;
/**
* 日志消息4
* */
@Column
(
name
=
"message_v4"
)
private
String
messageV4
;
/**
* 参数
*/
@Column
(
name
=
"parameter"
)
private
String
parameter
;
@Column
(
name
=
"field"
)
private
String
field
;
@Column
(
name
=
"system_name"
)
private
String
system
;
@Column
(
name
=
"belnr"
)
private
String
belnr
;
@JSONField
(
format
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Column
(
name
=
"created_date"
)
private
String
createdDate
;
@Column
(
name
=
"sequence"
)
private
int
sequence
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/common/repository/SapMutualEpLogRepository.java
0 → 100644
View file @
38bf20b2
package
com
.
huigou
.
topsun
.
sap
.
common
.
repository
;
import
com.huigou.topsun.sap.common.domain.SapMutualEpLog
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
/**
* @Auther: lxh
* @Date: 2024/03/01
* @Description:
*/
public
interface
SapMutualEpLogRepository
extends
JpaRepository
<
SapMutualEpLog
,
String
>
{
// List<SapMutualEpLog> findAllBybusinessType(String businessType);
}
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/application/NonProdApplyApplication.java
View file @
38bf20b2
...
...
@@ -20,4 +20,7 @@ public interface NonProdApplyApplication{
void
deleteNonProdApplyBaseInfoById
(
String
id
);
void
deleteNonProdApplyBaseInfoByIds
(
List
<
String
>
ids
);
String
publishDataToSap
(
String
id
);
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/application/impl/NonProdApplyApplicationImpl.java
View file @
38bf20b2
package
com
.
huigou
.
topsun
.
sap
.
nonProdApply
.
application
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.gson.Gson
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.sap.common.DefaultHttpClient
;
import
com.huigou.topsun.sap.common.application.SapMutualEpLogApplication
;
import
com.huigou.topsun.sap.nonProdApply.application.NonProdApplyApplication
;
import
com.huigou.topsun.sap.nonProdApply.application.NonProdApplyDeptApplication
;
import
com.huigou.topsun.sap.nonProdApply.domain.NonProdApplyBaseInfo
;
...
...
@@ -10,6 +17,10 @@ import com.huigou.topsun.sap.nonProdApply.domain.SapNonProdApplyDept;
import
com.huigou.topsun.sap.nonProdApply.domain.query.NonProdApplyBaseInfoQueryRequest
;
import
com.huigou.topsun.sap.nonProdApply.repository.NonProdApplyBaseInfoRepository
;
import
com.huigou.topsun.sap.nonProdApply.repository.NonProdApplyDeptRepository
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersBank
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersBuyer
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersInfo
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersPay
;
import
com.huigou.uasp.bmp.common.BizBillStatus
;
import
com.huigou.uasp.bpm.FlowBroker
;
import
com.huigou.util.ClassHelper
;
...
...
@@ -22,6 +33,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -32,6 +44,11 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
@Autowired
NonProdApplyDeptApplication
nonProdApplyDeptApplication
;
@Autowired
DefaultHttpClient
defaultHttpClient
;
@Autowired
SapMutualEpLogApplication
sapMutualEpLogApplication
;
@SneakyThrows
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
@Override
...
...
@@ -70,7 +87,6 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
NonProdApplyBaseInfo
nonProdApplyBaseInfo
=
nonProdApplyBaseInfoRepository
.
findOne
(
bizId
);
nonProdApplyBaseInfo
.
setStatusId
(
status
.
getId
());
nonProdApplyBaseInfoRepository
.
save
(
nonProdApplyBaseInfo
);
}
@Override
...
...
@@ -135,5 +151,68 @@ public class NonProdApplyApplicationImpl extends FlowBroker implements NonProdA
ids
.
forEach
(
this
::
deleteNonProdApplyBaseInfoById
);
}
@Override
public
String
publishDataToSap
(
String
id
){
NonProdApplyBaseInfo
nonProdApplyBaseInfo
=
nonProdApplyBaseInfoRepository
.
findOne
(
id
);
SapNonProdApplyDept
applyDept
=
nonProdApplyDeptApplication
.
getNonProdApplyDeptByBaseInfoId
(
nonProdApplyBaseInfo
.
getId
());
sendSapData
(
nonProdApplyBaseInfo
,
applyDept
);
return
""
;
}
/**
* 远程调用sap接口,传递数据
*/
public
void
sendSapData
(
NonProdApplyBaseInfo
prodApplyBaseInfo
,
SapNonProdApplyDept
applyDept
)
{
// Map<String, Object> paramItem = new HashMap<>();
// paramItem.put("ebeln", sapPurchaseOrder.getEbeln());
/*paramItem.put("BEDNR", suppliersInfo.getBillCode());
paramItem.put("frgkz", "10");
paramItem.put("flag", flag);
List<Map<String, Object>> paramList = new ArrayList<>();
paramList.add(paramItem);
Map<String, Object> param = new HashMap<>();
param.put("MODE", "PO");
param.put("DATA", paramList);*/
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Gson
gson
=
new
Gson
();
BeanUtil
.
copyProperties
(
prodApplyBaseInfo
,
map
);
map
.
remove
(
"fullId"
);
map
.
remove
(
"personMemberId"
);
map
.
remove
(
"personMemberName"
);
map
.
remove
(
"positionId"
);
map
.
remove
(
"positionName"
);
map
.
remove
(
"deptId"
);
map
.
remove
(
"deptName"
);
map
.
remove
(
"organId"
);
map
.
remove
(
"organName"
);
map
.
remove
(
"version"
);
BeanUtil
.
copyProperties
(
applyDept
,
map
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
url
=
"bd_mastdata/material"
;
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"businessType"
,
"nonProdApplyBaseInfo"
);
resultMap
.
put
(
"businessId"
,
prodApplyBaseInfo
.
getId
());
resultMap
.
put
(
"parameter"
,
JSON
.
toJSONString
(
map
));
try
{
String
result
=
defaultHttpClient
.
execute
(
map
,
url
);
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
});
resultMap
=
resultList
.
get
(
0
);
resultMap
.
put
(
"sequence"
,
resultMap
.
get
(
"row"
));
sapMutualEpLogApplication
.
saveSapMutualEpLog
(
resultMap
);
if
(
"S"
.
equals
(
resultMap
.
get
(
"TYPE"
)))
{
}
else
{
throw
new
RuntimeException
(
"数据传输失败,请稍后手动重试!"
+
resultMap
.
get
(
"MESSAGE"
));
}
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"type"
,
"E"
);
resultMap
.
put
(
"message"
,
e
.
getMessage
());
sapMutualEpLogApplication
.
saveSapMutualEpLog
(
resultMap
);
throw
new
RuntimeException
(
"数据传输失败请检查数据后重试!"
+
e
.
getMessage
());
}
}
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/nonProdApply/controller/NonProdApplyController.java
View file @
38bf20b2
...
...
@@ -70,6 +70,14 @@ public class NonProdApplyController extends CommonController {
nonProdApplyApplication
.
deleteNonProdApplyBaseInfoByIds
(
ids
);
return
success
();
}
public
String
publishDataToSap
(){
SDO
sdo
=
this
.
getSDO
();
System
.
out
.
println
(
"id============"
+
sdo
.
getString
(
"id"
));
nonProdApplyApplication
.
publishDataToSap
(
sdo
.
getString
(
"id"
));
return
success
();
}
}
topsun/src/main/java/com/huigou/topsun/sap/suppliers/application/impl/SuppliersDataApplicationImpl.java
View file @
38bf20b2
package
com
.
huigou
.
topsun
.
sap
.
suppliers
.
application
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonArray
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.sap.common.DefaultHttpClient
;
import
com.huigou.topsun.sap.common.application.SapMutualEpLogApplication
;
import
com.huigou.topsun.sap.nonProdApply.application.NonProdApplyApplication
;
import
com.huigou.topsun.sap.nonProdApply.domain.NonProdApplyBaseInfo
;
import
com.huigou.topsun.sap.nonProdApply.domain.SapNonProdApplyDept
;
import
com.huigou.topsun.sap.priceMasterData.domain.SapPriceMasterDataItem
;
import
com.huigou.topsun.sap.purchaseOrder.domain.SapPurchaseOrder
;
import
com.huigou.topsun.sap.suppliers.application.SuppliersDataApplication
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersBank
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersBuyer
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersInfo
;
import
com.huigou.topsun.sap.suppliers.domain.SuppliersPay
;
import
com.huigou.topsun.sap.suppliers.domain.*
;
import
com.huigou.topsun.sap.suppliers.domain.query.SuppliersBankQueryRequest
;
import
com.huigou.topsun.sap.suppliers.domain.query.SuppliersBuyerQueryRequest
;
import
com.huigou.topsun.sap.suppliers.domain.query.SuppliersDataQueryRequest
;
...
...
@@ -36,9 +42,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.*
;
@Service
(
"suppliersDataApplication"
)
public
class
SuppliersDataApplicationImpl
extends
FlowBroker
implements
SuppliersDataApplication
{
...
...
@@ -51,6 +55,10 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
SuppliersBuyerRepository
suppliersBuyerRepository
;
@Autowired
SuppliersBankRepository
suppliersBankRepository
;
@Autowired
DefaultHttpClient
defaultHttpClient
;
@Autowired
SapMutualEpLogApplication
sapMutualEpLogApplication
;
@Override
public
Map
<
String
,
Object
>
slicedSuppliersDataQuery
(
SuppliersDataQueryRequest
query
){
...
...
@@ -163,6 +171,14 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
suppliersInfo
.
setStatusId
(
status
.
getId
());
suppliersInfoRepository
.
save
(
suppliersInfo
);
List
<
SuppliersPay
>
payList
=
this
.
suppliersPayRepository
.
findAllBySId
(
suppliersInfo
.
getId
());
List
<
SuppliersBuyer
>
buyerList
=
this
.
suppliersBuyerRepository
.
findAllBySId
(
suppliersInfo
.
getId
());
List
<
SuppliersBank
>
bankList
=
this
.
suppliersBankRepository
.
findAllBySId
(
suppliersInfo
.
getId
());
sendSapData
(
suppliersInfo
,
payList
,
buyerList
,
bankList
);
}
@Override
...
...
@@ -189,6 +205,70 @@ public class SuppliersDataApplicationImpl extends FlowBroker implements Supplier
}
}
/**
* 远程调用sap接口,传递数据
*/
public
void
sendSapData
(
SuppliersInfo
suppliersInfo
,
List
<
SuppliersPay
>
payList
,
List
<
SuppliersBuyer
>
buyerList
,
List
<
SuppliersBank
>
bankList
)
{
// Map<String, Object> paramItem = new HashMap<>();
// paramItem.put("ebeln", sapPurchaseOrder.getEbeln());
/*paramItem.put("BEDNR", suppliersInfo.getBillCode());
paramItem.put("frgkz", "10");
paramItem.put("flag", flag);
List<Map<String, Object>> paramList = new ArrayList<>();
paramList.add(paramItem);
Map<String, Object> param = new HashMap<>();
param.put("MODE", "PO");
param.put("DATA", paramList);*/
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Gson
gson
=
new
Gson
();
BeanUtil
.
copyProperties
(
suppliersInfo
,
map
);
map
.
remove
(
"fullId"
);
map
.
remove
(
"personMemberId"
);
map
.
remove
(
"personMemberName"
);
map
.
remove
(
"positionId"
);
map
.
remove
(
"positionName"
);
map
.
remove
(
"deptId"
);
map
.
remove
(
"deptName"
);
map
.
remove
(
"organId"
);
map
.
remove
(
"organName"
);
map
.
remove
(
"version"
);
map
.
put
(
"rltyp"
,
map
.
get
(
"rltgr"
));
map
.
put
(
"updkz"
,
"I"
);
map
.
remove
(
"rltgr"
);
map
.
put
(
"LFB1"
,
gson
.
toJson
(
payList
));
map
.
put
(
"LFM1"
,
gson
.
toJson
(
buyerList
));
map
.
put
(
"BANK"
,
gson
.
toJson
(
bankList
));
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
url
=
"CUD_SUPPLY/SUPPLY_DATA"
;
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"businessType"
,
"suppliersInfo"
);
resultMap
.
put
(
"businessId"
,
suppliersInfo
.
getId
());
resultMap
.
put
(
"parameter"
,
JSON
.
toJSONString
(
map
));
try
{
String
result
=
defaultHttpClient
.
execute
(
map
,
url
);
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
});
resultMap
=
resultList
.
get
(
0
);
resultMap
.
put
(
"sequence"
,
resultMap
.
get
(
"row"
));
sapMutualEpLogApplication
.
saveSapMutualEpLog
(
resultMap
);
if
(
"S"
.
equals
(
resultMap
.
get
(
"TYPE"
)))
{
}
else
{
throw
new
RuntimeException
(
"数据传输失败,请稍后手动重试!"
+
resultMap
.
get
(
"MESSAGE"
));
}
}
catch
(
Exception
e
)
{
resultMap
.
put
(
"type"
,
"E"
);
resultMap
.
put
(
"message"
,
e
.
getMessage
());
sapMutualEpLogApplication
.
saveSapMutualEpLog
(
resultMap
);
throw
new
RuntimeException
(
"数据传输失败请检查数据后重试!"
+
e
.
getMessage
());
}
}
@Override
public
SuppliersInfo
loadSuppliersDataById
(
String
id
)
{
...
...
topsun/src/main/java/com/huigou/topsun/sap/suppliers/domain/SuppliersInfo.java
View file @
38bf20b2
...
...
@@ -213,7 +213,7 @@ public class SuppliersInfo extends FlowBillAbstractEntity {
private
String
stenr
;
/**
* 更新标识
* 更新标识
I、U、D
*/
@Column
(
name
=
"updkz"
)
private
String
updkz
;
...
...
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