|
|
@ -4,11 +4,17 @@ import com.hfkj.dao.BsMessageReadMapper; |
|
|
|
import com.hfkj.entity.BsMessageRead; |
|
|
|
import com.hfkj.entity.BsMessageRead; |
|
|
|
import com.hfkj.entity.BsMessageReadExample; |
|
|
|
import com.hfkj.entity.BsMessageReadExample; |
|
|
|
import com.hfkj.service.message.BsMessageReadService; |
|
|
|
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 org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @className: BsMessageReadServiceImpl |
|
|
|
* @className: BsMessageReadServiceImpl |
|
|
@ -19,6 +25,8 @@ import java.util.List; |
|
|
|
public class BsMessageReadServiceImpl implements BsMessageReadService { |
|
|
|
public class BsMessageReadServiceImpl implements BsMessageReadService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private BsMessageReadMapper messageReadMapper; |
|
|
|
private BsMessageReadMapper messageReadMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
|
|
private BsMessageService messageService; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void editData(BsMessageRead data) { |
|
|
|
public void editData(BsMessageRead data) { |
|
|
@ -40,4 +48,27 @@ public class BsMessageReadServiceImpl implements BsMessageReadService { |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|