fix:修改产品入库

This commit is contained in:
郭飞 2025-03-24 14:06:33 +08:00
parent 3e9ea3c6cc
commit 6e75aeb6d1
2 changed files with 29 additions and 13 deletions

View File

@ -359,10 +359,11 @@ public class ToSAPServiceImpl {
// 将消息记录log表 // 将消息记录log表
ErpMessageLog erplog = new ErpMessageLog(); ErpMessageLog erplog = new ErpMessageLog();
erplog.setEventUser(user); erplog.setEventUser(user);
erplog.setServerName("WmsToErp"); erplog.setServerName("WmsToSAP");
erplog.setEventName("FGStockIn"); erplog.setEventName("MatailInReverse");
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT)); erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
// erplog.setMessageId(RECEIVEACTNO); // erplog.setMessageId(undoId);
erplog.setMessageId(undoId);
erplog.setSendMsg2(makeFGStockIn); erplog.setSendMsg2(makeFGStockIn);
erplog.setSendMsg(makeFGStockIn); erplog.setSendMsg(makeFGStockIn);
erplog.setReturnMsg2(sapreturn); erplog.setReturnMsg2(sapreturn);
@ -723,24 +724,24 @@ public class ToSAPServiceImpl {
// itemsData.add(item); // itemsData.add(item);
// //
// } // }
// String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData); //String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData);
Map<String,Object> headData = new HashMap<>(); JSONObject MainData = new JSONObject(true);
Map<String,Object> bodyData = new HashMap<>();
Map<String,String> headJSonData = new HashMap<>(); Map<String,String> headJSonData = new HashMap<>();
Map<String,String> bodyJSonData = new HashMap<>(); Map<String,String> bodyJSonData = new HashMap<>();
headData.put("HEAD",headJSonData); MainData.put("HEAD",headJSonData);
bodyData.put("BODY",bodyJSonData); MainData.put("BODY",bodyJSonData);
headJSonData.put("INTF_ID",""); headJSonData.put("INTF_ID","");
headJSonData.put("SRC_SYSTEM",""); headJSonData.put("SRC_SYSTEM","WMS");
headJSonData.put("DEST_SYSTEM","SAP");
headJSonData.put("SRC_MSGID",""); headJSonData.put("SRC_MSGID","");
headJSonData.put("BACKUP1",""); headJSonData.put("BACKUP1","");
headJSonData.put("BACKUP2",""); headJSonData.put("BACKUP2","");
bodyJSonData.put("MBLNR", ""); bodyJSonData.put("MBLNR", undoId);
bodyJSonData.put("MJAHR", ""); bodyJSonData.put("MJAHR", "2025");
String sendData = ""; String sendData = MainData.toJSONString();
return sendData; return sendData;
} }
public String qtrNoInvoice(String receiveRequestName, String siteName, String reActo, String user) { public String qtrNoInvoice(String receiveRequestName, String siteName, String reActo, String user) {

View File

@ -294,6 +294,9 @@ public class ProductIntoServiceImpl implements FGStockInService {
throw new Exception("请选择正确的入库信息"); throw new Exception("请选择正确的入库信息");
} }
EventInfo eventInfo = EventInfoUtil.makeEventInfo("receiveMesShippInfo", user, "receiveMesShippInfo"); EventInfo eventInfo = EventInfoUtil.makeEventInfo("receiveMesShippInfo", user, "receiveMesShippInfo");
List<MaterialPackingKey> arrayList = new ArrayList<MaterialPackingKey> ();
//将查询的结果写入MaterialPacking表 //将查询的结果写入MaterialPacking表
for(int i=0;i<packingList.size();i++){ for(int i=0;i<packingList.size();i++){
//util将实体类中有值的放到map //util将实体类中有值的放到map
@ -303,12 +306,24 @@ public class ProductIntoServiceImpl implements FGStockInService {
packingList1.setMaterialPackingName(packingList.get(i).getMaterialPackingName()); packingList1.setMaterialPackingName(packingList.get(i).getMaterialPackingName());
packingList1.setUserColumns(stringObjectMap); packingList1.setUserColumns(stringObjectMap);
MaterialPackingServiceProxy.getMaterialPackingService().create(eventInfo, packingList1); MaterialPackingServiceProxy.getMaterialPackingService().create(eventInfo, packingList1);
MaterialPackingKey materialPackingKey = new MaterialPackingKey("SDK",packingList.get(i).getMaterialPackingName());
arrayList.add(materialPackingKey);
} }
//调用Sap入库接口 //调用Sap入库接口
List<ToSAPFgStockInDto> fgStockInInfo = toSapDao.getFgStockInInfo(boxList); List<ToSAPFgStockInDto> fgStockInInfo = toSapDao.getFgStockInInfo(boxList);
//封装为Json的字符串 //封装为Json的字符串
String json = JSON.toJSONString(fgStockInInfo); String json = JSON.toJSONString(fgStockInInfo);
String undoID = toSAPService.FGStockInByManulIn(json, user); //现sap没有手动直接入库
// String undoID = toSAPService.FGStockInByManulIn(json, user);
//手动先入到线边仓再转库
String aimErpFactory = boxList.get(0).getErpFactory();
String aimErpLocation = boxList.get(0).getErpLocation();
String aimLOcationName = boxList.get(0).getLocationName();
String undoID = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, user );
//更新物料凭证和库存状态 //更新物料凭证和库存状态