ruoyi-admin/src/main/java/com/ruoyi/web/component/RedisMqReceiver.java
@@ -5,6 +5,7 @@ import com.google.gson.Gson; import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.ServiceFromEnum; 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; @@ -13,10 +14,7 @@ import com.smartor.domain.*; import com.smartor.mapper.ServiceSubtaskMapper; import com.smartor.mapper.ServiceTaskMapper; import com.smartor.service.IBaseSmsaccountService; import com.smartor.service.IIvrTaskTemplateService; import com.smartor.service.IServiceSubtaskRecordService; import com.smartor.service.ISvyTaskTemplateService; import com.smartor.service.*; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -26,6 +24,7 @@ import org.springframework.data.redis.listener.RedisMessageListenerContainer; import org.springframework.stereotype.Component; import java.math.BigInteger; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.time.LocalDateTime; @@ -55,9 +54,7 @@ private String thirdWXUrl; @Autowired private IIvrTaskTemplateService ivrTaskTemplateService; @Autowired private ISvyTaskTemplateService svyTaskTemplateService; private IServiceOutPathService iServiceOutPathService; @Autowired private ServiceSubtaskMapper ivrTaskcallMapper; @@ -88,6 +85,9 @@ @Autowired IBaseSmsaccountService baseSmsaccountService; @Value("${xhsmsPath}") private String xhsmsPath; // å建åºå®å¤§å°ççº¿ç¨æ± private static final ExecutorService executorService = Executors.newFixedThreadPool(10); @@ -280,7 +280,6 @@ continue; } else if (descByCode.equals("çä¿¡")) { //çä¿¡ // http://localhost:8099/followvisit/particty?param1=3¶m2=348 //对urlä¸ä¸¤ä¸ªåæ°å å¯ RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); @@ -298,17 +297,62 @@ SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("4"); if (type == 1) { sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); } else if (type == 1) { sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"); //é访 ServiceOutPath serviceOutPath = new ServiceOutPath(); serviceOutPath.setParam1(taskId); serviceOutPath.setParam2(patid); serviceOutPath.setCreateTime(new Date()); iServiceOutPathService.insertServiceOutPath(serviceOutPath); // sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); //转æ16è¿å¶ String format = String.format("%03X", serviceOutPath.getId()); serviceOutPath.setRadix(format); serviceOutPath.setUpdateTime(new Date()); iServiceOutPathService.updateServiceOutPath(serviceOutPath); sendMagParam.setPhone(serviceSubtask.getPhone()); sendMagParam.setUrl(ip + ":" + req_path + "/sf?p=" + format); sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢éè®¿è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "å¡«åãæè°¢æ¨é åï¼"); } 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"); sendMagParam.setPhone(serviceSubtask.getPhone()); sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format); sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "å¡«åãæè°¢æ¨é åï¼"); } else if (type == 3) { sendMagParam.setUrl(ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"); //宣æ 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 + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"); sendMagParam.setPhone(serviceSubtask.getPhone()); sendMagParam.setUrl(ip + ":" + req_path + "/xj?p=" + format); sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢å®£æè°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "æ¥çãæè°¢æ¨é åï¼"); } //çä¿¡è¿éè¦æ¨¡æ¿ sendMagParam.setContent("ãæ°åå»é¢ã+<a href="+sendMagParam.getUrl()+"龿¥æµè¯</a>"); Boolean aBoolean = sendService.sendMsg(sendMagParam); if (!aBoolean) { Map<String, String> req = new HashMap<>(); req.put("phone", sendMagParam.getPhone()); req.put("content", sendMagParam.getContent()); String s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); if (s.equals("true")) { ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); serviceSubtaskRecord.setSubtaskId(serviceSubtask.getId()); @@ -387,12 +431,55 @@ // 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) { url = ip + ":" + req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; //é访 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) { url = ip + ":" + req_path + "/outsideChainwt?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; //é®å¸ 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) { url = ip + ":" + req_path + "/outsideChainxj?param1=" + taskId + "¶m2=" + patid + "¶m3=" + URLEncoder.encode(ivrTask1.getTaskName(), StandardCharsets.UTF_8.toString()) + "¶m5=false"; //宣æ 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(), "æ "); ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/ServiceOutPathController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,116 @@ package com.ruoyi.web.controller.smartor; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.utils.poi.ExcelUtil; import com.smartor.domain.ServiceOutPath; import com.smartor.service.IServiceOutPathService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections4.CollectionUtils; import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.util.List; /** * 主é®Controller * * @author lihu */ @Api("主é®") @RestController @RequestMapping("/smartor/outPath") public class ServiceOutPathController extends BaseController { @Autowired private IServiceOutPathService serviceOutPathService; /** * æ¥è¯¢ä¸»é®å表 */ @ApiOperation("æ¥è¯¢ä¸»é®å表") //@PreAuthorize("@ss.hasPermi('smartor:path:list')") @GetMapping("/list") public TableDataInfo list(ServiceOutPath serviceOutPath) { startPage(); List<ServiceOutPath> list = serviceOutPathService.selectServiceOutPathList(serviceOutPath); return getDataTable(list); } /** * paramå°±æ¯è¿å¶ * * @param param * @return */ @PostMapping("/getInfoByParam") public AjaxResult param(@Param("param") String param) { ServiceOutPath serviceOutPath=new ServiceOutPath(); serviceOutPath.setRadix(param); List<ServiceOutPath> list = serviceOutPathService.selectServiceOutPathList(serviceOutPath); ServiceOutPath serviceOutPath1 = list.get(0); serviceOutPath1.setId(null); serviceOutPath1.setRadix(null); if (CollectionUtils.isNotEmpty(list)) return success(serviceOutPath1); return success(null); } /** * 导åºä¸»é®å表 */ @ApiOperation("导åºä¸»é®å表") //@PreAuthorize("@ss.hasPermi('smartor:path:export')") @Log(title = "主é®", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ServiceOutPath serviceOutPath) { List<ServiceOutPath> list = serviceOutPathService.selectServiceOutPathList(serviceOutPath); ExcelUtil<ServiceOutPath> util = new ExcelUtil<ServiceOutPath>(ServiceOutPath.class); util.exportExcel(response, list, "䏻鮿°æ®"); } /** * è·å主é®è¯¦ç»ä¿¡æ¯ */ @ApiOperation("è·å主é®è¯¦ç»ä¿¡æ¯") @GetMapping(value = "/getInfo/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(serviceOutPathService.selectServiceOutPathById(id)); } /** * æ°å¢ä¸»é® */ @ApiOperation("æ°å¢ä¸»é®") @Log(title = "主é®", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody ServiceOutPath serviceOutPath) { return toAjax(serviceOutPathService.insertServiceOutPath(serviceOutPath)); } /** * ä¿®æ¹ä¸»é® */ @ApiOperation("ä¿®æ¹ä¸»é®") //@PreAuthorize("@ss.hasPermi('smartor:path:edit')") @Log(title = "主é®", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody ServiceOutPath serviceOutPath) { return toAjax(serviceOutPathService.updateServiceOutPath(serviceOutPath)); } /** * å é¤ä¸»é® */ @ApiOperation("å é¤ä¸»é®") //@PreAuthorize("@ss.hasPermi('smartor:path:remove')") @Log(title = "主é®", businessType = BusinessType.DELETE) @GetMapping("/remove/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(serviceOutPathService.deleteServiceOutPathByIds(ids)); } } ruoyi-admin/src/main/java/com/ruoyi/web/test/MQTest.java
@@ -4,12 +4,14 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUtils; import com.smartor.domain.ThiedInhospInfo; import io.swagger.models.auth.In; import org.junit.Test; import org.springframework.mock.web.MockMultipartFile; import org.springframework.web.multipart.MultipartFile; import java.io.*; import java.math.BigInteger; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; @@ -42,12 +44,14 @@ @Test public void bb(){ for (int j = 0; j < 5; j++) { if(j==5-1){ System.out.println("11111111111111111111"); } } // int number = 99999; // ç¤ºä¾æ°æ® // String format = String.format("%03X", number); // System.out.println(format); // for (int j = 0; j < 5; j++) { // if(j==5-1){ // System.out.println("11111111111111111111"); // } // } } public void aa(MultipartFile file) throws IOException { ruoyi-admin/src/main/resources/application-druid.yml
@@ -11,8 +11,9 @@ # username: root # password: 123456 # å ¬å¸ url: jdbc:mysql://192.168.2.9:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # url: jdbc:mysql://192.168.2.9:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # æ°å url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 username: smartor password: Smartor.2023 driverClassName: com.mysql.cj.jdbc.Driver @@ -155,9 +156,8 @@ hangup: http://192.168.2.10:8091/hangup #æ°åçä¿¡ #请æ±å°å xhsmsPath: http://183.134.75.159:7862/sms #æ°åç信请æ±å°å(è¿ä¸ªæå¡æ¯æä»¬èªå·±åç) xhsmsPath: http://192.16.4.220:8092/sendSms #å¸å· xhsmsAccount: 911124 #æ¥å£å¯ç ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -108,7 +108,7 @@ // è¿æ»¤è¯·æ± .authorizeRequests() // 对äºç»å½login 注åregister éªè¯ç captchaImage å 许å¿åè®¿é® .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer","/smartor/import/download","/smartor/serviceSubtask/recordAccept").permitAll() .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer","/smartor/import/download","/smartor/serviceSubtask/recordAccept","/smartor/outPath/getInfoByParam").permitAll() // éæèµæºï¼å¯å¿åè®¿é® .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // é¤ä¸é¢å¤çææè¯·æ±å ¨é¨éè¦é´æè®¤è¯ ruoyi-quartz/src/main/java/com/ruoyi/quartz/task/RyTask.java
@@ -12,6 +12,7 @@ import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.enums.ServiceFromEnum; import com.ruoyi.common.utils.DtoConversionUtils; 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; @@ -28,6 +29,8 @@ import org.springframework.transaction.PlatformTransactionManager; import org.springframework.transaction.annotation.Transactional; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.reflect.Type; @@ -55,6 +58,9 @@ private IServiceThirdDataService iServiceThirdDataService; @Autowired private IServiceOutPathService iServiceOutPathService; @Autowired private IServiceSubtaskAnswerService serviceSubtaskAnswerService; @Autowired @@ -71,6 +77,9 @@ @Value("${localIP}") private String localIP; @Value("${xhsmsPath}") private String xhsmsPath; @Value("${pub_key}") private String pub_key; @@ -332,23 +341,44 @@ } else if (descByCode.equals("纸质")) { //纸质 } else if (descByCode.equals("çä¿¡")) { //çä¿¡ // http://localhost:8099/followvisit/particty?param1=3¶m2=348 //对urlä¸ä¸¤ä¸ªåæ°å å¯ RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); for (ServiceSubtask serviceSubtask : selectServiceSubtaskList) { log.error("çä¿¡é¿æä»»å¡åé---------è¿æ¥äºåï¼{}", serviceSubtask); boolean dateToday = isDateToday(serviceSubtask.getLongSendTime()); if (dateToday) { try { //å 夿æ£è æ¯ä¸æ¯è¿è¦åé PatArchive patArchive = patArchiveService.selectPatArchiveByPatid(serviceSubtask.getPatid()); if (!Objects.isNull(patArchive) && patArchive.getNotrequiredFlag() == "1") { //ä¸éè¦åé serviceSubtask.setResult("error"); serviceSubtask.setRemark(patArchive.getNotrequiredreason()); serviceSubtask.setSendstate(4L); serviceSubtask.setFinishtime(new Date()); iServiceSubtaskService.insertServiceSubtask(serviceSubtask); continue; } String patid = rsaPublicKeyExample.encryptedData(serviceSubtask.getPatid().toString(), pub_key); SendMagParam sendMagParam = new SendMagParam(); sendMagParam.setType("4"); ServiceOutPath serviceOutPath = new ServiceOutPath(); serviceOutPath.setParam1(taskId); serviceOutPath.setParam2(patid); 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.setPhone(serviceSubtask.getPhone()); sendMagParam.setUrl(ip + ":" + req_path + "/followvisit/particty?param1=" + taskId + "¶m2=" + patid + "¶m5=false"); Boolean aBoolean = sendService.sendMsg(sendMagParam); sendMagParam.setUrl(ip + ":" + req_path + "/wt?p=" + format); sendMagParam.setContent("ãæ°åå»é¢ãæ¨å¥½ï¼é请æ¨å¡«ååºé¢è°æ¥è¡¨ï¼è¯·ç¹å»" + sendMagParam.getUrl() + "å¡«åãæè°¢æ¨é åï¼"); Map<String, String> req = new HashMap<>(); req.put("phone", sendMagParam.getPhone()); req.put("content", sendMagParam.getContent()); String isSuccess = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); //ä»»å¡åéè®°å½ ServiceSubtaskRecord serviceSubtaskRecord = new ServiceSubtaskRecord(); serviceSubtaskRecord.setTaskid(serviceSubtask.getTaskid().toString()); @@ -356,10 +386,31 @@ serviceSubtaskRecord.setTasktype(serviceSubtask.getType()); serviceSubtaskRecord.setPreachform("4"); serviceSubtaskRecord.setStartTime(System.currentTimeMillis()); serviceSubtaskRecord.setResult(aBoolean == true ? "æå" : "失败"); serviceSubtaskRecord.setResult("success"); if (StringUtils.isNotEmpty(isSuccess) && !isSuccess.equals("true")) serviceSubtaskRecord.setResult("error"); serviceSubtaskRecordService.insertServiceSubtaskRecord(serviceSubtaskRecord); //åé宿åï¼ä¿®æ¹ç¶æ serviceSubtask.setSendstate(3L); if (StringUtils.isNotEmpty(isSuccess) && !isSuccess.equals("true")) { serviceSubtask.setResult("success"); } else { serviceSubtask.setResult("error"); serviceSubtask.setSendstate(5L); serviceSubtask.setRemark("çä¿¡åé失败"); } iServiceSubtaskService.updateServiceSubtask(serviceSubtask); } catch (Exception e) { continue; String guid = UUID.randomUUID().toString(); log.error("é¿æä»»å¡ï¼åé失败åå ï¼{},{}", e.getMessage(), guid); serviceSubtask.setResult("error"); serviceSubtask.setRemark("ç³»ç»é误"); serviceSubtask.setSendstate(5L); serviceSubtask.setFinishtime(new Date()); serviceSubtask.setGuid(guid); iServiceSubtaskService.updateServiceSubtask(serviceSubtask); } } } } else if (descByCode.equals("å ¬ä¼å·")) { @@ -462,6 +513,32 @@ Type resultType = new TypeToken<List<ThiedInhospInfo>>() { }.getType(); List<ThiedInhospInfo> thiedInhospInfoList = gson.fromJson(resultArray, resultType); // å建ä¸ä¸ªæ°æä»¶ String filename = null; if (cry.equals("0")) filename = "å ¥é¢ä¿¡æ¯" + System.currentTimeMillis(); if (cry.equals("1")) filename = "åºé¢ä¿¡æ¯" + System.currentTimeMillis(); File file = new File("D:\\public\\ååéæå¹³å°æ°æ®\\" + filename); if (!file.exists()) { // 妿æä»¶ä¸åå¨ï¼ååå»ºæ°æä»¶ try { if (file.createNewFile()) { System.out.println("æååå»ºäºæ°æä»¶!"); } else { System.out.println("å¤±è´¥ï¼æä»¶æ æ³å建ï¼"); } } catch (IOException e) { e.printStackTrace(); } } // å°æ°æ®åå ¥å°æä»¶ä¸ try { FileWriter writer = new FileWriter(file); writer.write(result); } catch (IOException e) { e.printStackTrace(); } if (CollectionUtils.isNotEmpty(thiedInhospInfoList)) { for (ThiedInhospInfo thiedInhospInfo : thiedInhospInfoList) { //éè¿èº«ä»½è¯å·æ¥è¯¢è¯¥æ£è 卿£è 表æ¯å¦åå¨ @@ -571,7 +648,9 @@ inhosp.setPatno(patArchive.getPatientno()); inhosp.setSerialnum(patMedInhosp.getSerialnum()); List<PatMedInhosp> patMedInhosps = patMedInhospService.selectPatMedInhospList(inhosp); log.error("æ¯å¦éè¦æ´æ°ï¼{}", patMedInhosps.size()); if (CollectionUtils.isNotEmpty(patMedInhosps)) { patMedInhosp.setInhospid(patMedInhosps.get(0).getInhospid()); patMedInhospService.updatePatMedInhosp(patMedInhosp); } else { patMedInhospService.insertPatMedInhosp(patMedInhosp); smartor/src/main/java/com/smartor/domain/ServiceOutPath.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,66 @@ package com.smartor.domain; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 主é®å¯¹è±¡ service_out_path * * @author lihu * @date 2024-11-04 */ @Data @ApiModel("主é®") public class ServiceOutPath extends BaseEntity { private static final long serialVersionUID = 1L; /** * ä¸»é® */ @ApiModelProperty("主é®") private Long id; /** * taskID */ @ApiModelProperty("taskID") @Excel(name = "taskID") private String param1; /** * pid */ @ApiModelProperty("pid") @Excel(name = "pid") private String param2; /** * task_name */ @ApiModelProperty("task_name") @Excel(name = "task_name") private String param3; /** * flag(å端å®ç,ç´æ¥è¿åfalseå°±è¡) */ @ApiModelProperty("flag(å端å®ç,ç´æ¥è¿åfalseå°±è¡)") @Excel(name = "flag(å端å®ç,ç´æ¥è¿åfalseå°±è¡)") private String param5 = "false"; /** * å 餿 è®° */ @ApiModelProperty(value = "å 餿 è®°") private String delFlag; @ApiModelProperty(value = "è¿å¶") private String radix; } smartor/src/main/java/com/smartor/mapper/ServiceOutPathMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,63 @@ package com.smartor.mapper; import java.util.List; import org.apache.ibatis.annotations.Mapper; import com.smartor.domain.ServiceOutPath; /** * 主é®Mapperæ¥å£ * * @author lihu * @date 2024-11-04 */ @Mapper public interface ServiceOutPathMapper { /** * æ¥è¯¢ä¸»é® * * @param id 主é®ä¸»é® * @return ä¸»é® */ public ServiceOutPath selectServiceOutPathById(Long id); /** * æ¥è¯¢ä¸»é®å表 * * @param serviceOutPath ä¸»é® * @return 主é®éå */ public List<ServiceOutPath> selectServiceOutPathList(ServiceOutPath serviceOutPath); /** * æ°å¢ä¸»é® * * @param serviceOutPath ä¸»é® * @return ç»æ */ public int insertServiceOutPath(ServiceOutPath serviceOutPath); /** * ä¿®æ¹ä¸»é® * * @param serviceOutPath ä¸»é® * @return ç»æ */ public int updateServiceOutPath(ServiceOutPath serviceOutPath); /** * å é¤ä¸»é® * * @param id 主é®ä¸»é® * @return ç»æ */ public int deleteServiceOutPathById(Long id); /** * æ¹éå é¤ä¸»é® * * @param ids éè¦å é¤çæ°æ®ä¸»é®éå * @return ç»æ */ public int deleteServiceOutPathByIds(Long[] ids); } smartor/src/main/java/com/smartor/service/IServiceOutPathService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,61 @@ package com.smartor.service; import java.util.List; import com.smartor.domain.ServiceOutPath; /** * 主é®Serviceæ¥å£ * * @author lihu * @date 2024-11-04 */ public interface IServiceOutPathService { /** * æ¥è¯¢ä¸»é® * * @param id 主é®ä¸»é® * @return ä¸»é® */ public ServiceOutPath selectServiceOutPathById(Long id); /** * æ¥è¯¢ä¸»é®å表 * * @param serviceOutPath ä¸»é® * @return 主é®éå */ public List<ServiceOutPath> selectServiceOutPathList(ServiceOutPath serviceOutPath); /** * æ°å¢ä¸»é® * * @param serviceOutPath ä¸»é® * @return ç»æ */ public int insertServiceOutPath(ServiceOutPath serviceOutPath); /** * ä¿®æ¹ä¸»é® * * @param serviceOutPath ä¸»é® * @return ç»æ */ public int updateServiceOutPath(ServiceOutPath serviceOutPath); /** * æ¹éå é¤ä¸»é® * * @param ids éè¦å é¤ç主é®ä¸»é®éå * @return ç»æ */ public int deleteServiceOutPathByIds(Long[] ids); /** * å é¤ä¸»é®ä¿¡æ¯ * * @param id 主é®ä¸»é® * @return ç»æ */ public int deleteServiceOutPathById(Long id); } smartor/src/main/java/com/smartor/service/impl/ServiceOutPathServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,87 @@ package com.smartor.service.impl; import com.smartor.domain.ServiceOutPath; import com.smartor.mapper.ServiceOutPathMapper; import com.smartor.service.IServiceOutPathService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; /** * 主é®Serviceä¸å¡å±å¤ç * * @author lihu * @date 2024-11-04 */ @Service public class ServiceOutPathServiceImpl implements IServiceOutPathService { @Autowired private ServiceOutPathMapper serviceOutPathMapper; /** * æ¥è¯¢ä¸»é® * * @param id 主é®ä¸»é® * @return ä¸»é® */ @Override public ServiceOutPath selectServiceOutPathById(Long id) { return serviceOutPathMapper.selectServiceOutPathById(id); } /** * æ¥è¯¢ä¸»é®å表 * * @param serviceOutPath ä¸»é® * @return ä¸»é® */ @Override public List<ServiceOutPath> selectServiceOutPathList(ServiceOutPath serviceOutPath) { return serviceOutPathMapper.selectServiceOutPathList(serviceOutPath); } /** * æ°å¢ä¸»é® * * @param serviceOutPath ä¸»é® * @return ç»æ */ @Override public int insertServiceOutPath(ServiceOutPath serviceOutPath) { return serviceOutPathMapper.insertServiceOutPath(serviceOutPath); } /** * ä¿®æ¹ä¸»é® * * @param serviceOutPath ä¸»é® * @return ç»æ */ @Override public int updateServiceOutPath(ServiceOutPath serviceOutPath) { return serviceOutPathMapper.updateServiceOutPath(serviceOutPath); } /** * æ¹éå é¤ä¸»é® * * @param ids éè¦å é¤ç主é®ä¸»é® * @return ç»æ */ @Override public int deleteServiceOutPathByIds(Long[] ids) { return serviceOutPathMapper.deleteServiceOutPathByIds(ids); } /** * å é¤ä¸»é®ä¿¡æ¯ * * @param id 主é®ä¸»é® * @return ç»æ */ @Override public int deleteServiceOutPathById(Long id) { return serviceOutPathMapper.deleteServiceOutPathById(id); } } smartor/src/main/resources/mapper/smartor/ServiceOutPathMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,137 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.smartor.mapper.ServiceOutPathMapper"> <resultMap type="com.smartor.domain.ServiceOutPath" id="ServiceOutPathResult"> <result property="id" column="id"/> <result property="param1" column="param1"/> <result property="param2" column="param2"/> <result property="param3" column="param3"/> <result property="param5" column="param5"/> <result property="createTime" column="create_time"/> <result property="updateTime" column="update_time"/> <result property="delFlag" column="del_flag"/> <result property="radix" column="radix"/> </resultMap> <sql id="selectServiceOutPathVo"> select id, param1, param2, param3, param5, create_time, update_time, radix, del_flag from service_out_path </sql> <select id="selectServiceOutPathList" parameterType="com.smartor.domain.ServiceOutPath" resultMap="ServiceOutPathResult"> <include refid="selectServiceOutPathVo"/> <where> <if test="param1 != null "> and param1 = #{param1} </if> <if test="param2 != null "> and param2 = #{param2} </if> <if test="param3 != null and param3 != ''"> and param3 = #{param3} </if> <if test="param5 != null and param5 != ''"> and param5 = #{param5} </if> <if test="createTime != null"> and create_time = #{createTime} </if> <if test="param5 != null and param5 != ''"> and param5 = #{param5} </if> <if test="radix != null and radix != ''"> and radix = #{radix} </if> </where> </select> <select id="selectServiceOutPathById" parameterType="Long" resultMap="ServiceOutPathResult"> <include refid="selectServiceOutPathVo"/> where id = #{id} </select> <insert id="insertServiceOutPath" parameterType="com.smartor.domain.ServiceOutPath" useGeneratedKeys="true" keyProperty="id"> insert into service_out_path <trim prefix="(" suffix=")" suffixOverrides=","> <if test="param1 != null">param1, </if> <if test="param2 != null">param2, </if> <if test="param3 != null">param3, </if> <if test="param5 != null">param5, </if> <if test="radix != null">radix, </if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="param1 != null">#{param1}, </if> <if test="param2 != null">#{param2}, </if> <if test="param3 != null">#{param3}, </if> <if test="param5 != null">#{param5}, </if> <if test="radix != null">#{radix}, </if> </trim> </insert> <update id="updateServiceOutPath" parameterType="com.smartor.domain.ServiceOutPath"> update service_out_path <trim prefix="SET" suffixOverrides=","> <if test="param1 != null">param1 = #{param1}, </if> <if test="param2 != null">param2 = #{param2}, </if> <if test="param3 != null">param3 = #{param3}, </if> <if test="param5 != null">param5 = #{param5}, </if> <if test="radix != null">radix = #{radix}, </if> </trim> where id = #{id} </update> <update id="deleteServiceOutPathById" parameterType="Long"> update service_out_path <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where id = #{id} </update> <update id="deleteServiceOutPathByIds" parameterType="String"> update service_out_path <trim prefix="SET" suffixOverrides=","> del_flag =1 </trim> where id in <foreach item="id" collection="array" open="(" separator="," close=")"> #{id} </foreach> </update> </mapper> smartor/src/main/resources/mapper/smartor/ServiceTaskMapper.xml
@@ -52,6 +52,7 @@ <result property="compensateDate" column="compensate_date"/> <result property="leavehospitaldistrictcode" column="leavehospitaldistrictcode"/> <result property="leavehospitaldistrictname" column="leavehospitaldistrictname"/> <result property="compensateDate" column="compensate_date"/> </resultMap> <sql id="selectServiceTaskVo"> @@ -147,6 +148,7 @@ <if test="libtemplatename != null and libtemplatename != ''">and libtemplatename = #{libtemplatename}</if> <if test="createBy != null and createBy != ''">and create_by = #{createBy}</if> <if test="sendState != null ">and send_state = #{sendState}</if> <if test="compensateDate != null ">and compensate_date = #{compensateDate}</if> <if test="leavehospitaldistrictname != null ">and leavehospitaldistrictname = #{leavehospitaldistrictname} </if> @@ -228,7 +230,8 @@ <if test="jsy != null and jsy != ''">jsy,</if> <if test="leavehospitaldistrictname != null ">leavehospitaldistrictname,</if> <if test="leavehospitaldistrictcode != null ">leavehospitaldistrictcode,</if> <if test="compensateDate != null and compensateDate != ''">compensate_date</if> <if test="compensateDate != null and compensateDate != ''">compensate_date,</if> <if test="compensateDate != null ">compensate_date,</if> </trim> <trim prefix="values (" suffix=")" suffixOverrides=","> <if test="taskName != null">#{taskName},</if> @@ -277,6 +280,7 @@ <if test="leavehospitaldistrictname != null ">#{leavehospitaldistrictname},</if> <if test="leavehospitaldistrictcode != null ">#{leavehospitaldistrictcode},</if> <if test="compensateDate != null and compensateDate != ''">#{compensateDate}</if> <if test="compensateDate != null ">#{compensateDate},</if> </trim> </insert> @@ -331,6 +335,7 @@ <if test="leavehospitaldistrictcode != null ">leavehospitaldistrictcode = #{leavehospitaldistrictcode}, </if> <if test="compensateDate != null and compensateDate != ''">compensate_date = #{compensateDate}</if> <if test="compensateDate != null ">compensate_date = #{compensateDate}</if> </trim> where taskid = #{taskid} </update>