ERP接口调用公共方法。

Leon 4 years ago
parent 7152bfc137
commit bdbed490e8

@ -23,11 +23,18 @@ public class TmdMc {
@Test @Test
public void callErpWebService() throws RemoteException { public void callErpWebService() throws RemoteException {
String shopOrder = "SO20210714";
String stepId = "OP001";
//请求参数
ZprodordconfStruIn [] ins = new ZprodordconfStruIn[1];
ZprodordconfStruIn struIn = new ZprodordconfStruIn(); ZprodordconfStruIn struIn = new ZprodordconfStruIn();
//生产订单 //生产订单
struIn.setAufnr("SO20210714"); struIn.setAufnr(shopOrder);
//步骤标示 //步骤标示
struIn.setVornr("OP001"); struIn.setVornr(stepId);
struIn.setAueru("1"); struIn.setAueru("1");
//良品数量 //良品数量
struIn.setLmnga(new BigDecimal(10)); struIn.setLmnga(new BigDecimal(10));
@ -41,15 +48,23 @@ public class TmdMc {
struIn.setIsm04(new BigDecimal(1)); struIn.setIsm04(new BigDecimal(1));
struIn.setIsm05(new BigDecimal(1)); struIn.setIsm05(new BigDecimal(1));
struIn.setIsm06(new BigDecimal(1)); struIn.setIsm06(new BigDecimal(1));
ZprodordconfStruIn [] ins = new ZprodordconfStruIn[0];
ins[0] = struIn; ins[0] = struIn;
TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins); TableOfZprodordconfStruInHolder inHolder = new TableOfZprodordconfStruInHolder(ins);
//返回对象 //返回对象
ZprodordconfStruOut[] outs = new ZprodordconfStruOut[0]; ZprodordconfStruOut[] outs = new ZprodordconfStruOut[1];
outs[0] = new ZprodordconfStruOut();
ZprodordconfStruOut struOut = new ZprodordconfStruOut();
struOut.setAufnr(shopOrder);
struOut.setVornr(stepId);
struOut.setAueru("1");
struOut.setLmnga(new BigDecimal(1));
struOut.setRet("");
struOut.setMsg("");
outs[0] = struOut;
TableOfZprodordconfStruOutHolder outHolder = new TableOfZprodordconfStruOutHolder(outs); TableOfZprodordconfStruOutHolder outHolder = new TableOfZprodordconfStruOutHolder(outs);
//调用WS
String erpJson = ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder); String erpJson = ERPAPI.erpWebService().zmesProdordconf(inHolder, outHolder);
System.out.println("ERP接口返回" + erpJson); System.out.println("ERP接口返回" + erpJson);
} }

Loading…
Cancel
Save