| | |
| | | import com.fasterxml.jackson.databind.JsonNode; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.google.gson.Gson; |
| | | import com.ruoyi.common.annotation.AddOrgId; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.dx.MessageSend; |
| | | import com.ruoyi.common.utils.HttpUtil; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.http.HttpUtils; |
| | | import com.ruoyi.common.utils.sms.smsUtils; |
| | | import com.ruoyi.common.utils.sms.SmsUtils; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.smartor.common.MtSubmitSmUtil; |
| | | import com.smartor.common.ShiyiSmsUtil; |
| | | import com.smartor.domain.*; |
| | |
| | | private IServiceOutPathService iServiceOutPathService; |
| | | @Autowired |
| | | private IServiceSubtaskService iServiceSubtaskService; |
| | | @Autowired |
| | | private ISysConfigService configService; |
| | | |
| | | @Value("${spring.profiles.active}") |
| | | private String active; |
| | |
| | | @ApiOperation("短信发送") |
| | | @PostMapping("/sendTest") |
| | | public AjaxResult send(@RequestBody smsVO vo) { |
| | | String sendMsg = smsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), vo.getContent()); |
| | | String sendMsg = SmsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), vo.getContent()); |
| | | return AjaxResult.success(sendMsg); |
| | | } |
| | | |
| | |
| | | String sendMsg = "false"; |
| | | try { |
| | | if (active.equals("hzszlyy")) { |
| | | sendMsg = smsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), content); |
| | | sendMsg = SmsUtils.sendSms(xhsmsPath, xhsmsAccount, xhsmsPwd, vo.getPhone(), content); |
| | | } else if (active.equals("nhfy")) { |
| | | Map<String, Object> smsResult = mtSubmitSmUtil.submitSm(vo.getPhone(), content); |
| | | if (smsResult != null && smsResult.get("result") != null && smsResult.get("result").toString().equals("0")) { |
| | |
| | | serviceOutPath.setOrgid(vo.getOrgid()); |
| | | iServiceOutPathService.insertServiceOutPath(serviceOutPath); |
| | | String url = StringUtils.isNotEmpty(req_path) ? ip + ":" + req_path + "/wt?p=" + format : ip + "/wt?p=" + format; |
| | | sendMsg = smsUtils.sendChat(url, vo.getPhone(), vo.getIdCard()); |
| | | sendMsg = SmsUtils.sendChat(url, vo.getPhone(), vo.getIdCard()); |
| | | } |
| | | return AjaxResult.success(sendMsg); |
| | | } |
| | |
| | | return AjaxResult.success(content); |
| | | } |
| | | |
| | | /** |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation("短信发送") |
| | | @AddOrgId |
| | | @PostMapping("/sendYunMasSms") |
| | | public AjaxResult sendYunMasSms(@RequestBody smsVO vo) throws Exception { |
| | | // String yunMasConfig = configService.selectConfigByKey("ls.msg.yunmas",vo.getOrgid()); |
| | | SmsUtils.YunMasConfig yunMasConfig = new SmsUtils.YunMasConfig(); |
| | | SmsUtils.SmsResult smsResult = SmsUtils.sendYunMasSms(yunMasConfig, vo.getPhone(), vo.getContent()); |
| | | return AjaxResult.success(smsResult); |
| | | } |
| | | |
| | | |
| | | } |