新增发红包&企业付款&批量执行任务接口

This commit is contained in:
jinyu
2015-04-01 20:04:49 +08:00
parent 464359ae7a
commit 92037c567a
38 changed files with 1732 additions and 187 deletions
+5 -1
View File
@@ -51,4 +51,8 @@ weixin4j-base
* 2015-03-29
+ 单行注释调整为多行文档注释
+ 单行注释调整为多行文档注释
* 2015-04-01
+ 新增异步消息事件BatchjobresultMessage(./src/main/java/com/foxinmy/weixin4j/msg/event/BatchjobresultMessage.java)
@@ -0,0 +1,99 @@
package com.foxinmy.weixin4j.msg.event;
import java.io.Serializable;
import com.foxinmy.weixin4j.type.EventType;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
* 异步任务事件完成通知
*
* @className BatchjobresultMessage
* @author jy
* @date 2015年3月31日
* @since JDK 1.7
* @see <a
* href="http://qydev.weixin.qq.com/wiki/index.php?title=%E6%8E%A5%E6%94%B6%E4%BA%8B%E4%BB%B6#.E5.BC.82.E6.AD.A5.E4.BB.BB.E5.8A.A1.E5.AE.8C.E6.88.90.E4.BA.8B.E4.BB.B6.E6.8E.A8.E9.80.81">异步任务事件完成通知</a>
*/
public class BatchjobresultMessage extends EventMessage {
private static final long serialVersionUID = 8014540441322209657L;
public BatchjobresultMessage() {
super(EventType.batch_job_result);
}
/**
* 任务信息
*/
@XStreamAlias("BatchJob")
private BatchJob batchJob;
public BatchJob getBatchJob() {
return batchJob;
}
/**
* 任务信息
*
* @className BatchJob
* @author jy
* @date 2015年4月1日
* @since JDK 1.7
* @see
*/
public static class BatchJob implements Serializable {
private static final long serialVersionUID = -7520032656787156391L;
/**
* 异步任务id,最大长度为64字符
*/
@XStreamAlias("JobId")
private String jobId;
/**
* 操作类型,字符串,目前分别有: 1. sync_user(增量更新成员) 2. replace_user(全量覆盖成员) 3.
* invite_user(邀请成员关注) 4. replace_party(全量覆盖部门)
*
* @see com.foxinmy.weixin4j.qy.type.BatchType
*/
@XStreamAlias("JobType")
private String jobType;
/**
* 返回码
*/
@XStreamAlias("ErrCode")
private String ErrCode;
/**
* 对返回码的文本描述内容
*/
@XStreamAlias("ErrMsg")
private String errMsg;
public String getJobId() {
return jobId;
}
public String getJobType() {
return jobType;
}
public String getErrCode() {
return ErrCode;
}
public String getErrMsg() {
return errMsg;
}
@Override
public String toString() {
return "[jobId=" + jobId + ", jobType=" + jobType + ", ErrCode="
+ ErrCode + ", errMsg=" + errMsg + "]";
}
}
@Override
public String toString() {
return "BatchjobresultMessage [batchJob=" + batchJob + ", "
+ super.toString() + "]";
}
}
@@ -1,5 +1,6 @@
package com.foxinmy.weixin4j.type;
import com.foxinmy.weixin4j.msg.event.BatchjobresultMessage;
import com.foxinmy.weixin4j.msg.event.EnterAgentEventMessage;
import com.foxinmy.weixin4j.msg.event.EventMessage;
import com.foxinmy.weixin4j.msg.event.KfCloseEventMessage;
@@ -132,7 +133,13 @@ public enum EventType {
*
* @see com.foxinmy.weixin4j.msg.event.KfSwitchEventMessage
*/
kf_switch_session(KfSwitchEventMessage.class);
kf_switch_session(KfSwitchEventMessage.class),
/**
* 异步任务完成事件
*
* @see com.foxinmy.weixin4j.msg.event.BatchjobresultMessage
*/
batch_job_result(BatchjobresultMessage.class);
private Class<? extends EventMessage> eventClass;
@@ -46,7 +46,10 @@ public class Map2ObjectConverter extends MapConverter {
MarshallingContext context) {
Map<?, ?> map = (Map<?, ?>) source;
for (Entry<?, ?> entry : map.entrySet()) {
String value = (String) entry.getValue();
if (entry.getValue() == null) {
continue;
}
String value = entry.getValue().toString();
if (StringUtils.isBlank(value)) {
continue;
}
@@ -54,6 +57,7 @@ public class Map2ObjectConverter extends MapConverter {
.getKey().toString(), entry.getClass());
writer.setValue(value);
writer.endNode();
}
}
}