数据源修改

This commit is contained in:
xiang2lin 2024-07-09 17:53:05 +08:00
parent ef8f21e525
commit 15c8dcc302
5 changed files with 20 additions and 11 deletions

View File

@ -107,6 +107,7 @@ public class SeeyonExtPluginInitializer extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
try {
logger.info("重试插件:{}",JSONObject.toJSON(requestJson));
//重试方法
if (null != requestJson){
//JSONObject jsonStr = requestJson.getJSONObject("jsonStr");

View File

@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
@ -23,6 +24,8 @@ import java.util.List;
public class CustomerPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${oa.datasource_code}")
public String dataSourceCode;
@Autowired
private IFormmain0226Service formmain0226Service;
@Autowired
@ -105,12 +108,12 @@ public class CustomerPluginInitializer extends PluginBaseEntity {
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("开始执行OA客户同步U8定时任务");
logger.info("开始执行OA客户同步U8定时任务:{}",JSONObject.toJSONString(requestJson));
//1查询OA审批完成且未推送U8的客户申请
Formmain0226Entity formmain0226Entity = new Formmain0226Entity();
formmain0226Entity.setFinishedflag("1");
formmain0226Entity.setField0028Flag("1");
formmain0226Entity.setDataSourceCode(YdcConstant.dataSourceCode);
formmain0226Entity.setDataSourceCode(dataSourceCode);
List<Formmain0226Entity> list = formmain0226Service.query(formmain0226Entity);
if (CollectionUtils.isNotEmpty(list)){
for (Formmain0226Entity f : list) {
@ -128,7 +131,7 @@ public class CustomerPluginInitializer extends PluginBaseEntity {
logger.error("OA客户档案同步U8出错:{}", e);
} finally {
f.setField0028("1");
f.setDataSourceCode(YdcConstant.dataSourceCode);
f.setDataSourceCode(dataSourceCode);
formmain0226Service.updateFlag(f);
}
}

View File

@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
@ -23,12 +24,13 @@ import java.util.List;
public class InventoryPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
static String dataSourceCode = "ydc_oa_sqlserver_test";
@Autowired
private ISeeYonInterFace seeYonInterFace;
@Autowired
private IFormmain0227Service formmain0227Service;
@Value("${oa.datasource_code}")
public String dataSourceCode;
/***
* 插件初始化方法
* @Author 👻👻👻👻👻👻👻👻 gjh
@ -106,13 +108,13 @@ public class InventoryPluginInitializer extends PluginBaseEntity {
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("开始执行OA存货同步U8定时任务");
logger.info("开始执行OA存货同步U8定时任务{}",JSONObject.toJSONString(requestJson));
//1查询OA审批完成且未推送U8的存货申请
Formmain0227Entity formmain0227 = new Formmain0227Entity();
formmain0227.setFinishedflag("1");
formmain0227.setField0022Flag("1");
//formmain0227.setId("-8891720615522383237");
formmain0227.setDataSourceCode(YdcConstant.dataSourceCode);
formmain0227.setDataSourceCode(dataSourceCode);
List<Formmain0227Entity> list = formmain0227Service.query(formmain0227);
if (CollectionUtils.isNotEmpty(list)){
for (Formmain0227Entity f : list) {
@ -130,7 +132,7 @@ public class InventoryPluginInitializer extends PluginBaseEntity {
logger.error("OA存货档案同步U8出错:{}",e);
}finally {
f.setField0022("1");
f.setDataSourceCode(YdcConstant.dataSourceCode);
f.setDataSourceCode(dataSourceCode);
formmain0227Service.updateFlag(f);
}
}

View File

@ -12,6 +12,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import java.util.List;
@ -23,6 +24,8 @@ import java.util.List;
public class SupplierPluginInitializer extends PluginBaseEntity {
Logger logger = LoggerFactory.getLogger(getClass());
@Value("${oa.datasource_code}")
public String dataSourceCode;
@Autowired
private IFormmain0225Service formmain0225Service;
@Autowired
@ -106,12 +109,12 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
**/
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("开始执行OA供应商同步U8定时任务");
logger.info("开始执行OA供应商同步U8定时任务:{}",JSONObject.toJSONString(requestJson));
//1查询OA审批完成且为推送U8的供应商申请
Formmain0225Entity formmain0225Entity = new Formmain0225Entity();
formmain0225Entity.setFinishedflag("1");
formmain0225Entity.setField0025Flag("1");
formmain0225Entity.setDataSourceCode(YdcConstant.dataSourceCode);
formmain0225Entity.setDataSourceCode(dataSourceCode);
List<Formmain0225Entity> list = formmain0225Service.query(formmain0225Entity);
if (CollectionUtils.isNotEmpty(list)) {
for (Formmain0225Entity f : list) {
@ -130,7 +133,7 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
logger.error("OA供应商档案同步U8出错:{}", e);
} finally {
f.setField0025("1");
f.setDataSourceCode(YdcConstant.dataSourceCode);
f.setDataSourceCode(dataSourceCode);
formmain0225Service.updateFlag(f);
}
}

View File

@ -7,5 +7,5 @@ package com.hzya.frame.plugin.ydc.plugin;
**/
public class YdcConstant {
public static String dataSourceCode = "ydc_oa_sqlserver";
//public static String dataSourceCode = "ydc_oa_sqlserver";
}