wangjun 4 år sedan
förälder
incheckning
3bbbb72502

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/dao/OutpatientDao.java

@ -18,8 +18,8 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(0,1)")
    List<WlyyOutpatientDO> findByPatientList(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.status in(3) order by a.createTime desc ")
    List<WlyyOutpatientDO> findByPatientListByStatus(String patient);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.outpatientType =?2 and a.status in(3) order by a.createTime desc ")
    List<WlyyOutpatientDO> findByPatientListByStatus(String patient,String outpatientType);
    @Query("from WlyyOutpatientDO a where a.patient = ?1 and a.hisStatus=1 and a.createTime>=?2 and a.createTime<=?3")
    List<WlyyOutpatientDO> findByPatientListNoStatus(String patient,Date startDate,Date endDate);

+ 153 - 69
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -838,21 +838,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        outpatientDO.setStatus("0");
        outpatientDO.setCreateTime(new Date());
        outpatientDO.setIdcard(patientDO.getIdcard());
        outpatientDO.setOutpatientType("1");
        outpatientDO.setCreateTime(new Date());
        if (outpatientDO.getRegisterDate() == null) {
            outpatientDO.setRegisterDate(new Date());
        }
        WlyyPrescriptionExpressageDO previous = checkOutPatientPre(outpatientDO.getPatient());
        //2.物流信息
        WlyyPrescriptionExpressageDO expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
        if (null!=previous.getId()&&previous.getOneselfPickupFlg()!=expressageDO.getOneselfPickupFlg()){
            WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
            wlyyOutpatientDO.setRemindCount(previous.getOneselfPickupFlg());
            return wlyyOutpatientDO;
        WlyyPrescriptionExpressageDO expressageDO = new WlyyPrescriptionExpressageDO();
        if(!outpatientDO.getOutpatientType().equalsIgnoreCase("3")){
            WlyyPrescriptionExpressageDO previous = checkOutPatientPre(outpatientDO.getPatient());
            //2.物流信息
            expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
            if (null!=previous.getId()&&previous.getOneselfPickupFlg()!=expressageDO.getOneselfPickupFlg()){
                WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
                wlyyOutpatientDO.setRemindCount(previous.getOneselfPickupFlg());
                return wlyyOutpatientDO;
            }
        }
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
        Double price = 0.0;
@ -867,8 +870,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            outpatientDO.setPayStatus(0);
        }
        if ("3".equalsIgnoreCase(outpatient.getOutpatientType())){
            BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "专家咨询费", "1", "专家咨询费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        }else{
            BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "复诊-诊查费", "2", "复诊-诊查费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "复诊-诊查费", "2", "复诊-诊查费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        }
        WlyyPatientRegisterTimeDO registerTimeDO = null;
        WlyyPatientRegisterTimeDO wlyyPatientRegisterTimeDO =new WlyyPatientRegisterTimeDO();
@ -883,36 +890,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        } catch (Exception e) {
            throw new RuntimeException("号源已经被预约,请选择其他号源");
        }
        if (0==expressageDO.getOneselfPickupFlg()){
            if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                expressageDO.setHospitalCode(drugCode);
        if (!outpatientDO.getOutpatientType().equalsIgnoreCase("3")){
            if (0==expressageDO.getOneselfPickupFlg()){
                if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                    String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                    expressageDO.setHospitalCode(drugCode);
                }
                System.out.println("进入物流信息");
                expressageDO.setDel(1);
                expressageDO.setCreateTime(new Date());
                expressageDO.setOutpatientId(outpatient.getId());
                prescriptionExpressageDao.save(expressageDO);
            }else {
                System.out.println("写入自取信息");
                String drugStoreCode = expressageDO.getHospitalCode();
                BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
                if (null!=baseDrugStoreDO){
                    expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                    expressageDO.setCityName(baseDrugStoreDO.getCityName());
                    expressageDO.setProvinceCode(baseDrugStoreDO.getProvinceCode());
                    expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                    expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                    expressageDO.setTownName(baseDrugStoreDO.getTownName());
                    expressageDO.setHospitalCode(baseDrugStoreDO.getDrugStoreCode());
                    expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                    expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
                }
                expressageDO.setDel(1);
                expressageDO.setCreateTime(new Date());
                expressageDO.setOutpatientId(outpatient.getId());
                prescriptionExpressageDao.save(expressageDO);
            }
            System.out.println("进入物流信息");
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }else {
            System.out.println("写入自取信息");
            String drugStoreCode = expressageDO.getHospitalCode();
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
            if (null!=baseDrugStoreDO){
                expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                expressageDO.setCityName(baseDrugStoreDO.getCityName());
                expressageDO.setProvinceCode(baseDrugStoreDO.getProvinceCode());
                expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                expressageDO.setTownName(baseDrugStoreDO.getTownName());
                expressageDO.setHospitalCode(baseDrugStoreDO.getDrugStoreCode());
                expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
            }
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }
        if (wechatId.equalsIgnoreCase("xm_xzzx_wx")){
            logger.info("心脏中心同步患者开始");
@ -1133,14 +1141,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public Map<String, Object> checkOutpatient(String patient,String wxId,boolean flag) throws Exception {
    public Map<String, Object> checkOutpatient(String patient,String wxId,boolean flag,String outpatientType) throws Exception {
        //-1卡余额不足,,-2 存在未结束的诊断热 1成功
        Map<String, Object> rs = new HashedMap();
        //1.余额判断改到前端判断
        //net.sf.json.JSONObject json = entranceService.qutpatientBalance(cardNo,demoFlag);
        if (flag){
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                List<WlyyOutpatientDO> outpatientDOS = outpatientDao.findByPatientListByStatus(patient);
                List<WlyyOutpatientDO> outpatientDOS = outpatientDao.findByPatientListByStatus(patient,outpatientType);
                if (outpatientDOS!=null&&outpatientDOS.size()!=0){
                    WlyyOutpatientDO outpatientDO = outpatientDOS.get(0);
                    if (outpatientDO.getHisStatus()!=null){
@ -3850,16 +3858,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                data.put("gender", IdCardUtil.getSexForIdcard(wlyyOutpatientDO.getIdcard()));
                data.put("question", wlyyOutpatientDO.getIcd10Name());
                String msg = "";
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "9");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuseRemind", cancelRemark);
                }
                if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "16");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuseRemind", cancelRemark);
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())||"2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){
                    if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                        data.put("type", "9");
                        msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                        sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuseRemind", cancelRemark);
                    }
                    if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                        data.put("type", "16");
                        msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                        sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuseRemind", cancelRemark);
                    }
                }else {
                    if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                        data.put("type", "1");
                        msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文咨询已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                        sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "1", "doctorRefuseRemind", cancelRemark);
                    }
                    if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                        data.put("type", "17");
                        msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频咨询已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                        sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "17", "doctorRefuseRemind", cancelRemark);
                    }
                }
                data.put("msg", msg);
                messageDO.setData(data.toString());
                systemMessageService.saveMessage(messageDO);
