Browse Source

代码修改

liubing 3 years ago
parent
commit
9e62b905a7

+ 4 - 1
common/common-entity/sql记录

@ -1038,4 +1038,7 @@ alter table base.base_service_package_item add column topic_item varchar(50) def
--2021-06-11
ALTER table base.base_security_monitoring_order add column topic_item varchar(50) default "preventLost" COMMENT '安防工单所属专题 base_system_dict_entry表service_item';
ALTER TABLE base.base_security_monitoring_order ADD INDEX idx_topIt(topic_item);
ALTER TABLE base.base_security_monitoring_order ADD INDEX idx_topIt(topic_item);
ALTER TABLE base.base_doctor_patient_tmp MODIFY COLUMN  doctor_code varchar(50) DEFAULT NULL COMMENT 'type=(1,2,4为医生id) ';
ALTER TABLE base.base_doctor_patient_tmp ADD COLUMN org_code varchar(50) DEFAULT NULL COMMENT 'type=(3为机构code)';

+ 9 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/course/DoctorPatientTmpDO.java

@ -17,6 +17,7 @@ public class DoctorPatientTmpDO extends UuidIdentityEntityWithCreateTime {
    private Integer type; //1在线咨询,2上门辅导,3入学报名,4购买课程
    private String relationCode; //1:咨询code,2上门辅导工单id,3入学订单id,4课程订单id
    private String doctorCode;// type=(1,2,4为医生id;3机构code)
    private String orgCode;// type=(1,2,4为医生id;3机构code)
    private Integer status; //入学字段 1已入学,0未入学
    private Integer del;
@ -52,6 +53,14 @@ public class DoctorPatientTmpDO extends UuidIdentityEntityWithCreateTime {
        this.doctorCode = doctorCode;
    }
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    public Integer getStatus() {
        return status;
    }

+ 3 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/course/DoctorPatientTmpDao.java

@ -15,4 +15,7 @@ public interface DoctorPatientTmpDao extends PagingAndSortingRepository<DoctorPa
    @Query(value = "select count(1) from DoctorPatientTmpDO t where t.patient=?1 and t.doctorCode = ?2 and t.type=?3")
    Integer findByPatientAndDoctorCodeAndType(String patient,String doctorCode,Integer type);
    @Query(value = "select count(1) from DoctorPatientTmpDO t where t.patient=?1 and t.orgCode = ?2 and t.type=?3 and t.del=1")
    Integer findByPatientAndOrgCodeAndType(String patient,String orgCode,Integer type);
}

+ 6 - 8
svr/svr-base/src/main/java/com/yihu/jw/base/service/course/RecruitStudentsRecordService.java

@ -1,11 +1,10 @@
package com.yihu.jw.base.service.course;
import com.yihu.jw.base.dao.course.DoctorPatientTmpDao;
import com.yihu.jw.base.dao.course.PatientOrderRefundDao;
import com.yihu.jw.base.dao.course.RecruitStudentsDao;
import com.yihu.jw.base.dao.course.RecruitStudentsRecordDao;
import com.yihu.jw.base.util.EntranceUtil;
import com.yihu.jw.base.util.WxMessageUtil;
import com.yihu.jw.entity.care.course.DoctorPatientTmpDO;
import com.yihu.jw.entity.care.course.PatientOrderRefundDO;
import com.yihu.jw.entity.care.course.RecruitStudentsDO;
import com.yihu.jw.entity.care.course.RecruitStudentsRecordDO;
@ -37,7 +36,7 @@ public class RecruitStudentsRecordService extends BaseJpaService<RecruitStudents
    @Autowired
    private WxMessageUtil wxMessageUtil;
    @Autowired
    private DoctorPatientTmpDao doctorPatientTmpDao;
    private EntranceUtil entranceUtil;
    /**
     * 退费操作
@ -62,6 +61,7 @@ public class RecruitStudentsRecordService extends BaseJpaService<RecruitStudents
    public int leaveSchool(String id){
       int ret = recruitStudentsRecordDao.updateStatus(id);
        entranceUtil.deleteRecord(id);
       return ret;
    }
@ -87,11 +87,8 @@ public class RecruitStudentsRecordService extends BaseJpaService<RecruitStudents
            }else{
                re += recruitStudentsRecordDO.getPatientName()+",";
            }
            DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(id);
            if (tmpDO!=null){
                tmpDO.setStatus(1);
                doctorPatientTmpDao.save(tmpDO);
            }
            entranceUtil.updateStatus(1,id);
        }
        recruitStudentsRecordDao.save(list);
        wxMessageUtil.sengdWxTemplates(list);
@ -115,6 +112,7 @@ public class RecruitStudentsRecordService extends BaseJpaService<RecruitStudents
                recruitStudentsRecordDO.setStatus("4");
                list.add(recruitStudentsRecordDO);
            }
            entranceUtil.deleteRecord(id);
        }
        recruitStudentsRecordDao.save(list);
    }

+ 68 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/util/EntranceUtil.java

@ -0,0 +1,68 @@
package com.yihu.jw.base.util;
import com.yihu.jw.base.dao.course.DoctorPatientTmpDao;
import com.yihu.jw.entity.care.course.DoctorPatientTmpDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
 * 教师与新生儿 入学关系更新工具
 * Created by Bing on 2021/6/11.
 */
@Component
public class EntranceUtil {
    @Autowired
    private DoctorPatientTmpDao doctorPatientTmpDao;
    /**
     *
     * @param patient
     * @param type
     * @param del
     * @param doctorCode
     * @param orgCode
     * @param relationCode
     */
    public void newRecord(String patient,Integer type,Integer del,String doctorCode,String orgCode,String relationCode){
        if (1==type||2==type){//在线咨询与上门辅导不重复保存
            if (doctorPatientTmpDao.findByPatientAndDoctorCodeAndType(patient,orgCode,type)!=0){
                return ;
            }
        }
        DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO();
        tmpDO.setPatient(patient);
        tmpDO.setType(type);
        tmpDO.setDel(del);
        tmpDO.setOrgCode(orgCode);
        tmpDO.setDoctorCode(doctorCode);
        tmpDO.setRelationCode(relationCode);
        doctorPatientTmpDao.save(tmpDO);
    }
    /**
     * 更新状态
     * @param relationCode
     */
    public void updateStatus(Integer status,String relationCode){
        DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(relationCode);
        if (tmpDO!=null){
            tmpDO.setStatus(status);
            doctorPatientTmpDao.save(tmpDO);
        }
    }
    /**
     * 删除记录
     * @param relationCode
     */
    public void deleteRecord(String relationCode){
        DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(relationCode);
        if (tmpDO!=null){
            tmpDO.setDel(0);
            doctorPatientTmpDao.save(tmpDO);
        }
        doctorPatientTmpDao.save(tmpDO);
    }
}

+ 5 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/course/DoctorPatientTmpDao.java

@ -13,6 +13,10 @@ public interface DoctorPatientTmpDao extends PagingAndSortingRepository<DoctorPa
    DoctorPatientTmpDO findByRelationCode(String relationCode);
    @Query(value = "select count(1) from DoctorPatientTmpDO t where t.patient=?1 and t.doctorCode = ?2 and t.type=?3")
    @Query(value = "select count(1) from DoctorPatientTmpDO t where t.patient=?1 and t.doctorCode = ?2 and t.type=?3 and t.del=1")
    Integer findByPatientAndDoctorCodeAndType(String patient,String doctorCode,Integer type);
    @Query(value = "select count(1) from DoctorPatientTmpDO t where t.patient=?1 and t.orgCode = ?2 and t.type=?3 and t.del=1")
    Integer findByPatientAndOrgCodeAndType(String patient,String orgCode,Integer type);
}

+ 3 - 12
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultService.java

