| | |
| | | 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("检查项目暂时未出结果,请稍后同步!!!"); |
| | | } |
| | |
| | | return AjaxResult.success(orderService.getCunChuGuoChengCustomerList(tjNumber, page, pageSize, checkStatus, value, beginTime, endTime, name)); |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping ("/getBghsList") |
| | | @ApiOperation (value = "报告核收页面查询接口")//0待1已 |
| | | // @PreAuthorize("@ss.hasPermi('check:check:getList')") |
| | | public AjaxResult getBghsList(@ApiParam (value = "页码数(默认1)") @RequestParam (defaultValue = "1") Integer page, |
| | | @ApiParam (value = "显示条数(默认10)") @RequestParam (defaultValue = "10") Integer pageSize, |
| | | @ApiParam (value = "体检单号") @RequestParam (required = false) String tjNumber, |
| | | @ApiParam (value = "单位") @RequestParam (required = false) Long compId, |
| | | @ApiParam (value = "姓名)") @RequestParam (required = false) String name, |
| | | @ApiParam (value = "开始时间") @RequestParam (required = false) String beginTime, |
| | | @ApiParam (value = "结束时间") @RequestParam (required = false) String endTime) { |
| | | // String config = configService.selectConfigByKey("tj_confirm"); |
| | | // DateTime beginTimes = null; |
| | | // DateTime endTimes = null; |
| | | // if (null != beginTime && null != endTime) { |
| | | // beginTimes = DateUtil.beginOfDay(DateUtil.parse(beginTime)); |
| | | // endTimes = DateUtil.endOfDay(DateUtil.parse(endTime)); |
| | | // } |
| | | // asyncService.checkSetCustomerLisByRedis(config); |
| | | // //初始化体检订单表 |
| | | // List<TjOrder> orderList = null; |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // |
| | | // //姓名查询 |
| | | // if (null != name && !"".equals(name)) { |
| | | // List<TjCustomer> list = customerService.getTjCustomerList(name); |
| | | // if (null != list && list.size() > 0) { |
| | | // List<TjCustomer> lists = new ArrayList<>(); |
| | | // for (TjCustomer customer : list) { |
| | | // if ("Y".equals(config)) { |
| | | // orderList = orderService.getCsTjOrderListByCusId1(customer.getCusId()); |
| | | // } else { |
| | | // orderList = orderService.getTjOrderListByCusId(customer.getCusId()); |
| | | // } |
| | | // if (null != orderList && orderList.size() > 0) { |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getFinishTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setCusName(MatchUtils.hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(MatchUtils.hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(MatchUtils.hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // customer.setTjCategory(tjOrder.getTjCategory()); |
| | | // if (tjOrder.getFirmId().equals("0")) { |
| | | // customer.setTjCompName(null); |
| | | // } else { |
| | | // customer.setTjCompName(compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()).getCnName()); |
| | | // } |
| | | // lists.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // List<TjCustomer> customers = null; |
| | | // if (lists.size() > 0) { |
| | | // customers = lists.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // } |
| | | // map.put("customers", customers); |
| | | // map.put("total", lists.size()); |
| | | // return AjaxResult.success(map); |
| | | // } |
| | | // return AjaxResult.success("暂无数据"); |
| | | // } |
| | | // |
| | | // //条件查询 |
| | | // if (null != tjNumber || null != compId || (null != beginTime && null != endTime)) { |
| | | // //判断是否开启初审 |
| | | // if ("Y".equals(config)) { |
| | | // orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } else { |
| | | // orderList = orderService.getTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | // |
| | | // List<TjCustomer> customers = null; |
| | | // if (null != checkStatus && checkStatus == 0) { |
| | | // customers = redisCache.getCacheMapValue("check", "ws"); |
| | | // } |
| | | // if (null != checkStatus && checkStatus == 1) { |
| | | // customers = redisCache.getCacheMapValue("check", "ys"); |
| | | // } |
| | | // if (customers != null && customers.size() > 0) { |
| | | //// asyncService.addRedis(customers); |
| | | // List<TjCustomer> customerLists = customers.stream().skip((long) (page - 1) * pageSize).limit(pageSize).collect(Collectors.toList()); |
| | | // map.put("customers", customerLists); |
| | | // map.put("total", customers.size()); |
| | | // return AjaxResult.success(map); |
| | | // } else { |
| | | // //判断是否开启初审 |
| | | // if ("Y".equals(config)) { |
| | | // orderList = orderService.getCsTjOrderList1(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } else { |
| | | // orderList = orderService.getTjOrderList(tjNumber, checkStatus, compId, beginTimes, endTimes); |
| | | // } |
| | | // return getResult(page, pageSize, orderList, customerList, map); |
| | | // } |
| | | |
| | | String value = String.valueOf(compId); |
| | | if (tjNumber == null) tjNumber = ""; |
| | | if (compId == null) value = ""; |
| | | if (name == null) name = ""; |
| | | if (beginTime == null) beginTime = ""; |
| | | if (endTime == null) endTime = ""; |
| | | return AjaxResult.success(orderService.getgetBghsList(tjNumber, page, pageSize, value, beginTime, endTime, name)); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据体检订单号获取体检详情信息接口 |
| | | * |