Pārlūkot izejas kodu

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

# Conflicts:
#	common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
wangzhinan 2 gadi atpakaļ
vecāks
revīzija
6795ec4562

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

@ -333,6 +333,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private PrescriptionLogDao prescriptionLogDao;
    @Autowired
    private HcyyEntranceService hcyyEntranceService;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
@ -1410,6 +1412,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return systemMessageDO;
    }
    public JSONArray findPatientCardList(String patientId) throws Exception {
        patientMedicareCardDao.deleteByPatientId(patientId);
        net.sf.json.JSONArray array =findPatientCard(patientId);
        for (int i=0;i<array.size();i++){
            net.sf.json.JSONObject object = array.getJSONObject(i);
            String cardType = object.getString("CARD_TYPE");
            String cardNo = object.getString("CARD_NO");
            String cardTypeName = object.getString("CARD_TYPE_NAME");
            PatientMedicareCardDO patientMedicareCardDO = new PatientMedicareCardDO();
            patientMedicareCardDO.setCode(cardNo);
            patientMedicareCardDO.setParentType("A");
            if (cardType.equalsIgnoreCase("2")){
                patientMedicareCardDO.setType("A_01");
            }else {
                patientMedicareCardDO.setType("A_03");
            }
            patientMedicareCardDO.setPatientCode(patientId);
            patientMedicareCardDO.setOrgCode("350211A1002");
            patientMedicareCardDO.setCityCode("350200");
            patientMedicareCardDO.setDel("1");
            patientMedicareCardDO.setRemark(cardTypeName);
            patientMedicareCardDao.save(patientMedicareCardDO);
        }
        return array;
    }
    /**
     * 获取卡记录
     *
@ -4966,11 +4995,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        try {
            if (wxId.equalsIgnoreCase("xm_ykyy_wx")) {
                businessOrderService.orderRefund(wxId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                //眼科接诊时更新眼科通状态
                if (!flag){
                    if (businessOrderDO!=null){
                        ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                if (businessOrderDO.getStatus()==1){
                    businessOrderService.orderRefund(wxId, wlyyOutpatientDO.getConsumer(), businessOrderDO.getOrderNo(), businessOrderDO.getPayPrice(), description);
                    //眼科接诊时更新眼科通状态
                    if (!flag){
                        if (businessOrderDO!=null){
                            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),"2");
                        }
                    }
                }
            } else if (wxId.equalsIgnoreCase("xm_zsyy_wx")) {
@ -4978,7 +5009,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                WlyyHospitalSysDictDO hospitalSysDictDO =  hospitalSysDictDao.findById("isCloseRefund");
                if (hospitalSysDictDO!=null&&hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                    try {
                        entranceService.hisRefund(outPatientId);
                        if (businessOrderDO.getStatus()==1){
                            entranceService.hisRefund(outPatientId);
                        }
                    }catch (Exception e){
                        e.printStackTrace();
                    }
@ -5114,26 +5147,48 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("patientCancel".equalsIgnoreCase(titelType)) {
            WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("isCloseRefund");
            if (hospitalSysDictDO!=null){
                if (hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                    if ("9".equals(type)) {
                        contentMsg = "您发起的图文复诊已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                        first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已被您取消,您可重新发起";
                    }
                    if ("16".equals(type)) {
                        contentMsg =  "您发起的视频复诊已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                        first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已被您取消,您可重新发起";
                    }
                    if ("1".equals(type)) {
                        contentMsg =  "您发起的图文咨询已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                        first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已被您取消,您可重新发起";
                    }
                    if ("17".equals(type)) {
                        contentMsg = "您发起的视频咨询已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                        first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起";
                    }
                    if ("12".equals(type)) {
                        return;
            if (outpatientDO.getPayStatus()==1){
                if (hospitalSysDictDO!=null){
                    if (hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                        if ("9".equals(type)) {
                            contentMsg = "您发起的图文复诊已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已被您取消,您可重新发起";
                        }
                        if ("16".equals(type)) {
                            contentMsg =  "您发起的视频复诊已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已被您取消,您可重新发起";
                        }
                        if ("1".equals(type)) {
                            contentMsg =  "您发起的图文咨询已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已被您取消,您可重新发起";
                        }
                        if ("17".equals(type)) {
                            contentMsg = "您发起的视频咨询已被您取消。已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起";
                        }
                        if ("12".equals(type)) {
                            return;
                        }
                    }else {
                        if ("9".equals(type)) {
                            contentMsg = "您发起的图文复诊已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已被您取消,您可重新发起";
                        }
                        if ("16".equals(type)) {
                            contentMsg =  "您发起的视频复诊已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已被您取消,您可重新发起";
                        }
                        if ("1".equals(type)) {
                            contentMsg =  "您发起的图文咨询已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已被您取消,您可重新发起";
                        }
                        if ("17".equals(type)) {
                            contentMsg = "您发起的视频咨询已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起";
                        }
                        if ("12".equals(type)) {
                            return;
                        }
                    }
                }else {
                    if ("9".equals(type)) {
@ -5158,19 +5213,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }else {
                if ("9".equals(type)) {
                    contentMsg = "您发起的图文复诊已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    contentMsg = "您发起的图文复诊已被您取消。如有问诊需求,可重新发起或到医院门急诊就诊。";
                    first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已被您取消,您可重新发起";
                }
                if ("16".equals(type)) {
                    contentMsg =  "您发起的视频复诊已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    contentMsg =  "您发起的视频复诊已被您取消。如有问诊需求,可重新发起或到医院门急诊就诊。";
                    first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已被您取消,您可重新发起";
                }
                if ("1".equals(type)) {
                    contentMsg =  "您发起的图文咨询已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    contentMsg =  "您发起的图文咨询已被您取消。如有问诊需求,可重新发起或到医院门急诊就诊。";
                    first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已被您取消,您可重新发起";
                }
                if ("17".equals(type)) {
                    contentMsg = "您发起的视频咨询已被您取消。请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    contentMsg = "您发起的视频咨询已被您取消。如有问诊需求,可重新发起或到医院门急诊就诊。";
                    first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起";
                }
                if ("12".equals(type)) {
@ -5183,15 +5238,26 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else if("systemCancelRemind".equalsIgnoreCase(titelType)){
            //超过24小时未接诊,系统取消
            WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("isCloseRefund");
            if (hospitalSysDictDO!=null){
                if (hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                    if ("9".equals(type)) {
                        contentMsg = "您发起的图文复诊已取消,已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                        first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超过24小时未接诊已自动取消图文咨询。";
                    }
                    if ("16".equals(type)) {
                        contentMsg = "您发起的视频复诊已取消,已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                        first = outpatientDO.getConsumerName() + ",您好!您的视频复诊因超过24小时未接诊已自动取消视频咨询。";
            if (outpatientDO.getPayStatus()==1){
                if (hospitalSysDictDO!=null){
                    if (hospitalSysDictDO.getDictValue().equalsIgnoreCase("1")){
                        if ("9".equals(type)) {
                            contentMsg = "您发起的图文复诊已取消,已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超过24小时未接诊已自动取消图文咨询。";
                        }
                        if ("16".equals(type)) {
                            contentMsg = "您发起的视频复诊已取消,已支付的18元将原路退回,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的视频复诊因超过24小时未接诊已自动取消视频咨询。";
                        }
                    }else {
                        if ("9".equals(type)) {
                            contentMsg = "您发起的图文复诊已取消,请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超过24小时未接诊已自动取消图文咨询。";
                        }
                        if ("16".equals(type)) {
                            contentMsg = "您发起的视频复诊已取消,请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                            first = outpatientDO.getConsumerName() + ",您好!您的视频复诊因超过24小时未接诊已自动取消视频咨询。";
                        }
                    }
                }else {
                    if ("9".equals(type)) {
@ -5205,15 +5271,16 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                }
            }else {
                if ("9".equals(type)) {
                    contentMsg = "您发起的图文复诊已取消,请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    contentMsg = "您发起的图文复诊已取消,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超过24小时未接诊已自动取消图文咨询。";
                }
                if ("16".equals(type)) {
                    contentMsg = "您发起的视频复诊已取消,请前往收费窗口进行退款,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    contentMsg = "您发起的视频复诊已取消,如有问诊需求,可重新发起或到医院门急诊就诊。";
                    first = outpatientDO.getConsumerName() + ",您好!您的视频复诊因超过24小时未接诊已自动取消视频咨询。";
                }
            }
            logger.info("系统取消接诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if ("payRemind".equalsIgnoreCase(titelType)) {
@ -12607,10 +12674,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                String mobile1 = patientDO.getMobile();
                                String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id=" + baseNatAppointmentDO.getId();
                                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                                WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                                String addres = "我院五号楼北侧(急诊部后侧)";
                                String timeDes = "6-8小时";
                                if (hospitalSysDictDO1!=null){
                                    com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
                                    for (int i=0;i<array1.size();i++){
                                        com.alibaba.fastjson.JSONObject object1 = array1.getJSONObject(i);
                                        String chargeCode1 = object1.getString("chargeCode");
                                        if (chargeCode.equalsIgnoreCase(chargeCode1)){
                                            addres = "我院发热门诊";
                                            timeDes = "2小时";
                                        }
                                    }
                                }
                                String first = "尊敬的用户" + baseNatAppointmentDO.getName() + ",您已完成线上自助核酸检测预约申请";
                                String contentMsg = "申请人:" + baseNatAppointmentDO.getName() + "\r\n 预约时间:" + date + " \r\n发票流水号:" + baseNatAppointmentDO.getRealOrder();
                                String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                        "2、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                        "2、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                String responseMsg = "";
                                responseMsg = entranceService.ehospitalNotice(
                                        name1,
@ -13035,10 +13116,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                String responseMsg="";
                String url="";
                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                String addres = "我院五号楼北侧(急诊部后侧)";
                String timeDes = "6-8小时";
                if (hospitalSysDictDO1!=null){
                    com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
                    for (int i=0;i<array1.size();i++){
                        com.alibaba.fastjson.JSONObject object1 = array1.getJSONObject(i);
                        String chargeCode1 = object1.getString("chargeCode");
                        if (baseNatAppointmentDO.getChargeCode().equalsIgnoreCase(chargeCode1)){
                            addres = "我院发热门诊";
                            timeDes = "2小时";
                        }
                    }
                }
                String contentMsg="申请人:"+baseNatAppointmentDO.getName()+"\r\n预约时间:"+date;
                String remark = "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\r\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
                        "3、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\r\n" +
                        "3、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
                    responseMsg = entranceService.ehospitalNotice(
                            baseNatAppointmentDO.getName(),
@ -13060,9 +13155,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                jsonObject.put("keyword1",DateUtil.getStringDate());
                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                jsonObject.put("keyword2","申请人:"+baseNatAppointmentDO.getName()+"\n预约时间:"+date);
                WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                String addres = "我院五号楼北侧(急诊部后侧)";
                String timeDes = "6-8小时";
                if (hospitalSysDictDO1!=null){
                    com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
                    for (int i=0;i<array1.size();i++){
                        com.alibaba.fastjson.JSONObject object1 = array1.getJSONObject(i);
                        String chargeCode1 = object1.getString("chargeCode");
                        if (baseNatAppointmentDO.getChargeCode().equalsIgnoreCase(chargeCode1)){
                            addres = "我院发热门诊";
                            timeDes = "2小时";
                        }
                    }
                }
                String remark =  "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" +
                        "3、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\n" +
                        "3、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                jsonObject.put("remark",remark);
                jsonObject.put("url","111111");
                String url = "https://xmzsyyfwc.xmpbinfo.cn/weixin/1/notification/push/nucleictest";
@ -13187,6 +13296,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.town_name as \"townName\"," +
                "t.street_name as \"streetName\"," +
                "t.address as \"address\"," +
                "t.charge_code as \"chargeCode\"," +
                "t.HOSPITAL_FLAG as \"hospitalFlag\"," +
                "t.charge_amount as \"chargeAmount\"," ;
        if ("xm_tasy_wx".equalsIgnoreCase(wechatId)){
@ -13461,7 +13571,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    public String sendAlipayMessage(String patientId,String code,String fee,String redirdctUrl,String reserverTime,String realorder) throws Exception {
    public String sendAlipayMessage(String patientId,String code,String fee,String redirdctUrl,String reserverTime,String realorder,Integer id) throws Exception {
        com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
      /*  ⽀付提醒通知:
        code: 通知代码,⽀付提醒为“2” open_id:⽀付宝⽤户ID user_name: 姓名 order_id: 订单号
@ -13496,8 +13606,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            jsonObject.put("keyword2","申请人:"+patientDO.getName()+"\n" +
                    "预约时间:"+reserverTime+"\n" +
                    "发票流水号:"+realorder+"");
            String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" +
                    "2、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
            BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
            WlyyHospitalSysDictDO hospitalSysDictDO1 = wlyyHospitalSysDictDao.findById("natConfigTestNew");
            String addres = "我院五号楼北侧(急诊部后侧)";
            String timeDes = "6-8小时";
            if (hospitalSysDictDO1!=null){
                com.alibaba.fastjson.JSONArray array1 = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO1.getDictValue());
                for (int i=0;i<array1.size();i++){
                    com.alibaba.fastjson.JSONObject object1 = array1.getJSONObject(i);
                    String chargeCode1 = object1.getString("chargeCode");
                    if (baseNatAppointmentDO.getChargeCode().equalsIgnoreCase(chargeCode1)){
                        addres = "我院发热门诊";
                        timeDes = "2小时";
                    }
                }
            }
            String remark = "1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\n" +
                    "2、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
            jsonObject.put("remark",remark);
            jsonObject.put("url",redirdctUrl);
        }

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/order/pay/ylz/YlzPayService.java

@ -533,7 +533,7 @@ public class YlzPayService {
            e.printStackTrace(pw);
            error = sw.toString();
        }
        logService.saveHttpLog(isSuccess, "hop.trade.refund", "互联网预交金退款", "POST", null,null, jsonObject, error, logService.shoppatType);
        logService.saveHttpLog(isSuccess, "hop.trade.refund", "互联网预交金退款", "POST", null,param.toString(), jsonObject, error, logService.shoppatType);
        return jsonObject;
    }
@ -543,7 +543,7 @@ public class YlzPayService {
     *
     * @param operatorId
     * @param operatorName
     * @param termNo
     * @param termNotermNo
     * @param tradeType
     * @param outTradeNo
     * @param traceNo

+ 5 - 0
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientMedicareCardDao.java

@ -2,6 +2,7 @@ package com.yihu.jw.patient.dao;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
@ -15,6 +16,10 @@ public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<P
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
    @Modifying
    @Query("delete PatientMedicareCardDO a where a.patientCode=?1")
    int deleteByPatientId(String patientCode);
    @Query("select id from PatientMedicareCardDO where patientCode = ?1")
    Set<Object> findIdListByPatientCode(String patientCode);

+ 27 - 40
business/base-service/src/main/java/com/yihu/jw/wlyy/service/WlyyBusinessService.java

@ -291,6 +291,7 @@ public class WlyyBusinessService {
            params.put("idcard",idcard);
            String patientCardNo = null;
            patientMedicareCardDao.deleteByPatientId(patientId);
            if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
                net.sf.json.JSONArray array =prescriptionService.findPatientCard(patientId);
                for (int i=0;i<array.size();i++){
@ -298,28 +299,21 @@ public class WlyyBusinessService {
                    String cardType = object.getString("CARD_TYPE");
                    String cardNo = object.getString("CARD_NO");
                    String cardTypeName = object.getString("CARD_TYPE_NAME");
                    PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByCodeAndPatientCode(cardNo,patientId);
                    if (patientMedicareCardDO==null){
                        patientMedicareCardDO = new PatientMedicareCardDO();
                        patientMedicareCardDO.setCode(cardNo);
                        patientMedicareCardDO.setParentType("A");
                        if (cardType.equalsIgnoreCase("2")){
                            patientMedicareCardDO.setType("A_01");
                            patientCardNo = cardNo;
                        }else {
                            patientMedicareCardDO.setType("A_03");
                        }
                        patientMedicareCardDO.setPatientCode(patientId);
                        patientMedicareCardDO.setOrgCode("350211A1002");
                        patientMedicareCardDO.setCityCode("350200");
                        patientMedicareCardDO.setDel("1");
                        patientMedicareCardDO.setRemark(cardTypeName);
                        patientMedicareCardDao.save(patientMedicareCardDO);
                    PatientMedicareCardDO patientMedicareCardDO = new PatientMedicareCardDO();
                    patientMedicareCardDO.setCode(cardNo);
                    patientMedicareCardDO.setParentType("A");
                    if (cardType.equalsIgnoreCase("2")){
                        patientMedicareCardDO.setType("A_01");
                        patientCardNo = cardNo;
                    }else {
                        if (patientMedicareCardDO.getType().equalsIgnoreCase("A_01")){
                            patientCardNo = patientMedicareCardDO.getCode();
                        }
                        patientMedicareCardDO.setType("A_03");
                    }
                    patientMedicareCardDO.setPatientCode(patientId);
                    patientMedicareCardDO.setOrgCode("350211A1002");
                    patientMedicareCardDO.setCityCode("350200");
                    patientMedicareCardDO.setDel("1");
                    patientMedicareCardDO.setRemark(cardTypeName);
                    patientMedicareCardDao.save(patientMedicareCardDO);
                }
            }else if (wxId.equalsIgnoreCase("xm_xzzx_wx")){
                JSONArray array = xzzxEntranceService.selectPateintCard(patientId);
@ -328,28 +322,21 @@ public class WlyyBusinessService {
                    String cardType = jsonObject.getString("CARD_TYPE");
                    String cardNo = jsonObject.getString("CARD_NO");
                    String cardTypeName = jsonObject.getString("CARD_TYPE_HIS");
                    PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByCodeAndPatientCode(cardNo,patientId);
                    if (patientMedicareCardDO==null){
                        patientMedicareCardDO = new PatientMedicareCardDO();
                        patientMedicareCardDO.setCode(cardNo);
                        patientMedicareCardDO.setParentType("A");
                        if (cardType.equalsIgnoreCase("01")){
                            patientMedicareCardDO.setType("A_01");
                            patientCardNo = cardNo;
                        }else {
                            patientMedicareCardDO.setType("A_03");
                        }
                        patientMedicareCardDO.setPatientCode(patientId);
                        patientMedicareCardDO.setOrgCode("350211A1002");
                        patientMedicareCardDO.setCityCode("350200");
                        patientMedicareCardDO.setDel("1");
                        patientMedicareCardDO.setRemark(cardTypeName);
                        patientMedicareCardDao.save(patientMedicareCardDO);
                    PatientMedicareCardDO patientMedicareCardDO = new PatientMedicareCardDO();
                    patientMedicareCardDO.setCode(cardNo);
                    patientMedicareCardDO.setParentType("A");
                    if (cardType.equalsIgnoreCase("01")){
                        patientMedicareCardDO.setType("A_01");
                        patientCardNo = cardNo;
                    }else {
                        if (patientMedicareCardDO.getType().equalsIgnoreCase("A_01")){
                            patientCardNo = patientMedicareCardDO.getCode();
                        }
                        patientMedicareCardDO.setType("A_03");
                    }
                    patientMedicareCardDO.setPatientCode(patientId);
                    patientMedicareCardDO.setOrgCode("350211A1002");
                    patientMedicareCardDO.setCityCode("350200");
                    patientMedicareCardDO.setDel("1");
                    patientMedicareCardDO.setRemark(cardTypeName);
                    patientMedicareCardDao.save(patientMedicareCardDO);
                }
            }else {
                PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patientId,"1");

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

@ -1282,10 +1282,24 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                            String mobile = patientDO.getMobile();
                                            String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id="+natAppointmentDO.getId();
                                            String date = DateUtil.dateToStrLong(natAppointmentDO.getAppointmentTime());
                                            WlyyHospitalSysDictDO hospitalSysDictDO = wlyyHospitalSysDictDao.findById("natConfigTestNew");
                                            String addres = "我院五号楼北侧(急诊部后侧)";
                                            String timeDes = "6-8小时";
                                            if (hospitalSysDictDO!=null){
                                                com.alibaba.fastjson.JSONArray array = com.alibaba.fastjson.JSONArray.parseArray(hospitalSysDictDO.getDictValue());
                                                for (int i=0;i<array.size();i++){
                                                    JSONObject object1 = array.getJSONObject(i);
                                                    String chargeCode = object1.getString("chargeCode");
                                                    if (natAppointmentDO.getChargeCode().equalsIgnoreCase(chargeCode)){
                                                        addres = "我院发热门诊";
                                                        timeDes = "2小时";
                                                    }
                                                }
                                            }
                                            String first = "尊敬的用户"+natAppointmentDO.getName()+",您已完成线上自助核酸检测预约申请";
                                            String contentMsg = "申请人:"+natAppointmentDO.getName()+"\r\n 预约时间:"+date+" \r\n发票流水号:"+waitPayDetailVO.getRecipeNo();
                                            String remark="1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                                    "2、核酸检测标本采集6-8小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                            String remark="1、请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至"+addres+"核酸检测点领取标本试管窗口绑定检测。\r\n" +
                                                    "2、核酸检测标本采集"+timeDes+"后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                                            String responseMsg="";
                                            if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
@ -1313,10 +1327,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                                logger.info("支付宝发送模板消息开始111");
                                                String url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id="+natAppointmentDO.getId();
                                                String date = DateUtil.dateToStrLong(natAppointmentDO.getAppointmentTime());
                                                prescriptionService.sendAlipayMessage(natAppointmentDO.getPatientId(),"3",waitPayDetailVO.getFee(),url,date,waitPayDetailVO.getRecipeNo());
                                                prescriptionService.sendAlipayMessage(natAppointmentDO.getPatientId(),"3",waitPayDetailVO.getFee(),url,date,waitPayDetailVO.getRecipeNo(),natAppointmentDO.getId());
                                                logger.info("支付宝发送模板消息结束1111");
                                                logger.info("支付宝发送模板消息结束22222");
                                                prescriptionService.sendAlipayMessage(natAppointmentDO.getPatientId(),"13",waitPayDetailVO.getFee(),url,date,waitPayDetailVO.getRecipeNo());
                                                prescriptionService.sendAlipayMessage(natAppointmentDO.getPatientId(),"13",waitPayDetailVO.getFee(),url,date,waitPayDetailVO.getRecipeNo(),natAppointmentDO.getId());
                                                logger.info("支付宝发送模板消息结束2222222");
                                            }
                                        }

+ 5 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -423,7 +423,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
        try {
            if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
                return success(prescriptionService.findPatientCard(patient));
                return success(prescriptionService.findPatientCardList(patient));
            } else if ("xm_hcyy_wx".equalsIgnoreCase(wxId)) {
                String result = hcyyEntranceService.findPatientCard(patient);
                JSONArray jsonArray = new JSONArray();
@ -3474,9 +3474,11 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                     @ApiParam(name = "realorder", value = "realorder")
                                     @RequestParam(value = "realorder", required = false) String realorder,
                                     @ApiParam(name = "reserverTime", value = "reserverTime")
                                     @RequestParam(value = "reserverTime", required = false) String reserverTime) throws Exception {
                                     @RequestParam(value = "reserverTime", required = false) String reserverTime,
                                     @ApiParam(name = "id", value = "id")
                                         @RequestParam(value = "id", required = false) Integer id) throws Exception {
        try {
            return success(prescriptionService.sendAlipayMessage(patientId, code, fee, redirdctUrl, reserverTime, realorder));
            return success(prescriptionService.sendAlipayMessage(patientId, code, fee, redirdctUrl, reserverTime, realorder,id));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }