diff --git a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java index 78b1746..a18f3bb 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -15,6 +15,7 @@ import com.lyms.talkonlineweb.result.BaseResponse; import com.lyms.talkonlineweb.result.PatientPcaseResult; import com.lyms.talkonlineweb.service.*; import com.lyms.talkonlineweb.util.*; +import com.mysql.cj.Query; import lombok.extern.log4j.Log4j2; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.DigestUtils; @@ -75,6 +76,8 @@ public class PatientController { @Autowired //科室所拥有的疾病 private LymsDepartillService lymsDepartillService; + @Autowired + private LymsPatientAttentionService lymsPatientAttentionService; /** * 获取患者列表 @@ -889,7 +892,7 @@ public class PatientController { /** * 修改患者密码/重置密码 - * @param doctor + * @param patient * @return */ @PostMapping("updatePatientPassword") @@ -898,8 +901,7 @@ public class PatientController { BaseResponse baseResponse=new BaseResponse(); if(1==patient.getType()){//1 重置密码 patient.setPpasswd(DigestUtils.md5DigestAsHex(Constant.COMMON_PASSWD.getBytes())); - } - if(StringUtil.isNotEmpty(patient.getPpasswd())){ + }else{//修改 patient.setPpasswd(DigestUtils.md5DigestAsHex(patient.getPpasswd().getBytes())); } boolean f=lymsPatientService.updateById(patient); @@ -934,4 +936,59 @@ public class PatientController { } return baseResponse; } +// /** +// * 小程序关注患者查询 +// * +// * @param patient +// * @return +// */ +// @GetMapping("getPatientAttention") +// public BaseResponse getPatientAttention(LymsPatient patient) { +// QueryWrapper queryWrapper=new QueryWrapper<>(); +// if(StringUtil.isNotEmpty(patient.getIdno())){ +// queryWrapper.lambda().eq(LymsPatient::getIdno, patient.getIdno()); +// } +// if(StringUtil.isNotEmpty(patient.getEnrolmentPhone())){ +// queryWrapper.eq("p.enrolment_phone", patient.getEnrolmentPhone()) +// .or().eq("pc.mobile", patient.getEnrolmentPhone()); +// } +// //指定返回列 +// queryWrapper.lambda().select(LymsPatient::getId, +// LymsPatient::getPname, +// LymsPatient::getSex, +// LymsPatient::getBirth, +// LymsPatient::getIdno, +// LymsPatient::getCreatedtime); +// LymsPatient resultPatient = lymsPatientService.getPatient(queryWrapper); +// +// BaseResponse baseResponse = new BaseResponse(); +// baseResponse.setErrorcode(0); +// baseResponse.setObject(resultPatient); +// baseResponse.setErrormsg("成功"); +// return baseResponse; +// } +// +// /** +// * 小程序关注的患者列表 +// * +// * @param patient +// * @return +// */ +// @GetMapping("getPatientAttentionList") +// public BaseResponse getPatientAttentionList(LymsPatientAttention patientAttention) { +// BaseResponse baseResponse = new BaseResponse(); +// if (null==patientAttention.getPid()) { +// baseResponse.setErrorcode(1); +// baseResponse.setErrormsg("参数错误"); +// return baseResponse; +// } +// QueryWrapper queryWrapper=Wrappers.query(patientAttention); +// //指定返回列 +// queryWrapper.lambda().select(LymsPatientAttention::getAttentionId); +// List ids=lymsPatientAttentionService.listObjs(queryWrapper); +// baseResponse.setErrorcode(0); +// baseResponse.setObject(ids); +// baseResponse.setErrormsg("成功"); +// return baseResponse; +// } }