From 4f0266dedafcad212c34bd0fec0e4fab1459b127 Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 13 十二月 2023 19:52:08 +0800
Subject: [PATCH] zjh 2023/12/13--1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java      |   12 ++++--
 ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java |    5 +-
 ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java     |   60 +++++++++++++++++++-----------
 3 files changed, 49 insertions(+), 28 deletions(-)

diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
index e9981ed..dd1839f 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
+++ b/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);
                     }
                 }
diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
index cdb13b2..4173982 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/sqlserver/TjSqlController.java
+++ b/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鐨勬暟閲�(寰堝鍗氬鐬庤瑕佹寚瀹欼nteger.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鐨勬暟閲�(寰堝鍗氬鐬庤瑕佹寚瀹欼nteger.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();
     }
 
 
diff --git a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java b/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java
index 4b94f93..e074882 100644
--- a/ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java
+++ b/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) {

--
Gitblit v1.8.0