Просмотр исходного кода

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

wangzhinan 4 лет назад
Родитель
Сommit
090e5bc3d8

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

@ -56,6 +56,8 @@ public interface OutpatientDao extends PagingAndSortingRepository<WlyyOutpatient
    Integer countByTime(String type,String doctor,Date startTime,Date endTime);
    @Query("from WlyyOutpatientDO a where a.status = 0 and a.payStatus = 1 and (a.remindCount<?1 or a.remindCount is null)")
    List<WlyyOutpatientDO> findWaitingOutpatient(Integer remindCount);
    @Query("from WlyyOutpatientDO a where a.status = 0")
    List<WlyyOutpatientDO> findAllWaitingOutpatient();
    /*@Query("from WlyyOutpatientDO a where a.patient = ?1 and a.outpatientType = 1")
    List<WlyyOutpatientDO> findOutpatientByPatientAndStatus(String patient);*/

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

@ -3622,6 +3622,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        wlyyOutpatientDO.setStatus("-1");
        //报错拒诊操作人
        wlyyOutpatientDO.setOperator(userAgent.getUID());
        wlyyOutpatientDO.setEndTime(new Date());
        String description = null;
        if (1 == operator) {
            //居民取消
@ -3755,7 +3756,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            if ("9".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已取消";
            }
            if ("16".equals(type)) {
                contentMsg = "医生已取消您的复诊申请,取消原因:"+remindMsg;
@ -3768,6 +3768,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            first = outpatientDO.getConsumerName() + ",您好!";
            logger.info("outPatientTimeOutRemind:outpatientId="+outpatientId+"contentMsg"+contentMsg);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        }else if("systemCancelRemind".equalsIgnoreCase(titelType)){
            if ("9".equals(type)) {
                contentMsg = "系统已自动取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已取消";
            }
            if ("16".equals(type)) {
                contentMsg = "系统已自动取消您的复诊申请,取消原因:"+remindMsg;
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已取消";
            }
            logger.info("系统取消接诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
@ -4043,6 +4054,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + consultTeam.getConsult());
                logger.info("眼科微信消息模板推送 服务评价提醒开始");
            } else if ("systemCancelRemind".equalsIgnoreCase(titelType)) {
                scene = "xtqxfz";
                WxTemplateConfigDO config = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, "template_system_cancel", scene, 1);
                BeanUtils.copyProperties(config, newConfig);
                newConfig.setFirst(config.getFirst().replace("key1", outpatientDO.getConsumerName()));
                if ("9".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "图文复诊"));
                } else if ("16".equals(type)) {
                    newConfig.setFirst(newConfig.getFirst().replace("key2", "视频复诊"));
                }
                newConfig.setKeyword1( outpatientDO.getHospitalName());
                newConfig.setKeyword2(outpatientDO.getDoctorName());
                newConfig.setKeyword3( doctorDO.getFee());
                //发起微信消息模板推送
                newConfig.setUrl(newConfig.getUrl() + "" + outpatientDO.getId());
                logger.info("眼科微信消息模板推送 系统拒诊开始");
            }

+ 7 - 6
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -3717,7 +3717,7 @@ public class StatisticsEsService {
                object.put("totalData",array);//新增量
                JSONArray array1 = dateTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);//未接诊
                object.put("noReceiveData",array1);//未接诊
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index1,"1,2",SaveModel.timeLevel_ZL,null);//已接诊
                JSONArray array2 = dateTotalStatistics2(startDate,endDate,area,level,index,"1,2,3",SaveModel.timeLevel_ZL,null);//已接诊
                object.put("haveReceiveData",array2);//已接诊
                JSONArray array3 = dateTotalStatistics2(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL,null);//患者取消
                object.put("concleData",array3);//患者取消
