| | |
| | | import com.ltkj.system.service.ISysUserService; |
| | | import com.ltkj.web.controller.his.HisApiGetMethodService; |
| | | import com.ltkj.web.controller.his.HisApiMethodService; |
| | | import com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | |
| | | /*同步检查 his存储过程*/ |
| | | AjaxResult results = jcsqdService.getTjJcProByHisCall("体检中心", order.getCardId(), "''", 100, 1, "'1'"); |
| | | |
| | | DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | |
| | | log.info("检查项目查询返回值: " + results.toString()); |
| | |
| | | jcbgdService.save(jcbgd); |
| | | } |
| | | jcsqdService.saveLtkjExamJcsqd(order.getCardId()); |
| | | testMapper.updateDetailByTjJcCall(order.getCardId(), String.valueOf(order.getOrderId()), order.getTjNumber(), UserHoder.getLoginUser().getUserId()); |
| | | |
| | | int maxRetries=3; |
| | | for (int attempt = 0; attempt < maxRetries; attempt++) { |
| | | try { |
| | | testMapper.updateDetailByTjJcCall(order.getCardId(), |
| | | String.valueOf(order.getOrderId()), order.getTjNumber(), UserHoder.getLoginUser().getUserId()); |
| | | break; |
| | | } catch (Exception e) { |
| | | if (attempt==maxRetries-1){ |
| | | throw e; |
| | | } |
| | | try { |
| | | Thread.sleep(1000); |
| | | } catch (InterruptedException ignored) { |
| | | } |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | return AjaxResult.error("检查项目暂时未出结果,请稍后同步!!!"); |
| | | } |
| | |
| | | List<String> baoGaoDans = ltkjHybgdService.getJianYanBaoGaoDan(order.getCardId()); |
| | | List<String> jianChaBaoGaoDan = ltkjHybgdService.getJianChaBaoGaoDan(order.getCardId()); |
| | | //同步检验 |
| | | if (null != baoGaoDans && baoGaoDans.size() > 0) { |
| | | if (null != baoGaoDans && !baoGaoDans.isEmpty()) { |
| | | Date dates = new Date(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("his_registration_id", order.getCardId()); |
| | |
| | | log.info("检查项目查询返回值: " + results.toString()); |
| | | if (Integer.parseInt(results.get("code").toString()) == 200) { |
| | | List<Map<String, Object>> datas = (List<Map<String, Object>>) results.get("data"); |
| | | if (null != datas && datas.size() > 0) { |
| | | if (null != datas && !datas.isEmpty()) { |
| | | jcsqdService.deletedLtkjJcsqdByTjhAndTmh(order.getCardId()); |
| | | jcbgdService.deletedLtkjJcbgdByTjhAndTmh(order.getCardId()); |
| | | for (Map<String, Object> objectMap : datas) { |
| | |
| | | // final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | | // if(null !=getInfoFromSqlData && getInfoFromSqlData.equals("Y")) |
| | | // tbhyxm(one); |
| | | TjCustomer customer = customerService.getById(one.getUserId()); |
| | | // TjCustomer customer = customerService.getById(one.getUserId()); |
| | | List<TjOrderRemark> remarkList = orderRemarkService.addHuaYanAndCgTable(tjNumber); |
| | | List<TjOrderDetail> tjOrderDetails = detailService.addHuaYanAndCgTable(tjNumber); |
| | | |
| | |
| | | } |
| | | if (StrUtil.isNotBlank(ckfw)) { |
| | | try { |
| | | if (ckfw != null && ckfw.contains("-")) { |
| | | Integer.parseInt(tjOrderDetail.getYcbz()); |
| | | String[] split = ckfw.split("-"); |
| | | BigDecimal min = new BigDecimal(split[0]); |
| | | BigDecimal max = new BigDecimal(split[1]); |
| | | String proResult = tjOrderDetail.getProResult(); |
| | | BigDecimal jyjgval = new BigDecimal(proResult); |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | tjOrderDetail.setYcbz("↓"); |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | tjOrderDetail.setYcbz("↑"); |
| | | } else { |
| | | if(null !=proResult){ |
| | | BigDecimal jyjgval = new BigDecimal(proResult); |
| | | if (jyjgval.compareTo(min) < 0) { |
| | | tjOrderDetail.setYcbz("↓"); |
| | | } else if (jyjgval.compareTo(max) > 0) { |
| | | tjOrderDetail.setYcbz("↑"); |
| | | } else if(proResult.contains("阴")) { |
| | | tjOrderDetail.setYcbz(""); |
| | | }else { |
| | | tjOrderDetail.setYcbz(""); |
| | | } |
| | | if (null != tjOrderDetail.getYcbz() && !tjOrderDetail.getYcbz().equals("")) { |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult() + " [" + tjOrderDetail.getYcbz() + "]"); |
| | | } |
| | | }else { |
| | | tjOrderDetail.setYcbz(""); |
| | | } |
| | | }else { |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阴")) tjOrderDetail.setYcbz(""); |
| | | |
| | | if (tjOrderDetail.getProResult() != null && tjOrderDetail.getProResult().contains("阳")) tjOrderDetail.setYcbz("↑"); |
| | | } |
| | | } catch (NumberFormatException ignored) { |
| | | ignored.printStackTrace(); |
| | | } |
| | | if (null != tjOrderDetail.getYcbz() && !tjOrderDetail.getYcbz().equals("")) { |
| | | tjOrderDetail.setProResult(tjOrderDetail.getProResult() + " [" + tjOrderDetail.getYcbz() + "]"); |
| | | } |
| | | }else { |
| | | tjOrderDetail.setYcbz(""); |