Browse Source

健康教育文章处理

8 years ago
parent
commit
4accc4260e

+ 24 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -84,6 +84,30 @@ public class WechatController extends WeixinBaseController {
        }
    }
    /**
     * 获取验证码发送的手机号码
     * @param idCard
     * @return
     */
    @RequestMapping(value = "getMobile")
    @ResponseBody
    public String getPatientInfoByIdCard(@RequestParam(value = "idCard",required = true) String idCard){
        Patient temp = patientService.findByIdcard(idCard);
        if(temp==null){
            return error(-1, "用户未注册");
        }else{
            if(StringUtils.isBlank(temp.getMobile())){
                return error(-2, "用户未绑定手机号");
            }else{
                JSONObject object = new JSONObject();
                object.put("mobile",temp.getMobile());
                return write(200,"获取成功","data",object);
            }
        }
    }
    /**
     * 患者注册-验证身份证
     *

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

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.health;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.service.app.health.HealthEduArticleOpHistoryService;
import com.yihu.wlyy.service.app.health.HealthEduArticlePatientService;
@ -45,6 +46,9 @@ public class HealthEduArticleController extends BaseController {
	@Autowired
	private HealthEduArticleOpHistoryService healthEduArticleOpHistoryService;
	@Autowired
	private HealthEduArticleService healthEduArticleService;
	@Autowired
	private DoctorService doctorService;
@ -127,18 +131,20 @@ public class HealthEduArticleController extends BaseController {
				//将文章更新为已读
				healthEduArticlePatientService.updateRead(getUID(), healthEduArticlePatient.getArticle());
			}
			HealthEduArticle healthEduArticle = healthEduArticleService.findArticleByCode(healthEduArticlePatient.getArticle());
			JSONObject json = new JSONObject();
			json.put("id", healthEduArticlePatient.getId());
			json.put("id", healthEduArticle.getId());
			// 文章标识
			json.put("article", healthEduArticlePatient.getArticle());
			// 医生姓名
			json.put("doctorName", healthEduArticlePatient.getDoctorName());
			// 文章标题
			json.put("title", healthEduArticlePatient.getTitle());
			json.put("title", healthEduArticle.getTitle());
			// 文章内容
			json.put("content", healthEduArticlePatient.getContent());
			json.put("content", healthEduArticle.getContent());
			json.put("url", healthEduArticlePatient.getUrl());
			json.put("url", healthEduArticle.getUrl());
			// 添加日期
			json.put("czrq", DateUtil.dateToStrLong(healthEduArticlePatient.getCzrq()));
			int readAmount = healthEduArticleOpHistoryService.countReadAmount(healthEduArticlePatient.getArticle());