|
|
@ -79,23 +79,25 @@ public class SapController extends BaseController {
|
|
|
|
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
|
|
|
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
|
|
|
List<Map<String, String>> dateSources = dateSources0.getData();
|
|
|
|
List<Map<String, String>> dateSources = dateSources0.getData();
|
|
|
|
dateSources.forEach(dateSource -> {
|
|
|
|
dateSources.forEach(dateSource -> {
|
|
|
|
logger.info("++++++++++++" + dateSource.get("poolName") + "++++product同步开始++++++++++");
|
|
|
|
if(!"ds_999".equals(dateSource.get("poolName"))){
|
|
|
|
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
|
|
|
|
logger.info("++++++++++++" + dateSource.get("poolName") + "++++product同步开始++++++++++");
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
|
|
|
|
Date maxTime0 = sapBomMapper.getProductMaxTime();
|
|
|
|
|
|
|
|
if(maxTime0 != null){
|
|
|
|
Date maxTime0 = sapBomMapper.getProductMaxTime();
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
if(maxTime0 != null){
|
|
|
|
calendar.setTime(maxTime0);
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
|
calendar.setTime(maxTime0);
|
|
|
|
Date maxTime = calendar.getTime();
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
|
qo.setLaeda(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
|
|
|
|
Date maxTime = calendar.getTime();
|
|
|
|
}
|
|
|
|
qo.setLaeda(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
R r = sapItemSyncService.itemSync(qo);
|
|
|
|
R r = sapItemSyncService.itemSync(qo);
|
|
|
|
if(r.getCode()!=200){
|
|
|
|
if(r.getCode()!=200){
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName")+"同步product失败,错误信息:"+ r.getMsg());
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName")+"同步product失败,错误信息:"+ r.getMsg());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "++++product同步结束++++++++++");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "++++product同步结束++++++++++");
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -115,23 +117,25 @@ public class SapController extends BaseController {
|
|
|
|
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
|
|
|
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
|
|
|
List<Map<String, String>> dateSources = dateSources0.getData();
|
|
|
|
List<Map<String, String>> dateSources = dateSources0.getData();
|
|
|
|
dateSources.forEach(dateSource -> {
|
|
|
|
dateSources.forEach(dateSource -> {
|
|
|
|
logger.info("++++++++++++" + dateSource.get("poolName") + "++++bom同步开始++++++++++");
|
|
|
|
if(!"ds_999".equals(dateSource.get("poolName"))) {
|
|
|
|
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
|
|
|
|
logger.info("++++++++++++" + dateSource.get("poolName") + "++++bom同步开始++++++++++");
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
|
|
|
|
Date maxTime0 = sapBomMapper.getProductMaxTime();
|
|
|
|
|
|
|
|
if(maxTime0 != null){
|
|
|
|
Date maxTime0 = sapBomMapper.getProductMaxTime();
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
if (maxTime0 != null) {
|
|
|
|
calendar.setTime(maxTime0);
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
|
calendar.setTime(maxTime0);
|
|
|
|
Date maxTime = calendar.getTime();
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
|
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
|
|
|
|
Date maxTime = calendar.getTime();
|
|
|
|
}
|
|
|
|
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
R r = sapBomService.bomSync(qo);
|
|
|
|
R r = sapBomService.bomSync(qo);
|
|
|
|
if(r.getCode()!=200){
|
|
|
|
if (r.getCode() != 200) {
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName")+"同步bom失败,错误信息:"+ r.getMsg());
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "同步bom失败,错误信息:" + r.getMsg());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "++++bom同步结束++++++++++");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "++++bom同步结束++++++++++");
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
|
|
|
|
|
|
|
@ -152,27 +156,28 @@ public class SapController extends BaseController {
|
|
|
|
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
|
|
|
R<List<Map<String, String>>> dateSources0 = remoteUserService.getPoolNameList(sysUser);
|
|
|
|
List<Map<String, String>> dateSources = dateSources0.getData();
|
|
|
|
List<Map<String, String>> dateSources = dateSources0.getData();
|
|
|
|
dateSources.forEach(dateSource -> {
|
|
|
|
dateSources.forEach(dateSource -> {
|
|
|
|
logger.info("++++++++++++" + dateSource.get("poolName") + "++++工艺同步开始++++++++++");
|
|
|
|
if(!"ds_999".equals(dateSource.get("poolName"))) {
|
|
|
|
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
|
|
|
|
logger.info("++++++++++++" + dateSource.get("poolName") + "++++工艺同步开始++++++++++");
|
|
|
|
|
|
|
|
DynamicDataSourceContextHolder.push(dateSource.get("poolName"));// 这是数据源的key
|
|
|
|
Date maxTime0 = sapBomMapper.getRouteMaxTime();
|
|
|
|
|
|
|
|
if(maxTime0 != null){
|
|
|
|
Date maxTime0 = sapBomMapper.getRouteMaxTime();
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
if (maxTime0 != null) {
|
|
|
|
calendar.setTime(maxTime0);
|
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
|
calendar.setTime(maxTime0);
|
|
|
|
Date maxTime = calendar.getTime();
|
|
|
|
calendar.add(Calendar.DAY_OF_YEAR, 1);
|
|
|
|
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
|
|
|
|
Date maxTime = calendar.getTime();
|
|
|
|
}
|
|
|
|
qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
|
|
|
|
qo.setWerks(dateSource.get("poolName").replace("ds_",""));//工厂
|
|
|
|
}
|
|
|
|
|
|
|
|
qo.setWerks(dateSource.get("poolName").replace("ds_", ""));//工厂
|
|
|
|
|
|
|
|
|
|
|
|
R r = sapRouterService.sapRouterSync(qo);
|
|
|
|
R r = sapRouterService.sapRouterSync(qo);
|
|
|
|
if(r.getCode()!=200){
|
|
|
|
if (r.getCode() != 200) {
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName")+"同步工艺失败,错误信息:"+ r.getMsg());
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "同步工艺失败,错误信息:" + r.getMsg());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "++++工艺同步结束++++++++++");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
logger.error("++++++++++++" + dateSource.get("poolName") + "++++工艺同步结束++++++++++");
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|