Sfoglia il codice sorgente

Merge branch '2.0' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into 2.0

wangzhinan 1 anno fa
parent
commit
6e9fca606b

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

@ -100,6 +100,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.encrypt.MD5;
import com.yihu.jw.util.entity.ServiceException;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.utils.*;
@ -114,6 +115,7 @@ import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.jw.wechat.service.BaseSensitiveFilterWordsService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import com.yihu.jw.yx.dao.YxTokenMappingDao;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
@ -341,6 +343,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BaseDictIcd10Dao dictIcd10Dao;
    @Autowired
    private ServiceItemPlanDao serviceItemPlanDao;
    @Autowired
    private WlyyBusinessService wlyyBusinessService;
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
@ -1187,14 +1191,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else if ("3".equalsIgnoreCase(outpatient.getOutpatientType())){
            BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "专家咨询费", "1", "专家咨询费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        }else if ("4".equalsIgnoreCase(outpatient.getOutpatientType())){
            ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(outpatient.getPlanId()).orElse(null);
            if(serviceItemPlanDO!=null){
                if(!org.springframework.util.StringUtils.isEmpty(serviceItemPlanDO.getRelationCode())){
                    throw new RuntimeException("该计划已发起过咨询,请选择其他计划发起!");
            if(StringUtils.isNotBlank(outpatient.getPlanId())){
                ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(outpatient.getPlanId()).orElse(null);
                if(serviceItemPlanDO!=null){
                    if(!org.springframework.util.StringUtils.isEmpty(serviceItemPlanDO.getRelationCode())){
                        throw new ServiceException("该计划已发起过咨询,请选择其他计划发起!");
                    }
                    serviceItemPlanDO.setStatus("3");
                    serviceItemPlanDO.setRelationCode(outpatient.getId());
                    serviceItemPlanDao.save(serviceItemPlanDO);
                }
                serviceItemPlanDO.setStatus("3");
                serviceItemPlanDO.setRelationCode(outpatient.getId());
                serviceItemPlanDao.save(serviceItemPlanDO);
            }
            BusinessOrderDO businessOrderDO = businessOrderService.recharge(outpatient.getId(), "康复咨询费", "6", "康复咨询费", outpatient.getConsumer(), outpatient.getConsumerName(), outpatient.getDoctor(), price);
        }
@ -1211,7 +1217,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                wlyyPatientRegisterTimeDO = patientRegisterTimeDao.save(registerTimeDO);
            }
        } catch (Exception e) {
            throw new RuntimeException("号源已经被预约,请选择其他号源");
            throw new ServiceException("号源已经被预约,请选择其他号源");
        }
        if (!outpatientDO.getOutpatientType().equalsIgnoreCase("3")&&!outpatientDO.getOutpatientType().equalsIgnoreCase("4")){
            if (1==expressageDO.getOneselfPickupFlg()){
@ -1253,7 +1259,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("眼科中心患者档案查询");
            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(outpatient.getPatient());
            if (patientMappingDO==null){
                throw new Exception("您的信息在院内无档案,请确认就诊人信息,并重新保存就诊人信息!");
                throw new ServiceException("您的信息在院内无档案,请确认就诊人信息,并重新保存就诊人信息!");
            }
            logger.info("眼科中心患者档案查询");
        }
@ -5145,6 +5151,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        outpatientDao.save(wlyyOutpatientDO);
        if(StringUtils.isNotBlank(wlyyOutpatientDO.getPlanId())){
            ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(wlyyOutpatientDO.getPlanId()).orElse(null);
            if(serviceItemPlanDO!=null){
                serviceItemPlanDO.setStatus("0");
                serviceItemPlanDO.setRelationCode(null);
                serviceItemPlanDao.save(serviceItemPlanDO);
            }
        }
        //删除门诊号源
        List<WlyyPatientRegisterTimeDO> list = patientRegisterTimeDao.findByOutpatientId(wlyyOutpatientDO.getId());
@ -5192,6 +5206,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return rs;
    }
    /**
     * 发送微信模板消息  本地无法测试消息是否发送成功
     * @param wxId
@ -15667,6 +15683,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else {
            outpatientHospitalizationDO.setCreateTime(new Date());
        }
        WlyyOutpatientHospitalizationDO hospitalizationDO = outpatientHospitalizationDao.findByOutpatientId(outpatientHospitalizationDO.getOutpatientId());
        if(hospitalizationDO!=null){
            throw new ServiceException("改复诊已发起过住院申请,请勿重复发起");
        }
        BasePatientDO patientDO = basePatientDao.findById(outpatientHospitalizationDO.getPatient()).orElse(null);
        if(patientDO==null){
            throw new ServiceException("参数错误");
        }
        outpatientHospitalizationDO.setStatus(0);
        outpatientHospitalizationDO.setIdCard(patientDO.getIdcard());
        outpatientHospitalizationDO = outpatientHospitalizationDao.save(outpatientHospitalizationDO);
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(outpatientHospitalizationDO.getDoctor());
        String visitDoctor = doctorMappingDO.getDoctorName()+"/"+doctorMappingDO.getMappingCode();

+ 7 - 0
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -780,6 +780,13 @@ public class WlyyBusinessService {
        return re;
    }
    //获取社区医生列表
    public JSONObject getDoctorList(String hospital, String doctorName, Integer page, Integer pageSize, String mobile) {
        String param = "?hospital="+nullToTransfor(hospital)+"&doctorName="+nullToTransfor(doctorName)+"&page="+page+"&pageSize="+pageSize+"&mobile="+nullToTransfor(mobile);
        JSONObject re = wlyyHttpService.sendWlyyMesGet("getDoctorList",param);
        return re;
    }
    //获取机构列表分页
    public JSONObject getHospitalList(String name, Integer page, Integer pageSize, String town) {
        String param = "?name="+nullToTransfor(name)+"&town="+nullToTransfor(town)+"&page="+page+"&pageSize="+pageSize;

+ 61 - 33
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -517,12 +517,12 @@ public class ImService {
        }
        String content = "进入了咨询";
        BasePatientDO p = basePatientDao.getOne(currentUid);
        BasePatientDO p = basePatientDao.findById(currentUid).orElse(null);
        String intoUserName = p.getName();
//		if (currentUid.equals(uid)) {
//			content = intoUserName + content;
//		} else {
        BasePatientDO member = basePatientDao.getOne(currentUid);
        BasePatientDO member = basePatientDao.findById(currentUid).orElse(null);
        content = intoUserName + content;
        //目前没有家人关系,所以家人名称的名字获取暂时注释
//			content = member.getName() + "(" + relations.get(familyMember.getFamilyRelation()) + ")" + content;
@ -595,7 +595,7 @@ public class ImService {
            arr = new String[]{content};
        }
//            Patient patient = patientDao.findByCode(getUID());
        BasePatientDO patient = basePatientDao.getOne(patientcode);
        BasePatientDO patient = basePatientDao.findById(patientcode).orElse(null);
        int i = 0;
        List<String> failed = new ArrayList<>();
@ -674,7 +674,7 @@ public class ImService {
            arr = new String[]{content};
        }
//            Patient patient = patientDao.findByCode(getUID());
        BasePatientDO patient = basePatientDao.getOne(patientcode);
        BasePatientDO patient = basePatientDao.findById(patientcode).orElse(null);
        int i = 0;
        List<String> failed = new ArrayList<>();
@ -1006,7 +1006,7 @@ public class ImService {
        JSONObject re = new JSONObject();
        boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
        logger.info("boo" + boo);
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.getOne("consultClose");
        WlyyHospitalSysDictDO sysDictDO = hospitalSysDictDao.findById("consultClose").orElse(null);
        boolean flag = false;
        if (sysDictDO != null) {
            if (sysDictDO.getDictCode().equalsIgnoreCase("1")) {
@ -1046,7 +1046,7 @@ public class ImService {
        // 设置患者信息
        ct.setPatient(patient);
        // 查询患者信息
        BasePatientDO tempPatient = basePatientDao.getOne(patient);
        BasePatientDO tempPatient = basePatientDao.findById(patient).orElse(null);
        // 设置患者姓名
        ct.setName(tempPatient.getName());
        // 设置患者生日
@ -1238,7 +1238,7 @@ public class ImService {
        synchronized (outpatientCode.intern()) {
            //1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(outpatientCode);
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientCode).orElse(null);
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                //眼科接诊时更新眼科通状态
@ -1257,12 +1257,12 @@ public class ImService {
            BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
//			doctorCode = doctor.getCode();
            // 查询患者信息
            BasePatientDO p = basePatientDao.getOne(patient);
            BasePatientDO p = basePatientDao.findById(patient).orElse(null);
            if (!"0".equals(wlyyOutpatientDO.getStatus())) {
                throw new RuntimeException("该就诊记录已被取消,无法接单!");
            }
            BasePatientDO patientDO = basePatientDao.getOne(wlyyOutpatientDO.getPatient());
            BasePatientDO patientDO = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("title", patientDO.getName() + "申请复诊");
            jsonObject.put("content", wlyyOutpatientDO.getDescription());
@ -1496,11 +1496,11 @@ public class ImService {
     */
    public JSONObject addConsult(String outpatientCode, String patient, String doctorCode, ConsultTeamDo ct, String reason, Integer type, String wxId, String source) throws Exception {
        //1、获取his就诊记录详情(保存续方表、药品续方信息表、续方疾病类型表)
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(outpatientCode);
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(outpatientCode).orElse(null);
        BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(doctorCode);
//			doctorCode = doctor.getCode();
        // 查询患者信息
        BasePatientDO p = basePatientDao.getOne(patient);
        BasePatientDO p = basePatientDao.findById(patient).orElse(null);
        JSONObject jsonObject = new JSONObject();
        if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {
            jsonObject.put("title", p.getName() + "申请咨询");
@ -1514,7 +1514,7 @@ public class ImService {
        jsonObject.put("sex", p.getSex());
        jsonObject.put("name", p.getName());
        if (null != wlyyOutpatientDO) {
            BasePatientDO outPatient = basePatientDao.getOne(wlyyOutpatientDO.getPatient());
            BasePatientDO outPatient = basePatientDao.findById(wlyyOutpatientDO.getPatient()).orElse(null);
            if (null != outPatient) {
                jsonObject.put("age", DateUtil.getAgeForIdcard(outPatient.getIdcard()));
                jsonObject.put("sex", outPatient.getSex());
@ -1743,7 +1743,7 @@ public class ImService {
        ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
        ConsultDo cons = consultDao.getOne(consult);
        ConsultDo cons = consultDao.findById(consult).orElse(null);
        if (consultTeam.getStatus() == 1) {
            return -1;
@ -1757,7 +1757,7 @@ public class ImService {
         * 发送评价消息
         */
        BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(consultTeam.getDoctor());
        BasePatientDO patient = basePatientDao.getOne(consultTeam.getPatient());
        BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient()).orElse(null);
        JSONObject evalueContent = new JSONObject();
        evalueContent.put("patientCode", consultTeam.getPatient());
        evalueContent.put("patientName", patient.getName());
@ -1774,7 +1774,7 @@ public class ImService {
        JSONObject obj = new JSONObject();
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            BasePatientDO p = basePatientDao.getOne(endOperator);
            BasePatientDO p = basePatientDao.findById(endOperator).orElse(null);
            endName = p.getName();
            endId = p.getId();
            obj = imUtil.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
@ -1820,9 +1820,6 @@ public class ImService {
                if(org.apache.commons.lang3.StringUtils.isNotBlank(wlyyOutpatientDO.getPlanId())){
                    ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(wlyyOutpatientDO.getPlanId()).orElse(null);
                    if(serviceItemPlanDO!=null){
                        if(!org.springframework.util.StringUtils.isEmpty(serviceItemPlanDO.getRelationCode())){
                            throw new RuntimeException("该计划已发起过咨询,请选择其他计划发起!");
                        }
                        serviceItemPlanDO.setStatus("1");
                        serviceItemPlanDO.setCompleteTime(DateUtil.getStringDate());
                        serviceItemPlanDao.save(serviceItemPlanDO);
@ -1897,7 +1894,7 @@ public class ImService {
        ConsultTeamDo consultTeam = consultTeamDao.findByConsult(consult);
        ConsultDo cons = consultDao.getOne(consult);
        ConsultDo cons = consultDao.findById(consult).orElse(null);
        if (consultTeam.getStatus() == 1) {
            return -1;
@ -1911,7 +1908,7 @@ public class ImService {
         * 发送评价消息
         */
        BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(consultTeam.getDoctor());
        BasePatientDO patient = basePatientDao.getOne(consultTeam.getPatient());
        BasePatientDO patient = basePatientDao.findById(consultTeam.getPatient()).orElse(null);
		/*JSONObject evalueContent = new JSONObject();
		evalueContent.put("patientCode",consultTeam.getPatient());
		evalueContent.put("patientName",patient.getName());
@ -1931,7 +1928,7 @@ public class ImService {
        JSONObject obj = new JSONObject();
        //结束咨询才发送推送给IM文字消息
        if (endType == 1) {
            BasePatientDO p = basePatientDao.getOne(endOperator);
            BasePatientDO p = basePatientDao.findById(endOperator).orElse(null);
            endName = p.getName();
            endId = p.getId();
            obj = imUtil.endTopics(consultTeam.getPatient(), endId, endName, consultTeam.getConsult());
@ -2026,7 +2023,7 @@ public class ImService {
        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
        data.put("name", patient.getName());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(consultTeam.getRelationCode());
        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(consultTeam.getRelationCode()).orElse(null);
        if (wlyyOutpatientDO!=null){
            data.put("consumerName",wlyyOutpatientDO.getConsumerName());
        }
@ -2087,7 +2084,7 @@ public class ImService {
        ConsultTeamDo consultTeamDo = consultTeamDao.findByConsult(consult);
        ConsultDo consultDo = consultDao.getOne(consult);
        ConsultDo consultDo = consultDao.findById(consult).orElse(null);
        object.put("doctorCode", consultTeamDo.getDoctor());
        //支付状态
@ -2117,7 +2114,7 @@ public class ImService {
            result.put("consultDo", null);
        }
        BasePatientDO basePatientDO = null;
        basePatientDO = basePatientDao.getOne(patientCode);
        basePatientDO = basePatientDao.findById(patientCode).orElse(null);
        JSONObject patientinfoObj = new JSONObject();
        patientinfoObj.put("name", basePatientDO.getName());
@ -2278,11 +2275,11 @@ public class ImService {
            consultTeamDo.setEvaluateTime(new Date());
            consultTeamDao.save(consultTeamDo);
            ConsultDo consultDo = consultDao.getOne(consult);
            ConsultDo consultDo = consultDao.findById(consult).orElse(null);
            //如果是复诊咨询,或者协同门诊,则修改成已评价
            if (9 == consultDo.getType() || 12 == consultDo.getType() || 16 == consultDo.getType()) {
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(consultTeamDo.getRelationCode());
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(consultTeamDo.getRelationCode()).orElse(null);
                wlyyOutpatientDO.setEvaluateStatus("1");
                outpatientDao.save(wlyyOutpatientDO);
            }
@ -2382,7 +2379,7 @@ public class ImService {
        //获取诊断
        List<WlyyPrescriptionDiagnosisVO> wlyyPrescriptionDiagnosisVOS = wlyyPrescriptionVO.getDiagnosisVOs();
        if (wlyyPrescriptionDiagnosisVOS != null && wlyyPrescriptionDiagnosisVOS.size() != 0) {
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(wlyyPrescriptionVO.getOutpatientId());
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId()).orElse(null);
            if (wlyyOutpatientDO.getOutpatientType() != null) {
                if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1") && wlyyOutpatientDO.getType().equalsIgnoreCase("1")) {
                    String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer() + "_" + wlyyPrescriptionVO.getOutpatientId() + "_9", "24", JSON.toJSONString(wlyyPrescriptionDiagnosisVOS), "1", null);
@ -2400,7 +2397,7 @@ public class ImService {
        object.put("prescriptionid", wlyyPrescriptionVO.getId());
        object.put("ispay", wlyyPrescriptionVO.getPayStatus());
        if (infoVOs != null && infoVOs.size() != 0) {
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(wlyyPrescriptionVO.getOutpatientId());
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(wlyyPrescriptionVO.getOutpatientId()).orElse(null);
            if (wlyyOutpatientDO.getOutpatientType() != null) {
                if (wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1") && wlyyOutpatientDO.getType().equalsIgnoreCase("1")) {
                    String response = imUtil.sendImMsg(wlyyPrescriptionVO.getDoctor(), wlyyPrescriptionVO.getDoctorName(), wlyyOutpatientDO.getConsumer() + "_" + wlyyPrescriptionVO.getOutpatientId() + "_9", "27", JSON.toJSONString(object), "1", null);
@ -3206,6 +3203,37 @@ public class ImService {
        imUtil.sendMessage(sender, reciver, contentType, content);
    }
    //发送在线候诊室消息
    public void sendConstomerImg(String patientCode,String outpatientId,String outpatientType,String doctorCode){
        try {
            //808080eb8223c9e50182249cd6ff0000_guidance_26
            String session_id26 = patientCode +"_guidance_26";
            String session_id27 = patientCode +"_guidance_27";
            BaseDoctorDO doctorDO = baseDoctorDao.findByIdAndDel(doctorCode);
            String msg = "您好,"+doctorDO.getName()+"医生已接诊,请您及时进入诊室与您的医生沟通。医生将会与您详细讨论病情,并为您提供专业的治疗建议。我们将竭诚为您服务,为您的健康保驾护航。";
            JSONObject json = new JSONObject();
            json.put("outpatientId",outpatientId);
            json.put("outpatientType",outpatientType);
            json.put("msg",msg);
            WlyyHospitalSysDictDO dictDO = hospitalSysDictDao.findById("customer").orElse(null);
            String sender_id = "customer";
            String sender_name = "客服";
            if(dictDO!=null){
                sender_id = dictDO.getDictCode();
                sender_name = dictDO.getDictValue();
            }
            if(imUtil.sessionIsExist(session_id26)){
                imUtil.sendImMsg(sender_id, sender_name, session_id26, "51", json.toJSONString(), "2", null);
            }
            if(imUtil.sessionIsExist(session_id27)){
                imUtil.sendImMsg(sender_id, sender_name, session_id27, "51", json.toJSONString(), "2", null);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    /**
     * 导诊的咨询对话
     *
@ -3222,7 +3250,7 @@ public class ImService {
        } else {
            JSONObject participants = new JSONObject();
            participants.put(patientCode, 0);
            BasePatientDO basePatientDO = basePatientDao.getOne(patientCode);
            BasePatientDO basePatientDO = basePatientDao.findById(patientCode).orElse(null);
            String patientSex = "";
            if (basePatientDO.getSex() != null && 1 == basePatientDO.getSex()) {
                patientSex = "男";
@ -3303,7 +3331,7 @@ public class ImService {
        BaseDoctorDO specialDoctor = baseDoctorDao.findByIdAndDel(special_doctor);
//			doctorCode = doctor.getCode();
        // 查询患者信息
        BasePatientDO p = basePatientDao.getOne(patient_code);
        BasePatientDO p = basePatientDao.findById(patient_code).orElse(null);
        String consultTitle = "居民:" + p.getName() + "(医生:)-" + specialDoctor.getName() + "发起咨询!";
@ -3702,7 +3730,7 @@ public class ImService {
            BaseDoctorDO doctor = baseDoctorDao.findByIdAndDel(outpatient.getDoctor());
//			doctorCode = doctor.getCode();
            // 查询患者信息
            BasePatientDO p = basePatientDao.getOne(outpatient.getPatient());
            BasePatientDO p = basePatientDao.findById(outpatient.getPatient()).orElse(null);
            String title = "";
            //协同门诊
@ -4301,7 +4329,7 @@ public class ImService {
                }
            }
            if (map.get("outpatientId") != null) {
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(map.get("outpatientId").toString());
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()).orElse(null);
                map.put("deptName", wlyyOutpatientDO.getDeptName());
            }
            if (map.get("outpatientType") != null) {
@ -4574,7 +4602,7 @@ public class ImService {
                }
            }
            if (map.get("outpatientId") != null) {
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.getOne(map.get("outpatientId").toString());
                WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(map.get("outpatientId").toString()).orElse(null);
                map.put("deptName", wlyyOutpatientDO.getDeptName());
            }
            if (map.get("outpatientType") != null) {

+ 1 - 0
business/im-service/src/main/java/com/yihu/jw/im/util/ImUtil.java

@ -50,6 +50,7 @@ public class ImUtil {
        Reservation("转诊预约发送", "21"),
        Know("已知悉", "22"),
        Hospitalization("住院登记申请", "50"),
        ReceptionReminder("接诊提醒", "51"),
        KnowCommonQuestion("知识库-常见问题", "3001"),
        KnowCommonCustomer("知识库-客服欢迎", "3008"),
        KnowCommonQuestions("知识库-常见问题集", "3002"),

+ 4 - 1
common/common-entity/src/db/2024.sql

@ -29,4 +29,7 @@ INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict
INSERT INTO `base`.`wlyy_hospital_sys_dict` (`id`, `saas_id`, `dict_name`, `dict_code`, `dict_value`, `py_code`, `sort`, `hospital`, `create_time`, `create_user`, `create_user_name`, `update_time`, `update_user`, `update_user_name`, `img_url`, `model_name`) VALUES ('knowledge_question_scene4', NULL, 'knowledge_question_scene', '4', '在线诊室', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '使用场景');
ALTER table wlyy_patient_family_member add COLUMN `medicare` varchar(50) DEFAULT NULL COMMENT '社保卡';
ALTER table wlyy_patient_family_member add COLUMN `medicare` varchar(50) DEFAULT NULL COMMENT '社保卡';
INSERT INTO `base`.`oauth_wlyy_config` (`id`, `app_id`, `app_secret`, `token_url`, `url`, `remark`) VALUES
    ('getDoctorList', '019bd04d-3cb2-433f-a530-03f0cdb083e5', '08cc3ec2-736b-4732-a8f0-f99eb6f9d311', 'https://www.xmtyw.cn/wlyytest/gc/accesstoken', 'https://www.xmtyw.cn/wlyytest/wlyygc/tongan/hospital/getDoctorList', '厦门I健康获取社区医生列表');

+ 27 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyOutpatientHospitalizationDO.java

@ -18,8 +18,10 @@ public class WlyyOutpatientHospitalizationDO extends UuidIdentityEntityWithOpera
    private String outpatientId;
    private String visitDeptCode;//就诊科室代码
    private String visitDeptName;//就诊科室名称
    private String visitNo;//就诊号
    private String inDeptCode;//入院科室代码
    private String inDeptName;//入院科室名称
    private String diagnosisCode;//入院诊断代码
    private String diagnosisName;//入院诊断代码名称
    private Integer admissionType;//入院方式,0-门诊 1-急诊 2-转入 5-留观
@ -32,6 +34,7 @@ public class WlyyOutpatientHospitalizationDO extends UuidIdentityEntityWithOpera
    private String doctor;//医生编码
    private String doctorName;//医生姓名
    private String cardNo;//就诊卡号
    private String idCard;//身份证
    private Integer status;//0失败1成功
@ -170,4 +173,28 @@ public class WlyyOutpatientHospitalizationDO extends UuidIdentityEntityWithOpera
    public void setCardNo(String cardNo) {
        this.cardNo = cardNo;
    }
    public String getIdCard() {
        return idCard;
    }
    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }
    public String getVisitDeptName() {
        return visitDeptName;
    }
    public void setVisitDeptName(String visitDeptName) {
        this.visitDeptName = visitDeptName;
    }
    public String getInDeptName() {
        return inDeptName;
    }
    public void setInDeptName(String inDeptName) {
        this.inDeptName = inDeptName;
    }
}

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

@ -334,6 +334,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
				}
				try {
					imService.sendConstomerImg(patientCode,outpatientCode,outpatientDO.getOutpatientType(),doctorCode);
					prescriptionService.sendWxTemplateMsg(wxId, outpatientCode,null, consult.getType().toString(), "doctorPick", "");
					if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
						String msgUrl="https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientCode;

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

@ -47,6 +47,7 @@ import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.*;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.util.entity.ServiceException;
import com.yihu.jw.wlyy.service.WlyyBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -587,10 +588,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                         @ApiParam(name = "registerJson", value = "预约时间")
                                         @RequestParam(value = "registerJson", required = false) String registerJson,
                                         @ApiParam(name = "chargeType", value = "预约实体json")
                                         @RequestParam(value = "chargeType", required = false) String chargeType) throws Exception {
   /*     try {*/
                                         @RequestParam(value = "chargeType", required = false) String chargeType)  {
    try {
            WlyyOutpatientDO wlyyOutpatientDO = prescriptionService.appointmentRevisit(outpatientJson, expressageJson, registerJson, chargeType);
            if (wlyyOutpatientDO != null && null == wlyyOutpatientDO.getId() && !wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")
                    && !wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("4")) {
@ -629,12 +628,13 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                        logger.info("发送厦门i健康智能失败" + e.toString());
                    }
                }
                return success(BaseHospitalRequestMapping.Prescription.api_success, wlyyOutpatientDO);
            }
     /*   } catch (Exception e) {
        }catch (ServiceException se){
            return ObjEnvelop.getError(se.getMessage());
        }catch (Exception e) {
            return failedObjEnvelopException(e);
        }*/
        }
    }
@ -3812,13 +3812,16 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            jsonObject.put("admissionCondition",hospitalizationDO.getAdmissionCondition());//入院病情
            imUtil.sendImMsg(hospitalizationDO.getDoctor(), hospitalizationDO.getDoctorName(), session_id, "50", jsonObject.toString(), "1", null);
            return success("操作成功",hospitalizationDO);
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }catch (ServiceException se){
            return Envelop.getError(se.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("操作失败");
        }
    }
    @PostMapping("/selectHospitalizationByOutpatientId")
    @GetMapping("/selectHospitalizationByOutpatientId")
    @ApiOperation(value = "查询申请记录", notes = "查询申请记录")
    public Envelop selectHospitalizationByOutpatientId(
            @ApiParam(name = "outpatientId", value = "门诊id", required = false)

+ 15 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/team/DoctorTeamEndpoint.java

@ -83,6 +83,21 @@ public class DoctorTeamEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "getDoctorList")
    @ApiOperation(value = "获取社区医生列表")
    public String getDoctorList(@RequestParam(required = false) String hospital,
                                         @RequestParam(required = false) String doctorName,
                                         @RequestParam(required = false) Integer page,
                                         @RequestParam(required = false) Integer pageSize,
                                         @RequestParam(required = false) String mobile) {
        try {
            return wlyyBusinessService.getDoctorList(hospital,doctorName,page,pageSize,mobile).toJSONString();
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1,"查询失败");
        }
    }
    @GetMapping(value = "getHospitalList")
    @ApiOperation(value = "获取社区机构列表分页")
    public String getHospitalList(@RequestParam(required = false) String name,