Quellcode durchsuchen

Merge branch 'dev' of linzhuo/patient-co-management into dev

sand vor 8 Jahren
Ursprung
Commit
a8a418e16c

+ 84 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/education/HealthEduArticleOpHistory.java

@ -0,0 +1,84 @@
package com.yihu.wlyy.entity.education;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * 健康教育文章操作历史表
 * @author linz
 *
 */
@Entity
@Table(name = "wlyy_health_edu_article_op_history")
public class HealthEduArticleOpHistory extends IdEntity {
	// 文章标识
	private String code;
	// 文章标题
	private String title;
	// 操作类型1.阅读 2.收藏 3.转发
	private String status;
	// 操作人
	private String creater;
	// 发布时间
	private Date createdTime;
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getCreater() {
		return creater;
	}
	public void setCreater(String creater) {
		this.creater = creater;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public Date getCreatedTime() {
		return createdTime;
	}
	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}
	/**
	 * 阅读状态
	 */
	public static final String READ_STATUS ="1";
	/**
	 * 收藏状态
	 */
	public static final String COLLECTION_STATUS ="2";
	/**
	 * 转发状态
	 */
	public static final String REPEAT_STATUS ="3";
}

+ 16 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/education/HealthEduArticleOpHistoryDao.java

@ -0,0 +1,16 @@
package com.yihu.wlyy.repository.education;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface HealthEduArticleOpHistoryDao extends PagingAndSortingRepository<HealthEduArticleOpHistory, Long>, JpaSpecificationExecutor<HealthEduArticleOpHistory> {
	@Query("select count(1) from HealthEduArticleOpHistory a where a.code = ?1 and a.status = ?2")
	int countByCodeStatus(String code,String status);
	@Query("select count(1) from HealthEduArticleOpHistory a where a.creater = ?1 and a.status = ?2")
	int countByUserStatus(String user,String status);
}

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/education/HealthEduArticlePatientDao.java

@ -7,10 +7,16 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import java.util.List;
public interface HealthEduArticlePatientDao extends PagingAndSortingRepository<HealthEduArticlePatient, Long>, JpaSpecificationExecutor<HealthEduArticlePatient> {
	// 更新为已读
	@Modifying
	@Query("update HealthEduArticlePatient a set a.read = 0 where a.patient = ?1 and a.article = ?2 ")
	int updateRead(String patient, String article);
	HealthEduArticlePatient findByArticle(String article);
	List<HealthEduArticlePatient> findByArticleAndPatient(String article,String patient);
}

+ 89 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleOpHistoryService.java

@ -0,0 +1,89 @@
package com.yihu.wlyy.service.app.health;
import com.yihu.wlyy.entity.IdEntity;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import com.yihu.wlyy.repository.education.HealthEduArticleOpHistoryDao;
import com.yihu.wlyy.repository.education.HealthEduArticlePatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.persistence.SearchFilter.Operator;
import java.util.HashMap;
import java.util.Map;
/**
 * 健康教育患者业务逻辑类
 * @author linz
 *
 */
@Component
@Transactional(rollbackFor = Exception.class)
public class HealthEduArticleOpHistoryService extends BaseService {
	@Autowired
	private HealthEduArticleOpHistoryDao healthEduArticleOpHistoryDao;
	/**
	 * 汇总阅读量
	 * @param code
	 * @return
	 */
	public  int countReadAmount(String code){
		return healthEduArticleOpHistoryDao.countByCodeStatus(code,HealthEduArticleOpHistory.READ_STATUS);
	}
	/**
	 * 汇总转发量
	 * @param code
	 * @return
	 */
	public int countRepeatAmount(String code){
		return healthEduArticleOpHistoryDao.countByCodeStatus(code,HealthEduArticleOpHistory.COLLECTION_STATUS);
	}
	/**
	 * 获取收藏量
	 * @param code
	 * @return
	 */
	public  int countCollectionAmount(String code){
		return healthEduArticleOpHistoryDao.countByCodeStatus(code,HealthEduArticleOpHistory.REPEAT_STATUS);
	}
	public int countByUserStatus(String user,String status){
		return healthEduArticleOpHistoryDao.countByCodeStatus(user,status);
	}
	/**
	 *
	 * @param status 状态
	 * @param code 文章编号
	 * @param title 文章标题
	 * @param user 操作人
	 * @return
	 */
	public HealthEduArticleOpHistory saveByStatus(String status,String code,String title,String user){
		HealthEduArticleOpHistory healthEduArticleOpHistory = new HealthEduArticleOpHistory();
		healthEduArticleOpHistory.setCode(code);
		healthEduArticleOpHistory.setCreatedTime(DateUtil.getNow());
		healthEduArticleOpHistory.setStatus(status);
		healthEduArticleOpHistory.setTitle(title);
		healthEduArticleOpHistory.setCreater(user);
		healthEduArticleOpHistory.setId(0L);
		healthEduArticleOpHistoryDao.save(healthEduArticleOpHistory);
		return healthEduArticleOpHistory;
	}
}

