Commit a6c33b90704c638f99fac66fa3034770569e691b

Authored by shiyang
1 parent 70c2f1169b
Exists in master

小程序注册患者

Showing 1 changed file with 26 additions and 0 deletions

talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java View file @ a6c33b9
... ... @@ -767,6 +767,7 @@
767 767  
768 768 return baseResponse;
769 769 }
  770 +
770 771 /**
771 772 * 选科室后查询出科室下有哪些疾病
772 773 * @param 科室id
... ... @@ -794,6 +795,7 @@
794 795 }
795 796 return baseResponse;
796 797 }
  798 +
797 799 /**
798 800 * 修改患者密码/重置密码
799 801 * @param doctor
... ... @@ -808,6 +810,30 @@
808 810 boolean f=lymsPatientService.updateById(patient);
809 811 baseResponse.setErrorcode(f==true?0:1);
810 812 baseResponse.setErrormsg(f==true?"成功":"失败");
  813 + return baseResponse;
  814 + }
  815 +
  816 + /**
  817 + * 小程序注册患者
  818 + *
  819 + * @param patient
  820 + * @return
  821 + */
  822 + @PostMapping("signInPatient")
  823 + public BaseResponse signInPatient(@RequestBody LymsPatient patient) {
  824 + BaseResponse baseResponse = new BaseResponse();
  825 + baseResponse.setErrorcode(1);
  826 + baseResponse.setErrormsg("身份证已注册。如有疑问请联系管理员!");
  827 + patient.setIdno(patient.getIdno().toLowerCase());
  828 + LymsPatient tmpP=new LymsPatient();
  829 + tmpP.setIdno(patient.getIdno().toLowerCase());
  830 + LymsPatient patient2 = lymsPatientService.getOne(Wrappers.query(tmpP).eq("idno", patient.getIdno()));
  831 + if (patient2 == null) {
  832 + patient.setCreatedtime(new Date());
  833 + boolean f = lymsPatientService.save(patient);
  834 + baseResponse.setErrorcode(0);
  835 + baseResponse.setErrormsg("注册成功!");
  836 + }
811 837 return baseResponse;
812 838 }
813 839 }