Преглед на файлове

Merge branch 'dev' of suhaiwen/wlyy2.0 into dev

wangzhinan преди 4 години
родител
ревизия
a4c7bdec2f

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/hospital/mapping/service/PatientMappingService.java

@ -77,7 +77,7 @@ public class PatientMappingService {
     * @return
     * @throws Exception
     */
    public String findYkyyPatNoByPatient(String patient)throws Exception{
    public String findYkyyPatNoByPatient(String patient,boolean demoFlag)throws Exception{
        logger.info("findYkyyPatNoByPatient:"+patient);
        BasePatientDO patientDO = basePatientDao.findById(patient);
        logger.info("patientDO:"+patientDO.toString());
@ -86,7 +86,7 @@ public class PatientMappingService {
        if(patientMappingDO!=null){
            return patientMappingDO.getMappingCode();
        }
        com.alibaba.fastjson.JSONArray rs = ykyyEntranceService.findHisPatient(patientMedicareCardDO.getCode());
        com.alibaba.fastjson.JSONArray rs = ykyyEntranceService.findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        if(rs!=null&&rs.size()>0){
            //获取居民信息

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

@ -13,6 +13,8 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -243,7 +245,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    @Autowired
    private DictDeptDescDao dictDeptDescDao;
    @Value("${demo.flag}")
    private boolean demoFlag;
    @Value("${wechat.id}")
@ -2102,7 +2103,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //先下单
                businessOrderService.savePrescriptionOrder(prescription.getId());
                //同步his
                ykyyEntranceService.findByRealOrder(prescription.getId());
                ykyyEntranceService.findByRealOrder(prescription.getId(),demoFlag);
                List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findById(prescription.getId());
                if (prescriptionDOList != null && prescriptionDOList.size() != 0) {
                    WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDOList.get(0);
@ -3326,12 +3327,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if ("1".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "9");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个图文复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(), "9", "doctorRefuse", null);
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "doctorRefuse", "");
                }
                if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                    data.put("type", "16");
                    msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被医生取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(), "16", "doctorRefuse", null);
                    sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "doctorRefuse", "");
                }
                data.put("msg", msg);
                messageDO.setData(data.toString());
