|
|
|
@ -594,5 +594,55 @@ public class SapItemSyncImpl implements SapItemSyncService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ZMES_103_MIGO函数取值说明:智慧工厂MIGO-103移动类型收货
|
|
|
|
|
* 字段 类型 长度 小数位 描述
|
|
|
|
|
* EBELN CHAR 10 0 采购凭证号
|
|
|
|
|
* EBELP NUMC 5 0 采购凭证的项目编号
|
|
|
|
|
* MATNR CHAR 18 0 物料号
|
|
|
|
|
* WERKS CHAR 4 0 工厂
|
|
|
|
|
* QUANTITY QUAN 13 3 数量
|
|
|
|
|
* @param mapList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public R temporarilyCollected(List<Map> mapList) {
|
|
|
|
|
try {
|
|
|
|
|
JCoRepository repository = dest.getRepository();
|
|
|
|
|
JCoFunction func = repository.getFunction("ZMES_103_MIGO");
|
|
|
|
|
if (func == null) {
|
|
|
|
|
throw new RuntimeException("Function does not exist in SAP");
|
|
|
|
|
}
|
|
|
|
|
log.info("来料暂收参数-------" + mapList.toString());
|
|
|
|
|
JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM");
|
|
|
|
|
System.out.println(L_ITEM);
|
|
|
|
|
for (Map map : mapList) {
|
|
|
|
|
L_ITEM.appendRow();
|
|
|
|
|
L_ITEM.setValue("EBELN", map.get("EBELN"));
|
|
|
|
|
L_ITEM.setValue("EBELP", map.get("EBELP"));
|
|
|
|
|
L_ITEM.setValue("MATNR", map.get("MATNR"));
|
|
|
|
|
L_ITEM.setValue("WERKS", map.get("WERKS"));
|
|
|
|
|
L_ITEM.setValue("QUANTITY", map.get("QUANTITY"));
|
|
|
|
|
}
|
|
|
|
|
System.out.println(L_ITEM);
|
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
|
/**
|
|
|
|
|
* RETCODE CHAR3 返回值:200-没有错误,500-有错误
|
|
|
|
|
* L_MSG CHAR220 返回消息文本
|
|
|
|
|
* MATERIALDOCUMENT CHAR10 物料凭证编号
|
|
|
|
|
* MATDOCUMENTYEAR NUMC4 物料凭证年度
|
|
|
|
|
*/
|
|
|
|
|
String RETCODE = func.getExportParameterList().getString("RETCODE");
|
|
|
|
|
String MESSAGE = func.getExportParameterList().getString("L_MSG");
|
|
|
|
|
String MATERIALDOCUMENT = func.getExportParameterList().getString("MATERIALDOCUMENT");
|
|
|
|
|
String MATDOCUMENTYEAR = func.getExportParameterList().getString("MATDOCUMENTYEAR");
|
|
|
|
|
System.out.println(RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR);
|
|
|
|
|
return R.ok();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error(e.getMessage());
|
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|