|
@ -27,6 +27,7 @@ import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
@ -110,12 +111,16 @@ public class HealthEduArticleController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "article")
|
|
|
@ResponseBody
|
|
|
public String article(@RequestParam(value = "article",required = true) long id) {
|
|
|
public String article(@RequestParam(value = "article",required = true) String article) {
|
|
|
try {
|
|
|
//获取单条文章记录
|
|
|
HealthEduArticlePatient healthEduArticlePatient = healthEduArticlePatientService.findById(id);
|
|
|
List<HealthEduArticlePatient> healthEduArticlePatients = healthEduArticlePatientService.findByArticleAndPatient(article,getUID());
|
|
|
if(healthEduArticlePatients==null||healthEduArticlePatients.size()==0){
|
|
|
return error(-2,"对不起,该消息不是您的消息,您无法查看哦~");
|
|
|
}
|
|
|
int isRead = healthEduArticleOpHistoryService.countByUserStatus(getUID(),HealthEduArticleOpHistory.READ_STATUS);
|
|
|
//插入文章读取状态第一次阅读记录浏览数量//暂时更新每次都算一次浏览量
|
|
|
HealthEduArticlePatient healthEduArticlePatient = healthEduArticlePatients.get(0);
|
|
|
healthEduArticleOpHistoryService.saveByStatus(HealthEduArticleOpHistory.READ_STATUS,healthEduArticlePatient.getArticle(),healthEduArticlePatient.getTitle(),getUID());
|
|
|
if(isRead==0){
|
|
|
//将文章更新为已读
|