From 13ea15348c3459c19c5ca2b037ea080bc6b59b64 Mon Sep 17 00:00:00 2001 From: changpengfei Date: Wed, 22 Sep 2021 10:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=82=A3=E8=80=85=E5=BE=85?= =?UTF-8?q?=E7=94=A8=E5=8D=A1=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/PatientController.java | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) 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 db8f240..5b97043 100644 --- a/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java +++ b/talkonlineweb/src/main/java/com/lyms/talkonlineweb/controller/PatientController.java @@ -563,4 +563,33 @@ public class PatientController { baseResponse.setObject(patientListMap); return baseResponse; } + + /** + * 更新患者待用卡数量---小程序端使用 + * + * @param patient + * @return + */ + @PostMapping("updateCcnt") + public BaseResponse updateCcnt(@RequestBody LymsPatient patient){ + BaseResponse baseResponse=new BaseResponse(); + boolean f=false; + LymsPatient patient2=lymsPatientService.getById(patient.getId()); + if(Objects.nonNull(patient2)){//验证问诊卡次数 + int cnt=patient2.getCcnt()-1; + if (cnt < 0) { + baseResponse.setErrorcode(1); + baseResponse.setErrormsg("问诊卡次数错误"); + return baseResponse; + }else{ + patient.setCcnt(cnt); + } + } + if(Objects.nonNull(patient.getId()) ){ + patient.setUpdatedtime(new Date()); + f=lymsPatientService.saveOrUpdate(patient); + } + baseResponse.setErrorcode(f==true?0:1); + return baseResponse; + } } -- 1.8.3.1