审批中心消息推送
This commit is contained in:
@@ -23,6 +23,8 @@ import com.yxt.messagecenter.biz.messagelist.MessageListService;
|
||||
import com.yxt.messagecenter.biz.messagetype.MessageTypeService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.YamlPropertiesFactoryBean;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
@@ -264,13 +266,27 @@ public class MessageService extends MybatisBaseService<MessageMapper, Message> {
|
||||
}
|
||||
executor.shutdown();
|
||||
//标题、内容、消息类别key、消息类别名称、
|
||||
for (int i = 0; i < receiveIdList.size(); i++) {
|
||||
/**
|
||||
* msgTitle:排产申请
|
||||
* content:xxx的排产申请
|
||||
*/
|
||||
JPushServer.sendPushAlias(msgTitle, msgContent, msgTypeSid, "审批中心", receiveIdList.get(i));
|
||||
YamlPropertiesFactoryBean factoryBean = new YamlPropertiesFactoryBean();
|
||||
factoryBean.setResources(new ClassPathResource("application.yml"));
|
||||
Properties properties = factoryBean.getObject();
|
||||
if ("pro".equals(properties.get("spring.profiles.active"))) {
|
||||
for (int i = 0; i < receiveIdList.size(); i++) {
|
||||
/**
|
||||
* msgTitle:排产申请
|
||||
* content:xxx的排产申请
|
||||
*/
|
||||
JPushServer.sendPushAlias(msgTitle, msgContent, msgTypeSid, "审批中心", receiveIdList.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < receiveIdList.size(); i++) {
|
||||
/**
|
||||
* msgTitle:排产申请
|
||||
* content:xxx的排产申请
|
||||
*/
|
||||
JPushServer.sendPushAlias(msgTitle, msgContent, msgTypeSid, "审批中心", "T" + receiveIdList.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
return rb.success().setData(msgSid);
|
||||
}
|
||||
|
||||
@@ -324,4 +340,17 @@ public class MessageService extends MybatisBaseService<MessageMapper, Message> {
|
||||
String msgSid = stringResultBean.getData();
|
||||
return rb.success().setMsg(msgSid);
|
||||
}
|
||||
|
||||
public static void main(String[] arg0) {
|
||||
YamlPropertiesFactoryBean factoryBean = new YamlPropertiesFactoryBean();
|
||||
factoryBean.setResources(new ClassPathResource("application.yml"));
|
||||
Properties properties = factoryBean.getObject();
|
||||
if ("pro".equals(properties.get("spring.profiles.active"))) {
|
||||
System.out.println("====pro");
|
||||
} else {
|
||||
System.out.println("====devv");
|
||||
}
|
||||
// properties.keySet().forEach(key -> System.out.println(key + "=====" + properties.get(key)));
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user