zjh
2025-07-04 d12e3914e9e823a3038335a8f9e0b525343d965b
ltkj-admin/src/main/java/com/ltkj/web/controller/service/TjSysAsyncServiceImpl.java
@@ -773,6 +773,7 @@
//    @Async("async")
//    @Transactional
    public Boolean iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser, String jxbz) {
      try {
        Date dates = new Date();
        final String date = DateUtil.format(dates, "yyyy-MM-dd HH:mm:ss");
@@ -948,18 +949,24 @@
                addCaiYangDengJi(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz);
                String isUseMx = configService.selectConfigByKey("jcxhis_is_use_mx");
                AjaxResult result;
                  try {
                if (isUseMx.equalsIgnoreCase("Y"))
                    result = tijianbulushenqing(customer, date, order.getCardId(), jxbz, jianChaProjects, (tjFlowingWater.getPayType() == 6L || tjFlowingWater.getPayStasus() == 1L));
                else
                    result = tijianbulushenqingJinchuanNew(customer, date, order.getCardId(), jxbz, jianChaProjects,(tjFlowingWater.getPayType() == 6L || tjFlowingWater.getPayStasus() == 1L));
                  } catch (Exception e) {
                      throw new RuntimeException(e);
                  }
                return result.get("code").toString().equals("200");
            } else {
                List<TjOrderDetail> detailLists = tjOrderDetailService.getCaiYangDengJiJxbz(order.getOrderId(), jxbz);
                addCaiYangDengJiByDiaoYongShiTu(detailLists, !detailLists.isEmpty(), order, sysUser, jxbz);
            }
        }
        return true;
      }catch (Exception e){
          throw new RuntimeException(e);
      }
    }
    public void addCaiYangDengJiByDiaoYongShiTu(List<TjOrderDetail> detailList, boolean detailList1, TjOrder order, SysUser sysUser, String jxbz) {
@@ -1046,6 +1053,7 @@
            }
        } catch (Exception e) {
            log.error(e.getMessage());
            throw new RuntimeException();
        }
    }
@@ -1054,16 +1062,20 @@
    private static ArrayList<String> ids = null;
    public AjaxResult tijianbulushenqingJinchuanNew(TjCustomer customer, String date, String cardId, String jxbz, ArrayList<TjProject> jianChaProjects, Boolean isTuanTiPiao) {
        try {
        mapJinchuan = new ArrayList<>();
        ids = new ArrayList<>();
        tijianbulushenqingOld(customer, date, cardId, jxbz, jianChaProjects, isTuanTiPiao);
        tijianbulushenqingJinchuan(customer, date, cardId, jxbz, jianChaProjects, isTuanTiPiao);
        return AjaxResult.success();
        //return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    public AjaxResult tijianbulushenqingJinchuan(TjCustomer customer, String date, String cardId, String jxbz, ArrayList<TjProject> jianChaProjects, Boolean isTuanTiPiao) {
        try {
        TjOrder order = orderService.getOrderByCardId(cardId);
        if (null != order) {
            String dept = configService.selectConfigByKey("request_default_dept");
@@ -1233,13 +1245,8 @@
                                        tree.setCreateTime(DateUtil.date());
                                        ltkjJianchajianyanTreeService.save(tree);
                                    }
                                    // TODO 个人以及团体 暂不向采样管理写数据
                                    // HIS发送无法合并操作 无法获取LIS的检验序号 条码无法打印
//                TjOrder tjOrder = orderService.getOrderByCardId(cardId);
//                if(null !=tjOrder){
//                    List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId());
//                    tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null);
//                }
                                    }else {
                                        throw new RuntimeException();
                                }
                            }
                        }
@@ -1356,6 +1363,8 @@
                                        tree.setCreateTime(DateUtil.date());
                                        ltkjJianchajianyanTreeService.save(tree);
                                    }
                                    }else {
                                        throw new RuntimeException();
                                }
                            }
                        }
@@ -1470,6 +1479,8 @@
                                        tree.setCreateTime(DateUtil.date());
                                        ltkjJianchajianyanTreeService.save(tree);
                                    }
                                    }else {
                                        throw new RuntimeException();
                                }
                            }
                        }
