From 5978bf12f908c76e18dd229293bdedd729e1183c Mon Sep 17 00:00:00 2001
From: zjh <1084500556@qq.com>
Date: 星期三, 31 七月 2024 14:38:39 +0800
Subject: [PATCH] zjh 2024/07/31-1

---
 ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysDeptController.java |  799 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 701 insertions(+), 98 deletions(-)

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 c6a8590..ab97ccf 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
@@ -1,30 +1,40 @@
 package com.ltkj.web.controller.system;
 
 import java.io.*;
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
 import java.util.stream.Collectors;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.json.JSONArray;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.base.Joiner;
+import com.ltkj.common.core.domain.TreeSelect;
+import com.ltkj.common.core.domain.entity.SysRole;
 import com.ltkj.common.core.domain.entity.SysUser;
 import com.ltkj.common.core.redis.RedisCache;
+import com.ltkj.common.core.text.Convert;
 import com.ltkj.common.utils.SecurityUtils;
 import com.ltkj.common.utils.bean.BeanUtils;
 import com.ltkj.framework.config.MatchUtils;
 import com.ltkj.hosp.domain.*;
+import com.ltkj.hosp.mapper.TestMapper;
 import com.ltkj.hosp.service.*;
 import com.ltkj.system.domain.SysPost;
 import com.ltkj.system.domain.SysUserPost;
-import com.ltkj.system.service.ISysPostService;
-import com.ltkj.system.service.ISysUserPostService;
-import com.ltkj.system.service.ISysUserService;
+import com.ltkj.system.service.*;
+import com.ltkj.web.controller.his.HisApiGetMethodService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.ArrayUtils;
 import org.apache.ibatis.jdbc.Null;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -44,7 +54,6 @@
 import com.ltkj.common.core.domain.entity.SysDept;
 import com.ltkj.common.enums.BusinessType;
 import com.ltkj.common.utils.StringUtils;
-import com.ltkj.system.service.ISysDeptService;
 
 import javax.annotation.Resource;
 
@@ -56,6 +65,7 @@
 @RestController
 @RequestMapping("/system/dept")
 @Api(tags = "绉戝閮ㄩ棬淇℃伅")
