|
|
@ -9,6 +9,7 @@ import com.op.common.core.utils.StringUtils;
|
|
|
|
import com.op.common.core.utils.bean.BeanValidators;
|
|
|
|
import com.op.common.core.utils.bean.BeanValidators;
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
import com.op.common.security.utils.SecurityUtils;
|
|
|
|
import com.op.sap.domain.vo.SapItemQuery;
|
|
|
|
import com.op.sap.domain.vo.SapItemQuery;
|
|
|
|
|
|
|
|
import com.op.sap.domain.vo.SapMaterialPosting;
|
|
|
|
import com.op.sap.mapper.SapBaseProductMapper;
|
|
|
|
import com.op.sap.mapper.SapBaseProductMapper;
|
|
|
|
import com.op.sap.service.SapItemSyncService;
|
|
|
|
import com.op.sap.service.SapItemSyncService;
|
|
|
|
import com.op.sap.util.SAPConnUtils;
|
|
|
|
import com.op.sap.util.SAPConnUtils;
|
|
|
@ -191,6 +192,28 @@ public class SapItemSyncImpl implements SapItemSyncService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public R sapMaterialPosting(SapMaterialPosting sapMaterialPosting) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
// 获取调用 RFC 函数对象
|
|
|
|
|
|
|
|
//获取连接
|
|
|
|
|
|
|
|
JCoDestination dest = SAPConnUtils.connect();
|
|
|
|
|
|
|
|
JCoRepository repository = dest.getRepository();
|
|
|
|
|
|
|
|
JCoFunction func = repository.getFunction("ZPPR_MES_GOODSMVT_CREATE");
|
|
|
|
|
|
|
|
// 配置传入参数
|
|
|
|
|
|
|
|
JCoTable jCoTable = func.getTableParameterList().getTable("L_ITEM");
|
|
|
|
|
|
|
|
System.out.println(jCoTable);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (func == null) {
|
|
|
|
|
|
|
|
throw new RuntimeException("Function does not exist in SAP");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return R.ok();
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String importProducts(List<SapBaseProduct> sapBaseProductList){
|
|
|
|
public String importProducts(List<SapBaseProduct> sapBaseProductList){
|
|
|
|
if (StringUtils.isNull(sapBaseProductList) || sapBaseProductList.size() == 0)
|
|
|
|
if (StringUtils.isNull(sapBaseProductList) || sapBaseProductList.size() == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|