丽水获取token url获取改成sys_config表动态设置
 
	
	
	
	
	
	
	
	
	
	
	
	
	
 |  |  | 
 |  |  | import com.ruoyi.common.utils.RSAPublicKeyExample; | 
 |  |  | import com.ruoyi.common.utils.StringUtils; | 
 |  |  | import com.ruoyi.common.utils.http.HttpUtils; | 
 |  |  | import com.ruoyi.system.service.ISysConfigService; | 
 |  |  | import com.smartor.common.LSHospTokenUtil; | 
 |  |  | import com.smartor.domain.*; | 
 |  |  | import com.smartor.mapper.HeLibraryMapper; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     IBaseSmsaccountService baseSmsaccountService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ISysConfigService configService; | 
 |  |  |  | 
 |  |  |     @Value("${xhsmsPath}") | 
 |  |  |     private String xhsmsPath; | 
 |  |  | 
 |  |  |                                 req.put("content", sendMagParam.getContent()); | 
 |  |  |                                 s = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); | 
 |  |  |                             } else if (visitHosp == 2) { | 
 |  |  |                                 String url = configService.selectConfigByKey("token.360"); | 
 |  |  |                                 //丽水的短信发送方式 | 
 |  |  |                                 Map<String, String> map = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); | 
 |  |  |                                 String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid()); | 
 |  |  |                                 String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid(),url); | 
 |  |  |                                 log.info("-----------token的值为:{}", token); | 
 |  |  |                                 if (ObjectUtils.isNotEmpty(map) && StringUtils.isEmpty(map.get("address"))) { | 
 |  |  |                                     ServiceSubtask ss = new ServiceSubtask(); | 
 
 |  |  | 
 |  |  | import com.ruoyi.common.core.controller.BaseController; | 
 |  |  | import com.ruoyi.common.core.domain.AjaxResult; | 
 |  |  | import com.ruoyi.common.utils.DtoConversionUtils; | 
 |  |  | import com.ruoyi.system.service.ISysConfigService; | 
 |  |  | import com.smartor.domain.*; | 
 |  |  | import com.smartor.service.IServiceExternalService; | 
 |  |  | import com.smartor.service.IServiceSubtaskDetailService; | 
 |  |  | 
 |  |  |     private IServiceExternalService serviceExternalService; | 
 |  |  |     @Autowired | 
 |  |  |     private ISvyTaskSingleService svyTaskSingleService; | 
 |  |  |     @Autowired | 
 |  |  |     private ISysConfigService configService; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 通用接口 | 
 |  |  | 
 |  |  |         log.info("------serviceQueryInfo的入参为:{}", serviceQueryInfo); | 
 |  |  |         Map map = null; | 
 |  |  |         try { | 
 |  |  |             String url = configService.selectConfigByKey("token.360"); | 
 |  |  |             serviceQueryInfo.setUrl(url); | 
 |  |  |             map = svyTaskSingleService.query360PatInfo(serviceQueryInfo); | 
 |  |  |         } catch (Exception e) { | 
 |  |  |             e.printStackTrace(); | 
 
 |  |  | 
 |  |  | uploadSwitch: 0 | 
 |  |  |  | 
 |  |  | #  指定asr回调的url路径(本地) | 
 |  |  | ASRCallBackPath: http://192.168.100.10:8095/smartor/serviceSubtask/phoneCallBackYQ | 
 |  |  | ASRCallBackPath: http://192.169.129.198:8095/smartor/serviceSubtask/phoneCallBackYQ | 
 |  |  | #挂断IP(本地) | 
 |  |  | hangup: http://192.168.100.6:8089/hangup | 
 |  |  | hangup: http://192.169.129.198:8089/hangup | 
 |  |  | #fs所使用的阿里的app_key(本地) | 
 |  |  | app_key_yq: ZurNHpaQLq6P55YS | 
 |  |  |  | 
 
 |  |  | 
 |  |  |             <artifactId>smartor</artifactId> | 
 |  |  |             <version>3.8.5</version> | 
 |  |  |         </dependency> | 
 |  |  |         <dependency> | 
 |  |  |             <groupId>com.ruoyi</groupId> | 
 |  |  |             <artifactId>ruoyi-system</artifactId> | 
 |  |  |         </dependency> | 
 |  |  |  | 
 |  |  |     </dependencies> | 
 |  |  |  | 
 
 |  |  | 
 |  |  |                 for (SysUserDept sud : sysUserDept) { | 
 |  |  |                     if (usersTemp.size() > 0) { | 
 |  |  |                         sud.setUserId(usersTemp.get(0).getUserId()); | 
 |  |  |                     SysDept sysDeptTemp = sysDept2Mapper.selectDeptByCode(sud.getDeptCode()); | 
 |  |  |                     if (sysDeptTemp != null) | 
 |  |  |                         sud.setDeptId(sysDeptTemp.getDeptId()); | 
 |  |  |                         sysUserDeptMapper.insertSysUserDept(sud); | 
 |  |  |                     } | 
 |  |  |                 } | 
 |  |  | 
 |  |  |         log.info("selectDeptList的采集到的数量为:{}", sysDepts.size()); | 
 |  |  |         int i = sysDept2Mapper.batchDept(sysDepts); | 
 |  |  |         return i; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 检查并执行分表的核心方法 | 
 |  |  |      * | 
 |  |  |      * @param tableName 要检查的表名 | 
 |  |  |      */ | 
 |  |  |     private synchronized void checkAndShard(String tableName) { | 
 |  |  |         long currentCount = shardingMapper.getTableCount(tableName); | 
 |  |  |  | 
 |  |  |         if (currentCount >= SHARDING_THRESHOLD) { | 
 |  |  |             log.warn("表 '{}' 已达到分表阈值 {},准备执行分表操作...", tableName, SHARDING_THRESHOLD); | 
 |  |  |  | 
 |  |  |             String newTableName = tableName + "_" + java.time.LocalDate.now().format(java.time.format.DateTimeFormatter.ofPattern("yyyy_MM")); | 
 |  |  |             Long maxId = shardingMapper.getMaxId(tableName); | 
 |  |  |             if (maxId == null) maxId = 0L; | 
 |  |  |  | 
 |  |  |             shardingMapper.renameTable(tableName, newTableName); | 
 |  |  |             log.info("已将表 '{}' 重命名为 '{}'", tableName, newTableName); | 
 |  |  |  | 
 |  |  |             shardingMapper.createLikeTable(tableName, newTableName); | 
 |  |  |             log.info("已创建新表 '{}'", tableName); | 
 |  |  |  | 
 |  |  |             shardingMapper.setAutoIncrement(tableName, maxId + 1); | 
 |  |  |             log.info("已设置新表 '{}' 的自增ID起始值为 {}", tableName, maxId + 1); | 
 |  |  |  | 
 |  |  |             log.info("表 '{}' 的分表操作完成!", tableName); | 
 |  |  |         } | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  | import com.ruoyi.common.utils.http.HttpUtils; | 
 |  |  | import com.ruoyi.common.utils.sms.smsUtils; | 
 |  |  | import com.ruoyi.quartz.service.ICollectHISService; | 
 |  |  | import com.ruoyi.system.service.ISysConfigService; | 
 |  |  | import com.smartor.common.LSHospTokenUtil; | 
 |  |  | import com.smartor.domain.*; | 
 |  |  | import com.smartor.mapper.HeLibraryMapper; | 
 |  |  | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ICollectHISService ichService; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ISysConfigService configService; | 
 |  |  |  | 
 |  |  |  | 
 |  |  |     @Value("${localIP}") | 
 |  |  | 
 |  |  |                                     req.put("content", sendMagParam.getContent()); | 
 |  |  |                                     isSuccess = HttpUtil.postJsonRequest(xhsmsPath, new Gson().toJson(req)); | 
 |  |  |                                 } else if (visitHosp == 2) { | 
 |  |  |                                     String url = configService.selectConfigByKey("token.360"); | 
 |  |  |                                     //丽水的短信发送方式 | 
 |  |  |                                     Map<String, String> map = MsgLSEnum.getAddressByCode(serviceSubtask.getOrgid()); | 
 |  |  |                                     String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid()); | 
 |  |  |                                     String token = LSHospTokenUtil.getToken(serviceSubtask.getOrgid(),url); | 
 |  |  |                                     if (ObjectUtils.isNotEmpty(map) && StringUtils.isEmpty(map.get("address"))) { | 
 |  |  |                                         ServiceSubtask ss = new ServiceSubtask(); | 
 |  |  |                                         ss.setResult("error"); | 
 
 |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ServiceSubtaskMapper serviceSubtaskMapper; | 
 |  |  |  | 
 |  |  |     @Autowired | 
 |  |  |     private ISysConfigService configService; | 
 |  |  |  | 
 |  |  |     /** | 
 |  |  |      * 查询短信记录 | 
 |  |  |      * | 
 |  |  | 
 |  |  |         //丽水的短信发送方式 | 
 |  |  |         Boolean isSuccess = false; | 
 |  |  |         try { | 
 |  |  |             String url = configService.selectConfigByKey("token.360"); | 
 |  |  |             Map<String, String> map = MsgLSEnum.getAddressByCode(orgid); | 
 |  |  |             String token = LSHospTokenUtil.getToken(orgid); | 
 |  |  |             String token = LSHospTokenUtil.getToken(orgid,url); | 
 |  |  |             log.info("【sfHandlle】丽水短信发送,地址:{},参数:{},机构ID:{}", map.get("address"), orgid); | 
 |  |  |             String dxCode = getDXCode(map.get("address"), phone, content, map.get("sendPersonId"), map.get("sendPersonName"), MsgLSEnum.getHeaderByCode(orgid), token); | 
 |  |  |             log.info("【sfHandlle】丽水短信发送结果:{}", dxCode); | 
 
 |  |  | 
 |  |  | package com.smartor.common; | 
 |  |  |  | 
 |  |  | import org.apache.commons.lang3.ObjectUtils; | 
 |  |  |  | 
 |  |  | import java.io.IOException; | 
 |  |  |  | 
 |  |  | public class LSHospTokenUtil { | 
 |  |  |     public static String getToken(String orgid) { | 
 |  |  |      public static String getToken(String orgid,String url) { | 
 |  |  |         String token = null; | 
 |  |  |         LyraTokenUtil lyraTokenUtil = null; | 
 |  |  |         if(ObjectUtils.isNotEmpty(url)){ | 
 |  |  |             lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil(url, "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); | 
 |  |  |         }else { | 
 |  |  |         if (orgid.equals("47255004333112711A1001"))  //景宁 | 
 |  |  |             lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); | 
 |  |  |         if (orgid.equals("47231022633110211A2101"))  //中医院 | 
 |  |  |             lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13011/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |         try { | 
 |  |  |             token = lyraTokenUtil.getToken(); | 
 |  |  |         } catch (IOException e) { | 
 |  |  | 
 |  |  |         } | 
 |  |  |         return token; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | } | 
 
 |  |  | 
 |  |  |     @ApiModelProperty(value = "业务信息") | 
 |  |  |     public YeWuXX YeWuXX; | 
 |  |  |  | 
 |  |  |     @ApiModelProperty(value = "tokenUrl") | 
 |  |  |     public String url; | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 
 |  |  | 
 |  |  |      */ | 
 |  |  |     @Override | 
 |  |  |     public List<Map<String,Object>> getList() { | 
 |  |  |        List<Map<String,Object>> lists= utilsMapper.getList("select * from service_telinfo where state=0 "); | 
 |  |  |        List<Map<String,Object>> lists= utilsMapper.getList("select * from service_telinfo where state=0  OR DATE_ADD(editTime, INTERVAL 10 MINUTE)< NOW()  "); | 
 |  |  |         return lists; | 
 |  |  |     } | 
 |  |  |     /** | 
 
 |  |  | 
 |  |  |             log.info("360查询条件为空"); | 
 |  |  |             throw new BaseException("360查询条件为空"); | 
 |  |  |         } | 
 |  |  |         String token = LSHospTokenUtil.getToken(serviceQueryInfo.getXiaoXiTou().getFaSongJGID()); | 
 |  |  |         String token = LSHospTokenUtil.getToken(serviceQueryInfo.getXiaoXiTou().getFaSongJGID(),serviceQueryInfo.getUrl()); | 
 |  |  | //        LyraTokenUtil lyraTokenUtil = null; | 
 |  |  | //        if (serviceQueryInfo.getXiaoXiTou().getFaSongJGID().equals("47255004333112711A1001"))  //景宁 | 
 |  |  | //            lyraTokenUtil = LyraTokenUtil.createLyraTokenUtil("https://9.0.124.104:13021/mediinfo-lyra-authserver/connect/token", "zjhes.suifangxt", "OIjdJvx2ALjFVGZoCZO4I8O"); |