Commit 02948f7d authored by Quxl's avatar Quxl

x

parent 1db861ba
...@@ -64,93 +64,96 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService { ...@@ -64,93 +64,96 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
header.put("MSGTYPE", MESSAGE.getMSGTYPE()); header.put("MSGTYPE", MESSAGE.getMSGTYPE());
header.put("MSGTXT", MESSAGE.getMSGTXT()); header.put("MSGTXT", MESSAGE.getMSGTXT());
} }
header.put("BSTKD_E", h.getBSTKD_E()); if(h != null) {
header.put("VBELN", h.getVBELN()); header.put("BSTKD_E", h.getBSTKD_E());
header.put("VKORG", h.getVKORG()); header.put("VBELN", h.getVBELN());
header.put("VTWEG", h.getVTWEG()); header.put("VKORG", h.getVKORG());
header.put("SPART", h.getSPART()); header.put("VTWEG", h.getVTWEG());
header.put("ERNAM", h.getERNAM()); header.put("SPART", h.getSPART());
header.put("BSTDK", DateUtil.parseDateNoEmpty(h.getBSTDK(), DateUtil.FMT_DATE)); header.put("ERNAM", h.getERNAM());
header.put("ERZET", DateUtil.parseDateNoEmpty(h.getERZET(), DateUtil.FMT_TIME)); header.put("BSTDK", DateUtil.parseDateNoEmpty(h.getBSTDK(), DateUtil.FMT_DATE));
header.put("ERDAT", DateUtil.parseDateNoEmpty(h.getERDAT(), DateUtil.FMT_DATE)); header.put("ERZET", DateUtil.parseDateNoEmpty(h.getERZET(), DateUtil.FMT_TIME));
header.put("KUNNR", h.getKUNNR()); header.put("ERDAT", DateUtil.parseDateNoEmpty(h.getERDAT(), DateUtil.FMT_DATE));
header.put("KGNNR", h.getKGNNR()); header.put("KUNNR", h.getKUNNR());
header.put("NAME1", h.getNAME1()); header.put("KGNNR", h.getKGNNR());
header.put("NAME2", h.getNAME2()); header.put("NAME1", h.getNAME1());
header.put("POSTL_COD1", h.getPOSTL_COD1()); header.put("NAME2", h.getNAME2());
header.put("CITY1", h.getCITY1()); header.put("POSTL_COD1", h.getPOSTL_COD1());
header.put("ZZPROM", h.getZZPROM()); header.put("CITY1", h.getCITY1());
header.put("BSTKD", h.getBSTKD()); header.put("ZZPROM", h.getZZPROM());
header.put("AUART", h.getAUART()); header.put("BSTKD", h.getBSTKD());
header.put("CMGST", h.getCMGST()); header.put("AUART", h.getAUART());
header.put("NETWRH", StringUtil.toDouble(h.getNETWRH())); header.put("CMGST", h.getCMGST());
header.put("MWSTH", StringUtil.toDouble(h.getMWSTH())); header.put("NETWRH", StringUtil.toDouble(h.getNETWRH()));
header.put("WAERK", h.getWAERK()); header.put("MWSTH", StringUtil.toDouble(h.getMWSTH()));
header.put("DPFLAG", h.getDPFLAG()); header.put("WAERK", h.getWAERK());
header.put("SEND_STATUS", "N"); header.put("DPFLAG", h.getDPFLAG());
header.put("BATCH", dateString + "-" + common.getNextval("T_SO_CONFIRMACTION_HEADER_BATCH_" + dateString)); header.put("SEND_STATUS", "N");
header.put("CREATED", now); header.put("BATCH", dateString + "-" + common.getNextval("T_SO_CONFIRMACTION_HEADER_BATCH_" + dateString));
header.put("CREATEBY", "system"); header.put("CREATED", now);
String idIndex = StringUtil.format(common.getNextval("T_SO_CONFIRMATION_HEADER_ID_"+dateString), "00000"); header.put("CREATEBY", "system");
Long hID = Long.valueOf(time+idIndex); String idIndex = StringUtil.format(common.getNextval("T_SO_CONFIRMATION_HEADER_ID_"+dateString), "00000");
header.put("ID", hID); Long hID = Long.valueOf(time+idIndex);
header.put("TRACE_NO", "sapsoconfirmquotation"+DateUtil.formatDate(now, DateUtil.FMT_DATETIME)); header.put("ID", hID);
header.put("TRACE_NO", "sapsoconfirmquotation"+DateUtil.formatDate(now, DateUtil.FMT_DATETIME));
insertTo(header, "t_so_confirmation_header"); insertTo(header, "t_so_confirmation_header");
List<ITEM_DATA> ids = res.getITEM_DATA();
List<ITEM_DATA> ids = res.getITEM_DATA(); Map<String, Map<String, Object>> itemDatas = new HashMap<>();
Map<String, Map<String, Object>> itemDatas = new HashMap<>(); if(ids != null) {
for(ITEM_DATA id : ids) { for(ITEM_DATA id : ids) {
Map<String, Object> itemData = new HashMap<>(); Map<String, Object> itemData = new HashMap<>();
itemData.put("BSTKD_E", h.getBSTKD_E()); itemData.put("BSTKD_E", h.getBSTKD_E());
itemData.put("VBELN", h.getVBELN()); itemData.put("VBELN", h.getVBELN());
itemData.put("HEADER_ID", hID); itemData.put("HEADER_ID", hID);
itemData.put("POSNR", id.getPOSNR()); itemData.put("POSNR", id.getPOSNR());
itemData.put("UEPOS", id.getUEPOS()); itemData.put("UEPOS", id.getUEPOS());
itemData.put("VTEXT", id.getVTEXT()); itemData.put("VTEXT", id.getVTEXT());
itemData.put("MATNR", id.getMATNR()); itemData.put("MATNR", id.getMATNR());
itemData.put("KWMENG", StringUtil.toDouble(id.getKWMENG())); itemData.put("KWMENG", StringUtil.toDouble(id.getKWMENG()));
itemData.put("VRKME", id.getVRKME()); itemData.put("VRKME", id.getVRKME());
itemData.put("EDATU", DateUtil.parseDateNoEmpty(id.getEDATU(), DateUtil.FMT_DATE)); itemData.put("EDATU", DateUtil.parseDateNoEmpty(id.getEDATU(), DateUtil.FMT_DATE));
itemData.put("CDATE", DateUtil.parseDateNoEmpty(id.getCDATE(), DateUtil.FMT_DATE)); itemData.put("CDATE", DateUtil.parseDateNoEmpty(id.getCDATE(), DateUtil.FMT_DATE));
itemData.put("REFLAG", id.getREFLAG()); itemData.put("REFLAG", id.getREFLAG());
itemData.put("MWSTI", StringUtil.toDouble(id.getMWSTI())); itemData.put("MWSTI", StringUtil.toDouble(id.getMWSTI()));
itemData.put("NETWRI", StringUtil.toDouble(id.getNETWRI())); itemData.put("NETWRI", StringUtil.toDouble(id.getNETWRI()));
itemData.put("WAERK_I", id.getWAERK_I()); itemData.put("WAERK_I", id.getWAERK_I());
itemData.put("WERKS", id.getWERKS()); itemData.put("WERKS", id.getWERKS());
itemData.put("ZZCRDDATE", DateUtil.parseDateNoEmpty(id.getZZCRDDATE(), DateUtil.FMT_DATE)); itemData.put("ZZCRDDATE", DateUtil.parseDateNoEmpty(id.getZZCRDDATE(), DateUtil.FMT_DATE));
itemData.put("KGNNR_I", id.getKGNNR_I()); itemData.put("KGNNR_I", id.getKGNNR_I());
itemData.put("NAME1_I", id.getNAME1_I()); itemData.put("NAME1_I", id.getNAME1_I());
itemData.put("NAME2_I", id.getNAME2_I()); itemData.put("NAME2_I", id.getNAME2_I());
itemData.put("POSTL_CODE1_I", id.getPOSTL_COD1_I()); itemData.put("POSTL_CODE1_I", id.getPOSTL_COD1_I());
itemData.put("CITY1_I", id.getCITY1_I()); itemData.put("CITY1_I", id.getCITY1_I());
itemData.put("CREATED", now); itemData.put("CREATED", now);
itemData.put("CREATEBY", "system"); itemData.put("CREATEBY", "system");
String iidIndex = StringUtil.format(common.getNextval("T_SO_CONFIRMATION_ITEM_DATA_ID_"+dateString), "00000"); String iidIndex = StringUtil.format(common.getNextval("T_SO_CONFIRMATION_ITEM_DATA_ID_"+dateString), "00000");
Long iID = Long.valueOf(time+iidIndex); Long iID = Long.valueOf(time+iidIndex);
itemData.put("ID", iID); itemData.put("ID", iID);
itemDatas.put(id.getPOSNR(), itemData); itemDatas.put(id.getPOSNR(), itemData);
insertTo(itemData, "t_so_confirmation_item_data"); insertTo(itemData, "t_so_confirmation_item_data");
} }
}
List<ITEM_PRICING> ips = res.getITEM_PRICING(); List<ITEM_PRICING> ips = res.getITEM_PRICING();
for(ITEM_PRICING ip : ips) { if(ips != null) {
Map<String, Object> itemPricing = new HashMap<>(); for(ITEM_PRICING ip : ips) {
itemPricing.put("HEADER_ID", hID); Map<String, Object> itemPricing = new HashMap<>();
String POSNR = ip.getPOSNR(); itemPricing.put("HEADER_ID", hID);
itemPricing.put("ITEM_DATA_ID", itemDatas.get(POSNR).get("ID")); String POSNR = ip.getPOSNR();
itemPricing.put("BSTKD_E", h.getBSTKD_E()); itemPricing.put("ITEM_DATA_ID", itemDatas.get(POSNR).get("ID"));
itemPricing.put("VBELN", h.getVBELN()); itemPricing.put("BSTKD_E", h.getBSTKD_E());
itemPricing.put("POSNR", POSNR); itemPricing.put("VBELN", h.getVBELN());
itemPricing.put("KSCHL", ip.getKSCHL()); itemPricing.put("POSNR", POSNR);
itemPricing.put("VTEXT", ip.getVTEXT()); itemPricing.put("KSCHL", ip.getKSCHL());
itemPricing.put("KBETR", StringUtil.toDouble(ip.getKBETR())); itemPricing.put("VTEXT", ip.getVTEXT());
itemPricing.put("KWERT", StringUtil.toDouble(ip.getKWERT())); itemPricing.put("KBETR", StringUtil.toDouble(ip.getKBETR()));
itemPricing.put("CREATED", now); itemPricing.put("KWERT", StringUtil.toDouble(ip.getKWERT()));
itemPricing.put("CREATEBY", "system"); itemPricing.put("CREATED", now);
String itemPricingID = StringUtil.format(common.getNextval("T_SO_CONFIRMATION_ITEM_PRICING_ID_"+dateString), "00000"); itemPricing.put("CREATEBY", "system");
itemPricing.put("ID", Long.valueOf(time+itemPricingID)); String itemPricingID = StringUtil.format(common.getNextval("T_SO_CONFIRMATION_ITEM_PRICING_ID_"+dateString), "00000");
insertTo(itemPricing, "t_so_confirmation_item_pricing"); itemPricing.put("ID", Long.valueOf(time+itemPricingID));
insertTo(itemPricing, "t_so_confirmation_item_pricing");
}
}
} }
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment