diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java index 7dfe7fc1..caf0bbd0 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/CustdocAutoAllotPluginInitializer.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java index c7a7c2e0..a6094d2b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/GoodsAutoAllotPluginInitializer.java @@ -116,7 +116,7 @@ public class GoodsAutoAllotPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/KitPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/KitPluginInitializer.java index 1e9971ad..86030b50 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/KitPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/KitPluginInitializer.java @@ -127,7 +127,7 @@ public class KitPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUClassPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUClassPluginInitializer.java index 6269225a..e2d3e3b1 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUClassPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUClassPluginInitializer.java @@ -136,7 +136,7 @@ public class SKUClassPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java index 24de1d60..38f40266 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUPluginInitializer.java @@ -128,7 +128,7 @@ public class SKUPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUSealPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUSealPluginInitializer.java index 3e4aef36..e88cd6a4 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUSealPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SKUSealPluginInitializer.java @@ -124,7 +124,7 @@ public class SKUSealPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java index 200cde7a..a4bdad0c 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/ShopPluginInitializer.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java index 496155c5..d9dac684 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/base/SupplierPluginInitializer.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java index e496d5f5..3cd3b73e 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningIn.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java index 6a982005..63cb3f15 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/outsourc/ConsignmachiningInReturn.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java index b5c2259b..1044ad53 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseReturn.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousOrder.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousOrder.java index 65166f4c..4699462b 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousOrder.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousOrder.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java index df27a3f7..2a8ebc44 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/purchase/ProxyPurchaseWarehousWarehouse.java @@ -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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java index df34539c..b3d7c3e4 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/RefundOnlyPluginInitializer.java @@ -143,7 +143,7 @@ public class RefundOnlyPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java index d44d2874..314d8d23 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToB.java @@ -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"));//sceneType:stock、tran - 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"));//sceneType:stock、tran + 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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java index 49ce31e3..4e8d9d78 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleOutPluginInitializerToC.java @@ -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"));//sceneType:stock、tran - 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 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"));//sceneType:stock、tran + 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 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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java index 8537b1b9..81744672 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToB.java @@ -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"));//sceneType:stock、tran - 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"));//sceneType:stock、tran + 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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java index 5fd926ec..caeb426e 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/sales/SoSaleReturnPluginInitializerToC.java @@ -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"));//sceneType:stock、tran - 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 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"));//sceneType:stock、tran + 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 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("插件执行成功"); } diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java index 1e943590..abc9ea0f 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferInPluginInitializer.java @@ -135,7 +135,7 @@ public class TransferInPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功"); diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java index f79a758a..b73f1255 100644 --- a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/transfer/TransferOutPluginInitializer.java @@ -139,7 +139,7 @@ public class TransferOutPluginInitializer extends PluginBaseEntity { start(); } } catch (Exception e) { - e.printStackTrace(); +// e.printStackTrace(); logger.error("executeBusiness方法抛出异常", e); } return BaseResult.getSuccessMessageEntity("插件执行成功");