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
cab5b685
Commit
cab5b685
authored
Jan 26, 2024
by
wanghang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
费用报销
parent
d3efd311
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
359 additions
and
140 deletions
+359
-140
costReimbursement.js
...app/biz/topsun/sap/costReimbursement/costReimbursement.js
+51
-25
costReimbursement.jsp
...pp/biz/topsun/sap/costReimbursement/costReimbursement.jsp
+19
-7
sapPurchaseOrderDetail.js
...pp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderDetail.js
+4
-7
sapPurchaseOrderDetail.jsp
...p/biz/topsun/sap/purchaseOrder/sapPurchaseOrderDetail.jsp
+30
-8
sapPurchaseOrderList.js
...bapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderList.js
+2
-4
SapCostReimbursementApplication.java
...ursement/application/SapCostReimbursementApplication.java
+1
-1
SapCostReimbursementApplicationImpl.java
...application/impl/SapCostReimbursementApplicationImpl.java
+72
-57
SapCostReimbursement.java
...un/sap/costReimbursement/domain/SapCostReimbursement.java
+64
-0
SapCostReimbursementDetail.java
.../costReimbursement/domain/SapCostReimbursementDetail.java
+5
-2
SapPurchaseOrderApplicationImpl.java
...der/application/impl/SapPurchaseOrderApplicationImpl.java
+39
-27
SapPurchaseOrder.java
...gou/topsun/sap/purchaseOrder/domain/SapPurchaseOrder.java
+72
-2
No files found.
topsun-xt/src/main/webapp/biz/topsun/sap/costReimbursement/costReimbursement.js
View file @
cab5b685
...
...
@@ -40,7 +40,7 @@ var tableArray = [
}
},
{
display
:
"BP"
,
name
:
"partner"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
display
:
"BP
(合作伙伴)
"
,
name
:
"partner"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'text'
...
...
@@ -111,7 +111,7 @@ var tableArray = [
display
:
"计划付款日期"
,
name
:
"zepFpldate"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
,
editor
:
{
type
:
'
text
'
type
:
'
date
'
}
},
{
...
...
@@ -309,8 +309,7 @@ var tableArray = [
}
},
]
}
,
{
},
{
parms
:
{},
node
:
"capitalPostGrid"
,
gridManager
:
null
,
...
...
@@ -345,14 +344,40 @@ var tableArray = [
},
]
}
,
{
parms
:
{},
node
:
"financialAudit_sapReturnGrid"
,
gridManager
:
null
,
data
:
null
,
columns
:
[
{
display
:
"EP流程子序号"
,
name
:
"zepItemno"
,
width
:
80
,
minwidth
:
80
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"记账凭证编号"
,
name
:
"belnr"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"记账凭证财年"
,
name
:
"gjahr"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"记账过账日期"
,
name
:
"budat"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"记账凭证日期"
,
name
:
"bldat"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"返回状态"
,
name
:
"msgty"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"返回消息"
,
name
:
"msgtx"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
]
}
,
{
parms
:
{},
node
:
"paymentAccomplish_sapReturnGrid"
,
gridManager
:
null
,
data
:
null
,
columns
:
[
{
display
:
"EP流程子序号"
,
name
:
"zepItemno"
,
width
:
80
,
minwidth
:
80
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"付款凭证编号"
,
name
:
"belnr1"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"付款状态"
,
name
:
"zpayStaus"
,
width
:
120
,
minwidth
:
120
,
type
:
"string"
,
align
:
"left"
}
]
}
]
//创建表格(参数、列、插入的节点、数据源)
function
loadGrid
(
obj
)
{
var
toolbarOptions
=
null
;
var
toolbarOptions
=
null
;
// if(obj.node=="reimbursementApplierGrid") {//只有第一个表格含工具栏
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
addHandler
:
function
()
{
tableArray
.
forEach
((
item
)
=>
{
UICtrl
.
addGridRow
(
item
.
gridManager
,
{
zepItemno
:
getZepItemNo
()});
...
...
@@ -391,11 +416,11 @@ function loadGrid(obj) {
row
=
temp
;
}
})
checked
?
item
.
gridManager
.
select
(
row
):
item
.
gridManager
.
unselect
(
row
);
checked
?
item
.
gridManager
.
select
(
row
)
:
item
.
gridManager
.
unselect
(
row
);
})
return
false
;
//阻止默认事件、防止某个表格的对应行被多次选中
},
onBeforeCheckAllRow
:
function
(
a
,
b
)
{
onBeforeCheckAllRow
:
function
(
a
,
b
)
{
// console.log(b)
// $(b).addClass("l-checked")
...
...
@@ -508,6 +533,7 @@ function getTableDataAll(obj) {
//调用数组
function
useArrayTable
(
func
,
...
data
)
{
debugger
const
results
=
tableArray
.
map
((
item
)
=>
{
return
func
(
item
,
...
data
);
});
...
...
@@ -515,13 +541,13 @@ function useArrayTable(func, ...data) {
}
//获取最新子序号(维护实体的标识)
function
getZepItemNo
(){
let
result
=
getTableDataAll
(
tableArray
[
tableArray
.
length
-
1
]);
let
zepItemNo
=
"001"
;
if
(
result
.
length
>
0
)
{
function
getZepItemNo
()
{
let
result
=
getTableDataAll
(
tableArray
[
tableArray
.
length
-
1
]);
let
zepItemNo
=
"001"
;
if
(
result
.
length
>
0
)
{
//获取上一个节点的子序值
let
wornNo
=
parseInt
(
result
[
result
.
length
-
1
][
"zepItemno"
],
10
);
zepItemNo
=
(
"00"
+
(
wornNo
+
1
)).
slice
(
-
3
);
let
wornNo
=
parseInt
(
result
[
result
.
length
-
1
][
"zepItemno"
],
10
);
zepItemNo
=
(
"00"
+
(
wornNo
+
1
)).
slice
(
-
3
);
}
return
zepItemNo
;
}
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/sap/costReimbursement/costReimbursement.jsp
View file @
cab5b685
...
...
@@ -26,7 +26,8 @@
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"zepNo"
required=
"false"
label=
"EP流程单号"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFcrdate"
required=
"false"
wrapper=
"date"
label=
"付款申请创建日期"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFcrdate"
required=
"false"
wrapper=
"date"
label=
"付款申请创建日期"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFtype"
required=
"false"
label=
"EP付款申请类别"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"2"
/>
...
...
@@ -38,8 +39,8 @@
<x:inputC
name=
"zepDepartname"
required=
"false"
label=
"EP部门名称"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepAppli"
required=
"false"
label=
"EP流程申请人代码"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepAppliname"
required=
"false"
label=
"EP流程申请人"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFcrdate"
wrapper=
"date"
required=
"false"
label=
"付款申请创建日期"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepNo"
required=
"false"
label=
"EP流程单号"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFcrdate"
wrapper=
"date"
required=
"false"
label=
"付款申请创建日期"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepTxt"
required=
"false"
label=
"付款申请内容"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFtamount"
required=
"false"
label=
"申请总金额(本位币)"
labelCol=
"2"
fieldCol=
"2"
/>
<x:inputC
name=
"zepFttax"
required=
"false"
label=
"申请总税额(本位币)"
labelCol=
"2"
fieldCol=
"2"
/>
...
...
@@ -62,10 +63,21 @@
<div
id=
"financialAuditGrid"
style=
"margin: 2px;"
>
</div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"财务已审核、sap回执"
name=
"group"
/>
<div
id=
"financialAudit_sapReturnGrid"
style=
"margin: 2px;"
>
</div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"资金岗填写"
name=
"group"
/>
<div
id=
"capitalPostGrid"
style=
"margin: 2px;"
>
</div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"付款完成、sap回执"
name=
"group"
/>
<div
id=
"paymentAccomplish_sapReturnGrid"
style=
"margin: 2px;"
>
</div>
</div>
</form>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderDetail.js
View file @
cab5b685
...
...
@@ -15,16 +15,13 @@ function initItemGrid() {
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/sapPurchaseOrder/querySapPurchaseOrderItems.ajax'
,
parms
:
{
sapPurchaseOrderId
:
getId
()},
height
:
'
99.6%
'
,
height
:
'
400px
'
,
heightDiff
:
-
4
,
sortName
:
'id'
,
sortOrder
:
'asc'
,
checkbox
:
true
,
// sortName: 'id',
// sortOrder: 'asc',
usePager
:
true
,
rownumbers
:
true
,
enabledEdit
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
// fixedCellHeight: true,
}
);
UICtrl
.
setSearchAreaToggle
(
itemGridManager
);
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderDetail.jsp
View file @
cab5b685
...
...
@@ -27,13 +27,35 @@
<x:hidden
name=
"statusId"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"ebeln"
label=
"采购订单号码"
readonly=
"false"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"bsart"
label=
"采购订单类型"
readonly=
"false"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"batxt"
label=
"采购订单类型描述"
readonly=
"false"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"ekgrp"
label=
"采购组"
readonly=
"false"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"eknam"
label=
"采购组描述"
readonly=
"false"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"waers"
label=
"币种"
readonly=
"false"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"fillinDate"
label=
"创建日期"
readonly=
"true"
wrapper=
"date"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"ebeln"
label=
"采购订单号码"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"bsart"
label=
"采购订单类型"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"batxt"
label=
"采购订单类型描述"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"ekgrp"
label=
"采购组"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"eknam"
label=
"采购组描述"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"waers"
label=
"币种"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"fillinDate"
label=
"创建日期"
readonly=
"true"
wrapper=
"date"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
</div>
</div>
<x:title
title=
"sap回执"
name=
"group"
/>
<div
class=
"hg-form-cols"
>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"msgType"
label=
"消息类型"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"msgId"
label=
"消息id"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"number"
label=
"消息编号"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"message"
label=
"消息内容"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"logNo"
label=
"日志编号"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"logMsgNo"
label=
"日志消息编号"
readonly=
"true"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"messageV1"
label=
"消息参数 1"
readonly=
"true"
wrapper=
"date"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"messageV2"
label=
"消息参数 2"
readonly=
"true"
wrapper=
"date"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"messageV3"
label=
"消息参数 3"
readonly=
"true"
wrapper=
"date"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
<x:inputC
name=
"messageV4"
label=
"消息参数 4"
readonly=
"true"
wrapper=
"date"
labelCol=
"1"
fieldCol=
"2"
required=
"false"
/>
</div>
</div>
<div
id=
"maingrid"
></div>
...
...
topsun-xt/src/main/webapp/biz/topsun/sap/purchaseOrder/sapPurchaseOrderList.js
View file @
cab5b685
...
...
@@ -22,6 +22,8 @@ function loadGrid() {
,
{
display
:
"采购订单号码"
,
name
:
"ebeln"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"采购订单类型"
,
name
:
"bsart"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"采购订单类型描述"
,
name
:
"batxt"
,
width
:
150
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
,
{
display
:
"sap回执"
,
name
:
"message"
,
width
:
200
,
minWidth
:
60
,
type
:
"string"
,
align
:
"center"
}
],
dataAction
:
'server'
,
url
:
web_app
.
name
+
'/sapPurchaseOrder/slicedSapPurchaseOrderList.ajax?'
,
...
...
@@ -31,13 +33,9 @@ function loadGrid() {
height
:
'100%'
,
pageSize
:
100
,
heightDiff
:
-
4
,
checkbox
:
true
,
usePager
:
true
,
rownumbers
:
true
,
enabledEdit
:
false
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
enableObjectBag
:
true
,
onSuccess
:
function
(
data
)
{
if
(
data
.
error
)
{
Public
.
tip
(
data
.
error
);
...
...
topsun/src/main/java/com/huigou/topsun/sap/costReimbursement/application/SapCostReimbursementApplication.java
View file @
cab5b685
...
...
@@ -23,5 +23,5 @@ public interface SapCostReimbursementApplication {
void
deleteSapCostReimbursementById
(
String
id
);
void
deleteSapCostReimbursementByIds
(
List
<
String
>
ids
);
void
sendSapDate
(
String
bizId
);
void
sendSapDate
(
SapCostReimbursement
sapCostReimbursement
);
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/costReimbursement/application/impl/SapCostReimbursementApplicationImpl.java
View file @
cab5b685
package
com
.
huigou
.
topsun
.
sap
.
costReimbursement
.
application
.
impl
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.huigou.data.query.model.QueryDescriptor
;
...
...
@@ -24,28 +25,29 @@ import com.huigou.util.SDO;
import
lombok.SneakyThrows
;
import
org.activiti.engine.delegate.DelegateExecution
;
import
org.activiti.engine.delegate.DelegateTask
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
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.util.ArrayList
;
import
java.util.Base64
;
import
java.util.List
;
import
java.util.Map
;
import
java.io.IOException
;
import
java.util.*
;
@Service
(
"sapCostReimbursementApplication"
)
public
class
SapCostReimbursementApplicationImpl
extends
FlowBroker
implements
SapCostReimbursementApplication
{
private
final
static
Logger
LOG
=
LoggerFactory
.
getLogger
(
SapCostReimbursementApplicationImpl
.
class
);
@Autowired
private
SapCostReimbursementDetailRepository
costReimbursementDetailRepository
;
@Autowired
private
SapCostReimbursementRepository
costReimbursementRepository
;
//
@Autowired
//
DefaultHttpClient defaultHttpClient;
@Autowired
DefaultHttpClient
defaultHttpClient
;
// @Autowired
// MessageCodec messageCodec;
...
...
@@ -71,7 +73,8 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
if
(!
CRDetailAll
.
isEmpty
())
{
costReimbursementDetailRepository
.
delete
(
CRDetailAll
);
}
List
<
SapCostReimbursementDetail
>
CRDetailList
=
objectMapper
.
readValue
(
CRDetailJSON
,
new
TypeReference
<
List
<
SapCostReimbursementDetail
>>()
{});
List
<
SapCostReimbursementDetail
>
CRDetailList
=
objectMapper
.
readValue
(
CRDetailJSON
,
new
TypeReference
<
List
<
SapCostReimbursementDetail
>>()
{
});
for
(
SapCostReimbursementDetail
item
:
CRDetailList
)
{
item
.
setReimbursementBaseInfoId
(
sapCostReimbursement
.
getId
());
}
...
...
@@ -101,7 +104,7 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
sapCostReimbursement
.
setStatusId
(
status
.
getId
());
costReimbursementRepository
.
save
(
sapCostReimbursement
);
//审核完成、远程调用sap接口
sendSapDate
(
bizId
);
sendSapDate
(
sapCostReimbursement
);
}
@Override
...
...
@@ -155,65 +158,77 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
ids
.
forEach
(
this
::
deleteSapCostReimbursementById
);
}
/**
* 远程调用sap接口,传递数据
*
* @param bizId
*/
public
void
sendSapDate
(
String
bizId
)
{
SapCostReimbursement
sapCostReimbursement
=
costReimbursementRepository
.
findOne
(
bizId
);
public
void
sendSapDate
(
SapCostReimbursement
sapCostReimbursement
)
{
if
(
sapCostReimbursement
.
getStatusId
()
==
BizBillStatus
.
APPLYING
.
getId
())
{
throw
new
RuntimeException
(
"本数据未经审批完成!"
);
}
List
<
SapCostReimbursementDetail
>
all
=
costReimbursementDetailRepository
.
findAllByReimbursementBaseInfoId
(
bizId
);
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
ObjectMapper
objectMapper
=
new
ObjectMapper
();
Map
<
String
,
Object
>
map
=
MyBaseUtil
.
convertToMap
(
sapCostReimbursement
,
true
);
List
<
SapCostReimbursementDetail
>
all
=
costReimbursementDetailRepository
.
findAllByReimbursementBaseInfoId
(
sapCostReimbursement
.
getId
());
List
<
Object
>
paramList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
itemList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
new
ArrayList
<>();
Map
<
String
,
Object
>
map
=
MyBaseUtil
.
convertToMap
(
sapCostReimbursement
,
true
);
map
.
remove
(
"ZEP_FTYPE"
);
map
.
remove
(
"ZEP_NO"
);
// 封装参数
// for (SapStatsIndicatorsDetail sapStatsIndicatorsDetail : all) {
// Map<String, Object> detailMap = objectMapper.convertValue(sapStatsIndicatorsDetail, Map.class);
// map.put("ITEM", detailMap);
// list.add(map);
// }
//
// String url = "cud_kb31n/kb31n";
// SapStatsIndicatorsResult sapStatsIndicatorsResult = null;
// try {
// String result = defaultHttpClient.execute(list, url);
// List<SapStatsIndicatorsResult> resultList = objectMapper.readValue(result, new TypeReference<List<SapStatsIndicatorsResult>>() {
// });
//
// sapStatsIndicatorsResult = resultList.get(0);
//
// if (!"s".equals(sapStatsIndicatorsResult.getType())) {
// throw new RuntimeException("数据传输失败,请稍后手动重试!");
// }
// } catch (IOException e) {
// if (sapStatsIndicatorsResult == null) {
// sapStatsIndicatorsResult = new SapStatsIndicatorsResult();
// }
// sapStatsIndicatorsResult.setType("A");
// throw new RuntimeException("sap服务器无响应请稍后手动重试!");
// } finally {
// SapStatsIndicatorsResult statsIndicatorsId = sapStatsIndicatorsResultRepository.findByStatsIndicatorsId(bizId);
// if(statsIndicatorsId!=null)sapStatsIndicatorsResultRepository.delete(statsIndicatorsId);
// sapStatsIndicatorsResult.setStatsIndicatorsId(bizId);
// sapStatsIndicatorsResultRepository.save(sapStatsIndicatorsResult);
// }
}
public
static
void
main
(
String
[]
args
)
{
for
(
SapCostReimbursementDetail
costReimbursementDetail
:
all
)
{
Map
<
String
,
Object
>
detailMap
=
MyBaseUtil
.
convertToMap
(
costReimbursementDetail
,
true
);
detailMap
.
putAll
(
map
);
itemList
.
add
(
detailMap
);
}
paramMap
.
put
(
"ITEM"
,
itemList
);
paramMap
.
put
(
"MANDT"
,
"300"
);
paramMap
.
put
(
"ZEP_FTYPE"
,
sapCostReimbursement
.
getZepFtype
());
paramMap
.
put
(
"ZEP_NO"
,
sapCostReimbursement
.
getZepNo
());
paramList
.
add
(
paramMap
);
String
url
=
"cud_fi012/cud_fi012"
;
try
{
String
result
=
defaultHttpClient
.
execute
(
paramList
,
url
);
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
});
StringBuffer
errorMsg
=
new
StringBuffer
();
for
(
Map
<
String
,
Object
>
resultMap
:
resultList
)
{
if
(!
"S"
.
equals
(
resultMap
.
get
(
"TYPE"
)))
{
errorMsg
.
append
(
resultMap
.
get
(
"MESSAGE"
));
}
}
if
(
errorMsg
.
length
()==
0
)
{
Map
<
String
,
Object
>
resultMap
=
resultList
.
get
(
0
);
sapCostReimbursement
.
setMsgId
((
String
)
resultMap
.
get
(
"ID"
));
sapCostReimbursement
.
setNumber
((
String
)
resultMap
.
get
(
"NUMBER"
));
sapCostReimbursement
.
setMsgType
((
String
)
resultMap
.
get
(
"TYPE"
));
sapCostReimbursement
.
setLogNo
((
String
)
resultMap
.
get
(
"LOG_NO"
));
sapCostReimbursement
.
setLogMsgNo
((
String
)
resultMap
.
get
(
"LOG_MSG_NO"
));
sapCostReimbursement
.
setMessage
((
String
)
resultMap
.
get
(
"MESSAGE"
));
sapCostReimbursement
.
setMessageV1
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
sapCostReimbursement
.
setMessageV2
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
sapCostReimbursement
.
setMessageV3
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
sapCostReimbursement
.
setMessageV4
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
this
.
costReimbursementRepository
.
save
(
sapCostReimbursement
);
}
else
{
LOG
.
error
(
"数据传输失败!error: {}"
,
errorMsg
);
throw
new
RuntimeException
(
"数据传输失败,请检查后重试!error:"
+
errorMsg
);
}
}
catch
(
IOException
e
)
{
LOG
.
error
(
"sap服务器无响应请稍后手动重试!error: {}"
,
e
.
getMessage
());
throw
new
RuntimeException
(
"sap服务器无响应请稍后手动重试!error:"
+
e
.
getMessage
());
}
}
public
static
void
main
(
String
[]
args
)
throws
JsonProcessingException
{
// post.setHeader("Content-type", "application/json;charset=utf-8");
String
usernameAndPassword
=
"rest_user:Bsn123456"
;
String
usernameAndPassword
=
"rest_user:Bsn123456"
;
System
.
out
.
println
(
"Authorization"
);
System
.
out
.
println
(
"Basic "
+
Base64
.
getEncoder
().
encodeToString
(
usernameAndPassword
.
getBytes
()));
System
.
out
.
println
(
"Basic "
+
Base64
.
getEncoder
().
encodeToString
(
usernameAndPassword
.
getBytes
()));
}
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/costReimbursement/domain/SapCostReimbursement.java
View file @
cab5b685
...
...
@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import
java.util.Date
;
import
javax.persistence.*
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.huigou.data.domain.model.FlowBillAbstractEntity
;
import
lombok.Data
;
...
...
@@ -132,6 +133,69 @@ public class SapCostReimbursement extends FlowBillAbstractEntity {
private
BigDecimal
zepPttax1
;
/**
* 消息类型
*/
@JsonIgnore
@Column
(
name
=
"MSG_TYPE"
)
private
String
msgType
;
/**
* 消息id
*/
@JsonIgnore
@Column
(
name
=
"MSG_ID"
)
private
String
msgId
;
/**
* 消息编号
*/
@JsonIgnore
@Column
(
name
=
"NUMBER"
)
private
String
number
;
/**
* 消息内容
*/
@JsonIgnore
@Column
(
name
=
"MESSAGE"
)
private
String
message
;
/**
* 日志编号
*/
@JsonIgnore
@Column
(
name
=
"LOG_NO"
)
private
String
logNo
;
/**
* 日志消息编号
*/
@JsonIgnore
@Column
(
name
=
"LOG_MSG_NO"
)
private
String
logMsgNo
;
/**
* 消息参数 1
*/
@JsonIgnore
@Column
(
name
=
"MESSAGE_V1"
)
private
String
messageV1
;
/**
* 消息参数 2
*/
@JsonIgnore
@Column
(
name
=
"MESSAGE_V2"
)
private
String
messageV2
;
/**
* 消息参数 3
*/
@JsonIgnore
@Column
(
name
=
"MESSAGE_V3"
)
private
String
messageV3
;
/**
* 消息参数 4
*/
@JsonIgnore
@Column
(
name
=
"MESSAGE_V4"
)
private
String
messageV4
;
@Override
protected
String
getCodeRuleId
()
{
return
"sapCostReimbursement"
;
...
...
topsun/src/main/java/com/huigou/topsun/sap/costReimbursement/domain/SapCostReimbursementDetail.java
View file @
cab5b685
...
...
@@ -5,6 +5,8 @@ import java.math.BigDecimal;
import
java.util.Date
;
import
javax.persistence.*
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnoreProperties
;
import
lombok.Data
;
import
org.hibernate.annotations.GenericGenerator
;
...
...
@@ -30,11 +32,13 @@ public class SapCostReimbursementDetail implements Serializable {
strategy
=
"guid"
)
@Column
(
name
=
"reimbursement_detail_id"
)
@JsonIgnore
private
String
reimbursementDetailId
;
/**
*
*/
@JsonIgnore
@Column
(
name
=
"reimbursement_base_info_id"
)
private
String
reimbursementBaseInfoId
;
...
...
@@ -131,6 +135,7 @@ public class SapCostReimbursementDetail implements Serializable {
/**
* 计划付款日期
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Column
(
name
=
"ZEP_FPLDATE"
)
private
Date
zepFpldate
;
...
...
@@ -362,6 +367,4 @@ public class SapCostReimbursementDetail implements Serializable {
@Column
(
name
=
"MSGTX"
)
private
String
msgtx
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/application/impl/SapPurchaseOrderApplicationImpl.java
View file @
cab5b685
...
...
@@ -70,7 +70,6 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
}
@Override
protected
Map
<
String
,
Object
>
getProcessBizParams
(
String
bizId
)
{
// 返回业务数据给流程实例
...
...
@@ -85,7 +84,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
SapPurchaseOrder
sapPurchaseOrder
=
sapPurchaseOrderRepository
.
findOne
(
bizId
);
sapPurchaseOrder
.
setStatusId
(
status
.
getId
());
SapPurchaseOrder
save
=
sapPurchaseOrderRepository
.
save
(
sapPurchaseOrder
);
this
.
sendSapDate
(
save
,
"Y"
);
this
.
sendSapDate
(
save
,
"Y"
);
}
...
...
@@ -110,7 +109,7 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
SapPurchaseOrder
sapPurchaseOrder
=
sapPurchaseOrderRepository
.
findOne
(
bizId
);
sapPurchaseOrder
.
setStatusId
(
BizBillStatus
.
APPLYING
.
getId
());
SapPurchaseOrder
save
=
sapPurchaseOrderRepository
.
save
(
sapPurchaseOrder
);
this
.
sendSapDate
(
save
,
"N"
);
this
.
sendSapDate
(
save
,
"N"
);
// 调用 onEnd 方法
// DelegateExecution execution = delegateTask.getExecution();
// onEnd(execution);
...
...
@@ -132,12 +131,12 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
@Override
@Transactional
public
void
saveSapPurchaseOrderDto
(
SapPurchaseOrderDto
sapPurchaseOrderDto
){
public
void
saveSapPurchaseOrderDto
(
SapPurchaseOrderDto
sapPurchaseOrderDto
)
{
SapPurchaseOrderVo
sapPurchaseOrderVo
=
sapPurchaseOrderDto
.
getLsHeader
();
SapPurchaseOrder
purchaseOrder
=
sapPurchaseOrderRepository
.
findAllByEbeln
(
sapPurchaseOrderVo
.
getEbeln
());
String
purchaseOrderId
=
""
;
String
purchaseOrderId
=
""
;
//数据第一次接收,创建流程任务
if
(
purchaseOrder
==
null
)
{
if
(
purchaseOrder
==
null
)
{
SapPurchaseOrder
sapPurchaseOrder
=
new
SapPurchaseOrder
();
BeanUtil
.
copyProperties
(
sapPurchaseOrderVo
,
sapPurchaseOrder
);
//初始化用户信息
...
...
@@ -152,54 +151,67 @@ public class SapPurchaseOrderApplicationImpl extends FlowBroker implements SapPu
sapPurchaseOrder
.
setFillinDate
(
sapPurchaseOrderVo
.
getAedat
());
sapPurchaseOrder
=
this
.
sapPurchaseOrderRepository
.
save
(
sapPurchaseOrder
);
purchaseOrderId
=
sapPurchaseOrder
.
getId
();
}
else
{
purchaseOrderId
=
sapPurchaseOrder
.
getId
();
}
else
{
//数据第n次接收覆盖上一次数据
BeanUtil
.
copyProperties
(
sapPurchaseOrderVo
,
purchaseOrder
);
this
.
sapPurchaseOrderRepository
.
save
(
purchaseOrder
);
List
<
SapPurchaseOrderItem
>
purchaseOrderItems
=
sapPurchaseOrderItemApplication
.
getPurchaseOrderItems
(
purchaseOrder
.
getId
());
sapPurchaseOrderItemApplication
.
deletePurchaseOrderItems
(
purchaseOrderItems
);
purchaseOrderId
=
purchaseOrder
.
getId
();
purchaseOrderId
=
purchaseOrder
.
getId
();
}
List
<
SapPurchaseOrderItemVo
>
ltItems
=
sapPurchaseOrderDto
.
getLtItems
();
List
<
SapPurchaseOrderItem
>
purchaseOrderItems
=
new
ArrayList
<>();
ltItems
.
forEach
(
approvalItemVo
->
{
ltItems
.
forEach
(
approvalItemVo
->
{
SapPurchaseOrderItem
sapPurchaseApprovalItem
=
new
SapPurchaseOrderItem
();
BeanUtil
.
copyProperties
(
approvalItemVo
,
sapPurchaseApprovalItem
);
BeanUtil
.
copyProperties
(
approvalItemVo
,
sapPurchaseApprovalItem
);
purchaseOrderItems
.
add
(
sapPurchaseApprovalItem
);
});
sapPurchaseOrderItemApplication
.
saveSapPurchaseOrderItems
(
purchaseOrderId
,
purchaseOrderItems
);
sapPurchaseOrderItemApplication
.
saveSapPurchaseOrderItems
(
purchaseOrderId
,
purchaseOrderItems
);
}
/**
* 远程调用sap接口,传递数据
*/
public
void
sendSapDate
(
SapPurchaseOrder
sapPurchaseOrder
,
String
flag
)
{
Map
<
String
,
Object
>
paramItem
=
new
HashMap
<>();
paramItem
.
put
(
"ebeln"
,
sapPurchaseOrder
.
getEbeln
());
paramItem
.
put
(
"BEDNR"
,
sapPurchaseOrder
.
getBillCode
());
paramItem
.
put
(
"frgkz"
,
"10"
);
paramItem
.
put
(
"flag"
,
flag
);
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
<>();
public
void
sendSapDate
(
SapPurchaseOrder
sapPurchaseOrder
,
String
flag
)
{
Map
<
String
,
Object
>
paramItem
=
new
HashMap
<>();
paramItem
.
put
(
"ebeln"
,
sapPurchaseOrder
.
getEbeln
());
paramItem
.
put
(
"BEDNR"
,
sapPurchaseOrder
.
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
>
param
=
new
HashMap
<>();
param
.
put
(
"MODE"
,
"PO"
);
param
.
put
(
"DATA"
,
paramList
);
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
url
=
"pass_approval/approval"
;
try
{
String
result
=
defaultHttpClient
.
execute
(
param
,
url
);
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{});
List
<
Map
<
String
,
Object
>>
resultList
=
objectMapper
.
readValue
(
result
,
new
TypeReference
<
List
<
Map
<
String
,
Object
>>>()
{
});
Map
<
String
,
Object
>
resultMap
=
resultList
.
get
(
0
);
if
(!
"S"
.
equals
(
resultMap
.
get
(
"TYPE"
)))
{
throw
new
RuntimeException
(
"数据传输失败,请稍后手动重试!"
+
resultMap
.
get
(
"MESSAGE"
));
if
(
"S"
.
equals
(
resultMap
.
get
(
"TYPE"
)))
{
sapPurchaseOrder
.
setMsgId
((
String
)
resultMap
.
get
(
"ID"
));
sapPurchaseOrder
.
setNumber
((
String
)
resultMap
.
get
(
"NUMBER"
));
sapPurchaseOrder
.
setMsgType
((
String
)
resultMap
.
get
(
"TYPE"
));
sapPurchaseOrder
.
setLogNo
((
String
)
resultMap
.
get
(
"LOG_NO"
));
sapPurchaseOrder
.
setLogMsgNo
((
String
)
resultMap
.
get
(
"LOG_MSG_NO"
));
sapPurchaseOrder
.
setMessage
((
String
)
resultMap
.
get
(
"MESSAGE"
));
sapPurchaseOrder
.
setMessageV1
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
sapPurchaseOrder
.
setMessageV2
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
sapPurchaseOrder
.
setMessageV3
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
sapPurchaseOrder
.
setMessageV4
((
String
)
resultMap
.
get
(
"MESSAGE_V1"
));
this
.
sapPurchaseOrderRepository
.
save
(
sapPurchaseOrder
);
}
else
{
throw
new
RuntimeException
(
"数据传输失败,请稍后手动重试!"
+
resultMap
.
get
(
"MESSAGE"
));
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"数据传输失败请检查数据后重试!"
+
e
.
getMessage
());
throw
new
RuntimeException
(
"数据传输失败请检查数据后重试!"
+
e
.
getMessage
());
}
}
}
topsun/src/main/java/com/huigou/topsun/sap/purchaseOrder/domain/SapPurchaseOrder.java
View file @
cab5b685
...
...
@@ -12,10 +12,9 @@ import java.io.Serializable;
import
java.util.Date
;
/**
*
* @TableName sap_purchase_order
*/
@Table
(
name
=
"sap_purchase_order"
)
@Table
(
name
=
"sap_purchase_order"
)
@Entity
@Data
public
class
SapPurchaseOrder
extends
FlowBillAbstractEntity
{
...
...
@@ -76,7 +75,78 @@ public class SapPurchaseOrder extends FlowBillAbstractEntity {
// @Column(name = "NAME_TEXT")
// private String nameText;
/**
* 消息类型
*/
@Column
(
name
=
"MSG_TYPE"
)
private
String
msgType
;
/**
* 消息id
*/
@Column
(
name
=
"MSG_ID"
)
private
String
msgId
;
/**
* 消息编号
*/
@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 = "ROW")
// private String row;
// /**
// * 字段
// */
// @Column(name = "FIELD")
// private String field;
// /**
// * 系统
// */
// @Column(name = "SYSTEM")
// private String system;
@Override
protected
String
getCodeRuleId
()
{
...
...
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