liusheng
2026-10-10 0afac42fb2e9d6e5291304dd0044ce3042b45d2b
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SmsParamServiceImpl.java
@@ -1,17 +1,13 @@
package com.ruoyi.system.service.impl;
import WebServiceClient.MessagingInsertLocator;
import WebServiceClient.MessagingInsertSoap12Stub;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.message.sms.provider.messaginginsert.MessagingInsertSmsApi;
import com.ruoyi.system.domain.SmsParam;
import com.ruoyi.system.mapper.SmsParamMapper;
import com.ruoyi.system.service.ISmsParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.xml.rpc.holders.IntHolder;
import java.rmi.RemoteException;
import java.util.Date;
import java.util.List;
/**
@@ -24,6 +20,12 @@
public class SmsParamServiceImpl implements ISmsParamService {
    @Autowired
    private SmsParamMapper smsParamMapper;
    /**
     * 预约挂号短信平台(MessagingInsert)API,已收口到 ruoyi-message 模块
     */
    @Autowired
    private MessagingInsertSmsApi messagingInsertSmsApi;
    /**
     * 查询短信参数
@@ -96,19 +98,8 @@
    @Override
    public int sendSmsInfo(String info, String phone) {
        MessagingInsertSoap12Stub binding = null;
        try {
            binding = (MessagingInsertSoap12Stub) new MessagingInsertLocator().getMessagingInsertSoap12();
        } catch (Exception e) {
            e.printStackTrace();
        }
        String aa = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" + "<Request>\n" + "<operate>S001</operate>\n" + "<Sheets>\n" + "<Sheet>\n" + "<Content>" + info + "</Content>\n" + "<Mobile>" + phone + "</Mobile>\n" + "<DateTime>" + new Date() + "</DateTime>\n" + "<Type>预约挂号</Type>\n" + "</Sheet>\n" + "</Sheets>\n" + "</Request>";
        Integer integer = null;
        try {
            integer = binding.SMSMessageAccept(aa, new IntHolder(), new javax.xml.rpc.holders.StringHolder());
        } catch (RemoteException e) {
            e.printStackTrace();
        }
        return integer;
        //预约挂号短信平台(MessagingInsert,Axis SOAP12)已收口到 ruoyi-message 模块
        Integer result = messagingInsertSmsApi.sendSmsInfo(info, phone);
        return result == null ? 0 : result;
    }
}