+@Slf4j
 public class SysDeptController extends BaseController implements Serializable {
     @Resource
     private ISysDeptService deptService;
@@ -97,7 +107,16 @@
     private ITjRulesService tjRulesService;
     @Autowired
     public RedisTemplate<Object,Object> redisTemplate;
-
+    @Resource
+    private TestMapper testMapper;
+    @Autowired
+    private ISysConfigService configService;
+    @Autowired
+    private ITjFlowingWaterService tjFlowingWaterService;
+    @Autowired
+    private HisApiGetMethodService hisApiGetMethodService;
+    @Autowired
+    private LtkjJianchajianyanTreeService ltkjJianchajianyanTreeService;
 
     /**
      * 璇ヤ綋妫�绉戝涓嬪鎴峰垪琛ㄦ樉绀烘帴鍙�
@@ -391,7 +410,9 @@
                             StringBuilder stringBuilder = new StringBuilder();
                             for (TjOrderRemark remark : list) {
                                 TjProject byId = projectService.getById(remark.getProId());
-                                stringBuilder.append(byId.getProName()).append(";");
+                                if(null !=byId){
+                                    stringBuilder.append(byId.getProName()).append(";");
+                                }
                             }
                             customer.setNotCheckeds(String.valueOf(stringBuilder));
                             if (null == customer.getNotCheckeds()) customer.setNotCheckeds("鍏ㄩ儴宸叉");
@@ -416,49 +437,63 @@
      * 鍖栭獙妫�鏌ラ〉闈㈠垪琛�
      */
     @GetMapping("/huaYangetProList")
-    @ApiOperation("褰卞儚/鍖栭獙妫�鏌ラ〉闈㈠垪琛�")
+    @ApiOperation("鍖栭獙妫�鏌ラ〉闈㈠垪琛�")
     public AjaxResult huaYangetProList(@ApiParam(value = "浣撴鍗曞彿") @RequestParam(required = false) String tjNumber,
                                  @ApiParam(value = "0鏈,1宸叉") @RequestParam(defaultValue = "0") Integer type,
                                  @ApiParam(value = "濮撳悕)") @RequestParam(required = false) String name,
                                  @ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer page,
                                  @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize) {
-        String userId = SecurityUtils.getLoginUser().getUserId();
-        Integer ksId = null;
-        SysUser sysUser = null;
-        if (null != userId) {
-            sysUser = userService.getById(Long.valueOf(userId));
-            if (null != sysUser) {
-                ksId = Math.toIntExact(sysUser.getDeptId());
-            }
-        }
-        if (ksId == null) {
-            return AjaxResult.error("璇疯緭鍏ョ瀹d");
-        }
+//        String userId = SecurityUtils.getLoginUser().getUserId();
+//        Integer ksId = null;
+//        SysUser sysUser = null;
+//        if (null != userId) {
+//            sysUser = userService.getById(Long.valueOf(userId));
+//            if (null != sysUser) {
+//                ksId = Math.toIntExact(sysUser.getDeptId());
+//            }
+//        }
+//        if (ksId == null) {
+//            return AjaxResult.error("璇疯緭鍏ョ瀹d");
+//        }
+
+        //A30鍖栭獙
         //鏍规嵁褰撳墠鐧婚檰鐨勪汉鐨勭瀹d锛岃幏鍙栬绉戝涓嬬殑鎵�鏈夐」鐩�
-        List<Long> postIds = sysUser.getPostIds();
+//        List<Long> postIds = sysUser.getPostIds();
         List<Long> ksproList = null;
-        if (postIds != null) {
-            for (Long postId : postIds) {
-                LambdaQueryWrapper<SysUserPost> wq111 = new LambdaQueryWrapper<>();
-                wq111.eq(SysUserPost::getPostId, postId);
-                SysUserPost one = userPostService.getOne(wq111);
-                if (one != null) {
-                    SysPost byId = postService.getById(one.getPostId());
-                    if (byId.getPostName().equals("褰曞叆鍛�")) {
-                        ksproList = projectService.getKsTjProjectIdListBydeptId(String.valueOf(ksId));
-                    }
-                }
-            }
-        } else {
-            ksproList = projectService.getKsTjProjectIdList();
-        }
+//        if (postIds != null) {
+//            for (Long postId : postIds) {
+//                LambdaQueryWrapper<SysUserPost> wq111 = new LambdaQueryWrapper<>();
+//                wq111.eq(SysUserPost::getPostId, postId);
+//                SysUserPost one = userPostService.getOne(wq111);
+//                if (one != null) {
+//                    SysPost byId = postService.getById(one.getPostId());
+//                    if (byId.getPostName().equals("褰曞叆鍛�")) {
+//                        ksproList = projectService.getKsTjProjectIdListBydeptId(String.valueOf(ksId));
+//                    }
+//                }
+//            }
+//        } else {
+//            ksproList = projectService.getKsTjProjectIdList();
+//        }
+
+//        if(sysUser.getUserName().equals("10001")){
+            ksproList = projectService.getHuaYanProId();
+//        }
+//        else {
+//            ksproList = projectService.getKsTjProjectIdListBydeptId(String.valueOf(ksId));
+//        }
 
         if (ksproList == null || ksproList.size() == 0) {
             return AjaxResult.error("璇峰畬鍠勭瀹ら」鐩俊鎭�");
         }
+        //绛涢�夊寲楠岀殑椤圭洰銆�
+//        ksproList = ksproList.stream()
+//                .filter(element -> element ==1633660948860522629L)
+//                .collect(Collectors.toList());
+
         List<TjCustomer> customerLis = new ArrayList<>();
 
-        //鏍规嵁浣撴鍙锋煡
+/*        //鏍规嵁浣撴鍙锋煡
         if (null != tjNumber) {
             List<TjOrder> orderList = orderService.getOrderListByLikeTjNum(tjNumber);
             if (null == orderList) {
@@ -594,27 +629,477 @@
                 return AjaxResult.success("鏆傛棤鏁版嵁");
             }
         }
-        List<TjCustomer> customerLists = new ArrayList<>();
+        List<TjCustomer> customerLists = null;*/
+//        //鏍规嵁浣撴鍙锋煡
+//        if (null != tjNumber) {
+//            List<TjOrder> orderList = orderService.getOrderListByLikeTjNum(tjNumber);
+//            if (null == orderList) {
+//                return AjaxResult.success("鏆傛椂娌℃湁鏁版嵁");
+//            }
+//            for (TjOrder order : orderList) {
+//                List<TjOrderDetail> list = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get();
+//                if (list.size() == 0) {
+//                    continue;
+//                }
+//                LambdaQueryWrapper<TjOrderRemark> wqs = new LambdaQueryWrapper<>();
+//                wqs.eq(TjOrderRemark::getTjNumber, order.getTjNumber());
+//                wqs.in(TjOrderRemark::getType, 0,3);
+//                List<TjOrderRemark> lists = remarkService.list(wqs);
+//                TjCustomer customer = customerService.getById(order.getUserId());
+//
+//                //閬嶅巻椤圭洰 鍒ゆ柇鏄惁鏈夐噸澶ч槼鎬�  鏍囪
+//                for (TjOrderDetail tjOrderDetail11 : list) {
+//                    customer.setIsPositive(tjOrderDetail11.getIsPositive());
+//                    if (tjOrderDetail11.getIsPositive()==1){
+//                        break;
+//                    }
+//                }
+//
+//                customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
+//                customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
+//                customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
+//                if (null != lists && lists.size() > 0) {
+//                    StringBuilder stringBuilder = new StringBuilder();
+//                    for (TjOrderRemark remark : lists) {
+//                        TjProject byId = projectService.selectTjProjectByProId(remark.getProId());
+//                        TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId()));
+//                        if (one.getFlowingWaterId() != null) {
+//                            stringBuilder.append(byId.getProName()).append(";");
+//                        }
+//
+//                    }
+//                    customer.setNotCheckeds(String.valueOf(stringBuilder));
+//                    customer.setTjStatus(0L);
+//                } else {
+//                    customer.setTjStatus(1L);
+//                    customer.setNotCheckeds("鏃�");
+//                }
+//                if (order.getTjType().equals("1")) {
+//                    customer.setTjType("鍥綋");
+//                }
+//                if (order.getTjType().equals("2")) {
+//                    customer.setTjType("涓汉");
+//                }
+//                customer.setTjTime(order.getCreateTime());
+//                customer.setTjNumber(order.getTjNumber());
+//                customer.setOrderId(order.getOrderId());
+//                customer.setIsHz(order.getIsHz());
+//                customer.setTjCategory(order.getTjCategory());
+//                customerLis.add(customer);
+//            }
+//            if (customerLis.size() > 0) {
+//                List<TjCustomer> customerList = customerLis.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+//                Collections.reverse(customerList);
+//                Map<String, Object> map = new HashMap<>();
+//                map.put("date", customerList);
+//                map.put("total", customerLis.size());
+//                return AjaxResult.success(map);
+//            } else {
+//                return AjaxResult.success("鏆傛棤鏁版嵁");
+//            }
+//        }
+//
+//        //鏍规嵁濮撳悕鏌ヨ
+//        if (null != name && !"".equals(name)) {
+//            LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>();
+//            wq.like(TjCustomer::getCusName, name);
+//            List<TjCustomer> list = customerService.list(wq);
+//            List<TjCustomer> list11111 = new ArrayList<>();
+//            if (null != list && list.size() > 0) {
+//                for (TjCustomer customer : list) {
+//                    customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
+//                    customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
+//                    customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
+//                    List<TjOrder> orderList = orderService.getOrderListByCusId(String.valueOf(customer.getCusId()));
+//                    if (null != orderList && orderList.size() > 0) {
+//                        for (TjOrder order : orderList) {
+//                            List<TjOrderDetail> list111 = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get();
+//                            if (list111.size() == 0) {
+//                                continue;
+//                            }
+//                            //閬嶅巻椤圭洰 鍒ゆ柇鏄惁鏈夐噸澶ч槼鎬�  鏍囪
+//                            for (TjOrderDetail tjOrderDetail11 : list111) {
+//                                customer.setIsPositive(tjOrderDetail11.getIsPositive());
+//                                if (tjOrderDetail11.getIsPositive()==1){
+//                                    break;
+//                                }
+//                            }
+//                            List<TjOrderRemark> lists = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber());
+//                            if (null != lists && lists.size() > 0) {
+//                                StringBuilder stringBuilder = new StringBuilder();
+//                                for (TjOrderRemark remark : lists) {
+//                                    TjProject byId = projectService.selectTjProjectByProId(remark.getProId());
+//                                    TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId()));
+//                                    if (one.getFlowingWaterId() != null) {
+//                                        stringBuilder.append(byId.getProName()).append(";");
+//                                    }
+//                                }
+//                                customer.setNotCheckeds(String.valueOf(stringBuilder));
+//                                if (null == customer.getNotCheckeds()) customer.setNotCheckeds("鍏ㄩ儴宸叉");
+//                                customer.setTjStatus(0L);
+//                            } else {
+//                                customer.setNotCheckeds("鏃�");
+//                                customer.setTjStatus(1L);
+//                            }
+//                            if (order.getTjType().equals("1")) {
+//                                customer.setTjType("鍥綋");
+//                            }
+//                            if (order.getTjType().equals("2")) {
+//                                customer.setTjType("涓汉");
+//                            }
+//                            customer.setTjTime(order.getCreateTime());
+//                            customer.setTjNumber(order.getTjNumber());
+//                            customer.setOrderId(order.getOrderId());
+//                            customer.setIsHz(order.getIsHz());
+//                            customer.setTjCategory(order.getTjCategory());
+//                            list11111.add(customer);
+//                        }
+//                    }
+//                }
+//                if (list11111.size() == 0) {
+//                    return AjaxResult.success("鏆傛棤鏁版嵁");
+//                }
+//                Map<String, Object> map = new HashMap<>();
+//                List<TjCustomer> customers = list11111.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+//                Collections.reverse(customers);
+//                map.put("customers", customers);
+//                map.put("total", list11111.size());
+//                return AjaxResult.success(map);
+//            } else {
+//                return AjaxResult.success("鏆傛棤鏁版嵁");
+//            }
+//        }
+//        List<TjCustomer> customerLists = new ArrayList<>();
+
+//        String key="*";
+//        if(sysUser.isAdmin()){
+//            key="ks"+":*";
+//        }else {
+//            key="ks:"+ksId+":*";
+//        }
+//        ScanOptions options = ScanOptions.scanOptions()
+//                //杩欓噷鎸囧畾姣忔鎵弿key鐨勬暟閲�(寰堝鍗氬鐬庤瑕佹寚瀹欼nteger.MAX_VALUE锛岃繖鏍风殑璇濊窡        keys鏈変粈涔堝尯鍒紵)
+//                .count(10000)
+//                .match(key).build();
+//        RedisSerializer<String> redisSerializer = (RedisSerializer<String>) redisTemplate.getKeySerializer();
+//        0鏈,1宸叉
+        Map<String,Object> map=null;
         if (type == 0) {
-            customerLists = redisCache.getCacheMapValue(ksId + "ks", "wj");
+//            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){
+//                    customers.add(wj);
+//                }
+//            }
+////            //鍒囪杩欓噷涓�瀹氳鍏抽棴锛屽惁鍒欎細鑰楀敖杩炴帴鏁般�傛姤Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a
+//            cursor.close();
+//            customerLists = redisCache.getCacheMapValue(ksId + "ks", "wj");
+            map = deptService.getSysDeptHyAndYxYjWjCustomerList13("A30", name, tjNumber, 0, page, pageSize);
+//            customerLists = customers;
         }
         if (type == 1) {
-            customerLists = redisCache.getCacheMapValue(ksId + "ks", "yj");
+//            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){
+//                    customers.add(wj);
+//                }
+//            }
+////            //鍒囪杩欓噷涓�瀹氳鍏抽棴锛屽惁鍒欎細鑰楀敖杩炴帴鏁般�傛姤Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a
+//            cursor.close();
+//            customerLists = redisCache.getCacheMapValue(ksId + "ks", "yj");
+            map = deptService.getSysDeptHyAndYxYjWjCustomerList13("A30", name, tjNumber, 1, page, pageSize);
+//            customerLists = customers;
         }
-        asyncService.dockerSetCustomerLisByRedis(ksproList, String.valueOf(ksId));
-        if (customerLists != null && customerLists.size() > 0) {
-            Collections.reverse(customerLists);
-            List<TjCustomer> customerList = customerLists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
-            Map<String, Object> map = new HashMap<>();
-            map.put("date", customerList);
-            map.put("total", customerLists.size());
-            return AjaxResult.success(map);
-        } else {
-            AjaxResult map = getAjaxResult(type, page, pageSize, ksproList, customerLis);
-            if (map != null) return map;
-            return AjaxResult.success("鏆傛椂娌℃湁鏁版嵁");
-        }
+//        asyncService.dockerSetCustomerLisByRedis(ksproList, String.valueOf(ksId));
+//        AjaxResult map = getAjaxResult(type, page, pageSize, ksproList, customerLis);
+//        if (map != null) return map;
+        return AjaxResult.success(map);
     }
+
+
+    /**
+     * 褰卞儚妫�鏌ラ〉闈㈠垪琛�
+     */
+    @GetMapping("/yingXiangGetProList")
+    @ApiOperation("褰卞儚妫�鏌ラ〉闈㈠垪琛�")
+    public AjaxResult yingXiangGetProList(@ApiParam(value = "浣撴鍗曞彿") @RequestParam(required = false) String tjNumber,
+                                       @ApiParam(value = "0鏈,1宸叉") @RequestParam(defaultValue = "0") Integer type,
+                                       @ApiParam(value = "濮撳悕)") @RequestParam(required = false) String name,
+                                       @ApiParam(value = "椤电爜鏁�(榛樿1)") @RequestParam(defaultValue = "1") Integer page,
+                                       @ApiParam(value = "鏄剧ず鏉℃暟(榛樿10)") @RequestParam(defaultValue = "10") Integer pageSize) {
+/*        String userId = SecurityUtils.getLoginUser().getUserId();
+        Integer ksId = null;
+        SysUser sysUser = null;
+        if (null != userId) {
+            sysUser = userService.getById(Long.valueOf(userId));
+            if (null != sysUser) {
+                ksId = Math.toIntExact(sysUser.getDeptId());
+            }
+        }
+        if (ksId == null) {
+            return AjaxResult.error("璇疯緭鍏ョ瀹d");
+        }
+        //鏍规嵁褰撳墠鐧婚檰鐨勪汉鐨勭瀹d锛岃幏鍙栬绉戝涓嬬殑鎵�鏈夐」鐩�
+        List<Long> postIds = sysUser.getPostIds();
+        List<Long> ksproList = null;
+        if (postIds != null) {
+            for (Long postId : postIds) {
+                LambdaQueryWrapper<SysUserPost> wq111 = new LambdaQueryWrapper<>();
+                wq111.eq(SysUserPost::getPostId, postId);
+                SysUserPost one = userPostService.getOne(wq111);
+                if (one != null) {
+                    SysPost byId = postService.getById(one.getPostId());
+                    if (byId.getPostName().equals("褰曞叆鍛�")) {
+                        ksproList = projectService.getKsTjProjectIdListBydeptId(String.valueOf(ksId));
+
+                    }
+                }
+            }
+        } else {
+            ksproList = projectService.getKsTjProjectIdList();
+        }
+        //绛涢�夊奖鍍忕殑椤圭洰銆� A32褰卞儚
+        if (ksproList.size() == 0) {
+            return AjaxResult.error("璇峰畬鍠勭瀹ら」鐩俊鎭�");
+        }
+        ksproList = ksproList.stream()
+                .filter(element -> element ==1633660948860522589L
+//                        ||  element ==1633660948860522504L
+//                        ||
+//                        element ==1633660948860522507L||  element ==1633660948860522508L
+//                        ||
+//                        element ==1633660948860522515L||  element ==1633660948860522516L
+//                        ||
+//                        element ==1633660948860522517L||  element ==1633660948860522519L
+//                        ||
+//                        element ==1633660948860522524L||  element ==1633660948860522530L
+//                        ||
+//                        element ==1633660948860522531L||  element ==1633660948860522533L
+                )
+                .collect(Collectors.toList());*/
+
+
+//        List<Long> ksproList  = projectService.getYingXiangProId();
+//        List<TjCustomer> customerLis = new ArrayList<>();
+//
+//        //鏍规嵁浣撴鍙锋煡
+//        if (null != tjNumber) {
+//            List<TjOrder> orderList = orderService.getOrderListByLikeTjNum(tjNumber);
+//            if (null == orderList) {
+//                return AjaxResult.success("鏆傛椂娌℃湁鏁版嵁");
+//            }
+//            for (TjOrder order : orderList) {
+//                List<TjOrderDetail> list = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get();
+//                if (list.size() == 0) {
+//                    continue;
+//                }
+//                LambdaQueryWrapper<TjOrderRemark> wqs = new LambdaQueryWrapper<>();
+//                wqs.eq(TjOrderRemark::getTjNumber, order.getTjNumber());
+//                wqs.in(TjOrderRemark::getType, 0,3);
+//                List<TjOrderRemark> lists = remarkService.list(wqs);
+//                TjCustomer customer = customerService.getById(order.getUserId());
+//                //閬嶅巻椤圭洰 鍒ゆ柇鏄惁鏈夐噸澶ч槼鎬�  鏍囪
+//                for (TjOrderDetail tjOrderDetail11 : list) {
+//                    customer.setIsPositive(tjOrderDetail11.getIsPositive());
+//                    if (tjOrderDetail11.getIsPositive()==1){
+//                        break;
+//                    }
+//                }
+//                customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
+//                customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
+//                customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
+//                if (null != lists && lists.size() > 0) {
+//                    StringBuilder stringBuilder = new StringBuilder();
+//                    for (TjOrderRemark remark : lists) {
+//                        TjProject byId = projectService.selectTjProjectByProId(remark.getProId());
+//                        TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId()));
+//                        if (one.getFlowingWaterId() != null) {
+//                            stringBuilder.append(byId.getProName()).append(";");
+//                        }
+//
+//                    }
+//                    customer.setNotCheckeds(String.valueOf(stringBuilder));
+//                    customer.setTjStatus(0L);
+//                } else {
+//                    customer.setTjStatus(1L);
+//                    customer.setNotCheckeds("鏃�");
+//                }
+//                if (order.getTjType().equals("1")) {
+//                    customer.setTjType("鍥綋");
+//                }
+//                if (order.getTjType().equals("2")) {
+//                    customer.setTjType("涓汉");
+//                }
+//                customer.setTjTime(order.getCreateTime());
+//                customer.setTjNumber(order.getTjNumber());
+//                customer.setOrderId(order.getOrderId());
+//                customer.setIsHz(order.getIsHz());
+//                customerLis.add(customer);
+//
+//            }
+//            if (customerLis.size() > 0) {
+//                List<TjCustomer> customerList = customerLis.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+//                Collections.reverse(customerList);
+//                Map<String, Object> map = new HashMap<>();
+//                map.put("date", customerList);
+//                map.put("total", customerLis.size());
+//                return AjaxResult.success(map);
+//            } else {
+//                return AjaxResult.success("鏆傛棤鏁版嵁");
+//            }
+//        }
+//
+//        //鏍规嵁濮撳悕鏌ヨ
+//        if (null != name && !"".equals(name)) {
+//            LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>();
+//            wq.like(TjCustomer::getCusName, name);
+//            List<TjCustomer> list = customerService.list(wq);
+//            List<TjCustomer> list11111 = new ArrayList<>();
+//            if (null != list && list.size() > 0) {
+//                for (TjCustomer customer : list) {
+//                    customer.setCusName(MatchUtils.hideCusName(customer.getCusName()));
+//                    customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone()));
+//                    customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard()));
+//                    List<TjOrder> orderList = orderService.getOrderListByCusId(String.valueOf(customer.getCusId()));
+//                    if (null != orderList && orderList.size() > 0) {
+//                        for (TjOrder order : orderList) {
+//                            List<TjOrderDetail> list111 = Optional.ofNullable(detailService.getTjOrderDetailListByOrderId(String.valueOf(order.getOrderId()))).get();
+//                            if (list111.size() == 0) {
+//                                continue;
+//                            }
+//                            //閬嶅巻椤圭洰 鍒ゆ柇鏄惁鏈夐噸澶ч槼鎬�  鏍囪
+//                            for (TjOrderDetail tjOrderDetail11 : list111) {
+//                                customer.setIsPositive(tjOrderDetail11.getIsPositive());
+//                                if (tjOrderDetail11.getIsPositive()==1){
+//                                    break;
+//                                }
+//                            }
+//                            List<TjOrderRemark> lists = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber());
+//                            if (null != lists && lists.size() > 0) {
+//                                StringBuilder stringBuilder = new StringBuilder();
+//                                for (TjOrderRemark remark : lists) {
+//                                    TjProject byId = projectService.selectTjProjectByProId(remark.getProId());
+//                                    TjOrderDetail one = detailService.getTjOrderDetailByOrderId(String.valueOf(order.getOrderId()), String.valueOf(byId.getProId()));
+//                                    if (one.getFlowingWaterId() != null) {
+//                                        stringBuilder.append(byId.getProName()).append(";");
+//                                    }
+//                                }
+//                                customer.setNotCheckeds(String.valueOf(stringBuilder));
+//                                if (null == customer.getNotCheckeds()) customer.setNotCheckeds("鍏ㄩ儴宸叉");
+//                                customer.setTjStatus(0L);
+//                            } else {
+//                                customer.setNotCheckeds("鏃�");
+//                                customer.setTjStatus(1L);
+//                            }
+//                            if (order.getTjType().equals("1")) {
+//                                customer.setTjType("鍥綋");
+//                            }
+//                            if (order.getTjType().equals("2")) {
+//                                customer.setTjType("涓汉");
+//                            }
+//                            customer.setTjTime(order.getCreateTime());
+//                            customer.setTjNumber(order.getTjNumber());
+//                            customer.setOrderId(order.getOrderId());
+//                            customer.setIsHz(order.getIsHz());
+//                            list11111.add(customer);
+//                        }
+//                    }
+//                }
+//                if (list11111.size() == 0) {
+//                    return AjaxResult.success("鏆傛棤鏁版嵁");
+//                }
+//                Map<String, Object> map = new HashMap<>();
+//                List<TjCustomer> customers = list11111.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+//                Collections.reverse(customers);
+//                map.put("customers", customers);
+//                map.put("total", list11111.size());
+//                return AjaxResult.success(map);
+//            } else {
+//                return AjaxResult.success("鏆傛棤鏁版嵁");
+//            }
+//        }
+//        List<TjCustomer> customerLists = null;
+        Map<String,Object> map=null;
+        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){
+//                    customers.add(wj);
+//                }
+//            }
+////            //鍒囪杩欓噷涓�瀹氳鍏抽棴锛屽惁鍒欎細鑰楀敖杩炴帴鏁般�傛姤Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a
+//            cursor.close();
+//            customerLists = redisCache.getCacheMapValue(ksId + "ks", "wj");
+            map = deptService.getSysDeptHyAndYxYjWjCustomerList13("A32", name, tjNumber, 0, page, pageSize);
+//            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){
+//                    customers.add(wj);
+//                }
+//            }
+////            //鍒囪杩欓噷涓�瀹氳鍏抽棴锛屽惁鍒欎細鑰楀敖杩炴帴鏁般�傛姤Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisException: Could not get a
+//            cursor.close();
+//            customerLists = redisCache.getCacheMapValue(ksId + "ks", "yj");
+            map = deptService.getSysDeptHyAndYxYjWjCustomerList13("A32", name, tjNumber, 1, page, pageSize);
+//            customerLists = customers;
+        }
+//        asyncService.dockerSetCustomerLisByRedis(ksproList, String.valueOf(ksId));
+//        if (customerLists.size() > 0) {
+//            Collections.reverse(customerLists);
+//            List<TjCustomer> customerList = customerLists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList());
+//            Map<String, Object> map = new HashMap<>();
+//            map.put("date", customerList);
+//            map.put("total", customerLists.size());
+//            return AjaxResult.success(map);
+//        } else {
+//            AjaxResult map = getAjaxResult(type, page, pageSize, ksproList, customerLis);
+//            if (map != null) return map;
+//            return AjaxResult.success("鏆傛椂娌℃湁鏁版嵁");
+        return AjaxResult.success(map);
+//        }
+    }
+
+
+    @GetMapping("/getTjYxjcList")
+    @ApiOperation("鏌ヨ涓汉褰卞搷妫�鏌ラ」鐩粨鏋滈泦")
+    public AjaxResult getTjYxjcList(@ApiParam(value = "濮撳悕") @RequestParam String patname,
+                                    @ApiParam(value = "鎬у埆") @RequestParam String sex,
+                                    @ApiParam(value = "骞撮緞") @RequestParam String patage,
+                                    @ApiParam(value = "骞撮緞鍗曚綅") @RequestParam String patagename,
+                                    @ApiParam(value = "鐢熸棩)") @RequestParam Date patbirth) {
+
+        String format = DateUtil.format(patbirth, "yyyy.MM.dd");
+
+        List<Map<String, Object>> tjYxjcList = testMapper.getTjYxjcList(patname,sex,null);
+        return AjaxResult.success(tjYxjcList);
+    }
+
+
+//    @GetMapping("/getSsTjYxjcList")
+//    @ApiOperation("鏌ヨ涓汉褰卞搷妫�鏌ラ」鐩粨鏋滈泦(鎼滅礌鐢�)")
+//    public AjaxResult getSsTjYxjcList(@ApiParam(value = "濮撳悕") @RequestParam String patname,
+//                                    @ApiParam(value = "鎬у埆") @RequestParam String sex,
+//                                    @ApiParam(value = "骞撮緞") @RequestParam String patage) {
+//
+//
+//        List<Map<String, Object>> tjYxjcList = testMapper.getTjYxjcList(patname,sex,null,null);
+//        return AjaxResult.success(tjYxjcList);
+//    }
 
 
 
