Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
d88a735800

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

@ -71,23 +71,6 @@ public class PayInfoNoticeService {
        return null;
    }
    public String pushMessagePayBefore(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();
            String idcard = patientDO.getIdcard();
            String phone = patientDO.getMobile();
            if (!StringUtils.isNotBlank(url)){
                url = "https://hlwyy.xmzsh.com/hlwyy/ims-wx/#/nucleicTest/detail?id="+id;
            }
            String remark = "结算方式:微信结算 \r\n" +
                    "发票流水号:"+realOrder+"\r\n"+
                    "点击查看核酸预约开单信息";
            return paySuccessNotice(userName,idcard,phone,title,url,doctorName,total,"0",total,orderNo,remark);
        }
        return null;
    }
    /**
     * 支付成功提醒

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

@ -10457,9 +10457,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return null;
    }
    public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag) throws Exception {
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType) throws Exception {
        Map returnMap = new HashMap();
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            net.sf.json.JSONObject jsondate = new JSONObject();
            jsondate.put("checkPart","鼻/咽拭子");
@ -10515,6 +10514,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    baseNatAppointmentDO.setStreetName(streetName);
                    baseNatAppointmentDO.setPatientId(patientId);
                    baseNatAppointmentDO.setIsSuccess("0");
                    baseNatAppointmentDO.setCardNoType(cardNoType);
                    baseNatAppointmentDO.setPayStatus("0");
                    baseNatAppointmentDO.setCreateTime(new Date());
                    baseNatAppointmentDO.setMobile(mobile);
@ -10611,7 +10611,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                            baseNatAppointmentDO.setIsSuccess("1");
                            baseNatAppointmentDO.setVoucherNo(voucherNo);
                            baseNatAppointmentDO =baseNatAppointmentDao.save(baseNatAppointmentDO);
                            logger.info("模板消息推送标识pushFlag"+pushFlag);
                            /*logger.info("模板消息推送标识pushFlag"+pushFlag);
                            if (!StringUtils.isNoneBlank(pushFlag)){
                                String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
                                String applyDepaName = map.get("deptName").toString();
@ -10636,10 +10636,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                                ylzPayService.msgPush("01", mediaCard, "01", patientDO.getMobile(), "00", hisId, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1",pushChannel);
                            }else {
                  /*          String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
                            String title="您在厦门大学附属中山医院有一笔交易已支付完成!";
                            String pushPayLog = payInfoNoticeService.pushPrescriptionPayAndHsjc(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getDoctorName(),waitPayDetailVO.getVoucherNo(),natAppointmentDO.getId()+"",fee,title,null,waitPayDetailVO.getRecipeNo());
*/
                            }
                            }*/
                        /*//成功后发送模板消息
@ -10698,6 +10697,87 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return returnMap;
    }
    public String sendMessage(Integer id,String pushChannel,String pushFlag) throws Exception {
        BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(id);
        if (baseNatAppointmentDO==null){
            throw new Exception("预约记录不存在");
        }
        if (!StringUtils.isNoneBlank(baseNatAppointmentDO.getRealOrder())){
            throw new Exception("核酸项目不存在");
        }
        logger.info("模板消息推送标识pushFlag"+pushFlag);
        if (!StringUtils.isNoneBlank(pushFlag)){
            String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
            String applyDepaName = baseNatAppointmentDO.getDeptName();
            String applyDoctorName = baseNatAppointmentDO.getDoctorName();
            BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
            String userName = null;
            String idcard = null;
            if (patientDO != null) {
                userName = patientDO.getName();
                idcard = patientDO.getIdcard();
            }
            String hisId = patientMappingService.findHisPatNoByPatient(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getMedicare());
            logger.info("cardNo:" + baseNatAppointmentDO.getMedicare());
            JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag);
            net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
            logger.info("获取待结算数据 res: " + res.toString());
            String rsCode = res.getString("@RESULT");
            String free= 0+"";
            if ("0".equals(rsCode)) {
                free = res.getString("@total_charge");
            }
            ylzPayService.msgPush("01", baseNatAppointmentDO.getMedicare(), "01", patientDO.getMobile(), "00", hisId, userName, idcard, baseNatAppointmentDO.getVoucherNo(), applyDepaName, applyDoctorName, recipeTime, free, "1",pushChannel);
        }else {
            if (pushChannel.equalsIgnoreCase("WX_PUB")){
                String first="尊敬的用户"+baseNatAppointmentDO.getName()+",您已完成线上自助核酸检测预约申请";
                String responseMsg="";
                String url="";
                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                String contentMsg="申请人:"+baseNatAppointmentDO.getName()+"\r\n预约时间:"+date;
                String remark = "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\r\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\r\n" +
                        "3、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)) {
                    responseMsg = entranceService.ehospitalNotice(
                            baseNatAppointmentDO.getName(),
                            baseNatAppointmentDO.getCardNo(),
                            baseNatAppointmentDO.getMobile(),
                            first,
                            url,
                            contentMsg,
                            remark);
                    logger.info("中山发送模板消息返回结果="+responseMsg);
                    System.out.println("结束发送模板消息");
                }
            }else if (pushChannel.equalsIgnoreCase("ALI_PUB")){
                BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId());
                com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
                jsonObject.put("code","13");
                jsonObject.put("open_id",patientDO.getAlipayId());
                jsonObject.put("first","尊敬的用户"+baseNatAppointmentDO.getName()+",您已完成线上自助核酸检测预约申请");
                jsonObject.put("keyword1",DateUtil.getStringDate());
                String date = DateUtil.dateToStrLong(baseNatAppointmentDO.getAppointmentTime());
                jsonObject.put("keyword2","申请人:"+baseNatAppointmentDO.getName()+"\n预约时间:"+date);
                String remark =  "1、请于预约时间"+date+"前,携带医保卡/就诊卡/电子健康卡到院区自助机进行结算。\n" +
                        "2、结算完成后请您持核酸预约申请信息和发票流水号、医保卡/就诊卡/电子健康卡,准时至我院五号楼北侧(急诊部后侧)核酸检测点领取标本试管窗口绑定检测。\n" +
                        "3、核酸检测标本采集24小时后出具报告。请关注厦门大学附属中山医院微信公众号查询;如需打印,请至厦门大学附属中山医院核酸检测点自助机打印。";
                jsonObject.put("remark",remark);
                jsonObject.put("url","111111");
                String url = "https://xmzsyyfwc.xmpbinfo.cn/weixin/1/notification/push/nucleictest";
                logger.info("jsonObject"+jsonObject.toJSONString());
                String encdata = AES.encrypt("3bdc154ed1e44a9c9f44451a16d8e0aa",jsonObject.toJSONString());
                Map<String, String> params = new HashedMap();
                params.put("encdata",encdata);
                String reponse = httpClientUtil.httpPost(url,params);
                logger.info("支付宝模板消息"+reponse);
            }
         }
         return "发送成功!";
    }
    public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,Integer page ,Integer pageSize){
        try {
            savePayStatusByHis(patientId);
@ -10717,6 +10797,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.medicare as \"medicare\","+
                "t.voucher_no as \"voucherNo\","+
                "t.id as \"id\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNoneBlank(patientId)){

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -55,6 +55,8 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String voucherNo;
    private String registerNo;
    private String ampm;
    private String cardNoType;
    public String getMedicare() {
        return medicare;
@ -408,4 +410,12 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    public void setAmpm(String ampm) {
        this.ampm = ampm;
    }
    public String getCardNoType() {
        return cardNoType;
    }
    public void setCardNoType(String cardNoType) {
        this.cardNoType = cardNoType;
    }
}

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

@ -2588,15 +2588,32 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "pushChannel", value = "pushChannel")
                                          @RequestParam(value = "pushChannel",required = false)String pushChannel,
                                      @ApiParam(name = "pushFlag", value = "pushFlag")
                                          @RequestParam(value = "pushFlag",required = false)String pushFlag){
                                          @RequestParam(value = "pushFlag",required = false)String pushFlag,
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType){
        try {
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag));
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/sendMessage")
    @ApiOperation(value = "预约成功发送模板消息")
    public Envelop sendMessage( @ApiParam(name = "pushChannel", value = "pushChannel")
                                          @RequestParam(value = "pushChannel",required = false)String pushChannel,
                                      @ApiParam(name = "pushFlag", value = "pushFlag")
                                          @RequestParam(value = "pushFlag",required = false)String pushFlag,
                                      @ApiParam(name = "id", value = "id")
                                          @RequestParam(value = "id",required = false)Integer id) throws Exception {
        try {
            return success(prescriptionService.sendMessage(id,pushChannel,pushFlag));
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
        }
    }
    @GetMapping("/sendAlipayMessage")
    public Envelop sendAlipayMessage(@ApiParam(name = "code", value = "code")
                           @RequestParam(value = "code",required = false)String code,