|
|
@ -18,7 +18,9 @@ import com.sap.conn.jco.*;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
@Service
|
|
|
@ -141,7 +143,7 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public R<List<String>> SapCreateOrder(List<SapCreateOrder> sapCreateOrderList) {
|
|
|
|
public R<List<Map<String, String>>> SapCreateOrder(List<SapCreateOrder> sapCreateOrderList) {
|
|
|
|
String L_MSG=null;
|
|
|
|
String L_MSG=null;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//获取连接
|
|
|
|
//获取连接
|
|
|
@ -154,9 +156,9 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
|
|
|
|
|
|
|
|
// 配置传入参数
|
|
|
|
// 配置传入参数
|
|
|
|
JCoParameterList jCoParameterList = func.getImportParameterList();
|
|
|
|
JCoParameterList jCoParameterList = func.getImportParameterList();
|
|
|
|
List<String> LV_ORDER_NUM_List=new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sapCreateOrderList!=null && sapCreateOrderList.size()>0){
|
|
|
|
if (sapCreateOrderList!=null && sapCreateOrderList.size()>0){
|
|
|
|
|
|
|
|
List<Map<String,String>> LV_ORDER_NUM_List=new ArrayList<>();
|
|
|
|
for (SapCreateOrder sapCreateOrder:sapCreateOrderList){
|
|
|
|
for (SapCreateOrder sapCreateOrder:sapCreateOrderList){
|
|
|
|
jCoParameterList.setValue("P_WERKS",sapCreateOrder.getWerks());
|
|
|
|
jCoParameterList.setValue("P_WERKS",sapCreateOrder.getWerks());
|
|
|
|
jCoParameterList.setValue("P_AUFPAR",sapCreateOrder.getAufpar());
|
|
|
|
jCoParameterList.setValue("P_AUFPAR",sapCreateOrder.getAufpar());
|
|
|
@ -169,17 +171,24 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
System.out.println(J);
|
|
|
|
System.out.println(J);
|
|
|
|
L_MSG= func.getExportParameterList().getString("L_MSG");
|
|
|
|
L_MSG= func.getExportParameterList().getString("L_MSG");
|
|
|
|
String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER");
|
|
|
|
String LV_ORDER_NUMBER= func.getExportParameterList().getString("LV_ORDER_NUMBER");
|
|
|
|
if (!StringUtils.isEmpty(LV_ORDER_NUMBER)){
|
|
|
|
|
|
|
|
LV_ORDER_NUM_List.add(LV_ORDER_NUMBER);
|
|
|
|
JCoTable LT_ZGD=func.getTableParameterList().getTable("LT_ZGD");
|
|
|
|
}else {
|
|
|
|
System.out.println(LT_ZGD);
|
|
|
|
return R.fail(L_MSG);
|
|
|
|
//DynamicDataSourceContextHolder.push("ds_1000");//controller已经完成切换
|
|
|
|
|
|
|
|
for (int i = 0; i <LT_ZGD.getNumRows(); i++) {
|
|
|
|
|
|
|
|
LT_ZGD.setRow(i);
|
|
|
|
|
|
|
|
Map map=new HashMap();
|
|
|
|
|
|
|
|
String LEAD_AUFNR = LT_ZGD.getString("LEAD_AUFNR");
|
|
|
|
|
|
|
|
String AUFNR = LT_ZGD.getString("AUFNR");
|
|
|
|
|
|
|
|
map.put("LEAD_AUFNR",LEAD_AUFNR);
|
|
|
|
|
|
|
|
map.put("AUFNR",AUFNR);
|
|
|
|
|
|
|
|
LV_ORDER_NUM_List.add(map);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return R.ok(LV_ORDER_NUM_List,L_MSG);
|
|
|
|
return R.ok(LV_ORDER_NUM_List,L_MSG);
|
|
|
|
}else {
|
|
|
|
}else {
|
|
|
|
return R.fail("接收的数据为空");
|
|
|
|
return R.fail("接收的数据为空");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|
return R.fail(L_MSG);
|
|
|
|
return R.fail(L_MSG);
|
|
|
|
}
|
|
|
|
}
|
|
|
|