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
02948f7d
Commit
02948f7d
authored
Jul 26, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
1db861ba
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
90 additions
and
87 deletions
+90
-87
ConfirmQuotationServiceImpl.java
...rvices/confirm_quotation/ConfirmQuotationServiceImpl.java
+90
-87
No files found.
src/main/java/com/egolm/sso/services/confirm_quotation/ConfirmQuotationServiceImpl.java
View file @
02948f7d
...
...
@@ -64,93 +64,96 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
header
.
put
(
"MSGTYPE"
,
MESSAGE
.
getMSGTYPE
());
header
.
put
(
"MSGTXT"
,
MESSAGE
.
getMSGTXT
());
}
header
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
header
.
put
(
"VBELN"
,
h
.
getVBELN
());
header
.
put
(
"VKORG"
,
h
.
getVKORG
());
header
.
put
(
"VTWEG"
,
h
.
getVTWEG
());
header
.
put
(
"SPART"
,
h
.
getSPART
());
header
.
put
(
"ERNAM"
,
h
.
getERNAM
());
header
.
put
(
"BSTDK"
,
DateUtil
.
parseDateNoEmpty
(
h
.
getBSTDK
(),
DateUtil
.
FMT_DATE
));
header
.
put
(
"ERZET"
,
DateUtil
.
parseDateNoEmpty
(
h
.
getERZET
(),
DateUtil
.
FMT_TIME
));
header
.
put
(
"ERDAT"
,
DateUtil
.
parseDateNoEmpty
(
h
.
getERDAT
(),
DateUtil
.
FMT_DATE
));
header
.
put
(
"KUNNR"
,
h
.
getKUNNR
());
header
.
put
(
"KGNNR"
,
h
.
getKGNNR
());
header
.
put
(
"NAME1"
,
h
.
getNAME1
());
header
.
put
(
"NAME2"
,
h
.
getNAME2
());
header
.
put
(
"POSTL_COD1"
,
h
.
getPOSTL_COD1
());
header
.
put
(
"CITY1"
,
h
.
getCITY1
());
header
.
put
(
"ZZPROM"
,
h
.
getZZPROM
());
header
.
put
(
"BSTKD"
,
h
.
getBSTKD
());
header
.
put
(
"AUART"
,
h
.
getAUART
());
header
.
put
(
"CMGST"
,
h
.
getCMGST
());
header
.
put
(
"NETWRH"
,
StringUtil
.
toDouble
(
h
.
getNETWRH
()));
header
.
put
(
"MWSTH"
,
StringUtil
.
toDouble
(
h
.
getMWSTH
()));
header
.
put
(
"WAERK"
,
h
.
getWAERK
());
header
.
put
(
"DPFLAG"
,
h
.
getDPFLAG
());
header
.
put
(
"SEND_STATUS"
,
"N"
);
header
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_SO_CONFIRMACTION_HEADER_BATCH_"
+
dateString
));
header
.
put
(
"CREATED"
,
now
);
header
.
put
(
"CREATEBY"
,
"system"
);
String
idIndex
=
StringUtil
.
format
(
common
.
getNextval
(
"T_SO_CONFIRMATION_HEADER_ID_"
+
dateString
),
"00000"
);
Long
hID
=
Long
.
valueOf
(
time
+
idIndex
);
header
.
put
(
"ID"
,
hID
);
header
.
put
(
"TRACE_NO"
,
"sapsoconfirmquotation"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
insertTo
(
header
,
"t_so_confirmation_header"
);
List
<
ITEM_DATA
>
ids
=
res
.
getITEM_DATA
();
Map
<
String
,
Map
<
String
,
Object
>>
itemDatas
=
new
HashMap
<>();
for
(
ITEM_DATA
id
:
ids
)
{
Map
<
String
,
Object
>
itemData
=
new
HashMap
<>();
itemData
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
itemData
.
put
(
"VBELN"
,
h
.
getVBELN
());
itemData
.
put
(
"HEADER_ID"
,
hID
);
itemData
.
put
(
"POSNR"
,
id
.
getPOSNR
());
itemData
.
put
(
"UEPOS"
,
id
.
getUEPOS
());
itemData
.
put
(
"VTEXT"
,
id
.
getVTEXT
());
itemData
.
put
(
"MATNR"
,
id
.
getMATNR
());
itemData
.
put
(
"KWMENG"
,
StringUtil
.
toDouble
(
id
.
getKWMENG
()));
itemData
.
put
(
"VRKME"
,
id
.
getVRKME
());
itemData
.
put
(
"EDATU"
,
DateUtil
.
parseDateNoEmpty
(
id
.
getEDATU
(),
DateUtil
.
FMT_DATE
));
itemData
.
put
(
"CDATE"
,
DateUtil
.
parseDateNoEmpty
(
id
.
getCDATE
(),
DateUtil
.
FMT_DATE
));
itemData
.
put
(
"REFLAG"
,
id
.
getREFLAG
());
itemData
.
put
(
"MWSTI"
,
StringUtil
.
toDouble
(
id
.
getMWSTI
()));
itemData
.
put
(
"NETWRI"
,
StringUtil
.
toDouble
(
id
.
getNETWRI
()));
itemData
.
put
(
"WAERK_I"
,
id
.
getWAERK_I
());
itemData
.
put
(
"WERKS"
,
id
.
getWERKS
());
itemData
.
put
(
"ZZCRDDATE"
,
DateUtil
.
parseDateNoEmpty
(
id
.
getZZCRDDATE
(),
DateUtil
.
FMT_DATE
));
itemData
.
put
(
"KGNNR_I"
,
id
.
getKGNNR_I
());
itemData
.
put
(
"NAME1_I"
,
id
.
getNAME1_I
());
itemData
.
put
(
"NAME2_I"
,
id
.
getNAME2_I
());
itemData
.
put
(
"POSTL_CODE1_I"
,
id
.
getPOSTL_COD1_I
());
itemData
.
put
(
"CITY1_I"
,
id
.
getCITY1_I
());
itemData
.
put
(
"CREATED"
,
now
);
itemData
.
put
(
"CREATEBY"
,
"system"
);
String
iidIndex
=
StringUtil
.
format
(
common
.
getNextval
(
"T_SO_CONFIRMATION_ITEM_DATA_ID_"
+
dateString
),
"00000"
);
Long
iID
=
Long
.
valueOf
(
time
+
iidIndex
);
itemData
.
put
(
"ID"
,
iID
);
itemDatas
.
put
(
id
.
getPOSNR
(),
itemData
);
insertTo
(
itemData
,
"t_so_confirmation_item_data"
);
}
List
<
ITEM_PRICING
>
ips
=
res
.
getITEM_PRICING
();
for
(
ITEM_PRICING
ip
:
ips
)
{
Map
<
String
,
Object
>
itemPricing
=
new
HashMap
<>();
itemPricing
.
put
(
"HEADER_ID"
,
hID
);
String
POSNR
=
ip
.
getPOSNR
();
itemPricing
.
put
(
"ITEM_DATA_ID"
,
itemDatas
.
get
(
POSNR
).
get
(
"ID"
));
itemPricing
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
itemPricing
.
put
(
"VBELN"
,
h
.
getVBELN
());
itemPricing
.
put
(
"POSNR"
,
POSNR
);
itemPricing
.
put
(
"KSCHL"
,
ip
.
getKSCHL
());
itemPricing
.
put
(
"VTEXT"
,
ip
.
getVTEXT
());
itemPricing
.
put
(
"KBETR"
,
StringUtil
.
toDouble
(
ip
.
getKBETR
()));
itemPricing
.
put
(
"KWERT"
,
StringUtil
.
toDouble
(
ip
.
getKWERT
()));
itemPricing
.
put
(
"CREATED"
,
now
);
itemPricing
.
put
(
"CREATEBY"
,
"system"
);
String
itemPricingID
=
StringUtil
.
format
(
common
.
getNextval
(
"T_SO_CONFIRMATION_ITEM_PRICING_ID_"
+
dateString
),
"00000"
);
itemPricing
.
put
(
"ID"
,
Long
.
valueOf
(
time
+
itemPricingID
));
insertTo
(
itemPricing
,
"t_so_confirmation_item_pricing"
);
if
(
h
!=
null
)
{
header
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
header
.
put
(
"VBELN"
,
h
.
getVBELN
());
header
.
put
(
"VKORG"
,
h
.
getVKORG
());
header
.
put
(
"VTWEG"
,
h
.
getVTWEG
());
header
.
put
(
"SPART"
,
h
.
getSPART
());
header
.
put
(
"ERNAM"
,
h
.
getERNAM
());
header
.
put
(
"BSTDK"
,
DateUtil
.
parseDateNoEmpty
(
h
.
getBSTDK
(),
DateUtil
.
FMT_DATE
));
header
.
put
(
"ERZET"
,
DateUtil
.
parseDateNoEmpty
(
h
.
getERZET
(),
DateUtil
.
FMT_TIME
));
header
.
put
(
"ERDAT"
,
DateUtil
.
parseDateNoEmpty
(
h
.
getERDAT
(),
DateUtil
.
FMT_DATE
));
header
.
put
(
"KUNNR"
,
h
.
getKUNNR
());
header
.
put
(
"KGNNR"
,
h
.
getKGNNR
());
header
.
put
(
"NAME1"
,
h
.
getNAME1
());
header
.
put
(
"NAME2"
,
h
.
getNAME2
());
header
.
put
(
"POSTL_COD1"
,
h
.
getPOSTL_COD1
());
header
.
put
(
"CITY1"
,
h
.
getCITY1
());
header
.
put
(
"ZZPROM"
,
h
.
getZZPROM
());
header
.
put
(
"BSTKD"
,
h
.
getBSTKD
());
header
.
put
(
"AUART"
,
h
.
getAUART
());
header
.
put
(
"CMGST"
,
h
.
getCMGST
());
header
.
put
(
"NETWRH"
,
StringUtil
.
toDouble
(
h
.
getNETWRH
()));
header
.
put
(
"MWSTH"
,
StringUtil
.
toDouble
(
h
.
getMWSTH
()));
header
.
put
(
"WAERK"
,
h
.
getWAERK
());
header
.
put
(
"DPFLAG"
,
h
.
getDPFLAG
());
header
.
put
(
"SEND_STATUS"
,
"N"
);
header
.
put
(
"BATCH"
,
dateString
+
"-"
+
common
.
getNextval
(
"T_SO_CONFIRMACTION_HEADER_BATCH_"
+
dateString
));
header
.
put
(
"CREATED"
,
now
);
header
.
put
(
"CREATEBY"
,
"system"
);
String
idIndex
=
StringUtil
.
format
(
common
.
getNextval
(
"T_SO_CONFIRMATION_HEADER_ID_"
+
dateString
),
"00000"
);
Long
hID
=
Long
.
valueOf
(
time
+
idIndex
);
header
.
put
(
"ID"
,
hID
);
header
.
put
(
"TRACE_NO"
,
"sapsoconfirmquotation"
+
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATETIME
));
insertTo
(
header
,
"t_so_confirmation_header"
);
List
<
ITEM_DATA
>
ids
=
res
.
getITEM_DATA
();
Map
<
String
,
Map
<
String
,
Object
>>
itemDatas
=
new
HashMap
<>();
if
(
ids
!=
null
)
{
for
(
ITEM_DATA
id
:
ids
)
{
Map
<
String
,
Object
>
itemData
=
new
HashMap
<>();
itemData
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
itemData
.
put
(
"VBELN"
,
h
.
getVBELN
());
itemData
.
put
(
"HEADER_ID"
,
hID
);
itemData
.
put
(
"POSNR"
,
id
.
getPOSNR
());
itemData
.
put
(
"UEPOS"
,
id
.
getUEPOS
());
itemData
.
put
(
"VTEXT"
,
id
.
getVTEXT
());
itemData
.
put
(
"MATNR"
,
id
.
getMATNR
());
itemData
.
put
(
"KWMENG"
,
StringUtil
.
toDouble
(
id
.
getKWMENG
()));
itemData
.
put
(
"VRKME"
,
id
.
getVRKME
());
itemData
.
put
(
"EDATU"
,
DateUtil
.
parseDateNoEmpty
(
id
.
getEDATU
(),
DateUtil
.
FMT_DATE
));
itemData
.
put
(
"CDATE"
,
DateUtil
.
parseDateNoEmpty
(
id
.
getCDATE
(),
DateUtil
.
FMT_DATE
));
itemData
.
put
(
"REFLAG"
,
id
.
getREFLAG
());
itemData
.
put
(
"MWSTI"
,
StringUtil
.
toDouble
(
id
.
getMWSTI
()));
itemData
.
put
(
"NETWRI"
,
StringUtil
.
toDouble
(
id
.
getNETWRI
()));
itemData
.
put
(
"WAERK_I"
,
id
.
getWAERK_I
());
itemData
.
put
(
"WERKS"
,
id
.
getWERKS
());
itemData
.
put
(
"ZZCRDDATE"
,
DateUtil
.
parseDateNoEmpty
(
id
.
getZZCRDDATE
(),
DateUtil
.
FMT_DATE
));
itemData
.
put
(
"KGNNR_I"
,
id
.
getKGNNR_I
());
itemData
.
put
(
"NAME1_I"
,
id
.
getNAME1_I
());
itemData
.
put
(
"NAME2_I"
,
id
.
getNAME2_I
());
itemData
.
put
(
"POSTL_CODE1_I"
,
id
.
getPOSTL_COD1_I
());
itemData
.
put
(
"CITY1_I"
,
id
.
getCITY1_I
());
itemData
.
put
(
"CREATED"
,
now
);
itemData
.
put
(
"CREATEBY"
,
"system"
);
String
iidIndex
=
StringUtil
.
format
(
common
.
getNextval
(
"T_SO_CONFIRMATION_ITEM_DATA_ID_"
+
dateString
),
"00000"
);
Long
iID
=
Long
.
valueOf
(
time
+
iidIndex
);
itemData
.
put
(
"ID"
,
iID
);
itemDatas
.
put
(
id
.
getPOSNR
(),
itemData
);
insertTo
(
itemData
,
"t_so_confirmation_item_data"
);
}
}
List
<
ITEM_PRICING
>
ips
=
res
.
getITEM_PRICING
();
if
(
ips
!=
null
)
{
for
(
ITEM_PRICING
ip
:
ips
)
{
Map
<
String
,
Object
>
itemPricing
=
new
HashMap
<>();
itemPricing
.
put
(
"HEADER_ID"
,
hID
);
String
POSNR
=
ip
.
getPOSNR
();
itemPricing
.
put
(
"ITEM_DATA_ID"
,
itemDatas
.
get
(
POSNR
).
get
(
"ID"
));
itemPricing
.
put
(
"BSTKD_E"
,
h
.
getBSTKD_E
());
itemPricing
.
put
(
"VBELN"
,
h
.
getVBELN
());
itemPricing
.
put
(
"POSNR"
,
POSNR
);
itemPricing
.
put
(
"KSCHL"
,
ip
.
getKSCHL
());
itemPricing
.
put
(
"VTEXT"
,
ip
.
getVTEXT
());
itemPricing
.
put
(
"KBETR"
,
StringUtil
.
toDouble
(
ip
.
getKBETR
()));
itemPricing
.
put
(
"KWERT"
,
StringUtil
.
toDouble
(
ip
.
getKWERT
()));
itemPricing
.
put
(
"CREATED"
,
now
);
itemPricing
.
put
(
"CREATEBY"
,
"system"
);
String
itemPricingID
=
StringUtil
.
format
(
common
.
getNextval
(
"T_SO_CONFIRMATION_ITEM_PRICING_ID_"
+
dateString
),
"00000"
);
itemPricing
.
put
(
"ID"
,
Long
.
valueOf
(
time
+
itemPricingID
));
insertTo
(
itemPricing
,
"t_so_confirmation_item_pricing"
);
}
}
}
}
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