111
rk
2025-08-22 6b6dea66dc53ebee26ac5e6731d8e7f0bd6a9fe2
server/services/src/main/java/com/doumee/service/business/AliSmsService.java
@@ -46,7 +46,9 @@
    private final static String SING_NAME = "橙桔天下科技";
    public void sendSms(int type, String phone, Orders orders, String receiveName, String businessPhone, BigDecimal distance, IdentityInfo identityInfo,CategoryMapper categoryMapper){
    public void businessSendSms(int type, String phone, Orders orders, BigDecimal distance,
                        IdentityInfo identityInfo,CategoryMapper categoryMapper){
        try{
        Constants.smsContent smsContent = Constants.smsContent.getSmsContent(type);
        Map<String,Object> tempParam = new HashMap<>();
        if(smsContent.getName().indexOf("time1")>=Constants.ZERO){
@@ -54,9 +56,6 @@
        }
        if(smsContent.getName().indexOf("time2")>=Constants.ZERO){
            tempParam.put("time2", DateUtil.formatDate(orders.getEndDate(),"MM-dd"));
        }
        if(smsContent.getName().indexOf("name")>=Constants.ZERO){
            tempParam.put("name", receiveName);
        }
        if(smsContent.getName().indexOf("money")>=Constants.ZERO){
            tempParam.put("money", new BigDecimal(orders.getReceiveAccount().toString()).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP)+"元");
@@ -71,7 +70,7 @@
                tempParam.put("authentication", Constants.equalsInteger(identityInfo.getAuthType(),Constants.ZERO)?"个人":identityInfo.getCompanyName());
            }
            if(smsContent.getName().indexOf("order")>=Constants.ZERO){
                tempParam.put("order", Constants.orderType.getName(identityInfo.getType()).replace("单",""));
                    tempParam.put("oeder", Constants.orderType.getName(identityInfo.getType()).replace("单",""));
            }
            if(smsContent.getName().indexOf("status")>=Constants.ZERO){
                tempParam.put("status", Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.TWO)?"已通过":"未通过");
@@ -107,11 +106,14 @@
                tempParam.put("order",order);
            }
        }
        if(smsContent.getName().indexOf("authentication")>=Constants.ZERO){
            if(smsContent.getName().indexOf("distance")>=Constants.ZERO){
            tempParam.put("distance", distance +"km");
        }
        AliSmsService.sendSms(phone,smsContent.getCode(), JSONObject.toJSONString(tempParam));
        }catch (Exception e){
            log.error("短信发送失败~");
        }
    }
@@ -166,10 +168,10 @@
            //请求失败这里会抛ClientException异常
            SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request);
            if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) {
//                logger.info(phone + "-" + templateCode + "-" + templateParam + " >>> " + JSON.toJSONString(sendSmsResponse));
                log.info("短信发送内容:"+phone + "-" + templateCode + "-" + templateParam + " >>> " + JSON.toJSONString(sendSmsResponse));
                return true;
            } else {
//                logger.error(phone + "-" + templateCode + "-" + templateParam + " >>> " + JSON.toJSONString(sendSmsResponse));
                log.error("短信发送内容:"+phone + "-" + templateCode + "-" + templateParam + " >>> " + JSON.toJSONString(sendSmsResponse));
            }
        } catch (Exception e) {
            e.printStackTrace();