@ -3956,6 +3978,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已取消";
            }
            if ("1".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已取消";
            }
            if ("17".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已取消";
            }
            logger.info("doctorRefuseRemind医生拒诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("outPatientTimeOutRemind".equalsIgnoreCase(titelType)) {
@ -4488,6 +4518,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //协同门诊
        if (3 == type) {
            sql += " AND room.reservation_type=2 ";
        } else if (4==type){
            //专家咨询
            sql += " AND room.reservation_type=2 AND room.consult_type in (1,2,3)";
        } else {
            //在线复诊
            sql += " AND room.reservation_type=1 AND room.consult_type=" + type;
@ -5892,7 +5925,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return waitCount.toString();
    }
    public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId) {
    public com.alibaba.fastjson.JSONArray getWaitingForVisitVideoPrescriptionByDoctor(String doctor, String wxId,String outpatientType) {
        String condition = "";
        if ("xm_ykyy_wx".equals(wxId)) {
            if(flag){
@ -5936,11 +5969,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "AND outpatient.status = 0 " +
                "AND outpatient.pay_status = 1 " +
                "AND room.doctor='" + doctor + "' " +
                "AND room.reservation_time is not null " +
                "AND room.consult_type= 2 ";/* +
                "AND room.reservation_time is not null ";/* +
                "AND room.reservation_time >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' order by room.reservation_time ASC ";
//                "AND room.reservation_time>='"+DateUtil.getStringDate("yyyy-MM-dd")+" 00:00:00"+"' ";*/
        if(StringUtils.isNotBlank(outpatientType)){
            sql+=" AND outpatient.type= 2 and outpatient.outpatient_type ="+outpatientType;
        }else {
            sql+="AND room.consult_type= 2 ";
        }
        if ("xm_ykyy_wx".equals(wxId)) {
            if(flag){
                sql += " AND room.reservation_time >= str_to_date('" + DateUtil.dateToStrShort(new Date()) + " 00:00:00','YYYY-MM-DD HH24:MI:SS')";
@ -6310,7 +6346,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "AND outpatient.doctor='" + doctor + "' " +
                "AND outpatient.pay_status = 1 " +
                "AND outpatient.outpatient_type= '" + outpatient_type + "'  ";
        if ("1".equals(outpatient_type)) {//复诊
        if ("1".equals(outpatient_type)||"3".equals(outpatient_type)) {//复诊
            sql = sql + " AND outpatient.type= '" + type + "' ";
            if ("2".equals(type)) {//视频复诊才需要判断时间,
                if ("xm_ykyy_wx".equals(wxId)) {
@ -6451,21 +6487,27 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if ("2".equals(outpatient.getOutpatientType())) {
                systemMessageDO.setTitle("协同门诊");
                systemMessageDO.setType("3");
            } else {
                //1.图文 2.视频
            } else if ("3".equals(outpatient.getOutpatientType())) {//专家咨询
                //1.图文 2.视频 3家医
                if ("1".equals(outpatient.getType())) {
                    systemMessageDO.setTitle("图文复诊");
                    systemMessageDO.setType("1");
                    systemMessageDO.setTitle("图文咨询");
                    systemMessageDO.setType("4");
                    if (payFlag){
                        saveInquirySystemMessage(outpatient,null);
                    }
                } else {
                    systemMessageDO.setTitle("视频复诊预约成功");
                } else if("3".equals(outpatient.getType())){
                    systemMessageDO.setTitle("家医咨询");
                    systemMessageDO.setType("15");
                    if (payFlag){
                        saveInquirySystemMessage(outpatient,null);
                    }
                }else {
                    systemMessageDO.setTitle("视频咨询预约成功");
                    systemMessageDO.setType("2");
                    if (payFlag){
                        saveInquirySystemMessage(outpatient,null);
                    }
                    msg = "您的视频复诊已预约成功。\n" +
                    msg = "您的视频咨询已预约成功。\n" +
                            "预计" + outpatient.getDoctorName() + "医生将于" + outpatient.getRegisterDate() + " 与您进行视频咨询。请留意系统消息或微信公众号消息。咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
                    systemMessageDO.setReceiver(outpatient.getDoctor());
                    systemMessageDO.setReceiverName(outpatient.getDoctorName());
@ -6484,7 +6526,40 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    systemMessageService.saveMessage(systemMessageDO);
                    sendWxTemplateMsg(wechatId, outpatient.getId(),null, "17", "videoOrderRemind", "");
                }
            }
            } else if ("1".equals(outpatient.getOutpatientType()))  {//在线复诊
                    //1.图文 2.视频
                    if ("1".equals(outpatient.getType())) {
                        systemMessageDO.setTitle("图文复诊");
                        systemMessageDO.setType("1");
                        if (payFlag){
                            saveInquirySystemMessage(outpatient,null);
                        }
                    } else {
                        systemMessageDO.setTitle("视频复诊预约成功");
                        systemMessageDO.setType("2");
                        if (payFlag){
                            saveInquirySystemMessage(outpatient,null);
                        }
                        msg = "您的视频复诊已预约成功。\n" +
                                "预计" + outpatient.getDoctorName() + "医生将于" + outpatient.getRegisterDate() + " 与您进行视频咨询。请留意系统消息或微信公众号消息。咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
                        systemMessageDO.setReceiver(outpatient.getDoctor());
                        systemMessageDO.setReceiverName(outpatient.getDoctorName());
                        systemMessageDO.setRelationCode(outpatient.getId());
                        systemMessageDO.setSender(outpatient.getPatient());
                        systemMessageDO.setSenderName(outpatient.getPatientName());
                        systemMessageDO.setRelationCode(outpatient.getId());
                        data.put("name", outpatient.getPatientName());
                        data.put("age", IdCardUtil.getAgeForIdcard(outpatient.getIdcard()));
                        data.put("gender", IdCardUtil.getSexForIdcard_new(outpatient.getIdcard()));
                        data.put("question", outpatient.getDescription());
                        data.put("msg", msg);
                        systemMessageDO.setData(data.toString());
                        systemMessageService.saveMessage(systemMessageDO);
                        sendWxTemplateMsg(wechatId, outpatient.getId(),null, "17", "videoOrderRemind", "");
                    }
                }
            BasePatientDO patient = basePatientDao.findById(outpatient.getPatient());
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                ykyyService.pushNotificationToYktPatient(patient.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString());
@ -6505,14 +6580,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        systemMessageDO.setType("11");
        JSONObject data = new JSONObject();
        if (outpatient!=null){
            if ("1".equals(outpatient.getType())) {
                type = "9";
                msg = outpatient.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
            } else if ("2".equals(outpatient.getType())){
                type = "16";
                msg = outpatient.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
            if("1"==outpatient.getOutpatientType()){
                if ("1".equals(outpatient.getType())) {
                    type = "9";
                    msg = outpatient.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
                } else if ("2".equals(outpatient.getType())){
                    type = "16";
                    msg = outpatient.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
                }
            }else if ("3"==outpatient.getOutpatientType()){
                if ("1".equals(outpatient.getType())) {
                    type = "1";
                    msg = outpatient.getPatientName() + ",您好!您有一个图文咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
                } else if ("2".equals(outpatient.getType())){
                    type = "17";
                    msg = outpatient.getPatientName() + ",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
                }
            }
            systemMessageDO.setSender(outpatient.getDoctor());
            systemMessageDO.setSenderName(outpatient.getDoctorName());
            systemMessageDO.setRelationCode(outpatient.getId());

+ 65 - 46
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -178,7 +178,6 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        outpatientDO.setStatus("0");
        outpatientDO.setCreateTime(new Date());
        outpatientDO.setIdcard(patientDO.getIdcard());
        outpatientDO.setOutpatientType("1");
        outpatientDO.setCreateTime(new Date());
        if (!payFlag){
            outpatientDO.setPayStatus(1);
@ -191,21 +190,39 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        BusinessOrderDO businessOrderDO = new BusinessOrderDO();
        businessOrderDO.setRelationCode(outpatient.getId());
        businessOrderDO.setRelationName("复诊-诊查费");
        businessOrderDO.setDescription("复诊-诊查费");
        businessOrderDO.setRematk(outpatient.getDescription());
        businessOrderDO.setPatient(outpatient.getConsumer());
        businessOrderDO.setPatientName(outpatient.getConsumerName());
        businessOrderDO.setDoctor(outpatient.getDoctor());
        if (outpatientDO.getType().equalsIgnoreCase("1")) {
            businessOrderDO.setOrderType(1);
            businessOrderDO.setOrderCategory("2");
        } else if (outpatientDO.getType().equalsIgnoreCase("2")) {
            businessOrderDO.setOrderType(3);
            businessOrderDO.setOrderCategory("3");
        if("3".equalsIgnoreCase(outpatient.getOutpatientType())){
            businessOrderDO.setRelationCode(outpatient.getId());
            businessOrderDO.setRelationName("专家咨询费");
            businessOrderDO.setDescription("专家咨询费");
            businessOrderDO.setRematk(outpatient.getDescription());
            businessOrderDO.setPatient(outpatient.getConsumer());
            businessOrderDO.setPatientName(outpatient.getConsumerName());
            businessOrderDO.setDoctor(outpatient.getDoctor());
            if (outpatientDO.getType().equalsIgnoreCase("1")) {
                businessOrderDO.setOrderType(1);
                businessOrderDO.setOrderCategory("1");
            } else if (outpatientDO.getType().equalsIgnoreCase("2")) {
                businessOrderDO.setOrderType(3);
                businessOrderDO.setOrderCategory("1");
            }
        }else {
            businessOrderDO.setRelationCode(outpatient.getId());
            businessOrderDO.setRelationName("复诊-诊查费");
            businessOrderDO.setDescription("复诊-诊查费");
            businessOrderDO.setRematk(outpatient.getDescription());
            businessOrderDO.setPatient(outpatient.getConsumer());
            businessOrderDO.setPatientName(outpatient.getConsumerName());
            businessOrderDO.setDoctor(outpatient.getDoctor());
            if (outpatientDO.getType().equalsIgnoreCase("1")) {
                businessOrderDO.setOrderType(1);
                businessOrderDO.setOrderCategory("2");
            } else if (outpatientDO.getType().equalsIgnoreCase("2")) {
                businessOrderDO.setOrderType(3);
                businessOrderDO.setOrderCategory("3");
            }
        }
        if (!flag){
            businessOrderDO = businessOrderService.saveOrder(businessOrderDO);
        }
@ -223,45 +240,47 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        } catch (Exception e) {
            throw new RuntimeException("号源已经被预约,请选择其他号源");
        }
        if ("3".equalsIgnoreCase(outpatient.getOutpatientType())){
        //2.物流信息
        WlyyPrescriptionExpressageDO expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
        expressageDO.setDel(1);
        expressageDO.setCreateTime(new Date());
        expressageDO.setOutpatientId(outpatient.getId());
        prescriptionExpressageDao.save(expressageDO);
        if (0==expressageDO.getOneselfPickupFlg()){
            if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                expressageDO.setHospitalCode(drugCode);
            }
            System.out.println("进入物流信息");
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }else {
            System.out.println("写入自取信息");
            String drugStoreCode = expressageDO.getHospitalCode();
            BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
            if (null!=baseDrugStoreDO){
                expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                expressageDO.setCityName(baseDrugStoreDO.getCityName());
                expressageDO.setProvinceCode(baseDrugStoreDO.getProvinceCode());
                expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                expressageDO.setTownName(baseDrugStoreDO.getTownName());
                expressageDO.setHospitalCode(baseDrugStoreDO.getDrugStoreCode());
                expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
            }
            //2.物流信息
            WlyyPrescriptionExpressageDO expressageDO = objectMapper.readValue(expressageJson, WlyyPrescriptionExpressageDO.class);
            expressageDO.setDel(1);
            expressageDO.setCreateTime(new Date());
            expressageDO.setOutpatientId(outpatient.getId());
            prescriptionExpressageDao.save(expressageDO);
        }
            if (0==expressageDO.getOneselfPickupFlg()){
                if("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                    String drugCode= expressageDO.getHospitalCode()==null?"5550":expressageDO.getHospitalCode();
                    expressageDO.setHospitalCode(drugCode);
                }
                System.out.println("进入物流信息");
                expressageDO.setDel(1);
                expressageDO.setCreateTime(new Date());
                expressageDO.setOutpatientId(outpatient.getId());
                prescriptionExpressageDao.save(expressageDO);
            }else {
                System.out.println("写入自取信息");
                String drugStoreCode = expressageDO.getHospitalCode();
                BaseDrugStoreDO baseDrugStoreDO = baseDrugStoreDao.findDrugByid(drugStoreCode);
                if (null!=baseDrugStoreDO){
                    expressageDO.setCityCode(baseDrugStoreDO.getCityCode());
                    expressageDO.setCityName(baseDrugStoreDO.getCityName());
                    expressageDO.setProvinceCode(baseDrugStoreDO.getProvinceCode());
                    expressageDO.setProvinceName(baseDrugStoreDO.getProvinceName());
                    expressageDO.setTownCode(baseDrugStoreDO.getTownCode());
                    expressageDO.setTownName(baseDrugStoreDO.getTownName());
                    expressageDO.setHospitalCode(baseDrugStoreDO.getDrugStoreCode());
                    expressageDO.setHospitalName(baseDrugStoreDO.getHospitalName());
                    expressageDO.setHospitalAddress(baseDrugStoreDO.getAddress());
                }
                expressageDO.setDel(1);
                expressageDO.setCreateTime(new Date());
                expressageDO.setOutpatientId(outpatient.getId());
                prescriptionExpressageDao.save(expressageDO);
            }
        }
        //3.创建候诊室
        createRoom(outpatient, chargeType);
        return outpatient;

+ 80 - 7
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -1,5 +1,6 @@
package com.yihu.jw.im.service;
import ch.qos.logback.core.joran.conditional.ElseAction;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
@ -65,6 +66,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.xml.bind.Element;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@ -1195,7 +1197,22 @@ public class ImService {
					consultName.put("patientName",p.getName());
					consultName.put("doctorName",doctor.getName());
					jsonObject.put("name",consultName.toJSONString());
				}else{
				}else if ("3".equals(wlyyOutpatientDO.getOutpatientType())){
					if (wlyyOutpatientDO.getType().equalsIgnoreCase("1")){
						users.put(patient, 0);
						ct.setType(1);
						consultTitle = "图文咨询";
					}else if (wlyyOutpatientDO.getType().equalsIgnoreCase("2")){
						users.put(patient, 0);
						ct.setType(17);
						consultTitle = "视频咨询";
					}else {
						users.put(patient, 0);
						ct.setType(15);
						consultTitle = "家医咨询";
					}
				} else{
					users.put(patient, 0);
					consultTitle = "申请复诊";
				}
@ -1253,12 +1270,27 @@ public class ImService {
					sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
					obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_COLLABORATION_HOSPITAL);
				}else{
				}else if("3".equals(wlyyOutpatientDO.getOutpatientType())){
					messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
					//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
					sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
					if(1== type){
					if("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
						//图文咨询
						obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_MUC);
					}
					else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
						//视频咨询
						obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_MUC_VIDEO);
					}else{
						obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_GENERAL_EXPERT);
					}
				} else{
					messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
					//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
					sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
					if("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
						//图文复诊
						obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_EXAMINATION);
					}else{
@ -1338,6 +1370,15 @@ public class ImService {
				imUtil.sendMessage(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getGeneralDoctor(),"1",object.toString());
				//医生接诊发送导诊护士外层消息
				this.sendOutpatientGuaidanceMessage(wlyyOutpatientDO);
			}else {
				//专家咨询
				System.out.println("发送外层SOCKET消息:专家咨询");
				JSONObject object = new JSONObject();
				object.put("socket_sms_type",5);
				object.put("relation_code",wlyyOutpatientDO.getId());
				imUtil.sendMessage(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getPatient(),"1",object.toString());
				//医生接诊发送导诊护士外层消息
				this.sendOutpatientGuaidanceMessage(wlyyOutpatientDO);
			}
			return result;
		}
@ -1384,7 +1425,22 @@ public class ImService {
			consultName.put("patientName",p.getName());
			consultName.put("doctorName",doctor.getName());
			jsonObject.put("name",consultName.toJSONString());
		}else{
		}else if ("3".equals(wlyyOutpatientDO.getOutpatientType())){
			if (wlyyOutpatientDO.getType().equalsIgnoreCase("1")){
				users.put(patient, 0);
				ct.setType(1);
				consultTitle = "图文咨询";
			}else if (wlyyOutpatientDO.getType().equalsIgnoreCase("2")){
				users.put(patient, 0);
				ct.setType(17);
				consultTitle = "视频咨询";
			}else {
				users.put(patient, 0);
				ct.setType(15);
				consultTitle = "家医咨询";
			}
		}  else{
			users.put(patient, 0);
			consultTitle = "申请复诊";
		}
@ -1442,12 +1498,27 @@ public class ImService {
			sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
			obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_COLLABORATION_HOSPITAL);
		}else{
		}else if("3".equals(wlyyOutpatientDO.getOutpatientType())){
			messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
			//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
			sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
			if("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
				//图文咨询
				obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_MUC);
			}
			else if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())){
				//视频咨询
				obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_MUC_VIDEO);
			}else{
				obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_GENERAL_EXPERT);
			}
		} else{
			messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
			//5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
			sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
			if(1== type){
			if("1".equalsIgnoreCase(wlyyOutpatientDO.getType())){
				//图文复诊
				obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_EXAMINATION);
			}else{
@ -1489,7 +1560,7 @@ public class ImService {
		JSONObject result = imUtil.getSingleSessionInfo(sessionId,doctorCode);
		//发送外层SOCKET消息 在线复诊
		if("1".equals(wlyyOutpatientDO.getOutpatientType())){
		if("1".equals(wlyyOutpatientDO.getOutpatientType())||"3".equals(wlyyOutpatientDO.getOutpatientType())){
			System.out.println("发送外层SOCKET消息:在线复诊");
			JSONObject object = new JSONObject();
			object.put("socket_sms_type",5);
@ -1527,6 +1598,8 @@ public class ImService {
			msgStr = msgStr + "  已开始复诊";
		}else if("2".equals(wlyyOutpatientDO.getOutpatientType())){
			msgStr = msgStr + "  已开始协同门诊";
		}else {
			msgStr = msgStr + "  已开始专家咨询";
		}
		object.put("msg",msgStr);

+ 6 - 5
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -658,9 +658,6 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                String idcard = patient.getString("idcard");
                BasePatientDO patientDO2 = patientDao.findByIdcardAndDel(idcard,"1");
                BasePatientDO patient1 = new BasePatientDO();
                if (patientDO2!=null){
                    patient1=patientDO2;
                }
                String salt = UUID.randomUUID().toString().substring(0,5);
                String mobile = patient.getString("mobile");
                String pw = null;
@ -669,10 +666,14 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
                }else{
                    pw = idcard.substring(idcard.length()-6);
                }
                if (patientDO2!=null){
                    patient1=patientDO2;
                }else {
                    patient1.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                    patient1.setSalt(salt);
                }
                patient1.setIdcard(idcard);
                patient1.setName(patient.getString("name"));
                patient1.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                patient1.setSalt(salt);
                patient1.setSex(StringUtils.isNotBlank(idcard)?Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)):null);
                patient1.setMobile(mobile);
                patient1.setDel("1");

+ 1 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/doctor/BaseDoctorDao.java

@ -23,7 +23,7 @@ import java.util.List;
public interface BaseDoctorDao extends PagingAndSortingRepository<BaseDoctorDO, String>, JpaSpecificationExecutor<BaseDoctorDO>  {
    BaseDoctorDO findById(String id);
    @Query("from BaseDoctorDO d where d.idcard=?1 and d.del ='1'")
    BaseDoctorDO findByIdcard(String idcard);
    List<BaseDoctorDO> findByMobile(String mobile);

+ 4 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -605,6 +605,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                if ("10000".equalsIgnoreCase(jsonObject.getString("code"))){
                    captcha = jsonObject.getString("value");
                    resltCode = jsonObject.getString("code");
                    msg = "发送成功";
                }
            }
            if ("10000".equalsIgnoreCase(resltCode)) {
@ -614,7 +615,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                _captcha.setExpiresIn(300);
                wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, _captcha);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>(msg, 200);
                HttpHeaders headers = new HttpHeaders();
                headers.set("Cache-Control", "no-store");
                headers.set("Pragma", "no-cache");
@ -652,7 +653,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                    _captcha.setExpiresIn(300);
                    wlyyRedisVerifyCodeService.store(client_id, username, captcha1, 300);
                    Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, _captcha);
                    Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200);
                    HttpHeaders headers = new HttpHeaders();
                    headers.set("Cache-Control", "no-store");
                    headers.set("Pragma", "no-cache");
@ -669,7 +670,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
                _captcha.setExpiresIn(300);
                wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, _captcha);
                Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200);
                HttpHeaders headers = new HttpHeaders();
                headers.set("Cache-Control", "no-store");
                headers.set("Pragma", "no-cache");

