| | |
| | | @ApiParam (value = "显示条数(默认10)") @RequestParam (defaultValue = "10") Integer pageSize, |
| | | @ApiParam (value = "体检号)") @RequestParam (required = false) String tjNum, |
| | | @ApiParam (value = "姓名)") @RequestParam (required = false) String name, |
| | | @ApiParam (value = "项目名)") @RequestParam (required = false) String xmmc, |
| | | @ApiParam (value = "登记开始时间") @RequestParam (required = false) Date djbeginTime, |
| | | @ApiParam (value = "登记结束时间") @RequestParam (required = false) Date djendTime, |
| | | @ApiParam (value = "报告开始时间") @RequestParam (required = false) Date bgbeginTime, |
| | |
| | | if (null != tjNum) { |
| | | wq.eq(TjOrder::getTjNumber, tjNum); |
| | | } |
| | | |
| | | |
| | | if (null != xmmc) { |
| | | wq.in(TjOrder::getTjNumber, projectService.getTjNumLIstByXmmx(xmmc)); |
| | | } |
| | | |
| | | wq.orderByDesc(TjOrder::getCreateTime); |
| | | Page<TjOrder> page2 = tjOrderService.page(page1, wq); |
| | | List<TjOrder> list = page2.getRecords(); |
| | |
| | | order.setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | order.setTjCustomerName(tjCustomer.getCusName()); |
| | | order.setTjCustomerPhone(tjCustomer.getCusPhone()); |
| | | // order.setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | order.setTjCusIdCard(tjCustomer.getCusIdcard()); |
| | | order.setCareer(tjCustomer.getCareer()); |
| | | order.setIdType(tjCustomer.getIdType()); |
| | |
| | | if (null != order.getPacId()) { |
| | | if (null != tjPackageService.getById(order.getPacId())) { |
| | | order.setPacName(tjPackageService.getById(order.getPacId()).getPacName()); |
| | | } |
| | | }else |
| | | if (null != dwDeptService.getById(order.getPacId())) { |
| | | order.setPacName(dwDeptService.getById(order.getPacId()).getDwDeptName()); |
| | | } |
| | |
| | | LambdaQueryWrapper<TjCustomer> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.like(TjCustomer::getCusName, name); |
| | | List<TjCustomer> customerList = tjCustomerService.list(wqq); |
| | | if (null != customerList && customerList.size() > 0) { |
| | | if (null != customerList && !customerList.isEmpty()) { |
| | | List<TjOrder> list = new ArrayList<>(); |
| | | for (TjCustomer customer : customerList) { |
| | | LambdaQueryWrapper<TjOrder> wq = new LambdaQueryWrapper<>(); |
| | |
| | | list.addAll(tjOrderService.list(wq)); |
| | | } |
| | | List<TjOrder> collect = null; |
| | | if (list.size() > 0) { |
| | | if (!list.isEmpty()) { |
| | | |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TjCustomer tjCustomer = tjCustomerService.getById(list.get(i).getUserId()); |
| | |
| | | } |
| | | list.get(i).setTjCustomerSex(tjCustomer.getCusSex()); |
| | | list.get(i).setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | list.get(i).setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | list.get(i).setTjCustomerName(tjCustomer.getCusName()); |
| | | list.get(i).setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | list.get(i).setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | | |
| | |
| | | } |
| | | list.get(i).setTjCustomerSex(tjCustomer.getCusSex()); |
| | | list.get(i).setTjCustomerAge(DateUtil.ageOfNow(tjCustomer.getCusBrithday())); |
| | | list.get(i).setTjCustomerName(MatchUtils.hideCusName(tjCustomer.getCusName())); |
| | | list.get(i).setTjCustomerName(tjCustomer.getCusName()); |
| | | list.get(i).setTjCustomerPhone(MatchUtils.hidePhoneNum(tjCustomer.getCusPhone())); |
| | | if (tjCustomer.getCusIdcard() != null) { |
| | | list.get(i).setTjCusIdCard(MatchUtils.hideIdCardNum(tjCustomer.getCusIdcard())); |
| | |
| | | return AjaxResult.error("不可重复登记"); |
| | | } |
| | | |
| | | |
| | | TjFlowingWater tjFlowingWater = new TjFlowingWater(); |
| | | LambdaQueryWrapper<TjReservation> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjReservation::getIdCard, tjCustomer.getCusIdcard()); |
| | | wq1.eq(TjReservation::getIsExpire, 2); |
| | |
| | | // if (DateUtil.endOfDay(new Date()).before(tjReservation.getReservationTime())) { |
| | | // return AjaxResult.error("未到预约时间"); |
| | | // } |
| | | if (DateUtil.endOfDay(tjReservation.getReservationTime()).before(new Date())) { |
| | | if (DateUtil.endOfDay(DateUtil.offsetDay(tjReservation.getReservationTime(),tjReservation.getYxts())).before(new Date())) { |
| | | tjReservation.setIsExpire(1); |
| | | tjReservationService.updateById(tjReservation); |
| | | return AjaxResult.error("对不起您的预约已超时请重新预约"); |
| | |
| | | tjOrder.setFinishTime(new Date()); |
| | | tjOrder.setCheckStatus(1); |
| | | tjOrder.setStatus(TjConstants.TJ_WAIT); |
| | | tjFlowingWater.setPayStasus(1L); |
| | | }else { |
| | | tjFlowingWater.setPayStasus(0L); |
| | | } |
| | | if (tjOrderService.save(tjOrder)) { |
| | | |
| | |
| | | Long cusNumber = tjCustomer.getCusNumber(); |
| | | cusNumber += 1; |
| | | tjCustomer.setCusNumber(cusNumber); |
| | | BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount())).divide(BigDecimal.valueOf(10)); |
| | | TjFlowingWater tjFlowingWater = new TjFlowingWater(); |
| | | tjFlowingWater.setPayStasus(0L); |
| | | BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount())); |
| | | |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjFlowingWater.setPayStasus(3L); |
| | |
| | | |
| | | } |
| | | |
| | | //修改每项的原价现价 //修改临时表体检号 |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), discount, tjOrder.getTjNumber()); |
| | | |
| | | /*调用his接口*/ |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (null != config && config.equals("Y")) { |
| | | AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer,tjOrder); |
| | | if (!result.get("code").toString().equals("200")) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | Object jzh = result.get("jzh"); |
| | | if(null !=jzh && null !=jzh.toString()){ |
| | | hisApiMethod.ZfHisApiMethod(jzh.toString()); |
| | | } |
| | | return AjaxResult.error("挂号失败!" + result.get("msg").toString()); |
| | | } |
| | | |
| | | log.info("该登记人的his就诊号是: "+tjOrder.getCardId()); |
| | | //团体 |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | asyncService.ttextracted(tjOrder, tjCustomer, sysUser, tjReservation, tjFlowingWater); |
| | | } |
| | | //个人 |
| | | if ("2".equals(tjOrder.getTjType())) { |
| | | //asyncService.newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | } |
| | | hisApiMethod.tijianshenqing(tjCustomer,DateUtil.format(date1,"yyyy-MM-dd HH:mm:ss"),tjOrder.getCardId()); |
| | | |
| | | return AjaxResult.success(tjNumber); |
| | | } else { |
| | | tjCustomer.setCardId(tjOrder.getTjNumber()); |
| | | tjCustomerService.updateById(tjCustomer); |
| | | transitionService.updateCardIdByTjNumAndIdCard(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), tjOrder.getTjNumber()); |
| | | tjOrder.setCardId(tjOrder.getTjNumber()); |
| | | tjOrderService.updateById(tjOrder); |
| | | } |
| | | |
| | | |
| | | //团体 |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | asyncService.ttextracted(tjOrder, tjCustomer, sysUser, tjReservation, tjFlowingWater); |
| | |
| | | if ("2".equals(tjOrder.getTjType())) { |
| | | //asyncService.newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | newSaveextracted(tjOrder, tjCustomer, discount, sysUser, tjReservation, tjFlowingWater); |
| | | } |
| | | |
| | | //调用SQL server拿取收费情况 |
| | | //根据配置调取存储过程 将临时表数据存入预约表2023.12.12 |
| | | // final String getInfoFromSqlData = configService.selectConfigByKey("getInfoFromSqlData"); |
| | | // if ("Y".equals(getInfoFromSqlData)){ |
| | | // List<LtkjMiddleHead> one = testMapper.saveMiddleHeadByPatId(tjCustomer.getCusIdcard()); |
| | | // if (one!=null){ |
| | | // for (LtkjMiddleHead ltkjMiddleHead : one) { |
| | | // DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | // headService.save(ltkjMiddleHead); |
| | | // DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | // List<LtkjMiddleDetail> detailList = testMapper.getMiddleDetailByHeadId(ltkjMiddleHead.getFeadId()); |
| | | // if (detailList!=null){ |
| | | // for (LtkjMiddleDetail ltkjMiddleDetail : detailList) { |
| | | // DynamicDataSourceContextHolder.setDataSourceType(DataSourceType.MASTER.name()); |
| | | // middleDetailService.save(ltkjMiddleDetail); |
| | | // DynamicDataSourceContextHolder.clearDataSourceType(); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | |
| | | |
| | | /*调用his接口*/ |
| | | String config = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (null != config && config.equals("Y")) { |
| | | AjaxResult result = hisApiMethod.HisApiMethods(tjCustomer, tjOrder.getOrderId()); |
| | | if (!result.get("code").toString().equals("200")) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("挂号失败!" + result.get("msg").toString()); |
| | | } |
| | | } else { |
| | | tjCustomer.setCardId(tjOrder.getTjNumber()); |
| | | tjCustomerService.updateById(tjCustomer); |
| | | transitionService.updateCardIdByTjNumAndIdCard(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), tjOrder.getTjNumber()); |
| | | tjOrder.setCardId(tjOrder.getTjNumber()); |
| | | tjOrderService.updateById(tjOrder); |
| | | } |
| | | return AjaxResult.success(tjNumber); |
| | | } |
| | |
| | | redisCache.deleteCacheMapValue(cardId + cusId + "cusId", cardId + cusId); |
| | | } |
| | | } |
| | | // List<TbTransition> tbTransitionList = null; |
| | | // if (!redisCache.hasKey(cardId + cusId)) { |
| | | // tbTransitionList = new ArrayList<>(); |
| | | // } else { |
| | | // tbTransitionList = redisCache.getCacheList(cardId + cusId); |
| | | // } |
| | | //套餐 |
| | | /*套餐*/ |
| | | if (null != packId && !packId.equals("")) { |
| | | Long pacId = Long.valueOf(packId.toString()); |
| | | List<TbTransition> list = transitionService.getTbTransitionListByCusIdAndPac(cusId, String.valueOf(pacId)); |
| | | if (null == list || list.size() == 0) { |
| | | if (null == list || list.isEmpty()) { |
| | | transitionService.deletedTbTransitionListByCusIdAndPac(cusId, cardId); |
| | | // if (redisCache.hasKey(cardId + cusId + "cusId")) |
| | | // redisCache.deleteCacheMapValue(cardId + cusId + "cusId", cardId + cusId); |
| | | // if (redisCache.hasKey(cardId + cusId)) { |
| | | // tbTransitionList = new ArrayList<>(); |
| | | // redisCache.deleteObject(cardId + cusId); |
| | | // } |
| | | List<TjPackageProject> ppList = tjPackageProjectService.getTjPackageProjectListByPacId(String.valueOf(pacId)); |
| | | if (null != ppList && ppList.size() > 0) { |
| | | if (null != ppList && !ppList.isEmpty()) { |
| | | transitionService.saveRedisTransitionByPacId(cusId, cardId, pacId); |
| | | //异步保存数据库 |
| | | // asyncService.addRedisTransitionPac(cusId, pacId, ppList); |
| | | // asyncService.saveRedisTransitionByPacId(cusId, cardId, pacId, null); |
| | | // for (TjPackageProject tjPackageProject : ppList) { |
| | | // TjProject project = projectService.getTjProjectById(String.valueOf(tjPackageProject.getProId())); |
| | | // if (null != project) { |
| | | // |
| | | // BigDecimal divide = BigDecimal.valueOf(0); |
| | | // if (tjPackageProject.getPriceNow().compareTo(BigDecimal.valueOf(0)) == 0 || project.getProPrice().compareTo(BigDecimal.valueOf(0)) == 0) { |
| | | // divide = BigDecimal.valueOf(0); |
| | | // } else { |
| | | // divide = tjPackageProject.getPriceNow().divide(project.getProPrice(), 5, RoundingMode.HALF_DOWN); |
| | | // } |
| | | // List<TjProject> tjProSonList = projectService.getTjProjectListBySoneId(String.valueOf(project.getProId())); |
| | | // if (null != tjProSonList && tjProSonList.size() > 0) { |
| | | // //addRedisTransitionPac(cusId, tbTransitionList, pacId, tjPackageProject, project, divide, tjProSonList); |
| | | // for (TjProject tjProject : tjProSonList) { |
| | | // TbTransition tbTransition = new TbTransition(); |
| | | // tbTransition.setCusId(cusId); |
| | | // tbTransition.setPacId(pacId); |
| | | // if (null != tjPackageProject.getPriceNow() && divide.compareTo(BigDecimal.valueOf(0)) > 0) { |
| | | // tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2, RoundingMode.HALF_DOWN)); |
| | | // tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2, RoundingMode.HALF_DOWN)); |
| | | // } else { |
| | | // tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | // tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | // } |
| | | // tbTransition.setParentProId(project.getProId()); |
| | | // tbTransition.setParentProName(project.getProName()); |
| | | // tbTransition.setProId(tjProject.getProId()); |
| | | // tbTransition.setProName(tjProject.getProName()); |
| | | // tbTransition.setPacName(tjPackageService.getById(tbTransition.getPacId()).getPacName()); |
| | | // tbTransition.setProType(tjProject.getProType()); |
| | | // tbTransition.setProCheckMethod(tjProject.getProCheckMethod()); |
| | | // tbTransitionList.add(tbTransition); |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //单项 |
| | | if (null != proIds && proIds.size() > 0) { |
| | | if (null != proIds && !proIds.isEmpty()) { |
| | | //异步保存数据库表 |
| | | // asyncService.saveRedisTransitionByPacId(cusId, cardId, null, proIds); |
| | | for (Long proId : proIds) { |
| | | TjProject project = projectService.selectTjProjectByProId(proId); |
| | | if (null != project) { //&& (!project.getProName().contains("静脉采血")|| !project.getProName().contains("费")) |
| | | if (null != project) { |
| | | List<TbTransition> transitionList = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)); |
| | | if (null == transitionList || transitionList.size() == 0) { |
| | | if (null == transitionList || transitionList.isEmpty()) { |
| | | transitionService.saveRedisTransitionByProId(cusId, cardId, proId); |
| | | } |
| | | } |
| | | // if(null !=project) transitionService.saveRedisTransitionByProId(cusId,cardId, proId); |
| | | } |
| | | // for (Long proId : proIds) { |
| | | // List<TbTransition> transitions = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)); |
| | | // if (null != transitions && transitions.size() > 0) { |
| | | // continue; |
| | | // } |
| | | // TjProject tjProject = projectService.getTjProjectById(String.valueOf(proId)); |
| | | // if (null != tjProject) { |
| | | //// List<TjProject> tjProSonList = projectService.getTjProjectListBySoneId(String.valueOf(project.getProId())); |
| | | //// if (null != tjProSonList && tjProSonList.size() > 0) { |
| | | //// for (TjProject tjProject : tjProSonList) { |
| | | //// List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(tjProject.getProId())); |
| | | //// if (null != transitionss && transitionss.size() > 0) { |
| | | //// continue; |
| | | //// } |
| | | // TbTransition tbTransition = new TbTransition(); |
| | | // tbTransition.setCusId(cusId); |
| | | // tbTransition.setPacId(null); |
| | | // if (null != tjProject.getProPrice()) { |
| | | // tbTransition.setOrdPrice(tjProject.getProPrice()); |
| | | // tbTransition.setNowPrice(tjProject.getProPrice()); |
| | | // } else { |
| | | // tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | // tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | // } |
| | | // tbTransition.setParentProId(tjProject.getProParentId()); |
| | | // if (tjProject.getProParentId() != null) { |
| | | // TjProject byId = projectService.getById(tjProject.getProParentId()); |
| | | // if (null != byId) { |
| | | // tbTransition.setParentProName(byId.getProName()); |
| | | // } |
| | | // } |
| | | // tbTransition.setParentProName(""); |
| | | // |
| | | // tbTransition.setProId(tjProject.getProId()); |
| | | // tbTransition.setProName(tjProject.getProName()); |
| | | // tbTransition.setProType(tjProject.getProType()); |
| | | // tbTransition.setProCheckMethod(tjProject.getProCheckMethod()); |
| | | // tbTransitionList.add(tbTransition); |
| | | //// } |
| | | //// } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | |
| | | // if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | // if (redisCache.hasKey(cardId + cusId)) { |
| | | // redisCache.deleteObject(cardId + cusId); |
| | | // redisCache.setCacheList(cardId + cusId, tbTransitionList); |
| | | // redisCache.setCacheMapValue(cardId + cusId + "cusId", cardId + cusId, getMaps(cusId, cardId)); |
| | | // } else { |
| | | // redisCache.setCacheList(cardId + cusId, tbTransitionList); |
| | | // redisCache.setCacheMapValue(cardId + cusId + "cusId", cardId + cusId, getMaps(cusId, cardId)); |
| | | // } |
| | | // List<Map<String, Object>> map1 = getMap(cusId, cardId, tbTransitionList); |
| | | // return AjaxResult.success(); |
| | | // } |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | if (null != tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")) { |
| | | tjOrderDetailService.saveJSYTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.saveJSYTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId()); |
| | | } else { |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId()),tjOrder.getCardId()); |
| | | } |
| | | |
| | | tjOrderDetailService.saveTjPureToneTesByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | //修改每项的原价现价 //修改临时表体检号 |
| | | transitionService.updateTbTransitionPriceByCusId(tjCustomer.getCusIdcard(), discount, tjOrder.getTjNumber()); |
| | | tjOrderDetailService.saveTjPureToneTesByCusId(tjCustomer.getCusIdcard(), tjOrder.getTjNumber(), sysUser.getNickName(),String.valueOf(sysUser.getUserId()),tjOrder.getCardId()); |
| | | |
| | | //添加remark表数据 |
| | | if (null != tjOrder.getTjCategory() && tjOrder.getTjCategory().equals("13")) { |
| | | remarkService.saveJSYTjOrderRemarkByOrderId(tjOrder.getTjNumber(), sysUser.getNickName(), String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | |
| | | tjFlowingWaterService.updateById(tjFlowingWater); |
| | | asyncService.addTjChargingStandard(tjOrder, transitionService.getTbTransitionListByCusId(tjCustomer.getCusIdcard(), tjOrder.getCardId()), sysUser); |
| | | } |
| | | // System.out.println("这段代码时间" + (System.currentTimeMillis() - l)); |
| | | } |
| | | |
| | | |
| | |
| | | tjCustomerService.updateById(customer); |
| | | String configByKey = configService.selectConfigByKey("sfkqdyhis"); |
| | | if (configByKey.equals("Y")) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("cardtype", "4"); |
| | | // map.put("input", order.getCardId()); |
| | | map.put("input", customer.getPationId()); |
| | | LocalDate currentDate = LocalDate.now(); |
| | | LocalDateTime startOfDay = currentDate.atStartOfDay(); |
| | | LocalDateTime nineteenOClock = currentDate.atTime(LocalTime.of(19, 0)); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | String ksrq = startOfDay.format(formatter); |
| | | String jsrq = nineteenOClock.format(formatter); |
| | | map.put("ksrq", ksrq); |
| | | map.put("jsrq", jsrq); |
| | | AjaxResult result = hisApiGetMethodService.getHISDataNew("Getoutpatientcostinfo", map); |
| | | if (Integer.parseInt(String.valueOf(result.get("code"))) == 200) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("撤销失败,该人员已缴费,请先退费!"); |
| | | } else { |
| | | boolean zfHisApiMethods = hisApiMethod.ZfHisApiMethods(null, order); |
| | | if (zfHisApiMethods) { |
| | | return AjaxResult.success("撤销成功", map); |
| | | } else { |
| | | |
| | | HashMap<String, Object> hisRequestParams = new HashMap<>(); |
| | | hisRequestParams.put("patientId", order.getCardId()); |
| | | AjaxResult queryPay = hisApiGetMethodService.getHISDataNew("QueryPay", hisRequestParams); |
| | | if (Integer.parseInt(queryPay.get("code").toString()) == 200) { |
| | | List<Map<String, String>> data = (List<Map<String, String>>) queryPay.get("data"); |
| | | |
| | | BigDecimal cateFeeAll = BigDecimal.ZERO; |
| | | for (Map<String, String> datum : data) { |
| | | BigDecimal cateFee = new BigDecimal(datum.get("CateFee")); |
| | | cateFeeAll = cateFeeAll.add(cateFee); |
| | | } |
| | | if (cateFeeAll.compareTo(BigDecimal.ZERO) != 0) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("撤销失败,调用作废出现失败"); |
| | | return AjaxResult.error("撤销失败,该人员已缴费,请先退费!"); |
| | | } |
| | | } |
| | | boolean zfHisApiMethods = hisApiMethod.ZfHisApiMethods(null, order); |
| | | if (zfHisApiMethods) { |
| | | return AjaxResult.success("撤销成功"); |
| | | } else { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("撤销失败,调用作废出现失败"); |
| | | } |
| | | |
| | | } |
| | | return AjaxResult.success("撤销成功!!!"); |
| | | } |
| | |
| | | if (advIds.containsAll(dto.getBldhs()) && cateFeeAll.compareTo(BigDecimal.ZERO) != 0) { |
| | | return AjaxResult.error("改项目已缴费不可撤销!!!"); |
| | | } |
| | | |
| | | } |
| | | boolean b = hisApiMethod.ZfBlXm(dto.getBldhs(), order); |
| | | if(!b){ |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return AjaxResult.error("撤销失败,调用作废出现失败"); |
| | | } |
| | | } |
| | | for (String bldh : dto.getBldhs()) { |
| | |
| | | String result1 = getAjaxResult(result); |
| | | JSONObject object = getJSONObject(result1); |
| | | String code = object.getStr("ResultCode"); |
| | | if (null != code && code.equals("200")) { |
| | | if (null != code && code.equals("0")) { |
| | | |
| | | } |
| | | return AjaxResult.success(); |