first commit

This commit is contained in:
那些花儿
2025-11-05 09:27:20 +08:00
commit 375eb81203
4587 changed files with 880312 additions and 0 deletions
@@ -0,0 +1,164 @@
package com.budwk.app;
import cn.dev33.satoken.SaManager;
import cn.dev33.satoken.config.SaTokenConfig;
import com.budwk.app.base.utils.AppIocUtil;
import com.budwk.app.flow.engine.FlowEngine;
import com.budwk.app.sys.services.SysTaskService;
import com.budwk.app.task.services.TaskPlatformService;
import com.budwk.app.web.commons.auth.satoken.SaTokenContextImpl;
import com.budwk.app.web.commons.auth.satoken.SaTokenDaoRedisImpl;
import com.budwk.app.web.commons.auth.satoken.StpInterfaceImpl;
import com.budwk.app.web.commons.base.Globals;
import com.budwk.app.web.commons.ext.pubsub.WebPubSub;
import com.budwk.app.zhgh.dayofficework.message.service.GlobalMessageSendService;
import lombok.extern.slf4j.Slf4j;
import org.beetl.core.GroupTemplate;
import org.nutz.boot.NbApp;
import org.nutz.dao.Dao;
import org.nutz.dao.impl.FileSqlManager;
import org.nutz.dao.sql.Sql;
import org.nutz.dao.util.Daos;
import org.nutz.integration.jedis.JedisAgent;
import org.nutz.ioc.Ioc;
import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Mirror;
import org.nutz.mvc.Mvcs;
import org.nutz.mvc.annotation.*;
import org.quartz.Scheduler;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.servlet.ServletContext;
import java.lang.management.ManagementFactory;
import java.sql.Driver;
import java.sql.DriverManager;
import java.util.Enumeration;
import java.util.List;
@IocBean(create = "init", depose = "depose")
@Localization(value = "locales/", defaultLocalizationKey = "zh_CN")
@Encoding(input = "UTF-8", output = "UTF-8")
@ChainBy(args = "chain/mvc-chain.json")
@Slf4j
public class MainLauncher {
protected static final String PRE = "security.";
@Inject("refer:$ioc")
private Ioc ioc;
@Inject
private PropertiesProxy conf;
@Inject
private JedisAgent jedisAgent;
@Inject
private WebPubSub webPubSub;//注入一下为了初始化
@Inject
private GroupTemplate groupTemplate;
@Inject
private TaskPlatformService taskPlatformService;
@Inject
private SysTaskService sysTaskService;
@Inject
private Dao dao;
public static void main(String[] args) throws Exception {
NbApp nb = new NbApp().setArgs(args).setPrintProcDoc(true);
nb.getAppContext().setMainPackage("com.budwk");
nb.run();
}
public static NbApp warMain(ServletContext sc) {
NbApp nb = new NbApp().setPrintProcDoc(true);
nb.getAppContext().setMainPackage("com.budwk");
return nb;
}
public void init() {
Mvcs.DISABLE_X_POWERED_BY = true;
Globals.AppBase = Mvcs.getServletContext().getContextPath();
Globals.AppRoot = Mvcs.getServletContext().getRealPath("/");
init_sys();
init_task();
init_auth();
ioc.get(Globals.class);
ioc.get(FlowEngine.class);
ioc.get(GlobalMessageSendService.class);
AppIocUtil.setIoc(ioc);
}
public void init_auth() {
SaTokenConfig saTokenConfig = conf.makeDeep(SaTokenConfig.class, PRE);
String tokenName = conf.get(PRE + "tokenName", "token");
// 注意这里的token默认超时时间与控制中心 websocket 超时时间保持一致
saTokenConfig.setTimeout(conf.getLong(PRE + "timeout", 86400));
saTokenConfig.setTokenName(tokenName);
saTokenConfig.setIsV(false);
SaManager.setConfig(saTokenConfig);
SaManager.setSaTokenContext(ioc.get(SaTokenContextImpl.class));
SaManager.setSaTokenDao(ioc.get(SaTokenDaoRedisImpl.class));
SaManager.setStpInterface(ioc.get(StpInterfaceImpl.class));
}
private void init_task() {
if (log.isDebugEnabled() && !dao.exists("sys_qrtz_triggers") && !dao.exists("sys_qrtz_triggers".toUpperCase())) {
//执行Quartz SQL脚本
String dbType = dao.getJdbcExpert().getDatabaseType();
log.debug("dbType:::" + dbType);
FileSqlManager fmq = new FileSqlManager("db/quartz/" + dbType.toLowerCase() + ".sql");
List<Sql> sqlListq = fmq.createCombo(fmq.keys());
Sql[] sqlsq = sqlListq.toArray(new Sql[sqlListq.size()]);
for (Sql sql : sqlsq) {
dao.execute(sql);
}
}
}
private void init_sys() {
if (log.isDebugEnabled()) {
//通过POJO类创建表结构
try {
Daos.createTablesInPackage(dao, "com.budwk", false);
//通过POJO类修改表结构
Daos.migration(dao, "com.budwk", true, false);
// Daos.migration(dao, "com.budwk", true, false, false);
} catch (Exception e) {
e.printStackTrace();
}
}
}
public void depose() {
// 非mysql数据库,或多webapp共享mysql驱动的话,以下语句删掉
try {
Mirror.me(Class.forName("com.mysql.jdbc.AbandonedConnectionCleanupThread")).invoke(null, "shutdown");
} catch (Throwable e) {
}
// 解决quartz有时候无法停止的问题
try {
ioc.get(Scheduler.class).shutdown(true);
} catch (Exception e) {
}
// 解决com.alibaba.druid.proxy.DruidDriver和com.mysql.jdbc.Driver在reload时报warning的问题
// 多webapp共享mysql驱动的话,以下语句删掉
Enumeration<Driver> en = DriverManager.getDrivers();
while (en.hasMoreElements()) {
try {
Driver driver = en.nextElement();
String className = driver.getClass().getName();
log.debug("deregisterDriver: " + className);
DriverManager.deregisterDriver(driver);
} catch (Exception e) {
}
}
try {
MBeanServer mbeanServer = ManagementFactory.getPlatformMBeanServer();
ObjectName objectName = new ObjectName("com.alibaba.druid:type=MockDriver");
if (mbeanServer.isRegistered(objectName)) mbeanServer.unregisterMBean(objectName);
objectName = new ObjectName("com.alibaba.druid:type=DruidDriver");
if (mbeanServer.isRegistered(objectName)) mbeanServer.unregisterMBean(objectName);
} catch (Exception ex) {
}
}
}
@@ -0,0 +1,22 @@
package com.budwk.app.base.annotation;
import java.lang.annotation.*;
/**
* 字典枚举类注解,方便收集做为字典使用的
*/
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
public @interface DictEnum{
/**
* 名称
*/
String name();
/**
* 唯一标识
*/
String key();
}
@@ -0,0 +1,23 @@
package com.budwk.app.base.annotation;
import java.lang.annotation.*;
/**
* 自定义注解防止表单重复提交
*
* @author ruoyi
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit {
/**
* 间隔时间(ms),小于此时间视为重复提交
*/
public int interval() default 5000;
/**
* 提示消息
*/
public String message() default "请求过于频繁,请稍后再试";
}
@@ -0,0 +1,41 @@
package com.budwk.app.base.annotation;
import java.lang.annotation.*;
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Inherited
public @interface SLog {
String type() default "platform";
/**
* 标签
*
* @return
*/
String tag();
String msg() default "";
/**
* 是否记录传递参数
*
* @return 消息模板
*/
boolean param() default true;
/**
* 记录执行结果
*
* @return 消息模板
*/
boolean result() default true;
/**
* 是否异步执行,默认为true
*
* @return true, 如果需要异步执行
*/
boolean async() default true;
}
@@ -0,0 +1,119 @@
package com.budwk.app.base.config;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.constant.RedisConstant;
import com.budwk.app.base.exception.BaseException;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.impl.PropertiesProxy;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.HashMap;
import java.util.Map;
/**
* @version 1.0
* @Author zzr
* @nameDataCenterProperties
* @Date 2025/9/15 15:34
* @注释 数据中心配置文件,存放接口地址和参数配置
*/
@Slf4j
@Data
@IocBean(create = "init")
public class DataCenterProperties {
@Inject
private PropertiesProxy conf;
@Inject
private RedisService redisService;
private String appId;
private String tokenUrl;
private Map<String, String> codes = new HashMap<>();
private Map<String, String> urls = new HashMap<>();
public void init() {
Map<String, String> all = conf.toMap();
appId = all.get("data-center.app-id");
tokenUrl = all.get("data-center.token-url");
extract(all, "data-center.codes.", codes);
extract(all, "data-center.urls.", urls);
}
/**
* 扫描配置 把 prefix 开头的 key 变成 Map
* @param prefix 配置前缀
* @param target 目标值
*/
private void extract(Map<String, String> all, String prefix, Map<String, String> target) {
all.forEach((k, v) -> {
if (k.startsWith(prefix)) {
target.put(k.substring(prefix.length()), v);
}
});
}
/**
* 读取配置
* @param key 接口类型枚举
* @return 相关配置
*/
public Credential credential(String key) {
String code = codes.get(key);
String url = urls.get(key);
if (code == null || url == null) {
throw new BaseException("未知业务: " + key);
}
String token = getToken(Integer.parseInt(code), key);
return new Credential(url, token);
}
@Getter
@AllArgsConstructor
public static class Credential {
private String url;
private String token;
}
/**
* 获取token
* @param code
* @param keyPrefix
* @return token
*/
private String getToken(Integer code, String keyPrefix) {
String dateCenterPrefix = RedisConstant.DATE_CENTER_PREFIX + keyPrefix;
String token = redisService.get(dateCenterPrefix);
if (StrUtil.isNotBlank(token)) {
return token;
} else {
HttpRequest httpRequest = HttpUtil.createPost(tokenUrl);
Map<String, Object> reqBody = Map.of(
"appId", appId,
"code", code
);
httpRequest.body(JSONUtil.toJsonStr(reqBody));
JSONObject resp = JSONUtil.parseObj(httpRequest.execute().body());
if (resp.getInt("code") != 200) {
throw new BaseException("获取token失败: " + resp.getStr("msg"));
} else {
JSONObject data = resp.getJSONObject("data");
String tokenStr = data.getStr("token");
Integer expire = data.getInt("expire");
redisService.setex(dateCenterPrefix, expire, tokenStr);
return tokenStr;
}
}
}
}
@@ -0,0 +1,125 @@
package com.budwk.app.base.config;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.Lang;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.List;
import java.util.concurrent.ThreadPoolExecutor;
/**
* @version 1.0
* @Author zzr
* @nameThreadPoolConfig
* @Date 2024/9/2 10:18
* @注释
*/
@Slf4j
@IocBean
public class ThreadPoolConfig {
@Inject
private Dao dao;
/**
* 核心线程数(默认线程数)
*/
private static final int CORE_POOL_SIZE = 2 * Runtime.getRuntime().availableProcessors() + 1;
/**
* 最大线程数
*/
private static final int MAX_POOL_SIZE = 128;
/**
* 允许线程空闲时间(单位:默认为秒)
*/
private static final int KEEP_ALIVE_TIME = 5;
/**
* 任务的等待时间
*/
private static final int AWAIT_TERMINATION_TIME = 30;
/**
* 缓冲队列数
*/
private static final int QUEUE_CAPACITY = 1200;
/**
* 线程池名前缀
*/
private static final String THREAD_NAME_PREFIX = "dd3s-thread-pool";
/**
* bean的名称,默认为首字母小写的方法名
* spring管理的线程池,顶级父类也是Executor
*/
@IocBean(name = "executorService")
public ThreadPoolTaskExecutor executorService() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setCorePoolSize(CORE_POOL_SIZE);
executor.setMaxPoolSize(MAX_POOL_SIZE);
executor.setQueueCapacity(QUEUE_CAPACITY);
executor.setKeepAliveSeconds(KEEP_ALIVE_TIME);
executor.setThreadNamePrefix(THREAD_NAME_PREFIX);
executor.setAwaitTerminationSeconds(AWAIT_TERMINATION_TIME);
executor.setWaitForTasksToCompleteOnShutdown(true);
// 线程池对拒绝任务的处理策略
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
executor.initialize();
return executor;
}
/**
* 异步执行
*
* @param list 泛型list,任意实体类集合
* @param batchSize 期望单次操作的数量,默认200
* @param mode insert插入 update更新 insertOrUpdate插入或更新
* @param isFastInsertOrUpdateIgnoreNull mode为新增此值为true代表fastInsertmode为修改时此值为true代表updateIgnoreNull
* @param <T>
*/
public <T> void asyncExecute(List<T> list, Integer batchSize, String mode, boolean isFastInsertOrUpdateIgnoreNull) {
if (Lang.isEmpty(list)) {
return;
}
if (batchSize == null || batchSize <= 0) {
batchSize = 200;
}
for (int i = 0; i < list.size(); i += batchSize) {
final int end = Math.min(i + batchSize, list.size());
List<T> batch = list.subList(i, end);
executorService().execute(() -> {
try {
switch(mode) {
case "insert" -> {
if (isFastInsertOrUpdateIgnoreNull) {
dao.fastInsert(batch);
} else {
dao.insert(batch);
}
}
case "update" -> {
if (isFastInsertOrUpdateIgnoreNull) {
dao.updateIgnoreNull(batch);
} else {
dao.update(batch);
}
}
case "insertOrUpdate" -> dao.insertOrUpdate(batch);
}
} catch (Exception e) {
// 日志记录异常信息
System.err.println("Error occurred while inserting batch: " + e.getMessage());
e.printStackTrace();
}
});
}
}
}
@@ -0,0 +1,49 @@
package com.budwk.app.base.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 流程常量
*/
@Getter
@AllArgsConstructor
public enum BpmProcessConstant {
WARMTH_CONDOLENCE("送温暖慰问"),
LOVE_ASSIST("爱心扶助基金"),
PROPOSAL("提案"),
SUGGESTION_TC("教代会意见建议"),
SUGGESTION_WC("工代会意见建议"),
GRASSROOTS_CONGRESS("基层双代会"),
GRASSROOTS_CONGRESS_MATERIALS("基层双代会会议资料"),
MEMBER_SINGLE_APPLY("会员入会申请"),
MEMBER_CHANGE("会员入会申请"),
MEMBER_BRANCH_UNION_CHANGE("会员分工会变更"),
CLUB_JOIN("协会入会申请"),
CLUB_EXAMINE("协会考核"),
CLUB_EVALUATE("协会评优"),
CLUB_REGISTER("协会注册"),
PERSON_EVALUATE("评优评先申请"),
ARTICLE("新闻投稿"),
BRANCH_UNION_WEIYUAN_AUTHORIZATION("分工会委员授权")
;
public final String description;
}
@@ -0,0 +1,17 @@
package com.budwk.app.base.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
@Getter
@AllArgsConstructor
public enum ProcessBusinessConstant {
CONDOLENCE_APPLY("慰问");
/**
* 避免和枚举类的name冲突
*/
public final String roleName;
}
@@ -0,0 +1,70 @@
package com.budwk.app.base.constant;
/**
* @author wizzer@qq.com
*/
public class RedisConstant {
//项目统一前缀
public final static String PLATFORM_REDIS_PREFIX = "budwk5mini:";
public final static String PLATFORM_REDIS_WKCACHE_PREFIX = PLATFORM_REDIS_PREFIX + "wkcache:";
//聊天室
public final static String REDIS_KEY_WSROOM = PLATFORM_REDIS_PREFIX + "wsroom:";
public final static String REDIS_KEY_LOGIN_ADMIN_CAPTCHA = PLATFORM_REDIS_PREFIX + "admin:login:captcha:";
public final static String REDIS_KEY_ADMIN_PUBSUB = PLATFORM_REDIS_PREFIX + "admin:pubsub:";
//微信token
public final static String REDIS_KEY_WX_TOKEN = PLATFORM_REDIS_PREFIX + "wx:token:";
//企业微信token
public final static String REDIS_KEY_WX_WORK_TOKEN = PLATFORM_REDIS_PREFIX + "wxwork:token:";
//健步走小程序TOKEN
public final static String REDIS_KEY_WE_APP_ACCESS_TOKEN = PLATFORM_REDIS_PREFIX + "weapp:token:";
//图形验证码
public final static String REDIS_CAPTCHA_KEY = PLATFORM_REDIS_PREFIX + "platfrom:captcha:";
//短信验证码
public final static String REDIS_SMSCODE_KEY = PLATFORM_REDIS_PREFIX + "platfrom:smscode:";
public final static String REDIS_KEY_API_SIGN_DEPLOY_NONCE = PLATFORM_REDIS_PREFIX + "api:sign:deploy:nonce:";
public final static String REDIS_KEY_API_SIGN_OPEN_NONCE = PLATFORM_REDIS_PREFIX + "api:sign:open:nonce:";
/**
* Token 缓存前缀
*/
public static final String TOKEN = PLATFORM_REDIS_PREFIX + "token:";
/**
* 验证码前缀
*/
public static final String UCENTER_CAPTCHA = PLATFORM_REDIS_PREFIX + "ucenter:captcha:";
/**
* 短信验证码前缀
*/
public static final String UCENTER_SMSCODE = PLATFORM_REDIS_PREFIX + "ucenter:smscode:";
/**
* 接口重复提交前缀
*/
public static final String REPEAT_SUBMIT_PREFIX = PLATFORM_REDIS_PREFIX + "repeat_submit:";
/**
* 签名前缀
*/
public static final String SIGNATURE_PREFIX = PLATFORM_REDIS_PREFIX + "sys:signature:";
/**
* 用户登录锁前缀
*/
public static final String USER_LOGIN_LOCK_PREFIX = PLATFORM_REDIS_PREFIX + "user:login:lock:";
/**
* 数据接口锁前缀
*/
public static final String DATE_CENTER_PREFIX = PLATFORM_REDIS_PREFIX + "datacenter:token:";
}
@@ -0,0 +1,98 @@
package com.budwk.app.base.constant;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 角色常量
*/
@Getter
@AllArgsConstructor
public enum
RoleConstant {
PUBLIC("公共角色"),
MEMBER("会员角色"),
SYSADMIN("系统管理员"),
SCHOOL_UNION_ADMIN("校工会管理员"),
SCHOOL_UNION_CHAIRMAN("校工会主席"),
SCHOOL_UNION_VICE_CHAIRMAN("校工会副主席"),
SCHOOL_UNION_WELFARE_ADMIN("校工会福利管理员"),
SCHOOL_UNION_MEMBER_ADMIN("校工会会员管理员"),
SCHOOL_UNION_TC_ADMIN("校工会教代会管理员"),
SCHOOL_UNION_WC_ADMIN("校工会工代会管理员"),
SCHOOL_UNION_DC_ADMIN("校工会民主管理员"),
SCHOOL_UNION_PROPOSAL_ADMIN("校工会提案管理员"),
SCHOOL_UNION_CLUB_ADMIN("校工会协会管理员"),
SCHOOL_UNION_ACTIVITY_ADMIN("校工会活动管理员"),
SCHOOL_UNION_ARTICLE_CLUB_ADMIN("校工会协会新闻审批管理员"),
SCHOOL_UNION_ARTICLE_FGH_ADMIN("校工会分工会新闻审批管理员"),
SCHOOL_UNION_ARTICLE_ADMIN("校工会新闻审批管理员"),
SCHOOL_OUTLAY_ADMIN("校工会经费管理员"),
BRANCH_UNION_ADMIN("分工会管理员"),
BRANCH_UNION_CHAIRMAN("分工会主席"),
BRANCH_UNION_VICE_CHAIRMAN("分工会副主席"),
BRANCH_UNION_OPERATOR("分工会操作员"),
BRANCH_UNION_GROUP_LEADER("工会小组组长"),
BRANCH_UNION_ARTICLE_WRITER("分工会新闻投稿员"),
BRANCH_UNION_WY("分工会委员"),
BRANCH_UNION_ZUZHI_WY("分工会组织委员"),
BRANCH_UNION_XUANCHUAN_WY("分工会宣传委员"),
BRANCH_UNION_NVGONG_WY("分工会女工委员"),
BRANCH_UNION_QINGNIAN_WY("分工会青年委员"),
BRANCH_UNION_WENTI_WY("分工会文体委员"),
BRANCH_UNION_SHENGGHUO_WY("分工会生活委员"),
BRANCH_UNION_TIAOJIE_WY("分工会调解委员"),
UNIT_PARTY_SECRETARY("单位党委书记"),
TEACHER_CONGRESS_DELEGATE_FORMAL("教代会正式代表"),
TEACHER_CONGRESS_DELEGATE_ATTENDANCE("教代会列席代表"),
TEACHER_CONGRESS_DELEGATE_SPECIALLY_INVITE("教代会特邀代表"),
TEACHER_CONGRESS_DELEGATION_HEAD("教代会代表团团长"),
TEACHER_CONGRESS_VICE_DELEGATION_HEAD("教代会代表团副团长"),
TEACHER_CONGRESS_DELEGATION_CONTACT("教代会代表团联络人"),
PROPOSAL_COMMITTEE_DIRECTOR("提案委员会主任"),
PROPOSAL_COMMITTEE_DEPUTY_DIRECTOR("提案委员会副主任"),
PROPOSAL_BRANCH_SCHOOL_LEADER("提案分管校领导"),
PROPOSAL_UNIT_LEADER("提案承办单位领导"),
PROPOSAL_UNIT_PROXY("提案承办单位代理答复人"),
WORKER_CONGRESS_DELEGATE_FORMAL("工代会正式代表"),
WORKER_CONGRESS_DELEGATE_ATTENDANCE("工代会列席代表"),
WORKER_CONGRESS_DELEGATE_SPECIALLY_INVITE("工代会特邀代表"),
WORKER_CONGRESS_DELEGATION_HEAD("工代会代表团团长"),
SCHOOL_UNION_WC_AUDIT_ADMIN("基层双代会校工会批复人"),
SCHOOL_HOSPITAL_LEADER("校医院负责人"),
/*协会模块*/
CLUB_MEMBER("协会会员"),
CLUB_MANAGER("协会负责人"),
CLUB_PRESIDENT("协会会长"),
CLUB_VICE_PRESIDENT("协会副会长"),
CLUB_SECRETARY("协会秘书长"),
CLUB_VICE_SECRETARY("协会副秘书长"),
// SCHOOL_UNION_CLUB_ADMIN("校工会协会管理员"),
CLUB_AUDIT_LEADER("协会分管领导"),
CLUB_OPERATOR("协会操作员"),
/*大病基金会员*/
AID_FUND_MEMBER("大病基金会员"),
/*爱心扶助基金*/
LOVE_ASSIST_WORK_GROUP_LEADER("爱心扶助小组组长"),
LOVE_ASSIST_WORK_GROUP_MEMBER("爱心扶助小组审批员"),
PSYCHOLOGY_DOCTOR("心理咨询师"),
LEGAL_DOCTOR("法律顾问"),
;
/**
* 避免和枚举类的name冲突
*/
public final String roleName;
}
@@ -0,0 +1,15 @@
package com.budwk.app.base.enums;
/**
* 浏览器平台
*/
public enum BrowserPlatform {
PC_WEB,
H5_WEB,
WEI_XIN,
QI_YE_WEI_XIN;
}
@@ -0,0 +1,35 @@
package com.budwk.app.base.enums;
import cn.hutool.core.convert.Convert;
import java.util.Arrays;
import java.util.Optional;
public interface CodedEnum {
Integer getCode();
String getMessage();
public static <E extends Enum<?> & CodedEnum> Optional<E> codeOf(Class<E> enumClass, Object code) {
try {
return Arrays.stream(enumClass.getEnumConstants()).filter(e ->
e.getCode().equals(Convert.toInt(code))
|| e.name().equalsIgnoreCase(Convert.toStr(code))
|| e.getMessage().equalsIgnoreCase(Convert.toStr(code))
).findAny();
} catch (Exception e) {
return Optional.empty();
}
}
/**
* 获取数据类型,用于转换String或Integer
*
* @return
*/
default Class<?> getDataType() {
return Integer.class;
}
}
@@ -0,0 +1,21 @@
package com.budwk.app.base.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 登录类型
*/
@Getter
@AllArgsConstructor
public enum LoginType {
QI_YE_WECHAT("企业微信"),
WECHAT("微信"),
PC_LOCAL("PC本地"),
MOBILE_LOCAL("手机本地"),
CAS("CAS");
private final String value;
}
@@ -0,0 +1,21 @@
package com.budwk.app.base.enums;
/**
* 文件存储桶的权限策略枚举
*/
public enum MinIoFileBucketAuthEnum {
/**
* 私有的(仅有 owner 可以读写)
*/
PRIVATE,
/**
* 公有读,私有写( owner 可以读写, 其他客户可以读)
*/
PUBLIC_READ,
/**
* 公共读写(即所有人都可以读写,慎用)
*/
PUBLIC_READ_WRITE
}
@@ -0,0 +1,18 @@
package com.budwk.app.base.enums;
import lombok.Data;
import java.util.List;
/**
* @author mldong
* @date 2023/9/27
*/
@Data
//@ApiModel(value = "UpAndDownParam对象", description = "启用/禁用实体")
public class UpAndDownParam {
// @ApiModelProperty(value = "id集合")
private List<Object> ids;
// @ApiModelProperty(value = "操作类型")
private YesNoEnum opType;
}
@@ -0,0 +1,52 @@
package com.budwk.app.base.enums;
import com.budwk.app.base.annotation.DictEnum;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* yes_no
*
* @author mldong
*/
@DictEnum(key = "yes_no", name = "是否")
public enum YesNoEnum implements CodedEnum {
/**
* 是
*/
YES(1, ""),
/**
* 否
*/
NO(0, "");
private Integer code;
private String message;
/**
* 未删除
*/
public final static int Y = 1;
/**
* 已删除
*/
public final static int N = 0;
@JsonCreator
public static YesNoEnum forValue(Object value) {
return CodedEnum.codeOf(YesNoEnum.class, value).get();
}
YesNoEnum(int value, String name) {
this.code = value;
this.message = name;
}
@JsonValue
public Integer getCode() {
return code;
}
public String getMessage() {
return message;
}
}
@@ -0,0 +1,13 @@
package com.budwk.app.base.event.role;
/**
* @version 1.0
* @Author zzr
* @nameRoleEventListener
* @Date 2025/9/3 17:13
* @注释
*/
public interface RoleEventListener {
void receive(RoleEventMsg message);
}
@@ -0,0 +1,68 @@
package com.budwk.app.base.event.role;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @version 1.0
* @Author zzr
* @nameRoleEventMsg
* @Date 2025/9/3 17:14
* @注释
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class RoleEventMsg {
/**
* 用户id
*/
private List<String> userIds;
/**
* 角色code
*/
private String roleCode;
/**
* 单位id
*/
private String unitId;
/**
* 操作类型
*/
private Integer operationType;
/**
* 添加角色
*/
public static final int ADD_ROLE = 1;
/**
* 删除角色
*/
public static final int REMOVE_ROLE = 2;
/**
* 更新角色
*/
public static final int RENEW_ROLE = 3;
public RoleEventMsg(String unitId, String roleCode, Integer operationType){
this.unitId = unitId;
this.roleCode = roleCode;
this.operationType = operationType;
}
public RoleEventMsg(List<String> userIds, String roleCode, Integer operationType){
this.userIds = userIds;
this.roleCode = roleCode;
this.operationType = operationType;
}
}
@@ -0,0 +1,21 @@
package com.budwk.app.base.event.role;
import org.nutz.mvc.Mvcs;
/**
* @version 1.0
* @Author zzr
* @nameRoleEventPublisher
* @Date 2025/9/3 17:14
* @注释
*/
public class RoleEventPublisher {
public static void broadcast(RoleEventMsg event){
String[] names = Mvcs.getIoc().getNamesByType(RoleEventListener.class);
for (String name : names) {
RoleEventListener listener = Mvcs.getIoc().get(RoleEventListener.class, name);
listener.receive(event);
}
}
}
@@ -0,0 +1,17 @@
package com.budwk.app.base.event.user;
import com.budwk.app.zhgh.staffmanage.member.constant.MemberChangeType;
import lombok.Builder;
import lombok.Data;
@Data
@Builder
public class SysUserEvent {
//变更类型
private MemberChangeType memberChangeType;
//userId
private String userId;
}
@@ -0,0 +1,7 @@
package com.budwk.app.base.event.user;
public interface SysUserEventListener {
void onEvent(SysUserEvent event);
}
@@ -0,0 +1,14 @@
package com.budwk.app.base.event.user;
import org.nutz.mvc.Mvcs;
public class SysUserPublisher {
public static void notify(SysUserEvent event){
String[] names = Mvcs.getIoc().getNamesByType(SysUserEventListener.class);
for (String name : names) {
SysUserEventListener listener = Mvcs.getIoc().get(SysUserEventListener.class, name);
listener.onEvent(event);
}
}
}
@@ -0,0 +1,13 @@
package com.budwk.app.base.event.user;
/**
* @version 1.0
* @Author zzr
* @nameUserChangeEventListener
* @Date 2025/8/13 14:18
* @注释
*/
public interface UserChangeEventListener {
void receive(UserChangeMsg message);
}
@@ -0,0 +1,70 @@
package com.budwk.app.base.event.user;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @version 1.0
* @Author zzr
* @nameUserChangeMsg
* @Date 2025/8/13 11:51
* @注释
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserChangeMsg {
/**
* 变更资源,用户Id
*/
private List<String> userIds;
/**
* 操作类型
*/
private Integer operationType;
/**
* 变更前的单位Id,当operationType值为1时,该字段有效
*/
private String sourceUnitId;
/**
* 变更后的单位Id,当operationType值为1时,该字段有效
*/
private String targetUnitId;
/**
* 单位变动
*/
public final static int UNIT_CHANGE_OPERATION = 1;
/**
* 退休
*/
public final static int RETIRE_OPERATION = 2;
/**
* 入会
*/
public final static int RESTORE_OPERATION = 3;
public UserChangeMsg(List<String> userIds, Integer operationType) {
super();
this.userIds = userIds;
this.operationType = operationType;
}
public UserChangeMsg(List<String> userIds, Integer operationType, String sourceUnitId) {
super();
this.userIds = userIds;
this.operationType = operationType;
this.sourceUnitId = sourceUnitId;
}
}
@@ -0,0 +1,25 @@
package com.budwk.app.base.event.user;
import com.budwk.app.base.utils.AppIocUtil;
import org.nutz.ioc.Ioc;
/**
* @version 1.0
* @Author zzr
* @nameUserChangePublisher
* @Date 2025/8/13 14:23
* @注释
*/
public class UserChangePublisher {
// 发送消息给所有订阅者
public static void broadcast(UserChangeMsg msg) {
Ioc ioc = AppIocUtil.get();
String[] names = ioc.getNamesByType(UserChangeEventListener.class);
for (String listener : names) {
UserChangeEventListener listenerBean = ioc.get(UserChangeEventListener.class, listener);
listenerBean.receive(msg);
}
}
}
@@ -0,0 +1,19 @@
package com.budwk.app.base.exception;
import cn.hutool.core.util.StrUtil;
/**
* @author wizzer@qq.com
*/
public class BaseException extends RuntimeException{
private static final long serialVersionUID = 7192152812384031563L;
public BaseException(String message) {
super(message);
}
public BaseException(String message, Object... arguments) {
super(StrUtil.format(message, arguments));
}
}
@@ -0,0 +1,18 @@
package com.budwk.app.base.exception;
import cn.hutool.core.util.StrUtil;
/**
* 方法参数校验异常
*/
public class MethodArgumentNotValidException extends RuntimeException{
public MethodArgumentNotValidException(String message) {
super(message);
}
public MethodArgumentNotValidException(String message, Object... arguments) {
super(StrUtil.format(message, arguments));
}
}
@@ -0,0 +1,8 @@
package com.budwk.app.base.exception;
public class UnknownAccountException extends BaseException{
public UnknownAccountException(String message) {
super(message);
}
}
@@ -0,0 +1,19 @@
package com.budwk.app.base.interceptor.repeatSubmit;
import com.budwk.app.base.annotation.RepeatSubmit;
import org.nutz.aop.MethodInterceptor;
import org.nutz.ioc.Ioc;
import org.nutz.ioc.aop.SimpleAopMaker;
import org.nutz.ioc.loader.annotation.IocBean;
import java.lang.reflect.Method;
import java.util.List;
@IocBean(name = "$aop_repeatSubmit")
public class RepeatSubmitAopConfiguration extends SimpleAopMaker<RepeatSubmit> {
@Override
public List<? extends MethodInterceptor> makeIt(RepeatSubmit repeatSubmit, Method method, Ioc ioc) {
return List.of(new RepeatSubmitAopInterceptor(ioc, repeatSubmit, method));
}
}
@@ -0,0 +1,51 @@
package com.budwk.app.base.interceptor.repeatSubmit;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.annotation.RepeatSubmit;
import com.budwk.app.base.constant.RedisConstant;
import com.budwk.app.base.exception.BaseException;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import org.nutz.aop.InterceptorChain;
import org.nutz.aop.MethodInterceptor;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.Ioc;
import org.nutz.mvc.Mvcs;
import java.lang.reflect.Method;
public class RepeatSubmitAopInterceptor implements MethodInterceptor {
protected Ioc ioc;
public RepeatSubmitAopInterceptor(Ioc ioc, RepeatSubmit repeatSubmit, Method method) {
RedisService redisService = ioc.get(RedisService.class);
}
@Override
public void filter(InterceptorChain chain) throws Throwable {
Method method = chain.getCallingMethod();
RepeatSubmit annotation = method.getAnnotation(RepeatSubmit.class);
int interval = annotation.interval();
RedisService redisService = Mvcs.getIoc().get(RedisService.class);
String source = method.getDeclaringClass().getName() + "#" + method.getName();
Object[] args = chain.getArgs();
String parameterJson = "";
if (ObjectUtil.isNotEmpty(args)) {
parameterJson = JSONUtil.toJsonStr(args); // 序列化实际参数
}
String key = RedisConstant.REPEAT_SUBMIT_PREFIX + SecurityUtil.getUserId() + ":" + source;
Boolean exists = redisService.exists(key);
if (exists) {
// 判断
String oldParameterJson = redisService.get(key);
if (oldParameterJson != null && oldParameterJson.equalsIgnoreCase(parameterJson)) {
throw new BaseException(annotation.message());
}
} else {
redisService.setex(key, interval / 1000, parameterJson);
}
chain.doChain();
}
}
@@ -0,0 +1,34 @@
package com.budwk.app.base.interceptor.sLog;
import com.budwk.app.base.annotation.SLog;
import org.nutz.aop.MethodInterceptor;
import org.nutz.ioc.Ioc;
import org.nutz.ioc.aop.SimpleAopMaker;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
/**
* Created by wizzer on 2016/6/22.
*/
@IocBean(name = "$aop_syslog")
public class SLogAopConfigration extends SimpleAopMaker<SLog> {
@Inject("refer:$ioc")
protected Ioc ioc;
public List<? extends MethodInterceptor> makeIt(SLog slog, Method method, Ioc ioc) {
return Arrays.asList(new SLogAopInterceptor(ioc, slog, method));
}
public String[] getName() {
return new String[0];
}
public boolean has(String name) {
return false;
}
}
@@ -0,0 +1,88 @@
package com.budwk.app.base.interceptor.sLog;
import com.budwk.app.base.annotation.SLog;
import org.nutz.aop.InterceptorChain;
import org.nutz.aop.MethodInterceptor;
import org.nutz.el.El;
import org.nutz.ioc.Ioc;
import org.nutz.lang.segment.CharSegment;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;
/**
* Created by wizzer on 2016/6/22.
*/
public class SLogAopInterceptor implements MethodInterceptor {
private static final Log log = Logs.get();
protected SLogService sLogService;
protected String source;
protected String type;
protected String tag;
protected CharSegment seg;
protected boolean param;
protected boolean result;
protected boolean async;
protected Map<String, El> els;
protected Ioc ioc;
public SLogAopInterceptor(Ioc ioc, SLog slog, Method method) {
this.seg = new CharSegment(slog.msg());
if (seg.hasKey()) {
els = new HashMap<String, El>();
for (String key : seg.keys()) {
els.put(key, new El(key));
}
}
this.param = slog.param();
this.result = slog.result();
this.ioc = ioc;
this.source = method.getDeclaringClass().getName() + "#" + method.getName();
this.tag = slog.tag();
SLog _s = method.getDeclaringClass().getAnnotation(SLog.class);
if (_s != null) {
this.tag = _s.tag() + "," + this.tag;
}
this.type = slog.type();
this.async = slog.async();
}
public void filter(InterceptorChain chain) throws Throwable {
try {
chain.doChain();
doLog("aop.after", seg, chain, null);
} catch (Throwable e) {
doLog("aop.error", seg, chain, e);
throw e;
}
}
protected void doLog(String t, CharSegment seg, InterceptorChain chain, Throwable e) {
if (sLogService == null)
sLogService = ioc.get(SLogService.class);
try {
sLogService.log(t,
type,
tag,
source,
seg,
els,
param,
result,
async,
chain.getArgs(),
chain.getReturn(),
chain.getCallingMethod(),
chain.getCallingObj(),
e);
} catch (Exception e1) {
log.debug("slog fail", e1);
}
}
}
@@ -0,0 +1,230 @@
package com.budwk.app.base.interceptor.sLog;
import com.budwk.app.sys.models.Sys_log;
import com.budwk.app.sys.services.SysLogService;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import org.nutz.Nutz;
import org.nutz.el.El;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.Lang;
import org.nutz.lang.segment.CharSegment;
import org.nutz.lang.util.ClassMetaReader;
import org.nutz.lang.util.Context;
import org.nutz.lang.util.MethodParamNamesScaner;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.Mvcs;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
/**
* Created by wizzer on 2016/6/22.
*/
@IocBean(create = "init", depose = "close")
public class SLogService implements Runnable {
private static final Log log = Logs.get();
ExecutorService es;
LinkedBlockingQueue<Sys_log> queue;
@Inject
protected SysLogService sysLogService;
/**
* 异步插入日志
*
* @param syslog 日志对象
*/
public void async(Sys_log syslog) {
LinkedBlockingQueue<Sys_log> queue = this.queue;
if (queue != null)
try {
boolean re = queue.offer(syslog, 50, TimeUnit.MILLISECONDS);
if (!re) {
log.info("syslog queue is full, drop it ...");
}
} catch (InterruptedException e) {
}
}
/**
* 同步插入日志
*
* @param syslog 日志对象
*/
public void sync(Sys_log syslog) {
try {
sysLogService.fastInsertSysLog(syslog);
} catch (Throwable e) {
log.info("insert syslog sync fail", e);
}
}
public void run() {
while (true) {
LinkedBlockingQueue<Sys_log> queue = this.queue;
if (queue == null)
break;
try {
Sys_log sysLog = queue.poll(1, TimeUnit.SECONDS);
if (sysLog != null) {
sync(sysLog);
}
} catch (InterruptedException e) {
break;
}
}
}
/**
* 本方法通常由aop拦截器调用.
*
* @param t 日志类型
* @param tag 标签
* @param source 源码位置
* @param els 消息模板的EL表达式预处理表
* @param param 是否异步插入
* @param result 是否异步插入
* @param async 是否异步插入
* @param args 方法参数
* @param re 方法返回值
* @param method 方法实例
* @param obj 被拦截的对象
* @param e 异常对象
*/
public void log(String t, String type, String tag, String source, CharSegment seg,
Map<String, El> els, boolean param, boolean result,
boolean async,
Object[] args, Object re, Method method, Object obj,
Throwable e) {
String _msg = null;
if (seg.hasKey()) {
Context ctx = Lang.context();
List<String> names = null;
if (Nutz.majorVersion() == 1 && Nutz.minorVersion() < 60) {
Class<?> klass = obj.getClass();
if (klass.getName().endsWith("$$NUTZAOP"))
klass = klass.getSuperclass();
String key = klass.getName();
if (caches.containsKey(key))
names = caches.get(key).get(ClassMetaReader.getKey(method));
else {
try {
Map<String, List<String>> tmp = MethodParamNamesScaner.getParamNames(klass);
names = tmp.get(ClassMetaReader.getKey(method));
caches.put(key, tmp);
} catch (IOException e1) {
log.debug("error when reading param name");
}
}
} else {
names = MethodParamNamesScaner.getParamNames(method);
}
if (names != null) {
for (int i = 0; i < names.size() && i < args.length; i++) {
ctx.set(names.get(i), args[i]);
}
}
ctx.set("obj", obj);
ctx.set("args", args);
ctx.set("re", re);
ctx.set("return", re);
ctx.set("req", Mvcs.getReq());
ctx.set("resp", Mvcs.getResp());
Context _ctx = Lang.context();
for (String key : seg.keys()) {
_ctx.set(key, els.get(key).eval(ctx));
}
_msg = seg.render(_ctx).toString();
} else {
_msg = seg.getOrginalString();
}
String _param = "";
String _result = "";
if (param && args != null) {
try {
_param = Json.toJson(args);
} catch (Exception e1) {
_param = "传参不能转换为JSON格式";
}
}
if (result && re != null) {
try {
_result = Json.toJson(re);
} catch (Exception e1) {
_param = "返回对象不能转换为JSON格式";
}
}
log(type, tag, source, _msg, async, _param, _result);
}
public void log(String type, String tag, String source, String msg, boolean async, String param, String result) {
Sys_log slog = makeLog(type, tag, source, msg, param, result);
if (async)
async(slog);
else
sync(slog);
}
protected static Map<String, Map<String, List<String>>> caches = new HashMap<String, Map<String, List<String>>>();
public void init() {
queue = new LinkedBlockingQueue<Sys_log>();
int c = Runtime.getRuntime().availableProcessors();
es = Executors.newFixedThreadPool(c);
for (int i = 0; i < c; i++) {
es.submit(this);
}
}
public void close() throws InterruptedException {
queue = null; // 触发关闭
if (es != null && !es.isShutdown()) {
es.shutdown();
es.awaitTermination(5, TimeUnit.SECONDS);
}
}
public static Sys_log makeLog(String type, String tag, String source, String msg, String param, String result) {
Sys_log sysLog = new Sys_log();
if (type == null || tag == null) {
throw new RuntimeException("type/tag can't null");
}
if (source == null) {
StackTraceElement[] tmp = Thread.currentThread().getStackTrace();
if (tmp.length > 2) {
source = tmp[2].getClassName() + "#" + tmp[2].getMethodName();
} else {
source = "main";
}
}
sysLog.setType(type);
sysLog.setTag(tag);
sysLog.setSrc(source);
sysLog.setMsg(msg);
sysLog.setParam(param);
sysLog.setResult(result);
if (Mvcs.getReq() != null) {
sysLog.setIp(Lang.getIP(Mvcs.getReq()));
}
sysLog.setCreatedBy(SecurityUtil.getUserId());
sysLog.setDelFlag(false);
sysLog.setUsername(SecurityUtil.getUserUsername());
sysLog.setLoginname(SecurityUtil.getUserLoginname());
return sysLog;
}
}
@@ -0,0 +1,83 @@
package com.budwk.app.base.model;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Table("audit")
@Comment("审核记录表")
@Data
public class Audit extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("审核人")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(els = {@EL("$me.uid()")})
private String auditor;
@Column
@Comment("是否通过")
@ColDefine(type = ColType.BOOLEAN)
private Boolean auditPass;
@Column
@Comment("审核时间")
@Prev(els = {@EL("$me.nowDate()")})
private Date auditTime;
@Column
@Comment("审核意见")
@ColDefine(type = ColType.VARCHAR, width = 500)
private String auditOpinion;
@Column
@Comment("签字")
@ColDefine(type = ColType.TEXT)
private String auditSign;
@Column
@Comment("审核人姓名")
@ColDefine(type = ColType.VARCHAR, width = 50)
@PrevInsert(els = {@EL("$me.userName()")})
private String username;
@Column
@Comment("审核人工号")
@ColDefine(type = ColType.VARCHAR, width = 50)
@PrevInsert(els = {@EL("$me.loginName()")})
private String loginname;
@Column
@Comment("审核类型(1.通过 2.拒绝 3.退回)")
@ColDefine(type = ColType.INT)
private Integer auditType;
public Date nowDate() {
return new Date();
}
public String uid() {
return SecurityUtil.getUserId();
}
public String userName() {
return SecurityUtil.getUserUsername();
}
public String loginName() {
return SecurityUtil.getUserLoginname();
}
}
@@ -0,0 +1,92 @@
package com.budwk.app.base.model;
import cn.dev33.satoken.stp.StpUtil;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import org.nutz.dao.interceptor.annotation.PrevUpdate;
import org.nutz.json.Json;
import org.nutz.json.JsonFormat;
import org.nutz.lang.Strings;
import java.io.Serializable;
/**
* Created by wizzer on 2016/6/21.
* Update by wizzer on 2021/8/30.
*/
@Data
public abstract class BaseModel implements Serializable {
private static final long serialVersionUID = 1L;
@Column
@Comment("创建人")
@PrevInsert(els = @EL("$me.createdByUid()"))
@ColDefine(type = ColType.VARCHAR, width = 32)
private String createdBy;
/**
* Long不要用ColDefine定义,兼容oracle/mysql,支持2038年以后的时间戳
* 13位时间戳哦,不再是11位
*/
@Column
@Comment("创建时间")
@PrevInsert(now = true)
private Long createdAt;
@Column
@Comment("修改人")
@PrevInsert(els = @EL("$me.updatedByUid()"))
@PrevUpdate(els = @EL("$me.updatedByUid()"))
@ColDefine(type = ColType.VARCHAR, width = 32)
private String updatedBy;
/**
* Long不要用ColDefine定义,兼容oracle/mysql,支持2038年以后的时间戳
* 13位时间戳哦,不再是11位
*/
@Column
@Comment("修改时间")
@PrevInsert(now = true)
@PrevUpdate(now = true)
private Long updatedAt;
@Column
@Comment("删除标记")
@PrevInsert(els = @EL("$me.flag()"))
@ColDefine(type = ColType.BOOLEAN)
private Boolean delFlag;
public String toJsonString() {
return Json.toJson(this, JsonFormat.compact());
}
public Boolean flag() {
return false;
}
public String createdByUid() {
String uid = getCreatedBy();
if (Strings.isNotBlank(uid)) {
return uid;
}
try {
return StpUtil.getLoginIdAsString();
} catch (Exception e) {
return "";
}
}
public String updatedByUid() {
String uid = getUpdatedBy();
if (Strings.isNotBlank(uid)) {
return uid;
}
try {
return StpUtil.getLoginIdAsString();
} catch (Exception e) {
return "";
}
}
}
@@ -0,0 +1,18 @@
package com.budwk.app.base.model;
import lombok.Data;
import java.util.List;
@Data
public class CustomFormField {
private String fieldName; // 字段名称
private String fieldType; // 字段类型(如 "text", "date", "file" 等)
private Boolean required; // 是否必填
private Integer maxLength; // 最大字符数(仅适用于文本类型)
private String dateRange; // 日期范围(仅适用于日期类型,格式为 "YYYY-MM-DD,YYYY-MM-DD"
private List<String> allowedFileTypes; // 允许的文件类型(仅适用于文件类型,如 ["pdf", "jpg"]
private Integer maxFiles; // 最大文件数量(仅适用于文件类型)
}
@@ -0,0 +1,25 @@
package com.budwk.app.base.model;
import lombok.Getter;
/**
* Excel导入错误信息
*/
public class ExcelImportError {
/**
* 行号
*/
private int row;
/**
* 错误信息
*/
@Getter
private String errMsg;
public void setErrInfo(String errMsg, int row) {
this.errMsg = errMsg;
this.row = row;
}
}
@@ -0,0 +1,29 @@
package com.budwk.app.base.model;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/**
* Excel导入结果
* @param <T>
*/
@Data
public class ExcelImportRes<T extends ExcelImportError> {
private int totalRecords = 0;
private int successCount = 0;
private int failedCount = 0;
private List<T> errorDetails = new ArrayList<>();
// 失败数+1
public void addFailedCount() {
failedCount++;
System.out.println(failedCount);
}
}
@@ -0,0 +1,46 @@
package com.budwk.app.base.page;
import org.nutz.dao.pager.Pager;
import java.io.Serializable;
/**
* 指定偏移量及大小的Pager, 这样就不会受限于原生Pager的offset=(pageNumber-1)*pageSize
*
* @author wendal
*/
public class OffsetPager extends Pager implements Serializable {
private static final long serialVersionUID = -1385308131663113162L;
protected int offset = -1;
protected OffsetPager() {
}
/**
* 构建一个指定偏移量及大小的Pager
*
* @param offset 偏移量
* @param size 数据大小
*/
public OffsetPager(int offset, int size) {
super();
this.offset = offset;
setPageSize(size);
}
/**
* 覆盖超类的计算得到的offset
*/
public int getOffset() {
if (offset > -1)
return offset;
return super.getOffset();
}
public void setOffset(int offset) {
this.offset = offset;
}
}
@@ -0,0 +1,57 @@
package com.budwk.app.base.page;
public interface Paginable {
/**
* 总记录数
*
* @return
*/
public int getTotalCount();
/**
* 总页数
*
* @return
*/
public int getTotalPage();
/**
* 每页记录数
*
* @return
*/
public int getPageSize();
/**
* 当前页号
*
* @return
*/
public int getPageNo();
/**
* 是否第一页
*
* @return
*/
public boolean isFirstPage();
/**
* 是否最后一页
*
* @return
*/
public boolean isLastPage();
/**
* 返回下页的页号
*/
public int getNextPage();
/**
* 返回上页的页号
*/
public int getPrePage();
}
@@ -0,0 +1,77 @@
package com.budwk.app.base.page;
import org.nutz.lang.Lang;
import java.util.List;
public class Pagination<T> extends SimplePage implements java.io.Serializable {
private static final long serialVersionUID = 1L;
public Pagination() {
}
/**
* 构造器
*
* @param pageNo 页码
* @param pageSize 每页几条数据
* @param totalCount 总共几条数据
*/
public Pagination(int pageNo, int pageSize, int totalCount) {
super(pageNo, pageSize, totalCount);
}
/**
* 构造器
*
* @param pageNo 页码
* @param pageSize 每页几条数据
* @param totalCount 总共几条数据
* @param list 分页内容
*/
public Pagination(int pageNo, int pageSize, int totalCount, List<T> list) {
super(pageNo, pageSize, totalCount);
this.list = list;
}
/**
* 第一条数据位置
*
* @return
*/
public int getFirstResult() {
return (pageNo - 1) * pageSize;
}
/**
* 当前页的数据
*/
private List<T> list;
/**
* 获得分页内容
*
* @return
*/
public List<T> getList() {
return list;
}
/**
* @param classOfT 列表容器內的元素类型
* @return
*/
public List<T> getList(Class<T> classOfT) {
return Lang.collection2list(list, classOfT);
}
/**
* 设置分页内容
*
* @param list
*/
public void setList(List<T> list) {
this.list = list;
}
}
@@ -0,0 +1,175 @@
package com.budwk.app.base.page;
import java.util.ArrayList;
import java.util.List;
public class SimplePage implements java.io.Serializable, Paginable {
private static final long serialVersionUID = 1L;
public static final int DEF_COUNT = 10;
private List<Integer> localArrayList = new ArrayList<Integer>();
public List<Integer> getSegment() {
return localArrayList;
}
/**
* 检查页码 checkPageNo
*
* @param pageNo
* @return if pageNo==null or pageNo 小于 1 then return 1 else return pageNo
*/
public static int cpn(Integer pageNo) {
return (pageNo == null || pageNo < 1) ? 1 : pageNo;
}
public SimplePage() {
}
/**
* 构造器
*
* @param pageNo 页码
* @param pageSize 每页几条数据
* @param totalCount 总共几条数据
*/
public SimplePage(int pageNo, int pageSize, int totalCount) {
setTotalCount(totalCount);
setPageSize(pageSize);
setPageNo(pageNo);
adjustPageNo();
int totalPages = getTotalPage();
minPage = minPage < 1 ? 1 : minPage;
maxPage = maxPage > totalPages ? totalPages : maxPage;
for (int i = minPage; i <= maxPage; i++) {
localArrayList.add(i);
}
}
/**
* 调整页码,使不超过最大页数
*/
public void adjustPageNo() {
if (pageNo == 1) {
return;
}
int tp = getTotalPage();
if (pageNo > tp) {
pageNo = tp;
}
}
/**
* 获得页码
*/
public int getPageNo() {
return pageNo;
}
/**
* 每页几条数据
*/
public int getPageSize() {
return pageSize;
}
/**
* 总共几条数据
*/
public int getTotalCount() {
return totalCount;
}
/**
* 总共几页
*/
public int getTotalPage() {
int totalPage = totalCount / pageSize;
if (totalPage == 0 || totalCount % pageSize != 0) {
totalPage++;
}
return totalPage;
}
/**
* 是否第一页
*/
public boolean isFirstPage() {
return pageNo <= 1;
}
/**
* 是否最后一页
*/
public boolean isLastPage() {
return pageNo >= getTotalPage();
}
/**
* 下一页页码
*/
public int getNextPage() {
if (isLastPage()) {
return pageNo;
} else {
return pageNo + 1;
}
}
/**
* 上一页页码
*/
public int getPrePage() {
if (isFirstPage()) {
return pageNo;
} else {
return pageNo - 1;
}
}
protected int totalCount = 0;
protected int pageSize = 20;
protected int pageNo = 1;
/**
* if totalCount 小于 0 then totalCount=0
*
* @param totalCount
*/
public void setTotalCount(int totalCount) {
if (totalCount < 0) {
this.totalCount = 0;
} else {
this.totalCount = totalCount;
}
}
/**
* if pageSize 小于 1 then pageSize=DEF_COUNT
*
* @param pageSize
*/
public void setPageSize(int pageSize) {
if (pageSize < 1) {
this.pageSize = DEF_COUNT;
} else {
this.pageSize = pageSize;
}
}
/**
* if pageNo 小于 1 then pageNo=1
*
* @param pageNo
*/
public void setPageNo(int pageNo) {
if (pageNo < 1) {
this.pageNo = 1;
} else {
this.pageNo = pageNo;
}
}
int minPage = pageNo - (int) Math.floor((pageSize - 1) / 2.0D);
int maxPage = pageNo + (int) Math.ceil((pageSize - 1) / 2.0D);
int totalPage = getTotalPage();
}
@@ -0,0 +1,47 @@
package com.budwk.app.base.page.datatable;
import java.io.Serializable;
/**
* Created by wizzer on 2016/6/27.
*/
public class DataTableColumn implements Serializable {
private static final long serialVersionUID = 1L;
protected String data;
protected String name;
protected boolean searchable;
protected boolean orderable;
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public boolean isSearchable() {
return searchable;
}
public void setSearchable(boolean searchable) {
this.searchable = searchable;
}
public boolean isOrderable() {
return orderable;
}
public void setOrderable(boolean orderable) {
this.orderable = orderable;
}
}
@@ -0,0 +1,29 @@
package com.budwk.app.base.page.datatable;
import java.io.Serializable;
/**
* Created by wizzer on 2016/6/27.
*/
public class DataTableOrder implements Serializable {
private static final long serialVersionUID = 1L;
protected int column;
protected String dir;
public int getColumn() {
return column;
}
public void setColumn(int column) {
this.column = column;
}
public String getDir() {
return dir;
}
public void setDir(String dir) {
this.dir = dir;
}
}
@@ -0,0 +1,21 @@
package com.budwk.app.base.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 单个条件
*/
@Data
public class Condition {
@ApiModelProperty("字段名")
private String field;
@ApiModelProperty("操作符: =, !=, >, <, >=, <=, LIKE, IN, NOT IN, IS NULL, IS NOT NULL")
private String operator;
@ApiModelProperty("字段值")
private Object value;
}
@@ -0,0 +1,24 @@
package com.budwk.app.base.param;
import com.budwk.app.sys.param.SysDataUserUpdateParam;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* 条件组,支持嵌套的与或非逻辑
*/
@Data
public class ConditionGroup {
@ApiModelProperty("逻辑类型:AND, OR")
private String logic = "AND";
@ApiModelProperty("条件列表")
private List<Condition> conditions;
@ApiModelProperty("嵌套条件组")
private List<ConditionGroup> groups;
}
@@ -0,0 +1,14 @@
package com.budwk.app.base.param;
import lombok.Data;
/**
* 自定义导出表格列
*/
@Data
public class ExportTableColumns {
private String label;
private String prop;
}
@@ -0,0 +1,60 @@
package com.budwk.app.base.param;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Positive;
/**
* @Digits注解 验证注解的元素值的整数位数和小数位数上限 ,并且类型为floatdoubleBigDecimal。
*/
@Data
public class PageForm {
@NotNull(message = "pageNumber不能为空")
@Min(value = 1, message = "pageNumber最小为1")
@Positive(message = "pageNumber必须是正数")
private Integer pageNumber;
@NotNull(message = "pageSize不能为空")
@Max(value = 200, message = "pageSize最大为50")
private Integer pageSize;
private String pageOrderName;
private String pageOrderBy;
private String searchName;
private String searchKeyword;
/*======================流程参数==============================*/
/**
* 是否审核
*/
private Boolean audit;
/**
* 业务ID
*/
private String bizId;
public PageForm defaultSort(String column, String order) {
this.setPageOrderName(column);
this.setPageOrderBy(order);
return this;
}
public PageForm defaultSortAsc(String column) {
return this.defaultSort(column, "ascending");
}
public PageForm defaultSortDesc(String column) {
return this.defaultSort(column, "descending");
}
}
@@ -0,0 +1,68 @@
package com.budwk.app.base.payment.alipay.controller;
import com.budwk.app.base.payment.alipay.service.AlipayService;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
/**
* @ClassName AlipayClientController
* @Description TODO
* @Author zhf
* @Date 2024/1/25 15:36
*/
@IocBean
@Slf4j
@Ok("json:full")
@At("/mobile/memberCost/AlipayClient")
public class AlipayClientController {
@Inject
private AlipayService alipayService;
@At("/tradePagePay")
public String tradePagePay(String money, String paymentProjectId) throws Exception {
log.info("统一收单下单并支付接口调用");
String formStr = alipayService.tradeCreate(money, paymentProjectId);
return formStr;
}
@At("/tradeNotify")
@Ok("re")
public String tradeNotify(HttpServletRequest request) {
try {
Map<String, String> params = new HashMap<String, String>();
Map<String, String[]> requestParams = request.getParameterMap();
for (Iterator<String> iter = requestParams.keySet().iterator(); iter.hasNext(); ) {
String name = (String) iter.next();
String[] values = (String[]) requestParams.get(name);
String valueStr = "";
for (int i = 0; i < values.length; i++) {
valueStr = (i == values.length - 1) ? valueStr + values[i]
: valueStr + values[i] + ",";
}
//乱码解决,这段代码在出现乱码时使用
valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
params.put(name, valueStr);
}
log.info("支付通知,正在执行,通知参数:{}");
return alipayService.tradeNotify(params);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
@@ -0,0 +1,22 @@
package com.budwk.app.base.payment.alipay.service;
/**
* @ClassName AlipayClientConfig
* @Description TODO
* @Author zhf
* @Date 2024/1/25 15:33
*/
public interface AlipayClientConfig {
String serverUrl = "https://openapi.alipay.com/gateway.do";
String appId = "2021004133670087";
String sellerId = "2088002638762620";
String privateKey = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCEJBWNlUIY/2Tave1OtjTgvA21GZ5tdvZZD3jFmixIFTkEdZaRUpXCvlKuZ9heoL1IQwpbuOErJ4dM2f2Ju/Oc7QtUOjEOX6CnElR73KK5OSY8d8f5822LUOgp2zg5FHI6C7olYmjN4Nw26G6BGyqQBmWs4/sKzghKelEaH9AqkR8DZ+yOvuYtIg5KEvVixsM27TMhd6/3BuNXDIiQDVH9ZeQVb9IKuynZ6hnUJS0T4MkS41qehS1u8LgplGU5yvrNuUNeQtybADsiGHDNmNkl5lVt0QNh+N/lo56//duf5PJwh8ApDB22eXptiS6p321PSrYowy5VeFpHC07Tref9AgMBAAECggEAPQddXPKegGUT82LcgwnsCg9QVV/rp6rVw/Q9VyYJZZFHsCOO0rdNq4+zKBGWAL5ELWepFQuiEwhCmN/lFQPVU5i3LsNhfL31uLPiiQIxtVILssmvdmVTJpDLaOlyYgprZxubcUCuHsfHbSSURNSDJ9mMg/kXLLpTYfJ0Gpiuz7lkrMuAxncdz88Sp2r0O9k2T+TcnHFpRXHs+C/QAaa15EF18ieDSBLPkY0ti1R8J91LGAzDrjwcP7pNlq4u7TasZ7djv47ZFwQ3yjWoo13d9ab0MBYeQx9Grf5N+JGNf33YLyulQ0IshcuwNyB+RYhyWGjNmjnJdytzKRMOYSpPgQKBgQC6iqMPX+LGunyI+3T9l/AwAVWRJXzEHPflNxDYfQbicB5awlRixxH5T1qyZ46KZb/pBt01qDULXy0bEObVFSjAn1wXPzC9Fwb+BtVZUroYBTKV3tOAMpVCz2AAC34OZwG/3X//sRtW9Sr0Dr+yCcx8ULMiFS1BuCZfhSNXA516NQKBgQC1V+rge1pYKGnjtWqML4qJy4FEIDI4fSpGIizxumYDMxdXoUdNKoG2NHQkznHU4fIHJPVvIN/Tm82mfj2rhH9eFuu1FB8TL2soe5nPgzSJ9AmP7rZ7KBo3/SczvZqUEpii8+PjHu+Gx95BmgTzOFMnYz8xzitb4IBGTEGxVzavqQKBgCL28XFkS6FsOwOB/n+6Bu84kM1P9X7c3yo7lBC//pZa5ZWlbyPEpH3SffGKr5EJWVtYSgZQrQCgqle0Z0/xU14ngJ9q3LvUoR7kMQE5HGB8OOsWhRY2ZPvM2vWnMc2JSS6pWeCXVcSK164/RXcdlxKGHc15oq360lZ9Ig6hQtcxAoGAIYijd2V4HGtEwYXvsQKtlLOcMNPfVZDXu2Zgd0bnzFmrTFoXjE569A2ZGKFQbXRmxClydV1X5pKeIdagYtI6l1SXu8F/yZVwNGk+1R/HHGeTSRl0hyuwRYA7upaqOg2CSkfdcUdsNblKAUmQ9sUIo3T336bnX7MRJW6+iyO8ihkCgYBG8vG1fVUwPmqlRK+QanHxicR1+UyjRAN+aW6dgJUNMlC+tmPeHj21+WGkDdKPdhinHziLihLmzbmpwWSDwuGMMQPNQm8gSjiaqy1tWcP6XKDxjpG5biTzwEyHNuCIY6odS4HTeDOrrU4LvN6PxirN8xKBIpq+A2cgpGo+Mn4x+g==";
String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjO/QUy+ujNBlToL6Kt8YjvTRGpEwmXjqc9pFe7GIORVkzBXP3F/UC/w5mPiwXhhyymXAe7bUwLANL/QMUZhvpjjCdLENtFWC9bd6hq3m2oHiTu0oicbzqCuaoQkzik2NybrNjuH+aYVi4RU0eNYpdewQoHHW+hbfxkSYUWmx7NF4SuG93edYlpc/G/ImdrweATLE0b6W9il4H/BxVUweCraPrispiOM8r6TN3fiIKUQRP15HKQo8Xsr4pMJzfi37I9aN8AThN/xBf6sual8IZZsH5hC3PS37LrYkXbUjt0dK5tqKl3SsZPjvvHGyz9b9JC225+0q09Y6B8/axOlihwIDAQAB";
/* String serverUrl = "https://openapi-sandbox.dl.alipaydev.com/gateway.do";
String appId = "9021000134641646";
String privateKey = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCBFTF8qFbK+NiqUbKf1/jWHL/s0hfUXK6cyKwZCEXkEMZH1Lu6kZQl3kQye9Fsasawxn1vLmKz+OKjMiE+TdTytHDu5ULdLlSHN3bY1qf91i8L+RJfmZpb1p+NQOk9zImhhSauuk+itMkTC3bTiwwAkg/utOxkNB7YaynpAb3evhXnlX3LUVTHaMnCQFeV7ithh7CDKx0LPlxOpOvxnkWDBR3nsdcfjDqYNDVHXnUxEk0KQV4Ik6fA40+Gq/HXTByJolCSAaTk0OaH2ULp1RZAklWLqhiNEhytTZAlJUx8cSm36mm0c4jhgSXNdRz0Yi1BlPY9yxQGStpH5ue3+EfvAgMBAAECggEAda/D4Zp9HysIJyi7SZ6XwWaO2TSnAzfI/yq6NUxkpE1i6cSbr7rgrjHaTYiz5DvpkOw3GnHZDarhvtaKlopRl0JKIJSnhI6kBG/eDE6Q9Q4c8LaSONULdaXU6+z9ehmMddW28eDtkDNxi8qM+MuyEqcYnZMYXzdh1ADIQicTXArxo+9fpvlKUMNxOTO5LoOf0DtJg/xE1CD9PtWVc+l2G8S3+C52+RhfZ214YQdxwayMlvJQlWzLTbfzJCp8w4F2up1nJdwp7EY8k8xDUngEnG6BWm8ztWUVTTg7qp/+SC9yMTD2dl86wDkJt1lTtwcKaWxHYh2ZIn8a8+icHFykaQKBgQDgBEWAmuj0pgpny5Q0GRsUYPq42SwpN70u4rmD5UYFCeDHaKb4U3kyvA1V+1Tp0XWzFi7GU855h1n8dnQX64J3Vm4GfhftWwTJgB5ibbY53cZVEoV5nZe0bOO4hxxMdNy3BKjPovkT0REPpCkVas/RRLAFCdnvi6vmDkFxvv9JewKBgQCTgx9NZZCqSzzCJYpLTDOCitooOQmR8kAlgBiDCcHeH2wNVMh5O2Dl/OyTGauKUJFWIOSD8FXVTrNUbOEmx58msnS/+Mc5SnbEka5ptVEDp73gf6ctB+eZAMdO1kLsBT3iKnuyNa7pRyR/D2A692RHOTQZIvRHE1N+kM1r+iBPHQKBgCZRVLocxUAjrp/2eJE4wiMIO5qmuyEJwbhlW6ot634tJF+3jOfpD1AYToeoh+u+wk0xvCp8Z1LuTfwbHtyAkj5rcEJ4Cwu0h+sXmRro/USEpMokcuRMioh4H7OOmM6TJrW/fEiX7dbv6eUtBUH+lTGMeDdEahzJXUvqoFMegnhFAoGAa2eflRUMflIFzT7UMPsszjIXog3VoASJHETmlBK4q+ipHhPLXCoV5Z+BCaI5Op5rFBEjEcYeWQ/Slvgn/7p9cQmi5FxZgqdrTrjcC2/Pqx+pqxqHOMx2nvroI8jyNTOj2VchdaKM1qHMOw+Q+55Bz3IhMuQ2hMHXm2IHkEUw3SkCgYBjcqcWbJcq26L8yYVpU2JFzOvu7iHuV99TpEvF9Ym3cAcSNuoR5kGXzGS0MadYY87cd4HK9HvmXQmthLY14buKYxq27ZFfNbK/Auz8vk0Wbrm1Ym4Z1yMqClQqxKdr4hV29ijn1nPProRqgnVsGH3EtFmNxDfilZoVzh9ERaZe7w==";
String alipayPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArhElUiFMpxqFCs+8zDHa4OVuhdWgKUUGVKgWnfLktPgy9mDZkuGPKk295k8ktWQSUZsnFvT8ikJIKdGYfbSWzlXvCAn6lDDDlsjfOJWMQ6zLmb9xygCih2OjwN5xt9QFIIthnWq8sOXpWvqmoRpIFQHolxxmvvCmUZ/VwK6mwgwU/yVvVypruQ/FGrJA70LAcJ764spWAMy/pWIoIs5UewOlJa3TAcZQIqRnjupL2/sI/TpIWFWF90a/rahwLfBgZ83VH7MA4Tl9uFLc3aeNFLllDF4X7lRdzaHIMYgUUKte9yvlDy5Ihrt+ssjsgdRhqLHvFn00u/g7BCvO5ZmIUwIDAQAB";
*/
}
@@ -0,0 +1,15 @@
package com.budwk.app.base.payment.alipay.service;
import com.budwk.app.base.service.BaseService;
import java.util.Map;
public interface AlipayService extends BaseService {
/**
* 支付宝开放平台接收 request请求对象后
* @return
*/
String tradeCreate( String money, String paymentProjectId) throws Exception;
String tradeNotify(Map<String, String> params) ;
}
@@ -0,0 +1,140 @@
package com.budwk.app.base.payment.alipay.service.impl;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayConstants;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.domain.AlipayTradeWapPayModel;
import com.alipay.api.internal.util.AlipaySignature;
import com.alipay.api.request.AlipayTradeWapPayRequest;
import com.alipay.api.response.AlipayTradeWapPayResponse;
import com.budwk.app.base.payment.alipay.service.AlipayClientConfig;
import com.budwk.app.base.payment.alipay.service.AlipayService;
import com.budwk.app.base.service.impl.BaseServiceImpl;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffmanage.memberCost.model.MemberPaymentInfo;
import lombok.extern.slf4j.Slf4j;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.loader.annotation.IocBean;
import java.util.Date;
import java.util.Map;
/**
* @ClassName AlipayNewServiceImpl
* @Description TODO
* @Author zhf
* @Date 2024/1/25 15:38
*/
@Slf4j
@IocBean(args = {"refer:dao"})
public class AlipayNewServiceImpl extends BaseServiceImpl implements AlipayService {
public AlipayNewServiceImpl(Dao dao) {
super(dao);
}
DefaultAlipayClient alipayClient = new DefaultAlipayClient(AlipayClientConfig.serverUrl,
AlipayClientConfig.appId,
AlipayClientConfig.privateKey,
AlipayConstants.FORMAT_JSON,
AlipayConstants.CHARSET_UTF8,
AlipayClientConfig.alipayPublicKey,
AlipayConstants.SIGN_TYPE_RSA2);
@Override
public String tradeCreate(String money, String paymentProjectId) throws Exception {
String outTradeNo = String.valueOf(new Date().getTime());
AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest();
//支付宝公共参数
request.setReturnUrl("http://sansi.ltd/mobile/memberCost/AlipayClient/tradeNotify");
//面向对象封装业务参数
AlipayTradeWapPayModel model = new AlipayTradeWapPayModel();
model.setOutTradeNo(outTradeNo);
model.setTotalAmount(money);
model.setSubject("会员入会会费");
model.setProductCode("QUICK_WAP_WAY");
model.setSellerId(AlipayClientConfig.sellerId);
model.setTimeoutExpress("30m");
model.setQuitUrl("http://sansi.ltd/mobile/memberCost/list");
request.setBizModel(model);
//执行请求,调用支付宝
AlipayTradeWapPayResponse response = alipayClient.pageExecute(request, "POST");
if (response.isSuccess()) {
dao().update(MemberPaymentInfo.class, Chain.make("payId", outTradeNo), Cnd.where("paymentProjectId", "=", paymentProjectId)
.and("userId", "=", SecurityUtil.getUserId()));
log.info("调用成功,返回结果:[{}]", response.getBody());
return response.getBody();
} else {
log.info("调用失败!!");
}
return null;
}
@Override
public String tradeNotify(Map<String, String> params) {
String total_amount = params.get("total_amount");
String out_trade_no = params.get("out_trade_no");
String trade_no = params.get("trade_no");
//
String result = "failure";
try {
//异步通知验签
boolean signVerified = AlipaySignature.rsaCheckV1(params,
AlipayClientConfig.alipayPublicKey,
AlipayConstants.CHARSET_UTF8,
AlipayConstants.SIGN_TYPE_RSA2);
if (!signVerified) {
// TODO 验签失败则记录异常日志,并在response中返回failure.
log.error("支付成功,异步通知验签失败!");
return result;
}
log.info("支付成功,异步通知验签成功!");
//TODO 验签成功后,按照支付结果异步通知中的描述,对支付结果中的业务内容进行二次校验
//1.验证out_trade_no 是否为商家系统中创建的订单号
String outTradeNo = params.get("out_trade_no");
if (!outTradeNo.equals(out_trade_no)) {
log.error("订单号不一致");
return result;
}
//2.判断 total_amount 是否确实为该订单的实际金额
String totalAmount = params.get("total_amount");
if (!totalAmount.equals(total_amount)) {
log.error("订单的实际金额不一致");
return result;
}
//3.校验通知中的 seller_id是否为 out_trade_no 这笔单据的对应的操作方
String sellerId = params.get("seller_id");
if (!sellerId.equals(AlipayClientConfig.sellerId)) {
log.error("商家PID校验失败");
return result;
}
//4.验证 app_id 是否为该商家本身
String appId = params.get("app_id");
if (!appId.equals(AlipayClientConfig.appId)) {
log.error("app_id校验失败");
return result;
}
dao().update(MemberPaymentInfo.class,
Chain.make("isPayment", true)
.add("paymentMoney", total_amount)
.add("paymentTime", new Date())
.add("tradeNo", trade_no),
Cnd.where("userId", "=", SecurityUtil.getUserId()).and("payId", "=", out_trade_no));
//TODO 处理自身业务
result = "->:/mobile/memberCost/list/paySuccess";
} catch (AlipayApiException e) {
e.printStackTrace();
}
return result;
}
}
@@ -0,0 +1,24 @@
package com.budwk.app.base.payment.enums;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 退款状态枚举
*/
@Getter
@AllArgsConstructor
@DictEnum(key = "RefundStateEnum", name = "退款状态枚举")
public enum RefundStateEnum {
INITIATE_REFUND("发起退款"),
REFUNDING("退款中"),
REFUND_SUCCESS("退款成功"),
REFUND_FAILED("退款失败");
/**
* 避免和枚举类的name冲突
*/
public final String refundStateName;
}
@@ -0,0 +1,25 @@
package com.budwk.app.base.payment.enums;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 交易渠道枚举
*/
@Getter
@AllArgsConstructor
@DictEnum(key = "TradingChannelEnum", name = "交易渠道枚举")
public enum TradingChannelEnum {
QQ_PAY("QQ"),
WX_PAY("微信"),
JD_PAY("京东"),
ALI_PAY("支付宝"),
UNION_PAY("云闪付");
/**
* 避免和枚举类的name冲突
*/
public final String tradingChannelName;
}
@@ -0,0 +1,24 @@
package com.budwk.app.base.payment.enums;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 支付状态枚举
*/
@Getter
@AllArgsConstructor
@DictEnum(key = "TradingStateEnum", name = "支付状态枚举")
public enum TradingStateEnum {
WAITING_FOR_PAYMENT("等待支付"),
PAY_SUCCESS("支付成功"),
CANCEL_PAYMENT("取消支付");
/**
* 避免和枚举类的name冲突
*/
public final String tradingStateName;
}
@@ -0,0 +1,22 @@
package com.budwk.app.base.payment.enums;
import com.budwk.app.base.annotation.DictEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 交易类型枚举
*/
@Getter
@AllArgsConstructor
@DictEnum(key = "TradingTypeEnum", name = "交易类型枚举")
public enum TradingTypeEnum {
PAYMENT("付款"),
REFUND("退款");
/**
* 避免和枚举类的name冲突
*/
public final String tradingTypeName;
}
@@ -0,0 +1,30 @@
package com.budwk.app.base.payment.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @version 1.0
* @Author zzr
* @nameWxPayResultCode
* @Date 2025/3/10 10:27
* @注释 微信支付返回码
*/
@Getter
@AllArgsConstructor
public enum WxPayResultCode {
SUCCESS(200, "操作成功"),
APPID_MCHID_NOT_MATCH(400, "商户ID和服务号或企业微信号不匹配"),
INVALID_REQUEST(400, "无效请求"),
MCH_NOT_EXISTS(400, "商户号不存在"),
PARAM_ERROR(400, "参数错误"),
SIGN_ERROR(401, "签名错误"),
NO_AUTH(403, "商户无权限"),
OUT_TRADE_NO_USED(403, "商户订单号重复"),
FREQUENCY_LIMITED(429, "频率超限"),
SYSTEM_ERROR(500, "系统错误");
final int code;
final String msg;
}
@@ -0,0 +1,61 @@
package com.budwk.app.base.payment.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.math.BigDecimal;
/**
* 退款记录表
*/
@Data
@Table
@Comment("退款记录表")
@EqualsAndHashCode(callSuper = true)
public class PaymentRefundRecord extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("关联系统交易订单表Id")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String paymentTransactionId;
@Column
@Comment("本次退款订单号")
@ColDefine(type = ColType.VARCHAR,width = 128)
private String outRefundTradeNo;
@Column
@Comment("第三方支付的退款单号")
@ColDefine(type = ColType.VARCHAR,width = 128)
private String refundNo;
@Column
@Comment("退款状态")
@ColDefine(type = ColType.VARCHAR,width = 30)
private String refundState;
@Column
@Comment("本次退款金额")
@ColDefine(type = ColType.INT)
private Integer refundAmount;
@Column
@Comment("原订单金额")
@ColDefine(type = ColType.INT)
private Integer total;
@Column
@Comment("交易返回数据")
@ColDefine(type = ColType.MYSQL_JSON)
private String resultJson;
}
@@ -0,0 +1,131 @@
package com.budwk.app.base.payment.model;
import com.budwk.app.base.model.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;
import java.math.BigDecimal;
/**
* 交易单表
*/
@Data
@Table
@Comment("交易订单表")
@EqualsAndHashCode(callSuper = true)
public class PaymentTransaction extends BaseModel {
@Column
@Name
@Comment("ID")
@ColDefine(type = ColType.VARCHAR, width = 32)
@PrevInsert(uu32 = true)
private String id;
@Column
@Comment("商户号")
@ColDefine(type = ColType.VARCHAR,width = 128)
private String mchId;
@Column
@Comment("订单号,传递给交易系统,交易系统订单号")
@ColDefine(type = ColType.VARCHAR,width = 128)
private String outTradeNo;
@Column
@Comment("交易系统交易号")
@ColDefine(type = ColType.VARCHAR,width = 128)
private String transactionId;
@Column
@Comment("交易渠道")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String tradingChannel;
@Column
@Comment("交易类型")
@ColDefine(type = ColType.VARCHAR,width = 30)
private String tradingType;
@Column
@Comment("交易状态")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String tradingState;
@Column
@Comment("用户ID")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String userId;
@Column
@Comment("用户工号")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String loginName;
@Column
@Comment("用户姓名")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String userName;
@Column
@Comment("工会id")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String unionId;
@Column
@Comment("用户工会")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String unionName;
@Column
@Comment("单位id")
@ColDefine(type = ColType.VARCHAR,width = 32)
private String unitId;
@Column
@Comment("用户单位")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String unitName;
@Column
@Comment("交易金额")
@ColDefine(type = ColType.INT)
private Integer tradingAmount;
@Column
@Comment("是否退款")
@ColDefine(type = ColType.BOOLEAN)
private Boolean isRefund;
@Column
@Comment("退款金额")
@ColDefine(type = ColType.INT)
private Integer refundAmount;
@Column
@Comment("订单描述")
@ColDefine(type = ColType.VARCHAR,width = 128)
private String description;
@Column
@Comment("附加详细描述")
@ColDefine(type = ColType.TEXT)
private String attach;
@Column
@Comment("微信支付用户openId")
@ColDefine(type = ColType.VARCHAR,width = 50)
private String openId;
@Column
@Comment("交易返回数据")
@ColDefine(type = ColType.MYSQL_JSON)
private String resultJson;
@Column
@Comment("交易名单的主键id")
@ColDefine(type = ColType.VARCHAR, width = 32)
private String memberPaymentInfoId;
}
@@ -0,0 +1,53 @@
package com.budwk.app.base.payment.wxpay.bean;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @version 1.0
* @Author zzr
* @nameWxPayV3Bean
* @Date 2025/3/6 9:54
* @注释
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WxPayV3Bean {
/**
* 服务号
* appid: wxf12fa6175ec7c75f
* app_secret: f65bbb41d3de4a93c8c93d8e2fd50369
*/
private String appId;
private String keyPath;
private String publicKeyPath;
private String certPath;
private String certP12Path;
private String platformCertPath;
private String mchId;
private String apiKey;
private String apiKey3;
private String domain;
private String publicKeyId;
@Override
public String toString() {
return "WxPayV3Bean{" +
"appId='" + appId + '\'' +
", keyPath='" + keyPath + '\'' +
", publicKeyPath='" + publicKeyPath + '\'' +
", certPath='" + certPath + '\'' +
", certP12Path='" + certP12Path + '\'' +
", platformCertPath='" + platformCertPath + '\'' +
", mchId='" + mchId + '\'' +
", apiKey='" + apiKey + '\'' +
", apiKey3='" + apiKey3 + '\'' +
", domain='" + domain + '\'' +
", publicKeyId='" + publicKeyId + '\'' +
'}';
}
}
@@ -0,0 +1,44 @@
package com.budwk.app.base.payment.wxpay.controller;
import com.budwk.app.base.payment.wxpay.service.WxPayCommonService;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @version 1.0
* @Author zzr
* @nameWxPayCommonController
* @Date 2025/3/10 19:28
* @注释 微信支付回调
*/
@Slf4j
@IocBean
@Ok("json:full")
@At("/platform/wxPay")
public class WxPayCommonController {
@Inject
private WxPayCommonService wxPayCommonService;
@At
@Ok("void")
@ApiOperation("微信支付-付款回调")
public void payNotify(HttpServletRequest request, HttpServletResponse response){
wxPayCommonService.payNotify(request, response);
}
@At
@Ok("void")
public void refundNotify(HttpServletRequest request, HttpServletResponse response){
wxPayCommonService.refundNotify(request, response);
}
}
@@ -0,0 +1,25 @@
-----BEGIN CERTIFICATE-----
MIIEKDCCAxCgAwIBAgIUONYpzvxVfV/RrWnLGPlL6/nb/AcwDQYJKoZIhvcNAQEL
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
Q0EwHhcNMjUwMzA2MTQwNDAzWhcNMzAwMzA1MTQwNDAzWjCBgTETMBEGA1UEAwwK
MTY2NjkzMDk4MDEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMS0wKwYDVQQL
DCTmrabmsYnlnLDlpKfkuInmgJ3np5HmioDmnInpmZDlhazlj7gxCzAJBgNVBAYT
AkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC
AQoCggEBALlDML+FJEW+m2hXp/qUH1cU6xlwFllLU4LjFusJkxwyzzcZO4nY0mOi
3woz8xIJipvUWj2Y413WYwMkfcJcRgghupZkfYwdQtSyPfUu7xQBUm8TLWGH88Re
kyyVABEB5T+ne6r3LesXS4IuZknm5N/iaa4z9mbbscGqF0GLvMUqZCRNyTkyfK9r
Bkvs/vspi+Jcjx9I7aU++h/vwzsGB6Bf/uB3kLMb+lj/i3xY20sdrrW8JD2sqONQ
NcRIKmNXSp4zsNy+d6kIKWE3P5609ZTta1ogkeGBNdGXMRNNy6vLIudQc7zny/9H
S4LxGsIrsYmZNhGljRng56X+PG3w1CUCAwEAAaOBuTCBtjAJBgNVHRMEAjAAMAsG
A1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0cDovL2V2Y2Eu
aXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRC
MDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0MjJFMTJCMjdB
OUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUAA4IBAQBQ5e8U
1pQ40gfRoZyO0s+QF16L8pAcVLVwHffo0mmJpIRB4bu8W5IJ9kKhksJ0CzZ0YEwB
Yv7/LTC1qpi7PE73nZ4Ytm9oZeH1Kk5KIlQS+2H3IwOpoV4wucMc34y6MVQJjC7E
u5OnglBPSAopwNP4p+Us9A3ah7Ks48XCw+LCEWpA/setJwo9C13Qq2AQm8qLpogK
pNBwm/oylxb8/kZK1lLPgcXd7geLDhl/Str+aOzBXyd7YSEMxS8zWiZhWozu6rCq
dg10QFKicPGDkDzNQwBz7cDXvlJXSWRDBK5r1li1YgX+QD5WJYPchATo5SlvF4Lr
5/V/dZzI7BJTinr1
-----END CERTIFICATE-----
@@ -0,0 +1,28 @@
-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC5QzC/hSRFvpto
V6f6lB9XFOsZcBZZS1OC4xbrCZMcMs83GTuJ2NJjot8KM/MSCYqb1Fo9mONd1mMD
JH3CXEYIIbqWZH2MHULUsj31Lu8UAVJvEy1hh/PEXpMslQARAeU/p3uq9y3rF0uC
LmZJ5uTf4mmuM/Zm27HBqhdBi7zFKmQkTck5MnyvawZL7P77KYviXI8fSO2lPvof
78M7BgegX/7gd5CzG/pY/4t8WNtLHa61vCQ9rKjjUDXESCpjV0qeM7DcvnepCClh
Nz+etPWU7WtaIJHhgTXRlzETTcuryyLnUHO858v/R0uC8RrCK7GJmTYRpY0Z4Oel
/jxt8NQlAgMBAAECggEBAKGQqTi9Ii741Ysftsze1J4bDhS3HaZt/LyO0vPS+8qB
vRiuFrBWuNRPu/en6nl2fLz9al2Bsfep+dtJvar80c5Rq+lwZdUFx7y6XTIv5iwq
IvvfW5pM+Bfu6qbcopwybP0gUMd+nTsCq8UyNd6JUFy3lbZodqCpQ9JDRdjRxqSi
oMonve36Q9kJyDs0mS2F0w+Y9oYFtpE9WvGMBthwT7VfzWuDa+YC/Gh0RhT2V9OG
uDC8kxmfaIbk0IITDVFWVMMhScXiqmJL1II9yQWsCHH73dZS+dDxwwH0ObRD3kOx
hHptxpRzhtuNxLjCOZDGhneyvUHIftpqf4wdOgQ8iUECgYEA6TDo36s3XDFIs8SH
lpVYrhie0nmaNET50CtOc5C2M1OotrkMUrQTMoa4F263UloJfqweW9AKZX11wPp2
8h7af2sZsGawjuwv7mMthZJoi0fc5J2+z6BnVGgFo7uZbcs1Y/+B0tNrDKIHVrqb
Lywmh18iKDXrMiMDMRp8mtiNyU0CgYEAy2Im0oGb1rmAh9gPvQIENmNEgRsyIU4x
WPAFb5KO7jnseO9KrC9uiRSO5JuwZu/QNGlga2w77Gu7n+Q4HfSU2KFlNhR6pKjb
mqXzPq1quryzbtWay520VsRKz3F/Tfp1FUpIuZvj8x7FrL8z8vjbLkbW4p+Z7HE4
heYdmk2KCjkCgYBC6xU48pJtc3swk2pxjSQoucoCDoFxFIY39eWKhnGy4wQcg5gE
t8Z2jnCP0ObszAfDgTMpF9eT7l/3ZCj0LGR5gkuZ8q4iJadPmsh6d1xm89VxCc+z
F43vi/ZqWTCbcGA+9RjVXnRu6KSAgAZ+kAXyfRt5PJflCGUnFznA2fo+VQKBgG6s
n7Gno/UKBv5lPdM9mKs8A5g6A2KKWWIrYtnfJ/ZNAPiiRsFCImVoEYYnjqvFTkhn
G3f5cvZpfbU5jKwIX0MvOJNgO4kE9lPGgIKX/d9WNlJW3KB21h7tPER8X6lAZJxM
SxztzvKKyUkC1zMd5q/dDqxN64X16qs6mNtR3I9JAoGBAJbqQtg59Szi2m4jZ9Xo
0cKvP7+PSKgysdWsemTkU0ji1rcMpGRTtcUGRWlawLjRSInQS+xNdL6GVU5mHZWe
gNwXIXEpape4IJta0B1PYAhNcIvOSh5CzcUnVTeo6q0CTSVQPdsivlrObLKZ4uGQ
eewDw82Ej6YoSgczjf99ug0x
-----END PRIVATE KEY-----
@@ -0,0 +1,24 @@
-----BEGIN CERTIFICATE-----
MIIEFDCCAvygAwIBAgIUKN05Gm0Q9n9mLPPltUh8qjKKegQwDQYJKoZIhvcNAQEL
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
Q0EwHhcNMjUwMzA2MTQwNDAzWhcNMzAwMzA1MTQwNDAzWjBuMRgwFgYDVQQDDA9U
ZW5wYXkuY29tIHNpZ24xEzARBgNVBAoMClRlbnBheS5jb20xHTAbBgNVBAsMFFRl
bnBheS5jb20gQ0EgQ2VudGVyMQswCQYDVQQGEwJDTjERMA8GA1UEBwwIU2hlblpo
ZW4wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDbMenF0GNlcUYErPpj
Aj+WOuzRFz+PJcrtgkI81S0WDh8flMtq1A2nwKARNyPXx+UPd9it657nH5G8E9kL
Ea5u5rENpn+JZc4cAIvZqazteSAUg2pfQH9ewW+/CxNOWarjXPNRYa0OjZWf+5F8
ZBOT/x8sJ2+jou9lxKNe1skha+jzmiQ8m3B2vPXqR87qgL/fyQjjpLvBGpvearh/
hxTMBEfGeB4F6Fu52Fz3/VCWe38ubxwj8EMcRSPp4xsl2BTaRVMMT525Hul2N49C
vXCSVsCNt3ND8UDffXnb19Zgpir4KqpECTbfqcT7YX+U34P1Av8gcDl6rRm+7Wpj
PY4RAgMBAAGjgbkwgbYwCQYDVR0TBAIwADALBgNVHQ8EBAMCA/gwgZsGA1UdHwSB
kzCBkDCBjaCBiqCBh4aBhGh0dHA6Ly9ldmNhLml0cnVzLmNvbS5jbi9wdWJsaWMv
aXRydXNjcmw/Q0E9MUJENDIyMEU1MERCQzA0QjA2QUQzOTc1NDk4NDZDMDFDM0U4
RUJEMiZzZz1IQUNDNDcxQjY1NDIyRTEyQjI3QTlEMzNBODdBRDFDREY1OTI2RTE0
MDM3MTANBgkqhkiG9w0BAQsFAAOCAQEAUAvXCx55ZGmd3ATi28W4mirnUHQb2RAw
X5/0OC2SkuBdzxI5RbY4YAuugP6nQIAU8TXCANzno2oqZ6vmFZ4dBnJmLewVFMoM
qp18A4RWmnsGnmEIgMm6N1kB+RbM11oLCLdy2KK0SvmqDmTBFJyjyUGqEmRshnV/
QfKn4UUzJ4suDFAolGX4DyDIOtM0D+SCHwwxGI4yf2+nj4IB8XgmmOeschxoSvu9
T3E6BgQ271YVDwg+3r9CiFVI5JdyftvQagOEQmZJMPINEKgFn5LzrZJW7mH42+N+
i4RFz04wpGUsrSFDESh3JxYSNhq/HulpMLinntWxEBHFhpkjyyGDGg==
-----END CERTIFICATE-----
@@ -0,0 +1,71 @@
package com.budwk.app.base.payment.wxpay.service;
import com.budwk.app.base.payment.wxpay.vo.WxPayNeedParamVo;
import com.budwk.app.base.result.Result;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @version 1.0
* @Author zzr
* @nameWxPayCommonService
* @Date 2025/3/6 11:40
* @注释
*/
public interface WxPayCommonService {
/**
* 二维码统一下单返回支付二维码链接
* @param paramVo 需要传递的信息请自定义付款金额Amount 付款描述Description其他关键信息请勿修改
* 注意Amount的总价total是int类型会自动乘以0.01例如传递100元会自动转换为1元
* @return
*/
Result nativePay(WxPayNeedParamVo paramVo);
/**
* JSAPI支付返回支付参数
* @param paramVo 需要传递的信息请自定义付款金额Amount 付款描述Description其他关键信息请勿修改
* 注意Amount的总价total是int类型会自动乘以0.01例如传递100元会自动转换为1元
* JsAPI支付需要传递openId请自行获取
* @return
*/
Result jsApiPay(WxPayNeedParamVo paramVo);
/**
* WAP支付返回支付参数
* @param paramVo 需要传递的信息请自定义付款金额Amount 付款描述Description其他关键信息请勿修改
* 注意Amount的总价total是int类型会自动乘以0.01例如传递100元会自动转换为1元
* @return
*/
Result wapPay(WxPayNeedParamVo paramVo);
/**
* 支付回调,验证是否支付成功
* @param request 请求
* @param response 响应
*/
void payNotify(HttpServletRequest request, HttpServletResponse response);
/**
* 退款
* @param transactionId 微信订单号
* @param outTradeNo 商户订单号
* @return
*/
Result refund(String transactionId, String outTradeNo);
/**
* 退款回调
* @param request 请求
* @param response 响应
*/
void refundNotify(HttpServletRequest request, HttpServletResponse response);
}
@@ -0,0 +1,612 @@
package com.budwk.app.base.payment.wxpay.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.ContentType;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.payment.enums.*;
import com.budwk.app.base.payment.model.PaymentRefundRecord;
import com.budwk.app.base.payment.model.PaymentTransaction;
import com.budwk.app.base.payment.wxpay.bean.WxPayV3Bean;
import com.budwk.app.base.payment.wxpay.service.WxPayCommonService;
import com.budwk.app.base.payment.wxpay.vo.WxPayNeedParamVo;
import com.budwk.app.base.result.Result;
import com.budwk.app.sys.models.Sys_user;
import com.budwk.app.sys.services.SysUserService;
import com.budwk.app.sys.views.View_user;
import com.budwk.app.web.commons.auth.utils.SecurityUtil;
import com.budwk.app.zhgh.staffmanage.memberCost.model.MemberPaymentInfo;
import com.ijpay.core.IJPayHttpResponse;
import com.ijpay.core.enums.AuthTypeEnum;
import com.ijpay.core.enums.RequestMethodEnum;
import com.ijpay.core.kit.AesUtil;
import com.ijpay.core.kit.HttpKit;
import com.ijpay.core.kit.PayKit;
import com.ijpay.core.kit.WxPayKit;
import com.ijpay.wxpay.WxPayApi;
import com.ijpay.wxpay.enums.WxDomainEnum;
import com.ijpay.wxpay.enums.v3.BasePayApiEnum;
import com.ijpay.wxpay.model.v3.*;
import lombok.extern.slf4j.Slf4j;
import org.nutz.aop.interceptor.ioc.TransAop;
import org.nutz.dao.Chain;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;
import org.nutz.ioc.aop.Aop;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.lang.random.R;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.FileWriter;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.StandardCharsets;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @version 1.0
* @Author zzr
* @nameWxPayCommonServiceImpl
* @Date 2025/3/6 11:41
* @注释
*/
@Slf4j
@IocBean
public class WxPayCommonServiceImpl implements WxPayCommonService {
// 判断下单接口成功返回码
private final static int OK = 200;
// 1666930980 商户号
// ww3eda050a1b5ad96e 企业微信
// wxf12fa6175ec7c75f 微信服务号
// 微信V3必要的支付参数后期优化
private final static WxPayV3Bean WX_PAY_V3_BEAN = new WxPayV3Bean(
"wxf12fa6175ec7c75f",
"src/main/java/com/budwk/app/base/payment/wxpay/pem/apiclient_key.pem",
"src/main/java/com/budwk/app/base/payment/wxpay/pem/apiclient_key.pem",
"src/main/java/com/budwk/app/base/payment/wxpay/pem/apiclient_cert.pem",
"src/main/java/com/budwk/app/base/payment/wxpay/pem/apiclient_cert.pem",
"src/main/java/com/budwk/app/base/payment/wxpay/pem/wechatpay.pem",
"1666930980",
"",
"4ebd020883285d698c44ec50939c0967",
"https://schoolhd.top/platform",
"");
// 自定义参数内容是统一的但会被多次调用直接声明
private String serialNo;
private String platSerialNo;
private final String payNotifyUrl = WX_PAY_V3_BEAN.getDomain().concat("/wxPay/payNotify");
private final String refundNotifyUrl = WX_PAY_V3_BEAN.getDomain().concat("/wxPay/refundNotify");
@Inject
private Dao dao;
@Inject
private SysUserService sysUserService;
/**
* 微信扫描二维码支付
* @param paramVo 需要传递的信息请自定义付款金额Amount 付款描述Description其他关键信息请勿修改
* 注意Amount的总价total是int类型会自动乘以0.01例如传递100元会自动转换为1元
* @return
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public Result nativePay(WxPayNeedParamVo paramVo) {
try {
// 商户订单号存储当前用户的订单
String outTradeNo = PayKit.generateStr();
String timeExpire = getNowTimeExpire();
UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
.setAppid(WX_PAY_V3_BEAN.getAppId())
.setMchid(WX_PAY_V3_BEAN.getMchId())
// 描述信息
.setDescription(paramVo.getDescription())
.setOut_trade_no(outTradeNo)
.setTime_expire(timeExpire)
.setAttach(paramVo.getAttach())
.setNotify_url(payNotifyUrl)
// 订单金额
.setAmount(paramVo.getAmount());
log.info("二维码支付统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
IJPayHttpResponse response = WxPayApi.v3(
RequestMethodEnum.POST,
WxDomainEnum.CHINA.toString(),
BasePayApiEnum.NATIVE_PAY.toString(),
WX_PAY_V3_BEAN.getMchId(),
getSerialNumber(),
null,
WX_PAY_V3_BEAN.getKeyPath(),
JSONUtil.toJsonStr(unifiedOrderModel),
AuthTypeEnum.RSA.getCode()
);
log.info("统一下单响应 {}", response);
// 根据证书序列号查询对应的证书来验证签名结果
boolean verifySignature = WxPayKit.verifySignature(response, WX_PAY_V3_BEAN.getPlatformCertPath());
log.info("verifySignature: {}", verifySignature);
// 下单返回数据
String result = response.getBody();
JSONObject jsonObject = JSONUtil.parseObj(result);
if (response.getStatus() == OK) {
// 统一下单成功向数据库插入订单记录
insertTradingOrder(paramVo, outTradeNo, result);
return Result.success("请在三分钟内完成支付,超时将自动取消订单").addData(result);
} else {
WxPayResultCode code = WxPayResultCode.valueOf(WxPayResultCode.class, jsonObject.getStr("code"));
return Result.error(code.getMsg());
}
} catch (Exception e) {
log.error("系统异常", e);
return Result.error(e.getMessage());
}
}
@Override
@Aop(TransAop.READ_COMMITTED)
public Result jsApiPay(WxPayNeedParamVo paramVo) {
try {
Sys_user user = dao.fetch(Sys_user.class, SecurityUtil.getUserId());
if (StrUtil.isBlank(user.getOpenId())) {
return Result.error("未获取到当前用户的openid,请重新登录");
}
// 商户订单号存储当前用户的订单
String outTradeNo = PayKit.generateStr();
// 订单关闭时间
String timeExpire = getNowTimeExpire();
UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
.setAppid(WX_PAY_V3_BEAN.getAppId())
.setMchid(WX_PAY_V3_BEAN.getMchId())
.setDescription(paramVo.getDescription())
.setOut_trade_no(outTradeNo)
.setTime_expire(timeExpire)
.setAttach(paramVo.getAttach())
.setNotify_url(payNotifyUrl)
.setAmount(paramVo.getAmount())
.setPayer(new Payer().setOpenid(user.getOpenId()));
log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
IJPayHttpResponse response = WxPayApi.v3(
RequestMethodEnum.POST,
WxDomainEnum.CHINA.toString(),
BasePayApiEnum.JS_API_PAY.toString(),
WX_PAY_V3_BEAN.getMchId(),
getSerialNumber(),
null,
WX_PAY_V3_BEAN.getKeyPath(),
JSONUtil.toJsonStr(unifiedOrderModel)
);
log.info("统一下单响应 {}", response);
// 根据证书序列号查询对应的证书来验证签名结果
boolean verifySignature = WxPayKit.verifySignature(response, WX_PAY_V3_BEAN.getPlatformCertPath());
log.info("verifySignature: {}", verifySignature);
if (response.getStatus() == OK && verifySignature) {
String body = response.getBody();
JSONObject jsonObject = JSONUtil.parseObj(body);
String prepayId = jsonObject.getStr("prepay_id");
Map<String, String> map = WxPayKit.jsApiCreateSign(WX_PAY_V3_BEAN.getAppId(), prepayId, WX_PAY_V3_BEAN.getKeyPath());
log.info("唤起支付参数:{}", map);
// 唤起支付成功向数据库插入订单参数
insertTradingOrder(paramVo, outTradeNo, body);
return Result.success().addData(JSONUtil.toJsonStr(map));
}
// return JSONUtil.toJsonStr(response);
return Result.error("唤起支付失败");
} catch (Exception e) {
log.error("系统异常", e);
return Result.error(e.getMessage());
}
}
@Override
@Aop(TransAop.READ_COMMITTED)
public Result wapPay(WxPayNeedParamVo paramVo) {
try {
// 商户订单号存储当前用户的订单
String outTradeNo = PayKit.generateStr();
// 订单关闭时间
String timeExpire = getNowTimeExpire();
UnifiedOrderModel unifiedOrderModel = new UnifiedOrderModel()
.setAppid(WX_PAY_V3_BEAN.getAppId())
.setMchid(WX_PAY_V3_BEAN.getMchId())
.setDescription(paramVo.getDescription())
.setOut_trade_no(outTradeNo)
.setTime_expire(timeExpire)
.setAttach(paramVo.getAttach())
.setNotify_url(payNotifyUrl)
.setAmount(paramVo.getAmount())
.setScene_info(
new SceneInfo()
.setPayer_client_ip("").
setH5_info(new H5Info()
.setType("Wap")));
log.info("统一下单参数 {}", JSONUtil.toJsonStr(unifiedOrderModel));
IJPayHttpResponse response = WxPayApi.v3(
RequestMethodEnum.POST,
WxDomainEnum.CHINA.toString(),
BasePayApiEnum.H5_PAY.toString(),
WX_PAY_V3_BEAN.getMchId(),
getSerialNumber(),
null,
WX_PAY_V3_BEAN.getKeyPath(),
JSONUtil.toJsonStr(unifiedOrderModel)
);
log.info("统一下单响应 {}", response);
// 根据证书序列号查询对应的证书来验证签名结果
boolean verifySignature = WxPayKit.verifySignature(response, WX_PAY_V3_BEAN.getPlatformCertPath());
log.info("verifySignature: {}", verifySignature);
if (response.getStatus() == OK && verifySignature) {
String body = response.getBody();
insertTradingOrder(paramVo, outTradeNo, body);
return Result.success(JSONUtil.toJsonStr(body));
}
// return JSONUtil.toJsonStr(response);
return Result.error();
} catch (Exception e) {
log.error("系统异常", e);
return Result.error(e.getMessage());
}
}
/**
* 支付回调
* @param request
* @param response
*/
@Override
public void payNotify(HttpServletRequest request, HttpServletResponse response) {
Map<String, String> map = new HashMap<>(12);
try {
String timestamp = request.getHeader("Wechatpay-Timestamp");
String nonce = request.getHeader("Wechatpay-Nonce");
String serialNo = request.getHeader("Wechatpay-Serial");
String signature = request.getHeader("Wechatpay-Signature");
log.info("timestamp:{} nonce:{} serialNo:{} signature:{}", timestamp, nonce, serialNo, signature);
String result = HttpKit.readData(request);
log.info("支付通知密文 {}", result);
// String plainText = null;
// 需要通过证书序列号查找对应的证书verifyNotify 中有验证证书的序列号
String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
WX_PAY_V3_BEAN.getApiKey3(), WX_PAY_V3_BEAN.getPlatformCertPath());
// 微信公钥验证签名并解密
// if (ObjectUtil.equals(serialNo, WX_PAY_V3_BEAN.getPublicKeyId())) {
// plainText = WxPayKit.verifyPublicKeyNotify(result, signature, nonce, timestamp,
// WX_PAY_V3_BEAN.getApiKey3(), WX_PAY_V3_BEAN.getPlatformCertPath());
// }
log.info("支付通知明文 {}", plainText);
if (StrUtil.isNotEmpty(plainText)) {
// 支付结果
JSONObject jsonResult = JSONUtil.parseObj(plainText);
// 获取缴费记录,并修改缴费结果
PaymentTransaction transaction = sysUserService.dao().fetch(PaymentTransaction.class, Cnd.where("outTradeNo", "=", jsonResult.getStr("out_trade_no")));
transaction.setTradingState(TradingStateEnum.PAY_SUCCESS.name());
transaction.setTransactionId(jsonResult.getStr("transaction_id"));
sysUserService.dao().update(transaction);
sysUserService.dao().update(MemberPaymentInfo.class,
Chain.make("isPayment", true).add("paymentTime", DateUtil.date())
.add("paymentMoney", transaction.getTradingAmount()),
Cnd.where("id", "=", transaction.getMemberPaymentInfoId())
);
response.setStatus(200);
map.put("code", "SUCCESS");
map.put("message", "SUCCESS");
} else {
response.setStatus(500);
map.put("code", "ERROR");
map.put("message", "签名错误");
log.error("签名错误");
}
// 支付回调返回给微信自己也接收不到结果这里的返回没用
response.setHeader("Content-type", ContentType.JSON.toString());
response.getOutputStream().write(JSONUtil.toJsonStr(map).getBytes(StandardCharsets.UTF_8));
response.flushBuffer();
} catch (Exception e) {
log.error("系统异常", e);
}
}
/**
* 退款
* @param transactionId 微信订单号
* @param outTradeNo 商户订单号
* @return
*/
@Override
public Result refund(String transactionId, String outTradeNo) {
try {
// 查询商户订单
PaymentTransaction transaction = sysUserService.dao().fetch(PaymentTransaction.class, Cnd.where("outTradeNo", "=", outTradeNo));
Integer tradingAmount = transaction.getTradingAmount();
String outRefundNo = PayKit.generateStr();
log.info("商户退款单号: {}", outRefundNo);
// 没用
// List<RefundGoodsDetail> list = new ArrayList<>();
// RefundGoodsDetail refundGoodsDetail = new RefundGoodsDetail()
// .setMerchant_goods_id("123")
// .setGoods_name("测试")
// .setUnit_price(1)
// .setRefund_amount(1)
// .setRefund_quantity(1);
// list.add(refundGoodsDetail);
RefundModel refundModel = new RefundModel()
.setOut_refund_no(outRefundNo)
.setReason(transaction.getDescription() + "退款")
.setNotify_url(refundNotifyUrl)
.setAmount(new RefundAmount().setRefund(tradingAmount).setTotal(tradingAmount).setCurrency("CNY"));
// .setGoods_detail(list);
if (StrUtil.isNotEmpty(transactionId)) {
refundModel.setTransaction_id(transactionId);
}
if (StrUtil.isNotEmpty(outTradeNo)) {
refundModel.setOut_trade_no(outTradeNo);
}
log.info("退款参数 {}", JSONUtil.toJsonStr(refundModel));
IJPayHttpResponse response = WxPayApi.v3(
RequestMethodEnum.POST,
WxDomainEnum.CHINA.toString(),
BasePayApiEnum.REFUND.toString(),
WX_PAY_V3_BEAN.getMchId(),
getSerialNumber(),
null,
WX_PAY_V3_BEAN.getKeyPath(),
JSONUtil.toJsonStr(refundModel)
);
// 根据证书序列号查询对应的证书来验证签名结果
boolean verifySignature = WxPayKit.verifySignature(response, WX_PAY_V3_BEAN.getPlatformCertPath());
// 微信支付公钥验证签名
// boolean verifySignature = WxPayKit.verifyPublicKeySignature(response, WX_PAY_V3_BEAN.getPlatformCertPath());
log.info("verifySignature: {}", verifySignature);
log.info("退款响应 {}", response);
if (verifySignature) {
// 用户发起退款存一个退款记录
PaymentRefundRecord record = new PaymentRefundRecord();
record.setId(R.UU32());
record.setPaymentTransactionId(transaction.getId());
record.setOutRefundTradeNo(outRefundNo);
record.setRefundNo(null);
record.setRefundState(RefundStateEnum.REFUNDING.name());
record.setRefundAmount(tradingAmount);
record.setTotal(tradingAmount);
record.setResultJson(response.getBody());
dao.insert(record);
dao.update(MemberPaymentInfo.class, Chain.make("isRefund", true)
.add("refundState", RefundStateEnum.REFUNDING.name()),
Cnd.where("id", "=", transaction.getMemberPaymentInfoId()));
// 返回退款下单结果
return Result.success();
}
return Result.error("退款失败");
} catch (Exception e) {
log.error("系统异常", e);
return Result.error(e.getMessage());
}
}
/**
* 退款回调
* @param request
* @param response
*/
@Override
@Aop(TransAop.READ_COMMITTED)
public void refundNotify(HttpServletRequest request, HttpServletResponse response) {
Map<String, String> map = new HashMap<>(12);
try {
String timestamp = request.getHeader("Wechatpay-Timestamp");
String nonce = request.getHeader("Wechatpay-Nonce");
String serialNo = request.getHeader("Wechatpay-Serial");
String signature = request.getHeader("Wechatpay-Signature");
log.info("退款通知 timestamp:{} nonce:{} serialNo:{} signature:{}", timestamp, nonce, serialNo, signature);
String result = HttpKit.readData(request);
log.info("退款通知密文 {}", result);
// String plainText = null;
// 需要通过证书序列号查找对应的证书verifyNotify 中有验证证书的序列号
String plainText = WxPayKit.verifyNotify(serialNo, result, signature, nonce, timestamp,
WX_PAY_V3_BEAN.getApiKey3(), WX_PAY_V3_BEAN.getPlatformCertPath());
// 微信公钥验证签名并解密
// if (ObjectUtil.equals(serialNo, WX_PAY_V3_BEAN.getPublicKeyId())) {
// plainText = WxPayKit.verifyPublicKeyNotify(result, signature, nonce, timestamp,
// WX_PAY_V3_BEAN.getApiKey3(), WX_PAY_V3_BEAN.getPlatformCertPath());
// }
log.info("退款通知明文 {}", plainText);
if (StrUtil.isNotEmpty(plainText)) {
// 取出明文修改退款的结果
JSONObject jsonObject = JSONUtil.parseObj(plainText);
// 查询出退款记录存储关键信息并修改
PaymentRefundRecord record = dao.fetch(PaymentRefundRecord.class, Cnd.where("outRefundTradeNo", "=", jsonObject.getStr("out_refund_no")));
record.setRefundNo(jsonObject.getStr("refund_id"));
record.setRefundState(RefundStateEnum.REFUND_SUCCESS.name());
// 到此是退款成功了还要去修改订单表的数据
PaymentTransaction transaction = dao.fetch(PaymentTransaction.class, record.getPaymentTransactionId());
dao.update(PaymentTransaction.class, Chain.make("isRefund", true)
.add("refundAmount", record.getRefundAmount()),
Cnd.where("id", "=", record.getPaymentTransactionId()));
dao.update(MemberPaymentInfo.class, Chain.make("isPayment", null).add("paymentMoney", null)
.add("refundState", RefundStateEnum.REFUND_SUCCESS.name()),
Cnd.where("id", "=", transaction.getMemberPaymentInfoId()));
dao.update(record);
response.setStatus(200);
map.put("code", "SUCCESS");
map.put("message", "SUCCESS");
} else {
response.setStatus(500);
map.put("code", "ERROR");
map.put("message", "签名错误");
}
// 没用
response.setHeader("Content-type", ContentType.JSON.toString());
response.getOutputStream().write(JSONUtil.toJsonStr(map).getBytes(StandardCharsets.UTF_8));
response.flushBuffer();
} catch (Exception e) {
log.error("系统异常", e);
}
}
/**
* 公共方法获取证书序列号
* @return
*/
private String getSerialNumber() {
if (StrUtil.isEmpty(serialNo)) {
// 获取证书序列号
X509Certificate certificate = PayKit.getCertificate(WX_PAY_V3_BEAN.getCertPath());
if (null != certificate) {
serialNo = certificate.getSerialNumber().toString(16).toUpperCase();
// 提前两天检查证书是否有效
boolean isValid = PayKit.checkCertificateIsValid(certificate, WX_PAY_V3_BEAN.getMchId(), -2);
log.info("证书是否可用 {} 证书有效期为 {}", isValid, DateUtil.format(certificate.getNotAfter(), DatePattern.NORM_DATETIME_PATTERN));
}
// System.out.println("输出证书信息:\n" + certificate.toString());
// // 输出关键信息截取部分并进行标记
// System.out.println("证书序列号:" + certificate.getSerialNumber().toString(16));
// System.out.println("版本号:" + certificate.getVersion());
// System.out.println("签发者:" + certificate.getIssuerDN());
// System.out.println("有效起始日期:" + certificate.getNotBefore());
// System.out.println("有效终止日期:" + certificate.getNotAfter());
// System.out.println("主体名:" + certificate.getSubjectDN());
// System.out.println("签名算法:" + certificate.getSigAlgName());
// System.out.println("签名:" + certificate.getSignature().toString());
}
System.out.println("serialNo:" + serialNo);
return serialNo;
}
/**
* 公共方法获取平台证书序列号
* @return
*/
private String getPlatSerialNumber() {
if (StrUtil.isEmpty(platSerialNo)) {
// 获取平台证书序列号
X509Certificate certificate = PayKit.getCertificate(FileUtil.getInputStream(WX_PAY_V3_BEAN.getPlatformCertPath()));
platSerialNo = certificate.getSerialNumber().toString(16).toUpperCase();
}
System.out.println("platSerialNo:" + platSerialNo);
return platSerialNo;
}
/**
* 公共方法保存平台证书
* @param associatedData
* @param nonce
* @param cipherText
* @param algorithm
* @param certPath
* @return
*/
private String savePlatformCert(String associatedData, String nonce, String cipherText, String algorithm, String certPath) {
try {
String key3 = WX_PAY_V3_BEAN.getApiKey3();
String publicKey;
if (StrUtil.equals(algorithm, AuthTypeEnum.SM2.getPlatformCertAlgorithm())) {
publicKey = PayKit.sm4DecryptToString(key3, cipherText, nonce, associatedData);
} else {
AesUtil aesUtil = new AesUtil(WX_PAY_V3_BEAN.getApiKey3().getBytes(StandardCharsets.UTF_8));
// 平台证书密文解密
// encrypt_certificate 中的 associated_data nonce ciphertext
publicKey = aesUtil.decryptToString(
associatedData.getBytes(StandardCharsets.UTF_8),
nonce.getBytes(StandardCharsets.UTF_8),
cipherText
);
}
if (StrUtil.isNotEmpty(publicKey)) {
// 保存证书
FileWriter writer = new FileWriter(certPath);
writer.write(publicKey);
// 获取平台证书序列号
X509Certificate certificate = PayKit.getCertificate(new ByteArrayInputStream(publicKey.getBytes()));
return certificate.getSerialNumber().toString(16).toUpperCase();
}
return "";
} catch (Exception e) {
log.error("保存平台证书异常", e);
return e.getMessage();
}
}
/**
* 公共方法构建订单关闭时间默认3分钟
* @return
*/
private String getNowTimeExpire() {
long currentTimeMillis = System.currentTimeMillis() + 1000 * 60 * 3;
// 将时间戳转换为 DateTime 对象
DateTime dateTime = DateUtil.date(currentTimeMillis);
return DateUtil.format(dateTime, "yyyy-MM-dd'T'HH:mm:ssXXX");
}
/**
* 公共方法插入交易订单
* @param paramVo 交易必填参数Vo
* @param outTradeNo 商户交易号
* @param result 下单返回结构
*/
private void insertTradingOrder(WxPayNeedParamVo paramVo, String outTradeNo, String result){
View_user user = sysUserService.dao().fetch(View_user.class, Cnd.where("id", "=", SecurityUtil.getUserId()));
PaymentTransaction transaction = new PaymentTransaction();
transaction.setId(R.UU32());
transaction.setMchId(WX_PAY_V3_BEAN.getMchId());
transaction.setOutTradeNo(outTradeNo);
transaction.setTransactionId(null);
transaction.setTradingChannel(TradingChannelEnum.WX_PAY.name());
transaction.setTradingType(TradingTypeEnum.PAYMENT.name());
transaction.setUserId(user.getId());
transaction.setLoginName(user.getLoginname());
transaction.setUserName(user.getUsername());
transaction.setUnitId(user.getUnitId());
transaction.setUnitName(user.getUnitName());
transaction.setUnionId(user.getUnionId());
transaction.setUnionName(user.getUnionName());
transaction.setTradingState(TradingStateEnum.WAITING_FOR_PAYMENT.name());
// 获取订单金额
transaction.setTradingAmount(paramVo.getAmount().getTotal());
transaction.setIsRefund(false);
transaction.setRefundAmount(null);
transaction.setDescription(paramVo.getDescription());
transaction.setAttach(paramVo.getAttach());
transaction.setOpenId(null);
transaction.setResultJson(result);
transaction.setMemberPaymentInfoId(paramVo.getMemberPaymentInfoId());
sysUserService.dao().insert(transaction);
}
}
@@ -0,0 +1,132 @@
package com.budwk.app.base.payment.wxpay.util;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import com.budwk.app.base.constant.RedisConstant;
import lombok.extern.slf4j.Slf4j;
import org.nutz.http.Http;
import org.nutz.integration.jedis.RedisService;
import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import org.nutz.lang.util.NutMap;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
import java.net.URLEncoder;
import java.util.Base64;
/**
* @version 1.0
* @Author zzr
* @nameWeChatUtils
* @Date 2025/3/10 14:13
* @注释
*/
@Slf4j
@IocBean
public class WeChatUtils {
private static final String ALGORITHM = "AES";
private static final String KEY = "4eXvXq1ZJmZj8z5z6yXvXq1ZJmZj8z5z";
@Inject
private RedisService redisService;
public static final String APPID = "wxf12fa6175ec7c75f";
public static final String SECRET = "f65bbb41d3de4a93c8c93d8e2fd50369";
// 获取code
public final static String CODE_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
//获取网页access_token的接口地址
public final static String WEB_ACCESS_TOKEN_URL = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=APPSECRET&code=CODE&grant_type=authorization_code";
//获取用户信息地址
public final static String USERINFO_URL = "https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";
// 获取access_token的接口地址GET 限2000/
public final static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";
// 发送模板消息
public static final String SEND_MESSAGE_URL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=ACCESS_TOKEN";
/**
* 生成获取code的url
*
* @param redirectUrl
* @return
*/
public String getCodeUrl(String redirectUrl, String state) {
String requestUrl = null;
state = state == null ? "" : state;
try {
requestUrl = CODE_URL.replace("APPID", APPID).replace("REDIRECT_URI", URLEncoder.encode(redirectUrl, "UTF-8")).replace("STATE", state);
} catch (Exception e) {
e.printStackTrace();
}
return requestUrl;
}
/**
* 获取微信网页access_token openid
*
* @param code
* @return
*/
public JSONObject getWebAccessTokenAndOpenid(String code) {
String requestUrl = WEB_ACCESS_TOKEN_URL.replace("APPID", APPID).replace("APPSECRET", SECRET).replace("CODE", code);
return JSONUtil.parseObj(HttpUtil.post(requestUrl, new JSONObject()));
}
/**
* 网页授权作用域为snsapi_userinfo则此时开发者可以通过access_token和openid拉取用户信息了
* <a href="https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/Wechat_webpage_authorization.html">...</a>
*
* @param webAccessToken
* @param openid
* @return
*/
public JSONObject getUserInfo(String webAccessToken, String openid) {
String requestUrl = USERINFO_URL.replace("ACCESS_TOKEN", webAccessToken).replace("OPENID", openid);
return JSONUtil.parseObj(HttpUtil.post(requestUrl, new JSONObject()));
}
/**
* 获取access_token 先从Redis获取如果没有再调微信获取并存Redis
*
* @return
*/
public String getAccessToken() {
String token = redisService.get(RedisConstant.REDIS_KEY_WX_TOKEN);
if (StrUtil.isNotBlank(token)) {
return token;
}
String accessTokenUrl = ACCESS_TOKEN_URL.formatted(APPID, SECRET);
String accessToken = Json.fromJson(NutMap.class, Http.get(accessTokenUrl).getContent()).getString("access_token");
redisService.setex(RedisConstant.REDIS_KEY_WX_TOKEN, 60 * 60 * 2, accessToken);
return accessToken;
}
public String encrypt(String data) throws Exception {
SecretKeySpec keySpec = new SecretKeySpec(KEY.getBytes(), ALGORITHM);
Cipher cipher = Cipher.getInstance(ALGORITHM);
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
byte[] encryptedBytes = cipher.doFinal(data.getBytes());
return Base64.getEncoder().encodeToString(encryptedBytes);
}
public String decrypt(String encryptedData) throws Exception {
SecretKeySpec keySpec = new SecretKeySpec(KEY.getBytes(), ALGORITHM);
Cipher cipher = Cipher.getInstance(ALGORITHM);
cipher.init(Cipher.DECRYPT_MODE, keySpec);
byte[] decryptedBytes = cipher.doFinal(Base64.getDecoder().decode(encryptedData));
return new String(decryptedBytes);
}
}
@@ -0,0 +1,37 @@
package com.budwk.app.base.payment.wxpay.vo;
import com.ijpay.wxpay.model.v3.Amount;
import com.ijpay.wxpay.model.v3.Payer;
import lombok.Data;
/**
* @version 1.0
* @Author zzr
* @nameWxPayNeedParamVo
* @Date 2025/3/7 18:43
* @注释
*/
@Data
public class WxPayNeedParamVo {
/**
* 订单描述会显示在支付界面的标题最大长度127必填
*/
private String description;
/**
* 附加数据订单的详细描述信息不必填
*/
private String attach;
/**
* 金额对象,对象中的 total 是金额必填
* 其余参数可不传递也可不填
*/
private Amount amount;
/**
* 会员支付信息ID必填
*/
private String memberPaymentInfoId;
}
@@ -0,0 +1,10 @@
package com.budwk.app.base.result;
/**
* @author wizzer@qq.com
*/
public interface IResultCode {
int getCode();
String getMsg();
}
@@ -0,0 +1,117 @@
package com.budwk.app.base.result;
import org.nutz.json.Json;
import org.nutz.json.JsonFormat;
import org.nutz.lang.Strings;
import org.nutz.mvc.Mvcs;
import java.io.Serializable;
/**
* Created by wizzer on 2016/12/21.
*/
public class Result implements Serializable {
private static final long serialVersionUID = 1L;
private int code;
private String msg;
private Object data;
private long time;
public Result() {
this.time = System.currentTimeMillis();
}
public static Result NEW() {
return new Result();
}
public Result addCode(int code) {
this.code = code;
return this;
}
public Result addMsg(String msg) {
if (Strings.isBlank(msg) || Mvcs.getActionContext() == null || Mvcs.getActionContext().getRequest() == null || Mvcs.getMessage(Mvcs.getActionContext().getRequest(), msg) == null) {
this.msg = Strings.sNull(msg);
} else {
this.msg = Mvcs.getMessage(Mvcs.getActionContext().getRequest(), msg);
}
return this;
}
public Result addData(Object data) {
this.data = data;
return this;
}
public Result(int code, String msg, Object data) {
this.code = code;
if (Strings.isBlank(msg) || Mvcs.getActionContext() == null || Mvcs.getActionContext().getRequest() == null || Mvcs.getMessage(Mvcs.getActionContext().getRequest(), msg) == null) {
this.msg = Strings.sNull(msg);
} else {
this.msg = Mvcs.getMessage(Mvcs.getActionContext().getRequest(), msg);
}
this.data = data;
this.time = System.currentTimeMillis();
}
public static Result success(String content) {
return new Result(0, content, null);
}
public static Result success(String content, Object data) {
return new Result(0, content, data);
}
public static Result success(Object data) {
return new Result(0, "system.success", data);
}
public boolean isSuccess() {
return this.code == ResultCode.SUCCESS.code;
}
public static Result error(IResultCode resultCode) {
return new Result(resultCode.getCode(), resultCode.getMsg(), null);
}
public static Result error(int code, String content) {
return new Result(code, content, null);
}
public static Result error(String content) {
return new Result(1, content, null);
}
public static Result success() {
return new Result(0, "system.success", null);
}
public static Result error() {
return new Result(1, "system.error", null);
}
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
public Object getData() {
return data;
}
public static Result condition(boolean flag) {
return flag ? success("system.error") : error("system.error");
}
public String toJsonString() {
return Json.toJson(this, JsonFormat.compact());
}
}
@@ -0,0 +1,42 @@
package com.budwk.app.base.result;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* @author wizzer@qq.com
*/
@Getter
@AllArgsConstructor
public enum ResultCode implements IResultCode {
SUCCESS(0, "操作成功"),
FAILURE(200400, "业务异常"),
NOT_FOUND(200404, "服务未找到"),
TOO_MANY_REQUESTS(200429, "请求次数过多"),
SERVER_ERROR(200500, "服务异常"),
IOC_ERROR(500000, "IOC对象加载异常"),
NULL_DATA_ERROR(500100, "数据不存在"),
HAVE_DATA_ERROR(500110, "数据已存在"),
PARAM_ERROR(500200, "参数错误"),
XSS_SQL_ERROR(500300, "传参被拦截"),
BLACKLIST_ERROR(500400, "IP黑名单"),
DAO_ERROR(500600, "DAO数据库查询错误"),
DEMO_ERROR(500700, "演示环境,限制操作"),
PARAM_VALID_ERROR(500800, "请求参数校验异常"),
USER_NOT_LOGIN(600098, "用户未登录"),
USER_NOT_ROLE(600099, "无此角色"),
USER_NOT_PERMISSION(600100, "无此权限"),
USER_NOT_FOUND(600101, "用户不存在"),
USER_DISABLED(600102, "用户被禁用"),
USER_LOCKED(600103, "用户已锁定"),
USER_NAME_ERROR(600104, "用户名错误"),
USER_PWD_ERROR(600105, "用户密码错误"),
USER_PWD_EXPIRED(600106, "用户密码过期"),
USER_VERIFY_ERROR(600107, "验证码错误"),
USER_LOGIN_FAIL(600108, "用户登录失败");
final int code;
final String msg;
}
@@ -0,0 +1,960 @@
package com.budwk.app.base.service;
import com.budwk.app.base.page.Pagination;
import com.budwk.app.base.page.datatable.DataTableColumn;
import com.budwk.app.base.page.datatable.DataTableOrder;
import com.budwk.app.base.param.PageForm;
import org.nutz.dao.*;
import org.nutz.dao.entity.Entity;
import org.nutz.dao.entity.Record;
import org.nutz.dao.pager.Pager;
import org.nutz.dao.sql.Sql;
import org.nutz.lang.util.NutMap;
import java.util.List;
import java.util.Map;
/**
* Created by wizzer on 2016/12/22.
*/
public interface BaseService<T> {
Dao dao();
/**
* 获取实体的Entity
*
* @return 实体的Entity
*/
Entity<T> getEntity();
/**
* 获取实体类型
*
* @return 实体类型
*/
Class<T> getEntityClass();
/**
* 统计符合条件的对象表条数
*
* @param cnd
* @return
*/
int count(Condition cnd);
/**
* 统计对象表条数
*
* @return
*/
int count();
/**
* 统计符合条件的记录条数
*
* @param tableName
* @param cnd
* @return
*/
int count(String tableName, Condition cnd);
/**
* 统计表记录条数
*
* @param tableName
* @return
*/
int count(String tableName);
/**
* 自定义SQL统计
*
* @param sql
* @return
*/
int count(Sql sql);
/**
* 通过数字型主键查询对象
*
* @param id
* @return
*/
T fetch(long id);
/**
* 自定义SQL查询VO对象
*
* @param sql
* @param clazz
* @param <C>
* @return 味大无需多盐
*/
<C> C fetchVO(Sql sql, Class<C> clazz);
/**
* 通过字符型主键查询对象
*
* @param id
* @return
*/
T fetch(String id);
/**
* 查询关联表
*
* @param obj 数据对象,可以是普通对象或集合,但不是类
* @param regex 为null查询全部,支持通配符 ^(a|b)$
* @return
*/
<T> T fetchLinks(T obj, String regex);
/**
* 查询关联表
*
* @param obj 数据对象,可以是普通对象或集合,但不是类
* @param regex 为null查询全部,支持通配符 ^(a|b)$
* @param cnd 关联字段的过滤(排序,条件语句,分页等)
* @return
*/
<T> T fetchLinks(T obj, String regex, Condition cnd);
/**
* 查出符合条件的第一条记录
*
* @param cnd 查询条件
* @return 实体, 如不存在则为null
*/
T fetch(Condition cnd);
/**
* 复合主键专用
*
* @param pks 键值
* @return 对象 T
*/
T fetchx(Object... pks);
/**
* 复合主键专用
*
* @param pks 键值
* @return 对象 T
*/
boolean exists(Object... pks);
/**
* 将一个对象插入到一个数据库
*
* @param obj 要被插入的对象
* 它可以是
* 普通 POJO
* 集合
* 数组
* Map
* 注意如果是集合数组或者 Map所有的对象必须类型相同否则可能会出错
* @return 插入后的对象
*/
<T> T insert(T obj);
/**
* 将一个对象按FieldFilter过滤后,插入到一个数据源
* <p>
* <code>dao.insert(pet, FieldFilter.create(Pet.class, FieldMatcher.create(false)));</code>
*
* @param obj 要被插入的对象
* @param filter 字段过滤器, 其中FieldMatcher.isIgnoreId生效
* @return 插入后的对象
* @see Dao#insert(Object)
*/
<T> T insert(T obj, FieldFilter filter);
/**
* 根据对象的主键(@Id/@Name/@Pk)先查询, 如果存在就更新, 不存在就插入
*
* @param obj 对象
* @return 原对象
*/
<T> T insertOrUpdate(T obj);
/**
* 根据对象的主键(@Id/@Name/@Pk)先查询, 如果存在就更新, 不存在就插入
*
* @param obj 对象
* @param insertFieldFilter 插入时的字段过滤, 可以是null
* @param updateFieldFilter 更新时的字段过滤,可以是null
* @return 原对象
*/
<T> T insertOrUpdate(T obj, FieldFilter insertFieldFilter, FieldFilter updateFieldFilter);
/**
* 自由的向一个数据表插入一条数据
*
* @param tableName 表名
* @param chain 数据名值链
*/
void insert(String tableName, Chain chain);
/**
* 快速插入一个对象,对象的 '@Prev' 以及 '@Next' 在这个函数里不起作用
*
* @param obj
* @return
*/
<T> T fastInsert(T obj);
/**
* 将对象插入数据库同时也将符合一个正则表达式的所有关联字段关联的对象统统插入相应的数据库
* <p>
* 关于关联字段更多信息请参看 '@One' | '@Many' | '@ManyMany' 更多的描述
*
* @param obj 数据对象
* @param regex 正则表达式描述了什么样的关联字段将被关注如果为 null则表示全部的关联字段都会被插入
* @return 数据对象本身
* @see org.nutz.dao.entity.annotation.One
* @see org.nutz.dao.entity.annotation.Many
* @see org.nutz.dao.entity.annotation.ManyMany
*/
<T> T insertWith(T obj, String regex);
/**
* 根据一个正则表达式仅将对象所有的关联字段插入到数据库中并不包括对象本身
*
* @param obj 数据对象
* @param regex 正则表达式描述了什么样的关联字段将被关注如果为 null则表示全部的关联字段都会被插入
* @return 数据对象本身
* @see org.nutz.dao.entity.annotation.One
* @see org.nutz.dao.entity.annotation.Many
* @see org.nutz.dao.entity.annotation.ManyMany
*/
<T> T insertLinks(T obj, String regex);
/**
* 将对象的一个或者多个多对多的关联信息插入数据表
*
* @param obj 对象
* @param regex 正则表达式描述了那种多对多关联字段将被执行该操作
* @return 对象自身
* @see org.nutz.dao.entity.annotation.ManyMany
*/
<T> T insertRelation(T obj, String regex);
/**
* 更新数据
*
* @param obj
* @return
*/
int update(Object obj);
/**
* 更新数据忽略值为null的字段
*
* @param obj
* @return
*/
int updateIgnoreNull(Object obj);
/**
* 部分更新实体表
*
* @param chain
* @param cnd
* @return
*/
int update(Chain chain, Condition cnd);
/**
* 部分更新表
*
* @param tableName
* @param chain
* @param cnd
* @return
*/
int update(String tableName, Chain chain, Condition cnd);
/**
* 将对象更新的同时也将符合一个正则表达式的所有关联字段关联的对象统统更新
* <p>
* 关于关联字段更多信息请参看 '@One' | '@Many' | '@ManyMany' 更多的描述
*
* @param obj 数据对象
* @param regex 正则表达式描述了什么样的关联字段将被关注如果为 null则表示全部的关联字段都会被更新
* @return 数据对象本身
* @see org.nutz.dao.entity.annotation.One
* @see org.nutz.dao.entity.annotation.Many
* @see org.nutz.dao.entity.annotation.ManyMany
*/
<T> T updateWith(T obj, String regex);
/**
* 根据一个正则表达式仅更新对象所有的关联字段并不包括对象本身
*
* @param obj 数据对象
* @param regex 正则表达式描述了什么样的关联字段将被关注如果为 null则表示全部的关联字段都会被更新
* @return 数据对象本身
* @see org.nutz.dao.entity.annotation.One
* @see org.nutz.dao.entity.annotation.Many
* @see org.nutz.dao.entity.annotation.ManyMany
*/
<T> T updateLinks(T obj, String regex);
/**
* 多对多关联是通过一个中间表将两条数据表记录关联起来
* <p>
* 而这个中间表可能还有其他的字段比如描述关联的权重等
* <p>
* 这个操作可以让你一次更新某一个对象中多个多对多关联的数据
*
* @param classOfT 对象类型
* @param regex 正则表达式描述了那种多对多关联字段将被执行该操作
* @param chain 针对中间关联表的名值链
* @param cnd 针对中间关联表的 WHERE 条件
* @return 共有多少条数据被更新
* @see org.nutz.dao.entity.annotation.ManyMany
*/
int updateRelation(Class<?> classOfT, String regex, Chain chain, Condition cnd);
/**
* 基于版本的更新版本不一样无法更新到数据
*
* @param obj 需要更新的对象, 必须有version属性
* @return 若更新成功, 大于0, 否则小于0
*/
int updateWithVersion(Object obj);
/**
* 基于版本的更新版本不一样无法更新到数据
*
* @param obj 需要更新的对象, 必须有version属性
* @param filter 需要过滤的字段设置
* @return 若更新成功, 大于0, 否则小于0
*/
int updateWithVersion(Object obj, FieldFilter filter);
/**
* 乐观锁, 以特定字段的值作为限制条件,更新对象,并自增该字段.
* <p>
* 执行的sql如下:
* <p>
* <code>update t_user set age=30, city="广州", version=version+1 where name="wendal" and version=124;</code>
*
* @param obj 需要更新的对象, 必须带@Id/@Name/@Pk中的其中一种.
* @param fieldFilter 需要过滤的属性. 若设置了哪些字段不更新,那务必确保过滤掉fieldName的字段
* @param fieldName 参考字段的Java属性名.默认是"version",可以是任意数值字段
* @return 若更新成功, 返回值大于0, 否则小于等于0
*/
int updateAndIncrIfMatch(Object obj, FieldFilter fieldFilter, String fieldName);
/**
* 获取某个对象,最大的 ID ,这个对象必须声明了 '@Id'
*
* @return
*/
int getMaxId();
/**
* 通过long主键删除数据
*
* @param id
* @return
*/
int delete(long id);
/**
* 通过int主键删除数据
*
* @param id
* @return
*/
int delete(int id);
/**
* 通过string主键删除数据
*
* @param id
* @return
*/
int delete(String id);
/**
* 批量删除
*
* @param ids
*/
void delete(Integer[] ids);
/**
* 批量删除
*
* @param ids
*/
void delete(Long[] ids);
/**
* 批量删除
*
* @param ids
*/
void delete(String[] ids);
/**
* 批量删除
*
* @param ids
*/
void delete(List<String> ids);
/**
* 清空表
*
* @return
*/
int clear();
/**
* 清空表
*
* @return
*/
int clear(String tableName);
/**
* 按条件清除一组数据
*
* @return
*/
int clear(Condition cnd);
/**
* 按条件清除一组数据
*
* @return
*/
int clear(String tableName, Condition cnd);
/**
* 伪删除
*
* @param id
* @return
*/
int vDelete(String id);
/**
* 批量伪删除
*
* @param ids
* @return
*/
int vDelete(String[] ids);
/**
* 批量伪删除
*
* @param ids
* @return
*/
int vDelete(List<String> ids);
/**
* 根据条件进行伪删除
*
* @param cnd
* @return
*/
int vDelete(Condition cnd);
/**
* 根据条件进行伪删除
*
* @param cnd
* @return
*/
int vDelete(String tableName, Condition cnd);
/**
* 通过LONG主键获取部分字段值
*
* @param fieldName
* @param id
* @return
*/
T getField(String fieldName, long id);
/**
* 通过INT主键获取部分字段值
*
* @param fieldName
* @param id
* @return
*/
T getField(String fieldName, int id);
/**
* 通过NAME主键获取部分字段值
*
* @param fieldName 支持通配符 ^(a|b)$
* @param name
* @return
*/
T getField(String fieldName, String name);
/**
* 通过条件获取部分字段值
*
* @param fieldName 支持通配符 ^(a|b)$
* @param cnd
* @return
*/
T getField(String fieldName, Condition cnd);
/**
* 查询获取部分字段
*
* @param fieldName 支持通配符 ^(a|b)$
* @param cnd
* @return
*/
List<T> query(String fieldName, Condition cnd);
/**
* 查询一组对象你可以为这次查询设定条件
*
* @param cnd WHERE 条件如果为 null将获取全部数据顺序为数据库原生顺序<br>
* 只有在调用这个函数的时候 cnd.limit 才会生效
* @return 对象列表
*/
List<T> query(Condition cnd);
/**
* 获取全部数据
*
* @return
*/
List<T> query();
/**
* @param cnd 查询条件
* @param linkName 关联字段支持正则 ^(a|b)$
* @return
*/
List<T> query(Condition cnd, String linkName);
/**
* 获取表及关联表全部数据(支持子查询)
*
* @param cnd 查询条件
* @param linkName 关联字段支持正则 ^(a|b)$
* @param linkCnd 关联条件
* @return
*/
List<T> query(Condition cnd, String linkName, Condition linkCnd);
/**
* 获取表及关联表全部数据
*
* @param linkName 关联字段支持正则 ^(a|b)$
* @return
*/
List<T> query(String linkName);
/**
* 分页关联字段查询
*
* @param cnd 查询条件
* @param linkName 关联字段支持正则 ^(a|b)$
* @param pager 分页对象
* @return
*/
List<T> query(Condition cnd, String linkName, Pager pager);
/**
* 分页关联字段查询(支持关联条件)
*
* @param cnd 查询条件
* @param linkName 关联字段支持正则 ^(a|b)$
* @param linkCnd 关联条件
* @param pager 分页对象
* @return
*/
List<T> query(Condition cnd, String linkName, Condition linkCnd, Pager pager);
/**
* 分页查询
*
* @param cnd 查询条件
* @param pager 分页对象
* @return
*/
List<T> query(Condition cnd, Pager pager);
/**
* 查询获取NutMap对象
*
* @param keyColumnName 作为key的字段名
* @param valueColumnName 作为value的字段名
* @param cnd 查询条件
* @return
*/
NutMap query(String keyColumnName, String valueColumnName, Condition cnd);
/**
* 查询获取NutMap对象
*
* @param tableName 表名
* @param keyColumnName 作为key的字段名
* @param valueColumnName 作为value的字段名
* @param cnd 查询条件
* @return
*/
NutMap query(String tableName, String keyColumnName, String valueColumnName, Condition cnd);
/**
* 计算子节点TREEID
*
* @param tableName
* @param colName
* @param value
* @return
*/
String getSubPath(String tableName, String colName, String value);
/**
* 获取TREEID父级
*
* @param path
* @return
*/
String getParentPath(String path);
/**
* 执行一条自定义SQL
*
* @param sql
* @return
*/
Sql execute(Sql sql);
/**
* 自定义SQL返回Record记录集Record是个MAP但不区分大小写
* 别返回Map对象因为MySql和Oracle中字段名有大小写之分
*
* @param sql
* @return
*/
List<Record> list(Sql sql);
/**
* 自定义SQL返回NutMap记录集区分大小写
*
* @param sql
* @return
*/
List<NutMap> listMap(Sql sql);
/**
* 自定义sql 返回自定义类型
*
* @param sql
* @return
*/
<C> List<C> listVO(Sql sql, Class<C> clazz);
/**
* 自定义分页sql 返回自定义类型
*
* @param sql
* @return
*/
<C> Pagination<C> listPageVO(PageForm pageForm, Sql sql, Class<C> clazz);
/**
* 自定义查询,并返回当前实体类对象
*
* @param sql
* @return
*/
List<T> listEntity(Sql sql);
/**
* 自定义sql获取map key-value
*
* @param sql
* @return
*/
Map getMap(Sql sql);
/**
* 自定义sql获取NutMap key-value
*
* @param sql
* @return
*/
NutMap getNutMap(Sql sql);
/**
* 分页查询
*
* @param pageNumber
* @param cnd
* @return
*/
Pagination listPage(Integer pageNumber, Condition cnd);
/**
* 分页查询
*
* @param pageNumber
* @param sql
* @return
*/
Pagination listPage(Integer pageNumber, Sql sql);
/**
* 分页查询(sql)
*
* @param pageNumber
* @param pageSize
* @param sql
* @return
*/
Pagination listPage(Integer pageNumber, int pageSize, Sql sql);
/**
* 分页查询
*
* @param pageNumber
* @param sql 查询语句
* @param countSql 统计语句
* @return
*/
Pagination listPage(Integer pageNumber, Sql sql, Sql countSql);
/**
* 分页查询
*
* @param pageNumber
* @param pageSize
* @param sql 查询语句
* @param countSql 统计语句
* @return
*/
Pagination listPage(Integer pageNumber, int pageSize, Sql sql, Sql countSql);
/**
* 分页查询
*
* @param pageNumber
* @param sql
* @return
*/
Pagination listPageMap(Integer pageNumber, Sql sql);
/**
* 分页查询(sql)
*
* @param pageNumber
* @param pageSize
* @param sql
* @return
*/
Pagination listPageMap(Integer pageNumber, int pageSize, Sql sql);
/**
* 分页查询
*
* @param pageNumber
* @param sql 查询语句
* @param countSql 统计语句
* @return
*/
Pagination listPageMap(Integer pageNumber, Sql sql, Sql countSql);
/**
* 分页查询
*
* @param pageNumber
* @param pageSize
* @param sql 查询语句
* @param countSql 统计语句
* @return
*/
Pagination listPageMap(Integer pageNumber, int pageSize, Sql sql, Sql countSql);
/**
* 分页查询
*
* @param pageNumber
* @param tableName
* @param cnd
* @return
*/
Pagination listPage(Integer pageNumber, String tableName, Condition cnd);
/**
* 分页查询(cnd)
*
* @param pageNumber
* @param pageSize
* @param cnd
* @return
*/
Pagination listPage(Integer pageNumber, int pageSize, Condition cnd);
/**
* 分页 只要你的class是实体类 就是标注了@Table 就可以不写service 直接用这个
*
* @param pageNumber
* @param pageSize
* @param clazz
* @param cnd
* @param <C>
* @return
*/
<C> Pagination<C> listPage(Integer pageNumber, int pageSize, Class<C> clazz, Condition cnd);
/**
* 分页查询,获取部分字段(cnd)
*
* @param pageNumber
* @param pageSize
* @param cnd
* @param fieldName 支持通配符 ^(a|b)$
* @return
*/
Pagination listPage(Integer pageNumber, int pageSize, Condition cnd, String fieldName);
/**
* 关联查询
*
* @param pageNumber
* @param pageSize
* @param cnd
* @param linkName 支持通配符 ^(a|b)$
* @return
*/
Pagination listPageLinks(Integer pageNumber, int pageSize, Condition cnd, String linkName);
/**
* 关联查询,带子查询条件
*
* @param pageNumber
* @param pageSize
* @param cnd
* @param linkName 支持通配符 ^(a|b)$
* @param subCnd 子查询条件
* @return
*/
Pagination listPageLinks(Integer pageNumber, int pageSize, Condition cnd, String linkName, Condition subCnd);
/**
* 分页查询(tabelName)
*
* @param pageNumber
* @param pageSize
* @param tableName
* @param cnd
* @return
*/
Pagination listPage(Integer pageNumber, int pageSize, String tableName, Condition cnd);
/**
* 分页查询并返回包含实体类内容的NutMap对象
*
* @param pageNumber
* @param cnd
* @return
*/
Pagination listPageMap(Integer pageNumber, Condition cnd);
/**
* 分页查询并返回包含实体类内容的NutMap对象
*
* @param pageNumber
* @param pageSize
* @param cnd
* @return
*/
Pagination listPageMap(Integer pageNumber, int pageSize, Condition cnd);
/**
* DataTable Page
*
* @param length 页大小
* @param start start
* @param draw draw
* @param orders 排序
* @param columns 字段
* @param cnd 查询条件
* @param linkName 关联查询 支持通配符 ^(a|b)$
* @return
*/
NutMap data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, Cnd cnd, String linkName);
/**
* DataTable Page
*
* @param length 页大小
* @param start start
* @param draw draw
* @param orders 排序
* @param columns 字段
* @param cnd 查询条件
* @param linkName 关联查询 支持通配符 ^(a|b)$
* @param subCnd 关联查询条件
* @return
*/
NutMap data(int length, int start, int draw, List<DataTableOrder> orders, List<DataTableColumn> columns, Cnd cnd, String linkName, Cnd subCnd);
/**
* DataTable Page 自定义SQL
*
* @param length 页大小
* @param start start
* @param draw draw
* @param countSql 统计查询语句
* @param orderSql 结果查询语句
* @return
*/
NutMap data(int length, int start, int draw, Sql countSql, Sql orderSql);
/**
* DataTable Page 自定义SQL
*
* @param length 页大小
* @param start start
* @param draw draw
* @param countSql 统计查询语句
* @param orderSql 结果查询语句
* @param countOnly 统计查询语句是否只有count()
* @return
*/
NutMap data(int length, int start, int draw, Sql countSql, Sql orderSql, boolean countOnly);
/**
* DataTable Page
*
* @param length 页大小
* @param start start
* @param draw draw
* @param cnd 查询条件
* @param linkName 关联查询 支持通配符 ^(a|b)$
* @return
*/
NutMap data(int length, int start, int draw, Cnd cnd, String linkName);
/**
* 获取Map
* @param sql
* @return
*/
NutMap fetchMap(Sql sql);
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,39 @@
package com.budwk.app.base.sms;
import java.util.List;
public interface SmsService {
/**
* 单发
* @param loginName 工号
* @param content 内容
*/
void send(String loginName, String content);
/**
* 单发
* @param loginName 工号
* @param title 标题
* @param content 内容
*/
void send(String loginName, String title, String content);
/**
* 单发
* @param loginName 工号
* @param title 标题
* @param content 内容
* @param link 链接
*/
void send(String loginName, String title, String content, String link);
/**
* 群发 多人接收内容相同时使用该方法
* @param loginNames 工号
* @param title 标题
* @param content 内容
* @param link 链接
*/
void massSend(List<String> loginNames, String title, String content, String link);
}
@@ -0,0 +1,85 @@
package com.budwk.app.base.sms.impl.njupt;
import cn.hutool.core.util.ArrayUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.budwk.app.base.sms.SmsService;
import com.budwk.app.base.sms.impl.njupt.ucp.serv.MessageSender;
import com.budwk.app.base.sms.impl.njupt.ucp.serv.client.*;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.util.TokenBuilder;
import com.budwk.app.web.commons.base.Globals;
import lombok.extern.slf4j.Slf4j;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.json.Json;
import java.util.ArrayList;
import java.util.List;
/**
* 南邮短信实现
* channeIds 短信邮箱及时消息(1,2,3)
*/
@IocBean
@Slf4j
public class SmsNjuptServiceImpl implements SmsService {
@Override
public void send(String loginName, String content) {
Address[] address = new Address[]{
new Address("(" + loginName + ")", "uc_ux")
};
Message message = builder(address, null, content, null);
send(message);
}
@Override
public void send(String loginName, String title, String content) {
Address[] address = new Address[]{
new Address("(" + loginName + ")", "uc_ux")
};
Message message = builder(address, title, content, null);
send(message);
}
@Override
public void send(String loginName, String title, String content, String link) {
Address[] address = new Address[]{
new Address("(" + loginName + ")", "uc_ux")
};
Message message = builder(address, title, content, link);
send(message);
}
@Override
public void massSend(List<String> loginNames, String title, String content, String link) {
// List<Address> sms = loginNames.stream().map(loginName -> new Address(loginName, "sms")).toList();
List<Address> sms = loginNames.stream().map(loginName -> new Address("(" + loginName + ")", "uc_ux")).toList();
Address[] addresses = ArrayUtil.toArray(sms, Address.class);
Message message = builder(addresses, title, content, link);
send(message);
}
private void send(Message message) {
}
private Message builder(Address[] address, String title, String content, String linkUrl) {
Message message = new Message();
message.setTo(address); //接收人地址
message.setSubject(title); //标题
message.setContent(content); //内容
message.setMsgType(StrUtil.isNotBlank(linkUrl) ? 1 : 0); //是否有链接
MessagePropertiesEntry signature = buildProperty("smsSignature", ""); //用户签名
MessagePropertiesEntry innermsg = buildProperty("innerMsg", "true"); //支持站内信
MessagePropertiesEntry imLinkUrl = buildProperty("im_linkUrl", linkUrl);//短信中的链接
MessagePropertiesEntry[] entrys = StrUtil.isNotBlank(linkUrl) ? new MessagePropertiesEntry[]{signature, innermsg, imLinkUrl} : new MessagePropertiesEntry[]{signature, innermsg};
message.setProperties(new MessageProperties(entrys));
return message;
}
private MessagePropertiesEntry buildProperty(String key, String value) {
return new MessagePropertiesEntry(key, value);
}
}
@@ -0,0 +1,31 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv;
import com.budwk.app.base.sms.impl.njupt.ucp.serv.client.UcpWebServ_PortType;
import com.budwk.app.base.sms.impl.njupt.ucp.serv.client.UcpWebServ_Service;
import com.budwk.app.base.sms.impl.njupt.ucp.serv.client.UcpWebServ_ServiceLocator;
import java.net.URL;
public class MessageSender {
public static final int[] MESSAGE_SOLUTION = new int[]{1};
public static final int CHANNEL_SMS = 1;
public static final int CHANNEL_EMAIL = 2;
public static final int CHANNEL_IM = 3;
private String ws_url;
public MessageSender(String url) {
this.ws_url = url;
}
public MessageSender(String path, String url) {
this.ws_url = url;
System.setProperty("javax.net.ssl.keyStore", path);
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
}
public UcpWebServ_PortType loadUcpClient() throws Exception {
UcpWebServ_Service uws_s = new UcpWebServ_ServiceLocator();
return uws_s.getUcpWebServPort(new URL(this.ws_url));
}
}
@@ -0,0 +1,112 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
public class Address implements Serializable {
private String address;
private String type;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(Address.class, true);
public Address() {
}
public Address(String address, String type) {
this.address = address;
this.type = type;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getType() {
return this.type;
}
public void setType(String type) {
this.type = type;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof Address)) {
return false;
} else {
Address other = (Address)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.address == null && other.getAddress() == null || this.address != null && this.address.equals(other.getAddress())) && (this.type == null && other.getType() == null || this.type != null && this.type.equals(other.getType()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getAddress() != null) {
_hashCode += this.getAddress().hashCode();
}
if (this.getType() != null) {
_hashCode += this.getType().hashCode();
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("address");
elemField.setXmlName(new QName("", "address"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("type");
elemField.setXmlName(new QName("", "type"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,133 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
public class Attachment implements Serializable {
private String content;
private String mimeType;
private String name;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(Attachment.class, true);
public Attachment() {
}
public Attachment(String content, String mimeType, String name) {
this.content = content;
this.mimeType = mimeType;
this.name = name;
}
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
}
public String getMimeType() {
return this.mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof Attachment)) {
return false;
} else {
Attachment other = (Attachment)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.content == null && other.getContent() == null || this.content != null && this.content.equals(other.getContent())) && (this.mimeType == null && other.getMimeType() == null || this.mimeType != null && this.mimeType.equals(other.getMimeType())) && (this.name == null && other.getName() == null || this.name != null && this.name.equals(other.getName()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getContent() != null) {
_hashCode += this.getContent().hashCode();
}
if (this.getMimeType() != null) {
_hashCode += this.getMimeType().hashCode();
}
if (this.getName() != null) {
_hashCode += this.getName().hashCode();
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "attachment"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("content");
elemField.setXmlName(new QName("", "content"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("mimeType");
elemField.setXmlName(new QName("", "mimeType"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("name");
elemField.setXmlName(new QName("", "name"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,208 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
public class Channel implements Serializable {
private String[] addressTypes;
private String config;
private String friendlyName;
private int id;
private String implClass;
private String name;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(Channel.class, true);
public Channel() {
}
public Channel(String[] addressTypes, String config, String friendlyName, int id, String implClass, String name) {
this.addressTypes = addressTypes;
this.config = config;
this.friendlyName = friendlyName;
this.id = id;
this.implClass = implClass;
this.name = name;
}
public String[] getAddressTypes() {
return this.addressTypes;
}
public void setAddressTypes(String[] addressTypes) {
this.addressTypes = addressTypes;
}
public String getAddressTypes(int i) {
return this.addressTypes[i];
}
public void setAddressTypes(int i, String _value) {
this.addressTypes[i] = _value;
}
public String getConfig() {
return this.config;
}
public void setConfig(String config) {
this.config = config;
}
public String getFriendlyName() {
return this.friendlyName;
}
public void setFriendlyName(String friendlyName) {
this.friendlyName = friendlyName;
}
public int getId() {
return this.id;
}
public void setId(int id) {
this.id = id;
}
public String getImplClass() {
return this.implClass;
}
public void setImplClass(String implClass) {
this.implClass = implClass;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof Channel)) {
return false;
} else {
Channel other = (Channel)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.addressTypes == null && other.getAddressTypes() == null || this.addressTypes != null && Arrays.equals(this.addressTypes, other.getAddressTypes())) && (this.config == null && other.getConfig() == null || this.config != null && this.config.equals(other.getConfig())) && (this.friendlyName == null && other.getFriendlyName() == null || this.friendlyName != null && this.friendlyName.equals(other.getFriendlyName())) && this.id == other.getId() && (this.implClass == null && other.getImplClass() == null || this.implClass != null && this.implClass.equals(other.getImplClass())) && (this.name == null && other.getName() == null || this.name != null && this.name.equals(other.getName()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getAddressTypes() != null) {
for(int i = 0; i < Array.getLength(this.getAddressTypes()); ++i) {
Object obj = Array.get(this.getAddressTypes(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (this.getConfig() != null) {
_hashCode += this.getConfig().hashCode();
}
if (this.getFriendlyName() != null) {
_hashCode += this.getFriendlyName().hashCode();
}
_hashCode += this.getId();
if (this.getImplClass() != null) {
_hashCode += this.getImplClass().hashCode();
}
if (this.getName() != null) {
_hashCode += this.getName().hashCode();
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "channel"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("addressTypes");
elemField.setXmlName(new QName("", "addressTypes"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("config");
elemField.setXmlName(new QName("", "config"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("friendlyName");
elemField.setXmlName(new QName("", "friendlyName"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("id");
elemField.setXmlName(new QName("", "id"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("implClass");
elemField.setXmlName(new QName("", "implClass"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("name");
elemField.setXmlName(new QName("", "name"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,265 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.Calendar;
public class ChannelDeliverState implements Serializable {
private int billCount;
private String chanelDeliverId;
private int channelId;
private String errorMessage;
private int frameNo;
private Recipient recipientBy;
private String recvMessageId;
private Calendar sendTime;
private Recipient sendTo;
private int state;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(ChannelDeliverState.class, true);
public ChannelDeliverState() {
}
public ChannelDeliverState(int billCount, String chanelDeliverId, int channelId, String errorMessage, int frameNo, Recipient recipientBy, String recvMessageId, Calendar sendTime, Recipient sendTo, int state) {
this.billCount = billCount;
this.chanelDeliverId = chanelDeliverId;
this.channelId = channelId;
this.errorMessage = errorMessage;
this.frameNo = frameNo;
this.recipientBy = recipientBy;
this.recvMessageId = recvMessageId;
this.sendTime = sendTime;
this.sendTo = sendTo;
this.state = state;
}
public int getBillCount() {
return this.billCount;
}
public void setBillCount(int billCount) {
this.billCount = billCount;
}
public String getChanelDeliverId() {
return this.chanelDeliverId;
}
public void setChanelDeliverId(String chanelDeliverId) {
this.chanelDeliverId = chanelDeliverId;
}
public int getChannelId() {
return this.channelId;
}
public void setChannelId(int channelId) {
this.channelId = channelId;
}
public String getErrorMessage() {
return this.errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public int getFrameNo() {
return this.frameNo;
}
public void setFrameNo(int frameNo) {
this.frameNo = frameNo;
}
public Recipient getRecipientBy() {
return this.recipientBy;
}
public void setRecipientBy(Recipient recipientBy) {
this.recipientBy = recipientBy;
}
public String getRecvMessageId() {
return this.recvMessageId;
}
public void setRecvMessageId(String recvMessageId) {
this.recvMessageId = recvMessageId;
}
public Calendar getSendTime() {
return this.sendTime;
}
public void setSendTime(Calendar sendTime) {
this.sendTime = sendTime;
}
public Recipient getSendTo() {
return this.sendTo;
}
public void setSendTo(Recipient sendTo) {
this.sendTo = sendTo;
}
public int getState() {
return this.state;
}
public void setState(int state) {
this.state = state;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof ChannelDeliverState)) {
return false;
} else {
ChannelDeliverState other = (ChannelDeliverState)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = this.billCount == other.getBillCount() && (this.chanelDeliverId == null && other.getChanelDeliverId() == null || this.chanelDeliverId != null && this.chanelDeliverId.equals(other.getChanelDeliverId())) && this.channelId == other.getChannelId() && (this.errorMessage == null && other.getErrorMessage() == null || this.errorMessage != null && this.errorMessage.equals(other.getErrorMessage())) && this.frameNo == other.getFrameNo() && (this.recipientBy == null && other.getRecipientBy() == null || this.recipientBy != null && this.recipientBy.equals(other.getRecipientBy())) && (this.recvMessageId == null && other.getRecvMessageId() == null || this.recvMessageId != null && this.recvMessageId.equals(other.getRecvMessageId())) && (this.sendTime == null && other.getSendTime() == null || this.sendTime != null && this.sendTime.equals(other.getSendTime())) && (this.sendTo == null && other.getSendTo() == null || this.sendTo != null && this.sendTo.equals(other.getSendTo())) && this.state == other.getState();
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += this.getBillCount();
if (this.getChanelDeliverId() != null) {
_hashCode += this.getChanelDeliverId().hashCode();
}
_hashCode += this.getChannelId();
if (this.getErrorMessage() != null) {
_hashCode += this.getErrorMessage().hashCode();
}
_hashCode += this.getFrameNo();
if (this.getRecipientBy() != null) {
_hashCode += this.getRecipientBy().hashCode();
}
if (this.getRecvMessageId() != null) {
_hashCode += this.getRecvMessageId().hashCode();
}
if (this.getSendTime() != null) {
_hashCode += this.getSendTime().hashCode();
}
if (this.getSendTo() != null) {
_hashCode += this.getSendTo().hashCode();
}
_hashCode += this.getState();
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "channelDeliverState"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("billCount");
elemField.setXmlName(new QName("", "billCount"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("chanelDeliverId");
elemField.setXmlName(new QName("", "chanelDeliverId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("channelId");
elemField.setXmlName(new QName("", "channelId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("errorMessage");
elemField.setXmlName(new QName("", "errorMessage"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("frameNo");
elemField.setXmlName(new QName("", "frameNo"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("recipientBy");
elemField.setXmlName(new QName("", "recipientBy"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "recipient"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("recvMessageId");
elemField.setXmlName(new QName("", "recvMessageId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("sendTime");
elemField.setXmlName(new QName("", "sendTime"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "dateTime"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("sendTo");
elemField.setXmlName(new QName("", "sendTo"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "recipient"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("state");
elemField.setXmlName(new QName("", "state"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,323 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.util.Calendar;
public class ChannelMessageDetail implements Serializable {
private int billCount;
private String chanelDeliverId;
private int channelId;
private String errorMessage;
private int frameNo;
private ChannelMessageDetailProperties properties;
private Recipient recipientBy;
private String recvMessageId;
private String replyContent;
private int replyCount;
private Calendar sendTime;
private Recipient sendTo;
private int state;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(ChannelMessageDetail.class, true);
public ChannelMessageDetail() {
}
public ChannelMessageDetail(int billCount, String chanelDeliverId, int channelId, String errorMessage, int frameNo, ChannelMessageDetailProperties properties, Recipient recipientBy, String recvMessageId, String replyContent, int replyCount, Calendar sendTime, Recipient sendTo, int state) {
this.billCount = billCount;
this.chanelDeliverId = chanelDeliverId;
this.channelId = channelId;
this.errorMessage = errorMessage;
this.frameNo = frameNo;
this.properties = properties;
this.recipientBy = recipientBy;
this.recvMessageId = recvMessageId;
this.replyContent = replyContent;
this.replyCount = replyCount;
this.sendTime = sendTime;
this.sendTo = sendTo;
this.state = state;
}
public int getBillCount() {
return this.billCount;
}
public void setBillCount(int billCount) {
this.billCount = billCount;
}
public String getChanelDeliverId() {
return this.chanelDeliverId;
}
public void setChanelDeliverId(String chanelDeliverId) {
this.chanelDeliverId = chanelDeliverId;
}
public int getChannelId() {
return this.channelId;
}
public void setChannelId(int channelId) {
this.channelId = channelId;
}
public String getErrorMessage() {
return this.errorMessage;
}
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
public int getFrameNo() {
return this.frameNo;
}
public void setFrameNo(int frameNo) {
this.frameNo = frameNo;
}
public ChannelMessageDetailProperties getProperties() {
return this.properties;
}
public void setProperties(ChannelMessageDetailProperties properties) {
this.properties = properties;
}
public Recipient getRecipientBy() {
return this.recipientBy;
}
public void setRecipientBy(Recipient recipientBy) {
this.recipientBy = recipientBy;
}
public String getRecvMessageId() {
return this.recvMessageId;
}
public void setRecvMessageId(String recvMessageId) {
this.recvMessageId = recvMessageId;
}
public String getReplyContent() {
return this.replyContent;
}
public void setReplyContent(String replyContent) {
this.replyContent = replyContent;
}
public int getReplyCount() {
return this.replyCount;
}
public void setReplyCount(int replyCount) {
this.replyCount = replyCount;
}
public Calendar getSendTime() {
return this.sendTime;
}
public void setSendTime(Calendar sendTime) {
this.sendTime = sendTime;
}
public Recipient getSendTo() {
return this.sendTo;
}
public void setSendTo(Recipient sendTo) {
this.sendTo = sendTo;
}
public int getState() {
return this.state;
}
public void setState(int state) {
this.state = state;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof ChannelMessageDetail)) {
return false;
} else {
ChannelMessageDetail other = (ChannelMessageDetail)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = this.billCount == other.getBillCount() && (this.chanelDeliverId == null && other.getChanelDeliverId() == null || this.chanelDeliverId != null && this.chanelDeliverId.equals(other.getChanelDeliverId())) && this.channelId == other.getChannelId() && (this.errorMessage == null && other.getErrorMessage() == null || this.errorMessage != null && this.errorMessage.equals(other.getErrorMessage())) && this.frameNo == other.getFrameNo() && (this.properties == null && other.getProperties() == null || this.properties != null && this.properties.equals(other.getProperties())) && (this.recipientBy == null && other.getRecipientBy() == null || this.recipientBy != null && this.recipientBy.equals(other.getRecipientBy())) && (this.recvMessageId == null && other.getRecvMessageId() == null || this.recvMessageId != null && this.recvMessageId.equals(other.getRecvMessageId())) && (this.replyContent == null && other.getReplyContent() == null || this.replyContent != null && this.replyContent.equals(other.getReplyContent())) && this.replyCount == other.getReplyCount() && (this.sendTime == null && other.getSendTime() == null || this.sendTime != null && this.sendTime.equals(other.getSendTime())) && (this.sendTo == null && other.getSendTo() == null || this.sendTo != null && this.sendTo.equals(other.getSendTo())) && this.state == other.getState();
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
_hashCode += this.getBillCount();
if (this.getChanelDeliverId() != null) {
_hashCode += this.getChanelDeliverId().hashCode();
}
_hashCode += this.getChannelId();
if (this.getErrorMessage() != null) {
_hashCode += this.getErrorMessage().hashCode();
}
_hashCode += this.getFrameNo();
if (this.getProperties() != null) {
_hashCode += this.getProperties().hashCode();
}
if (this.getRecipientBy() != null) {
_hashCode += this.getRecipientBy().hashCode();
}
if (this.getRecvMessageId() != null) {
_hashCode += this.getRecvMessageId().hashCode();
}
if (this.getReplyContent() != null) {
_hashCode += this.getReplyContent().hashCode();
}
_hashCode += this.getReplyCount();
if (this.getSendTime() != null) {
_hashCode += this.getSendTime().hashCode();
}
if (this.getSendTo() != null) {
_hashCode += this.getSendTo().hashCode();
}
_hashCode += this.getState();
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "channelMessageDetail"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("billCount");
elemField.setXmlName(new QName("", "billCount"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("chanelDeliverId");
elemField.setXmlName(new QName("", "chanelDeliverId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("channelId");
elemField.setXmlName(new QName("", "channelId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("errorMessage");
elemField.setXmlName(new QName("", "errorMessage"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("frameNo");
elemField.setXmlName(new QName("", "frameNo"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("properties");
elemField.setXmlName(new QName("", "properties"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">channelMessageDetail>properties"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("recipientBy");
elemField.setXmlName(new QName("", "recipientBy"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "recipient"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("recvMessageId");
elemField.setXmlName(new QName("", "recvMessageId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("replyContent");
elemField.setXmlName(new QName("", "replyContent"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("replyCount");
elemField.setXmlName(new QName("", "replyCount"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("sendTime");
elemField.setXmlName(new QName("", "sendTime"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "dateTime"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("sendTo");
elemField.setXmlName(new QName("", "sendTo"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "recipient"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("state");
elemField.setXmlName(new QName("", "state"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,107 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
public class ChannelMessageDetailProperties implements Serializable {
private ChannelMessageDetailPropertiesEntry[] entry;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(ChannelMessageDetailProperties.class, true);
public ChannelMessageDetailProperties() {
}
public ChannelMessageDetailProperties(ChannelMessageDetailPropertiesEntry[] entry) {
this.entry = entry;
}
public ChannelMessageDetailPropertiesEntry[] getEntry() {
return this.entry;
}
public void setEntry(ChannelMessageDetailPropertiesEntry[] entry) {
this.entry = entry;
}
public ChannelMessageDetailPropertiesEntry getEntry(int i) {
return this.entry[i];
}
public void setEntry(int i, ChannelMessageDetailPropertiesEntry _value) {
this.entry[i] = _value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof ChannelMessageDetailProperties)) {
return false;
} else {
ChannelMessageDetailProperties other = (ChannelMessageDetailProperties)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = this.entry == null && other.getEntry() == null || this.entry != null && Arrays.equals(this.entry, other.getEntry());
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getEntry() != null) {
for(int i = 0; i < Array.getLength(this.getEntry()); ++i) {
Object obj = Array.get(this.getEntry(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">channelMessageDetail>properties"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("entry");
elemField.setXmlName(new QName("", "entry"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">>channelMessageDetail>properties>entry"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,112 @@
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
public class ChannelMessageDetailPropertiesEntry implements Serializable {
private String key;
private String value;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(ChannelMessageDetailPropertiesEntry.class, true);
public ChannelMessageDetailPropertiesEntry() {
}
public ChannelMessageDetailPropertiesEntry(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof ChannelMessageDetailPropertiesEntry)) {
return false;
} else {
ChannelMessageDetailPropertiesEntry other = (ChannelMessageDetailPropertiesEntry)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.key == null && other.getKey() == null || this.key != null && this.key.equals(other.getKey())) && (this.value == null && other.getValue() == null || this.value != null && this.value.equals(other.getValue()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getKey() != null) {
_hashCode += this.getKey().hashCode();
}
if (this.getValue() != null) {
_hashCode += this.getValue().hashCode();
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">>channelMessageDetail>properties>entry"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("key");
elemField.setXmlName(new QName("", "key"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("value");
elemField.setXmlName(new QName("", "value"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,280 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
public class Message implements Serializable {
private Address[] bcc;
private Address[] cc;
private String content;
private int msgType;
private boolean needReply;
private MessageProperties properties;
private String subject;
private Address[] to;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(Message.class, true);
public Message() {
}
public Message(Address[] bcc, Address[] cc, String content, int msgType, boolean needReply, MessageProperties properties, String subject, Address[] to) {
this.bcc = bcc;
this.cc = cc;
this.content = content;
this.msgType = msgType;
this.needReply = needReply;
this.properties = properties;
this.subject = subject;
this.to = to;
}
public Address[] getBcc() {
return this.bcc;
}
public void setBcc(Address[] bcc) {
this.bcc = bcc;
}
public Address getBcc(int i) {
return this.bcc[i];
}
public void setBcc(int i, Address _value) {
this.bcc[i] = _value;
}
public Address[] getCc() {
return this.cc;
}
public void setCc(Address[] cc) {
this.cc = cc;
}
public Address getCc(int i) {
return this.cc[i];
}
public void setCc(int i, Address _value) {
this.cc[i] = _value;
}
public String getContent() {
return this.content;
}
public void setContent(String content) {
this.content = content;
}
public int getMsgType() {
return this.msgType;
}
public void setMsgType(int msgType) {
this.msgType = msgType;
}
public boolean isNeedReply() {
return this.needReply;
}
public void setNeedReply(boolean needReply) {
this.needReply = needReply;
}
public MessageProperties getProperties() {
return this.properties;
}
public void setProperties(MessageProperties properties) {
this.properties = properties;
}
public String getSubject() {
return this.subject;
}
public void setSubject(String subject) {
this.subject = subject;
}
public Address[] getTo() {
return this.to;
}
public void setTo(Address[] to) {
this.to = to;
}
public Address getTo(int i) {
return this.to[i];
}
public void setTo(int i, Address _value) {
this.to[i] = _value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof Message)) {
return false;
} else {
Message other = (Message)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.bcc == null && other.getBcc() == null || this.bcc != null && Arrays.equals(this.bcc, other.getBcc())) && (this.cc == null && other.getCc() == null || this.cc != null && Arrays.equals(this.cc, other.getCc())) && (this.content == null && other.getContent() == null || this.content != null && this.content.equals(other.getContent())) && this.msgType == other.getMsgType() && this.needReply == other.isNeedReply() && (this.properties == null && other.getProperties() == null || this.properties != null && this.properties.equals(other.getProperties())) && (this.subject == null && other.getSubject() == null || this.subject != null && this.subject.equals(other.getSubject())) && (this.to == null && other.getTo() == null || this.to != null && Arrays.equals(this.to, other.getTo()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
int i;
Object obj;
if (this.getBcc() != null) {
for(i = 0; i < Array.getLength(this.getBcc()); ++i) {
obj = Array.get(this.getBcc(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (this.getCc() != null) {
for(i = 0; i < Array.getLength(this.getCc()); ++i) {
obj = Array.get(this.getCc(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (this.getContent() != null) {
_hashCode += this.getContent().hashCode();
}
_hashCode += this.getMsgType();
_hashCode += (this.isNeedReply() ? Boolean.TRUE : Boolean.FALSE).hashCode();
if (this.getProperties() != null) {
_hashCode += this.getProperties().hashCode();
}
if (this.getSubject() != null) {
_hashCode += this.getSubject().hashCode();
}
if (this.getTo() != null) {
for(i = 0; i < Array.getLength(this.getTo()); ++i) {
obj = Array.get(this.getTo(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "message"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("bcc");
elemField.setXmlName(new QName("", "bcc"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("cc");
elemField.setXmlName(new QName("", "cc"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("content");
elemField.setXmlName(new QName("", "content"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("msgType");
elemField.setXmlName(new QName("", "msgType"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("needReply");
elemField.setXmlName(new QName("", "needReply"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "boolean"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("properties");
elemField.setXmlName(new QName("", "properties"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">message>properties"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("subject");
elemField.setXmlName(new QName("", "subject"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("to");
elemField.setXmlName(new QName("", "to"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,104 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.AxisFault;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.SerializationContext;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import org.xml.sax.Attributes;
import javax.xml.namespace.QName;
import java.io.IOException;
import java.io.Serializable;
public class MessageException extends AxisFault implements Serializable {
private String message1;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(MessageException.class, true);
public MessageException() {
}
public MessageException(String message1) {
this.message1 = message1;
}
public String getMessage1() {
return this.message1;
}
public void setMessage1(String message1) {
this.message1 = message1;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof MessageException)) {
return false;
} else {
MessageException other = (MessageException)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = this.message1 == null && other.getMessage1() == null || this.message1 != null && this.message1.equals(other.getMessage1());
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getMessage1() != null) {
_hashCode += this.getMessage1().hashCode();
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
public void writeDetails(QName qname, SerializationContext context) throws IOException {
context.serialize(qname, (Attributes)null, this);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "MessageException"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("message1");
elemField.setXmlName(new QName("", "message"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,112 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
public class MessageProperties implements Serializable {
private MessagePropertiesEntry[] entry;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(MessageProperties.class, true);
public MessageProperties() {
}
public MessageProperties(MessagePropertiesEntry[] entry) {
this.entry = entry;
}
public MessagePropertiesEntry[] getEntry() {
return this.entry;
}
public void setEntry(MessagePropertiesEntry[] entry) {
this.entry = entry;
}
public MessagePropertiesEntry getEntry(int i) {
return this.entry[i];
}
public void setEntry(int i, MessagePropertiesEntry _value) {
this.entry[i] = _value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof MessageProperties)) {
return false;
} else {
MessageProperties other = (MessageProperties)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = this.entry == null && other.getEntry() == null || this.entry != null && Arrays.equals(this.entry, other.getEntry());
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getEntry() != null) {
for(int i = 0; i < Array.getLength(this.getEntry()); ++i) {
Object obj = Array.get(this.getEntry(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">message>properties"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("entry");
elemField.setXmlName(new QName("", "entry"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">>message>properties>entry"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,117 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
public class MessagePropertiesEntry implements Serializable {
private String key;
private String value;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(MessagePropertiesEntry.class, true);
public MessagePropertiesEntry() {
}
public MessagePropertiesEntry(String key, String value) {
this.key = key;
this.value = value;
}
public String getKey() {
return this.key;
}
public void setKey(String key) {
this.key = key;
}
public String getValue() {
return this.value;
}
public void setValue(String value) {
this.value = value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof MessagePropertiesEntry)) {
return false;
} else {
MessagePropertiesEntry other = (MessagePropertiesEntry)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.key == null && other.getKey() == null || this.key != null && this.key.equals(other.getKey())) && (this.value == null && other.getValue() == null || this.value != null && this.value.equals(other.getValue()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getKey() != null) {
_hashCode += this.getKey().hashCode();
}
if (this.getValue() != null) {
_hashCode += this.getValue().hashCode();
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", ">>message>properties>entry"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("key");
elemField.setXmlName(new QName("", "key"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("value");
elemField.setXmlName(new QName("", "value"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,113 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
public class Recipient implements Serializable {
private Address address;
private int type;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(Recipient.class, true);
public Recipient() {
}
public Recipient(Address address, int type) {
this.address = address;
this.type = type;
}
public Address getAddress() {
return this.address;
}
public void setAddress(Address address) {
this.address = address;
}
public int getType() {
return this.type;
}
public void setType(int type) {
this.type = type;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof Recipient)) {
return false;
} else {
Recipient other = (Recipient)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.address == null && other.getAddress() == null || this.address != null && this.address.equals(other.getAddress())) && this.type == other.getType();
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getAddress() != null) {
_hashCode += this.getAddress().hashCode();
}
_hashCode += this.getType();
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "recipient"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("address");
elemField.setXmlName(new QName("", "address"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("type");
elemField.setXmlName(new QName("", "type"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,171 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
public class SendResult implements Serializable {
private String errorInfo;
private String messageId;
private boolean succeeded;
private WrongAddress[] wrongAddresses;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(SendResult.class, true);
public SendResult() {
}
public SendResult(String errorInfo, String messageId, boolean succeeded, WrongAddress[] wrongAddresses) {
this.errorInfo = errorInfo;
this.messageId = messageId;
this.succeeded = succeeded;
this.wrongAddresses = wrongAddresses;
}
public String getErrorInfo() {
return this.errorInfo;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public String getMessageId() {
return this.messageId;
}
public void setMessageId(String messageId) {
this.messageId = messageId;
}
public boolean isSucceeded() {
return this.succeeded;
}
public void setSucceeded(boolean succeeded) {
this.succeeded = succeeded;
}
public WrongAddress[] getWrongAddresses() {
return this.wrongAddresses;
}
public void setWrongAddresses(WrongAddress[] wrongAddresses) {
this.wrongAddresses = wrongAddresses;
}
public WrongAddress getWrongAddresses(int i) {
return this.wrongAddresses[i];
}
public void setWrongAddresses(int i, WrongAddress _value) {
this.wrongAddresses[i] = _value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof SendResult)) {
return false;
} else {
SendResult other = (SendResult)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.errorInfo == null && other.getErrorInfo() == null || this.errorInfo != null && this.errorInfo.equals(other.getErrorInfo())) && (this.messageId == null && other.getMessageId() == null || this.messageId != null && this.messageId.equals(other.getMessageId())) && this.succeeded == other.isSucceeded() && (this.wrongAddresses == null && other.getWrongAddresses() == null || this.wrongAddresses != null && Arrays.equals(this.wrongAddresses, other.getWrongAddresses()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getErrorInfo() != null) {
_hashCode += this.getErrorInfo().hashCode();
}
if (this.getMessageId() != null) {
_hashCode += this.getMessageId().hashCode();
}
_hashCode += (this.isSucceeded() ? Boolean.TRUE : Boolean.FALSE).hashCode();
if (this.getWrongAddresses() != null) {
for(int i = 0; i < Array.getLength(this.getWrongAddresses()); ++i) {
Object obj = Array.get(this.getWrongAddresses(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "sendResult"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("errorInfo");
elemField.setXmlName(new QName("", "errorInfo"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("messageId");
elemField.setXmlName(new QName("", "messageId"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("succeeded");
elemField.setXmlName(new QName("", "succeeded"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "boolean"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("wrongAddresses");
elemField.setXmlName(new QName("", "wrongAddresses"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "wrongAddress"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,940 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.AxisFault;
import org.apache.axis.NoEndPointException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Stub;
import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;
import org.apache.axis.description.FaultDesc;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ParameterDesc;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.ser.*;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.utils.JavaUtils;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.encoding.SerializerFactory;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.Calendar;
import java.util.Enumeration;
import java.util.Vector;
public class UcpWebServPortBindingStub extends Stub implements UcpWebServ_PortType {
private Vector cachedSerClasses;
private Vector cachedSerQNames;
private Vector cachedSerFactories;
private Vector cachedDeserFactories;
static OperationDesc[] _operations = new OperationDesc[12];
private static void _initOperationDesc1() {
OperationDesc oper = new OperationDesc();
oper.setName("sendMessage");
ParameterDesc param = new ParameterDesc(new QName("", "boxId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "message"), (byte)1, new QName("http://serv.ucp.sudytech.com/", "message"), Message.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channels"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), int[].class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "usesSignature"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "boolean"), Boolean.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "plannedTime"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "dateTime"), Calendar.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://serv.ucp.sudytech.com/", "sendResult"));
oper.setReturnClass(SendResult.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[0] = oper;
oper = new OperationDesc();
oper.setName("addAttachment");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "attachment"), (byte)1, new QName("http://serv.ucp.sudytech.com/", "attachment"), Attachment.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
oper.setReturnClass(String.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[1] = oper;
oper = new OperationDesc();
oper.setName("deleteAttachment");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "attachmentId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "boolean"));
oper.setReturnClass(Boolean.TYPE);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[2] = oper;
oper = new OperationDesc();
oper.setName("createMessage");
param = new ParameterDesc(new QName("", "boxId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "message"), (byte)1, new QName("http://serv.ucp.sudytech.com/", "message"), Message.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
oper.setReturnClass(String.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[3] = oper;
oper = new OperationDesc();
oper.setName("deleteMessage");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "boolean"));
oper.setReturnClass(Boolean.TYPE);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[4] = oper;
oper = new OperationDesc();
oper.setName("sendSavedMessage");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channels"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), int[].class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "usesSignature"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "boolean"), Boolean.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "plannedTime"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "dateTime"), Calendar.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://serv.ucp.sudytech.com/", "sendResult"));
oper.setReturnClass(SendResult.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[5] = oper;
oper = new OperationDesc();
oper.setName("sendIndivMessage");
param = new ParameterDesc(new QName("", "boxId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "message"), (byte)1, new QName("http://serv.ucp.sudytech.com/", "message"), Message.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channels"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), int[].class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "usesSignature"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "boolean"), Boolean.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "solution"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "datasrc"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "idvidualParams"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "plannedTime"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "dateTime"), Calendar.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://serv.ucp.sudytech.com/", "sendResult"));
oper.setReturnClass(SendResult.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[6] = oper;
oper = new OperationDesc();
oper.setName("sendIndivSavedMessage");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channels"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), int[].class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "usesSignature"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "boolean"), Boolean.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "solution"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "datasrc"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "idvidualParams"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "plannedTime"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "dateTime"), Calendar.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://serv.ucp.sudytech.com/", "sendResult"));
oper.setReturnClass(SendResult.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://serv.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.serv.client.MessageException", new QName("http://serv.ucp.sudytech.com/", "MessageException"), true));
_operations[7] = oper;
oper = new OperationDesc();
oper.setName("getMessageDeliverCount");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channel"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
oper.setReturnClass(Integer.TYPE);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
_operations[8] = oper;
oper = new OperationDesc();
oper.setName("getMessageDelivers");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channel"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "beginIndex"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "count"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://serv.ucp.sudytech.com/", "channelDeliverState"));
oper.setReturnClass(ChannelDeliverState[].class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
_operations[9] = oper;
}
private static void _initOperationDesc2() {
OperationDesc oper = new OperationDesc();
oper.setName("getChannelMessageDetailCount");
ParameterDesc param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channel"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
oper.setReturnClass(Integer.TYPE);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
_operations[10] = oper;
oper = new OperationDesc();
oper.setName("getChannelMessageDetails");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "channel"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "beginIndex"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "count"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "int"), Integer.TYPE, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "serviceToken"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://serv.ucp.sudytech.com/", "channelMessageDetail"));
oper.setReturnClass(ChannelMessageDetail[].class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
_operations[11] = oper;
}
public UcpWebServPortBindingStub() throws AxisFault {
this((Service)null);
}
public UcpWebServPortBindingStub(URL endpointURL, Service service) throws AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public UcpWebServPortBindingStub(Service service) throws AxisFault {
this.cachedSerClasses = new Vector();
this.cachedSerQNames = new Vector();
this.cachedSerFactories = new Vector();
this.cachedDeserFactories = new Vector();
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
Class beansf = BeanSerializerFactory.class;
Class beandf = BeanDeserializerFactory.class;
Class enumsf = EnumSerializerFactory.class;
Class enumdf = EnumDeserializerFactory.class;
Class arraysf = ArraySerializerFactory.class;
Class arraydf = ArrayDeserializerFactory.class;
Class simplesf = SimpleSerializerFactory.class;
Class simpledf = SimpleDeserializerFactory.class;
Class simplelistsf = SimpleListSerializerFactory.class;
Class simplelistdf = SimpleListDeserializerFactory.class;
QName qName = new QName("http://serv.ucp.sudytech.com/", ">>channelMessageDetail>properties>entry");
this.cachedSerQNames.add(qName);
Class cls = ChannelMessageDetailPropertiesEntry.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", ">>message>properties>entry");
this.cachedSerQNames.add(qName);
cls = MessagePropertiesEntry.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", ">channelMessageDetail>properties");
this.cachedSerQNames.add(qName);
cls = ChannelMessageDetailProperties.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", ">message>properties");
this.cachedSerQNames.add(qName);
cls = MessageProperties.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "address");
this.cachedSerQNames.add(qName);
cls = Address.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "attachment");
this.cachedSerQNames.add(qName);
cls = Attachment.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "channel");
this.cachedSerQNames.add(qName);
cls = Channel.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "channelDeliverState");
this.cachedSerQNames.add(qName);
cls = ChannelDeliverState.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "channelMessageDetail");
this.cachedSerQNames.add(qName);
cls = ChannelMessageDetail.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "message");
this.cachedSerQNames.add(qName);
cls = Message.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "MessageException");
this.cachedSerQNames.add(qName);
cls = MessageException.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "recipient");
this.cachedSerQNames.add(qName);
cls = Recipient.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "sendResult");
this.cachedSerQNames.add(qName);
cls = SendResult.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://serv.ucp.sudytech.com/", "wrongAddress");
this.cachedSerQNames.add(qName);
cls = WrongAddress.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
}
protected Call createCall() throws RemoteException {
try {
Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
Enumeration keys = super.cachedProperties.keys();
while(keys.hasMoreElements()) {
String key = (String)keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
synchronized(this) {
if (this.firstCall()) {
_call.setEncodingStyle((String)null);
for(int i = 0; i < this.cachedSerFactories.size(); ++i) {
Class cls = (Class)this.cachedSerClasses.get(i);
QName qName = (QName)this.cachedSerQNames.get(i);
Object x = this.cachedSerFactories.get(i);
if (x instanceof Class) {
Class sf = (Class)this.cachedSerFactories.get(i);
Class df = (Class)this.cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
} else if (x instanceof SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)this.cachedSerFactories.get(i);
DeserializerFactory df = (DeserializerFactory)this.cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
} catch (Throwable var12) {
throw new AxisFault("Failure trying to get the Call object", var12);
}
}
public SendResult sendMessage(int boxId, Message message, int[] channels, boolean usesSignature, Calendar plannedTime, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "sendMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{new Integer(boxId), message, channels, new Boolean(usesSignature), plannedTime, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (SendResult)_resp;
} catch (Exception var10) {
return (SendResult)JavaUtils.convert(_resp, SendResult.class);
}
}
} catch (AxisFault var11) {
if (var11.detail != null) {
if (var11.detail instanceof RemoteException) {
throw (RemoteException)var11.detail;
}
if (var11.detail instanceof MessageException) {
throw (MessageException)var11.detail;
}
}
throw var11;
}
}
}
public String addAttachment(String messageId, Attachment attachment, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "addAttachment"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, attachment, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (String)_resp;
} catch (Exception var7) {
return (String)JavaUtils.convert(_resp, String.class);
}
}
} catch (AxisFault var8) {
if (var8.detail != null) {
if (var8.detail instanceof RemoteException) {
throw (RemoteException)var8.detail;
}
if (var8.detail instanceof MessageException) {
throw (MessageException)var8.detail;
}
}
throw var8;
}
}
}
public boolean deleteAttachment(String messageId, String attachmentId, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "deleteAttachment"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, attachmentId, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (Boolean)_resp;
} catch (Exception var7) {
return (Boolean)JavaUtils.convert(_resp, Boolean.TYPE);
}
}
} catch (AxisFault var8) {
if (var8.detail != null) {
if (var8.detail instanceof RemoteException) {
throw (RemoteException)var8.detail;
}
if (var8.detail instanceof MessageException) {
throw (MessageException)var8.detail;
}
}
throw var8;
}
}
}
public String createMessage(int boxId, Message message, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[3]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "createMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{new Integer(boxId), message, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (String)_resp;
} catch (Exception var7) {
return (String)JavaUtils.convert(_resp, String.class);
}
}
} catch (AxisFault var8) {
if (var8.detail != null) {
if (var8.detail instanceof RemoteException) {
throw (RemoteException)var8.detail;
}
if (var8.detail instanceof MessageException) {
throw (MessageException)var8.detail;
}
}
throw var8;
}
}
}
public boolean deleteMessage(String messageId, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[4]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "deleteMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (Boolean)_resp;
} catch (Exception var6) {
return (Boolean)JavaUtils.convert(_resp, Boolean.TYPE);
}
}
} catch (AxisFault var7) {
if (var7.detail != null) {
if (var7.detail instanceof RemoteException) {
throw (RemoteException)var7.detail;
}
if (var7.detail instanceof MessageException) {
throw (MessageException)var7.detail;
}
}
throw var7;
}
}
}
public SendResult sendSavedMessage(String messageId, int[] channels, boolean usesSignature, Calendar plannedTime, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[5]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "sendSavedMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, channels, new Boolean(usesSignature), plannedTime, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (SendResult)_resp;
} catch (Exception var9) {
return (SendResult)JavaUtils.convert(_resp, SendResult.class);
}
}
} catch (AxisFault var10) {
if (var10.detail != null) {
if (var10.detail instanceof RemoteException) {
throw (RemoteException)var10.detail;
}
if (var10.detail instanceof MessageException) {
throw (MessageException)var10.detail;
}
}
throw var10;
}
}
}
public SendResult sendIndivMessage(int boxId, Message message, int[] channels, boolean usesSignature, int solution, String datasrc, String idvidualParams, Calendar plannedTime, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[6]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "sendIndivMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{new Integer(boxId), message, channels, new Boolean(usesSignature), new Integer(solution), datasrc, idvidualParams, plannedTime, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (SendResult)_resp;
} catch (Exception var13) {
return (SendResult)JavaUtils.convert(_resp, SendResult.class);
}
}
} catch (AxisFault var14) {
if (var14.detail != null) {
if (var14.detail instanceof RemoteException) {
throw (RemoteException)var14.detail;
}
if (var14.detail instanceof MessageException) {
throw (MessageException)var14.detail;
}
}
throw var14;
}
}
}
public SendResult sendIndivSavedMessage(String messageId, int[] channels, boolean usesSignature, int solution, String datasrc, String idvidualParams, Calendar plannedTime, String serviceToken) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[7]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "sendIndivSavedMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, channels, new Boolean(usesSignature), new Integer(solution), datasrc, idvidualParams, plannedTime, serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (SendResult)_resp;
} catch (Exception var12) {
return (SendResult)JavaUtils.convert(_resp, SendResult.class);
}
}
} catch (AxisFault var13) {
if (var13.detail != null) {
if (var13.detail instanceof RemoteException) {
throw (RemoteException)var13.detail;
}
if (var13.detail instanceof MessageException) {
throw (MessageException)var13.detail;
}
}
throw var13;
}
}
}
public int getMessageDeliverCount(String messageId, int channel, String serviceToken) throws RemoteException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[8]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "getMessageDeliverCount"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, new Integer(channel), serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (Integer)_resp;
} catch (Exception var7) {
return (Integer)JavaUtils.convert(_resp, Integer.TYPE);
}
}
} catch (AxisFault var8) {
throw var8;
}
}
}
public ChannelDeliverState[] getMessageDelivers(String messageId, int channel, int beginIndex, int count, String serviceToken) throws RemoteException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[9]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "getMessageDelivers"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, new Integer(channel), new Integer(beginIndex), new Integer(count), serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (ChannelDeliverState[])((ChannelDeliverState[])_resp);
} catch (Exception var9) {
return (ChannelDeliverState[])((ChannelDeliverState[])JavaUtils.convert(_resp, ChannelDeliverState[].class));
}
}
} catch (AxisFault var10) {
throw var10;
}
}
}
public int getChannelMessageDetailCount(String messageId, int channel, String serviceToken) throws RemoteException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[10]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "getChannelMessageDetailCount"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, new Integer(channel), serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (Integer)_resp;
} catch (Exception var7) {
return (Integer)JavaUtils.convert(_resp, Integer.TYPE);
}
}
} catch (AxisFault var8) {
throw var8;
}
}
}
public ChannelMessageDetail[] getChannelMessageDetails(String messageId, int channel, int beginIndex, int count, String serviceToken) throws RemoteException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[11]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://serv.ucp.sudytech.com/", "getChannelMessageDetails"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId, new Integer(channel), new Integer(beginIndex), new Integer(count), serviceToken});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (ChannelMessageDetail[])((ChannelMessageDetail[])_resp);
} catch (Exception var9) {
return (ChannelMessageDetail[])((ChannelMessageDetail[])JavaUtils.convert(_resp, ChannelMessageDetail[].class));
}
}
} catch (AxisFault var10) {
throw var10;
}
}
}
static {
_initOperationDesc1();
_initOperationDesc2();
}
}
@@ -0,0 +1,36 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.Calendar;
public interface UcpWebServ_PortType extends Remote {
SendResult sendMessage(int var1, Message var2, int[] var3, boolean var4, Calendar var5, String var6) throws RemoteException, MessageException;
String addAttachment(String var1, Attachment var2, String var3) throws RemoteException, MessageException;
boolean deleteAttachment(String var1, String var2, String var3) throws RemoteException, MessageException;
String createMessage(int var1, Message var2, String var3) throws RemoteException, MessageException;
boolean deleteMessage(String var1, String var2) throws RemoteException, MessageException;
SendResult sendSavedMessage(String var1, int[] var2, boolean var3, Calendar var4, String var5) throws RemoteException, MessageException;
SendResult sendIndivMessage(int var1, Message var2, int[] var3, boolean var4, int var5, String var6, String var7, Calendar var8, String var9) throws RemoteException, MessageException;
SendResult sendIndivSavedMessage(String var1, int[] var2, boolean var3, int var4, String var5, String var6, Calendar var7, String var8) throws RemoteException, MessageException;
int getMessageDeliverCount(String var1, int var2, String var3) throws RemoteException;
ChannelDeliverState[] getMessageDelivers(String var1, int var2, int var3, int var4, String var5) throws RemoteException;
int getChannelMessageDetailCount(String var1, int var2, String var3) throws RemoteException;
ChannelMessageDetail[] getChannelMessageDetails(String var1, int var2, int var3, int var4, String var5) throws RemoteException;
}
@@ -0,0 +1,18 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceException;
import java.net.URL;
public interface UcpWebServ_Service extends Service {
String getUcpWebServPortAddress();
UcpWebServ_PortType getUcpWebServPort() throws ServiceException;
UcpWebServ_PortType getUcpWebServPort(URL var1) throws ServiceException;
}
@@ -0,0 +1,127 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.AxisFault;
import org.apache.axis.EngineConfiguration;
import org.apache.axis.client.Service;
import org.apache.axis.client.Stub;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceException;
import java.net.MalformedURLException;
import java.net.URL;
import java.rmi.Remote;
import java.util.HashSet;
import java.util.Iterator;
public class UcpWebServ_ServiceLocator extends Service implements UcpWebServ_Service {
private String UcpWebServPort_address = "http://172.18.10.32:8181/UcpWebServ";
private String UcpWebServPortWSDDServiceName = "UcpWebServPort";
private HashSet ports = null;
public UcpWebServ_ServiceLocator() {
}
public UcpWebServ_ServiceLocator(EngineConfiguration config) {
super(config);
}
public UcpWebServ_ServiceLocator(String wsdlLoc, QName sName) throws ServiceException {
super(wsdlLoc, sName);
}
public String getUcpWebServPortAddress() {
return this.UcpWebServPort_address;
}
public String getUcpWebServPortWSDDServiceName() {
return this.UcpWebServPortWSDDServiceName;
}
public void setUcpWebServPortWSDDServiceName(String name) {
this.UcpWebServPortWSDDServiceName = name;
}
public UcpWebServ_PortType getUcpWebServPort() throws ServiceException {
URL endpoint;
try {
endpoint = new URL(this.UcpWebServPort_address);
} catch (MalformedURLException var3) {
throw new ServiceException(var3);
}
return this.getUcpWebServPort(endpoint);
}
public UcpWebServ_PortType getUcpWebServPort(URL portAddress) throws ServiceException {
try {
UcpWebServPortBindingStub _stub = new UcpWebServPortBindingStub(portAddress, this);
_stub.setPortName(this.getUcpWebServPortWSDDServiceName());
return _stub;
} catch (AxisFault var3) {
return null;
}
}
public void setUcpWebServPortEndpointAddress(String address) {
this.UcpWebServPort_address = address;
}
public Remote getPort(Class serviceEndpointInterface) throws ServiceException {
try {
if (UcpWebServ_PortType.class.isAssignableFrom(serviceEndpointInterface)) {
UcpWebServPortBindingStub _stub = new UcpWebServPortBindingStub(new URL(this.UcpWebServPort_address), this);
_stub.setPortName(this.getUcpWebServPortWSDDServiceName());
return _stub;
}
} catch (Throwable var3) {
throw new ServiceException(var3);
}
throw new ServiceException("There is no stub implementation for the interface: " + (serviceEndpointInterface == null ? "null" : serviceEndpointInterface.getName()));
}
public Remote getPort(QName portName, Class serviceEndpointInterface) throws ServiceException {
if (portName == null) {
return this.getPort(serviceEndpointInterface);
} else {
String inputPortName = portName.getLocalPart();
if ("UcpWebServPort".equals(inputPortName)) {
return this.getUcpWebServPort();
} else {
Remote _stub = this.getPort(serviceEndpointInterface);
((Stub)_stub).setPortName(portName);
return _stub;
}
}
}
public QName getServiceName() {
return new QName("http://serv.ucp.sudytech.com/", "UcpWebServ");
}
public Iterator getPorts() {
if (this.ports == null) {
this.ports = new HashSet();
this.ports.add(new QName("http://serv.ucp.sudytech.com/", "UcpWebServPort"));
}
return this.ports.iterator();
}
public void setEndpointAddress(String portName, String address) throws ServiceException {
if ("UcpWebServPort".equals(portName)) {
this.setUcpWebServPortEndpointAddress(address);
} else {
throw new ServiceException(" Cannot set Endpoint Address for Unknown Port" + portName);
}
}
public void setEndpointAddress(QName portName, String address) throws ServiceException {
this.setEndpointAddress(portName.getLocalPart(), address);
}
}
@@ -0,0 +1,208 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.serv.client;
import org.apache.axis.description.ElementDesc;
import org.apache.axis.description.TypeDesc;
import org.apache.axis.encoding.Deserializer;
import org.apache.axis.encoding.Serializer;
import org.apache.axis.encoding.ser.BeanDeserializer;
import org.apache.axis.encoding.ser.BeanSerializer;
import javax.xml.namespace.QName;
import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.Arrays;
public class WrongAddress implements Serializable {
private Address address;
private String errorInfo;
private int errorType;
private Channel[] forbiddenChannels;
private Address[] subAddresses;
private Object __equalsCalc = null;
private boolean __hashCodeCalc = false;
private static TypeDesc typeDesc = new TypeDesc(WrongAddress.class, true);
public WrongAddress() {
}
public WrongAddress(Address address, String errorInfo, int errorType, Channel[] forbiddenChannels, Address[] subAddresses) {
this.address = address;
this.errorInfo = errorInfo;
this.errorType = errorType;
this.forbiddenChannels = forbiddenChannels;
this.subAddresses = subAddresses;
}
public Address getAddress() {
return this.address;
}
public void setAddress(Address address) {
this.address = address;
}
public String getErrorInfo() {
return this.errorInfo;
}
public void setErrorInfo(String errorInfo) {
this.errorInfo = errorInfo;
}
public int getErrorType() {
return this.errorType;
}
public void setErrorType(int errorType) {
this.errorType = errorType;
}
public Channel[] getForbiddenChannels() {
return this.forbiddenChannels;
}
public void setForbiddenChannels(Channel[] forbiddenChannels) {
this.forbiddenChannels = forbiddenChannels;
}
public Channel getForbiddenChannels(int i) {
return this.forbiddenChannels[i];
}
public void setForbiddenChannels(int i, Channel _value) {
this.forbiddenChannels[i] = _value;
}
public Address[] getSubAddresses() {
return this.subAddresses;
}
public void setSubAddresses(Address[] subAddresses) {
this.subAddresses = subAddresses;
}
public Address getSubAddresses(int i) {
return this.subAddresses[i];
}
public void setSubAddresses(int i, Address _value) {
this.subAddresses[i] = _value;
}
public synchronized boolean equals(Object obj) {
if (!(obj instanceof WrongAddress)) {
return false;
} else {
WrongAddress other = (WrongAddress)obj;
if (obj == null) {
return false;
} else if (this == obj) {
return true;
} else if (this.__equalsCalc != null) {
return this.__equalsCalc == obj;
} else {
this.__equalsCalc = obj;
boolean _equals = (this.address == null && other.getAddress() == null || this.address != null && this.address.equals(other.getAddress())) && (this.errorInfo == null && other.getErrorInfo() == null || this.errorInfo != null && this.errorInfo.equals(other.getErrorInfo())) && this.errorType == other.getErrorType() && (this.forbiddenChannels == null && other.getForbiddenChannels() == null || this.forbiddenChannels != null && Arrays.equals(this.forbiddenChannels, other.getForbiddenChannels())) && (this.subAddresses == null && other.getSubAddresses() == null || this.subAddresses != null && Arrays.equals(this.subAddresses, other.getSubAddresses()));
this.__equalsCalc = null;
return _equals;
}
}
}
public synchronized int hashCode() {
if (this.__hashCodeCalc) {
return 0;
} else {
this.__hashCodeCalc = true;
int _hashCode = 1;
if (this.getAddress() != null) {
_hashCode += this.getAddress().hashCode();
}
if (this.getErrorInfo() != null) {
_hashCode += this.getErrorInfo().hashCode();
}
_hashCode += this.getErrorType();
int i;
Object obj;
if (this.getForbiddenChannels() != null) {
for(i = 0; i < Array.getLength(this.getForbiddenChannels()); ++i) {
obj = Array.get(this.getForbiddenChannels(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
if (this.getSubAddresses() != null) {
for(i = 0; i < Array.getLength(this.getSubAddresses()); ++i) {
obj = Array.get(this.getSubAddresses(), i);
if (obj != null && !obj.getClass().isArray()) {
_hashCode += obj.hashCode();
}
}
}
this.__hashCodeCalc = false;
return _hashCode;
}
}
public static TypeDesc getTypeDesc() {
return typeDesc;
}
public static Serializer getSerializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanSerializer(_javaType, _xmlType, typeDesc);
}
public static Deserializer getDeserializer(String mechType, Class _javaType, QName _xmlType) {
return new BeanDeserializer(_javaType, _xmlType, typeDesc);
}
static {
typeDesc.setXmlType(new QName("http://serv.ucp.sudytech.com/", "wrongAddress"));
ElementDesc elemField = new ElementDesc();
elemField.setFieldName("address");
elemField.setXmlName(new QName("", "address"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("errorInfo");
elemField.setXmlName(new QName("", "errorInfo"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("errorType");
elemField.setXmlName(new QName("", "errorType"));
elemField.setXmlType(new QName("http://www.w3.org/2001/XMLSchema", "int"));
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("forbiddenChannels");
elemField.setXmlName(new QName("", "forbiddenChannels"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "channel"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
elemField = new ElementDesc();
elemField.setFieldName("subAddresses");
elemField.setXmlName(new QName("", "subAddresses"));
elemField.setXmlType(new QName("http://serv.ucp.sudytech.com/", "address"));
elemField.setMinOccurs(0);
elemField.setNillable(true);
elemField.setMaxOccursUnbounded(true);
typeDesc.addFieldDesc(elemField);
}
}
@@ -0,0 +1,38 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.ws;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.msg.UcpMessage;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.msg.UcpMessageService_PortType;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.msg.UcpMessageService_Service;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.msg.UcpMessageService_ServiceLocator;
import java.net.URL;
public class MessageService {
private String url;
public MessageService(String url) {
this.url = url;
}
public UcpMessageService_PortType loadMessageServiceClient() throws Exception {
UcpMessageService_Service service = new UcpMessageService_ServiceLocator();
return service.getUcpMessageServicePort(new URL(this.url));
}
public int findUnreadMessageCount(String loginName) throws Exception {
return this.loadMessageServiceClient().findUnreadMessageCount(loginName);
}
public UcpMessage[] findUnreadMessages(String loginName) throws Exception {
return this.loadMessageServiceClient().findUnreadMessages(loginName, -1, -1);
}
public UcpMessage[] findUnreadMessages(String loginName, int beginIndex, int count) throws Exception {
return this.loadMessageServiceClient().findUnreadMessages(loginName, beginIndex, count);
}
}
@@ -0,0 +1,46 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.ws;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.SmsService_PortType;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.SmsService_Service;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.SmsService_ServiceLocator;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.DeliverState;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.MessageState;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.SendResult;
import java.net.URL;
public class SmsMessageSender {
private String url;
public SmsMessageSender(String path, String url) {
this.url = url;
System.setProperty("javax.net.ssl.keyStore", path);
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "PKCS12");
}
private SmsService_PortType loadSmsClient() throws Exception {
SmsService_Service service = new SmsService_ServiceLocator();
return service.getSmsServicePort(new URL(this.url));
}
public SendResult send(String context, String[] phones) throws Exception {
SmsService_PortType client = this.loadSmsClient();
return client.sendSmsMessage(context, phones);
}
public DeliverState[] findSmsMessageDelivers(String messageId) throws Exception {
SmsService_PortType client = this.loadSmsClient();
return client.findSmsMessageDelivers(messageId);
}
public MessageState[] findSmsMessageStates(String messageId) throws Exception {
SmsService_PortType client = this.loadSmsClient();
return client.findSmsMessageStates(messageId);
}
}
@@ -0,0 +1,48 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.ws;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.one.SmsService1_PortType;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.one.SmsService1_Service;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.client.one.SmsService1_ServiceLocator;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.DeliverState;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.MessageState;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.SendResult;
import java.net.URL;
public class SmsMessageSender1 {
private String url;
private String username;
private String password;
public SmsMessageSender1(String url, String username, String password) {
this.url = url;
this.username = username;
this.password = password;
}
private SmsService1_PortType loadSmsClient() throws Exception {
SmsService1_Service service = new SmsService1_ServiceLocator();
return service.getSmsService1Port(new URL(this.url));
}
public SendResult send(String context, String[] phones) throws Exception {
SmsService1_PortType client = this.loadSmsClient();
return client.sendSmsMessage(context, phones, this.username, this.password);
}
public DeliverState[] findSmsMessageDelivers(String messageId) throws Exception {
SmsService1_PortType client = this.loadSmsClient();
return client.findSmsMessageDelivers(messageId, this.username, this.password);
}
public MessageState[] findSmsMessageStates(String messageId) throws Exception {
SmsService1_PortType client = this.loadSmsClient();
return client.findSmsMessageStates(messageId, this.username, this.password);
}
}
@@ -0,0 +1,350 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.ws.client;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.*;
import org.apache.axis.AxisFault;
import org.apache.axis.NoEndPointException;
import org.apache.axis.client.Call;
import org.apache.axis.client.Stub;
import org.apache.axis.constants.Style;
import org.apache.axis.constants.Use;
import org.apache.axis.description.FaultDesc;
import org.apache.axis.description.OperationDesc;
import org.apache.axis.description.ParameterDesc;
import org.apache.axis.encoding.DeserializerFactory;
import org.apache.axis.encoding.ser.*;
import org.apache.axis.soap.SOAPConstants;
import org.apache.axis.utils.JavaUtils;
import javax.xml.namespace.QName;
import javax.xml.rpc.Service;
import javax.xml.rpc.encoding.SerializerFactory;
import java.net.URL;
import java.rmi.RemoteException;
import java.util.Enumeration;
import java.util.Vector;
public class SmsServicePortBindingStub extends Stub implements SmsService_PortType {
private Vector cachedSerClasses;
private Vector cachedSerQNames;
private Vector cachedSerFactories;
private Vector cachedDeserFactories;
static OperationDesc[] _operations = new OperationDesc[3];
private static void _initOperationDesc1() {
OperationDesc oper = new OperationDesc();
oper.setName("findSmsMessageDelivers");
ParameterDesc param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://api.ws.ucp.sudytech.com/", "deliverState"));
oper.setReturnClass(DeliverState[].class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://api.ws.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.ws.om.MessageException", new QName("http://api.ws.ucp.sudytech.com/", "MessageException"), true));
_operations[0] = oper;
oper = new OperationDesc();
oper.setName("sendSmsMessage");
param = new ParameterDesc(new QName("", "content"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
param = new ParameterDesc(new QName("", "addresses"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String[].class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://api.ws.ucp.sudytech.com/", "sendResult"));
oper.setReturnClass(SendResult.class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://api.ws.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.ws.om.MessageException", new QName("http://api.ws.ucp.sudytech.com/", "MessageException"), true));
_operations[1] = oper;
oper = new OperationDesc();
oper.setName("findSmsMessageStates");
param = new ParameterDesc(new QName("", "messageId"), (byte)1, new QName("http://www.w3.org/2001/XMLSchema", "string"), String.class, false, false);
oper.addParameter(param);
oper.setReturnType(new QName("http://api.ws.ucp.sudytech.com/", "messageState"));
oper.setReturnClass(MessageState[].class);
oper.setReturnQName(new QName("", "return"));
oper.setStyle(Style.WRAPPED);
oper.setUse(Use.LITERAL);
oper.addFault(new FaultDesc(new QName("http://api.ws.ucp.sudytech.com/", "MessageException"), "com.sudytech.ucp.ws.om.MessageException", new QName("http://api.ws.ucp.sudytech.com/", "MessageException"), true));
_operations[2] = oper;
}
public SmsServicePortBindingStub() throws AxisFault {
this((Service)null);
}
public SmsServicePortBindingStub(URL endpointURL, Service service) throws AxisFault {
this(service);
super.cachedEndpoint = endpointURL;
}
public SmsServicePortBindingStub(Service service) throws AxisFault {
this.cachedSerClasses = new Vector();
this.cachedSerQNames = new Vector();
this.cachedSerFactories = new Vector();
this.cachedDeserFactories = new Vector();
if (service == null) {
super.service = new org.apache.axis.client.Service();
} else {
super.service = service;
}
((org.apache.axis.client.Service)super.service).setTypeMappingVersion("1.2");
Class beansf = BeanSerializerFactory.class;
Class beandf = BeanDeserializerFactory.class;
Class enumsf = EnumSerializerFactory.class;
Class enumdf = EnumDeserializerFactory.class;
Class arraysf = ArraySerializerFactory.class;
Class arraydf = ArrayDeserializerFactory.class;
Class simplesf = SimpleSerializerFactory.class;
Class simpledf = SimpleDeserializerFactory.class;
Class simplelistsf = SimpleListSerializerFactory.class;
Class simplelistdf = SimpleListDeserializerFactory.class;
QName qName = new QName("http://api.ws.ucp.sudytech.com/", ">>messageState>properties>entry");
this.cachedSerQNames.add(qName);
Class cls = MessageStatePropertiesEntry.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://api.ws.ucp.sudytech.com/", ">messageState>properties");
this.cachedSerQNames.add(qName);
cls = MessageStateProperties.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://api.ws.ucp.sudytech.com/", "deliverState");
this.cachedSerQNames.add(qName);
cls = DeliverState.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://api.ws.ucp.sudytech.com/", "MessageException");
this.cachedSerQNames.add(qName);
cls = MessageException.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://api.ws.ucp.sudytech.com/", "messageState");
this.cachedSerQNames.add(qName);
cls = MessageState.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://api.ws.ucp.sudytech.com/", "sendResult");
this.cachedSerQNames.add(qName);
cls = SendResult.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
qName = new QName("http://api.ws.ucp.sudytech.com/", "wrongAddress");
this.cachedSerQNames.add(qName);
cls = WrongAddress.class;
this.cachedSerClasses.add(cls);
this.cachedSerFactories.add(beansf);
this.cachedDeserFactories.add(beandf);
}
protected Call createCall() throws RemoteException {
try {
Call _call = super._createCall();
if (super.maintainSessionSet) {
_call.setMaintainSession(super.maintainSession);
}
if (super.cachedUsername != null) {
_call.setUsername(super.cachedUsername);
}
if (super.cachedPassword != null) {
_call.setPassword(super.cachedPassword);
}
if (super.cachedEndpoint != null) {
_call.setTargetEndpointAddress(super.cachedEndpoint);
}
if (super.cachedTimeout != null) {
_call.setTimeout(super.cachedTimeout);
}
if (super.cachedPortName != null) {
_call.setPortName(super.cachedPortName);
}
Enumeration keys = super.cachedProperties.keys();
while(keys.hasMoreElements()) {
String key = (String)keys.nextElement();
_call.setProperty(key, super.cachedProperties.get(key));
}
synchronized(this) {
if (this.firstCall()) {
_call.setEncodingStyle((String)null);
for(int i = 0; i < this.cachedSerFactories.size(); ++i) {
Class cls = (Class)this.cachedSerClasses.get(i);
QName qName = (QName)this.cachedSerQNames.get(i);
Object x = this.cachedSerFactories.get(i);
if (x instanceof Class) {
Class sf = (Class)this.cachedSerFactories.get(i);
Class df = (Class)this.cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
} else if (x instanceof SerializerFactory) {
org.apache.axis.encoding.SerializerFactory sf = (org.apache.axis.encoding.SerializerFactory)this.cachedSerFactories.get(i);
DeserializerFactory df = (DeserializerFactory)this.cachedDeserFactories.get(i);
_call.registerTypeMapping(cls, qName, sf, df, false);
}
}
}
}
return _call;
} catch (Throwable var12) {
throw new AxisFault("Failure trying to get the Call object", var12);
}
}
public DeliverState[] findSmsMessageDelivers(String messageId) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://api.ws.ucp.sudytech.com/", "findSmsMessageDelivers"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (DeliverState[])((DeliverState[])_resp);
} catch (Exception var5) {
return (DeliverState[])((DeliverState[])JavaUtils.convert(_resp, DeliverState[].class));
}
}
} catch (AxisFault var6) {
if (var6.detail != null) {
if (var6.detail instanceof RemoteException) {
throw (RemoteException)var6.detail;
}
if (var6.detail instanceof MessageException) {
throw (MessageException)var6.detail;
}
}
throw var6;
}
}
}
public SendResult sendSmsMessage(String content, String[] addresses) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[1]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://api.ws.ucp.sudytech.com/", "sendSmsMessage"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{content, addresses});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (SendResult)_resp;
} catch (Exception var6) {
return (SendResult)JavaUtils.convert(_resp, SendResult.class);
}
}
} catch (AxisFault var7) {
if (var7.detail != null) {
if (var7.detail instanceof RemoteException) {
throw (RemoteException)var7.detail;
}
if (var7.detail instanceof MessageException) {
throw (MessageException)var7.detail;
}
}
throw var7;
}
}
}
public MessageState[] findSmsMessageStates(String messageId) throws RemoteException, MessageException {
if (super.cachedEndpoint == null) {
throw new NoEndPointException();
} else {
Call _call = this.createCall();
_call.setOperation(_operations[2]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("");
_call.setEncodingStyle((String)null);
_call.setProperty("sendXsiTypes", Boolean.FALSE);
_call.setProperty("sendMultiRefs", Boolean.FALSE);
_call.setSOAPVersion(SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new QName("http://api.ws.ucp.sudytech.com/", "findSmsMessageStates"));
this.setRequestHeaders(_call);
this.setAttachments(_call);
try {
Object _resp = _call.invoke(new Object[]{messageId});
if (_resp instanceof RemoteException) {
throw (RemoteException)_resp;
} else {
this.extractAttachments(_call);
try {
return (MessageState[])((MessageState[])_resp);
} catch (Exception var5) {
return (MessageState[])((MessageState[])JavaUtils.convert(_resp, MessageState[].class));
}
}
} catch (AxisFault var6) {
if (var6.detail != null) {
if (var6.detail instanceof RemoteException) {
throw (RemoteException)var6.detail;
}
if (var6.detail instanceof MessageException) {
throw (MessageException)var6.detail;
}
}
throw var6;
}
}
}
static {
_initOperationDesc1();
}
}
@@ -0,0 +1,22 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.ws.client;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.DeliverState;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.MessageException;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.MessageState;
import com.budwk.app.base.sms.impl.njupt.ucp.ws.om.SendResult;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface SmsService_PortType extends Remote {
DeliverState[] findSmsMessageDelivers(String var1) throws RemoteException, MessageException;
SendResult sendSmsMessage(String var1, String[] var2) throws RemoteException, MessageException;
MessageState[] findSmsMessageStates(String var1) throws RemoteException, MessageException;
}
@@ -0,0 +1,18 @@
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
package com.budwk.app.base.sms.impl.njupt.ucp.ws.client;
import javax.xml.rpc.Service;
import javax.xml.rpc.ServiceException;
import java.net.URL;
public interface SmsService_Service extends Service {
String getSmsServicePortAddress();
SmsService_PortType getSmsServicePort() throws ServiceException;
SmsService_PortType getSmsServicePort(URL var1) throws ServiceException;
}

Some files were not shown because too many files have changed in this diff Show More