| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import java.util.List; |
| | | import WebServiceClient.MessagingInsertLocator; |
| | | import WebServiceClient.MessagingInsertSoap12Stub; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.smartor.domain.SmsParam; |
| | | import com.smartor.mapper.SmsParamMapper; |
| | | import com.smartor.service.ISmsParamService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.smartor.mapper.SmsParamMapper; |
| | | import com.smartor.domain.SmsParam; |
| | | import com.smartor.service.ISmsParamService; |
| | | |
| | | import javax.xml.rpc.holders.IntHolder; |
| | | import java.rmi.RemoteException; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短信参数Service业务层处理 |
| | |
| | | * @date 2023-03-06 |
| | | */ |
| | | @Service |
| | | public class SmsParamServiceImpl implements ISmsParamService |
| | | { |
| | | public class SmsParamServiceImpl implements ISmsParamService { |
| | | @Autowired |
| | | private SmsParamMapper smsParamMapper; |
| | | |
| | |
| | | * @return 短信参数 |
| | | */ |
| | | @Override |
| | | public SmsParam selectSmsParamByParamid(Long paramid) |
| | | { |
| | | public SmsParam selectSmsParamByParamid(Long paramid) { |
| | | return smsParamMapper.selectSmsParamByParamid(paramid); |
| | | } |
| | | |
| | |
| | | * @return 短信参数 |
| | | */ |
| | | @Override |
| | | public List<SmsParam> selectSmsParamList(SmsParam smsParam) |
| | | { |
| | | public List<SmsParam> selectSmsParamList(SmsParam smsParam) { |
| | | return smsParamMapper.selectSmsParamList(smsParam); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int insertSmsParam(SmsParam smsParam) |
| | | { |
| | | public int insertSmsParam(SmsParam smsParam) { |
| | | smsParam.setCreateTime(DateUtils.getNowDate()); |
| | | return smsParamMapper.insertSmsParam(smsParam); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改短信参数 |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int updateSmsParam(SmsParam smsParam) |
| | | { |
| | | public int updateSmsParam(SmsParam smsParam) { |
| | | smsParam.setUpdateTime(DateUtils.getNowDate()); |
| | | return smsParamMapper.updateSmsParam(smsParam); |
| | | } |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSmsParamByParamids(Long[] paramids) |
| | | { |
| | | public int deleteSmsParamByParamids(Long[] paramids) { |
| | | return smsParamMapper.deleteSmsParamByParamids(paramids); |
| | | } |
| | | |
| | |
| | | * @return 结果 |
| | | */ |
| | | @Override |
| | | public int deleteSmsParamByParamid(Long paramid) |
| | | { |
| | | public int deleteSmsParamByParamid(Long paramid) { |
| | | return smsParamMapper.deleteSmsParamByParamid(paramid); |
| | | } |
| | | |
| | | @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; |
| | | } |
| | | } |