@ -3378,72 +3379,101 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param titelType
     * @param remindMsg
     */
    public void sendWxTemplateMsg(String wxId, String outpatientId, String type, String titelType, String remindMsg) {
    public void sendWxTemplateMsg(String wxId, String outpatientId,ConsultTeamDo consultTeam,  String type, String titelType, String remindMsg) {
        BaseDoctorDO consDoctorDO = new BaseDoctorDO();
        BasePatientDO consPatientDO = new BasePatientDO();
        //获取咨询的信息
        if (consultTeam!=null){
            consDoctorDO = baseDoctorDao.findById(consultTeam.getDoctor());
            consPatientDO = basePatientDao.findById(consultTeam.getPatient());
        }
        WlyyOutpatientDO outpatientDO = new WlyyOutpatientDO();
        BaseDoctorDO doctorDO = new BaseDoctorDO();
        BasePatientDO patientDO = new BasePatientDO();
        if (StringUtils.isNotEmpty(outpatientId)){
            outpatientDO = outpatientDao.findById(outpatientId);
            doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
            patientDO = basePatientDao.findById(outpatientDO.getPatient());
        }
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientId);
        BaseDoctorDO doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
        BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
        String contentMsg = "";
        String first = "";
        String remark = "";
        if ("doctorRefuseRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "通知内容:您的图文复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
                contentMsg = "您的图文复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
                first = outpatientDO.getPatientName() + ",您好!您的图文复诊已取消";
            }
            if ("16".equals(type)) {
                contentMsg = "通知内容:您的视频复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
                contentMsg = "您的视频复诊订单已被医生取消,您可重新发起。由于订单取消将不做扣费处理";
                first = outpatientDO.getPatientName() + ",您好!您的视频复诊已取消";
            }
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "通知内容:您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
                contentMsg = "您有一个图文复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = outpatientDO.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。";
            } else if ("16".equals(type)) {
                contentMsg = "通知内容:您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
                contentMsg = "您有一个视频复诊订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = outpatientDO.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。";
            } else if ("1".equals(type)) {
                contentMsg = "通知内容:您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = outpatientDO.getPatientName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
            }
            if ("1".equals(type)) {
                contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = consPatientDO.getName() + ",您好!您有一个图文咨询订单待支付,请及时支付。";
            } else if ("17".equals(type)) {
                contentMsg = "通知内容:您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first = outpatientDO.getPatientName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
                contentMsg = "您有一个视频咨询订单待支付,点击完成支付,如您已支付请忽略本条信息";
                first =  consPatientDO.getName() + ",您好!您有一个视频咨询订单待支付,请及时支付。";
            }
        } else if ("prescriptionPayRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好! 医生已为您开具处方,请及时支付。";
            contentMsg = "通知内容:医生已为您开具处方,请及时支付。";
            remark = "备注:点击完成支付,如您已支付请忽略本条信息";
            contentMsg = "医生已为您开具处方,请及时支付。";
            remark = "点击完成支付,如您已支付请忽略本条信息";
        } else if ("msgRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好!";
            contentMsg = "通知内容:" + remindMsg;
            remark = "备注:请您尽快回复";
            contentMsg = "" + remindMsg;
            remark = "请您尽快回复";
        } else if ("outpatientMsgRemind".equalsIgnoreCase(titelType)) {
            first = doctorDO.getName() + doctorDO.getJobTitleName() + "医生已向您发起视频通话邀请,请点击详情进入视频诊室。";
            if ("16".equals(type)) {
                contentMsg = "通知内容:您的视频复诊已开始,错过将重新排队";
                remark = "备注:点击消息进入视频诊室接听视频通话,开始视频咨询。";
                contentMsg = "您的视频复诊已开始,错过将重新排队";
                remark = "点击消息进入视频诊室接听视频通话,开始视频咨询。";
            } else if ("17".equals(type)) {
                contentMsg = "通知内容:您的视频咨询已开始,错过将重新排队";
                remark = "备注:点击消息进入视频诊室接听视频通话,开始视频复诊。";
                contentMsg = "您的视频咨询已开始,错过将重新排队";
                remark = "点击消息进入视频诊室接听视频通话,开始视频复诊。";
            }
        } else if ("videoOrderRemind".equalsIgnoreCase(titelType)) {
            if ("16".equals(type)) {
                first = "您的视频复诊已预约成功。";
                contentMsg = "通知内容:预计" + outpatientDO.getDoctorName() + "医生将于" + outpatientDO.getRegisterDate() + " 与您进行视频复诊。请留意微信公众号消息。";
                contentMsg = "预计" + outpatientDO.getDoctorName() + "医生将于" + DateUtil.dateToStrLong(outpatientDO.getRegisterDate()) + " 与您进行视频复诊。请留意微信公众号消息。";
            } else if ("17".equals(type)) {
                first = "您的视频咨询已预约成功。";
                contentMsg = "通知内容:预计" + outpatientDO.getDoctorName() + "医生将于" + outpatientDO.getRegisterDate() + " 与您进行视频咨询。请留意微信公众号消息。";
                contentMsg = "预计" + consDoctorDO.getName() + "医生将于" + DateUtil.dateToStrLong(consultTeam.getCzrq()) + " 与您进行视频咨询。请留意微信公众号消息。";
            }
            remark = "备注:咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
            remark = "咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
        } else if ("evaluateRemind".equalsIgnoreCase(titelType)) {
            first = outpatientDO.getPatientName() + ",您好!您有1条专家咨询已结束,请及时对咨询医生进行评价。";
            contentMsg = "通知内容:请对" + outpatientDO.getDoctorName() + "医生的服务进行评价";
            if (consultTeam.getType()!=null&&1==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。";
            }
            if (consultTeam.getType()!=null&&9==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。";
            }
            if (consultTeam.getType()!=null&&16==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。";
            }
            if (consultTeam.getType()!=null&&17==consultTeam.getType()){
                first = consultTeam.getName() + ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。";
            }
            contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价";
        }
