wms修改9.2

master
mengjiao 1 year ago
parent b27e18f403
commit 4dced6b421

@ -85,10 +85,10 @@ public interface RemoteSapService {
public R sapProductWarehousing(@RequestBody(required = false) List<Map<String, Object>> mapList);
/**获取采购订单*/
@PostMapping("/sapPurchaseOrderSync")
@PostMapping("/sap/sapPurchaseOrderSync")
public R sapPurchaseOrderSync(@RequestBody SapPurchaseOrderQuery sapPurchaseOrderQuery);
/**采购订单收货过账*/
@PostMapping("/sapPOrderGoodsReceipt")
@PostMapping("/sap/sapPOrderGoodsReceipt")
public R sapPOrderGoodsReceipt(@RequestBody(required = false) List<Map<String, Object>> mapList);
}

@ -3,12 +3,9 @@ package com.op.sap.service;
import com.op.common.core.domain.R;
import com.op.sap.domain.vo.SapOrderReceiptQuery;
import com.op.sap.domain.vo.SapPurchaseOrderQuery;
import com.op.system.api.domain.sap.SapPurchaseOrderQuery;//SapPurchaseOrderQuery
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapShopOrderQuery;
import com.op.system.api.domain.sap.*;
import com.op.system.api.model.SapProOrder;
import java.util.List;

@ -8,13 +8,10 @@ import com.op.common.core.utils.StringUtils;
import com.op.common.core.utils.uuid.IdUtils;
import com.op.sap.domain.vo.SapOrderReceiptQuery;
import com.op.sap.domain.vo.SapPurchaseOrderQuery;
import com.op.sap.service.SapOrderService;
import com.op.system.api.domain.sap.SapCloseOrderQuery;
import com.op.system.api.domain.sap.SapCreateOrder;
import com.op.system.api.domain.sap.SapRFW;
import com.op.system.api.domain.sap.SapShopOrderQuery;
import com.op.system.api.domain.sap.*;
import com.op.system.api.model.SapProOrder;
import com.sap.conn.jco.*;

@ -184,8 +184,15 @@ public WmsToWCSDTO packingMaterialsOutBoundCompleted(@RequestBody WmsToWCSDTO wc
Integer result= odsProcureOrderService.ProductionMaterialRequisitionAdd(orderList);
return success(result);
}
/**
*
* @param odsProcureOrder
* @return
*/
@PostMapping("/sapPurchaseOrderSync")
public AjaxResult sapPurchaseOrderSync(@RequestBody OdsProcureOrder odsProcureOrder){
AjaxResult result= odsProcureOrderService.sapPurchaseOrderSync(odsProcureOrder);
return result;
}

@ -8,10 +8,7 @@ import com.alibaba.fastjson.JSONObject;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import com.op.common.core.domain.R;
@ -22,6 +19,7 @@ import com.op.common.security.utils.SecurityUtils;
import com.op.system.api.RemoteSapService;
import com.op.system.api.domain.sap.SapBackflushMPQuery;
import com.op.system.api.domain.sap.SapMaterialPosting;
import com.op.system.api.domain.sap.SapPurchaseOrderQuery;
import okhttp3.OkHttpClient;
import okhttp3.MediaType;
import okhttp3.RequestBody;
@ -30,6 +28,7 @@ import okhttp3.Response;
import java.io.IOException;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.utils.uuid.IdUtils;
@ -554,13 +553,19 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
sapBackflushMPQueryList.add(sapBackflushMPQuery);
R result2= remoteSapService.sapBackflushMP(sapBackflushMPQueryList);//x
int code= result2.getCode();
String msg= result2.getMsg();
odsProcureOutOrder.setUserDefined11(msg);
if (code==200){//过账成功
Map map=new HashMap();
map= (Map) result2.getData();
String userDefined9= (String) map.get("MATERIALDOCUMENT");
odsProcureOutOrder.setUserDefined9(userDefined9);
odsProcureOutOrder.setUserDefined10("2");//成功
odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder);
}else {//
odsProcureOutOrder.setUserDefined9("");
odsProcureOutOrder.setUserDefined10("3");//失败
odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder);
}
@ -578,14 +583,20 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
sapMaterialPosting.setBatch(odsProcureOutOrder.getUserDefined2()); //批号
sapMaterialPostingList.add(sapMaterialPosting);
R result= remoteSapService.sapMaterialPosting(sapMaterialPostingList);
int code= result.getCode();
String msg= result.getMsg();
odsProcureOutOrder.setUserDefined11(msg);
if (code==200){//过账成功
Map map=new HashMap();
map= (Map) result.getData();
String userDefined9= (String) map.get("MATERIALDOCUMENT");
odsProcureOutOrder.setUserDefined9(userDefined9);
odsProcureOutOrder.setUserDefined10("2");//成功
odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder);
}else {//
odsProcureOutOrder.setUserDefined9("");
odsProcureOutOrder.setUserDefined10("3");//失败
odsProcureOutOrderMapper.updateOdsProcureOutOrderByid(odsProcureOutOrder);
}
@ -597,7 +608,13 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
@Override
public AjaxResult sapPurchaseOrderSync(OdsProcureOrder odsProcureOrder) {
//remoteSapService.sapPurchaseOrderSync();
DynamicDataSourceContextHolder.push("ds_" +odsProcureOrder.getFactoryCode());
SapPurchaseOrderQuery sapPurchaseOrderQuery=new SapPurchaseOrderQuery();
sapPurchaseOrderQuery.setEbeln(odsProcureOrder.getProcureCode());
R result= remoteSapService.sapPurchaseOrderSync(sapPurchaseOrderQuery);
List<SapPurchaseOrderQuery> sapPurchaseOrderQueryList=new ArrayList<>();
sapPurchaseOrderQueryList= (List<SapPurchaseOrderQuery>) result.getData();
// sapPurchaseOrderQueryList
return null;
}

Loading…
Cancel
Save