diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java b/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java index fd3d1a9..cc085f6 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/Patients.java @@ -487,6 +487,35 @@ public class Patients extends BaseModel { private String buildingManualCode; private Integer isComplete; + /** + * 威县一月内会诊数据 + * @return + */ + /** + * his病例ID + */ + private String patientHId; + /** + * 一个月内访问次数 + */ + private String visitsNum; + + public String getPatientHId() { + return patientHId; + } + + public void setPatientHId(String patientHId) { + this.patientHId = patientHId; + } + + public String getVisitsNum() { + return visitsNum; + } + + public void setVisitsNum(String visitsNum) { + this.visitsNum = visitsNum; + } + public String getVillageId() { return villageId; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java new file mode 100644 index 0000000..a5b45d4 --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/PatientController.java @@ -0,0 +1,57 @@ +package com.lyms.platform.operate.web.controller; + +import com.lyms.platform.biz.service.PatientsService; +import com.lyms.platform.common.constants.ErrorCodeConstants; +import com.lyms.platform.common.result.BaseResponse; +import com.lyms.platform.operate.web.utils.CollectionUtils; +import com.lyms.platform.operate.web.vo.PatientsDTO; +import com.lyms.platform.pojo.Patients; +import com.lyms.platform.query.PatientsQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +@Controller("/patient") +public class PatientController { + @Autowired + private PatientsService patientsService; + //http://112.112.112.183:8085/viewhip-etyy/view/commView/layout.jsp?patientId=病人ID + + @RequestMapping(method = RequestMethod.GET, value = "/getPatients") + @ResponseBody + public BaseResponse getPatients(){ + BaseResponse baseResponse=new BaseResponse(); + PatientsQuery patientsQuery =new PatientsQuery(); + patientsQuery.setYn(1); + patientsQuery.setHospitalId("2100002419"); + List patientsList= patientsService.queryPatient(patientsQuery); + baseResponse.setObject(patientsList); + return baseResponse.setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); + } + + @RequestMapping(method = RequestMethod.POST, value = "/updatePatients") + @ResponseBody + public BaseResponse updatePatients(@RequestBody PatientsDTO patientsDTO){ + BaseResponse baseResponse=new BaseResponse(); + if (patientsDTO!=null){ + PatientsQuery patientsQuery =new PatientsQuery(); + patientsQuery.setYn(1); + patientsQuery.setId(patientsDTO.getId()); + List patientsList=patientsService.queryPatient(patientsQuery); + if (CollectionUtils.isNotEmpty(patientsList)){ + Patients patient= patientsList.get(0); + patient.setPatientHId(patientsDTO.getPatientHId()); + patient.setVisitsNum(patientsDTO.getVisitsNum()); + patientsService.updatePatientOne(patient,patient.getId()); + baseResponse.setErrormsg("成功"); + } + + } + return baseResponse; + } +} diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/PatientsDTO.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/PatientsDTO.java new file mode 100644 index 0000000..53460cc --- /dev/null +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/vo/PatientsDTO.java @@ -0,0 +1,40 @@ +package com.lyms.platform.operate.web.vo; + +public class PatientsDTO { + /** + * 患者ID + */ + private String id; + /** + * his病例ID + */ + private String patientHId; + /** + * 一个月内访问次数 + */ + private String visitsNum; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getPatientHId() { + return patientHId; + } + + public void setPatientHId(String patientHId) { + this.patientHId = patientHId; + } + + public String getVisitsNum() { + return visitsNum; + } + + public void setVisitsNum(String visitsNum) { + this.visitsNum = visitsNum; + } +}