This commit is contained in:
PQZ 2024-09-24 21:32:13 +08:00
commit f680a54b5c
41 changed files with 457 additions and 99 deletions

View File

@ -0,0 +1,32 @@
package cn.iocoder.yudao.module.app.car.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.custom.entity.CarBrand;
import cn.iocoder.yudao.module.custom.service.CarBrandService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "小程序 - 车辆品牌维护")
@RestController
@RequestMapping("/userClient/base/carBrand")
@Validated
public class AppCarBrandController {
@Resource
private CarBrandService carBrandService;
@GetMapping("/list")
@Operation(summary = "获得全部车辆品牌")
public CommonResult<List<CarBrand>> getCarBrandList() {
List<CarBrand> carBrandList = carBrandService.getCarBrandList();
return success(carBrandList);
}
}

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.app.car.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain; import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.service.AppCarMainService; import cn.iocoder.yudao.module.app.car.service.AppCarMainService;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
@ -71,9 +72,9 @@ public class AppCarMainController {
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得车辆信息") @Operation(summary = "获得车辆信息")
// @PreAuthorize("@ss.hasPermission('base:car-main:query')") // @PreAuthorize("@ss.hasPermission('base:car-main:query')")
public CommonResult<List<AppCarMain>> getCarMain() { public CommonResult<List<AppCarMainResVo>> getCarMain() {
List<AppCarMain> carMain = carMainService.getCarMain(); List<AppCarMainResVo> carMain = carMainService.getCarMain();
return CommonResult.success(carMain); return CommonResult.success(carMain);
} }

View File

@ -1,52 +0,0 @@
package cn.iocoder.yudao.module.app.car.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.module.custom.entity.CarModel;
import cn.iocoder.yudao.module.custom.service.CarModelService;
import cn.iocoder.yudao.module.custom.vo.CarModelReqVO;
import cn.iocoder.yudao.module.custom.vo.CarModelRespVO;
import cn.iocoder.yudao.module.custom.vo.CascaderOptionsVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 车辆品牌型号")
@RestController
@RequestMapping("/userClient/base/carModel")
@Validated
public class AppCarModelController {
@Autowired
private CarModelService carModelService;
/**
* 获得全部车辆品牌
*
* @return
*/
@GetMapping("/list")
@Operation(summary = "查询车辆品牌")
public CommonResult<List<CarModel>> getList() {
List<CarModel> carModelList = carModelService.getCarModelList();
return success(carModelList);
}
}

View File

@ -7,13 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
/** /**
* 车辆信息 DO * 车辆信息 DO
@ -109,7 +105,7 @@ public class AppCarMain extends TenantBaseDO {
/** /**
* 车辆注册日期 * 车辆注册日期
*/ */
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
private Date carRegisterDate; private Date carRegisterDate;
/** /**
* 行驶证图片 * 行驶证图片

View File

@ -1,6 +1,7 @@
package cn.iocoder.yudao.module.app.car.mapper; package cn.iocoder.yudao.module.app.car.mapper;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain; import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -12,6 +13,6 @@ public interface AppCarMainMapper extends BaseMapper<AppCarMain> {
// 查询当前用户的所有车辆 // 查询当前用户的所有车辆
List<AppCarMain> getUserCarMain(@Param("userId") Long userId); List<AppCarMainResVo> getUserCarMain(@Param("userId") Long userId);
} }

View File

@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.app.car.service;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain; import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import cn.iocoder.yudao.module.custom.vo.CarMainRespVO; import cn.iocoder.yudao.module.custom.vo.CarMainRespVO;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -41,7 +42,7 @@ public interface AppCarMainService extends IService<AppCarMain> {
* *
* @return 车辆信息 * @return 车辆信息
*/ */
List<AppCarMain> getCarMain(); List<AppCarMainResVo> getCarMain();

View File

@ -8,6 +8,7 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain; import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import cn.iocoder.yudao.module.app.car.mapper.AppCarMainMapper; import cn.iocoder.yudao.module.app.car.mapper.AppCarMainMapper;
import cn.iocoder.yudao.module.app.car.service.AppCarMainService; import cn.iocoder.yudao.module.app.car.service.AppCarMainService;
import cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo;
import cn.iocoder.yudao.module.custom.entity.CustomerCar; import cn.iocoder.yudao.module.custom.entity.CustomerCar;
import cn.iocoder.yudao.module.custom.entity.CustomerMain; import cn.iocoder.yudao.module.custom.entity.CustomerMain;
import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper;
@ -99,9 +100,9 @@ public class AppCarMainServiceImpl extends ServiceImpl<AppCarMainMapper, AppCarM
* @return * @return
*/ */
@Override @Override
public List<AppCarMain> getCarMain() { public List<AppCarMainResVo> getCarMain() {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
List<AppCarMain> userCarMain = super.baseMapper.getUserCarMain(loginUser.getId()); List<AppCarMainResVo> userCarMain = super.baseMapper.getUserCarMain(loginUser.getId());
return userCarMain; return userCarMain;

View File

@ -0,0 +1,13 @@
package cn.iocoder.yudao.module.app.car.vo;
import cn.iocoder.yudao.module.app.car.entity.AppCarMain;
import lombok.Data;
@Data
public class AppCarMainResVo extends AppCarMain {
// 品牌名称
private String brandName;
// 品牌图片路径
private String logoImg;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.company.admin; package cn.iocoder.yudao.module.app.company.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.company.entity.Company; import cn.iocoder.yudao.module.company.entity.Company;
@ -24,7 +24,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 14:04 2024/9/23 * @date 14:04 2024/9/23
**/ **/
@RestController @RestController
@RequestMapping("/api/base/company") @RequestMapping("/userClient/base/company")
@Tag(name = "API - BASE 企业管理") @Tag(name = "API - BASE 企业管理")
@Validated @Validated
public class CompanyAPI { public class CompanyAPI {
@ -50,4 +50,16 @@ public class CompanyAPI {
return success(companyService.getCompanyPageByServer(company, page)); return success(companyService.getCompanyPageByServer(company, page));
} }
/**
* 查企业能提供的业务
*
* @author 小李
* @date 10:21 2024/9/24
* @param id 企业ID
**/
@GetMapping("/get")
@Operation(summary = "查企业能提供的业务")
public CommonResult<?> getCompanyServerById(@RequestParam("id") String id){
return success(companyService.getCompanyServerById(id));
}
} }

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.app.company.vo;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import lombok.Data;
import java.util.List;
/**
* 企业和企业的服务
*
* @author 小李
* @date 10:22 2024/9/24
**/
@Data
public class CompanyToServerVO extends Company {
private List<ServicePackageDto> servicePackages;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.conf.admin; package cn.iocoder.yudao.module.app.conf.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.conf.entity.BaseType; import cn.iocoder.yudao.module.conf.entity.BaseType;
@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 14:21 2024/9/23 * @date 14:21 2024/9/23
**/ **/
@RestController @RestController
@RequestMapping("/api/base/type") @RequestMapping("/userClient/base/type")
public class BaseTypeAPI { public class BaseTypeAPI {
@Resource @Resource

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.company.service; package cn.iocoder.yudao.module.company.service;
import cn.iocoder.yudao.module.app.company.vo.CompanyToServerVO;
import cn.iocoder.yudao.module.company.entity.Company; import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.vo.CompanyReqVO; import cn.iocoder.yudao.module.company.vo.CompanyReqVO;
import cn.iocoder.yudao.module.company.vo.CompanyRespVO; import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
@ -67,4 +68,13 @@ public interface CompanyService extends IService<Company> {
* @param company 企业对象主要是serverCodes * @param company 企业对象主要是serverCodes
**/ **/
IPage<Company> getCompanyPageByServer(Company company, Page<Company> page); IPage<Company> getCompanyPageByServer(Company company, Page<Company> page);
/**
* 查企业能提供的业务
*
* @author 小李
* @date 10:21 2024/9/24
* @param id 企业ID
**/
CompanyToServerVO getCompanyServerById(String id);
} }

View File

@ -1,15 +1,19 @@
package cn.iocoder.yudao.module.company.service.impl; package cn.iocoder.yudao.module.company.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.exception.ErrorCode; import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.exception.ServiceException;
import cn.iocoder.yudao.module.app.company.vo.CompanyToServerVO;
import cn.iocoder.yudao.module.company.entity.Company; import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.vo.CompanyRespVO; import cn.iocoder.yudao.module.company.vo.CompanyRespVO;
import cn.iocoder.yudao.module.system.api.dept.DeptApi; import cn.iocoder.yudao.module.system.api.dept.DeptApi;
import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO;
import cn.iocoder.yudao.module.system.api.permission.PermissionApi; import cn.iocoder.yudao.module.system.api.permission.PermissionApi;
import cn.iocoder.yudao.module.system.api.permission.RoleApi; import cn.iocoder.yudao.module.system.api.permission.RoleApi;
import cn.iocoder.yudao.module.system.api.service.ServicePackageApi;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO; import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
@ -26,10 +30,7 @@ import cn.iocoder.yudao.module.company.service.CompanyService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays; import java.util.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF; import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
@ -53,6 +54,9 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
private PermissionApi permissionApi; private PermissionApi permissionApi;
@Resource @Resource
private DeptApi deptApi; private DeptApi deptApi;
@Resource
@Lazy
private ServicePackageApi servicePackageApi;
/** /**
@ -182,4 +186,23 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
public IPage<Company> getCompanyPageByServer(Company company, Page<Company> page){ public IPage<Company> getCompanyPageByServer(Company company, Page<Company> page){
return baseMapper.getCompanyPageByServer(company, page); return baseMapper.getCompanyPageByServer(company, page);
} }
/**
* 查企业能提供的业务
*
* @author 小李
* @date 10:21 2024/9/24
* @param id 企业ID
**/
@Override
public CompanyToServerVO getCompanyServerById(String id){
// 查企业信息
Company company = baseMapper.selectById(id);
CompanyToServerVO result = BeanUtil.toBean(company, CompanyToServerVO.class);
// 查服务
List<String> services = Arrays.asList(company.getServiceCodes().split(","));
List<ServicePackageDto> servicePackageByIds = servicePackageApi.getServicePackageByIds(services);
Optional.ofNullable(servicePackageByIds).ifPresent(result::setServicePackages);
return result;
}
} }

View File

@ -146,6 +146,7 @@ public class BaseTypeServiceImpl extends ServiceImpl<BaseTypeMapper, BaseType> i
* @date 14:29 2024/9/23 * @date 14:29 2024/9/23
* @param baseType 查询条件 * @param baseType 查询条件
**/ **/
@Deprecated // 写错了先弃用
@Override @Override
public List<BaseType> getListByTypeAndCorpId(BaseType baseType){ public List<BaseType> getListByTypeAndCorpId(BaseType baseType){
return baseTypeMapper.getListByTypeAndCorpId(baseType); return baseTypeMapper.getListByTypeAndCorpId(baseType);

View File

@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.custom.vo.CarBrandRespVO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* 车辆品牌维护 Service 接口 * 车辆品牌维护 Service 接口
* *
@ -53,4 +55,6 @@ public interface CarBrandService extends IService<CarBrand> {
*/ */
IPage<CarBrandRespVO> getCarBrandPage(CarBrandReqVO pageReqVO); IPage<CarBrandRespVO> getCarBrandPage(CarBrandReqVO pageReqVO);
List<CarBrand> getCarBrandList();
} }

View File

@ -12,6 +12,7 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import java.util.List;
import java.util.UUID; import java.util.UUID;
/** /**
@ -86,4 +87,9 @@ public class CarBrandServiceImpl extends ServiceImpl<CarBrandMapper, CarBrand> i
return baseMapper.findPage(page,pageReqVO); return baseMapper.findPage(page,pageReqVO);
} }
@Override
public List<CarBrand> getCarBrandList() {
return baseMapper.selectList(null);
}
} }

View File

@ -107,5 +107,11 @@ public interface RepairOrderInfoService extends IService<RepairOrderInfo> {
*/ */
Map<String,Object> payTransactions(String orderId); Map<String,Object> payTransactions(String orderId);
/**
* 获得已经评价的订单
*
* @author 小李
* @date 15:50 2024/9/24
**/
IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page);
} }

View File

@ -4,6 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils; import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.company.service.CompanyService;
import cn.iocoder.yudao.module.custom.service.CustomerBalanceService; import cn.iocoder.yudao.module.custom.service.CustomerBalanceService;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
@ -28,7 +30,10 @@ import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.common.BaseConstants.GENERAL_YES; import static cn.iocoder.yudao.common.BaseConstants.GENERAL_YES;
import static cn.iocoder.yudao.common.BaseConstants.ORDER_HYCZ; import static cn.iocoder.yudao.common.BaseConstants.ORDER_HYCZ;
@ -139,6 +144,8 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
**/ **/
@Override @Override
public IPage<RepairOrderInfoRespVO> getOrderPageByStatus(RepairOrderInfoRespVO respVO, Page<RepairOrderInfo> page){ public IPage<RepairOrderInfoRespVO> getOrderPageByStatus(RepairOrderInfoRespVO respVO, Page<RepairOrderInfo> page){
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
Optional.ofNullable(loginUserId).ifPresent(respVO::setUserId);
return baseMapper.getOrderPageByStatus(respVO, page); return baseMapper.getOrderPageByStatus(respVO, page);
} }
@ -205,4 +212,19 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl<RepairOrderInfoMappe
return JSONObject.parseObject(resStr, new TypeReference<Map<String, Object>>(){}); return JSONObject.parseObject(resStr, new TypeReference<Map<String, Object>>(){});
} }
/**
* 获得已经评价的订单
*
* @author 小李
* @date 15:50 2024/9/24
**/
@Override
public IPage<RepairOrderInfo> getAppraisePage(Page<RepairOrderInfo> page){
// 查订单
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
return baseMapper.selectPage(page, new LambdaQueryWrapper<RepairOrderInfo>().and(item -> {
item.eq(RepairOrderInfo::getUserId, loginUserId)
.isNotNull(RepairOrderInfo::getCommentDesc);
}));
}
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.order.vo; package cn.iocoder.yudao.module.order.vo;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
@ -13,8 +14,6 @@ public class RepairOrderInfoRespVO extends RepairOrderInfo {
/** 订单状态(工单的状态) */ /** 订单状态(工单的状态) */
private String status; private String status;
//订单描述 //订单描述
private String description; private String description;
} }

