Commit 89172829 authored by Quxl's avatar Quxl

x

parent 1eb984f0
......@@ -19,11 +19,11 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import com.egolm.sso.service.MaterialMasterService;
import com.egolm.sso.service.PriceListService;
import com.egolm.sso.service.ProFormaInvoiceService;
import com.egolm.sso.service.ShippingNotificationService;
import com.egolm.sso.service.SoConfirmQuotationService;
import com.egolm.sso.services.confirm_quotation.ConfirmQuotationService;
import com.egolm.sso.services.material_master.MaterialMasterService;
import com.egolm.sso.services.preform_invoice.PoformaInvoiceService;
import com.egolm.sso.services.price_list.PriceListService;
import com.egolm.sso.services.shipping_notfirmation.ShippingNotificationService;
@Configuration
......@@ -52,18 +52,18 @@ public class WsConfig {
}
@Bean
public Endpoint getProFormaInvoicePoint(ProFormaInvoiceService priceListService) {
public Endpoint getProFormaInvoicePoint(PoformaInvoiceService priceListService) {
EndpointImpl endpoint = new EndpointImpl(bus, priceListService);
endpoint.setInInterceptors(Arrays.asList(authInterceptor));
endpoint.publish("/pro_forma_invoice");
endpoint.publish("/prforma_invoice");
return endpoint;
}
@Bean
public Endpoint getSoConfirmQuotationPoint(SoConfirmQuotationService soConfirmQuotationService) {
public Endpoint getSoConfirmQuotationPoint(ConfirmQuotationService soConfirmQuotationService) {
EndpointImpl endpoint = new EndpointImpl(bus, soConfirmQuotationService);
endpoint.setInInterceptors(Arrays.asList(authInterceptor));
endpoint.publish("/so_confirm_quotation");
endpoint.publish("/confirm_quotation");
return endpoint;
}
......
package com.egolm.sso.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://pro_forma_invoice.sso.egolm.com")
public interface ProFormaInvoiceService {
@WebMethod
public void execute(String xml);
}
package com.egolm.sso.service;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://so-confirm-quotation.sso.egolm.com")
public interface SoConfirmQuotationService {
@WebMethod
public void execute(String xml);
}
package com.egolm.sso.services.confirm_quotation;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://confirm_quotation.sso.egolm.com")
public interface ConfirmQuotationService {
@WebMethod
public void execute(Z_MT_SD_008_SO_CONFIRM_QUOTATION Z_MT_SD_008_SO_CONFIRM_QUOTATION);
}
package com.egolm.sso.service.impl;
package com.egolm.sso.services.confirm_quotation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
......@@ -15,35 +14,30 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.egolm.sso.bean.Z_MT_SD_008_SO_CONFIRM_QUOTATION;
import com.egolm.sso.bean.Z_MT_SD_008_SO_CONFIRM_QUOTATION.HEADER;
import com.egolm.sso.bean.Z_MT_SD_008_SO_CONFIRM_QUOTATION.ITEM_DATA;
import com.egolm.sso.bean.Z_MT_SD_008_SO_CONFIRM_QUOTATION.ITEM_PRICING;
import com.egolm.sso.bean.Z_MT_SD_008_SO_CONFIRM_QUOTATION.RESPONSE;
import com.egolm.sso.service.CommonService;
import com.egolm.sso.service.SoConfirmQuotationService;
import com.egolm.sso.services.confirm_quotation.Z_MT_SD_008_SO_CONFIRM_QUOTATION.HEADER;
import com.egolm.sso.services.confirm_quotation.Z_MT_SD_008_SO_CONFIRM_QUOTATION.ITEM_DATA;
import com.egolm.sso.services.confirm_quotation.Z_MT_SD_008_SO_CONFIRM_QUOTATION.ITEM_PRICING;
import com.egolm.sso.services.confirm_quotation.Z_MT_SD_008_SO_CONFIRM_QUOTATION.RESPONSE;
import com.egolm.sso.util.DateUtil;
import com.egolm.sso.util.FileUtil;
import com.egolm.sso.util.StringUtil;
import com.egolm.sso.util.XMLUtil;
@Component
@WebService(serviceName = "SoConfirmQuotationService", targetNamespace = "http://so_confirm_quotation.sso.egolm.com", endpointInterface = "com.egolm.sso.service.SoConfirmQuotationService")
public class SoConfirmQuotationServiceImpl implements SoConfirmQuotationService{
@WebService(serviceName = "ConfirmQuotationService", targetNamespace = "http://confirm_quotation.sso.egolm.com", endpointInterface = "com.egolm.sso.services.confirm_quotation.ConfirmQuotationService")
public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
@Autowired
JdbcTemplate jdbcTemplate;
@Autowired JdbcTemplate jdbcTemplate;
@Autowired CommonService common;
@Autowired
CommonService common;
@Override
public void execute(String xml) {
public void execute(Z_MT_SD_008_SO_CONFIRM_QUOTATION Z_MT_SD_008_SO_CONFIRM_QUOTATION) {
Date now = new Date();
String today = DateUtil.formatDate(now, DateUtil.FMT_DATE);
Long time = now.getTime();
Z_MT_SD_008_SO_CONFIRM_QUOTATION Z_MT_SD_008_SO_CONFIRM_QUOTATION = XMLUtil.toBeanByJxab(xml, Z_MT_SD_008_SO_CONFIRM_QUOTATION.class);
System.out.println(JSON.toJSONString(Z_MT_SD_008_SO_CONFIRM_QUOTATION));
Map<String, Object> header = new HashMap<>();
......@@ -160,5 +154,4 @@ public class SoConfirmQuotationServiceImpl implements SoConfirmQuotationService{
jdbcTemplate.update(insertSql, values.toArray());
}
}
package com.egolm.sso.bean;
package com.egolm.sso.services.confirm_quotation;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType
@XmlType(name = "Z_MT_SD_008_SO_CONFIRM_QUOTATION")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="Z_MT_SD_008_SO_CONFIRM_QUOTATION", namespace="http://schneider-distributor.com/")
public class Z_MT_SD_008_SO_CONFIRM_QUOTATION {
RESPONSE RESPONSE;
......@@ -23,45 +20,59 @@ public class Z_MT_SD_008_SO_CONFIRM_QUOTATION {
RESPONSE = rESPONSE;
}
public static class RESPONSE{
@XmlType(name = "RESPONSE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class RESPONSE {
String VBELN;
String MESSAGE;
HEADER HEADER;
List<ITEM_DATA> ITEM_DATA;
List<ITEM_PRICING> ITEM_PRICING;
public String getVBELN() {
return VBELN;
}
public void setVBELN(String vBELN) {
VBELN = vBELN;
}
public String getMESSAGE() {
return MESSAGE;
}
public void setMESSAGE(String mESSAGE) {
MESSAGE = mESSAGE;
}
public HEADER getHEADER() {
return HEADER;
}
public void setHEADER(HEADER hEADER) {
HEADER = hEADER;
}
public List<ITEM_DATA> getITEM_DATA() {
return ITEM_DATA;
}
public void setITEM_DATA(List<ITEM_DATA> iTEM_DATA) {
ITEM_DATA = iTEM_DATA;
}
public List<ITEM_PRICING> getITEM_PRICING() {
return ITEM_PRICING;
}
public void setITEM_PRICING(List<ITEM_PRICING> iTEM_PRICING) {
ITEM_PRICING = iTEM_PRICING;
}
}
public static class HEADER{
@XmlType(name = "HEADER")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER {
String BSTKD_E;
String VBELN;
String VKORG;
......@@ -85,148 +96,196 @@ public class Z_MT_SD_008_SO_CONFIRM_QUOTATION {
String MWSTH;
String WAERK;
String DPFLAG;
public String getBSTKD_E() {
return BSTKD_E;
}
public void setBSTKD_E(String bSTKD_E) {
BSTKD_E = bSTKD_E;
}
public String getVBELN() {
return VBELN;
}
public void setVBELN(String vBELN) {
VBELN = vBELN;
}
public String getVKORG() {
return VKORG;
}
public void setVKORG(String vKORG) {
VKORG = vKORG;
}
public String getVTWEG() {
return VTWEG;
}
public void setVTWEG(String vTWEG) {
VTWEG = vTWEG;
}
public String getSPART() {
return SPART;
}
public void setSPART(String sPART) {
SPART = sPART;
}
public String getERNAM() {
return ERNAM;
}
public void setERNAM(String eRNAM) {
ERNAM = eRNAM;
}
public String getBSTDK() {
return BSTDK;
}
public void setBSTDK(String bSTDK) {
BSTDK = bSTDK;
}
public String getERZET() {
return ERZET;
}
public void setERZET(String eRZET) {
ERZET = eRZET;
}
public String getERDAT() {
return ERDAT;
}
public void setERDAT(String eRDAT) {
ERDAT = eRDAT;
}
public String getKUNNR() {
return KUNNR;
}
public void setKUNNR(String kUNNR) {
KUNNR = kUNNR;
}
public String getKGNNR() {
return KGNNR;
}
public void setKGNNR(String kGNNR) {
KGNNR = kGNNR;
}
public String getNAME1() {
return NAME1;
}
public void setNAME1(String nAME1) {
NAME1 = nAME1;
}
public String getNAME2() {
return NAME2;
}
public void setNAME2(String nAME2) {
NAME2 = nAME2;
}
public String getPOSTL_COD1() {
return POSTL_COD1;
}
public void setPOSTL_COD1(String pOSTL_COD1) {
POSTL_COD1 = pOSTL_COD1;
}
public String getCITY1() {
return CITY1;
}
public void setCITY1(String cITY1) {
CITY1 = cITY1;
}
public String getZZPROM() {
return ZZPROM;
}
public void setZZPROM(String zZPROM) {
ZZPROM = zZPROM;
}
public String getBSTKD() {
return BSTKD;
}
public void setBSTKD(String bSTKD) {
BSTKD = bSTKD;
}
public String getAUART() {
return AUART;
}
public void setAUART(String aUART) {
AUART = aUART;
}
public String getCMGST() {
return CMGST;
}
public void setCMGST(String cMGST) {
CMGST = cMGST;
}
public String getNETWRH() {
return NETWRH;
}
public void setNETWRH(String nETWRH) {
NETWRH = nETWRH;
}
public String getMWSTH() {
return MWSTH;
}
public void setMWSTH(String mWSTH) {
MWSTH = mWSTH;
}
public String getWAERK() {
return WAERK;
}
public void setWAERK(String wAERK) {
WAERK = wAERK;
}
public String getDPFLAG() {
return DPFLAG;
}
public void setDPFLAG(String dPFLAG) {
DPFLAG = dPFLAG;
}
}
public static class ITEM_DATA{
@XmlType(name = "ITEM_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_DATA {
String POSNR;
String UEPOS;
String VTEXT;
......@@ -246,156 +305,206 @@ public class Z_MT_SD_008_SO_CONFIRM_QUOTATION {
String NAME2_I;
String POSTL_COD1_I;
String CITY1_I;
public String getPOSNR() {
return POSNR;
}
public void setPOSNR(String pOSNR) {
POSNR = pOSNR;
}
public String getUEPOS() {
return UEPOS;
}
public void setUEPOS(String uEPOS) {
UEPOS = uEPOS;
}
public String getVTEXT() {
return VTEXT;
}
public void setVTEXT(String vTEXT) {
VTEXT = vTEXT;
}
public String getMATNR() {
return MATNR;
}
public void setMATNR(String mATNR) {
MATNR = mATNR;
}
public String getKWMENG() {
return KWMENG;
}
public void setKWMENG(String kWMENG) {
KWMENG = kWMENG;
}
public String getVRKME() {
return VRKME;
}
public void setVRKME(String vRKME) {
VRKME = vRKME;
}
public String getEDATU() {
return EDATU;
}
public void setEDATU(String eDATU) {
EDATU = eDATU;
}
public String getCDATE() {
return CDATE;
}
public void setCDATE(String cDATE) {
CDATE = cDATE;
}
public String getREFLAG() {
return REFLAG;
}
public void setREFLAG(String rEFLAG) {
REFLAG = rEFLAG;
}
public String getMWSTI() {
return MWSTI;
}
public void setMWSTI(String mWSTI) {
MWSTI = mWSTI;
}
public String getNETWRI() {
return NETWRI;
}
public void setNETWRI(String nETWRI) {
NETWRI = nETWRI;
}
public String getWAERK_I() {
return WAERK_I;
}
public void setWAERK_I(String wAERK_I) {
WAERK_I = wAERK_I;
}
public String getWERKS() {
return WERKS;
}
public void setWERKS(String wERKS) {
WERKS = wERKS;
}
public String getZZCRDDATE() {
return ZZCRDDATE;
}
public void setZZCRDDATE(String zZCRDDATE) {
ZZCRDDATE = zZCRDDATE;
}
public String getKGNNR_I() {
return KGNNR_I;
}
public void setKGNNR_I(String kGNNR_I) {
KGNNR_I = kGNNR_I;
}
public String getNAME1_I() {
return NAME1_I;
}
public void setNAME1_I(String nAME1_I) {
NAME1_I = nAME1_I;
}
public String getNAME2_I() {
return NAME2_I;
}
public void setNAME2_I(String nAME2_I) {
NAME2_I = nAME2_I;
}
public String getPOSTL_COD1_I() {
return POSTL_COD1_I;
}
public void setPOSTL_COD1_I(String pOSTL_COD1_I) {
POSTL_COD1_I = pOSTL_COD1_I;
}
public String getCITY1_I() {
return CITY1_I;
}
public void setCITY1_I(String cITY1_I) {
CITY1_I = cITY1_I;
}
}
public static class ITEM_PRICING{
@XmlType(name = "ITEM_PRICING")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_PRICING {
String POSNR;
String KSCHL;
String VTEXT;
String KBETR;
String KWERT;
public String getPOSNR() {
return POSNR;
}
public void setPOSNR(String pOSNR) {
POSNR = pOSNR;
}
public String getKSCHL() {
return KSCHL;
}
public void setKSCHL(String kSCHL) {
KSCHL = kSCHL;
}
public String getVTEXT() {
return VTEXT;
}
public void setVTEXT(String vTEXT) {
VTEXT = vTEXT;
}
public String getKBETR() {
return KBETR;
}
public void setKBETR(String kBETR) {
KBETR = kBETR;
}
public String getKWERT() {
return KWERT;
}
public void setKWERT(String kWERT) {
KWERT = kWERT;
}
......
package com.egolm.sso.service;
package com.egolm.sso.services.material_master;
import javax.jws.WebMethod;
import javax.jws.WebService;
......@@ -7,6 +7,6 @@ import javax.jws.WebService;
public interface MaterialMasterService {
@WebMethod
public void execute(String xml);
public void execute(Z_MT_SD_001_MATERIAL_MASTER Z_MT_SD_001_MATERIAL_MASTER);
}
package com.egolm.sso.service.impl;
package com.egolm.sso.services.material_master;
import java.util.ArrayList;
import java.util.Date;
......@@ -6,28 +6,23 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import javax.jws.WebService;
import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.egolm.sso.bean.Z_MT_SD_001_MATERIAL_MASTER;
import com.egolm.sso.bean.Z_MT_SD_001_MATERIAL_MASTER.HEADER_SENDING;
import com.egolm.sso.bean.Z_MT_SD_001_MATERIAL_MASTER.ITEM;
import com.egolm.sso.bean.Z_MT_SD_001_MATERIAL_MASTER.RECORD;
import com.egolm.sso.service.CommonService;
import com.egolm.sso.service.MaterialMasterService;
import com.egolm.sso.services.material_master.Z_MT_SD_001_MATERIAL_MASTER.HEADER_SENDING;
import com.egolm.sso.services.material_master.Z_MT_SD_001_MATERIAL_MASTER.ITEM;
import com.egolm.sso.services.material_master.Z_MT_SD_001_MATERIAL_MASTER.RECORD;
import com.egolm.sso.util.DateUtil;
import com.egolm.sso.util.StringUtil;
import com.egolm.sso.util.XMLUtil;
import com.google.gson.Gson;
@Component
@WebService(serviceName = "MaterialMasterService", targetNamespace = "http://material_master.sso.egolm.com", endpointInterface = "com.egolm.sso.service.MaterialMasterService")
@WebService(serviceName = "MaterialMasterService", targetNamespace = "http://material_master.sso.egolm.com", endpointInterface = "com.egolm.sso.services.material_master.MaterialMasterService")
public class MaterialMasterServiceImpl implements MaterialMasterService {
@Autowired
......@@ -37,17 +32,10 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
CommonService common;
@Override
public void execute(String xml) {
public void execute(Z_MT_SD_001_MATERIAL_MASTER Z_MT_SD_001_MATERIAL_MASTER) {
System.out.println(new Gson().toJson(Z_MT_SD_001_MATERIAL_MASTER));
Date now = new Date();
String today = DateUtil.formatDate(now, DateUtil.FMT_DATE);
Long time = now.getTime();
String regex = "xmlns:[a-zA-Z\\d]+=\"[a-zA-Z]+:\\S+\"";
xml = xml.replaceAll("<[a-zA-Z\\d]+:", "<");
xml = xml.replaceAll("</[a-zA-Z\\d]+:", "</");
xml = xml.replaceAll(regex, "");
Z_MT_SD_001_MATERIAL_MASTER Z_MT_SD_001_MATERIAL_MASTER = XMLUtil.toBeanByJxab(xml, Z_MT_SD_001_MATERIAL_MASTER.class);
RECORD RECORD = Z_MT_SD_001_MATERIAL_MASTER.getRECORD();
HEADER_SENDING h = RECORD.getHEADER_SENDING();
......
package com.egolm.sso.bean;
package com.egolm.sso.services.material_master;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType
@XmlType(name = "Z_MT_SD_001_MATERIAL_MASTER")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="Z_MT_SD_001_MATERIAL_MASTER")
public class Z_MT_SD_001_MATERIAL_MASTER {
RECORD RECORD;
......@@ -23,6 +21,8 @@ public class Z_MT_SD_001_MATERIAL_MASTER {
RECORD = rECORD;
}
@XmlType(name = "RECORD")
@XmlAccessorType(XmlAccessType.FIELD)
public static class RECORD{
HEADER_SENDING HEADER_SENDING;
List<ITEM> ITEM;
......@@ -41,6 +41,8 @@ public class Z_MT_SD_001_MATERIAL_MASTER {
}
@XmlType(name = "HEADER_SENDING")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_SENDING{
String KUNNR;
String DATUM;
......@@ -66,6 +68,8 @@ public class Z_MT_SD_001_MATERIAL_MASTER {
}
@XmlType(name = "ITEM")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM{
String MATNR;
String BRGEW;
......
package com.egolm.sso.services.preform_invoice;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://preform_invoice.sso.egolm.com")
public interface PoformaInvoiceService {
@WebMethod
public void execute(Z_MT_SD_005_PERFORM_INVOICE Z_MT_SD_005_PERFORM_INVOICE);
}
package com.egolm.sso.service.impl;
package com.egolm.sso.services.preform_invoice;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
......@@ -12,35 +11,30 @@ import javax.jws.WebService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.HEADER_BANK_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.HEADER_DOCU_DATE;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.HEADER_GENERAL_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.HEADER_ORGANIZATIONAL_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.HEADER_PARTNER_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.HEADER_REFERENCE_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.ITEM_AMOUNT_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.ITEM_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.ITEM_MATERIAL_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.ITEM_REFERENCE_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.ITEM_REFERENCE_PO_TYPE;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.ITEM_VAT_DATA;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.SUMMARY_GENERAL;
import com.egolm.sso.bean.Z_MT_SD_005_PERFORM_INVOICE.Z_DT_SD_005_PERFORM_INVOICE;
import com.egolm.sso.service.CommonService;
import com.egolm.sso.service.ProFormaInvoiceService;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.HEADER_BANK_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.HEADER_DOCU_DATE;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.HEADER_GENERAL_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.HEADER_ORGANIZATIONAL_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.HEADER_PARTNER_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.HEADER_REFERENCE_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.ITEM_AMOUNT_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.ITEM_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.ITEM_MATERIAL_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.ITEM_REFERENCE_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.ITEM_REFERENCE_PO_TYPE;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.ITEM_VAT_DATA;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.SUMMARY_GENERAL;
import com.egolm.sso.services.preform_invoice.Z_MT_SD_005_PERFORM_INVOICE.Z_DT_SD_005_PERFORM_INVOICE;
import com.egolm.sso.util.DateUtil;
import com.egolm.sso.util.FileUtil;
import com.egolm.sso.util.SqlUtil;
import com.egolm.sso.util.SqlUtil.Sql;
import com.egolm.sso.util.StringUtil;
import com.egolm.sso.util.XMLUtil;
@Component
@WebService(serviceName = "ProFormaInvoiceService", targetNamespace = "http://pro_forma_invoice.sso.egolm.com", endpointInterface = "com.egolm.sso.service.ProFormaInvoiceService")
public class ProFormaInvoiceServiceImpl implements ProFormaInvoiceService {
@WebService(serviceName = "PoformaInvoiceService", targetNamespace = "http://preform_invoice.sso.egolm.com", endpointInterface = "com.egolm.sso.services.preform_invoice.PoformaInvoiceService")
public class PoformaInvoiceServiceImpl implements PoformaInvoiceService {
@Autowired
JdbcTemplate jdbcTemplate;
......@@ -49,13 +43,11 @@ public class ProFormaInvoiceServiceImpl implements ProFormaInvoiceService {
CommonService common;
@Override
@Transactional
public void execute(String xml) {
public void execute(Z_MT_SD_005_PERFORM_INVOICE Z_MT_SD_005_PERFORM_INVOICE) {
Date now = new Date();
String dateString = DateUtil.formatDate(now, DateUtil.FMT_DATE);
Z_MT_SD_005_PERFORM_INVOICE bean = XMLUtil.toBeanByJxab(xml, Z_MT_SD_005_PERFORM_INVOICE.class);
Map<String, Object> headMap = new HashMap<String, Object>();
Z_DT_SD_005_PERFORM_INVOICE Z_DT_SD_005_PERFORM_INVOICE = bean.getZ_DT_SD_005_PERFORM_INVOICE();
Z_DT_SD_005_PERFORM_INVOICE Z_DT_SD_005_PERFORM_INVOICE = Z_MT_SD_005_PERFORM_INVOICE.getZ_DT_SD_005_PERFORM_INVOICE();
HEADER_GENERAL_DATA HEADER_GENERAL_DATA = Z_DT_SD_005_PERFORM_INVOICE.getHEADER_GENERAL_DATA();
List<HEADER_PARTNER_DATA> partnerList = Z_DT_SD_005_PERFORM_INVOICE.getHEADER_PARTNER_DATA();
HEADER_DOCU_DATE HEADER_DOCU_DATE = Z_DT_SD_005_PERFORM_INVOICE.getHEADER_DOCU_DATE();
......@@ -176,9 +168,4 @@ public class ProFormaInvoiceServiceImpl implements ProFormaInvoiceService {
jdbcTemplate.batchUpdate(itemDataSql.getSql(), itemDataSql.getBachArgs());
}
public static void main(String[] args) throws IOException {
new ProFormaInvoiceServiceImpl().execute(FileUtil.readText("D:/data/sso/005.XML"));
}
}
package com.egolm.sso.bean;
package com.egolm.sso.services.preform_invoice;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType
@XmlType(name = "Z_MT_SD_005_PERFORM_INVOICE")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="Z_MT_SD_005_PERFORM_INVOICE", namespace="http://schneider-distributor.com/")
public class Z_MT_SD_005_PERFORM_INVOICE {
Z_DT_SD_005_PERFORM_INVOICE Z_DT_SD_005_PERFORM_INVOICE;
@XmlType(name = "Z_DT_SD_005_PERFORM_INVOICE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class Z_DT_SD_005_PERFORM_INVOICE {
......@@ -92,6 +92,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "HEADER_GENERAL_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_GENERAL_DATA {
String BELNR;
String ZTERM;
......@@ -113,6 +115,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "HEADER_PARTNER_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_PARTNER_DATA {
String PARVW;
String PARTN;
......@@ -134,6 +138,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "HEADER_DOCU_DATE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_DOCU_DATE {
String IDDAT;
String DATUM;
......@@ -155,6 +161,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "HEADER_REFERENCE_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_REFERENCE_DATA {
String QUALF;
String BELNR;
......@@ -185,6 +193,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "HEADER_BANK_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_BANK_DATA {
String ACNUM;
......@@ -197,6 +207,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "HEADER_ORGANIZATIONAL_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_ORGANIZATIONAL_DATA {
String QUALF;
String ORGID;
......@@ -218,6 +230,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "SUMMARY_GENERAL")
@XmlAccessorType(XmlAccessType.FIELD)
public static class SUMMARY_GENERAL {
String SUMID;
String SUMME;
......@@ -248,6 +262,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_DATA {
ITEM_REFERENCE_DATA ITEM_REFERENCE_DATA;
ITEM_MATERIAL_DATA ITEM_MATERIAL_DATA;
......@@ -332,6 +348,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_REFERENCE_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_REFERENCE_DATA {
String QUALF;
String BELNR;
......@@ -389,6 +407,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_MATERIAL_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_MATERIAL_DATA {
String QUALF;
String IDTNR;
......@@ -410,6 +430,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_AMOUNT_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_AMOUNT_DATA {
String QUALF;
String BETRG;
......@@ -431,6 +453,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_VAT_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_VAT_DATA {
String MWSKZ;
String MWSBT;
......@@ -452,6 +476,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_REFERENCE_PO_TYPE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_REFERENCE_PO_TYPE {
ITEM_REFERENCE_PO_DATA ITEM_REFERENCE_PO_DATA;
String TDID;
......@@ -473,6 +499,8 @@ public class Z_MT_SD_005_PERFORM_INVOICE {
}
}
@XmlType(name = "ITEM_REFERENCE_PO_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_REFERENCE_PO_DATA {
String TDLINE;
......
package com.egolm.sso.service;
package com.egolm.sso.services.price_list;
import javax.jws.WebMethod;
import javax.jws.WebService;
......@@ -7,5 +7,6 @@ import javax.jws.WebService;
public interface PriceListService {
@WebMethod
public void execute(String xml);
public void execute(Z_MT_SD_002_PRICE_LIST Z_MT_SD_002_PRICE_LIST);
}
package com.egolm.sso.service.impl;
package com.egolm.sso.services.price_list;
import java.util.ArrayList;
import java.util.Date;
......@@ -9,24 +9,20 @@ import java.util.Map.Entry;
import javax.jws.WebService;
import org.dom4j.Element;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.egolm.sso.bean.Z_MT_SD_002_PRICE_LIST;
import com.egolm.sso.bean.Z_MT_SD_002_PRICE_LIST.HEADER_SENDING;
import com.egolm.sso.bean.Z_MT_SD_002_PRICE_LIST.ITEM;
import com.egolm.sso.bean.Z_MT_SD_002_PRICE_LIST.RECORD;
import com.egolm.sso.service.CommonService;
import com.egolm.sso.service.PriceListService;
import com.egolm.sso.services.price_list.Z_MT_SD_002_PRICE_LIST.HEADER_SENDING;
import com.egolm.sso.services.price_list.Z_MT_SD_002_PRICE_LIST.ITEM;
import com.egolm.sso.services.price_list.Z_MT_SD_002_PRICE_LIST.RECORD;
import com.egolm.sso.util.DateUtil;
import com.egolm.sso.util.StringUtil;
import com.egolm.sso.util.XMLUtil;
import com.google.gson.Gson;
@Component
@WebService(serviceName = "PriceListService", targetNamespace = "http://price_list.sso.egolm.com", endpointInterface = "com.egolm.sso.service.PriceListService")
@WebService(serviceName = "PriceListService", targetNamespace = "http://price_list.sso.egolm.com", endpointInterface = "com.egolm.sso.services.price_list.PriceListService")
public class PriceListServiceImpl implements PriceListService {
@Autowired
......@@ -36,19 +32,11 @@ public class PriceListServiceImpl implements PriceListService {
CommonService common;
@Override
public void execute(String xml) {
public void execute(Z_MT_SD_002_PRICE_LIST Z_MT_SD_002_PRICE_LIST) {
Date now = new Date();
String today = DateUtil.formatDate(now, DateUtil.FMT_DATE);
Long time = now.getTime();
String regex = "xmlns:[a-zA-Z\\d]+=\"[a-zA-Z]+:\\S+\"";
xml = xml.replaceAll("<[a-zA-Z\\d]+:", "<");
xml = xml.replaceAll("</[a-zA-Z\\d]+:", "</");
xml = xml.replaceAll(regex, "");
Z_MT_SD_002_PRICE_LIST Z_MT_SD_002_PRICE_LIST = XMLUtil.toBeanByJxab(xml, Z_MT_SD_002_PRICE_LIST.class);
System.out.println(JSON.toJSONString(Z_MT_SD_002_PRICE_LIST));
System.out.println(new Gson().toJson(Z_MT_SD_002_PRICE_LIST));
RECORD r = Z_MT_SD_002_PRICE_LIST.getRECORD();
HEADER_SENDING h = r.getHEADER_SENDING();
List<ITEM> items = r.getITEM();
......
package com.egolm.sso.bean;
package com.egolm.sso.services.price_list;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType
@XmlType(name = "Z_MT_SD_002_PRICE_LIST")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="Z_MT_SD_002_PRICE_LIST")
public class Z_MT_SD_002_PRICE_LIST {
RECORD RECORD;
......@@ -23,6 +21,8 @@ public class Z_MT_SD_002_PRICE_LIST {
RECORD = rECORD;
}
@XmlType(name = "RECORD")
@XmlAccessorType(XmlAccessType.FIELD)
public static class RECORD {
HEADER_SENDING HEADER_SENDING;
......@@ -42,6 +42,8 @@ public class Z_MT_SD_002_PRICE_LIST {
}
@XmlType(name = "HEADER_SENDING")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_SENDING {
String KUNNR;
......@@ -68,6 +70,8 @@ public class Z_MT_SD_002_PRICE_LIST {
}
@XmlType(name = "ITEM")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM {
String MATNR;
......
package com.egolm.sso.service;
package com.egolm.sso.services.shipping_notfirmation;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService(targetNamespace = "http://shipping_notification.sso.egolm.com")
@WebService(targetNamespace = "http://shipping_notfirmation.sso.egolm.com")
public interface ShippingNotificationService {
@WebMethod
public void execute(String xml);
public void execute(Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE);
}
package com.egolm.sso.service.impl;
package com.egolm.sso.services.shipping_notfirmation;
import java.util.ArrayList;
import java.util.Date;
......@@ -14,23 +14,21 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSON;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.HEADER_DATE;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.HEADER_DELIVERY;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.HEADER_PARTNER;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM_REFERENCE_PO_DATA;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM_REFERENCE_PO_TYPE;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM_REFERENCE_SO;
import com.egolm.sso.bean.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE;
import com.egolm.sso.service.CommonService;
import com.egolm.sso.service.ShippingNotificationService;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.HEADER_DATE;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.HEADER_DELIVERY;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.HEADER_PARTNER;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM_REFERENCE_PO_DATA;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM_REFERENCE_PO_TYPE;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.ITEM_REFERENCE_SO;
import com.egolm.sso.services.shipping_notfirmation.Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE;
import com.egolm.sso.util.DateUtil;
import com.egolm.sso.util.StringUtil;
import com.egolm.sso.util.XMLUtil;
@Component
@WebService(serviceName = "ShippingNotificationService", targetNamespace = "http://shipping_notification.sso.egolm.com", endpointInterface = "com.egolm.sso.service.ShippingNotificationService")
@WebService(serviceName = "ShippingNotificationService", targetNamespace = "http://shipping_notfirmation.sso.egolm.com", endpointInterface = "com.egolm.sso.services.shipping_notfirmation.ShippingNotificationService")
public class ShippingNotificationServiceImpl implements ShippingNotificationService {
@Autowired
......@@ -40,8 +38,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
CommonService common;
@Override
public void execute(String xml) {
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE = XMLUtil.toBeanByJxab(xml, Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE.class);
public void execute(Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE) {
System.out.println(JSON.toJSONString(Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE));
Date now = new Date();
......@@ -156,4 +153,5 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
insertSql = insertSql + fieldSql + ") values " + valuesSql + ")";
jdbcTemplate.update(insertSql, values.toArray());
}
}
package com.egolm.sso.bean;
package com.egolm.sso.services.shipping_notfirmation;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
@XmlType
@XmlType(name = "Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name="Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE", namespace="http://schneider-distributor.com/")
public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE;
......@@ -23,6 +21,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE = z_DT_SD_007_SHIPPING_NOTIFICATION_FILE;
}
@XmlType(name = "Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class Z_DT_SD_007_SHIPPING_NOTIFICATION_FILE{
HEADER_DELIVERY HEADER_DELIVERY;
......@@ -35,6 +35,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "HEADER_DELIVERY")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_DELIVERY{
String VBELN;
String LFART;
......@@ -108,6 +110,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "HEADER_PARTNER")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_PARTNER{
String PARTNER_Q;
String PARTNER_ID;
......@@ -153,6 +157,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "HEADER_DATE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class HEADER_DATE{
String QUALF;
String NTEND;
......@@ -170,6 +176,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "ITEM")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM{
String POSNR;
String VTWEG;
......@@ -229,6 +237,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "ITEM_REFERENCE_SO")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_REFERENCE_SO{
String QUALF;
String BELNR;
......@@ -253,6 +263,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "ITEM_REFERENCE_PO_TYPE")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_REFERENCE_PO_TYPE{
String TDID;
List<ITEM_REFERENCE_PO_DATA> ITEM_REFERENCE_PO_DATA;
......@@ -270,6 +282,8 @@ public class Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE {
}
}
@XmlType(name = "ITEM_REFERENCE_PO_DATA")
@XmlAccessorType(XmlAccessType.FIELD)
public static class ITEM_REFERENCE_PO_DATA{
String TDLINE;
......
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