@ -3,6 +3,7 @@ package com.yihu.jw.care.service.consult;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.course.DoctorPatientTmpDao;
import com.yihu.jw.care.util.EntranceUtil;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -72,7 +73,7 @@ public class ConsultService {
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    @Autowired
    private DoctorPatientTmpDao doctorPatientTmpDao;
    private EntranceUtil entranceUtil;
    /**
     * 获取居民该机构的最近一次在线咨询
@ -589,20 +590,10 @@ public class ConsultService {
        }
        if (ct.getType()==23){
            if(doctorPatientTmpDao.findByPatientAndDoctorCodeAndType(patient,doctor,1)==0){
                DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO();
                tmpDO.setDoctorCode(doctor);
                tmpDO.setPatient(patient);
                tmpDO.setType(1);
                tmpDO.setDel(1);
                tmpDO.setRelationCode(ct.getConsult());
                doctorPatientTmpDao.save(tmpDO);
            }
            entranceUtil.newRecord(patient,1,1,doctor,null,ct.getConsult());
        }
        // 保存医生咨询信息
        // 添加咨询转发记录
        // 添加医生咨询日志

+ 6 - 25
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/course/CourseService.java

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.course.*;
import com.yihu.jw.care.dao.course.DoctorPatientTmpDao;
import com.yihu.jw.care.util.EntranceUtil;
import com.yihu.jw.care.util.MessageUtil;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -71,7 +72,7 @@ public class CourseService {
    @Autowired
    private MessageUtil messageUtil;
    @Autowired
    private DoctorPatientTmpDao doctorPatientTmpDao;
    private EntranceUtil entranceUtil;
    public String getOrderNo(String type){
        return type + System.currentTimeMillis()+(int)(Math.random() * 900)+100 +"";
@ -91,10 +92,7 @@ public class CourseService {
                return "只有待支付的订单才能取消";
            }
            recordDO.setStatus("7");
            recruitStudentsRecordDao.save(recordDO);
            DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(recordDO.getId());
            tmpDO.setDel(0);
            doctorPatientTmpDao.save(tmpDO);
            entranceUtil.deleteRecord(recordDO.getId());
        }else  if("2".equals(type)){
            //课程
@ -103,11 +101,7 @@ public class CourseService {
                return "只有待支付的订单才能取消";
            }
            recordDO.setStatus("7");
            courseSalesOrderRecordDao.save(recordDO);
            DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(recordDO.getId());
            tmpDO.setDel(0);
            doctorPatientTmpDao.save(tmpDO);
            entranceUtil.deleteRecord(recordDO.getId());
        }
        return null;
    }
@ -812,14 +806,7 @@ public class CourseService {
        //这个机构收到新的在线报名申请时,给机构联系人发送一条短信
        messageUtil.sendOnlineRegistSms(recruitStudentsDO.getOrgCode());
        DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO();
        tmpDO.setPatient(recordDO.getPatient());
        tmpDO.setType(3);
        tmpDO.setStatus(0);//未入取
        tmpDO.setDel(1);
        tmpDO.setDoctorCode(recordDO.getOrgCode());
        tmpDO.setRelationCode(recordDO.getId());
        doctorPatientTmpDao.save(tmpDO);
        entranceUtil.newRecord(recordDO.getPatient(),3,1,null,recordDO.getOrgCode(),recordDO.getId());
        return result;
    }
@ -856,13 +843,7 @@ public class CourseService {
        recordDO.setOrderNo(getOrderNo("2"));
        courseSalesOrderRecordDao.save(recordDO);
        DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO();
        tmpDO.setPatient(recordDO.getPatient());
        tmpDO.setType(4);
        tmpDO.setDel(1);
        tmpDO.setDoctorCode(courseDO.getDoctor());
        tmpDO.setRelationCode(recordDO.getId());
        doctorPatientTmpDao.save(tmpDO);
        entranceUtil.newRecord(recordDO.getPatient(),4,1,courseDO.getDoctor(),null,recordDO.getId());
        return recordDO;
    }

+ 6 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/course/RecruitStudentService.java

@ -3,6 +3,7 @@ package com.yihu.jw.care.service.course;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.course.RecruitStudentsDao;
import com.yihu.jw.care.dao.course.RecruitStudentsRecordDao;
import com.yihu.jw.care.util.EntranceUtil;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
@ -41,6 +42,8 @@ public class RecruitStudentService {
    private RecruitStudentsDao recruitStudentsDao;
    @Autowired
    private BaseDoctorHospitalDao baseDoctorHospitalDao;
    @Autowired
    private EntranceUtil entranceUtil;
    /**
     * 在线报名-已报名数量
@ -150,6 +153,7 @@ public class RecruitStudentService {
        }
        recruitStudentsRecordDO.setStatus("2");
        recruitStudentsRecordDao.save(recruitStudentsRecordDO);
        entranceUtil.updateStatus(1,id);
        return null;
    }
@ -184,6 +188,8 @@ public class RecruitStudentService {
        }
        recruitStudentsRecordDO.setStatus("4");
        recruitStudentsRecordDao.save(recruitStudentsRecordDO);
        entranceUtil.deleteRecord(id);
        return null;
    }
}

+ 17 - 22
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -310,26 +310,25 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        return result;
    }
    //已入学未入学统一从base_doctor_patient_tmp该表查询
    //未入学:发起咨询的幼儿列表、发起上门辅导的幼儿列表、已报名但是未录取的幼儿
    public PageEnvelop getTeacherChildren(String doctor,int searchType,String name,int page,int size){
        page = page>0?page-1:0;
        List<Map<String,Object>> list = new ArrayList<>();
        //未入学
        String sql0 = "select * from  " +
                " (select Distinct patient,'1' as type from base_doctor_patient_tmp where type=1 and doctor_code='"+doctor+"' and del=1 " +
        String sql0 = "select Distinct patient,'1' as type from base_doctor_patient_tmp where type=1 and doctor_code='"+doctor+"' and del=1 " +
                " UNION " +
                " select Distinct patient,'2' as type from base_doctor_patient_tmp where type=2 and doctor_code='"+doctor+"' and del=1 " +
                " UNION " +
                " select Distinct patient,'4' as type from base_doctor_patient_tmp where type=4 and doctor_code='"+doctor+"' and del=1 " +
                " UNION " +
                " select tmp.patient,'3' as type from base_doctor_patient_tmp tmp INNER JOIN base_doctor_hospital dh on dh.org_code = tmp.doctor_code " +
                " and dh.del =1 where tmp.type=3 and dh.doctor_code='"+doctor+"' and tmp.del=1 and tmp.`status`=0)B where  " +
                " not EXISTS (select DISTINCT rsr.patient  from base_recruit_students_record rsr INNER JOIN  base_org org on rsr.org_code = org.`code` " +
                " and org.del=1  INNER JOIN base_doctor_hospital dh on rsr.org_code = dh.org_code and dh.del =1  where rsr.patient=B.patient and " +
                " dh.doctor_code='"+doctor+"'   and rsr.del<>0  and rsr.`status` = 2 )";
                " select tmp.patient,'3' as type from base_doctor_patient_tmp tmp INNER JOIN base_doctor_hospital dh on dh.org_code = tmp.org_code " +
                " and dh.del =1 where tmp.type=3 and dh.doctor_code='"+doctor+"' and tmp.del=1 and tmp.`status`=0 ";
        //已入学
        String sql1=" select DISTINCT rsr.patient,null as type from base_recruit_students_record rsr INNER JOIN  base_org org on rsr.org_code = org.`code` " +
                "and org.del=1 INNER JOIN base_doctor_hospital dh on rsr.org_code = dh.org_code and dh.del =1  where dh.doctor_code='"+doctor+"' " +
                "and rsr.del<>0  and rsr.`status` = 2   ";
        String sql1=" select tmp.patient,'3' as type from base_doctor_patient_tmp tmp INNER JOIN base_doctor_hospital dh on dh.org_code = tmp.org_code " +
                " and dh.del =1 where tmp.type=3 and dh.doctor_code='"+doctor+"' and tmp.del=1 and tmp.`status`=0   ";
        String sql = "select p.id,p.name,p.photo,p.sex,p.idcard,p.openid,p.mobile,group_concat(tmp.type) type,group_concat( pd.category_code) deviceType from ( {sqlReplace} )tmp " +
                " Inner JOIN base_patient p on tmp.patient  = p.id " +
                " LEFT JOIN wlyy_patient_device pd on pd.`user`=p.id and pd.category_code BETWEEN 1 and 2 GROUP BY p.id limit "+page*size+","+size;
@ -383,22 +382,18 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    public Map<String,Long> getTeacherChildrenCount(String doctor){
        Map<String,Long> result = new HashMap<>();
        //未入学 (发起咨询的幼儿列表,发起上门辅导的幼儿列表,已报名但是未录取的幼儿)
        String sql0 = "select * from  " +
                " (select Distinct patient from base_doctor_patient_tmp where type=1 and doctor_code='"+doctor+"' and del=1 " +
        //未入学
        String sql0 = "select Distinct patient,'1' as type from base_doctor_patient_tmp where type=1 and doctor_code='"+doctor+"' and del=1 " +
                " UNION " +
                " select Distinct patient from base_doctor_patient_tmp where type=2 and doctor_code='"+doctor+"' and del=1 " +
                " select Distinct patient,'2' as type from base_doctor_patient_tmp where type=2 and doctor_code='"+doctor+"' and del=1 " +
                " UNION " +
                " select Distinct patient from base_doctor_patient_tmp where type=4 and doctor_code='"+doctor+"' and del=1 " +
                " select Distinct patient,'4' as type from base_doctor_patient_tmp where type=4 and doctor_code='"+doctor+"' and del=1 " +
                " UNION " +
                " select tmp.patient from base_doctor_patient_tmp tmp INNER JOIN base_doctor_hospital dh on dh.org_code = tmp.doctor_code " +
                " and dh.del =1 where tmp.type=3 and dh.doctor_code='"+doctor+"' and tmp.del=1 and tmp.`status`=0)B where  " +
                " not EXISTS (select DISTINCT rsr.patient  from base_recruit_students_record rsr INNER JOIN  base_org org on rsr.org_code = org.`code` " +
                " and org.del=1  INNER JOIN base_doctor_hospital dh on rsr.org_code = dh.org_code and dh.del =1  where rsr.patient=B.patient and " +
                " dh.doctor_code='"+doctor+"'   and rsr.del<>0  and rsr.`status` = 2 )";
                " select tmp.patient,'3' as type from base_doctor_patient_tmp tmp INNER JOIN base_doctor_hospital dh on dh.org_code = tmp.org_code " +
                " and dh.del =1 where tmp.type=3 and dh.doctor_code='"+doctor+"' and tmp.del=1 and tmp.`status`=0 ";
        //已入学
        String sql1=" select DISTINCT rsr.patient from base_recruit_students_record rsr INNER JOIN  base_org org on rsr.org_code = org.`code` " +
                "and org.del=1 INNER JOIN base_doctor_hospital dh on rsr.org_code = dh.org_code and dh.del =1  where dh.doctor_code='"+doctor+"' " +
                "and rsr.del<>0  and rsr.`status` = 2   ";
        String sql1=" select tmp.patient,'3' as type from base_doctor_patient_tmp tmp INNER JOIN base_doctor_hospital dh on dh.org_code = tmp.org_code " +
                " and dh.del =1 where tmp.type=3 and dh.doctor_code='"+doctor+"' and tmp.del=1 and tmp.`status`=0   ";
        String sqlcpunt = "select count(Distinct p.id) from ( {sqlReplace} )tmp Inner JOIN base_patient p on tmp.patient  = p.id " +
                " LEFT JOIN wlyy_patient_device pd on pd.`user`=p.id and pd.category_code BETWEEN 1 and 2  ";

+ 3 - 10
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java

@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.care.dao.doorCoach.*;
import com.yihu.jw.care.dao.course.DoctorPatientTmpDao;
import com.yihu.jw.care.service.consult.ConsultTeamService;
import com.yihu.jw.care.util.EntranceUtil;
import com.yihu.jw.care.util.MessageUtil;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
@ -121,7 +122,7 @@ public class DoctorDoorCoachOrderService {
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @Autowired
    private DoctorPatientTmpDao doctorPatientTmpDao;
    private EntranceUtil entranceUtil;
    /**
     * 根据id获取服务工单信息
@ -457,15 +458,7 @@ public class DoctorDoorCoachOrderService {
        }
        //  待接单消息设为已操作, 434 医生接单-- 王五接受了服务工单12345678
        messageUtil.updateDoorCoachMessage(doorServiceOrder,new String[]{"703","707"},"734",null,null);
        if(doctorPatientTmpDao.findByPatientAndDoctorCodeAndType(doorServiceOrder.getPatient(),doorServiceOrder.getDoctor(),2)==0){
            DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO();
            tmpDO.setDoctorCode(doorServiceOrder.getDoctor());
            tmpDO.setPatient(doorServiceOrder.getPatient());
            tmpDO.setType(2);
            tmpDO.setDel(1);
            tmpDO.setRelationCode(doorServiceOrder.getId());
            doctorPatientTmpDao.save(tmpDO);
        }
        entranceUtil.newRecord(doorServiceOrder.getPatient(),2,1,doorServiceOrder.getDoctor(),null,doorServiceOrder.getId());
    }

+ 68 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/EntranceUtil.java

@ -0,0 +1,68 @@
package com.yihu.jw.care.util;
import com.yihu.jw.care.dao.course.DoctorPatientTmpDao;
import com.yihu.jw.entity.care.course.DoctorPatientTmpDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
 * 教师与新生儿 入学关系更新工具
 * Created by Bing on 2021/6/11.
 */
@Component
public class EntranceUtil {
    @Autowired
    private DoctorPatientTmpDao doctorPatientTmpDao;
    /**
     *
     * @param patient
     * @param type
     * @param del
     * @param doctorCode
     * @param orgCode
     * @param relationCode
     */
    public void newRecord(String patient,Integer type,Integer del,String doctorCode,String orgCode,String relationCode){
        if (1==type||2==type){//在线咨询与上门辅导不重复保存
            if (doctorPatientTmpDao.findByPatientAndDoctorCodeAndType(patient,orgCode,type)!=0){
                return ;
            }
        }
        DoctorPatientTmpDO tmpDO = new DoctorPatientTmpDO();
        tmpDO.setPatient(patient);
        tmpDO.setType(type);
        tmpDO.setDel(del);
        tmpDO.setOrgCode(orgCode);
        tmpDO.setDoctorCode(doctorCode);
        tmpDO.setRelationCode(relationCode);
        doctorPatientTmpDao.save(tmpDO);
    }
    /**
     * 更新状态
     * @param relationCode
     */
    public void updateStatus(Integer status,String relationCode){
        DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(relationCode);
        if (tmpDO!=null){
            tmpDO.setStatus(status);
            doctorPatientTmpDao.save(tmpDO);
        }
    }
    /**
     * 删除记录
     * @param relationCode
     */
    public void deleteRecord(String relationCode){
        DoctorPatientTmpDO tmpDO = doctorPatientTmpDao.findByRelationCode(relationCode);
        if (tmpDO!=null){
            tmpDO.setDel(0);
            doctorPatientTmpDao.save(tmpDO);
        }
        doctorPatientTmpDao.save(tmpDO);
    }
}