View File

@ -43,7 +43,7 @@
and dbt.type = #{map.type} and dbt.type = #{map.type}
</if> </if>
<if test="map.corpId != null and map.corpId != ''"> <if test="map.corpId != null and map.corpId != ''">
and dbt.corp_id = #{map.corpId} and find_in_set(#{map.corpId}, dbt.corp_id) > 0
</if> </if>
</select> </select>
</mapper> </mapper>

View File

@ -3,13 +3,19 @@
<mapper namespace="cn.iocoder.yudao.module.app.car.mapper.AppCarMainMapper"> <mapper namespace="cn.iocoder.yudao.module.app.car.mapper.AppCarMainMapper">
<select id="getUserCarMain" resultType="cn.iocoder.yudao.module.app.car.entity.AppCarMain"> <select id="getUserCarMain" resultType="cn.iocoder.yudao.module.app.car.vo.AppCarMainResVo">
select main.* from base_customer_car car INNER JOIN base_car_main main on car.car_id = main.id SELECT main.*, brand.brand_name as brandName, brand.logo_img as logoImg
where car.cus_id = ( from (select main.*
select id from base_customer_main from base_customer_car car
where user_id = #{userId} INNER JOIN base_car_main main on car.car_id = main.id
and deleted = 0 where car.cus_id = (
) and main.deleted = 0 select id
from base_customer_main
where user_id = #{userId}
and deleted = 0
)
and main.deleted = 0) as main
LEFT JOIN base_car_brand brand on main.car_brand = brand.id
</select> </select>
</mapper> </mapper>

View File

@ -35,7 +35,7 @@
<resultMap id="QueryResultMap" type="cn.iocoder.yudao.module.company.vo.CompanyRespVO"> <resultMap id="QueryResultMap" type="cn.iocoder.yudao.module.company.vo.CompanyRespVO">
<id property="id" column="c_id" jdbcType="VARCHAR"/> <id property="id" column="c_id" jdbcType="VARCHAR"/>
<association property="userDTO" javaType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO"> <association property="userDTO" javaType="cn.iocoder.yudao.module.system.api.user.dto.UserDTO">
<id property="id" column="u_id" jdbcType="BIGINT" /> <id property="id" column="u_id" jdbcType="BIGINT"/>
</association> </association>
</resultMap> </resultMap>
<select id="getCompanyAndManager" resultMap="QueryResultMap"> <select id="getCompanyAndManager" resultMap="QueryResultMap">
@ -46,8 +46,9 @@
</select> </select>
<select id="getCompanyPageByServer" resultType="cn.iocoder.yudao.module.company.entity.Company"> <select id="getCompanyPageByServer" resultType="cn.iocoder.yudao.module.company.entity.Company">
select * select bc.*
from base_company from base_company bc
where FIND_IN_SET(#{map.serviceCodes}, service_codes) > 0 left join system_tenant st on bc.tenant_id = st.id
where FIND_IN_SET(#{map.serviceCodes}, bc.service_codes) > 0
</select> </select>
</mapper> </mapper>

View File

@ -48,10 +48,10 @@
<if test="map.status != null and map.status != ''"> <if test="map.status != null and map.status != ''">
<choose> <choose>
<when test="map.status != '00'"> <when test="map.status != '00'">
drt.tickets_work_status = #{map.status} and drt.tickets_work_status = #{map.status}
</when> </when>
<when test="map.status == '00'"> <when test="map.status == '00'">
roi.comment_time is null and roi.comment_time is null and roi.order_status = '1'
</when> </when>
</choose> </choose>
</if> </if>

View File

@ -1,16 +1,20 @@
package cn.iocoder.yudao.module.app.booking.admin; package cn.iocoder.yudao.module.app.booking.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/** /**
@ -20,7 +24,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 11:04 2024/9/23 * @date 11:04 2024/9/23
**/ **/
@RestController @RestController
@RequestMapping("/api/repair/booking") @RequestMapping("/userClient/repair/booking")
public class BookingAPI { public class BookingAPI {
/** /**
@ -88,4 +92,17 @@ public class BookingAPI {
public CommonResult<?> getBookingById(@RequestParam("id") String id){ public CommonResult<?> getBookingById(@RequestParam("id") String id){
return success(dlRepairBookingService.getBookingById(id)); return success(dlRepairBookingService.getBookingById(id));
} }
/**
* 维修预约表 映射
*
* @author 小李
* @date 13:32 2024/9/24
* @param ids 预约记录ID
**/
@GetMapping("/map")
@Operation(summary = "维修预约表 映射")
public CommonResult<?> getBookingMap(@RequestParam("ids") List<String> ids){
return success(dlRepairBookingService.getBookingMap(ids));
}
} }

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.app.booking.vo;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
import lombok.Data;
/**
* 预约信息查询
*
* @author 小李
* @date 13:25 2024/9/24
**/
@Data
public class BookingQueryVO extends DlRepairBooking {
/** 企业信息 */
private Company company;
/** 服务信息 */
private ServicePackageDto servicePackage;
}

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.order.admin; package cn.iocoder.yudao.module.app.order.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo;
@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 17:20 2024/9/23 * @date 17:20 2024/9/23
**/ **/
@RestController @RestController
@RequestMapping("/api/repair/order") @RequestMapping("/userClient/repair/order")
public class RepairOrderAPI { public class RepairOrderAPI {
@Resource @Resource
@ -71,4 +71,19 @@ public class RepairOrderAPI {
repairOrderInfoService.appraiseOrder(respVO); repairOrderInfoService.appraiseOrder(respVO);
return CommonResult.ok(); return CommonResult.ok();
} }
/**
* 获得已经评价的订单
*
* @author 小李
* @date 15:50 2024/9/24
* @param pageNo 页码
* @param pageSize 条数
**/
@GetMapping("/getAppraise")
@Operation(summary = "获得已经评价的订单")
public CommonResult<?> getAppraisePage(@RequestParam(value = "pageNo", defaultValue = "1")Integer pageNo,@RequestParam(value = "pageSize",defaultValue = "1")Integer pageSize){
Page<RepairOrderInfo> page = new Page<>(pageNo, pageSize);
return success(repairOrderInfoService.getAppraisePage(page));
}
} }

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.app.tickets.admin; package cn.iocoder.yudao.module.app.tickets.controller;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService; import cn.iocoder.yudao.module.tickets.service.DlRepairTicketsService;
@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
* @date 18:21 2024/9/13 * @date 18:21 2024/9/13
**/ **/
@RestController @RestController
@RequestMapping("/api/repair/tickets") @RequestMapping("/userClient/repair/tickets")
public class TicketsAPI { public class TicketsAPI {
/** /**

View File

@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -87,5 +88,13 @@ public class DlRepairBookingController {
public CommonResult<?> getBookingById(@RequestParam("id") String id){ public CommonResult<?> getBookingById(@RequestParam("id") String id){
return success(dlRepairBookingService.getBookingById(id)); return success(dlRepairBookingService.getBookingById(id));
} }
@GetMapping("/list")
@Operation(summary = "维修预约表 不分页")
public CommonResult<?> getBookingList(@RequestParam("userId")Integer userId){
return success(dlRepairBookingService.list(new LambdaQueryWrapper<DlRepairBooking>()
.eq(DlRepairBooking::getUserId,userId)
.orderByDesc(DlRepairBooking::getBookingTime)));
}
} }

View File

@ -63,8 +63,8 @@ public class DlRepairBooking extends TenantBaseDO {
/** /**
* 预约时间 * 预约时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss")
private Date bookingTime; private Date bookingTime;
/** /**

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.booking.service; package cn.iocoder.yudao.module.booking.service;
import cn.iocoder.yudao.module.app.booking.vo.BookingQueryVO;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
@ -7,6 +8,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* 针对表dl_repair_booking(维修预约表)的数据库操作Service * 针对表dl_repair_booking(维修预约表)的数据库操作Service
* *
@ -50,4 +53,13 @@ public interface DlRepairBookingService extends IService<DlRepairBooking> {
* @param id id * @param id id
**/ **/
DlRepairBooking getBookingById(String id); DlRepairBooking getBookingById(String id);
/**
* 维修预约表 映射
*
* @author 小李
* @date 13:32 2024/9/24
* @param ids 预约记录ID
**/
List<BookingQueryVO> getBookingMap(List<String> ids);
} }

View File

@ -1,16 +1,29 @@
package cn.iocoder.yudao.module.booking.service.impl; package cn.iocoder.yudao.module.booking.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.app.booking.vo.BookingQueryVO;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.mapper.DlRepairBookingMapper; import cn.iocoder.yudao.module.booking.mapper.DlRepairBookingMapper;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO;
import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingRespVO;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.company.service.CompanyService;
import cn.iocoder.yudao.module.system.api.service.ServicePackageApi;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception0;
/** /**
@ -23,6 +36,14 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMapper, DlRepairBooking> public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMapper, DlRepairBooking>
implements DlRepairBookingService { implements DlRepairBookingService {
@Resource
@Lazy
private CompanyService companyService;
@Resource
@Lazy
private ServicePackageApi servicePackageApi;
/** /**
* 维修预约表 新增修改 * 维修预约表 新增修改
* *
@ -56,6 +77,8 @@ public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMappe
**/ **/
@Override @Override
public IPage<DlRepairBooking> getBookingPage(DlRepairBookingReqVO repairBookingReqVO, Page<DlRepairBooking> page){ public IPage<DlRepairBooking> getBookingPage(DlRepairBookingReqVO repairBookingReqVO, Page<DlRepairBooking> page){
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
Optional.ofNullable(loginUserId).ifPresent(repairBookingReqVO::setUserId);
return baseMapper.getBookingPage(repairBookingReqVO, page); return baseMapper.getBookingPage(repairBookingReqVO, page);
} }
@ -70,6 +93,32 @@ public class DlRepairBookingServiceImpl extends ServiceImpl<DlRepairBookingMappe
public DlRepairBooking getBookingById(String id){ public DlRepairBooking getBookingById(String id){
return baseMapper.selectById(id); return baseMapper.selectById(id);
} }
/**
* 维修预约表 映射
*
* @author 小李
* @date 13:32 2024/9/24
* @param ids 预约记录ID
**/
@Override
public List<BookingQueryVO> getBookingMap(List<String> ids){
// 查预约记录
List<DlRepairBooking> dlRepairBookings = baseMapper.selectBatchIds(ids);
List<BookingQueryVO> result = dlRepairBookings.stream().map(item -> BeanUtil.toBean(item, BookingQueryVO.class)).collect(Collectors.toList());
// 查企业
Set<String> companyIds = result.stream().map(BookingQueryVO::getCorpId).collect(Collectors.toSet());
List<Company> companies = companyService.list(new LambdaQueryWrapper<Company>().in(Company::getId, companyIds));
// 查服务
Set<String> serviceIds = result.stream().map(BookingQueryVO::getProjectId).collect(Collectors.toSet());
List<ServicePackageDto> servicePackageByIds = servicePackageApi.getServicePackageByIds(new ArrayList<>(serviceIds));
// 映射
result.forEach(item -> {
companies.stream().filter(i -> i.getId().equals(item.getCorpId())).findFirst().ifPresent(item::setCompany);
servicePackageByIds.stream().filter(i -> i.getId().equals(item.getProjectId())).findFirst().ifPresent(item::setServicePackage);
});
return result.stream().sorted(Comparator.comparing(BookingQueryVO::getCreateTime).reversed()).collect(Collectors.toList());
}
} }

