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
076ea7fe
Commit
076ea7fe
authored
Aug 01, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
bacdd330
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
156 additions
and
59 deletions
+156
-59
ConfirmQuotationServiceImpl.java
...rvices/confirm_quotation/ConfirmQuotationServiceImpl.java
+19
-5
DNDeletionServiceImpl.java
...egolm/sso/services/dn_deletion/DNDeletionServiceImpl.java
+16
-3
MaterialMasterServiceImpl.java
...o/services/material_master/MaterialMasterServiceImpl.java
+15
-3
PrformaInvoiceServiceImpl.java
...o/services/prforma_invoice/PrformaInvoiceServiceImpl.java
+15
-3
PriceListServiceImpl.java
...m/egolm/sso/services/price_list/PriceListServiceImpl.java
+15
-3
ShippingNotificationServiceImpl.java
...hipping_notfirmation/ShippingNotificationServiceImpl.java
+16
-3
ZMISD009SOCREATIONTask.java
...ava/com/schneider_distributor/ZMISD009SOCREATIONTask.java
+60
-39
No files found.
src/main/java/com/egolm/sso/services/confirm_quotation/ConfirmQuotationServiceImpl.java
View file @
076ea7fe
...
...
@@ -54,7 +54,10 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapsoconfirmquotation"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
);
Long
time
=
now
.
getTime
();
String
KUNNR
=
null
;
String
VBELN
=
null
;
try
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
RESPONSE
res
=
Z_MT_SD_008_SO_CONFIRM_QUOTATION
.
getRESPONSE
();
...
...
@@ -65,10 +68,10 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
header
.
put
(
"MSGTXT"
,
MESSAGE
.
getMSGTXT
());
}
if
(
h
!=
null
)
{
String
KUNNR
=
h
.
getKUNNR
();
KUNNR
=
h
.
getKUNNR
();
VBELN
=
h
.
getVBELN
();
header
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
header
.
put
(
"VBELN"
,
h
.
getVBELN
()
);
header
.
put
(
"VBELN"
,
VBELN
);
header
.
put
(
"VKORG"
,
h
.
getVKORG
());
header
.
put
(
"VTWEG"
,
h
.
getVTWEG
());
header
.
put
(
"SPART"
,
h
.
getSPART
());
...
...
@@ -102,7 +105,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
String
idIndex
=
StringUtil
.
getIndex
(
"T_SO_CONFIRMATION_HEADER_ID"
);
Long
hID
=
Long
.
valueOf
(
time
+
idIndex
);
header
.
put
(
"ID"
,
hID
);
header
.
put
(
"TRACE_NO"
,
"sapsoconfirmquotation"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
)
);
header
.
put
(
"TRACE_NO"
,
TRACE_NO
);
insertTo
(
header
,
"t_so_confirmation_header"
);
List
<
ITEM_DATA
>
ids
=
res
.
getITEM_DATA
();
Map
<
String
,
Map
<
String
,
Object
>>
itemDatas
=
new
HashMap
<>();
...
...
@@ -163,8 +166,20 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
}
}
}
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/confirm_quotation"
,
"SUCCESS"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"SoConfirmQuotation"
,
VBELN
,
KUNNR
,
"U"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/confirm_quotation"
,
"ERROR"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"SoConfirmQuotation"
,
VBELN
,
KUNNR
,
"U"
,
"ERROR"
,
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
String
xmlName
=
Z_MT_SD_008_SO_CONFIRM_QUOTATION
.
getClass
().
getSimpleName
();
...
...
@@ -174,7 +189,6 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_008_SO_CONFIRM_QUOTATION
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/confirm_quotation"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/dn_deletion/DNDeletionServiceImpl.java
View file @
076ea7fe
...
...
@@ -48,10 +48,12 @@ public class DNDeletionServiceImpl implements DNDeletionService {
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapsodndeletion"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
);
String
SOLD_TO
=
null
;
try
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
ID
=
Long
.
valueOf
(
""
+
System
.
currentTimeMillis
()
+
StringUtil
.
getIndex
(
"T_SO_DN_DELETION_ID"
));
S
tring
S
OLD_TO
=
DELETED_DOCUMENTS
.
getSOLD_TO
();
SOLD_TO
=
DELETED_DOCUMENTS
.
getSOLD_TO
();
map
.
put
(
"ID"
,
ID
);
map
.
put
(
"MESSAGE_ID"
,
DELETED_DOCUMENTS
.
getMSGID
());
map
.
put
(
"TARGET_SYSTEM"
,
DELETED_DOCUMENTS
.
getTARGET_SYSTEM
());
...
...
@@ -65,7 +67,7 @@ public class DNDeletionServiceImpl implements DNDeletionService {
throw
new
XRException
(
"Unable to generate batch number, [SOLD_TO] cannot be empty"
);
}
map
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_SO_DN_DELETION_BATCH_"
+
SOLD_TO
));
map
.
put
(
"TRACE_NO"
,
"sapsodndeletion"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
)
);
map
.
put
(
"TRACE_NO"
,
TRACE_NO
);
map
.
put
(
"SEND_STATUS"
,
"N"
);
map
.
put
(
"CREATED"
,
now
);
map
.
put
(
"CREATEBY"
,
systemId
);
...
...
@@ -73,8 +75,20 @@ public class DNDeletionServiceImpl implements DNDeletionService {
map
.
put
(
"UPDATEBY"
,
systemId
);
Sql
headerSql
=
SqlUtil
.
insertSql
(
"t_so_dn_deletion"
,
map
);
jdbcTemplate
.
update
(
headerSql
.
getSql
(),
headerSql
.
getArgs
());
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/dn_deletion"
,
"SUCCESS"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"SODNDeletion"
,
null
,
SOLD_TO
,
"U"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/dn_deletion"
,
"ERROR"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"SODNDeletion"
,
null
,
SOLD_TO
,
"U"
,
"ERROR"
,
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
String
xmlName
=
DELETED_DOCUMENTS
.
getClass
().
getSimpleName
();
...
...
@@ -84,7 +98,6 @@ public class DNDeletionServiceImpl implements DNDeletionService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
DELETED_DOCUMENTS
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/dn_deletion"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/material_master/MaterialMasterServiceImpl.java
View file @
076ea7fe
...
...
@@ -51,10 +51,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
boolean
isSuccess
=
true
;
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_001_MATERIAL_MASTER
));
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapmaterialmaster"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
);
String
DIS_CODE
=
null
;
try
{
RECORD
RECORD
=
Z_MT_SD_001_MATERIAL_MASTER
.
getRECORD
();
HEADER_SENDING
HEADER_SENDING
=
RECORD
.
getHEADER_SENDING
();
String
DIS_CODE
=
null
;
String
DATUM
=
null
;
String
UZEIT
=
null
;
if
(
HEADER_SENDING
!=
null
)
{
...
...
@@ -110,7 +111,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
goods
.
put
(
"MEABM_B"
,
item
.
getMEABM_B
());
goods
.
put
(
"PUBLIC"
,
item
.
getPUBLIC
());
goods
.
put
(
"INTERNET"
,
item
.
getINTERNET
());
goods
.
put
(
"TRACE_NO"
,
"sapmaterialmaster"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
)
);
goods
.
put
(
"TRACE_NO"
,
TRACE_NO
);
goods
.
put
(
"BATCH"
,
BATCH
);
goods
.
put
(
"SEND_STATUS"
,
"N"
);
if
(
goods
.
get
(
"ID"
)
!=
null
)
{
...
...
@@ -121,8 +122,20 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
}
}
}
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/material_master"
,
"SUCCESS"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"MaterialMaster"
,
null
,
DIS_CODE
,
"U"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/material_master"
,
"ERROR"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"MaterialMaster"
,
null
,
DIS_CODE
,
"U"
,
"ERROR"
,
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
String
xmlName
=
Z_MT_SD_001_MATERIAL_MASTER
.
getClass
().
getSimpleName
();
...
...
@@ -132,7 +145,6 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_001_MATERIAL_MASTER
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/material_master"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/prforma_invoice/PrformaInvoiceServiceImpl.java
View file @
076ea7fe
...
...
@@ -63,6 +63,8 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapproformainvoice"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
);
String
BATCH_CODE
=
null
;
try
{
Map
<
String
,
Object
>
headMap
=
new
HashMap
<
String
,
Object
>();
Z_DT_SD_005_PERFORM_INVOICE
Z_DT_SD_005_PERFORM_INVOICE
=
Z_MT_SD_005_PERFORM_INVOICE
.
getZ_DT_SD_005_PERFORM_INVOICE
();
...
...
@@ -80,7 +82,6 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
headMap
.
put
(
"GENERAL_BELNR"
,
HEADER_GENERAL_DATA
.
getBELNR
());
headMap
.
put
(
"GENERAL_ZTERM"
,
HEADER_GENERAL_DATA
.
getZTERM
());
}
String
BATCH_CODE
=
null
;
if
(
partnerList
!=
null
)
{
for
(
HEADER_PARTNER_DATA
HEADER_PARTNER_DATA
:
partnerList
)
{
if
(
HEADER_PARTNER_DATA
!=
null
)
{
...
...
@@ -156,7 +157,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
throw
new
XRException
(
"Unable to generate batch number, [PARTN] cannot be empty"
);
}
headMap
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_PERFORM_INVOICE_HEADER_BATCH_"
+
BATCH_CODE
));
headMap
.
put
(
"TRACE_NO"
,
"sapproformainvoice"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
)
);
headMap
.
put
(
"TRACE_NO"
,
TRACE_NO
);
headMap
.
put
(
"CREATED"
,
now
);
headMap
.
put
(
"CREATEBY"
,
systemId
);
...
...
@@ -248,8 +249,20 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
jdbcTemplate
.
update
(
headerSql
.
getSql
(),
headerSql
.
getArgs
());
Sql
itemDataSql
=
SqlUtil
.
insertSqlBatch
(
"t_perform_invoice_item_data"
,
itemDatas
);
jdbcTemplate
.
batchUpdate
(
itemDataSql
.
getSql
(),
itemDataSql
.
getBachArgs
());
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/prforma_invoice"
,
"SUCCESS"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"ProFormaInvoice"
,
null
,
BATCH_CODE
,
"U"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/prforma_invoice"
,
"ERROR"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"ProFormaInvoice"
,
null
,
BATCH_CODE
,
"U"
,
"ERROR"
,
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
String
xmlName
=
Z_MT_SD_005_PERFORM_INVOICE
.
getClass
().
getSimpleName
();
...
...
@@ -259,7 +272,6 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_005_PERFORM_INVOICE
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/prforma_invoice"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/price_list/PriceListServiceImpl.java
View file @
076ea7fe
...
...
@@ -51,13 +51,14 @@ public class PriceListServiceImpl implements PriceListService {
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sappricelist"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
);
String
KUNNR
=
null
;
try
{
RECORD
r
=
Z_MT_SD_002_PRICE_LIST
.
getRECORD
();
if
(
r
!=
null
)
{
HEADER_SENDING
h
=
r
.
getHEADER_SENDING
();
List
<
ITEM
>
items
=
r
.
getITEM
();
String
KUNNR
=
null
;
String
DATUM
=
null
;
String
UZEIT
=
null
;
if
(
h
!=
null
)
{
...
...
@@ -93,7 +94,7 @@ public class PriceListServiceImpl implements PriceListService {
priceObj
.
put
(
"PLINE"
,
item
.
getPLINE
());
priceObj
.
put
(
"PRSCH_1"
,
StringUtil
.
toDouble
(
item
.
getPRSCH_1
()));
priceObj
.
put
(
"SEND_STATUS"
,
"N"
);
priceObj
.
put
(
"TRACE_NO"
,
"sappricelist"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
)
);
priceObj
.
put
(
"TRACE_NO"
,
TRACE_NO
);
priceObj
.
put
(
"BATCH"
,
BATCH
);
if
(
priceObj
.
get
(
"ID"
)
!=
null
)
{
updatePriceObj
(
priceObj
);
...
...
@@ -104,8 +105,20 @@ public class PriceListServiceImpl implements PriceListService {
}
}
}
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/price_list"
,
"SUCCESS"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"PriceList"
,
null
,
KUNNR
,
"U"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/price_list"
,
"ERROR"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"PriceList"
,
null
,
KUNNR
,
"U"
,
"ERROR"
,
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
String
xmlName
=
Z_MT_SD_002_PRICE_LIST
.
getClass
().
getSimpleName
();
...
...
@@ -115,7 +128,6 @@ public class PriceListServiceImpl implements PriceListService {
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_002_PRICE_LIST
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/price_list"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/egolm/sso/services/shipping_notfirmation/ShippingNotificationServiceImpl.java
View file @
076ea7fe
...
...
@@ -58,13 +58,15 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
Long
time
=
now
.
getTime
();
String
TRACE_NO
=
"sapshippingnotification"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
);
String
BATCH_CODE
=
null
;
try
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE
=
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
.
getZ_DT_SD_007_SHIPPING_NOTIFICATION_FILE
();
if
(
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE
!=
null
)
{
HEADER_DELIVERY
HEADER_DELIVERY
=
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE
.
getHEADER_DELIVERY
();
if
(
HEADER_DELIVERY
!=
null
)
{
String
BATCH_CODE
=
null
;
header
.
put
(
"DELIVERY_VBELN"
,
HEADER_DELIVERY
.
getVBELN
());
header
.
put
(
"DELIVERY_LFART"
,
HEADER_DELIVERY
.
getLFART
());
header
.
put
(
"DELIVERY_INCO1"
,
HEADER_DELIVERY
.
getINCO1
());
...
...
@@ -114,7 +116,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
}
header
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_HEADER_BATCH_"
+
BATCH_CODE
));
header
.
put
(
"SEND_STATUS"
,
"N"
);
header
.
put
(
"TRACE_NO"
,
"sapshippingnotification"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
)
);
header
.
put
(
"TRACE_NO"
,
TRACE_NO
);
header
.
put
(
"CREATED"
,
now
);
header
.
put
(
"CREATEBY"
,
systemId
);
Long
hID
=
Long
.
valueOf
(
time
+
StringUtil
.
getIndex
(
"T_SHIPPING_NOTIFICATION_HEADER_ID"
));
...
...
@@ -172,8 +174,20 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
}
}
}
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/shipping_notfirmation"
,
"SUCCESS"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"ShippingNotification"
,
null
,
BATCH_CODE
,
"U"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
try
{
common
.
saveApiAccessLog
(
"execute"
,
"/shipping_notfirmation"
,
"ERROR"
);
common
.
saveOrderTracking
(
TRACE_NO
,
"ShippingNotification"
,
null
,
BATCH_CODE
,
"U"
,
"ERROR"
,
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
()
+
" -- "
+
timeString
,
e
);
}
finally
{
String
xmlName
=
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
.
getClass
().
getSimpleName
();
...
...
@@ -183,7 +197,6 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
FileUtil
.
writeText
(
xmlFullName
,
xml
);
String
json
=
new
Gson
().
toJson
(
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
);
FileUtil
.
writeText
(
xmlFullName
+
".JSON"
,
json
);
common
.
saveApiAccessLog
(
"execute"
,
"/shipping_notfirmation"
,
isSuccess
?
"SUCCESS"
:
"ERROR"
);
}
catch
(
Exception
e
)
{
throw
new
XRException
(
ThrowableUtil
.
getCaused
(
e
).
getMessage
(),
e
);
}
...
...
src/main/java/com/schneider_distributor/ZMISD009SOCREATIONTask.java
View file @
076ea7fe
...
...
@@ -9,11 +9,13 @@ import java.util.Map;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.system.ApplicationHome
;
import
org.springframework.dao.DataAccessException
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.egolm.sso.services.CommonService
;
import
com.egolm.sso.util.ServiceFactory
;
import
com.schneider_distributor.ZDTSD009SOCREATION.Header
;
import
com.schneider_distributor.ZDTSD009SOCREATION.ITEM
;
...
...
@@ -24,6 +26,9 @@ public class ZMISD009SOCREATIONTask {
@Autowired
private
JdbcTemplate
jdbcTemplate
;
@Autowired
private
CommonService
common
;
@Value
(
"${schneider.username}"
)
private
String
username
;
...
...
@@ -54,49 +59,65 @@ public class ZMISD009SOCREATIONTask {
List
<
Map
<
String
,
Object
>>
headerList
=
jdbcTemplate
.
queryForList
(
"SELECT * FROM t_so_creation_header WHERE SEND_STATUS = ? LIMIT ?"
,
"N"
,
1
);
if
(
headerList
.
size
()
>
0
)
{
for
(
Map
<
String
,
Object
>
headerMap
:
headerList
)
{
ZDTSD009SOCREATION
ZDTSD009SOCREATIONBean
=
new
ZDTSD009SOCREATION
();
Header
header
=
new
Header
();
Long
ID
=
(
Long
)
headerMap
.
get
(
"ID"
);
String
BSTKD_E
=
(
String
)
headerMap
.
get
(
"BSTKD_E"
);
String
VBELN
=
(
String
)
headerMap
.
get
(
"VBELN"
);
Date
BSTDK
=
(
Date
)
headerMap
.
get
(
"BSTDK"
);
String
TRACE_NO
=
(
String
)
headerMap
.
get
(
"TRACE_NO"
);
String
KUNNR
=
(
String
)
headerMap
.
get
(
"KUNNR"
);
String
KGNNR
=
(
String
)
headerMap
.
get
(
"KGNNR"
);
String
QTFLAG
=
(
String
)
headerMap
.
get
(
"QTFLAG"
);
header
.
setBSTKDE
(
BSTKD_E
);
header
.
setVBELN
(
VBELN
);
header
.
setKUNNR
(
KUNNR
);
header
.
setKGNNR
(
KGNNR
);
header
.
setQTFLAG
(
QTFLAG
);
if
(
BSTDK
!=
null
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
header
.
setBSTDK
(
format
.
format
(
BSTDK
));
}
ZDTSD009SOCREATIONBean
.
setHeader
(
header
);
List
<
Map
<
String
,
Object
>>
itemList
=
jdbcTemplate
.
queryForList
(
"SELECT * FROM t_so_creation_item WHERE HEADER_ID = ?"
,
ID
);
for
(
Map
<
String
,
Object
>
itemMap
:
itemList
)
{
String
POSNR
=
(
String
)
itemMap
.
get
(
"POSNR"
);
String
VTEXT
=
(
String
)
itemMap
.
get
(
"VTEXT"
);
String
MATNR
=
(
String
)
itemMap
.
get
(
"MATNR"
);
Integer
KWMENG
=
(
Integer
)
itemMap
.
get
(
"KWMENG"
);
Date
EDATU
=
(
Date
)
itemMap
.
get
(
"EDATU"
);
ITEM
item
=
new
ITEM
();
item
.
setPOSNR
(
POSNR
);
item
.
setVTEXT
(
VTEXT
);
item
.
setMATNR
(
MATNR
);
if
(
KWMENG
!=
null
)
{
item
.
setKWMENG
(
KWMENG
.
toString
());
}
if
(
EDATU
!=
null
)
{
try
{
ZDTSD009SOCREATION
ZDTSD009SOCREATIONBean
=
new
ZDTSD009SOCREATION
();
Header
header
=
new
Header
();
Long
ID
=
(
Long
)
headerMap
.
get
(
"ID"
);
String
BSTKD_E
=
(
String
)
headerMap
.
get
(
"BSTKD_E"
);
String
VBELN
=
(
String
)
headerMap
.
get
(
"VBELN"
);
Date
BSTDK
=
(
Date
)
headerMap
.
get
(
"BSTDK"
);
String
KGNNR
=
(
String
)
headerMap
.
get
(
"KGNNR"
);
String
QTFLAG
=
(
String
)
headerMap
.
get
(
"QTFLAG"
);
header
.
setBSTKDE
(
BSTKD_E
);
header
.
setVBELN
(
VBELN
);
header
.
setKUNNR
(
KUNNR
);
header
.
setKGNNR
(
KGNNR
);
header
.
setQTFLAG
(
QTFLAG
);
if
(
BSTDK
!=
null
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
item
.
setEDATU
(
format
.
format
(
EDATU
));
header
.
setBSTDK
(
format
.
format
(
BSTDK
));
}
ZDTSD009SOCREATIONBean
.
setHeader
(
header
);
List
<
Map
<
String
,
Object
>>
itemList
=
jdbcTemplate
.
queryForList
(
"SELECT * FROM t_so_creation_item WHERE HEADER_ID = ?"
,
ID
);
for
(
Map
<
String
,
Object
>
itemMap
:
itemList
)
{
String
POSNR
=
(
String
)
itemMap
.
get
(
"POSNR"
);
String
VTEXT
=
(
String
)
itemMap
.
get
(
"VTEXT"
);
String
MATNR
=
(
String
)
itemMap
.
get
(
"MATNR"
);
Integer
KWMENG
=
(
Integer
)
itemMap
.
get
(
"KWMENG"
);
Date
EDATU
=
(
Date
)
itemMap
.
get
(
"EDATU"
);
ITEM
item
=
new
ITEM
();
item
.
setPOSNR
(
POSNR
);
item
.
setVTEXT
(
VTEXT
);
item
.
setMATNR
(
MATNR
);
if
(
KWMENG
!=
null
)
{
item
.
setKWMENG
(
KWMENG
.
toString
());
}
if
(
EDATU
!=
null
)
{
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
item
.
setEDATU
(
format
.
format
(
EDATU
));
}
ZDTSD009SOCREATIONBean
.
getITEM
().
add
(
item
);
}
ZMISD009SOCREATION
.
zMISD009SOCREATION
(
ZDTSD009SOCREATIONBean
);
jdbcTemplate
.
update
(
"UPDATE t_so_creation_header SET SEND_STATUS = 'Y', SEND_TIME = NOW() WHERE ID = ?"
,
ID
);
try
{
common
.
saveOrderTracking
(
TRACE_NO
,
"SoCreation"
,
null
,
KUNNR
,
"D"
,
"SUCCESS"
,
null
);
}
catch
(
Throwable
e
)
{
e
.
printStackTrace
();
}
}
catch
(
DataAccessException
e
)
{
e
.
printStackTrace
();
try
{
common
.
saveOrderTracking
(
TRACE_NO
,
"SoCreation"
,
null
,
KUNNR
,
"D"
,
"ERROR"
,
null
);
}
catch
(
Throwable
e1
)
{
e1
.
printStackTrace
();
}
ZDTSD009SOCREATIONBean
.
getITEM
().
add
(
item
);
}
ZMISD009SOCREATION
.
zMISD009SOCREATION
(
ZDTSD009SOCREATIONBean
);
jdbcTemplate
.
update
(
"UPDATE t_so_creation_header SET SEND_STATUS = 'Y', SEND_TIME = NOW() WHERE ID = ?"
,
ID
);
}
}
}
...
...
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