diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletlogin/AppletLoginController.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletlogin/AppletLoginController.java index 90ec4f9..9e67552 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletlogin/AppletLoginController.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/controller/appletlogin/AppletLoginController.java @@ -116,4 +116,30 @@ public class AppletLoginController extends BaseController { } return appletLoginService.existPatientInfo(openId); } + + /** + * 查询省级区域信息信息(小程序app修改用户地址信息查询) + * + * @return 省级区域信息集合 + */ + @GetMapping("/getProvinceInfo") + public AjaxResult getProvinceAreaInfo() { + return appletLoginService.getProvinceAreaInfo(); + } + + /** + * 根据父级区域编码查询下级区域(小程序app修改用户地址信息查询) + * + * @param areaCode 父级区域编码 + * @return 所属下级区域信息集合 + */ + @GetMapping("/getSubordinateInfo") + public AjaxResult getSubordinateAreaInfo(String areaCode) { + if (StringUtils.isBlank(areaCode)) { + return AjaxResult.error("上级区域编码不能为空"); + } + return appletLoginService.getSubordinateAreaInfo(areaCode); + } + + } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/ChatRecordDTO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/ChatRecordDTO.java index a05879c..dd681ca 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/ChatRecordDTO.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/chatrecord/ChatRecordDTO.java @@ -42,6 +42,7 @@ public class ChatRecordDTO extends BaseEntity implements Serializable { /** * 发送时间,时间格式:yyyy-MM-dd HH:mm:ss */ + @NotNull(message = "接收时间不能为空", groups = {Insert.class}) private Date sendTime; /** diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java index 8b3befc..88b658b 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/dto/consultationInfo/ConsultationInfoDTO.java @@ -128,6 +128,10 @@ public class ConsultationInfoDTO extends BaseEntity implements Serializable { @Length(max = 100, message = "病历不能超过100位", groups = {Insert.class, Update.class}) private String medicalRecord; + /** + * 状态 + */ + private Integer status; /** * 问诊资料文件 diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/AppletLoginService.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/AppletLoginService.java index 8a9a3bb..967c72b 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/AppletLoginService.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/AppletLoginService.java @@ -52,4 +52,19 @@ public interface AppletLoginService { * @return 护理人列表集合 */ AjaxResult existPatientInfo(String openId); + + /** + * 查询省级区域信息信息 + * + * @return 省级区域信息集合 + */ + AjaxResult getProvinceAreaInfo(); + + /** + * 根据父区域编码查询其下属区域信息 + * + * @param areaCode 父级区域编码 + * @return 下属区域信息集合 + */ + AjaxResult getSubordinateAreaInfo(String areaCode); } diff --git a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java index 9b2790e..3f5d240 100644 --- a/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java +++ b/xinelu-nurse-applet/src/main/java/com/xinelu/applet/service/appletlogin/impl/AppletLoginServiceImpl.java @@ -26,10 +26,12 @@ import com.xinelu.manage.domain.appointmentorder.AppointmentOrder; import com.xinelu.manage.domain.appointmentorderdetails.AppointmentOrderDetails; import com.xinelu.manage.domain.appointmentorderprocessrecord.AppointmentOrderProcessRecord; import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.domain.sysarea.SysArea; import com.xinelu.manage.mapper.appointmentorder.AppointmentOrderMapper; import com.xinelu.manage.mapper.appointmentorderdetails.AppointmentOrderDetailsMapper; import com.xinelu.manage.mapper.appointmentorderprocessrecord.AppointmentOrderProcessRecordMapper; import com.xinelu.manage.mapper.patientinfo.PatientInfoMapper; +import com.xinelu.manage.mapper.sysarea.SysAreaMapper; import com.xinelu.manage.vo.patientinfo.PatientInfoVO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -88,6 +90,9 @@ public class AppletLoginServiceImpl implements AppletLoginService { */ private static final String OK = "ok"; + @Resource + private SysAreaMapper sysAreaMapper; + /** * 提前预约时间半天标识 */ @@ -308,6 +313,31 @@ public class AppletLoginServiceImpl implements AppletLoginService { return AjaxResult.success("NOT_LOGIN"); } + /** + * 查询省级区域信息信息 + * + * @return 省级区域信息集合 + */ + @Override + public AjaxResult getProvinceAreaInfo() { + SysArea area = new SysArea(); + area.setAreaLevel(1); + area.setRemoteSigns(0); + return AjaxResult.success(sysAreaMapper.selectSysAreaList(area)); + } + + /** + * 根据父级区域编码查询其下属区域信息 + * + * @param areaCode 父级区域编码 + * @return 下属区域信息集合 + */ + @Override + public AjaxResult getSubordinateAreaInfo(String areaCode) { + //查询出下级区域集合 + return AjaxResult.success(sysAreaMapper.getCityInfoList(areaCode, RemoteSignsEnum.REMOTE.getInfo())); + } + /** * 校验预约服务时间 * diff --git a/xinelu-nurse-applet/src/main/resources/mapper/applet/consultationInfo/ConsultationInfoMapper.xml b/xinelu-nurse-applet/src/main/resources/mapper/applet/consultationInfo/ConsultationInfoMapper.xml index 1b11751..e7ac6a4 100644 --- a/xinelu-nurse-applet/src/main/resources/mapper/applet/consultationInfo/ConsultationInfoMapper.xml +++ b/xinelu-nurse-applet/src/main/resources/mapper/applet/consultationInfo/ConsultationInfoMapper.xml @@ -68,17 +68,17 @@ ci.doctor_id, ci.doctor_name, ci.problem_description, - COUNT(cr.id) as messageCount - FROM - consultation_info ci - LEFT JOIN chat_record cr ON cr.consultation_id=ci.id AND read_status='0' + ci.create_time, + (SELECT COUNT(cr.id) FROM chat_record cr WHERE cr.consultation_id = ci.id AND read_status = '0' and sender_id= ci.doctor_id and sender_id= ci.patient_id - + ) AS messageCount + FROM + consultation_info ci and ci.patient_id = #{patientId} @@ -143,7 +143,7 @@ SELECT file_url FROM consultation_file WHERE del_flag='0' AND consultation_id=#{id} - + insert into consultation_info id, @@ -246,7 +246,7 @@ insert into consultation_file(consultation_id, file_url) values - (#{consultationId},#{item.fileUrl}) + (#{consultationId},#{item}) diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientArchivesInfoController.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientArchivesInfoController.java new file mode 100644 index 0000000..8f11448 --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/controller/patientinfo/PatientArchivesInfoController.java @@ -0,0 +1,130 @@ +package com.xinelu.manage.controller.patientinfo; + +import com.xinelu.common.annotation.Log; +import com.xinelu.common.core.controller.BaseController; +import com.xinelu.common.core.domain.AjaxResult; +import com.xinelu.common.core.page.TableDataInfo; +import com.xinelu.common.enums.BusinessType; +import com.xinelu.common.utils.poi.ExcelUtil; +import com.xinelu.manage.domain.patientinfo.PatientInfo; +import com.xinelu.manage.dto.cancelpicture.CancelPictureDTO; +import com.xinelu.manage.service.patientinfo.IPatientInfoService; +import com.xinelu.manage.vo.patientinfo.PatientInfoVO; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Objects; + +/** + * 被护理人基本信息Controller + * + * @author xinyilu + * @date 2022-09-02 + */ +@RestController +@RequestMapping("/system/patientArchives") +public class PatientArchivesInfoController extends BaseController { + + @Resource + private IPatientInfoService patientInfoService; + + /** + * 查询被护理人基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:patientArchives:list')") + @GetMapping("/list") + public TableDataInfo list(PatientInfoVO patientInfo) { + startPage(); + List list = patientInfoService.selectPatientInfoList(patientInfo); + return getDataTable(list); + } + + /** + * 导出被护理人基本信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:patientArchives:export')") + @Log(title = "被护理人基本信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, PatientInfoVO patientInfo) { + List list = patientInfoService.selectPatientInfoList(patientInfo); + ExcelUtil util = new ExcelUtil<>(PatientInfoVO.class); + util.exportExcel(response, list, "被护理人基本信息数据"); + } + + /** + * 获取被护理人基本信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:patientArchives:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) { + return AjaxResult.success(patientInfoService.selectPatientInfoById(id)); + } + + /** + * 新增被护理人基本信息 + */ + @PreAuthorize("@ss.hasPermi('system:patientArchives:add')") + @Log(title = "被护理人基本信息", businessType = BusinessType.INSERT) + @PostMapping("/add") + public AjaxResult add(@RequestBody PatientInfo patientInfo) { + return toAjax(patientInfoService.insertPatientInfo(patientInfo)); + } + + /** + * 修改被护理人基本信息 + */ + @PreAuthorize("@ss.hasPermi('system:patientArchives:edit')") + @Log(title = "被护理人基本信息", businessType = BusinessType.UPDATE) + @PostMapping(value = "edit") + public AjaxResult edit(@RequestBody PatientInfo patientInfo) { + return patientInfoService.updatePatientInfo(patientInfo); + } + + /** + * 删除被护理人基本信息 + */ + @PreAuthorize("@ss.hasPermi('system:patientArchives:remove')") + @Log(title = "被护理人基本信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) { + return toAjax(patientInfoService.deletePatientInfoByIds(ids)); + } + + /** + * 删除旧图片 + * + * @param cancelPictureDTO 路径参数 + * @return 结果 + */ + @PostMapping("/updatePicture") + public AjaxResult updatePicture(@RequestBody CancelPictureDTO cancelPictureDTO) { + if (CollectionUtils.isEmpty(cancelPictureDTO.getPictureUrlList())) { + return AjaxResult.success(); + } + return patientInfoService.updatePicture(cancelPictureDTO.getPictureUrlList()); + } + + /** + * PC端重置密码 + * + * @param id 会员id + * @param password 密码 + * @return AjaxResult + */ + @PostMapping("/updatePassword") + public AjaxResult updatePassword(Long id, String password) { + if (Objects.isNull(id)) { + return AjaxResult.error("用户信息有误,请联系管理员!"); + } + if (StringUtils.isBlank(password)) { + return AjaxResult.error("请输入密码!"); + } + return patientInfoService.updatePasswordById(id, password); + } +} + diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/cancelpicture/CancelPictureDTO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/cancelpicture/CancelPictureDTO.java new file mode 100644 index 0000000..9803cfe --- /dev/null +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/dto/cancelpicture/CancelPictureDTO.java @@ -0,0 +1,21 @@ +package com.xinelu.manage.dto.cancelpicture; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 取消图片参数实体类 + * @Author 纪寒 + * @Date 2022-11-09 14:26:28 + * @Version 1.0 + */ +@Data +public class CancelPictureDTO implements Serializable { + private static final long serialVersionUID = 3470954431511861546L; + /** + * 图片集合 + */ + private List pictureUrlList; +} \ No newline at end of file diff --git a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/consultationInfo/ConsultationInfoVO.java b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/consultationInfo/ConsultationInfoVO.java index 2ec4853..48b753c 100644 --- a/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/consultationInfo/ConsultationInfoVO.java +++ b/xinelu-nurse-manage/src/main/java/com/xinelu/manage/vo/consultationInfo/ConsultationInfoVO.java @@ -22,7 +22,7 @@ import java.util.Date; * @date 2023-09-25 */ @Data -public class ConsultationInfoVO implements Serializable { +public class ConsultationInfoVO extends BaseEntity implements Serializable { private static final long serialVersionUID = 1L; /**