随访功能测试:模板、任务、定时发送、公众号发送,流程走通
| | |
| | | package com.ruoyi.web.component; |
| | | |
| | | import com.alibaba.fastjson2.JSON; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.rabbitmq.client.Channel; |
| | | import com.ruoyi.common.core.redis.RedisCache; |
| | | import com.ruoyi.common.enums.ServiceFromEnum; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.web.task.PhoneTask; |
| | | import com.smartor.common.SendService; |
| | |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | |
| | | |
| | | @Value("${phonePath}") |
| | | private String phonePath; |
| | | |
| | | @Value("${pub_key}") |
| | | private String pub_key; |
| | | |
| | | @Value("${req_path}") |
| | | private String req_path; |
| | | |
| | | private static IIvrTaskTemplateService ivrTaskTemplateService; |
| | | |
| | |
| | | private static RabbitMqCallPhoneConfig rabbitMqCallPhoneConfig; |
| | | |
| | | private static RobotPhoneUtils robotPhoneUtils; |
| | | |
| | | |
| | | // å建åºå®å¤§å°ççº¿ç¨æ± |
| | | private static final ExecutorService executorService = Executors.newFixedThreadPool(10); |
| | |
| | | */ |
| | | @RabbitListener(queues = "task_queue", concurrency = "50") |
| | | public void phoneVisit(String content, Message message, Channel channel) throws IOException { |
| | | |
| | | log.error("æ¶æ¯è¿æ¥äº--------------"); |
| | | try { |
| | | IvrTaskcallMQ ivrTaskcallMQ = null; |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(ivrTaskcallMQ.getServicefrom())) { |
| | | if (StringUtils.isNotEmpty(ivrTaskcallMQ.getPreachform())) { |
| | | //å¦ä½ä»»å¡åéæ¹å¼ä¸ä¸ºç©º |
| | | String[] split = ivrTaskcallMQ.getServicefrom().split(","); |
| | | String[] split = ivrTaskcallMQ.getPreachform().split(","); |
| | | for (String serviceFrom : split) { |
| | | String descByCode = ServiceFromEnum.getDescByCode(Integer.valueOf(serviceFrom)); |
| | | //è¿éå¯ä»¥èèç¨çç¥æ¨¡å¼ä¼åä¸ä¸ï¼ä¸ç¶å¤ªé¾çäº |
| | | |
| | | //éè¿æ¨¡æ¿IDè·å模æ¿é®é¢ |
| | | IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO(); |
| | | ivrTaskTemplateVO.setID(Long.valueOf(ivrTaskcallMQ.getTemplateid())); |
| | | IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); |
| | | |
| | | //éè¿ä»»å¡IDæ¿å°æ£è
ä¿¡æ¯ |
| | | IvrTaskSingle ivrTaskcall = new IvrTaskSingle(); |
| | | ivrTaskcall.setTaskid(ivrTaskcallMQ.getTaskid()); |
| | | List<IvrTaskSingle> ivrTaskcalls = ivrTaskcallMapper.selectIvrTaskcallList(ivrTaskcall); |
| | | if (descByCode.equals("çµè¯")) { |
| | | //éè¿æ¨¡æ¿IDè·å模æ¿é®é¢ |
| | | IvrTaskTemplateVO ivrTaskTemplateVO = new IvrTaskTemplateVO(); |
| | | ivrTaskTemplateVO.setID(Long.valueOf(ivrTaskcallMQ.getTemplateid())); |
| | | IvrTaskTemplateVO ivrTaskTemplateVO1 = ivrTaskTemplateService.selectInfoByCondition(ivrTaskTemplateVO); |
| | | |
| | | //éè¿ä»»å¡IDæ¿å°æ£è
ä¿¡æ¯ |
| | | IvrTaskSingle ivrTaskcall = new IvrTaskSingle(); |
| | | ivrTaskcall.setTaskid(ivrTaskcallMQ.getTaskid()); |
| | | List<IvrTaskSingle> ivrTaskcalls = ivrTaskcallMapper.selectIvrTaskcallList(ivrTaskcall); |
| | | |
| | | for (IvrTaskSingle ivrTaskcall1 : ivrTaskcalls) { |
| | | IvrTask ivrTask = ivrTaskMapper.selectIvrTaskByTaskid(ivrTaskcall1.getTaskid()); |
| | | if (StringUtils.isNotEmpty(ivrTask.getSendState()) && ivrTask.getSendState().equals(3) || StringUtils.isNotEmpty(ivrTask.getSendState()) && ivrTask.getSendState().equals(4)) { |
| | | if (ivrTask.getSendState() != null && ivrTask.getSendState() == 3 || ivrTask.getSendState() != null && ivrTask.getSendState() == 4) { |
| | | //å¦ä½ä»»å¡è¢«âæåâæâç»æ¢â |
| | | break; |
| | | } |
| | | //éè¿å¤çº¿ç¨çæ¹å¼å»æçµè¯ |
| | | executorService.submit(new PhoneTask(ivrTaskcall1, ivrTaskTemplateVO1, redisCache, rabbitMqCallPhoneConfig, message, sendService, phonePath, robotPhoneUtils)); |
| | | } |
| | | } else if (descByCode.equals("å
¬ä¼å·")) { |
| | | } else if (descByCode.equals("å¤åªä½")) { |
| | | //å¤åªä½ |
| | | } 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 (IvrTaskSingle ivrTaskSingle : ivrTaskcalls) { |
| | | String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key); |
| | | SendMagParam sendMagParam = new SendMagParam(); |
| | | sendMagParam.setType("4"); |
| | | sendMagParam.setUrl("192.168.2.10:8099/followvisit/particty?param1=" + taskId + "¶m2=" + patid); |
| | | sendService.sendMsg(sendMagParam); |
| | | } |
| | | } else if (descByCode.equals("å
¬ä¼å·")) { |
| | | //å
¬ä¼å· |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | String taskId = rsaPublicKeyExample.encryptedData(ivrTask1.getTaskid().toString(), pub_key); |
| | | for (IvrTaskSingle ivrTaskSingle : ivrTaskcalls) { |
| | | String patid = rsaPublicKeyExample.encryptedData(ivrTaskSingle.getPatid().toString(), pub_key); |
| | | SendMagParam sendMagParam = new SendMagParam(); |
| | | sendMagParam.setType("5"); |
| | | sendMagParam.setUrl(req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName()); |
| | | log.info("龿¥å®æ´è·¯å¾ï¼{}", req_path + "/outsideChain?param1=" + taskId + "¶m2=" + patid + "¶m3=" + ivrTask1.getTaskName()); |
| | | //è¿ä¸ªæ¨¡æ¿IDå
åæ»ï¼åé¢åæå¯é |
| | | sendMagParam.setTmpCode("oG3pJHPVWpE81DmZsua_2tKwgJ97r0qz37z56ns7NB4"); |
| | | Map map = new HashMap(); |
| | | map.put("first", ivrTask1.getTaskName()); |
| | | sendMagParam.setContent(JSON.toJSONString(map)); |
| | | sendService.sendMsg(sendMagParam); |
| | | } |
| | | } |
| | | //éç¥ MQ æ¶æ¯å·²è¢«æ¥æ¶,å¯ä»¥ACK(ä»éåä¸å é¤)äº ï¼è¿ä¸ªéè¦æ ¹æ®ä¸å¡åå»å¤çACKï¼ |
| | | channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | 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.PageUtils; |
| | | import com.smartor.domain.HeTask; |
| | | import com.smartor.domain.HeTaskVO; |
| | | import com.smartor.domain.PatArchiveReq; |
| | | import com.smartor.domain.PatTaskRelevanceVO; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.service.IHeTaskService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | @PostMapping("/getPatientInfo") |
| | | public TableDataInfo getPatientInfo(@RequestBody PatArchiveReq patArchiveReq) { |
| | | PageUtils.startPageByPost(patArchiveReq.getPageNum(), patArchiveReq.getPageSize()); |
| | | return getDataTable(heTaskService.getPatientInfo(patArchiveReq)); |
| | | List<PatTaskRelevance> patientInfo = heTaskService.getPatientInfo(patArchiveReq); |
| | | long count = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | heTaskService.getPatientInfo(patArchiveReq); |
| | | } |
| | | }); |
| | | return getDataTable2(count, patientInfo); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.config.PhoneUtils; |
| | | import com.smartor.config.RabbitMqCallPhoneConfig; |
| | |
| | | @PreAuthorize("@ss.hasPermi('smartor:template:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody IvrLibaTemplate ivrLibaTemplate) { |
| | | startPage(); |
| | | //å页 |
| | | PageUtils.startPageByPost(ivrLibaTemplate.getPageNum(), ivrLibaTemplate.getPageSize()); |
| | | List<IvrLibaTemplate> list = ivrLibaTemplateService.selectIvrLibaTemplateList(ivrLibaTemplate); |
| | | return getDataTable(list); |
| | | } |
| | |
| | | package com.ruoyi.web.controller.smartor; |
| | | |
| | | import com.github.pagehelper.ISelect; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.constant.HttpStatus; |
| | |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.RSAPublicKeyExample; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.IvrTask; |
| | | import com.smartor.domain.IvrTaskScriptQues; |
| | | import com.smartor.domain.IvrTaskVO; |
| | | import com.smartor.domain.IvrTaskSingle; |
| | | import com.smartor.service.IIvrTaskService; |
| | | import com.smartor.service.IIvrTaskSingleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | * @author smartor |
| | | * @date 2023-03-24 |
| | | */ |
| | | @Slf4j |
| | | @Api(description = "é访任å¡") |
| | | @RestController |
| | | @RequestMapping("/smartor/ivrtask") |
| | |
| | | |
| | | @Autowired |
| | | private IIvrTaskSingleService iIvrTaskCallService; |
| | | |
| | | @Value("${pub_key}") |
| | | private String pub_key; |
| | | |
| | | @Value("${pri_key}") |
| | | private String pri_key; |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯é³ä»»å¡å表 |
| | |
| | | PageUtils.startPageByPost(ivrTask.getPageNum(), ivrTask.getPageSize()); |
| | | List<IvrTask> list = ivrTaskService.selectIvrTaskList(ivrTask); |
| | | List<IvrTaskVO> ivrTaskVOS = DtoConversionUtils.sourceToTarget(list, IvrTaskVO.class); |
| | | |
| | | //设置å页 |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("æ¥è¯¢æå"); |
| | | rspData.setRows(null); |
| | | rspData.setTotal(0); |
| | | |
| | | if (CollectionUtils.isNotEmpty(ivrTaskVOS)) { |
| | | for (IvrTaskVO ivrTaskVO : ivrTaskVOS) { |
| | |
| | | ivrTaskVO.setWfs(wfs); |
| | | } |
| | | } |
| | | //è·åtotal |
| | | long total = PageUtils.count(new ISelect() { |
| | | @Override |
| | | public void doSelect() { |
| | | ivrTask.setPageNum(null); |
| | | ivrTask.setPageSize(null); |
| | | ivrTaskService.selectIvrTaskList(ivrTask); |
| | | } |
| | | }); |
| | | |
| | | //ç¨äºå页 |
| | | ivrTask.setPageNum(null); |
| | | ivrTask.setPageSize(null); |
| | | List<IvrTask> ivrTasks = ivrTaskService.selectIvrTaskList(ivrTask); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("æ¥è¯¢æå"); |
| | | rspData.setRows(ivrTaskVOS); |
| | | rspData.setTotal(new PageInfo(ivrTasks).getTotal()); |
| | | return getDataTable2(total, ivrTaskVOS); |
| | | } |
| | | |
| | | return rspData; |
| | | return getDataTable2(0, ivrTaskVOS); |
| | | } |
| | | |
| | | /** |
| | |
| | | return toAjax(ivrTaskService.deleteIvrTaskByTaskid(taskId)); |
| | | } |
| | | |
| | | /** |
| | | * éè¿ä»»å¡ID忣è
IDè·åå个人çé¢ç®ä¿¡æ¯ |
| | | * |
| | | * @return |
| | | */ |
| | | @ApiOperation("éè¿ä»»å¡ID忣è
IDè·åå个人çé¢ç®ä¿¡æ¯") |
| | | @PostMapping("/getScriptInfoByCondition") |
| | | public TableDataInfo getScriptInfoByCondition(@RequestBody IvrTaskScriptQues ivrTaskScriptQues) { |
| | | RSAPublicKeyExample rsaPublicKeyExample = new RSAPublicKeyExample(); |
| | | Long tid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskScriptQues.getParam1(), pri_key)); |
| | | Long pid = Long.valueOf(rsaPublicKeyExample.decryptedData(ivrTaskScriptQues.getParam2(), pri_key)); |
| | | log.info("tidåpidçå¼ä¸ºï¼{},{}", tid, pid); |
| | | return getDataTable(ivrTaskService.getScriptInfoByCondition(tid, pid)); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.PageUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.smartor.domain.IvrTaskSingle; |
| | | import com.smartor.domain.IvrTaskSingleVO; |
| | | import com.smartor.domain.PhoneCallBackVO; |
| | | import com.smartor.domain.SendTaskVO; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.robot.back.RobotAIDialogBack; |
| | | import com.smartor.domain.robot.back.RobotCallBack; |
| | | import com.smartor.service.IIvrTaskSingleService; |
| | |
| | | @PreAuthorize("@ss.hasPermi('system:task:add')") |
| | | @Log(title = "åä¸ä»»å¡ï¼é访ï¼", businessType = BusinessType.INSERT) |
| | | @PostMapping("/insertOrUpdateTask") |
| | | public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { |
| | | public AjaxResult insertOrUpdateHeTask(@RequestBody IvrTaskVO ivrTaskVO) { |
| | | |
| | | LoginUser loginUser = getLoginUser(); |
| | | SysUser user = loginUser.getUser(); |
| | | ivrTaskcallVO.setCreateBy(user.getNickName()); |
| | | return toAjax(ivrTaskcallService.insertOrUpdateTask(ivrTaskcallVO)); |
| | | ivrTaskVO.setCreateBy(user.getNickName()); |
| | | return toAjax(ivrTaskcallService.insertOrUpdateTask(ivrTaskVO)); |
| | | } |
| | | |
| | | /** |
| | |
| | | public AjaxResult queryTaskByCondition(@RequestBody IvrTaskSingleVO ivrTaskcallVO) { |
| | | //æ ¹æ®å
¥åæ¥è¯¢ä¿¡æ¯ |
| | | IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskcallVO, IvrTaskSingle.class); |
| | | IvrTaskSingleVO ivrTaskSingleVO = ivrTaskcallService.queryTaskByCondition(ivrTaskcall); |
| | | return success(ivrTaskSingleVO); |
| | | IvrTaskVO ivrTaskVO = ivrTaskcallService.queryTaskByCondition(ivrTaskcall); |
| | | return success(ivrTaskVO); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @ApiOperation("ä»»å¡çåéæ§è¡ãæåãç»æ¢") |
| | | @PostMapping("/taskSend") |
| | | public AjaxResult heTaskSend(@RequestBody SendTaskVO sendTaskVO) { |
| | | public AjaxResult taskSend(@RequestBody SendTaskVO sendTaskVO) { |
| | | return toAjax(ivrTaskcallService.heTaskSend(sendTaskVO)); |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson2.JSONArray; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.smartor.domain.WeChatSendVo; |
| | | import com.smartor.service.WeChatService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import me.chanjar.weixin.common.exception.WxErrorException; |
| | |
| | | @Value("${appSecret}") |
| | | private String appSecret; |
| | | |
| | | @Autowired |
| | | private WeChatService weChatService; |
| | | |
| | | |
| | | /** |
| | | * è·å模æ¿ä¿¡æ¯ |
| | |
| | | */ |
| | | @ApiOperation("微信å
¬ä¼å·ä¿¡æ¯åé") |
| | | @PostMapping("/sendMessageToFollowers") |
| | | public Boolean sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo) { |
| | | WxMpService wxMpService; |
| | | wxMpService = new WxMpServiceImpl(); |
| | | wxMpService.setWxMpConfigStorage(new WxMpInMemoryConfigStorage()); |
| | | WxMpInMemoryConfigStorage wxMpConfigStorage = (WxMpInMemoryConfigStorage) wxMpService.getWxMpConfigStorage(); |
| | | wxMpConfigStorage.setAppId(appid); |
| | | wxMpConfigStorage.setSecret(appSecret); |
| | | try { |
| | | List<String> openIdList = wxMpService.getUserService().userList(null).getOpenids(); |
| | | for (String openId : openIdList) { |
| | | WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(openId).templateId(weChatSendVo.getTemplateId()).url(weChatSendVo.getUrl()).build(); |
| | | for (String key : weChatSendVo.getContent().keySet()) { |
| | | templateMessage.addData(new WxMpTemplateData(key, weChatSendVo.getContent().get(key).toString())); |
| | | } |
| | | wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage); |
| | | } |
| | | } catch (WxErrorException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return true; |
| | | public AjaxResult sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo) { |
| | | return toAjax(weChatService.sendMessageToFollowers(weChatSendVo)); |
| | | } |
| | | |
| | | |
| | |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import javax.crypto.BadPaddingException; |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.IllegalBlockSizeException; |
| | | import javax.crypto.NoSuchPaddingException; |
| | | import java.security.*; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.util.Base64; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | |
| | |
| | | |
| | | @Test |
| | | public void testSend() { |
| | | String str = "absdf"; |
| | | String c = Character.toUpperCase(str.charAt(0)) + str.substring(1); |
| | | System.out.println(c); |
| | | try { |
| | | |
| | | // çæRSAå¯é¥å¯¹ |
| | | KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA"); |
| | | keyPairGenerator.initialize(2048); |
| | | KeyPair keyPair = keyPairGenerator.generateKeyPair(); |
| | | |
| | | // è·åå
¬é¥åç§é¥ |
| | | PublicKey publicKey = keyPair.getPublic(); |
| | | PrivateKey privateKey = keyPair.getPrivate(); |
| | | String publicKeyString = Base64.getEncoder().encodeToString(privateKey.getEncoded()); |
| | | System.out.println(publicKeyString); |
| | | // ææ |
| | | String plainText = "Hello, World!"; |
| | | |
| | | // å å¯ |
| | | Cipher encryptCipher = Cipher.getInstance("RSA"); |
| | | encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | byte[] encryptedBytes = encryptCipher.doFinal(plainText.getBytes()); |
| | | |
| | | // å°å å¯åçæ°æ®è½¬æ¢ä¸ºBase64ç¼ç çå符串 |
| | | String encryptedText = Base64.getEncoder().encodeToString(encryptedBytes); |
| | | System.out.println("å å¯åçæ°æ®ï¼" + encryptedText); |
| | | |
| | | // è§£å¯ |
| | | Cipher decryptCipher = Cipher.getInstance("RSA"); |
| | | decryptCipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | byte[] decryptedBytes = decryptCipher.doFinal(Base64.getDecoder().decode(encryptedBytes)); |
| | | |
| | | // ææ |
| | | String decryptedText = new String(decryptedBytes); |
| | | System.out.println("è§£å¯åçæ°æ®ï¼" + decryptedText); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | |
| | | // String str = "absdf"; |
| | | // String c = Character.toUpperCase(str.charAt(0)) + str.substring(1); |
| | | // System.out.println(c); |
| | | "æ¨å¥½ï¼ææ¯æµäºå»é¢å¼ å»çï¼æ¨æ¯${name}åï¼è¿æ¯å®¶å±?".replaceAll("$$*variable", "AA"); |
| | | // Pattern pattern = Pattern.compile("^(?!.*(好|太好)).*$"); |
| | | // Matcher matcher = pattern.matcher("ç¡ç ä¸å¥½"); |
| | |
| | | // |
| | | // executorService.submit(new PhoneTask()); |
| | | } |
| | | |
| | | @Test |
| | | public void testSend22() { |
| | | try { |
| | | byte[] privateKeyBytes = Base64.getDecoder().decode(""); |
| | | PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PrivateKey privateKey = keyFactory.generatePrivate(keySpec); |
| | | |
| | | // 使ç¨ç§é¥è§£å¯æ°æ® |
| | | Cipher decryptCipher = Cipher.getInstance("RSA"); |
| | | decryptCipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | byte[] decryptedBytes = decryptCipher.doFinal(Base64.getDecoder().decode("")); |
| | | |
| | | // è§£å¯åçæ°æ® |
| | | String decryptedData = new String(decryptedBytes); |
| | | System.out.println("è§£å¯åçæ°æ®ï¼" + decryptedData); |
| | | } catch (Exception e) { |
| | | } |
| | | } |
| | | } |
| | |
| | | spring: |
| | | rabbitmq: |
| | | host: 116.62.18.175 |
| | | # host: 127.0.0.1 |
| | | # host: 192.168.2.8 |
| | | password: guest |
| | | port: 5672 |
| | | username: guest |
| | |
| | | app_id: hz_ali |
| | | #ææ key(å·²å å¯è¿ç key)(æå·) |
| | | app_key: a2f3b5799d635216aa280362fafd8c35 |
| | | |
| | | |
| | | pub_key: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBALQzqW1EIXBKGMu+2oEYSB5gM7Ox/ihyYTeeoE0yPX1qtt4++5yNOeTBVd6EEM4iKzVEzWj6REIWVwaSNPn/SvUCAwEAAQ== |
| | | #è¿ä¸ªæ¯å端çç§é¥ï¼ç¨ä¸å° |
| | | #pri_key_me: MIIBUwIBADANBgkqhkiG9w0BAQEFAASCAT0wggE5AgEAAkEAtDOpbUQhcEoYy77agRhIHmAzs7H+KHJhN56gTTI9fWq23j77nI055MFV3oQQziIrNUTNaPpEQhZXBpI0+f9K9QIDAQABAkB3n0fcWfrcoMN/FU3VnrnZOEF6CzFNxkgU9P8y36QECWKZ9JhYQkNpKrMC9oXlN3VSaRigV7B+L/I/a0Rs1W+tAiEA4jx7xcXJ4y4BNwAmVHt6NNiEkzIwWnwC/0qsEu8NsOsCIQDL6MMn1D2uznC6OuOWpxDCkBh1JL1NzZTZeH2G+hj7nwIgKGAC9tjFnvWm4dn0/T7MIIJDpsFeP8fCAS2iZ/6hwuECIAS/eLvWr1EAsZNEh8QcQ8GkBU3E+ztyjAK8UX/xFt/VAiBf79/1tDErX4/DChecM8w3c3DhbBcjuE3fHZn7p6/UKg== |
| | | pri_key: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEApHTIe/StslZAT5Jzv8XClbrqox32pfaTrP5IOCRJ3FaH/UZsGgA/tsNBBEXq9eagqwPbJrjYfpdEtINcChrK4wIDAQABAkEAilDujdKshGGmlUZHs/NQRT6AOdDpsYxBiC4V76IVvQpw0IW6c4HGEvH4T+xRufika7/48L0eu0f06H+YtL5lgQIhANUd0a6oSsVxWifAjtKwMZcXD3OaIxQIQSCN4NT4VFY3AiEAxYxYrIhkIyg+UVw3WOSvBpXKxM4/WL9HRzkxDLvp2rUCIQCK23P8tgCJ5xJT5l3onw6goFDcBKkoazxsBqVgfjENPwIgWbuTd+OIYPPhwsE5ntZZrosSDO2GlsBkFzUiU59z7VUCIA0LL+9IFb+FWCl3DGTwIQ9SZYbv61T83LKjebUcSOfe |
| | | |
| | | #请æ±IPå端å£å· |
| | | req_path: 192.168.2.10:8099 |
| | |
| | | mapperLocations: classpath*:mapper/**/*Mapper.xml |
| | | # å è½½å
¨å±çé
ç½®æä»¶ |
| | | configLocation: classpath:mybatis/mybatis-config.xml |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | |
| | | # PageHelperå页æä»¶ |
| | | pagehelper: |
| | |
| | | import java.beans.PropertyEditorSupport; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.web.bind.WebDataBinder; |
| | |
| | | |
| | | /** |
| | | * webå±éç¨æ°æ®å¤ç |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public class BaseController |
| | | { |
| | | public class BaseController { |
| | | protected final Logger logger = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | /** |
| | | * å°åå°ä¼ éè¿æ¥çæ¥ææ ¼å¼çå符串ï¼èªå¨è½¬å为Dateç±»å |
| | | */ |
| | | @InitBinder |
| | | public void initBinder(WebDataBinder binder) |
| | | { |
| | | public void initBinder(WebDataBinder binder) { |
| | | // Date ç±»åè½¬æ¢ |
| | | binder.registerCustomEditor(Date.class, new PropertyEditorSupport() |
| | | { |
| | | binder.registerCustomEditor(Date.class, new PropertyEditorSupport() { |
| | | @Override |
| | | public void setAsText(String text) |
| | | { |
| | | public void setAsText(String text) { |
| | | setValue(DateUtils.parseDate(text)); |
| | | } |
| | | }); |
| | |
| | | /** |
| | | * 设置请æ±åé¡µæ°æ® |
| | | */ |
| | | protected void startPage() |
| | | { |
| | | protected void startPage() { |
| | | PageUtils.startPage(); |
| | | } |
| | | |
| | | /** |
| | | * è®¾ç½®è¯·æ±æåºæ°æ® |
| | | */ |
| | | protected void startOrderBy() |
| | | { |
| | | protected void startOrderBy() { |
| | | PageDomain pageDomain = TableSupport.buildPageRequest(); |
| | | if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) |
| | | { |
| | | if (StringUtils.isNotEmpty(pageDomain.getOrderBy())) { |
| | | String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); |
| | | PageHelper.orderBy(orderBy); |
| | | } |
| | |
| | | /** |
| | | * æ¸
çå页ç线ç¨åé |
| | | */ |
| | | protected void clearPage() |
| | | { |
| | | protected void clearPage() { |
| | | PageUtils.clearPage(); |
| | | } |
| | | |
| | | /** |
| | | * ååºè¯·æ±åé¡µæ°æ® |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable(List<?> list) |
| | | { |
| | | @SuppressWarnings({"rawtypes", "unchecked"}) |
| | | protected TableDataInfo getDataTable(List<?> list) { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("æ¥è¯¢æå"); |
| | |
| | | /** |
| | | * ååºè¯·æ±åé¡µæ°æ® |
| | | */ |
| | | @SuppressWarnings({ "rawtypes", "unchecked" }) |
| | | protected TableDataInfo getDataTable2(List<?> list,List<?> list2) |
| | | { |
| | | @SuppressWarnings({"rawtypes", "unchecked"}) |
| | | protected TableDataInfo getDataTable2(long total, List<?> list) { |
| | | TableDataInfo rspData = new TableDataInfo(); |
| | | rspData.setCode(HttpStatus.SUCCESS); |
| | | rspData.setMsg("æ¥è¯¢æå"); |
| | | rspData.setRows(list2); |
| | | rspData.setTotal(new PageInfo(list).getTotal()); |
| | | rspData.setRows(list); |
| | | rspData.setTotal(total); |
| | | return rspData; |
| | | } |
| | | |
| | | /** |
| | | * è¿åæå |
| | | */ |
| | | public AjaxResult success() |
| | | { |
| | | public AjaxResult success() { |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * è¿åå¤±è´¥æ¶æ¯ |
| | | */ |
| | | public AjaxResult error() |
| | | { |
| | | public AjaxResult error() { |
| | | return AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | */ |
| | | public AjaxResult success(String message) |
| | | { |
| | | public AjaxResult success(String message) { |
| | | return AjaxResult.success(message); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * è¿åæåæ¶æ¯ |
| | | */ |
| | | public AjaxResult success(Object data) |
| | | { |
| | | public AjaxResult success(Object data) { |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | /** |
| | | * è¿åå¤±è´¥æ¶æ¯ |
| | | */ |
| | | public AjaxResult error(String message) |
| | | { |
| | | public AjaxResult error(String message) { |
| | | return AjaxResult.error(message); |
| | | } |
| | | |
| | | /** |
| | | * è¿åè¦åæ¶æ¯ |
| | | */ |
| | | public AjaxResult warn(String message) |
| | | { |
| | | public AjaxResult warn(String message) { |
| | | return AjaxResult.warn(message); |
| | | } |
| | | |
| | | /** |
| | | * ååºè¿åç»æ |
| | | * |
| | | * |
| | | * @param rows å½±åè¡æ° |
| | | * @return æä½ç»æ |
| | | */ |
| | | protected AjaxResult toAjax(int rows) |
| | | { |
| | | protected AjaxResult toAjax(int rows) { |
| | | return rows > 0 ? AjaxResult.success() : AjaxResult.error(); |
| | | } |
| | | |
| | | /** |
| | | * ååºè¿åç»æ |
| | | * |
| | | * |
| | | * @param result ç»æ |
| | | * @return æä½ç»æ |
| | | */ |
| | | protected AjaxResult toAjax(boolean result) |
| | | { |
| | | protected AjaxResult toAjax(boolean result) { |
| | | return result ? success() : error(); |
| | | } |
| | | |
| | | /** |
| | | * 页é¢è·³è½¬ |
| | | */ |
| | | public String redirect(String url) |
| | | { |
| | | public String redirect(String url) { |
| | | return StringUtils.format("redirect:{}", url); |
| | | } |
| | | |
| | | /** |
| | | * è·åç¨æ·ç¼åä¿¡æ¯ |
| | | */ |
| | | public LoginUser getLoginUser() |
| | | { |
| | | public LoginUser getLoginUser() { |
| | | return SecurityUtils.getLoginUser(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»å½ç¨æ·id |
| | | */ |
| | | public Long getUserId() |
| | | { |
| | | public Long getUserId() { |
| | | return getLoginUser().getUserId(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»å½é¨é¨id |
| | | */ |
| | | public Long getDeptId() |
| | | { |
| | | public Long getDeptId() { |
| | | return getLoginUser().getDeptId(); |
| | | } |
| | | |
| | | /** |
| | | * è·åç»å½ç¨æ·å |
| | | */ |
| | | public String getUsername() |
| | | { |
| | | public String getUsername() { |
| | | return getLoginUser().getUsername(); |
| | | } |
| | | } |
| | |
| | | ZZ(2, "纸质"), |
| | | DH(3, "çµè¯"), |
| | | DX(4, "çä¿¡"), |
| | | GZH(5, "微信å
¬ä¼å·"), |
| | | GZH(5, "å
¬ä¼å·"), |
| | | WXXCH(6, "微信å°ç¨åº"), |
| | | ZFB(7, "æ¯ä»å®"), |
| | | ZNXCH(8, "æºè½å°ç¨åº"), |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import java.security.KeyFactory; |
| | | import java.security.PrivateKey; |
| | | import java.security.PublicKey; |
| | | import java.security.spec.PKCS8EncodedKeySpec; |
| | | import java.security.spec.X509EncodedKeySpec; |
| | | import java.util.Base64; |
| | | |
| | | @Slf4j |
| | | @Component |
| | | public class RSAPublicKeyExample { |
| | | |
| | | |
| | | /** |
| | | * æ°æ®è§£å¯ |
| | | * |
| | | * @param encryptedData |
| | | * @return |
| | | */ |
| | | public String decryptedData(String encryptedData, String pri_key) { |
| | | String privateKeyString = "ç§é¥çBase64ç¼ç å符串"; // å端ç§é¥çBase64ç¼ç å符串 |
| | | |
| | | try { |
| | | // å°ç§é¥Base64ç¼ç å符串转æ¢ä¸ºPrivateKey对象 |
| | | byte[] privateKeyBytes = Base64.getDecoder().decode(pri_key); |
| | | PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(privateKeyBytes); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PrivateKey privateKey = keyFactory.generatePrivate(keySpec); |
| | | |
| | | // 使ç¨ç§é¥è§£å¯æ°æ® |
| | | Cipher decryptCipher = Cipher.getInstance("RSA"); |
| | | decryptCipher.init(Cipher.DECRYPT_MODE, privateKey); |
| | | byte[] decryptedBytes = decryptCipher.doFinal(Base64.getDecoder().decode(encryptedData)); |
| | | |
| | | // è§£å¯åçæ°æ® |
| | | String decryptedData = new String(decryptedBytes); |
| | | System.out.println("è§£å¯åçæ°æ®ï¼" + decryptedData); |
| | | return decryptedData; |
| | | } catch (Exception e) { |
| | | log.error("è§£å¯æ¥éäº:{}", e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * è¦å å¯çæææ°æ® |
| | | * |
| | | * @param plainText |
| | | * @return |
| | | */ |
| | | public String encryptedData(String plainText, String pub_key) { |
| | | String publicKeyString = "å
¬é¥çBase64ç¼ç å符串"; // åç«¯ä¼ éçå
¬é¥å符串 |
| | | // å°å
¬é¥Base64ç¼ç å符串转æ¢ä¸ºPublicKey对象 |
| | | try { |
| | | |
| | | byte[] publicKeyBytes = Base64.getDecoder().decode(pub_key); |
| | | X509EncodedKeySpec keySpec = new X509EncodedKeySpec(publicKeyBytes); |
| | | KeyFactory keyFactory = KeyFactory.getInstance("RSA"); |
| | | PublicKey publicKey = keyFactory.generatePublic(keySpec); |
| | | |
| | | // 使ç¨å
¬é¥å 坿°æ® |
| | | Cipher encryptCipher = Cipher.getInstance("RSA"); |
| | | encryptCipher.init(Cipher.ENCRYPT_MODE, publicKey); |
| | | byte[] encryptedBytes = encryptCipher.doFinal(plainText.getBytes()); |
| | | |
| | | // å°å å¯åçæ°æ®è½¬æ¢ä¸ºBase64ç¼ç çå符串 |
| | | String encryptedText = Base64.getEncoder().encodeToString(encryptedBytes); |
| | | System.out.println("å å¯åçæ°æ®ï¼" + encryptedText); |
| | | return encryptedText; |
| | | } catch (Exception e) { |
| | | log.error("å å¯å¤±è´¥äº:{}", e.getMessage()); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | // è¿æ»¤è¯·æ± |
| | | .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/tasksingle/phoneCallBack","/smartor/robot/callstatus","/smartor/robot/aidialog","/smartor/robot/cdrinfo","/getToken").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/tasksingle/phoneCallBack","/smartor/robot/callstatus","/smartor/robot/aidialog","/smartor/robot/cdrinfo","/getToken","/smartor/ivrtask/getScriptInfoByCondition").permitAll() |
| | | // éæèµæºï¼å¯å¿åè®¿é® |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() |
| | | // é¤ä¸é¢å¤çææè¯·æ±å
¨é¨éè¦é´æè®¤è¯ |
| | |
| | | package com.smartor.common; |
| | | |
| | | import com.aliyun.dysmsapi20170525.models.SendSmsResponseBody; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.PatWildcardMapper; |
| | | import com.smartor.service.DingTalkService; |
| | | import com.smartor.service.WeChatService; |
| | | import com.smartor.service.impl.BaseSmsaccountServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * åéæå¡å·¥å
·ç±» |
| | |
| | | @Autowired |
| | | private PatWildcardMapper patWildcardMapper; |
| | | |
| | | @Autowired |
| | | private WeChatService weChatService; |
| | | |
| | | public Boolean sendMsg(SendMagParam sendMagParam) { |
| | | // 1,å¤åªä½ 2,纸质 3,çµè¯ 4,çä¿¡ 5.微信å
¬ä¼å· 6.微信å°ç¨åº 7.æ¯ä»å® 8.æºè½å°ç¨åº 9.éé |
| | | switch (sendMagParam.getType()) { |
| | | case ("å¤åªä½"): |
| | | case ("1"): |
| | | |
| | | case ("纸质"): |
| | | case ("2"): |
| | | |
| | | case ("çµè¯"): |
| | | case ("3"): |
| | | |
| | | case ("çä¿¡"): |
| | | case ("4"): |
| | | BaseSmsRequest baseSmsRequest = new BaseSmsRequest(); |
| | | baseSmsRequest.setPhoneNumber(sendMagParam.getPhone()); |
| | | baseSmsRequest.setTemplateCode("SMS_461860582"); |
| | | |
| | | SendSmsResponseBody sendSmsResponseBody = baseSmsaccountService.sendMsg(baseSmsRequest); |
| | | if (sendSmsResponseBody.getCode().equals("OK")) { |
| | | return true; |
| | | } |
| | | return false; |
| | | case ("微信å
¬ä¼å·"): |
| | | case ("5"): |
| | | WeChatSendVo weChatSendVo = new WeChatSendVo(); |
| | | weChatSendVo.setUrl(sendMagParam.getUrl()); |
| | | weChatSendVo.setTemplateId(sendMagParam.getTmpCode()); |
| | | ObjectMapper objectMapper=new ObjectMapper(); |
| | | Map map = null; |
| | | try { |
| | | map = objectMapper.readValue(sendMagParam.getContent(), Map.class); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | weChatSendVo.setContent(map); |
| | | Boolean aBoolean1 = weChatService.sendMessageToFollowers(weChatSendVo); |
| | | return aBoolean1; |
| | | case ("6"): |
| | | |
| | | case ("微信å°ç¨åº"): |
| | | case ("7"): |
| | | |
| | | case ("æ¯ä»å®"): |
| | | case ("8"): |
| | | |
| | | case ("æºè½å°ç¨åº"): |
| | | |
| | | case ("éé"): |
| | | case ("9"): |
| | | DingTalkReqVo dingTalkReqVo = new DingTalkReqVo(); |
| | | Boolean aBoolean = dingTalkService.sendNotification(dingTalkReqVo); |
| | | if (aBoolean) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | //package com.smartor.config; |
| | | // |
| | | //import lombok.extern.slf4j.Slf4j; |
| | | //import org.springframework.amqp.core.Message; |
| | | //import org.springframework.amqp.rabbit.connection.CorrelationData; |
| | | //import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.stereotype.Component; |
| | | // |
| | | //import javax.annotation.PostConstruct; |
| | | // |
| | | //@Slf4j |
| | | //@Component |
| | | //public class RabbitMQAckConfig implements RabbitTemplate.ConfirmCallback,RabbitTemplate.ReturnCallback { |
| | | // |
| | | // |
| | | // @Autowired |
| | | // private RabbitTemplate rabbitTemplate; |
| | | // |
| | | // @PostConstruct |
| | | // public void init(){ |
| | | // rabbitTemplate.setConfirmCallback(this); |
| | | // rabbitTemplate.setReturnCallback(this); |
| | | // } |
| | | // |
| | | // |
| | | // //夿æ¯å¦å°è¾¾äº¤æ¢æº |
| | | // @Override |
| | | // public void confirm(CorrelationData correlationData, boolean ack, String cause) { |
| | | // if (ack){ |
| | | // log.info("æ¶æ¯å°äºäº¤æ¢æº"); |
| | | // System.out.println("æ¶æ¯å°äºäº¤æ¢æº -------------"); |
| | | // }else { |
| | | // log.info("æ¶æ¯æ²¡æå°è¾¾äº¤æ¢æº"); |
| | | // System.out.println("æ¶æ¯æ²¡æå°äº¤æ¢æº----------------- "); |
| | | // } |
| | | // } |
| | | // |
| | | // //夿æ¯å¦å°è¾¾éå |
| | | // @Override |
| | | // public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) { |
| | | // System.out.println("messageæ¶æ¯ = " + new String(message.getBody())); |
| | | // System.out.println("replyCodeåºçç = " + replyCode); |
| | | // System.out.println("replyTextæè¿° = " + replyText); |
| | | // System.out.println("exchangeäº¤æ¢æº = " + exchange); |
| | | // System.out.println("routingKeyè·¯ç±key = " + routingKey); |
| | | // } |
| | | //} |
| | |
| | | package com.smartor.config; |
| | | |
| | | import org.springframework.amqp.AmqpException; |
| | | import org.springframework.amqp.core.*; |
| | | import org.springframework.amqp.rabbit.connection.CorrelationData; |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | @Component |
| | | public class RabbitMqCallPhoneConfig { |
| | |
| | | private AmqpAdmin amqpAdmin; |
| | | |
| | | @Autowired |
| | | private AmqpTemplate rabbitTemplate; |
| | | private RabbitTemplate rabbitTemplate; |
| | | |
| | | /** |
| | | * åå»ºäº¤æ¢æº |
| | |
| | | * @param data æ¶æ¯ |
| | | */ |
| | | public void sendMessage(String changeName, String routingKey, String data, Long times) { |
| | | |
| | | this.rabbitTemplate.convertAndSend(changeName, routingKey, data, message -> { |
| | | //注æè¿éæ¶é´å¯ä»¥ä½¿longï¼è䏿¯è®¾ç½®header |
| | | message.getMessageProperties().setHeader("x-delay", times); |
| | |
| | | @ApiModelProperty(value = "é访åè¯æ¯ï¼ç»æè¯ï¼") |
| | | private String revisitAfter; |
| | | |
| | | /** |
| | | * pageNum |
| | | */ |
| | | @ApiModelProperty(value = "pageNum") |
| | | @Excel(name = "pageNum") |
| | | private Integer pageNum; |
| | | |
| | | /** |
| | | * pageSize |
| | | */ |
| | | @ApiModelProperty(value = "pageSize") |
| | | @Excel(name = "pageSize") |
| | | private Integer pageSize; |
| | | |
| | | |
| | | } |
| | |
| | | private String preachform; |
| | | |
| | | /** |
| | | * æ¯å¦åé ï¼ 0 æååé 1 宿¶åé 2 ç«å³åé |
| | | * åéç±»å: 1æå®æ¶é´åé 2å³å»åé |
| | | */ |
| | | @Excel(name = " æ¯å¦åé ï¼ 0 æååé 1 宿¶åé 2 ç«å³åé ") |
| | | @ApiModelProperty(value = "æ¯å¦åé ï¼ 0 æååé 1 宿¶åé 2 ç«å³åé ") |
| | | private Integer sendType; |
| | | @Excel(name = " åéç±»å: 1æå®æ¶é´åé 2å³å»åé ") |
| | | @ApiModelProperty(value = "åéç±»å: 1æå®æ¶é´åé 2å³å»åé ") |
| | | private Long sendType; |
| | | |
| | | /** |
| | | * åéç¶æï¼ 0 失败 1æå |
| | | */ |
| | | @Excel(name = " åéç¶æï¼ 1å建 2æ§è¡ä¸ 3 æå 4ç»æ¢ 5宿 ") |
| | | @ApiModelProperty(value = "åéç¶æï¼ 1å建 2æ§è¡ä¸ 3 æå 4ç»æ¢ 5宿 ") |
| | | private String sendState; |
| | | private Integer sendState; |
| | | |
| | | // /** |
| | | // * ææ¬åéåæ° |
| | |
| | | @ApiModelProperty(value = "å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ 3.ä¸ç
ï¼") |
| | | private String hospType; |
| | | |
| | | // /** |
| | | // * å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼ |
| | | // */ |
| | | // @Excel(name = " å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼ ") |
| | | // @ApiModelProperty(value = "å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼") |
| | | // private String hospno; |
| | | |
| | | /** |
| | | * ä»»å¡æè¿° |
| | | */ |
| | |
| | | @Excel(name = "æåç¶æ ï¼ ç¶æå¦æåçä¿®æ¹ï¼å¼å°±å 1") |
| | | @ApiModelProperty(value = "æåç¶æ ï¼ ç¶æå¦æåçä¿®æ¹ï¼å¼å°±å 1") |
| | | private Long stopState = 0L; |
| | | |
| | | /** |
| | | * ææ¬åéåæ° |
| | | */ |
| | | @Excel(name = "ææ¬åéåæ°") |
| | | @ApiModelProperty(value = "ææ¬åéåæ°") |
| | | private String textParam; |
| | | |
| | | @ApiModelProperty(value = "ä¸åæ¶é´") |
| | | private String showTimeMorn; |
| | | |
| | | @ApiModelProperty(value = "ä¸åæ¶é´") |
| | | private String showTimeNoon; |
| | | |
| | | @ApiModelProperty(value = "æåæ¶é´") |
| | | private String showTimeNight; |
| | | |
| | | @ApiModelProperty(value = "å±ç¤ºæ¥æ") |
| | | private String showDate; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.domain; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | 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; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * è¯é³ä»»å¡å¯¹è±¡ ivr_task |
| | | * |
| | | * @author smartor |
| | | * @date 2023-03-24 |
| | | */ |
| | | @ApiModel(value = "IvrTaskScriptQues", description = "ä»»å¡å¯¹è±¡") |
| | | @Data |
| | | public class IvrTaskScriptQues { |
| | | |
| | | /** |
| | | * taskid |
| | | */ |
| | | @ApiModelProperty(value = "taskid") |
| | | private String param1; |
| | | |
| | | /** |
| | | * patid |
| | | */ |
| | | @Excel(name = "patid ") |
| | | @ApiModelProperty(value = "patid") |
| | | private String param2; |
| | | |
| | | } |
| | |
| | | */ |
| | | @Excel(name = " æ§å«") |
| | | @ApiModelProperty(value = "æ§å«") |
| | | private String sex; |
| | | private Long sex; |
| | | |
| | | /** |
| | | * å¹´é¾ |
| | |
| | | @Excel(name = "ä»»å¡ç±»å(0éç¥ã1宣æã2é¨è¯ã3åºé¢ã4å¤è¯ã5使£ã6é®å·ã7廿â¦â¦)") |
| | | @ApiModelProperty(value = "ä»»å¡ç±»å(0éç¥ã1宣æã2é¨è¯ã3åºé¢ã4å¤è¯ã5使£ã6é®å·ã7廿â¦â¦)") |
| | | private String type; |
| | | |
| | | |
| | | /** |
| | | * 模æ¿ID |
| | |
| | | private String diagname; |
| | | |
| | | /** |
| | | * æ£è
ID |
| | | */ |
| | | @Excel(name = " æ£è
ID") |
| | | @ApiModelProperty(value = "æ£è
ID") |
| | | private Long patid; |
| | | |
| | | /** |
| | | * ç§å®¤åç§° |
| | | */ |
| | | @Excel(name = "ç§å®¤åç§°") |
| | |
| | | @ApiModelProperty(value = "宣æå½¢å¼ : 1,ææ¬ã2,å¾çã3,è¯é³ã4,è§é¢ã5,æ··å") |
| | | private String serviceform; |
| | | |
| | | /** |
| | | * æ£è
ä¸åä¸ä»»å¡å
³è表éå |
| | | */ |
| | | @Excel(name = " 宣æ£è
ä¸åä¸ä»»å¡å
³è表éå") |
| | | @ApiModelProperty(value = "æ£è
ä¸åä¸ä»»å¡å
³è表éå") |
| | | private List<PatTaskRelevance> patTaskRelevances; |
| | | |
| | | // /** |
| | | // * åºå· |
| | | // */ |
| | | // @Excel(name = "åºå·") |
| | | // @ApiModelProperty(value = "åºå·") |
| | | // private Long bedNo; |
| | | /** |
| | | * åºå· |
| | | */ |
| | | @Excel(name = "åºå·") |
| | | @ApiModelProperty(value = "åºå·") |
| | | private Long bedNo; |
| | | |
| | | /** |
| | | * æ£è
ID |
| | | */ |
| | | @Excel(name = " æ£è
ID") |
| | | @ApiModelProperty(value = "æ£è
ID") |
| | | private Long patid; |
| | | // |
| | | // /** |
| | | // * ç¾ç
åç§° |
| | |
| | | @ApiModelProperty(value = "ä»»å¡æè¿°") |
| | | private String taskDesc; |
| | | |
| | | // |
| | | // /** |
| | | // * é访人 |
| | | // */ |
| | | // @Excel(name = " é访人 ") |
| | | // @ApiModelProperty(value = "é访人") |
| | | // private String operator; |
| | | // |
| | | // /** |
| | | // * é访人 |
| | | // */ |
| | | // @Excel(name = " é访人ç¼å· ") |
| | | // @ApiModelProperty(value = "é访人ç¼å·") |
| | | // private String operatorNo; |
| | | // |
| | | // |
| | | // /** |
| | | // * å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼ |
| | | // */ |
| | | // @Excel(name = " å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼ ") |
| | | // @ApiModelProperty(value = "å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼") |
| | | // private String hospno; |
| | | // |
| | | // /** |
| | | // * å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ï¼ |
| | | // */ |
| | | // @Excel(name = " å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ 3.ä¸ç
ï¼") |
| | | // @ApiModelProperty(value = "å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ 3.ä¸ç
ï¼") |
| | | // private String hospType; |
| | | |
| | | /** |
| | | * é访人 |
| | | */ |
| | | @Excel(name = " é访人 ") |
| | | @ApiModelProperty(value = "é访人") |
| | | private String operator; |
| | | |
| | | /** |
| | | * é访人 |
| | | */ |
| | | @Excel(name = " é访人ç¼å· ") |
| | | @ApiModelProperty(value = "é访人ç¼å·") |
| | | private String operatorNo; |
| | | |
| | | |
| | | /** |
| | | * å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼ |
| | | */ |
| | | @Excel(name = " å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼ ") |
| | | @ApiModelProperty(value = "å°±è¯ç¼å·ï¼å¯¹åºçouthospnoãinhospnoï¼") |
| | | private String hospno; |
| | | |
| | | /** |
| | | * å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ï¼ |
| | | */ |
| | | @Excel(name = " å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ 3.ä¸ç
ï¼") |
| | | @ApiModelProperty(value = "å°±è¯ç±»åï¼1é¨è¯ 2åºé¢ 3.ä¸ç
ï¼") |
| | | private String hospType; |
| | | // |
| | | // /** |
| | | // * 微信 |
| | |
| | | // private String wechat; |
| | | // |
| | | // |
| | | // /** |
| | | // * è¯æåç§° |
| | | // */ |
| | | // @Excel(name = " è¯æåç§°") |
| | | // @ApiModelProperty(value = "è¯æåç§°") |
| | | // private String diagname; |
| | | /** |
| | | * è¯æåç§° |
| | | */ |
| | | @Excel(name = " è¯æåç§°") |
| | | @ApiModelProperty(value = "è¯æåç§°") |
| | | private String diagname; |
| | | // |
| | | // /** |
| | | // * ç§å®¤åç§° |
| | |
| | | // @ApiModelProperty(value = "å°±è¯æ¥æ") |
| | | // private Date admindate; |
| | | // |
| | | // /** |
| | | // * ç
æ¿å· |
| | | // */ |
| | | // @Excel(name = " ç
æ¿å·") |
| | | // @ApiModelProperty(value = "ç
æ¿å·") |
| | | // private String roomno; |
| | | /** |
| | | * ç
æ¿å· |
| | | */ |
| | | @Excel(name = " ç
æ¿å·") |
| | | @ApiModelProperty(value = "ç
æ¿å·") |
| | | private String roomno; |
| | | } |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * è¯é³ä»»å¡å¯¹è±¡ ivr_task |
| | |
| | | */ |
| | | @Excel(name = " ") |
| | | private Long fail; |
| | | |
| | | /** |
| | | * ä»»å¡å½¢å¼ 1,å¤åªä½ 2,纸质 3,çµè¯ 4,çä¿¡ 5.微信å
¬ä¼å· 6.微信å°ç¨åº 7.æ¯ä»å® 8.æºè½å°ç¨åº 9.éé |
| | | */ |
| | | @Excel(name = " ä»»å¡å½¢å¼ 1,å¤åªä½ 2,纸质 3,çµè¯ 4,çä¿¡ 5.微信å
¬ä¼å· 6.微信å°ç¨åº 7.æ¯ä»å® 8.æºè½å°ç¨åº 9.éé ") |
| | | @ApiModelProperty(value = " ä»»å¡å½¢å¼ 1,å¤åªä½ 2,纸质 3,çµè¯ 4,çä¿¡ 5.微信å
¬ä¼å· 6.微信å°ç¨åº 7.æ¯ä»å® 8.æºè½å°ç¨åº 9.éé ") |
| | | private String preachform; |
| | | |
| | | |
| | | /** |
| | | * |
| | |
| | | */ |
| | | @Excel(name = " åéç¶æï¼ 1å建 2æ§è¡ä¸ 3 æå 4ç»æ¢ 5宿 ") |
| | | @ApiModelProperty(value = "åéç¶æï¼ 1å建 2æ§è¡ä¸ 3 æå 4ç»æ¢ 5宿 ") |
| | | private String sendState; |
| | | private Integer sendState; |
| | | |
| | | |
| | | /** |
| | | * æ£è
ä¸åä¸ä»»å¡å
³è表éå |
| | | */ |
| | | @Excel(name = " 宣æ£è
ä¸åä¸ä»»å¡å
³è表éå") |
| | | @ApiModelProperty(value = "æ£è
ä¸åä¸ä»»å¡å
³è表éå") |
| | | private List<PatTaskRelevance> patTaskRelevances; |
| | | |
| | | /** |
| | | * æ¯å¦å卿ä½ï¼1 æ°å¢ 2ä¿®æ¹ 3å é¤ |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦å卿ä½ï¼1 æ°å¢ 2ä¿®æ¹ 3å é¤") |
| | | private Integer isoperation; |
| | | |
| | | /** |
| | | * ææ¬åéåæ° |
| | | */ |
| | | @Excel(name = "ææ¬åéåæ°") |
| | | @ApiModelProperty(value = "ææ¬åéåæ°") |
| | | private Map<String, Map<String, String>> textParam; |
| | | |
| | | |
| | | /** |
| | | * åéç±»å: 1 æ¶é´æ®µ 2 æ¶é´ç¹ 3 å³å»åé |
| | | */ |
| | | @ApiModelProperty(value = "åéç±»å: 1 æ¶é´æ®µ 2 å³å»åé") |
| | | private Long sendType; |
| | | |
| | | @ApiModelProperty(value = "ä¸åæ¶é´") |
| | | private String showTimeMorn; |
| | | |
| | | @ApiModelProperty(value = "ä¸åæ¶é´") |
| | | private String showTimeNoon; |
| | | |
| | | @ApiModelProperty(value = "æåæ¶é´") |
| | | private String showTimeNight; |
| | | |
| | | @ApiModelProperty(value = "å±ç¤ºæ¥æ") |
| | | private String showDate; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | @ApiModel(value = "IvrTaskcallMQ", description = "MQä»»å¡") |
| | | @Data |
| | | public class IvrTaskcallMQ extends BaseEntity { |
| | | public class IvrTaskcallMQ { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | |
| | | * ä»»å¡åéæ¹å¼ï¼âçµè¯ï¼çä¿¡ï¼å
¬ä¼å·ï¼é¾æ¥...â以éå·åé |
| | | */ |
| | | @Excel(name = "ä»»å¡åéæ¹å¼ï¼çµè¯ï¼çä¿¡ï¼å
¬ä¼å·ï¼é¾æ¥...") |
| | | @ApiModelProperty(value = "å¡åéæ¹å¼ï¼çµè¯ï¼çä¿¡ï¼å
¬ä¼å·ï¼é¾æ¥... 以éå·åé") |
| | | private String servicefrom; |
| | | @ApiModelProperty(value = "å¡åéæ¹å¼ï¼çµè¯ï¼çä¿¡ï¼å
¬ä¼å·... 以éå·åé") |
| | | private String preachform; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * å§å |
| | | */ |
| | | @ApiModelProperty("æ£è
idéå") |
| | | @Excel(name = " æ£è
idéåï¼å¨éæ©ç
人æ¶ï¼è¿æ»¤å·²ç»éæ©çpidsï¼ ") |
| | | private List<Integer> pids; |
| | | |
| | | /** |
| | | * å§å |
| | | */ |
| | | @ApiModelProperty("å§å") |
| | | @Excel(name = " å§å ") |
| | | private String name; |
| | |
| | | |
| | | //模æ¿code ä¾å¦ ï¼ SMS_461860582 |
| | | private String tmpCode; |
| | | |
| | | private String url; |
| | | } |
| | |
| | | */ |
| | | @Excel(name = " åéç¶æï¼ 1å建 2æ§è¡ä¸ 3 æå 4ç»æ¢ 5宿 ") |
| | | @ApiModelProperty(value = "åéç¶æï¼ 1å建 2æ§è¡ä¸ 3 æå 4ç»æ¢ 5宿 ") |
| | | private String sendState; |
| | | |
| | | |
| | | private Integer sendState; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | private String type; |
| | | |
| | | private Long stopState; |
| | | |
| | | private Long servicefrom; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public Boolean updateIvrTaskcall(IvrTaskSingle ivrTaskSingle); |
| | | |
| | | public Boolean updateIvrTaskcallByCondition(IvrTaskSingle ivrTaskSingle); |
| | | |
| | | /** |
| | | * å é¤åä¸ä»»å¡ï¼éè®¿ï¼ |
| | | * |
| | |
| | | */ |
| | | public int deleteIvrTaskcallById(Long id); |
| | | |
| | | public int deleteIvrTaskcallByCondition(@Param("taskid") Long id, @Param("patid") Long patid); |
| | | |
| | | /** |
| | | * å é¤åä¸ä»»å¡ï¼éè®¿ï¼ |
| | | * |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.smartor.domain.IvrLibaTemplateScript; |
| | | import com.smartor.domain.IvrLibaTemplateScriptVO; |
| | | import com.smartor.domain.IvrTask; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | |
| | | /** |
| | | * è¯é³ä»»å¡Serviceæ¥å£ |
| | |
| | | * @return ç»æ |
| | | */ |
| | | public Boolean deleteIvrTaskByTaskid(Long taskid); |
| | | |
| | | public List<IvrLibaTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid); |
| | | } |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.smartor.domain.*; |
| | | import com.smartor.domain.robot.back.RobotAIDialogBack; |
| | | import com.smartor.domain.robot.back.RobotCallBack; |
| | | import com.smartor.domain.IvrTaskSingle; |
| | | import com.smartor.domain.IvrTaskVO; |
| | | import com.smartor.domain.PhoneCallBackVO; |
| | | import com.smartor.domain.SendTaskVO; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param ivrTaskcall |
| | | * @return |
| | | */ |
| | | public IvrTaskSingleVO queryTaskByCondition(IvrTaskSingle ivrTaskcall); |
| | | public IvrTaskVO queryTaskByCondition(IvrTaskSingle ivrTaskcall); |
| | | |
| | | /** |
| | | * æ¥è¯¢æ£è
éè®¿ä¿¡æ¯ |
| | |
| | | /** |
| | | * æ°å¢å®£æä»»å¡ |
| | | * |
| | | * @param ivrTaskcallVO åä¸ä»»å¡ |
| | | * @param ivrTaskVO åä¸ä»»å¡ |
| | | * @return ç»æ |
| | | */ |
| | | public int insertOrUpdateTask(IvrTaskSingleVO ivrTaskcallVO); |
| | | public int insertOrUpdateTask(IvrTaskVO ivrTaskVO); |
| | | |
| | | /** |
| | | * ä»»å¡åéæ§è¡ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service; |
| | | |
| | | import com.smartor.domain.WeChatSendVo; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | public interface WeChatService { |
| | | public Boolean sendMessageToFollowers(@RequestBody WeChatSendVo weChatSendVo); |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | try { |
| | | //è·åå°åéæ¶é´çéå |
| | | if (StringUtils.isNotEmpty(sendTimeSlot)) { |
| | | List<TaskSendTimeVO> taskSendTimeVOList = objectMapper.readValue(sendTimeSlot, List.class); |
| | | List<TaskSendTimeVO> taskSendTimeVOList = objectMapper.readValue(sendTimeSlot, new TypeReference<List<TaskSendTimeVO>>() {}); |
| | | heTaskSingleVO.setSendTimeslot(taskSendTimeVOList); |
| | | } |
| | | //ææ¬åéåæ° |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.smartor.domain.IvrTaskSingle; |
| | | import com.smartor.mapper.IvrTaskSingleMapper; |
| | | import com.ruoyi.common.utils.DtoConversionUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.smartor.domain.*; |
| | | import com.smartor.mapper.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.smartor.mapper.IvrTaskMapper; |
| | | import com.smartor.domain.IvrTask; |
| | | import com.smartor.service.IIvrTaskService; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | * @author smartor |
| | | * @date 2023-03-24 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class IvrTaskServiceImpl implements IIvrTaskService { |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private IvrTaskSingleMapper ivrTaskcallMapper; |
| | | |
| | | @Autowired |
| | | private IvrLibaTemplateScriptMapper ivrLibaTemplateScriptMapper; |
| | | |
| | | @Autowired |
| | | private PatArchiveMapper patArchiveMapper; |
| | | |
| | | @Autowired |
| | | private IvrLibaTemplateTargetoptionMapper ivrLibaTemplateTargetOptionMapper; |
| | | |
| | | /** |
| | | * æ¥è¯¢è¯é³ä»»å¡ |
| | |
| | | isSuccess = ivrTaskMapper.deleteIvrTaskByTaskid(taskid); |
| | | return isSuccess; |
| | | } |
| | | |
| | | @Override |
| | | public List<IvrLibaTemplateScriptVO> getScriptInfoByCondition(Long taskid, Long patid) { |
| | | //éè¿ä»»å¡IDè·å模æ¿ID |
| | | IvrTask ivrTask = selectIvrTaskByTaskid(taskid); |
| | | |
| | | //éè¿æ¨¡æ¿IDè·åé®é¢ä¿¡æ¯ |
| | | IvrLibaTemplateScript ivrLibaTemplateScript = new IvrLibaTemplateScript(); |
| | | ivrLibaTemplateScript.setTemplateID(ivrTask.getTemplateid()); |
| | | ivrLibaTemplateScript.setDelFlag("0"); |
| | | List<IvrLibaTemplateScript> ivrLibaTemplateScripts = ivrLibaTemplateScriptMapper.selectIvrLibaTemplateScriptList(ivrLibaTemplateScript); |
| | | if (CollectionUtils.isEmpty(ivrLibaTemplateScripts) || ivrLibaTemplateScripts.size() == 0) { |
| | | log.info("ivrLibaTemplateScripts为空äºï¼è¯·å°½å¿«è系管çåå¤ç"); |
| | | return new ArrayList<>(); |
| | | } |
| | | List<IvrLibaTemplateScriptVO> ivrLibaTemplateScriptVOS = DtoConversionUtils.sourceToTarget(ivrLibaTemplateScripts, IvrLibaTemplateScriptVO.class); |
| | | |
| | | //è·åæ£è
ä¿¡æ¯ |
| | | PatArchive patArchive = patArchiveMapper.selectPatArchiveByPatid(patid); |
| | | |
| | | //éè¿æ£è
ä¿¡æ¯åä»»å¡ä¿¡æ¯ä¸çtextParam对é®é¢ä¸çåéè¿è¡å¡«å
|
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | Map<String, Map<String, String>> ivrTaskMap = null; |
| | | try { |
| | | ivrTaskMap = objectMapper.readValue(ivrTask.getTextParam(), Map.class); |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | List<Map<String, String>> mapList = new ArrayList<>(); |
| | | |
| | | for (Map<String, String> map : ivrTaskMap.values()) { |
| | | mapList.add(map); |
| | | } |
| | | |
| | | //å°æ¨¡æ¿é®é¢è¯æ¯éçéé
ç¬¦æ¿æ¢ |
| | | for (IvrLibaTemplateScriptVO ivrLibaTemplateScriptVO : ivrLibaTemplateScriptVOS) { |
| | | if (StringUtils.isNotEmpty(ivrLibaTemplateScriptVO.getQuestionText())) { |
| | | for (Map<String, String> map : mapList) { |
| | | for (String key : map.keySet()) { |
| | | |
| | | ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace(key, StringUtils.isNotEmpty(map.get(key)) ? map.get(key) : "")); |
| | | } |
| | | } |
| | | //æ¿æ¢æ£è
ä¸ªäººä¿¡æ¯æ°æ® |
| | | ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${name}", StringUtils.isNotEmpty(patArchive.getName()) ? patArchive.getName() : "")); |
| | | ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${dzz}", StringUtils.isNotEmpty(patArchive.getPlaceOfResidence()) ? patArchive.getPlaceOfResidence() : "")); |
| | | ivrLibaTemplateScriptVO.setQuestionText(ivrLibaTemplateScriptVO.getQuestionText().replace("${dhh}", StringUtils.isNotEmpty(patArchive.getTelcode()) ? patArchive.getTelcode() : "")); |
| | | |
| | | //è·åé®é¢é项 |
| | | IvrLibaTemplateTargetoption ivrLibaTemplateTargetoption = new IvrLibaTemplateTargetoption(); |
| | | ivrLibaTemplateTargetoption.setScriptid(ivrLibaTemplateScriptVO.getID()); |
| | | List<IvrLibaTemplateTargetoption> ivrLibaTemplateTargetoptions = ivrLibaTemplateTargetOptionMapper.selectIvrLibaTemplateTargetoptionList(ivrLibaTemplateTargetoption); |
| | | ivrLibaTemplateScriptVO.setIvrLibaScriptTargetoptionList(ivrLibaTemplateTargetoptions); |
| | | } |
| | | } |
| | | |
| | | |
| | | return ivrLibaTemplateScriptVOS; |
| | | } |
| | | } |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public IvrTaskSingleVO queryTaskByCondition(IvrTaskSingle ivrTaskcall) { |
| | | public IvrTaskVO queryTaskByCondition(IvrTaskSingle ivrTaskcall) { |
| | | //å®ä¹æ£è
ä¸åä¸ä»»å¡å
³è表éå |
| | | List<PatTaskRelevance> patTaskRelevances = new ArrayList<>(); |
| | | List<IvrTaskSingle> list = selectIvrTaskcallList(ivrTaskcall); |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | new BaseException("该任å¡ä¸åå¨"); |
| | | if (CollectionUtils.isEmpty(list) || list.size() == 0) { |
| | | return new IvrTaskVO(); |
| | | } |
| | | IvrTask ivrTask = ivrTaskService.selectIvrTaskByTaskid(ivrTaskcall.getTaskid()); |
| | | //å°æ¥åºæ¥çæ°æ®åå
¥ivrTasksingleVOä¸ |
| | | IvrTaskSingleVO ivrTasksingleVO2 = DtoConversionUtils.sourceToTarget(list.get(0), IvrTaskSingleVO.class); |
| | | IvrTaskVO ivrTaskVO = DtoConversionUtils.sourceToTarget(list.get(0), IvrTaskVO.class); |
| | | ivrTaskVO.setShowDate(ivrTask.getShowDate()); |
| | | ivrTaskVO.setShowTimeMorn(ivrTask.getShowTimeMorn()); |
| | | ivrTaskVO.setShowTimeNoon(ivrTask.getShowTimeNoon()); |
| | | ivrTaskVO.setShowTimeNight(ivrTask.getShowTimeNight()); |
| | | String sendTimeSlot = ivrTask.getSendTimeSlot(); |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | try { |
| | | //è·åå°åéæ¶é´çéå |
| | | if (com.ruoyi.common.utils.StringUtils.isNotEmpty(sendTimeSlot)) { |
| | | List<TaskSendTimeVO> taskSendTimeVOList = objectMapper.readValue(sendTimeSlot, List.class); |
| | | ivrTasksingleVO2.setSendTimeslot(taskSendTimeVOList); |
| | | ivrTaskVO.setSendTimeslot(taskSendTimeVOList); |
| | | ivrTaskVO.setSendType(ivrTask.getSendType()); |
| | | } |
| | | //ææ¬åéåæ° |
| | | if (com.ruoyi.common.utils.StringUtils.isNotEmpty(list.get(0).getTextParam())) { |
| | | Map<String, Map<String, String>> textParam = objectMapper.readValue(list.get(0).getTextParam(), Map.class); |
| | | ivrTasksingleVO2.setTextParam(textParam); |
| | | if (com.ruoyi.common.utils.StringUtils.isNotEmpty(ivrTask.getTextParam())) { |
| | | Map<String, Map<String, String>> textParam = objectMapper.readValue(ivrTask.getTextParam(), Map.class); |
| | | ivrTaskVO.setTextParam(textParam); |
| | | } |
| | | } catch (JsonProcessingException e) { |
| | | e.printStackTrace(); |
| | |
| | | patTaskRelevance.setPhone(ivrTaskcall1.getPhone()); |
| | | patTaskRelevance.setAddr(ivrTaskcall1.getAddr()); |
| | | patTaskRelevance.setDiagname(ivrTaskcall1.getDiagname()); |
| | | patTaskRelevance.setPatid(ivrTaskcall1.getPatid()); |
| | | patTaskRelevances.add(patTaskRelevance); |
| | | } |
| | | if (ivrTaskcall1.getHospType().equals("2")) { |
| | |
| | | patTaskRelevance.setDeptName(ivrTaskcall1.getDeptname()); |
| | | patTaskRelevance.setBedNo(ivrTaskcall1.getBedNo()); |
| | | patTaskRelevance.setDiagname(ivrTaskcall1.getDiagname()); |
| | | patTaskRelevance.setPatid(ivrTaskcall1.getPatid()); |
| | | patTaskRelevances.add(patTaskRelevance); |
| | | } |
| | | } |
| | | |
| | | ivrTasksingleVO2.setPatTaskRelevances(patTaskRelevances); |
| | | return ivrTasksingleVO2; |
| | | ivrTaskVO.setPatTaskRelevances(patTaskRelevances); |
| | | return ivrTaskVO; |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int insertOrUpdateTask(IvrTaskSingleVO ivrTasksingleVO) { |
| | | if (ObjectUtils.isEmpty(ivrTasksingleVO)) { |
| | | public int insertOrUpdateTask(IvrTaskVO ivrTaskVO) { |
| | | if (ObjectUtils.isEmpty(ivrTaskVO)) { |
| | | log.info("ä»»å¡å
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | | throw new BaseException("ä»»å¡å
¥å为空ï¼è¯·æ£æ¥å
¥å"); |
| | | } |
| | | Integer integer = 0; |
| | | if (ivrTasksingleVO.getIsoperation() != null && ivrTasksingleVO.getIsoperation() == 1) { |
| | | Integer integer = 1; |
| | | IvrTask ivrTask = DtoConversionUtils.sourceToTarget(ivrTaskVO, IvrTask.class); |
| | | ivrTask.setTextParam(JSON.toJSONString(ivrTaskVO.getTextParam())); |
| | | if (ivrTaskVO.getIsoperation() != null && ivrTaskVO.getIsoperation() == 1) { |
| | | //å¾ä»»å¡è¡¨ä¸ï¼æ°å¢ä»»å¡ |
| | | IvrTask ivrTask = DtoConversionUtils.sourceToTarget(ivrTasksingleVO, IvrTask.class); |
| | | if (ObjectUtils.isNotEmpty(ivrTasksingleVO.getSendTimeslot())) |
| | | ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTasksingleVO.getSendTimeslot())); |
| | | if (ObjectUtils.isNotEmpty(ivrTaskVO.getSendTimeslot())) |
| | | ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTaskVO.getSendTimeslot())); |
| | | if (ivrTask.getSendState() == null) ivrTask.setSendState(1); |
| | | ivrTask.setTemplateid(ivrTaskVO.getLibtemplateid()); |
| | | ivrTaskService.insertIvrTask(ivrTask); |
| | | ivrTasksingleVO.setTaskid(ivrTask.getTaskid().longValue()); |
| | | |
| | | //å°ä»»å¡ä¿¡æ¯æ¾å°æå¡è¡¨ä¸ |
| | | IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskVO, IvrTaskSingle.class); |
| | | ivrTaskcall.setTaskid(ivrTask.getTaskid().longValue()); |
| | | //æ°å¢ |
| | | if (CollectionUtils.isNotEmpty(ivrTasksingleVO.getPatTaskRelevances())) { |
| | | for (PatTaskRelevance patTaskRelevance : ivrTasksingleVO.getPatTaskRelevances()) { |
| | | if (CollectionUtils.isNotEmpty(ivrTaskVO.getPatTaskRelevances())) { |
| | | for (PatTaskRelevance patTaskRelevance : ivrTaskVO.getPatTaskRelevances()) { |
| | | //å°ä»»å¡ä¿¡æ¯æ°å¢å°é访æå¡è¡¨ä¸ |
| | | IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTasksingleVO, IvrTaskSingle.class); |
| | | ivrTaskcall.setSendname(patTaskRelevance.getName()); |
| | | ivrTaskcall.setAge(patTaskRelevance.getAge()); |
| | | ivrTaskcall.setSfzh(patTaskRelevance.getSfzh()); |
| | | ivrTaskcall.setPhone(patTaskRelevance.getPhone()); |
| | | ivrTaskcall.setAddr(patTaskRelevance.getAddr()); |
| | | ivrTaskcall.setPatid(patTaskRelevance.getPatid()); |
| | | ivrTaskcall.setCreateTime(DateUtils.getNowDate()); |
| | | ivrTaskcall.setTextParam(new Gson().toJson(patTaskRelevance.getTextParam())); |
| | | ivrTaskcall.setCreateTime(DateUtils.getNowDate()); |
| | | ivrTaskcall.setType(ivrTaskVO.getHospType()); |
| | | ivrTaskSingleMapper.insertIvrTaskcall(ivrTaskcall); |
| | | integer = ivrTaskcall.getId().intValue(); |
| | | } |
| | | } |
| | | |
| | | } else if (ivrTasksingleVO.getIsoperation() != null && ivrTasksingleVO.getIsoperation() == 2) { |
| | | } else if (ivrTaskVO.getIsoperation() != null && ivrTaskVO.getIsoperation() == 2) { |
| | | //ä»»å¡ä¿®æ¹ |
| | | IvrTask ivrTask = DtoConversionUtils.sourceToTarget(ivrTasksingleVO, IvrTask.class); |
| | | if (ObjectUtils.isNotEmpty(ivrTasksingleVO.getSendTimeslot())) |
| | | ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTasksingleVO.getSendTimeslot())); |
| | | //è·å表éçstopStateæ°å¼ + 1 |
| | | if (ObjectUtils.isNotEmpty(ivrTaskVO.getSendTimeslot())) |
| | | ivrTask.setSendTimeSlot(JSON.toJSONString(ivrTaskVO.getSendTimeslot())); |
| | | IvrTask ivrTask1 = ivrTaskService.selectIvrTaskByTaskid(ivrTask.getTaskid()); |
| | | ivrTask.setStopState(ivrTask1.getStopState() + 1); |
| | | ivrTask.setTemplateid(ivrTaskVO.getLibtemplateid()); |
| | | ivrTaskService.updateIvrTask(ivrTask); |
| | | |
| | | if (CollectionUtils.isNotEmpty(ivrTasksingleVO.getPatTaskRelevances())) { |
| | | for (PatTaskRelevance patTaskRelevance : ivrTasksingleVO.getPatTaskRelevances()) { |
| | | if (CollectionUtils.isNotEmpty(ivrTaskVO.getPatTaskRelevances())) { |
| | | for (PatTaskRelevance patTaskRelevance : ivrTaskVO.getPatTaskRelevances()) { |
| | | |
| | | IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTasksingleVO, IvrTaskSingle.class); |
| | | IvrTaskSingle ivrTaskcall = DtoConversionUtils.sourceToTarget(ivrTaskVO, IvrTaskSingle.class); |
| | | ivrTaskcall.setSendname(patTaskRelevance.getName()); |
| | | ivrTaskcall.setAge(patTaskRelevance.getAge()); |
| | | ivrTaskcall.setSfzh(patTaskRelevance.getSfzh()); |
| | | ivrTaskcall.setPhone(patTaskRelevance.getPhone()); |
| | | ivrTaskcall.setAddr(patTaskRelevance.getAddr()); |
| | | ivrTaskcall.setPatid(patTaskRelevance.getPatid()); |
| | | ivrTaskcall.setType(ivrTaskVO.getHospType()); |
| | | ivrTaskcall.setCreateTime(DateUtils.getNowDate()); |
| | | ivrTaskcall.setTextParam(new Gson().toJson(ivrTasksingleVO.getTextParam())); |
| | | if (patTaskRelevance.getIsoperation() == 2) ivrTaskSingleMapper.updateIvrTaskcall(ivrTaskcall); |
| | | if (patTaskRelevance.getIsoperation() == 1) ivrTaskSingleMapper.insertIvrTaskcall(ivrTaskcall); |
| | | integer = ivrTaskcall.getId().intValue(); |
| | | ivrTaskcall.setTextParam(new Gson().toJson(ivrTaskVO.getTextParam())); |
| | | if (patTaskRelevance.getIsoperation() != null) { |
| | | if (patTaskRelevance.getIsoperation() == 2) |
| | | ivrTaskSingleMapper.updateIvrTaskcallByCondition(ivrTaskcall); |
| | | if (patTaskRelevance.getIsoperation() == 1) ivrTaskSingleMapper.insertIvrTaskcall(ivrTaskcall); |
| | | if (patTaskRelevance.getIsoperation() == 3) |
| | | // éè¿taskidåpatidå»å é¤è¯¥æ¡æ°æ® |
| | | ivrTaskSingleMapper.deleteIvrTaskcallByCondition(ivrTaskVO.getTaskid(), patTaskRelevance.getPatid()); |
| | | } |
| | | integer = ivrTaskcall.getTaskid().intValue(); |
| | | } |
| | | } |
| | | |
| | | } else if (ivrTasksingleVO.getIsoperation() != null && ivrTasksingleVO.getIsoperation() == 3) { |
| | | ivrTaskSingleMapper.deleteIvrTaskcallById(ivrTasksingleVO.getId()); |
| | | |
| | | integer = ivrTasksingleVO.getId().intValue(); |
| | | } |
| | | |
| | | |
| | | return integer; |
| | | } |
| | | |
| | |
| | | public int heTaskSend(SendTaskVO sendTaskVO) { |
| | | if (sendTaskVO.getTaskId() == null) throw new BaseException("ä»»å¡IDä¸è½ä¸ºç©ºï¼è¯·æ£æ¥åï¼åè¿è¡æ§è¡"); |
| | | IvrTask ivrTask = ivrTaskService.selectIvrTaskByTaskid(sendTaskVO.getTaskId()); |
| | | if (StringUtils.isNotEmpty(sendTaskVO.getSendState()) && sendTaskVO.getSendState().equals("3") || StringUtils.isNotEmpty(sendTaskVO.getSendState()) && sendTaskVO.getSendState().equals("4")) { |
| | | if (sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 3 || sendTaskVO.getSendState() != null && sendTaskVO.getSendState() == 4) { |
| | | //任塿åæç»æ¢ |
| | | IvrTask ivrTask3 = new IvrTask(); |
| | | ivrTask3.setTaskid(sendTaskVO.getTaskId()); |
| | |
| | | if (StringUtils.isEmpty(sendTaskVO.getSendType())) { |
| | | sendTaskVO.setSendType(ivrTask.getSendType().toString()); |
| | | } |
| | | |
| | | Long ss = ivrTask.getStopState() + 1; |
| | | //夿任塿¯å¦æ¯ç«å³åé |
| | | if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("2")) { |
| | | IvrTaskcallMQ ivrTaskcallMQ = new IvrTaskcallMQ(); |
| | | ivrTaskcallMQ.setTaskid(sendTaskVO.getTaskId()); |
| | | ivrTaskcallMQ.setSendType(sendTaskVO.getSendType()); |
| | | ivrTaskcallMQ.setTemplateid(ivrTask.getTemplateid().toString()); |
| | | ivrTaskcallMQ.setStopState(ivrTask.getStopState()); |
| | | ivrTaskcallMQ.setStopState(ss); |
| | | ivrTaskcallMQ.setPreachform(ivrTask.getPreachform()); |
| | | |
| | | String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); |
| | | ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); |
| | |
| | | //å°ä»»å¡ç¶æä¿®æ¹ææ§è¡ä¸ |
| | | IvrTask ivrTask2 = new IvrTask(); |
| | | ivrTask2.setTaskid(ivrTask.getTaskid()); |
| | | ivrTask2.setSendState("2"); |
| | | ivrTask2.setStopState(ivrTask.getStopState() + 1); |
| | | ivrTask2.setSendState(2); |
| | | ivrTask2.setStopState(ss); |
| | | ivrTaskService.updateIvrTask(ivrTask2); |
| | | } else if (StringUtils.isNotEmpty(sendTaskVO.getSendType()) && sendTaskVO.getSendType().equals("1")) { |
| | | //æ¶é´æ®µåé |
| | |
| | | if (StringUtils.isNotEmpty(ivrTask.getSendTimeSlot())) { |
| | | List<TaskSendTimeVO> taskSendTimeVOList = null; |
| | | try { |
| | | taskSendTimeVOList = objectMapper.readValue(ivrTask.getSendTimeSlot(), List.class); |
| | | taskSendTimeVOList = objectMapper.readValue(ivrTask.getSendTimeSlot(), new TypeReference<List<TaskSendTimeVO>>() { |
| | | }); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("JsonProcessingExceptionæ¥éäºï¼{}", e.getMessage()); |
| | | } |
| | |
| | | Long finalMilliseconds = milliseconds; |
| | | String ivrTaskcallMQJson = JSON.toJSONString(ivrTaskcallMQ); |
| | | ivrTaskcallMQJson = ivrTaskcallMQJson.substring(1, ivrTaskcallMQJson.length() - 1); |
| | | rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, 0L); |
| | | rabbitMqCallPhoneConfig.sendMessage("phone_exchange", "phone.123", ivrTaskcallMQJson, milliseconds); |
| | | } |
| | | //å°ä»»å¡ç¶æä¿®æ¹ææ§è¡ä¸ |
| | | IvrTask ivrTask2 = new IvrTask(); |
| | | ivrTask2.setTaskid(ivrTask.getTaskid()); |
| | | ivrTask2.setSendState("2"); |
| | | ivrTask2.setStopState(ivrTask.getStopState() + 1); |
| | | ivrTask2.setSendState(2); |
| | | ivrTask2.setStopState(ss); |
| | | ivrTaskService.updateIvrTask(ivrTask2); |
| | | } |
| | | } |
| | | return 0; |
| | | return 1; |
| | | } |
| | | |
| | | @Override |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.smartor.service.impl; |
| | | |
| | | import com.smartor.domain.WeChatSendVo; |
| | | import com.smartor.service.WeChatService; |
| | | import me.chanjar.weixin.common.exception.WxErrorException; |
| | | import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; |
| | | import me.chanjar.weixin.mp.api.WxMpService; |
| | | import me.chanjar.weixin.mp.api.impl.WxMpServiceImpl; |
| | | import me.chanjar.weixin.mp.bean.template.WxMpTemplateData; |
| | | import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class WeChatServiceImpl implements WeChatService { |
| | | @Value("${appid}") |
| | | private String appid; |
| | | |
| | | @Value("${appSecret}") |
| | | private String appSecret; |
| | | |
| | | @Override |
| | | public Boolean sendMessageToFollowers(WeChatSendVo weChatSendVo) { |
| | | WxMpService wxMpService; |
| | | wxMpService = new WxMpServiceImpl(); |
| | | wxMpService.setWxMpConfigStorage(new WxMpInMemoryConfigStorage()); |
| | | WxMpInMemoryConfigStorage wxMpConfigStorage = (WxMpInMemoryConfigStorage) wxMpService.getWxMpConfigStorage(); |
| | | wxMpConfigStorage.setAppId(appid); |
| | | wxMpConfigStorage.setSecret(appSecret); |
| | | try { |
| | | List<String> openIdList = wxMpService.getUserService().userList(null).getOpenids(); |
| | | for (String openId : openIdList) { |
| | | WxMpTemplateMessage templateMessage = WxMpTemplateMessage.builder().toUser(openId).templateId(weChatSendVo.getTemplateId()).url(weChatSendVo.getUrl()).build(); |
| | | for (String key : weChatSendVo.getContent().keySet()) { |
| | | templateMessage.addData(new WxMpTemplateData(key, weChatSendVo.getContent().get(key).toString())); |
| | | } |
| | | wxMpService.getTemplateMsgService().sendTemplateMsg(templateMessage); |
| | | } |
| | | } catch (WxErrorException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return true; |
| | | |
| | | } |
| | | } |
| | |
| | | <if test="mateNum != null ">mate_num = #{mateNum},</if> |
| | | <if test="revisitAfter != null ">revisit_after = #{revisitAfter},</if> |
| | | <if test="revisitBefore != null ">revisit_before = #{revisitBefore},</if> |
| | | <if test="noVoiceNum != null and noVoiceNum > 0 ">no_voice_num = #{noVoiceNum}</if> |
| | | <if test="noVoiceNum != null and noVoiceNum > 0 ">no_voice_num = #{noVoiceNum},</if> |
| | | <if test="silencetime != null">silencetime = #{silencetime}</if> |
| | | </trim> |
| | | where ID = #{ID} |
| | |
| | | <result property="libtemplatename" column="libtemplatename"/> |
| | | <result property="libtemplatename" column="libtemplatename"/> |
| | | <result property="stopState" column="stop_state"/> |
| | | <result property="showDate" column="show_date"/> |
| | | <result property="showTimeMorn" column="show_time_morn"/> |
| | | <result property="showTimeNoon" column="show_time_noon"/> |
| | | <result property="showTimeNight" column="show_time_night"/> |
| | | <result property="textParam" column="text_param"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectIvrTaskVo"> |
| | | select taskid, |
| | | task_name, |
| | | show_date, |
| | | show_time_morn, |
| | | show_time_noon, |
| | | show_time_night, |
| | | libtemplateid, |
| | | libtemplatename, |
| | | stop_state, |
| | | text_param, |
| | | templateid, |
| | | templatename, |
| | | labelinfo, |
| | |
| | | <include refid="selectIvrTaskVo"/> |
| | | <where> |
| | | <if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if> |
| | | <if test="sendTimeSlot != null and sendTimeSlot != ''">and sendTimeSlot like concat('%', #{sendTimeSlot}, |
| | | <if test="sendTimeSlot != null and sendTimeSlot != ''">and send_time_slot like concat('%', #{sendTimeSlot}, |
| | | '%') |
| | | </if> |
| | | <if test="templateid != null and templateid != ''">and templateid = #{templateid}</if> |
| | |
| | | <if test="hospType != null and hospType != ''">and hosp_type = #{hospType}</if> |
| | | <if test="libtemplateid != null ">and libtemplateid = #{libtemplateid}</if> |
| | | <if test="libtemplatename != null and libtemplatename != ''">and libtemplatename = #{libtemplatename}</if> |
| | | <if test="stopState != null ">and stop_state = #{stopState}</if> |
| | | </where> |
| | | order by update_time desc,taskid desc |
| | | </select> |
| | |
| | | <if test="taskDesc != null and taskDesc != ''">task_desc,</if> |
| | | <if test="libtemplateid != null ">libtemplateid,</if> |
| | | <if test="libtemplatename != null and libtemplatename != ''">libtemplatename,</if> |
| | | <if test="sendTimeSlot != null and sendTimeSlot != ''">sendTimeSlot,</if> |
| | | <if test="sendTimeSlot != null and sendTimeSlot != ''">send_time_slot,</if> |
| | | <if test="stopState != null">stop_state,</if> |
| | | <if test="showDate != null and showDate != ''">show_date,</if> |
| | | <if test="showTimeNight != null and showTimeNight != ''">show_time_night,</if> |
| | | <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon,</if> |
| | | <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn,</if> |
| | | <if test="textParam != null and textParam != ''">text_param,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="taskName != null">#{taskName},</if> |
| | |
| | | <if test="libtemplatename != null and libtemplatename != ''">#{libtemplatename},</if> |
| | | <if test="sendTimeSlot != null and sendTimeSlot != ''">#{sendTimeSlot},</if> |
| | | <if test="stopState != null">#{stopState},</if> |
| | | <if test="showDate != null and showDate != ''">#{showDate},</if> |
| | | <if test="showTimeNight != null and showTimeNight != ''">#{showTimeNight},</if> |
| | | <if test="showTimeNoon != null and showTimeNoon != ''">#{showTimeNoon},</if> |
| | | <if test="showTimeMorn != null and showTimeMorn != ''">#{showTimeMorn},</if> |
| | | <if test="textParam != null and textParam != ''">#{textParam},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="libtemplatename != null and libtemplatename != ''">libtemplatename = #{libtemplatename},</if> |
| | | <if test="sendTimeSlot != null and sendTimeSlot != ''">send_time_slot=#{sendTimeSlot},</if> |
| | | <if test="stopState != null ">stop_state=#{stopState},</if> |
| | | <if test="showDate != null and showDate != ''">show_date=#{showDate},</if> |
| | | <if test="showTimeNight != null and showTimeNight != ''">show_time_night=#{showTimeNight},</if> |
| | | <if test="showTimeNoon != null and showTimeNoon != ''">show_time_noon=#{showTimeNoon},</if> |
| | | <if test="showTimeMorn != null and showTimeMorn != ''">show_time_morn=#{showTimeMorn},</if> |
| | | <if test="textParam != null and textParam != ''">text_param=#{textParam},</if> |
| | | </trim> |
| | | where taskid = #{taskid} |
| | | </update> |
| | |
| | | <result property="templateid" column="templateid"/> |
| | | <result property="templatename" column="templatename"/> |
| | | <result property="senddate" column="senddate"/> |
| | | <result property="sendlimitabegin" column="sendlimitabegin"/> |
| | | <result property="sendlimitaend" column="sendlimitaend"/> |
| | | <result property="sendlimitpbegin" column="sendlimitpbegin"/> |
| | | <result property="sendlimitpend" column="sendlimitpend"/> |
| | | <result property="sendlimitnbegin" column="sendlimitnbegin"/> |
| | | <result property="sendlimitnend" column="sendlimitnend"/> |
| | | <result property="senduuid" column="senduuid"/> |
| | | <result property="result" column="result"/> |
| | | <result property="finishtime" column="finishtime"/> |
| | |
| | | <result property="deptname" column="deptname"/> |
| | | <result property="admindate" column="admindate"/> |
| | | <result property="roomno" column="roomno"/> |
| | | <result property="patid" column="patid"/> |
| | | <result property="libtemplatename" column="libtemplatename"/> |
| | | <result property="libtemplateid" column="libtemplateid"/> |
| | | </resultMap> |
| | |
| | | phone, |
| | | sex, |
| | | age, |
| | | patid, |
| | | sfzh, |
| | | addr, |
| | | senderdetail, |
| | |
| | | templateid, |
| | | templatename, |
| | | senddate, |
| | | sendlimitabegin, |
| | | sendlimitaend, |
| | | sendlimitpbegin, |
| | | sendlimitpend, |
| | | sendlimitnbegin, |
| | | sendlimitnend, |
| | | senduuid, |
| | | result, |
| | | finishtime, |
| | |
| | | roomno, |
| | | admindate, |
| | | deptname, |
| | | stop_state, |
| | | diagname |
| | | from ivr_task_single |
| | | </sql> |
| | |
| | | <if test="phone != null and phone != ''">and phone = #{phone}</if> |
| | | <if test="sex != null and sex != ''">and sex = #{sex}</if> |
| | | <if test="age != null ">and age = #{age}</if> |
| | | <if test="patid != null ">and patid = #{patid}</if> |
| | | <if test="sfzh != null and sfzh != ''">and sfzh = #{sfzh}</if> |
| | | <if test="addr != null and addr != ''">and addr = #{addr}</if> |
| | | <if test="senderdetail != null and senderdetail != ''">and senderdetail = #{senderdetail}</if> |
| | |
| | | '%') |
| | | </if> |
| | | <if test="senddate != null ">and senddate = #{senddate}</if> |
| | | <if test="sendlimitabegin != null and sendlimitabegin != ''">and sendlimitabegin = #{sendlimitabegin}</if> |
| | | <if test="sendlimitaend != null and sendlimitaend != ''">and sendlimitaend = #{sendlimitaend}</if> |
| | | <if test="sendlimitpbegin != null and sendlimitpbegin != ''">and sendlimitpbegin = #{sendlimitpbegin}</if> |
| | | <if test="sendlimitpend != null and sendlimitpend != ''">and sendlimitpend = #{sendlimitpend}</if> |
| | | <if test="sendlimitnbegin != null and sendlimitnbegin != ''">and sendlimitnbegin = #{sendlimitnbegin}</if> |
| | | <if test="sendlimitnend != null and sendlimitnend != ''">and sendlimitnend = #{sendlimitnend}</if> |
| | | <if test="senduuid != null and senduuid != ''">and senduuid = #{senduuid}</if> |
| | | <if test="result != null and result != ''">and result = #{result}</if> |
| | | <if test="finishtime != null ">and finishtime = #{finishtime}</if> |
| | |
| | | <if test="templateid != null">templateid,</if> |
| | | <if test="templatename != null">templatename,</if> |
| | | <if test="senddate != null">senddate,</if> |
| | | <if test="sendlimitabegin != null">sendlimitabegin,</if> |
| | | <if test="sendlimitaend != null">sendlimitaend,</if> |
| | | <if test="sendlimitpbegin != null">sendlimitpbegin,</if> |
| | | <if test="sendlimitpend != null">sendlimitpend,</if> |
| | | <if test="sendlimitnbegin != null">sendlimitnbegin,</if> |
| | | <if test="sendlimitnend != null">sendlimitnend,</if> |
| | | <if test="senduuid != null">senduuid,</if> |
| | | <if test="result != null">result,</if> |
| | | <if test="finishtime != null">finishtime,</if> |
| | |
| | | <if test="diagname != null and diagname != ''">diagname,</if> |
| | | <if test="libtemplateid != null ">libtemplateid,</if> |
| | | <if test="libtemplatename != null ">libtemplatename,</if> |
| | | <if test="patid != null ">patid,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="sendname != null">#{sendname},</if> |
| | |
| | | <if test="templateid != null">#{templateid},</if> |
| | | <if test="templatename != null">#{templatename},</if> |
| | | <if test="senddate != null">#{senddate},</if> |
| | | <if test="sendlimitabegin != null">#{sendlimitabegin},</if> |
| | | <if test="sendlimitaend != null">#{sendlimitaend},</if> |
| | | <if test="sendlimitpbegin != null">#{sendlimitpbegin},</if> |
| | | <if test="sendlimitpend != null">#{sendlimitpend},</if> |
| | | <if test="sendlimitnbegin != null">#{sendlimitnbegin},</if> |
| | | <if test="sendlimitnend != null">#{sendlimitnend},</if> |
| | | <if test="senduuid != null">#{senduuid},</if> |
| | | <if test="result != null">#{result},</if> |
| | | <if test="finishtime != null">#{finishtime},</if> |
| | |
| | | <if test="diagname != null and diagname != ''">#{diagname},</if> |
| | | <if test="libtemplateid != null ">#{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">#{libtemplatename},</if> |
| | | <if test="stopState != null ">#{stopState},</if> |
| | | <if test="patid != null ">#{patid},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | |
| | | <if test="templateid != null">templateid = #{templateid},</if> |
| | | <if test="templatename != null">templatename = #{templatename},</if> |
| | | <if test="senddate != null">senddate = #{senddate},</if> |
| | | <if test="sendlimitabegin != null">sendlimitabegin = #{sendlimitabegin},</if> |
| | | <if test="sendlimitaend != null">sendlimitaend = #{sendlimitaend},</if> |
| | | <if test="sendlimitpbegin != null">sendlimitpbegin = #{sendlimitpbegin},</if> |
| | | <if test="sendlimitpend != null">sendlimitpend = #{sendlimitpend},</if> |
| | | <if test="sendlimitnbegin != null">sendlimitnbegin = #{sendlimitnbegin},</if> |
| | | <if test="sendlimitnend != null">sendlimitnend = #{sendlimitnend},</if> |
| | | <if test="senduuid != null">senduuid = #{senduuid},</if> |
| | | <if test="result != null">result = #{result},</if> |
| | | <if test="finishtime != null">finishtime = #{finishtime},</if> |
| | |
| | | <if test="diagname != null and diagname != ''">diagname = #{diagname},</if> |
| | | <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> |
| | | <if test="patid != null ">patid = #{patid},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="updateIvrTaskcallByCondition" parameterType="com.smartor.domain.IvrTaskSingle"> |
| | | update ivr_task_single |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="sendname != null">sendname = #{sendname},</if> |
| | | <if test="phone != null">phone = #{phone},</if> |
| | | <if test="sex != null">sex = #{sex},</if> |
| | | <if test="age != null">age = #{age},</if> |
| | | <if test="sfzh != null">sfzh = #{sfzh},</if> |
| | | <if test="addr != null">addr = #{addr},</if> |
| | | <if test="senderdetail != null">senderdetail = #{senderdetail},</if> |
| | | <if test="type != null">type = #{type},</if> |
| | | <if test="taskid != null">taskid = #{taskid},</if> |
| | | <if test="templateid != null">templateid = #{templateid},</if> |
| | | <if test="templatename != null">templatename = #{templatename},</if> |
| | | <if test="senddate != null">senddate = #{senddate},</if> |
| | | <if test="senduuid != null">senduuid = #{senduuid},</if> |
| | | <if test="result != null">result = #{result},</if> |
| | | <if test="finishtime != null">finishtime = #{finishtime},</if> |
| | | <if test="recordid != null">recordid = #{recordid},</if> |
| | | <if test="exrecallcount != null">exrecallcount = #{exrecallcount},</if> |
| | | <if test="pulltime != null">pulltime = #{pulltime},</if> |
| | | <if test="deptcode != null">deptcode = #{deptcode},</if> |
| | | <if test="labelstatus != null">labelstatus = #{labelstatus},</if> |
| | | <if test="delFlag != null and delFlag != ''">del_flag = #{delFlag},</if> |
| | | <if test="updateBy != null">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null">update_time = #{updateTime},</if> |
| | | <if test="createBy != null">create_by = #{createBy},</if> |
| | | <if test="createTime != null">create_time = #{createTime},</if> |
| | | <if test="isupload != null">isupload = #{isupload},</if> |
| | | <if test="uploadTime != null">upload_time = #{uploadTime},</if> |
| | | <if test="orgid != null">orgid = #{orgid},</if> |
| | | <if test="pid != null">pid = #{pid},</if> |
| | | <if test="guid != null">guid = #{guid},</if> |
| | | <if test="textParam != null">text_param = #{textParam},</if> |
| | | <if test="serviceform != null">serviceform = #{serviceform},</if> |
| | | <if test="bedNo != null">bed_no = #{bedNo},</if> |
| | | <if test="sendType != null and sendType != ''">send_type = #{sendType},</if> |
| | | <if test="taskName != null and taskName != ''">task_name = #{taskName},</if> |
| | | <if test="taskDesc != null and taskDesc != ''">task_desc = #{taskDesc},</if> |
| | | <if test="operatorNo != null and operatorNo != ''">operator_no = #{operatorNo},</if> |
| | | <if test="operator != null and operator != ''">operator = #{operator},</if> |
| | | <if test="hospType != null and hospType != ''">hosp_type = #{hospType},</if> |
| | | <if test="hospno != null and hospno != ''">hospno = #{hospno},</if> |
| | | <if test="wechat != null and wechat != ''">wechat = #{wechat},</if> |
| | | <if test="roomno != null and roomno != ''">roomno = #{roomno},</if> |
| | | <if test="admindate != null and admindate != ''">admindate = #{admindate},</if> |
| | | <if test="deptname != null and deptname != ''">deptname = #{deptname},</if> |
| | | <if test="diagname != null and diagname != ''">diagname = #{diagname},</if> |
| | | <if test="libtemplateid != null ">libtemplateid = #{libtemplateid},</if> |
| | | <if test="libtemplatename != null ">libtemplatename = #{libtemplatename},</if> |
| | | <if test="patid != null ">patid = #{patid},</if> |
| | | </trim> |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | | |
| | | <update id="deleteIvrTaskcallById" parameterType="Long"> |
| | |
| | | del_flag =1 |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <update id="deleteIvrTaskcallByCondition" > |
| | | update ivr_task_single |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | del_flag =1 |
| | | </trim> |
| | | where patid = #{patid} and taskid = #{taskid} |
| | | </update> |
| | | |
| | | <select id="getDataByTime" resultMap="IvrTaskcallResult"> |
| | |
| | | templateid, |
| | | templatename, |
| | | senddate, |
| | | sendlimitabegin, |
| | | sendlimitaend, |
| | | sendlimitpbegin, |
| | | sendlimitpend, |
| | | sendlimitnbegin, |
| | | sendlimitnend, |
| | | senduuid, |
| | | result, |
| | | finishtime, |
| | |
| | | wechat, |
| | | roomno, |
| | | admindate, |
| | | patid, |
| | | deptname, |
| | | diagname |
| | | FROM ivr_task_single, |
| | |
| | | <if test="deptname != null and deptname != ''"> |
| | | AND d.deptname LIKE concat('%',#{deptname}, '%') |
| | | </if> |
| | | |
| | | <if test="pids != null"> |
| | | AND a.patid NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | </if> |
| | | AND d.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | </where> |
| | |
| | | resultMap="PatArchiveResult"> |
| | | |
| | | select |
| | | -- c.tagname as tag, |
| | | -- b.tagid as tagid, |
| | | a.patid, |
| | | d.deptname, |
| | | a.name, |
| | |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.pattype |
| | | -- from pat_archive a,pat_archivetag b ,base_tag c, pat_med_outhosp d |
| | | from pat_archive a, pat_med_outhosp d |
| | | <where> |
| | | a.patid = d.patid |
| | |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">and a.idcardno = #{idcardno}</if> |
| | | <if test="telcode != null and telcode != ''">and a.telcode = #{telcode}</if> |
| | | <!-- <if test="tagIds != null and tagIds != ''">and c.tagid in--> |
| | | <!-- <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">--> |
| | | <!-- #{tagId}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''"> |
| | | AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%') |
| | | </if> |
| | |
| | | <if test="drname != null and drname != ''"> |
| | | AND d.drname LIKE concat('%',#{drname}, '%') |
| | | </if> |
| | | |
| | | <if test="pids != null"> |
| | | AND a.patid NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | </if> |
| | | AND d.del_flag != 1 |
| | | -- AND b.del_flag != 1 |
| | | -- AND c.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | </where> |
| | | </select> |
| | |
| | | resultMap="PatArchiveResult"> |
| | | |
| | | select |
| | | -- c.tagname as tag, |
| | | -- b.tagid as tagid, |
| | | a.patid as id, |
| | | a.name, |
| | | a.sex, |
| | |
| | | a.isupload, |
| | | a.upload_time, |
| | | a.pattype |
| | | -- from pat_archive a,pat_archivetag b ,base_tag c, pat_med_physical d |
| | | from pat_archive a, pat_med_physical d |
| | | <where> |
| | | a.patid = d.patid |
| | |
| | | <if test="name != null and name != ''">and a.name like concat('%', #{name}, '%')</if> |
| | | <if test="idcardno != null and idcardno != ''">and a.idcardno = #{idcardno}</if> |
| | | <if test="telcode != null and telcode != ''">and a.telcode = #{telcode}</if> |
| | | <!-- <if test="tagIds != null and tagIds != ''">and c.tagid in--> |
| | | <!-- <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">--> |
| | | <!-- #{tagId}--> |
| | | <!-- </foreach>--> |
| | | <!-- </if>--> |
| | | <if test="hospitaldistrictname != null and hospitaldistrictname != ''"> |
| | | AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%') |
| | | </if> |
| | |
| | | <if test="drname != null and drname != ''"> |
| | | AND d.drname LIKE concat('%',#{drname}, '%') |
| | | </if> |
| | | |
| | | <if test="pids != null"> |
| | | AND a.patid NOT IN |
| | | <foreach collection="pids" item="pid" open="(" separator="," close=")"> |
| | | #{pid} |
| | | </foreach> |
| | | </if> |
| | | AND d.del_flag != 1 |
| | | -- AND b.del_flag != 1 |
| | | -- AND c.del_flag != 1 |
| | | AND a.del_flag != 1 |
| | | </where> |
| | | |