+ 96 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticlePatientService.java

@ -0,0 +1,96 @@
package com.yihu.wlyy.service.app.health;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import com.yihu.wlyy.repository.education.HealthEduArticleDao;
import com.yihu.wlyy.repository.education.HealthEduArticlePatientDao;
import com.yihu.wlyy.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springside.modules.persistence.DynamicSpecifications;
import org.springside.modules.persistence.SearchFilter;
import org.springside.modules.persistence.SearchFilter.Operator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
/**
 * 健康教育患者业务逻辑类
 * @author linz
 *
 */
@Component
@Transactional(rollbackFor = Exception.class)
public class HealthEduArticlePatientService extends BaseService {
	@Autowired
	private HealthEduArticlePatientDao healthEduArticlePatientDao;
	/**
	 * 根据文章标示获取数据
	 * @param article
	 * @return
	 *
	 */
	@Deprecated
	public HealthEduArticlePatient findByArticle(String article) {
		return healthEduArticlePatientDao.findByArticle(article);
	}
	/**
	 * 根据文章id获取数据
	 * @param id
	 * @return
	 */
	public HealthEduArticlePatient findById(Long id) {
		return healthEduArticlePatientDao.findOne(id);
	}
	public List<HealthEduArticlePatient> findByArticleAndPatient(String article,String patient) {
		return healthEduArticlePatientDao.findByArticleAndPatient(article, patient);
	}
	/**
	 * 查询患者文章
	 * @param patient 患者标识
	 * @param pagesize 分页大小
	 * @return
	 */
	public Page<HealthEduArticlePatient> findByPatient(String patient, long id, int pagesize) {
		if (pagesize <= 0) {
			pagesize = 10;
		}
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		// 设置查询条件
		Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
		// 患者过滤
		filters.put("patient", new SearchFilter("patient", Operator.EQ, patient));
		if (id > 0) {
			filters.put("id", new SearchFilter("id", Operator.LT, id));
		}
		Specification<HealthEduArticlePatient> spec = DynamicSpecifications.bySearchFilter(filters.values(), HealthEduArticlePatient.class);
		return healthEduArticlePatientDao.findAll(spec, pageRequest);
	}
	/**
	 * 文章更新为已读
	 * @param patient
	 * @param article
	 * @return
	 */
	public int updateRead(String patient, String article) {
		return healthEduArticlePatientDao.updateRead(patient, article);
	}
}

+ 20 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java

