wms的报检报表接口2

master
mengjiao 3 months ago
parent 34c9460106
commit 7c4011434f

@ -190,6 +190,8 @@ public class SapWmsServicelmpl implements SapWmsService {
L_ITEM.appendRow(); L_ITEM.appendRow();
L_ITEM.setValue("COSTCENTER", stringObjectMap.get("COSTCENTER"));//成本中心 L_ITEM.setValue("COSTCENTER", stringObjectMap.get("COSTCENTER"));//成本中心
L_ITEM.setValue("PLANT", stringObjectMap.get("PLANT"));//工厂 L_ITEM.setValue("PLANT", stringObjectMap.get("PLANT"));//工厂
L_ITEM.setValue("GL_ACCOUNT", stringObjectMap.get("GL_ACCOUNT"));//总帐科目编号
L_ITEM.setValue("GR_RCPT", stringObjectMap.get("GR_RCPT"));//收货方/运达方
L_ITEM.setValue("LGORT", stringObjectMap.get("LGORT"));//库存地点 L_ITEM.setValue("LGORT", stringObjectMap.get("LGORT"));//库存地点
L_ITEM.setValue("MATNR", stringObjectMap.get("MATNR"));//物料号 L_ITEM.setValue("MATNR", stringObjectMap.get("MATNR"));//物料号
L_ITEM.setValue("QUANTITY", stringObjectMap.get("QUANTITY"));//数量 L_ITEM.setValue("QUANTITY", stringObjectMap.get("QUANTITY"));//数量
@ -239,11 +241,11 @@ public class SapWmsServicelmpl implements SapWmsService {
try { try {
JCoRepository repository = dest.getRepository(); JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_961_MB1A"); JCoFunction func = repository.getFunction("ZMES_962_MB1A");
if (func == null) { if (func == null) {
throw new RuntimeException("Function does not exist in SAP"); throw new RuntimeException("Function does not exist in SAP");
} }
log.info("成品ZMES_201_MB1A-------" + mapList.toString()); log.info("ZMES_962_MB1A-------" + mapList.toString());
/** /**
AUFNR AUFNR
POSNR POSNR
@ -269,7 +271,9 @@ public class SapWmsServicelmpl implements SapWmsService {
JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM"); JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM");
for (Map<String, Object> stringObjectMap : mapList) { for (Map<String, Object> stringObjectMap : mapList) {
L_ITEM.appendRow(); L_ITEM.appendRow();
L_ITEM.setValue("COSTCENTER", stringObjectMap.get("COSTCENTER"));//成本中心 L_ITEM.setValue("AUFNR", stringObjectMap.get("AUFNR"));//订单号
L_ITEM.setValue("GL_ACCOUNT", stringObjectMap.get("GL_ACCOUNT"));//总帐科目编号
L_ITEM.setValue("GR_RCPT", stringObjectMap.get("GR_RCPT"));//收货方/运达方
L_ITEM.setValue("PLANT", stringObjectMap.get("PLANT"));//工厂 L_ITEM.setValue("PLANT", stringObjectMap.get("PLANT"));//工厂
L_ITEM.setValue("LGORT", stringObjectMap.get("LGORT"));//库存地点 L_ITEM.setValue("LGORT", stringObjectMap.get("LGORT"));//库存地点
L_ITEM.setValue("MATNR", stringObjectMap.get("MATNR"));//物料号 L_ITEM.setValue("MATNR", stringObjectMap.get("MATNR"));//物料号

@ -489,7 +489,8 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
List<OdsProcureOutOrder> orderList1 = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderSpecialByIDs(orderList); List<OdsProcureOutOrder> orderList1 = odsProcureOutOrderMapper.selectWmsOdsProcureOutOrderSpecialByIDs(orderList);
for (OdsProcureOutOrder order: for (OdsProcureOutOrder order:
orderList1 ) { orderList1 ) {
if ("成本中心".equals(orderList1.get(0).getUserDefined6())){//区分出来内部订单 if ("成本中心".equals(orderList1.get(0).getUserDefined6())){
//区分出来内部订单
Map paramMap=new HashMap<>(); Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>(); List<Map> mapList = new ArrayList<>();
paramMap.put("GL_ACCOUNT", order.getUserDefined2());//总帐科目编号 paramMap.put("GL_ACCOUNT", order.getUserDefined2());//总帐科目编号
@ -534,12 +535,15 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
order1.setUserDefined11(msg);//信息 order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1); odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1);
} }
//这个地方需要对
}else { }else {
//内部订单 //内部订单
Map paramMap=new HashMap<>(); Map paramMap=new HashMap<>();
List<Map> mapList = new ArrayList<>(); List<Map> mapList = new ArrayList<>();
paramMap.put("COSTCENTER", order.getUserDefined3());// paramMap.put("AUFNR", order.getProduceCode());//
paramMap.put("GL_ACCOUNT", order.getUserDefined2());//
paramMap.put("GR_RCPT", order.getUserDefined4());//收货方/运达方
paramMap.put("PLANT", order.getSiteCode());//工厂 paramMap.put("PLANT", order.getSiteCode());//工厂
paramMap.put("LGORT", order.getLocCode());//库存地点 paramMap.put("LGORT", order.getLocCode());//库存地点
paramMap.put("MATNR", order.getMaterialCode());// paramMap.put("MATNR", order.getMaterialCode());//
@ -551,6 +555,35 @@ public class OdsProcureOutOrderServiceImpl implements IOdsProcureOutOrderService
mapList.add(paramMap); mapList.add(paramMap);
// R result2 = remoteSapService.sapProductOutboundCostTWO(mapList); // R result2 = remoteSapService.sapProductOutboundCostTWO(mapList);
R result2 = remoteSapService.sapProductOutboundCostTW(mapList); R result2 = remoteSapService.sapProductOutboundCostTW(mapList);
int code = result2.getCode();
OdsProcureOutOrder order1 = new OdsProcureOutOrder();
String msg = result2.getMsg();
order.setUserDefined11(msg);
if (code== 200){
//过账成功
Map map = new HashMap();
map = (Map) result2.getData();
String userDefined9 = (String) map.get("MATERIALDOCUMENT");
//order.setUserDefined9(userDefined9);
// order.setUserDefined10("2");//成功
// for (OdsProcureOutOrder order2:
// orderList2 ) {
order1.setID(order.getID());
order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("2");//1是未过账2是成功3是失败
order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialById(order1);
// }
}else {
order1.setID(order.getID());
// order1.setSapNumber(order.getOutNumber());//成功..这个是否的outNumber是用已出库减去已经过账的数量
order1.setUserDefined10("3");//1是未过账2是成功3是失败
// order1.setUserDefined9(userDefined9);//凭证
order1.setUserDefined11(msg);//信息
odsProcureOutOrderMapper.updateWMSOdsProcureOutOrdersapSpecialTWById(order1);
}
} }
} }

Loading…
Cancel
Save