@@ -767,6 +1252,10 @@
         return toAjax(deptService.insertDept(dept));
     }
 
+
+    @Resource
+    private IDictHospService dictHospService;
+
     /**
      * 淇敼绉戝閮ㄩ棬
      */
@@ -785,6 +1274,16 @@
             return error("璇ラ儴闂ㄥ寘鍚湭鍋滅敤鐨勫瓙閮ㄩ棬锛�");
         }
         dept.setUpdateBy(getUsername());
+
+        //鏌ヨ闄㈠尯鍚嶅瓧璧嬪��
+        if (dept.getHospId()!=null){
+            final DictHosp byId = dictHospService.getById(dept.getHospId());
+            if (byId!=null){
+                dept.setHospName(byId.getHospAreaName());
+            }
+        }
+
+
         return toAjax(deptService.updateDept(dept));
     }
 
@@ -882,7 +1381,7 @@
                     if (null != summaryList && summaryList.size()>0 && !summaryList.contains(null)) {
                         one.setSummary(Joiner.on(";").join(orderRemark.getSummaryList()));
                     }
-                    one.setDeptId(orderRemark.getDeptId());
+//                    one.setDeptId(orderRemark.getDeptId());
                     one.setDoctorName(orderRemark.getDoctorName());
                     one.setType(1);
                     remarkService.updateById(one);
