Browse Source

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan 4 years ago
parent
commit
45bcd476d9

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

@ -53,7 +53,7 @@ public class PayInfoNoticeService {
        return null;
    }
    public String pushPrescriptionPayAndHsjc(String patient,String doctorName,String orderNo,String id,String total,String title,String url){
    public String pushPrescriptionPayAndHsjc(String patient,String doctorName,String orderNo,String id,String total,String title,String url,String realOrder){
        BasePatientDO patientDO = patientDao.findById(patient);
        if (patientDO!=null){
            String userName = patientDO.getName();
@ -62,7 +62,8 @@ public class PayInfoNoticeService {
            if (!StringUtils.isNotBlank(url)){
                url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id="+id;
            }
            String remark = "结算方式:微信结算" +
            String remark = "结算方式:微信结算 \r\n" +
                    "发票流水号:"+realOrder+"\r\n"+
                    "点击查看核酸预约开单信息";
            return paySuccessNotice(userName,idcard,phone,title,url,doctorName,total,"0",total,orderNo,remark);

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

@ -10465,7 +10465,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        baseNatAppointmentDO.setCardNo(cardNo);
        baseNatAppointmentDO.setCardType(cardType);
        baseNatAppointmentDO.setAddress(address);
        baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDate(natTime,"yyyy-MM-dd hh:mm:ss"));
        baseNatAppointmentDO.setAppointmentTime(DateUtil.strToDateLong(natTime));
        baseNatAppointmentDO.setCityName(cityName);
        baseNatAppointmentDO.setFirstJobCode(firstJobCode);
        baseNatAppointmentDO.setFirstJobName(firstJobName);
@ -10525,118 +10525,60 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            }
            if (flag){
                try {
                    logger.info("挂号开始");
                    String date = DateUtil.dateToStr(new Date(), "yyyy-MM-dd");
                    List<WlyyPatientRegisterDO> patientRegisterDOs = patientRegisterDao.findByPatientAndDateAndDoctorAndDel(patientId, date,map.get("doctorCode").toString() ,1);
                    if (patientRegisterDOs != null && patientRegisterDOs.size() > 0) {
                        WlyyPatientRegisterDO registerDO = patientRegisterDOs.get(0);
                        //判断是否已经挂号,如果已经挂号
                        if (StringUtils.isNotBlank(registerDO.getConNo()) && StringUtils.isNotBlank(registerDO.getRegisterNo())) {
                            net.sf.json.JSONObject res = new JSONObject();
                            res.put("@RESULT", "0");
                            logger.info("已经挂号 res: " + res.toString());
                            jsondate.put("serialNo",registerDO.getRegisterNo());
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setRegisterNo(registerDO.getRegisterNo());
                            baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                        }else {
                            returnMap.put("msg","已经挂号的数据有误");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                    rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
                    net.sf.json.JSONObject res = rs.getJSONObject("resquest");
                    logger.info("挂号结果 res: " + res.toString());
                    String rsCode = res.getString("@RESULT");
                    if ("0".equals(rsCode)) {
                        //存储挂号号
                        // {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
                        String serialNo = (String) res.get("@serial_no");
                        String conNo = (String) res.get("@times");
                        String xtgzh = (String) res.get("@xtgzh");
                        String realOrder = (String) res.get("@real_order");
                        logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                        jsondate.put("serialNo",serialNo);
                        jsondate.put("dept",map.get("deptCode").toString());
                        jsondate.put("doctor",map.get("doctorMappingCode").toString());
                        baseNatAppointmentDO.setRegisterNo(serialNo);
                        //保存日志
                        WlyyHttpLogDO log = new WlyyHttpLogDO();
                        log.setCode("registerOutPatient");
                        log.setName("挂号");
                        log.setPatient(patientId);
                        log.setDoctor(map.get("doctorCode").toString());
                        log.setResponse(rs.toString());
                        log.setStatus(rsCode);
                        log.setCreateTime(new Date());
                        wlyyHttpLogDao.save(log);
                    } else if ("-2".equals(rsCode)) {
                        String serialNo = (String) res.get("@serial_no");
                        String xtgzh = (String) res.get("@xtgzh");
                        String realOrder = (String) res.get("@real_order");
                        String conNo = (String) res.get("@times");
                        jsondate.put("serialNo",serialNo);
                        jsondate.put("dept",map.get("deptCode").toString());
                        jsondate.put("doctor",map.get("doctorMappingCode").toString());
                        logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                        //保存日志
                        WlyyHttpLogDO log = new WlyyHttpLogDO();
                        log.setCode("registerOutPatient");
                        log.setName("挂号");
                        log.setPatient(patientId);
                        log.setDoctor(map.get("doctorCode").toString());
                        log.setResponse(rs.toString());
                        log.setStatus(rsCode);
                        log.setCreateTime(new Date());
                        wlyyHttpLogDao.save(log);
                    }else {
                        rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag);
                        net.sf.json.JSONObject res = rs.getJSONObject("resquest");
                        logger.info("挂号结果 res: " + res.toString());
                        String rsCode = res.getString("@RESULT");
                        if ("0".equals(rsCode)) {
                            //存储挂号号
                            // {"resquest":{"@RESULT":"0","@MSG":"完成","@serial_no":"47770476","@times":"28"}}
                            String serialNo = (String) res.get("@serial_no");
                            String conNo = (String) res.get("@times");
                            String xtgzh = (String) res.get("@xtgzh");
                            String realOrder = (String) res.get("@real_order");
                            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                            jsondate.put("serialNo",serialNo);
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            baseNatAppointmentDO.setRegisterNo(serialNo);
                            //存储就诊记录
                            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
                            // 存储挂号医生与挂号科室
                            registerDO.setDoctor(map.get("doctorCode").toString());
                            registerDO.setDoctorName(map.get("doctorName").toString());
                            registerDO.setDept(map.get("deptCode").toString());
                            registerDO.setDeptName(map.get("deptName").toString());
                            registerDO.setRealOrder(realOrder);
                            registerDO.setXtgzh(xtgzh);
                            registerDO.setPatient(patientId);
                            registerDO.setPatientName(name);
                            //挂号流水号与挂号次数
                            registerDO.setRegisterNo(serialNo);
                            registerDO.setConNo(conNo);
                            registerDO.setCreateTime(new Date());
                            registerDO.setDel(1);
                            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
                            patientRegisterDao.save(registerDO);
                            //保存日志
                            WlyyHttpLogDO log = new WlyyHttpLogDO();
                            log.setCode("registerOutPatient");
                            log.setName("挂号");
                            log.setPatient(patientId);
                            log.setDoctor(map.get("doctorCode").toString());
                            log.setResponse(rs.toString());
                            log.setStatus(rsCode);
                            log.setCreateTime(new Date());
                            wlyyHttpLogDao.save(log);
                        } else if ("-2".equals(rsCode)) {
                            String serialNo = (String) res.get("@serial_no");
                            String xtgzh = (String) res.get("@xtgzh");
                            String realOrder = (String) res.get("@real_order");
                            String conNo = (String) res.get("@times");
                            jsondate.put("serialNo",serialNo);
                            jsondate.put("dept",map.get("deptCode").toString());
                            jsondate.put("doctor",map.get("doctorMappingCode").toString());
                            logger.info("挂号流水 @serial_no: " + serialNo + " @times: " + conNo);
                            //存储就诊记录
                            WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
                            registerDO.setDoctor(map.get("doctorCode").toString());
                            registerDO.setDoctorName(map.get("doctorName").toString());
                            registerDO.setDept(map.get("deptCode").toString());
                            registerDO.setDeptName(map.get("deptName").toString());
                            registerDO.setRealOrder(realOrder);
                            registerDO.setXtgzh(xtgzh);
                            registerDO.setPatient(patientId);
                            registerDO.setPatientName(name);
                            registerDO.setRegisterNo(serialNo);
                            registerDO.setConNo(conNo);
                            registerDO.setCreateTime(new Date());
                            registerDO.setDate(DateUtil.dateToStr(new Date(), "yyyy-MM-dd"));
                            patientRegisterDao.save(registerDO);
                            //保存日志
                            WlyyHttpLogDO log = new WlyyHttpLogDO();
                            log.setCode("registerOutPatient");
                            log.setName("挂号");
                            log.setPatient(patientId);
                            log.setDoctor(map.get("doctorCode").toString());
                            log.setResponse(rs.toString());
                            log.setStatus(rsCode);
                            log.setCreateTime(new Date());
                            wlyyHttpLogDao.save(log);
                        }else {
                            returnMap.put("msg","请求挂号失败");
                            returnMap.put("status","-1");
                            returnMap.put("id",baseNatAppointmentDO.getId());
                            return returnMap;
                        }
                        baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                        baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                        returnMap.put("msg","请求挂号失败");
                        returnMap.put("status","-1");
                        returnMap.put("id",baseNatAppointmentDO.getId());
                        return returnMap;
                    }
                    baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
                    baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
                } catch (Exception e) {
                    e.printStackTrace();
@ -10805,7 +10747,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            try {
                BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
                if (null!=baseNatAppointmentDO){
                    res = entranceService.BS10145("3150000","0001",DateUtil.dateToStr(baseNatAppointmentDO.getAppointmentTime(),"yyyy-MM-dd hh:mm:ss"),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                    res = entranceService.BS10145("3150000","0001",DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime()),baseNatAppointmentDO.getMedicare(),baseNatAppointmentDO.getName(),baseNatAppointmentDO.getCardNo(),baseNatAppointmentDO.getMobile(),baseNatAppointmentDO.getAmpm(),demoFlag);
                    logger.info("核酸检测预约取消"+res);
                    com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(res);
                    Boolean flag = false;

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

@ -952,7 +952,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                    String fee = waitPayDetailVO.getFee();
                                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                                        String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
                                        pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(natAppointmentDO.getPatientId(),natAppointmentDO.getDoctorName(),voucherNo,natAppointmentDO.getId()+"",fee,title,null);
                                        pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(natAppointmentDO.getPatientId(),natAppointmentDO.getDoctorName(),voucherNo,natAppointmentDO.getId()+"",fee,title,null,waitPayDetailVO.getRecipeNo());
                                    }
                                    //发送预约成功通知
                                    String name= natAppointmentDO.getName();
@ -961,8 +961,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                    String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id="+natAppointmentDO.getId();
                                    String date = DateUtil.dateToStrLong(natAppointmentDO.getAppointmentTime());
                                    String first = "尊敬的用户"+name+",您已完成线上自助核酸检测开单预约";
                                    String contentMsg = "申请人:"+name+";预约时间:"+date+";发票流水号:"+waitPayDetailVO.getRecipeNo();
                                    String remark="备注:1、请您持核酸开单预约信息和发票流水号、医保卡/就诊卡/电子健康卡,提前15分钟至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" +
                                    String contentMsg = "申请人:"+name+"\r\n 预约时间:"+date+" \r\n发票流水号:"+waitPayDetailVO.getRecipeNo();
                                    String remark="备注:1、请您持核酸开单预约信息和发票流水号、医保卡/就诊卡/电子健康卡,提前5分钟至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                            "2、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                    String responseMsg="";
                                    if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {