servicecode) {
- Assert.notNull(title, "消息标题为空");
- Assert.notNull(category, "消息类别编号为空");
- Assert.notNull(templateCode, "模板编号为空");
- Assert.notNull(body, "消息内容为空");
- Assert.notNull(params, "消息参数为空");
- Assert.notNull(servicecode, "业务参数为空");
-
- return client.postMessage(new MessageRaw().setTitle(title).setCategory(category)
- .setTemplateCode(templateCode).setBody(body).setExtra(params).setUsers(grantUsers).setServicecode(servicecode));
- }
-
-}
diff --git a/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/AsyncConfig.java b/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/AsyncConfig.java
deleted file mode 100644
index 880066a..0000000
--- a/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/AsyncConfig.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.chinaunicom.zyhy.ebtp.supplier.common.config;
-
-import com.chinaunicom.zyhy.ebtp.supplier.common.util.JsonUtils;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.context.properties.EnableConfigurationProperties;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.scheduling.annotation.AsyncConfigurer;
-import org.springframework.scheduling.annotation.EnableAsync;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.Executor;
-
-/**
- * 异步线程池配置
- *
- * @author f
- * @date 2021-11-12
- */
-@Configuration
-@EnableAsync
-@EnableConfigurationProperties(AsyncProperties.class)
-@Slf4j
-public class AsyncConfig implements AsyncConfigurer {
-
- @Autowired
- private AsyncProperties asyncProperties;
-
-
- /**
- * 配置异步线程池
- *
- * 拒绝异常处理 - 在调用线程中执行(当线程池中线程都已被占用且queue已满,则拒绝继续提交task,
- * 默认为ThreakPoolExecutor.AbortPolicy抛出异常到上层应用 - 导致异步死掉,无法再处理新任务,
- * 此处实现照搬ThreadPoolExecutor.CallerRunsPolicy且添加日志记录,
- * CallerRunsPolicy:不在新线程中执行任务,而是用调用者所在的线程来执行)
- */
- @Override
- public Executor getAsyncExecutor() {
- ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
- executor.setCorePoolSize(asyncProperties.getCoreSize());
- executor.setMaxPoolSize(asyncProperties.getMaxSize());
- executor.setQueueCapacity(asyncProperties.getQueueCapacity());
- executor.setKeepAliveSeconds(asyncProperties.getKeepAlive());
- executor.setThreadNamePrefix(asyncProperties.getThreadNamePrefix());
- // new ThreadPoolExecutor.CallerRunsPolicy();
- executor.setRejectedExecutionHandler((r, e) -> {
- log.error("Async thread pool over load - caller run - queue size:{}", e.getQueue().size());
- if (!e.isShutdown()) {
- r.run();
- }
- });
- // 等待所有任务结束后再关闭线程池
- executor.setWaitForTasksToCompleteOnShutdown(true);
- executor.initialize();
- return executor;
- }
-
- /**
- * 异步线程池 - 全局异常处理
- *
- * @return
- */
- @Override
- public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
- return (ex, method, params) -> {
- log.info("Async method:{} has uncaught exception,params: {}", method, JsonUtils.objectToJson(params), ex);
- };
- }
-}
diff --git a/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/AsyncProperties.java b/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/AsyncProperties.java
deleted file mode 100644
index d29bbf3..0000000
--- a/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/AsyncProperties.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.chinaunicom.zyhy.ebtp.supplier.common.config;
-
-
-import lombok.Data;
-import org.springframework.boot.context.properties.ConfigurationProperties;
-
-/**
- * 异步线程池属性
- *
- * @author f
- * @date 2021-11-12
- */
-@ConfigurationProperties(prefix = "async.thead.pool")
-@Data
-public class AsyncProperties {
-
- /**
- * 核心线程池大小
- */
- private Integer coreSize;
- /**
- * 最大线程池大小
- */
- private Integer maxSize;
- /**
- * 线程池队列容量(默认Integer.MAX_VALUE)
- */
- private Integer queueCapacity;
- /**
- * 线程池空闲时间
- */
- private Integer keepAlive;
- /**
- * 线程池名称前缀
- */
- private String threadNamePrefix;
-
-
-}
diff --git a/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/CustomJacksonTypeHandler.java b/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/CustomJacksonTypeHandler.java
deleted file mode 100644
index 4a2cc6b..0000000
--- a/src/main/java/com/chinaunicom/zyhy/ebtp/supplier/common/config/CustomJacksonTypeHandler.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.chinaunicom.zyhy.ebtp.supplier.common.config;
-
-import com.baomidou.mybatisplus.core.exceptions.MybatisPlusException;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.ibatis.type.BaseTypeHandler;
-import org.apache.ibatis.type.JdbcType;
-import org.apache.ibatis.type.MappedJdbcTypes;
-import org.apache.ibatis.type.MappedTypes;
-
-import java.io.IOException;
-import java.sql.CallableStatement;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-
-/**
- * 解决Json字段内容LocalDateTime反序列化问题
- *
- * @author dino
- * @date 2020/11/10 15:48
- */
-@Slf4j
-@MappedTypes({Object.class})
-@MappedJdbcTypes(JdbcType.VARCHAR)
-public class CustomJacksonTypeHandler extends BaseTypeHandler