|
@@ -27,6 +27,7 @@ import java.time.LocalDateTime;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -75,7 +76,7 @@ public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, M
|
|
|
@Override
|
|
|
public JSONObject sendWeChatMessage(@RequestBody SendWeChatMessageRequestVO requestVO) {
|
|
|
|
|
|
- String infoType = sysDictDataService.selectDictLabel("message_type",requestVO.getInfoType());
|
|
|
+// String infoTypeName = sysDictDataService.selectDictLabel("message_type",requestVO.getInfoType());
|
|
|
String infoTitle = requestVO.getInfoTitle();
|
|
|
String infoContent = requestVO.getInfoContent();
|
|
|
Integer infoId = requestVO.getInfoId();
|
|
@@ -110,10 +111,16 @@ public class MceMbuserServiceImpl extends AbstractCrudService<MceMbuserMapper, M
|
|
|
TemplateMsgEntityVO messageVo=new TemplateMsgEntityVO();
|
|
|
messageVo.setTTitle(infoTitle);
|
|
|
messageVo.setTKeyword1(infoContent);
|
|
|
- messageVo.setTKeyword2(infoType);
|
|
|
messageVo.setTKeyword3(LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
|
|
|
messageVo.setTRemark(infoContent);
|
|
|
- messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL,infoType,infoId));
|
|
|
+ if(Objects.nonNull(requestVO.getInfoTypeName())){
|
|
|
+ messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL,requestVO.getInfoType(),requestVO.getInfoTypeName(),infoId));
|
|
|
+ messageVo.setTKeyword2(requestVO.getInfoTypeName());
|
|
|
+ }else{
|
|
|
+ messageVo.setTUrl(String.format(constant.WE_CHAT_CUSTOMER_CALL_URL1,requestVO.getInfoType(),infoId));
|
|
|
+ messageVo.setTKeyword2("");
|
|
|
+ }
|
|
|
+
|
|
|
messageVo.setTemplateId(constant.WE_CHAT_TEMPLATE_ID);
|
|
|
|
|
|
String requestUrl = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + token;
|