|
|
|
@ -52,7 +52,7 @@ public class SapServiceImpl implements SapService {
|
|
|
|
|
public String saprouter;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<SapProOrder> shopOrderSync() {
|
|
|
|
|
public List<SapProOrder> shopOrderSync(SapProOrder sapProOrder) {
|
|
|
|
|
// 连接
|
|
|
|
|
SapConn con = new SapConn(
|
|
|
|
|
ashost,
|
|
|
|
@ -232,53 +232,74 @@ public class SapServiceImpl implements SapService {
|
|
|
|
|
);
|
|
|
|
|
JCoDestination jCoDestination = SAPConnUtils.connect(con);
|
|
|
|
|
// 获取调用 RFC 函数对象
|
|
|
|
|
JCoFunction func = jCoDestination.getRepository().getFunction("ZMMR_MES_MAT_GET");
|
|
|
|
|
JCoFunction func = jCoDestination.getRepository().getFunction("ZPPR_MES_PRO_TO");
|
|
|
|
|
// 配置传入参数
|
|
|
|
|
JCoParameterList importParameterList = func.getImportParameterList();
|
|
|
|
|
System.out.println(importParameterList.getListMetaData());
|
|
|
|
|
// importParameterList.setValue("S_ERDAT","2019-11-07" );
|
|
|
|
|
// 调用并获取返回值
|
|
|
|
|
func.execute(jCoDestination);
|
|
|
|
|
// 获取 内表 - ZMES_PRO
|
|
|
|
|
JCoTable maraTable = func.getTableParameterList().getTable("LT_MARA");
|
|
|
|
|
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");
|
|
|
|
|
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
|
|
|
|
|
System.out.println("###" + metaData.toString());
|
|
|
|
|
SapProOrder proOrder = new SapProOrder();
|
|
|
|
|
List<SapProOrder> proOrderList = new ArrayList<>();
|
|
|
|
|
// 循环输出 Table 数据
|
|
|
|
|
for (int i = 0; i < maraTable.getNumRows(); i++) {
|
|
|
|
|
maraTable.setRow(i);
|
|
|
|
|
String MATNR = maraTable.getString("MATNR");
|
|
|
|
|
String AUFNR = maraTable.getString("AUFNR");
|
|
|
|
|
String AUART = maraTable.getString("AUART");
|
|
|
|
|
String MAUFNR = maraTable.getString("MAUFNR");
|
|
|
|
|
String PLNBEZ = maraTable.getString("PLNBEZ");
|
|
|
|
|
String MAKTX = maraTable.getString("MAKTX");
|
|
|
|
|
String EAN11 = maraTable.getString("EAN11");
|
|
|
|
|
String MTART = maraTable.getString("MTART");
|
|
|
|
|
String MTBEZ = maraTable.getString("MTBEZ");
|
|
|
|
|
String MATKL = maraTable.getString("MATKL");
|
|
|
|
|
String WGBEZ = maraTable.getString("WGBEZ");
|
|
|
|
|
String BRGEW = maraTable.getString("BRGEW");
|
|
|
|
|
String NTGEW = maraTable.getString("NTGEW");
|
|
|
|
|
String VOLUM = maraTable.getString("VOLUM");
|
|
|
|
|
String VOLEH = maraTable.getString("VOLEH");
|
|
|
|
|
String MEINS = maraTable.getString("MEINS");
|
|
|
|
|
String MEINH = maraTable.getString("MEINH");
|
|
|
|
|
String UMREZ = maraTable.getString("UMREZ");
|
|
|
|
|
String UMREN = maraTable.getString("UMREN");
|
|
|
|
|
String LVORM = maraTable.getString("LVORM");
|
|
|
|
|
String MENGE = maraTable.getString("MENGE");
|
|
|
|
|
String MHDHB = maraTable.getString("MHDHB");
|
|
|
|
|
String SPART = maraTable.getString("SPART");
|
|
|
|
|
String SPART_NM = maraTable.getString("SPART_NM");
|
|
|
|
|
String MVGR1 = maraTable.getString("MVGR1");
|
|
|
|
|
String MVGR1_NM = maraTable.getString("MVGR1_NM");
|
|
|
|
|
String MVGR2 = maraTable.getString("MVGR2");
|
|
|
|
|
String MVGR2_NM = maraTable.getString("MVGR2_NM");
|
|
|
|
|
String MVGR3 = maraTable.getString("MVGR3");
|
|
|
|
|
String MVGR3_NM = maraTable.getString("MVGR3_NM");
|
|
|
|
|
String MVGR4 = maraTable.getString("MVGR4");
|
|
|
|
|
String MVGR4_NM = maraTable.getString("MVGR4_NM");
|
|
|
|
|
String MVGR5 = maraTable.getString("MVGR5");
|
|
|
|
|
String MVGR5_NM = maraTable.getString("MVGR5_NM");
|
|
|
|
|
System.out.println("物料号:" + MATNR + " - 物料描述:" + MAKTX + " - 国际文件号(EAN/UPC):" + EAN11 + " - 物料类型:" + MTART );
|
|
|
|
|
String PWERK = maraTable.getString("PWERK");
|
|
|
|
|
String GAMNG = maraTable.getString("GAMNG");
|
|
|
|
|
String GMEIN = maraTable.getString("GMEIN");
|
|
|
|
|
String PLNNR = maraTable.getString("PLNNR");
|
|
|
|
|
String GSTRP = maraTable.getString("GSTRP");
|
|
|
|
|
String GLTRP = maraTable.getString("GLTRP");
|
|
|
|
|
String ERNAM = maraTable.getString("ERNAM");
|
|
|
|
|
String ERDAT = maraTable.getString("ERDAT");
|
|
|
|
|
String STTXT = maraTable.getString("STTXT");
|
|
|
|
|
System.out.println("订单号:" +AUFNR+" - 订单类型:" + AUART+ " - 上级订单编号:" + MAUFNR+ " - 物料号:" + PLNBEZ+ " - 物料描述(短文本):" + MAKTX
|
|
|
|
|
+ " - 订单的计划工厂:" + PWERK+ " - 订单数量总计:" + GAMNG+ " - 基本计量单位:" + GMEIN+ " - 任务清单组码:" + PLNNR+ " - 基本开始日期:" + GSTRP
|
|
|
|
|
+ " - 基本完成日期:" + GLTRP+ " - 输入者:" + ERNAM+ " - 创建日期:" + ERDAT+ " - 系统状态:" + STTXT);
|
|
|
|
|
}
|
|
|
|
|
// 循环输出 Table 数据
|
|
|
|
|
// for (int i = 0; i < maraTable.getNumRows(); i++) {
|
|
|
|
|
// maraTable.setRow(i);
|
|
|
|
|
// String MATNR = maraTable.getString("MATNR");
|
|
|
|
|
// String MAKTX = maraTable.getString("MAKTX");
|
|
|
|
|
// String EAN11 = maraTable.getString("EAN11");
|
|
|
|
|
// String MTART = maraTable.getString("MTART");
|
|
|
|
|
// String MTBEZ = maraTable.getString("MTBEZ");
|
|
|
|
|
// String MATKL = maraTable.getString("MATKL");
|
|
|
|
|
// String WGBEZ = maraTable.getString("WGBEZ");
|
|
|
|
|
// String BRGEW = maraTable.getString("BRGEW");
|
|
|
|
|
// String NTGEW = maraTable.getString("NTGEW");
|
|
|
|
|
// String VOLUM = maraTable.getString("VOLUM");
|
|
|
|
|
// String VOLEH = maraTable.getString("VOLEH");
|
|
|
|
|
// String MEINS = maraTable.getString("MEINS");
|
|
|
|
|
// String MEINH = maraTable.getString("MEINH");
|
|
|
|
|
// String UMREZ = maraTable.getString("UMREZ");
|
|
|
|
|
// String UMREN = maraTable.getString("UMREN");
|
|
|
|
|
// String LVORM = maraTable.getString("LVORM");
|
|
|
|
|
// String MENGE = maraTable.getString("MENGE");
|
|
|
|
|
// String MHDHB = maraTable.getString("MHDHB");
|
|
|
|
|
// String SPART = maraTable.getString("SPART");
|
|
|
|
|
// String SPART_NM = maraTable.getString("SPART_NM");
|
|
|
|
|
// String MVGR1 = maraTable.getString("MVGR1");
|
|
|
|
|
// String MVGR1_NM = maraTable.getString("MVGR1_NM");
|
|
|
|
|
// String MVGR2 = maraTable.getString("MVGR2");
|
|
|
|
|
// String MVGR2_NM = maraTable.getString("MVGR2_NM");
|
|
|
|
|
// String MVGR3 = maraTable.getString("MVGR3");
|
|
|
|
|
// String MVGR3_NM = maraTable.getString("MVGR3_NM");
|
|
|
|
|
// String MVGR4 = maraTable.getString("MVGR4");
|
|
|
|
|
// String MVGR4_NM = maraTable.getString("MVGR4_NM");
|
|
|
|
|
// String MVGR5 = maraTable.getString("MVGR5");
|
|
|
|
|
// String MVGR5_NM = maraTable.getString("MVGR5_NM");
|
|
|
|
|
// System.out.println("物料号:" + MATNR + " - 物料描述:" + MAKTX + " - 国际文件号(EAN/UPC):" + EAN11 + " - 物料类型:" + MTART );
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|