1
luodangjia
2024-05-12 533558ecfbb188f43cbb151e5245abff1b1aa818
rest/src/main/java/cn/stylefeng/rest/modular/user/controller/CounsellingInfoController.java
@@ -308,7 +308,8 @@
            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));
                    .eq(CounsellingSetMeal::getSetMealType,1).eq(CounsellingSetMeal::getIsDelete,0)
                    .groupBy(CounsellingSetMeal::getCounsellingInfoId));
            List<CounsellinginfoResponseDTO> counsellinginfoResponseDTOS = BeanUtil.copyToList(page.getRecords(),CounsellinginfoResponseDTO.class, CopyOptions.create());
            counsellinginfoResponseDTOS.stream().forEach(counsellinginfoResponseDTO -> {
@@ -335,7 +336,7 @@
                if (CollectionUtil.isNotEmpty(lowMapList)){
                    lowMapList.stream().forEach(stringObjectMap -> {
                        if (stringObjectMap.get("counsellingInfoId") != null){
                        if (stringObjectMap.get("counsellingInfoId") != null && stringObjectMap.get("counsellingInfoId").toString().equals(counsellinginfoResponseDTO.getId().toString()) ){
                            counsellinginfoResponseDTO.setLowPrice(new BigDecimal(stringObjectMap.get("price").toString()));
                        }
                    });
@@ -813,7 +814,7 @@
    public ResponseData<CounsellingOrderResponseDTO> getCounsellingOrderInfoById(Long counsellingOrderId){
        CounsellingOrder counsellingOrder = this.counsellingOrderService.getById(counsellingOrderId);
        CounsellingOrderResponseDTO counsellingOrderResponseDTO = BeanUtil.copyProperties(counsellingOrder,CounsellingOrderResponseDTO.class);
        CounsellingInfo counsellingInfo = this.counsellingInfoService.getById(counsellingOrderResponseDTO.getCounsellingInfoId());
        CounsellingInfo counsellingInfo = this.counsellingInfoService.getById(counsellingOrder.getCounsellingInfoId());
        Customer customer = this.customerService.getById(counsellingInfo.getUserId());
        counsellingOrderResponseDTO.setCounsellingName(customer.getNickName());
        return new SuccessResponseData<>(counsellingOrderResponseDTO);