|
@@ -1,6 +1,7 @@
|
|
|
package com.uas.service.donate.service.impl;
|
|
package com.uas.service.donate.service.impl;
|
|
|
|
|
|
|
|
import com.uas.account.util.AccountUtils;
|
|
import com.uas.account.util.AccountUtils;
|
|
|
|
|
+import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.PageInfo;
|
|
import com.uas.platform.core.model.PageInfo;
|
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
import com.uas.platform.core.persistence.criteria.PredicateUtils;
|
|
|
import com.uas.service.donate.core.support.SystemSession;
|
|
import com.uas.service.donate.core.support.SystemSession;
|
|
@@ -11,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
+import org.springframework.ui.ModelMap;
|
|
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
@@ -177,4 +179,28 @@ public class UserServiceImpl implements UserService {
|
|
|
}
|
|
}
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 设置消息已读
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param mdId 消息详情id
|
|
|
|
|
+ * @return 处理结果
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public ModelMap setRead(Long mdId) {
|
|
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
|
|
+ MessageDetail detail = messageDetailDao.findOne(mdId);
|
|
|
|
|
+ if (null == detail) {
|
|
|
|
|
+ map.put("error", "未找到对应消息记录");
|
|
|
|
|
+ return map;
|
|
|
|
|
+ }
|
|
|
|
|
+ detail.setReadStatus(Constant.YES);
|
|
|
|
|
+ messageDetailDao.save(detail);
|
|
|
|
|
+ // 修改阅读人数
|
|
|
|
|
+ Message message = detail.getMessage();
|
|
|
|
|
+ message.setReaderNum(message.getReaderNum() != null ? message.getReaderNum() + 1 : 1);
|
|
|
|
|
+ messageDao.save(message);
|
|
|
|
|
+ map.put("success", "成功设为已读");
|
|
|
|
|
+ return map;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|