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