Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
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
曲欣亮
sap-service
Commits
4ae7ba41
Commit
4ae7ba41
authored
Aug 12, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
898cb98b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
7 deletions
+36
-7
SI004INVENTORYSyncOutServiceTask.java
...TORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
+17
-3
SI011ACTUALSALESSyncOutServiceTask.java
...ES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
+17
-3
ZMISD009SOCREATIONServiceTask.java
..._MI_SD_009_SO_CREATION/ZMISD009SOCREATIONServiceTask.java
+2
-1
No files found.
src/main/java/com/egolm/sso/clients/SI_004_INVENTORY_SyncOutService/SI004INVENTORYSyncOutServiceTask.java
View file @
4ae7ba41
...
@@ -15,6 +15,7 @@ import org.springframework.boot.system.ApplicationHome;
...
@@ -15,6 +15,7 @@ import org.springframework.boot.system.ApplicationHome;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -69,7 +70,7 @@ public class SI004INVENTORYSyncOutServiceTask {
...
@@ -69,7 +70,7 @@ public class SI004INVENTORYSyncOutServiceTask {
}
}
public
void
sendData
(
SI004INVENTORYSyncOut
SI004INVENTORYSyncOut
)
{
public
void
sendData
(
SI004INVENTORYSyncOut
SI004INVENTORYSyncOut
)
{
Page
page
=
new
Page
(
1L
,
1000L
,
new
String
[]
{
"DIS_CODE"
,
"
INVENTORY_DATE
"
});
Page
page
=
new
Page
(
1L
,
1000L
,
new
String
[]
{
"DIS_CODE"
,
"
TRACE_NO
"
});
String
sql
=
"SELECT * FROM t_dis_inventory WHERE SEND_STATUS = 'N'"
;
String
sql
=
"SELECT * FROM t_dis_inventory WHERE SEND_STATUS = 'N'"
;
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
tmp
=
null
;
List
<
Map
<
String
,
Object
>>
tmp
=
null
;
...
@@ -79,7 +80,7 @@ public class SI004INVENTORYSyncOutServiceTask {
...
@@ -79,7 +80,7 @@ public class SI004INVENTORYSyncOutServiceTask {
list
.
addAll
(
tmp
);
list
.
addAll
(
tmp
);
page
.
toNextPage
();
page
.
toNextPage
();
}
while
(
tmp
!=
null
&&
tmp
.
size
()
>
0
);
}
while
(
tmp
!=
null
&&
tmp
.
size
()
>
0
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
datas
=
CollectionUtil
.
toGroupList
(
list
,
"DIS_CODE"
,
"
INVENTORY_DATE
"
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
datas
=
CollectionUtil
.
toGroupList
(
list
,
"DIS_CODE"
,
"
TRACE_NO
"
);
for
(
List
<
Map
<
String
,
Object
>>
vList
:
datas
.
values
())
{
for
(
List
<
Map
<
String
,
Object
>>
vList
:
datas
.
values
())
{
try
{
try
{
this
.
sendData
(
SI004INVENTORYSyncOut
,
vList
);
this
.
sendData
(
SI004INVENTORYSyncOut
,
vList
);
...
@@ -89,17 +90,23 @@ public class SI004INVENTORYSyncOutServiceTask {
...
@@ -89,17 +90,23 @@ public class SI004INVENTORYSyncOutServiceTask {
}
}
}
}
@Transactional
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
sendData
(
SI004INVENTORYSyncOut
SI004INVENTORYSyncOut
,
List
<
Map
<
String
,
Object
>>
vList
)
{
public
void
sendData
(
SI004INVENTORYSyncOut
SI004INVENTORYSyncOut
,
List
<
Map
<
String
,
Object
>>
vList
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
boolean
isSuccess
=
true
;
boolean
isSuccess
=
true
;
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
ZDTSD004INVENTORYSENDING
mt004INVENTORY
=
new
ZDTSD004INVENTORYSENDING
();
ZDTSD004INVENTORYSENDING
mt004INVENTORY
=
new
ZDTSD004INVENTORYSENDING
();
String
message
=
null
;
String
errorMessage
=
null
;
String
traceNo
=
null
;
String
disCode
=
null
;
try
{
try
{
JSONObject
headerObject
=
new
JSONObject
(
vList
.
get
(
0
));
JSONObject
headerObject
=
new
JSONObject
(
vList
.
get
(
0
));
ZDTSD004INVENTORYSENDING
.
RECORD
RECORD
=
new
ZDTSD004INVENTORYSENDING
.
RECORD
();
ZDTSD004INVENTORYSENDING
.
RECORD
RECORD
=
new
ZDTSD004INVENTORYSENDING
.
RECORD
();
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
INVENTORYRECORD
=
new
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
();
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
INVENTORYRECORD
=
new
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
();
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
.
HEADER
INVENTORYRECORD_HEADER
=
new
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
.
HEADER
();
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
.
HEADER
INVENTORYRECORD_HEADER
=
new
ZDTSD004INVENTORYSENDING
.
RECORD
.
INVENTORYRECORD
.
HEADER
();
disCode
=
headerObject
.
getString
(
"DIS_CODE"
);
traceNo
=
headerObject
.
getString
(
"TRACE_NO"
);
INVENTORYRECORD_HEADER
.
setKUNNR
(
headerObject
.
getString
(
"DIS_CODE"
));
INVENTORYRECORD_HEADER
.
setKUNNR
(
headerObject
.
getString
(
"DIS_CODE"
));
INVENTORYRECORD_HEADER
.
setNAME1
(
headerObject
.
getString
(
"DIS_NAME"
));
INVENTORYRECORD_HEADER
.
setNAME1
(
headerObject
.
getString
(
"DIS_NAME"
));
INVENTORYRECORD_HEADER
.
setZDATE
(
headerObject
.
getString
(
"INVENTORY_DATE"
));
INVENTORYRECORD_HEADER
.
setZDATE
(
headerObject
.
getString
(
"INVENTORY_DATE"
));
...
@@ -126,6 +133,8 @@ public class SI004INVENTORYSyncOutServiceTask {
...
@@ -126,6 +133,8 @@ public class SI004INVENTORYSyncOutServiceTask {
jdbcTemplate
.
update
(
updateSql
,
idList
.
toArray
());
jdbcTemplate
.
update
(
updateSql
,
idList
.
toArray
());
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
isSuccess
=
false
;
isSuccess
=
false
;
message
=
ThrowableUtil
.
getThrowableDesc
(
e
);
errorMessage
=
ThrowableUtil
.
getCaused
(
e
).
getMessage
();
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
}
finally
{
try
{
try
{
...
@@ -133,6 +142,11 @@ public class SI004INVENTORYSyncOutServiceTask {
...
@@ -133,6 +142,11 @@ public class SI004INVENTORYSyncOutServiceTask {
}
catch
(
Exception
e1
)
{
}
catch
(
Exception
e1
)
{
logger
.
error
(
timeString
,
e1
);
logger
.
error
(
timeString
,
e1
);
}
}
try
{
common
.
saveOrderTracking
(
traceNo
,
"004_INVENTORY"
,
null
,
disCode
,
"D"
,
(
isSuccess
?
"S"
:
"F"
),
message
,
errorMessage
);
}
catch
(
Throwable
e1
)
{
logger
.
error
(
"追踪数据保存失败"
,
e1
);
}
String
xmlName
=
"Z_DT_SD_004_INVENTORY_SENDING"
;
String
xmlName
=
"Z_DT_SD_004_INVENTORY_SENDING"
;
try
{
try
{
String
xml
=
XMLUtil
.
toXml
(
mt004INVENTORY
);
String
xml
=
XMLUtil
.
toXml
(
mt004INVENTORY
);
...
...
src/main/java/com/egolm/sso/clients/SI_011_ACTUAL_SALES_SyncOutService/SI011ACTUALSALESSyncOutServiceTask.java
View file @
4ae7ba41
...
@@ -15,6 +15,7 @@ import org.springframework.boot.system.ApplicationHome;
...
@@ -15,6 +15,7 @@ import org.springframework.boot.system.ApplicationHome;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -69,7 +70,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
...
@@ -69,7 +70,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
}
}
private
void
sendData
(
SI011ACTUALSALESSyncOut
SI011ACTUALSALESSyncOut
)
{
private
void
sendData
(
SI011ACTUALSALESSyncOut
SI011ACTUALSALESSyncOut
)
{
Page
page
=
new
Page
(
1L
,
1000L
,
new
String
[]
{
"DIS_CODE"
,
"
SALES
_NO"
});
Page
page
=
new
Page
(
1L
,
1000L
,
new
String
[]
{
"DIS_CODE"
,
"
TRACE
_NO"
});
String
sql
=
"SELECT * FROM t_dis_sales WHERE SEND_STATUS = 'N'"
;
String
sql
=
"SELECT * FROM t_dis_sales WHERE SEND_STATUS = 'N'"
;
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<
Map
<
String
,
Object
>>();
List
<
Map
<
String
,
Object
>>
tmp
=
null
;
List
<
Map
<
String
,
Object
>>
tmp
=
null
;
...
@@ -79,7 +80,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
...
@@ -79,7 +80,7 @@ public class SI011ACTUALSALESSyncOutServiceTask {
list
.
addAll
(
tmp
);
list
.
addAll
(
tmp
);
page
.
toNextPage
();
page
.
toNextPage
();
}
while
(
tmp
!=
null
&&
tmp
.
size
()
>
0
);
}
while
(
tmp
!=
null
&&
tmp
.
size
()
>
0
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
datas
=
CollectionUtil
.
toGroupList
(
list
,
"DIS_CODE"
,
"
SALES
_NO"
);
Map
<
String
,
List
<
Map
<
String
,
Object
>>>
datas
=
CollectionUtil
.
toGroupList
(
list
,
"DIS_CODE"
,
"
TRACE
_NO"
);
for
(
List
<
Map
<
String
,
Object
>>
vList
:
datas
.
values
())
{
for
(
List
<
Map
<
String
,
Object
>>
vList
:
datas
.
values
())
{
try
{
try
{
this
.
sendData
(
SI011ACTUALSALESSyncOut
,
vList
);
this
.
sendData
(
SI011ACTUALSALESSyncOut
,
vList
);
...
@@ -89,18 +90,24 @@ public class SI011ACTUALSALESSyncOutServiceTask {
...
@@ -89,18 +90,24 @@ public class SI011ACTUALSALESSyncOutServiceTask {
}
}
}
}
@Transactional
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
sendData
(
SI011ACTUALSALESSyncOut
SI011ACTUALSALESSyncOut
,
List
<
Map
<
String
,
Object
>>
vList
)
{
public
void
sendData
(
SI011ACTUALSALESSyncOut
SI011ACTUALSALESSyncOut
,
List
<
Map
<
String
,
Object
>>
vList
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
boolean
isSuccess
=
true
;
boolean
isSuccess
=
true
;
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
ZDTSD011ACTUALSALESSENDING
mt011ACTUALSALES
=
new
ZDTSD011ACTUALSALESSENDING
();
ZDTSD011ACTUALSALESSENDING
mt011ACTUALSALES
=
new
ZDTSD011ACTUALSALESSENDING
();
String
message
=
null
;
String
errorMessage
=
null
;
String
traceNo
=
null
;
String
disCode
=
null
;
try
{
try
{
ZDTSD011ACTUALSALESSENDING
.
RECORD
RECORD
=
new
ZDTSD011ACTUALSALESSENDING
.
RECORD
();
ZDTSD011ACTUALSALESSENDING
.
RECORD
RECORD
=
new
ZDTSD011ACTUALSALESSENDING
.
RECORD
();
mt011ACTUALSALES
.
setRECORD
(
RECORD
);
mt011ACTUALSALES
.
setRECORD
(
RECORD
);
ZDTSD011ACTUALSALESSENDING
.
RECORD
.
HEADER
header
=
new
ZDTSD011ACTUALSALESSENDING
.
RECORD
.
HEADER
();
ZDTSD011ACTUALSALESSENDING
.
RECORD
.
HEADER
header
=
new
ZDTSD011ACTUALSALESSENDING
.
RECORD
.
HEADER
();
List
<
ZDTSD011ACTUALSALESSENDING
.
RECORD
.
ITEM
>
itemList
=
RECORD
.
getITEM
();
List
<
ZDTSD011ACTUALSALESSENDING
.
RECORD
.
ITEM
>
itemList
=
RECORD
.
getITEM
();
JSONObject
headerObject
=
new
JSONObject
(
vList
.
get
(
0
));
JSONObject
headerObject
=
new
JSONObject
(
vList
.
get
(
0
));
traceNo
=
headerObject
.
getString
(
"TRACE_NO"
);
disCode
=
headerObject
.
getString
(
"DIS_CODE"
);
header
.
setAUBEL
(
headerObject
.
getString
(
"SALES_NO"
));
header
.
setAUBEL
(
headerObject
.
getString
(
"SALES_NO"
));
header
.
setFXSNA
(
headerObject
.
getString
(
"DIS_NAME"
));
header
.
setFXSNA
(
headerObject
.
getString
(
"DIS_NAME"
));
header
.
setFXSNO
(
headerObject
.
getString
(
"DIS_CODE"
));
header
.
setFXSNO
(
headerObject
.
getString
(
"DIS_CODE"
));
...
@@ -133,6 +140,8 @@ public class SI011ACTUALSALESSyncOutServiceTask {
...
@@ -133,6 +140,8 @@ public class SI011ACTUALSALESSyncOutServiceTask {
jdbcTemplate
.
update
(
updateSql
,
idList
.
toArray
());
jdbcTemplate
.
update
(
updateSql
,
idList
.
toArray
());
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
isSuccess
=
false
;
isSuccess
=
false
;
message
=
ThrowableUtil
.
getThrowableDesc
(
e
);
errorMessage
=
ThrowableUtil
.
getCaused
(
e
).
getMessage
();
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
}
finally
{
try
{
try
{
...
@@ -140,6 +149,11 @@ public class SI011ACTUALSALESSyncOutServiceTask {
...
@@ -140,6 +149,11 @@ public class SI011ACTUALSALESSyncOutServiceTask {
}
catch
(
Exception
e1
)
{
}
catch
(
Exception
e1
)
{
logger
.
error
(
timeString
,
e1
);
logger
.
error
(
timeString
,
e1
);
}
}
try
{
common
.
saveOrderTracking
(
traceNo
,
"011_ACTUAL_SALES"
,
null
,
disCode
,
"D"
,
(
isSuccess
?
"S"
:
"F"
),
message
,
errorMessage
);
}
catch
(
Throwable
e1
)
{
logger
.
error
(
"追踪数据保存失败"
,
e1
);
}
String
xmlName
=
"Z_DT_SD_011_ACTUAL_SALES_SENDING"
;
String
xmlName
=
"Z_DT_SD_011_ACTUAL_SALES_SENDING"
;
try
{
try
{
String
xml
=
XMLUtil
.
toXml
(
mt011ACTUALSALES
);
String
xml
=
XMLUtil
.
toXml
(
mt011ACTUALSALES
);
...
...
src/main/java/com/egolm/sso/clients/Z_MI_SD_009_SO_CREATION/ZMISD009SOCREATIONServiceTask.java
View file @
4ae7ba41
...
@@ -14,6 +14,7 @@ import org.springframework.boot.system.ApplicationHome;
...
@@ -14,6 +14,7 @@ import org.springframework.boot.system.ApplicationHome;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.egolm.sso.clients.ServiceFactory
;
import
com.egolm.sso.clients.ServiceFactory
;
...
@@ -78,7 +79,7 @@ public class ZMISD009SOCREATIONServiceTask {
...
@@ -78,7 +79,7 @@ public class ZMISD009SOCREATIONServiceTask {
}
}
}
}
@Transactional
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
sendData
(
ZMISD009SOCREATION
ZMISD009SOCREATION
,
Map
<
String
,
Object
>
headerMap
)
{
public
void
sendData
(
ZMISD009SOCREATION
ZMISD009SOCREATION
,
Map
<
String
,
Object
>
headerMap
)
{
Date
now
=
new
Date
();
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
...
...
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