| | |
| | | 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)) { |
| | | |
| | |
| | | cusNumber += 1; |
| | | tjCustomer.setCusNumber(cusNumber); |
| | | BigDecimal discount = BigDecimal.valueOf(Double.parseDouble(tjOrder.getTjFlowingWater().getDiscount())); |
| | | TjFlowingWater tjFlowingWater = new TjFlowingWater(); |
| | | tjFlowingWater.setPayStasus(0L); |
| | | |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjFlowingWater.setPayStasus(3L); |
| | |
| | | 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(); |
| | | } |
| | | |
| | |
| | | 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(); |