From 048db32d9a965f1ef398a8aa02a012e9b968a6b1 Mon Sep 17 00:00:00 2001 From: liusheng <337615773@qq.com> Date: 星期五, 08 十一月 2024 18:39:04 +0800 Subject: [PATCH] 代码提交 --- ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java | 137 +++++++++++++++++++++++---------------------- 1 files changed, 69 insertions(+), 68 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java index f5cbbb7..56581fc 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java @@ -1,5 +1,6 @@ package com.ruoyi.web.component; +import com.alibaba.fastjson.JSON; import com.alibaba.fastjson2.JSONObject; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; @@ -417,77 +418,77 @@ String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); - -// SendMagParam sendMagParam = new SendMagParam(); -// sendMagParam.setType("5"); -// sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); -// log.info("閾炬帴瀹屾暣璺緞锛歿}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); -// //杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙�� -// sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4"); -// Map map = new HashMap(); -// map.put("first", ivrTask1.getTaskName()); -// sendMagParam.setContent(JSON.toJSONString(map)); -// sendMagParam.setOpenid(serviceSubtask.getOpenid()); -// Boolean aBoolean = sendService.sendMsg(sendMagParam); - String url = null; try { -// if (type == 1) { -// url = ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; -// } else if (type == 2) { -// url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; -// } else if (type == 3) { -// url = ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; -// } - if (type == 1) { - //闅忚 - ServiceOutPath serviceOutPath = new ServiceOutPath(); - serviceOutPath.setParam1(taskId); - serviceOutPath.setParam2(patid); - serviceOutPath.setCreateTime(new Date()); - iServiceOutPathService.insertServiceOutPath(serviceOutPath); - String format = String.format("%03X", serviceOutPath.getId()); - serviceOutPath.setRadix(format); - serviceOutPath.setUpdateTime(new Date()); - iServiceOutPathService.updateServiceOutPath(serviceOutPath); -// sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); - url = ip + ":" + req_path + "/sf?p=" + format; - } else if (type == 2) { - //闂埜 - ServiceOutPath serviceOutPath = new ServiceOutPath(); - serviceOutPath.setParam1(taskId); - serviceOutPath.setParam2(patid); -// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString())); - serviceOutPath.setParam3(ivrTask1.getTaskName()); - serviceOutPath.setCreateTime(new Date()); - iServiceOutPathService.insertServiceOutPath(serviceOutPath); - String format = String.format("%03X", serviceOutPath.getId()); - serviceOutPath.setRadix(format); - serviceOutPath.setUpdateTime(new Date()); - iServiceOutPathService.updateServiceOutPath(serviceOutPath); -// sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"); - url = ip + ":" + req_path + "/wt?p=" + format; - } else if (type == 3) { - //瀹f暀 - ServiceOutPath serviceOutPath = new ServiceOutPath(); - serviceOutPath.setParam1(taskId); - serviceOutPath.setParam2(patid); -// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString())); - serviceOutPath.setParam3(ivrTask1.getTaskName()); - serviceOutPath.setCreateTime(new Date()); - iServiceOutPathService.insertServiceOutPath(serviceOutPath); - String format = String.format("%03X", serviceOutPath.getId()); - serviceOutPath.setRadix(format); - serviceOutPath.setUpdateTime(new Date()); - iServiceOutPathService.updateServiceOutPath(serviceOutPath); - url = ip + ":" + req_path + "/xj?p=" + format; - } + SendMagParam sendMagParam = new SendMagParam(); + sendMagParam.setType("5"); + sendMagParam.setUrl(ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); + log.info("閾炬帴瀹屾暣璺緞锛歿}", ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName() + "¶m5=false"); + //杩欎釜妯℃澘ID鍏堝啓姝伙紝鍚庨潰鍋氭垚鍙�� + sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4"); + Map map = new HashMap(); + map.put("first", ivrTask1.getTaskName()); + sendMagParam.setContent(JSON.toJSONString(map)); + sendMagParam.setOpenid(serviceSubtask.getOpenid()); + Boolean aBoolean = sendService.sendMsg(sendMagParam); + String url = null; - String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "鏃�"); - Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); - if (!map.isEmpty()) { +//// if (type == 1) { +//// url = ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; +//// } else if (type == 2) { +//// url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; +//// } else if (type == 3) { +//// url = ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; +//// } +// if (type == 1) { +// //闅忚 +// ServiceOutPath serviceOutPath = new ServiceOutPath(); +// serviceOutPath.setParam1(taskId); +// serviceOutPath.setParam2(patid); +// serviceOutPath.setCreateTime(new Date()); +// iServiceOutPathService.insertServiceOutPath(serviceOutPath); +// String format = String.format("%03X", serviceOutPath.getId()); +// serviceOutPath.setRadix(format); +// serviceOutPath.setUpdateTime(new Date()); +// iServiceOutPathService.updateServiceOutPath(serviceOutPath); +//// sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); +// url = ip + ":" + req_path + "/sf?p=" + format; +// } else if (type == 2) { +// //闂埜 +// ServiceOutPath serviceOutPath = new ServiceOutPath(); +// serviceOutPath.setParam1(taskId); +// serviceOutPath.setParam2(patid); +//// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString())); +// serviceOutPath.setParam3(ivrTask1.getTaskName()); +// serviceOutPath.setCreateTime(new Date()); +// iServiceOutPathService.insertServiceOutPath(serviceOutPath); +// String format = String.format("%03X", serviceOutPath.getId()); +// serviceOutPath.setRadix(format); +// serviceOutPath.setUpdateTime(new Date()); +// iServiceOutPathService.updateServiceOutPath(serviceOutPath); +//// sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"); +// url = ip + ":" + req_path + "/wt?p=" + format; +// } else if (type == 3) { +// //瀹f暀 +// ServiceOutPath serviceOutPath = new ServiceOutPath(); +// serviceOutPath.setParam1(taskId); +// serviceOutPath.setParam2(patid); +//// serviceOutPath.setParam3(URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString())); +// serviceOutPath.setParam3(ivrTask1.getTaskName()); +// serviceOutPath.setCreateTime(new Date()); +// iServiceOutPathService.insertServiceOutPath(serviceOutPath); +// String format = String.format("%03X", serviceOutPath.getId()); +// serviceOutPath.setRadix(format); +// serviceOutPath.setUpdateTime(new Date()); +// iServiceOutPathService.updateServiceOutPath(serviceOutPath); +// url = ip + ":" + req_path + "/xj?p=" + format; +// } +// +// String wxCode = getWXCode(serviceSubtask.getSfzh(), url, serviceSubtask.getTaskName(), serviceSubtask.getTaskDesc(), "鏃�"); +// Map<String, Object> map = JSONObject.parseObject(wxCode, Map.class); +// if (!map.isEmpty()) { serviceSubtask.setResult("success"); serviceSubtask.setSendstate(3L); - if ((Boolean) map.get("succ") == false) { + if (aBoolean == false) { ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); serviceSubtaskRecord.setSubtaskId(serviceSubtask.getId()); @@ -500,7 +501,7 @@ serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); continue; } - } +// } } catch (Exception e) { ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); -- Gitblit v1.9.3