Parcourir la source

医生端健康教育需求完善

il y a 8 ans
Parent
commit
0e6f872904

+ 4 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -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,13 @@ 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());
			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){
				//将文章更新为已读