|
|
@@ -1,5 +1,6 @@
|
|
|
package com.goafanti.message.service.impl;
|
|
|
|
|
|
+import java.lang.reflect.InvocationTargetException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
|
@@ -8,6 +9,7 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
+import org.apache.commons.beanutils.BeanUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -16,11 +18,13 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import com.goafanti.app.bo.IndexBo;
|
|
|
import com.goafanti.common.dao.JpushEasemobAccountMapper;
|
|
|
+import com.goafanti.common.dao.JtMessageConsumerMapper;
|
|
|
import com.goafanti.common.dao.JtMessageProducerMapper;
|
|
|
import com.goafanti.common.dao.MessageFromSystemMapper;
|
|
|
import com.goafanti.common.dao.MessageProducerMapper;
|
|
|
import com.goafanti.common.model.Admin;
|
|
|
import com.goafanti.common.model.JpushEasemobAccount;
|
|
|
+import com.goafanti.common.model.JtMessageConsumer;
|
|
|
import com.goafanti.common.model.JtMessageProducer;
|
|
|
import com.goafanti.common.model.MessageConsumer;
|
|
|
import com.goafanti.common.model.MessageFromSystem;
|
|
|
@@ -30,6 +34,7 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.message.JGMessageHelper;
|
|
|
+import com.goafanti.message.bo.AppMessageBo;
|
|
|
import com.goafanti.message.bo.MessageBo;
|
|
|
import com.goafanti.message.bo.MessageListBo;
|
|
|
import com.goafanti.message.enums.ConsumerType;
|
|
|
@@ -47,8 +52,11 @@ public class MessageServiceImpl extends BaseMybatisDao<MessageFromSystemMapper>
|
|
|
private JpushEasemobAccountMapper jpushEasemobAccountMapper;
|
|
|
@Autowired
|
|
|
private JGMessageHelper jgMessageHelper;
|
|
|
+
|
|
|
@Autowired
|
|
|
private JtMessageProducerMapper jtMessageProducerMapper;
|
|
|
+ @Autowired
|
|
|
+ private JtMessageConsumerMapper jtMessageConsumerMapper;
|
|
|
@Override
|
|
|
public String selectSendUser(Map<Integer, String> selectMap,Integer type) {
|
|
|
if(selectMap.containsKey(ConsumerType.PERSON_CUSTOMER_RETAIL.getTypeCode())){ //客户散户
|
|
|
@@ -433,23 +441,38 @@ public class MessageServiceImpl extends BaseMybatisDao<MessageFromSystemMapper>
|
|
|
return jpushEasemobAccountMapper.insert(jea);
|
|
|
}
|
|
|
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
+ @Override
|
|
|
+ public Pagination<AppMessageBo> applistMessage(Integer pageNo, Integer pageSize) {
|
|
|
+ Map<String,Object> params = new HashMap<String,Object>();
|
|
|
+ if(null==pageNo||pageNo<1)pageNo=1;
|
|
|
+ if(null==pageSize||pageSize<1)pageSize=10;
|
|
|
+ params.put("uid", TokenManager.getUserId());
|
|
|
+ //params.put("uid", "2160baeb-8ea4-4192-a6f4-fccf8738e248");
|
|
|
+ return (Pagination<AppMessageBo>)findPage("appMessageList", "appMessageCount", params, pageNo, pageSize);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public AppMessageBo updateAppReadMessage(String id) {
|
|
|
+ JtMessageConsumer mc=new JtMessageConsumer();
|
|
|
+ mc.setId(id);
|
|
|
+ mc.setIsRead(true);
|
|
|
+ jtMessageConsumerMapper.updateByPrimaryKeySelective(mc);
|
|
|
+ return jtMessageConsumerMapper.selectById(id);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public int addMessage(JtMessageProducer messageProducer) {
|
|
|
- //处理消息内容
|
|
|
- messageProducer.setId(UUID.randomUUID().toString());
|
|
|
- messageProducer.setCreater(TokenManager.getUserId());
|
|
|
- if(null != messageProducer.getCreateTime()){
|
|
|
- messageProducer.setCreateTime(new Date());
|
|
|
- }
|
|
|
- return jtMessageProducerMapper.insertSelective(messageProducer);
|
|
|
+ // TODO Auto-generated method stub
|
|
|
+ return 0;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public int sendMessage(String messageId) {
|
|
|
- // 获得所有正常使用的注册用户
|
|
|
- //List<JtMessageProducer> list =
|
|
|
+ // TODO Auto-generated method stub
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
|
|
|
}
|