Commit 5e2e8868 authored by Quxl's avatar Quxl

x

parent 02948f7d
...@@ -50,12 +50,18 @@ public class MaterialMasterServiceImpl implements MaterialMasterService { ...@@ -50,12 +50,18 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
try { try {
RECORD RECORD = Z_MT_SD_001_MATERIAL_MASTER.getRECORD(); RECORD RECORD = Z_MT_SD_001_MATERIAL_MASTER.getRECORD();
HEADER_SENDING h = RECORD.getHEADER_SENDING(); HEADER_SENDING h = RECORD.getHEADER_SENDING();
String DIS_CODE = h.getKUNNR(); String DIS_CODE = null;
String DATUM = h.getDATUM(); String DATUM = null;
String UZEIT = h.getUZEIT(); String UZEIT = null;
if(h != null) {
DIS_CODE = h.getKUNNR();
DATUM = h.getDATUM();
UZEIT = h.getUZEIT();
}
List<ITEM> items = RECORD.getITEM(); List<ITEM> items = RECORD.getITEM();
if(items != null) {
for(ITEM item : items) { for(ITEM item : items) {
String GOODS_CODE = item.getMATNR(); String GOODS_CODE = item.getMATNR();
Map<String, Object> goods = getGoods(DIS_CODE, GOODS_CODE); Map<String, Object> goods = getGoods(DIS_CODE, GOODS_CODE);
...@@ -96,19 +102,6 @@ public class MaterialMasterServiceImpl implements MaterialMasterService { ...@@ -96,19 +102,6 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
goods.put("PUBLIC", item.getPUBLIC()); goods.put("PUBLIC", item.getPUBLIC());
goods.put("INTERNET", item.getINTERNET()); 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); Long BATCHID = common.getNextval(dateString + "T_VEN_GOODS_BATCH_" + dateString);
String BATCH = dateString+"-"+BATCHID; String BATCH = dateString+"-"+BATCHID;
goods.put("TRACE_NO", "sapmaterialmaster" + DateUtil.formatDate(now, DateUtil.FMT_DATETIME)); goods.put("TRACE_NO", "sapmaterialmaster" + DateUtil.formatDate(now, DateUtil.FMT_DATETIME));
...@@ -121,6 +114,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService { ...@@ -121,6 +114,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
insertGoods(goods); insertGoods(goods);
} }
} }
}
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
throw new XRException(ThrowableUtil.getCaused(e).getMessage(), e); throw new XRException(ThrowableUtil.getCaused(e).getMessage(), e);
......
...@@ -49,12 +49,19 @@ public class PriceListServiceImpl implements PriceListService { ...@@ -49,12 +49,19 @@ public class PriceListServiceImpl implements PriceListService {
System.out.println(new Gson().toJson(Z_MT_SD_002_PRICE_LIST)); System.out.println(new Gson().toJson(Z_MT_SD_002_PRICE_LIST));
try { try {
RECORD r = Z_MT_SD_002_PRICE_LIST.getRECORD(); RECORD r = Z_MT_SD_002_PRICE_LIST.getRECORD();
if(r != null) {
HEADER_SENDING h = r.getHEADER_SENDING(); HEADER_SENDING h = r.getHEADER_SENDING();
List<ITEM> items = r.getITEM(); List<ITEM> items = r.getITEM();
String KUNNR = h.getKUNNR(); String KUNNR = null;
String DATUM = h.getDATUM(); String DATUM = null;
String UZEIT = h.getUZEIT(); String UZEIT = null;
if(h != null) {
KUNNR = h.getKUNNR();
DATUM = h.getDATUM();
UZEIT = h.getUZEIT();
}
if(items != null) {
for(ITEM item : items) { for(ITEM item : items) {
String MATNR = item.getMATNR(); String MATNR = item.getMATNR();
Map<String, Object> priceObj = getPriceObj(KUNNR, MATNR); Map<String, Object> priceObj = getPriceObj(KUNNR, MATNR);
...@@ -93,6 +100,8 @@ public class PriceListServiceImpl implements PriceListService { ...@@ -93,6 +100,8 @@ public class PriceListServiceImpl implements PriceListService {
insertPriceObj(priceObj); insertPriceObj(priceObj);
} }
} }
}
}
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
throw new XRException(ThrowableUtil.getCaused(e).getMessage(), e); throw new XRException(ThrowableUtil.getCaused(e).getMessage(), e);
......
...@@ -57,7 +57,9 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -57,7 +57,9 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
try { try {
Map<String, Object> header = new HashMap<>(); 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(); 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(); 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_VBELN", HEADER_DELIVERY.getVBELN());
header.put("DELIVERY_LFART", HEADER_DELIVERY.getLFART()); header.put("DELIVERY_LFART", HEADER_DELIVERY.getLFART());
header.put("DELIVERY_INCO1", HEADER_DELIVERY.getINCO1()); header.put("DELIVERY_INCO1", HEADER_DELIVERY.getINCO1());
...@@ -66,6 +68,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -66,6 +68,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
header.put("DELIVERY_CMGST", HEADER_DELIVERY.getCMGST()); header.put("DELIVERY_CMGST", HEADER_DELIVERY.getCMGST());
header.put("DELIVERY_VKORG", HEADER_DELIVERY.getVKORG()); header.put("DELIVERY_VKORG", HEADER_DELIVERY.getVKORG());
List<HEADER_PARTNER> HEADER_PARTNERs = HEADER_DELIVERY.getHEADER_PARTNER(); List<HEADER_PARTNER> HEADER_PARTNERs = HEADER_DELIVERY.getHEADER_PARTNER();
if(HEADER_PARTNERs != null) {
for(int i=0; i<HEADER_PARTNERs.size(); i++) { for(int i=0; i<HEADER_PARTNERs.size(); i++) {
HEADER_PARTNER HEADER_PARTNER = HEADER_PARTNERs.get(i); HEADER_PARTNER HEADER_PARTNER = HEADER_PARTNERs.get(i);
String PARTNER_Q = HEADER_PARTNER.getPARTNER_Q(); String PARTNER_Q = HEADER_PARTNER.getPARTNER_Q();
...@@ -92,8 +95,9 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -92,8 +95,9 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
throw new XRException("Partner type undefined [" + PARTNER_Q + "] in HEADER_PARTNER"); throw new XRException("Partner type undefined [" + PARTNER_Q + "] in HEADER_PARTNER");
} }
} }
}
List<HEADER_DATE> HEADER_DATEs= HEADER_DELIVERY.getHEADER_DATE(); List<HEADER_DATE> HEADER_DATEs= HEADER_DELIVERY.getHEADER_DATE();
if(HEADER_DATEs!=null&&HEADER_DATEs.size()>0) { if(HEADER_DATEs!=null) {
HEADER_DATE HEADER_DATE = HEADER_DATEs.get(0); HEADER_DATE HEADER_DATE = HEADER_DATEs.get(0);
header.put("QUALF", HEADER_DATE.getQUALF()); header.put("QUALF", HEADER_DATE.getQUALF());
header.put("NTEND", HEADER_DATE.getNTEND()); header.put("NTEND", HEADER_DATE.getNTEND());
...@@ -108,6 +112,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -108,6 +112,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
insertTo(header, "t_shipping_notification_header"); insertTo(header, "t_shipping_notification_header");
List<ITEM> ITEMs = HEADER_DELIVERY.getITEM(); List<ITEM> ITEMs = HEADER_DELIVERY.getITEM();
if(ITEMs != null) {
for(ITEM ITEM : ITEMs) { for(ITEM ITEM : ITEMs) {
Map<String, Object> item = new HashMap<>(); Map<String, Object> item = new HashMap<>();
Long iID = Long.valueOf(time+StringUtil.format(common.getNextval("T_SHIPPING_NOTIFICATION_ITEM_ID_"+dateString), "00000")); Long iID = Long.valueOf(time+StringUtil.format(common.getNextval("T_SHIPPING_NOTIFICATION_ITEM_ID_"+dateString), "00000"));
...@@ -120,13 +125,14 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -120,13 +125,14 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
item.put("LFIMG", ITEM.getLFIMG()); item.put("LFIMG", ITEM.getLFIMG());
item.put("VRKME", ITEM.getVRKME()); item.put("VRKME", ITEM.getVRKME());
List<ITEM_REFERENCE_SO> ITEM_REFERENCE_SOs = ITEM.getITEM_REFERENCE_SO(); List<ITEM_REFERENCE_SO> ITEM_REFERENCE_SOs = ITEM.getITEM_REFERENCE_SO();
if(ITEM_REFERENCE_SOs!=null&&ITEM_REFERENCE_SOs.size()>0) { if(ITEM_REFERENCE_SOs!=null) {
ITEM_REFERENCE_SO ITEM_REFERENCE_SO = ITEM_REFERENCE_SOs.get(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_QUALF", ITEM_REFERENCE_SO.getQUALF());
item.put("REFERENCE_SO_BELNR", ITEM_REFERENCE_SO.getBELNR()); item.put("REFERENCE_SO_BELNR", ITEM_REFERENCE_SO.getBELNR());
item.put("REFERENCE_SO_POSNR", ITEM_REFERENCE_SO.getPOSNR()); item.put("REFERENCE_SO_POSNR", ITEM_REFERENCE_SO.getPOSNR());
} }
List<ITEM_REFERENCE_PO_TYPE> ITEM_REFERENCE_PO_TYPEs = ITEM.getITEM_REFERENCE_PO_TYPE(); 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++) { 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_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()); item.put("REFERENCE_PO_TYPE_TDID"+(i+1), ITEM_REFERENCE_PO_TYPE.getTDID());
...@@ -136,10 +142,14 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ ...@@ -136,10 +142,14 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
item.put("REFERENCE_PO_TYPE_TDLINE"+(i+1), ITEM_REFERENCE_PO_DATA.getTDLINE()); item.put("REFERENCE_PO_TYPE_TDLINE"+(i+1), ITEM_REFERENCE_PO_DATA.getTDLINE());
} }
} }
}
item.put("CREATED", now); item.put("CREATED", now);
item.put("CREATEBY", "system"); item.put("CREATEBY", "system");
insertTo(item, "t_shipping_notification_item"); insertTo(item, "t_shipping_notification_item");
} }
}
}
}
} catch (Exception e) { } catch (Exception e) {
isSuccess = false; isSuccess = false;
throw new XRException(ThrowableUtil.getCaused(e).getMessage(), e); throw new XRException(ThrowableUtil.getCaused(e).getMessage(), e);
......
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