|
|
|
@ -86,9 +86,20 @@ public class WxMessageServiceImpl implements IMessageService {
|
|
|
|
|
PushTemplate template = new PushTemplate(); |
|
|
|
|
template.setTemplateId(message.getTemplateId()); |
|
|
|
|
template.setSkipUrl(message.getSkipUrl()); |
|
|
|
|
template.setMap(message.getMap()); |
|
|
|
|
Map<String, Object> map = message.getMap(); |
|
|
|
|
map.replaceAll((key,value)->getTruncateString(value.toString(),27)); |
|
|
|
|
template.setMap(map); |
|
|
|
|
template.setUserIds(Arrays.stream(message.getUserIds().split(",")).collect(Collectors.toList())); |
|
|
|
|
template.setTenantId("200000"); |
|
|
|
|
R<WxPushFeignVO> result = wxPushClient.sendPushTemplateByUserId(template); |
|
|
|
|
return result.isSuccess(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getTruncateString(String ruleDefName, int maxSize) { |
|
|
|
|
if (ruleDefName.length()<= maxSize){ |
|
|
|
|
return ruleDefName; |
|
|
|
|
}else { |
|
|
|
|
return ruleDefName.substring(0, maxSize - 3) + "..."; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|