| | |
| | | if (null != tjReservation.getPacId()) tjOrder.setPacId(tjReservation.getPacId()); |
| | | if (null != tjReservation.getTjCategory()) tjOrder.setTjCategory(tjReservation.getTjCategory()); |
| | | if (null != tjReservation.getGroupingId()) { |
| | | TjDwGrouping dwGrouping = dwGroupingService.getById(tjReservation.getGroupingId()); |
| | | tjOrder.setGroupId(tjReservation.getGroupingId()); |
| | | tjOrder.setFirmDeptId(tjReservation.getPacId()); |
| | | tjOrder.setFirmDeptId(dwGrouping.getDwDeptId()); |
| | | } |
| | | tjReservation.setIsExpire(1); |
| | | tjReservationService.updateById(tjReservation); |
| | |
| | | if (null != cusIds && !cusIds.isEmpty()) { |
| | | ExecutorService threadPools = Executors.newFixedThreadPool(cusIds.size()); |
| | | for (String cusId : cusIds) { |
| | | threadPools.execute(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | getAjaxResults(cusId); |
| | | } |
| | | }); |
| | | |
| | | // threadPools.execute(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | try { |
| | | getAjaxResults(cusId); |
| | | } catch (Exception e) { |
| | | |
| | | } |
| | | // } |
| | | // }); |
| | | } |
| | | LambdaQueryWrapper<TjCustomer> wq = new LambdaQueryWrapper<>(); |
| | | wq.in(TjCustomer::getCusIdcard, cusIds); |
| | |
| | | } |
| | | // TODO 因为有体检号会查出空数据 先使用死数据 打印导诊单 |
| | | if (!tjNumbers.isEmpty()) { |
| | | /* Map<String, Object> map = null; |
| | | try { |
| | | map = PDFDocumentUtil.getDocument(); |
| | | Document document = (Document) map.get("document"); |
| | | // for (int i = 0; i < tjNumbers.size(); i++) { |
| | | int i = 0; |
| | | for (String tjNumber : tjNumbers) { |
| | | try { |
| | | List<Map<String, Object>> djdInfos = tjOrderService.selectDjdInfo(tjNumber); |
| | | Map<String, Object> userInfo = tjOrderService.selectDjdUserInfo(tjNumber); |
| | | if(null !=userInfo && null !=djdInfos && !djdInfos.isEmpty()){ |
| | | LocalDateTime tjsj = (LocalDateTime) userInfo.get("tjsj"); |
| | | DateTimeFormatter dateFormat = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); |
| | | String time = null; |
| | | if (tjsj != null) { |
| | | time = dateFormat.format(tjsj); |
| | | } |
| | | PDFDocumentUtil.makeUserInfoTable(document, (String) userInfo.get("tjname"), (String) userInfo.get("sex") |
| | | , (String) userInfo.get("tjh"), (String) userInfo.get("lxdh"), (String) userInfo.get("tjname"), time); |
| | | PDFDocumentUtil.makeTjInfo(document, djdInfos); |
| | | // 多条则换页 |
| | | if (i + 1 < tjNumbers.size()) { |
| | | document.newPage(); |
| | | } |
| | | } |
| | | |
| | | } catch (DocumentException | IOException e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | //这里删除的是这个人所有项目包括补录项目 |
| | | TjOrder order = tjOrderService.getOrderByTjNum(tjNumber); |
| | | tjOrderService.deleteTjOrderByOrderId(order.getOrderId()); |
| | | tjOrderDetailService.deleteTjOrderDetailByOrderDetailId(String.valueOf(order.getOrderId())); |
| | | remarkService.deletedOrderRemarkByTjNum(tjNumber); |
| | | tjFlowingWaterService.deleteTjFlowingWaterByOrderId(String.valueOf(order.getOrderId())); |
| | | // transitionService.deletedTbTransitionByTjNum(tjNum); |
| | | tjSamplingMapper.deleteByTjNumAndCusId(order.getTjNumber(), order.getUserId()); |
| | | |
| | | TjReservation reservation = tjReservationService.getById(order.getReservationId()); |
| | | if(null !=reservation){ |
| | | reservation.setIsExpire(2); |
| | | tjReservationService.updateById(reservation); |
| | | transitionService.updateTbTransitionByTjNum(tjNumber); |
| | | } |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | // } |
| | | document.close(); |
| | | ByteArrayOutputStream outputStream = (ByteArrayOutputStream) map.get("stream"); |
| | | String encodeToString = java.util.Base64.getEncoder().encodeToString(outputStream.toByteArray()); |
| | | return AjaxResult.success().put("file", encodeToString); |
| | | } catch (IOException | DocumentException e) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | e.printStackTrace(); |
| | | }*/ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("tjh",tjNumbers); |
| | | return AjaxResult.success("操作成功",map); |
| | | } |
| | | |
| | | if (!errTjh.isEmpty()){ |
| | | Map<String,Object> map=new HashMap<>(); |
| | | map.put("errtjh",errTjh); |
| | | return AjaxResult.success("以上人员签到失败",map); |
| | | } |
| | | return AjaxResult.success(); |
| | | return AjaxResult.error(); |
| | | } |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error(); |
| | |
| | | tjReservationService.updateById(tjReservation); |
| | | // return AjaxResult.error("对不起您的预约已超时请重新预约"); |
| | | }*/ |
| | | LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjCustomer::getCusIdcard, cusIdcard); |
| | | TjCustomer tjCustomer1 = tjCustomerService.getOne(qw); |
| | | if (tjCustomer1 != null) { |
| | | tjCustomer1.setTjType(tjReservation.getTjType()); |
| | | tjCustomer1.setCusName(tjReservation.getName()); |
| | | tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex())); |
| | | tjCustomer1.setCusBrithday(tjReservation.getBirthday()); |
| | | tjCustomer1.setCusPhone(tjReservation.getPhoe()); |
| | | tjCustomer1.setCusEmail(tjReservation.getEmail()); |
| | | tjCustomer1.setCusAddr(tjReservation.getAddress()); |
| | | tjCustomer1.setCusMarryStatus(String.valueOf(tjReservation.getMarriage())); |
| | | tjCustomer1.setCusNational(String.valueOf(tjReservation.getNation())); |
| | | tjCustomer1.setIdType(tjReservation.getIdType()); |
| | | tjCustomer1.setAge(tjReservation.getAge()); |
| | | tjCustomer1.setAgeUnit(tjReservation.getAgeUnit()); |
| | | tjCustomer1.setCareer(tjReservation.getCareer()); |
| | | tjCustomerService.updateById(tjCustomer1); |
| | | } else { |
| | | TjCustomer tjCustomer = new TjCustomer(); |
| | | tjCustomer.setCusIdcard(tjReservation.getIdCard()); |
| | | tjCustomer.setCusName(tjReservation.getName()); |
| | | tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex())); |
| | | tjCustomer.setCusBrithday(tjReservation.getBirthday()); |
| | | tjCustomer.setCusPhone(tjReservation.getPhoe()); |
| | | tjCustomer.setCusEmail(tjReservation.getEmail()); |
| | | tjCustomer.setCusAddr(tjReservation.getAddress()); |
| | | tjCustomer.setCusMarryStatus(String.valueOf(tjReservation.getMarriage())); |
| | | tjCustomer.setCusNational(String.valueOf(tjReservation.getNation())); |
| | | tjCustomer.setIdType(tjReservation.getIdType()); |
| | | tjCustomer.setAge(tjReservation.getAge()); |
| | | tjCustomer.setAgeUnit(tjReservation.getAgeUnit()); |
| | | tjCustomer.setCareer(tjReservation.getCareer()); |
| | | tjCustomer.setDwPhone(tjReservation.getDwPhone()); |
| | | tjCustomer.setCardId(tjReservation.getCardId()); |
| | | tjCustomer.setIndexCard(tjReservation.getIndexCard()); |
| | | //截取密码自动生成set进去 |
| | | String substring = cusIdcard.substring(cusIdcard.length() - 6); |
| | | substring = DigestUtils.md5DigestAsHex(substring.getBytes()); |
| | | tjCustomer.setCusPassword(substring); |
| | | tjCustomer.setTjType(tjReservation.getTjType()); |
| | | tjCustomerService.save(tjCustomer); |
| | | try { |
| | | LambdaQueryWrapper<TjCustomer> qw = new LambdaQueryWrapper<>(); |
| | | qw.eq(TjCustomer::getCusIdcard, cusIdcard); |
| | | TjCustomer tjCustomer1 = tjCustomerService.getOne(qw); |
| | | if (tjCustomer1 != null) { |
| | | tjCustomer1.setTjType(tjReservation.getTjType()); |
| | | tjCustomer1.setCusName(tjReservation.getName()); |
| | | tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex())); |
| | | tjCustomer1.setCusBrithday(tjReservation.getBirthday()); |
| | | tjCustomer1.setCusPhone(tjReservation.getPhoe()); |
| | | tjCustomer1.setCusEmail(tjReservation.getEmail()); |
| | | tjCustomer1.setCusAddr(tjReservation.getAddress()); |
| | | tjCustomer1.setCusMarryStatus(String.valueOf(tjReservation.getMarriage())); |
| | | tjCustomer1.setCusNational(String.valueOf(tjReservation.getNation())); |
| | | tjCustomer1.setIdType(tjReservation.getIdType()); |
| | | tjCustomer1.setAge(tjReservation.getAge()); |
| | | tjCustomer1.setAgeUnit(tjReservation.getAgeUnit()); |
| | | tjCustomer1.setCareer(tjReservation.getCareer()); |
| | | tjCustomerService.updateById(tjCustomer1); |
| | | } else { |
| | | TjCustomer tjCustomer = new TjCustomer(); |
| | | tjCustomer.setCusIdcard(tjReservation.getIdCard()); |
| | | tjCustomer.setCusName(tjReservation.getName()); |
| | | tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex())); |
| | | tjCustomer.setCusBrithday(tjReservation.getBirthday()); |
| | | tjCustomer.setCusPhone(tjReservation.getPhoe()); |
| | | tjCustomer.setCusEmail(tjReservation.getEmail()); |
| | | tjCustomer.setCusAddr(tjReservation.getAddress()); |
| | | tjCustomer.setCusMarryStatus(String.valueOf(tjReservation.getMarriage())); |
| | | tjCustomer.setCusNational(String.valueOf(tjReservation.getNation())); |
| | | tjCustomer.setIdType(tjReservation.getIdType()); |
| | | tjCustomer.setAge(tjReservation.getAge()); |
| | | tjCustomer.setAgeUnit(tjReservation.getAgeUnit()); |
| | | tjCustomer.setCareer(tjReservation.getCareer()); |
| | | tjCustomer.setDwPhone(tjReservation.getDwPhone()); |
| | | tjCustomer.setCardId(tjReservation.getCardId()); |
| | | tjCustomer.setIndexCard(tjReservation.getIndexCard()); |
| | | //截取密码自动生成set进去 |
| | | String substring = cusIdcard.substring(cusIdcard.length() - 6); |
| | | substring = DigestUtils.md5DigestAsHex(substring.getBytes()); |
| | | tjCustomer.setCusPassword(substring); |
| | | tjCustomer.setTjType(tjReservation.getTjType()); |
| | | tjCustomerService.save(tjCustomer); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }else { |
| | | throw new RuntimeException(); |
| | | } |
| | | |
| | | }else { |
| | | throw new RuntimeException(); |
| | | } |
| | | } |
| | | |
| | |
| | | //获取拼接前缀 |
| | | String makeLisTmhPrefix = configService.selectConfigByKey("make_lis_tmh_prefix"); |
| | | // String tjNumber = (sysUser.getUserName() + idUtils.getTjNumber()); |
| | | String tjNumber = idUtils.getTjNumber(); |
| | | String tjNumber = idUtils.getNewTjNumberRedisLockAndMysql(); |
| | | if (StringUtil.isNotBlank(makeLisTmhPrefix)) tjNumber = makeLisTmhPrefix + tjNumber; |
| | | |
| | | |
| | |
| | | transitionService.saveRedisTransitionByPacId(cusId, cardId, pacId); |
| | | |
| | | //补差价 |
| | | List<Map<String, Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId.toString(), cusId); |
| | | List<Map<String, Object>> cjMaps = transitionService.addTbhuoquxiangmuchajia(pacId.toString(), cusId); |
| | | if (null != cjMaps && !cjMaps.isEmpty()) { |
| | | log.info("该套餐"+pacId+"中有差价:"+cjMaps.size()+"个"); |
| | | for (Map<String, Object> cjMap : cjMaps) { |
| | | log.info("添加临时表套餐数据时所选的差价为:"+ cjMap.get("cj").toString()); |
| | | transitionService.buxiangmuchajia(cusId, pacId.toString(), cjMap.get("xmid").toString(), new BigDecimal(cjMap.get("cj").toString())); |
| | | } |
| | | } |
| | |
| | | tjReport.setTjNumber(String.valueOf(tjNumber)); |
| | | tjReport.setPath(urlValue + outputFileName1); |
| | | String outputPath1 = value + File.separator; |
| | | String pdfBinary = getPDFBinary(outputPath1 + outputFileName1); |
| | | tjReport.setReport(pdfBinary); |
| | | // String pdfBinary = getPDFBinary(outputPath1 + outputFileName1); |
| | | // tjReport.setReport(pdfBinary); |
| | | tjReport.setType("体检报告"); |
| | | tjReport.setPrint("pdf"); |
| | | tjReportService.save(tjReport); |
| | |
| | | @GetMapping(value = "newgetTransitionList") |
| | | @ApiOperation(value = "最新查询过渡表数据") |
| | | public AjaxResult newgetTransitionList(@RequestParam @ApiParam(value = "客户id") String cusId) { |
| | | // String pacId = transitionService.getTbTransitionPacId(cusId); |
| | | // if(StringUtil.isNotBlank(pacId)){ |
| | | // //补差价 |
| | | // List<Map<String,Object>> cjMaps = groupingProService.huoquxiangmuchajia(pacId, cusId); |
| | | // if(null !=cjMaps && !cjMaps.isEmpty()){ |
| | | // for (Map<String, Object> cjMap : cjMaps) { |
| | | // transitionService.buxiangmuchajia(cusId,pacId,cjMap.get("xmid").toString(),new BigDecimal(cjMap.get("cj").toString())); |
| | | // } |
| | | // } |
| | | // } |
| | | List<TbTransition> list = transitionService.newgetTransitionList(cusId); |
| | | return AjaxResult.success(list); |
| | | } |