| | |
| | | INNER JOIN toc_customer tcus on tcus.customer_id = tci.user_id |
| | | INNER JOIN t_counselling_user tco on tco.counselling_info_id = tcor.counselling_info_id and tco.user_id = tcor.user_id |
| | | <where> |
| | | |
| | | tcor.stauts !=5 |
| | | <if test="params.stauts != null"> |
| | | AND tcor.stauts = #{params.stauts} |
| | | </if> |
| | |
| | | // +"预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime(); |
| | | // IM推送数据json |
| | | ImPushDataDTO pushData = ImPushDataDTO.builder() |
| | | .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS.getCode()) |
| | | .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS_ONLY.getCode()) |
| | | .objId(ObjUtil.toString(counsellingInfo.getUserId())) |
| | | .title("通知") |
| | | .content(pushContent) |
| | |
| | | .set(CounsellingUser::getClassHours,0).set(CounsellingUser::getResidueClassHours,0) |
| | | .eq(CounsellingUser::getCounsellingInfoId,counsellingOrder.getCounsellingInfoId()).eq(CounsellingUser::getUserId,counsellingOrder.getUserId()); |
| | | if (counsellingOrder.getOrderType().intValue() ==1){ |
| | | counsellingUserLambdaUpdateWrapper.set(CounsellingUser::getIsFirstAppointment,null); |
| | | counsellingUserLambdaUpdateWrapper.set(CounsellingUser::getIsFirstAppointment,1); |
| | | } |
| | | //更新咨询师用户信息 |
| | | this.counsellingUserService.update(counsellingUserLambdaUpdateWrapper); |
| | |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource; |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource; |
| | | import cn.stylefeng.roses.kernel.sms.modular.service.SysSmsInfoService; |
| | | import cn.stylefeng.roses.kernel.system.api.exception.SystemModularException; |
| | | import cn.stylefeng.roses.kernel.system.api.exception.enums.user.SysUserExceptionEnum; |
| | | import cn.stylefeng.roses.kernel.system.api.expander.SystemConfigExpander; |
| | | import cn.stylefeng.roses.kernel.system.api.pojo.role.dto.SysRoleDTO; |
| | | import cn.stylefeng.roses.kernel.system.api.pojo.user.SysUserDTO; |
| | |
| | | @PostResource(name = "工作人员_删除", path = "/sysUser/delete") |
| | | @BusinessLog |
| | | public ResponseData<?> delete(@RequestBody @Validated(SysUserRequest.delete.class) SysUserDeleteRequest req) { |
| | | |
| | | List<CounsellingInfo> list = counsellingInfoService.list(Wrappers.lambdaQuery(CounsellingInfo.class).eq(CounsellingInfo::getListingStatus, 1).eq(CounsellingInfo::getIsDelete, 0)); |
| | | if (!list.isEmpty()){ |
| | | throw new SystemModularException(SysUserExceptionEnum.USER_CAN_NOT_DELETE_ADMIN); |
| | | |
| | | } |
| | | |
| | | |
| | | SysUserRequest sysUserRequest = BeanUtil.toBean(req, SysUserRequest.class); |
| | | boolean del = sysUserService.del(sysUserRequest); |
| | | if (del) { |
| | |
| | | import cn.hutool.core.collection.ListUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageFactory; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory; |
| | | import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult; |
| | |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource; |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource; |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource; |
| | | import cn.stylefeng.roses.kernel.system.modular.role.entity.SysRole; |
| | | import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser; |
| | | import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | private IVersionService versionService; |
| | | @Autowired |
| | | private SysUserService userService; |
| | | @Resource |
| | | private CacheOperatorApi<Integer> cacheOperatorApi; |
| | | |
| | | @ApiOperation("ios是否内购修改1关2开 -t") |
| | | @PostResource(name = "ios是否内购修改1关2开 -t", path = "/ios/put") |
| | | @BusinessLog |
| | | public ResponseData<?> ios(Integer ios) { |
| | | cacheOperatorApi.put("ios:need:pay",ios); |
| | | return new SuccessResponseData<>(); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("后台ios是否内购 1") |
| | | @PostResource(name = "后台ios是否内购 2", path = "/ios-list") |
| | | @BusinessLog |
| | | public ResponseData<?> ios1() { |
| | | Integer o = (Integer) cacheOperatorApi.get("ios:need:pay"); |
| | | |
| | | return new SuccessResponseData<>(o==null ? 0 :o); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | |
| | | import cn.stylefeng.guns.modular.business.service.IStoreAppointmentService; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.rule.annotation.BusinessLog; |
| | | import cn.stylefeng.roses.kernel.rule.enums.DeleteEnum; |
| | | import cn.stylefeng.roses.kernel.rule.enums.StatusEnum; |
| | | import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData; |
| | |
| | | Long userId = loginUser.getUserId(); |
| | | o.setUserId(userId); |
| | | } |
| | | |
| | | o.setStatusFlag(0); |
| | | // 保存实体 |
| | | storeAppointmentService.save(o); |
| | | return new SuccessResponseData(o.getId()); |
| | | } |
| | | |
| | | @Resource |
| | | private CacheOperatorApi<Integer> cacheOperatorApi; |
| | | @ApiOperation("ios是否内购") |
| | | @PostResource(name = "ios是否内购", path = "/ios") |
| | | @BusinessLog |
| | | public ResponseData<?> ios() { |
| | | Integer o = (Integer) cacheOperatorApi.get("ios:need:pay"); |
| | | |
| | | return new SuccessResponseData<>(o==null ? 0 :o); |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.stylefeng.guns.modular.business.dto.request.CreateOrderConsultOneRequest; |
| | | import cn.stylefeng.guns.modular.business.dto.request.CreateOrderMentalTestRequest; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalAnalysisTime; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalAppointment; |
| | | import cn.stylefeng.guns.modular.business.entity.OrderConsultOne; |
| | | import cn.stylefeng.guns.modular.business.entity.OrderMentalTest; |
| | | import cn.stylefeng.guns.modular.business.service.IMentalAnalysisTimeService; |
| | | import cn.stylefeng.guns.modular.business.service.IMentalAppointmentService; |
| | | import cn.stylefeng.guns.modular.business.service.IOrderConsultOneService; |
| | | import cn.stylefeng.guns.modular.business.service.IOrderMentalTestService; |
| | | import cn.stylefeng.guns.modular.business.entity.*; |
| | | import cn.stylefeng.guns.modular.business.service.*; |
| | | import cn.stylefeng.rest.modular.order.service.MentalTestOrderBizService; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "心理测试接口") |
| | |
| | | return new SuccessResponseData(o); |
| | | } |
| | | |
| | | @Resource |
| | | private IMentalAnalysisTimeConfigService mentalAnalysisTimeConfigService; |
| | | |
| | | @ApiOperation(value = "1V1咨询可预约时间") |
| | | @GetResource(name = "1V1咨询可预约时间", path = "/mentalAnalysisTime") |
| | | public ResponseData<List<MentalAnalysisTime>> mentalAnalysisTime() { |
| | | List<MentalAnalysisTime> list = mentalAnalysisTimeService.list( |
| | | Wrappers.<MentalAnalysisTime>lambdaQuery() |
| | | .orderByAsc(MentalAnalysisTime::getModuleNo, MentalAnalysisTime::getWeekDay, MentalAnalysisTime::getBeginTimePoint, MentalAnalysisTime::getEndTimePoint) |
| | | ); |
| | | return new SuccessResponseData(list); |
| | | // List<Customer> filteredCustomers = customerService.list(Wrappers.lambdaQuery(Customer.class).eq(Customer::getMentalAnalysisStatus,1) |
| | | // .like(Customer::getPostIds, "31")); |
| | | |
| | | // if (filteredCustomers.isEmpty()) { |
| | | List<MentalAnalysisTime> list = mentalAnalysisTimeService.list( |
| | | Wrappers.<MentalAnalysisTime>lambdaQuery() |
| | | .orderByAsc(MentalAnalysisTime::getModuleNo, MentalAnalysisTime::getWeekDay, MentalAnalysisTime::getBeginTimePoint, MentalAnalysisTime::getEndTimePoint) |
| | | ); |
| | | return new SuccessResponseData(list); |
| | | // }else { |
| | | // List<Long> collect = filteredCustomers.stream().map(Customer::getCustomerId).collect(Collectors.toList()); |
| | | // List<MentalAnalysisTimeConfig> list = mentalAnalysisTimeConfigService.list(Wrappers.lambdaQuery(MentalAnalysisTimeConfig.class).in(MentalAnalysisTimeConfig::getCounsellingInfoId, collect)); |
| | | // HashMap<String,MentalAnalysisTimeConfig> hashMap =new HashMap<>(); |
| | | // for (MentalAnalysisTimeConfig mentalAnalysisTimeConfig : list) { |
| | | // hashMap.put(mentalAnalysisTimeConfig.getWeekDay()+mentalAnalysisTimeConfig.getBeginTimePoint()+mentalAnalysisTimeConfig.getEndTimePoint(),mentalAnalysisTimeConfig); |
| | | // } |
| | | // Collection<MentalAnalysisTimeConfig> values = hashMap.values(); |
| | | // return new SuccessResponseData(values); |
| | | // } |
| | | } |
| | | |
| | | @Resource |
| | |
| | | import cn.stylefeng.rest.ijpay.controller.WxPayController; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.customer.api.pojo.CustomerInfo; |
| | | import cn.stylefeng.roses.kernel.customer.modular.entity.Customer; |
| | | import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService; |
| | |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource; |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.GetResource; |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource; |
| | | import cn.stylefeng.roses.kernel.system.modular.role.entity.SysRole; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private CacheOperatorApi<List<CounsellinginfoResponseDTO>> roleInfoCacheApi; |
| | | |
| | | |
| | | /** |
| | | * 获取咨询师信息列表(分页) |
| | | */ |
| | |
| | | @ApiImplicitParam(name = "pageSize", value = "分页:每页大小(默认10)", dataTypeClass = Integer.class, paramType = "query"), |
| | | @ApiImplicitParam(name = "searchType", value = "查询类型 1-严选,2-普通查询,默认2", dataTypeClass = Integer.class, paramType = "query") |
| | | }) |
| | | public ResponseData<PageResult<CounsellinginfoResponseDTO>> page(Integer pageNo, Integer pageSize,Integer searchType) { |
| | | 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); |
| | | .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); |
| | |
| | | |
| | | }); |
| | | |
| | | 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){ |
| | | // 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()))); |
| | | } |
| | | |
| | | |
| | |
| | | .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_SUCCESS.getCode()) |
| | | .objId(ObjUtil.toString(counsellingOrderReservation.getId())) |
| | | .title("通知") |
| | | .data1(ObjUtil.toString(counsellingInfo.getUserId())) |
| | | .data2(ObjUtil.toString(counsellingOrder.getUserId())) |
| | | .content(pushContent) |
| | | // .extra("("+DateUtil.formatDate(counsellingOrder.getFirstAppointmentDate())+" "+counsellingOrder.getFirstAppointmentTimes()+")") |
| | | .build(); |
| | | // 发送首次预约 |
| | | imBizService.messageSendSystem(counsellingOrderReservation.getUserId()+"", new String[]{counsellingOrderReservation.getUserId()+""}, pushData, ImUserTypeEnum.USER, null, true); |
| | | |
| | | |
| | | //给咨询师发消息 |
| | | Customer customerOld = this.customerService.getById(counsellingOrderReservation.getUserId()); |
| | | |
| | | String pushContent1 = "你有新的预约,请注意查收。预约用户:"+customerOld.getNickName()+",预约时间:"+DateUtil.formatDate(counsellingOrder.getFirstAppointmentDate())+" "+counsellingOrder.getFirstAppointmentTimes(); |
| | | // +"预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime(); |
| | | // IM推送数据json |
| | | ImPushDataDTO pushData2 = ImPushDataDTO.builder() |
| | | .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS.getCode()) |
| | | .objId(ObjUtil.toString(counsellingInfo.getUserId())) |
| | | .title("通知") |
| | | .content(pushContent1) |
| | | .data1(ObjUtil.toString(counsellingOrder.getUserId())) |
| | | .data2(ObjUtil.toString(counsellingInfo.getUserId())) |
| | | // .extra("去查看。") |
| | | .build(); |
| | | // 发送预约提示 |
| | | imBizService.messageSendSystem(counsellingOrder.getUserId()+"", new String[]{counsellingInfo.getUserId()+""}, pushData2, ImUserTypeEnum.WORKER, PostIdEnum.PO_22, true); |
| | | }else{ |
| | | counsellingOrderReservation.setStauts(1); |
| | | counsellingOrderReservation.setReservationType(2); |
| | |
| | | import cn.stylefeng.guns.modular.business.entity.*; |
| | | import cn.stylefeng.guns.modular.business.service.*; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.customer.modular.entity.Customer; |
| | | import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageFactory; |
| | |
| | | } |
| | | return new SuccessResponseData<>(course); |
| | | } |
| | | |
| | | @Resource |
| | | private CacheOperatorApi<List<CourseResponseDTO>> roleInfoCacheApi1; |
| | | /** |
| | | * 获取课程管理列表(分页) |
| | | */ |
| | | @ApiOperation("获取课程管理列表(分页)") |
| | | @GetResource(name = "获取课程管理列表(分页)", path = "/page", requiredPermission = false) |
| | | public ResponseData<PageResult<CourseResponseDTO>> page(CourseRequest courseRequest) { |
| | | LambdaQueryWrapper<Course> lambdaQueryWrapper = new LambdaQueryWrapper<Course>().eq(Course::getIsDelete,false) |
| | | .orderByDesc(Course::getSort,Course::getCreateTime); |
| | | if (courseRequest.getListingStatus() != null){ |
| | | lambdaQueryWrapper.eq(Course::getListingStatus,courseRequest.getListingStatus()); |
| | | }else { |
| | | lambdaQueryWrapper.eq(Course::getListingStatus,1); |
| | | } |
| | | lambdaQueryWrapper.like(StrUtil.isNotBlank(courseRequest.getCourseName()),Course::getCourseName,courseRequest.getCourseName()); |
| | | Page<Course> page = this.courseService.page(PageFactory.defaultPage(), lambdaQueryWrapper); |
| | | public ResponseData<List<CourseResponseDTO>> page(CourseRequest courseRequest) { |
| | | List<CourseResponseDTO> course = roleInfoCacheApi1.get("course"); |
| | | return new SuccessResponseData<>(course); |
| | | |
| | | if (CollectionUtil.isNotEmpty(page.getRecords())){ |
| | | List<CourseResponseDTO> courseResponseDTOList = BeanUtil.copyToList(page.getRecords(),CourseResponseDTO.class, CopyOptions.create()); |
| | | //查询当前人是否购买过课程 |
| | | List<CourseOrder> courseOrderList = this.courseOrderService.list(new LambdaQueryWrapper<CourseOrder>().select(CourseOrder::getCourseId).eq(CourseOrder::getUserId, LoginContext.me().getLoginUser().getUserId()).eq(CourseOrder::getStatusFlag,1)); |
| | | if (CollectionUtil.isNotEmpty(courseOrderList)){ |
| | | List<Long> courseIds = courseOrderList.stream().map(CourseOrder::getCourseId).collect(Collectors.toList()); |
| | | courseResponseDTOList.forEach(course1 -> { |
| | | if (courseIds.contains(course1.getId())){ |
| | | course1.setIsBuy(true); |
| | | CourseOrder courseOrder = this.courseOrderService.getOne(new LambdaQueryWrapper<CourseOrder>().select(CourseOrder::getId).eq(CourseOrder::getUserId, LoginContext.me().getLoginUser().getUserId()).eq(CourseOrder::getStatusFlag,1) |
| | | .eq(CourseOrder::getCourseId,course1.getId()).orderByAsc(CourseOrder::getPayTime) |
| | | .last(" limit 1 ")); |
| | | if(courseOrder != null){ |
| | | course1.setCourseOrderId(courseOrder.getId()); |
| | | } |
| | | }else{ |
| | | course1.setIsBuy(false); |
| | | } |
| | | }); |
| | | } |
| | | return new SuccessResponseData<>(PageResultFactory.createPageResult(courseResponseDTOList,page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | } |
| | | return new SuccessResponseData<>(PageResultFactory.createPageResult(new ArrayList<CourseResponseDTO>(),page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | // LambdaQueryWrapper<Course> lambdaQueryWrapper = new LambdaQueryWrapper<Course>().eq(Course::getIsDelete,false) |
| | | // .orderByDesc(Course::getSort,Course::getCreateTime); |
| | | // if (courseRequest.getListingStatus() != null){ |
| | | // lambdaQueryWrapper.eq(Course::getListingStatus,courseRequest.getListingStatus()); |
| | | // }else { |
| | | // lambdaQueryWrapper.eq(Course::getListingStatus,1); |
| | | // } |
| | | // lambdaQueryWrapper.like(StrUtil.isNotBlank(courseRequest.getCourseName()),Course::getCourseName,courseRequest.getCourseName()); |
| | | // Page<Course> page = this.courseService.page(PageFactory.defaultPage(), lambdaQueryWrapper); |
| | | // |
| | | // if (CollectionUtil.isNotEmpty(page.getRecords())){ |
| | | // List<CourseResponseDTO> courseResponseDTOList = BeanUtil.copyToList(page.getRecords(),CourseResponseDTO.class, CopyOptions.create()); |
| | | // //查询当前人是否购买过课程 |
| | | // List<CourseOrder> courseOrderList = this.courseOrderService.list(new LambdaQueryWrapper<CourseOrder>().select(CourseOrder::getCourseId).eq(CourseOrder::getUserId, LoginContext.me().getLoginUser().getUserId()).eq(CourseOrder::getStatusFlag,1)); |
| | | // if (CollectionUtil.isNotEmpty(courseOrderList)){ |
| | | // List<Long> courseIds = courseOrderList.stream().map(CourseOrder::getCourseId).collect(Collectors.toList()); |
| | | // courseResponseDTOList.forEach(course1 -> { |
| | | // if (courseIds.contains(course1.getId())){ |
| | | // course1.setIsBuy(true); |
| | | // CourseOrder courseOrder = this.courseOrderService.getOne(new LambdaQueryWrapper<CourseOrder>().select(CourseOrder::getId).eq(CourseOrder::getUserId, LoginContext.me().getLoginUser().getUserId()).eq(CourseOrder::getStatusFlag,1) |
| | | // .eq(CourseOrder::getCourseId,course1.getId()).orderByAsc(CourseOrder::getPayTime) |
| | | // .last(" limit 1 ")); |
| | | // if(courseOrder != null){ |
| | | // course1.setCourseOrderId(courseOrder.getId()); |
| | | // } |
| | | // }else{ |
| | | // course1.setIsBuy(false); |
| | | // } |
| | | // }); |
| | | // } |
| | | // return new SuccessResponseData<>(PageResultFactory.createPageResult(courseResponseDTOList,page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | // } |
| | | // return new SuccessResponseData<>(PageResultFactory.createPageResult(new ArrayList<CourseResponseDTO>(),page.getTotal(), Convert.toInt(page.getSize()),Convert.toInt(page.getCurrent()))); |
| | | } |
| | | |
| | | |
| | |
| | | package cn.stylefeng.rest.modular.work; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import cn.stylefeng.guns.modular.business.dto.CounsellinginfoResponseDTO; |
| | | import cn.stylefeng.guns.modular.business.dto.CourseResponseDTO; |
| | | import cn.stylefeng.guns.modular.business.dto.ImPushDataDTO; |
| | | import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalAppointment; |
| | | import cn.stylefeng.guns.modular.business.service.IMentalAppointmentService; |
| | | import cn.stylefeng.guns.modular.business.service.IMentalTestRecordService; |
| | | import cn.stylefeng.guns.modular.business.entity.*; |
| | | import cn.stylefeng.guns.modular.business.service.*; |
| | | import cn.stylefeng.guns.modular.business.service.impl.ImBizService; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.customer.modular.entity.Customer; |
| | | import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageFactory; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory; |
| | | import cn.stylefeng.roses.kernel.rule.enums.*; |
| | | import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | * Corn表达式 @Scheduled(cron = Corn表达式) |
| | | * @Scheduled(cron = "0 0/30 * * * *") |
| | | */ |
| | | @Resource |
| | | private CacheOperatorApi<List<CounsellinginfoResponseDTO>> roleInfoCacheApi; |
| | | @Resource |
| | | private CacheOperatorApi<List<CourseResponseDTO>> roleInfoCacheApi1; |
| | | @Resource |
| | | private CustomerService customerService; |
| | | @Resource |
| | | private ICounsellingInfoService counsellingInfoService; |
| | | @Resource |
| | | private ICounsellingOrderService counsellingOrderService; |
| | | @Resource |
| | | private ICounsellingTagService counsellingTagService; |
| | | @Resource |
| | | private ICounsellingSetMealService counsellingSetMealService; |
| | | @Resource |
| | | private ICourseService courseService; |
| | | @Resource |
| | | private ICourseOrderService courseOrderService; |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | public void list1() { |
| | | LambdaQueryWrapper<Course> lambdaQueryWrapper = new LambdaQueryWrapper<Course>().eq(Course::getIsDelete,false) |
| | | .orderByDesc(Course::getSort,Course::getCreateTime); |
| | | lambdaQueryWrapper.eq(Course::getListingStatus,1); |
| | | // lambdaQueryWrapper.like(StrUtil.isNotBlank(courseRequest.getCourseName()),Course::getCourseName,courseRequest.getCourseName()); |
| | | List<Course> page = this.courseService.list(lambdaQueryWrapper); |
| | | |
| | | if (CollectionUtil.isNotEmpty(page)){ |
| | | List<CourseResponseDTO> courseResponseDTOList = BeanUtil.copyToList(page,CourseResponseDTO.class, CopyOptions.create()); |
| | | //查询当前人是否购买过课程 |
| | | List<CourseOrder> courseOrderList = this.courseOrderService.list(new LambdaQueryWrapper<CourseOrder>().select(CourseOrder::getCourseId).eq(CourseOrder::getUserId, LoginContext.me().getLoginUser().getUserId()).eq(CourseOrder::getStatusFlag,1)); |
| | | if (CollectionUtil.isNotEmpty(courseOrderList)){ |
| | | List<Long> courseIds = courseOrderList.stream().map(CourseOrder::getCourseId).collect(Collectors.toList()); |
| | | courseResponseDTOList.forEach(course1 -> { |
| | | if (courseIds.contains(course1.getId())){ |
| | | course1.setIsBuy(true); |
| | | CourseOrder courseOrder = this.courseOrderService.getOne(new LambdaQueryWrapper<CourseOrder>().select(CourseOrder::getId).eq(CourseOrder::getUserId, LoginContext.me().getLoginUser().getUserId()).eq(CourseOrder::getStatusFlag,1) |
| | | .eq(CourseOrder::getCourseId,course1.getId()).orderByAsc(CourseOrder::getPayTime) |
| | | .last(" limit 1 ")); |
| | | if(courseOrder != null){ |
| | | course1.setCourseOrderId(courseOrder.getId()); |
| | | } |
| | | }else{ |
| | | course1.setIsBuy(false); |
| | | } |
| | | }); |
| | | } |
| | | roleInfoCacheApi1.put("course",courseResponseDTOList); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | @Scheduled(fixedRate = 1000 * 60) |
| | | |
| | | public void list() { |
| | | 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> customerList1 = customerService.getWorkerListByLineStatusAndPost(null, null, PostIdEnum.PO_22.getCode(), CustomerWorkStatusEnum.ON_WORK.getCode()); |
| | | if (CollectionUtil.isNotEmpty(customerList1)){ |
| | | List<Long> customerIds = customerList1.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); |
| | | } |
| | | } |
| | | @Scheduled(fixedRate = 1000 * 30) |
| | | public void autoStartMentalAppointment() { |
| | | // 当前时间 |
| | |
| | | .ge(CounsellingOrderReservation::getReservationBeginTime,startTime).le(CounsellingOrderReservation::getReservationBeginTime,nowDate) |
| | | .eq(CounsellingOrderReservation::getStauts,2)); |
| | | if (CollectionUtil.isNotEmpty(waitList)){ |
| | | //更新为待服务 |
| | | //更新为服务中 |
| | | List<Long> idList = waitList.stream().map(CounsellingOrderReservation::getId).collect(Collectors.toList()); |
| | | log.info("自动更新待服务的咨询,ids:"+idList.toString()); |
| | | this.counsellingOrderReservationService.update(new LambdaUpdateWrapper<CounsellingOrderReservation>().set(CounsellingOrderReservation::getStauts,3) |
| | |
| | | .in(CounsellingOrderReservation::getId,idList)); |
| | | |
| | | } |
| | | |
| | | // //查询结束的预约 |
| | | // List<CounsellingOrderReservation> waitList1 = this.counsellingOrderReservationService.list(new LambdaQueryWrapper<CounsellingOrderReservation>() |
| | | // .le(CounsellingOrderReservation::getReservationEndTime,startTime).eq(CounsellingOrderReservation::getStauts,2)); |
| | | // |
| | | // if (CollectionUtil.isNotEmpty(waitList1)){ |
| | | // //更新为已完成 |
| | | // List<Long> idList = waitList1.stream().map(CounsellingOrderReservation::getId).collect(Collectors.toList()); |
| | | // log.info("自动更新待服务的咨询,ids:"+idList.toString()); |
| | | // this.counsellingOrderReservationService.update(new LambdaUpdateWrapper<CounsellingOrderReservation>().set(CounsellingOrderReservation::getStauts,4) |
| | | // .set(CounsellingOrderReservation::getServiceBeginTime,new Date()) |
| | | // .in(CounsellingOrderReservation::getId,idList)); |
| | | |
| | | // } |
| | | //查询服务中的预约 |
| | | List<CounsellingOrderReservation> serviceList = this.counsellingOrderReservationService.list(new LambdaQueryWrapper<CounsellingOrderReservation>() |
| | | .le(CounsellingOrderReservation::getReservationEndTime,nowDate) |
| | |
| | | S_TO_W_TIP_MENTAL_APPOINTMENT("01002", "提示性格分析师有预约"), |
| | | S_TO_W_TIP_CONSULT_PAY_SUCCESS("21103", "首次咨询支付成功后提示"), |
| | | S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS("21204", "咨询支付成功后提示"), |
| | | S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS_ONLY("212041", "只提示"), |
| | | S_TO_W_TIP_COURSE_PAY_GROUP_SUCCESS("21205", "课程支付成功后提示"), |
| | | C_TO_W_IM_1V1_START_CONSULT("21107", "用户发送心理测试结果,1v1咨询开始"), |
| | | S_TO_C_TIP_AUDIT_PASS("02001", "咨询师同意预约后提示"), |
| | |
| | | * 系统执行出错(一级宏观错误码) |
| | | */ |
| | | SYSTEM_RUNTIME_ERROR(BUSINESS_ERROR_TYPE_CODE + FIRST_LEVEL_WIDE_CODE, "系统执行出错,请检查系统运行状况"), |
| | | MENTAL_APPOINTMENT_NO_WORKER_ERROR("500", "预约失败,请更换预约时间段"); |
| | | MENTAL_APPOINTMENT_NO_WORKER_ERROR("500", "分析师已下班"); |
| | | |
| | | /** |
| | | * 错误编码 |
| | |
| | | * 不能删除超级管理员 |
| | | */ |
| | | USER_CAN_NOT_DELETE_ADMIN(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "75", "不能删除超级管理员"), |
| | | USER_CAN_NOT_DELETE_INFO(RuleConstants.USER_OPERATION_ERROR_TYPE_CODE + SystemConstants.SYSTEM_EXCEPTION_STEP_CODE + "778", "不能删除已配置咨询师信息的员工"), |
| | | |
| | | /** |
| | | * 不能修改超级管理员状态 |
| | |
| | | import cn.stylefeng.roses.kernel.wrapper.api.annotation.Wrapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | return new SuccessResponseData<>(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除系统用户 |
| | | * |
| | |
| | | return sysUser; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean del(SysUserRequest sysUserRequest) { |
| | | SysUser sysUser = this.querySysUser(sysUserRequest); |
| | | |
| | | |
| | | // 不能删除超级管理员 |
| | | if (YesOrNotEnum.Y.getCode().equals(sysUser.getSuperAdminFlag())) { |
| | | throw new SystemModularException(SysUserExceptionEnum.USER_CAN_NOT_DELETE_ADMIN); |