增强插件执行的健壮性

在多个插件的executeBusiness方法中添加了try-catch结构,以捕获和记录异常。这样可以避免因未处理的异常而导致的程序崩溃,提高了代码的健壮性。
This commit is contained in:
liuy 2024-10-18 14:55:40 +08:00
parent bb7ef33c9d
commit 7c0daa89a7
20 changed files with 497 additions and 449 deletions

View File

@ -89,30 +89,34 @@ public class CustdocAutoAllotPluginInitializer extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
start(split[0], split[1]);
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
start(split[0], split[1]);
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
if (param != null && !"".equals(param)) {
start(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
start(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
start();
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
if (param != null && !"".equals(param)) {
start(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
start(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
start();
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -116,7 +116,7 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -127,7 +127,7 @@ public class KitPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -136,7 +136,7 @@ public class SKUClassPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -128,7 +128,7 @@ public class SKUPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -124,7 +124,7 @@ public class SKUSealPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -102,30 +102,34 @@ public class ShopPluginInitializer extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
startImplement(split[0], split[1]);
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
startImplement(split[0], split[1]);
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
startImplement(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
startImplement();
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
startImplement(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
startImplement();
} catch (Exception e) {
logger.error("executeBusiness", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -100,31 +100,35 @@ public class SupplierPluginInitializer extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
try {
logger.info("调用:" + getPluginName() + "-插件");
String prod = "prod";
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
String param = String.valueOf(requestJson.get("param"));
if (requestJson != null && ProfilesActiveConstant.TYPE_DATE.equals(requestJson.get("type"))) {
//按日期
if (param != null && !"".equals(param)) {
String[] split = param.split("/");
if (!(split.length == 2)) {
Assert.state(false, "时间格式传递不正确");
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
startImplement(split[0], split[1]);
}
Assert.notNull(split[0], "开始时间不能为空");
Assert.notNull(split[1], "结束时间不能为空");
startImplement(split[0], split[1]);
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
startImplement(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
startImplement();
}
} else if (requestJson != null && ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = (String) requestJson.get("integration_task_living_details_id");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
startImplement(integrationTaskLivingDetailsEntity.getRootAppPk());
} else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) {
startImplement();
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -138,55 +138,59 @@ public class ConsignmachiningIn extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplement(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplement(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplement(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplement(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness-方法调用结束:" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness-方法调用结束:" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -140,55 +140,59 @@ public class ConsignmachiningInReturn extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplement(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplement(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -137,54 +137,58 @@ public class ProxyPurchaseReturn extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
try {
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplement(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplement(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
try {
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplement(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplement(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplement(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -131,55 +131,59 @@ public class ProxyPurchaseWarehousOrder extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplementByCode(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplementByCode(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplementByCode(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplementByCode(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness-方法抛出异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness-方法抛出异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -134,55 +134,59 @@ public class ProxyPurchaseWarehousWarehouse extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplementByCode(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplementByCode(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号推送
if (param != null && !"".equals(param)) {
startImplementByCode(param);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = offsetTimeTime.computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr);
}
} else if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
String integration_task_living_details_id = String.valueOf(requestJson.get("integration_task_living_details_id"));
Assert.notNull(integration_task_living_details_id, "明细行主键不能为空!");
IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integration_task_living_details_id);
if (integrationTaskLivingDetailsEntity != null && integrationTaskLivingDetailsEntity.getRootAppBill() != null) {
startImplementByCode(integrationTaskLivingDetailsEntity.getRootAppBill());
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行实时执行计算时间偏移量
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -143,7 +143,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -115,54 +115,58 @@ public class SoSaleOutPluginInitializerToB extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
Assert.notNull(sceneType, "sceneType参数不能为空");
Assert.notNull(!"".equals(sceneType), "sceneType参数不能为空");
if (param != null && !"".equals(param)) {
startImplementByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
Assert.notNull(sceneType, "sceneType参数不能为空");
Assert.notNull(!"".equals(sceneType), "sceneType参数不能为空");
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//实时执行每1分钟调度一次
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByStockTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
startImplementByTranTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
Assert.notNull(sceneType, "sceneType参数不能为空");
Assert.notNull(!"".equals(sceneType), "sceneType参数不能为空");
if (param != null && !"".equals(param)) {
startImplementByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
Assert.notNull(sceneType, "sceneType参数不能为空");
Assert.notNull(!"".equals(sceneType), "sceneType参数不能为空");
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//实时执行每1分钟调度一次
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByStockTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
startImplementByTranTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness-方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -104,53 +104,57 @@ public class SoSaleOutPluginInitializerToC extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
// if (ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
// throw new BaseSystemException("TOC退货业务无法按单行推送需要根据天的维度推送");
// }
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
startImplementStockByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行每天晚上凌晨0点5分
//暂定先同步TOC销售库存再推送TOC销售确认收入
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
startImplementTranByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
startImplementStockByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行每天晚上凌晨0点5分
//暂定先同步TOC销售库存再推送TOC销售确认收入
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
startImplementTranByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -104,52 +104,56 @@ public class SoSaleReturnPluginInitializerToB extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
startImplementByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
Assert.notNull(sceneType, "sceneType参数不能为空");
Assert.notNull(!"".equals(sceneType), "sceneType参数不能为空");
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//实时执行每1分钟调度一次
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByStockTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
startImplementByTradeTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
startImplementByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
Assert.notNull(sceneType, "sceneType参数不能为空");
Assert.notNull(!"".equals(sceneType), "sceneType参数不能为空");
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//实时执行每1分钟调度一次
StartAndEndVo startAndEndVo = offsetTimeTime.offsetTime();
startImplementByStockTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
startImplementByTradeTime(startAndEndVo.getStart_time(), startAndEndVo.getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -100,51 +100,55 @@ public class SoSaleReturnPluginInitializerToC extends PluginBaseEntity {
@Override
public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
long startMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用开始" + getPluginName() + "-插件");
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
startImplementByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行每天晚上凌晨0点5分
//暂定先同步TOC销售库存再推送TOC销售确认收入
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
try {
String param = String.valueOf(requestJson.get("param"));
String sceneType = String.valueOf(requestJson.get("sceneType"));//sceneTypestocktran
if (ProfilesActiveConstant.TYPE_VBILLCODE.equals(requestJson.get("type"))) {
//按单号
if (param != null && !"".equals(param)) {
startImplementByCode(param, sceneType);
}
} else if (ProfilesActiveConstant.TYPE_TIME_FRAME.equals(requestJson.get("type"))) {
//前台页面功能日期推送或者接口调用也行
String craeteDateStr = computingTime(param);
if (craeteDateStr != null && !"".equals(craeteDateStr)) {
splitDateAndPush(craeteDateStr, sceneType);
}
} else {
if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(PROD_FILED)) {
//默认被定时器执行每天晚上凌晨0点5分
//暂定先同步TOC销售库存再推送TOC销售确认收入
List<StartAndEndVo> startAndEndVos = calculateCalculateEntireDayPeriod(null);
startImplementStockByTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
startImplementByTradeTime(startAndEndVos.get(0).getStart_time(), startAndEndVos.get(0).getEnd_time());
}
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
} catch (Exception e) {
logger.error("executeBusiness方法异常", e);
}
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
long endMillis = System.currentTimeMillis();
logger.info("executeBusiness方法调用结束" + getPluginName() + "-插件 执行耗时:{}", (endMillis - startMillis));
// return null;
}
}, "执行插件:" + getPluginName());
thread.start();
}
}, "执行插件:" + getPluginName());
thread.start();
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
if (requestJson != null && requestJson.get("type") != null && ProfilesActiveConstant.TYPE_DETAIL_ERROR.equals(requestJson.get("type"))) {
try {
thread.join();
} catch (Exception e) {
logger.error("thread.join();抛出异常", e);
}
}
} catch (Exception e) {
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");
}

View File

@ -135,7 +135,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");

View File

@ -139,7 +139,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity {
start();
}
} catch (Exception e) {
e.printStackTrace();
// e.printStackTrace();
logger.error("executeBusiness方法抛出异常", e);
}
return BaseResult.getSuccessMessageEntity("插件执行成功");