Переглянути джерело

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

wangzhinan 4 роки тому
батько
коміт
e9df53b65e

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

@ -1268,7 +1268,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        List<WlyyOutpatientDO> list = new ArrayList<>();
        List<WlyyOutpatientDO> list = new ArrayList<>();
        if(StringUtils.isNotBlank(outpatientType)&&outpatientType.equalsIgnoreCase("3")){
        if(StringUtils.isNotBlank(outpatientType)&&outpatientType.equalsIgnoreCase("3")){
            list = outpatientDao.findByPatientAndDoctorList(patient);
            list = outpatientDao.findByPatientAndDoctorList(patient);
        }else{
        }else {
            list = outpatientDao.findByPatientList(patient);
            list = outpatientDao.findByPatientList(patient);
        }
        }
@ -6313,6 +6313,49 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        wlyyOutpatientDO.setDoctor(doctor);
        wlyyOutpatientDO.setDoctor(doctor);
        wlyyOutpatientDO.setDoctorName(baseDoctorDO.getName());
        wlyyOutpatientDO.setDoctorName(baseDoctorDO.getName());
        outpatientDao.save(wlyyOutpatientDO);
        outpatientDao.save(wlyyOutpatientDO);
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String doctorYktid ="";
            if (baseDoctorDO!=null){
                if(StringUtils.isNoneBlank(baseDoctorDO.getYktDoctorId())){
                    doctorYktid = baseDoctorDO.getYktDoctorId();
                }else {
                    DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(baseDoctorDO.getId());
                    if (doctorMappingDO!=null){
                        String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                        System.out.println("Continue");
                        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
                        if (jsonObject.getInteger("code")==200){
                            com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("data");
                            if (array!=null&&array.size()!=0){
                                doctorYktid=array.getJSONObject(0).getString("DOCTORUSERID");
                            }
                        }
                    }
                }
            }
            String orderNo = "";
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientCode);
            if (businessOrderDO!=null){
                orderNo = businessOrderDO.getOrderNo();
            }
            String res = ykyyService.updateDoctorIdByOrderId(doctorYktid,orderNo);
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            if (StringUtils.isNoneBlank(res)){
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(res);
                if (object!=null){
                    wlyyHttpLogDO.setCode(object.getString("code"));
                }
            }
            wlyyHttpLogDO.setName("抢单医生id写入眼科通");
            wlyyHttpLogDO.setCode("update_doctorid_by_orderno");
            wlyyHttpLogDO.setRequest("doctorId="+doctorYktid+";"+"orderNo="+orderNo);
            wlyyHttpLogDO.setDoctor(doctor);
            wlyyHttpLogDO.setResponse(res);
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
        }
    }
    }
@ -6971,6 +7014,49 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            }
            hospitalWaitingRoomDao.save(roomDOs);
            hospitalWaitingRoomDao.save(roomDOs);
        }
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String doctorYktid = "";
            String orderNo = "";
            BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
            if (baseDoctorDO!=null){
                if(StringUtils.isNoneBlank(baseDoctorDO.getYktDoctorId())){
                    doctorYktid = baseDoctorDO.getYktDoctorId();
                }else {
                    DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(baseDoctorDO.getId());
                    if (doctorMappingDO!=null){
                        String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
                        System.out.println("Continue");
                        com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
                        if (jsonObject.getInteger("code")==200){
                            com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("data");
                            if (array!=null&&array.size()!=0){
                                doctorYktid=array.getJSONObject(0).getString("DOCTORUSERID");
                            }
                        }
                    }
                }
            }
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
            if (businessOrderDO!=null){
                orderNo = businessOrderDO.getOrderNo();
            }
            String res = ykyyService.updateDoctorIdByOrderId(doctorYktid,orderNo);
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            if (StringUtils.isNoneBlank(res)){
                com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(res);
                if (object!=null){
                    wlyyHttpLogDO.setCode(object.getString("code"));
                }
            }
            wlyyHttpLogDO.setName("患者选择抢单医生id写入眼科通");
            wlyyHttpLogDO.setCode("update_doctorid_by_orderno");
            wlyyHttpLogDO.setRequest("doctorId="+doctorYktid+";"+"orderNo="+orderNo);
            wlyyHttpLogDO.setDoctor(outpatientDO.getDoctor());
            wlyyHttpLogDO.setPatient(outpatientDO.getConsumer());
            wlyyHttpLogDO.setResponse(res);
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
        }
        return outpatient;
        return outpatient;
    }
    }
