Commit 50661e09266f963ec1dff624a642f743e51390f0
Merge remote-tracking branch 'origin/test'
Showing
3 changed files
with
12 additions
and
5 deletions
fw-hermes-sdk/src/main/java/cn/fw/hermes/sdk/api/para/MsgParamCondition.java
1 | package cn.fw.hermes.sdk.api.para; | 1 | package cn.fw.hermes.sdk.api.para; |
2 | 2 | ||
3 | +import lombok.Data; | ||
4 | +import org.springframework.util.CollectionUtils; | ||
3 | import java.math.BigDecimal; | 5 | import java.math.BigDecimal; |
4 | import java.util.List; | 6 | import java.util.List; |
5 | import java.util.Map; | 7 | import java.util.Map; |
6 | -import lombok.Data; | ||
7 | -import org.springframework.util.CollectionUtils; | ||
8 | 8 | ||
9 | /** | 9 | /** |
10 | * @author 张志伟 | 10 | * @author 张志伟 |
@@ -64,7 +64,7 @@ public class MsgParamCondition { | @@ -64,7 +64,7 @@ public class MsgParamCondition { | ||
64 | /** | 64 | /** |
65 | * 消息接收人是否为业务人员 | 65 | * 消息接收人是否为业务人员 |
66 | */ | 66 | */ |
67 | - private Boolean isStaff; | 67 | + private Boolean isStaff = true; |
68 | 68 | ||
69 | /** | 69 | /** |
70 | * 消息唯一ID | 70 | * 消息唯一ID |
@@ -216,6 +216,7 @@ public class MsgParamCondition { | @@ -216,6 +216,7 @@ public class MsgParamCondition { | ||
216 | title = title == null ? "" : title; | 216 | title = title == null ? "" : title; |
217 | customContent.setData(title); | 217 | customContent.setData(title); |
218 | customContent.setDesc(desc); | 218 | customContent.setDesc(desc); |
219 | + customContent.setExt(ext); | ||
219 | lifeTime = lifeTime == null ? 604800 : lifeTime; | 220 | lifeTime = lifeTime == null ? 604800 : lifeTime; |
220 | if (lifeTime / 604800 > 0) { | 221 | if (lifeTime / 604800 > 0) { |
221 | lifeTime = 604800; | 222 | lifeTime = 604800; |
@@ -237,6 +238,7 @@ public class MsgParamCondition { | @@ -237,6 +238,7 @@ public class MsgParamCondition { | ||
237 | return builder; | 238 | return builder; |
238 | } | 239 | } |
239 | 240 | ||
241 | + | ||
240 | public static Builder newBuilder() { | 242 | public static Builder newBuilder() { |
241 | return new Builder(); | 243 | return new Builder(); |
242 | } | 244 | } |
@@ -254,6 +256,7 @@ public class MsgParamCondition { | @@ -254,6 +256,7 @@ public class MsgParamCondition { | ||
254 | private Integer msgLifeTime; | 256 | private Integer msgLifeTime; |
255 | private Long userId; | 257 | private Long userId; |
256 | private BusinessType businessType; | 258 | private BusinessType businessType; |
259 | + private Boolean isStaff; | ||
257 | 260 | ||
258 | 261 | ||
259 | public Builder setMsgType(MsgTypeEnum msgType) { | 262 | public Builder setMsgType(MsgTypeEnum msgType) { |
@@ -316,6 +319,10 @@ public class MsgParamCondition { | @@ -316,6 +319,10 @@ public class MsgParamCondition { | ||
316 | return this; | 319 | return this; |
317 | } | 320 | } |
318 | 321 | ||
322 | + public Builder setIsStaff(Boolean isStaff) { | ||
323 | + this.isStaff = isStaff; | ||
324 | + return this; | ||
325 | + } | ||
319 | public MsgParamCondition build() { | 326 | public MsgParamCondition build() { |
320 | if (CollectionUtils.isEmpty(contentList)) { | 327 | if (CollectionUtils.isEmpty(contentList)) { |
321 | unitMsg = false; | 328 | unitMsg = false; |
fw-hermes-server/src/main/java/cn/fw/hermes/task/SendMessageTask.java
@@ -106,8 +106,7 @@ public class SendMessageTask { | @@ -106,8 +106,7 @@ public class SendMessageTask { | ||
106 | if (!StringUtils.isEmpty(sysMsgStr)) { | 106 | if (!StringUtils.isEmpty(sysMsgStr)) { |
107 | SysMsg sysMsg = JSON.parseObject(sysMsgStr, SysMsg.class); | 107 | SysMsg sysMsg = JSON.parseObject(sysMsgStr, SysMsg.class); |
108 | if (sysMsg.getRetriesNum() < 3) { | 108 | if (sysMsg.getRetriesNum() < 3) { |
109 | - log.info("{} 失败 进行第 {} 次重试,messageId[{}]", msg, sysMsg.getRetriesNum() + 1, | ||
110 | - sysMsg.getMessageId()); | 109 | + log.info("{} 失败 进行第 {} 次重试,messageId[{}]", msg, sysMsg.getRetriesNum() + 1, sysMsg.getMessageId()); |
111 | sysMsg.setRetriesNum(sysMsg.getRetriesNum() + 1); | 110 | sysMsg.setRetriesNum(sysMsg.getRetriesNum() + 1); |
112 | messageBizService.saveMsg(sysMsg); | 111 | messageBizService.saveMsg(sysMsg); |
113 | } else { | 112 | } else { |
fw-hermes-service/src/main/java/cn/fw/hermes/service/biz/MessageBizService.java
@@ -172,6 +172,7 @@ public class MessageBizService { | @@ -172,6 +172,7 @@ public class MessageBizService { | ||
172 | BV.isTrue(msgBodyDto.getMsgBody() != null, "消息内容不合法"); | 172 | BV.isTrue(msgBodyDto.getMsgBody() != null, "消息内容不合法"); |
173 | //如果消息是自定义消息,则检查对应的消息业务类型是否存在 | 173 | //如果消息是自定义消息,则检查对应的消息业务类型是否存在 |
174 | if (msgBodyDto.getMsgTypeEnum().getCode().equals(MsgTypeEnum.CUSTOM.getCode())) { | 174 | if (msgBodyDto.getMsgTypeEnum().getCode().equals(MsgTypeEnum.CUSTOM.getCode())) { |
175 | + BV.notNull(msgPara.getCustomContent().getExt(),"扩展字段参数不能为空"); | ||
175 | this.checkExt(msgPara); | 176 | this.checkExt(msgPara); |
176 | } | 177 | } |
177 | //获取发送方用户识别码 | 178 | //获取发送方用户识别码 |