From ac802e693f3beee7fcedf33461cd2eeea1211b25 Mon Sep 17 00:00:00 2001 From: zhengyf Date: Fri, 13 Sep 2024 16:17:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BD=E7=9F=A5=EF=BC=9A=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=87=BA=E5=85=A5=E5=BA=93=EF=BC=88ZZ?= =?UTF-8?q?=EF=BC=89=E8=87=AA=E5=8A=A8=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adjust/OtherInPluginInitializer.java | 116 +++++++++++++++++ .../adjust/OtherOutPluginInitializer.java | 117 ++++++++++++++++++ 2 files changed, 233 insertions(+) create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherInPluginInitializer.java create mode 100644 buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherOutPluginInitializer.java diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherInPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherInPluginInitializer.java new file mode 100644 index 00000000..e0ef4414 --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherInPluginInitializer.java @@ -0,0 +1,116 @@ +package com.hzya.frame.plugin.lets.plugin.adjust; + +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +import com.hzya.frame.plugin.lets.dao.IIcGeneralHDao; +import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; +import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; +import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.concurrent.locks.ReentrantLock; + +/** + * 组装自动生成的其他入库单自动审核。 + */ +public class OtherInPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(OtherInPluginInitializer.class); + + private static final ReentrantLock LOCK = new ReentrantLock(true); + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "adjust.OtherInPluginInitializer"; + } + + @Override + public String getPluginName() { + return "丽知:其他入库单自动审核"; + } + + @Override + public String getPluginLabel() { + return "丽知:其他入库单自动审核"; + } + + @Autowired + private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; + @Autowired + private PushDataByU8cUtil pushDataByU8cUtil; + @Autowired + private PushU8CByApiCode pushU8CByApiCode; + @Autowired + private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; + + @Autowired + private OfsUnifiedService ofsUnifiedService; + @Autowired + private IIcGeneralHDao iIcGeneralHDao; + @Override + public String getPluginType() { + return "1"; + } + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + 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]); + } + } 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 integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails); + start(integrationTaskLivingDetailsEntity.getRootAppPk()); + } else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) { + //默认 + start(); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("executeBusiness方法抛出异常", e); + } + return null; + } + + public void start(){ + + } + public void start(String vbillcode){ + + } + public void start(String startTime, String endTime){ + + } +} diff --git a/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherOutPluginInitializer.java b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherOutPluginInitializer.java new file mode 100644 index 00000000..7127187d --- /dev/null +++ b/buildpackage/src/main/java/com/hzya/frame/plugin/lets/plugin/adjust/OtherOutPluginInitializer.java @@ -0,0 +1,117 @@ +package com.hzya.frame.plugin.lets.plugin.adjust; + +import cn.hutool.core.lang.Assert; +import com.alibaba.fastjson.JSONObject; +import com.hzya.frame.base.PluginBaseEntity; +import com.hzya.frame.plugin.lets.constant.ProfilesActiveConstant; +import com.hzya.frame.plugin.lets.dao.IIcGeneralHDao; +import com.hzya.frame.plugin.lets.util.PushDataByU8cUtil; +import com.hzya.frame.plugin.lets.util.SaveOrUpdateBusinessLogUtil; +import com.hzya.frame.plugin.lets.util.pushData.PushU8CByApiCode; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.dao.IIntegrationTaskLivingDetailsDao; +import com.hzya.frame.sysnew.integtationTaskLivingDetails.entity.IntegrationTaskLivingDetailsEntity; +import com.hzya.frame.ttxofs.service.OfsUnifiedService; +import com.hzya.frame.web.entity.JsonResultEntity; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.concurrent.locks.ReentrantLock; + +/** + * 组装自动生成的其他出库单自动审核。 + */ +public class OtherOutPluginInitializer extends PluginBaseEntity { + Logger logger = LoggerFactory.getLogger(OtherOutPluginInitializer.class); + + private static final ReentrantLock LOCK = new ReentrantLock(true); + + @Override + public void initialize() { + logger.info(getPluginLabel() + "執行初始化方法initialize()"); + } + + @Override + public void destroy() { + logger.info(getPluginLabel() + "執行銷毀方法destroy()"); + } + + @Override + public String getPluginId() { + return "adjust.OtherOutPluginInitializer"; + } + + @Override + public String getPluginName() { + return "丽知:其他出库单自动审核"; + } + + @Override + public String getPluginLabel() { + return "丽知:其他出库单自动审核"; + } + + @Autowired + private IIntegrationTaskLivingDetailsDao iIntegrationTaskLivingDetailsDao; + @Autowired + private PushDataByU8cUtil pushDataByU8cUtil; + @Autowired + private PushU8CByApiCode pushU8CByApiCode; + @Autowired + private SaveOrUpdateBusinessLogUtil saveOrUpdateBusinessLogUtil; + + @Autowired + private OfsUnifiedService ofsUnifiedService; + @Autowired + private IIcGeneralHDao iIcGeneralHDao; + + @Override + public String getPluginType() { + return "1"; + } + public JsonResultEntity executeBusiness(JSONObject requestJson) throws Exception { + 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]); + } + } 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 integrationTaskLivingDetails = (String) requestJson.get("integration_task_living_details_id"); + IntegrationTaskLivingDetailsEntity integrationTaskLivingDetailsEntity = saveOrUpdateBusinessLogUtil.queryIntegrationTaskLivingDetailsEntity(integrationTaskLivingDetails); + start(integrationTaskLivingDetailsEntity.getRootAppPk()); + } else if (ProfilesActiveConstant.LETS_PROFILES_ACTIVE.equals(prod)) { + //默认 + start(); + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("executeBusiness方法抛出异常", e); + } + return null; + } + + public void start(){ + + } + public void start(String vbillcode){ + + } + public void start(String startTime, String endTime){ + + } +}