@ -7031,7 +7117,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                        patient.setCreateTime(new Date());
                        patient.setCreateTime(new Date());
                        patient.setUpdateTime(new Date());
                        patient.setUpdateTime(new Date());
                        patient.setBirthday(DateUtil.strToDate(biz.getString("birthday"), "yyyyMMdd"));
                        patient.setBirthday(DateUtil.strToDate(biz.getString("birthday"), "yyyyMMdd"));
                        basePatientDao.save(patient);
                        basePatientDao.save(patient);
                        rsMap.put("sCode", auth_status);
                        rsMap.put("sCode", auth_status);
                        rsMap.put("sMes", "success");
                        rsMap.put("sMes", "success");

+ 1 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java

@ -248,6 +248,7 @@ public class YkyyService {
        if (StringUtils.isNoneBlank(appCallbackUrl)){
        if (StringUtils.isNoneBlank(appCallbackUrl)){
            url+="&app_callback_url="+URLEncoder.encode(appCallbackUrl);
            url+="&app_callback_url="+URLEncoder.encode(appCallbackUrl);
        }
        }
        logger.info("眼科通新增订单接口url:"+url);
        response = httpClientUtil.get(url,"GBK");
        response = httpClientUtil.get(url,"GBK");
        logger.info("眼科通新增订单接口:"+response);
        logger.info("眼科通新增订单接口:"+response);
        return response;
        return response;

+ 54 - 11
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -12,6 +12,7 @@ import com.yihu.jw.entity.base.wx.WxPayLogDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
@ -21,6 +22,7 @@ import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.entity.order.BusinessOrderRefundDO;
import com.yihu.jw.entity.order.BusinessOrderRefundDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.OutpatientDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
@ -45,6 +47,7 @@ import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeiXinPayUtils;
import com.yihu.jw.util.wechat.WeiXinPayUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
@ -125,6 +128,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private PrescriptionService prescriptionService;
    private PrescriptionService prescriptionService;
    @Autowired
    @Autowired
    private WlyyChargeDictDao chargeDictDao;
    private WlyyChargeDictDao chargeDictDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
@ -243,7 +248,11 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        businessOrderDO.setCreateTime(new Date());
        businessOrderDO.setCreateTime(new Date());
        businessOrderDO.setUpdateTime(new Date());
        businessOrderDO.setUpdateTime(new Date());
        businessOrderDO.setStatus(0);
        businessOrderDO.setStatus(0);
        businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
            businessOrderDO.setOrderNo("HLWYY"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        }else {
            businessOrderDO.setOrderNo("HLWYYQD"+businessOrderDO.getOrderType()+System.currentTimeMillis()+(int)(Math.random()*900)+100);
        }
        businessOrderDO.setUploadStatus(0);
        businessOrderDO.setUploadStatus(0);
        businessOrderDO.setPayType(1);
        businessOrderDO.setPayType(1);
        if (businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){
        if (businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){
@ -282,7 +291,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        String orderType =businessOrderDO.getOrderType().toString();
        String orderType =businessOrderDO.getOrderType().toString();
        String payType="2";
        String payType="2";
        String patientTel = basePatientDO.getMobile();
        String patientTel = basePatientDO.getMobile();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
        DoctorMappingDO doctorMappingDO = null;
        if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
            doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
        }
        String orderCatagrate = businessOrderDO.getOrderCategory();
        String orderCatagrate = businessOrderDO.getOrderCategory();
        String pcCallBack=businessOrderDO.getPcCallbackUrl();
        String pcCallBack=businessOrderDO.getPcCallbackUrl();
        String appCallBack = businessOrderDO.getAppCallbackUrl();
        String appCallBack = businessOrderDO.getAppCallbackUrl();
@ -299,13 +311,17 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    JSONArray array = jsonObject.getJSONArray("data");
                    JSONArray array = jsonObject.getJSONArray("data");
                    if (array!=null&&array.size()!=0){
                    if (array!=null&&array.size()!=0){
                        yktDoctor=array.getJSONObject(0).getString("DOCTORUSERID");
                        yktDoctor=array.getJSONObject(0).getString("DOCTORUSERID");
                    }else {
                        yktDoctor = "hlwyymrys001";
                    }
                    }
                }
                }
            }
            }
        }else {
        }else {
            /*throw new Exception("医生映射表不存在!");*/
            /*throw new Exception("医生映射表不存在!");*/
            yktDoctor="hlwyymrys001";
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                yktDoctor="hlwyymrys001";
            }
        }
        }
        String remark = businessOrderDO.getRematk();
        String remark = businessOrderDO.getRematk();
        if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
        if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
