ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
@@ -1362,7 +1362,6 @@ for (TjOrderRemark remark : list) { TjProject byId = projectService.getById(remark.getProId()); stringBuilder.append(byId.getProName()).append(";"); getDgYjAjaxResult(orderId,remark.getDeptId()); } customer.setNotCheckeds(String.valueOf(stringBuilder)); if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); @@ -1441,11 +1440,11 @@ for (TjOrderRemark remark : list) { TjProject byId = projectService.getById(remark.getProId()); stringBuilder.append(byId.getProName()).append(";"); getDgWjAjaxResult(orderId,remark.getDeptId()); } customer.setNotCheckeds(String.valueOf(stringBuilder)); if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); } customerLis.add(customer); } } @@ -1467,6 +1466,7 @@ List<TjOrderDetail> lists = tjOrderDetailService.list(qww); if (null == lists || lists.size() == 0) { redisCache.deleteCacheMapValue("ks"+ksId+customer.getCusId(),"1"); redisCache.setCacheMapValue("ks:"+ksId+":"+customer.getCusId(),"0",customer); } if (null != customer) { //遍历项目 判断是否有重大阳性 标记 @@ -1561,6 +1561,7 @@ customer.setNotCheckeds(String.valueOf(stringBuilder)); if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); } redisCache.setCacheMapValue("ks"+ksId+":"+customer.getCusId(),"1",customer); redisCache.setCacheMapValue("ks"+ksId+":"+customer.getCusId(),"0",customer); } } ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
@@ -1,10 +1,13 @@ package com.ltkj.web.controller.sqlserver; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.core.redis.RedisCache; import com.ltkj.common.enums.DataSourceType; import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; import com.ltkj.hosp.domain.TjOrder; import com.ltkj.hosp.domain.TjOrderRemark; import com.ltkj.hosp.service.*; import com.ltkj.hosp.sqlDomain.*; import com.ltkj.hosp.mapper.TestMapper; @@ -56,31 +59,44 @@ public RedisTemplate<Object,Object> redisTemplate; @Resource private RedisCache redisCache; @Resource private TjAsyncService asyncService; @Resource private ITjOrderRemarkService remarkService; @Resource private ITjOrderService orderService; @GetMapping("/getRedisValue") @ApiOperation(value = "测试redis模糊查询") public AjaxResult getRedisValue(@RequestParam String aa) { long start = System.currentTimeMillis(); //需要匹配的key ScanOptions options = ScanOptions.scanOptions() //这里指定每次扫描key的数量(很多博客瞎说要指定Integer.MAX_VALUE,这样的话跟 keys有什么区别?) .count(10000) .match(aa+"*").build(); RedisSerializer<String> redisSerializer = (RedisSerializer<String>) redisTemplate.getKeySerializer(); Cursor cursor = redisTemplate.executeWithStickyConnection(redisConnection -> new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize)); List<Object> result = new ArrayList<>(); while(cursor.hasNext()){ String s = cursor.next().toString(); redisCache.deleteObject(s); public AjaxResult getRedisValue() { // long start = System.currentTimeMillis(); // //需要匹配的key // ScanOptions options = ScanOptions.scanOptions() // //这里指定每次扫描key的数量(很多博客瞎说要指定Integer.MAX_VALUE,这样的话跟 keys有什么区别?) // .count(10000) // .match(aa+"*").build(); // RedisSerializer<String> redisSerializer = (RedisSerializer<String>) redisTemplate.getKeySerializer(); // Cursor cursor = redisTemplate.executeWithStickyConnection(redisConnection -> new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize)); // List<Object> result = new ArrayList<>(); // while(cursor.hasNext()){ // String s = cursor.next().toString(); // redisCache.deleteObject(s); // } // //切记这里一定要关闭,否则会耗尽连接数。报Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a // cursor.close(); //// System.out.println(result); // log.info("scan扫描共耗时:{} ms key数量:{}",System.currentTimeMillis()-start,result.size()); // Map<String,Object>map=new HashMap<>(); // map.put("result",result); // map.put("scan扫描共耗时:{} ms key数量:{}",System.currentTimeMillis()-start+result.size()); List<TjOrderRemark> list = remarkService.list(new LambdaQueryWrapper<TjOrderRemark>().ne(TjOrderRemark::getType,2).groupBy(TjOrderRemark::getTjNumber)); for (TjOrderRemark remark : list) { TjOrder orderByTjNum = orderService.getOrderByTjNum(remark.getTjNumber()); if(null !=orderByTjNum){ asyncService.dockerSetWjCustomerByRedis(orderByTjNum.getOrderId(),remark.getDeptId()); asyncService.dockerSetYjCustomerByRedis(orderByTjNum.getOrderId(),remark.getDeptId()); } } //切记这里一定要关闭,否则会耗尽连接数。报Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a cursor.close(); // System.out.println(result); log.info("scan扫描共耗时:{} ms key数量:{}",System.currentTimeMillis()-start,result.size()); Map<String,Object>map=new HashMap<>(); map.put("result",result); map.put("scan扫描共耗时:{} ms key数量:{}",System.currentTimeMillis()-start+result.size()); return AjaxResult.success(map); return AjaxResult.success(); } ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java
@@ -300,29 +300,33 @@ // 0未检,1已检 if (type == 0) { // Cursor cursor = redisTemplate.executeWithStickyConnection(redisConnection -> new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize)); // List<TjCustomer> customers = new ArrayList<>(); // while(cursor.hasNext()){ // String s = cursor.next().toString(); // TjCustomer wj = redisCache.getCacheMapValue(s,"0"); // if(null !=wj){ // customerLists.add(wj); // customers.add(wj); // } // } // //切记这里一定要关闭,否则会耗尽连接数。报Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a //// //切记这里一定要关闭,否则会耗尽连接数。报Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a // cursor.close(); customerLists = redisCache.getCacheMapValue(ksId + "ks", "wj"); // customerLists = customers; } if (type == 1) { // Cursor cursor = redisTemplate.executeWithStickyConnection(redisConnection -> new ConvertingCursor<>(redisConnection.scan(options), redisSerializer::deserialize)); // List<TjCustomer> customers = new ArrayList<>(); // while(cursor.hasNext()){ // String s = cursor.next().toString(); // TjCustomer wj = redisCache.getCacheMapValue(s,"1"); // if(null !=wj){ // customerLists.add(wj); // customers.add(wj); // } // } // //切记这里一定要关闭,否则会耗尽连接数。报Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a //// //切记这里一定要关闭,否则会耗尽连接数。报Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a // cursor.close(); customerLists = redisCache.getCacheMapValue(ksId + "ks", "yj"); // customerLists = customers; } asyncService.dockerSetCustomerLisByRedis(ksproList, String.valueOf(ksId)); if (null !=customerLists && customerLists.size() > 0) {