@ -4506,17 +4536,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if (one.getId().equalsIgnoreCase(workTimeDO.getId())) {
                    continue;
                }
                try {
                    //与医院与自己排班比较  是否冲突  第一组最后时间小于等于第二组最前时间 || 第一组最前时间大于等于第二组最后时间
                    if (one.getEndTime().before(workTimeDO.getStartTime()) || one.getStartTime().after(workTimeDO.getEndTime())) {
                    } else {
                        throw new Exception("您选择的时间与“开始时间-结束时间”的医院排班/自己排班冲突,请重新选择!");
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    return false;
                //与医院与自己排班比较  是否冲突  第一组最后时间小于等于第二组最前时间 || 第一组最前时间大于等于第二组最后时间
                if (one.getEndTime().before(workTimeDO.getStartTime()) || one.getStartTime().after(workTimeDO.getEndTime())) {
                } else {
                    throw new Exception("您选择的时间与“开始时间-结束时间”的医院排班/自己排班冲突,请重新选择!");
                }
            }
            doctorWorkTimeDao.save(workTimeDO);
@ -5261,11 +5288,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                if ("1".equals(outpatient.getType())) {
                    systemMessageDO.setTitle("图文复诊");
                    systemMessageDO.setType("1");
                    saveInquirySystemMessage(outpatient);
                    saveInquirySystemMessage(outpatient,null);
                } else {
                    systemMessageDO.setTitle("视频复诊预约成功");
                    systemMessageDO.setType("2");
                    saveInquirySystemMessage(outpatient);
                    saveInquirySystemMessage(outpatient,null);
                    msg = "您的视频复诊已预约成功。\n" +
                            "预计" + outpatient.getDoctorName() + "医生将于" + outpatient.getRegisterDate() + " 与您进行视频咨询。请留意系统消息或微信公众号消息。咨询开始时,医生将邀请您进行视频通话,请您关注消息提醒,及时接受医生视频邀请。";
                    systemMessageDO.setReceiver(outpatient.getDoctor());
@ -5283,7 +5310,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    data.put("msg", msg);
                    systemMessageDO.setData(data.toString());
                    systemMessageService.saveMessage(systemMessageDO);
                    sendWxTemplateMsg(wechatId, outpatient.getId(), "17", "videoOrderRemind", null);
                    sendWxTemplateMsg(wechatId, outpatient.getId(),null, "17", "videoOrderRemind", "");
                }
            }
@ -5299,44 +5326,86 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return systemMessageDO;
    }
    public void saveInquirySystemMessage(WlyyOutpatientDO outpatient) {
    public void saveInquirySystemMessage(WlyyOutpatientDO outpatient,ConsultTeamDo consultTeamDo) {
        SystemMessageDO systemMessageDO = new SystemMessageDO();
        String msg = "";
        String type = "";
        if ("1".equals(outpatient.getType())) {
            type = "9";
            msg = outpatient.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
        } else {
            type = "16";
            msg = outpatient.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
        }
        systemMessageDO.setTitle("支付提醒");
        systemMessageDO.setType("11");
        systemMessageDO.setSender(outpatient.getDoctor());
        systemMessageDO.setSenderName(outpatient.getDoctorName());
        systemMessageDO.setRelationCode(outpatient.getId());
        systemMessageDO.setReceiver(outpatient.getPatient());
        systemMessageDO.setReceiverName(outpatient.getPatientName());
        JSONObject data = new JSONObject();
        try {
            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);
            data.put("type", type);
            systemMessageDO.setData(data.toString());
            systemMessageService.saveMessage(systemMessageDO);
        } catch (Exception e) {
            e.printStackTrace();
        if (outpatient!=null){
            if ("1".equals(outpatient.getType())) {
                type = "9";
                msg = outpatient.getPatientName() + ",您好!您有一个图文复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
            } else if ("2".equals(outpatient.getType())){
                type = "16";
                msg = outpatient.getPatientName() + ",您好!您有一个视频复诊订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
            }
            systemMessageDO.setSender(outpatient.getDoctor());
            systemMessageDO.setSenderName(outpatient.getDoctorName());
            systemMessageDO.setRelationCode(outpatient.getId());
            systemMessageDO.setReceiver(outpatient.getPatient());
            systemMessageDO.setReceiverName(outpatient.getPatientName());
           data = new JSONObject();
            try {
                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);
                data.put("type", type);
                systemMessageDO.setData(data.toString());
                systemMessageService.saveMessage(systemMessageDO);
            } catch (Exception e) {
                e.printStackTrace();
            }
            sendWxTemplateMsg(wechatId, outpatient.getId(),null, type, "payRemind", "");
        }
        if (consultTeamDo!=null){
            if (consultTeamDo.getType().equals("17")){
                type = "17";
                msg = outpatient.getPatientName() + ",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
            }else if (consultTeamDo.getType().equals("1")){
                type = "1";
                msg = outpatient.getPatientName() + ",您好!您有一个图文咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
            }
            BaseDoctorDO doctorDO = baseDoctorDao.findById(consultTeamDo.getDoctor());
            BasePatientDO patientDO = basePatientDao.findById(consultTeamDo.getPatient());
            systemMessageDO.setSender(consultTeamDo.getDoctor());
            systemMessageDO.setSenderName(doctorDO.getName());
            systemMessageDO.setRelationCode(consultTeamDo.getConsult());
            systemMessageDO.setReceiver(consultTeamDo.getPatient());
            systemMessageDO.setReceiverName(consultTeamDo.getName());
           data = new JSONObject();
            try {
                data.put("name", outpatient.getPatientName());
                data.put("age", IdCardUtil.getAgeForIdcard(patientDO.getIdcard()));
                data.put("gender", IdCardUtil.getSexForIdcard_new(patientDO.getIdcard()));
                data.put("question", consultTeamDo.getSymptoms());
                data.put("msg", msg);
                data.put("type", type);
                systemMessageDO.setData(data.toString());
                systemMessageService.saveMessage(systemMessageDO);
            } catch (Exception e) {
                e.printStackTrace();
            }
            sendWxTemplateMsg(wechatId, "",consultTeamDo, type, "payRemind", "");
        }
        BasePatientDO patient = basePatientDao.findById(outpatient.getPatient());
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
            ykyyService.pushNotificationToYktPatient(patient.getYktId(), systemMessageDO.getTitle(), data.get("msg").toString());
        }
        sendWxTemplateMsg(wechatId, outpatient.getId(), type, "payRemind", null);
    }