@ -313,6 +329,12 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        } else {
        } else {
            String response=ykyyService.addYktOrder(orderNo,patientId,orderAmout,remark,state,orderType,yktDoctor,payType,null,patientTel,orderCatagrate,pcCallBack,appCallBack);
            String response=ykyyService.addYktOrder(orderNo,patientId,orderAmout,remark,state,orderType,yktDoctor,payType,null,patientTel,orderCatagrate,pcCallBack,appCallBack);
            JSONObject object = JSONObject.parseObject(response);
            JSONObject object = JSONObject.parseObject(response);
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            wlyyHttpLogDO.setResponse(response);
            wlyyHttpLogDO.setRequest("orderNo;"+orderNo+";"+"yktDoctor:"+yktDoctor);
            wlyyHttpLogDO.setName("同步眼科通订单接口");
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
            if (object.getInteger("code")==200){
            if (object.getInteger("code")==200){
                businessOrderDO.setUploadStatus(1);
                businessOrderDO.setUploadStatus(1);
                businessOrderDao.save(businessOrderDO);
                businessOrderDao.save(businessOrderDO);
@ -354,7 +376,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        String orderType =businessOrderDO.getOrderType().toString();
        String orderType =businessOrderDO.getOrderType().toString();
        String payType="2";
        String payType="2";
        String patientTel = basePatientDO.getMobile();
        String patientTel = basePatientDO.getMobile();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
        DoctorMappingDO doctorMappingDO = null;
        if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
            doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
        }
        String orderCatagrate = businessOrderDO.getOrderCategory();
        String orderCatagrate = businessOrderDO.getOrderCategory();
        String pcCallBack=businessOrderDO.getPcCallbackUrl();
        String pcCallBack=businessOrderDO.getPcCallbackUrl();
        String appCallBack = businessOrderDO.getAppCallbackUrl();
        String appCallBack = businessOrderDO.getAppCallbackUrl();
@ -364,6 +389,10 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        String doctorId = "";
        String doctorId = "";
        if (doctorMappingDO!=null){
        if (doctorMappingDO!=null){
            doctorId = doctorMappingDO.getMappingCode();
            doctorId = doctorMappingDO.getMappingCode();
        }else {
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                doctorId="hlwyymrys001";
            }
        }
        }
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
        WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("YKTCONTROL");
        if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
        if (null != hospitalSysDictDO && "0".equalsIgnoreCase(hospitalSysDictDO.getDictValue())) {
@ -881,19 +910,33 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        String orderType =businessOrderDO.getOrderType().toString();
        String orderType =businessOrderDO.getOrderType().toString();
        String payType="2";
        String payType="2";
        String patientTel = basePatientDO.getMobile();
        String patientTel = basePatientDO.getMobile();
        DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
        DoctorMappingDO doctorMappingDO = null;
        if (StringUtils.isNoneBlank(businessOrderDO.getDoctor())){
            doctorMappingDO = doctorMappingDao.findByDoctor(businessOrderDO.getDoctor());
        }
        String orderCatagrate = businessOrderDO.getOrderCategory();
        String orderCatagrate = businessOrderDO.getOrderCategory();
        String pcCallBack=businessOrderDO.getPcCallbackUrl();
        String pcCallBack=businessOrderDO.getPcCallbackUrl();
        String appCallBack = businessOrderDO.getAppCallbackUrl();
        String appCallBack = businessOrderDO.getAppCallbackUrl();
        String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
        String yktDoctor ="";
        String yktDoctor ="";
        JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
        if (jsonObject.getInteger("code")==200){
            JSONArray array = jsonObject.getJSONArray("data");
            if (array!=null&&array.size()!=0){
                yktDoctor=array.getJSONObject(0).getString("DOCTORUSERID");
        if (null!=doctorMappingDO){
            String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
            JSONObject jsonObject = JSONObject.parseObject(doctorResponse);
            if (jsonObject.getInteger("code")==200){
                JSONArray array = jsonObject.getJSONArray("data");
                if (array!=null&&array.size()!=0){
                    yktDoctor=array.getJSONObject(0).getString("DOCTORUSERID");
                }else {
                    if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                        yktDoctor="hlwyymrys001";
                    }
                }
            }
        }else {
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                yktDoctor="hlwyymrys001";
            }
            }
        }
        }
        String response = ykyyService.addYktOrder(orderNo,patientId,orderAmout,description,state,orderType,yktDoctor,payType,null,patientTel,orderCatagrate,pcCallBack,appCallBack);
        String response = ykyyService.addYktOrder(orderNo,patientId,orderAmout,description,state,orderType,yktDoctor,payType,null,patientTel,orderCatagrate,pcCallBack,appCallBack);
        return response;
        return response;
    }
    }