@ -3742,12 +3742,12 @@ public class StatisticsEsService {
                object.put("totalData",array);//新增量
                JSONArray array1 = weekTotalStatistics(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL);//未接诊
                object.put("noReceiveData",array1);;//未接诊
                JSONArray array2 = weekTotalStatistics(startDate,endDate,area,level,index1,"1,2",SaveModel.timeLevel_ZL);//已接诊
                JSONArray array2 = weekTotalStatistics(startDate,endDate,area,level,index,"1,2,3",SaveModel.timeLevel_ZL);//已接诊
                object.put("haveReceiveData",array2);//已接诊
                JSONArray array3 = weekTotalStatistics(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL);//患者取消
                object.put("concleData",array3);//患者取消
                JSONArray array4 = weekTotalStatistics(startDate,endDate,area,level,index,"3",SaveModel.timeLevel_ZL);//已结束
                object.put("endData",array3);//已结束
                object.put("endData",array4);//已结束
            }
        }else if (interval==3){
@ -3767,7 +3767,7 @@ public class StatisticsEsService {
                object.put("totalData",array);
                JSONArray array1 = monthTotalStatistics2(startDate,endDate,area,level,index1,"0",SaveModel.timeLevel_ZL,null);
                object.put("noReceiveData",array1);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index1,"1,2",SaveModel.timeLevel_ZL,null);
                JSONArray array2 = monthTotalStatistics2(startDate,endDate,area,level,index,"1,2,3",SaveModel.timeLevel_ZL,null);
                object.put("haveReceiveData",array2);
                JSONArray array3 = monthTotalStatistics2(startDate,endDate,area,level,index,"-1",SaveModel.timeLevel_ZL,null);
                object.put("concleData",array3);
@ -3815,11 +3815,11 @@ public class StatisticsEsService {
            //咨询总数
            List<SaveModel> total = elasticsearchUtil.findListDateQuotaLevel0(startTime, endTime, area, level, index1, SaveModel.timeLevel_ZL, lowLevel);
            //已接诊
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1,2");
            List<SaveModel> haveReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"1,2,3");
            //未接诊
            List<SaveModel> noReceiveTotal = elasticsearchUtil.findListDateQuotaLevel1(startTime, endTime, area, level, index, SaveModel.timeLevel_ZL, lowLevel,"0");
            result.put("resultList", getCoutListPC1(level, lowLevel, endTotal, total, haveReceiveTotal,noReceiveTotal,concleTotal));
        }
    }
        return result;
@ -3930,6 +3930,7 @@ public class StatisticsEsService {
            rs.put("total", totalNm);
            rs.put("noReceiveCount", noReceiveNm);
            rs.put("haveReceiveCount", haveReceiveNm);
            rs.put("endAndReciveCount",endNm+haveReceiveNm);
            rs.put("code", key);
            resultMaps.add(rs);
        }

