|
|
|
@ -8,9 +8,6 @@ import com.op.common.core.utils.DateUtils;
|
|
|
|
|
import com.op.common.core.utils.StringUtils;
|
|
|
|
|
import com.op.common.core.utils.bean.BeanValidators;
|
|
|
|
|
import com.op.common.core.utils.uuid.IdUtils;
|
|
|
|
|
import com.op.common.core.utils.uuid.UUID;
|
|
|
|
|
import com.op.common.core.web.domain.AjaxResult;
|
|
|
|
|
import com.op.sap.domain.vo.SapRouterQuery;
|
|
|
|
|
import com.op.sap.mapper.*;
|
|
|
|
|
import com.op.sap.service.SapRouterService;
|
|
|
|
|
import com.op.sap.util.SAPConnUtils;
|
|
|
|
@ -18,8 +15,6 @@ import com.op.system.api.domain.sap.*;
|
|
|
|
|
import com.sap.conn.jco.*;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.web.server.ServerErrorException;
|
|
|
|
|
|
|
|
|
|
import javax.validation.Validator;
|
|
|
|
|
import java.rmi.ServerException;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
@ -77,7 +72,7 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
S_MATNR.setValue("OPTION", "EQ");
|
|
|
|
|
S_MATNR.setValue("LOW", sapRouterQuery.getMatnr());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getMatnr())){
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getWerks())){
|
|
|
|
|
JCoTable S_WERKS = func.getTableParameterList().getTable("S_WERKS");
|
|
|
|
|
S_WERKS.appendRow();
|
|
|
|
|
S_WERKS.setValue("SIGN", "I");
|
|
|
|
@ -85,14 +80,14 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
S_WERKS.setValue("LOW", sapRouterQuery.getWerks());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getMatnr())){
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getArbpl())){
|
|
|
|
|
JCoTable S_ARBPL = func.getTableParameterList().getTable("S_ARBPL");
|
|
|
|
|
S_ARBPL.appendRow();
|
|
|
|
|
S_ARBPL.setValue("SIGN", "I");
|
|
|
|
|
S_ARBPL.setValue("OPTION", "EQ");
|
|
|
|
|
S_ARBPL.setValue("LOW", sapRouterQuery.getArbpl());
|
|
|
|
|
}
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getMatnr())){
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getAndat())){
|
|
|
|
|
JCoTable S_ANDAT = func.getTableParameterList().getTable("S_ANDAT");
|
|
|
|
|
S_ANDAT.appendRow();
|
|
|
|
|
S_ANDAT.setValue("SIGN", "I");
|
|
|
|
@ -101,7 +96,7 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
S_ANDAT.setValue("HIGH", END_DATE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getMatnr())){
|
|
|
|
|
if (!StringUtils.isNull(sapRouterQuery.getAedat())){
|
|
|
|
|
JCoTable S_AEDAT = func.getTableParameterList().getTable("S_AEDAT");
|
|
|
|
|
S_AEDAT.appendRow();
|
|
|
|
|
S_AEDAT.setValue("SIGN", "I");
|
|
|
|
@ -120,7 +115,7 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
|
|
|
|
|
System.out.println("###" + metaData.toString());
|
|
|
|
|
List<SapProRoute> sapProRouteList=new ArrayList<>();
|
|
|
|
|
DynamicDataSourceContextHolder.push("ds_1000");
|
|
|
|
|
//DynamicDataSourceContextHolder.push("ds_1000");//controller已经完成切换
|
|
|
|
|
for (int i = 0; i <maraTable.getNumRows(); i++) {
|
|
|
|
|
SapProProcess sapProProcess=new SapProProcess();
|
|
|
|
|
maraTable.setRow(i);
|
|
|
|
@ -236,6 +231,7 @@ public class SapRouterServiceImpl implements SapRouterService {
|
|
|
|
|
sapProRoute.setRouteDesc(KTEXT);
|
|
|
|
|
sapProRoute.setEnableFlag("Y");
|
|
|
|
|
sapProRoute.setCreateBy(ANNAM);
|
|
|
|
|
sapProRoute.setAttr1("job");//说明是来自定时任务
|
|
|
|
|
sapProRoute.setCreateTime(DateUtils.dateTime("yyyy-MM-dd", ANDAT));
|
|
|
|
|
sapProRoute.setRouteVersion("1.0");
|
|
|
|
|
sapProRouteMapper.insertProRoute(sapProRoute);
|
|
|
|
|