View File

@ -1,6 +1,9 @@
package cn.iocoder.yudao.module.booking.vo; package cn.iocoder.yudao.module.booking.vo;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking; import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.company.entity.Company;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.tickets.vo.DlRepairTicketsRespVO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;

View File

@ -5,6 +5,8 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.iocoder.yudao.common.RepairErrorCodeConstants; import cn.iocoder.yudao.common.RepairErrorCodeConstants;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.booking.entity.DlRepairBooking;
import cn.iocoder.yudao.module.booking.service.DlRepairBookingService;
import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO;
import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService;
@ -79,6 +81,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
@Lazy @Lazy
private RepairOrderInfoService repairOrderInfoService; private RepairOrderInfoService repairOrderInfoService;
@Resource
@Lazy
private DlRepairBookingService bookingService;
/** /**
* 维修工单表 新增 * 维修工单表 新增
* *
@ -147,7 +153,17 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl<DlRepairTicketsMappe
repairOrderInfo.setGoodsPrice(ticketsRespVO.getTotalPrice()); repairOrderInfo.setGoodsPrice(ticketsRespVO.getTotalPrice());
repairOrderInfo.setOrderTime(ticketsRespVO.getCreateTime()); repairOrderInfo.setOrderTime(ticketsRespVO.getCreateTime());
repairOrderInfo.setOrderStatus("0"); repairOrderInfo.setOrderStatus("0");
repairOrderInfo.setPayMoney(ticketsRespVO.getTotalPrice());
repairOrderInfo.setDeptId(Integer.parseInt(deptId + "")); repairOrderInfo.setDeptId(Integer.parseInt(deptId + ""));
// 如果选择了预约还要更新预约记录
if (ObjectUtil.isNotEmpty(ticketsRespVO.getBookingId())){
DlRepairBooking dlRepairBooking = new DlRepairBooking();
dlRepairBooking.setId(ticketsRespVO.getBookingId());
dlRepairBooking.setTicketsId(ticketsRespVO.getId());
dlRepairBooking.setBookingStatus("02");
bookingService.updateById(dlRepairBooking);
}
repairOrderInfoService.saveOrderInfo(repairOrderInfo); repairOrderInfoService.saveOrderInfo(repairOrderInfo);
} }

View File

@ -19,4 +19,7 @@ public class DlRepairTicketsRespVO extends DlRepairTickets {
/** 上面有地方在用,只能新用一个了,子表数组 */ /** 上面有地方在用,只能新用一个了,子表数组 */
private List<DlRepairTitemReqVO> items; private List<DlRepairTitemReqVO> items;
/** 预约记录ID */
private String bookingId;
} }

View File

@ -45,8 +45,8 @@
and (drb.booking_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}) and (drb.booking_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]})
</if> </if>
<if test="map.carNo != null and map.carNo != ''"> <if test="map.carNo != null and map.carNo != ''">
and drp.car_no = #{map.carNo} and drb.car_no = #{map.carNo}
</if> </if>
order by drp_create_time desc order by drb.create_time desc
</select> </select>
</mapper> </mapper>

View File

@ -0,0 +1,24 @@
package cn.iocoder.yudao.module.system.api.service;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import java.util.List;
/**
* 查租户服务的
*
* @author 小李
* @date 10:33 2024/9/24
**/
public interface ServicePackageApi {
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
List<ServicePackageDto> getServicePackageByIds(List<String> ids);
}

View File

@ -0,0 +1,23 @@
package cn.iocoder.yudao.module.system.api.service.dto;
import lombok.Data;
/**
* 查租户服务的
*
* @author 小李
* @date 10:36 2024/9/24
**/
@Data
public class ServicePackageDto {
/** 套餐编号 */
private String id;
/** 套餐名 */
private String name;
/** 备注 */
private String remark;
}

View File

@ -22,5 +22,4 @@ public interface TenantApi {
* @param id 租户编号 * @param id 租户编号
*/ */
void validateTenant(Long id); void validateTenant(Long id);
} }

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.system.api.service;
import cn.hutool.core.bean.BeanUtil;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO;
import cn.iocoder.yudao.module.system.service.service.ServicePackageService;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* 查租户服务的接口实现
*
* @author 小李
* @date 10:39 2024/9/24
**/
@Service
public class ServicePackageApiImpl implements ServicePackageApi{
@Resource
@Lazy
private ServicePackageService servicePackageService;
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
@Override
public List<ServicePackageDto> getServicePackageByIds(List<String> ids) {
List<ServicePackageDO> servicePackageByIds = servicePackageService.getServicePackageByIds(ids);
return servicePackageByIds.stream().map(item -> BeanUtil.toBean(item, ServicePackageDto.class)).collect(Collectors.toList());
}
}

View File

@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.system.service.service;
import java.util.*; import java.util.*;
import javax.validation.*; import javax.validation.*;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.controller.admin.service.vo.*; import cn.iocoder.yudao.module.system.controller.admin.service.vo.*;
import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO; import cn.iocoder.yudao.module.system.dal.dataobject.service.ServicePackageDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
@ -67,4 +69,13 @@ public interface ServicePackageService {
* @return 服务套餐 * @return 服务套餐
*/ */
List<ServicePackageDO> getServicePackageListByStatus(Integer status); List<ServicePackageDO> getServicePackageListByStatus(Integer status);
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
List<ServicePackageDO> getServicePackageByIds(List<String> ids);
} }

View File

@ -3,7 +3,9 @@ package cn.iocoder.yudao.module.system.service.service;
import cn.iocoder.yudao.framework.common.config.CommonStr; import cn.iocoder.yudao.framework.common.config.CommonStr;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule; import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils; import cn.iocoder.yudao.framework.tenant.core.util.TenantUtils;
import cn.iocoder.yudao.module.system.api.service.dto.ServicePackageDto;
import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO; import cn.iocoder.yudao.module.system.controller.admin.permission.vo.role.RoleSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantDO;
import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO; import cn.iocoder.yudao.module.system.dal.dataobject.tenant.TenantPackageDO;
@ -142,4 +144,15 @@ public class ServicePackageServiceImpl implements ServicePackageService {
return servicePackageMapper.selectListByStatus(status); return servicePackageMapper.selectListByStatus(status);
} }
/**
* 查租户服务的详情通过id
*
* @author 小李
* @date 10:37 2024/9/24
* @param ids ids
**/
@Override
public List<ServicePackageDO> getServicePackageByIds(List<String> ids){
return servicePackageMapper.selectList(new LambdaQueryWrapperX<ServicePackageDO>().in(ServicePackageDO::getId, ids));
}
} }