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
5e2e8868
Commit
5e2e8868
authored
Jul 26, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
02948f7d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
197 additions
and
184 deletions
+197
-184
MaterialMasterServiceImpl.java
...o/services/material_master/MaterialMasterServiceImpl.java
+58
-64
PriceListServiceImpl.java
...m/egolm/sso/services/price_list/PriceListServiceImpl.java
+49
-40
ShippingNotificationServiceImpl.java
...hipping_notfirmation/ShippingNotificationServiceImpl.java
+90
-80
No files found.
src/main/java/com/egolm/sso/services/material_master/MaterialMasterServiceImpl.java
View file @
5e2e8868
...
...
@@ -50,75 +50,69 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
try
{
RECORD
RECORD
=
Z_MT_SD_001_MATERIAL_MASTER
.
getRECORD
();
HEADER_SENDING
h
=
RECORD
.
getHEADER_SENDING
();
String
DIS_CODE
=
h
.
getKUNNR
();
String
DATUM
=
h
.
getDATUM
();
String
UZEIT
=
h
.
getUZEIT
();
String
DIS_CODE
=
null
;
String
DATUM
=
null
;
String
UZEIT
=
null
;
if
(
h
!=
null
)
{
DIS_CODE
=
h
.
getKUNNR
();
DATUM
=
h
.
getDATUM
();
UZEIT
=
h
.
getUZEIT
();
}
List
<
ITEM
>
items
=
RECORD
.
getITEM
();
for
(
ITEM
item
:
items
)
{
String
GOODS_CODE
=
item
.
getMATNR
();
Map
<
String
,
Object
>
goods
=
getGoods
(
DIS_CODE
,
GOODS_CODE
);
if
(
goods
==
null
)
{
goods
=
new
HashMap
<>();
}
goods
.
put
(
"DIS_CODE"
,
DIS_CODE
);
goods
.
put
(
"DATUM"
,
DateUtil
.
parseDate
(
DATUM
,
DateUtil
.
FMT_DATE
));
goods
.
put
(
"UZEIT"
,
DateUtil
.
parseDate
(
UZEIT
,
DateUtil
.
FMT_TIME
));
goods
.
put
(
"GOODS_CODE"
,
GOODS_CODE
);
goods
.
put
(
"ROUGH_WEIGHT"
,
Double
.
valueOf
(
item
.
getBRGEW
()));
goods
.
put
(
"NET_WEIGHT"
,
Double
.
valueOf
(
item
.
getNTGEW
()));
goods
.
put
(
"WETGHT_UNIT"
,
item
.
getGEWEI
());
goods
.
put
(
"CATEGORY_CODE"
,
item
.
getPLINE
());
goods
.
put
(
"CREATION_DATE"
,
DateUtil
.
parseDate
(
item
.
getERSDA
(),
DateUtil
.
FMT_DATE
));
goods
.
put
(
"LAST_CHANGE_DATE"
,
DateUtil
.
parseDate
(
item
.
getLAEDA
(),
DateUtil
.
FMT_DATE
));
goods
.
put
(
"GOODS_NAME"
,
item
.
getNORMT
());
goods
.
put
(
"PRODUCTION_LINE_CODE"
,
item
.
getLIFNR
());
goods
.
put
(
"VMSTA"
,
item
.
getVMSTA
());
goods
.
put
(
"MSTAV"
,
item
.
getMSTAV
());
goods
.
put
(
"STKTYP"
,
item
.
getSTKTYP
());
goods
.
put
(
"SPEC"
,
item
.
getUMREZ
());
if
(
items
!=
null
)
{
for
(
ITEM
item
:
items
)
{
String
GOODS_CODE
=
item
.
getMATNR
();
Map
<
String
,
Object
>
goods
=
getGoods
(
DIS_CODE
,
GOODS_CODE
);
if
(
goods
==
null
)
{
goods
=
new
HashMap
<>();
}
goods
.
put
(
"DIS_CODE"
,
DIS_CODE
);
goods
.
put
(
"DATUM"
,
DateUtil
.
parseDate
(
DATUM
,
DateUtil
.
FMT_DATE
));
goods
.
put
(
"UZEIT"
,
DateUtil
.
parseDate
(
UZEIT
,
DateUtil
.
FMT_TIME
));
goods
.
put
(
"GOODS_CODE"
,
GOODS_CODE
);
goods
.
put
(
"ROUGH_WEIGHT"
,
Double
.
valueOf
(
item
.
getBRGEW
()));
goods
.
put
(
"NET_WEIGHT"
,
Double
.
valueOf
(
item
.
getNTGEW
()));
goods
.
put
(
"WETGHT_UNIT"
,
item
.
getGEWEI
());
goods
.
put
(
"CATEGORY_CODE"
,
item
.
getPLINE
());
goods
.
put
(
"CREATION_DATE"
,
DateUtil
.
parseDate
(
item
.
getERSDA
(),
DateUtil
.
FMT_DATE
));
goods
.
put
(
"LAST_CHANGE_DATE"
,
DateUtil
.
parseDate
(
item
.
getLAEDA
(),
DateUtil
.
FMT_DATE
));
goods
.
put
(
"GOODS_NAME"
,
item
.
getNORMT
());
goods
.
put
(
"PRODUCTION_LINE_CODE"
,
item
.
getLIFNR
());
goods
.
put
(
"VMSTA"
,
item
.
getVMSTA
());
goods
.
put
(
"MSTAV"
,
item
.
getMSTAV
());
goods
.
put
(
"STKTYP"
,
item
.
getSTKTYP
());
goods
.
put
(
"SPEC"
,
item
.
getUMREZ
());
goods
.
put
(
"GOODS_NAME_EN"
,
item
.
getNORMT_EN
());
goods
.
put
(
"AUMNG"
,
item
.
getAUMNG
());
goods
.
put
(
"VRKME"
,
item
.
getVRKME
());
goods
.
put
(
"BASE_UNIT"
,
item
.
getMEINS
());
goods
.
put
(
"STATISTICS_UNIT"
,
item
.
getSCHME
());
// (统计单位--》发货单位)
goods
.
put
(
"LAENG"
,
item
.
getLAENG
());
goods
.
put
(
"BREIT"
,
item
.
getBREIT
());
goods
.
put
(
"HOEHE"
,
item
.
getHOEHE
());
goods
.
put
(
"MEABM"
,
item
.
getMEABM
());
goods
.
put
(
"LAENG_B"
,
item
.
getLAENG_B
());
goods
.
put
(
"BREIT_B"
,
item
.
getBREIT_B
());
goods
.
put
(
"HOEHE_B"
,
item
.
getHOEHE_B
());
goods
.
put
(
"MEABM_B"
,
item
.
getMEABM_B
());
goods
.
put
(
"PUBLIC"
,
item
.
getPUBLIC
());
goods
.
put
(
"INTERNET"
,
item
.
getINTERNET
());
goods
.
put
(
"GOODS_NAME_EN"
,
item
.
getNORMT_EN
());
goods
.
put
(
"AUMNG"
,
item
.
getAUMNG
());
goods
.
put
(
"VRKME"
,
item
.
getVRKME
());
goods
.
put
(
"BASE_UNIT"
,
item
.
getMEINS
());
goods
.
put
(
"STATISTICS_UNIT"
,
item
.
getSCHME
());
// (统计单位--》发货单位)
goods
.
put
(
"LAENG"
,
item
.
getLAENG
());
goods
.
put
(
"BREIT"
,
item
.
getBREIT
());
goods
.
put
(
"HOEHE"
,
item
.
getHOEHE
());
goods
.
put
(
"MEABM"
,
item
.
getMEABM
());
goods
.
put
(
"LAENG_B"
,
item
.
getLAENG_B
());
goods
.
put
(
"BREIT_B"
,
item
.
getBREIT_B
());
goods
.
put
(
"HOEHE_B"
,
item
.
getHOEHE_B
());
goods
.
put
(
"MEABM_B"
,
item
.
getMEABM_B
());
goods
.
put
(
"PUBLIC"
,
item
.
getPUBLIC
());
goods
.
put
(
"INTERNET"
,
item
.
getINTERNET
());
/*
goods.put("CATEGORY_NAME", "");// 品类名称
goods.put("PRODUCTION_LINE_CODE", "");// 产线(产地)编码
goods.put("PRODUCTION_LINE_NAME", "");// 产线(产地)名称
goods.put("MSTAV", "");// 停产标志2
goods.put("BARCODE", "");// 物料条码
goods.put("TAX_RATE", 0);// 税率
goods.put("GOODS_KEY", "");// 物料唯一码
goods.put("SEND_TIME", now);// 发送时间
goods.put("DIS_UPDATE_STATUS", "N");// 分销商更新结果(Y成功,N失败)
*/
Long
BATCHID
=
common
.
getNextval
(
dateString
+
"T_VEN_GOODS_BATCH_"
+
dateString
);
String
BATCH
=
dateString
+
"-"
+
BATCHID
;
goods
.
put
(
"TRACE_NO"
,
"sapmaterialmaster"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
goods
.
put
(
"BATCH"
,
BATCH
);
goods
.
put
(
"SEND_STATUS"
,
"N"
);
Long
BATCHID
=
common
.
getNextval
(
dateString
+
"T_VEN_GOODS_BATCH_"
+
dateString
);
String
BATCH
=
dateString
+
"-"
+
BATCHID
;
goods
.
put
(
"TRACE_NO"
,
"sapmaterialmaster"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
goods
.
put
(
"BATCH"
,
BATCH
);
goods
.
put
(
"SEND_STATUS"
,
"N"
);
if
(
goods
.
get
(
"ID"
)
!=
null
)
{
updateGoods
(
goods
);
}
else
{
insertGoods
(
goods
);
if
(
goods
.
get
(
"ID"
)
!=
null
)
{
updateGoods
(
goods
);
}
else
{
insertGoods
(
goods
);
}
}
}
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/egolm/sso/services/price_list/PriceListServiceImpl.java
View file @
5e2e8868
...
...
@@ -49,48 +49,57 @@ public class PriceListServiceImpl implements PriceListService {
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_002_PRICE_LIST
));
try
{
RECORD
r
=
Z_MT_SD_002_PRICE_LIST
.
getRECORD
();
HEADER_SENDING
h
=
r
.
getHEADER_SENDING
();
List
<
ITEM
>
items
=
r
.
getITEM
();
String
KUNNR
=
h
.
getKUNNR
();
String
DATUM
=
h
.
getDATUM
();
String
UZEIT
=
h
.
getUZEIT
();
for
(
ITEM
item
:
items
)
{
String
MATNR
=
item
.
getMATNR
();
Map
<
String
,
Object
>
priceObj
=
getPriceObj
(
KUNNR
,
MATNR
);
if
(
priceObj
==
null
)
{
priceObj
=
new
HashMap
<>();
}
priceObj
.
put
(
"KUNNR"
,
KUNNR
);
priceObj
.
put
(
"DATUM"
,
DateUtil
.
parseDate
(
DATUM
,
DateUtil
.
FMT_DATE
));
priceObj
.
put
(
"UZEIT"
,
DateUtil
.
parseDate
(
UZEIT
,
DateUtil
.
FMT_TIME
));
priceObj
.
put
(
"MATNR"
,
MATNR
);
if
(
r
!=
null
)
{
HEADER_SENDING
h
=
r
.
getHEADER_SENDING
();
List
<
ITEM
>
items
=
r
.
getITEM
();
priceObj
.
put
(
"KBETR"
,
StringUtil
.
toDouble
(
item
.
getKBETR
()));
priceObj
.
put
(
"KONWA"
,
item
.
getKONWA
());
priceObj
.
put
(
"KPEIN"
,
item
.
getKPEIN
());
priceObj
.
put
(
"KMEIN"
,
item
.
getKMEIN
());
priceObj
.
put
(
"UMREZ"
,
item
.
getUMREZ
());
priceObj
.
put
(
"MAKTX"
,
item
.
getMAKTX
());
priceObj
.
put
(
"PRSCH"
,
StringUtil
.
toDouble
(
item
.
getPRSCH
()));
priceObj
.
put
(
"DATAM"
,
DateUtil
.
parseDate
(
item
.
getDATAM
(),
DateUtil
.
FMT_DATE
));
priceObj
.
put
(
"DATBI"
,
DateUtil
.
parseDateNoEmpty
(
item
.
getDATBI
(),
DateUtil
.
FMT_DATE
));
priceObj
.
put
(
"PLINE"
,
item
.
getPLINE
());
priceObj
.
put
(
"PRSCH_1"
,
StringUtil
.
toDouble
(
item
.
getPRSCH_1
()));
/*
priceObj.put("SEND_DATE", new Date(0));// 发送时间
*/
priceObj
.
put
(
"SEND_STATUS"
,
"N"
);
Long
BATCHID
=
common
.
getNextval
(
"T_PRICE_LIST_BATCH_"
+
dateString
);
String
BATCH
=
dateString
+
"-"
+
BATCHID
;
String
KUNNR
=
null
;
String
DATUM
=
null
;
String
UZEIT
=
null
;
if
(
h
!=
null
)
{
KUNNR
=
h
.
getKUNNR
();
DATUM
=
h
.
getDATUM
();
UZEIT
=
h
.
getUZEIT
();
}
if
(
items
!=
null
)
{
for
(
ITEM
item
:
items
)
{
String
MATNR
=
item
.
getMATNR
();
Map
<
String
,
Object
>
priceObj
=
getPriceObj
(
KUNNR
,
MATNR
);
if
(
priceObj
==
null
)
{
priceObj
=
new
HashMap
<>();
}
priceObj
.
put
(
"KUNNR"
,
KUNNR
);
priceObj
.
put
(
"DATUM"
,
DateUtil
.
parseDate
(
DATUM
,
DateUtil
.
FMT_DATE
));
priceObj
.
put
(
"UZEIT"
,
DateUtil
.
parseDate
(
UZEIT
,
DateUtil
.
FMT_TIME
));
priceObj
.
put
(
"MATNR"
,
MATNR
);
priceObj
.
put
(
"KBETR"
,
StringUtil
.
toDouble
(
item
.
getKBETR
()));
priceObj
.
put
(
"KONWA"
,
item
.
getKONWA
());
priceObj
.
put
(
"KPEIN"
,
item
.
getKPEIN
());
priceObj
.
put
(
"KMEIN"
,
item
.
getKMEIN
());
priceObj
.
put
(
"UMREZ"
,
item
.
getUMREZ
());
priceObj
.
put
(
"MAKTX"
,
item
.
getMAKTX
());
priceObj
.
put
(
"PRSCH"
,
StringUtil
.
toDouble
(
item
.
getPRSCH
()));
priceObj
.
put
(
"DATAM"
,
DateUtil
.
parseDate
(
item
.
getDATAM
(),
DateUtil
.
FMT_DATE
));
priceObj
.
put
(
"DATBI"
,
DateUtil
.
parseDateNoEmpty
(
item
.
getDATBI
(),
DateUtil
.
FMT_DATE
));
priceObj
.
put
(
"PLINE"
,
item
.
getPLINE
());
priceObj
.
put
(
"PRSCH_1"
,
StringUtil
.
toDouble
(
item
.
getPRSCH_1
()));
/*
priceObj.put("SEND_DATE", new Date(0));// 发送时间
*/
priceObj
.
put
(
"SEND_STATUS"
,
"N"
);
Long
BATCHID
=
common
.
getNextval
(
"T_PRICE_LIST_BATCH_"
+
dateString
);
String
BATCH
=
dateString
+
"-"
+
BATCHID
;
priceObj
.
put
(
"TRACE_NO"
,
"sappricelist"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
priceObj
.
put
(
"BATCH"
,
BATCH
);
if
(
priceObj
.
get
(
"ID"
)
!=
null
)
{
updatePriceObj
(
priceObj
);
}
else
{
insertPriceObj
(
priceObj
);
priceObj
.
put
(
"TRACE_NO"
,
"sappricelist"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
priceObj
.
put
(
"BATCH"
,
BATCH
);
if
(
priceObj
.
get
(
"ID"
)
!=
null
)
{
updatePriceObj
(
priceObj
);
}
else
{
insertPriceObj
(
priceObj
);
}
}
}
}
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/egolm/sso/services/shipping_notfirmation/ShippingNotificationServiceImpl.java
View file @
5e2e8868
...
...
@@ -57,88 +57,98 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
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
();
HEADER_DELIVERY
HEADER_DELIVERY
=
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE
.
getHEADER_DELIVERY
();
header
.
put
(
"DELIVERY_VBELN"
,
HEADER_DELIVERY
.
getVBELN
());
header
.
put
(
"DELIVERY_LFART"
,
HEADER_DELIVERY
.
getLFART
());
header
.
put
(
"DELIVERY_INCO1"
,
HEADER_DELIVERY
.
getINCO1
());
header
.
put
(
"DELIVERY_BTGEW"
,
StringUtil
.
toDouble
(
HEADER_DELIVERY
.
getBTGEW
()));
header
.
put
(
"DELIVERY_GEWEI"
,
HEADER_DELIVERY
.
getGEWEI
());
header
.
put
(
"DELIVERY_CMGST"
,
HEADER_DELIVERY
.
getCMGST
());
header
.
put
(
"DELIVERY_VKORG"
,
HEADER_DELIVERY
.
getVKORG
());
List
<
HEADER_PARTNER
>
HEADER_PARTNERs
=
HEADER_DELIVERY
.
getHEADER_PARTNER
();
for
(
int
i
=
0
;
i
<
HEADER_PARTNERs
.
size
();
i
++)
{
HEADER_PARTNER
HEADER_PARTNER
=
HEADER_PARTNERs
.
get
(
i
);
String
PARTNER_Q
=
HEADER_PARTNER
.
getPARTNER_Q
();
String
PARTNER_ID
=
HEADER_PARTNER
.
getPARTNER_ID
();
String
NAME1
=
HEADER_PARTNER
.
getNAME1
();
String
NAME2
=
HEADER_PARTNER
.
getNAME2
();
String
POSTL_COD1
=
HEADER_PARTNER
.
getPOSTL_COD1
();
String
CITY1
=
HEADER_PARTNER
.
getCITY1
();
if
(
"AG"
.
equals
(
PARTNER_Q
))
{
header
.
put
(
"PARTNER_Q1"
,
PARTNER_Q
);
header
.
put
(
"PARTNER_ID1"
,
PARTNER_ID
);
header
.
put
(
"PARTNER_NAME1_1"
,
NAME1
);
header
.
put
(
"PARTNER_NAME2_1"
,
NAME2
);
header
.
put
(
"PARTNER_POSTLCOD1_1"
,
POSTL_COD1
);
header
.
put
(
"PARTNER_CITY1_1"
,
CITY1
);
}
else
if
(
"WE"
.
equals
(
PARTNER_Q
))
{
header
.
put
(
"PARTNER_Q2"
,
PARTNER_Q
);
header
.
put
(
"PARTNER_ID2"
,
PARTNER_ID
);
header
.
put
(
"PARTNER_NAME1_2"
,
NAME1
);
header
.
put
(
"PARTNER_NAME2_2"
,
NAME2
);
header
.
put
(
"PARTNER_POSTLCOD1_2"
,
POSTL_COD1
);
header
.
put
(
"PARTNER_CITY1_2"
,
CITY1
);
}
else
{
throw
new
XRException
(
"Partner type undefined ["
+
PARTNER_Q
+
"] in HEADER_PARTNER"
);
}
}
List
<
HEADER_DATE
>
HEADER_DATEs
=
HEADER_DELIVERY
.
getHEADER_DATE
();
if
(
HEADER_DATEs
!=
null
&&
HEADER_DATEs
.
size
()>
0
)
{
HEADER_DATE
HEADER_DATE
=
HEADER_DATEs
.
get
(
0
);
header
.
put
(
"QUALF"
,
HEADER_DATE
.
getQUALF
());
header
.
put
(
"NTEND"
,
HEADER_DATE
.
getNTEND
());
}
header
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_HEADER_BATCH_"
+
dateString
));
header
.
put
(
"SEND_STATUS"
,
"N"
);
header
.
put
(
"TRACE_NO"
,
"sapshippingnotification"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
header
.
put
(
"CREATED"
,
now
);
header
.
put
(
"CREATEBY"
,
"system"
);
Long
hID
=
Long
.
valueOf
(
time
+
StringUtil
.
format
(
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_HEADER_ID_"
+
dateString
),
"00000"
));
header
.
put
(
"ID"
,
hID
);
insertTo
(
header
,
"t_shipping_notification_header"
);
List
<
ITEM
>
ITEMs
=
HEADER_DELIVERY
.
getITEM
();
for
(
ITEM
ITEM
:
ITEMs
)
{
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
Long
iID
=
Long
.
valueOf
(
time
+
StringUtil
.
format
(
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_ITEM_ID_"
+
dateString
),
"00000"
));
item
.
put
(
"ID"
,
iID
);
item
.
put
(
"HEADER_ID"
,
hID
);
item
.
put
(
"POSNR"
,
ITEM
.
getPOSNR
());
item
.
put
(
"VTWEG"
,
ITEM
.
getVTWEG
());
item
.
put
(
"MATNR"
,
ITEM
.
getMATNR
());
item
.
put
(
"DMATNR"
,
ITEM
.
getDMATNR
());
item
.
put
(
"LFIMG"
,
ITEM
.
getLFIMG
());
item
.
put
(
"VRKME"
,
ITEM
.
getVRKME
());
List
<
ITEM_REFERENCE_SO
>
ITEM_REFERENCE_SOs
=
ITEM
.
getITEM_REFERENCE_SO
();
if
(
ITEM_REFERENCE_SOs
!=
null
&&
ITEM_REFERENCE_SOs
.
size
()>
0
)
{
ITEM_REFERENCE_SO
ITEM_REFERENCE_SO
=
ITEM_REFERENCE_SOs
.
get
(
0
);
item
.
put
(
"REFERENCE_SO_QUALF"
,
ITEM_REFERENCE_SO
.
getQUALF
());
item
.
put
(
"REFERENCE_SO_BELNR"
,
ITEM_REFERENCE_SO
.
getBELNR
());
item
.
put
(
"REFERENCE_SO_POSNR"
,
ITEM_REFERENCE_SO
.
getPOSNR
());
}
List
<
ITEM_REFERENCE_PO_TYPE
>
ITEM_REFERENCE_PO_TYPEs
=
ITEM
.
getITEM_REFERENCE_PO_TYPE
();
for
(
int
i
=
0
;
i
<
ITEM_REFERENCE_PO_TYPEs
.
size
();
i
++)
{
ITEM_REFERENCE_PO_TYPE
ITEM_REFERENCE_PO_TYPE
=
ITEM_REFERENCE_PO_TYPEs
.
get
(
i
);
item
.
put
(
"REFERENCE_PO_TYPE_TDID"
+(
i
+
1
),
ITEM_REFERENCE_PO_TYPE
.
getTDID
());
List
<
ITEM_REFERENCE_PO_DATA
>
ITEM_REFERENCE_PO_DATAs
=
ITEM_REFERENCE_PO_TYPE
.
getITEM_REFERENCE_PO_DATA
();
if
(
ITEM_REFERENCE_PO_DATAs
!=
null
&&
ITEM_REFERENCE_PO_DATAs
.
size
()>
0
)
{
ITEM_REFERENCE_PO_DATA
ITEM_REFERENCE_PO_DATA
=
ITEM_REFERENCE_PO_DATAs
.
get
(
0
);
item
.
put
(
"REFERENCE_PO_TYPE_TDLINE"
+(
i
+
1
),
ITEM_REFERENCE_PO_DATA
.
getTDLINE
());
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
)
{
header
.
put
(
"DELIVERY_VBELN"
,
HEADER_DELIVERY
.
getVBELN
());
header
.
put
(
"DELIVERY_LFART"
,
HEADER_DELIVERY
.
getLFART
());
header
.
put
(
"DELIVERY_INCO1"
,
HEADER_DELIVERY
.
getINCO1
());
header
.
put
(
"DELIVERY_BTGEW"
,
StringUtil
.
toDouble
(
HEADER_DELIVERY
.
getBTGEW
()));
header
.
put
(
"DELIVERY_GEWEI"
,
HEADER_DELIVERY
.
getGEWEI
());
header
.
put
(
"DELIVERY_CMGST"
,
HEADER_DELIVERY
.
getCMGST
());
header
.
put
(
"DELIVERY_VKORG"
,
HEADER_DELIVERY
.
getVKORG
());
List
<
HEADER_PARTNER
>
HEADER_PARTNERs
=
HEADER_DELIVERY
.
getHEADER_PARTNER
();
if
(
HEADER_PARTNERs
!=
null
)
{
for
(
int
i
=
0
;
i
<
HEADER_PARTNERs
.
size
();
i
++)
{
HEADER_PARTNER
HEADER_PARTNER
=
HEADER_PARTNERs
.
get
(
i
);
String
PARTNER_Q
=
HEADER_PARTNER
.
getPARTNER_Q
();
String
PARTNER_ID
=
HEADER_PARTNER
.
getPARTNER_ID
();
String
NAME1
=
HEADER_PARTNER
.
getNAME1
();
String
NAME2
=
HEADER_PARTNER
.
getNAME2
();
String
POSTL_COD1
=
HEADER_PARTNER
.
getPOSTL_COD1
();
String
CITY1
=
HEADER_PARTNER
.
getCITY1
();
if
(
"AG"
.
equals
(
PARTNER_Q
))
{
header
.
put
(
"PARTNER_Q1"
,
PARTNER_Q
);
header
.
put
(
"PARTNER_ID1"
,
PARTNER_ID
);
header
.
put
(
"PARTNER_NAME1_1"
,
NAME1
);
header
.
put
(
"PARTNER_NAME2_1"
,
NAME2
);
header
.
put
(
"PARTNER_POSTLCOD1_1"
,
POSTL_COD1
);
header
.
put
(
"PARTNER_CITY1_1"
,
CITY1
);
}
else
if
(
"WE"
.
equals
(
PARTNER_Q
))
{
header
.
put
(
"PARTNER_Q2"
,
PARTNER_Q
);
header
.
put
(
"PARTNER_ID2"
,
PARTNER_ID
);
header
.
put
(
"PARTNER_NAME1_2"
,
NAME1
);
header
.
put
(
"PARTNER_NAME2_2"
,
NAME2
);
header
.
put
(
"PARTNER_POSTLCOD1_2"
,
POSTL_COD1
);
header
.
put
(
"PARTNER_CITY1_2"
,
CITY1
);
}
else
{
throw
new
XRException
(
"Partner type undefined ["
+
PARTNER_Q
+
"] in HEADER_PARTNER"
);
}
}
}
List
<
HEADER_DATE
>
HEADER_DATEs
=
HEADER_DELIVERY
.
getHEADER_DATE
();
if
(
HEADER_DATEs
!=
null
)
{
HEADER_DATE
HEADER_DATE
=
HEADER_DATEs
.
get
(
0
);
header
.
put
(
"QUALF"
,
HEADER_DATE
.
getQUALF
());
header
.
put
(
"NTEND"
,
HEADER_DATE
.
getNTEND
());
}
header
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_HEADER_BATCH_"
+
dateString
));
header
.
put
(
"SEND_STATUS"
,
"N"
);
header
.
put
(
"TRACE_NO"
,
"sapshippingnotification"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
header
.
put
(
"CREATED"
,
now
);
header
.
put
(
"CREATEBY"
,
"system"
);
Long
hID
=
Long
.
valueOf
(
time
+
StringUtil
.
format
(
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_HEADER_ID_"
+
dateString
),
"00000"
));
header
.
put
(
"ID"
,
hID
);
insertTo
(
header
,
"t_shipping_notification_header"
);
List
<
ITEM
>
ITEMs
=
HEADER_DELIVERY
.
getITEM
();
if
(
ITEMs
!=
null
)
{
for
(
ITEM
ITEM
:
ITEMs
)
{
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
Long
iID
=
Long
.
valueOf
(
time
+
StringUtil
.
format
(
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_ITEM_ID_"
+
dateString
),
"00000"
));
item
.
put
(
"ID"
,
iID
);
item
.
put
(
"HEADER_ID"
,
hID
);
item
.
put
(
"POSNR"
,
ITEM
.
getPOSNR
());
item
.
put
(
"VTWEG"
,
ITEM
.
getVTWEG
());
item
.
put
(
"MATNR"
,
ITEM
.
getMATNR
());
item
.
put
(
"DMATNR"
,
ITEM
.
getDMATNR
());
item
.
put
(
"LFIMG"
,
ITEM
.
getLFIMG
());
item
.
put
(
"VRKME"
,
ITEM
.
getVRKME
());
List
<
ITEM_REFERENCE_SO
>
ITEM_REFERENCE_SOs
=
ITEM
.
getITEM_REFERENCE_SO
();
if
(
ITEM_REFERENCE_SOs
!=
null
)
{
ITEM_REFERENCE_SO
ITEM_REFERENCE_SO
=
ITEM_REFERENCE_SOs
.
get
(
0
);
item
.
put
(
"REFERENCE_SO_QUALF"
,
ITEM_REFERENCE_SO
.
getQUALF
());
item
.
put
(
"REFERENCE_SO_BELNR"
,
ITEM_REFERENCE_SO
.
getBELNR
());
item
.
put
(
"REFERENCE_SO_POSNR"
,
ITEM_REFERENCE_SO
.
getPOSNR
());
}
List
<
ITEM_REFERENCE_PO_TYPE
>
ITEM_REFERENCE_PO_TYPEs
=
ITEM
.
getITEM_REFERENCE_PO_TYPE
();
if
(
ITEM_REFERENCE_PO_TYPEs
!=
null
)
{
for
(
int
i
=
0
;
i
<
ITEM_REFERENCE_PO_TYPEs
.
size
();
i
++)
{
ITEM_REFERENCE_PO_TYPE
ITEM_REFERENCE_PO_TYPE
=
ITEM_REFERENCE_PO_TYPEs
.
get
(
i
);
item
.
put
(
"REFERENCE_PO_TYPE_TDID"
+(
i
+
1
),
ITEM_REFERENCE_PO_TYPE
.
getTDID
());
List
<
ITEM_REFERENCE_PO_DATA
>
ITEM_REFERENCE_PO_DATAs
=
ITEM_REFERENCE_PO_TYPE
.
getITEM_REFERENCE_PO_DATA
();
if
(
ITEM_REFERENCE_PO_DATAs
!=
null
&&
ITEM_REFERENCE_PO_DATAs
.
size
()>
0
)
{
ITEM_REFERENCE_PO_DATA
ITEM_REFERENCE_PO_DATA
=
ITEM_REFERENCE_PO_DATAs
.
get
(
0
);
item
.
put
(
"REFERENCE_PO_TYPE_TDLINE"
+(
i
+
1
),
ITEM_REFERENCE_PO_DATA
.
getTDLINE
());
}
}
}
item
.
put
(
"CREATED"
,
now
);
item
.
put
(
"CREATEBY"
,
"system"
);
insertTo
(
item
,
"t_shipping_notification_item"
);
}
}
}
item
.
put
(
"CREATED"
,
now
);
item
.
put
(
"CREATEBY"
,
"system"
);
insertTo
(
item
,
"t_shipping_notification_item"
);
}
}
catch
(
Exception
e
)
{
isSuccess
=
false
;
...
...
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