@ -6385,7 +6454,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if ("xm_ykyy_wx".equalsIgnoreCase(wxId)) {
                ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
            }
            sendWxTemplateMsg(wxId, outpatientDO.getId(), "", "prescriptionPayRemind", null);
            sendWxTemplateMsg(wxId, outpatientDO.getId(), null,"", "prescriptionPayRemind", "");
        } else {
            wlyyPrescriptionDO.setId(prescriptionId);
            wlyyPrescriptionDO.setCheckStatus(status);

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

@ -93,11 +93,10 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
    @Autowired
    private BaseUserAgent userAgent;
    @Value("${demo.flag}")
    private boolean demoFlag;
    /**
     * 获取居民就诊记录接口
     * @param patient
@ -109,7 +108,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     */
    public  List<WlyyOutpatientVO> findOutpatientList(String patient, String startTime, String endTime, boolean demoFlag)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient,demoFlag);
        if(StringUtils.isBlank(patNo)){
            return null;
        }
@ -139,7 +138,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     */
    public  WlyyOutpatientVO findOutpatientInfo(String patient,String conNo, boolean demoFlag)throws Exception{
        logger.info("findOutpatientList patient:"+patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient);
        String patNo =patientMappingService.findYkyyPatNoByPatient(patient,demoFlag);
        if(StringUtils.isBlank(patNo)){
            return null;
        }

+ 50 - 14
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -46,6 +46,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -134,7 +135,6 @@ public class YkyyEntranceService {
    private YkyyService ykyyService;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
        return hibenateUtils.createSQLQuery(sql,params,page,size);
    }
@ -395,8 +395,27 @@ public class YkyyEntranceService {
            return null;
        }
//KSSJ,h.BRID,h.BRXM,h.SJHM,h.JZKH,h.SFZH,h.BRXZ,h.YSDM,h.KDYS" +
//                ",h.KSDM,h.KSMC,h.ZDMC,h.JZXH
        JSONArray jsonArray = new JSONArray();
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("BRID","402803ff6b4ae7ae016b4b06a498025s6");
            jsonObject.put("BRXM","张灵玉");
            jsonObject.put("SJHM","8622");
            jsonObject.put("SFZH","350529188526051213");
            jsonObject.put("BRXZ","普通性质");
            jsonObject.put("YSDM","A250545");
            jsonObject.put("KDYS","张楚岚");
            jsonObject.put("KSDM","062525");
            jsonObject.put("KSMC","消化科");
            jsonObject.put("ZDMC","消化不良");
            jsonObject.put("JZXH","XM1231258225225442GK");
            jsonArray.add(jsonObject);
        }else {
            jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime);
        }
        //查找眼科数据
        JSONArray jsonArray = findV_ZKSG_HZCX_HIS(patientMappingDO.getMappingCode(),conNo,startTime,endTime);
        if (jsonArray.size() == 0) {
            return null;
        }
