From 2d111bd7b1c95f1d8ec1ec3c28ed6c2d2f8eb5b6 Mon Sep 17 00:00:00 2001 From: zhaotianfeng <12345678> Date: Tue, 24 Sep 2024 19:50:08 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=BD=A6=E8=BE=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../car/controller/AppCarBrandController.java | 32 ++++++++++++ .../car/controller/AppCarMainController.java | 5 +- .../car/controller/AppCarModelController.java | 52 ------------------- .../module/app/car/entity/AppCarMain.java | 6 +-- .../app/car/mapper/AppCarMainMapper.java | 3 +- .../app/car/service/AppCarMainService.java | 3 +- .../service/impl/AppCarMainServiceImpl.java | 5 +- .../module/app/car/vo/AppCarMainResVo.java | 13 +++++ 8 files changed, 56 insertions(+), 63 deletions(-) create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarBrandController.java delete mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarModelController.java create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/vo/AppCarMainResVo.java diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarBrandController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarBrandController.java new file mode 100644 index 00000000..31c42fa7 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarBrandController.java @@ -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> getCarBrandList() { + List carBrandList = carBrandService.getCarBrandList(); + return success(carBrandList); + } + + +} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarMainController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarMainController.java index 37874f74..fd37be12 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarMainController.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarMainController.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.app.car.controller; import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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.vo.AppCarMainResVo; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -71,9 +72,9 @@ public class AppCarMainController { @GetMapping("/get") @Operation(summary = "获得车辆信息") // @PreAuthorize("@ss.hasPermission('base:car-main:query')") - public CommonResult> getCarMain() { + public CommonResult> getCarMain() { - List carMain = carMainService.getCarMain(); + List carMain = carMainService.getCarMain(); return CommonResult.success(carMain); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarModelController.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarModelController.java deleted file mode 100644 index 40c7320c..00000000 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/controller/AppCarModelController.java +++ /dev/null @@ -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> getList() { - List carModelList = carModelService.getCarModelList(); - return success(carModelList); - } - - - -} \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/entity/AppCarMain.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/entity/AppCarMain.java index 51fdd255..84d76465 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/entity/AppCarMain.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/entity/AppCarMain.java @@ -7,13 +7,9 @@ import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; -import org.springframework.format.annotation.DateTimeFormat; - import java.math.BigDecimal; -import java.time.LocalDateTime; import java.util.Date; -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY; /** * 车辆信息 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; /** * 行驶证图片 diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/mapper/AppCarMainMapper.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/mapper/AppCarMainMapper.java index 3a0c852e..e75552bc 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/mapper/AppCarMainMapper.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/mapper/AppCarMainMapper.java @@ -1,6 +1,7 @@ package cn.iocoder.yudao.module.app.car.mapper; 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 org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -12,6 +13,6 @@ public interface AppCarMainMapper extends BaseMapper { // 查询当前用户的所有车辆 - List getUserCarMain(@Param("userId") Long userId); + List getUserCarMain(@Param("userId") Long userId); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/AppCarMainService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/AppCarMainService.java index 50f23cb4..069e9cf3 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/AppCarMainService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/AppCarMainService.java @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.app.car.service; import cn.iocoder.yudao.framework.common.pojo.CommonResult; 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 com.baomidou.mybatisplus.extension.service.IService; @@ -41,7 +42,7 @@ public interface AppCarMainService extends IService { * * @return 车辆信息 */ - List getCarMain(); + List getCarMain(); diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/impl/AppCarMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/impl/AppCarMainServiceImpl.java index 84204cf1..767847ac 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/impl/AppCarMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/service/impl/AppCarMainServiceImpl.java @@ -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.mapper.AppCarMainMapper; 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.CustomerMain; import cn.iocoder.yudao.module.custom.mapper.CustomerCarMapper; @@ -99,9 +100,9 @@ public class AppCarMainServiceImpl extends ServiceImpl getCarMain() { + public List getCarMain() { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); - List userCarMain = super.baseMapper.getUserCarMain(loginUser.getId()); + List userCarMain = super.baseMapper.getUserCarMain(loginUser.getId()); return userCarMain; diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/vo/AppCarMainResVo.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/vo/AppCarMainResVo.java new file mode 100644 index 00000000..096fa623 --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/car/vo/AppCarMainResVo.java @@ -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; +} From 753d0f52002caa3d2ff6f6b3b9af96ad6a325c45 Mon Sep 17 00:00:00 2001 From: zhaotianfeng <12345678> Date: Tue, 24 Sep 2024 19:54:03 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/custom/service/CarBrandService.java | 4 ++++ .../module/custom/service/impl/CarBrandServiceImpl.java | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarBrandService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarBrandService.java index 819e5a5a..e41f01db 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarBrandService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/CarBrandService.java @@ -8,6 +8,8 @@ import cn.iocoder.yudao.module.custom.vo.CarBrandRespVO; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * 车辆品牌维护 Service 接口 * @@ -53,4 +55,6 @@ public interface CarBrandService extends IService { */ IPage getCarBrandPage(CarBrandReqVO pageReqVO); + List getCarBrandList(); + } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java index 4cb46d9e..6a479c4d 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CarBrandServiceImpl.java @@ -12,6 +12,7 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import java.util.List; import java.util.UUID; /** @@ -86,4 +87,9 @@ public class CarBrandServiceImpl extends ServiceImpl i return baseMapper.findPage(page,pageReqVO); } + @Override + public List getCarBrandList() { + return baseMapper.selectList(null); + } + } \ No newline at end of file From 8a2bf03a20319c1aacfa535eb130006c0f0c3a52 Mon Sep 17 00:00:00 2001 From: zhaotianfeng <12345678> Date: Tue, 24 Sep 2024 20:05:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E8=A1=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/car/AppCarMainMapper.xml | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/dl-module-base/src/main/resources/mapper/car/AppCarMainMapper.xml b/dl-module-base/src/main/resources/mapper/car/AppCarMainMapper.xml index 9ecbb1a6..f9aa9664 100644 --- a/dl-module-base/src/main/resources/mapper/car/AppCarMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/car/AppCarMainMapper.xml @@ -3,13 +3,19 @@ - - select main.* from base_customer_car car INNER JOIN base_car_main main on car.car_id = main.id - where car.cus_id = ( - select id from base_customer_main - where user_id = #{userId} - and deleted = 0 - ) and main.deleted = 0 + SELECT main.*, brand.brand_name as brandName, brand.logo_img as logoImg + from (select main.* + from base_customer_car car + INNER JOIN base_car_main main on car.car_id = main.id + where car.cus_id = ( + 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 \ No newline at end of file From 33d9ba5ecccccdaa0d5b69cd3045684713099df4 Mon Sep 17 00:00:00 2001 From: xiao-fajia <1665375861@qq.com> Date: Tue, 24 Sep 2024 20:54:24 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{admin => controller}/CompanyAPI.java | 16 +++++- .../app/company/vo/CompanyToServerVO.java | 19 +++++++ .../{admin => controller}/BaseTypeAPI.java | 4 +- .../company/service/CompanyService.java | 10 ++++ .../service/impl/CompanyServiceImpl.java | 31 ++++++++++-- .../service/impl/BaseTypeServiceImpl.java | 1 + .../order/service/RepairOrderInfoService.java | 8 ++- .../impl/RepairOrderInfoServiceImpl.java | 22 +++++++++ .../order/vo/RepairOrderInfoRespVO.java | 3 +- .../mapper/baseType/BaseTypeMapper.xml | 2 +- .../mapper/company/CompanyMapper.xml | 9 ++-- .../mapper/order/RepairOrderInfoMapper.xml | 4 +- .../{admin => controller}/BookingAPI.java | 21 +++++++- .../module/app/booking/vo/BookingQueryVO.java | 23 +++++++++ .../{admin => controller}/RepairOrderAPI.java | 19 ++++++- .../{admin => controller}/TicketsAPI.java | 4 +- .../admin/DlRepairBookingController.java | 9 ++++ .../booking/entity/DlRepairBooking.java | 4 +- .../service/DlRepairBookingService.java | 12 +++++ .../impl/DlRepairBookingServiceImpl.java | 49 +++++++++++++++++++ .../booking/vo/DlRepairBookingReqVO.java | 3 ++ .../impl/DlRepairTicketsServiceImpl.java | 16 ++++++ .../tickets/vo/DlRepairTicketsRespVO.java | 3 ++ .../mapper/booking/DlRepairBookingMapper.xml | 4 +- .../system/api/service/ServicePackageApi.java | 24 +++++++++ .../api/service/dto/ServicePackageDto.java | 23 +++++++++ .../module/system/api/tenant/TenantApi.java | 1 - .../api/service/ServicePackageApiImpl.java | 39 +++++++++++++++ .../service/ServicePackageService.java | 11 +++++ .../service/ServicePackageServiceImpl.java | 13 +++++ 30 files changed, 378 insertions(+), 29 deletions(-) rename dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/{admin => controller}/CompanyAPI.java (79%) create mode 100644 dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/vo/CompanyToServerVO.java rename dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/{admin => controller}/BaseTypeAPI.java (92%) rename dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/{admin => controller}/BookingAPI.java (81%) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/vo/BookingQueryVO.java rename dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/{admin => controller}/RepairOrderAPI.java (76%) rename dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/{admin => controller}/TicketsAPI.java (92%) create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApi.java create mode 100644 yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/dto/ServicePackageDto.java create mode 100644 yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApiImpl.java diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/admin/CompanyAPI.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/controller/CompanyAPI.java similarity index 79% rename from dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/admin/CompanyAPI.java rename to dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/controller/CompanyAPI.java index c017ca92..09549e56 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/admin/CompanyAPI.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/controller/CompanyAPI.java @@ -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.module.company.entity.Company; @@ -24,7 +24,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * @date 14:04 2024/9/23 **/ @RestController -@RequestMapping("/api/base/company") +@RequestMapping("/userClient/base/company") @Tag(name = "API - BASE 企业管理") @Validated public class CompanyAPI { @@ -50,4 +50,16 @@ public class CompanyAPI { 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)); + } } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/vo/CompanyToServerVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/vo/CompanyToServerVO.java new file mode 100644 index 00000000..4aba414e --- /dev/null +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/company/vo/CompanyToServerVO.java @@ -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 servicePackages; +} diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/admin/BaseTypeAPI.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/controller/BaseTypeAPI.java similarity index 92% rename from dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/admin/BaseTypeAPI.java rename to dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/controller/BaseTypeAPI.java index 327264f0..bca2b7bb 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/admin/BaseTypeAPI.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/conf/controller/BaseTypeAPI.java @@ -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.module.conf.entity.BaseType; @@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * @date 14:21 2024/9/23 **/ @RestController -@RequestMapping("/api/base/type") +@RequestMapping("/userClient/base/type") public class BaseTypeAPI { @Resource diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyService.java index 96dbcb80..5c800903 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/CompanyService.java @@ -1,5 +1,6 @@ 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.vo.CompanyReqVO; import cn.iocoder.yudao.module.company.vo.CompanyRespVO; @@ -67,4 +68,13 @@ public interface CompanyService extends IService { * @param company 企业对象,主要是serverCodes **/ IPage getCompanyPageByServer(Company company, Page page); + + /** + * 查企业能提供的业务 + * + * @author 小李 + * @date 10:21 2024/9/24 + * @param id 企业ID + **/ + CompanyToServerVO getCompanyServerById(String id); } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java index 758fe40a..b5daf525 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/company/service/impl/CompanyServiceImpl.java @@ -1,15 +1,19 @@ package cn.iocoder.yudao.module.company.service.impl; +import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.exception.ErrorCode; 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.vo.CompanyRespVO; 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.permission.PermissionApi; 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.dto.AdminUserRespDTO; 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 java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; import static cn.iocoder.yudao.framework.common.config.CommonStr.USER_TYPE_STAFF; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; @@ -53,6 +54,9 @@ public class CompanyServiceImpl extends ServiceImpl impl private PermissionApi permissionApi; @Resource private DeptApi deptApi; + @Resource + @Lazy + private ServicePackageApi servicePackageApi; /** @@ -182,4 +186,23 @@ public class CompanyServiceImpl extends ServiceImpl impl public IPage getCompanyPageByServer(Company company, Page 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 services = Arrays.asList(company.getServiceCodes().split(",")); + List servicePackageByIds = servicePackageApi.getServicePackageByIds(services); + Optional.ofNullable(servicePackageByIds).ifPresent(result::setServicePackages); + return result; + } } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java index 15c6453a..4e132ef8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/conf/service/impl/BaseTypeServiceImpl.java @@ -146,6 +146,7 @@ public class BaseTypeServiceImpl extends ServiceImpl i * @date 14:29 2024/9/23 * @param baseType 查询条件 **/ + @Deprecated // 写错了,先弃用 @Override public List getListByTypeAndCorpId(BaseType baseType){ return baseTypeMapper.getListByTypeAndCorpId(baseType); diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java index 2c895981..fcf746b8 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/RepairOrderInfoService.java @@ -113,5 +113,11 @@ public interface RepairOrderInfoService extends IService { */ Map payTransactions(String orderId); - + /** + * 获得已经评价的订单 + * + * @author 小李 + * @date 15:50 2024/9/24 + **/ + IPage getAppraisePage(Page page); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java index 42562e9c..43fc1362 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/service/impl/RepairOrderInfoServiceImpl.java @@ -4,6 +4,8 @@ import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.util.object.BeanUtils; 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.order.entity.RepairOrderInfo; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; @@ -28,7 +30,10 @@ import javax.annotation.Resource; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.HashMap; +import java.util.List; 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.ORDER_HYCZ; @@ -141,6 +146,8 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl getOrderPageByStatus(RepairOrderInfoRespVO respVO, Page page){ + Long loginUserId = SecurityFrameworkUtils.getLoginUserId(); + Optional.ofNullable(loginUserId).ifPresent(respVO::setUserId); return baseMapper.getOrderPageByStatus(respVO, page); } @@ -206,4 +213,19 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl>(){}); } + /** + * 获得已经评价的订单 + * + * @author 小李 + * @date 15:50 2024/9/24 + **/ + @Override + public IPage getAppraisePage(Page page){ + // 查订单 + Long loginUserId = SecurityFrameworkUtils.getLoginUserId(); + return baseMapper.selectPage(page, new LambdaQueryWrapper().and(item -> { + item.eq(RepairOrderInfo::getUserId, loginUserId) + .isNotNull(RepairOrderInfo::getCommentDesc); + })); + } } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderInfoRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderInfoRespVO.java index 4175c1f3..94280d00 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderInfoRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/order/vo/RepairOrderInfoRespVO.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.order.vo; +import cn.iocoder.yudao.module.company.entity.Company; import cn.iocoder.yudao.module.order.entity.RepairOrderInfo; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import io.swagger.v3.oas.annotations.media.Schema; @@ -13,8 +14,6 @@ public class RepairOrderInfoRespVO extends RepairOrderInfo { /** 订单状态(工单的状态) */ private String status; - //订单描述 private String description; - } diff --git a/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml b/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml index 6c33c9c3..d0e125e2 100644 --- a/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml +++ b/dl-module-base/src/main/resources/mapper/baseType/BaseTypeMapper.xml @@ -43,7 +43,7 @@ and dbt.type = #{map.type} - and dbt.corp_id = #{map.corpId} + and find_in_set(#{map.corpId}, dbt.corp_id) > 0 \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/company/CompanyMapper.xml b/dl-module-base/src/main/resources/mapper/company/CompanyMapper.xml index 4ff031a5..1a66457e 100644 --- a/dl-module-base/src/main/resources/mapper/company/CompanyMapper.xml +++ b/dl-module-base/src/main/resources/mapper/company/CompanyMapper.xml @@ -35,7 +35,7 @@ - + \ No newline at end of file diff --git a/dl-module-base/src/main/resources/mapper/order/RepairOrderInfoMapper.xml b/dl-module-base/src/main/resources/mapper/order/RepairOrderInfoMapper.xml index eceefe24..60ece770 100644 --- a/dl-module-base/src/main/resources/mapper/order/RepairOrderInfoMapper.xml +++ b/dl-module-base/src/main/resources/mapper/order/RepairOrderInfoMapper.xml @@ -44,10 +44,10 @@ - drt.tickets_work_status = #{map.status} + and drt.tickets_work_status = #{map.status} - roi.comment_time is null + and roi.comment_time is null and roi.order_status = '1' diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/admin/BookingAPI.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/controller/BookingAPI.java similarity index 81% rename from dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/admin/BookingAPI.java rename to dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/controller/BookingAPI.java index 286b77ea..abaaba60 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/admin/BookingAPI.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/controller/BookingAPI.java @@ -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.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.booking.vo.DlRepairBookingReqVO; 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 io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; + 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 **/ @RestController -@RequestMapping("/api/repair/booking") +@RequestMapping("/userClient/repair/booking") public class BookingAPI { /** @@ -88,4 +92,17 @@ public class BookingAPI { public CommonResult getBookingById(@RequestParam("id") String 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 ids){ + return success(dlRepairBookingService.getBookingMap(ids)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/vo/BookingQueryVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/vo/BookingQueryVO.java new file mode 100644 index 00000000..27652164 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/booking/vo/BookingQueryVO.java @@ -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; +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/admin/RepairOrderAPI.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/controller/RepairOrderAPI.java similarity index 76% rename from dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/admin/RepairOrderAPI.java rename to dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/controller/RepairOrderAPI.java index bd10b76d..1369e795 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/admin/RepairOrderAPI.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/order/controller/RepairOrderAPI.java @@ -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.module.order.entity.RepairOrderInfo; @@ -20,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * @date 17:20 2024/9/23 **/ @RestController -@RequestMapping("/api/repair/order") +@RequestMapping("/userClient/repair/order") public class RepairOrderAPI { @Resource @@ -71,4 +71,19 @@ public class RepairOrderAPI { repairOrderInfoService.appraiseOrder(respVO); 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 page = new Page<>(pageNo, pageSize); + return success(repairOrderInfoService.getAppraisePage(page)); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/admin/TicketsAPI.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/controller/TicketsAPI.java similarity index 92% rename from dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/admin/TicketsAPI.java rename to dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/controller/TicketsAPI.java index ccf7f855..f0c04d3b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/admin/TicketsAPI.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/tickets/controller/TicketsAPI.java @@ -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.module.tickets.service.DlRepairTicketsService; @@ -18,7 +18,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; * @date 18:21 2024/9/13 **/ @RestController -@RequestMapping("/api/repair/tickets") +@RequestMapping("/userClient/repair/tickets") public class TicketsAPI { /** diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java index 20e548f6..bba5bfef 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/controller/admin/DlRepairBookingController.java @@ -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.vo.DlRepairBookingReqVO; 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 io.swagger.v3.oas.annotations.Operation; import org.springframework.web.bind.annotation.*; @@ -87,5 +88,13 @@ public class DlRepairBookingController { public CommonResult getBookingById(@RequestParam("id") String id){ return success(dlRepairBookingService.getBookingById(id)); } + + @GetMapping("/list") + @Operation(summary = "维修预约表 不分页") + public CommonResult getBookingList(@RequestParam("userId")Integer userId){ + return success(dlRepairBookingService.list(new LambdaQueryWrapper() + .eq(DlRepairBooking::getUserId,userId) + .orderByDesc(DlRepairBooking::getBookingTime))); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java index bb19edef..6d37c076 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/entity/DlRepairBooking.java @@ -63,8 +63,8 @@ public class DlRepairBooking extends TenantBaseDO { /** * 预约时间 */ - @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") - @DateTimeFormat(pattern="yyyy-MM-dd") + @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern="yyyy-MM-dd hh:mm:ss") private Date bookingTime; /** diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java index f9c312d2..9b9e88d9 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/DlRepairBookingService.java @@ -1,5 +1,6 @@ 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.vo.DlRepairBookingReqVO; 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.service.IService; +import java.util.List; + /** * 针对表【dl_repair_booking(维修预约表)】的数据库操作Service * @@ -50,4 +53,13 @@ public interface DlRepairBookingService extends IService { * @param id id **/ DlRepairBooking getBookingById(String id); + + /** + * 维修预约表 映射 + * + * @author 小李 + * @date 13:32 2024/9/24 + * @param ids 预约记录ID + **/ + List getBookingMap(List ids); } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java index 28abc464..eb5fcf6e 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/service/impl/DlRepairBookingServiceImpl.java @@ -1,16 +1,29 @@ package cn.iocoder.yudao.module.booking.service.impl; +import cn.hutool.core.bean.BeanUtil; 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.mapper.DlRepairBookingMapper; import cn.iocoder.yudao.module.booking.service.DlRepairBookingService; import cn.iocoder.yudao.module.booking.vo.DlRepairBookingReqVO; 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.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.context.annotation.Lazy; 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; /** @@ -23,6 +36,14 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU public class DlRepairBookingServiceImpl extends ServiceImpl implements DlRepairBookingService { + @Resource + @Lazy + private CompanyService companyService; + + @Resource + @Lazy + private ServicePackageApi servicePackageApi; + /** * 维修预约表 新增、修改 * @@ -56,6 +77,8 @@ public class DlRepairBookingServiceImpl extends ServiceImpl getBookingPage(DlRepairBookingReqVO repairBookingReqVO, Page page){ + Long loginUserId = SecurityFrameworkUtils.getLoginUserId(); + Optional.ofNullable(loginUserId).ifPresent(repairBookingReqVO::setUserId); return baseMapper.getBookingPage(repairBookingReqVO, page); } @@ -70,6 +93,32 @@ public class DlRepairBookingServiceImpl extends ServiceImpl getBookingMap(List ids){ + // 查预约记录 + List dlRepairBookings = baseMapper.selectBatchIds(ids); + List result = dlRepairBookings.stream().map(item -> BeanUtil.toBean(item, BookingQueryVO.class)).collect(Collectors.toList()); + // 查企业 + Set companyIds = result.stream().map(BookingQueryVO::getCorpId).collect(Collectors.toSet()); + List companies = companyService.list(new LambdaQueryWrapper().in(Company::getId, companyIds)); + // 查服务 + Set serviceIds = result.stream().map(BookingQueryVO::getProjectId).collect(Collectors.toSet()); + List 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()); + } } diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java index 4d42ff78..19f90fa1 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/booking/vo/DlRepairBookingReqVO.java @@ -1,6 +1,9 @@ package cn.iocoder.yudao.module.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 io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java index 3f8ef6c2..25a34c2b 100644 --- a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/tickets/service/impl/DlRepairTicketsServiceImpl.java @@ -5,6 +5,8 @@ import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.ObjectUtil; import cn.iocoder.yudao.common.RepairErrorCodeConstants; 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.vo.CustomerMainRespVO; import cn.iocoder.yudao.module.order.service.RepairOrderInfoService; @@ -79,6 +81,10 @@ public class DlRepairTicketsServiceImpl extends ServiceImpl items; + + /** 预约记录ID */ + private String bookingId; } diff --git a/dl-module-repair/src/main/resources/mapper/booking/DlRepairBookingMapper.xml b/dl-module-repair/src/main/resources/mapper/booking/DlRepairBookingMapper.xml index 6db58a38..0c2c5328 100644 --- a/dl-module-repair/src/main/resources/mapper/booking/DlRepairBookingMapper.xml +++ b/dl-module-repair/src/main/resources/mapper/booking/DlRepairBookingMapper.xml @@ -45,8 +45,8 @@ and (drb.booking_time between #{map.searchTimeArray[0]} and #{map.searchTimeArray[1]}) - and drp.car_no = #{map.carNo} + and drb.car_no = #{map.carNo} - order by drp_create_time desc + order by drb.create_time desc diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApi.java new file mode 100644 index 00000000..813a1bdd --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApi.java @@ -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 getServicePackageByIds(List ids); +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/dto/ServicePackageDto.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/dto/ServicePackageDto.java new file mode 100644 index 00000000..ef4867cc --- /dev/null +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/service/dto/ServicePackageDto.java @@ -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; +} diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java index 1fad83ed..1b062a43 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/tenant/TenantApi.java @@ -22,5 +22,4 @@ public interface TenantApi { * @param id 租户编号 */ void validateTenant(Long id); - } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApiImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApiImpl.java new file mode 100644 index 00000000..e1facaec --- /dev/null +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/service/ServicePackageApiImpl.java @@ -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 getServicePackageByIds(List ids) { + List servicePackageByIds = servicePackageService.getServicePackageByIds(ids); + return servicePackageByIds.stream().map(item -> BeanUtil.toBean(item, ServicePackageDto.class)).collect(Collectors.toList()); + } +} diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java index b755f158..5edda829 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageService.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.system.service.service; import java.util.*; 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.dal.dataobject.service.ServicePackageDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -67,4 +69,13 @@ public interface ServicePackageService { * @return 服务套餐 */ List getServicePackageListByStatus(Integer status); + + /** + * 查租户服务的详情通过id + * + * @author 小李 + * @date 10:37 2024/9/24 + * @param ids ids + **/ + List getServicePackageByIds(List ids); } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java index 1696916c..2a2085a0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/service/ServicePackageServiceImpl.java @@ -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.enums.CommonStatusEnum; 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.module.system.api.service.dto.ServicePackageDto; 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.TenantPackageDO; @@ -142,4 +144,15 @@ public class ServicePackageServiceImpl implements ServicePackageService { return servicePackageMapper.selectListByStatus(status); } + /** + * 查租户服务的详情通过id + * + * @author 小李 + * @date 10:37 2024/9/24 + * @param ids ids + **/ + @Override + public List getServicePackageByIds(List ids){ + return servicePackageMapper.selectList(new LambdaQueryWrapperX().in(ServicePackageDO::getId, ids)); + } } \ No newline at end of file