@@ -903,6 +1402,7 @@
      * @param tjNumber
      * @return
      */
+//    @Transactional
     @GetMapping("/getParentList")
     @ApiOperation(value = "鍖荤敓鐐瑰嚮浣撴淇℃伅璇︽儏(鍙樉绀虹埗椤圭洰鍒楄〃)")
     public AjaxResult getParentList(@ApiParam(value = "瀹㈡埛浣撴鍙�") @RequestParam String tjNumber) {
@@ -916,6 +1416,76 @@
             }
             ksId = Math.toIntExact(sysUser.getDeptId());
         }
+        String configByKey = configService.selectConfigByKey("sfkqdyhis");
+        if (configByKey.equals("Y")){
+            // 鍒ゆ柇鏄惁鏀惰垂 璇锋眰鎺ュ彛
+            LambdaQueryWrapper<TjOrder> tjOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            tjOrderLambdaQueryWrapper.eq(TjOrder::getTjNumber,tjNumber);
+            TjOrder tjOrder = orderService.getOne(tjOrderLambdaQueryWrapper);
+            LambdaQueryWrapper<TjFlowingWater> tjFlowingWaterLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            tjFlowingWaterLambdaQueryWrapper.eq(TjFlowingWater::getOrderId,tjOrder.getOrderId());
+            tjFlowingWaterLambdaQueryWrapper.ne(TjFlowingWater::getPayStasus,2);
+            tjFlowingWaterLambdaQueryWrapper.eq(TjFlowingWater::getIsAddition,"N");
+            TjFlowingWater tjFlowingWater = tjFlowingWaterService.getOne(tjFlowingWaterLambdaQueryWrapper);
+
+                HashMap<String, Object> hisRequestParams = new HashMap<>();
+                // 涓嶅湪闇�瑕佽韩浠借瘉鍙�
+                hisRequestParams.put("patientId",tjOrder.getCardId());
+                AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams);
+                if (Integer.parseInt(queryPay.get("code").toString()) == 200) {
+//                    List<Map<String, String>> data = (List<Map<String, String>>) queryPay.get("data");
+//                    BigDecimal cateFeeAll = BigDecimal.ZERO;
+//                    for (Map<String, String> datum : data) {
+//                        BigDecimal cateFee = new BigDecimal(datum.get("CateFee"));
+//                        cateFeeAll = cateFeeAll.add(cateFee);
+//                    }
+//                    BigDecimal fyhj = ltkjJianchajianyanTreeService.getLtkjJianchajianyanTreeFyhjByCardId(tjOrder.getCardId());
+//                    if (cateFeeAll.compareTo(fyhj) != 0){
+//                        return AjaxResult.error("瀛樺湪鏈即璐归」鐩�");
+//                    }
+
+                    int sfsf = ltkjJianchajianyanTreeService.getSfsfByCardId(tjOrder.getCardId());
+                    if (sfsf > 0){
+                        log.error("璺嘲绉戞妧---  "+DateUtil.date()+" 瀛樺湪鏈即璐归」鐩殑 灏卞崟鏁�  "+sfsf);
+                        log.error("璺嘲绉戞妧---  "+DateUtil.date()+" 瀛樺湪鏈即璐归」鐩殑 灏辫瘖鍙�  "+tjOrder.getCardId()+" 浣撴鍙� "+tjOrder.getTjNumber());
+                        return AjaxResult.error("瀛樺湪鏈即璐归」鐩�");
+                    }
+
+                    extracted(tjOrder, tjFlowingWater);
+                }else {
+                    log.error("璺嘲绉戞妧--- "+DateUtil.date()+" 鏈煡璇㈠埌缂磋垂璁板綍鐨� 灏辫瘖鍙�  "+tjOrder.getCardId()+" 浣撴鍙� "+tjOrder.getTjNumber());
+                    return AjaxResult.error("鏈煡璇㈠埌缂磋垂璁板綍");
+                }
+//            }
+        }
+        String config = configService.selectConfigByKey("qt_open_xdt");
+        String byKey = configService.selectConfigByKey("qt_kjksid");
+        List<Integer> split = new ArrayList<>(); // 瀛樻斁杞崲鍚庣殑integer绫诲瀷缁撴灉
+        if("Y".equals(config)){
+            List<SysRole> roles = SecurityUtils.getLoginUser().getUser().getRoles();
+            if(null !=roles && roles.size()>0){
+                List<SysRole> list = roles.stream().filter(item -> item.getRoleName().contains("鍓嶅彴")).collect(Collectors.toList());
+                if(list.size()>0){
+                    if(null !=ksId && ksId==100){
+                        ksId=999;
+                    }
+                    if(null !=byKey && !"".equals(byKey)){
+                        String[] arr = byKey.split(","); // 鏍规嵁閫楀彿杩涜鍒囧壊
+                        for (String s : arr) {
+                            int num = Integer.parseInt(s); // 灏嗘瘡涓瓙瀛楃涓茶浆鎹负integer绫诲瀷
+                            split.add(num); // 娣诲姞鍒板垪琛ㄤ腑
+                        }
+                    }
+                }else {
+                    split.add(ksId);
+                }
+            }else {
+                split.add(ksId);
+            }
+        }else {
+            split.add(ksId);
+        }
+
         //鍒ゆ柇褰撳墠鐧婚檰鐨勪汉鏄笉鏄鐞嗗憳銆傜鐞嗗憳鍙互鐪嬪綋鍓嶄綋妫�鍙蜂笅鎵�鏈夐」鐩�
 //        if (sysUser.getUserName().equals("10001")) {
 //            QueryWrapper<TjOrderRemark> wqq = new QueryWrapper<>();