@ -1,10 +1,11 @@
package com.yihu.wlyy.service.app.health;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.io.File;
import java.util.*;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.patient.PatientHealthRecordMedication;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
@ -36,6 +37,8 @@ public class HealthEduArticleService extends BaseService {
	private HealthEduArticleDao healthEduArticleDao;
	@Autowired
	private HealthEduArticlePatientDao healthEduArticlePatientDao;
	@Autowired
	private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
	/**
	 * 查询文章信息
@ -52,20 +55,23 @@ public class HealthEduArticleService extends BaseService {
	 * @param pagesize 分页大小
	 * @return 列表
	 */
	public Page<HealthEduArticle> findAll(long id, int pagesize) {
	public Page<HealthEduArticle> findAll(int page, int pagesize,String filter) {
		if (pagesize <= 0) {
			pagesize = 10;
		}
		if(page<0){
			page = 0;
		}
		// 排序
		Sort sort = new Sort(Direction.DESC, "id");
		// 分页信息
		PageRequest pageRequest = new PageRequest(0, pagesize, sort);
		PageRequest pageRequest = new PageRequest(page, pagesize, sort);
		// 设置查询条件
		Map<String, SearchFilter> filters = new HashMap<String, SearchFilter>();
		if (id > 0) {
			filters.put("id", new SearchFilter("id", Operator.LT, id));
		if (StringUtils.isNotBlank(filter)) {
			filters.put("title", new SearchFilter("filter", Operator.LIKE, filter));
		}
		Specification<HealthEduArticle> spec = DynamicSpecifications.bySearchFilter(filters.values(), HealthEduArticle.class);
		Specification<HealthEduArticle> spec = DynamicSpecifications.bySearchFilter(filters.values(),HealthEduArticle.class);
		return healthEduArticleDao.findAll(spec, pageRequest);
	}
@ -111,11 +117,16 @@ public class HealthEduArticleService extends BaseService {
	 */
	public int send(List<HealthEduArticlePatient> list) {
		Iterable<HealthEduArticlePatient> iterable = healthEduArticlePatientDao.save(list);
		//记录转发量
		for(HealthEduArticlePatient healthEduArticlePatient:list){
			healthEduArticleOpHistoryService.saveByStatus(HealthEduArticleOpHistory.COLLECTION_STATUS,healthEduArticlePatient.getArticle(),healthEduArticlePatient.getTitle(),healthEduArticlePatient.getDoctor());
		}
		Iterator<HealthEduArticlePatient> iterator = iterable.iterator();
		if (iterator.hasNext()) {
			return 1;
		} else {
			return 0;
		}
	}
}

+ 100 - 14
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -1,11 +1,11 @@
package com.yihu.wlyy.web.doctor.health;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import com.yihu.wlyy.service.app.health.HealthEduArticlePatientService;
import com.yihu.wlyy.service.app.label.SignPatientLabelInfoService;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
@ -16,6 +16,7 @@ import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
@ -42,7 +43,14 @@ public class DoctorHealthEduArticleController extends BaseController {
	private HealthEduArticleService healthEduArticleService;
	@Autowired
	private DoctorService doctorService;
	@Autowired
	private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
	@Autowired
	private SignPatientLabelInfoService signPatientLabelInfoService;
	@Autowired
	private HealthEduArticlePatientService healthEduArticlePatientService;
	/**
	 * 查询
	 * @param pagesize 分页大小
@ -50,9 +58,9 @@ public class DoctorHealthEduArticleController extends BaseController {
	 */
	@RequestMapping(value = "list")
	@ResponseBody
	public String list(long id, int pagesize) {
	public String list(@RequestParam(value = "page",required = true)int page, @RequestParam(value = "pagesize",required = true)int pagesize,@RequestParam(value = "filter",required = false)String filter) {
		try {
			Page<HealthEduArticle> list = healthEduArticleService.findAll(id, pagesize);
			Page<HealthEduArticle> list = healthEduArticleService.findAll(page, pagesize,filter);
			JSONArray jsonArray = new JSONArray();
			if (list != null) {
				for (HealthEduArticle article : list) {
@ -68,6 +76,18 @@ public class DoctorHealthEduArticleController extends BaseController {
					json.put("content", article.getContent());
					// 添加日期
					json.put("czrq", DateUtil.dateToStrLong(article.getCzrq()));
					int collectionAmount =  healthEduArticleOpHistoryService.countCollectionAmount(article.getCode());
					int readAmount = healthEduArticleOpHistoryService.countReadAmount(article.getCode());
					int repeatAmount = healthEduArticleOpHistoryService.countRepeatAmount(article.getCode());
					//阅读量
					json.put("readAmount", readAmount);
					//收藏量
					json.put("collectionAmount", collectionAmount);
					//转发量
					json.put("repeatAmount", repeatAmount);
					//是否收藏
					json.put("collection",1);
					jsonArray.put(json);
				}
			}
@ -78,36 +98,90 @@ public class DoctorHealthEduArticleController extends BaseController {
		}
	}
	/**
	 * 查询文章列表
	 * @param code 数据文章唯一标示code
	 * @return 列表
	 */
	@RequestMapping(value = "article")
	@ResponseBody
	public String article(@RequestParam(value = "code",required = true) String code) {
		try {
			//获取单条文章记录
			HealthEduArticle healthEduArticle = healthEduArticleService.findArticleByCode(code);
			int isRead  = healthEduArticleOpHistoryService.countByUserStatus(getUID(), HealthEduArticleOpHistory.READ_STATUS);
			//插入文章读取状态第一次阅读记录浏览数量
			if(isRead==0){
				//更新浏览量
				healthEduArticleOpHistoryService.saveByStatus(HealthEduArticleOpHistory.READ_STATUS,healthEduArticle.getCode(),healthEduArticle.getTitle(),getUID());
			}
			JSONObject json = new JSONObject();
			json.put("id", healthEduArticle.getId());
			// 文章标识
			json.put("code", healthEduArticle.getCode());
			// 文章标题
			json.put("title", healthEduArticle.getTitle());
			// 文章内容
			json.put("content", healthEduArticle.getContent());
			// 添加日期
			json.put("czrq", DateUtil.dateToStrLong(healthEduArticle.getCzrq()));
			int readAmount = healthEduArticleOpHistoryService.countReadAmount(code);
			json.put("readAmount",readAmount);
			json.put("collection",1);
			return write(200, "查询成功", "data", json);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
	/**
	 * 发送文章给患者
	 * @param article 文章标识,多个以逗号分隔
	 * @param code 文章标识,多个以逗号分隔
	 * @param patient 患者标识,多个以逗号分隔
	 * @param  group 所选群组,多个用逗号分隔
	 * @return
	 */
	@RequestMapping(value = "send")
	@ResponseBody
	public String send(String article, String patient) {
	public String send(@RequestParam(value = "code")String code,
					   @RequestParam(value = "patient",required = false)String patient,
					   @RequestParam(value = "group",required = false,defaultValue = "")String group,
					   @RequestParam(value = "labelType",required = false)String labelType,
					   @RequestParam(value = "labelCode",required = false)String labelCode,
					   @RequestParam(value = "teamCode",required = false)long teamCode) {
		try {
			List<HealthEduArticlePatient> list = new ArrayList<HealthEduArticlePatient>();
			if (StringUtils.isEmpty(article)) {
			if (StringUtils.isEmpty(code)) {
				return error(-1, "请至少选择一篇文章!");
			}
			if (StringUtils.isEmpty(patient)) {
			if (StringUtils.isEmpty(patient)&&StringUtils.isEmpty(group)) {
				return error(-1, "请至少选择一个患者!");
			}
			String[] articles = article.split(",");
			String[] articles = code.split(",");
			String[] patients = patient.split(",");
			String[] groups = group.split(",");
			if (articles.length == 0) {
				return error(-1, "请至少选择一篇文章!");
			}
			if (patients.length == 0) {
			if (patients.length == 0&&groups.length==0) {
				return error(-1, "请至少选择一个患者!");
			}
			Map<String, HealthEduArticle> maps = new HashMap<String, HealthEduArticle>();
			Set<String> patientSet = new HashSet<>();
			if(StringUtils.isNotBlank(group)&&groups.length>0){
				//递归患者数据
				getPatientByGroup(labelCode,labelType,teamCode,patientSet,1,100);
			}
			//去重操作
			for (String p : patients) {
				patientSet.add(p);
			}
			// 查询医生信息
			Doctor doctor = doctorService.findDoctorByCode(getUID());
			JSONArray messages = new JSONArray();
			for (String p : patients) {
			for (String p : patientSet) {
				for (String a : articles) {
					// 查询文章信息
					HealthEduArticle temp = maps.get(a);
@ -116,6 +190,7 @@ public class DoctorHealthEduArticleController extends BaseController {
						// 添加到缓存
						maps.put(a, temp);
					}
					HealthEduArticlePatient heap = new HealthEduArticlePatient();
					// 设置文章标识
					heap.setArticle(a);
@ -159,5 +234,16 @@ public class DoctorHealthEduArticleController extends BaseController {
			return error(-1, "发送失败!");
		}
	}
	private void getPatientByGroup(String labelCode, String labelType, Long teamCode,Set<String> patientSet,int page,int pagesize) throws Exception{
		JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize);
		for(Object o : result){
			JSONObject json  = (JSONObject)o;
			String patient  = (String)json.get("code");
			patientSet.add(patient);
		}
		if(result.length()==100){
			getPatientByGroup( labelCode,labelType,teamCode,patientSet,page+1,pagesize);
		}
	}
}

+ 59 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -1,5 +1,8 @@
package com.yihu.wlyy.web.patient.health;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import com.yihu.wlyy.service.app.health.HealthEduArticlePatientService;
import io.swagger.annotations.Api;
import org.json.JSONArray;
import org.json.JSONObject;
@ -9,6 +12,7 @@ import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
@ -27,7 +31,10 @@ import com.yihu.wlyy.web.BaseController;
public class HealthEduArticleController extends BaseController {
	@Autowired
	private HealthEduArticleService healthEduArticleService;
	private HealthEduArticlePatientService healthEduArticlePatientService;
	@Autowired
	private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
	/**
	 * 查询文章列表
@ -36,9 +43,9 @@ public class HealthEduArticleController extends BaseController {
	 */
	@RequestMapping(value = "list")
	@ResponseBody
	public String list(long id, int pagesize) {
	public String list(@RequestParam("id")long id, @RequestParam("pagesize") int pagesize) {
		try {
			Page<HealthEduArticlePatient> list = healthEduArticleService.findByPatient(getUID(), id, pagesize);
			Page<HealthEduArticlePatient> list = healthEduArticlePatientService.findByPatient(getUID(), id, pagesize);
			JSONArray jsonArray = new JSONArray();
			if (list != null) {
				for (HealthEduArticlePatient article : list) {
@ -58,6 +65,15 @@ public class HealthEduArticleController extends BaseController {
					json.put("read", article.getRead());
					// 添加日期
					json.put("czrq", DateUtil.dateToStrLong(article.getCzrq()));
					//int collectionAmount =  healthEduArticleOpHistoryService.countCollectionAmount(article.getArticle());
					//int readAmount = healthEduArticleOpHistoryService.countReadAmount(article.getArticle());
					//int repeatAmount = healthEduArticleOpHistoryService.countRepeatAmount(article.getArticle());
					////阅读量
					//json.put("readAmount", readAmount);
					////收藏量
					//json.put("collectionAmount", collectionAmount);
					////转发量
					//json.put("repeatAmount", repeatAmount);
					jsonArray.put(json);
				}
			}
@ -67,7 +83,44 @@ public class HealthEduArticleController extends BaseController {
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
	/**
	 * 查询文章列表
	 * @param id 数据文章唯一标示article
	 * @return 列表
	 */
	@RequestMapping(value = "article")
	@ResponseBody
	public String article(@RequestParam(value = "article",required = true) long id) {
		try {
			//获取单条文章记录
			HealthEduArticlePatient healthEduArticlePatient = healthEduArticlePatientService.findById(id);
			int isRead  = healthEduArticleOpHistoryService.countByUserStatus(getUID(),HealthEduArticleOpHistory.READ_STATUS);
			//插入文章读取状态第一次阅读记录浏览数量//暂时更新每次都算一次浏览量
			healthEduArticleOpHistoryService.saveByStatus(HealthEduArticleOpHistory.READ_STATUS,healthEduArticlePatient.getArticle(),healthEduArticlePatient.getTitle(),getUID());
			if(isRead==0){
				//将文章更新为已读
				healthEduArticlePatientService.updateRead(getUID(), healthEduArticlePatient.getArticle());
			}
			JSONObject json = new JSONObject();
			json.put("id", healthEduArticlePatient.getId());
			// 文章标识
			json.put("article", healthEduArticlePatient.getArticle());
			// 医生姓名
			json.put("doctorName", healthEduArticlePatient.getDoctorName());
			// 文章标题
			json.put("title", healthEduArticlePatient.getTitle());
			// 文章内容
			json.put("content", healthEduArticlePatient.getContent());
			// 添加日期
			json.put("czrq", DateUtil.dateToStrLong(healthEduArticlePatient.getCzrq()));
			int readAmount = healthEduArticleOpHistoryService.countReadAmount(healthEduArticlePatient.getArticle());
			json.put("readAmount",readAmount);
			return write(200, "查询成功", "data", json);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
	/**
	 * 更新文章为已读
	 * @param article 文章标识
@ -75,9 +128,9 @@ public class HealthEduArticleController extends BaseController {
	 */
	@RequestMapping(value = "read")
	@ResponseBody
	public String read(String article) {
	public String read(@RequestParam("article") String article) {
		try {
			healthEduArticleService.updateRead(getUID(), article);
			healthEduArticlePatientService.updateRead(getUID(), article);
			return success("操作成功!");
		} catch (Exception ex) {
			error(ex);