+ 16 - 12
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -215,7 +215,8 @@ public class ImService {
				"d.job_title_name AS \"jobTitleName\", " +
				"h.dept_name AS \"deptName\", " +
				"h.org_name AS \"hospitalName\", " +
				"a.pay_status AS \"payStatus\" "+
				"a.pay_status AS \"payStatus\", "+
				"a.source AS \"source\" "+
				"FROM wlyy_consult a," +
				"wlyy_consult_team b," +
				"base_doctor d, " +
@ -893,7 +894,7 @@ public class ImService {
	 * @return
	 * @throws Exception
	 */
	public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor) throws Exception {
	public JSONObject addTeamConsult(ConsultTeamDo ct, String patient, String doctor,String source) throws Exception {
		JSONObject re = new JSONObject();
		boolean boo = StringUtils.isEmpty(getUnfinishedConsult(patient, doctor));
		logger.info("boo"+boo);
@ -938,7 +939,7 @@ public class ImService {
		// 医生未读数量为1
		ct.setDoctorRead(1);
		// 添加咨询记录
		ConsultDo consult = addConsult(ct.getPatient(), "专家咨询", ct.getSymptoms(), ct.getImages(), ct.getType());
		ConsultDo consult = addConsult(ct.getPatient(), "专家咨询", ct.getSymptoms(), ct.getImages(), ct.getType(),source);
//		// 设置关联指导
//		consult.setGuidance(ct.getGuidance());
		// 设置咨询标识
@ -1011,7 +1012,7 @@ public class ImService {
	 * @param type 咨询类型:9在线复诊,13专家咨询
	 * @return
	 */
	public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type) {
	public ConsultDo addConsult(String patient, String title, String symptoms, String images, int type,String source) {
		ConsultDo consult = new ConsultDo();
		consult.setId(UUID.randomUUID().toString().replaceAll("-", ""));
		consult.setCzrq(new Date());
@ -1022,6 +1023,7 @@ public class ImService {
		consult.setImages(images);
		consult.setType(type);
		consult.setPayStatus(0);
		consult.setSource(source);
		return consultDao.save(consult);
	}
	
@ -1106,7 +1108,7 @@ public class ImService {
	 * @param reason
	 * @return
	 */
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception {
	public JSONObject addPrescriptionConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId,String source) throws Exception {
		
		synchronized (outpatientCode.intern()) {
			
@ -1227,7 +1229,7 @@ public class ImService {
				//添加就诊图片
				ct.setImages(wlyyOutpatientDO.getDiseaseImg());
				// 添加咨询记录
				ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType());
				ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),wlyyOutpatientDO.getSource());
				// 设置关联指导
				consult.setGuidance(ct.getGuidance());
				//关联业务code
@ -1345,7 +1347,7 @@ public class ImService {
	 * 添加复诊咨询
	 * @return
	 */
	public JSONObject addConsult(String outpatientCode, String patient,String doctorCode, ConsultTeamDo ct, String reason, Integer type,String wxId) throws Exception {
	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.findOne(outpatientCode);
		BaseDoctorDO doctor = baseDoctorDao.findById(doctorCode);
@ -1407,7 +1409,7 @@ public class ImService {
		//添加就诊图片
		ct.setImages(wlyyOutpatientDO.getDiseaseImg());
		// 添加咨询记录
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType());
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),wlyyOutpatientDO.getSource());
		// 设置关联指导
		consult.setGuidance(ct.getGuidance());
		//关联业务code
@ -2174,7 +2176,8 @@ public class ImService {
					"d.idcard as \"patientIdcard\"," +
					"d.sex as \"patientSex\"," +
					"d.photo AS \"patientPhoto\", " +
					"b.doctor as \"doctor\"  "+
					"b.doctor as \"doctor\" ,"+
					"a.source as \"source\"  "+
					"FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d " +
@ -2210,7 +2213,8 @@ public class ImService {
					"op.general_doctor as \"generalDoctor\"," +
					"op.icd10_name as \"icd10Name\"," +
					"d.photo AS \"patientPhoto\" , " +
					"b.doctor as \"doctor\"  "+
					"b.doctor as \"doctor\" ,"+
                    "a.source as \"source\"  "+
					"FROM wlyy_consult_team b," +
					"base_patient d," +
					"wlyy_consult a   " +
@ -2569,7 +2573,7 @@ public class ImService {
	 * @param images
	 * @return
	 */
	public String generalAddExpertConsult(String patient_code, String general_doctor, String special_doctor, String when, String symptoms, String images, ConsultTeamDo ct) throws Exception {
	public String generalAddExpertConsult(String patient_code, String general_doctor, String special_doctor, String when, String symptoms, String images, ConsultTeamDo ct,String source) throws Exception {
		// 设置咨询类型:15
		ct.setType(15);
		// 设置发病时间
@ -2632,7 +2636,7 @@ public class ImService {
		// 医生未读数量为1
		ct.setDoctorRead(1);
		// 添加咨询记录
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType());
		ConsultDo consult = addConsult(ct.getPatient(), consultTitle, ct.getSymptoms(), ct.getImages(), ct.getType(),source);
		// 设置关联指导
//		consult.setGuidance(ct.getGuidance());
		//关联业务code

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultDo.java

@ -38,6 +38,16 @@ public class ConsultDo extends UuidIdentityEntity {
	private String relationCode;
	//支付状态
	private Integer payStatus;
	//来源
	private String source;
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	
	public String getPatient() {
		return patient;

+ 123 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/PrescriptionStatusUpdateService.java

@ -2,20 +2,33 @@ package com.yihu.jw.service.channel;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.hospital.prescription.*;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao;
import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao;
import com.yihu.jw.hospital.message.service.SystemMessageService;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
import com.yihu.jw.hospital.prescription.service.PrescriptionService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.im.service.ImService;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.repository.job.QuartzJobLogDao;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.status.EnvelopStatus;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -63,7 +76,17 @@ public class PrescriptionStatusUpdateService {
    @Autowired
    private PrescriptionLogService prescriptionLogService;
    @Autowired
    private QuartzJobLogDao quartzJobLogDao;
    private HospitalWaitingRoomDao hospitalWaitingRoomDao;
    @Autowired
    private PatientRegisterTimeDao patientRegisterTimeDao;
    @Autowired
    private YkyyService ykyyService;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private SystemMessageService systemMessageService;
    public void autoPush() throws Exception {
@ -287,6 +310,7 @@ public class PrescriptionStatusUpdateService {
            for(WlyyOutpatientDO outpatientDO:outpatientDOs){
                //结束门诊
                outpatientDO.setStatus("3");
                outpatientDO.setEndTime(new Date());
                String consultCode ="";
                try {
                    consultCode = imService.getConsultCodeByOutpatientId(outpatientDO.getId());
@ -323,6 +347,103 @@ public class PrescriptionStatusUpdateService {
            logger.info("setOutPatientOver count :"+0);
        }
        logger.info("setOutPatientOver end ");
        //logger.info("进入结束超时未接诊的门诊");
        /*List<WlyyOutpatientDO> timeout = outpatientDao.findAllWaitingOutpatient();
        if (null!=timeout&&timeout.size()>0){
            logger.info("开始结束超时未接诊的门诊");
            String cancelValue = "超时订单系统自动取消";
            String cancelRemark = "当天未接诊的门诊订单自动取消";
            for(WlyyOutpatientDO wlyyOutpatientDO:timeout){
                String outPatientId = wlyyOutpatientDO.getId();
                //判断医生是否接诊
                List<WlyyHospitalWaitingRoomDO> roomDOs = hospitalWaitingRoomDao.findByOutpatientId(outPatientId);
                if (roomDOs != null && roomDOs.size() > 0) {
                    for (WlyyHospitalWaitingRoomDO roomDO : roomDOs) {
                        if (roomDO.getVisitStatus() == 2) {
                            logger.info("id为:"+outPatientId+"的门诊已被医生接诊");
                        } else {
                            roomDO.setVisitStatus(-1);
                            logger.info("修改候诊室状态,将候诊病人移除候诊室");
                            hospitalWaitingRoomDao.save(roomDO);
                        }
                    }
                }
                //更改门诊状态
                wlyyOutpatientDO.setStatus("-1");
                String description = null;
                wlyyOutpatientDO.setDoctorCancelRemark("6");
                wlyyOutpatientDO.setDoctorCancelType(cancelValue);
                wlyyOutpatientDO.setDoctorCancelValue(cancelRemark);
                wlyyOutpatientDO.setEndTime(new Date());
                description = cancelValue;
                //系统消息
                SystemMessageDO messageDO = new SystemMessageDO();
                messageDO.setTitle("超时订单系统自动取消");
                messageDO.setType("13");
                messageDO.setSender(wlyyOutpatientDO.getDoctor());
                messageDO.setSenderName(wlyyOutpatientDO.getDoctorName());
                messageDO.setRelationCode(wlyyOutpatientDO.getId());
                messageDO.setReceiver(wlyyOutpatientDO.getPatient());
                messageDO.setReceiverName(wlyyOutpatientDO.getPatientName());
                net.sf.json.JSONObject data = new net.sf.json.JSONObject();
                try {
                    data.put("name", wlyyOutpatientDO.getPatientName());
                    data.put("age", IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard()));
                    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 + "。";
                        prescriptionService.sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "9", "systemCancelRemind", cancelRemark);
                    }
                    if ("2".equalsIgnoreCase(wlyyOutpatientDO.getType())) {
                        data.put("type", "16");
                        msg += wlyyOutpatientDO.getPatientName() + ",您好! 您有一个视频复诊已被系统取消,取消原因:" + cancelValue + "。取消说明:" + cancelRemark + "。";
                        prescriptionService.sendWxTemplateMsg(wechatId, wlyyOutpatientDO.getId(),null, "16", "systemCancelRemind", cancelRemark);
                    }
                    data.put("msg", msg);
                    messageDO.setData(data.toString());
                    systemMessageService.saveMessage(messageDO);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                //推送消息到眼科通
                BasePatientDO patient = basePatientDao.findById(wlyyOutpatientDO.getPatient());
                if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
                    logger.info("推送消息到眼科通");
                    ykyyService.pushNotificationToYktPatient(patient.getYktId(), messageDO.getTitle(), data.get("msg").toString());
                }
                outpatientDao.save(wlyyOutpatientDO);
                logger.info("修改保存的门诊记录:"+wlyyOutpatientDO.getId());
                //删除门诊号源
                List<WlyyPatientRegisterTimeDO> list = patientRegisterTimeDao.findByOutpatientId(wlyyOutpatientDO.getId());
                if (list != null && list.size() > 0) {
                    patientRegisterTimeDao.delete(list);
                }
                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
                try {
                    if (wechatId.equalsIgnoreCase("xm_ykyy_wx")) {
                        businessOrderService.orderRefund(wechatId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                    //眼科接诊时更新眼科通状态
                    if (businessOrderDO!=null){
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                    }
                    } else if (wechatId.equalsIgnoreCase("xm_zsyy_wx")) {
*//*
                businessOrderService.ylzOrderRefund(wxId, wlyyOutpatientDO.getPatient(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
*//*
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }
                logger.info(wlyyOutpatientDO.getId()+"的门诊记录设置为取消");
            }
            outpatientDao.save(outpatientDOs);
        }*/
    }
@ -369,6 +490,7 @@ public class PrescriptionStatusUpdateService {
            logger.info("setOutPatientOver Time is not up ");
        }
        logger.info("setOutPatientOver end ");
        Set set = new HashSet();
    }

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

@ -190,7 +190,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "type", value = "咨询类型(1、图文;2、视频,3、图文+视频)", defaultValue = "1")
			@RequestParam(value = "type", required = true) Integer type,
			@ApiParam(name = "reason", value = "复诊说明", defaultValue = "复诊说明")
			@RequestParam(value = "reason", required = false) String reason)throws Exception{
			@RequestParam(value = "reason", required = false) String reason,
										  @ApiParam(name = "source", value = "来源")
											  @RequestParam(value = "source", required = false) String source)throws Exception{
			ConsultTeamDo consult = new ConsultTeamDo();
			if(2 == type){
				consult.setType(16);//视频复诊
@ -235,13 +237,13 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					if("0".equals(rsCode)||"-2".equals(rsCode)){
						//挂号成功,已经挂号
						//2.
						result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
						result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
					}else{
						return failed(mes);
					}
					logger.info("调用挂号接口====END");
				}else {
					result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
					result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
				}
			}
@ -297,7 +299,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
										  @ApiParam(name = "type", value = "咨询类型(1、图文;2、视频,3、图文+视频)", defaultValue = "1")
										  @RequestParam(value = "type", required = true) Integer type,
										  @ApiParam(name = "reason", value = "复诊说明", defaultValue = "复诊说明")
										  @RequestParam(value = "reason", required = false) String reason)throws Exception{
										  @RequestParam(value = "reason", required = false) String reason,
							  @ApiParam(name = "source", value = "来源")
								  @RequestParam(value = "source", required = false) String source)throws Exception{
		ConsultTeamDo consult = new ConsultTeamDo();
		if(2 == type){
			consult.setType(16);//视频复诊
@ -349,7 +353,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
*/
			//2.
			result = imService.addConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId);
			result = imService.addConsult(outpatientCode, patientCode,doctorCode,consult,reason,type,wxId,source);
		}
		return success("操作成功",result);
	}
@ -371,14 +375,16 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "images", value = "图片")
			@RequestParam(value = "images",required = false) String images,
			@ApiParam(name = "voice", value = "语音")
			@RequestParam(value = "voice",required = false) String voice)throws Exception{
			@RequestParam(value = "voice",required = false) String voice,
			@ApiParam(name = "source", value = "来源")
			@RequestParam(value = "source",required = false) String source)throws Exception{
		
		ConsultTeamDo consult = new ConsultTeamDo();
		consult.setType(15);//家医咨询求助互联网医院专科医生:全科医生-专科医生-咨询聊天
		
		String result = "";
		synchronized (patient_code.intern()){
			result = imService.generalAddExpertConsult(patient_code, general_doctor,special_doctor,when,symptoms,images,consult);
			result = imService.generalAddExpertConsult(patient_code, general_doctor,special_doctor,when,symptoms,images,consult,source);
			
			BaseDoctorDO generalDoctor = baseDoctorDao.findById(general_doctor);
			BaseDoctorDO specialDoctor = baseDoctorDao.findById(special_doctor);
@ -461,6 +467,8 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
					}
					logger.info("发送诊查费支付模板消息end");
				}
				outpatientDO.setEndTime(new Date());
				outpatientDao.save(outpatientDO);
			}
		}
		if(1 == resutl){

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

@ -419,7 +419,9 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "voice", value = "语音")
			@RequestParam(value = "voice",required = false) String voice,
			@ApiParam(name = "type", value = "咨询类型:1专家咨询 14导诊助手 17专家视频咨询")
			@RequestParam(value = "type",required = false) Integer type)throws Exception{
			@RequestParam(value = "type",required = false) Integer type,
			@ApiParam(name = "source", value = "咨询类型来源")
			@RequestParam(value = "source",required = false) String source)throws Exception{
		
//		//发送厦门i健康智能推送
//		try{
@ -458,7 +460,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
//		JSONArray dts = null;
		synchronized (patient.intern()){//新增同步方法。设备保存写在service层但是不生效,写在controller层才生效
			JSONObject re = null;
			re = imService.addTeamConsult(consult, patient,doctor);
			re = imService.addTeamConsult(consult, patient,doctor,source);
//			res = re.getInteger("status");
//			dts = re.containsKey("doctor")?re.getJSONArray("doctor"):null;
			if (payFlag){
@ -670,7 +672,8 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				}
				logger.info("发送诊查费支付模板消息end");
			}
			outpatientDO.setEndTime(new Date());
			outpatientDao.save(outpatientDO);
		}
		}
		if(1 == resutl){