@ -1355,7 +1374,7 @@ public class YkyyEntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray findHisPatient(String ssc) throws Exception {
    public JSONArray findHisPatient(String ssc,boolean demoFlag) throws Exception {
        String sql = "SELECT\n" +
                "\tx.brid AS \"brid\",\n" +
                "\tx.mzhm AS \"mzhm\",\n" +
@ -1378,14 +1397,31 @@ public class YkyyEntranceService {
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        logger.info("idcard:"+sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            array = rs.getJSONArray("detailModelList");
        if (demoFlag){
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("BRID","f6ab67115413e4bba1523d6d4c35766a");
            jsonObject.put("MZHM","0502452155");
            jsonObject.put("BRXM","诸葛青也");
            jsonObject.put("SFZH","450521199405092535");
            jsonObject.put("BRXZ","一般");
            jsonObject.put("BRXB","男");
            jsonObject.put("CSNY","1994-05-09");
            jsonObject.put("JZKH","DXM25631856");
            jsonObject.put("JDSJ","2020-06-28 15:15:35");
            jsonObject.put("GZZTMC","一般");
            jsonObject.put("LXDZ","厦门市五缘湾");
            array.add(jsonObject);
        }else  {
            HttpResponse response = HttpUtils.doGet(url,params);
            String content = response.getContent();
            logger.info("response:"+content);
            JSONObject rs = JSON.parseObject(content);
            Integer status = rs.getInteger("status");
            if (status==200){
                array = rs.getJSONArray("detailModelList");
            }
        }
        return array;
    }
@ -1437,7 +1473,7 @@ public class YkyyEntranceService {
    public String findByRealOrder(String code) throws Exception {
    public String findByRealOrder(String code,boolean demoFlag) throws Exception {
        List<WlyyPrescriptionDO>  wlyyPrescriptionDOs = prescriptionDao.findById(code);
        if (wlyyPrescriptionDOs!=null&&wlyyPrescriptionDOs.size()!=0){
            WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOs.get(0);
@ -1452,7 +1488,7 @@ public class YkyyEntranceService {
                wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
            }
            //诊断
            synPrescriptionDiagnosis(prescriptionVO,code);
            synPrescriptionDiagnosis(prescriptionVO,code,demoFlag);
            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
            synPrecriptionHis(prescriptionVO,code);
@ -1564,7 +1600,7 @@ public class YkyyEntranceService {
     * 诊断
     * @param wlyyPrescriptionVO
     */
    public void synPrescriptionDiagnosis(WlyyPrescriptionVO wlyyPrescriptionVO,String code) throws Exception{
    public void synPrescriptionDiagnosis(WlyyPrescriptionVO wlyyPrescriptionVO,String code,boolean demoFlag) throws Exception{
        String doctor = wlyyPrescriptionVO.getDoctor();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctor);
        String patient = wlyyPrescriptionVO.getPatientCode();
@ -1601,7 +1637,7 @@ public class YkyyEntranceService {
        hlwGhmxDO.setYSDM(doctorMappingDO.getMappingCode());//医生代码
        hlwGhmxDO.setJZYS(doctorMappingDO.getMappingCode());//接诊医生
        //病人性质
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode());
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);

+ 11 - 3
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -179,7 +179,10 @@ public class ImService {
	
	@Value("${wechat.id}")
	private String wxId;
	
	@Value("${wechat.flag}")
	private boolean flag;
	
	
	/**
@ -202,7 +205,11 @@ public class ImService {
				"a.title AS \"title\"," +
				"a.symptoms AS \"symptoms\",";
		if("xm_ykyy_wx".equals(wxId)){
			sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
			if (flag){
				sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}else {
				sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
			}
		}else{
			sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
		}
@ -252,6 +259,7 @@ public class ImService {
			sql += " and a.pay_status = " + payStatus + "";
		}
		sql += " ORDER BY a.czrq desc ";
		logger.info("sql="+sql);
		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pagesize);
		/*result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));*/
		return result;
@ -1519,7 +1527,7 @@ public class ImService {
			ykyyService.pushNotificationToYktPatient(patient.getYktId(),messageDO.getTitle(),data.get("msg").toString());
		}
		prescriptionService.sendWxTemplateMsg(wxId,cons.getRelationCode(),type,"evaluateRemind",null);
		prescriptionService.sendWxTemplateMsg(wxId,"",consultTeam,type,"evaluateRemind","");
	}

+ 1 - 4
svr/svr-base/src/main/resources/application.yml

@ -469,9 +469,6 @@ fast-dfs:
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段  # todo 待配置
---
spring:
  profiles: jwystest
@ -517,4 +514,4 @@ wechat:
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream
  remote_inner_url: 172.16.100.240:10023/open/fileUpload/upload_stream

+ 1 - 1
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -372,7 +372,7 @@ testPattern:
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService

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

@ -440,10 +440,11 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				String msg= "";
				if (type==17){
					msg=re.getString("patientName")+",您好!您有一个视频咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
					prescriptionService.sendWxTemplateMsg(wxId,null,type+"","videoOrderRemind",null);
					prescriptionService.sendWxTemplateMsg(wxId,"",consult,type+"","videoOrderRemind","");
				}else {
					msg=re.getString("patientName")+",您好!您有一个图文咨询订单待支付,请及时支付。点击完成支付,如您已支付请忽略本条信息。";
				}
				prescriptionService.saveInquirySystemMessage(null,consult);
				data.put("msg",msg);
				systemMessageDO.setData(data.toString());
				systemMessageService.saveMessage(systemMessageDO);

+ 3 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/ykyy/YkyyController.java

@ -45,6 +45,8 @@ public class YkyyController extends EnvelopRestEndpoint {
    @Autowired
    private WxTemplateService wxTemplateService;
    @Value("${demo.flag}")
    private boolean demoFlag;
    @GetMapping(value = "/selectCardList")
    @ApiOperation(value = "查询就诊卡")
@ -384,7 +386,7 @@ public class YkyyController extends EnvelopRestEndpoint {
            @ApiParam(name = "code", value = "code", required = true)
            @RequestParam(required = true)String code) throws Exception {
        try {
            ykyyEntranceService.findByRealOrder(code);
            ykyyEntranceService.findByRealOrder(code,demoFlag);
            return ObjEnvelop.getSuccess("ok","");
        } catch (Exception e) {
            return ObjEnvelop.getError(e.getMessage());

+ 22 - 4
svr/svr-internet-hospital/src/main/resources/application.yml

@ -111,6 +111,7 @@ myFamily:
  qrCodeFailurTime: 2
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
@ -183,6 +184,7 @@ fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
@ -263,6 +265,7 @@ fast-dfs:
  tracker-server: 192.0.33.26:22122 #服务器地址
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
@ -352,6 +355,7 @@ fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
@ -437,6 +441,7 @@ fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
@ -519,6 +524,7 @@ fast-dfs:
  tracker-server: 192.168.103.159:22122 #服务器地址
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
@ -599,6 +605,7 @@ fast-dfs:
  tracker-server: 172.16.100.240:22122 #服务器地址
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
@ -681,6 +688,7 @@ fast-dfs:
  tracker-server: 192.168.103.159:22122 #服务器地址
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段  # todo 待配置
  flag: false #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP #todo 待配置
@ -754,15 +762,16 @@ spring:
    password: admin
  redis:
#    host: 172.26.0.253 # Redis server host.
    host: 172.26.0.190 # Redis server host.
    port: 6379 # Redis server port.
    host: 172.26.0.190 # Redis server host
    port: 6379 # Redis server port
fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
fast-dfs:
  tracker-server: 172.26.0.110:22122 #服务器地址
wechat:
  id: xm_zsyy_wx  # base库中,wx_wechat 的id字段
  id: xm_ykyy_wx  # base库中,wx_wechat 的id字段
  flag: true #演示环境  true走Mysql数据库  false走Oracle
# 短信验证码发送的客户端标识,居民端
sms:
  clientId: EwC0iRSrcP
@ -807,4 +816,13 @@ wlyy:
qywx:
  url: 2
  id: 1
  id: 1
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk