Merge branch 'jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支' of http://182.92.166.109:3000/jihan/xinelu-api into jihan_0920_护理服务、商城、积分兑换、在线问诊功能分支

This commit is contained in:
haown 2023-10-10 11:09:10 +08:00
commit 8082668114
9 changed files with 235 additions and 8 deletions

View File

@ -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);
}
}

View File

@ -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;
/**

View File

@ -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;
/**
* 问诊资料文件

View File

@ -52,4 +52,19 @@ public interface AppletLoginService {
* @return 护理人列表集合
*/
AjaxResult existPatientInfo(String openId);
/**
* 查询省级区域信息信息
*
* @return 省级区域信息集合
*/
AjaxResult getProvinceAreaInfo();
/**
* 根据父区域编码查询其下属区域信息
*
* @param areaCode 父级区域编码
* @return 下属区域信息集合
*/
AjaxResult getSubordinateAreaInfo(String areaCode);
}

View File

@ -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()));
}
/**
* 校验预约服务时间
*

View File

@ -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'
<if test="patientId != null ">
and sender_id= ci.doctor_id
</if>
<if test="doctorId != null ">
and sender_id= ci.patient_id
</if>
) AS messageCount
FROM
consultation_info ci
<where>
<if test="patientId != null ">
and ci.patient_id = #{patientId}
@ -143,7 +143,7 @@
SELECT file_url FROM consultation_file WHERE del_flag='0' AND consultation_id=#{id}
</select>
<insert id="insertConsultationInfo" parameterType="ConsultationInfo">
<insert id="insertConsultationInfo" parameterType="ConsultationInfo" useGeneratedKeys="true" keyProperty="id">
insert into consultation_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,
@ -246,7 +246,7 @@
<insert id="insertConsultationFile">
insert into consultation_file(consultation_id, file_url) values
<foreach item="item" index="index" collection="fileUrls" separator=",">
(#{consultationId},#{item.fileUrl})
(#{consultationId},#{item})
</foreach>
</insert>

View File

@ -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<PatientInfoVO> 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<PatientInfoVO> list = patientInfoService.selectPatientInfoList(patientInfo);
ExcelUtil<PatientInfoVO> 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);
}
}

View File

@ -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<String> pictureUrlList;
}

View File

@ -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;
/**