Prechádzať zdrojové kódy

居民端一键修改阅读状态

wujunjie 8 rokov pred
rodič
commit
476ae1a666

+ 6 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java

@ -69,16 +69,17 @@ public class PatientHealthGuidanceService extends BaseService {
	 * @param id
	 * @return
	 */
	public void modifyStatus(String id) {
		if(id.equals(id)){
	public void modifyStatus(String id,String type) {
		if("1".equals(type)){
//            一键设置居民未读指导
			String sql = "UPDATE wlyy_patient_health_guidance wphg " +
					"SET wphg .read_status = 1  "+
					"where wphg.patient = ?";
					"WHERE wphg.patient = ?";
			jdbcTemplate.update(sql,id);
		}else {
			String sql = "UPDATE wlyy_patient_health_guidance wphg " +
					"SET wphg .read_status = 1 " +
					"WHERE id = ?";
					"SET wphg .read_status = 1  " +
					"WHERE wphg.id = ?";
			jdbcTemplate.update(sql, id);
		}
	}

+ 4 - 11
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/PatientHealthGuidanceController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.health;
import com.yihu.wlyy.entity.patient.PatientHealthGuidance;
import com.yihu.wlyy.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.json.JSONArray;
import org.json.JSONObject;
@ -8,16 +9,9 @@ import org.springframework.beans.factory.annotation.Autowired;
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.service.app.health.PatientHealthGuidanceService;
import com.yihu.wlyy.web.BaseController;
import static com.yihu.wlyy.logs.BusinessLogs.BusinessType.guidance;
import static org.bouncycastle.asn1.x509.X509ObjectIdentifiers.id;
/**
 * 患者端:健康指导控制类
 * @author George
@ -40,7 +34,7 @@ public class PatientHealthGuidanceController extends BaseController {
	@ResponseBody
	public String modifyStatus() {
		try {
			patientHealthGuidanceService.modifyStatus(getUID());
			patientHealthGuidanceService.modifyStatus(getUID(),"1");
			return write(200, "设置成功!");
		} catch (Exception e) {
			error(e);
@ -51,7 +45,6 @@ public class PatientHealthGuidanceController extends BaseController {
	/**
	 * 查询患者的健康指导
	 * @param patient
	 * @return
	 */
	@RequestMapping(value = "list")
@ -86,7 +79,7 @@ public class PatientHealthGuidanceController extends BaseController {
			JSONObject guidance = patientHealthGuidanceService.findById(idl);
//			修改医生给居民指导的阅读状态,改为已读
			patientHealthGuidanceService.modifyStatus(id);
			patientHealthGuidanceService.modifyStatus(id,"0");
			return write(200,"查询成功","data",guidance);
		}catch (Exception e){