+ 65 - 30
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -200,22 +200,37 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
										  @ApiParam(name = "source", value = "来源")
											  @RequestParam(value = "source", required = false) String source)throws Exception{
			ConsultTeamDo consult = new ConsultTeamDo();
			if(2 == type){
				consult.setType(16);//视频复诊
				if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
					prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
			if (null!=outpatientDO){
				if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
					if("2".equalsIgnoreCase(outpatientDO.getType())){
						consult.setType(16);//视频复诊
						if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
							prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
						}
					}else{
						consult.setType(9);//图文复诊
					}
					//咨询类型(1、图文;2、视频,3、图文+视频)
					consult.setHealthindexType(Integer.valueOf(StringUtils.isNotBlank(outpatientDO.getType())?outpatientDO.getType():"0"));
				}else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())){
					if("2".equalsIgnoreCase(outpatientDO.getType())){
						consult.setType(17);//视频咨询
						if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
							prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"17","outpatientMsgRemind","");
						}
					}else if ("1".equalsIgnoreCase(outpatientDO.getType())){
						consult.setType(1);//图文咨询
					}
				}
			}else{
				consult.setType(9);//图文复诊
			}
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
			if (outpatientDO.getStatus().equalsIgnoreCase("-1")){
				return failed("患者已取消!");
			}
			
			
			//咨询类型(1、图文;2、视频,3、图文+视频)
			consult.setHealthindexType(type);
//			int res = 0;
		
			JSONObject result = new JSONObject();
@ -226,28 +241,35 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					String rsCode = "";
					String mes = "";
					if("xm_xzzx_wx".equals(wxId)){ //心脏中心挂号
						if (!outpatientDO.getOutpatientType().equalsIgnoreCase("2")){
						if (!outpatientDO.getOutpatientType().equalsIgnoreCase("2")&&!outpatientDO.getOutpatientType().equalsIgnoreCase("3")){
							JSONObject res = xzyyPrescriptionService.registerOutPatient(outpatientCode,doctorCode);
							rsCode = res.getString("@RESULT");
							mes = res.getString("@MSG");
						}else {
						}else  {
							rsCode="0";
							mes="已挂号";
						}
						if (type==2){
							prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
						if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
							if ("2".equalsIgnoreCase(outpatientDO.getType())){
								prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
							}
						}
						if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())){
							if ("2".equalsIgnoreCase(outpatientDO.getType())){
								prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"17","outpatientMsgRemind","");
							}
						}
					}else {
						if (demoFlag.equalsIgnoreCase("true")){
							rsCode="0";
							mes="已挂号";
						}else {
							if (!outpatientDO.getOutpatientType().equalsIgnoreCase("2")){
							if (!outpatientDO.getOutpatientType().equalsIgnoreCase("2")&&!outpatientDO.getOutpatientType().equalsIgnoreCase("3")){
								net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
								rsCode = (String)res.get("@RESULT");
								mes = (String)res.get("@MSG");
							}else {
							}else  {
								rsCode="0";
								mes="已挂号";
							}
@ -337,21 +359,31 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
							  @ApiParam(name = "source", value = "来源")
								  @RequestParam(value = "source", required = false) String source)throws Exception{
		ConsultTeamDo consult = new ConsultTeamDo();
		if(2 == type){
			consult.setType(16);//视频复诊
			/*if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
				prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
			}*/
		}else{
			consult.setType(9);//图文复诊
		WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
		if (null!=outpatientDO){
			if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
				if("2".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(16);//视频复诊
					if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
						prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"16","outpatientMsgRemind","");
					}
				}else{
					consult.setType(9);//图文复诊
				}
				//咨询类型(1、图文;2、视频,3、图文+视频)
				consult.setHealthindexType(Integer.valueOf(StringUtils.isNotBlank(outpatientDO.getType())?outpatientDO.getType():"0"));
			}else if ("3".equalsIgnoreCase(outpatientDO.getOutpatientType())){
				if("2".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(17);//视频咨询
					if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
						prescriptionService.sendWxTemplateMsg(wxId,outpatientCode,null,"17","outpatientMsgRemind","");
					}
				}else if ("1".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(1);//图文咨询
				}
			}
		}
		//咨询类型(1、图文;2、视频,3、图文+视频)
		consult.setHealthindexType(type);
//			int res = 0;
		WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
		if (outpatientDO.getStatus().equalsIgnoreCase("-1")){
			return failed("患者已取消!");
		}
@ -550,7 +582,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	public ListEnvelop getWaitingForVisitVideoPrescriptionByDoctor(
			@ApiParam(name = "doctor", value = "医生CODE")
			@RequestParam(value = "doctor",required = true) String doctor)throws Exception{
		return success("请求成功",prescriptionService.getWaitingForVisitVideoPrescriptionByDoctor(doctor,wxId));
		return success("请求成功",prescriptionService.getWaitingForVisitVideoPrescriptionByDoctor(doctor,wxId,""));
	}
	
	@PostMapping(value = BaseHospitalRequestMapping.DodtorIM.pickVideoPrescripitonWaitingPeople)
@ -799,6 +831,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		result.put("imgCount",prescriptionService.getWaitVideoCount(doctor,"1","1",wxId));//图文复诊数量
		result.put("videoCount",prescriptionService.getWaitVideoCount(doctor,"2","1",wxId));//视频复诊数量
		result.put("xtCount",prescriptionService.getWaitVideoCount(doctor,"","2",wxId));//协同门诊候诊数量
		result.put("imgConsultCount",prescriptionService.getWaitVideoCount(doctor,"1","3",wxId));//图文咨询数量
		result.put("videoConsultCount",prescriptionService.getWaitVideoCount(doctor,"2","3",wxId));//视频咨询数量
		result.put("homeConsultCount",prescriptionService.getWaitVideoCount(doctor,"3","3",wxId));//家医咨询数量
		logger.info("action:doctorReviewConsultCount--end:"+DateUtil.dateToStrLong(new Date()));
		return success("请求成功",result);
	}

+ 5 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -265,8 +265,10 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
    public ObjEnvelop checkOutpatient(@ApiParam(name = "patient", value = "续方明细")
                                      @RequestParam(value = "patient", required = true)String patient,
                                      @ApiParam(name = "flag", value = "标识是否开启结算")
                                      @RequestParam(value = "flag", required = false)boolean flag)throws Exception{
        return success(prescriptionService.checkOutpatient(patient,wxId,flag));
                                      @RequestParam(value = "flag", required = false)boolean flag,
                                      @ApiParam(name = "outpatientType", value = "1:在线问诊;2协同;3专家咨询")
                                          @RequestParam(value = "outpatientType", required = false)String outpatientType)throws Exception{
        return success(prescriptionService.checkOutpatient(patient,wxId,flag,outpatientType));
    }
    
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.findAllHospital)
@ -355,7 +357,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @RequestParam(value = "chargeType", required = false)String chargeType)throws Exception {
        
        WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson,expressageJson,registerJson,chargeType);
        if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()){
        if (wlyyOutpatientDO!=null&&null==wlyyOutpatientDO.getId()&&!wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")){
            ObjEnvelop objEnvelop =new ObjEnvelop();
            String msg = "";
            if (1==wlyyOutpatientDO.getRemindCount()){