@@ -1534,15 +1545,21 @@
                            cf.setCreateTime(new Date());
                            cfService.save(cf);
                        }
                        }else {
                            throw new RuntimeException();
                    }
                }
            }
        }
        return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    //    体检对his申请单调用方法
    public AjaxResult tijianbulushenqingOld(TjCustomer customer, String date, String cardId, String jxbz, ArrayList<TjProject> jianChaProjects, Boolean isTuanTiPiao) {
        try {
        TjOrder order = orderService.getOrderByCardId(cardId);
        if (null != order) {
            String dept = configService.selectConfigByKey("request_default_dept");
@@ -1704,6 +1721,8 @@
                            tree.setCreateTime(DateUtil.date());
                            ltkjJianchajianyanTreeService.save(tree);
                        }
                        }else {
                            throw new RuntimeException();
                    }
                }
@@ -1813,6 +1832,8 @@
                            tree.setCreateTime(DateUtil.date());
                            ltkjJianchajianyanTreeService.save(tree);
                        }
                        }else {
                            throw new RuntimeException();
                    }
                }
@@ -1937,6 +1958,8 @@
                            tree.setCreateTime(DateUtil.date());
                            ltkjJianchajianyanTreeService.save(tree);
                        }
                        }else {
                            throw new RuntimeException();
                    }
                }
/*
@@ -1991,6 +2014,9 @@
            }
        }
        return AjaxResult.success();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
    /**/
@@ -2435,6 +2461,7 @@
//    }
    public AjaxResult tijianbulushenqing(TjCustomer customer, String date, String cardId, String jxbz, ArrayList<TjProject> jianChaProjects, Boolean isTuanTiPiao) {
        try {
        TjOrder order = orderService.getOrderByCardId(cardId);
        if (null != order) {
            String dept = configService.selectConfigByKey("request_default_dept");
@@ -2473,8 +2500,7 @@
                            log.info("分组后 ->{}",JSONUtil.toJsonStr(listMap));
                            boolean save = lisApiMethod.save(listMap, order, customer);
                            if (!save) {
                                TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
                                return AjaxResult.error("处理失败");
                                    throw new RuntimeException();
                            }
                            for (TjSampling tjSampling : list) {
                                tjSampling.setIsSignFor("0");
@@ -2520,7 +2546,7 @@
                        }
                        Boolean confirmed = samplingServiceApi.confirmSamplingApi(ids, "Y", "N");
                        if (!confirmed)
                            return AjaxResult.error("处理失败");
                                throw new RuntimeException();
                    }
                }
@@ -2645,6 +2671,8 @@
//                    List<TjOrderDetail> dengJi = tjOrderDetailService.getCaiYangDengJi(tjOrder.getOrderId());
//                    tjSysAsyncService.addCaiYangDengJi(dengJi,!dengJi.isEmpty(),tjOrder, SecurityUtils.getLoginUser().getUser(), null);
//                }
                                    }else {
                                        throw new RuntimeException();
                                }
                            }
                        }
@@ -2758,6 +2786,9 @@
                                        tree.setCreateTime(DateUtil.date());
                                        ltkjJianchajianyanTreeService.save(tree);
                                    }
                                    }else {
                                        throw new RuntimeException();
                                }
                            }
                        }
@@ -2869,6 +2900,8 @@
                                        tree.setCreateTime(DateUtil.date());
                                        ltkjJianchajianyanTreeService.save(tree);
                                    }
                                    }else {
                                        throw new RuntimeException();
                                }
                            }
                        }
@@ -2997,12 +3030,17 @@
                                cf.setCreateTime(new Date());
                                cfService.save(cf);
                            }
                            }else {
                                throw new RuntimeException();
                        }
                    });
                }
            }
        }
        return AjaxResult.success();
        } catch (RuntimeException e) {
            throw new RuntimeException(e);
        }
    }
    public void pacsReg(TjOrder order, TjCustomer customer, ArrayList<TjProject> jianChaProjects) {