| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Value("${refund.wxpay-url}") |
| | | private String refundWxpayUrl; |
| | | |
| | | @Resource |
| | | private RedissonClient redissonClient; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @ApiImplicitParam(name = "pageSize", value = "分页:每页大小(默认10)", dataTypeClass = Integer.class, paramType = "query"), |
| | | @ApiImplicitParam(name = "searchType", value = "查询类型 1-严选,2-普通查询,默认2", dataTypeClass = Integer.class, paramType = "query") |
| | | }) |
| | | public ResponseData<List<CounsellinginfoResponseDTO>> page(Integer pageNo, Integer pageSize,Integer searchType) { |
| | | if (roleInfoCacheApi.get("customer")!=null){ |
| | | List<CounsellinginfoResponseDTO> customer = roleInfoCacheApi.get("customer"); |
| | | return new SuccessResponseData<>(customer); |
| | | } |
| | | |
| | | LambdaQueryWrapper<CounsellingInfo> lambdaQueryWrapper = new LambdaQueryWrapper<CounsellingInfo>().eq(CounsellingInfo::getIsDelete,false) |
| | | .orderByDesc(CounsellingInfo::getSort,CounsellingInfo::getCreateTime).eq(CounsellingInfo::getListingStatus,1); |
| | | //默认普通查询 |
| | | if (searchType != null && searchType.intValue() == 1){ |
| | | List<Customer> customerList = customerService.getWorkerListByLineStatusAndPost(null, null, PostIdEnum.PO_22.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode()); |
| | | if (CollectionUtil.isNotEmpty(customerList)){ |
| | | List<Long> customerIds = customerList.stream().map(Customer::getCustomerId).collect(Collectors.toList()); |
| | | lambdaQueryWrapper.in(CounsellingInfo::getUserId,customerIds); |
| | | } |
| | | } |
| | | List<CounsellingInfo> page = this.counsellingInfoService.list(lambdaQueryWrapper); |
| | | if (CollectionUtil.isNotEmpty(page)){ |
| | | List<Long> counseIds = page.stream().map(CounsellingInfo::getId).collect(Collectors.toList()); |
| | | QueryWrapper<CounsellingOrder> orderQueryWrapper = new QueryWrapper<CounsellingOrder>().select("counselling_info_id counsellingInfoId,count(1) num "); |
| | | //查询是否首次咨询 |
| | | orderQueryWrapper.lambda().eq(CounsellingOrder::getUserId,LoginContext.me().getLoginUser().getUserId()).in(CounsellingOrder::getStatusFlag,1,2).in(CounsellingOrder::getCounsellingInfoId,counseIds) |
| | | .eq(CounsellingOrder::getOrderType,1).groupBy(CounsellingOrder::getCounsellingInfoId).having(" num > 0 "); |
| | | List<Map<String,Object>> mapList = this.counsellingOrderService.listMaps(orderQueryWrapper); |
| | | Map<Long,Object> fristMap = new HashMap<>(); |
| | | if (CollectionUtil.isNotEmpty(mapList)){ |
| | | |
| | | mapList.stream().forEach(stringObjectMap -> { |
| | | fristMap.put(Long.parseLong(stringObjectMap.get("counsellingInfoId").toString()),stringObjectMap.get("num")); |
| | | }); |
| | | } |
| | | //查询标签总条数 |
| | | List<CounsellingTag> counsellingTags = this.counsellingTagService.list(new LambdaQueryWrapper<CounsellingTag>() |
| | | .select(CounsellingTag::getId,CounsellingTag::getTagName)); |
| | | List<Long> custommerIds = page.stream().map(CounsellingInfo::getUserId).collect(Collectors.toList()); |
| | | //查询客户ids |
| | | List<Customer> customerList = this.customerService.list(new LambdaQueryWrapper<Customer>().select(Customer::getCustomerId,Customer::getNickName).in(Customer::getCustomerId,custommerIds)); |
| | | //查询套餐最低价 |
| | | List<Map<String,Object>> lowMapList = this.counsellingSetMealService.listMaps(new QueryWrapper<CounsellingSetMeal>().select(" counselling_info_id counsellingInfoId,IFNULL(min(price),0) price ").lambda().in(CounsellingSetMeal::getCounsellingInfoId,counseIds) |
| | | .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0)); |
| | | |
| | | List<CounsellinginfoResponseDTO> counsellinginfoResponseDTOS = BeanUtil.copyToList(page,CounsellinginfoResponseDTO.class, CopyOptions.create()); |
| | | counsellinginfoResponseDTOS.stream().forEach(counsellinginfoResponseDTO -> { |
| | | if (fristMap.get(counsellinginfoResponseDTO.getId()) != null){ |
| | | counsellinginfoResponseDTO.setIsFirstBuy(true); |
| | | } |
| | | if (StrUtil.isNotBlank(counsellinginfoResponseDTO.getCounsellingTagIds())){ |
| | | List<String> counsellingTagList = Arrays.asList(counsellinginfoResponseDTO.getCounsellingTagIds().split(",")); |
| | | String tagNames = counsellingTags.stream().filter(cou -> counsellingTagList.contains(cou.getId().toString())).map(CounsellingTag::getTagName).collect(Collectors.joining(",")); |
| | | //获取课程标签名称 |
| | | // LambdaQueryWrapper<CounsellingTag> counsellingTagLambdaQueryWrapper = new QueryWrapper<CounsellingTag>().select(" GROUP_CONCAT(tag_name) tagName ").lambda(); |
| | | // Map<String,Object> map = counsellingTagService.getMap(counsellingTagLambdaQueryWrapper.in(CounsellingTag::getId,counsellinginfoResponseDTO.getCounsellingTagIds().split(","))); |
| | | // if (ObjectUtil.isNotEmpty(map)){ |
| | | counsellinginfoResponseDTO.setCounsellingTagNames(tagNames); |
| | | // } |
| | | } |
| | | counsellinginfoResponseDTO.setPersonalProfile(null); |
| | | |
| | | counsellinginfoResponseDTO.setNikeName(customerList.stream().filter(cus -> counsellinginfoResponseDTO.getUserId().longValue() == cus.getCustomerId().longValue()).findFirst().get().getNickName()); |
| | | |
| | | // BigDecimal lowPrice = this.counsellingSetMealService.getObj(new QueryWrapper<CounsellingSetMeal>().select(" counselling_info_id counsellingInfoId,IFNULL(min(price),0) price ").lambda().eq(CounsellingSetMeal::getCounsellingInfoId,counsellinginfoResponseDTO.getId()) |
| | | // .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0),Convert::toBigDecimal); |
| | | |
| | | |
| | | if (CollectionUtil.isNotEmpty(lowMapList)){ |
| | | lowMapList.stream().forEach(stringObjectMap -> { |
| | | if (stringObjectMap.get("counsellingInfoId") != null){ |
| | | counsellinginfoResponseDTO.setLowPrice(new BigDecimal(stringObjectMap.get("price").toString())); |
| | | } |
| | | }); |
| | | if (counsellinginfoResponseDTO.getLowPrice() == null){ |
| | | counsellinginfoResponseDTO.setLowPrice(new BigDecimal(0)); |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | roleInfoCacheApi.put("customer",counsellinginfoResponseDTOS,600L); |
| | | |
| | | return new SuccessResponseData<>(counsellinginfoResponseDTOS); |
| | | } |
| | | |
| | | return new SuccessResponseData<>(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public ResponseData<PageResult<CounsellinginfoResponseDTO>> page(Integer pageNo, Integer pageSize,Integer searchType) { |
| | | // if (roleInfoCacheApi.get("customer:"+LoginContext.me().getLoginUser().getUserId())!=null){ |
| | | // List<CounsellinginfoResponseDTO> customer = roleInfoCacheApi.get("customer:"+LoginContext.me().getLoginUser().getUserId()); |
| | | // return new SuccessResponseData<>(customer); |
| | | // } |
| | | // |
| | | // LambdaQueryWrapper<CounsellingInfo> lambdaQueryWrapper = new LambdaQueryWrapper<CounsellingInfo>().eq(CounsellingInfo::getIsDelete,false) |
| | | // .orderByDesc(CounsellingInfo::getSort,CounsellingInfo::getCreateTime).eq(CounsellingInfo::getListingStatus,1); |
| | | // .orderByDesc(CounsellingInfo::getSort,CounsellingInfo::getCreateTime).eq(CounsellingInfo::getListingStatus,1); |
| | | // //默认普通查询 |
| | | // if (searchType != null && searchType.intValue() == 1){ |
| | | // List<Customer> customerList = customerService.getWorkerListByLineStatusAndPost(null, null, PostIdEnum.PO_22.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode()); |
| | |
| | | // lambdaQueryWrapper.in(CounsellingInfo::getUserId,customerIds); |
| | | // } |
| | | // } |
| | | // Page<CounsellingInfo> page = this.counsellingInfoService.page(PageFactory.defaultPage(), lambdaQueryWrapper); |
| | | // if (CollectionUtil.isNotEmpty(page.getRecords())){ |
| | | // List<Long> counseIds = page.getRecords().stream().map(CounsellingInfo::getId).collect(Collectors.toList()); |
| | | // List<CounsellingInfo> page = this.counsellingInfoService.list(lambdaQueryWrapper); |
| | | // if (CollectionUtil.isNotEmpty(page)){ |
| | | // List<Long> counseIds = page.stream().map(CounsellingInfo::getId).collect(Collectors.toList()); |
| | | // QueryWrapper<CounsellingOrder> orderQueryWrapper = new QueryWrapper<CounsellingOrder>().select("counselling_info_id counsellingInfoId,count(1) num "); |
| | | // //查询是否首次咨询 |
| | | // orderQueryWrapper.lambda().eq(CounsellingOrder::getUserId,LoginContext.me().getLoginUser().getUserId()).in(CounsellingOrder::getStatusFlag,1,2).in(CounsellingOrder::getCounsellingInfoId,counseIds) |
| | |
| | | // //查询标签总条数 |
| | | // List<CounsellingTag> counsellingTags = this.counsellingTagService.list(new LambdaQueryWrapper<CounsellingTag>() |
| | | // .select(CounsellingTag::getId,CounsellingTag::getTagName)); |
| | | // List<Long> custommerIds = page.getRecords().stream().map(CounsellingInfo::getUserId).collect(Collectors.toList()); |
| | | // List<Long> custommerIds = page.stream().map(CounsellingInfo::getUserId).collect(Collectors.toList()); |
| | | // //查询客户ids |
| | | // List<Customer> customerList = this.customerService.list(new LambdaQueryWrapper<Customer>().select(Customer::getCustomerId,Customer::getNickName).in(Customer::getCustomerId,custommerIds)); |
| | | // //查询套餐最低价 |
| | | // List<Map<String,Object>> lowMapList = this.counsellingSetMealService.listMaps(new QueryWrapper<CounsellingSetMeal>().select(" counselling_info_id counsellingInfoId,IFNULL(min(price),0) price ").lambda().in(CounsellingSetMeal::getCounsellingInfoId,counseIds) |
| | | // .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0)); |
| | | // |
| | | // List<CounsellinginfoResponseDTO> counsellinginfoResponseDTOS = BeanUtil.copyToList(page.getRecords(),CounsellinginfoResponseDTO.class, CopyOptions.create()); |
| | | // List<CounsellinginfoResponseDTO> counsellinginfoResponseDTOS = BeanUtil.copyToList(page,CounsellinginfoResponseDTO.class, CopyOptions.create()); |
| | | // counsellinginfoResponseDTOS.stream().forEach(counsellinginfoResponseDTO -> { |
| | | // if (fristMap.get(counsellinginfoResponseDTO.getId()) != null){ |
| | | // counsellinginfoResponseDTO.setIsFirstBuy(true); |
| | |
| | | //// LambdaQueryWrapper<CounsellingTag> counsellingTagLambdaQueryWrapper = new QueryWrapper<CounsellingTag>().select(" GROUP_CONCAT(tag_name) tagName ").lambda(); |
| | | //// Map<String,Object> map = counsellingTagService.getMap(counsellingTagLambdaQueryWrapper.in(CounsellingTag::getId,counsellinginfoResponseDTO.getCounsellingTagIds().split(","))); |
| | | //// if (ObjectUtil.isNotEmpty(map)){ |
| | | // counsellinginfoResponseDTO.setCounsellingTagNames(tagNames); |
| | | // counsellinginfoResponseDTO.setCounsellingTagNames(tagNames); |
| | | //// } |
| | | // } |
| | | // counsellinginfoResponseDTO.setPersonalProfile(null); |
| | |
| | | // |
| | | // |
| | | // }); |
| | | // roleInfoCacheApi.put("customer:"+LoginContext.me().getLoginUser().getUserId(),counsellinginfoResponseDTOS,600L); |
| | | // |
| | | // return new SuccessResponseData<>(PageResultFactory.createPageResult(counsellinginfoResponseDTOS,page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | // return new SuccessResponseData<>(counsellinginfoResponseDTOS); |
| | | // } |
| | | // |
| | | // return new SuccessResponseData<>(PageResultFactory.createPageResult(new ArrayList<CounsellinginfoResponseDTO>(),page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | // return new SuccessResponseData<>(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | LambdaQueryWrapper<CounsellingInfo> lambdaQueryWrapper = new LambdaQueryWrapper<CounsellingInfo>().eq(CounsellingInfo::getIsDelete,false) |
| | | .orderByDesc(CounsellingInfo::getSort,CounsellingInfo::getCreateTime).eq(CounsellingInfo::getListingStatus,1); |
| | | //默认普通查询 |
| | | if (searchType != null && searchType.intValue() == 1){ |
| | | List<Customer> customerList = customerService.getWorkerListByLineStatusAndPost(null, null, PostIdEnum.PO_22.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode()); |
| | | if (CollectionUtil.isNotEmpty(customerList)){ |
| | | List<Long> customerIds = customerList.stream().map(Customer::getCustomerId).collect(Collectors.toList()); |
| | | lambdaQueryWrapper.in(CounsellingInfo::getUserId,customerIds); |
| | | } |
| | | } |
| | | Page<CounsellingInfo> page = this.counsellingInfoService.page(PageFactory.defaultPage(), lambdaQueryWrapper); |
| | | if (CollectionUtil.isNotEmpty(page.getRecords())){ |
| | | List<Long> counseIds = page.getRecords().stream().map(CounsellingInfo::getId).collect(Collectors.toList()); |
| | | QueryWrapper<CounsellingOrder> orderQueryWrapper = new QueryWrapper<CounsellingOrder>().select("counselling_info_id counsellingInfoId,count(1) num "); |
| | | //查询是否首次咨询 |
| | | orderQueryWrapper.lambda().eq(CounsellingOrder::getUserId,LoginContext.me().getLoginUser().getUserId()).in(CounsellingOrder::getStatusFlag,1,2).in(CounsellingOrder::getCounsellingInfoId,counseIds) |
| | | .eq(CounsellingOrder::getOrderType,1).groupBy(CounsellingOrder::getCounsellingInfoId).having(" num > 0 "); |
| | | List<Map<String,Object>> mapList = this.counsellingOrderService.listMaps(orderQueryWrapper); |
| | | Map<Long,Object> fristMap = new HashMap<>(); |
| | | if (CollectionUtil.isNotEmpty(mapList)){ |
| | | |
| | | mapList.stream().forEach(stringObjectMap -> { |
| | | fristMap.put(Long.parseLong(stringObjectMap.get("counsellingInfoId").toString()),stringObjectMap.get("num")); |
| | | }); |
| | | } |
| | | //查询标签总条数 |
| | | List<CounsellingTag> counsellingTags = this.counsellingTagService.list(new LambdaQueryWrapper<CounsellingTag>() |
| | | .select(CounsellingTag::getId,CounsellingTag::getTagName)); |
| | | List<Long> custommerIds = page.getRecords().stream().map(CounsellingInfo::getUserId).collect(Collectors.toList()); |
| | | //查询客户ids |
| | | List<Customer> customerList = this.customerService.list(new LambdaQueryWrapper<Customer>().select(Customer::getCustomerId,Customer::getNickName).in(Customer::getCustomerId,custommerIds)); |
| | | //查询套餐最低价 |
| | | List<Map<String,Object>> lowMapList = this.counsellingSetMealService.listMaps(new QueryWrapper<CounsellingSetMeal>().select(" counselling_info_id counsellingInfoId,IFNULL(min(price),0) price ").lambda().in(CounsellingSetMeal::getCounsellingInfoId,counseIds) |
| | | .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0)); |
| | | |
| | | List<CounsellinginfoResponseDTO> counsellinginfoResponseDTOS = BeanUtil.copyToList(page.getRecords(),CounsellinginfoResponseDTO.class, CopyOptions.create()); |
| | | counsellinginfoResponseDTOS.stream().forEach(counsellinginfoResponseDTO -> { |
| | | if (fristMap.get(counsellinginfoResponseDTO.getId()) != null){ |
| | | counsellinginfoResponseDTO.setIsFirstBuy(true); |
| | | } |
| | | if (StrUtil.isNotBlank(counsellinginfoResponseDTO.getCounsellingTagIds())){ |
| | | List<String> counsellingTagList = Arrays.asList(counsellinginfoResponseDTO.getCounsellingTagIds().split(",")); |
| | | String tagNames = counsellingTags.stream().filter(cou -> counsellingTagList.contains(cou.getId().toString())).map(CounsellingTag::getTagName).collect(Collectors.joining(",")); |
| | | //获取课程标签名称 |
| | | // LambdaQueryWrapper<CounsellingTag> counsellingTagLambdaQueryWrapper = new QueryWrapper<CounsellingTag>().select(" GROUP_CONCAT(tag_name) tagName ").lambda(); |
| | | // Map<String,Object> map = counsellingTagService.getMap(counsellingTagLambdaQueryWrapper.in(CounsellingTag::getId,counsellinginfoResponseDTO.getCounsellingTagIds().split(","))); |
| | | // if (ObjectUtil.isNotEmpty(map)){ |
| | | counsellinginfoResponseDTO.setCounsellingTagNames(tagNames); |
| | | // } |
| | | } |
| | | counsellinginfoResponseDTO.setPersonalProfile(null); |
| | | |
| | | counsellinginfoResponseDTO.setNikeName(customerList.stream().filter(cus -> counsellinginfoResponseDTO.getUserId().longValue() == cus.getCustomerId().longValue()).findFirst().get().getNickName()); |
| | | |
| | | // BigDecimal lowPrice = this.counsellingSetMealService.getObj(new QueryWrapper<CounsellingSetMeal>().select(" counselling_info_id counsellingInfoId,IFNULL(min(price),0) price ").lambda().eq(CounsellingSetMeal::getCounsellingInfoId,counsellinginfoResponseDTO.getId()) |
| | | // .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0),Convert::toBigDecimal); |
| | | |
| | | |
| | | if (CollectionUtil.isNotEmpty(lowMapList)){ |
| | | lowMapList.stream().forEach(stringObjectMap -> { |
| | | if (stringObjectMap.get("counsellingInfoId") != null && stringObjectMap.get("counsellingInfoId").toString().equals(counsellinginfoResponseDTO.getId().toString()) ){ |
| | | counsellinginfoResponseDTO.setLowPrice(new BigDecimal(stringObjectMap.get("price").toString())); |
| | | } |
| | | }); |
| | | if (counsellinginfoResponseDTO.getLowPrice() == null){ |
| | | counsellinginfoResponseDTO.setLowPrice(new BigDecimal(0)); |
| | | } |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | return new SuccessResponseData<>(PageResultFactory.createPageResult(counsellinginfoResponseDTOS,page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | } |
| | | |
| | | return new SuccessResponseData<>(PageResultFactory.createPageResult(new ArrayList<CounsellinginfoResponseDTO>(),page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | } |
| | | |
| | | |
| | |
| | | @ApiOperation("咨询订单预约") |
| | | @PostResource(name = "咨询订单预约", path = "/counsellingOrderReservation/saveCounsellingOrderReservation") |
| | | public ResponseData<CounsellingOrderReservation> saveCounsellingOrderReservation(@RequestBody CounsellingReservationRequest counsellingReservationRequest) throws ParseException { |
| | | |
| | | //查询咨询师当天是否取消预约 |
| | | CounsellingSpecialTimeConfig specialTimeConfig = this.counsellingSpecialTimeConfigService.getOne(new LambdaQueryWrapper<CounsellingSpecialTimeConfig>().eq(CounsellingSpecialTimeConfig::getCounsellingInfoId,counsellingReservationRequest.getCounsellingId()) |
| | | .eq(CounsellingSpecialTimeConfig::getSpecialDay,counsellingReservationRequest.getDayTime()).eq(CounsellingSpecialTimeConfig::getIsCancelDay,1)); |
| | |
| | | if (counsellingOrder == null){ |
| | | throw new ServiceException("没有在咨询的订单,无法进行预约!"); |
| | | } |
| | | String key = "counsel:" + counsellingReservationRequest.getCounsellingId()+"_"+counsellingReservationRequest.getDayTime()+"_"+counsellingReservationRequest.getTimePoint(); |
| | | RLock lock = redissonClient.getLock(key); |
| | | boolean tryLock = false; |
| | | try { |
| | | log.info("咨询key:"+key+",userId:"+counsellingOrder.getUserId()); |
| | | tryLock = lock.tryLock(20, TimeUnit.SECONDS); |
| | | if (!tryLock) { |
| | | throw new ServiceException("当前时间段已预约,请选择其他时间段!"); |
| | | } |
| | | |
| | | //验证未支付的首次咨询订单 |
| | | long counselllingCount = this.counsellingOrderService.count(new LambdaQueryWrapper<CounsellingOrder>().eq(CounsellingOrder::getFirstAppointmentDate,counsellingReservationRequest.getDayTime()) |
| | |
| | | this.counsellingOrderService.updateById(counsellingOrder); |
| | | this.counsellingUserService.updateById(counsellingUserOld); |
| | | |
| | | |
| | | |
| | | CounsellingInfo counsellingInfo = this.counsellingInfoService.getById(counsellingOrder.getCounsellingInfoId()); |
| | | |
| | | |
| | | //将此条消息加入到可聊天的表中t_mental_appointment |
| | | MentalAppointment mentalAppointment = MentalAppointment.builder() |
| | |
| | | |
| | | // 发送IM消息 |
| | | ImPushDataDTO pushData1 = ImPushDataDTO.builder() |
| | | .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getCode()) |
| | | .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getName()) |
| | | .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getCode()) |
| | | .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getName()) |
| | | .content("预约成功"+",请注意预约时间:"+counsellingReservationRequest.getDayTime()+counsellingReservationRequest.getTimePoint()) |
| | | // .content("预约成功!") |
| | | .objId(ObjUtil.toString(counsellingInfo.getId())) |
| | |
| | | customerService.updateCustomerRemoveCache(customer); |
| | | } |
| | | |
| | | try { |
| | | try { |
| | | |
| | | CustomerUpdateRequest customerUpdateRequest = counsellingReservationRequest.getCustomerUpdateRequest(); |
| | | Customer customer = new Customer(); |
| | | BeanUtil.copyProperties(customerUpdateRequest,customer); |
| | | LoginUser loginUser = LoginContext.me().getLoginUser(); |
| | | customer.setCustomerId(loginUser.getUserId()); |
| | | customerService.updateById(customer); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.info("编辑用户报错"); |
| | | CustomerUpdateRequest customerUpdateRequest = counsellingReservationRequest.getCustomerUpdateRequest(); |
| | | Customer customer = new Customer(); |
| | | BeanUtil.copyProperties(customerUpdateRequest,customer); |
| | | LoginUser loginUser = LoginContext.me().getLoginUser(); |
| | | customer.setCustomerId(loginUser.getUserId()); |
| | | customerService.updateById(customer); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.info("编辑用户报错"); |
| | | } |
| | | return new SuccessResponseData<>(counsellingOrderReservation); |
| | | }catch (Exception ex){ |
| | | log.error("咨询预约服务异常",ex.getStackTrace()); |
| | | throw new ServiceException("当前时间段已在进行预约,请稍后再试!"); |
| | | }finally { |
| | | if(tryLock){ |
| | | lock.unlock(); |
| | | } |
| | | } |
| | | |
| | | return new SuccessResponseData<>(counsellingOrderReservation); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ApiOperation("根据咨询订单id查询咨询信息") |
| | | @ApiOperation("根据咨询订单id查询咨询信息") |
| | | @GetResource(name = "根据咨询订单id查询咨询信息", path = {"/counsellingOrder/getCounsellingOrderInfoById","/worker/counsellingOrder/getCounsellingOrderInfoById"}) |
| | | public ResponseData<CounsellingOrderResponseDTO> getCounsellingOrderInfoById(Long counsellingOrderId){ |
| | | CounsellingOrder counsellingOrder = this.counsellingOrderService.getById(counsellingOrderId); |