wangzhinan 1 рік тому
батько
коміт
840fc13377

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

@ -742,9 +742,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            if(rs.get("obj") instanceof JSONObject){
                object = rs.getJSONObject("obj");
            }else {
            if(!rs.getString("obj").contains("00")){
                throw new ServiceException(rs.getString("obj"));
            }
        }
@ -1995,7 +1993,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            String operatorName = "互联网医院";
            String termNo = "DSYYHLWYY";
            JSONObject rsObj = confirmPayGjybToHospital(ylzMedicalRelationDO.getCardNo(),ylzMedicalRelationDO.getLogNo(),depositAmount,outChargeNo, operatorId,operatorName,termNo);
            logger.info("");
            logger.info("rsObj");
            boolean flag = true;
            if (rsObj!=null){
                String retCode = rsObj.getString("retCode");

+ 73 - 4
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -26,6 +26,7 @@ import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.prescription.dao.*;
import com.yihu.jw.hospital.prescription.service.DsyyPrescriptionService;
import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
@ -162,6 +163,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    private DsyyPrescriptionService dsyyPrescriptionService;
    @Autowired
    private DsyyEntranceService dsyyEntranceService;
    @Autowired
    private SystemMessageDao systemMessageDao;
@ -1459,28 +1462,94 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    logger.info("his充值结束");
                }
                if (businessOrderDO.getStatus()!=1){
                    WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
                    if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                        wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                        wlyyOutpatientDO.setPayStatus(1);
                        WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
                    }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                        wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                        wlyyOutpatientDO.setPayStatus(1);
                        WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
                    }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
                        WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                        wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                        wlyyOutpatientDO.setPayStatus(1);
                        WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
                    }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("6")){
                        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findById(businessOrderDO.getRelationCode()).get();
                        if (wechatId.equalsIgnoreCase("xm_dsyy_wx")){
                            if (businessOrderDO.getStatus()!=1){
                                dsyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                                try {
                                    dsyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                                }catch (Exception e){
                                    e.printStackTrace();
                                }
                            }
                        }
                    }
                    if (wlyyOutpatientDO!=null){
                        String msg = "";
                        String sex = "";
                        String age="";
                        String date = "";
                        String title = "";
                        SystemMessageDO systemMessageDO = new SystemMessageDO();
                        if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
                            systemMessageDO.setTitle("协同门诊接诊消息提醒");
                            systemMessageDO.setType("63");
                        } else if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {//专家咨询
                            //1.图文 2.视频 3家医
                            if ("1".equals(wlyyOutpatientDO.getType())) {
                                systemMessageDO.setTitle("图文咨询接诊消息提醒");
                                systemMessageDO.setType("68");
                                title = "图文咨询消息提醒";
                                msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文咨询,请您及时点击回复";
                            } else if ("3".equals(wlyyOutpatientDO.getType())) {
                                systemMessageDO.setTitle("家医咨询接诊消息提醒");
                                systemMessageDO.setType("65");
                            } else {
                                systemMessageDO.setTitle("视频咨询接诊消息提醒");
                                systemMessageDO.setType("67");
                                title = "视频咨询接诊消息提醒";
                                date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                                msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频咨询,点击查看";
                            }
                        } else if ("1".equals(wlyyOutpatientDO.getOutpatientType())) {//在线复诊
                            //1.图文 2.视频
                            if ("1".equals(wlyyOutpatientDO.getType())) {
                                systemMessageDO.setTitle("图文复诊接诊消息提醒");
                                systemMessageDO.setType("61");
                                title = "图文复诊接诊消息提醒";
                                msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文复诊,请您及时点击接诊";
                            } else {
                                systemMessageDO.setTitle("视频复诊接诊消息提醒");
                                systemMessageDO.setType("62");
                                title = "视频复诊接诊消息提醒";
                                date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                                msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                            }
                        }
                        net.sf.json.JSONObject data = new net.sf.json.JSONObject();
                        data.put("name", wlyyOutpatientDO.getPatientName());
                        data.put("age", IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard()));
                        data.put("gender", IdCardUtil.getSexForIdcard_new(wlyyOutpatientDO.getIdcard()));
                        data.put("question", wlyyOutpatientDO.getDescription());
                        data.put("msg", systemMessageDO.getTitle());
                        systemMessageDO.setData(data.toString());
                        systemMessageDO.setReceiver(wlyyOutpatientDO.getDoctor());
                        systemMessageDO.setReceiverName(wlyyOutpatientDO.getDoctorName());
                        systemMessageDO.setRelationCode(wlyyOutpatientDO.getId());
                        systemMessageDO.setSender(wlyyOutpatientDO.getPatient());
                        systemMessageDO.setSenderName(wlyyOutpatientDO.getPatientName());
                        systemMessageDO.setRelationCode(wlyyOutpatientDO.getId());
                        systemMessageDO.setIsRead("0");
                        systemMessageDO.setDel("1");
                        systemMessageDO.setCreateTime(new Date());
                        systemMessageDao.save(systemMessageDO);
                    }
                }
                businessOrderDO.setUpdateTime(new Date());
                businessOrderDO.setStatus(1);

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

