| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | | import org.apache.ibatis.jdbc.Null; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.ConvertingCursor; |
| | | import org.springframework.data.redis.core.Cursor; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.data.redis.core.ScanOptions; |
| | | import org.springframework.data.redis.serializer.RedisSerializer; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | @Autowired |
| | | private ITjRulesService tjRulesService; |
| | | |
| | | @Autowired |
| | | public RedisTemplate<Object,Object> redisTemplate; |
| | | |
| | | |
| | | /** |
| | |
| | | @GetMapping("/getProList") |
| | | @ApiOperation("该体检科室下客户列表显示接口") |
| | | public AjaxResult getProList(@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("请输入科室id"); |
| | | } |
| | | //根据当前登陆的人的科室id,获取该科室下的所有项目 |
| | | // TODO: 2023/3/24 给超级管理员赋医生检查权限 |
| | | 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 (ksproList == null || ksproList.size() == 0) { |
| | | return AjaxResult.error("请完善科室项目信息"); |
| | | } |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | | if(null==name) name=""; |
| | | if(null==tjNumber) tjNumber=""; |
| | | |
| | | // //根据体检号查 |
| | | // 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的数量(很多博客瞎说要指定Integer.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) { |
| | | // 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.getSysDeptYjWjCustomerList13(String.valueOf(ksId), 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.getSysDeptYjWjCustomerList13(String.valueOf(ksId), name, tjNumber, 1, page, pageSize); |
| | | // customerLists = customers; |
| | | } |
| | | return AjaxResult.success(map); |
| | | // asyncService.dockerSetCustomerLisByRedis(ksproList, String.valueOf(ksId)); |
| | | // if (null !=customerLists && 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("暂时没有数据"); |
| | | // } |
| | | } |
| | | |
| | | private AjaxResult getAjaxResult(Integer type, Integer page, Integer pageSize, List<Long> ksproList, List<TjCustomer> customerLis) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrderDetail::getTjStatus, type); |
| | | wq1.in(TjOrderDetail::getProId, ksproList); |
| | | wq1.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq1.orderByDesc(TjOrderDetail::getCreateTime); |
| | | List<TjOrderDetail> detailList = detailService.list(wq1); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | //收集orderId并去重 |
| | | List<Long> orderIds = detailList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( |
| | | () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | for (Long orderId : orderIds) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | continue; |
| | | } |
| | | if (type == 1) { |
| | | List<TjOrderDetail> list = detailService.getTjOrderDetailListByOrderIdAndStatus(String.valueOf(orderId)); |
| | | if (null != list && list.size() > 0) { |
| | | continue; |
| | | } |
| | | } |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(orderId); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customer.setTjStatus(Long.valueOf(type)); |
| | | List<TjOrderRemark> list = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber()); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 化验检查页面列表 |
| | | */ |
| | | @GetMapping("/huaYangetProList") |
| | | @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, |
| | |
| | | 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())); |
| | |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | customerLis.add(customer); |
| | | |
| | | } |
| | |
| | | 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(); |
| | |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setOrderId(order.getOrderId()); |
| | | customer.setIsHz(order.getIsHz()); |
| | | list11111.add(customer); |
| | | } |
| | | } |
| | |
| | | return AjaxResult.success("暂无数据"); |
| | | } |
| | | } |
| | | List<TjCustomer> customerLists = null; |
| | | List<TjCustomer> customerLists = new ArrayList<>(); |
| | | if (type == 0) { |
| | | customerLists = redisCache.getCacheMapValue(ksId + "ks", "wj"); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | private AjaxResult getAjaxResult(Integer type, Integer page, Integer pageSize, List<Long> ksproList, List<TjCustomer> customerLis) { |
| | | LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrderDetail::getTjStatus, type); |
| | | wq1.in(TjOrderDetail::getProId, ksproList); |
| | | wq1.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq1.orderByDesc(TjOrderDetail::getCreateTime); |
| | | List<TjOrderDetail> detailList = detailService.list(wq1); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | //收集orderId并去重 |
| | | List<Long> orderIds = detailList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( |
| | | () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | for (Long orderId : orderIds) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | continue; |
| | | } |
| | | if (type == 1) { |
| | | List<TjOrderDetail> list = detailService.getTjOrderDetailListByOrderIdAndStatus(String.valueOf(orderId)); |
| | | if (null != list && list.size() > 0) { |
| | | continue; |
| | | } |
| | | } |
| | | TjCustomer customer = customerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(type)); |
| | | List<TjOrderRemark> list = remarkService.getTjOrderRemarkListByYjNum(order.getTjNumber()); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if (null == customer.getNotCheckeds()) customer.setNotCheckeds("全部已检"); |
| | | } |
| | | 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); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询客户体检历史记录 |
| | |
| | | return AjaxResult.success("操作失败"); |
| | | } |
| | | for (TjOrderRemark orderRemark : remarklList) { |
| | | if (null != orderRemark.getSummaryList()) { |
| | | List<String> summaryList = orderRemark.getSummaryList(); |
| | | if (null != summaryList && summaryList.size()>0 && !summaryList.contains(null) ) { |
| | | orderRemark.setSummary(Joiner.on(";").join(orderRemark.getSummaryList())); |
| | | } |
| | | LambdaQueryWrapper<TjOrder> qw = new LambdaQueryWrapper<>(); |
| | |
| | | } |
| | | } |
| | | } |
| | | //-----------------------------------end |
| | | asyncService.updateOrdeltile(tjOrderDetailList, sysUser, order); |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | |
| | | remarkService.save(remark); |
| | | } else { |
| | | one.setRemark(orderRemark.getRemark()); |
| | | if (orderRemark.getSummaryList() != null) { |
| | | if (null != summaryList && summaryList.size()>0 && !summaryList.contains(null)) { |
| | | one.setSummary(Joiner.on(";").join(orderRemark.getSummaryList())); |
| | | } |
| | | one.setDeptId(orderRemark.getDeptId()); |
| | |
| | | one.setType(1); |
| | | remarkService.updateById(one); |
| | | } |
| | | asyncService.updateCheckType(orderRemark.getTjNumber()); |
| | | asyncService.getOrderDetailByProParentId(orderRemark.getTjNumber(),null, String.valueOf(orderRemark.getProId())); |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | | asyncService.updateCheckType(orderRemark.getTjNumber()); |
| | | asyncService.getOrderDetailByProParentId(orderRemark.getTjNumber(),null, String.valueOf(orderRemark.getProId())); |
| | | } |
| | | return AjaxResult.success("操作成功"); |
| | | } |
| | |
| | | if (null != sysUser && !sysUser.getUserName().equals("10001")) { |
| | | wq2.eq(TjProject::getDeptId, ksId); |
| | | } |
| | | //判断该项目是否需要打印报告 |
| | | wq2.eq(TjProject::getNeedReport,"Y"); |
| | | List<TjProject> Deptlist = projectService.list(wq2); |
| | | List<Long> proIdList = Deptlist.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | if (Deptlist.size() == 0 || proIdList.size() == 0) { |
| | |
| | | wq.ne("type", 2); |
| | | List<TjOrderRemark> list = remarkService.list(wq); |
| | | if (list.size() == 0) { |
| | | return AjaxResult.error("该科室下无项目!"); |
| | | return AjaxResult.success("该科室下无项目!"); |
| | | } |
| | | for (TjOrderRemark tjOrderRemark : list) { |
| | | TjProject tjProject = projectService.getById(tjOrderRemark.getProId()); |
| | |
| | | @ApiOperation("点击父项目显示子项目详情") |
| | | public AjaxResult getOrderDetailByProParentId(@ApiParam(value = "父项目id") @RequestParam String proParentId, |
| | | @ApiParam(value = "体检号") @RequestParam String tjNumber) { |
| | | TjOrderRemark remark = remarkService.getTjOrderRemarkByTjNumAndProParentId(tjNumber, proParentId); |
| | | if (null == SecurityUtils.getLoginUser().getUserId() || null == userService.getById(SecurityUtils.getLoginUser().getUserId())) { |
| | | return AjaxResult.error("获取用户信息错误"); |
| | | } |
| | | |
| | | // if(redisCache.hasHKey("getOrderDetailByProParentId"+tjNumber,proParentId)){ |
| | | // Map<String, Object> mapValue = redisCache.getCacheMapValue("getOrderDetailByProParentId" + tjNumber, proParentId); |
| | | // return AjaxResult.success(mapValue); |
| | | // } |
| | | |
| | | TjOrderRemark remark = remarkService.getTjOrderRemarkByTjNumAndProParentId(tjNumber, proParentId); |
| | | List<TjProject> proParentList = projectService.getTjProjectListBySoneId(proParentId); |
| | | if (null == proParentList) { |
| | | return AjaxResult.error("该项目下暂时没数据"); |
| | | if (null == proParentList || proParentList.size()==0) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("xiaoJieIds", null); |
| | | map.put("sons", projectService.list(new LambdaQueryWrapper<TjProject>().eq(TjProject::getProId,proParentId))); |
| | | map.put("xiaoJie", null); |
| | | map.put("remark", remark.getRemark()); |
| | | return AjaxResult.success(map); |
| | | } |
| | | List<Long> proParentIdList = proParentList.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | TjOrder one = orderService.getOrderByTjNum(tjNumber); |
| | |
| | | if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | TjProject project = projectService.getById(tjOrderDetail.getProId()); |
| | | //病种回显 |
| | | LambdaQueryWrapper<TjOrderDetailRules> wq=new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetailRules::getProId,project.getProId()); |
| | | wq.eq(TjOrderDetailRules::getTjNumber,tjNumber); |
| | | List<TjOrderDetailRules> list = tjOrderDetailRulesService.list(wq); |
| | | List<TjRules> res=new ArrayList<>(); |
| | | for (TjOrderDetailRules orderDetailRules : list) { |
| | | final TjRules byId = tjRulesService.getById(orderDetailRules.getAid()); |
| | | res.add(byId); |
| | | //判断该项目是否需要打印报告 |
| | | if ("N".equals(project.getNeedReport())){ |
| | | continue; |
| | | } |
| | | tjOrderDetail.setRulesList(res); |
| | | //病种回显 |
| | | // LambdaQueryWrapper<TjOrderDetailRules> wq=new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderDetailRules::getProId,project.getProId()); |
| | | // wq.eq(TjOrderDetailRules::getTjNumber,tjNumber); |
| | | // List<TjOrderDetailRules> list = tjOrderDetailRulesService.list(wq); |
| | | // List<TjRules> res=new ArrayList<>(); |
| | | // for (TjOrderDetailRules orderDetailRules : list) { |
| | | // final TjRules byId = tjRulesService.getById(orderDetailRules.getAid()); |
| | | // res.add(byId); |
| | | // } |
| | | List<TjRules> rulesList = tjRulesService.getTjRulesListByTjNumAndProId(tjNumber, tjOrderDetail.getProId()); |
| | | tjOrderDetail.setRulesList(rulesList); |
| | | |
| | | //查标准和单位----start |
| | | List<TjStandard> list26 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId())); |
| | |
| | | List<TjAdvice> adviceList = new ArrayList<>(); |
| | | if (null != remark) { |
| | | String[] strings = StringUtils.split(remark.getSummary(), ";"); |
| | | if (null != strings && strings.length > 0) { |
| | | for (String string : strings) { |
| | | adviceList.add(tjAdviceService.getById(string)); |
| | | } |
| | | // if (null != strings && strings.length > 0) { |
| | | // for (String string : strings) { |
| | | // adviceList.add(tjAdviceService.getById(string)); |
| | | // } |
| | | // } |
| | | if(null !=strings && strings.length>0){ |
| | | List<TjAdvice> list = tjAdviceService.getAdviceStringByIds(strings); |
| | | adviceList.addAll(list); |
| | | } |
| | | map.put("xiaoJieIds", StringUtils.split(remark.getSummary(), ";")); |
| | | } else { |
| | |
| | | map.put("sons", tjOrderDetails); |
| | | map.put("xiaoJie", adviceList); |
| | | map.put("remark", remark.getRemark()); |
| | | |
| | | // asyncService.getOrderDetailByProParentId(tjNumber,map,proParentId); |
| | | return AjaxResult.success(map); |
| | | } |
| | | |
| | |
| | | return success(deptService.selectDeptTreeList(dept)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取子科室部门列表 |
| | | */ |
| | | @GetMapping("/getChildList") |
| | | @ApiOperation(value = "获取子科室部门列表") |
| | | public AjaxResult getChildList(String deptName) { |
| | | LambdaQueryWrapper<SysDept> wq=new LambdaQueryWrapper<>(); |
| | | wq.ne(SysDept::getParentId,0); |
| | | if (deptName!=null){ |
| | | wq.like(SysDept::getDeptName,deptName); |
| | | } |
| | | List<SysDept> depts = deptService.list(wq); |
| | | return success(depts); |
| | | } |
| | | |
| | | } |