@@ -934,7 +1504,7 @@
 //        }
         LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>();
         if ((null != sysUser && !sysUser.getUserName().equals("10001")) && 100!=ksId) {
-            wq2.eq(TjProject::getDeptId, ksId);
+            wq2.in(TjProject::getDeptId,split);
         }
         //鍒ゆ柇璇ラ」鐩槸鍚﹂渶瑕佹墦鍗版姤鍛�
         wq2.eq(TjProject::getNeedReport,"Y");
@@ -951,6 +1521,7 @@
             wqq.eq(TjOrderDetail::getOrderId, one.getOrderId());
             wqq.isNotNull(TjOrderDetail::getFlowingWaterId);
             wqq.in(TjOrderDetail::getProId, proIdList);
+            wqq.notIn(TjOrderDetail::getProId, proIdList,projectService.getNneedReprotProId());
             List<TjOrderDetail> detailList = detailService.list(wqq);
             if (detailList != null && detailList.size() > 0) {
                 List<Long> collect = detailList.stream().map(TjOrderDetail::getProId).collect(Collectors.toList());
@@ -958,6 +1529,8 @@
                 wq.eq("tj_number", tjNumber);
                 wq.in("pro_id", collect);
                 wq.ne("type", 2);
+                wq.ne("dept_id",241);
+                wq.notIn("pro_id", proIdList,projectService.getNneedReprotProId());
                 List<TjOrderRemark> list = remarkService.list(wq);
                 if (list.size() == 0) {
                     return AjaxResult.success("璇ョ瀹や笅鏃犻」鐩紒");
@@ -973,6 +1546,23 @@
             return AjaxResult.success();
         }
         return AjaxResult.error();
+    }
+
+    @Transactional
+    private void extracted(TjOrder tjOrder, TjFlowingWater tjFlowingWater) {
+        tjFlowingWater.setPayStasus(1L);
+        tjFlowingWater.setPayType(0L);
+        tjFlowingWater.setTollCollectorId("148");
+        tjFlowingWaterService.updateById(tjFlowingWater);
+        Long tjSerialNumber = tjFlowingWater.getTjSerialNumber();
+        LambdaQueryWrapper<TjOrderDetail> tjOrderDetailLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        tjOrderDetailLambdaQueryWrapper.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId());
+        List<TjOrderDetail> tjOrderDetails = detailService.list(tjOrderDetailLambdaQueryWrapper);
+        List<Long> detailIds = tjOrderDetails.stream().map(TjOrderDetail::getOrderDetailId).collect(Collectors.toList());
+        LambdaUpdateWrapper<TjOrderDetail> tjOrderDetailLambdaUpdateWrapper = new LambdaUpdateWrapper<>();
+        tjOrderDetailLambdaUpdateWrapper.set(TjOrderDetail::getFlowingWaterId,tjSerialNumber);
+        tjOrderDetailLambdaUpdateWrapper.in(TjOrderDetail::getOrderDetailId,detailIds);
+        detailService.update(tjOrderDetailLambdaUpdateWrapper);
     }
 
     /**
@@ -994,7 +1584,10 @@
 //        }
 
         TjOrderRemark remark = remarkService.getTjOrderRemarkByTjNumAndProParentId(tjNumber, proParentId);
-        List<TjProject> proParentList = projectService.getTjProjectListBySoneId(proParentId);
+
+//        List<TjProject> proParentList = projectService.getTjProjectListBySoneId(proParentId);
+        List<TjProject> proParentList = projectService.getTjProjectListByTbTransition(proParentId,tjNumber);
+
         if (null == proParentList || proParentList.size()==0) {
             Map<String, Object> map = new HashMap<>();
             map.put("xiaoJieIds", null);
@@ -1009,6 +1602,7 @@
             return AjaxResult.success("璇ョ敤鎴锋殏鏃舵病鏈変綋妫�鏁版嵁");
         }
         List<TjOrderDetail> tjOrderDetails = detailService.getTjOrderDetailListInProParentIdList(String.valueOf(one.getOrderId()), proParentIdList);
+        List<TjOrderDetail> tjOrderDetailList=new ArrayList<>();
         TjCustomer customer = tjCustomerService.getById(one.getUserId());
         if (null != tjOrderDetails && tjOrderDetails.size() > 0) {
             for (TjOrderDetail tjOrderDetail : tjOrderDetails) {
@@ -1031,50 +1625,50 @@
                 tjOrderDetail.setRulesList(rulesList);
 
                 //鏌ユ爣鍑嗗拰鍗曚綅----start
-                List<TjStandard> list26 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId()));
-                if (list26.size() == 0) {
-                    project.setProMetering("/");
-                    project.setProScope("/");
-                } else if (list26.size() == 1) {
-                    project.setProMetering(list26.get(0).getCompany() == null ? " " : list26.get(0).getCompany());
-                    project.setProScope((list26.get(0).getTjStandardLtValue() == null ? " " : list26.get(0).getTjStandardLtValue()) + "-" + (list26.get(0).getTjStandardGtValue() == null ? " " : list26.get(0).getTjStandardGtValue()));
-                } else {
-                    Long cusSex = customer.getCusSex();
-                    Date cusBrithday = customer.getCusBrithday();
-                    int age = DateUtil.ageOfNow(cusBrithday);
-                    for (TjStandard tjStandard : list26) {
-                        LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>();
-                        if (tjStandard.getTjSex() != null) {
-                            wq8.eq(TjStandard::getTjSex, cusSex);
-                        }
-                        if (tjStandard.getTjType() != null) {
-                            wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(age));
-                        }
-                        TjStandard standard = tjStandardService.getOne(wq8);
-                        project.setProMetering(standard.getCompany());
-                        project.setProScope((standard.getTjStandardLtValue() == null ? " " : standard.getTjStandardLtValue()) + "-" + (standard.getTjStandardGtValue() == null ? " " : standard.getTjStandardGtValue()));
-                    }
-                }
+//                List<TjStandard> list26 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId()));
+//                if (list26.size() == 0) {
+//                    project.setProMetering("/");
+//                    project.setProScope("/");
+//                } else if (list26.size() == 1) {
+//                    project.setProMetering(list26.get(0).getCompany() == null ? " " : list26.get(0).getCompany());
+//                    project.setProScope((list26.get(0).getTjStandardLtValue() == null ? " " : list26.get(0).getTjStandardLtValue()) + "-" + (list26.get(0).getTjStandardGtValue() == null ? " " : list26.get(0).getTjStandardGtValue()));
+//                } else {
+//                    Long cusSex = customer.getCusSex();
+//                    Date cusBrithday = customer.getCusBrithday();
+//                    int age = DateUtil.ageOfNow(cusBrithday);
+//                    for (TjStandard tjStandard : list26) {
+//                        LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>();
+//                        if (tjStandard.getTjSex() != null) {
+//                            wq8.eq(TjStandard::getTjSex, cusSex);
+//                        }
+//                        if (tjStandard.getTjType() != null) {
+//                            wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(age));
+//                        }
+//                        TjStandard standard = tjStandardService.getOne(wq8);
+//                        project.setProMetering(standard.getCompany());
+//                        project.setProScope((standard.getTjStandardLtValue() == null ? " " : standard.getTjStandardLtValue()) + "-" + (standard.getTjStandardGtValue() == null ? " " : standard.getTjStandardGtValue()));
+//                    }
+//                }
                 //鏌ユ爣鍑嗗拰鍗曚綅-----end
                 tjOrderDetail.setProject(project);
-                List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(project.getProId()));
-                if (list2.size() == 0) {
-                    tjOrderDetail.setStandard(null);
-                } else if (list2.size() == 1) {
-                    tjOrderDetail.setStandard(list2.get(0));
-                } else {
-                    for (TjStandard tjStandard : list2) {
-                        LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>();
-                        if (tjStandard.getTjSex() != null) {
-                            wq8.eq(TjStandard::getTjSex, customer.getCusSex());
-                        }
-                        if (tjStandard.getTjType() != null) {
-                            wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday())));
-                        }
-                        TjStandard standard = tjStandardService.getOne(wq8);
-                        tjOrderDetail.setStandard(standard);
-                    }
-                }
+//                List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(project.getProId()));
+//                if (list2.size() == 0) {
+//                    tjOrderDetail.setStandard(null);
+//                } else if (list2.size() == 1) {
+//                    tjOrderDetail.setStandard(list2.get(0));
+//                } else {
+//                    for (TjStandard tjStandard : list2) {
+//                        LambdaQueryWrapper<TjStandard> wq8 = new LambdaQueryWrapper<>();
+//                        if (tjStandard.getTjSex() != null) {
+//                            wq8.eq(TjStandard::getTjSex, customer.getCusSex());
+//                        }
+//                        if (tjStandard.getTjType() != null) {
+//                            wq8.eq(TjStandard::getTjType, StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday())));
+//                        }
+//                        TjStandard standard = tjStandardService.getOne(wq8);
+//                        tjOrderDetail.setStandard(standard);
+//                    }
+//                }
                 if (null != remark.getDoctorName()) {
                     //lg0412
                     SysUser byId = userService.getById(remark.getDoctorName());
@@ -1084,6 +1678,7 @@
                 } else {
                     tjOrderDetail.setDoctorName(null);
                 }
+                tjOrderDetailList.add(tjOrderDetail);
             }
         }
         Map<String, Object> map = new HashMap<>();
@@ -1103,7 +1698,7 @@
         } else {
             map.put("xiaoJieIds", null);
         }
-        map.put("sons", tjOrderDetails);
+        map.put("sons", tjOrderDetailList);
         map.put("xiaoJie", adviceList);
         map.put("remark", remark.getRemark());
 
@@ -1168,6 +1763,14 @@
     }
 
 
+    @GetMapping("/deptTree111")
+    @ApiOperation("鑾峰彇閮ㄩ棬鏍戝垪琛�1111111111")
+    public AjaxResult deptTree111(SysDept dept) {
+        final List<TreeSelect> treeSelects = deptService.selectDeptTreeList1(dept);
+        return success(treeSelects);
+    }
+
+
     /**
      * 鑾峰彇瀛愮瀹ら儴闂ㄥ垪琛�
      */

--
Gitblit v1.8.0