Pu Zhibing
5 天以前 3244b550596e0330031b3f4547356927df83b0ad
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/MsgUtil.java
@@ -49,6 +49,40 @@
        return encode;
    }
    /**
     * 更换手机号:【签名】验证码:XXX,用于更换手机号。请勿转发。
     * @param phone 手机号
     * @param code 验证码
     * @return
     */
    public static String applyCodeMsg(String phone,String code){
        SubmitTempletReq submitReq = new SubmitTempletReq();
        String[] paramss = {code};
        submitReq.setApId(MsgConstants.APPLY_AP_ID);
        submitReq.setEcName(ecName);
        submitReq.setSecretKey(secretKey);
        submitReq.setParams(JSON.toJSONString(paramss));
        submitReq.setMobiles(phone);
        submitReq.setAddSerial("");
        submitReq.setSign(sign);
        submitReq.setTemplateId(MsgConstants.APPLY_TEMPLATE_ID);
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(submitReq.getEcName());
        stringBuffer.append(submitReq.getApId());
        stringBuffer.append(submitReq.getSecretKey());
        stringBuffer.append(submitReq.getTemplateId());
        stringBuffer.append(submitReq.getMobiles());
        stringBuffer.append(submitReq.getParams());
        stringBuffer.append(submitReq.getSign());
        stringBuffer.append(submitReq.getAddSerial());
        submitReq.setMac(MD5Util.getMD5(stringBuffer.toString()));
        String reqText = JSON.toJSONString(submitReq);
        //加密
        String encode = Base64.encodeBase64String(reqText.getBytes());
        System.err.println(encode);
        return encode;
    }
    /**
     * 停车占位提醒:车辆已在3小时前完成充电,请及时取车,避免长时间占用充电资源。
@@ -112,14 +146,18 @@
        return encode;
    }
    /**
    /**  phone  单词可拼接5000个号码
     * 桩故障(自动/手动):检测到【电站1】【编号】号桩设备离线,请及时查看处理!
     * @param phone 手机号
     * @param site 站点名称
     * @param chargeGun 桩编号
     * @return
     */
    public static String faultMsg(String phone,String site,String chargeGun){
        // 去除特殊字符 比如.-/{(等等
        site = site.replaceAll("[\\p{P}+~$`^=|<>~`$^+=|<>¥×]", "");
        SubmitTempletReq submitReq = new SubmitTempletReq();
        if(site.length()<=10){
            String[] paramss = {site,chargeGun};