|
|
|
@ -4,17 +4,11 @@ import com.hfkj.dao.BsMessageReadMapper; |
|
|
|
|
import com.hfkj.entity.BsMessageRead; |
|
|
|
|
import com.hfkj.entity.BsMessageReadExample; |
|
|
|
|
import com.hfkj.service.message.BsMessageReadService; |
|
|
|
|
import com.hfkj.service.message.BsMessageService; |
|
|
|
|
import com.hfkj.sysenum.message.MessageStatusEnum; |
|
|
|
|
import com.hfkj.sysenum.message.MessageTypeEnum; |
|
|
|
|
import org.apache.commons.collections4.MapUtils; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
|
import java.util.Date; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @className: BsMessageReadServiceImpl |
|
|
|
@ -25,8 +19,6 @@ import java.util.Map; |
|
|
|
|
public class BsMessageReadServiceImpl implements BsMessageReadService { |
|
|
|
|
@Resource |
|
|
|
|
private BsMessageReadMapper messageReadMapper; |
|
|
|
|
@Resource |
|
|
|
|
private BsMessageService messageService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void editData(BsMessageRead data) { |
|
|
|
@ -48,27 +40,4 @@ public class BsMessageReadServiceImpl implements BsMessageReadService { |
|
|
|
|
} |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void read(Long userId, MessageTypeEnum messageType) { |
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
|
param.put("userId", userId); |
|
|
|
|
param.put("type", messageType.getType()); |
|
|
|
|
param.put("status", MessageStatusEnum.status2.getStatus()); |
|
|
|
|
// 未读
|
|
|
|
|
param.put("readStatus", 0); |
|
|
|
|
|
|
|
|
|
// 查询数据
|
|
|
|
|
List<Map<String, Object>> list = messageService.getUserMsgList(param); |
|
|
|
|
for (Map<String,Object> map : list) { |
|
|
|
|
if (MapUtils.getLong(map, "id") != null) { |
|
|
|
|
// 已读
|
|
|
|
|
BsMessageRead messageRead = new BsMessageRead(); |
|
|
|
|
messageRead.setMessageId(MapUtils.getLong(map, "id")); |
|
|
|
|
messageRead.setUserId(userId); |
|
|
|
|
messageRead.setStatus(1); |
|
|
|
|
editData(messageRead); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|