+ 1 - 2
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -55,6 +55,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.ylzinfo.onepay.sdk.domain.ext.WaitPayDetailVO;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
@ -1411,7 +1412,6 @@ public class ImService {
		}
		}
	}
	}
	/**
	/**
	 * 添加复诊咨询
	 * 添加复诊咨询
	 * @return
	 * @return
@ -1588,7 +1588,6 @@ public class ImService {
		// 添加医生咨询日志
		// 添加医生咨询日志
		addLogs(ct);
		addLogs(ct);
		JSONObject result = imUtil.getSingleSessionInfo(sessionId,doctorCode);
		JSONObject result = imUtil.getSingleSessionInfo(sessionId,doctorCode);
		//发送外层SOCKET消息 在线复诊
		//发送外层SOCKET消息 在线复诊
		if("1".equals(wlyyOutpatientDO.getOutpatientType())||"3".equals(wlyyOutpatientDO.getOutpatientType())){
		if("1".equals(wlyyOutpatientDO.getOutpatientType())||"3".equals(wlyyOutpatientDO.getOutpatientType())){
			System.out.println("发送外层SOCKET消息:在线复诊");
			System.out.println("发送外层SOCKET消息:在线复诊");

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

@ -1362,7 +1362,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        try {
        try {
            logger.info("authCode :"+authCode);
            logger.info("authCode :"+authCode);
            Map<String,Object> rs = oauthSsoService.savePatient(code,appId,authCode);
            Map<String,Object> rs = oauthSsoService.savePatient(code,appId,authCode,wechatId);
            Integer c = (Integer) rs.get("code");
            Integer c = (Integer) rs.get("code");
            if(c != 1){
            if(c != 1){
                return ObjEnvelop.getError(rs.get("mes")+"");
                return ObjEnvelop.getError(rs.get("mes")+"");

+ 2 - 2
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthSsoService.java

@ -86,7 +86,7 @@ public class OauthSsoService {
        return oauthRsaKeyDO.getPublicKey();
        return oauthRsaKeyDO.getPublicKey();
    }
    }
    public Map<String,Object> savePatient(String code,String appId,String authCode)throws Exception{
    public Map<String,Object> savePatient(String code,String appId,String authCode,String wechatId)throws Exception{
        Map<String,Object> rs = new HashedMap();
        Map<String,Object> rs = new HashedMap();
        try{
        try{
@ -128,7 +128,7 @@ public class OauthSsoService {
                    rs.put("mes","获取居民信息成功");
                    rs.put("mes","获取居民信息成功");
                    rs.put("patient",basePatientDO);
                    rs.put("patient",basePatientDO);
                    List<BasePatientWechatDo> wechatDos = basePatientWechatDao.findByWechatIdAndPatientId(appId,basePatientDO.getId());
                    List<BasePatientWechatDo> wechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wechatId,basePatientDO.getId());
                    if(wechatDos!=null&&wechatDos.size()>0){
                    if(wechatDos!=null&&wechatDos.size()>0){
                        for(BasePatientWechatDo wechatDo:wechatDos){
                        for(BasePatientWechatDo wechatDo:wechatDos){
                            wechatDo.setOpenid(openid);
                            wechatDo.setOpenid(openid);

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

@ -202,6 +202,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			ConsultTeamDo consult = new ConsultTeamDo();
			ConsultTeamDo consult = new ConsultTeamDo();
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
			WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
			if (null!=outpatientDO){
			if (null!=outpatientDO){
                if(!outpatientDO.getDoctor().equalsIgnoreCase(doctorCode)){
                    return failed("当前患者已选择其他医生进行咨询或复诊。");
                }
				if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
				if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
					if("2".equalsIgnoreCase(outpatientDO.getType())){
					if("2".equalsIgnoreCase(outpatientDO.getType())){
						consult.setType(16);//视频复诊
						consult.setType(16);//视频复诊
@ -361,6 +364,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
		ConsultTeamDo consult = new ConsultTeamDo();
		ConsultTeamDo consult = new ConsultTeamDo();
		WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
		WlyyOutpatientDO outpatientDO = outpatientDao.findById(outpatientCode);
		if (null!=outpatientDO){
		if (null!=outpatientDO){
		    if(!outpatientDO.getDoctor().equalsIgnoreCase(doctorCode)){
                return failed("当前患者已选择其他医生进行咨询或复诊。");
            }
			if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
			if ("1".equalsIgnoreCase(outpatientDO.getOutpatientType())){
				if("2".equalsIgnoreCase(outpatientDO.getType())){
				if("2".equalsIgnoreCase(outpatientDO.getType())){
					consult.setType(16);//视频复诊
					consult.setType(16);//视频复诊
@ -523,16 +529,21 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
						cardNo = outpatientDO.getCardNo();
						cardNo = outpatientDO.getCardNo();
					}
					}
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					String date=DateUtil.dateToStr(outpatientDO.getRegisterDate(), "yyyyMMddHHmmss");
					net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
					net.sf.json.JSONObject res = object.getJSONObject("resquest");
					logger.info("获取待结算数据 res: " + res.toString());
					String rsCode = res.getString("@RESULT");
					String free= 0+"";
					if ("0".equals(rsCode)) {
						if (res.getString("@settle_flag").equalsIgnoreCase("N")){
							free = res.getString("@total_charge");
                    String free= 0+"";
                    if (StringUtils.isNoneBlank(outpatientDO.getRealOrder())){
                        net.sf.json.JSONObject object =entranceService.BS15054(patientMappingDO.getMappingCode(),outpatientDO.getRealOrder(),false);
                        if(object!=null){
							net.sf.json.JSONObject res = object.getJSONObject("resquest");
							String rsCode = res.getString("@RESULT");
							if ("0".equals(rsCode)) {
								if (res.getString("@settle_flag").equalsIgnoreCase("N")){
									free = res.getString("@total_charge");
								}
							}
							logger.info("获取待结算数据 res: " + res.toString());
						}
						}
					}
                    }
					if (!free.equalsIgnoreCase("0")){
					if (!free.equalsIgnoreCase("0")){
						ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
						ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, outpatientDO.getXtgzh(), outpatientDO.getDeptName(), outpatientDO.getDoctorName(), date, free, "1");
					}
					}
@ -600,7 +611,14 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			@RequestParam(value = "doctor",required = true) String doctor)throws Exception{
			@RequestParam(value = "doctor",required = true) String doctor)throws Exception{
		prescriptionService.pickVideoPrescripitonWaitingPeople(outpatientCode,doctor);
		prescriptionService.pickVideoPrescripitonWaitingPeople(outpatientCode,doctor);
		WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode);
		WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findOne(outpatientCode);
		if (StringUtils.isNoneBlank(wlyyOutpatientDO.getType())){
			if (wlyyOutpatientDO.getType().equalsIgnoreCase("2")&&wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("3")){
				prescriptionService.sendWxTemplateMsg(wxId, wlyyOutpatientDO.getId(),null, "17", "videoOrderRemind", "");
			}else if (wlyyOutpatientDO.getType().equalsIgnoreCase("2")&&wlyyOutpatientDO.getOutpatientType().equalsIgnoreCase("1")){
				prescriptionService.sendWxTemplateMsg(wxId, wlyyOutpatientDO.getId(),null, "16", "videoOrderRemind", "");
			}
		}
		//发送外层SOCKET消息 在线复诊
		//发送外层SOCKET消息 在线复诊
		if("2".equals(wlyyOutpatientDO.getOutpatientType())){
		if("2".equals(wlyyOutpatientDO.getOutpatientType())){
			System.out.println("发送外层SOCKET消息:协同门诊医生抢单之后,通知全科医生修改状态");
			System.out.println("发送外层SOCKET消息:协同门诊医生抢单之后,通知全科医生修改状态");
@ -613,8 +631,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			JSONObject object = new JSONObject();
			JSONObject object = new JSONObject();
			object.put("socket_sms_type",6);
			object.put("socket_sms_type",6);
			object.put("relation_code",wlyyOutpatientDO.getId());
			object.put("relation_code",wlyyOutpatientDO.getId());
			imService.sendWaiSocketMessage(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getPatient(),object.toString(),"1");
			imService.sendWaiSocketMessage(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getConsumer(),object.toString(),"1");
		}
		}
		return success("请求成功");
		return success("请求成功");
	}
	}