yeshijie hace 4 años
padre
commit
95ff641667

+ 109 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailAppointmentDO.java

@ -0,0 +1,109 @@
package com.yihu.jw.entity.specialist.rehabilitation;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
 * Created by ysj on 2020/7/11.
 */
@Entity
@Table(name = "wlyy_plan_detail_appointment")
public class RehabilitationDetailAppointmentDO extends UuidIdentityEntity implements Serializable {
    private String rehabilitationPlanDetailId;//'计划明细code'
    private Integer isSend;//是否已经提醒(0未提醒,1已提醒)
    private String appointmentTime;//'预约时间'
    private String doctor;//'执行医生code' 家医
    private String doctorName;
    private String appointmentDoctor;//预约医生code 专科
    private String appointmentDoctorName;
    private String patient;
    private Date createTime;
    @Column(name = "appointment_doctor")
    public String getAppointmentDoctor() {
        return appointmentDoctor;
    }
    public void setAppointmentDoctor(String appointmentDoctor) {
        this.appointmentDoctor = appointmentDoctor;
    }
    @Column(name = "appointment_doctor_name")
    public String getAppointmentDoctorName() {
        return appointmentDoctorName;
    }
    public void setAppointmentDoctorName(String appointmentDoctorName) {
        this.appointmentDoctorName = appointmentDoctorName;
    }
    @Column(name = "rehabilitation_plan_detail_id")
    public String getRehabilitationPlanDetailId() {
        return rehabilitationPlanDetailId;
    }
    public void setRehabilitationPlanDetailId(String rehabilitationPlanDetailId) {
        this.rehabilitationPlanDetailId = rehabilitationPlanDetailId;
    }
    @Column(name = "is_send")
    public Integer getIsSend() {
        return isSend;
    }
    public void setIsSend(Integer isSend) {
        this.isSend = isSend;
    }
    @Column(name = "appointment_time")
    public String getAppointmentTime() {
        return appointmentTime;
    }
    public void setAppointmentTime(String appointmentTime) {
        this.appointmentTime = appointmentTime;
    }
    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/specialist/rehabilitation/RehabilitationDetailDO.java

@ -51,6 +51,17 @@ public class RehabilitationDetailDO extends UuidIdentityEntityWithOperator imple
    @Column(name = "relation_code")
    private String relationCode;//业务关联code
    private Integer reservationType;//复诊类型:1线上,2线下,3远程
    @Column(name = "reservation_type")
    public Integer getReservationType() {
        return reservationType;
    }
    public void setReservationType(Integer reservationType) {
        this.reservationType = reservationType;
    }
    @Column(name = "saas_id")
    public String getSaasId() {
        return saasId;

+ 26 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/rehabilitation/RehabilitationManageController.java

@ -152,6 +152,32 @@ public class RehabilitationManageController {
        }
    }
    @PostMapping(value = "appointmentConsultation")
    @ApiOperation(value = "康复管理-预约协诊")
    public ObjEnvelop appointmentConsultation(
            @ApiParam(name = "patient", value = "居民姓名", required = true)
            @RequestParam(value = "patient", required = true) String patient,
            @ApiParam(name = "doctor", value = "医生code-家医", required = true)
            @RequestParam(value = "doctor", required = true) String doctor,
            @ApiParam(name = "doctorName", value = "医生姓名", required = true)
            @RequestParam(value = "doctorName", required = true) String doctorName,
            @ApiParam(name = "appointmentDoctor", value = "医生code-专科", required = true)
            @RequestParam(value = "appointmentDoctor", required = true) String appointmentDoctor,
            @ApiParam(name = "appointmentDoctorName", value = "医生姓名", required = true)
            @RequestParam(value = "appointmentDoctorName", required = true) String appointmentDoctorName,
                                              @ApiParam(name = "sendTime", value = "发送时间", required = true)
                                              @RequestParam(value = "sendTime", required = true) String sendTime,
                                              @ApiParam(name = "planDetailId", value = "计划明细id", required = true)
                                              @RequestParam(value = "planDetailId", required = true) String planDetailId){
        try {
            return rehabilitationManageService.appointmentConsultation(patient,doctor, doctorName,appointmentDoctor,appointmentDoctorName, sendTime, planDetailId);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
            return ObjEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = SpecialistMapping.rehabilitation.saveGuidanceMessage)
    @ApiOperation(value = "康复管理-保存指导留言")
    public Envelop saveGuidanceMessage(@ApiParam(name = "messageId", value = "消息id", required = true)

+ 13 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/dao/rehabilitation/RehabilitationDetailAppointmentDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.dao.rehabilitation;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailAppointmentDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by ysj on 2020/7/10.
 */
public interface RehabilitationDetailAppointmentDao extends PagingAndSortingRepository<RehabilitationDetailAppointmentDO, String>,JpaSpecificationExecutor<RehabilitationDetailAppointmentDO> {
}

+ 36 - 9
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationManageService.java

@ -1,15 +1,9 @@
package com.yihu.jw.service.rehabilitation;
import com.yihu.jw.dao.SpecialistPatientRelationDao;
import com.yihu.jw.dao.rehabilitation.GuidanceMessageLogDao;
import com.yihu.jw.dao.rehabilitation.PatientRehabilitationPlanDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationDetailDao;
import com.yihu.jw.dao.rehabilitation.RehabilitationOperateRecordsDao;
import com.yihu.jw.dao.rehabilitation.*;
import com.yihu.jw.entity.specialist.SpecialistPatientRelationDO;
import com.yihu.jw.entity.specialist.rehabilitation.GuidanceMessageLogDO;
import com.yihu.jw.entity.specialist.rehabilitation.PatientRehabilitationPlanDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationDetailDO;
import com.yihu.jw.entity.specialist.rehabilitation.RehabilitationOperateRecordsDO;
import com.yihu.jw.entity.specialist.rehabilitation.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
@ -21,7 +15,6 @@ import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Sort;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -51,6 +44,32 @@ public class RehabilitationManageService {
    private SpecialistPatientRelationDao specialistPatientRelationDao;
    @Autowired
    private RehabilitationOperateRecordsDao rehabilitationOperateRecordsDao;
    @Autowired
    private RehabilitationDetailAppointmentDao rehabilitationDetailAppointmentDao;
    /**
     * 预约协诊
     * @param doctor
     * @param doctorName
     * @param sendTime
     * @param planDetailId
     */
    public ObjEnvelop appointmentConsultation(String patient,String doctor, String doctorName,
            String appointmentDoctor,String appointmentDoctorName,String sendTime, String planDetailId){
        RehabilitationDetailAppointmentDO appointment = new RehabilitationDetailAppointmentDO();
        appointment.setAppointmentTime(sendTime+":00");
        appointment.setCreateTime(new Date());
        appointment.setDoctor(doctor);
        appointment.setDoctorName(doctorName);
        appointment.setAppointmentDoctor(appointmentDoctor);
        appointment.setAppointmentDoctorName(appointmentDoctorName);
        appointment.setIsSend(0);
        appointment.setRehabilitationPlanDetailId(planDetailId);
        appointment.setPatient(patient);
        rehabilitationDetailAppointmentDao.save(appointment);
        return ObjEnvelop.getSuccess("获取成功",appointment);
    }
    /**
     * 康复管理(专科)-- 计划列表
@ -693,9 +712,11 @@ public class RehabilitationManageService {
        String sql = "select h.name as title,h.content as content,h.code as itemType,d.id,d.execute_time,d.hospital_name,d.status,d.type,d.expense,d.doctor as executeDoctor, " +
                " d.doctor_name as executeDoctorName,p.patient ,p.name as patientName,p.create_user as createDoctor,p.create_user_name as createDoctorName, p.status as planStatus," +
                " p.disease,p.disease_name as diseaseName,p.title as planTitle,d.plan_id as planId,d.relation_code as relationCode,d.frequency_code as frequencyCode,d.remark  "+
                " ,a.appointment_time appointmentTime,a.appointment_doctor appointmentDoctor,a.appointment_doctor_name appointmentDoctorName,d.reservation_type reservationType" +
                " from wlyy_specialist.wlyy_rehabilitation_plan_detail d " +
                " LEFT JOIN wlyy_specialist.wlyy_rehabilitation_service_item h on d.hospital_service_item_id = h.code "+
                " LEFT JOIN wlyy_specialist.wlyy_patient_rehabilitation_plan p on d.plan_id=p.id " +
                " LEFT JOIN wlyy_specialist.wlyy_plan_detail_appointment a on d.id=.a.rehabilitation_plan_detail_id " +
                " where d.id = '"+planDetailId+"'";
        List<Map<String,Object>> serviceItemList = jdbcTemplate.queryForList(sql);
        Map<String,Object> one = serviceItemList.get(0);
@ -706,6 +727,12 @@ public class RehabilitationManageService {
        if(StringUtils.isNotEmpty(doctorCode)&&doctorCode.equals(one.get("executeDoctor")+"")){
            isMyTask=1;
        }
        // 协诊预约信息
        resultMap.put("appointmentTime",one.get("appointmentTime"));
        resultMap.put("appointmentDoctor",one.get("appointmentDoctor"));
        resultMap.put("appointmentDoctorName",one.get("appointmentDoctorName"));
        resultMap.put("reservationType",one.get("reservationType"));//复诊类型:1线上,2线下,3远程
        resultMap.put("frequencyCode",one.get("frequencyCode")+"");
        resultMap.put("isMyTask",isMyTask);//0不是自己的任务,1是自己的任务
//        if(!(one.get("specialistDoctor")+"").equals((one.get("create_user")+""))){