@ -121,6 +121,7 @@ public class RobotService {
    public Map<String,JSONObject> robotReply(String session_id,String type,String content){
        Map<String,JSONObject> map = new HashMap<>();
        try {
            System.out.println("自动回复1==="+type+"==="+session_id);
            List<BaseSystemDialogSetting> settingList = dialogSettingDao.selectBySystemTypeAndFlag(sessionTypeToType(type),1);
            if(settingList.size()==0){
                //未配置自动回复内容

+ 1 - 1
common/common-util/src/main/java/com/yihu/jw/util/http/HttpClientUtil.java

@ -453,7 +453,7 @@ public class HttpClientUtil {
    public  static String postBodyStatic(String url, com.alibaba.fastjson.JSONObject params) {
        RestTemplate restTemplate = new RestTemplate();
        HttpHeaders headers = new HttpHeaders();
        MediaType type = MediaType.parseMediaType("application/json; charset=GBK");
        MediaType type = MediaType.parseMediaType("application/json; charset=utf-8");
        headers.setContentType(type);
        headers.add("Accept", MediaType.APPLICATION_JSON.toString());
        org.springframework.http.HttpEntity<String> formEntity = new org.springframework.http.HttpEntity<String>(params.toString(), headers);

+ 76 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -41,6 +41,7 @@ import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.healthCare.YlzMedicailRelationDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.httplog.service.WlyyHttpLogService;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.message.service.BaseBannerDoctorService;
import com.yihu.jw.hospital.message.service.BaseUserMsgService;
import com.yihu.jw.hospital.message.service.SystemMessageService;
@ -75,6 +76,7 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.patient.PatientRequestMapping;
import com.yihu.jw.sms.service.YkyyINSMSService;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
@ -269,6 +271,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @Autowired
    private DsyyPrescriptionService dsyyPrescriptionService;
    @Autowired
    private SystemMessageDao systemMessageDao;
    @GetMapping(value = "orgInfo")
@ -758,6 +762,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                        logger.info("his充值结束");
                    }
                    if (businessOrderDO.getStatus()!=1){
                        WlyyOutpatientDO wlyyOutpatientDO = new WlyyOutpatientDO();
                        if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
                            WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findById(businessOrderDO.getRelationCode()).orElse(null);
                            JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
@ -774,11 +779,20 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
                            prescriptionVO.setPayStatus(1);
                            imService.pushPrescriptionImMessage(prescriptionVO);
                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){
                            SystemMessageDO systemMessageDO = new SystemMessageDO();
                            systemMessageDO.setType("1");
                            systemMessageDO.setReceiver(businessOrderDO.getDoctor());
                            systemMessageDO.setSender(businessOrderDO.getPatient());
                            wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                            //发送IM消息
                            hospitalSystemMessageService.sendImMessage(systemMessageDO);
                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){
                            SystemMessageDO systemMessageDO = new SystemMessageDO();
                            systemMessageDO.setType("1");
                            systemMessageDO.setReceiver(businessOrderDO.getDoctor());
                            systemMessageDO.setSender(businessOrderDO.getPatient());
                            wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                            //发送IM消息
                            hospitalSystemMessageService.sendImMessage(systemMessageDO);
                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
@ -786,6 +800,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                            systemMessageDO.setType("2");
                            systemMessageDO.setReceiver(businessOrderDO.getDoctor());
                            systemMessageDO.setSender(businessOrderDO.getPatient());
                            wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
                            //发送IM消息
                            hospitalSystemMessageService.sendImMessage(systemMessageDO);
                        }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("6")){
@ -794,7 +809,68 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                dsyyPrescriptionService.confirmSettlement(ylzMedicalRelationDO.getRelationCode());
                            }
                        }
                        if (wlyyOutpatientDO!=null){
                            String msg = "";
                            String sex = "";
                            String age="";
                            String date = "";
                            String title = "";
                            SystemMessageDO systemMessageDO = new SystemMessageDO();
                            if ("2".equals(wlyyOutpatientDO.getOutpatientType())) {
                                systemMessageDO.setTitle("协同门诊接诊消息提醒");
                                systemMessageDO.setType("63");
                            } else if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {//专家咨询
                                //1.图文 2.视频 3家医
                                if ("1".equals(wlyyOutpatientDO.getType())) {
                                    systemMessageDO.setTitle("图文咨询接诊消息提醒");
                                    systemMessageDO.setType("68");
                                    title = "图文咨询消息提醒";
                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文咨询,请您及时点击回复";
                                } else if ("3".equals(wlyyOutpatientDO.getType())) {
                                    systemMessageDO.setTitle("家医咨询接诊消息提醒");
                                    systemMessageDO.setType("65");
                                } else {
                                    systemMessageDO.setTitle("视频咨询接诊消息提醒");
                                    systemMessageDO.setType("67");
                                    title = "视频咨询接诊消息提醒";
                                    date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频咨询,点击查看";
                                }
                            } else if ("1".equals(wlyyOutpatientDO.getOutpatientType())) {//在线复诊
                                //1.图文 2.视频
                                if ("1".equals(wlyyOutpatientDO.getType())) {
                                    systemMessageDO.setTitle("图文复诊接诊消息提醒");
                                    systemMessageDO.setType("61");
                                    title = "图文复诊接诊消息提醒";
                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)向您发起了图文复诊,请您及时点击接诊";
                                } else {
                                    systemMessageDO.setTitle("视频复诊接诊消息提醒");
                                    systemMessageDO.setType("62");
                                    title = "视频复诊接诊消息提醒";
                                    date = DateUtil.dateToStrLong(wlyyOutpatientDO.getRegisterDate());
                                    msg = wlyyOutpatientDO.getPatientName()+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                                }
                            }
                            net.sf.json.JSONObject data = new net.sf.json.JSONObject();
                            data.put("name", wlyyOutpatientDO.getPatientName());
                            data.put("age", IdCardUtil.getAgeForIdcard(wlyyOutpatientDO.getIdcard()));
                            data.put("gender", IdCardUtil.getSexForIdcard_new(wlyyOutpatientDO.getIdcard()));
                            data.put("question", wlyyOutpatientDO.getDescription());
                            data.put("msg", systemMessageDO.getTitle());
                            systemMessageDO.setData(data.toString());
                            systemMessageDO.setReceiver(wlyyOutpatientDO.getDoctor());
                            systemMessageDO.setReceiverName(wlyyOutpatientDO.getDoctorName());
                            systemMessageDO.setRelationCode(wlyyOutpatientDO.getId());
                            systemMessageDO.setSender(wlyyOutpatientDO.getPatient());
                            systemMessageDO.setSenderName(wlyyOutpatientDO.getPatientName());
                            systemMessageDO.setRelationCode(wlyyOutpatientDO.getId());
                            systemMessageDO.setIsRead("0");
                            systemMessageDO.setDel("1");
                            systemMessageDO.setCreateTime(new Date());
                            systemMessageDao.save(systemMessageDO);
                        }
                    }
                    businessOrderService.updatePayStatus(traceNo);
                    return "SUCCESS";
                }